From 6c7925e5da38a31c329b872a5a2d92253eaf97f0 Mon Sep 17 00:00:00 2001 From: yoshi-code-bot <70984784+yoshi-code-bot@users.noreply.github.com> Date: Tue, 22 Jun 2021 18:09:29 -0700 Subject: [PATCH 01/50] chore: release spanner 1.21.0 (#4284) --- spanner/CHANGES.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/spanner/CHANGES.md b/spanner/CHANGES.md index c54c4915a31..c94a9da05fa 100644 --- a/spanner/CHANGES.md +++ b/spanner/CHANGES.md @@ -1,5 +1,12 @@ # Changes +## [1.21.0](https://www.github.com/googleapis/google-cloud-go/compare/spanner/v1.20.0...spanner/v1.21.0) (2021-06-23) + + +### Miscellaneous Chores + +* **spanner:** trigger a release for low cost instance ([#4264](https://www.github.com/googleapis/google-cloud-go/issues/4264)) ([24c4451](https://www.github.com/googleapis/google-cloud-go/commit/24c4451404cdf4a83cc7a35ee1911d654d2ba132)) + ## [1.20.0](https://www.github.com/googleapis/google-cloud-go/compare/spanner/v1.19.0...spanner/v1.20.0) (2021-06-08) From 564102b335dbfb558bec8af883e5f898efb5dd10 Mon Sep 17 00:00:00 2001 From: Chris Cotter Date: Wed, 23 Jun 2021 00:02:47 -0400 Subject: [PATCH 02/50] fix(storage): try to reopen for failed Reads (#4226) Errors from reading the response body in Reader.Read will now always trigger a reopen() call (unless the context has been canceled). Previously, this was limited to only INTERNAL_ERROR from HTTP/2. Fixes #3040 --- storage/integration_test.go | 48 +++++++++++++++++++++++++++++++++++++ storage/reader.go | 20 +++++++--------- storage/reader_test.go | 30 +++++++++++++++-------- 3 files changed, 77 insertions(+), 21 deletions(-) diff --git a/storage/integration_test.go b/storage/integration_test.go index 7faa31dbd3e..16fd736f486 100644 --- a/storage/integration_test.go +++ b/storage/integration_test.go @@ -3178,6 +3178,54 @@ func TestIntegration_ReaderAttrs(t *testing.T) { } } +// Test that context cancellation correctly stops a download before completion. +func TestIntegration_ReaderCancel(t *testing.T) { + ctx := context.Background() + client := testConfig(ctx, t) + defer client.Close() + + bkt := client.Bucket(bucketName) + + // Upload a 1MB object. + obj := bkt.Object("reader-cancel-obj") + w := obj.NewWriter(ctx) + c := randomContents() + for i := 0; i < 62500; i++ { + if _, err := w.Write(c); err != nil { + t.Fatalf("writer.Write: %v", err) + } + + } + w.Close() + + // Create a reader (which makes a GET request to GCS and opens the body to + // read the object) and then cancel the context before reading. + readerCtx, cancel := context.WithCancel(ctx) + r, err := obj.NewReader(readerCtx) + if err != nil { + t.Fatalf("obj.NewReader: %v", err) + } + defer r.Close() + + cancel() + + // Read the object 1KB a time. We cannot guarantee that Reads will return a + // context canceled error immediately, but they should always do so before we + // reach EOF. + var readErr error + for i := 0; i < 1000; i++ { + buf := make([]byte, 1000) + _, readErr = r.Read(buf) + if readErr != nil { + if readErr == context.Canceled { + return + } + break + } + } + t.Fatalf("Reader.Read: got %v, want context.Canceled", readErr) +} + // Ensures that a file stored with a: // * Content-Encoding of "gzip" // * Content-Type of "text/plain" diff --git a/storage/reader.go b/storage/reader.go index d64f5ec778c..94563c2afee 100644 --- a/storage/reader.go +++ b/storage/reader.go @@ -23,7 +23,6 @@ import ( "io/ioutil" "net/http" "net/url" - "reflect" "strconv" "strings" "time" @@ -135,6 +134,11 @@ func (o *ObjectHandle) NewRangeReader(ctx context.Context, offset, length int64) // Define a function that initiates a Read with offset and length, assuming we // have already read seen bytes. reopen := func(seen int64) (*http.Response, error) { + // If the context has already expired, return immediately without making a + // call. + if err := ctx.Err(); err != nil { + return nil, err + } start := offset + seen if length < 0 && start < 0 { req.Header.Set("Range", fmt.Sprintf("bytes=%d", start)) @@ -369,11 +373,12 @@ func (r *Reader) readWithRetry(p []byte) (int, error) { m, err := r.body.Read(p[n:]) n += m r.seen += int64(m) - if !shouldRetryRead(err) { + if err == nil || err == io.EOF { return n, err } - // Read failed, but we will try again. Send a ranged read request that takes - // into account the number of bytes we've already seen. + // Read failed (likely due to connection issues), but we will try to reopen + // the pipe and continue. Send a ranged read request that takes into account + // the number of bytes we've already seen. res, err := r.reopen(r.seen) if err != nil { // reopen already retries @@ -385,13 +390,6 @@ func (r *Reader) readWithRetry(p []byte) (int, error) { return n, nil } -func shouldRetryRead(err error) bool { - if err == nil { - return false - } - return strings.HasSuffix(err.Error(), "INTERNAL_ERROR") && strings.Contains(reflect.TypeOf(err).String(), "http2") -} - // Size returns the size of the object in bytes. // The returned value is always the same and is not affected by // calls to Read or Close. diff --git a/storage/reader_test.go b/storage/reader_test.go index 4b35f3c94c0..81c9a0c6d80 100644 --- a/storage/reader_test.go +++ b/storage/reader_test.go @@ -131,7 +131,8 @@ func (h http2Error) Error() string { } func TestRangeReaderRetry(t *testing.T) { - retryErr := http2Error("blah blah INTERNAL_ERROR") + internalErr := http2Error("blah blah INTERNAL_ERROR") + goawayErr := http2Error("http2: server sent GOAWAY and closed the connection; LastStreamID=15, ErrCode=NO_ERROR, debug=\"load_shed\"") readBytes := []byte(readData) hc, close := newTestServer(handleRangeRead) defer close() @@ -159,7 +160,7 @@ func TestRangeReaderRetry(t *testing.T) { offset: 0, length: -1, bodies: []fakeReadCloser{ - {data: readBytes, counts: []int{3}, err: retryErr}, + {data: readBytes, counts: []int{3}, err: internalErr}, {data: readBytes[3:], counts: []int{5, 2}, err: io.EOF}, }, want: readData, @@ -168,8 +169,8 @@ func TestRangeReaderRetry(t *testing.T) { offset: 0, length: -1, bodies: []fakeReadCloser{ - {data: readBytes, counts: []int{5}, err: retryErr}, - {data: readBytes[5:], counts: []int{1, 3}, err: retryErr}, + {data: readBytes, counts: []int{5}, err: internalErr}, + {data: readBytes[5:], counts: []int{1, 3}, err: goawayErr}, {data: readBytes[9:], counts: []int{1}, err: io.EOF}, }, want: readData, @@ -178,7 +179,16 @@ func TestRangeReaderRetry(t *testing.T) { offset: 0, length: 5, bodies: []fakeReadCloser{ - {data: readBytes, counts: []int{3}, err: retryErr}, + {data: readBytes, counts: []int{3}, err: internalErr}, + {data: readBytes[3:], counts: []int{2}, err: io.EOF}, + }, + want: readData[:5], + }, + { + offset: 0, + length: 5, + bodies: []fakeReadCloser{ + {data: readBytes, counts: []int{3}, err: goawayErr}, {data: readBytes[3:], counts: []int{2}, err: io.EOF}, }, want: readData[:5], @@ -187,7 +197,7 @@ func TestRangeReaderRetry(t *testing.T) { offset: 1, length: 5, bodies: []fakeReadCloser{ - {data: readBytes, counts: []int{3}, err: retryErr}, + {data: readBytes, counts: []int{3}, err: internalErr}, {data: readBytes[3:], counts: []int{2}, err: io.EOF}, }, want: readData[:5], @@ -196,7 +206,7 @@ func TestRangeReaderRetry(t *testing.T) { offset: 1, length: 3, bodies: []fakeReadCloser{ - {data: readBytes[1:], counts: []int{1}, err: retryErr}, + {data: readBytes[1:], counts: []int{1}, err: internalErr}, {data: readBytes[2:], counts: []int{2}, err: io.EOF}, }, want: readData[1:4], @@ -205,8 +215,8 @@ func TestRangeReaderRetry(t *testing.T) { offset: 4, length: -1, bodies: []fakeReadCloser{ - {data: readBytes[4:], counts: []int{1}, err: retryErr}, - {data: readBytes[5:], counts: []int{4}, err: retryErr}, + {data: readBytes[4:], counts: []int{1}, err: internalErr}, + {data: readBytes[5:], counts: []int{4}, err: internalErr}, {data: readBytes[9:], counts: []int{1}, err: io.EOF}, }, want: readData[4:], @@ -215,7 +225,7 @@ func TestRangeReaderRetry(t *testing.T) { offset: -4, length: -1, bodies: []fakeReadCloser{ - {data: readBytes[6:], counts: []int{1}, err: retryErr}, + {data: readBytes[6:], counts: []int{1}, err: internalErr}, {data: readBytes[7:], counts: []int{3}, err: io.EOF}, }, want: readData[6:], From 9bb82c3d5133af3832924d3a6615feca4c447a13 Mon Sep 17 00:00:00 2001 From: Carlo Alberto Ferraris Date: Wed, 23 Jun 2021 13:57:25 +0900 Subject: [PATCH 03/50] docs: clarify MaxIdle in SessionPoolConfig (#4304) Co-authored-by: Hengfeng Li --- spanner/session.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/spanner/session.go b/spanner/session.go index 49b046a6616..a41276026b6 100644 --- a/spanner/session.go +++ b/spanner/session.go @@ -404,7 +404,8 @@ type SessionPoolConfig struct { // Defaults to 100. MinOpened uint64 - // MaxIdle is the maximum number of idle sessions, pool is allowed to keep. + // MaxIdle is the maximum number of idle sessions that are allowed in the + // session pool. // // Defaults to 0. MaxIdle uint64 From 1e1f4e297c9ba93ab8d6f3da5df4c831b85b80dc Mon Sep 17 00:00:00 2001 From: Gregory Ledray Date: Thu, 24 Jun 2021 11:27:49 -0500 Subject: [PATCH 04/50] fix: return error from NewClient if projectID is not set (#4299) Co-authored-by: Christopher Wilcox --- firestore/client.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/firestore/client.go b/firestore/client.go index 8ee1071d283..1b4c4618672 100644 --- a/firestore/client.go +++ b/firestore/client.go @@ -60,6 +60,9 @@ type Client struct { // NewClient creates a new Firestore client that uses the given project. func NewClient(ctx context.Context, projectID string, opts ...option.ClientOption) (*Client, error) { + if projectID == "" { + return nil, errors.New("firestore: projectID was empty") + } var o []option.ClientOption // If this environment variable is defined, configure the client to talk to the emulator. if addr := os.Getenv("FIRESTORE_EMULATOR_HOST"); addr != "" { From 2f06416f405c6b5218283fde0d2b530366668f9a Mon Sep 17 00:00:00 2001 From: yoshi-code-bot <70984784+yoshi-code-bot@users.noreply.github.com> Date: Thu, 24 Jun 2021 10:32:17 -0700 Subject: [PATCH 05/50] chore: release pubsub 1.12.0 (#4266) :robot: I have created a release \*beep\* \*boop\* --- ## [1.12.0](https://www.github.com/googleapis/google-cloud-go/compare/pubsub/v1.11.0...pubsub/v1.12.0) (2021-06-23) ### Features * **pubsub/pstest:** add channel to support user-defined publish responses ([#4251](https://www.github.com/googleapis/google-cloud-go/issues/4251)) ([e1304f4](https://www.github.com/googleapis/google-cloud-go/commit/e1304f435fed4a767f4a652f32f1386979ff794f)) ### Bug Fixes * **pubsub:** fix memory leak issue in publish scheduler ([#4282](https://www.github.com/googleapis/google-cloud-go/issues/4282)) ([22ffc18](https://www.github.com/googleapis/google-cloud-go/commit/22ffc18e522c0f943db57f8c943e7356067bedfd)) This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- pubsub/CHANGES.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/pubsub/CHANGES.md b/pubsub/CHANGES.md index a625eaa0fcf..980d03596b9 100644 --- a/pubsub/CHANGES.md +++ b/pubsub/CHANGES.md @@ -1,5 +1,17 @@ # Changes +## [1.12.0](https://www.github.com/googleapis/google-cloud-go/compare/pubsub/v1.11.0...pubsub/v1.12.0) (2021-06-23) + + +### Features + +* **pubsub/pstest:** add channel to support user-defined publish responses ([#4251](https://www.github.com/googleapis/google-cloud-go/issues/4251)) ([e1304f4](https://www.github.com/googleapis/google-cloud-go/commit/e1304f435fed4a767f4a652f32f1386979ff794f)) + + +### Bug Fixes + +* **pubsub:** fix memory leak issue in publish scheduler ([#4282](https://www.github.com/googleapis/google-cloud-go/issues/4282)) ([22ffc18](https://www.github.com/googleapis/google-cloud-go/commit/22ffc18e522c0f943db57f8c943e7356067bedfd)) + ## [1.11.0](https://www.github.com/googleapis/google-cloud-go/compare/pubsub/v1.10.3...pubsub/v1.11.0) (2021-05-27) From 8805c8a302b16d3accae2a3f7cb1702405079c96 Mon Sep 17 00:00:00 2001 From: Cody Oss <6331106+codyoss@users.noreply.github.com> Date: Thu, 24 Jun 2021 13:38:26 -0500 Subject: [PATCH 06/50] chore(all): auto-regenerate gapics (#4311) * chore(all): auto-regenerate gapics This is an auto-generated regeneration of the gapic clients by cloud.google.com/go/internal/gapicgen. Once the corresponding genproto PR is submitted, genbot will update this PR with a newer dependency to the newer version of genproto and assign reviewers to this PR. If you have been assigned to review this PR, please: - Ensure that the version of genproto in go.mod has been updated. - Ensure that CI is passing. If it's failing, it requires your manual attention. - Approve and submit this PR if you believe it's ready to ship. Corresponding genproto PR: https://github.com/googleapis/go-genproto/pull/623 Changes: feat(servicedirectory): Update Service Directory v1beta1 protos to include VPC Network field, and create/modify timestamp fields. PiperOrigin-RevId: 381234166 Source-Link: https://github.com/googleapis/googleapis/commit/d69baf2e2d3c0071a117e64689c154f8dd46fb09 fix(servicecontrol): add dependency log_severity.proto Committer: @summerji PiperOrigin-RevId: 381179420 Source-Link: https://github.com/googleapis/googleapis/commit/8b976f7c6187f7f68956207b9a154bc278e11d7e feat(spanner): add JSON type PiperOrigin-RevId: 381156241 Source-Link: https://github.com/googleapis/googleapis/commit/fb5c4fbc1ded09e6958d6be7ca36a9221dc7e52f feat(asset): add new searchable fields (memberTypes, roles, project, folders and organization), new request fields (assetTypes and orderBy) and new response fields (assetType, folders and organization) in SearchAllIamPolicies PiperOrigin-RevId: 381145907 Source-Link: https://github.com/googleapis/googleapis/commit/5d301f95d17d50f78e0b2a6889301c180b947357 chore(resourcesettings): update resourcesettings build rules Committer: @neenushaji PiperOrigin-RevId: 380831596 Source-Link: https://github.com/googleapis/googleapis/commit/2c1d1b27646cba6f14b760b635f29fafc5a74ca6 build(clouddms): fix package name hint PiperOrigin-RevId: 380817131 Source-Link: https://github.com/googleapis/googleapis/commit/284d1ddb804986a80866166e69d3cd44e8e19a5d feat(documentai): update ReviewDocumentRequest to allow set priority and enable validation. PiperOrigin-RevId: 380732771 Source-Link: https://github.com/googleapis/googleapis/commit/87fc4d48c705e307a2427fcaf8f4f799ac3b8ca8 feat!(dialogflow/cx): mark agent.default_language_code as required feat: add return_partial response to Fulfillment docs: add notes to train agent before sending queries PiperOrigin-RevId: 380726996 Source-Link: https://github.com/googleapis/googleapis/commit/a5cec0a71095a75d83dafeaa4c3a62245042473a feat(pubsublite): Add SeekSubscription and Operations to API PiperOrigin-RevId: 380660182 Source-Link: https://github.com/googleapis/googleapis/commit/b601f026f724bbbd25f99273a3fd5e3c3cb8523c chore(gkeconnect/gateway): fix multi-version package names in grpc_service_config for gkeconnect Committer: @miraleung PiperOrigin-RevId: 380655273 Source-Link: https://github.com/googleapis/googleapis/commit/9250dff2c0fe684c42fdb2fb32027374be3256c0 docs(dialogflow): added notes to train agent prior to sending queries fix: added resource reference to agent_version PiperOrigin-RevId: 380595849 Source-Link: https://github.com/googleapis/googleapis/commit/5fe3c6322046ed5cfc41e6c41c7ebac54db589dd docs(dialogflow/cx): added notes to train agent before sending queries PiperOrigin-RevId: 380267079 Source-Link: https://github.com/googleapis/googleapis/commit/01bad53fe00ac2435ff550047770e88f87c969cb chore(gkeconnect/gateway): Update gkeconnect/gateway v1beta1 BUILD.bazel for python PiperOrigin-RevId: 380077711 Source-Link: https://github.com/googleapis/googleapis/commit/9d8dbc0dc647efd8b625178d37b0949d3f08adcb chore(resourcemanager): remove protoc-gen-docs_plugin from WORKSPACE PiperOrigin-RevId: 380020641 Source-Link: https://github.com/googleapis/googleapis/commit/cb44b173bae6999533c64b2df1249d1bf1f59129 * update deps --- .../apiv1/access_approval_client.go | 2 +- accessapproval/apiv1/doc.go | 2 +- accessapproval/apiv1/gapic_metadata.json | 50 +- aiplatform/apiv1/dataset_client.go | 2 +- aiplatform/apiv1/doc.go | 2 +- aiplatform/apiv1/endpoint_client.go | 2 +- aiplatform/apiv1/gapic_metadata.json | 332 +++++------ aiplatform/apiv1/job_client.go | 2 +- aiplatform/apiv1/migration_client.go | 2 +- aiplatform/apiv1/model_client.go | 2 +- aiplatform/apiv1/pipeline_client.go | 2 +- aiplatform/apiv1/specialist_pool_client.go | 2 +- .../apiv1alpha/analytics_admin_client.go | 2 +- analytics/admin/apiv1alpha/doc.go | 2 +- .../admin/apiv1alpha/gapic_metadata.json | 294 +++++----- analytics/data/apiv1alpha/doc.go | 2 +- analytics/data/apiv1alpha/gapic_metadata.json | 46 +- apigateway/apiv1/api_gateway_client.go | 2 +- apigateway/apiv1/doc.go | 2 +- apigateway/apiv1/gapic_metadata.json | 82 +-- apigeeconnect/apiv1/connection_client.go | 2 +- apigeeconnect/apiv1/doc.go | 2 +- apigeeconnect/apiv1/gapic_metadata.json | 40 +- .../apiv1/authorized_certificates_client.go | 2 +- appengine/apiv1/authorized_domains_client.go | 2 +- appengine/apiv1/doc.go | 2 +- appengine/apiv1/domain_mappings_client.go | 2 +- appengine/apiv1/firewall_client.go | 2 +- appengine/apiv1/gapic_metadata.json | 228 ++++---- appengine/apiv1/instances_client.go | 2 +- appengine/apiv1/services_client.go | 2 +- appengine/apiv1/versions_client.go | 2 +- area120/tables/apiv1alpha1/doc.go | 2 +- .../tables/apiv1alpha1/gapic_metadata.json | 70 +-- area120/tables/apiv1alpha1/tables_client.go | 2 +- .../apiv1beta2/artifact_registry_client.go | 2 +- artifactregistry/apiv1beta2/doc.go | 2 +- .../apiv1beta2/gapic_metadata.json | 106 ++-- asset/apiv1/asset_client.go | 4 +- asset/apiv1/doc.go | 2 +- asset/apiv1/gapic_metadata.json | 70 +-- asset/apiv1p2beta1/doc.go | 2 +- asset/apiv1p2beta1/gapic_metadata.json | 42 +- asset/apiv1p5beta1/asset_client.go | 2 +- asset/apiv1p5beta1/doc.go | 2 +- asset/apiv1p5beta1/gapic_metadata.json | 26 +- .../apiv1beta1/assured_workloads_client.go | 2 +- assuredworkloads/apiv1beta1/doc.go | 2 +- .../apiv1beta1/gapic_metadata.json | 42 +- automl/apiv1/auto_ml_client.go | 2 +- automl/apiv1/doc.go | 2 +- automl/apiv1/gapic_metadata.json | 112 ++-- automl/apiv1beta1/auto_ml_client.go | 2 +- automl/apiv1beta1/doc.go | 2 +- automl/apiv1beta1/gapic_metadata.json | 136 ++--- .../connection/apiv1/connection_client.go | 2 +- bigquery/connection/apiv1/doc.go | 2 +- bigquery/connection/apiv1/gapic_metadata.json | 54 +- bigquery/connection/apiv1beta1/doc.go | 2 +- .../connection/apiv1beta1/gapic_metadata.json | 58 +- .../apiv1/data_transfer_client.go | 2 +- bigquery/datatransfer/apiv1/doc.go | 2 +- .../datatransfer/apiv1/gapic_metadata.json | 78 +-- bigquery/go.mod | 5 +- bigquery/go.sum | 14 +- bigquery/reservation/apiv1/doc.go | 2 +- .../reservation/apiv1/gapic_metadata.json | 98 ++-- .../reservation/apiv1/reservation_client.go | 2 +- bigquery/reservation/apiv1beta1/doc.go | 2 +- .../apiv1beta1/gapic_metadata.json | 98 ++-- .../apiv1beta1/reservation_client.go | 2 +- bigquery/storage/apiv1/doc.go | 2 +- bigquery/storage/apiv1/gapic_metadata.json | 34 +- bigquery/storage/apiv1beta1/doc.go | 2 +- .../storage/apiv1beta1/gapic_metadata.json | 42 +- bigquery/storage/apiv1beta2/doc.go | 2 +- .../storage/apiv1beta2/gapic_metadata.json | 68 +-- bigtable/go.mod | 4 +- bigtable/go.sum | 10 +- billing/apiv1/cloud_billing_client.go | 2 +- billing/apiv1/cloud_catalog_client.go | 2 +- billing/apiv1/doc.go | 2 +- billing/apiv1/gapic_metadata.json | 80 +-- billing/budgets/apiv1/budget_client.go | 2 +- billing/budgets/apiv1/doc.go | 2 +- billing/budgets/apiv1/gapic_metadata.json | 42 +- billing/budgets/apiv1beta1/budget_client.go | 2 +- billing/budgets/apiv1beta1/doc.go | 2 +- .../budgets/apiv1beta1/gapic_metadata.json | 42 +- ...uthz_management_service_v1_beta1_client.go | 2 +- binaryauthorization/apiv1beta1/doc.go | 2 +- .../apiv1beta1/gapic_metadata.json | 50 +- channel/apiv1/cloud_channel_client.go | 2 +- channel/apiv1/doc.go | 2 +- channel/apiv1/gapic_metadata.json | 158 +++--- cloudbuild/apiv1/v2/cloud_build_client.go | 2 +- cloudbuild/apiv1/v2/doc.go | 2 +- cloudbuild/apiv1/v2/gapic_metadata.json | 90 +-- clouddms/apiv1/data_migration_client.go | 2 +- clouddms/apiv1/doc.go | 2 +- clouddms/apiv1/gapic_metadata.json | 90 +-- cloudtasks/apiv2/cloud_tasks_client.go | 2 +- cloudtasks/apiv2/doc.go | 2 +- cloudtasks/apiv2/gapic_metadata.json | 86 +-- cloudtasks/apiv2beta2/cloud_tasks_client.go | 2 +- cloudtasks/apiv2beta2/doc.go | 2 +- cloudtasks/apiv2beta2/gapic_metadata.json | 102 ++-- cloudtasks/apiv2beta3/cloud_tasks_client.go | 2 +- cloudtasks/apiv2beta3/doc.go | 2 +- cloudtasks/apiv2beta3/gapic_metadata.json | 86 +-- container/apiv1/cluster_manager_client.go | 2 +- container/apiv1/doc.go | 2 +- container/apiv1/gapic_metadata.json | 150 ++--- .../container_analysis_v1_beta1_client.go | 2 +- containeranalysis/apiv1beta1/doc.go | 2 +- .../apiv1beta1/gapic_metadata.json | 82 +-- .../apiv1beta1/grafeas_v1_beta1_client.go | 2 +- datacatalog/apiv1/data_catalog_client.go | 2 +- datacatalog/apiv1/doc.go | 2 +- datacatalog/apiv1/gapic_metadata.json | 214 ++++---- .../apiv1/policy_tag_manager_client.go | 2 +- datacatalog/apiv1beta1/data_catalog_client.go | 2 +- datacatalog/apiv1beta1/doc.go | 2 +- datacatalog/apiv1beta1/gapic_metadata.json | 210 +++---- .../apiv1beta1/policy_tag_manager_client.go | 2 +- .../apiv1beta1/data_labeling_client.go | 2 +- datalabeling/apiv1beta1/doc.go | 2 +- datalabeling/apiv1beta1/gapic_metadata.json | 158 +++--- dataproc/apiv1/autoscaling_policy_client.go | 2 +- dataproc/apiv1/cluster_controller_client.go | 2 +- dataproc/apiv1/doc.go | 2 +- dataproc/apiv1/gapic_metadata.json | 160 +++--- dataproc/apiv1/job_controller_client.go | 2 +- dataproc/apiv1/workflow_template_client.go | 2 +- .../apiv1beta2/autoscaling_policy_client.go | 2 +- .../apiv1beta2/cluster_controller_client.go | 2 +- dataproc/apiv1beta2/doc.go | 2 +- dataproc/apiv1beta2/gapic_metadata.json | 152 +++--- dataproc/apiv1beta2/job_controller_client.go | 2 +- .../apiv1beta2/workflow_template_client.go | 2 +- dataqna/apiv1alpha/doc.go | 2 +- dataqna/apiv1alpha/gapic_metadata.json | 56 +- .../admin/apiv1/datastore_admin_client.go | 2 +- datastore/admin/apiv1/doc.go | 2 +- datastore/admin/apiv1/gapic_metadata.json | 46 +- datastore/go.mod | 4 +- datastore/go.sum | 14 +- debugger/apiv2/doc.go | 2 +- debugger/apiv2/gapic_metadata.json | 64 +-- dialogflow/apiv2/agents_client.go | 22 +- dialogflow/apiv2/answer_records_client.go | 2 +- dialogflow/apiv2/contexts_client.go | 2 +- .../apiv2/conversation_profiles_client.go | 2 +- dialogflow/apiv2/conversations_client.go | 2 +- dialogflow/apiv2/doc.go | 2 +- dialogflow/apiv2/documents_client.go | 2 +- dialogflow/apiv2/entity_types_client.go | 34 +- dialogflow/apiv2/environments_client.go | 2 +- dialogflow/apiv2/gapic_metadata.json | 490 ++++++++--------- dialogflow/apiv2/intents_client.go | 22 +- dialogflow/apiv2/knowledge_bases_client.go | 2 +- dialogflow/apiv2/participants_client.go | 2 +- .../apiv2/session_entity_types_client.go | 2 +- dialogflow/apiv2/versions_client.go | 2 +- dialogflow/cx/apiv3/agents_client.go | 14 +- dialogflow/cx/apiv3/doc.go | 2 +- dialogflow/cx/apiv3/entity_types_client.go | 14 +- dialogflow/cx/apiv3/environments_client.go | 2 +- dialogflow/cx/apiv3/experiments_client.go | 2 +- dialogflow/cx/apiv3/flows_client.go | 18 +- dialogflow/cx/apiv3/gapic_metadata.json | 516 +++++++++--------- dialogflow/cx/apiv3/intents_client.go | 14 +- dialogflow/cx/apiv3/pages_client.go | 14 +- .../cx/apiv3/security_settings_client.go | 2 +- .../cx/apiv3/session_entity_types_client.go | 2 +- dialogflow/cx/apiv3/test_cases_client.go | 2 +- .../apiv3/transition_route_groups_client.go | 14 +- dialogflow/cx/apiv3/versions_client.go | 2 +- dialogflow/cx/apiv3/webhooks_client.go | 2 +- dialogflow/cx/apiv3beta1/agents_client.go | 14 +- dialogflow/cx/apiv3beta1/doc.go | 2 +- .../cx/apiv3beta1/entity_types_client.go | 10 +- .../cx/apiv3beta1/environments_client.go | 2 +- .../cx/apiv3beta1/experiments_client.go | 2 +- dialogflow/cx/apiv3beta1/flows_client.go | 18 +- dialogflow/cx/apiv3beta1/gapic_metadata.json | 516 +++++++++--------- dialogflow/cx/apiv3beta1/intents_client.go | 14 +- dialogflow/cx/apiv3beta1/pages_client.go | 2 +- .../cx/apiv3beta1/security_settings_client.go | 2 +- .../apiv3beta1/session_entity_types_client.go | 2 +- dialogflow/cx/apiv3beta1/test_cases_client.go | 2 +- .../transition_route_groups_client.go | 14 +- dialogflow/cx/apiv3beta1/versions_client.go | 2 +- dialogflow/cx/apiv3beta1/webhooks_client.go | 2 +- dlp/apiv2/dlp_client.go | 2 +- dlp/apiv2/doc.go | 2 +- dlp/apiv2/gapic_metadata.json | 158 +++--- documentai/apiv1/doc.go | 2 +- documentai/apiv1/gapic_metadata.json | 34 +- documentai/apiv1beta3/doc.go | 2 +- .../apiv1beta3/document_processor_client.go | 2 +- documentai/apiv1beta3/gapic_metadata.json | 58 +- domains/apiv1beta1/doc.go | 2 +- domains/apiv1beta1/domains_client.go | 2 +- domains/apiv1beta1/gapic_metadata.json | 74 +-- errorreporting/apiv1beta1/doc.go | 2 +- .../apiv1beta1/error_stats_client.go | 2 +- errorreporting/apiv1beta1/gapic_metadata.json | 66 +-- essentialcontacts/apiv1/doc.go | 2 +- .../apiv1/essential_contacts_client.go | 2 +- essentialcontacts/apiv1/gapic_metadata.json | 50 +- firestore/apiv1/admin/doc.go | 2 +- .../apiv1/admin/firestore_admin_client.go | 2 +- firestore/apiv1/admin/gapic_metadata.json | 58 +- firestore/apiv1/doc.go | 2 +- firestore/apiv1/firestore_client.go | 2 +- firestore/apiv1/gapic_metadata.json | 82 +-- firestore/go.mod | 5 +- firestore/go.sum | 14 +- functions/apiv1/cloud_functions_client.go | 2 +- functions/apiv1/doc.go | 2 +- functions/apiv1/gapic_metadata.json | 66 +-- gaming/apiv1/doc.go | 2 +- gaming/apiv1/game_server_clusters_client.go | 2 +- gaming/apiv1/game_server_configs_client.go | 2 +- .../apiv1/game_server_deployments_client.go | 2 +- gaming/apiv1/gapic_metadata.json | 160 +++--- gaming/apiv1/realms_client.go | 2 +- gaming/apiv1beta/doc.go | 2 +- .../apiv1beta/game_server_clusters_client.go | 2 +- .../apiv1beta/game_server_configs_client.go | 2 +- .../game_server_deployments_client.go | 2 +- gaming/apiv1beta/gapic_metadata.json | 160 +++--- gaming/apiv1beta/realms_client.go | 2 +- gkeconnect/gateway/apiv1beta1/doc.go | 2 +- .../gateway/apiv1beta1/gapic_metadata.json | 42 +- gkehub/apiv1beta1/doc.go | 2 +- gkehub/apiv1beta1/gapic_metadata.json | 54 +- .../apiv1beta1/gke_hub_membership_client.go | 2 +- go.mod | 4 +- go.sum | 11 +- gsuiteaddons/apiv1/doc.go | 2 +- gsuiteaddons/apiv1/g_suite_add_ons_client.go | 2 +- gsuiteaddons/apiv1/gapic_metadata.json | 58 +- iam/credentials/apiv1/doc.go | 2 +- iam/credentials/apiv1/gapic_metadata.json | 38 +- internal/examples/fake/go.mod | 8 +- internal/examples/fake/go.sum | 50 +- internal/examples/mock/go.mod | 5 +- internal/examples/mock/go.sum | 43 +- internal/gapicgen/go.mod | 2 +- internal/gapicgen/go.sum | 3 +- internal/generated/snippets/go.mod | 4 +- internal/generated/snippets/go.sum | 16 +- internal/godocfx/go.sum | 14 +- iot/apiv1/device_manager_client.go | 2 +- iot/apiv1/doc.go | 2 +- iot/apiv1/gapic_metadata.json | 98 ++-- kms/apiv1/doc.go | 2 +- kms/apiv1/gapic_metadata.json | 126 ++--- kms/apiv1/key_management_client.go | 2 +- language/apiv1/doc.go | 2 +- language/apiv1/gapic_metadata.json | 46 +- language/apiv1beta2/doc.go | 2 +- language/apiv1beta2/gapic_metadata.json | 46 +- lifesciences/apiv2beta/doc.go | 2 +- lifesciences/apiv2beta/gapic_metadata.json | 26 +- logging/apiv2/config_client.go | 2 +- logging/apiv2/doc.go | 2 +- logging/apiv2/gapic_metadata.json | 178 +++--- logging/apiv2/logging_client.go | 2 +- logging/apiv2/metrics_client.go | 2 +- logging/go.mod | 5 +- logging/go.sum | 11 +- longrunning/autogen/doc.go | 2 +- longrunning/autogen/gapic_metadata.json | 42 +- longrunning/autogen/operations_client.go | 2 +- managedidentities/apiv1/doc.go | 2 +- managedidentities/apiv1/gapic_metadata.json | 62 +-- .../apiv1/managed_identities_client.go | 2 +- mediatranslation/apiv1beta1/doc.go | 2 +- .../apiv1beta1/gapic_metadata.json | 26 +- memcache/apiv1/cloud_memcache_client.go | 2 +- memcache/apiv1/doc.go | 2 +- memcache/apiv1/gapic_metadata.json | 50 +- memcache/apiv1beta2/cloud_memcache_client.go | 2 +- memcache/apiv1beta2/doc.go | 2 +- memcache/apiv1beta2/gapic_metadata.json | 54 +- metastore/apiv1/dataproc_metastore_client.go | 2 +- metastore/apiv1/doc.go | 2 +- metastore/apiv1/gapic_metadata.json | 62 +-- .../apiv1alpha/dataproc_metastore_client.go | 2 +- metastore/apiv1alpha/doc.go | 2 +- metastore/apiv1alpha/gapic_metadata.json | 82 +-- .../apiv1beta/dataproc_metastore_client.go | 2 +- metastore/apiv1beta/doc.go | 2 +- metastore/apiv1beta/gapic_metadata.json | 82 +-- monitoring/apiv3/v2/alert_policy_client.go | 2 +- monitoring/apiv3/v2/doc.go | 2 +- monitoring/apiv3/v2/gapic_metadata.json | 266 ++++----- monitoring/apiv3/v2/group_client.go | 2 +- monitoring/apiv3/v2/metric_client.go | 2 +- .../apiv3/v2/notification_channel_client.go | 2 +- monitoring/apiv3/v2/query_client.go | 2 +- .../apiv3/v2/service_monitoring_client.go | 2 +- monitoring/apiv3/v2/uptime_check_client.go | 2 +- .../dashboard/apiv1/dashboards_client.go | 2 +- monitoring/dashboard/apiv1/doc.go | 2 +- .../dashboard/apiv1/gapic_metadata.json | 42 +- networkconnectivity/apiv1alpha1/doc.go | 2 +- .../apiv1alpha1/gapic_metadata.json | 62 +-- networkconnectivity/apiv1alpha1/hub_client.go | 2 +- notebooks/apiv1beta1/doc.go | 2 +- notebooks/apiv1beta1/gapic_metadata.json | 98 ++-- notebooks/apiv1beta1/notebook_client.go | 2 +- orgpolicy/apiv2/doc.go | 2 +- orgpolicy/apiv2/gapic_metadata.json | 50 +- orgpolicy/apiv2/org_policy_client.go | 2 +- osconfig/agentendpoint/apiv1/doc.go | 2 +- .../agentendpoint/apiv1/gapic_metadata.json | 46 +- osconfig/agentendpoint/apiv1beta/doc.go | 2 +- .../apiv1beta/gapic_metadata.json | 46 +- osconfig/apiv1/doc.go | 2 +- osconfig/apiv1/gapic_metadata.json | 58 +- osconfig/apiv1/os_config_client.go | 2 +- osconfig/apiv1alpha/doc.go | 2 +- osconfig/apiv1alpha/gapic_metadata.json | 70 +-- osconfig/apiv1alpha/os_config_zonal_client.go | 2 +- osconfig/apiv1beta/doc.go | 2 +- osconfig/apiv1beta/gapic_metadata.json | 82 +-- osconfig/apiv1beta/os_config_client.go | 2 +- oslogin/apiv1/doc.go | 2 +- oslogin/apiv1/gapic_metadata.json | 46 +- oslogin/apiv1beta/doc.go | 2 +- oslogin/apiv1beta/gapic_metadata.json | 46 +- phishingprotection/apiv1beta1/doc.go | 2 +- .../apiv1beta1/gapic_metadata.json | 26 +- policytroubleshooter/apiv1/doc.go | 2 +- .../apiv1/gapic_metadata.json | 26 +- privatecatalog/apiv1beta1/doc.go | 2 +- privatecatalog/apiv1beta1/gapic_metadata.json | 34 +- .../apiv1beta1/private_catalog_client.go | 2 +- pubsub/apiv1/doc.go | 2 +- pubsub/apiv1/gapic_metadata.json | 202 +++---- pubsub/apiv1/publisher_client.go | 2 +- pubsub/apiv1/schema_client.go | 2 +- pubsub/apiv1/subscriber_client.go | 2 +- pubsub/go.mod | 4 +- pubsub/go.sum | 11 +- pubsublite/apiv1/admin_client.go | 167 +++++- pubsublite/apiv1/admin_client_example_test.go | 24 + pubsublite/apiv1/cursor_client.go | 2 +- pubsublite/apiv1/doc.go | 2 +- pubsublite/apiv1/gapic_metadata.json | 185 ++++--- pubsublite/go.mod | 4 +- pubsublite/go.sum | 14 +- recaptchaenterprise/apiv1/doc.go | 2 +- recaptchaenterprise/apiv1/gapic_metadata.json | 50 +- .../apiv1/recaptcha_enterprise_client.go | 2 +- recaptchaenterprise/apiv1beta1/doc.go | 2 +- .../apiv1beta1/gapic_metadata.json | 50 +- ...tcha_enterprise_service_v1_beta1_client.go | 2 +- recommender/apiv1/doc.go | 2 +- recommender/apiv1/gapic_metadata.json | 54 +- recommender/apiv1/recommender_client.go | 2 +- recommender/apiv1beta1/doc.go | 2 +- recommender/apiv1beta1/gapic_metadata.json | 54 +- recommender/apiv1beta1/recommender_client.go | 2 +- redis/apiv1/cloud_redis_client.go | 2 +- redis/apiv1/doc.go | 2 +- redis/apiv1/gapic_metadata.json | 58 +- redis/apiv1beta1/cloud_redis_client.go | 2 +- redis/apiv1beta1/doc.go | 2 +- redis/apiv1beta1/gapic_metadata.json | 58 +- resourcemanager/apiv2/doc.go | 2 +- resourcemanager/apiv2/folders_client.go | 2 +- resourcemanager/apiv2/gapic_metadata.json | 66 +-- resourcesettings/apiv1/doc.go | 2 +- resourcesettings/apiv1/gapic_metadata.json | 34 +- .../apiv1/resource_settings_client.go | 2 +- retail/apiv2/catalog_client.go | 2 +- retail/apiv2/doc.go | 2 +- retail/apiv2/gapic_metadata.json | 104 ++-- scheduler/apiv1/cloud_scheduler_client.go | 2 +- scheduler/apiv1/doc.go | 2 +- scheduler/apiv1/gapic_metadata.json | 54 +- .../apiv1beta1/cloud_scheduler_client.go | 2 +- scheduler/apiv1beta1/doc.go | 2 +- scheduler/apiv1beta1/gapic_metadata.json | 54 +- secretmanager/apiv1/doc.go | 2 +- secretmanager/apiv1/gapic_metadata.json | 82 +-- secretmanager/apiv1/secret_manager_client.go | 2 +- secretmanager/apiv1beta1/doc.go | 2 +- secretmanager/apiv1beta1/gapic_metadata.json | 82 +-- .../apiv1beta1/secret_manager_client.go | 2 +- .../apiv1/certificate_authority_client.go | 2 +- security/privateca/apiv1/doc.go | 2 +- security/privateca/apiv1/gapic_metadata.json | 138 ++--- .../certificate_authority_client.go | 2 +- security/privateca/apiv1beta1/doc.go | 2 +- .../privateca/apiv1beta1/gapic_metadata.json | 102 ++-- securitycenter/apiv1/doc.go | 2 +- securitycenter/apiv1/gapic_metadata.json | 114 ++-- .../apiv1/security_center_client.go | 2 +- securitycenter/apiv1beta1/doc.go | 2 +- securitycenter/apiv1beta1/gapic_metadata.json | 94 ++-- .../apiv1beta1/security_center_client.go | 2 +- securitycenter/apiv1p1beta1/doc.go | 2 +- .../apiv1p1beta1/gapic_metadata.json | 114 ++-- .../apiv1p1beta1/security_center_client.go | 2 +- securitycenter/settings/apiv1beta1/doc.go | 2 +- .../settings/apiv1beta1/gapic_metadata.json | 74 +-- .../security_center_settings_client.go | 2 +- servicecontrol/apiv1/doc.go | 2 +- servicecontrol/apiv1/gapic_metadata.json | 44 +- servicedirectory/apiv1/doc.go | 2 +- servicedirectory/apiv1/gapic_metadata.json | 108 ++-- servicedirectory/apiv1/registration_client.go | 2 +- servicedirectory/apiv1beta1/doc.go | 5 +- .../apiv1beta1/gapic_metadata.json | 108 ++-- .../apiv1beta1/registration_client.go | 14 +- servicemanagement/apiv1/doc.go | 2 +- servicemanagement/apiv1/gapic_metadata.json | 82 +-- .../apiv1/service_manager_client.go | 2 +- serviceusage/apiv1/doc.go | 2 +- serviceusage/apiv1/gapic_metadata.json | 46 +- serviceusage/apiv1/service_usage_client.go | 2 +- shell/apiv1/doc.go | 2 +- shell/apiv1/gapic_metadata.json | 42 +- .../database/apiv1/database_admin_client.go | 2 +- spanner/admin/database/apiv1/doc.go | 2 +- .../admin/database/apiv1/gapic_metadata.json | 90 +-- spanner/admin/instance/apiv1/doc.go | 2 +- .../admin/instance/apiv1/gapic_metadata.json | 62 +-- .../instance/apiv1/instance_admin_client.go | 2 +- spanner/apiv1/doc.go | 2 +- spanner/apiv1/gapic_metadata.json | 82 +-- spanner/apiv1/spanner_client.go | 2 +- spanner/go.mod | 4 +- spanner/go.sum | 14 +- speech/apiv1/doc.go | 2 +- speech/apiv1/gapic_metadata.json | 34 +- speech/apiv1p1beta1/adaptation_client.go | 2 +- speech/apiv1p1beta1/doc.go | 2 +- speech/apiv1p1beta1/gapic_metadata.json | 84 +-- storage/go.mod | 4 +- storage/go.sum | 13 +- talent/apiv4/company_client.go | 2 +- talent/apiv4/doc.go | 2 +- talent/apiv4/gapic_metadata.json | 150 ++--- talent/apiv4/job_client.go | 2 +- talent/apiv4/tenant_client.go | 2 +- talent/apiv4beta1/application_client.go | 2 +- talent/apiv4beta1/company_client.go | 2 +- talent/apiv4beta1/doc.go | 2 +- talent/apiv4beta1/gapic_metadata.json | 214 ++++---- talent/apiv4beta1/job_client.go | 2 +- talent/apiv4beta1/profile_client.go | 2 +- talent/apiv4beta1/tenant_client.go | 2 +- texttospeech/apiv1/doc.go | 2 +- texttospeech/apiv1/gapic_metadata.json | 30 +- tpu/apiv1/doc.go | 2 +- tpu/apiv1/gapic_metadata.json | 66 +-- tpu/apiv1/tpu_client.go | 2 +- trace/apiv1/doc.go | 2 +- trace/apiv1/gapic_metadata.json | 34 +- trace/apiv1/trace_client.go | 2 +- trace/apiv2/doc.go | 2 +- trace/apiv2/gapic_metadata.json | 30 +- translate/apiv3/doc.go | 2 +- translate/apiv3/gapic_metadata.json | 54 +- translate/apiv3/translation_client.go | 2 +- video/transcoder/apiv1beta1/doc.go | 2 +- .../transcoder/apiv1beta1/gapic_metadata.json | 54 +- .../apiv1beta1/transcoder_client.go | 2 +- videointelligence/apiv1/doc.go | 2 +- videointelligence/apiv1/gapic_metadata.json | 26 +- videointelligence/apiv1beta2/doc.go | 2 +- .../apiv1beta2/gapic_metadata.json | 26 +- vision/apiv1/doc.go | 2 +- vision/apiv1/gapic_metadata.json | 124 ++--- vision/apiv1/product_search_client.go | 2 +- vision/apiv1p1beta1/doc.go | 2 +- vision/apiv1p1beta1/gapic_metadata.json | 26 +- vpcaccess/apiv1/doc.go | 2 +- vpcaccess/apiv1/gapic_metadata.json | 38 +- vpcaccess/apiv1/vpc_access_client.go | 2 +- webrisk/apiv1/doc.go | 2 +- webrisk/apiv1/gapic_metadata.json | 38 +- webrisk/apiv1beta1/doc.go | 2 +- webrisk/apiv1beta1/gapic_metadata.json | 34 +- websecurityscanner/apiv1/doc.go | 2 +- websecurityscanner/apiv1/gapic_metadata.json | 74 +-- .../apiv1/web_security_scanner_client.go | 2 +- workflows/apiv1beta/doc.go | 2 +- workflows/apiv1beta/gapic_metadata.json | 42 +- workflows/apiv1beta/workflows_client.go | 2 +- workflows/executions/apiv1beta/doc.go | 2 +- .../executions/apiv1beta/executions_client.go | 2 +- .../executions/apiv1beta/gapic_metadata.json | 38 +- 500 files changed, 7259 insertions(+), 6814 deletions(-) diff --git a/accessapproval/apiv1/access_approval_client.go b/accessapproval/apiv1/access_approval_client.go index c4394e09497..0ae5314bc9f 100644 --- a/accessapproval/apiv1/access_approval_client.go +++ b/accessapproval/apiv1/access_approval_client.go @@ -23,7 +23,6 @@ import ( "net/url" "time" - "github.com/golang/protobuf/proto" gax "github.com/googleapis/gax-go/v2" "google.golang.org/api/iterator" "google.golang.org/api/option" @@ -33,6 +32,7 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/proto" ) var newClientHook clientHook diff --git a/accessapproval/apiv1/doc.go b/accessapproval/apiv1/doc.go index c7520053af0..a4d44187f42 100644 --- a/accessapproval/apiv1/doc.go +++ b/accessapproval/apiv1/doc.go @@ -48,7 +48,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210612" +const versionClient = "20210624" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/accessapproval/apiv1/gapic_metadata.json b/accessapproval/apiv1/gapic_metadata.json index 25dd99519b2..51393e9d3f1 100644 --- a/accessapproval/apiv1/gapic_metadata.json +++ b/accessapproval/apiv1/gapic_metadata.json @@ -1,47 +1,47 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.accessapproval.v1", - "libraryPackage": "cloud.google.com/go/accessapproval/apiv1", - "services": { - "AccessApproval": { - "clients": { - "grpc": { - "libraryClient": "Client", - "rpcs": { - "ApproveApprovalRequest": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.accessapproval.v1", + "libraryPackage": "cloud.google.com/go/accessapproval/apiv1", + "services": { + "AccessApproval": { + "clients": { + "grpc": { + "libraryClient": "Client", + "rpcs": { + "ApproveApprovalRequest": { + "methods": [ "ApproveApprovalRequest" ] }, - "DeleteAccessApprovalSettings": { - "methods": [ + "DeleteAccessApprovalSettings": { + "methods": [ "DeleteAccessApprovalSettings" ] }, - "DismissApprovalRequest": { - "methods": [ + "DismissApprovalRequest": { + "methods": [ "DismissApprovalRequest" ] }, - "GetAccessApprovalSettings": { - "methods": [ + "GetAccessApprovalSettings": { + "methods": [ "GetAccessApprovalSettings" ] }, - "GetApprovalRequest": { - "methods": [ + "GetApprovalRequest": { + "methods": [ "GetApprovalRequest" ] }, - "ListApprovalRequests": { - "methods": [ + "ListApprovalRequests": { + "methods": [ "ListApprovalRequests" ] }, - "UpdateAccessApprovalSettings": { - "methods": [ + "UpdateAccessApprovalSettings": { + "methods": [ "UpdateAccessApprovalSettings" ] } diff --git a/aiplatform/apiv1/dataset_client.go b/aiplatform/apiv1/dataset_client.go index 9307ace54be..99e8c1d7038 100644 --- a/aiplatform/apiv1/dataset_client.go +++ b/aiplatform/apiv1/dataset_client.go @@ -25,7 +25,6 @@ import ( "cloud.google.com/go/longrunning" lroauto "cloud.google.com/go/longrunning/autogen" - "github.com/golang/protobuf/proto" gax "github.com/googleapis/gax-go/v2" "google.golang.org/api/iterator" "google.golang.org/api/option" @@ -35,6 +34,7 @@ import ( longrunningpb "google.golang.org/genproto/googleapis/longrunning" "google.golang.org/grpc" "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/proto" ) var newDatasetClientHook clientHook diff --git a/aiplatform/apiv1/doc.go b/aiplatform/apiv1/doc.go index 18afa20658d..c86f004cf39 100644 --- a/aiplatform/apiv1/doc.go +++ b/aiplatform/apiv1/doc.go @@ -51,7 +51,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210612" +const versionClient = "20210624" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/aiplatform/apiv1/endpoint_client.go b/aiplatform/apiv1/endpoint_client.go index 7589c153447..05df6310148 100644 --- a/aiplatform/apiv1/endpoint_client.go +++ b/aiplatform/apiv1/endpoint_client.go @@ -25,7 +25,6 @@ import ( "cloud.google.com/go/longrunning" lroauto "cloud.google.com/go/longrunning/autogen" - "github.com/golang/protobuf/proto" gax "github.com/googleapis/gax-go/v2" "google.golang.org/api/iterator" "google.golang.org/api/option" @@ -35,6 +34,7 @@ import ( longrunningpb "google.golang.org/genproto/googleapis/longrunning" "google.golang.org/grpc" "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/proto" ) var newEndpointClientHook clientHook diff --git a/aiplatform/apiv1/gapic_metadata.json b/aiplatform/apiv1/gapic_metadata.json index b0e687801dd..da1d3982b2a 100644 --- a/aiplatform/apiv1/gapic_metadata.json +++ b/aiplatform/apiv1/gapic_metadata.json @@ -1,62 +1,62 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.aiplatform.v1", - "libraryPackage": "cloud.google.com/go/aiplatform/apiv1", - "services": { - "DatasetService": { - "clients": { - "grpc": { - "libraryClient": "DatasetClient", - "rpcs": { - "CreateDataset": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.aiplatform.v1", + "libraryPackage": "cloud.google.com/go/aiplatform/apiv1", + "services": { + "DatasetService": { + "clients": { + "grpc": { + "libraryClient": "DatasetClient", + "rpcs": { + "CreateDataset": { + "methods": [ "CreateDataset" ] }, - "DeleteDataset": { - "methods": [ + "DeleteDataset": { + "methods": [ "DeleteDataset" ] }, - "ExportData": { - "methods": [ + "ExportData": { + "methods": [ "ExportData" ] }, - "GetAnnotationSpec": { - "methods": [ + "GetAnnotationSpec": { + "methods": [ "GetAnnotationSpec" ] }, - "GetDataset": { - "methods": [ + "GetDataset": { + "methods": [ "GetDataset" ] }, - "ImportData": { - "methods": [ + "ImportData": { + "methods": [ "ImportData" ] }, - "ListAnnotations": { - "methods": [ + "ListAnnotations": { + "methods": [ "ListAnnotations" ] }, - "ListDataItems": { - "methods": [ + "ListDataItems": { + "methods": [ "ListDataItems" ] }, - "ListDatasets": { - "methods": [ + "ListDatasets": { + "methods": [ "ListDatasets" ] }, - "UpdateDataset": { - "methods": [ + "UpdateDataset": { + "methods": [ "UpdateDataset" ] } @@ -64,43 +64,43 @@ } } }, - "EndpointService": { - "clients": { - "grpc": { - "libraryClient": "EndpointClient", - "rpcs": { - "CreateEndpoint": { - "methods": [ + "EndpointService": { + "clients": { + "grpc": { + "libraryClient": "EndpointClient", + "rpcs": { + "CreateEndpoint": { + "methods": [ "CreateEndpoint" ] }, - "DeleteEndpoint": { - "methods": [ + "DeleteEndpoint": { + "methods": [ "DeleteEndpoint" ] }, - "DeployModel": { - "methods": [ + "DeployModel": { + "methods": [ "DeployModel" ] }, - "GetEndpoint": { - "methods": [ + "GetEndpoint": { + "methods": [ "GetEndpoint" ] }, - "ListEndpoints": { - "methods": [ + "ListEndpoints": { + "methods": [ "ListEndpoints" ] }, - "UndeployModel": { - "methods": [ + "UndeployModel": { + "methods": [ "UndeployModel" ] }, - "UpdateEndpoint": { - "methods": [ + "UpdateEndpoint": { + "methods": [ "UpdateEndpoint" ] } @@ -108,108 +108,108 @@ } } }, - "JobService": { - "clients": { - "grpc": { - "libraryClient": "JobClient", - "rpcs": { - "CancelBatchPredictionJob": { - "methods": [ + "JobService": { + "clients": { + "grpc": { + "libraryClient": "JobClient", + "rpcs": { + "CancelBatchPredictionJob": { + "methods": [ "CancelBatchPredictionJob" ] }, - "CancelCustomJob": { - "methods": [ + "CancelCustomJob": { + "methods": [ "CancelCustomJob" ] }, - "CancelDataLabelingJob": { - "methods": [ + "CancelDataLabelingJob": { + "methods": [ "CancelDataLabelingJob" ] }, - "CancelHyperparameterTuningJob": { - "methods": [ + "CancelHyperparameterTuningJob": { + "methods": [ "CancelHyperparameterTuningJob" ] }, - "CreateBatchPredictionJob": { - "methods": [ + "CreateBatchPredictionJob": { + "methods": [ "CreateBatchPredictionJob" ] }, - "CreateCustomJob": { - "methods": [ + "CreateCustomJob": { + "methods": [ "CreateCustomJob" ] }, - "CreateDataLabelingJob": { - "methods": [ + "CreateDataLabelingJob": { + "methods": [ "CreateDataLabelingJob" ] }, - "CreateHyperparameterTuningJob": { - "methods": [ + "CreateHyperparameterTuningJob": { + "methods": [ "CreateHyperparameterTuningJob" ] }, - "DeleteBatchPredictionJob": { - "methods": [ + "DeleteBatchPredictionJob": { + "methods": [ "DeleteBatchPredictionJob" ] }, - "DeleteCustomJob": { - "methods": [ + "DeleteCustomJob": { + "methods": [ "DeleteCustomJob" ] }, - "DeleteDataLabelingJob": { - "methods": [ + "DeleteDataLabelingJob": { + "methods": [ "DeleteDataLabelingJob" ] }, - "DeleteHyperparameterTuningJob": { - "methods": [ + "DeleteHyperparameterTuningJob": { + "methods": [ "DeleteHyperparameterTuningJob" ] }, - "GetBatchPredictionJob": { - "methods": [ + "GetBatchPredictionJob": { + "methods": [ "GetBatchPredictionJob" ] }, - "GetCustomJob": { - "methods": [ + "GetCustomJob": { + "methods": [ "GetCustomJob" ] }, - "GetDataLabelingJob": { - "methods": [ + "GetDataLabelingJob": { + "methods": [ "GetDataLabelingJob" ] }, - "GetHyperparameterTuningJob": { - "methods": [ + "GetHyperparameterTuningJob": { + "methods": [ "GetHyperparameterTuningJob" ] }, - "ListBatchPredictionJobs": { - "methods": [ + "ListBatchPredictionJobs": { + "methods": [ "ListBatchPredictionJobs" ] }, - "ListCustomJobs": { - "methods": [ + "ListCustomJobs": { + "methods": [ "ListCustomJobs" ] }, - "ListDataLabelingJobs": { - "methods": [ + "ListDataLabelingJobs": { + "methods": [ "ListDataLabelingJobs" ] }, - "ListHyperparameterTuningJobs": { - "methods": [ + "ListHyperparameterTuningJobs": { + "methods": [ "ListHyperparameterTuningJobs" ] } @@ -217,18 +217,18 @@ } } }, - "MigrationService": { - "clients": { - "grpc": { - "libraryClient": "MigrationClient", - "rpcs": { - "BatchMigrateResources": { - "methods": [ + "MigrationService": { + "clients": { + "grpc": { + "libraryClient": "MigrationClient", + "rpcs": { + "BatchMigrateResources": { + "methods": [ "BatchMigrateResources" ] }, - "SearchMigratableResources": { - "methods": [ + "SearchMigratableResources": { + "methods": [ "SearchMigratableResources" ] } @@ -236,58 +236,58 @@ } } }, - "ModelService": { - "clients": { - "grpc": { - "libraryClient": "ModelClient", - "rpcs": { - "DeleteModel": { - "methods": [ + "ModelService": { + "clients": { + "grpc": { + "libraryClient": "ModelClient", + "rpcs": { + "DeleteModel": { + "methods": [ "DeleteModel" ] }, - "ExportModel": { - "methods": [ + "ExportModel": { + "methods": [ "ExportModel" ] }, - "GetModel": { - "methods": [ + "GetModel": { + "methods": [ "GetModel" ] }, - "GetModelEvaluation": { - "methods": [ + "GetModelEvaluation": { + "methods": [ "GetModelEvaluation" ] }, - "GetModelEvaluationSlice": { - "methods": [ + "GetModelEvaluationSlice": { + "methods": [ "GetModelEvaluationSlice" ] }, - "ListModelEvaluationSlices": { - "methods": [ + "ListModelEvaluationSlices": { + "methods": [ "ListModelEvaluationSlices" ] }, - "ListModelEvaluations": { - "methods": [ + "ListModelEvaluations": { + "methods": [ "ListModelEvaluations" ] }, - "ListModels": { - "methods": [ + "ListModels": { + "methods": [ "ListModels" ] }, - "UpdateModel": { - "methods": [ + "UpdateModel": { + "methods": [ "UpdateModel" ] }, - "UploadModel": { - "methods": [ + "UploadModel": { + "methods": [ "UploadModel" ] } @@ -295,33 +295,33 @@ } } }, - "PipelineService": { - "clients": { - "grpc": { - "libraryClient": "PipelineClient", - "rpcs": { - "CancelTrainingPipeline": { - "methods": [ + "PipelineService": { + "clients": { + "grpc": { + "libraryClient": "PipelineClient", + "rpcs": { + "CancelTrainingPipeline": { + "methods": [ "CancelTrainingPipeline" ] }, - "CreateTrainingPipeline": { - "methods": [ + "CreateTrainingPipeline": { + "methods": [ "CreateTrainingPipeline" ] }, - "DeleteTrainingPipeline": { - "methods": [ + "DeleteTrainingPipeline": { + "methods": [ "DeleteTrainingPipeline" ] }, - "GetTrainingPipeline": { - "methods": [ + "GetTrainingPipeline": { + "methods": [ "GetTrainingPipeline" ] }, - "ListTrainingPipelines": { - "methods": [ + "ListTrainingPipelines": { + "methods": [ "ListTrainingPipelines" ] } @@ -329,13 +329,13 @@ } } }, - "PredictionService": { - "clients": { - "grpc": { - "libraryClient": "PredictionClient", - "rpcs": { - "Predict": { - "methods": [ + "PredictionService": { + "clients": { + "grpc": { + "libraryClient": "PredictionClient", + "rpcs": { + "Predict": { + "methods": [ "Predict" ] } @@ -343,33 +343,33 @@ } } }, - "SpecialistPoolService": { - "clients": { - "grpc": { - "libraryClient": "SpecialistPoolClient", - "rpcs": { - "CreateSpecialistPool": { - "methods": [ + "SpecialistPoolService": { + "clients": { + "grpc": { + "libraryClient": "SpecialistPoolClient", + "rpcs": { + "CreateSpecialistPool": { + "methods": [ "CreateSpecialistPool" ] }, - "DeleteSpecialistPool": { - "methods": [ + "DeleteSpecialistPool": { + "methods": [ "DeleteSpecialistPool" ] }, - "GetSpecialistPool": { - "methods": [ + "GetSpecialistPool": { + "methods": [ "GetSpecialistPool" ] }, - "ListSpecialistPools": { - "methods": [ + "ListSpecialistPools": { + "methods": [ "ListSpecialistPools" ] }, - "UpdateSpecialistPool": { - "methods": [ + "UpdateSpecialistPool": { + "methods": [ "UpdateSpecialistPool" ] } diff --git a/aiplatform/apiv1/job_client.go b/aiplatform/apiv1/job_client.go index c8a5308aa48..ae209e9642e 100644 --- a/aiplatform/apiv1/job_client.go +++ b/aiplatform/apiv1/job_client.go @@ -25,7 +25,6 @@ import ( "cloud.google.com/go/longrunning" lroauto "cloud.google.com/go/longrunning/autogen" - "github.com/golang/protobuf/proto" gax "github.com/googleapis/gax-go/v2" "google.golang.org/api/iterator" "google.golang.org/api/option" @@ -35,6 +34,7 @@ import ( longrunningpb "google.golang.org/genproto/googleapis/longrunning" "google.golang.org/grpc" "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/proto" ) var newJobClientHook clientHook diff --git a/aiplatform/apiv1/migration_client.go b/aiplatform/apiv1/migration_client.go index 46a1e6f7ee9..ad671a95012 100644 --- a/aiplatform/apiv1/migration_client.go +++ b/aiplatform/apiv1/migration_client.go @@ -25,7 +25,6 @@ import ( "cloud.google.com/go/longrunning" lroauto "cloud.google.com/go/longrunning/autogen" - "github.com/golang/protobuf/proto" gax "github.com/googleapis/gax-go/v2" "google.golang.org/api/iterator" "google.golang.org/api/option" @@ -35,6 +34,7 @@ import ( longrunningpb "google.golang.org/genproto/googleapis/longrunning" "google.golang.org/grpc" "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/proto" ) var newMigrationClientHook clientHook diff --git a/aiplatform/apiv1/model_client.go b/aiplatform/apiv1/model_client.go index 5484919db10..03dda8ed87f 100644 --- a/aiplatform/apiv1/model_client.go +++ b/aiplatform/apiv1/model_client.go @@ -25,7 +25,6 @@ import ( "cloud.google.com/go/longrunning" lroauto "cloud.google.com/go/longrunning/autogen" - "github.com/golang/protobuf/proto" gax "github.com/googleapis/gax-go/v2" "google.golang.org/api/iterator" "google.golang.org/api/option" @@ -35,6 +34,7 @@ import ( longrunningpb "google.golang.org/genproto/googleapis/longrunning" "google.golang.org/grpc" "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/proto" ) var newModelClientHook clientHook diff --git a/aiplatform/apiv1/pipeline_client.go b/aiplatform/apiv1/pipeline_client.go index 788c74a5145..08527d61ed3 100644 --- a/aiplatform/apiv1/pipeline_client.go +++ b/aiplatform/apiv1/pipeline_client.go @@ -25,7 +25,6 @@ import ( "cloud.google.com/go/longrunning" lroauto "cloud.google.com/go/longrunning/autogen" - "github.com/golang/protobuf/proto" gax "github.com/googleapis/gax-go/v2" "google.golang.org/api/iterator" "google.golang.org/api/option" @@ -35,6 +34,7 @@ import ( longrunningpb "google.golang.org/genproto/googleapis/longrunning" "google.golang.org/grpc" "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/proto" ) var newPipelineClientHook clientHook diff --git a/aiplatform/apiv1/specialist_pool_client.go b/aiplatform/apiv1/specialist_pool_client.go index 654cd3db4a4..0e6c910fad0 100644 --- a/aiplatform/apiv1/specialist_pool_client.go +++ b/aiplatform/apiv1/specialist_pool_client.go @@ -25,7 +25,6 @@ import ( "cloud.google.com/go/longrunning" lroauto "cloud.google.com/go/longrunning/autogen" - "github.com/golang/protobuf/proto" gax "github.com/googleapis/gax-go/v2" "google.golang.org/api/iterator" "google.golang.org/api/option" @@ -35,6 +34,7 @@ import ( longrunningpb "google.golang.org/genproto/googleapis/longrunning" "google.golang.org/grpc" "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/proto" ) var newSpecialistPoolClientHook clientHook diff --git a/analytics/admin/apiv1alpha/analytics_admin_client.go b/analytics/admin/apiv1alpha/analytics_admin_client.go index a4fb2254aa8..8146580822e 100644 --- a/analytics/admin/apiv1alpha/analytics_admin_client.go +++ b/analytics/admin/apiv1alpha/analytics_admin_client.go @@ -23,7 +23,6 @@ import ( "net/url" "time" - "github.com/golang/protobuf/proto" gax "github.com/googleapis/gax-go/v2" "google.golang.org/api/iterator" "google.golang.org/api/option" @@ -33,6 +32,7 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/proto" ) var newAnalyticsAdminClientHook clientHook diff --git a/analytics/admin/apiv1alpha/doc.go b/analytics/admin/apiv1alpha/doc.go index 8d2c9d2bc76..9325b1374cc 100644 --- a/analytics/admin/apiv1alpha/doc.go +++ b/analytics/admin/apiv1alpha/doc.go @@ -48,7 +48,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210612" +const versionClient = "20210624" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/analytics/admin/apiv1alpha/gapic_metadata.json b/analytics/admin/apiv1alpha/gapic_metadata.json index 582fd4892aa..b7e9628c956 100644 --- a/analytics/admin/apiv1alpha/gapic_metadata.json +++ b/analytics/admin/apiv1alpha/gapic_metadata.json @@ -1,352 +1,352 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.analytics.admin.v1alpha", - "libraryPackage": "cloud.google.com/go/analytics/admin/apiv1alpha", - "services": { - "AnalyticsAdminService": { - "clients": { - "grpc": { - "libraryClient": "AnalyticsAdminClient", - "rpcs": { - "ArchiveCustomDimension": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.analytics.admin.v1alpha", + "libraryPackage": "cloud.google.com/go/analytics/admin/apiv1alpha", + "services": { + "AnalyticsAdminService": { + "clients": { + "grpc": { + "libraryClient": "AnalyticsAdminClient", + "rpcs": { + "ArchiveCustomDimension": { + "methods": [ "ArchiveCustomDimension" ] }, - "ArchiveCustomMetric": { - "methods": [ + "ArchiveCustomMetric": { + "methods": [ "ArchiveCustomMetric" ] }, - "AuditUserLinks": { - "methods": [ + "AuditUserLinks": { + "methods": [ "AuditUserLinks" ] }, - "BatchCreateUserLinks": { - "methods": [ + "BatchCreateUserLinks": { + "methods": [ "BatchCreateUserLinks" ] }, - "BatchDeleteUserLinks": { - "methods": [ + "BatchDeleteUserLinks": { + "methods": [ "BatchDeleteUserLinks" ] }, - "BatchGetUserLinks": { - "methods": [ + "BatchGetUserLinks": { + "methods": [ "BatchGetUserLinks" ] }, - "BatchUpdateUserLinks": { - "methods": [ + "BatchUpdateUserLinks": { + "methods": [ "BatchUpdateUserLinks" ] }, - "CreateConversionEvent": { - "methods": [ + "CreateConversionEvent": { + "methods": [ "CreateConversionEvent" ] }, - "CreateCustomDimension": { - "methods": [ + "CreateCustomDimension": { + "methods": [ "CreateCustomDimension" ] }, - "CreateCustomMetric": { - "methods": [ + "CreateCustomMetric": { + "methods": [ "CreateCustomMetric" ] }, - "CreateFirebaseLink": { - "methods": [ + "CreateFirebaseLink": { + "methods": [ "CreateFirebaseLink" ] }, - "CreateGoogleAdsLink": { - "methods": [ + "CreateGoogleAdsLink": { + "methods": [ "CreateGoogleAdsLink" ] }, - "CreateMeasurementProtocolSecret": { - "methods": [ + "CreateMeasurementProtocolSecret": { + "methods": [ "CreateMeasurementProtocolSecret" ] }, - "CreateProperty": { - "methods": [ + "CreateProperty": { + "methods": [ "CreateProperty" ] }, - "CreateUserLink": { - "methods": [ + "CreateUserLink": { + "methods": [ "CreateUserLink" ] }, - "CreateWebDataStream": { - "methods": [ + "CreateWebDataStream": { + "methods": [ "CreateWebDataStream" ] }, - "DeleteAccount": { - "methods": [ + "DeleteAccount": { + "methods": [ "DeleteAccount" ] }, - "DeleteAndroidAppDataStream": { - "methods": [ + "DeleteAndroidAppDataStream": { + "methods": [ "DeleteAndroidAppDataStream" ] }, - "DeleteConversionEvent": { - "methods": [ + "DeleteConversionEvent": { + "methods": [ "DeleteConversionEvent" ] }, - "DeleteFirebaseLink": { - "methods": [ + "DeleteFirebaseLink": { + "methods": [ "DeleteFirebaseLink" ] }, - "DeleteGoogleAdsLink": { - "methods": [ + "DeleteGoogleAdsLink": { + "methods": [ "DeleteGoogleAdsLink" ] }, - "DeleteIosAppDataStream": { - "methods": [ + "DeleteIosAppDataStream": { + "methods": [ "DeleteIosAppDataStream" ] }, - "DeleteMeasurementProtocolSecret": { - "methods": [ + "DeleteMeasurementProtocolSecret": { + "methods": [ "DeleteMeasurementProtocolSecret" ] }, - "DeleteProperty": { - "methods": [ + "DeleteProperty": { + "methods": [ "DeleteProperty" ] }, - "DeleteUserLink": { - "methods": [ + "DeleteUserLink": { + "methods": [ "DeleteUserLink" ] }, - "DeleteWebDataStream": { - "methods": [ + "DeleteWebDataStream": { + "methods": [ "DeleteWebDataStream" ] }, - "GetAccount": { - "methods": [ + "GetAccount": { + "methods": [ "GetAccount" ] }, - "GetAndroidAppDataStream": { - "methods": [ + "GetAndroidAppDataStream": { + "methods": [ "GetAndroidAppDataStream" ] }, - "GetConversionEvent": { - "methods": [ + "GetConversionEvent": { + "methods": [ "GetConversionEvent" ] }, - "GetCustomDimension": { - "methods": [ + "GetCustomDimension": { + "methods": [ "GetCustomDimension" ] }, - "GetCustomMetric": { - "methods": [ + "GetCustomMetric": { + "methods": [ "GetCustomMetric" ] }, - "GetDataSharingSettings": { - "methods": [ + "GetDataSharingSettings": { + "methods": [ "GetDataSharingSettings" ] }, - "GetEnhancedMeasurementSettings": { - "methods": [ + "GetEnhancedMeasurementSettings": { + "methods": [ "GetEnhancedMeasurementSettings" ] }, - "GetGlobalSiteTag": { - "methods": [ + "GetGlobalSiteTag": { + "methods": [ "GetGlobalSiteTag" ] }, - "GetGoogleSignalsSettings": { - "methods": [ + "GetGoogleSignalsSettings": { + "methods": [ "GetGoogleSignalsSettings" ] }, - "GetIosAppDataStream": { - "methods": [ + "GetIosAppDataStream": { + "methods": [ "GetIosAppDataStream" ] }, - "GetMeasurementProtocolSecret": { - "methods": [ + "GetMeasurementProtocolSecret": { + "methods": [ "GetMeasurementProtocolSecret" ] }, - "GetProperty": { - "methods": [ + "GetProperty": { + "methods": [ "GetProperty" ] }, - "GetUserLink": { - "methods": [ + "GetUserLink": { + "methods": [ "GetUserLink" ] }, - "GetWebDataStream": { - "methods": [ + "GetWebDataStream": { + "methods": [ "GetWebDataStream" ] }, - "ListAccountSummaries": { - "methods": [ + "ListAccountSummaries": { + "methods": [ "ListAccountSummaries" ] }, - "ListAccounts": { - "methods": [ + "ListAccounts": { + "methods": [ "ListAccounts" ] }, - "ListAndroidAppDataStreams": { - "methods": [ + "ListAndroidAppDataStreams": { + "methods": [ "ListAndroidAppDataStreams" ] }, - "ListConversionEvents": { - "methods": [ + "ListConversionEvents": { + "methods": [ "ListConversionEvents" ] }, - "ListCustomDimensions": { - "methods": [ + "ListCustomDimensions": { + "methods": [ "ListCustomDimensions" ] }, - "ListCustomMetrics": { - "methods": [ + "ListCustomMetrics": { + "methods": [ "ListCustomMetrics" ] }, - "ListFirebaseLinks": { - "methods": [ + "ListFirebaseLinks": { + "methods": [ "ListFirebaseLinks" ] }, - "ListGoogleAdsLinks": { - "methods": [ + "ListGoogleAdsLinks": { + "methods": [ "ListGoogleAdsLinks" ] }, - "ListIosAppDataStreams": { - "methods": [ + "ListIosAppDataStreams": { + "methods": [ "ListIosAppDataStreams" ] }, - "ListMeasurementProtocolSecrets": { - "methods": [ + "ListMeasurementProtocolSecrets": { + "methods": [ "ListMeasurementProtocolSecrets" ] }, - "ListProperties": { - "methods": [ + "ListProperties": { + "methods": [ "ListProperties" ] }, - "ListUserLinks": { - "methods": [ + "ListUserLinks": { + "methods": [ "ListUserLinks" ] }, - "ListWebDataStreams": { - "methods": [ + "ListWebDataStreams": { + "methods": [ "ListWebDataStreams" ] }, - "ProvisionAccountTicket": { - "methods": [ + "ProvisionAccountTicket": { + "methods": [ "ProvisionAccountTicket" ] }, - "SearchChangeHistoryEvents": { - "methods": [ + "SearchChangeHistoryEvents": { + "methods": [ "SearchChangeHistoryEvents" ] }, - "UpdateAccount": { - "methods": [ + "UpdateAccount": { + "methods": [ "UpdateAccount" ] }, - "UpdateAndroidAppDataStream": { - "methods": [ + "UpdateAndroidAppDataStream": { + "methods": [ "UpdateAndroidAppDataStream" ] }, - "UpdateCustomDimension": { - "methods": [ + "UpdateCustomDimension": { + "methods": [ "UpdateCustomDimension" ] }, - "UpdateCustomMetric": { - "methods": [ + "UpdateCustomMetric": { + "methods": [ "UpdateCustomMetric" ] }, - "UpdateEnhancedMeasurementSettings": { - "methods": [ + "UpdateEnhancedMeasurementSettings": { + "methods": [ "UpdateEnhancedMeasurementSettings" ] }, - "UpdateFirebaseLink": { - "methods": [ + "UpdateFirebaseLink": { + "methods": [ "UpdateFirebaseLink" ] }, - "UpdateGoogleAdsLink": { - "methods": [ + "UpdateGoogleAdsLink": { + "methods": [ "UpdateGoogleAdsLink" ] }, - "UpdateGoogleSignalsSettings": { - "methods": [ + "UpdateGoogleSignalsSettings": { + "methods": [ "UpdateGoogleSignalsSettings" ] }, - "UpdateIosAppDataStream": { - "methods": [ + "UpdateIosAppDataStream": { + "methods": [ "UpdateIosAppDataStream" ] }, - "UpdateMeasurementProtocolSecret": { - "methods": [ + "UpdateMeasurementProtocolSecret": { + "methods": [ "UpdateMeasurementProtocolSecret" ] }, - "UpdateProperty": { - "methods": [ + "UpdateProperty": { + "methods": [ "UpdateProperty" ] }, - "UpdateUserLink": { - "methods": [ + "UpdateUserLink": { + "methods": [ "UpdateUserLink" ] }, - "UpdateWebDataStream": { - "methods": [ + "UpdateWebDataStream": { + "methods": [ "UpdateWebDataStream" ] } diff --git a/analytics/data/apiv1alpha/doc.go b/analytics/data/apiv1alpha/doc.go index 430c77099b4..64fe21a0a2b 100644 --- a/analytics/data/apiv1alpha/doc.go +++ b/analytics/data/apiv1alpha/doc.go @@ -50,7 +50,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210617" +const versionClient = "20210624" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/analytics/data/apiv1alpha/gapic_metadata.json b/analytics/data/apiv1alpha/gapic_metadata.json index 88df4f94f55..5ad1bb6317e 100644 --- a/analytics/data/apiv1alpha/gapic_metadata.json +++ b/analytics/data/apiv1alpha/gapic_metadata.json @@ -1,42 +1,42 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.analytics.data.v1alpha", - "libraryPackage": "cloud.google.com/go/analytics/data/apiv1alpha", - "services": { - "AlphaAnalyticsData": { - "clients": { - "grpc": { - "libraryClient": "AlphaAnalyticsDataClient", - "rpcs": { - "BatchRunPivotReports": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.analytics.data.v1alpha", + "libraryPackage": "cloud.google.com/go/analytics/data/apiv1alpha", + "services": { + "AlphaAnalyticsData": { + "clients": { + "grpc": { + "libraryClient": "AlphaAnalyticsDataClient", + "rpcs": { + "BatchRunPivotReports": { + "methods": [ "BatchRunPivotReports" ] }, - "BatchRunReports": { - "methods": [ + "BatchRunReports": { + "methods": [ "BatchRunReports" ] }, - "GetMetadata": { - "methods": [ + "GetMetadata": { + "methods": [ "GetMetadata" ] }, - "RunPivotReport": { - "methods": [ + "RunPivotReport": { + "methods": [ "RunPivotReport" ] }, - "RunRealtimeReport": { - "methods": [ + "RunRealtimeReport": { + "methods": [ "RunRealtimeReport" ] }, - "RunReport": { - "methods": [ + "RunReport": { + "methods": [ "RunReport" ] } diff --git a/apigateway/apiv1/api_gateway_client.go b/apigateway/apiv1/api_gateway_client.go index ade65eecddd..f77136e9507 100644 --- a/apigateway/apiv1/api_gateway_client.go +++ b/apigateway/apiv1/api_gateway_client.go @@ -25,7 +25,6 @@ import ( "cloud.google.com/go/longrunning" lroauto "cloud.google.com/go/longrunning/autogen" - "github.com/golang/protobuf/proto" gax "github.com/googleapis/gax-go/v2" "google.golang.org/api/iterator" "google.golang.org/api/option" @@ -36,6 +35,7 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/proto" ) var newClientHook clientHook diff --git a/apigateway/apiv1/doc.go b/apigateway/apiv1/doc.go index 1890f8dc4cf..84e6b503ee3 100644 --- a/apigateway/apiv1/doc.go +++ b/apigateway/apiv1/doc.go @@ -46,7 +46,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210612" +const versionClient = "20210624" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/apigateway/apiv1/gapic_metadata.json b/apigateway/apiv1/gapic_metadata.json index 80e7cec7f00..af901b73b0f 100644 --- a/apigateway/apiv1/gapic_metadata.json +++ b/apigateway/apiv1/gapic_metadata.json @@ -1,87 +1,87 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.apigateway.v1", - "libraryPackage": "cloud.google.com/go/apigateway/apiv1", - "services": { - "ApiGatewayService": { - "clients": { - "grpc": { - "libraryClient": "Client", - "rpcs": { - "CreateApi": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.apigateway.v1", + "libraryPackage": "cloud.google.com/go/apigateway/apiv1", + "services": { + "ApiGatewayService": { + "clients": { + "grpc": { + "libraryClient": "Client", + "rpcs": { + "CreateApi": { + "methods": [ "CreateApi" ] }, - "CreateApiConfig": { - "methods": [ + "CreateApiConfig": { + "methods": [ "CreateApiConfig" ] }, - "CreateGateway": { - "methods": [ + "CreateGateway": { + "methods": [ "CreateGateway" ] }, - "DeleteApi": { - "methods": [ + "DeleteApi": { + "methods": [ "DeleteApi" ] }, - "DeleteApiConfig": { - "methods": [ + "DeleteApiConfig": { + "methods": [ "DeleteApiConfig" ] }, - "DeleteGateway": { - "methods": [ + "DeleteGateway": { + "methods": [ "DeleteGateway" ] }, - "GetApi": { - "methods": [ + "GetApi": { + "methods": [ "GetApi" ] }, - "GetApiConfig": { - "methods": [ + "GetApiConfig": { + "methods": [ "GetApiConfig" ] }, - "GetGateway": { - "methods": [ + "GetGateway": { + "methods": [ "GetGateway" ] }, - "ListApiConfigs": { - "methods": [ + "ListApiConfigs": { + "methods": [ "ListApiConfigs" ] }, - "ListApis": { - "methods": [ + "ListApis": { + "methods": [ "ListApis" ] }, - "ListGateways": { - "methods": [ + "ListGateways": { + "methods": [ "ListGateways" ] }, - "UpdateApi": { - "methods": [ + "UpdateApi": { + "methods": [ "UpdateApi" ] }, - "UpdateApiConfig": { - "methods": [ + "UpdateApiConfig": { + "methods": [ "UpdateApiConfig" ] }, - "UpdateGateway": { - "methods": [ + "UpdateGateway": { + "methods": [ "UpdateGateway" ] } diff --git a/apigeeconnect/apiv1/connection_client.go b/apigeeconnect/apiv1/connection_client.go index 088df7683c2..bb387f12ac8 100644 --- a/apigeeconnect/apiv1/connection_client.go +++ b/apigeeconnect/apiv1/connection_client.go @@ -23,7 +23,6 @@ import ( "net/url" "time" - "github.com/golang/protobuf/proto" gax "github.com/googleapis/gax-go/v2" "google.golang.org/api/iterator" "google.golang.org/api/option" @@ -33,6 +32,7 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/proto" ) var newConnectionClientHook clientHook diff --git a/apigeeconnect/apiv1/doc.go b/apigeeconnect/apiv1/doc.go index 869d11c3fa1..cafc83804d5 100644 --- a/apigeeconnect/apiv1/doc.go +++ b/apigeeconnect/apiv1/doc.go @@ -48,7 +48,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210612" +const versionClient = "20210624" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/apigeeconnect/apiv1/gapic_metadata.json b/apigeeconnect/apiv1/gapic_metadata.json index 9840b14ee63..c07a734a1f4 100644 --- a/apigeeconnect/apiv1/gapic_metadata.json +++ b/apigeeconnect/apiv1/gapic_metadata.json @@ -1,17 +1,17 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.apigeeconnect.v1", - "libraryPackage": "cloud.google.com/go/apigeeconnect/apiv1", - "services": { - "ConnectionService": { - "clients": { - "grpc": { - "libraryClient": "ConnectionClient", - "rpcs": { - "ListConnections": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.apigeeconnect.v1", + "libraryPackage": "cloud.google.com/go/apigeeconnect/apiv1", + "services": { + "ConnectionService": { + "clients": { + "grpc": { + "libraryClient": "ConnectionClient", + "rpcs": { + "ListConnections": { + "methods": [ "ListConnections" ] } @@ -19,13 +19,13 @@ } } }, - "Tether": { - "clients": { - "grpc": { - "libraryClient": "TetherClient", - "rpcs": { - "Egress": { - "methods": [ + "Tether": { + "clients": { + "grpc": { + "libraryClient": "TetherClient", + "rpcs": { + "Egress": { + "methods": [ "Egress" ] } diff --git a/appengine/apiv1/authorized_certificates_client.go b/appengine/apiv1/authorized_certificates_client.go index 532ce70d1aa..341f69752d1 100644 --- a/appengine/apiv1/authorized_certificates_client.go +++ b/appengine/apiv1/authorized_certificates_client.go @@ -22,7 +22,6 @@ import ( "math" "net/url" - "github.com/golang/protobuf/proto" gax "github.com/googleapis/gax-go/v2" "google.golang.org/api/iterator" "google.golang.org/api/option" @@ -31,6 +30,7 @@ import ( appenginepb "google.golang.org/genproto/googleapis/appengine/v1" "google.golang.org/grpc" "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/proto" ) var newAuthorizedCertificatesClientHook clientHook diff --git a/appengine/apiv1/authorized_domains_client.go b/appengine/apiv1/authorized_domains_client.go index d506cc6a0dc..40d3bc37b4a 100644 --- a/appengine/apiv1/authorized_domains_client.go +++ b/appengine/apiv1/authorized_domains_client.go @@ -22,7 +22,6 @@ import ( "math" "net/url" - "github.com/golang/protobuf/proto" gax "github.com/googleapis/gax-go/v2" "google.golang.org/api/iterator" "google.golang.org/api/option" @@ -31,6 +30,7 @@ import ( appenginepb "google.golang.org/genproto/googleapis/appengine/v1" "google.golang.org/grpc" "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/proto" ) var newAuthorizedDomainsClientHook clientHook diff --git a/appengine/apiv1/doc.go b/appengine/apiv1/doc.go index 758444d2d16..73ed39d498f 100644 --- a/appengine/apiv1/doc.go +++ b/appengine/apiv1/doc.go @@ -48,7 +48,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210612" +const versionClient = "20210624" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/appengine/apiv1/domain_mappings_client.go b/appengine/apiv1/domain_mappings_client.go index 1b7eaf21704..f28220e6928 100644 --- a/appengine/apiv1/domain_mappings_client.go +++ b/appengine/apiv1/domain_mappings_client.go @@ -25,7 +25,6 @@ import ( "cloud.google.com/go/longrunning" lroauto "cloud.google.com/go/longrunning/autogen" - "github.com/golang/protobuf/proto" gax "github.com/googleapis/gax-go/v2" "google.golang.org/api/iterator" "google.golang.org/api/option" @@ -35,6 +34,7 @@ import ( longrunningpb "google.golang.org/genproto/googleapis/longrunning" "google.golang.org/grpc" "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/proto" ) var newDomainMappingsClientHook clientHook diff --git a/appengine/apiv1/firewall_client.go b/appengine/apiv1/firewall_client.go index e8389c7440d..931f057918a 100644 --- a/appengine/apiv1/firewall_client.go +++ b/appengine/apiv1/firewall_client.go @@ -22,7 +22,6 @@ import ( "math" "net/url" - "github.com/golang/protobuf/proto" gax "github.com/googleapis/gax-go/v2" "google.golang.org/api/iterator" "google.golang.org/api/option" @@ -31,6 +30,7 @@ import ( appenginepb "google.golang.org/genproto/googleapis/appengine/v1" "google.golang.org/grpc" "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/proto" ) var newFirewallClientHook clientHook diff --git a/appengine/apiv1/gapic_metadata.json b/appengine/apiv1/gapic_metadata.json index c8dde65ebcc..aa7fd194333 100644 --- a/appengine/apiv1/gapic_metadata.json +++ b/appengine/apiv1/gapic_metadata.json @@ -1,32 +1,32 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.appengine.v1", - "libraryPackage": "cloud.google.com/go/appengine/apiv1", - "services": { - "Applications": { - "clients": { - "grpc": { - "libraryClient": "ApplicationsClient", - "rpcs": { - "CreateApplication": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.appengine.v1", + "libraryPackage": "cloud.google.com/go/appengine/apiv1", + "services": { + "Applications": { + "clients": { + "grpc": { + "libraryClient": "ApplicationsClient", + "rpcs": { + "CreateApplication": { + "methods": [ "CreateApplication" ] }, - "GetApplication": { - "methods": [ + "GetApplication": { + "methods": [ "GetApplication" ] }, - "RepairApplication": { - "methods": [ + "RepairApplication": { + "methods": [ "RepairApplication" ] }, - "UpdateApplication": { - "methods": [ + "UpdateApplication": { + "methods": [ "UpdateApplication" ] } @@ -34,33 +34,33 @@ } } }, - "AuthorizedCertificates": { - "clients": { - "grpc": { - "libraryClient": "AuthorizedCertificatesClient", - "rpcs": { - "CreateAuthorizedCertificate": { - "methods": [ + "AuthorizedCertificates": { + "clients": { + "grpc": { + "libraryClient": "AuthorizedCertificatesClient", + "rpcs": { + "CreateAuthorizedCertificate": { + "methods": [ "CreateAuthorizedCertificate" ] }, - "DeleteAuthorizedCertificate": { - "methods": [ + "DeleteAuthorizedCertificate": { + "methods": [ "DeleteAuthorizedCertificate" ] }, - "GetAuthorizedCertificate": { - "methods": [ + "GetAuthorizedCertificate": { + "methods": [ "GetAuthorizedCertificate" ] }, - "ListAuthorizedCertificates": { - "methods": [ + "ListAuthorizedCertificates": { + "methods": [ "ListAuthorizedCertificates" ] }, - "UpdateAuthorizedCertificate": { - "methods": [ + "UpdateAuthorizedCertificate": { + "methods": [ "UpdateAuthorizedCertificate" ] } @@ -68,13 +68,13 @@ } } }, - "AuthorizedDomains": { - "clients": { - "grpc": { - "libraryClient": "AuthorizedDomainsClient", - "rpcs": { - "ListAuthorizedDomains": { - "methods": [ + "AuthorizedDomains": { + "clients": { + "grpc": { + "libraryClient": "AuthorizedDomainsClient", + "rpcs": { + "ListAuthorizedDomains": { + "methods": [ "ListAuthorizedDomains" ] } @@ -82,33 +82,33 @@ } } }, - "DomainMappings": { - "clients": { - "grpc": { - "libraryClient": "DomainMappingsClient", - "rpcs": { - "CreateDomainMapping": { - "methods": [ + "DomainMappings": { + "clients": { + "grpc": { + "libraryClient": "DomainMappingsClient", + "rpcs": { + "CreateDomainMapping": { + "methods": [ "CreateDomainMapping" ] }, - "DeleteDomainMapping": { - "methods": [ + "DeleteDomainMapping": { + "methods": [ "DeleteDomainMapping" ] }, - "GetDomainMapping": { - "methods": [ + "GetDomainMapping": { + "methods": [ "GetDomainMapping" ] }, - "ListDomainMappings": { - "methods": [ + "ListDomainMappings": { + "methods": [ "ListDomainMappings" ] }, - "UpdateDomainMapping": { - "methods": [ + "UpdateDomainMapping": { + "methods": [ "UpdateDomainMapping" ] } @@ -116,38 +116,38 @@ } } }, - "Firewall": { - "clients": { - "grpc": { - "libraryClient": "FirewallClient", - "rpcs": { - "BatchUpdateIngressRules": { - "methods": [ + "Firewall": { + "clients": { + "grpc": { + "libraryClient": "FirewallClient", + "rpcs": { + "BatchUpdateIngressRules": { + "methods": [ "BatchUpdateIngressRules" ] }, - "CreateIngressRule": { - "methods": [ + "CreateIngressRule": { + "methods": [ "CreateIngressRule" ] }, - "DeleteIngressRule": { - "methods": [ + "DeleteIngressRule": { + "methods": [ "DeleteIngressRule" ] }, - "GetIngressRule": { - "methods": [ + "GetIngressRule": { + "methods": [ "GetIngressRule" ] }, - "ListIngressRules": { - "methods": [ + "ListIngressRules": { + "methods": [ "ListIngressRules" ] }, - "UpdateIngressRule": { - "methods": [ + "UpdateIngressRule": { + "methods": [ "UpdateIngressRule" ] } @@ -155,28 +155,28 @@ } } }, - "Instances": { - "clients": { - "grpc": { - "libraryClient": "InstancesClient", - "rpcs": { - "DebugInstance": { - "methods": [ + "Instances": { + "clients": { + "grpc": { + "libraryClient": "InstancesClient", + "rpcs": { + "DebugInstance": { + "methods": [ "DebugInstance" ] }, - "DeleteInstance": { - "methods": [ + "DeleteInstance": { + "methods": [ "DeleteInstance" ] }, - "GetInstance": { - "methods": [ + "GetInstance": { + "methods": [ "GetInstance" ] }, - "ListInstances": { - "methods": [ + "ListInstances": { + "methods": [ "ListInstances" ] } @@ -184,28 +184,28 @@ } } }, - "Services": { - "clients": { - "grpc": { - "libraryClient": "ServicesClient", - "rpcs": { - "DeleteService": { - "methods": [ + "Services": { + "clients": { + "grpc": { + "libraryClient": "ServicesClient", + "rpcs": { + "DeleteService": { + "methods": [ "DeleteService" ] }, - "GetService": { - "methods": [ + "GetService": { + "methods": [ "GetService" ] }, - "ListServices": { - "methods": [ + "ListServices": { + "methods": [ "ListServices" ] }, - "UpdateService": { - "methods": [ + "UpdateService": { + "methods": [ "UpdateService" ] } @@ -213,33 +213,33 @@ } } }, - "Versions": { - "clients": { - "grpc": { - "libraryClient": "VersionsClient", - "rpcs": { - "CreateVersion": { - "methods": [ + "Versions": { + "clients": { + "grpc": { + "libraryClient": "VersionsClient", + "rpcs": { + "CreateVersion": { + "methods": [ "CreateVersion" ] }, - "DeleteVersion": { - "methods": [ + "DeleteVersion": { + "methods": [ "DeleteVersion" ] }, - "GetVersion": { - "methods": [ + "GetVersion": { + "methods": [ "GetVersion" ] }, - "ListVersions": { - "methods": [ + "ListVersions": { + "methods": [ "ListVersions" ] }, - "UpdateVersion": { - "methods": [ + "UpdateVersion": { + "methods": [ "UpdateVersion" ] } diff --git a/appengine/apiv1/instances_client.go b/appengine/apiv1/instances_client.go index e13fcc2617b..f4512dd8fe3 100644 --- a/appengine/apiv1/instances_client.go +++ b/appengine/apiv1/instances_client.go @@ -25,7 +25,6 @@ import ( "cloud.google.com/go/longrunning" lroauto "cloud.google.com/go/longrunning/autogen" - "github.com/golang/protobuf/proto" gax "github.com/googleapis/gax-go/v2" "google.golang.org/api/iterator" "google.golang.org/api/option" @@ -35,6 +34,7 @@ import ( longrunningpb "google.golang.org/genproto/googleapis/longrunning" "google.golang.org/grpc" "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/proto" ) var newInstancesClientHook clientHook diff --git a/appengine/apiv1/services_client.go b/appengine/apiv1/services_client.go index ba575b48ab4..4fa5ef0bfce 100644 --- a/appengine/apiv1/services_client.go +++ b/appengine/apiv1/services_client.go @@ -25,7 +25,6 @@ import ( "cloud.google.com/go/longrunning" lroauto "cloud.google.com/go/longrunning/autogen" - "github.com/golang/protobuf/proto" gax "github.com/googleapis/gax-go/v2" "google.golang.org/api/iterator" "google.golang.org/api/option" @@ -35,6 +34,7 @@ import ( longrunningpb "google.golang.org/genproto/googleapis/longrunning" "google.golang.org/grpc" "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/proto" ) var newServicesClientHook clientHook diff --git a/appengine/apiv1/versions_client.go b/appengine/apiv1/versions_client.go index 043fa132a0f..81c88c3d359 100644 --- a/appengine/apiv1/versions_client.go +++ b/appengine/apiv1/versions_client.go @@ -25,7 +25,6 @@ import ( "cloud.google.com/go/longrunning" lroauto "cloud.google.com/go/longrunning/autogen" - "github.com/golang/protobuf/proto" gax "github.com/googleapis/gax-go/v2" "google.golang.org/api/iterator" "google.golang.org/api/option" @@ -35,6 +34,7 @@ import ( longrunningpb "google.golang.org/genproto/googleapis/longrunning" "google.golang.org/grpc" "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/proto" ) var newVersionsClientHook clientHook diff --git a/area120/tables/apiv1alpha1/doc.go b/area120/tables/apiv1alpha1/doc.go index 146530b7a06..42f4c1ee7ab 100644 --- a/area120/tables/apiv1alpha1/doc.go +++ b/area120/tables/apiv1alpha1/doc.go @@ -48,7 +48,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210612" +const versionClient = "20210624" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/area120/tables/apiv1alpha1/gapic_metadata.json b/area120/tables/apiv1alpha1/gapic_metadata.json index 5e6200fc68e..784712b0fcb 100644 --- a/area120/tables/apiv1alpha1/gapic_metadata.json +++ b/area120/tables/apiv1alpha1/gapic_metadata.json @@ -1,72 +1,72 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.area120.tables.v1alpha1", - "libraryPackage": "cloud.google.com/go/area120/tables/apiv1alpha1", - "services": { - "TablesService": { - "clients": { - "grpc": { - "libraryClient": "Client", - "rpcs": { - "BatchCreateRows": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.area120.tables.v1alpha1", + "libraryPackage": "cloud.google.com/go/area120/tables/apiv1alpha1", + "services": { + "TablesService": { + "clients": { + "grpc": { + "libraryClient": "Client", + "rpcs": { + "BatchCreateRows": { + "methods": [ "BatchCreateRows" ] }, - "BatchDeleteRows": { - "methods": [ + "BatchDeleteRows": { + "methods": [ "BatchDeleteRows" ] }, - "BatchUpdateRows": { - "methods": [ + "BatchUpdateRows": { + "methods": [ "BatchUpdateRows" ] }, - "CreateRow": { - "methods": [ + "CreateRow": { + "methods": [ "CreateRow" ] }, - "DeleteRow": { - "methods": [ + "DeleteRow": { + "methods": [ "DeleteRow" ] }, - "GetRow": { - "methods": [ + "GetRow": { + "methods": [ "GetRow" ] }, - "GetTable": { - "methods": [ + "GetTable": { + "methods": [ "GetTable" ] }, - "GetWorkspace": { - "methods": [ + "GetWorkspace": { + "methods": [ "GetWorkspace" ] }, - "ListRows": { - "methods": [ + "ListRows": { + "methods": [ "ListRows" ] }, - "ListTables": { - "methods": [ + "ListTables": { + "methods": [ "ListTables" ] }, - "ListWorkspaces": { - "methods": [ + "ListWorkspaces": { + "methods": [ "ListWorkspaces" ] }, - "UpdateRow": { - "methods": [ + "UpdateRow": { + "methods": [ "UpdateRow" ] } diff --git a/area120/tables/apiv1alpha1/tables_client.go b/area120/tables/apiv1alpha1/tables_client.go index fedd9b53f4a..b5ac43890a8 100644 --- a/area120/tables/apiv1alpha1/tables_client.go +++ b/area120/tables/apiv1alpha1/tables_client.go @@ -23,7 +23,6 @@ import ( "net/url" "time" - "github.com/golang/protobuf/proto" gax "github.com/googleapis/gax-go/v2" "google.golang.org/api/iterator" "google.golang.org/api/option" @@ -32,6 +31,7 @@ import ( tablespb "google.golang.org/genproto/googleapis/area120/tables/v1alpha1" "google.golang.org/grpc" "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/proto" ) var newClientHook clientHook diff --git a/artifactregistry/apiv1beta2/artifact_registry_client.go b/artifactregistry/apiv1beta2/artifact_registry_client.go index 19b331caaff..425e01f9eba 100644 --- a/artifactregistry/apiv1beta2/artifact_registry_client.go +++ b/artifactregistry/apiv1beta2/artifact_registry_client.go @@ -25,7 +25,6 @@ import ( "cloud.google.com/go/longrunning" lroauto "cloud.google.com/go/longrunning/autogen" - "github.com/golang/protobuf/proto" gax "github.com/googleapis/gax-go/v2" "google.golang.org/api/iterator" "google.golang.org/api/option" @@ -37,6 +36,7 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/proto" ) var newClientHook clientHook diff --git a/artifactregistry/apiv1beta2/doc.go b/artifactregistry/apiv1beta2/doc.go index 253bcc22ee3..353bdb59229 100644 --- a/artifactregistry/apiv1beta2/doc.go +++ b/artifactregistry/apiv1beta2/doc.go @@ -49,7 +49,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210612" +const versionClient = "20210624" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/artifactregistry/apiv1beta2/gapic_metadata.json b/artifactregistry/apiv1beta2/gapic_metadata.json index 8777a1d7cce..796c707d3a8 100644 --- a/artifactregistry/apiv1beta2/gapic_metadata.json +++ b/artifactregistry/apiv1beta2/gapic_metadata.json @@ -1,117 +1,117 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.devtools.artifactregistry.v1beta2", - "libraryPackage": "cloud.google.com/go/artifactregistry/apiv1beta2", - "services": { - "ArtifactRegistry": { - "clients": { - "grpc": { - "libraryClient": "Client", - "rpcs": { - "CreateRepository": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.devtools.artifactregistry.v1beta2", + "libraryPackage": "cloud.google.com/go/artifactregistry/apiv1beta2", + "services": { + "ArtifactRegistry": { + "clients": { + "grpc": { + "libraryClient": "Client", + "rpcs": { + "CreateRepository": { + "methods": [ "CreateRepository" ] }, - "CreateTag": { - "methods": [ + "CreateTag": { + "methods": [ "CreateTag" ] }, - "DeletePackage": { - "methods": [ + "DeletePackage": { + "methods": [ "DeletePackage" ] }, - "DeleteRepository": { - "methods": [ + "DeleteRepository": { + "methods": [ "DeleteRepository" ] }, - "DeleteTag": { - "methods": [ + "DeleteTag": { + "methods": [ "DeleteTag" ] }, - "DeleteVersion": { - "methods": [ + "DeleteVersion": { + "methods": [ "DeleteVersion" ] }, - "GetFile": { - "methods": [ + "GetFile": { + "methods": [ "GetFile" ] }, - "GetIamPolicy": { - "methods": [ + "GetIamPolicy": { + "methods": [ "GetIamPolicy" ] }, - "GetPackage": { - "methods": [ + "GetPackage": { + "methods": [ "GetPackage" ] }, - "GetRepository": { - "methods": [ + "GetRepository": { + "methods": [ "GetRepository" ] }, - "GetTag": { - "methods": [ + "GetTag": { + "methods": [ "GetTag" ] }, - "GetVersion": { - "methods": [ + "GetVersion": { + "methods": [ "GetVersion" ] }, - "ListFiles": { - "methods": [ + "ListFiles": { + "methods": [ "ListFiles" ] }, - "ListPackages": { - "methods": [ + "ListPackages": { + "methods": [ "ListPackages" ] }, - "ListRepositories": { - "methods": [ + "ListRepositories": { + "methods": [ "ListRepositories" ] }, - "ListTags": { - "methods": [ + "ListTags": { + "methods": [ "ListTags" ] }, - "ListVersions": { - "methods": [ + "ListVersions": { + "methods": [ "ListVersions" ] }, - "SetIamPolicy": { - "methods": [ + "SetIamPolicy": { + "methods": [ "SetIamPolicy" ] }, - "TestIamPermissions": { - "methods": [ + "TestIamPermissions": { + "methods": [ "TestIamPermissions" ] }, - "UpdateRepository": { - "methods": [ + "UpdateRepository": { + "methods": [ "UpdateRepository" ] }, - "UpdateTag": { - "methods": [ + "UpdateTag": { + "methods": [ "UpdateTag" ] } diff --git a/asset/apiv1/asset_client.go b/asset/apiv1/asset_client.go index d94d417823d..c1005cd63d9 100644 --- a/asset/apiv1/asset_client.go +++ b/asset/apiv1/asset_client.go @@ -25,7 +25,6 @@ import ( "cloud.google.com/go/longrunning" lroauto "cloud.google.com/go/longrunning/autogen" - "github.com/golang/protobuf/proto" gax "github.com/googleapis/gax-go/v2" "google.golang.org/api/iterator" "google.golang.org/api/option" @@ -36,6 +35,7 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/proto" ) var newClientHook clientHook @@ -136,7 +136,6 @@ func defaultCallOptions() *CallOptions { SearchAllResources: []gax.CallOption{ gax.WithRetry(func() gax.Retryer { return gax.OnCodes([]codes.Code{ - codes.DeadlineExceeded, codes.Unavailable, }, gax.Backoff{ Initial: 100 * time.Millisecond, @@ -148,7 +147,6 @@ func defaultCallOptions() *CallOptions { SearchAllIamPolicies: []gax.CallOption{ gax.WithRetry(func() gax.Retryer { return gax.OnCodes([]codes.Code{ - codes.DeadlineExceeded, codes.Unavailable, }, gax.Backoff{ Initial: 100 * time.Millisecond, diff --git a/asset/apiv1/doc.go b/asset/apiv1/doc.go index 6ee437ef7b7..ecf4935fca9 100644 --- a/asset/apiv1/doc.go +++ b/asset/apiv1/doc.go @@ -48,7 +48,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210612" +const versionClient = "20210624" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/asset/apiv1/gapic_metadata.json b/asset/apiv1/gapic_metadata.json index dd6e9fda56a..9fac653bb97 100644 --- a/asset/apiv1/gapic_metadata.json +++ b/asset/apiv1/gapic_metadata.json @@ -1,72 +1,72 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.asset.v1", - "libraryPackage": "cloud.google.com/go/asset/apiv1", - "services": { - "AssetService": { - "clients": { - "grpc": { - "libraryClient": "Client", - "rpcs": { - "AnalyzeIamPolicy": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.asset.v1", + "libraryPackage": "cloud.google.com/go/asset/apiv1", + "services": { + "AssetService": { + "clients": { + "grpc": { + "libraryClient": "Client", + "rpcs": { + "AnalyzeIamPolicy": { + "methods": [ "AnalyzeIamPolicy" ] }, - "AnalyzeIamPolicyLongrunning": { - "methods": [ + "AnalyzeIamPolicyLongrunning": { + "methods": [ "AnalyzeIamPolicyLongrunning" ] }, - "BatchGetAssetsHistory": { - "methods": [ + "BatchGetAssetsHistory": { + "methods": [ "BatchGetAssetsHistory" ] }, - "CreateFeed": { - "methods": [ + "CreateFeed": { + "methods": [ "CreateFeed" ] }, - "DeleteFeed": { - "methods": [ + "DeleteFeed": { + "methods": [ "DeleteFeed" ] }, - "ExportAssets": { - "methods": [ + "ExportAssets": { + "methods": [ "ExportAssets" ] }, - "GetFeed": { - "methods": [ + "GetFeed": { + "methods": [ "GetFeed" ] }, - "ListAssets": { - "methods": [ + "ListAssets": { + "methods": [ "ListAssets" ] }, - "ListFeeds": { - "methods": [ + "ListFeeds": { + "methods": [ "ListFeeds" ] }, - "SearchAllIamPolicies": { - "methods": [ + "SearchAllIamPolicies": { + "methods": [ "SearchAllIamPolicies" ] }, - "SearchAllResources": { - "methods": [ + "SearchAllResources": { + "methods": [ "SearchAllResources" ] }, - "UpdateFeed": { - "methods": [ + "UpdateFeed": { + "methods": [ "UpdateFeed" ] } diff --git a/asset/apiv1p2beta1/doc.go b/asset/apiv1p2beta1/doc.go index abad0941ffe..071b7424e9e 100644 --- a/asset/apiv1p2beta1/doc.go +++ b/asset/apiv1p2beta1/doc.go @@ -50,7 +50,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210612" +const versionClient = "20210624" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/asset/apiv1p2beta1/gapic_metadata.json b/asset/apiv1p2beta1/gapic_metadata.json index ea91937f100..606a6f8f023 100644 --- a/asset/apiv1p2beta1/gapic_metadata.json +++ b/asset/apiv1p2beta1/gapic_metadata.json @@ -1,37 +1,37 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.asset.v1p2beta1", - "libraryPackage": "cloud.google.com/go/asset/apiv1p2beta1", - "services": { - "AssetService": { - "clients": { - "grpc": { - "libraryClient": "Client", - "rpcs": { - "CreateFeed": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.asset.v1p2beta1", + "libraryPackage": "cloud.google.com/go/asset/apiv1p2beta1", + "services": { + "AssetService": { + "clients": { + "grpc": { + "libraryClient": "Client", + "rpcs": { + "CreateFeed": { + "methods": [ "CreateFeed" ] }, - "DeleteFeed": { - "methods": [ + "DeleteFeed": { + "methods": [ "DeleteFeed" ] }, - "GetFeed": { - "methods": [ + "GetFeed": { + "methods": [ "GetFeed" ] }, - "ListFeeds": { - "methods": [ + "ListFeeds": { + "methods": [ "ListFeeds" ] }, - "UpdateFeed": { - "methods": [ + "UpdateFeed": { + "methods": [ "UpdateFeed" ] } diff --git a/asset/apiv1p5beta1/asset_client.go b/asset/apiv1p5beta1/asset_client.go index c8036dcf923..f075b1ca1b1 100644 --- a/asset/apiv1p5beta1/asset_client.go +++ b/asset/apiv1p5beta1/asset_client.go @@ -23,7 +23,6 @@ import ( "net/url" "time" - "github.com/golang/protobuf/proto" gax "github.com/googleapis/gax-go/v2" "google.golang.org/api/iterator" "google.golang.org/api/option" @@ -33,6 +32,7 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/proto" ) var newClientHook clientHook diff --git a/asset/apiv1p5beta1/doc.go b/asset/apiv1p5beta1/doc.go index 9159be7ba3c..a820baf58c9 100644 --- a/asset/apiv1p5beta1/doc.go +++ b/asset/apiv1p5beta1/doc.go @@ -50,7 +50,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210612" +const versionClient = "20210624" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/asset/apiv1p5beta1/gapic_metadata.json b/asset/apiv1p5beta1/gapic_metadata.json index f8255c2a8b3..19e22893b65 100644 --- a/asset/apiv1p5beta1/gapic_metadata.json +++ b/asset/apiv1p5beta1/gapic_metadata.json @@ -1,17 +1,17 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.asset.v1p5beta1", - "libraryPackage": "cloud.google.com/go/asset/apiv1p5beta1", - "services": { - "AssetService": { - "clients": { - "grpc": { - "libraryClient": "Client", - "rpcs": { - "ListAssets": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.asset.v1p5beta1", + "libraryPackage": "cloud.google.com/go/asset/apiv1p5beta1", + "services": { + "AssetService": { + "clients": { + "grpc": { + "libraryClient": "Client", + "rpcs": { + "ListAssets": { + "methods": [ "ListAssets" ] } diff --git a/assuredworkloads/apiv1beta1/assured_workloads_client.go b/assuredworkloads/apiv1beta1/assured_workloads_client.go index 7f6b73b835d..3af6175f310 100644 --- a/assuredworkloads/apiv1beta1/assured_workloads_client.go +++ b/assuredworkloads/apiv1beta1/assured_workloads_client.go @@ -25,7 +25,6 @@ import ( "cloud.google.com/go/longrunning" lroauto "cloud.google.com/go/longrunning/autogen" - "github.com/golang/protobuf/proto" gax "github.com/googleapis/gax-go/v2" "google.golang.org/api/iterator" "google.golang.org/api/option" @@ -36,6 +35,7 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/proto" ) var newClientHook clientHook diff --git a/assuredworkloads/apiv1beta1/doc.go b/assuredworkloads/apiv1beta1/doc.go index 778e1a1b283..0a41bd280b2 100644 --- a/assuredworkloads/apiv1beta1/doc.go +++ b/assuredworkloads/apiv1beta1/doc.go @@ -48,7 +48,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210612" +const versionClient = "20210624" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/assuredworkloads/apiv1beta1/gapic_metadata.json b/assuredworkloads/apiv1beta1/gapic_metadata.json index fca15a740bd..a7cf211d9ce 100644 --- a/assuredworkloads/apiv1beta1/gapic_metadata.json +++ b/assuredworkloads/apiv1beta1/gapic_metadata.json @@ -1,37 +1,37 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.assuredworkloads.v1beta1", - "libraryPackage": "cloud.google.com/go/assuredworkloads/apiv1beta1", - "services": { - "AssuredWorkloadsService": { - "clients": { - "grpc": { - "libraryClient": "Client", - "rpcs": { - "CreateWorkload": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.assuredworkloads.v1beta1", + "libraryPackage": "cloud.google.com/go/assuredworkloads/apiv1beta1", + "services": { + "AssuredWorkloadsService": { + "clients": { + "grpc": { + "libraryClient": "Client", + "rpcs": { + "CreateWorkload": { + "methods": [ "CreateWorkload" ] }, - "DeleteWorkload": { - "methods": [ + "DeleteWorkload": { + "methods": [ "DeleteWorkload" ] }, - "GetWorkload": { - "methods": [ + "GetWorkload": { + "methods": [ "GetWorkload" ] }, - "ListWorkloads": { - "methods": [ + "ListWorkloads": { + "methods": [ "ListWorkloads" ] }, - "UpdateWorkload": { - "methods": [ + "UpdateWorkload": { + "methods": [ "UpdateWorkload" ] } diff --git a/automl/apiv1/auto_ml_client.go b/automl/apiv1/auto_ml_client.go index 1dff2414438..30e4cadafa2 100644 --- a/automl/apiv1/auto_ml_client.go +++ b/automl/apiv1/auto_ml_client.go @@ -25,7 +25,6 @@ import ( "cloud.google.com/go/longrunning" lroauto "cloud.google.com/go/longrunning/autogen" - "github.com/golang/protobuf/proto" gax "github.com/googleapis/gax-go/v2" "google.golang.org/api/iterator" "google.golang.org/api/option" @@ -36,6 +35,7 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/proto" ) var newClientHook clientHook diff --git a/automl/apiv1/doc.go b/automl/apiv1/doc.go index c44f6bd4e1d..cb7251363a3 100644 --- a/automl/apiv1/doc.go +++ b/automl/apiv1/doc.go @@ -49,7 +49,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210612" +const versionClient = "20210624" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/automl/apiv1/gapic_metadata.json b/automl/apiv1/gapic_metadata.json index e31b1eb209b..4f529c50ce0 100644 --- a/automl/apiv1/gapic_metadata.json +++ b/automl/apiv1/gapic_metadata.json @@ -1,102 +1,102 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.automl.v1", - "libraryPackage": "cloud.google.com/go/automl/apiv1", - "services": { - "AutoMl": { - "clients": { - "grpc": { - "libraryClient": "Client", - "rpcs": { - "CreateDataset": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.automl.v1", + "libraryPackage": "cloud.google.com/go/automl/apiv1", + "services": { + "AutoMl": { + "clients": { + "grpc": { + "libraryClient": "Client", + "rpcs": { + "CreateDataset": { + "methods": [ "CreateDataset" ] }, - "CreateModel": { - "methods": [ + "CreateModel": { + "methods": [ "CreateModel" ] }, - "DeleteDataset": { - "methods": [ + "DeleteDataset": { + "methods": [ "DeleteDataset" ] }, - "DeleteModel": { - "methods": [ + "DeleteModel": { + "methods": [ "DeleteModel" ] }, - "DeployModel": { - "methods": [ + "DeployModel": { + "methods": [ "DeployModel" ] }, - "ExportData": { - "methods": [ + "ExportData": { + "methods": [ "ExportData" ] }, - "ExportModel": { - "methods": [ + "ExportModel": { + "methods": [ "ExportModel" ] }, - "GetAnnotationSpec": { - "methods": [ + "GetAnnotationSpec": { + "methods": [ "GetAnnotationSpec" ] }, - "GetDataset": { - "methods": [ + "GetDataset": { + "methods": [ "GetDataset" ] }, - "GetModel": { - "methods": [ + "GetModel": { + "methods": [ "GetModel" ] }, - "GetModelEvaluation": { - "methods": [ + "GetModelEvaluation": { + "methods": [ "GetModelEvaluation" ] }, - "ImportData": { - "methods": [ + "ImportData": { + "methods": [ "ImportData" ] }, - "ListDatasets": { - "methods": [ + "ListDatasets": { + "methods": [ "ListDatasets" ] }, - "ListModelEvaluations": { - "methods": [ + "ListModelEvaluations": { + "methods": [ "ListModelEvaluations" ] }, - "ListModels": { - "methods": [ + "ListModels": { + "methods": [ "ListModels" ] }, - "UndeployModel": { - "methods": [ + "UndeployModel": { + "methods": [ "UndeployModel" ] }, - "UpdateDataset": { - "methods": [ + "UpdateDataset": { + "methods": [ "UpdateDataset" ] }, - "UpdateModel": { - "methods": [ + "UpdateModel": { + "methods": [ "UpdateModel" ] } @@ -104,18 +104,18 @@ } } }, - "PredictionService": { - "clients": { - "grpc": { - "libraryClient": "PredictionClient", - "rpcs": { - "BatchPredict": { - "methods": [ + "PredictionService": { + "clients": { + "grpc": { + "libraryClient": "PredictionClient", + "rpcs": { + "BatchPredict": { + "methods": [ "BatchPredict" ] }, - "Predict": { - "methods": [ + "Predict": { + "methods": [ "Predict" ] } diff --git a/automl/apiv1beta1/auto_ml_client.go b/automl/apiv1beta1/auto_ml_client.go index 9124de33525..cb8b9e07609 100644 --- a/automl/apiv1beta1/auto_ml_client.go +++ b/automl/apiv1beta1/auto_ml_client.go @@ -25,7 +25,6 @@ import ( "cloud.google.com/go/longrunning" lroauto "cloud.google.com/go/longrunning/autogen" - "github.com/golang/protobuf/proto" gax "github.com/googleapis/gax-go/v2" "google.golang.org/api/iterator" "google.golang.org/api/option" @@ -36,6 +35,7 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/proto" ) var newClientHook clientHook diff --git a/automl/apiv1beta1/doc.go b/automl/apiv1beta1/doc.go index 9018a5ef277..bf0e3ddba40 100644 --- a/automl/apiv1beta1/doc.go +++ b/automl/apiv1beta1/doc.go @@ -51,7 +51,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210612" +const versionClient = "20210624" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/automl/apiv1beta1/gapic_metadata.json b/automl/apiv1beta1/gapic_metadata.json index d7f1ce28366..c53df53d62f 100644 --- a/automl/apiv1beta1/gapic_metadata.json +++ b/automl/apiv1beta1/gapic_metadata.json @@ -1,132 +1,132 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.automl.v1beta1", - "libraryPackage": "cloud.google.com/go/automl/apiv1beta1", - "services": { - "AutoMl": { - "clients": { - "grpc": { - "libraryClient": "Client", - "rpcs": { - "CreateDataset": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.automl.v1beta1", + "libraryPackage": "cloud.google.com/go/automl/apiv1beta1", + "services": { + "AutoMl": { + "clients": { + "grpc": { + "libraryClient": "Client", + "rpcs": { + "CreateDataset": { + "methods": [ "CreateDataset" ] }, - "CreateModel": { - "methods": [ + "CreateModel": { + "methods": [ "CreateModel" ] }, - "DeleteDataset": { - "methods": [ + "DeleteDataset": { + "methods": [ "DeleteDataset" ] }, - "DeleteModel": { - "methods": [ + "DeleteModel": { + "methods": [ "DeleteModel" ] }, - "DeployModel": { - "methods": [ + "DeployModel": { + "methods": [ "DeployModel" ] }, - "ExportData": { - "methods": [ + "ExportData": { + "methods": [ "ExportData" ] }, - "ExportEvaluatedExamples": { - "methods": [ + "ExportEvaluatedExamples": { + "methods": [ "ExportEvaluatedExamples" ] }, - "ExportModel": { - "methods": [ + "ExportModel": { + "methods": [ "ExportModel" ] }, - "GetAnnotationSpec": { - "methods": [ + "GetAnnotationSpec": { + "methods": [ "GetAnnotationSpec" ] }, - "GetColumnSpec": { - "methods": [ + "GetColumnSpec": { + "methods": [ "GetColumnSpec" ] }, - "GetDataset": { - "methods": [ + "GetDataset": { + "methods": [ "GetDataset" ] }, - "GetModel": { - "methods": [ + "GetModel": { + "methods": [ "GetModel" ] }, - "GetModelEvaluation": { - "methods": [ + "GetModelEvaluation": { + "methods": [ "GetModelEvaluation" ] }, - "GetTableSpec": { - "methods": [ + "GetTableSpec": { + "methods": [ "GetTableSpec" ] }, - "ImportData": { - "methods": [ + "ImportData": { + "methods": [ "ImportData" ] }, - "ListColumnSpecs": { - "methods": [ + "ListColumnSpecs": { + "methods": [ "ListColumnSpecs" ] }, - "ListDatasets": { - "methods": [ + "ListDatasets": { + "methods": [ "ListDatasets" ] }, - "ListModelEvaluations": { - "methods": [ + "ListModelEvaluations": { + "methods": [ "ListModelEvaluations" ] }, - "ListModels": { - "methods": [ + "ListModels": { + "methods": [ "ListModels" ] }, - "ListTableSpecs": { - "methods": [ + "ListTableSpecs": { + "methods": [ "ListTableSpecs" ] }, - "UndeployModel": { - "methods": [ + "UndeployModel": { + "methods": [ "UndeployModel" ] }, - "UpdateColumnSpec": { - "methods": [ + "UpdateColumnSpec": { + "methods": [ "UpdateColumnSpec" ] }, - "UpdateDataset": { - "methods": [ + "UpdateDataset": { + "methods": [ "UpdateDataset" ] }, - "UpdateTableSpec": { - "methods": [ + "UpdateTableSpec": { + "methods": [ "UpdateTableSpec" ] } @@ -134,18 +134,18 @@ } } }, - "PredictionService": { - "clients": { - "grpc": { - "libraryClient": "PredictionClient", - "rpcs": { - "BatchPredict": { - "methods": [ + "PredictionService": { + "clients": { + "grpc": { + "libraryClient": "PredictionClient", + "rpcs": { + "BatchPredict": { + "methods": [ "BatchPredict" ] }, - "Predict": { - "methods": [ + "Predict": { + "methods": [ "Predict" ] } diff --git a/bigquery/connection/apiv1/connection_client.go b/bigquery/connection/apiv1/connection_client.go index fdd24abdd84..d345b06ed40 100644 --- a/bigquery/connection/apiv1/connection_client.go +++ b/bigquery/connection/apiv1/connection_client.go @@ -23,7 +23,6 @@ import ( "net/url" "time" - "github.com/golang/protobuf/proto" gax "github.com/googleapis/gax-go/v2" "google.golang.org/api/iterator" "google.golang.org/api/option" @@ -34,6 +33,7 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/proto" ) var newClientHook clientHook diff --git a/bigquery/connection/apiv1/doc.go b/bigquery/connection/apiv1/doc.go index 32961413a7b..5a23ce1087f 100644 --- a/bigquery/connection/apiv1/doc.go +++ b/bigquery/connection/apiv1/doc.go @@ -48,7 +48,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210612" +const versionClient = "20210624" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/bigquery/connection/apiv1/gapic_metadata.json b/bigquery/connection/apiv1/gapic_metadata.json index c073c217bfb..378c994be01 100644 --- a/bigquery/connection/apiv1/gapic_metadata.json +++ b/bigquery/connection/apiv1/gapic_metadata.json @@ -1,52 +1,52 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.bigquery.connection.v1", - "libraryPackage": "cloud.google.com/go/bigquery/connection/apiv1", - "services": { - "ConnectionService": { - "clients": { - "grpc": { - "libraryClient": "Client", - "rpcs": { - "CreateConnection": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.bigquery.connection.v1", + "libraryPackage": "cloud.google.com/go/bigquery/connection/apiv1", + "services": { + "ConnectionService": { + "clients": { + "grpc": { + "libraryClient": "Client", + "rpcs": { + "CreateConnection": { + "methods": [ "CreateConnection" ] }, - "DeleteConnection": { - "methods": [ + "DeleteConnection": { + "methods": [ "DeleteConnection" ] }, - "GetConnection": { - "methods": [ + "GetConnection": { + "methods": [ "GetConnection" ] }, - "GetIamPolicy": { - "methods": [ + "GetIamPolicy": { + "methods": [ "GetIamPolicy" ] }, - "ListConnections": { - "methods": [ + "ListConnections": { + "methods": [ "ListConnections" ] }, - "SetIamPolicy": { - "methods": [ + "SetIamPolicy": { + "methods": [ "SetIamPolicy" ] }, - "TestIamPermissions": { - "methods": [ + "TestIamPermissions": { + "methods": [ "TestIamPermissions" ] }, - "UpdateConnection": { - "methods": [ + "UpdateConnection": { + "methods": [ "UpdateConnection" ] } diff --git a/bigquery/connection/apiv1beta1/doc.go b/bigquery/connection/apiv1beta1/doc.go index fe78fae5e82..8689f326f64 100644 --- a/bigquery/connection/apiv1beta1/doc.go +++ b/bigquery/connection/apiv1beta1/doc.go @@ -50,7 +50,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210612" +const versionClient = "20210624" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/bigquery/connection/apiv1beta1/gapic_metadata.json b/bigquery/connection/apiv1beta1/gapic_metadata.json index 380ae9f12c3..d3e727f89c5 100644 --- a/bigquery/connection/apiv1beta1/gapic_metadata.json +++ b/bigquery/connection/apiv1beta1/gapic_metadata.json @@ -1,57 +1,57 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.bigquery.connection.v1beta1", - "libraryPackage": "cloud.google.com/go/bigquery/connection/apiv1beta1", - "services": { - "ConnectionService": { - "clients": { - "grpc": { - "libraryClient": "Client", - "rpcs": { - "CreateConnection": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.bigquery.connection.v1beta1", + "libraryPackage": "cloud.google.com/go/bigquery/connection/apiv1beta1", + "services": { + "ConnectionService": { + "clients": { + "grpc": { + "libraryClient": "Client", + "rpcs": { + "CreateConnection": { + "methods": [ "CreateConnection" ] }, - "DeleteConnection": { - "methods": [ + "DeleteConnection": { + "methods": [ "DeleteConnection" ] }, - "GetConnection": { - "methods": [ + "GetConnection": { + "methods": [ "GetConnection" ] }, - "GetIamPolicy": { - "methods": [ + "GetIamPolicy": { + "methods": [ "GetIamPolicy" ] }, - "ListConnections": { - "methods": [ + "ListConnections": { + "methods": [ "ListConnections" ] }, - "SetIamPolicy": { - "methods": [ + "SetIamPolicy": { + "methods": [ "SetIamPolicy" ] }, - "TestIamPermissions": { - "methods": [ + "TestIamPermissions": { + "methods": [ "TestIamPermissions" ] }, - "UpdateConnection": { - "methods": [ + "UpdateConnection": { + "methods": [ "UpdateConnection" ] }, - "UpdateConnectionCredential": { - "methods": [ + "UpdateConnectionCredential": { + "methods": [ "UpdateConnectionCredential" ] } diff --git a/bigquery/datatransfer/apiv1/data_transfer_client.go b/bigquery/datatransfer/apiv1/data_transfer_client.go index a7e075a8e7a..352edbdcbd9 100644 --- a/bigquery/datatransfer/apiv1/data_transfer_client.go +++ b/bigquery/datatransfer/apiv1/data_transfer_client.go @@ -23,7 +23,6 @@ import ( "net/url" "time" - "github.com/golang/protobuf/proto" gax "github.com/googleapis/gax-go/v2" "google.golang.org/api/iterator" "google.golang.org/api/option" @@ -33,6 +32,7 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/proto" ) var newClientHook clientHook diff --git a/bigquery/datatransfer/apiv1/doc.go b/bigquery/datatransfer/apiv1/doc.go index 931d5c6f019..f3377268f1d 100644 --- a/bigquery/datatransfer/apiv1/doc.go +++ b/bigquery/datatransfer/apiv1/doc.go @@ -49,7 +49,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210612" +const versionClient = "20210624" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/bigquery/datatransfer/apiv1/gapic_metadata.json b/bigquery/datatransfer/apiv1/gapic_metadata.json index fd8f604f9b8..caa81c5a3c4 100644 --- a/bigquery/datatransfer/apiv1/gapic_metadata.json +++ b/bigquery/datatransfer/apiv1/gapic_metadata.json @@ -1,82 +1,82 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.bigquery.datatransfer.v1", - "libraryPackage": "cloud.google.com/go/bigquery/datatransfer/apiv1", - "services": { - "DataTransferService": { - "clients": { - "grpc": { - "libraryClient": "Client", - "rpcs": { - "CheckValidCreds": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.bigquery.datatransfer.v1", + "libraryPackage": "cloud.google.com/go/bigquery/datatransfer/apiv1", + "services": { + "DataTransferService": { + "clients": { + "grpc": { + "libraryClient": "Client", + "rpcs": { + "CheckValidCreds": { + "methods": [ "CheckValidCreds" ] }, - "CreateTransferConfig": { - "methods": [ + "CreateTransferConfig": { + "methods": [ "CreateTransferConfig" ] }, - "DeleteTransferConfig": { - "methods": [ + "DeleteTransferConfig": { + "methods": [ "DeleteTransferConfig" ] }, - "DeleteTransferRun": { - "methods": [ + "DeleteTransferRun": { + "methods": [ "DeleteTransferRun" ] }, - "GetDataSource": { - "methods": [ + "GetDataSource": { + "methods": [ "GetDataSource" ] }, - "GetTransferConfig": { - "methods": [ + "GetTransferConfig": { + "methods": [ "GetTransferConfig" ] }, - "GetTransferRun": { - "methods": [ + "GetTransferRun": { + "methods": [ "GetTransferRun" ] }, - "ListDataSources": { - "methods": [ + "ListDataSources": { + "methods": [ "ListDataSources" ] }, - "ListTransferConfigs": { - "methods": [ + "ListTransferConfigs": { + "methods": [ "ListTransferConfigs" ] }, - "ListTransferLogs": { - "methods": [ + "ListTransferLogs": { + "methods": [ "ListTransferLogs" ] }, - "ListTransferRuns": { - "methods": [ + "ListTransferRuns": { + "methods": [ "ListTransferRuns" ] }, - "ScheduleTransferRuns": { - "methods": [ + "ScheduleTransferRuns": { + "methods": [ "ScheduleTransferRuns" ] }, - "StartManualTransferRuns": { - "methods": [ + "StartManualTransferRuns": { + "methods": [ "StartManualTransferRuns" ] }, - "UpdateTransferConfig": { - "methods": [ + "UpdateTransferConfig": { + "methods": [ "UpdateTransferConfig" ] } diff --git a/bigquery/go.mod b/bigquery/go.mod index 74eba857422..5c3ddb8b9db 100644 --- a/bigquery/go.mod +++ b/bigquery/go.mod @@ -9,7 +9,8 @@ require ( github.com/google/go-cmp v0.5.6 github.com/googleapis/gax-go/v2 v2.0.5 golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 - google.golang.org/api v0.48.0 - google.golang.org/genproto v0.0.0-20210614143202-012ab6975634 + google.golang.org/api v0.49.0 + google.golang.org/genproto v0.0.0-20210624174822-c5cf32407d0a google.golang.org/grpc v1.38.0 + google.golang.org/protobuf v1.26.0 ) diff --git a/bigquery/go.sum b/bigquery/go.sum index 4b662411ea8..432875bfea3 100644 --- a/bigquery/go.sum +++ b/bigquery/go.sum @@ -252,8 +252,9 @@ golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5/go.mod h1:KelEdhl1UZF7XfJ golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210220000619-9bb904979d93/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210313182246-cd4f82c27b84/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c h1:pkQiBZBvdos9qq4wBAHqlzuZHEXo07pqV06ef90u1WI= golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210615190721-d04028783cf1 h1:x622Z2o4hgCr/4CiKWc51jHVKaWdtVpBNmEI8wI9Qns= +golang.org/x/oauth2 v0.0.0-20210615190721-d04028783cf1/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -304,8 +305,9 @@ golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210514084401-e8d321eab015/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210603125802-9665404d3644 h1:CA1DEQ4NdKphKeL70tvsWNdT5oFh1lOjihRcEDROi0I= golang.org/x/sys v0.0.0-20210603125802-9665404d3644/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210616094352-59db8d763f22 h1:RqytpXGR1iVNX7psjB3ff8y7sNFinVFvkx1c8SjBkio= +golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -396,8 +398,9 @@ google.golang.org/api v0.40.0/go.mod h1:fYKFpnQN0DsDSKRVRcQSDQNtqWPfM9i+zNPxepjR google.golang.org/api v0.41.0/go.mod h1:RkxM5lITDfTzmyKFPt+wGrCJbVfniCr2ool8kTBzRTU= google.golang.org/api v0.43.0/go.mod h1:nQsDGjRXMo4lvh5hP0TKqF244gqhGcr/YSIykhUk/94= google.golang.org/api v0.47.0/go.mod h1:Wbvgpq1HddcWVtzsVLyfLp8lDg6AA241LmgIL59tHXo= -google.golang.org/api v0.48.0 h1:RDAPWfNFY06dffEXfn7hZF5Fr1ZbnChzfQZAPyBd1+I= google.golang.org/api v0.48.0/go.mod h1:71Pr1vy+TAZRPkPs/xlCf5SsU8WjuAWv1Pfjbtukyy4= +google.golang.org/api v0.49.0 h1:gjIBDxlTG7vnzMmEnYwTnvLTF8Rjzo+ETCgEX1YZ/fY= +google.golang.org/api v0.49.0/go.mod h1:BECiH72wsfwUvOVn3+btPD5WHi0LzavZReBndi42L18= 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.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= @@ -449,8 +452,9 @@ google.golang.org/genproto v0.0.0-20210513213006-bf773b8c8384/go.mod h1:P3QM42oQ google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= google.golang.org/genproto v0.0.0-20210604141403-392c879c8b08/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= google.golang.org/genproto v0.0.0-20210608205507-b6d2f5bf0d7d/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= -google.golang.org/genproto v0.0.0-20210614143202-012ab6975634 h1:LnkHrvncK4mYysgs+R1wPeMAILrmunf0Tzl0Li71pxo= -google.golang.org/genproto v0.0.0-20210614143202-012ab6975634/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24= +google.golang.org/genproto v0.0.0-20210617175327-b9e0b3197ced/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24= +google.golang.org/genproto v0.0.0-20210624174822-c5cf32407d0a h1:b5Bhxmy6Tppar7Yl4J6c6xF33YSBhkm2FtV9/ZQuBkQ= +google.golang.org/genproto v0.0.0-20210624174822-c5cf32407d0a/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= diff --git a/bigquery/reservation/apiv1/doc.go b/bigquery/reservation/apiv1/doc.go index e4e7c567dcc..7b5da64b285 100644 --- a/bigquery/reservation/apiv1/doc.go +++ b/bigquery/reservation/apiv1/doc.go @@ -48,7 +48,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210612" +const versionClient = "20210624" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/bigquery/reservation/apiv1/gapic_metadata.json b/bigquery/reservation/apiv1/gapic_metadata.json index 091d66bb845..4fc5a04ad6b 100644 --- a/bigquery/reservation/apiv1/gapic_metadata.json +++ b/bigquery/reservation/apiv1/gapic_metadata.json @@ -1,107 +1,107 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.bigquery.reservation.v1", - "libraryPackage": "cloud.google.com/go/bigquery/reservation/apiv1", - "services": { - "ReservationService": { - "clients": { - "grpc": { - "libraryClient": "Client", - "rpcs": { - "CreateAssignment": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.bigquery.reservation.v1", + "libraryPackage": "cloud.google.com/go/bigquery/reservation/apiv1", + "services": { + "ReservationService": { + "clients": { + "grpc": { + "libraryClient": "Client", + "rpcs": { + "CreateAssignment": { + "methods": [ "CreateAssignment" ] }, - "CreateCapacityCommitment": { - "methods": [ + "CreateCapacityCommitment": { + "methods": [ "CreateCapacityCommitment" ] }, - "CreateReservation": { - "methods": [ + "CreateReservation": { + "methods": [ "CreateReservation" ] }, - "DeleteAssignment": { - "methods": [ + "DeleteAssignment": { + "methods": [ "DeleteAssignment" ] }, - "DeleteCapacityCommitment": { - "methods": [ + "DeleteCapacityCommitment": { + "methods": [ "DeleteCapacityCommitment" ] }, - "DeleteReservation": { - "methods": [ + "DeleteReservation": { + "methods": [ "DeleteReservation" ] }, - "GetBiReservation": { - "methods": [ + "GetBiReservation": { + "methods": [ "GetBiReservation" ] }, - "GetCapacityCommitment": { - "methods": [ + "GetCapacityCommitment": { + "methods": [ "GetCapacityCommitment" ] }, - "GetReservation": { - "methods": [ + "GetReservation": { + "methods": [ "GetReservation" ] }, - "ListAssignments": { - "methods": [ + "ListAssignments": { + "methods": [ "ListAssignments" ] }, - "ListCapacityCommitments": { - "methods": [ + "ListCapacityCommitments": { + "methods": [ "ListCapacityCommitments" ] }, - "ListReservations": { - "methods": [ + "ListReservations": { + "methods": [ "ListReservations" ] }, - "MergeCapacityCommitments": { - "methods": [ + "MergeCapacityCommitments": { + "methods": [ "MergeCapacityCommitments" ] }, - "MoveAssignment": { - "methods": [ + "MoveAssignment": { + "methods": [ "MoveAssignment" ] }, - "SearchAssignments": { - "methods": [ + "SearchAssignments": { + "methods": [ "SearchAssignments" ] }, - "SplitCapacityCommitment": { - "methods": [ + "SplitCapacityCommitment": { + "methods": [ "SplitCapacityCommitment" ] }, - "UpdateBiReservation": { - "methods": [ + "UpdateBiReservation": { + "methods": [ "UpdateBiReservation" ] }, - "UpdateCapacityCommitment": { - "methods": [ + "UpdateCapacityCommitment": { + "methods": [ "UpdateCapacityCommitment" ] }, - "UpdateReservation": { - "methods": [ + "UpdateReservation": { + "methods": [ "UpdateReservation" ] } diff --git a/bigquery/reservation/apiv1/reservation_client.go b/bigquery/reservation/apiv1/reservation_client.go index b367fac4959..ee600def6b6 100644 --- a/bigquery/reservation/apiv1/reservation_client.go +++ b/bigquery/reservation/apiv1/reservation_client.go @@ -23,7 +23,6 @@ import ( "net/url" "time" - "github.com/golang/protobuf/proto" gax "github.com/googleapis/gax-go/v2" "google.golang.org/api/iterator" "google.golang.org/api/option" @@ -33,6 +32,7 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/proto" ) var newClientHook clientHook diff --git a/bigquery/reservation/apiv1beta1/doc.go b/bigquery/reservation/apiv1beta1/doc.go index 58fdebc2bed..c994cb989a0 100644 --- a/bigquery/reservation/apiv1beta1/doc.go +++ b/bigquery/reservation/apiv1beta1/doc.go @@ -50,7 +50,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210612" +const versionClient = "20210624" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/bigquery/reservation/apiv1beta1/gapic_metadata.json b/bigquery/reservation/apiv1beta1/gapic_metadata.json index 25fd839f9e2..c3240ac48df 100644 --- a/bigquery/reservation/apiv1beta1/gapic_metadata.json +++ b/bigquery/reservation/apiv1beta1/gapic_metadata.json @@ -1,107 +1,107 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.bigquery.reservation.v1beta1", - "libraryPackage": "cloud.google.com/go/bigquery/reservation/apiv1beta1", - "services": { - "ReservationService": { - "clients": { - "grpc": { - "libraryClient": "Client", - "rpcs": { - "CreateAssignment": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.bigquery.reservation.v1beta1", + "libraryPackage": "cloud.google.com/go/bigquery/reservation/apiv1beta1", + "services": { + "ReservationService": { + "clients": { + "grpc": { + "libraryClient": "Client", + "rpcs": { + "CreateAssignment": { + "methods": [ "CreateAssignment" ] }, - "CreateCapacityCommitment": { - "methods": [ + "CreateCapacityCommitment": { + "methods": [ "CreateCapacityCommitment" ] }, - "CreateReservation": { - "methods": [ + "CreateReservation": { + "methods": [ "CreateReservation" ] }, - "DeleteAssignment": { - "methods": [ + "DeleteAssignment": { + "methods": [ "DeleteAssignment" ] }, - "DeleteCapacityCommitment": { - "methods": [ + "DeleteCapacityCommitment": { + "methods": [ "DeleteCapacityCommitment" ] }, - "DeleteReservation": { - "methods": [ + "DeleteReservation": { + "methods": [ "DeleteReservation" ] }, - "GetBiReservation": { - "methods": [ + "GetBiReservation": { + "methods": [ "GetBiReservation" ] }, - "GetCapacityCommitment": { - "methods": [ + "GetCapacityCommitment": { + "methods": [ "GetCapacityCommitment" ] }, - "GetReservation": { - "methods": [ + "GetReservation": { + "methods": [ "GetReservation" ] }, - "ListAssignments": { - "methods": [ + "ListAssignments": { + "methods": [ "ListAssignments" ] }, - "ListCapacityCommitments": { - "methods": [ + "ListCapacityCommitments": { + "methods": [ "ListCapacityCommitments" ] }, - "ListReservations": { - "methods": [ + "ListReservations": { + "methods": [ "ListReservations" ] }, - "MergeCapacityCommitments": { - "methods": [ + "MergeCapacityCommitments": { + "methods": [ "MergeCapacityCommitments" ] }, - "MoveAssignment": { - "methods": [ + "MoveAssignment": { + "methods": [ "MoveAssignment" ] }, - "SearchAssignments": { - "methods": [ + "SearchAssignments": { + "methods": [ "SearchAssignments" ] }, - "SplitCapacityCommitment": { - "methods": [ + "SplitCapacityCommitment": { + "methods": [ "SplitCapacityCommitment" ] }, - "UpdateBiReservation": { - "methods": [ + "UpdateBiReservation": { + "methods": [ "UpdateBiReservation" ] }, - "UpdateCapacityCommitment": { - "methods": [ + "UpdateCapacityCommitment": { + "methods": [ "UpdateCapacityCommitment" ] }, - "UpdateReservation": { - "methods": [ + "UpdateReservation": { + "methods": [ "UpdateReservation" ] } diff --git a/bigquery/reservation/apiv1beta1/reservation_client.go b/bigquery/reservation/apiv1beta1/reservation_client.go index 5f88b27042c..548db39e8a0 100644 --- a/bigquery/reservation/apiv1beta1/reservation_client.go +++ b/bigquery/reservation/apiv1beta1/reservation_client.go @@ -23,7 +23,6 @@ import ( "net/url" "time" - "github.com/golang/protobuf/proto" gax "github.com/googleapis/gax-go/v2" "google.golang.org/api/iterator" "google.golang.org/api/option" @@ -33,6 +32,7 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/proto" ) var newClientHook clientHook diff --git a/bigquery/storage/apiv1/doc.go b/bigquery/storage/apiv1/doc.go index 9a1652b254b..8137ce3e85f 100644 --- a/bigquery/storage/apiv1/doc.go +++ b/bigquery/storage/apiv1/doc.go @@ -46,7 +46,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210612" +const versionClient = "20210624" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/bigquery/storage/apiv1/gapic_metadata.json b/bigquery/storage/apiv1/gapic_metadata.json index 2c9099af368..42c1fad16df 100644 --- a/bigquery/storage/apiv1/gapic_metadata.json +++ b/bigquery/storage/apiv1/gapic_metadata.json @@ -1,27 +1,27 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.bigquery.storage.v1", - "libraryPackage": "cloud.google.com/go/bigquery/storage/apiv1", - "services": { - "BigQueryRead": { - "clients": { - "grpc": { - "libraryClient": "BigQueryReadClient", - "rpcs": { - "CreateReadSession": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.bigquery.storage.v1", + "libraryPackage": "cloud.google.com/go/bigquery/storage/apiv1", + "services": { + "BigQueryRead": { + "clients": { + "grpc": { + "libraryClient": "BigQueryReadClient", + "rpcs": { + "CreateReadSession": { + "methods": [ "CreateReadSession" ] }, - "ReadRows": { - "methods": [ + "ReadRows": { + "methods": [ "ReadRows" ] }, - "SplitReadStream": { - "methods": [ + "SplitReadStream": { + "methods": [ "SplitReadStream" ] } diff --git a/bigquery/storage/apiv1beta1/doc.go b/bigquery/storage/apiv1beta1/doc.go index 34eeb9412aa..eff5d0a4023 100644 --- a/bigquery/storage/apiv1beta1/doc.go +++ b/bigquery/storage/apiv1beta1/doc.go @@ -48,7 +48,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210612" +const versionClient = "20210624" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/bigquery/storage/apiv1beta1/gapic_metadata.json b/bigquery/storage/apiv1beta1/gapic_metadata.json index 95235bc516a..6d78fdb0d84 100644 --- a/bigquery/storage/apiv1beta1/gapic_metadata.json +++ b/bigquery/storage/apiv1beta1/gapic_metadata.json @@ -1,37 +1,37 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.bigquery.storage.v1beta1", - "libraryPackage": "cloud.google.com/go/bigquery/storage/apiv1beta1", - "services": { - "BigQueryStorage": { - "clients": { - "grpc": { - "libraryClient": "BigQueryStorageClient", - "rpcs": { - "BatchCreateReadSessionStreams": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.bigquery.storage.v1beta1", + "libraryPackage": "cloud.google.com/go/bigquery/storage/apiv1beta1", + "services": { + "BigQueryStorage": { + "clients": { + "grpc": { + "libraryClient": "BigQueryStorageClient", + "rpcs": { + "BatchCreateReadSessionStreams": { + "methods": [ "BatchCreateReadSessionStreams" ] }, - "CreateReadSession": { - "methods": [ + "CreateReadSession": { + "methods": [ "CreateReadSession" ] }, - "FinalizeStream": { - "methods": [ + "FinalizeStream": { + "methods": [ "FinalizeStream" ] }, - "ReadRows": { - "methods": [ + "ReadRows": { + "methods": [ "ReadRows" ] }, - "SplitReadStream": { - "methods": [ + "SplitReadStream": { + "methods": [ "SplitReadStream" ] } diff --git a/bigquery/storage/apiv1beta2/doc.go b/bigquery/storage/apiv1beta2/doc.go index b888f9ac5dc..c84226ca0dc 100644 --- a/bigquery/storage/apiv1beta2/doc.go +++ b/bigquery/storage/apiv1beta2/doc.go @@ -48,7 +48,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210612" +const versionClient = "20210624" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/bigquery/storage/apiv1beta2/gapic_metadata.json b/bigquery/storage/apiv1beta2/gapic_metadata.json index 13e265e06a7..052802eb4eb 100644 --- a/bigquery/storage/apiv1beta2/gapic_metadata.json +++ b/bigquery/storage/apiv1beta2/gapic_metadata.json @@ -1,27 +1,27 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.bigquery.storage.v1beta2", - "libraryPackage": "cloud.google.com/go/bigquery/storage/apiv1beta2", - "services": { - "BigQueryRead": { - "clients": { - "grpc": { - "libraryClient": "BigQueryReadClient", - "rpcs": { - "CreateReadSession": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.bigquery.storage.v1beta2", + "libraryPackage": "cloud.google.com/go/bigquery/storage/apiv1beta2", + "services": { + "BigQueryRead": { + "clients": { + "grpc": { + "libraryClient": "BigQueryReadClient", + "rpcs": { + "CreateReadSession": { + "methods": [ "CreateReadSession" ] }, - "ReadRows": { - "methods": [ + "ReadRows": { + "methods": [ "ReadRows" ] }, - "SplitReadStream": { - "methods": [ + "SplitReadStream": { + "methods": [ "SplitReadStream" ] } @@ -29,38 +29,38 @@ } } }, - "BigQueryWrite": { - "clients": { - "grpc": { - "libraryClient": "BigQueryWriteClient", - "rpcs": { - "AppendRows": { - "methods": [ + "BigQueryWrite": { + "clients": { + "grpc": { + "libraryClient": "BigQueryWriteClient", + "rpcs": { + "AppendRows": { + "methods": [ "AppendRows" ] }, - "BatchCommitWriteStreams": { - "methods": [ + "BatchCommitWriteStreams": { + "methods": [ "BatchCommitWriteStreams" ] }, - "CreateWriteStream": { - "methods": [ + "CreateWriteStream": { + "methods": [ "CreateWriteStream" ] }, - "FinalizeWriteStream": { - "methods": [ + "FinalizeWriteStream": { + "methods": [ "FinalizeWriteStream" ] }, - "FlushRows": { - "methods": [ + "FlushRows": { + "methods": [ "FlushRows" ] }, - "GetWriteStream": { - "methods": [ + "GetWriteStream": { + "methods": [ "GetWriteStream" ] } diff --git a/bigtable/go.mod b/bigtable/go.mod index 1f1f5c7d763..464fb0185e6 100644 --- a/bigtable/go.mod +++ b/bigtable/go.mod @@ -10,8 +10,8 @@ require ( github.com/googleapis/gax-go/v2 v2.0.5 golang.org/x/oauth2 v0.0.0-20210615190721-d04028783cf1 golang.org/x/sys v0.0.0-20210616094352-59db8d763f22 - google.golang.org/api v0.48.0 - google.golang.org/genproto v0.0.0-20210608205507-b6d2f5bf0d7d + google.golang.org/api v0.49.0 + google.golang.org/genproto v0.0.0-20210624174822-c5cf32407d0a google.golang.org/grpc v1.38.0 google.golang.org/protobuf v1.26.0 rsc.io/binaryregexp v0.2.0 diff --git a/bigtable/go.sum b/bigtable/go.sum index 9f40c0a6a8f..e51b7d83f54 100644 --- a/bigtable/go.sum +++ b/bigtable/go.sum @@ -366,8 +366,9 @@ golang.org/x/tools v0.0.0-20201208233053-a543418bbed2/go.mod h1:emZCQorbCU4vsT4f golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/tools v0.1.2 h1:kRBLX7v7Af8W7Gdbbc908OJcdgtK8bOz9Uaj8/F1ACA= golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/tools v0.1.3 h1:L69ShwSZEyCsLKoAxDKeMvLDZkumEe8gXUZAjab0tX8= +golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= 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= @@ -395,8 +396,9 @@ google.golang.org/api v0.40.0/go.mod h1:fYKFpnQN0DsDSKRVRcQSDQNtqWPfM9i+zNPxepjR google.golang.org/api v0.41.0/go.mod h1:RkxM5lITDfTzmyKFPt+wGrCJbVfniCr2ool8kTBzRTU= google.golang.org/api v0.43.0/go.mod h1:nQsDGjRXMo4lvh5hP0TKqF244gqhGcr/YSIykhUk/94= google.golang.org/api v0.47.0/go.mod h1:Wbvgpq1HddcWVtzsVLyfLp8lDg6AA241LmgIL59tHXo= -google.golang.org/api v0.48.0 h1:RDAPWfNFY06dffEXfn7hZF5Fr1ZbnChzfQZAPyBd1+I= google.golang.org/api v0.48.0/go.mod h1:71Pr1vy+TAZRPkPs/xlCf5SsU8WjuAWv1Pfjbtukyy4= +google.golang.org/api v0.49.0 h1:gjIBDxlTG7vnzMmEnYwTnvLTF8Rjzo+ETCgEX1YZ/fY= +google.golang.org/api v0.49.0/go.mod h1:BECiH72wsfwUvOVn3+btPD5WHi0LzavZReBndi42L18= 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.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= @@ -447,8 +449,10 @@ google.golang.org/genproto v0.0.0-20210402141018-6c239bbf2bb1/go.mod h1:9lPAdzaE google.golang.org/genproto v0.0.0-20210513213006-bf773b8c8384/go.mod h1:P3QM42oQyzQSnHPnZ/vqoCdDmzH28fzWByN9asMeM8A= google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= google.golang.org/genproto v0.0.0-20210604141403-392c879c8b08/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= -google.golang.org/genproto v0.0.0-20210608205507-b6d2f5bf0d7d h1:KzwjikDymrEmYYbdyfievTwjEeGlu+OM6oiKBkF3Jfg= google.golang.org/genproto v0.0.0-20210608205507-b6d2f5bf0d7d/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= +google.golang.org/genproto v0.0.0-20210617175327-b9e0b3197ced/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24= +google.golang.org/genproto v0.0.0-20210624174822-c5cf32407d0a h1:b5Bhxmy6Tppar7Yl4J6c6xF33YSBhkm2FtV9/ZQuBkQ= +google.golang.org/genproto v0.0.0-20210624174822-c5cf32407d0a/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= diff --git a/billing/apiv1/cloud_billing_client.go b/billing/apiv1/cloud_billing_client.go index 0509ca2b2d0..2d2fe53936d 100644 --- a/billing/apiv1/cloud_billing_client.go +++ b/billing/apiv1/cloud_billing_client.go @@ -23,7 +23,6 @@ import ( "net/url" "time" - "github.com/golang/protobuf/proto" gax "github.com/googleapis/gax-go/v2" "google.golang.org/api/iterator" "google.golang.org/api/option" @@ -34,6 +33,7 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/proto" ) var newCloudBillingClientHook clientHook diff --git a/billing/apiv1/cloud_catalog_client.go b/billing/apiv1/cloud_catalog_client.go index 25f70f25e50..b262b8f5735 100644 --- a/billing/apiv1/cloud_catalog_client.go +++ b/billing/apiv1/cloud_catalog_client.go @@ -22,7 +22,6 @@ import ( "math" "net/url" - "github.com/golang/protobuf/proto" gax "github.com/googleapis/gax-go/v2" "google.golang.org/api/iterator" "google.golang.org/api/option" @@ -31,6 +30,7 @@ import ( billingpb "google.golang.org/genproto/googleapis/cloud/billing/v1" "google.golang.org/grpc" "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/proto" ) var newCloudCatalogClientHook clientHook diff --git a/billing/apiv1/doc.go b/billing/apiv1/doc.go index 4a1cf2a2134..982c7dbabc2 100644 --- a/billing/apiv1/doc.go +++ b/billing/apiv1/doc.go @@ -49,7 +49,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210612" +const versionClient = "20210624" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/billing/apiv1/gapic_metadata.json b/billing/apiv1/gapic_metadata.json index b5571d8762f..b74bdd800f7 100644 --- a/billing/apiv1/gapic_metadata.json +++ b/billing/apiv1/gapic_metadata.json @@ -1,62 +1,62 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.billing.v1", - "libraryPackage": "cloud.google.com/go/billing/apiv1", - "services": { - "CloudBilling": { - "clients": { - "grpc": { - "libraryClient": "CloudBillingClient", - "rpcs": { - "CreateBillingAccount": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.billing.v1", + "libraryPackage": "cloud.google.com/go/billing/apiv1", + "services": { + "CloudBilling": { + "clients": { + "grpc": { + "libraryClient": "CloudBillingClient", + "rpcs": { + "CreateBillingAccount": { + "methods": [ "CreateBillingAccount" ] }, - "GetBillingAccount": { - "methods": [ + "GetBillingAccount": { + "methods": [ "GetBillingAccount" ] }, - "GetIamPolicy": { - "methods": [ + "GetIamPolicy": { + "methods": [ "GetIamPolicy" ] }, - "GetProjectBillingInfo": { - "methods": [ + "GetProjectBillingInfo": { + "methods": [ "GetProjectBillingInfo" ] }, - "ListBillingAccounts": { - "methods": [ + "ListBillingAccounts": { + "methods": [ "ListBillingAccounts" ] }, - "ListProjectBillingInfo": { - "methods": [ + "ListProjectBillingInfo": { + "methods": [ "ListProjectBillingInfo" ] }, - "SetIamPolicy": { - "methods": [ + "SetIamPolicy": { + "methods": [ "SetIamPolicy" ] }, - "TestIamPermissions": { - "methods": [ + "TestIamPermissions": { + "methods": [ "TestIamPermissions" ] }, - "UpdateBillingAccount": { - "methods": [ + "UpdateBillingAccount": { + "methods": [ "UpdateBillingAccount" ] }, - "UpdateProjectBillingInfo": { - "methods": [ + "UpdateProjectBillingInfo": { + "methods": [ "UpdateProjectBillingInfo" ] } @@ -64,18 +64,18 @@ } } }, - "CloudCatalog": { - "clients": { - "grpc": { - "libraryClient": "CloudCatalogClient", - "rpcs": { - "ListServices": { - "methods": [ + "CloudCatalog": { + "clients": { + "grpc": { + "libraryClient": "CloudCatalogClient", + "rpcs": { + "ListServices": { + "methods": [ "ListServices" ] }, - "ListSkus": { - "methods": [ + "ListSkus": { + "methods": [ "ListSkus" ] } diff --git a/billing/budgets/apiv1/budget_client.go b/billing/budgets/apiv1/budget_client.go index f0617c0261c..e98a11e9eac 100644 --- a/billing/budgets/apiv1/budget_client.go +++ b/billing/budgets/apiv1/budget_client.go @@ -23,7 +23,6 @@ import ( "net/url" "time" - "github.com/golang/protobuf/proto" gax "github.com/googleapis/gax-go/v2" "google.golang.org/api/iterator" "google.golang.org/api/option" @@ -33,6 +32,7 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/proto" ) var newBudgetClientHook clientHook diff --git a/billing/budgets/apiv1/doc.go b/billing/budgets/apiv1/doc.go index c667ee6f31f..67718c838ba 100644 --- a/billing/budgets/apiv1/doc.go +++ b/billing/budgets/apiv1/doc.go @@ -50,7 +50,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210612" +const versionClient = "20210624" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/billing/budgets/apiv1/gapic_metadata.json b/billing/budgets/apiv1/gapic_metadata.json index 71de553dd86..05ad6bfd1d1 100644 --- a/billing/budgets/apiv1/gapic_metadata.json +++ b/billing/budgets/apiv1/gapic_metadata.json @@ -1,37 +1,37 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.billing.budgets.v1", - "libraryPackage": "cloud.google.com/go/billing/budgets/apiv1", - "services": { - "BudgetService": { - "clients": { - "grpc": { - "libraryClient": "BudgetClient", - "rpcs": { - "CreateBudget": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.billing.budgets.v1", + "libraryPackage": "cloud.google.com/go/billing/budgets/apiv1", + "services": { + "BudgetService": { + "clients": { + "grpc": { + "libraryClient": "BudgetClient", + "rpcs": { + "CreateBudget": { + "methods": [ "CreateBudget" ] }, - "DeleteBudget": { - "methods": [ + "DeleteBudget": { + "methods": [ "DeleteBudget" ] }, - "GetBudget": { - "methods": [ + "GetBudget": { + "methods": [ "GetBudget" ] }, - "ListBudgets": { - "methods": [ + "ListBudgets": { + "methods": [ "ListBudgets" ] }, - "UpdateBudget": { - "methods": [ + "UpdateBudget": { + "methods": [ "UpdateBudget" ] } diff --git a/billing/budgets/apiv1beta1/budget_client.go b/billing/budgets/apiv1beta1/budget_client.go index 7159f1fe497..65a7cbb86ec 100644 --- a/billing/budgets/apiv1beta1/budget_client.go +++ b/billing/budgets/apiv1beta1/budget_client.go @@ -23,7 +23,6 @@ import ( "net/url" "time" - "github.com/golang/protobuf/proto" gax "github.com/googleapis/gax-go/v2" "google.golang.org/api/iterator" "google.golang.org/api/option" @@ -33,6 +32,7 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/proto" ) var newBudgetClientHook clientHook diff --git a/billing/budgets/apiv1beta1/doc.go b/billing/budgets/apiv1beta1/doc.go index 580edd612ec..7a578a17eb0 100644 --- a/billing/budgets/apiv1beta1/doc.go +++ b/billing/budgets/apiv1beta1/doc.go @@ -52,7 +52,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210612" +const versionClient = "20210624" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/billing/budgets/apiv1beta1/gapic_metadata.json b/billing/budgets/apiv1beta1/gapic_metadata.json index 912efba0ed8..986d7e62544 100644 --- a/billing/budgets/apiv1beta1/gapic_metadata.json +++ b/billing/budgets/apiv1beta1/gapic_metadata.json @@ -1,37 +1,37 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.billing.budgets.v1beta1", - "libraryPackage": "cloud.google.com/go/billing/budgets/apiv1beta1", - "services": { - "BudgetService": { - "clients": { - "grpc": { - "libraryClient": "BudgetClient", - "rpcs": { - "CreateBudget": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.billing.budgets.v1beta1", + "libraryPackage": "cloud.google.com/go/billing/budgets/apiv1beta1", + "services": { + "BudgetService": { + "clients": { + "grpc": { + "libraryClient": "BudgetClient", + "rpcs": { + "CreateBudget": { + "methods": [ "CreateBudget" ] }, - "DeleteBudget": { - "methods": [ + "DeleteBudget": { + "methods": [ "DeleteBudget" ] }, - "GetBudget": { - "methods": [ + "GetBudget": { + "methods": [ "GetBudget" ] }, - "ListBudgets": { - "methods": [ + "ListBudgets": { + "methods": [ "ListBudgets" ] }, - "UpdateBudget": { - "methods": [ + "UpdateBudget": { + "methods": [ "UpdateBudget" ] } diff --git a/binaryauthorization/apiv1beta1/binauthz_management_service_v1_beta1_client.go b/binaryauthorization/apiv1beta1/binauthz_management_service_v1_beta1_client.go index afc4b567714..ad959919841 100644 --- a/binaryauthorization/apiv1beta1/binauthz_management_service_v1_beta1_client.go +++ b/binaryauthorization/apiv1beta1/binauthz_management_service_v1_beta1_client.go @@ -23,7 +23,6 @@ import ( "net/url" "time" - "github.com/golang/protobuf/proto" gax "github.com/googleapis/gax-go/v2" "google.golang.org/api/iterator" "google.golang.org/api/option" @@ -33,6 +32,7 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/proto" ) var newBinauthzManagementServiceV1Beta1ClientHook clientHook diff --git a/binaryauthorization/apiv1beta1/doc.go b/binaryauthorization/apiv1beta1/doc.go index 49ab883d13b..9b909abfec3 100644 --- a/binaryauthorization/apiv1beta1/doc.go +++ b/binaryauthorization/apiv1beta1/doc.go @@ -51,7 +51,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210612" +const versionClient = "20210624" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/binaryauthorization/apiv1beta1/gapic_metadata.json b/binaryauthorization/apiv1beta1/gapic_metadata.json index fb591a2cbb1..0e6b17f4296 100644 --- a/binaryauthorization/apiv1beta1/gapic_metadata.json +++ b/binaryauthorization/apiv1beta1/gapic_metadata.json @@ -1,47 +1,47 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.binaryauthorization.v1beta1", - "libraryPackage": "cloud.google.com/go/binaryauthorization/apiv1beta1", - "services": { - "BinauthzManagementServiceV1Beta1": { - "clients": { - "grpc": { - "libraryClient": "BinauthzManagementServiceV1Beta1Client", - "rpcs": { - "CreateAttestor": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.binaryauthorization.v1beta1", + "libraryPackage": "cloud.google.com/go/binaryauthorization/apiv1beta1", + "services": { + "BinauthzManagementServiceV1Beta1": { + "clients": { + "grpc": { + "libraryClient": "BinauthzManagementServiceV1Beta1Client", + "rpcs": { + "CreateAttestor": { + "methods": [ "CreateAttestor" ] }, - "DeleteAttestor": { - "methods": [ + "DeleteAttestor": { + "methods": [ "DeleteAttestor" ] }, - "GetAttestor": { - "methods": [ + "GetAttestor": { + "methods": [ "GetAttestor" ] }, - "GetPolicy": { - "methods": [ + "GetPolicy": { + "methods": [ "GetPolicy" ] }, - "ListAttestors": { - "methods": [ + "ListAttestors": { + "methods": [ "ListAttestors" ] }, - "UpdateAttestor": { - "methods": [ + "UpdateAttestor": { + "methods": [ "UpdateAttestor" ] }, - "UpdatePolicy": { - "methods": [ + "UpdatePolicy": { + "methods": [ "UpdatePolicy" ] } diff --git a/channel/apiv1/cloud_channel_client.go b/channel/apiv1/cloud_channel_client.go index 61de846bc2d..ad45dc9f2d8 100644 --- a/channel/apiv1/cloud_channel_client.go +++ b/channel/apiv1/cloud_channel_client.go @@ -25,7 +25,6 @@ import ( "cloud.google.com/go/longrunning" lroauto "cloud.google.com/go/longrunning/autogen" - "github.com/golang/protobuf/proto" gax "github.com/googleapis/gax-go/v2" "google.golang.org/api/iterator" "google.golang.org/api/option" @@ -36,6 +35,7 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/proto" ) var newCloudChannelClientHook clientHook diff --git a/channel/apiv1/doc.go b/channel/apiv1/doc.go index 128dd42287a..e5be880ab39 100644 --- a/channel/apiv1/doc.go +++ b/channel/apiv1/doc.go @@ -46,7 +46,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210612" +const versionClient = "20210624" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/channel/apiv1/gapic_metadata.json b/channel/apiv1/gapic_metadata.json index 70fd450e2eb..879d86e7189 100644 --- a/channel/apiv1/gapic_metadata.json +++ b/channel/apiv1/gapic_metadata.json @@ -1,182 +1,182 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.channel.v1", - "libraryPackage": "cloud.google.com/go/channel/apiv1", - "services": { - "CloudChannelService": { - "clients": { - "grpc": { - "libraryClient": "CloudChannelClient", - "rpcs": { - "ActivateEntitlement": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.channel.v1", + "libraryPackage": "cloud.google.com/go/channel/apiv1", + "services": { + "CloudChannelService": { + "clients": { + "grpc": { + "libraryClient": "CloudChannelClient", + "rpcs": { + "ActivateEntitlement": { + "methods": [ "ActivateEntitlement" ] }, - "CancelEntitlement": { - "methods": [ + "CancelEntitlement": { + "methods": [ "CancelEntitlement" ] }, - "ChangeOffer": { - "methods": [ + "ChangeOffer": { + "methods": [ "ChangeOffer" ] }, - "ChangeParameters": { - "methods": [ + "ChangeParameters": { + "methods": [ "ChangeParameters" ] }, - "ChangeRenewalSettings": { - "methods": [ + "ChangeRenewalSettings": { + "methods": [ "ChangeRenewalSettings" ] }, - "CheckCloudIdentityAccountsExist": { - "methods": [ + "CheckCloudIdentityAccountsExist": { + "methods": [ "CheckCloudIdentityAccountsExist" ] }, - "CreateChannelPartnerLink": { - "methods": [ + "CreateChannelPartnerLink": { + "methods": [ "CreateChannelPartnerLink" ] }, - "CreateCustomer": { - "methods": [ + "CreateCustomer": { + "methods": [ "CreateCustomer" ] }, - "CreateEntitlement": { - "methods": [ + "CreateEntitlement": { + "methods": [ "CreateEntitlement" ] }, - "DeleteCustomer": { - "methods": [ + "DeleteCustomer": { + "methods": [ "DeleteCustomer" ] }, - "GetChannelPartnerLink": { - "methods": [ + "GetChannelPartnerLink": { + "methods": [ "GetChannelPartnerLink" ] }, - "GetCustomer": { - "methods": [ + "GetCustomer": { + "methods": [ "GetCustomer" ] }, - "GetEntitlement": { - "methods": [ + "GetEntitlement": { + "methods": [ "GetEntitlement" ] }, - "ListChannelPartnerLinks": { - "methods": [ + "ListChannelPartnerLinks": { + "methods": [ "ListChannelPartnerLinks" ] }, - "ListCustomers": { - "methods": [ + "ListCustomers": { + "methods": [ "ListCustomers" ] }, - "ListEntitlements": { - "methods": [ + "ListEntitlements": { + "methods": [ "ListEntitlements" ] }, - "ListOffers": { - "methods": [ + "ListOffers": { + "methods": [ "ListOffers" ] }, - "ListProducts": { - "methods": [ + "ListProducts": { + "methods": [ "ListProducts" ] }, - "ListPurchasableOffers": { - "methods": [ + "ListPurchasableOffers": { + "methods": [ "ListPurchasableOffers" ] }, - "ListPurchasableSkus": { - "methods": [ + "ListPurchasableSkus": { + "methods": [ "ListPurchasableSkus" ] }, - "ListSkus": { - "methods": [ + "ListSkus": { + "methods": [ "ListSkus" ] }, - "ListSubscribers": { - "methods": [ + "ListSubscribers": { + "methods": [ "ListSubscribers" ] }, - "ListTransferableOffers": { - "methods": [ + "ListTransferableOffers": { + "methods": [ "ListTransferableOffers" ] }, - "ListTransferableSkus": { - "methods": [ + "ListTransferableSkus": { + "methods": [ "ListTransferableSkus" ] }, - "LookupOffer": { - "methods": [ + "LookupOffer": { + "methods": [ "LookupOffer" ] }, - "ProvisionCloudIdentity": { - "methods": [ + "ProvisionCloudIdentity": { + "methods": [ "ProvisionCloudIdentity" ] }, - "RegisterSubscriber": { - "methods": [ + "RegisterSubscriber": { + "methods": [ "RegisterSubscriber" ] }, - "StartPaidService": { - "methods": [ + "StartPaidService": { + "methods": [ "StartPaidService" ] }, - "SuspendEntitlement": { - "methods": [ + "SuspendEntitlement": { + "methods": [ "SuspendEntitlement" ] }, - "TransferEntitlements": { - "methods": [ + "TransferEntitlements": { + "methods": [ "TransferEntitlements" ] }, - "TransferEntitlementsToGoogle": { - "methods": [ + "TransferEntitlementsToGoogle": { + "methods": [ "TransferEntitlementsToGoogle" ] }, - "UnregisterSubscriber": { - "methods": [ + "UnregisterSubscriber": { + "methods": [ "UnregisterSubscriber" ] }, - "UpdateChannelPartnerLink": { - "methods": [ + "UpdateChannelPartnerLink": { + "methods": [ "UpdateChannelPartnerLink" ] }, - "UpdateCustomer": { - "methods": [ + "UpdateCustomer": { + "methods": [ "UpdateCustomer" ] } diff --git a/cloudbuild/apiv1/v2/cloud_build_client.go b/cloudbuild/apiv1/v2/cloud_build_client.go index c7e27e0fa73..bde219b32df 100644 --- a/cloudbuild/apiv1/v2/cloud_build_client.go +++ b/cloudbuild/apiv1/v2/cloud_build_client.go @@ -25,7 +25,6 @@ import ( "cloud.google.com/go/longrunning" lroauto "cloud.google.com/go/longrunning/autogen" - "github.com/golang/protobuf/proto" gax "github.com/googleapis/gax-go/v2" "google.golang.org/api/iterator" "google.golang.org/api/option" @@ -36,6 +35,7 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/proto" ) var newClientHook clientHook diff --git a/cloudbuild/apiv1/v2/doc.go b/cloudbuild/apiv1/v2/doc.go index 4b2296fd359..6d520a99bc4 100644 --- a/cloudbuild/apiv1/v2/doc.go +++ b/cloudbuild/apiv1/v2/doc.go @@ -48,7 +48,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210612" +const versionClient = "20210624" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/cloudbuild/apiv1/v2/gapic_metadata.json b/cloudbuild/apiv1/v2/gapic_metadata.json index a5ee7a289ed..6468ea5b2c6 100644 --- a/cloudbuild/apiv1/v2/gapic_metadata.json +++ b/cloudbuild/apiv1/v2/gapic_metadata.json @@ -1,97 +1,97 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.devtools.cloudbuild.v1", - "libraryPackage": "cloud.google.com/go/cloudbuild/apiv1/v2", - "services": { - "CloudBuild": { - "clients": { - "grpc": { - "libraryClient": "Client", - "rpcs": { - "CancelBuild": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.devtools.cloudbuild.v1", + "libraryPackage": "cloud.google.com/go/cloudbuild/apiv1/v2", + "services": { + "CloudBuild": { + "clients": { + "grpc": { + "libraryClient": "Client", + "rpcs": { + "CancelBuild": { + "methods": [ "CancelBuild" ] }, - "CreateBuild": { - "methods": [ + "CreateBuild": { + "methods": [ "CreateBuild" ] }, - "CreateBuildTrigger": { - "methods": [ + "CreateBuildTrigger": { + "methods": [ "CreateBuildTrigger" ] }, - "CreateWorkerPool": { - "methods": [ + "CreateWorkerPool": { + "methods": [ "CreateWorkerPool" ] }, - "DeleteBuildTrigger": { - "methods": [ + "DeleteBuildTrigger": { + "methods": [ "DeleteBuildTrigger" ] }, - "DeleteWorkerPool": { - "methods": [ + "DeleteWorkerPool": { + "methods": [ "DeleteWorkerPool" ] }, - "GetBuild": { - "methods": [ + "GetBuild": { + "methods": [ "GetBuild" ] }, - "GetBuildTrigger": { - "methods": [ + "GetBuildTrigger": { + "methods": [ "GetBuildTrigger" ] }, - "GetWorkerPool": { - "methods": [ + "GetWorkerPool": { + "methods": [ "GetWorkerPool" ] }, - "ListBuildTriggers": { - "methods": [ + "ListBuildTriggers": { + "methods": [ "ListBuildTriggers" ] }, - "ListBuilds": { - "methods": [ + "ListBuilds": { + "methods": [ "ListBuilds" ] }, - "ListWorkerPools": { - "methods": [ + "ListWorkerPools": { + "methods": [ "ListWorkerPools" ] }, - "ReceiveTriggerWebhook": { - "methods": [ + "ReceiveTriggerWebhook": { + "methods": [ "ReceiveTriggerWebhook" ] }, - "RetryBuild": { - "methods": [ + "RetryBuild": { + "methods": [ "RetryBuild" ] }, - "RunBuildTrigger": { - "methods": [ + "RunBuildTrigger": { + "methods": [ "RunBuildTrigger" ] }, - "UpdateBuildTrigger": { - "methods": [ + "UpdateBuildTrigger": { + "methods": [ "UpdateBuildTrigger" ] }, - "UpdateWorkerPool": { - "methods": [ + "UpdateWorkerPool": { + "methods": [ "UpdateWorkerPool" ] } diff --git a/clouddms/apiv1/data_migration_client.go b/clouddms/apiv1/data_migration_client.go index 39b5f813403..ea8ee366eb5 100644 --- a/clouddms/apiv1/data_migration_client.go +++ b/clouddms/apiv1/data_migration_client.go @@ -25,7 +25,6 @@ import ( "cloud.google.com/go/longrunning" lroauto "cloud.google.com/go/longrunning/autogen" - "github.com/golang/protobuf/proto" gax "github.com/googleapis/gax-go/v2" "google.golang.org/api/iterator" "google.golang.org/api/option" @@ -35,6 +34,7 @@ import ( longrunningpb "google.golang.org/genproto/googleapis/longrunning" "google.golang.org/grpc" "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/proto" ) var newDataMigrationClientHook clientHook diff --git a/clouddms/apiv1/doc.go b/clouddms/apiv1/doc.go index 48c71c65fd5..e1caa5859a1 100644 --- a/clouddms/apiv1/doc.go +++ b/clouddms/apiv1/doc.go @@ -51,7 +51,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210612" +const versionClient = "20210624" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/clouddms/apiv1/gapic_metadata.json b/clouddms/apiv1/gapic_metadata.json index b6b1c33804f..ad5aefcbeba 100644 --- a/clouddms/apiv1/gapic_metadata.json +++ b/clouddms/apiv1/gapic_metadata.json @@ -1,97 +1,97 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.clouddms.v1", - "libraryPackage": "cloud.google.com/go/clouddms/apiv1", - "services": { - "DataMigrationService": { - "clients": { - "grpc": { - "libraryClient": "DataMigrationClient", - "rpcs": { - "CreateConnectionProfile": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.clouddms.v1", + "libraryPackage": "cloud.google.com/go/clouddms/apiv1", + "services": { + "DataMigrationService": { + "clients": { + "grpc": { + "libraryClient": "DataMigrationClient", + "rpcs": { + "CreateConnectionProfile": { + "methods": [ "CreateConnectionProfile" ] }, - "CreateMigrationJob": { - "methods": [ + "CreateMigrationJob": { + "methods": [ "CreateMigrationJob" ] }, - "DeleteConnectionProfile": { - "methods": [ + "DeleteConnectionProfile": { + "methods": [ "DeleteConnectionProfile" ] }, - "DeleteMigrationJob": { - "methods": [ + "DeleteMigrationJob": { + "methods": [ "DeleteMigrationJob" ] }, - "GenerateSshScript": { - "methods": [ + "GenerateSshScript": { + "methods": [ "GenerateSshScript" ] }, - "GetConnectionProfile": { - "methods": [ + "GetConnectionProfile": { + "methods": [ "GetConnectionProfile" ] }, - "GetMigrationJob": { - "methods": [ + "GetMigrationJob": { + "methods": [ "GetMigrationJob" ] }, - "ListConnectionProfiles": { - "methods": [ + "ListConnectionProfiles": { + "methods": [ "ListConnectionProfiles" ] }, - "ListMigrationJobs": { - "methods": [ + "ListMigrationJobs": { + "methods": [ "ListMigrationJobs" ] }, - "PromoteMigrationJob": { - "methods": [ + "PromoteMigrationJob": { + "methods": [ "PromoteMigrationJob" ] }, - "RestartMigrationJob": { - "methods": [ + "RestartMigrationJob": { + "methods": [ "RestartMigrationJob" ] }, - "ResumeMigrationJob": { - "methods": [ + "ResumeMigrationJob": { + "methods": [ "ResumeMigrationJob" ] }, - "StartMigrationJob": { - "methods": [ + "StartMigrationJob": { + "methods": [ "StartMigrationJob" ] }, - "StopMigrationJob": { - "methods": [ + "StopMigrationJob": { + "methods": [ "StopMigrationJob" ] }, - "UpdateConnectionProfile": { - "methods": [ + "UpdateConnectionProfile": { + "methods": [ "UpdateConnectionProfile" ] }, - "UpdateMigrationJob": { - "methods": [ + "UpdateMigrationJob": { + "methods": [ "UpdateMigrationJob" ] }, - "VerifyMigrationJob": { - "methods": [ + "VerifyMigrationJob": { + "methods": [ "VerifyMigrationJob" ] } diff --git a/cloudtasks/apiv2/cloud_tasks_client.go b/cloudtasks/apiv2/cloud_tasks_client.go index 6621ffa21e6..ddba0312eb8 100644 --- a/cloudtasks/apiv2/cloud_tasks_client.go +++ b/cloudtasks/apiv2/cloud_tasks_client.go @@ -23,7 +23,6 @@ import ( "net/url" "time" - "github.com/golang/protobuf/proto" gax "github.com/googleapis/gax-go/v2" "google.golang.org/api/iterator" "google.golang.org/api/option" @@ -34,6 +33,7 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/proto" ) var newClientHook clientHook diff --git a/cloudtasks/apiv2/doc.go b/cloudtasks/apiv2/doc.go index 0e42750ee41..0629315db3c 100644 --- a/cloudtasks/apiv2/doc.go +++ b/cloudtasks/apiv2/doc.go @@ -48,7 +48,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210612" +const versionClient = "20210624" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/cloudtasks/apiv2/gapic_metadata.json b/cloudtasks/apiv2/gapic_metadata.json index ade36c0dc6f..8a4b72b2777 100644 --- a/cloudtasks/apiv2/gapic_metadata.json +++ b/cloudtasks/apiv2/gapic_metadata.json @@ -1,92 +1,92 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.tasks.v2", - "libraryPackage": "cloud.google.com/go/cloudtasks/apiv2", - "services": { - "CloudTasks": { - "clients": { - "grpc": { - "libraryClient": "Client", - "rpcs": { - "CreateQueue": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.tasks.v2", + "libraryPackage": "cloud.google.com/go/cloudtasks/apiv2", + "services": { + "CloudTasks": { + "clients": { + "grpc": { + "libraryClient": "Client", + "rpcs": { + "CreateQueue": { + "methods": [ "CreateQueue" ] }, - "CreateTask": { - "methods": [ + "CreateTask": { + "methods": [ "CreateTask" ] }, - "DeleteQueue": { - "methods": [ + "DeleteQueue": { + "methods": [ "DeleteQueue" ] }, - "DeleteTask": { - "methods": [ + "DeleteTask": { + "methods": [ "DeleteTask" ] }, - "GetIamPolicy": { - "methods": [ + "GetIamPolicy": { + "methods": [ "GetIamPolicy" ] }, - "GetQueue": { - "methods": [ + "GetQueue": { + "methods": [ "GetQueue" ] }, - "GetTask": { - "methods": [ + "GetTask": { + "methods": [ "GetTask" ] }, - "ListQueues": { - "methods": [ + "ListQueues": { + "methods": [ "ListQueues" ] }, - "ListTasks": { - "methods": [ + "ListTasks": { + "methods": [ "ListTasks" ] }, - "PauseQueue": { - "methods": [ + "PauseQueue": { + "methods": [ "PauseQueue" ] }, - "PurgeQueue": { - "methods": [ + "PurgeQueue": { + "methods": [ "PurgeQueue" ] }, - "ResumeQueue": { - "methods": [ + "ResumeQueue": { + "methods": [ "ResumeQueue" ] }, - "RunTask": { - "methods": [ + "RunTask": { + "methods": [ "RunTask" ] }, - "SetIamPolicy": { - "methods": [ + "SetIamPolicy": { + "methods": [ "SetIamPolicy" ] }, - "TestIamPermissions": { - "methods": [ + "TestIamPermissions": { + "methods": [ "TestIamPermissions" ] }, - "UpdateQueue": { - "methods": [ + "UpdateQueue": { + "methods": [ "UpdateQueue" ] } diff --git a/cloudtasks/apiv2beta2/cloud_tasks_client.go b/cloudtasks/apiv2beta2/cloud_tasks_client.go index a03bc302d4b..eb77d9e83ca 100644 --- a/cloudtasks/apiv2beta2/cloud_tasks_client.go +++ b/cloudtasks/apiv2beta2/cloud_tasks_client.go @@ -23,7 +23,6 @@ import ( "net/url" "time" - "github.com/golang/protobuf/proto" gax "github.com/googleapis/gax-go/v2" "google.golang.org/api/iterator" "google.golang.org/api/option" @@ -34,6 +33,7 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/proto" ) var newClientHook clientHook diff --git a/cloudtasks/apiv2beta2/doc.go b/cloudtasks/apiv2beta2/doc.go index a798f5da526..b87521ebac0 100644 --- a/cloudtasks/apiv2beta2/doc.go +++ b/cloudtasks/apiv2beta2/doc.go @@ -50,7 +50,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210612" +const versionClient = "20210624" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/cloudtasks/apiv2beta2/gapic_metadata.json b/cloudtasks/apiv2beta2/gapic_metadata.json index c88b99835e2..7ff48b0895b 100644 --- a/cloudtasks/apiv2beta2/gapic_metadata.json +++ b/cloudtasks/apiv2beta2/gapic_metadata.json @@ -1,112 +1,112 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.tasks.v2beta2", - "libraryPackage": "cloud.google.com/go/cloudtasks/apiv2beta2", - "services": { - "CloudTasks": { - "clients": { - "grpc": { - "libraryClient": "Client", - "rpcs": { - "AcknowledgeTask": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.tasks.v2beta2", + "libraryPackage": "cloud.google.com/go/cloudtasks/apiv2beta2", + "services": { + "CloudTasks": { + "clients": { + "grpc": { + "libraryClient": "Client", + "rpcs": { + "AcknowledgeTask": { + "methods": [ "AcknowledgeTask" ] }, - "CancelLease": { - "methods": [ + "CancelLease": { + "methods": [ "CancelLease" ] }, - "CreateQueue": { - "methods": [ + "CreateQueue": { + "methods": [ "CreateQueue" ] }, - "CreateTask": { - "methods": [ + "CreateTask": { + "methods": [ "CreateTask" ] }, - "DeleteQueue": { - "methods": [ + "DeleteQueue": { + "methods": [ "DeleteQueue" ] }, - "DeleteTask": { - "methods": [ + "DeleteTask": { + "methods": [ "DeleteTask" ] }, - "GetIamPolicy": { - "methods": [ + "GetIamPolicy": { + "methods": [ "GetIamPolicy" ] }, - "GetQueue": { - "methods": [ + "GetQueue": { + "methods": [ "GetQueue" ] }, - "GetTask": { - "methods": [ + "GetTask": { + "methods": [ "GetTask" ] }, - "LeaseTasks": { - "methods": [ + "LeaseTasks": { + "methods": [ "LeaseTasks" ] }, - "ListQueues": { - "methods": [ + "ListQueues": { + "methods": [ "ListQueues" ] }, - "ListTasks": { - "methods": [ + "ListTasks": { + "methods": [ "ListTasks" ] }, - "PauseQueue": { - "methods": [ + "PauseQueue": { + "methods": [ "PauseQueue" ] }, - "PurgeQueue": { - "methods": [ + "PurgeQueue": { + "methods": [ "PurgeQueue" ] }, - "RenewLease": { - "methods": [ + "RenewLease": { + "methods": [ "RenewLease" ] }, - "ResumeQueue": { - "methods": [ + "ResumeQueue": { + "methods": [ "ResumeQueue" ] }, - "RunTask": { - "methods": [ + "RunTask": { + "methods": [ "RunTask" ] }, - "SetIamPolicy": { - "methods": [ + "SetIamPolicy": { + "methods": [ "SetIamPolicy" ] }, - "TestIamPermissions": { - "methods": [ + "TestIamPermissions": { + "methods": [ "TestIamPermissions" ] }, - "UpdateQueue": { - "methods": [ + "UpdateQueue": { + "methods": [ "UpdateQueue" ] } diff --git a/cloudtasks/apiv2beta3/cloud_tasks_client.go b/cloudtasks/apiv2beta3/cloud_tasks_client.go index dc15053a726..25d19947ca0 100644 --- a/cloudtasks/apiv2beta3/cloud_tasks_client.go +++ b/cloudtasks/apiv2beta3/cloud_tasks_client.go @@ -23,7 +23,6 @@ import ( "net/url" "time" - "github.com/golang/protobuf/proto" gax "github.com/googleapis/gax-go/v2" "google.golang.org/api/iterator" "google.golang.org/api/option" @@ -34,6 +33,7 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/proto" ) var newClientHook clientHook diff --git a/cloudtasks/apiv2beta3/doc.go b/cloudtasks/apiv2beta3/doc.go index c5d2f9e742e..e782b175247 100644 --- a/cloudtasks/apiv2beta3/doc.go +++ b/cloudtasks/apiv2beta3/doc.go @@ -50,7 +50,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210612" +const versionClient = "20210624" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/cloudtasks/apiv2beta3/gapic_metadata.json b/cloudtasks/apiv2beta3/gapic_metadata.json index 1a5f03a6d03..358e340ee54 100644 --- a/cloudtasks/apiv2beta3/gapic_metadata.json +++ b/cloudtasks/apiv2beta3/gapic_metadata.json @@ -1,92 +1,92 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.tasks.v2beta3", - "libraryPackage": "cloud.google.com/go/cloudtasks/apiv2beta3", - "services": { - "CloudTasks": { - "clients": { - "grpc": { - "libraryClient": "Client", - "rpcs": { - "CreateQueue": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.tasks.v2beta3", + "libraryPackage": "cloud.google.com/go/cloudtasks/apiv2beta3", + "services": { + "CloudTasks": { + "clients": { + "grpc": { + "libraryClient": "Client", + "rpcs": { + "CreateQueue": { + "methods": [ "CreateQueue" ] }, - "CreateTask": { - "methods": [ + "CreateTask": { + "methods": [ "CreateTask" ] }, - "DeleteQueue": { - "methods": [ + "DeleteQueue": { + "methods": [ "DeleteQueue" ] }, - "DeleteTask": { - "methods": [ + "DeleteTask": { + "methods": [ "DeleteTask" ] }, - "GetIamPolicy": { - "methods": [ + "GetIamPolicy": { + "methods": [ "GetIamPolicy" ] }, - "GetQueue": { - "methods": [ + "GetQueue": { + "methods": [ "GetQueue" ] }, - "GetTask": { - "methods": [ + "GetTask": { + "methods": [ "GetTask" ] }, - "ListQueues": { - "methods": [ + "ListQueues": { + "methods": [ "ListQueues" ] }, - "ListTasks": { - "methods": [ + "ListTasks": { + "methods": [ "ListTasks" ] }, - "PauseQueue": { - "methods": [ + "PauseQueue": { + "methods": [ "PauseQueue" ] }, - "PurgeQueue": { - "methods": [ + "PurgeQueue": { + "methods": [ "PurgeQueue" ] }, - "ResumeQueue": { - "methods": [ + "ResumeQueue": { + "methods": [ "ResumeQueue" ] }, - "RunTask": { - "methods": [ + "RunTask": { + "methods": [ "RunTask" ] }, - "SetIamPolicy": { - "methods": [ + "SetIamPolicy": { + "methods": [ "SetIamPolicy" ] }, - "TestIamPermissions": { - "methods": [ + "TestIamPermissions": { + "methods": [ "TestIamPermissions" ] }, - "UpdateQueue": { - "methods": [ + "UpdateQueue": { + "methods": [ "UpdateQueue" ] } diff --git a/container/apiv1/cluster_manager_client.go b/container/apiv1/cluster_manager_client.go index 13661a6e97a..eb8b77248aa 100644 --- a/container/apiv1/cluster_manager_client.go +++ b/container/apiv1/cluster_manager_client.go @@ -23,7 +23,6 @@ import ( "net/url" "time" - "github.com/golang/protobuf/proto" gax "github.com/googleapis/gax-go/v2" "google.golang.org/api/iterator" "google.golang.org/api/option" @@ -33,6 +32,7 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/proto" ) var newClusterManagerClientHook clientHook diff --git a/container/apiv1/doc.go b/container/apiv1/doc.go index 8cdaa2dd2e2..34c204eb39f 100644 --- a/container/apiv1/doc.go +++ b/container/apiv1/doc.go @@ -49,7 +49,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210612" +const versionClient = "20210624" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/container/apiv1/gapic_metadata.json b/container/apiv1/gapic_metadata.json index 7cdf466eea3..832be126473 100644 --- a/container/apiv1/gapic_metadata.json +++ b/container/apiv1/gapic_metadata.json @@ -1,172 +1,172 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.container.v1", - "libraryPackage": "cloud.google.com/go/container/apiv1", - "services": { - "ClusterManager": { - "clients": { - "grpc": { - "libraryClient": "ClusterManagerClient", - "rpcs": { - "CancelOperation": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.container.v1", + "libraryPackage": "cloud.google.com/go/container/apiv1", + "services": { + "ClusterManager": { + "clients": { + "grpc": { + "libraryClient": "ClusterManagerClient", + "rpcs": { + "CancelOperation": { + "methods": [ "CancelOperation" ] }, - "CompleteIPRotation": { - "methods": [ + "CompleteIPRotation": { + "methods": [ "CompleteIPRotation" ] }, - "CreateCluster": { - "methods": [ + "CreateCluster": { + "methods": [ "CreateCluster" ] }, - "CreateNodePool": { - "methods": [ + "CreateNodePool": { + "methods": [ "CreateNodePool" ] }, - "DeleteCluster": { - "methods": [ + "DeleteCluster": { + "methods": [ "DeleteCluster" ] }, - "DeleteNodePool": { - "methods": [ + "DeleteNodePool": { + "methods": [ "DeleteNodePool" ] }, - "GetCluster": { - "methods": [ + "GetCluster": { + "methods": [ "GetCluster" ] }, - "GetJSONWebKeys": { - "methods": [ + "GetJSONWebKeys": { + "methods": [ "GetJSONWebKeys" ] }, - "GetNodePool": { - "methods": [ + "GetNodePool": { + "methods": [ "GetNodePool" ] }, - "GetOperation": { - "methods": [ + "GetOperation": { + "methods": [ "GetOperation" ] }, - "GetServerConfig": { - "methods": [ + "GetServerConfig": { + "methods": [ "GetServerConfig" ] }, - "ListClusters": { - "methods": [ + "ListClusters": { + "methods": [ "ListClusters" ] }, - "ListNodePools": { - "methods": [ + "ListNodePools": { + "methods": [ "ListNodePools" ] }, - "ListOperations": { - "methods": [ + "ListOperations": { + "methods": [ "ListOperations" ] }, - "ListUsableSubnetworks": { - "methods": [ + "ListUsableSubnetworks": { + "methods": [ "ListUsableSubnetworks" ] }, - "RollbackNodePoolUpgrade": { - "methods": [ + "RollbackNodePoolUpgrade": { + "methods": [ "RollbackNodePoolUpgrade" ] }, - "SetAddonsConfig": { - "methods": [ + "SetAddonsConfig": { + "methods": [ "SetAddonsConfig" ] }, - "SetLabels": { - "methods": [ + "SetLabels": { + "methods": [ "SetLabels" ] }, - "SetLegacyAbac": { - "methods": [ + "SetLegacyAbac": { + "methods": [ "SetLegacyAbac" ] }, - "SetLocations": { - "methods": [ + "SetLocations": { + "methods": [ "SetLocations" ] }, - "SetLoggingService": { - "methods": [ + "SetLoggingService": { + "methods": [ "SetLoggingService" ] }, - "SetMaintenancePolicy": { - "methods": [ + "SetMaintenancePolicy": { + "methods": [ "SetMaintenancePolicy" ] }, - "SetMasterAuth": { - "methods": [ + "SetMasterAuth": { + "methods": [ "SetMasterAuth" ] }, - "SetMonitoringService": { - "methods": [ + "SetMonitoringService": { + "methods": [ "SetMonitoringService" ] }, - "SetNetworkPolicy": { - "methods": [ + "SetNetworkPolicy": { + "methods": [ "SetNetworkPolicy" ] }, - "SetNodePoolAutoscaling": { - "methods": [ + "SetNodePoolAutoscaling": { + "methods": [ "SetNodePoolAutoscaling" ] }, - "SetNodePoolManagement": { - "methods": [ + "SetNodePoolManagement": { + "methods": [ "SetNodePoolManagement" ] }, - "SetNodePoolSize": { - "methods": [ + "SetNodePoolSize": { + "methods": [ "SetNodePoolSize" ] }, - "StartIPRotation": { - "methods": [ + "StartIPRotation": { + "methods": [ "StartIPRotation" ] }, - "UpdateCluster": { - "methods": [ + "UpdateCluster": { + "methods": [ "UpdateCluster" ] }, - "UpdateMaster": { - "methods": [ + "UpdateMaster": { + "methods": [ "UpdateMaster" ] }, - "UpdateNodePool": { - "methods": [ + "UpdateNodePool": { + "methods": [ "UpdateNodePool" ] } diff --git a/containeranalysis/apiv1beta1/container_analysis_v1_beta1_client.go b/containeranalysis/apiv1beta1/container_analysis_v1_beta1_client.go index 8ebdfceb788..fc81bf43fb5 100644 --- a/containeranalysis/apiv1beta1/container_analysis_v1_beta1_client.go +++ b/containeranalysis/apiv1beta1/container_analysis_v1_beta1_client.go @@ -23,7 +23,6 @@ import ( "net/url" "time" - "github.com/golang/protobuf/proto" gax "github.com/googleapis/gax-go/v2" "google.golang.org/api/iterator" "google.golang.org/api/option" @@ -34,6 +33,7 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/proto" ) var newContainerAnalysisV1Beta1ClientHook clientHook diff --git a/containeranalysis/apiv1beta1/doc.go b/containeranalysis/apiv1beta1/doc.go index 8bc91766f4b..5948917e79e 100644 --- a/containeranalysis/apiv1beta1/doc.go +++ b/containeranalysis/apiv1beta1/doc.go @@ -51,7 +51,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210612" +const versionClient = "20210624" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/containeranalysis/apiv1beta1/gapic_metadata.json b/containeranalysis/apiv1beta1/gapic_metadata.json index a6ea786a1c5..d00dcf37233 100644 --- a/containeranalysis/apiv1beta1/gapic_metadata.json +++ b/containeranalysis/apiv1beta1/gapic_metadata.json @@ -1,87 +1,87 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "grafeas.v1beta1", - "libraryPackage": "cloud.google.com/go/containeranalysis/apiv1beta1", - "services": { - "GrafeasV1Beta1": { - "clients": { - "grpc": { - "libraryClient": "GrafeasV1Beta1Client", - "rpcs": { - "BatchCreateNotes": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "grafeas.v1beta1", + "libraryPackage": "cloud.google.com/go/containeranalysis/apiv1beta1", + "services": { + "GrafeasV1Beta1": { + "clients": { + "grpc": { + "libraryClient": "GrafeasV1Beta1Client", + "rpcs": { + "BatchCreateNotes": { + "methods": [ "BatchCreateNotes" ] }, - "BatchCreateOccurrences": { - "methods": [ + "BatchCreateOccurrences": { + "methods": [ "BatchCreateOccurrences" ] }, - "CreateNote": { - "methods": [ + "CreateNote": { + "methods": [ "CreateNote" ] }, - "CreateOccurrence": { - "methods": [ + "CreateOccurrence": { + "methods": [ "CreateOccurrence" ] }, - "DeleteNote": { - "methods": [ + "DeleteNote": { + "methods": [ "DeleteNote" ] }, - "DeleteOccurrence": { - "methods": [ + "DeleteOccurrence": { + "methods": [ "DeleteOccurrence" ] }, - "GetNote": { - "methods": [ + "GetNote": { + "methods": [ "GetNote" ] }, - "GetOccurrence": { - "methods": [ + "GetOccurrence": { + "methods": [ "GetOccurrence" ] }, - "GetOccurrenceNote": { - "methods": [ + "GetOccurrenceNote": { + "methods": [ "GetOccurrenceNote" ] }, - "GetVulnerabilityOccurrencesSummary": { - "methods": [ + "GetVulnerabilityOccurrencesSummary": { + "methods": [ "GetVulnerabilityOccurrencesSummary" ] }, - "ListNoteOccurrences": { - "methods": [ + "ListNoteOccurrences": { + "methods": [ "ListNoteOccurrences" ] }, - "ListNotes": { - "methods": [ + "ListNotes": { + "methods": [ "ListNotes" ] }, - "ListOccurrences": { - "methods": [ + "ListOccurrences": { + "methods": [ "ListOccurrences" ] }, - "UpdateNote": { - "methods": [ + "UpdateNote": { + "methods": [ "UpdateNote" ] }, - "UpdateOccurrence": { - "methods": [ + "UpdateOccurrence": { + "methods": [ "UpdateOccurrence" ] } diff --git a/containeranalysis/apiv1beta1/grafeas_v1_beta1_client.go b/containeranalysis/apiv1beta1/grafeas_v1_beta1_client.go index 7f5faa57379..483a2c26235 100644 --- a/containeranalysis/apiv1beta1/grafeas_v1_beta1_client.go +++ b/containeranalysis/apiv1beta1/grafeas_v1_beta1_client.go @@ -23,7 +23,6 @@ import ( "net/url" "time" - "github.com/golang/protobuf/proto" gax "github.com/googleapis/gax-go/v2" "google.golang.org/api/iterator" "google.golang.org/api/option" @@ -33,6 +32,7 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/proto" ) var newGrafeasV1Beta1ClientHook clientHook diff --git a/datacatalog/apiv1/data_catalog_client.go b/datacatalog/apiv1/data_catalog_client.go index e6e92aabd06..fbc68db5f61 100644 --- a/datacatalog/apiv1/data_catalog_client.go +++ b/datacatalog/apiv1/data_catalog_client.go @@ -23,7 +23,6 @@ import ( "net/url" "time" - "github.com/golang/protobuf/proto" gax "github.com/googleapis/gax-go/v2" "google.golang.org/api/iterator" "google.golang.org/api/option" @@ -34,6 +33,7 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/proto" ) var newClientHook clientHook diff --git a/datacatalog/apiv1/doc.go b/datacatalog/apiv1/doc.go index 2aed75eca0e..8e11b57656c 100644 --- a/datacatalog/apiv1/doc.go +++ b/datacatalog/apiv1/doc.go @@ -49,7 +49,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210612" +const versionClient = "20210624" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/datacatalog/apiv1/gapic_metadata.json b/datacatalog/apiv1/gapic_metadata.json index 0af97677409..a219e339924 100644 --- a/datacatalog/apiv1/gapic_metadata.json +++ b/datacatalog/apiv1/gapic_metadata.json @@ -1,152 +1,152 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.datacatalog.v1", - "libraryPackage": "cloud.google.com/go/datacatalog/apiv1", - "services": { - "DataCatalog": { - "clients": { - "grpc": { - "libraryClient": "Client", - "rpcs": { - "CreateEntry": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.datacatalog.v1", + "libraryPackage": "cloud.google.com/go/datacatalog/apiv1", + "services": { + "DataCatalog": { + "clients": { + "grpc": { + "libraryClient": "Client", + "rpcs": { + "CreateEntry": { + "methods": [ "CreateEntry" ] }, - "CreateEntryGroup": { - "methods": [ + "CreateEntryGroup": { + "methods": [ "CreateEntryGroup" ] }, - "CreateTag": { - "methods": [ + "CreateTag": { + "methods": [ "CreateTag" ] }, - "CreateTagTemplate": { - "methods": [ + "CreateTagTemplate": { + "methods": [ "CreateTagTemplate" ] }, - "CreateTagTemplateField": { - "methods": [ + "CreateTagTemplateField": { + "methods": [ "CreateTagTemplateField" ] }, - "DeleteEntry": { - "methods": [ + "DeleteEntry": { + "methods": [ "DeleteEntry" ] }, - "DeleteEntryGroup": { - "methods": [ + "DeleteEntryGroup": { + "methods": [ "DeleteEntryGroup" ] }, - "DeleteTag": { - "methods": [ + "DeleteTag": { + "methods": [ "DeleteTag" ] }, - "DeleteTagTemplate": { - "methods": [ + "DeleteTagTemplate": { + "methods": [ "DeleteTagTemplate" ] }, - "DeleteTagTemplateField": { - "methods": [ + "DeleteTagTemplateField": { + "methods": [ "DeleteTagTemplateField" ] }, - "GetEntry": { - "methods": [ + "GetEntry": { + "methods": [ "GetEntry" ] }, - "GetEntryGroup": { - "methods": [ + "GetEntryGroup": { + "methods": [ "GetEntryGroup" ] }, - "GetIamPolicy": { - "methods": [ + "GetIamPolicy": { + "methods": [ "GetIamPolicy" ] }, - "GetTagTemplate": { - "methods": [ + "GetTagTemplate": { + "methods": [ "GetTagTemplate" ] }, - "ListEntries": { - "methods": [ + "ListEntries": { + "methods": [ "ListEntries" ] }, - "ListEntryGroups": { - "methods": [ + "ListEntryGroups": { + "methods": [ "ListEntryGroups" ] }, - "ListTags": { - "methods": [ + "ListTags": { + "methods": [ "ListTags" ] }, - "LookupEntry": { - "methods": [ + "LookupEntry": { + "methods": [ "LookupEntry" ] }, - "RenameTagTemplateField": { - "methods": [ + "RenameTagTemplateField": { + "methods": [ "RenameTagTemplateField" ] }, - "RenameTagTemplateFieldEnumValue": { - "methods": [ + "RenameTagTemplateFieldEnumValue": { + "methods": [ "RenameTagTemplateFieldEnumValue" ] }, - "SearchCatalog": { - "methods": [ + "SearchCatalog": { + "methods": [ "SearchCatalog" ] }, - "SetIamPolicy": { - "methods": [ + "SetIamPolicy": { + "methods": [ "SetIamPolicy" ] }, - "TestIamPermissions": { - "methods": [ + "TestIamPermissions": { + "methods": [ "TestIamPermissions" ] }, - "UpdateEntry": { - "methods": [ + "UpdateEntry": { + "methods": [ "UpdateEntry" ] }, - "UpdateEntryGroup": { - "methods": [ + "UpdateEntryGroup": { + "methods": [ "UpdateEntryGroup" ] }, - "UpdateTag": { - "methods": [ + "UpdateTag": { + "methods": [ "UpdateTag" ] }, - "UpdateTagTemplate": { - "methods": [ + "UpdateTagTemplate": { + "methods": [ "UpdateTagTemplate" ] }, - "UpdateTagTemplateField": { - "methods": [ + "UpdateTagTemplateField": { + "methods": [ "UpdateTagTemplateField" ] } @@ -154,73 +154,73 @@ } } }, - "PolicyTagManager": { - "clients": { - "grpc": { - "libraryClient": "PolicyTagManagerClient", - "rpcs": { - "CreatePolicyTag": { - "methods": [ + "PolicyTagManager": { + "clients": { + "grpc": { + "libraryClient": "PolicyTagManagerClient", + "rpcs": { + "CreatePolicyTag": { + "methods": [ "CreatePolicyTag" ] }, - "CreateTaxonomy": { - "methods": [ + "CreateTaxonomy": { + "methods": [ "CreateTaxonomy" ] }, - "DeletePolicyTag": { - "methods": [ + "DeletePolicyTag": { + "methods": [ "DeletePolicyTag" ] }, - "DeleteTaxonomy": { - "methods": [ + "DeleteTaxonomy": { + "methods": [ "DeleteTaxonomy" ] }, - "GetIamPolicy": { - "methods": [ + "GetIamPolicy": { + "methods": [ "GetIamPolicy" ] }, - "GetPolicyTag": { - "methods": [ + "GetPolicyTag": { + "methods": [ "GetPolicyTag" ] }, - "GetTaxonomy": { - "methods": [ + "GetTaxonomy": { + "methods": [ "GetTaxonomy" ] }, - "ListPolicyTags": { - "methods": [ + "ListPolicyTags": { + "methods": [ "ListPolicyTags" ] }, - "ListTaxonomies": { - "methods": [ + "ListTaxonomies": { + "methods": [ "ListTaxonomies" ] }, - "SetIamPolicy": { - "methods": [ + "SetIamPolicy": { + "methods": [ "SetIamPolicy" ] }, - "TestIamPermissions": { - "methods": [ + "TestIamPermissions": { + "methods": [ "TestIamPermissions" ] }, - "UpdatePolicyTag": { - "methods": [ + "UpdatePolicyTag": { + "methods": [ "UpdatePolicyTag" ] }, - "UpdateTaxonomy": { - "methods": [ + "UpdateTaxonomy": { + "methods": [ "UpdateTaxonomy" ] } @@ -228,18 +228,18 @@ } } }, - "PolicyTagManagerSerialization": { - "clients": { - "grpc": { - "libraryClient": "PolicyTagManagerSerializationClient", - "rpcs": { - "ExportTaxonomies": { - "methods": [ + "PolicyTagManagerSerialization": { + "clients": { + "grpc": { + "libraryClient": "PolicyTagManagerSerializationClient", + "rpcs": { + "ExportTaxonomies": { + "methods": [ "ExportTaxonomies" ] }, - "ImportTaxonomies": { - "methods": [ + "ImportTaxonomies": { + "methods": [ "ImportTaxonomies" ] } diff --git a/datacatalog/apiv1/policy_tag_manager_client.go b/datacatalog/apiv1/policy_tag_manager_client.go index c53e44920d2..ebc7691c9dd 100644 --- a/datacatalog/apiv1/policy_tag_manager_client.go +++ b/datacatalog/apiv1/policy_tag_manager_client.go @@ -23,7 +23,6 @@ import ( "net/url" "time" - "github.com/golang/protobuf/proto" gax "github.com/googleapis/gax-go/v2" "google.golang.org/api/iterator" "google.golang.org/api/option" @@ -33,6 +32,7 @@ import ( iampb "google.golang.org/genproto/googleapis/iam/v1" "google.golang.org/grpc" "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/proto" ) var newPolicyTagManagerClientHook clientHook diff --git a/datacatalog/apiv1beta1/data_catalog_client.go b/datacatalog/apiv1beta1/data_catalog_client.go index f828f15b303..539ecfec043 100644 --- a/datacatalog/apiv1beta1/data_catalog_client.go +++ b/datacatalog/apiv1beta1/data_catalog_client.go @@ -23,7 +23,6 @@ import ( "net/url" "time" - "github.com/golang/protobuf/proto" gax "github.com/googleapis/gax-go/v2" "google.golang.org/api/iterator" "google.golang.org/api/option" @@ -34,6 +33,7 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/proto" ) var newClientHook clientHook diff --git a/datacatalog/apiv1beta1/doc.go b/datacatalog/apiv1beta1/doc.go index ec1ae1ce66f..8cec8c617c4 100644 --- a/datacatalog/apiv1beta1/doc.go +++ b/datacatalog/apiv1beta1/doc.go @@ -51,7 +51,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210612" +const versionClient = "20210624" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/datacatalog/apiv1beta1/gapic_metadata.json b/datacatalog/apiv1beta1/gapic_metadata.json index 7d06dd470a0..0d47ee7d3c6 100644 --- a/datacatalog/apiv1beta1/gapic_metadata.json +++ b/datacatalog/apiv1beta1/gapic_metadata.json @@ -1,147 +1,147 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.datacatalog.v1beta1", - "libraryPackage": "cloud.google.com/go/datacatalog/apiv1beta1", - "services": { - "DataCatalog": { - "clients": { - "grpc": { - "libraryClient": "Client", - "rpcs": { - "CreateEntry": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.datacatalog.v1beta1", + "libraryPackage": "cloud.google.com/go/datacatalog/apiv1beta1", + "services": { + "DataCatalog": { + "clients": { + "grpc": { + "libraryClient": "Client", + "rpcs": { + "CreateEntry": { + "methods": [ "CreateEntry" ] }, - "CreateEntryGroup": { - "methods": [ + "CreateEntryGroup": { + "methods": [ "CreateEntryGroup" ] }, - "CreateTag": { - "methods": [ + "CreateTag": { + "methods": [ "CreateTag" ] }, - "CreateTagTemplate": { - "methods": [ + "CreateTagTemplate": { + "methods": [ "CreateTagTemplate" ] }, - "CreateTagTemplateField": { - "methods": [ + "CreateTagTemplateField": { + "methods": [ "CreateTagTemplateField" ] }, - "DeleteEntry": { - "methods": [ + "DeleteEntry": { + "methods": [ "DeleteEntry" ] }, - "DeleteEntryGroup": { - "methods": [ + "DeleteEntryGroup": { + "methods": [ "DeleteEntryGroup" ] }, - "DeleteTag": { - "methods": [ + "DeleteTag": { + "methods": [ "DeleteTag" ] }, - "DeleteTagTemplate": { - "methods": [ + "DeleteTagTemplate": { + "methods": [ "DeleteTagTemplate" ] }, - "DeleteTagTemplateField": { - "methods": [ + "DeleteTagTemplateField": { + "methods": [ "DeleteTagTemplateField" ] }, - "GetEntry": { - "methods": [ + "GetEntry": { + "methods": [ "GetEntry" ] }, - "GetEntryGroup": { - "methods": [ + "GetEntryGroup": { + "methods": [ "GetEntryGroup" ] }, - "GetIamPolicy": { - "methods": [ + "GetIamPolicy": { + "methods": [ "GetIamPolicy" ] }, - "GetTagTemplate": { - "methods": [ + "GetTagTemplate": { + "methods": [ "GetTagTemplate" ] }, - "ListEntries": { - "methods": [ + "ListEntries": { + "methods": [ "ListEntries" ] }, - "ListEntryGroups": { - "methods": [ + "ListEntryGroups": { + "methods": [ "ListEntryGroups" ] }, - "ListTags": { - "methods": [ + "ListTags": { + "methods": [ "ListTags" ] }, - "LookupEntry": { - "methods": [ + "LookupEntry": { + "methods": [ "LookupEntry" ] }, - "RenameTagTemplateField": { - "methods": [ + "RenameTagTemplateField": { + "methods": [ "RenameTagTemplateField" ] }, - "SearchCatalog": { - "methods": [ + "SearchCatalog": { + "methods": [ "SearchCatalog" ] }, - "SetIamPolicy": { - "methods": [ + "SetIamPolicy": { + "methods": [ "SetIamPolicy" ] }, - "TestIamPermissions": { - "methods": [ + "TestIamPermissions": { + "methods": [ "TestIamPermissions" ] }, - "UpdateEntry": { - "methods": [ + "UpdateEntry": { + "methods": [ "UpdateEntry" ] }, - "UpdateEntryGroup": { - "methods": [ + "UpdateEntryGroup": { + "methods": [ "UpdateEntryGroup" ] }, - "UpdateTag": { - "methods": [ + "UpdateTag": { + "methods": [ "UpdateTag" ] }, - "UpdateTagTemplate": { - "methods": [ + "UpdateTagTemplate": { + "methods": [ "UpdateTagTemplate" ] }, - "UpdateTagTemplateField": { - "methods": [ + "UpdateTagTemplateField": { + "methods": [ "UpdateTagTemplateField" ] } @@ -149,73 +149,73 @@ } } }, - "PolicyTagManager": { - "clients": { - "grpc": { - "libraryClient": "PolicyTagManagerClient", - "rpcs": { - "CreatePolicyTag": { - "methods": [ + "PolicyTagManager": { + "clients": { + "grpc": { + "libraryClient": "PolicyTagManagerClient", + "rpcs": { + "CreatePolicyTag": { + "methods": [ "CreatePolicyTag" ] }, - "CreateTaxonomy": { - "methods": [ + "CreateTaxonomy": { + "methods": [ "CreateTaxonomy" ] }, - "DeletePolicyTag": { - "methods": [ + "DeletePolicyTag": { + "methods": [ "DeletePolicyTag" ] }, - "DeleteTaxonomy": { - "methods": [ + "DeleteTaxonomy": { + "methods": [ "DeleteTaxonomy" ] }, - "GetIamPolicy": { - "methods": [ + "GetIamPolicy": { + "methods": [ "GetIamPolicy" ] }, - "GetPolicyTag": { - "methods": [ + "GetPolicyTag": { + "methods": [ "GetPolicyTag" ] }, - "GetTaxonomy": { - "methods": [ + "GetTaxonomy": { + "methods": [ "GetTaxonomy" ] }, - "ListPolicyTags": { - "methods": [ + "ListPolicyTags": { + "methods": [ "ListPolicyTags" ] }, - "ListTaxonomies": { - "methods": [ + "ListTaxonomies": { + "methods": [ "ListTaxonomies" ] }, - "SetIamPolicy": { - "methods": [ + "SetIamPolicy": { + "methods": [ "SetIamPolicy" ] }, - "TestIamPermissions": { - "methods": [ + "TestIamPermissions": { + "methods": [ "TestIamPermissions" ] }, - "UpdatePolicyTag": { - "methods": [ + "UpdatePolicyTag": { + "methods": [ "UpdatePolicyTag" ] }, - "UpdateTaxonomy": { - "methods": [ + "UpdateTaxonomy": { + "methods": [ "UpdateTaxonomy" ] } @@ -223,18 +223,18 @@ } } }, - "PolicyTagManagerSerialization": { - "clients": { - "grpc": { - "libraryClient": "PolicyTagManagerSerializationClient", - "rpcs": { - "ExportTaxonomies": { - "methods": [ + "PolicyTagManagerSerialization": { + "clients": { + "grpc": { + "libraryClient": "PolicyTagManagerSerializationClient", + "rpcs": { + "ExportTaxonomies": { + "methods": [ "ExportTaxonomies" ] }, - "ImportTaxonomies": { - "methods": [ + "ImportTaxonomies": { + "methods": [ "ImportTaxonomies" ] } diff --git a/datacatalog/apiv1beta1/policy_tag_manager_client.go b/datacatalog/apiv1beta1/policy_tag_manager_client.go index 66b406a2850..4b3eb72a48d 100644 --- a/datacatalog/apiv1beta1/policy_tag_manager_client.go +++ b/datacatalog/apiv1beta1/policy_tag_manager_client.go @@ -22,7 +22,6 @@ import ( "math" "net/url" - "github.com/golang/protobuf/proto" gax "github.com/googleapis/gax-go/v2" "google.golang.org/api/iterator" "google.golang.org/api/option" @@ -32,6 +31,7 @@ import ( iampb "google.golang.org/genproto/googleapis/iam/v1" "google.golang.org/grpc" "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/proto" ) var newPolicyTagManagerClientHook clientHook diff --git a/datalabeling/apiv1beta1/data_labeling_client.go b/datalabeling/apiv1beta1/data_labeling_client.go index cce4cdb7f18..76a49b2be03 100644 --- a/datalabeling/apiv1beta1/data_labeling_client.go +++ b/datalabeling/apiv1beta1/data_labeling_client.go @@ -25,7 +25,6 @@ import ( "cloud.google.com/go/longrunning" lroauto "cloud.google.com/go/longrunning/autogen" - "github.com/golang/protobuf/proto" gax "github.com/googleapis/gax-go/v2" "google.golang.org/api/iterator" "google.golang.org/api/option" @@ -36,6 +35,7 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/proto" ) var newClientHook clientHook diff --git a/datalabeling/apiv1beta1/doc.go b/datalabeling/apiv1beta1/doc.go index b2202fa0968..52dabea2efd 100644 --- a/datalabeling/apiv1beta1/doc.go +++ b/datalabeling/apiv1beta1/doc.go @@ -50,7 +50,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210612" +const versionClient = "20210624" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/datalabeling/apiv1beta1/gapic_metadata.json b/datalabeling/apiv1beta1/gapic_metadata.json index bc3f8733da3..69afd996bb3 100644 --- a/datalabeling/apiv1beta1/gapic_metadata.json +++ b/datalabeling/apiv1beta1/gapic_metadata.json @@ -1,182 +1,182 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.datalabeling.v1beta1", - "libraryPackage": "cloud.google.com/go/datalabeling/apiv1beta1", - "services": { - "DataLabelingService": { - "clients": { - "grpc": { - "libraryClient": "Client", - "rpcs": { - "CreateAnnotationSpecSet": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.datalabeling.v1beta1", + "libraryPackage": "cloud.google.com/go/datalabeling/apiv1beta1", + "services": { + "DataLabelingService": { + "clients": { + "grpc": { + "libraryClient": "Client", + "rpcs": { + "CreateAnnotationSpecSet": { + "methods": [ "CreateAnnotationSpecSet" ] }, - "CreateDataset": { - "methods": [ + "CreateDataset": { + "methods": [ "CreateDataset" ] }, - "CreateEvaluationJob": { - "methods": [ + "CreateEvaluationJob": { + "methods": [ "CreateEvaluationJob" ] }, - "CreateInstruction": { - "methods": [ + "CreateInstruction": { + "methods": [ "CreateInstruction" ] }, - "DeleteAnnotatedDataset": { - "methods": [ + "DeleteAnnotatedDataset": { + "methods": [ "DeleteAnnotatedDataset" ] }, - "DeleteAnnotationSpecSet": { - "methods": [ + "DeleteAnnotationSpecSet": { + "methods": [ "DeleteAnnotationSpecSet" ] }, - "DeleteDataset": { - "methods": [ + "DeleteDataset": { + "methods": [ "DeleteDataset" ] }, - "DeleteEvaluationJob": { - "methods": [ + "DeleteEvaluationJob": { + "methods": [ "DeleteEvaluationJob" ] }, - "DeleteInstruction": { - "methods": [ + "DeleteInstruction": { + "methods": [ "DeleteInstruction" ] }, - "ExportData": { - "methods": [ + "ExportData": { + "methods": [ "ExportData" ] }, - "GetAnnotatedDataset": { - "methods": [ + "GetAnnotatedDataset": { + "methods": [ "GetAnnotatedDataset" ] }, - "GetAnnotationSpecSet": { - "methods": [ + "GetAnnotationSpecSet": { + "methods": [ "GetAnnotationSpecSet" ] }, - "GetDataItem": { - "methods": [ + "GetDataItem": { + "methods": [ "GetDataItem" ] }, - "GetDataset": { - "methods": [ + "GetDataset": { + "methods": [ "GetDataset" ] }, - "GetEvaluation": { - "methods": [ + "GetEvaluation": { + "methods": [ "GetEvaluation" ] }, - "GetEvaluationJob": { - "methods": [ + "GetEvaluationJob": { + "methods": [ "GetEvaluationJob" ] }, - "GetExample": { - "methods": [ + "GetExample": { + "methods": [ "GetExample" ] }, - "GetInstruction": { - "methods": [ + "GetInstruction": { + "methods": [ "GetInstruction" ] }, - "ImportData": { - "methods": [ + "ImportData": { + "methods": [ "ImportData" ] }, - "LabelImage": { - "methods": [ + "LabelImage": { + "methods": [ "LabelImage" ] }, - "LabelText": { - "methods": [ + "LabelText": { + "methods": [ "LabelText" ] }, - "LabelVideo": { - "methods": [ + "LabelVideo": { + "methods": [ "LabelVideo" ] }, - "ListAnnotatedDatasets": { - "methods": [ + "ListAnnotatedDatasets": { + "methods": [ "ListAnnotatedDatasets" ] }, - "ListAnnotationSpecSets": { - "methods": [ + "ListAnnotationSpecSets": { + "methods": [ "ListAnnotationSpecSets" ] }, - "ListDataItems": { - "methods": [ + "ListDataItems": { + "methods": [ "ListDataItems" ] }, - "ListDatasets": { - "methods": [ + "ListDatasets": { + "methods": [ "ListDatasets" ] }, - "ListEvaluationJobs": { - "methods": [ + "ListEvaluationJobs": { + "methods": [ "ListEvaluationJobs" ] }, - "ListExamples": { - "methods": [ + "ListExamples": { + "methods": [ "ListExamples" ] }, - "ListInstructions": { - "methods": [ + "ListInstructions": { + "methods": [ "ListInstructions" ] }, - "PauseEvaluationJob": { - "methods": [ + "PauseEvaluationJob": { + "methods": [ "PauseEvaluationJob" ] }, - "ResumeEvaluationJob": { - "methods": [ + "ResumeEvaluationJob": { + "methods": [ "ResumeEvaluationJob" ] }, - "SearchEvaluations": { - "methods": [ + "SearchEvaluations": { + "methods": [ "SearchEvaluations" ] }, - "SearchExampleComparisons": { - "methods": [ + "SearchExampleComparisons": { + "methods": [ "SearchExampleComparisons" ] }, - "UpdateEvaluationJob": { - "methods": [ + "UpdateEvaluationJob": { + "methods": [ "UpdateEvaluationJob" ] } diff --git a/dataproc/apiv1/autoscaling_policy_client.go b/dataproc/apiv1/autoscaling_policy_client.go index 9b03812064d..8c0c5c82033 100644 --- a/dataproc/apiv1/autoscaling_policy_client.go +++ b/dataproc/apiv1/autoscaling_policy_client.go @@ -23,7 +23,6 @@ import ( "net/url" "time" - "github.com/golang/protobuf/proto" gax "github.com/googleapis/gax-go/v2" "google.golang.org/api/iterator" "google.golang.org/api/option" @@ -33,6 +32,7 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/proto" ) var newAutoscalingPolicyClientHook clientHook diff --git a/dataproc/apiv1/cluster_controller_client.go b/dataproc/apiv1/cluster_controller_client.go index 57f6257732e..64198e225c1 100644 --- a/dataproc/apiv1/cluster_controller_client.go +++ b/dataproc/apiv1/cluster_controller_client.go @@ -25,7 +25,6 @@ import ( "cloud.google.com/go/longrunning" lroauto "cloud.google.com/go/longrunning/autogen" - "github.com/golang/protobuf/proto" gax "github.com/googleapis/gax-go/v2" "google.golang.org/api/iterator" "google.golang.org/api/option" @@ -36,6 +35,7 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/proto" ) var newClusterControllerClientHook clientHook diff --git a/dataproc/apiv1/doc.go b/dataproc/apiv1/doc.go index c0046ebd0f6..5219788372d 100644 --- a/dataproc/apiv1/doc.go +++ b/dataproc/apiv1/doc.go @@ -48,7 +48,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210612" +const versionClient = "20210624" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/dataproc/apiv1/gapic_metadata.json b/dataproc/apiv1/gapic_metadata.json index 0d02cbf337d..533ee76f5c6 100644 --- a/dataproc/apiv1/gapic_metadata.json +++ b/dataproc/apiv1/gapic_metadata.json @@ -1,37 +1,37 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.dataproc.v1", - "libraryPackage": "cloud.google.com/go/dataproc/apiv1", - "services": { - "AutoscalingPolicyService": { - "clients": { - "grpc": { - "libraryClient": "AutoscalingPolicyClient", - "rpcs": { - "CreateAutoscalingPolicy": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.dataproc.v1", + "libraryPackage": "cloud.google.com/go/dataproc/apiv1", + "services": { + "AutoscalingPolicyService": { + "clients": { + "grpc": { + "libraryClient": "AutoscalingPolicyClient", + "rpcs": { + "CreateAutoscalingPolicy": { + "methods": [ "CreateAutoscalingPolicy" ] }, - "DeleteAutoscalingPolicy": { - "methods": [ + "DeleteAutoscalingPolicy": { + "methods": [ "DeleteAutoscalingPolicy" ] }, - "GetAutoscalingPolicy": { - "methods": [ + "GetAutoscalingPolicy": { + "methods": [ "GetAutoscalingPolicy" ] }, - "ListAutoscalingPolicies": { - "methods": [ + "ListAutoscalingPolicies": { + "methods": [ "ListAutoscalingPolicies" ] }, - "UpdateAutoscalingPolicy": { - "methods": [ + "UpdateAutoscalingPolicy": { + "methods": [ "UpdateAutoscalingPolicy" ] } @@ -39,48 +39,48 @@ } } }, - "ClusterController": { - "clients": { - "grpc": { - "libraryClient": "ClusterControllerClient", - "rpcs": { - "CreateCluster": { - "methods": [ + "ClusterController": { + "clients": { + "grpc": { + "libraryClient": "ClusterControllerClient", + "rpcs": { + "CreateCluster": { + "methods": [ "CreateCluster" ] }, - "DeleteCluster": { - "methods": [ + "DeleteCluster": { + "methods": [ "DeleteCluster" ] }, - "DiagnoseCluster": { - "methods": [ + "DiagnoseCluster": { + "methods": [ "DiagnoseCluster" ] }, - "GetCluster": { - "methods": [ + "GetCluster": { + "methods": [ "GetCluster" ] }, - "ListClusters": { - "methods": [ + "ListClusters": { + "methods": [ "ListClusters" ] }, - "StartCluster": { - "methods": [ + "StartCluster": { + "methods": [ "StartCluster" ] }, - "StopCluster": { - "methods": [ + "StopCluster": { + "methods": [ "StopCluster" ] }, - "UpdateCluster": { - "methods": [ + "UpdateCluster": { + "methods": [ "UpdateCluster" ] } @@ -88,43 +88,43 @@ } } }, - "JobController": { - "clients": { - "grpc": { - "libraryClient": "JobControllerClient", - "rpcs": { - "CancelJob": { - "methods": [ + "JobController": { + "clients": { + "grpc": { + "libraryClient": "JobControllerClient", + "rpcs": { + "CancelJob": { + "methods": [ "CancelJob" ] }, - "DeleteJob": { - "methods": [ + "DeleteJob": { + "methods": [ "DeleteJob" ] }, - "GetJob": { - "methods": [ + "GetJob": { + "methods": [ "GetJob" ] }, - "ListJobs": { - "methods": [ + "ListJobs": { + "methods": [ "ListJobs" ] }, - "SubmitJob": { - "methods": [ + "SubmitJob": { + "methods": [ "SubmitJob" ] }, - "SubmitJobAsOperation": { - "methods": [ + "SubmitJobAsOperation": { + "methods": [ "SubmitJobAsOperation" ] }, - "UpdateJob": { - "methods": [ + "UpdateJob": { + "methods": [ "UpdateJob" ] } @@ -132,43 +132,43 @@ } } }, - "WorkflowTemplateService": { - "clients": { - "grpc": { - "libraryClient": "WorkflowTemplateClient", - "rpcs": { - "CreateWorkflowTemplate": { - "methods": [ + "WorkflowTemplateService": { + "clients": { + "grpc": { + "libraryClient": "WorkflowTemplateClient", + "rpcs": { + "CreateWorkflowTemplate": { + "methods": [ "CreateWorkflowTemplate" ] }, - "DeleteWorkflowTemplate": { - "methods": [ + "DeleteWorkflowTemplate": { + "methods": [ "DeleteWorkflowTemplate" ] }, - "GetWorkflowTemplate": { - "methods": [ + "GetWorkflowTemplate": { + "methods": [ "GetWorkflowTemplate" ] }, - "InstantiateInlineWorkflowTemplate": { - "methods": [ + "InstantiateInlineWorkflowTemplate": { + "methods": [ "InstantiateInlineWorkflowTemplate" ] }, - "InstantiateWorkflowTemplate": { - "methods": [ + "InstantiateWorkflowTemplate": { + "methods": [ "InstantiateWorkflowTemplate" ] }, - "ListWorkflowTemplates": { - "methods": [ + "ListWorkflowTemplates": { + "methods": [ "ListWorkflowTemplates" ] }, - "UpdateWorkflowTemplate": { - "methods": [ + "UpdateWorkflowTemplate": { + "methods": [ "UpdateWorkflowTemplate" ] } diff --git a/dataproc/apiv1/job_controller_client.go b/dataproc/apiv1/job_controller_client.go index 7f4bd45f05a..ea4ddc30393 100644 --- a/dataproc/apiv1/job_controller_client.go +++ b/dataproc/apiv1/job_controller_client.go @@ -25,7 +25,6 @@ import ( "cloud.google.com/go/longrunning" lroauto "cloud.google.com/go/longrunning/autogen" - "github.com/golang/protobuf/proto" gax "github.com/googleapis/gax-go/v2" "google.golang.org/api/iterator" "google.golang.org/api/option" @@ -36,6 +35,7 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/proto" ) var newJobControllerClientHook clientHook diff --git a/dataproc/apiv1/workflow_template_client.go b/dataproc/apiv1/workflow_template_client.go index 463daa99bb4..7a542d0311a 100644 --- a/dataproc/apiv1/workflow_template_client.go +++ b/dataproc/apiv1/workflow_template_client.go @@ -25,7 +25,6 @@ import ( "cloud.google.com/go/longrunning" lroauto "cloud.google.com/go/longrunning/autogen" - "github.com/golang/protobuf/proto" gax "github.com/googleapis/gax-go/v2" "google.golang.org/api/iterator" "google.golang.org/api/option" @@ -36,6 +35,7 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/proto" ) var newWorkflowTemplateClientHook clientHook diff --git a/dataproc/apiv1beta2/autoscaling_policy_client.go b/dataproc/apiv1beta2/autoscaling_policy_client.go index a6ae2eb7458..4694494ce22 100644 --- a/dataproc/apiv1beta2/autoscaling_policy_client.go +++ b/dataproc/apiv1beta2/autoscaling_policy_client.go @@ -23,7 +23,6 @@ import ( "net/url" "time" - "github.com/golang/protobuf/proto" gax "github.com/googleapis/gax-go/v2" "google.golang.org/api/iterator" "google.golang.org/api/option" @@ -33,6 +32,7 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/proto" ) var newAutoscalingPolicyClientHook clientHook diff --git a/dataproc/apiv1beta2/cluster_controller_client.go b/dataproc/apiv1beta2/cluster_controller_client.go index fa8cc6d6325..40d74b6bcaf 100644 --- a/dataproc/apiv1beta2/cluster_controller_client.go +++ b/dataproc/apiv1beta2/cluster_controller_client.go @@ -25,7 +25,6 @@ import ( "cloud.google.com/go/longrunning" lroauto "cloud.google.com/go/longrunning/autogen" - "github.com/golang/protobuf/proto" gax "github.com/googleapis/gax-go/v2" "google.golang.org/api/iterator" "google.golang.org/api/option" @@ -36,6 +35,7 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/proto" ) var newClusterControllerClientHook clientHook diff --git a/dataproc/apiv1beta2/doc.go b/dataproc/apiv1beta2/doc.go index a070ab717b5..be2ba6dcd11 100644 --- a/dataproc/apiv1beta2/doc.go +++ b/dataproc/apiv1beta2/doc.go @@ -50,7 +50,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210612" +const versionClient = "20210624" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/dataproc/apiv1beta2/gapic_metadata.json b/dataproc/apiv1beta2/gapic_metadata.json index 2669636f437..ca6dee8c5e7 100644 --- a/dataproc/apiv1beta2/gapic_metadata.json +++ b/dataproc/apiv1beta2/gapic_metadata.json @@ -1,37 +1,37 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.dataproc.v1beta2", - "libraryPackage": "cloud.google.com/go/dataproc/apiv1beta2", - "services": { - "AutoscalingPolicyService": { - "clients": { - "grpc": { - "libraryClient": "AutoscalingPolicyClient", - "rpcs": { - "CreateAutoscalingPolicy": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.dataproc.v1beta2", + "libraryPackage": "cloud.google.com/go/dataproc/apiv1beta2", + "services": { + "AutoscalingPolicyService": { + "clients": { + "grpc": { + "libraryClient": "AutoscalingPolicyClient", + "rpcs": { + "CreateAutoscalingPolicy": { + "methods": [ "CreateAutoscalingPolicy" ] }, - "DeleteAutoscalingPolicy": { - "methods": [ + "DeleteAutoscalingPolicy": { + "methods": [ "DeleteAutoscalingPolicy" ] }, - "GetAutoscalingPolicy": { - "methods": [ + "GetAutoscalingPolicy": { + "methods": [ "GetAutoscalingPolicy" ] }, - "ListAutoscalingPolicies": { - "methods": [ + "ListAutoscalingPolicies": { + "methods": [ "ListAutoscalingPolicies" ] }, - "UpdateAutoscalingPolicy": { - "methods": [ + "UpdateAutoscalingPolicy": { + "methods": [ "UpdateAutoscalingPolicy" ] } @@ -39,38 +39,38 @@ } } }, - "ClusterController": { - "clients": { - "grpc": { - "libraryClient": "ClusterControllerClient", - "rpcs": { - "CreateCluster": { - "methods": [ + "ClusterController": { + "clients": { + "grpc": { + "libraryClient": "ClusterControllerClient", + "rpcs": { + "CreateCluster": { + "methods": [ "CreateCluster" ] }, - "DeleteCluster": { - "methods": [ + "DeleteCluster": { + "methods": [ "DeleteCluster" ] }, - "DiagnoseCluster": { - "methods": [ + "DiagnoseCluster": { + "methods": [ "DiagnoseCluster" ] }, - "GetCluster": { - "methods": [ + "GetCluster": { + "methods": [ "GetCluster" ] }, - "ListClusters": { - "methods": [ + "ListClusters": { + "methods": [ "ListClusters" ] }, - "UpdateCluster": { - "methods": [ + "UpdateCluster": { + "methods": [ "UpdateCluster" ] } @@ -78,43 +78,43 @@ } } }, - "JobController": { - "clients": { - "grpc": { - "libraryClient": "JobControllerClient", - "rpcs": { - "CancelJob": { - "methods": [ + "JobController": { + "clients": { + "grpc": { + "libraryClient": "JobControllerClient", + "rpcs": { + "CancelJob": { + "methods": [ "CancelJob" ] }, - "DeleteJob": { - "methods": [ + "DeleteJob": { + "methods": [ "DeleteJob" ] }, - "GetJob": { - "methods": [ + "GetJob": { + "methods": [ "GetJob" ] }, - "ListJobs": { - "methods": [ + "ListJobs": { + "methods": [ "ListJobs" ] }, - "SubmitJob": { - "methods": [ + "SubmitJob": { + "methods": [ "SubmitJob" ] }, - "SubmitJobAsOperation": { - "methods": [ + "SubmitJobAsOperation": { + "methods": [ "SubmitJobAsOperation" ] }, - "UpdateJob": { - "methods": [ + "UpdateJob": { + "methods": [ "UpdateJob" ] } @@ -122,43 +122,43 @@ } } }, - "WorkflowTemplateService": { - "clients": { - "grpc": { - "libraryClient": "WorkflowTemplateClient", - "rpcs": { - "CreateWorkflowTemplate": { - "methods": [ + "WorkflowTemplateService": { + "clients": { + "grpc": { + "libraryClient": "WorkflowTemplateClient", + "rpcs": { + "CreateWorkflowTemplate": { + "methods": [ "CreateWorkflowTemplate" ] }, - "DeleteWorkflowTemplate": { - "methods": [ + "DeleteWorkflowTemplate": { + "methods": [ "DeleteWorkflowTemplate" ] }, - "GetWorkflowTemplate": { - "methods": [ + "GetWorkflowTemplate": { + "methods": [ "GetWorkflowTemplate" ] }, - "InstantiateInlineWorkflowTemplate": { - "methods": [ + "InstantiateInlineWorkflowTemplate": { + "methods": [ "InstantiateInlineWorkflowTemplate" ] }, - "InstantiateWorkflowTemplate": { - "methods": [ + "InstantiateWorkflowTemplate": { + "methods": [ "InstantiateWorkflowTemplate" ] }, - "ListWorkflowTemplates": { - "methods": [ + "ListWorkflowTemplates": { + "methods": [ "ListWorkflowTemplates" ] }, - "UpdateWorkflowTemplate": { - "methods": [ + "UpdateWorkflowTemplate": { + "methods": [ "UpdateWorkflowTemplate" ] } diff --git a/dataproc/apiv1beta2/job_controller_client.go b/dataproc/apiv1beta2/job_controller_client.go index c315ea3833c..70a9e09c0d4 100644 --- a/dataproc/apiv1beta2/job_controller_client.go +++ b/dataproc/apiv1beta2/job_controller_client.go @@ -25,7 +25,6 @@ import ( "cloud.google.com/go/longrunning" lroauto "cloud.google.com/go/longrunning/autogen" - "github.com/golang/protobuf/proto" gax "github.com/googleapis/gax-go/v2" "google.golang.org/api/iterator" "google.golang.org/api/option" @@ -36,6 +35,7 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/proto" ) var newJobControllerClientHook clientHook diff --git a/dataproc/apiv1beta2/workflow_template_client.go b/dataproc/apiv1beta2/workflow_template_client.go index 905001ff8da..a2ae274917c 100644 --- a/dataproc/apiv1beta2/workflow_template_client.go +++ b/dataproc/apiv1beta2/workflow_template_client.go @@ -25,7 +25,6 @@ import ( "cloud.google.com/go/longrunning" lroauto "cloud.google.com/go/longrunning/autogen" - "github.com/golang/protobuf/proto" gax "github.com/googleapis/gax-go/v2" "google.golang.org/api/iterator" "google.golang.org/api/option" @@ -36,6 +35,7 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/proto" ) var newWorkflowTemplateClientHook clientHook diff --git a/dataqna/apiv1alpha/doc.go b/dataqna/apiv1alpha/doc.go index 72ef5100e29..fdf5a72013d 100644 --- a/dataqna/apiv1alpha/doc.go +++ b/dataqna/apiv1alpha/doc.go @@ -51,7 +51,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210612" +const versionClient = "20210624" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/dataqna/apiv1alpha/gapic_metadata.json b/dataqna/apiv1alpha/gapic_metadata.json index 5ed6988e3fa..b5acffa08f0 100644 --- a/dataqna/apiv1alpha/gapic_metadata.json +++ b/dataqna/apiv1alpha/gapic_metadata.json @@ -1,17 +1,17 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.dataqna.v1alpha", - "libraryPackage": "cloud.google.com/go/dataqna/apiv1alpha", - "services": { - "AutoSuggestionService": { - "clients": { - "grpc": { - "libraryClient": "AutoSuggestionClient", - "rpcs": { - "SuggestQueries": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.dataqna.v1alpha", + "libraryPackage": "cloud.google.com/go/dataqna/apiv1alpha", + "services": { + "AutoSuggestionService": { + "clients": { + "grpc": { + "libraryClient": "AutoSuggestionClient", + "rpcs": { + "SuggestQueries": { + "methods": [ "SuggestQueries" ] } @@ -19,33 +19,33 @@ } } }, - "QuestionService": { - "clients": { - "grpc": { - "libraryClient": "QuestionClient", - "rpcs": { - "CreateQuestion": { - "methods": [ + "QuestionService": { + "clients": { + "grpc": { + "libraryClient": "QuestionClient", + "rpcs": { + "CreateQuestion": { + "methods": [ "CreateQuestion" ] }, - "ExecuteQuestion": { - "methods": [ + "ExecuteQuestion": { + "methods": [ "ExecuteQuestion" ] }, - "GetQuestion": { - "methods": [ + "GetQuestion": { + "methods": [ "GetQuestion" ] }, - "GetUserFeedback": { - "methods": [ + "GetUserFeedback": { + "methods": [ "GetUserFeedback" ] }, - "UpdateUserFeedback": { - "methods": [ + "UpdateUserFeedback": { + "methods": [ "UpdateUserFeedback" ] } diff --git a/datastore/admin/apiv1/datastore_admin_client.go b/datastore/admin/apiv1/datastore_admin_client.go index 2308019b759..7a58fc84f5f 100644 --- a/datastore/admin/apiv1/datastore_admin_client.go +++ b/datastore/admin/apiv1/datastore_admin_client.go @@ -25,7 +25,6 @@ import ( "cloud.google.com/go/longrunning" lroauto "cloud.google.com/go/longrunning/autogen" - "github.com/golang/protobuf/proto" gax "github.com/googleapis/gax-go/v2" "google.golang.org/api/iterator" "google.golang.org/api/option" @@ -36,6 +35,7 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/proto" ) var newDatastoreAdminClientHook clientHook diff --git a/datastore/admin/apiv1/doc.go b/datastore/admin/apiv1/doc.go index e5a866fd7ea..9148bebfbc1 100644 --- a/datastore/admin/apiv1/doc.go +++ b/datastore/admin/apiv1/doc.go @@ -51,7 +51,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210612" +const versionClient = "20210624" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/datastore/admin/apiv1/gapic_metadata.json b/datastore/admin/apiv1/gapic_metadata.json index 12ca2f15ef3..07d60ee93be 100644 --- a/datastore/admin/apiv1/gapic_metadata.json +++ b/datastore/admin/apiv1/gapic_metadata.json @@ -1,42 +1,42 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.datastore.admin.v1", - "libraryPackage": "cloud.google.com/go/datastore/admin/apiv1", - "services": { - "DatastoreAdmin": { - "clients": { - "grpc": { - "libraryClient": "DatastoreAdminClient", - "rpcs": { - "CreateIndex": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.datastore.admin.v1", + "libraryPackage": "cloud.google.com/go/datastore/admin/apiv1", + "services": { + "DatastoreAdmin": { + "clients": { + "grpc": { + "libraryClient": "DatastoreAdminClient", + "rpcs": { + "CreateIndex": { + "methods": [ "CreateIndex" ] }, - "DeleteIndex": { - "methods": [ + "DeleteIndex": { + "methods": [ "DeleteIndex" ] }, - "ExportEntities": { - "methods": [ + "ExportEntities": { + "methods": [ "ExportEntities" ] }, - "GetIndex": { - "methods": [ + "GetIndex": { + "methods": [ "GetIndex" ] }, - "ImportEntities": { - "methods": [ + "ImportEntities": { + "methods": [ "ImportEntities" ] }, - "ListIndexes": { - "methods": [ + "ListIndexes": { + "methods": [ "ListIndexes" ] } diff --git a/datastore/go.mod b/datastore/go.mod index 99070a850a7..4bfd1801c5c 100644 --- a/datastore/go.mod +++ b/datastore/go.mod @@ -7,8 +7,8 @@ require ( github.com/golang/protobuf v1.5.2 github.com/google/go-cmp v0.5.6 github.com/googleapis/gax-go/v2 v2.0.5 - google.golang.org/api v0.48.0 - google.golang.org/genproto v0.0.0-20210614143202-012ab6975634 + google.golang.org/api v0.49.0 + google.golang.org/genproto v0.0.0-20210624174822-c5cf32407d0a google.golang.org/grpc v1.38.0 google.golang.org/protobuf v1.26.0 ) diff --git a/datastore/go.sum b/datastore/go.sum index 51829ee2af9..edb7eff7904 100644 --- a/datastore/go.sum +++ b/datastore/go.sum @@ -248,8 +248,9 @@ golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5/go.mod h1:KelEdhl1UZF7XfJ golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210220000619-9bb904979d93/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210313182246-cd4f82c27b84/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c h1:pkQiBZBvdos9qq4wBAHqlzuZHEXo07pqV06ef90u1WI= golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210615190721-d04028783cf1 h1:x622Z2o4hgCr/4CiKWc51jHVKaWdtVpBNmEI8wI9Qns= +golang.org/x/oauth2 v0.0.0-20210615190721-d04028783cf1/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -300,8 +301,9 @@ golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210514084401-e8d321eab015/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210603125802-9665404d3644 h1:CA1DEQ4NdKphKeL70tvsWNdT5oFh1lOjihRcEDROi0I= golang.org/x/sys v0.0.0-20210603125802-9665404d3644/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210616094352-59db8d763f22 h1:RqytpXGR1iVNX7psjB3ff8y7sNFinVFvkx1c8SjBkio= +golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -392,8 +394,9 @@ google.golang.org/api v0.40.0/go.mod h1:fYKFpnQN0DsDSKRVRcQSDQNtqWPfM9i+zNPxepjR google.golang.org/api v0.41.0/go.mod h1:RkxM5lITDfTzmyKFPt+wGrCJbVfniCr2ool8kTBzRTU= google.golang.org/api v0.43.0/go.mod h1:nQsDGjRXMo4lvh5hP0TKqF244gqhGcr/YSIykhUk/94= google.golang.org/api v0.47.0/go.mod h1:Wbvgpq1HddcWVtzsVLyfLp8lDg6AA241LmgIL59tHXo= -google.golang.org/api v0.48.0 h1:RDAPWfNFY06dffEXfn7hZF5Fr1ZbnChzfQZAPyBd1+I= google.golang.org/api v0.48.0/go.mod h1:71Pr1vy+TAZRPkPs/xlCf5SsU8WjuAWv1Pfjbtukyy4= +google.golang.org/api v0.49.0 h1:gjIBDxlTG7vnzMmEnYwTnvLTF8Rjzo+ETCgEX1YZ/fY= +google.golang.org/api v0.49.0/go.mod h1:BECiH72wsfwUvOVn3+btPD5WHi0LzavZReBndi42L18= 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.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= @@ -445,8 +448,9 @@ google.golang.org/genproto v0.0.0-20210513213006-bf773b8c8384/go.mod h1:P3QM42oQ google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= google.golang.org/genproto v0.0.0-20210604141403-392c879c8b08/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= google.golang.org/genproto v0.0.0-20210608205507-b6d2f5bf0d7d/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= -google.golang.org/genproto v0.0.0-20210614143202-012ab6975634 h1:LnkHrvncK4mYysgs+R1wPeMAILrmunf0Tzl0Li71pxo= -google.golang.org/genproto v0.0.0-20210614143202-012ab6975634/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24= +google.golang.org/genproto v0.0.0-20210617175327-b9e0b3197ced/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24= +google.golang.org/genproto v0.0.0-20210624174822-c5cf32407d0a h1:b5Bhxmy6Tppar7Yl4J6c6xF33YSBhkm2FtV9/ZQuBkQ= +google.golang.org/genproto v0.0.0-20210624174822-c5cf32407d0a/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= diff --git a/debugger/apiv2/doc.go b/debugger/apiv2/doc.go index b265d40e195..c8aebec454f 100644 --- a/debugger/apiv2/doc.go +++ b/debugger/apiv2/doc.go @@ -49,7 +49,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210612" +const versionClient = "20210624" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/debugger/apiv2/gapic_metadata.json b/debugger/apiv2/gapic_metadata.json index e0790b9e7f7..1727a125a34 100644 --- a/debugger/apiv2/gapic_metadata.json +++ b/debugger/apiv2/gapic_metadata.json @@ -1,27 +1,27 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.devtools.clouddebugger.v2", - "libraryPackage": "cloud.google.com/go/debugger/apiv2", - "services": { - "Controller2": { - "clients": { - "grpc": { - "libraryClient": "Controller2Client", - "rpcs": { - "ListActiveBreakpoints": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.devtools.clouddebugger.v2", + "libraryPackage": "cloud.google.com/go/debugger/apiv2", + "services": { + "Controller2": { + "clients": { + "grpc": { + "libraryClient": "Controller2Client", + "rpcs": { + "ListActiveBreakpoints": { + "methods": [ "ListActiveBreakpoints" ] }, - "RegisterDebuggee": { - "methods": [ + "RegisterDebuggee": { + "methods": [ "RegisterDebuggee" ] }, - "UpdateActiveBreakpoint": { - "methods": [ + "UpdateActiveBreakpoint": { + "methods": [ "UpdateActiveBreakpoint" ] } @@ -29,33 +29,33 @@ } } }, - "Debugger2": { - "clients": { - "grpc": { - "libraryClient": "Debugger2Client", - "rpcs": { - "DeleteBreakpoint": { - "methods": [ + "Debugger2": { + "clients": { + "grpc": { + "libraryClient": "Debugger2Client", + "rpcs": { + "DeleteBreakpoint": { + "methods": [ "DeleteBreakpoint" ] }, - "GetBreakpoint": { - "methods": [ + "GetBreakpoint": { + "methods": [ "GetBreakpoint" ] }, - "ListBreakpoints": { - "methods": [ + "ListBreakpoints": { + "methods": [ "ListBreakpoints" ] }, - "ListDebuggees": { - "methods": [ + "ListDebuggees": { + "methods": [ "ListDebuggees" ] }, - "SetBreakpoint": { - "methods": [ + "SetBreakpoint": { + "methods": [ "SetBreakpoint" ] } diff --git a/dialogflow/apiv2/agents_client.go b/dialogflow/apiv2/agents_client.go index 8e4bddc6c15..49004cc92af 100644 --- a/dialogflow/apiv2/agents_client.go +++ b/dialogflow/apiv2/agents_client.go @@ -25,7 +25,6 @@ import ( "cloud.google.com/go/longrunning" lroauto "cloud.google.com/go/longrunning/autogen" - "github.com/golang/protobuf/proto" structpb "github.com/golang/protobuf/ptypes/struct" gax "github.com/googleapis/gax-go/v2" "google.golang.org/api/iterator" @@ -37,6 +36,7 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/proto" ) var newAgentsClientHook clientHook @@ -235,6 +235,10 @@ func (c *AgentsClient) GetAgent(ctx context.Context, req *dialogflowpb.GetAgentR } // SetAgent creates/updates the specified agent. +// +// Note: You should always train an agent prior to sending it queries. See the +// training +// documentation (at https://cloud.google.com/dialogflow/es/docs/training). func (c *AgentsClient) SetAgent(ctx context.Context, req *dialogflowpb.SetAgentRequest, opts ...gax.CallOption) (*dialogflowpb.Agent, error) { return c.internalClient.SetAgent(ctx, req, opts...) } @@ -257,7 +261,9 @@ func (c *AgentsClient) SearchAgents(ctx context.Context, req *dialogflowpb.Searc // TrainAgent trains the specified agent. // -// Operation +// Note: You should always train an agent prior to sending it queries. See the +// training +// documentation (at https://cloud.google.com/dialogflow/es/docs/training). func (c *AgentsClient) TrainAgent(ctx context.Context, req *dialogflowpb.TrainAgentRequest, opts ...gax.CallOption) (*TrainAgentOperation, error) { return c.internalClient.TrainAgent(ctx, req, opts...) } @@ -269,8 +275,6 @@ func (c *AgentsClient) TrainAgentOperation(name string) *TrainAgentOperation { } // ExportAgent exports the specified agent to a ZIP file. -// -// Operation func (c *AgentsClient) ExportAgent(ctx context.Context, req *dialogflowpb.ExportAgentRequest, opts ...gax.CallOption) (*ExportAgentOperation, error) { return c.internalClient.ExportAgent(ctx, req, opts...) } @@ -291,9 +295,12 @@ func (c *AgentsClient) ExportAgentOperation(name string) *ExportAgentOperation { // call TrainAgent and wait for the operation it returns in order to train // explicitly. // -// Operation // An operation which tracks when importing is complete. It only tracks // when the draft agent is updated not when it is done training. +// +// Note: You should always train an agent prior to sending it queries. See the +// training +// documentation (at https://cloud.google.com/dialogflow/es/docs/training). func (c *AgentsClient) ImportAgent(ctx context.Context, req *dialogflowpb.ImportAgentRequest, opts ...gax.CallOption) (*ImportAgentOperation, error) { return c.internalClient.ImportAgent(ctx, req, opts...) } @@ -313,9 +320,12 @@ func (c *AgentsClient) ImportAgentOperation(name string) *ImportAgentOperation { // completed yet. Please call TrainAgent and wait for the operation it // returns in order to train explicitly. // -// Operation // An operation which tracks when restoring is complete. It only tracks // when the draft agent is updated not when it is done training. +// +// Note: You should always train an agent prior to sending it queries. See the +// training +// documentation (at https://cloud.google.com/dialogflow/es/docs/training). func (c *AgentsClient) RestoreAgent(ctx context.Context, req *dialogflowpb.RestoreAgentRequest, opts ...gax.CallOption) (*RestoreAgentOperation, error) { return c.internalClient.RestoreAgent(ctx, req, opts...) } diff --git a/dialogflow/apiv2/answer_records_client.go b/dialogflow/apiv2/answer_records_client.go index 953fad16259..29e728230e2 100644 --- a/dialogflow/apiv2/answer_records_client.go +++ b/dialogflow/apiv2/answer_records_client.go @@ -23,7 +23,6 @@ import ( "net/url" "time" - "github.com/golang/protobuf/proto" gax "github.com/googleapis/gax-go/v2" "google.golang.org/api/iterator" "google.golang.org/api/option" @@ -33,6 +32,7 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/proto" ) var newAnswerRecordsClientHook clientHook diff --git a/dialogflow/apiv2/contexts_client.go b/dialogflow/apiv2/contexts_client.go index ef338270481..6b90b50a834 100644 --- a/dialogflow/apiv2/contexts_client.go +++ b/dialogflow/apiv2/contexts_client.go @@ -23,7 +23,6 @@ import ( "net/url" "time" - "github.com/golang/protobuf/proto" gax "github.com/googleapis/gax-go/v2" "google.golang.org/api/iterator" "google.golang.org/api/option" @@ -33,6 +32,7 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/proto" ) var newContextsClientHook clientHook diff --git a/dialogflow/apiv2/conversation_profiles_client.go b/dialogflow/apiv2/conversation_profiles_client.go index 8580a83ccf2..3cb9c771f3f 100644 --- a/dialogflow/apiv2/conversation_profiles_client.go +++ b/dialogflow/apiv2/conversation_profiles_client.go @@ -23,7 +23,6 @@ import ( "net/url" "time" - "github.com/golang/protobuf/proto" gax "github.com/googleapis/gax-go/v2" "google.golang.org/api/iterator" "google.golang.org/api/option" @@ -33,6 +32,7 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/proto" ) var newConversationProfilesClientHook clientHook diff --git a/dialogflow/apiv2/conversations_client.go b/dialogflow/apiv2/conversations_client.go index 6b299522ee5..d1497245dce 100644 --- a/dialogflow/apiv2/conversations_client.go +++ b/dialogflow/apiv2/conversations_client.go @@ -23,7 +23,6 @@ import ( "net/url" "time" - "github.com/golang/protobuf/proto" gax "github.com/googleapis/gax-go/v2" "google.golang.org/api/iterator" "google.golang.org/api/option" @@ -33,6 +32,7 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/proto" ) var newConversationsClientHook clientHook diff --git a/dialogflow/apiv2/doc.go b/dialogflow/apiv2/doc.go index c758007337b..90292d8d2c9 100644 --- a/dialogflow/apiv2/doc.go +++ b/dialogflow/apiv2/doc.go @@ -49,7 +49,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210617" +const versionClient = "20210624" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/dialogflow/apiv2/documents_client.go b/dialogflow/apiv2/documents_client.go index ea6302b1f5c..21614f56fe7 100644 --- a/dialogflow/apiv2/documents_client.go +++ b/dialogflow/apiv2/documents_client.go @@ -25,7 +25,6 @@ import ( "cloud.google.com/go/longrunning" lroauto "cloud.google.com/go/longrunning/autogen" - "github.com/golang/protobuf/proto" gax "github.com/googleapis/gax-go/v2" "google.golang.org/api/iterator" "google.golang.org/api/option" @@ -36,6 +35,7 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/proto" ) var newDocumentsClientHook clientHook diff --git a/dialogflow/apiv2/entity_types_client.go b/dialogflow/apiv2/entity_types_client.go index e65e03d4adc..99af19d68cc 100644 --- a/dialogflow/apiv2/entity_types_client.go +++ b/dialogflow/apiv2/entity_types_client.go @@ -25,7 +25,6 @@ import ( "cloud.google.com/go/longrunning" lroauto "cloud.google.com/go/longrunning/autogen" - "github.com/golang/protobuf/proto" structpb "github.com/golang/protobuf/ptypes/struct" gax "github.com/googleapis/gax-go/v2" "google.golang.org/api/iterator" @@ -37,6 +36,7 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/proto" ) var newEntityTypesClientHook clientHook @@ -254,23 +254,37 @@ func (c *EntityTypesClient) GetEntityType(ctx context.Context, req *dialogflowpb } // CreateEntityType creates an entity type in the specified agent. +// +// Note: You should always train an agent prior to sending it queries. See the +// training +// documentation (at https://cloud.google.com/dialogflow/es/docs/training). func (c *EntityTypesClient) CreateEntityType(ctx context.Context, req *dialogflowpb.CreateEntityTypeRequest, opts ...gax.CallOption) (*dialogflowpb.EntityType, error) { return c.internalClient.CreateEntityType(ctx, req, opts...) } // UpdateEntityType updates the specified entity type. +// +// Note: You should always train an agent prior to sending it queries. See the +// training +// documentation (at https://cloud.google.com/dialogflow/es/docs/training). func (c *EntityTypesClient) UpdateEntityType(ctx context.Context, req *dialogflowpb.UpdateEntityTypeRequest, opts ...gax.CallOption) (*dialogflowpb.EntityType, error) { return c.internalClient.UpdateEntityType(ctx, req, opts...) } // DeleteEntityType deletes the specified entity type. +// +// Note: You should always train an agent prior to sending it queries. See the +// training +// documentation (at https://cloud.google.com/dialogflow/es/docs/training). func (c *EntityTypesClient) DeleteEntityType(ctx context.Context, req *dialogflowpb.DeleteEntityTypeRequest, opts ...gax.CallOption) error { return c.internalClient.DeleteEntityType(ctx, req, opts...) } // BatchUpdateEntityTypes updates/Creates multiple entity types in the specified agent. // -// Operation +// Note: You should always train an agent prior to sending it queries. See the +// training +// documentation (at https://cloud.google.com/dialogflow/es/docs/training). func (c *EntityTypesClient) BatchUpdateEntityTypes(ctx context.Context, req *dialogflowpb.BatchUpdateEntityTypesRequest, opts ...gax.CallOption) (*BatchUpdateEntityTypesOperation, error) { return c.internalClient.BatchUpdateEntityTypes(ctx, req, opts...) } @@ -283,7 +297,9 @@ func (c *EntityTypesClient) BatchUpdateEntityTypesOperation(name string) *BatchU // BatchDeleteEntityTypes deletes entity types in the specified agent. // -// Operation +// Note: You should always train an agent prior to sending it queries. See the +// training +// documentation (at https://cloud.google.com/dialogflow/es/docs/training). func (c *EntityTypesClient) BatchDeleteEntityTypes(ctx context.Context, req *dialogflowpb.BatchDeleteEntityTypesRequest, opts ...gax.CallOption) (*BatchDeleteEntityTypesOperation, error) { return c.internalClient.BatchDeleteEntityTypes(ctx, req, opts...) } @@ -296,7 +312,9 @@ func (c *EntityTypesClient) BatchDeleteEntityTypesOperation(name string) *BatchD // BatchCreateEntities creates multiple new entities in the specified entity type. // -// Operation +// Note: You should always train an agent prior to sending it queries. See the +// training +// documentation (at https://cloud.google.com/dialogflow/es/docs/training). func (c *EntityTypesClient) BatchCreateEntities(ctx context.Context, req *dialogflowpb.BatchCreateEntitiesRequest, opts ...gax.CallOption) (*BatchCreateEntitiesOperation, error) { return c.internalClient.BatchCreateEntities(ctx, req, opts...) } @@ -311,7 +329,9 @@ func (c *EntityTypesClient) BatchCreateEntitiesOperation(name string) *BatchCrea // method does not affect entities in the entity type that aren’t explicitly // specified in the request. // -// Operation +// Note: You should always train an agent prior to sending it queries. See the +// training +// documentation (at https://cloud.google.com/dialogflow/es/docs/training). func (c *EntityTypesClient) BatchUpdateEntities(ctx context.Context, req *dialogflowpb.BatchUpdateEntitiesRequest, opts ...gax.CallOption) (*BatchUpdateEntitiesOperation, error) { return c.internalClient.BatchUpdateEntities(ctx, req, opts...) } @@ -324,7 +344,9 @@ func (c *EntityTypesClient) BatchUpdateEntitiesOperation(name string) *BatchUpda // BatchDeleteEntities deletes entities in the specified entity type. // -// Operation +// Note: You should always train an agent prior to sending it queries. See the +// training +// documentation (at https://cloud.google.com/dialogflow/es/docs/training). func (c *EntityTypesClient) BatchDeleteEntities(ctx context.Context, req *dialogflowpb.BatchDeleteEntitiesRequest, opts ...gax.CallOption) (*BatchDeleteEntitiesOperation, error) { return c.internalClient.BatchDeleteEntities(ctx, req, opts...) } diff --git a/dialogflow/apiv2/environments_client.go b/dialogflow/apiv2/environments_client.go index 310e2936460..a91f65842fb 100644 --- a/dialogflow/apiv2/environments_client.go +++ b/dialogflow/apiv2/environments_client.go @@ -23,7 +23,6 @@ import ( "net/url" "time" - "github.com/golang/protobuf/proto" gax "github.com/googleapis/gax-go/v2" "google.golang.org/api/iterator" "google.golang.org/api/option" @@ -33,6 +32,7 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/proto" ) var newEnvironmentsClientHook clientHook diff --git a/dialogflow/apiv2/gapic_metadata.json b/dialogflow/apiv2/gapic_metadata.json index d7b1922072c..0671534239a 100644 --- a/dialogflow/apiv2/gapic_metadata.json +++ b/dialogflow/apiv2/gapic_metadata.json @@ -1,57 +1,57 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.dialogflow.v2", - "libraryPackage": "cloud.google.com/go/dialogflow/apiv2", - "services": { - "Agents": { - "clients": { - "grpc": { - "libraryClient": "AgentsClient", - "rpcs": { - "DeleteAgent": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.dialogflow.v2", + "libraryPackage": "cloud.google.com/go/dialogflow/apiv2", + "services": { + "Agents": { + "clients": { + "grpc": { + "libraryClient": "AgentsClient", + "rpcs": { + "DeleteAgent": { + "methods": [ "DeleteAgent" ] }, - "ExportAgent": { - "methods": [ + "ExportAgent": { + "methods": [ "ExportAgent" ] }, - "GetAgent": { - "methods": [ + "GetAgent": { + "methods": [ "GetAgent" ] }, - "GetValidationResult": { - "methods": [ + "GetValidationResult": { + "methods": [ "GetValidationResult" ] }, - "ImportAgent": { - "methods": [ + "ImportAgent": { + "methods": [ "ImportAgent" ] }, - "RestoreAgent": { - "methods": [ + "RestoreAgent": { + "methods": [ "RestoreAgent" ] }, - "SearchAgents": { - "methods": [ + "SearchAgents": { + "methods": [ "SearchAgents" ] }, - "SetAgent": { - "methods": [ + "SetAgent": { + "methods": [ "SetAgent" ] }, - "TrainAgent": { - "methods": [ + "TrainAgent": { + "methods": [ "TrainAgent" ] } @@ -59,18 +59,18 @@ } } }, - "AnswerRecords": { - "clients": { - "grpc": { - "libraryClient": "AnswerRecordsClient", - "rpcs": { - "ListAnswerRecords": { - "methods": [ + "AnswerRecords": { + "clients": { + "grpc": { + "libraryClient": "AnswerRecordsClient", + "rpcs": { + "ListAnswerRecords": { + "methods": [ "ListAnswerRecords" ] }, - "UpdateAnswerRecord": { - "methods": [ + "UpdateAnswerRecord": { + "methods": [ "UpdateAnswerRecord" ] } @@ -78,38 +78,38 @@ } } }, - "Contexts": { - "clients": { - "grpc": { - "libraryClient": "ContextsClient", - "rpcs": { - "CreateContext": { - "methods": [ + "Contexts": { + "clients": { + "grpc": { + "libraryClient": "ContextsClient", + "rpcs": { + "CreateContext": { + "methods": [ "CreateContext" ] }, - "DeleteAllContexts": { - "methods": [ + "DeleteAllContexts": { + "methods": [ "DeleteAllContexts" ] }, - "DeleteContext": { - "methods": [ + "DeleteContext": { + "methods": [ "DeleteContext" ] }, - "GetContext": { - "methods": [ + "GetContext": { + "methods": [ "GetContext" ] }, - "ListContexts": { - "methods": [ + "ListContexts": { + "methods": [ "ListContexts" ] }, - "UpdateContext": { - "methods": [ + "UpdateContext": { + "methods": [ "UpdateContext" ] } @@ -117,33 +117,33 @@ } } }, - "ConversationProfiles": { - "clients": { - "grpc": { - "libraryClient": "ConversationProfilesClient", - "rpcs": { - "CreateConversationProfile": { - "methods": [ + "ConversationProfiles": { + "clients": { + "grpc": { + "libraryClient": "ConversationProfilesClient", + "rpcs": { + "CreateConversationProfile": { + "methods": [ "CreateConversationProfile" ] }, - "DeleteConversationProfile": { - "methods": [ + "DeleteConversationProfile": { + "methods": [ "DeleteConversationProfile" ] }, - "GetConversationProfile": { - "methods": [ + "GetConversationProfile": { + "methods": [ "GetConversationProfile" ] }, - "ListConversationProfiles": { - "methods": [ + "ListConversationProfiles": { + "methods": [ "ListConversationProfiles" ] }, - "UpdateConversationProfile": { - "methods": [ + "UpdateConversationProfile": { + "methods": [ "UpdateConversationProfile" ] } @@ -151,33 +151,33 @@ } } }, - "Conversations": { - "clients": { - "grpc": { - "libraryClient": "ConversationsClient", - "rpcs": { - "CompleteConversation": { - "methods": [ + "Conversations": { + "clients": { + "grpc": { + "libraryClient": "ConversationsClient", + "rpcs": { + "CompleteConversation": { + "methods": [ "CompleteConversation" ] }, - "CreateConversation": { - "methods": [ + "CreateConversation": { + "methods": [ "CreateConversation" ] }, - "GetConversation": { - "methods": [ + "GetConversation": { + "methods": [ "GetConversation" ] }, - "ListConversations": { - "methods": [ + "ListConversations": { + "methods": [ "ListConversations" ] }, - "ListMessages": { - "methods": [ + "ListMessages": { + "methods": [ "ListMessages" ] } @@ -185,38 +185,38 @@ } } }, - "Documents": { - "clients": { - "grpc": { - "libraryClient": "DocumentsClient", - "rpcs": { - "CreateDocument": { - "methods": [ + "Documents": { + "clients": { + "grpc": { + "libraryClient": "DocumentsClient", + "rpcs": { + "CreateDocument": { + "methods": [ "CreateDocument" ] }, - "DeleteDocument": { - "methods": [ + "DeleteDocument": { + "methods": [ "DeleteDocument" ] }, - "GetDocument": { - "methods": [ + "GetDocument": { + "methods": [ "GetDocument" ] }, - "ListDocuments": { - "methods": [ + "ListDocuments": { + "methods": [ "ListDocuments" ] }, - "ReloadDocument": { - "methods": [ + "ReloadDocument": { + "methods": [ "ReloadDocument" ] }, - "UpdateDocument": { - "methods": [ + "UpdateDocument": { + "methods": [ "UpdateDocument" ] } @@ -224,58 +224,58 @@ } } }, - "EntityTypes": { - "clients": { - "grpc": { - "libraryClient": "EntityTypesClient", - "rpcs": { - "BatchCreateEntities": { - "methods": [ + "EntityTypes": { + "clients": { + "grpc": { + "libraryClient": "EntityTypesClient", + "rpcs": { + "BatchCreateEntities": { + "methods": [ "BatchCreateEntities" ] }, - "BatchDeleteEntities": { - "methods": [ + "BatchDeleteEntities": { + "methods": [ "BatchDeleteEntities" ] }, - "BatchDeleteEntityTypes": { - "methods": [ + "BatchDeleteEntityTypes": { + "methods": [ "BatchDeleteEntityTypes" ] }, - "BatchUpdateEntities": { - "methods": [ + "BatchUpdateEntities": { + "methods": [ "BatchUpdateEntities" ] }, - "BatchUpdateEntityTypes": { - "methods": [ + "BatchUpdateEntityTypes": { + "methods": [ "BatchUpdateEntityTypes" ] }, - "CreateEntityType": { - "methods": [ + "CreateEntityType": { + "methods": [ "CreateEntityType" ] }, - "DeleteEntityType": { - "methods": [ + "DeleteEntityType": { + "methods": [ "DeleteEntityType" ] }, - "GetEntityType": { - "methods": [ + "GetEntityType": { + "methods": [ "GetEntityType" ] }, - "ListEntityTypes": { - "methods": [ + "ListEntityTypes": { + "methods": [ "ListEntityTypes" ] }, - "UpdateEntityType": { - "methods": [ + "UpdateEntityType": { + "methods": [ "UpdateEntityType" ] } @@ -283,38 +283,38 @@ } } }, - "Environments": { - "clients": { - "grpc": { - "libraryClient": "EnvironmentsClient", - "rpcs": { - "CreateEnvironment": { - "methods": [ + "Environments": { + "clients": { + "grpc": { + "libraryClient": "EnvironmentsClient", + "rpcs": { + "CreateEnvironment": { + "methods": [ "CreateEnvironment" ] }, - "DeleteEnvironment": { - "methods": [ + "DeleteEnvironment": { + "methods": [ "DeleteEnvironment" ] }, - "GetEnvironment": { - "methods": [ + "GetEnvironment": { + "methods": [ "GetEnvironment" ] }, - "GetEnvironmentHistory": { - "methods": [ + "GetEnvironmentHistory": { + "methods": [ "GetEnvironmentHistory" ] }, - "ListEnvironments": { - "methods": [ + "ListEnvironments": { + "methods": [ "ListEnvironments" ] }, - "UpdateEnvironment": { - "methods": [ + "UpdateEnvironment": { + "methods": [ "UpdateEnvironment" ] } @@ -322,18 +322,18 @@ } } }, - "Fulfillments": { - "clients": { - "grpc": { - "libraryClient": "FulfillmentsClient", - "rpcs": { - "GetFulfillment": { - "methods": [ + "Fulfillments": { + "clients": { + "grpc": { + "libraryClient": "FulfillmentsClient", + "rpcs": { + "GetFulfillment": { + "methods": [ "GetFulfillment" ] }, - "UpdateFulfillment": { - "methods": [ + "UpdateFulfillment": { + "methods": [ "UpdateFulfillment" ] } @@ -341,43 +341,43 @@ } } }, - "Intents": { - "clients": { - "grpc": { - "libraryClient": "IntentsClient", - "rpcs": { - "BatchDeleteIntents": { - "methods": [ + "Intents": { + "clients": { + "grpc": { + "libraryClient": "IntentsClient", + "rpcs": { + "BatchDeleteIntents": { + "methods": [ "BatchDeleteIntents" ] }, - "BatchUpdateIntents": { - "methods": [ + "BatchUpdateIntents": { + "methods": [ "BatchUpdateIntents" ] }, - "CreateIntent": { - "methods": [ + "CreateIntent": { + "methods": [ "CreateIntent" ] }, - "DeleteIntent": { - "methods": [ + "DeleteIntent": { + "methods": [ "DeleteIntent" ] }, - "GetIntent": { - "methods": [ + "GetIntent": { + "methods": [ "GetIntent" ] }, - "ListIntents": { - "methods": [ + "ListIntents": { + "methods": [ "ListIntents" ] }, - "UpdateIntent": { - "methods": [ + "UpdateIntent": { + "methods": [ "UpdateIntent" ] } @@ -385,33 +385,33 @@ } } }, - "KnowledgeBases": { - "clients": { - "grpc": { - "libraryClient": "KnowledgeBasesClient", - "rpcs": { - "CreateKnowledgeBase": { - "methods": [ + "KnowledgeBases": { + "clients": { + "grpc": { + "libraryClient": "KnowledgeBasesClient", + "rpcs": { + "CreateKnowledgeBase": { + "methods": [ "CreateKnowledgeBase" ] }, - "DeleteKnowledgeBase": { - "methods": [ + "DeleteKnowledgeBase": { + "methods": [ "DeleteKnowledgeBase" ] }, - "GetKnowledgeBase": { - "methods": [ + "GetKnowledgeBase": { + "methods": [ "GetKnowledgeBase" ] }, - "ListKnowledgeBases": { - "methods": [ + "ListKnowledgeBases": { + "methods": [ "ListKnowledgeBases" ] }, - "UpdateKnowledgeBase": { - "methods": [ + "UpdateKnowledgeBase": { + "methods": [ "UpdateKnowledgeBase" ] } @@ -419,43 +419,43 @@ } } }, - "Participants": { - "clients": { - "grpc": { - "libraryClient": "ParticipantsClient", - "rpcs": { - "AnalyzeContent": { - "methods": [ + "Participants": { + "clients": { + "grpc": { + "libraryClient": "ParticipantsClient", + "rpcs": { + "AnalyzeContent": { + "methods": [ "AnalyzeContent" ] }, - "CreateParticipant": { - "methods": [ + "CreateParticipant": { + "methods": [ "CreateParticipant" ] }, - "GetParticipant": { - "methods": [ + "GetParticipant": { + "methods": [ "GetParticipant" ] }, - "ListParticipants": { - "methods": [ + "ListParticipants": { + "methods": [ "ListParticipants" ] }, - "SuggestArticles": { - "methods": [ + "SuggestArticles": { + "methods": [ "SuggestArticles" ] }, - "SuggestFaqAnswers": { - "methods": [ + "SuggestFaqAnswers": { + "methods": [ "SuggestFaqAnswers" ] }, - "UpdateParticipant": { - "methods": [ + "UpdateParticipant": { + "methods": [ "UpdateParticipant" ] } @@ -463,33 +463,33 @@ } } }, - "SessionEntityTypes": { - "clients": { - "grpc": { - "libraryClient": "SessionEntityTypesClient", - "rpcs": { - "CreateSessionEntityType": { - "methods": [ + "SessionEntityTypes": { + "clients": { + "grpc": { + "libraryClient": "SessionEntityTypesClient", + "rpcs": { + "CreateSessionEntityType": { + "methods": [ "CreateSessionEntityType" ] }, - "DeleteSessionEntityType": { - "methods": [ + "DeleteSessionEntityType": { + "methods": [ "DeleteSessionEntityType" ] }, - "GetSessionEntityType": { - "methods": [ + "GetSessionEntityType": { + "methods": [ "GetSessionEntityType" ] }, - "ListSessionEntityTypes": { - "methods": [ + "ListSessionEntityTypes": { + "methods": [ "ListSessionEntityTypes" ] }, - "UpdateSessionEntityType": { - "methods": [ + "UpdateSessionEntityType": { + "methods": [ "UpdateSessionEntityType" ] } @@ -497,18 +497,18 @@ } } }, - "Sessions": { - "clients": { - "grpc": { - "libraryClient": "SessionsClient", - "rpcs": { - "DetectIntent": { - "methods": [ + "Sessions": { + "clients": { + "grpc": { + "libraryClient": "SessionsClient", + "rpcs": { + "DetectIntent": { + "methods": [ "DetectIntent" ] }, - "StreamingDetectIntent": { - "methods": [ + "StreamingDetectIntent": { + "methods": [ "StreamingDetectIntent" ] } @@ -516,33 +516,33 @@ } } }, - "Versions": { - "clients": { - "grpc": { - "libraryClient": "VersionsClient", - "rpcs": { - "CreateVersion": { - "methods": [ + "Versions": { + "clients": { + "grpc": { + "libraryClient": "VersionsClient", + "rpcs": { + "CreateVersion": { + "methods": [ "CreateVersion" ] }, - "DeleteVersion": { - "methods": [ + "DeleteVersion": { + "methods": [ "DeleteVersion" ] }, - "GetVersion": { - "methods": [ + "GetVersion": { + "methods": [ "GetVersion" ] }, - "ListVersions": { - "methods": [ + "ListVersions": { + "methods": [ "ListVersions" ] }, - "UpdateVersion": { - "methods": [ + "UpdateVersion": { + "methods": [ "UpdateVersion" ] } diff --git a/dialogflow/apiv2/intents_client.go b/dialogflow/apiv2/intents_client.go index 6b033b88c56..e6b0158a708 100644 --- a/dialogflow/apiv2/intents_client.go +++ b/dialogflow/apiv2/intents_client.go @@ -25,7 +25,6 @@ import ( "cloud.google.com/go/longrunning" lroauto "cloud.google.com/go/longrunning/autogen" - "github.com/golang/protobuf/proto" structpb "github.com/golang/protobuf/ptypes/struct" gax "github.com/googleapis/gax-go/v2" "google.golang.org/api/iterator" @@ -37,6 +36,7 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/proto" ) var newIntentsClientHook clientHook @@ -212,23 +212,37 @@ func (c *IntentsClient) GetIntent(ctx context.Context, req *dialogflowpb.GetInte } // CreateIntent creates an intent in the specified agent. +// +// Note: You should always train an agent prior to sending it queries. See the +// training +// documentation (at https://cloud.google.com/dialogflow/es/docs/training). func (c *IntentsClient) CreateIntent(ctx context.Context, req *dialogflowpb.CreateIntentRequest, opts ...gax.CallOption) (*dialogflowpb.Intent, error) { return c.internalClient.CreateIntent(ctx, req, opts...) } // UpdateIntent updates the specified intent. +// +// Note: You should always train an agent prior to sending it queries. See the +// training +// documentation (at https://cloud.google.com/dialogflow/es/docs/training). func (c *IntentsClient) UpdateIntent(ctx context.Context, req *dialogflowpb.UpdateIntentRequest, opts ...gax.CallOption) (*dialogflowpb.Intent, error) { return c.internalClient.UpdateIntent(ctx, req, opts...) } // DeleteIntent deletes the specified intent and its direct or indirect followup intents. +// +// Note: You should always train an agent prior to sending it queries. See the +// training +// documentation (at https://cloud.google.com/dialogflow/es/docs/training). func (c *IntentsClient) DeleteIntent(ctx context.Context, req *dialogflowpb.DeleteIntentRequest, opts ...gax.CallOption) error { return c.internalClient.DeleteIntent(ctx, req, opts...) } // BatchUpdateIntents updates/Creates multiple intents in the specified agent. // -// Operation +// Note: You should always train an agent prior to sending it queries. See the +// training +// documentation (at https://cloud.google.com/dialogflow/es/docs/training). func (c *IntentsClient) BatchUpdateIntents(ctx context.Context, req *dialogflowpb.BatchUpdateIntentsRequest, opts ...gax.CallOption) (*BatchUpdateIntentsOperation, error) { return c.internalClient.BatchUpdateIntents(ctx, req, opts...) } @@ -241,7 +255,9 @@ func (c *IntentsClient) BatchUpdateIntentsOperation(name string) *BatchUpdateInt // BatchDeleteIntents deletes intents in the specified agent. // -// Operation +// Note: You should always train an agent prior to sending it queries. See the +// training +// documentation (at https://cloud.google.com/dialogflow/es/docs/training). func (c *IntentsClient) BatchDeleteIntents(ctx context.Context, req *dialogflowpb.BatchDeleteIntentsRequest, opts ...gax.CallOption) (*BatchDeleteIntentsOperation, error) { return c.internalClient.BatchDeleteIntents(ctx, req, opts...) } diff --git a/dialogflow/apiv2/knowledge_bases_client.go b/dialogflow/apiv2/knowledge_bases_client.go index cb339c67410..f57400e31b6 100644 --- a/dialogflow/apiv2/knowledge_bases_client.go +++ b/dialogflow/apiv2/knowledge_bases_client.go @@ -23,7 +23,6 @@ import ( "net/url" "time" - "github.com/golang/protobuf/proto" gax "github.com/googleapis/gax-go/v2" "google.golang.org/api/iterator" "google.golang.org/api/option" @@ -33,6 +32,7 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/proto" ) var newKnowledgeBasesClientHook clientHook diff --git a/dialogflow/apiv2/participants_client.go b/dialogflow/apiv2/participants_client.go index edc7c36512f..1706d5317f4 100644 --- a/dialogflow/apiv2/participants_client.go +++ b/dialogflow/apiv2/participants_client.go @@ -23,7 +23,6 @@ import ( "net/url" "time" - "github.com/golang/protobuf/proto" gax "github.com/googleapis/gax-go/v2" "google.golang.org/api/iterator" "google.golang.org/api/option" @@ -33,6 +32,7 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/proto" ) var newParticipantsClientHook clientHook diff --git a/dialogflow/apiv2/session_entity_types_client.go b/dialogflow/apiv2/session_entity_types_client.go index dceedf6fcd1..2342f4060fe 100644 --- a/dialogflow/apiv2/session_entity_types_client.go +++ b/dialogflow/apiv2/session_entity_types_client.go @@ -23,7 +23,6 @@ import ( "net/url" "time" - "github.com/golang/protobuf/proto" gax "github.com/googleapis/gax-go/v2" "google.golang.org/api/iterator" "google.golang.org/api/option" @@ -33,6 +32,7 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/proto" ) var newSessionEntityTypesClientHook clientHook diff --git a/dialogflow/apiv2/versions_client.go b/dialogflow/apiv2/versions_client.go index cc0db296f6d..4eb375f6855 100644 --- a/dialogflow/apiv2/versions_client.go +++ b/dialogflow/apiv2/versions_client.go @@ -23,7 +23,6 @@ import ( "net/url" "time" - "github.com/golang/protobuf/proto" gax "github.com/googleapis/gax-go/v2" "google.golang.org/api/iterator" "google.golang.org/api/option" @@ -33,6 +32,7 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/proto" ) var newVersionsClientHook clientHook diff --git a/dialogflow/cx/apiv3/agents_client.go b/dialogflow/cx/apiv3/agents_client.go index 4a9bdc216ae..f7671d8a97b 100644 --- a/dialogflow/cx/apiv3/agents_client.go +++ b/dialogflow/cx/apiv3/agents_client.go @@ -25,7 +25,6 @@ import ( "cloud.google.com/go/longrunning" lroauto "cloud.google.com/go/longrunning/autogen" - "github.com/golang/protobuf/proto" structpb "github.com/golang/protobuf/ptypes/struct" gax "github.com/googleapis/gax-go/v2" "google.golang.org/api/iterator" @@ -37,6 +36,7 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/proto" ) var newAgentsClientHook clientHook @@ -238,11 +238,19 @@ func (c *AgentsClient) GetAgent(ctx context.Context, req *cxpb.GetAgentRequest, } // CreateAgent creates an agent in the specified location. +// +// Note: You should always train flows prior to sending them queries. See the +// training +// documentation (at https://cloud.google.com/dialogflow/cx/docs/concept/training). func (c *AgentsClient) CreateAgent(ctx context.Context, req *cxpb.CreateAgentRequest, opts ...gax.CallOption) (*cxpb.Agent, error) { return c.internalClient.CreateAgent(ctx, req, opts...) } // UpdateAgent updates the specified agent. +// +// Note: You should always train flows prior to sending them queries. See the +// training +// documentation (at https://cloud.google.com/dialogflow/cx/docs/concept/training). func (c *AgentsClient) UpdateAgent(ctx context.Context, req *cxpb.UpdateAgentRequest, opts ...gax.CallOption) (*cxpb.Agent, error) { return c.internalClient.UpdateAgent(ctx, req, opts...) } @@ -267,6 +275,10 @@ func (c *AgentsClient) ExportAgentOperation(name string) *ExportAgentOperation { // // Replaces the current agent with a new one. Note that all existing resources // in agent (e.g. intents, entity types, flows) will be removed. +// +// Note: You should always train flows prior to sending them queries. See the +// training +// documentation (at https://cloud.google.com/dialogflow/cx/docs/concept/training). func (c *AgentsClient) RestoreAgent(ctx context.Context, req *cxpb.RestoreAgentRequest, opts ...gax.CallOption) (*RestoreAgentOperation, error) { return c.internalClient.RestoreAgent(ctx, req, opts...) } diff --git a/dialogflow/cx/apiv3/doc.go b/dialogflow/cx/apiv3/doc.go index a1bebf150e0..6623135f975 100644 --- a/dialogflow/cx/apiv3/doc.go +++ b/dialogflow/cx/apiv3/doc.go @@ -51,7 +51,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210612" +const versionClient = "20210624" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/dialogflow/cx/apiv3/entity_types_client.go b/dialogflow/cx/apiv3/entity_types_client.go index 8f861a110b9..e8d99c6f5c3 100644 --- a/dialogflow/cx/apiv3/entity_types_client.go +++ b/dialogflow/cx/apiv3/entity_types_client.go @@ -23,7 +23,6 @@ import ( "net/url" "time" - "github.com/golang/protobuf/proto" gax "github.com/googleapis/gax-go/v2" "google.golang.org/api/iterator" "google.golang.org/api/option" @@ -33,6 +32,7 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/proto" ) var newEntityTypesClientHook clientHook @@ -175,16 +175,28 @@ func (c *EntityTypesClient) GetEntityType(ctx context.Context, req *cxpb.GetEnti } // CreateEntityType creates an entity type in the specified agent. +// +// Note: You should always train a flow prior to sending it queries. See the +// training +// documentation (at https://cloud.google.com/dialogflow/cx/docs/concept/training). func (c *EntityTypesClient) CreateEntityType(ctx context.Context, req *cxpb.CreateEntityTypeRequest, opts ...gax.CallOption) (*cxpb.EntityType, error) { return c.internalClient.CreateEntityType(ctx, req, opts...) } // UpdateEntityType updates the specified entity type. +// +// Note: You should always train a flow prior to sending it queries. See the +// training +// documentation (at https://cloud.google.com/dialogflow/cx/docs/concept/training). func (c *EntityTypesClient) UpdateEntityType(ctx context.Context, req *cxpb.UpdateEntityTypeRequest, opts ...gax.CallOption) (*cxpb.EntityType, error) { return c.internalClient.UpdateEntityType(ctx, req, opts...) } // DeleteEntityType deletes the specified entity type. +// +// Note: You should always train a flow prior to sending it queries. See the +// training +// documentation (at https://cloud.google.com/dialogflow/cx/docs/concept/training). func (c *EntityTypesClient) DeleteEntityType(ctx context.Context, req *cxpb.DeleteEntityTypeRequest, opts ...gax.CallOption) error { return c.internalClient.DeleteEntityType(ctx, req, opts...) } diff --git a/dialogflow/cx/apiv3/environments_client.go b/dialogflow/cx/apiv3/environments_client.go index 54b78cded35..2d87bdd6b93 100644 --- a/dialogflow/cx/apiv3/environments_client.go +++ b/dialogflow/cx/apiv3/environments_client.go @@ -25,7 +25,6 @@ import ( "cloud.google.com/go/longrunning" lroauto "cloud.google.com/go/longrunning/autogen" - "github.com/golang/protobuf/proto" structpb "github.com/golang/protobuf/ptypes/struct" gax "github.com/googleapis/gax-go/v2" "google.golang.org/api/iterator" @@ -37,6 +36,7 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/proto" ) var newEnvironmentsClientHook clientHook diff --git a/dialogflow/cx/apiv3/experiments_client.go b/dialogflow/cx/apiv3/experiments_client.go index 35d71ae941a..d42b703f3de 100644 --- a/dialogflow/cx/apiv3/experiments_client.go +++ b/dialogflow/cx/apiv3/experiments_client.go @@ -23,7 +23,6 @@ import ( "net/url" "time" - "github.com/golang/protobuf/proto" gax "github.com/googleapis/gax-go/v2" "google.golang.org/api/iterator" "google.golang.org/api/option" @@ -33,6 +32,7 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/proto" ) var newExperimentsClientHook clientHook diff --git a/dialogflow/cx/apiv3/flows_client.go b/dialogflow/cx/apiv3/flows_client.go index 6bc73b4ba11..9f2c6c75846 100644 --- a/dialogflow/cx/apiv3/flows_client.go +++ b/dialogflow/cx/apiv3/flows_client.go @@ -25,7 +25,6 @@ import ( "cloud.google.com/go/longrunning" lroauto "cloud.google.com/go/longrunning/autogen" - "github.com/golang/protobuf/proto" structpb "github.com/golang/protobuf/ptypes/struct" gax "github.com/googleapis/gax-go/v2" "google.golang.org/api/iterator" @@ -37,6 +36,7 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/proto" ) var newFlowsClientHook clientHook @@ -242,6 +242,10 @@ func (c *FlowsClient) Connection() *grpc.ClientConn { } // CreateFlow creates a flow in the specified agent. +// +// Note: You should always train a flow prior to sending it queries. See the +// training +// documentation (at https://cloud.google.com/dialogflow/cx/docs/concept/training). func (c *FlowsClient) CreateFlow(ctx context.Context, req *cxpb.CreateFlowRequest, opts ...gax.CallOption) (*cxpb.Flow, error) { return c.internalClient.CreateFlow(ctx, req, opts...) } @@ -262,12 +266,20 @@ func (c *FlowsClient) GetFlow(ctx context.Context, req *cxpb.GetFlowRequest, opt } // UpdateFlow updates the specified flow. +// +// Note: You should always train a flow prior to sending it queries. See the +// training +// documentation (at https://cloud.google.com/dialogflow/cx/docs/concept/training). func (c *FlowsClient) UpdateFlow(ctx context.Context, req *cxpb.UpdateFlowRequest, opts ...gax.CallOption) (*cxpb.Flow, error) { return c.internalClient.UpdateFlow(ctx, req, opts...) } // TrainFlow trains the specified flow. Note that only the flow in ‘draft’ environment // is trained. +// +// Note: You should always train a flow prior to sending it queries. See the +// training +// documentation (at https://cloud.google.com/dialogflow/cx/docs/concept/training). func (c *FlowsClient) TrainFlow(ctx context.Context, req *cxpb.TrainFlowRequest, opts ...gax.CallOption) (*TrainFlowOperation, error) { return c.internalClient.TrainFlow(ctx, req, opts...) } @@ -292,6 +304,10 @@ func (c *FlowsClient) GetFlowValidationResult(ctx context.Context, req *cxpb.Get } // ImportFlow imports the specified flow to the specified agent from a binary file. +// +// Note: You should always train a flow prior to sending it queries. See the +// training +// documentation (at https://cloud.google.com/dialogflow/cx/docs/concept/training). func (c *FlowsClient) ImportFlow(ctx context.Context, req *cxpb.ImportFlowRequest, opts ...gax.CallOption) (*ImportFlowOperation, error) { return c.internalClient.ImportFlow(ctx, req, opts...) } diff --git a/dialogflow/cx/apiv3/gapic_metadata.json b/dialogflow/cx/apiv3/gapic_metadata.json index 409bc550939..c90368d52f5 100644 --- a/dialogflow/cx/apiv3/gapic_metadata.json +++ b/dialogflow/cx/apiv3/gapic_metadata.json @@ -1,57 +1,57 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.dialogflow.cx.v3", - "libraryPackage": "cloud.google.com/go/dialogflow/cx/apiv3", - "services": { - "Agents": { - "clients": { - "grpc": { - "libraryClient": "AgentsClient", - "rpcs": { - "CreateAgent": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.dialogflow.cx.v3", + "libraryPackage": "cloud.google.com/go/dialogflow/cx/apiv3", + "services": { + "Agents": { + "clients": { + "grpc": { + "libraryClient": "AgentsClient", + "rpcs": { + "CreateAgent": { + "methods": [ "CreateAgent" ] }, - "DeleteAgent": { - "methods": [ + "DeleteAgent": { + "methods": [ "DeleteAgent" ] }, - "ExportAgent": { - "methods": [ + "ExportAgent": { + "methods": [ "ExportAgent" ] }, - "GetAgent": { - "methods": [ + "GetAgent": { + "methods": [ "GetAgent" ] }, - "GetAgentValidationResult": { - "methods": [ + "GetAgentValidationResult": { + "methods": [ "GetAgentValidationResult" ] }, - "ListAgents": { - "methods": [ + "ListAgents": { + "methods": [ "ListAgents" ] }, - "RestoreAgent": { - "methods": [ + "RestoreAgent": { + "methods": [ "RestoreAgent" ] }, - "UpdateAgent": { - "methods": [ + "UpdateAgent": { + "methods": [ "UpdateAgent" ] }, - "ValidateAgent": { - "methods": [ + "ValidateAgent": { + "methods": [ "ValidateAgent" ] } @@ -59,33 +59,33 @@ } } }, - "EntityTypes": { - "clients": { - "grpc": { - "libraryClient": "EntityTypesClient", - "rpcs": { - "CreateEntityType": { - "methods": [ + "EntityTypes": { + "clients": { + "grpc": { + "libraryClient": "EntityTypesClient", + "rpcs": { + "CreateEntityType": { + "methods": [ "CreateEntityType" ] }, - "DeleteEntityType": { - "methods": [ + "DeleteEntityType": { + "methods": [ "DeleteEntityType" ] }, - "GetEntityType": { - "methods": [ + "GetEntityType": { + "methods": [ "GetEntityType" ] }, - "ListEntityTypes": { - "methods": [ + "ListEntityTypes": { + "methods": [ "ListEntityTypes" ] }, - "UpdateEntityType": { - "methods": [ + "UpdateEntityType": { + "methods": [ "UpdateEntityType" ] } @@ -93,48 +93,48 @@ } } }, - "Environments": { - "clients": { - "grpc": { - "libraryClient": "EnvironmentsClient", - "rpcs": { - "CreateEnvironment": { - "methods": [ + "Environments": { + "clients": { + "grpc": { + "libraryClient": "EnvironmentsClient", + "rpcs": { + "CreateEnvironment": { + "methods": [ "CreateEnvironment" ] }, - "DeleteEnvironment": { - "methods": [ + "DeleteEnvironment": { + "methods": [ "DeleteEnvironment" ] }, - "GetEnvironment": { - "methods": [ + "GetEnvironment": { + "methods": [ "GetEnvironment" ] }, - "ListContinuousTestResults": { - "methods": [ + "ListContinuousTestResults": { + "methods": [ "ListContinuousTestResults" ] }, - "ListEnvironments": { - "methods": [ + "ListEnvironments": { + "methods": [ "ListEnvironments" ] }, - "LookupEnvironmentHistory": { - "methods": [ + "LookupEnvironmentHistory": { + "methods": [ "LookupEnvironmentHistory" ] }, - "RunContinuousTest": { - "methods": [ + "RunContinuousTest": { + "methods": [ "RunContinuousTest" ] }, - "UpdateEnvironment": { - "methods": [ + "UpdateEnvironment": { + "methods": [ "UpdateEnvironment" ] } @@ -142,43 +142,43 @@ } } }, - "Experiments": { - "clients": { - "grpc": { - "libraryClient": "ExperimentsClient", - "rpcs": { - "CreateExperiment": { - "methods": [ + "Experiments": { + "clients": { + "grpc": { + "libraryClient": "ExperimentsClient", + "rpcs": { + "CreateExperiment": { + "methods": [ "CreateExperiment" ] }, - "DeleteExperiment": { - "methods": [ + "DeleteExperiment": { + "methods": [ "DeleteExperiment" ] }, - "GetExperiment": { - "methods": [ + "GetExperiment": { + "methods": [ "GetExperiment" ] }, - "ListExperiments": { - "methods": [ + "ListExperiments": { + "methods": [ "ListExperiments" ] }, - "StartExperiment": { - "methods": [ + "StartExperiment": { + "methods": [ "StartExperiment" ] }, - "StopExperiment": { - "methods": [ + "StopExperiment": { + "methods": [ "StopExperiment" ] }, - "UpdateExperiment": { - "methods": [ + "UpdateExperiment": { + "methods": [ "UpdateExperiment" ] } @@ -186,58 +186,58 @@ } } }, - "Flows": { - "clients": { - "grpc": { - "libraryClient": "FlowsClient", - "rpcs": { - "CreateFlow": { - "methods": [ + "Flows": { + "clients": { + "grpc": { + "libraryClient": "FlowsClient", + "rpcs": { + "CreateFlow": { + "methods": [ "CreateFlow" ] }, - "DeleteFlow": { - "methods": [ + "DeleteFlow": { + "methods": [ "DeleteFlow" ] }, - "ExportFlow": { - "methods": [ + "ExportFlow": { + "methods": [ "ExportFlow" ] }, - "GetFlow": { - "methods": [ + "GetFlow": { + "methods": [ "GetFlow" ] }, - "GetFlowValidationResult": { - "methods": [ + "GetFlowValidationResult": { + "methods": [ "GetFlowValidationResult" ] }, - "ImportFlow": { - "methods": [ + "ImportFlow": { + "methods": [ "ImportFlow" ] }, - "ListFlows": { - "methods": [ + "ListFlows": { + "methods": [ "ListFlows" ] }, - "TrainFlow": { - "methods": [ + "TrainFlow": { + "methods": [ "TrainFlow" ] }, - "UpdateFlow": { - "methods": [ + "UpdateFlow": { + "methods": [ "UpdateFlow" ] }, - "ValidateFlow": { - "methods": [ + "ValidateFlow": { + "methods": [ "ValidateFlow" ] } @@ -245,33 +245,33 @@ } } }, - "Intents": { - "clients": { - "grpc": { - "libraryClient": "IntentsClient", - "rpcs": { - "CreateIntent": { - "methods": [ + "Intents": { + "clients": { + "grpc": { + "libraryClient": "IntentsClient", + "rpcs": { + "CreateIntent": { + "methods": [ "CreateIntent" ] }, - "DeleteIntent": { - "methods": [ + "DeleteIntent": { + "methods": [ "DeleteIntent" ] }, - "GetIntent": { - "methods": [ + "GetIntent": { + "methods": [ "GetIntent" ] }, - "ListIntents": { - "methods": [ + "ListIntents": { + "methods": [ "ListIntents" ] }, - "UpdateIntent": { - "methods": [ + "UpdateIntent": { + "methods": [ "UpdateIntent" ] } @@ -279,33 +279,33 @@ } } }, - "Pages": { - "clients": { - "grpc": { - "libraryClient": "PagesClient", - "rpcs": { - "CreatePage": { - "methods": [ + "Pages": { + "clients": { + "grpc": { + "libraryClient": "PagesClient", + "rpcs": { + "CreatePage": { + "methods": [ "CreatePage" ] }, - "DeletePage": { - "methods": [ + "DeletePage": { + "methods": [ "DeletePage" ] }, - "GetPage": { - "methods": [ + "GetPage": { + "methods": [ "GetPage" ] }, - "ListPages": { - "methods": [ + "ListPages": { + "methods": [ "ListPages" ] }, - "UpdatePage": { - "methods": [ + "UpdatePage": { + "methods": [ "UpdatePage" ] } @@ -313,33 +313,33 @@ } } }, - "SecuritySettingsService": { - "clients": { - "grpc": { - "libraryClient": "SecuritySettingsClient", - "rpcs": { - "CreateSecuritySettings": { - "methods": [ + "SecuritySettingsService": { + "clients": { + "grpc": { + "libraryClient": "SecuritySettingsClient", + "rpcs": { + "CreateSecuritySettings": { + "methods": [ "CreateSecuritySettings" ] }, - "DeleteSecuritySettings": { - "methods": [ + "DeleteSecuritySettings": { + "methods": [ "DeleteSecuritySettings" ] }, - "GetSecuritySettings": { - "methods": [ + "GetSecuritySettings": { + "methods": [ "GetSecuritySettings" ] }, - "ListSecuritySettings": { - "methods": [ + "ListSecuritySettings": { + "methods": [ "ListSecuritySettings" ] }, - "UpdateSecuritySettings": { - "methods": [ + "UpdateSecuritySettings": { + "methods": [ "UpdateSecuritySettings" ] } @@ -347,33 +347,33 @@ } } }, - "SessionEntityTypes": { - "clients": { - "grpc": { - "libraryClient": "SessionEntityTypesClient", - "rpcs": { - "CreateSessionEntityType": { - "methods": [ + "SessionEntityTypes": { + "clients": { + "grpc": { + "libraryClient": "SessionEntityTypesClient", + "rpcs": { + "CreateSessionEntityType": { + "methods": [ "CreateSessionEntityType" ] }, - "DeleteSessionEntityType": { - "methods": [ + "DeleteSessionEntityType": { + "methods": [ "DeleteSessionEntityType" ] }, - "GetSessionEntityType": { - "methods": [ + "GetSessionEntityType": { + "methods": [ "GetSessionEntityType" ] }, - "ListSessionEntityTypes": { - "methods": [ + "ListSessionEntityTypes": { + "methods": [ "ListSessionEntityTypes" ] }, - "UpdateSessionEntityType": { - "methods": [ + "UpdateSessionEntityType": { + "methods": [ "UpdateSessionEntityType" ] } @@ -381,28 +381,28 @@ } } }, - "Sessions": { - "clients": { - "grpc": { - "libraryClient": "SessionsClient", - "rpcs": { - "DetectIntent": { - "methods": [ + "Sessions": { + "clients": { + "grpc": { + "libraryClient": "SessionsClient", + "rpcs": { + "DetectIntent": { + "methods": [ "DetectIntent" ] }, - "FulfillIntent": { - "methods": [ + "FulfillIntent": { + "methods": [ "FulfillIntent" ] }, - "MatchIntent": { - "methods": [ + "MatchIntent": { + "methods": [ "MatchIntent" ] }, - "StreamingDetectIntent": { - "methods": [ + "StreamingDetectIntent": { + "methods": [ "StreamingDetectIntent" ] } @@ -410,68 +410,68 @@ } } }, - "TestCases": { - "clients": { - "grpc": { - "libraryClient": "TestCasesClient", - "rpcs": { - "BatchDeleteTestCases": { - "methods": [ + "TestCases": { + "clients": { + "grpc": { + "libraryClient": "TestCasesClient", + "rpcs": { + "BatchDeleteTestCases": { + "methods": [ "BatchDeleteTestCases" ] }, - "BatchRunTestCases": { - "methods": [ + "BatchRunTestCases": { + "methods": [ "BatchRunTestCases" ] }, - "CalculateCoverage": { - "methods": [ + "CalculateCoverage": { + "methods": [ "CalculateCoverage" ] }, - "CreateTestCase": { - "methods": [ + "CreateTestCase": { + "methods": [ "CreateTestCase" ] }, - "ExportTestCases": { - "methods": [ + "ExportTestCases": { + "methods": [ "ExportTestCases" ] }, - "GetTestCase": { - "methods": [ + "GetTestCase": { + "methods": [ "GetTestCase" ] }, - "GetTestCaseResult": { - "methods": [ + "GetTestCaseResult": { + "methods": [ "GetTestCaseResult" ] }, - "ImportTestCases": { - "methods": [ + "ImportTestCases": { + "methods": [ "ImportTestCases" ] }, - "ListTestCaseResults": { - "methods": [ + "ListTestCaseResults": { + "methods": [ "ListTestCaseResults" ] }, - "ListTestCases": { - "methods": [ + "ListTestCases": { + "methods": [ "ListTestCases" ] }, - "RunTestCase": { - "methods": [ + "RunTestCase": { + "methods": [ "RunTestCase" ] }, - "UpdateTestCase": { - "methods": [ + "UpdateTestCase": { + "methods": [ "UpdateTestCase" ] } @@ -479,33 +479,33 @@ } } }, - "TransitionRouteGroups": { - "clients": { - "grpc": { - "libraryClient": "TransitionRouteGroupsClient", - "rpcs": { - "CreateTransitionRouteGroup": { - "methods": [ + "TransitionRouteGroups": { + "clients": { + "grpc": { + "libraryClient": "TransitionRouteGroupsClient", + "rpcs": { + "CreateTransitionRouteGroup": { + "methods": [ "CreateTransitionRouteGroup" ] }, - "DeleteTransitionRouteGroup": { - "methods": [ + "DeleteTransitionRouteGroup": { + "methods": [ "DeleteTransitionRouteGroup" ] }, - "GetTransitionRouteGroup": { - "methods": [ + "GetTransitionRouteGroup": { + "methods": [ "GetTransitionRouteGroup" ] }, - "ListTransitionRouteGroups": { - "methods": [ + "ListTransitionRouteGroups": { + "methods": [ "ListTransitionRouteGroups" ] }, - "UpdateTransitionRouteGroup": { - "methods": [ + "UpdateTransitionRouteGroup": { + "methods": [ "UpdateTransitionRouteGroup" ] } @@ -513,38 +513,38 @@ } } }, - "Versions": { - "clients": { - "grpc": { - "libraryClient": "VersionsClient", - "rpcs": { - "CreateVersion": { - "methods": [ + "Versions": { + "clients": { + "grpc": { + "libraryClient": "VersionsClient", + "rpcs": { + "CreateVersion": { + "methods": [ "CreateVersion" ] }, - "DeleteVersion": { - "methods": [ + "DeleteVersion": { + "methods": [ "DeleteVersion" ] }, - "GetVersion": { - "methods": [ + "GetVersion": { + "methods": [ "GetVersion" ] }, - "ListVersions": { - "methods": [ + "ListVersions": { + "methods": [ "ListVersions" ] }, - "LoadVersion": { - "methods": [ + "LoadVersion": { + "methods": [ "LoadVersion" ] }, - "UpdateVersion": { - "methods": [ + "UpdateVersion": { + "methods": [ "UpdateVersion" ] } @@ -552,33 +552,33 @@ } } }, - "Webhooks": { - "clients": { - "grpc": { - "libraryClient": "WebhooksClient", - "rpcs": { - "CreateWebhook": { - "methods": [ + "Webhooks": { + "clients": { + "grpc": { + "libraryClient": "WebhooksClient", + "rpcs": { + "CreateWebhook": { + "methods": [ "CreateWebhook" ] }, - "DeleteWebhook": { - "methods": [ + "DeleteWebhook": { + "methods": [ "DeleteWebhook" ] }, - "GetWebhook": { - "methods": [ + "GetWebhook": { + "methods": [ "GetWebhook" ] }, - "ListWebhooks": { - "methods": [ + "ListWebhooks": { + "methods": [ "ListWebhooks" ] }, - "UpdateWebhook": { - "methods": [ + "UpdateWebhook": { + "methods": [ "UpdateWebhook" ] } diff --git a/dialogflow/cx/apiv3/intents_client.go b/dialogflow/cx/apiv3/intents_client.go index b5c6963b708..e2b2fb76862 100644 --- a/dialogflow/cx/apiv3/intents_client.go +++ b/dialogflow/cx/apiv3/intents_client.go @@ -23,7 +23,6 @@ import ( "net/url" "time" - "github.com/golang/protobuf/proto" gax "github.com/googleapis/gax-go/v2" "google.golang.org/api/iterator" "google.golang.org/api/option" @@ -33,6 +32,7 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/proto" ) var newIntentsClientHook clientHook @@ -175,16 +175,28 @@ func (c *IntentsClient) GetIntent(ctx context.Context, req *cxpb.GetIntentReques } // CreateIntent creates an intent in the specified agent. +// +// Note: You should always train a flow prior to sending it queries. See the +// training +// documentation (at https://cloud.google.com/dialogflow/cx/docs/concept/training). func (c *IntentsClient) CreateIntent(ctx context.Context, req *cxpb.CreateIntentRequest, opts ...gax.CallOption) (*cxpb.Intent, error) { return c.internalClient.CreateIntent(ctx, req, opts...) } // UpdateIntent updates the specified intent. +// +// Note: You should always train a flow prior to sending it queries. See the +// training +// documentation (at https://cloud.google.com/dialogflow/cx/docs/concept/training). func (c *IntentsClient) UpdateIntent(ctx context.Context, req *cxpb.UpdateIntentRequest, opts ...gax.CallOption) (*cxpb.Intent, error) { return c.internalClient.UpdateIntent(ctx, req, opts...) } // DeleteIntent deletes the specified intent. +// +// Note: You should always train a flow prior to sending it queries. See the +// training +// documentation (at https://cloud.google.com/dialogflow/cx/docs/concept/training). func (c *IntentsClient) DeleteIntent(ctx context.Context, req *cxpb.DeleteIntentRequest, opts ...gax.CallOption) error { return c.internalClient.DeleteIntent(ctx, req, opts...) } diff --git a/dialogflow/cx/apiv3/pages_client.go b/dialogflow/cx/apiv3/pages_client.go index 4783a0eb75d..4bb883a8001 100644 --- a/dialogflow/cx/apiv3/pages_client.go +++ b/dialogflow/cx/apiv3/pages_client.go @@ -23,7 +23,6 @@ import ( "net/url" "time" - "github.com/golang/protobuf/proto" gax "github.com/googleapis/gax-go/v2" "google.golang.org/api/iterator" "google.golang.org/api/option" @@ -33,6 +32,7 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/proto" ) var newPagesClientHook clientHook @@ -175,16 +175,28 @@ func (c *PagesClient) GetPage(ctx context.Context, req *cxpb.GetPageRequest, opt } // CreatePage creates a page in the specified flow. +// +// Note: You should always train a flow prior to sending it queries. See the +// training +// documentation (at https://cloud.google.com/dialogflow/cx/docs/concept/training). func (c *PagesClient) CreatePage(ctx context.Context, req *cxpb.CreatePageRequest, opts ...gax.CallOption) (*cxpb.Page, error) { return c.internalClient.CreatePage(ctx, req, opts...) } // UpdatePage updates the specified page. +// +// Note: You should always train a flow prior to sending it queries. See the +// training +// documentation (at https://cloud.google.com/dialogflow/cx/docs/concept/training). func (c *PagesClient) UpdatePage(ctx context.Context, req *cxpb.UpdatePageRequest, opts ...gax.CallOption) (*cxpb.Page, error) { return c.internalClient.UpdatePage(ctx, req, opts...) } // DeletePage deletes the specified page. +// +// Note: You should always train a flow prior to sending it queries. See the +// training +// documentation (at https://cloud.google.com/dialogflow/cx/docs/concept/training). func (c *PagesClient) DeletePage(ctx context.Context, req *cxpb.DeletePageRequest, opts ...gax.CallOption) error { return c.internalClient.DeletePage(ctx, req, opts...) } diff --git a/dialogflow/cx/apiv3/security_settings_client.go b/dialogflow/cx/apiv3/security_settings_client.go index 6ed77d67bb3..19525b722f5 100644 --- a/dialogflow/cx/apiv3/security_settings_client.go +++ b/dialogflow/cx/apiv3/security_settings_client.go @@ -23,7 +23,6 @@ import ( "net/url" "time" - "github.com/golang/protobuf/proto" gax "github.com/googleapis/gax-go/v2" "google.golang.org/api/iterator" "google.golang.org/api/option" @@ -33,6 +32,7 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/proto" ) var newSecuritySettingsClientHook clientHook diff --git a/dialogflow/cx/apiv3/session_entity_types_client.go b/dialogflow/cx/apiv3/session_entity_types_client.go index 2140f40dd18..f8ef1c50ce6 100644 --- a/dialogflow/cx/apiv3/session_entity_types_client.go +++ b/dialogflow/cx/apiv3/session_entity_types_client.go @@ -23,7 +23,6 @@ import ( "net/url" "time" - "github.com/golang/protobuf/proto" gax "github.com/googleapis/gax-go/v2" "google.golang.org/api/iterator" "google.golang.org/api/option" @@ -33,6 +32,7 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/proto" ) var newSessionEntityTypesClientHook clientHook diff --git a/dialogflow/cx/apiv3/test_cases_client.go b/dialogflow/cx/apiv3/test_cases_client.go index 34c54b698c5..cb243cafc06 100644 --- a/dialogflow/cx/apiv3/test_cases_client.go +++ b/dialogflow/cx/apiv3/test_cases_client.go @@ -25,7 +25,6 @@ import ( "cloud.google.com/go/longrunning" lroauto "cloud.google.com/go/longrunning/autogen" - "github.com/golang/protobuf/proto" gax "github.com/googleapis/gax-go/v2" "google.golang.org/api/iterator" "google.golang.org/api/option" @@ -36,6 +35,7 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/proto" ) var newTestCasesClientHook clientHook diff --git a/dialogflow/cx/apiv3/transition_route_groups_client.go b/dialogflow/cx/apiv3/transition_route_groups_client.go index dfa7a11800a..a71d3bf795d 100644 --- a/dialogflow/cx/apiv3/transition_route_groups_client.go +++ b/dialogflow/cx/apiv3/transition_route_groups_client.go @@ -23,7 +23,6 @@ import ( "net/url" "time" - "github.com/golang/protobuf/proto" gax "github.com/googleapis/gax-go/v2" "google.golang.org/api/iterator" "google.golang.org/api/option" @@ -33,6 +32,7 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/proto" ) var newTransitionRouteGroupsClientHook clientHook @@ -175,16 +175,28 @@ func (c *TransitionRouteGroupsClient) GetTransitionRouteGroup(ctx context.Contex } // CreateTransitionRouteGroup creates an TransitionRouteGroup in the specified flow. +// +// Note: You should always train a flow prior to sending it queries. See the +// training +// documentation (at https://cloud.google.com/dialogflow/cx/docs/concept/training). func (c *TransitionRouteGroupsClient) CreateTransitionRouteGroup(ctx context.Context, req *cxpb.CreateTransitionRouteGroupRequest, opts ...gax.CallOption) (*cxpb.TransitionRouteGroup, error) { return c.internalClient.CreateTransitionRouteGroup(ctx, req, opts...) } // UpdateTransitionRouteGroup updates the specified TransitionRouteGroup. +// +// Note: You should always train a flow prior to sending it queries. See the +// training +// documentation (at https://cloud.google.com/dialogflow/cx/docs/concept/training). func (c *TransitionRouteGroupsClient) UpdateTransitionRouteGroup(ctx context.Context, req *cxpb.UpdateTransitionRouteGroupRequest, opts ...gax.CallOption) (*cxpb.TransitionRouteGroup, error) { return c.internalClient.UpdateTransitionRouteGroup(ctx, req, opts...) } // DeleteTransitionRouteGroup deletes the specified TransitionRouteGroup. +// +// Note: You should always train a flow prior to sending it queries. See the +// training +// documentation (at https://cloud.google.com/dialogflow/cx/docs/concept/training). func (c *TransitionRouteGroupsClient) DeleteTransitionRouteGroup(ctx context.Context, req *cxpb.DeleteTransitionRouteGroupRequest, opts ...gax.CallOption) error { return c.internalClient.DeleteTransitionRouteGroup(ctx, req, opts...) } diff --git a/dialogflow/cx/apiv3/versions_client.go b/dialogflow/cx/apiv3/versions_client.go index 11febef026e..0191353c143 100644 --- a/dialogflow/cx/apiv3/versions_client.go +++ b/dialogflow/cx/apiv3/versions_client.go @@ -25,7 +25,6 @@ import ( "cloud.google.com/go/longrunning" lroauto "cloud.google.com/go/longrunning/autogen" - "github.com/golang/protobuf/proto" structpb "github.com/golang/protobuf/ptypes/struct" gax "github.com/googleapis/gax-go/v2" "google.golang.org/api/iterator" @@ -37,6 +36,7 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/proto" ) var newVersionsClientHook clientHook diff --git a/dialogflow/cx/apiv3/webhooks_client.go b/dialogflow/cx/apiv3/webhooks_client.go index b097a71bcc0..a159f717d74 100644 --- a/dialogflow/cx/apiv3/webhooks_client.go +++ b/dialogflow/cx/apiv3/webhooks_client.go @@ -23,7 +23,6 @@ import ( "net/url" "time" - "github.com/golang/protobuf/proto" gax "github.com/googleapis/gax-go/v2" "google.golang.org/api/iterator" "google.golang.org/api/option" @@ -33,6 +32,7 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/proto" ) var newWebhooksClientHook clientHook diff --git a/dialogflow/cx/apiv3beta1/agents_client.go b/dialogflow/cx/apiv3beta1/agents_client.go index 131c311e2fd..3522935de1e 100644 --- a/dialogflow/cx/apiv3beta1/agents_client.go +++ b/dialogflow/cx/apiv3beta1/agents_client.go @@ -25,7 +25,6 @@ import ( "cloud.google.com/go/longrunning" lroauto "cloud.google.com/go/longrunning/autogen" - "github.com/golang/protobuf/proto" structpb "github.com/golang/protobuf/ptypes/struct" gax "github.com/googleapis/gax-go/v2" "google.golang.org/api/iterator" @@ -37,6 +36,7 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/proto" ) var newAgentsClientHook clientHook @@ -238,11 +238,19 @@ func (c *AgentsClient) GetAgent(ctx context.Context, req *cxpb.GetAgentRequest, } // CreateAgent creates an agent in the specified location. +// +// Note: You should always train a flow prior to sending it queries. See the +// training +// documentation (at https://cloud.google.com/dialogflow/cx/docs/concept/training). func (c *AgentsClient) CreateAgent(ctx context.Context, req *cxpb.CreateAgentRequest, opts ...gax.CallOption) (*cxpb.Agent, error) { return c.internalClient.CreateAgent(ctx, req, opts...) } // UpdateAgent updates the specified agent. +// +// Note: You should always train a flow prior to sending it queries. See the +// training +// documentation (at https://cloud.google.com/dialogflow/cx/docs/concept/training). func (c *AgentsClient) UpdateAgent(ctx context.Context, req *cxpb.UpdateAgentRequest, opts ...gax.CallOption) (*cxpb.Agent, error) { return c.internalClient.UpdateAgent(ctx, req, opts...) } @@ -267,6 +275,10 @@ func (c *AgentsClient) ExportAgentOperation(name string) *ExportAgentOperation { // // Replaces the current agent with a new one. Note that all existing resources // in agent (e.g. intents, entity types, flows) will be removed. +// +// Note: You should always train a flow prior to sending it queries. See the +// training +// documentation (at https://cloud.google.com/dialogflow/cx/docs/concept/training). func (c *AgentsClient) RestoreAgent(ctx context.Context, req *cxpb.RestoreAgentRequest, opts ...gax.CallOption) (*RestoreAgentOperation, error) { return c.internalClient.RestoreAgent(ctx, req, opts...) } diff --git a/dialogflow/cx/apiv3beta1/doc.go b/dialogflow/cx/apiv3beta1/doc.go index 012b6036163..bf72fa8fde0 100644 --- a/dialogflow/cx/apiv3beta1/doc.go +++ b/dialogflow/cx/apiv3beta1/doc.go @@ -51,7 +51,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210612" +const versionClient = "20210624" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/dialogflow/cx/apiv3beta1/entity_types_client.go b/dialogflow/cx/apiv3beta1/entity_types_client.go index 5190cd5fc42..532e475b2a5 100644 --- a/dialogflow/cx/apiv3beta1/entity_types_client.go +++ b/dialogflow/cx/apiv3beta1/entity_types_client.go @@ -23,7 +23,6 @@ import ( "net/url" "time" - "github.com/golang/protobuf/proto" gax "github.com/googleapis/gax-go/v2" "google.golang.org/api/iterator" "google.golang.org/api/option" @@ -33,6 +32,7 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/proto" ) var newEntityTypesClientHook clientHook @@ -180,11 +180,19 @@ func (c *EntityTypesClient) CreateEntityType(ctx context.Context, req *cxpb.Crea } // UpdateEntityType updates the specified entity type. +// +// Note: You should always train a flow prior to sending it queries. See the +// training +// documentation (at https://cloud.google.com/dialogflow/cx/docs/concept/training). func (c *EntityTypesClient) UpdateEntityType(ctx context.Context, req *cxpb.UpdateEntityTypeRequest, opts ...gax.CallOption) (*cxpb.EntityType, error) { return c.internalClient.UpdateEntityType(ctx, req, opts...) } // DeleteEntityType deletes the specified entity type. +// +// Note: You should always train a flow prior to sending it queries. See the +// training +// documentation (at https://cloud.google.com/dialogflow/cx/docs/concept/training). func (c *EntityTypesClient) DeleteEntityType(ctx context.Context, req *cxpb.DeleteEntityTypeRequest, opts ...gax.CallOption) error { return c.internalClient.DeleteEntityType(ctx, req, opts...) } diff --git a/dialogflow/cx/apiv3beta1/environments_client.go b/dialogflow/cx/apiv3beta1/environments_client.go index 1a8e55670bb..b15e83faa7c 100644 --- a/dialogflow/cx/apiv3beta1/environments_client.go +++ b/dialogflow/cx/apiv3beta1/environments_client.go @@ -25,7 +25,6 @@ import ( "cloud.google.com/go/longrunning" lroauto "cloud.google.com/go/longrunning/autogen" - "github.com/golang/protobuf/proto" structpb "github.com/golang/protobuf/ptypes/struct" gax "github.com/googleapis/gax-go/v2" "google.golang.org/api/iterator" @@ -37,6 +36,7 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/proto" ) var newEnvironmentsClientHook clientHook diff --git a/dialogflow/cx/apiv3beta1/experiments_client.go b/dialogflow/cx/apiv3beta1/experiments_client.go index e39247aa6af..e19e4a96c5c 100644 --- a/dialogflow/cx/apiv3beta1/experiments_client.go +++ b/dialogflow/cx/apiv3beta1/experiments_client.go @@ -23,7 +23,6 @@ import ( "net/url" "time" - "github.com/golang/protobuf/proto" gax "github.com/googleapis/gax-go/v2" "google.golang.org/api/iterator" "google.golang.org/api/option" @@ -33,6 +32,7 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/proto" ) var newExperimentsClientHook clientHook diff --git a/dialogflow/cx/apiv3beta1/flows_client.go b/dialogflow/cx/apiv3beta1/flows_client.go index 606175729ea..b83da23f24d 100644 --- a/dialogflow/cx/apiv3beta1/flows_client.go +++ b/dialogflow/cx/apiv3beta1/flows_client.go @@ -25,7 +25,6 @@ import ( "cloud.google.com/go/longrunning" lroauto "cloud.google.com/go/longrunning/autogen" - "github.com/golang/protobuf/proto" structpb "github.com/golang/protobuf/ptypes/struct" gax "github.com/googleapis/gax-go/v2" "google.golang.org/api/iterator" @@ -37,6 +36,7 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/proto" ) var newFlowsClientHook clientHook @@ -242,6 +242,10 @@ func (c *FlowsClient) Connection() *grpc.ClientConn { } // CreateFlow creates a flow in the specified agent. +// +// Note: You should always train a flow prior to sending it queries. See the +// training +// documentation (at https://cloud.google.com/dialogflow/cx/docs/concept/training). func (c *FlowsClient) CreateFlow(ctx context.Context, req *cxpb.CreateFlowRequest, opts ...gax.CallOption) (*cxpb.Flow, error) { return c.internalClient.CreateFlow(ctx, req, opts...) } @@ -262,12 +266,20 @@ func (c *FlowsClient) GetFlow(ctx context.Context, req *cxpb.GetFlowRequest, opt } // UpdateFlow updates the specified flow. +// +// Note: You should always train a flow prior to sending it queries. See the +// training +// documentation (at https://cloud.google.com/dialogflow/cx/docs/concept/training). func (c *FlowsClient) UpdateFlow(ctx context.Context, req *cxpb.UpdateFlowRequest, opts ...gax.CallOption) (*cxpb.Flow, error) { return c.internalClient.UpdateFlow(ctx, req, opts...) } // TrainFlow trains the specified flow. Note that only the flow in ‘draft’ environment // is trained. +// +// Note: You should always train a flow prior to sending it queries. See the +// training +// documentation (at https://cloud.google.com/dialogflow/cx/docs/concept/training). func (c *FlowsClient) TrainFlow(ctx context.Context, req *cxpb.TrainFlowRequest, opts ...gax.CallOption) (*TrainFlowOperation, error) { return c.internalClient.TrainFlow(ctx, req, opts...) } @@ -292,6 +304,10 @@ func (c *FlowsClient) GetFlowValidationResult(ctx context.Context, req *cxpb.Get } // ImportFlow imports the specified flow to the specified agent from a binary file. +// +// Note: You should always train a flow prior to sending it queries. See the +// training +// documentation (at https://cloud.google.com/dialogflow/cx/docs/concept/training). func (c *FlowsClient) ImportFlow(ctx context.Context, req *cxpb.ImportFlowRequest, opts ...gax.CallOption) (*ImportFlowOperation, error) { return c.internalClient.ImportFlow(ctx, req, opts...) } diff --git a/dialogflow/cx/apiv3beta1/gapic_metadata.json b/dialogflow/cx/apiv3beta1/gapic_metadata.json index 3f3dd0e6516..bf463ce0246 100644 --- a/dialogflow/cx/apiv3beta1/gapic_metadata.json +++ b/dialogflow/cx/apiv3beta1/gapic_metadata.json @@ -1,57 +1,57 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.dialogflow.cx.v3beta1", - "libraryPackage": "cloud.google.com/go/dialogflow/cx/apiv3beta1", - "services": { - "Agents": { - "clients": { - "grpc": { - "libraryClient": "AgentsClient", - "rpcs": { - "CreateAgent": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.dialogflow.cx.v3beta1", + "libraryPackage": "cloud.google.com/go/dialogflow/cx/apiv3beta1", + "services": { + "Agents": { + "clients": { + "grpc": { + "libraryClient": "AgentsClient", + "rpcs": { + "CreateAgent": { + "methods": [ "CreateAgent" ] }, - "DeleteAgent": { - "methods": [ + "DeleteAgent": { + "methods": [ "DeleteAgent" ] }, - "ExportAgent": { - "methods": [ + "ExportAgent": { + "methods": [ "ExportAgent" ] }, - "GetAgent": { - "methods": [ + "GetAgent": { + "methods": [ "GetAgent" ] }, - "GetAgentValidationResult": { - "methods": [ + "GetAgentValidationResult": { + "methods": [ "GetAgentValidationResult" ] }, - "ListAgents": { - "methods": [ + "ListAgents": { + "methods": [ "ListAgents" ] }, - "RestoreAgent": { - "methods": [ + "RestoreAgent": { + "methods": [ "RestoreAgent" ] }, - "UpdateAgent": { - "methods": [ + "UpdateAgent": { + "methods": [ "UpdateAgent" ] }, - "ValidateAgent": { - "methods": [ + "ValidateAgent": { + "methods": [ "ValidateAgent" ] } @@ -59,33 +59,33 @@ } } }, - "EntityTypes": { - "clients": { - "grpc": { - "libraryClient": "EntityTypesClient", - "rpcs": { - "CreateEntityType": { - "methods": [ + "EntityTypes": { + "clients": { + "grpc": { + "libraryClient": "EntityTypesClient", + "rpcs": { + "CreateEntityType": { + "methods": [ "CreateEntityType" ] }, - "DeleteEntityType": { - "methods": [ + "DeleteEntityType": { + "methods": [ "DeleteEntityType" ] }, - "GetEntityType": { - "methods": [ + "GetEntityType": { + "methods": [ "GetEntityType" ] }, - "ListEntityTypes": { - "methods": [ + "ListEntityTypes": { + "methods": [ "ListEntityTypes" ] }, - "UpdateEntityType": { - "methods": [ + "UpdateEntityType": { + "methods": [ "UpdateEntityType" ] } @@ -93,48 +93,48 @@ } } }, - "Environments": { - "clients": { - "grpc": { - "libraryClient": "EnvironmentsClient", - "rpcs": { - "CreateEnvironment": { - "methods": [ + "Environments": { + "clients": { + "grpc": { + "libraryClient": "EnvironmentsClient", + "rpcs": { + "CreateEnvironment": { + "methods": [ "CreateEnvironment" ] }, - "DeleteEnvironment": { - "methods": [ + "DeleteEnvironment": { + "methods": [ "DeleteEnvironment" ] }, - "GetEnvironment": { - "methods": [ + "GetEnvironment": { + "methods": [ "GetEnvironment" ] }, - "ListContinuousTestResults": { - "methods": [ + "ListContinuousTestResults": { + "methods": [ "ListContinuousTestResults" ] }, - "ListEnvironments": { - "methods": [ + "ListEnvironments": { + "methods": [ "ListEnvironments" ] }, - "LookupEnvironmentHistory": { - "methods": [ + "LookupEnvironmentHistory": { + "methods": [ "LookupEnvironmentHistory" ] }, - "RunContinuousTest": { - "methods": [ + "RunContinuousTest": { + "methods": [ "RunContinuousTest" ] }, - "UpdateEnvironment": { - "methods": [ + "UpdateEnvironment": { + "methods": [ "UpdateEnvironment" ] } @@ -142,43 +142,43 @@ } } }, - "Experiments": { - "clients": { - "grpc": { - "libraryClient": "ExperimentsClient", - "rpcs": { - "CreateExperiment": { - "methods": [ + "Experiments": { + "clients": { + "grpc": { + "libraryClient": "ExperimentsClient", + "rpcs": { + "CreateExperiment": { + "methods": [ "CreateExperiment" ] }, - "DeleteExperiment": { - "methods": [ + "DeleteExperiment": { + "methods": [ "DeleteExperiment" ] }, - "GetExperiment": { - "methods": [ + "GetExperiment": { + "methods": [ "GetExperiment" ] }, - "ListExperiments": { - "methods": [ + "ListExperiments": { + "methods": [ "ListExperiments" ] }, - "StartExperiment": { - "methods": [ + "StartExperiment": { + "methods": [ "StartExperiment" ] }, - "StopExperiment": { - "methods": [ + "StopExperiment": { + "methods": [ "StopExperiment" ] }, - "UpdateExperiment": { - "methods": [ + "UpdateExperiment": { + "methods": [ "UpdateExperiment" ] } @@ -186,58 +186,58 @@ } } }, - "Flows": { - "clients": { - "grpc": { - "libraryClient": "FlowsClient", - "rpcs": { - "CreateFlow": { - "methods": [ + "Flows": { + "clients": { + "grpc": { + "libraryClient": "FlowsClient", + "rpcs": { + "CreateFlow": { + "methods": [ "CreateFlow" ] }, - "DeleteFlow": { - "methods": [ + "DeleteFlow": { + "methods": [ "DeleteFlow" ] }, - "ExportFlow": { - "methods": [ + "ExportFlow": { + "methods": [ "ExportFlow" ] }, - "GetFlow": { - "methods": [ + "GetFlow": { + "methods": [ "GetFlow" ] }, - "GetFlowValidationResult": { - "methods": [ + "GetFlowValidationResult": { + "methods": [ "GetFlowValidationResult" ] }, - "ImportFlow": { - "methods": [ + "ImportFlow": { + "methods": [ "ImportFlow" ] }, - "ListFlows": { - "methods": [ + "ListFlows": { + "methods": [ "ListFlows" ] }, - "TrainFlow": { - "methods": [ + "TrainFlow": { + "methods": [ "TrainFlow" ] }, - "UpdateFlow": { - "methods": [ + "UpdateFlow": { + "methods": [ "UpdateFlow" ] }, - "ValidateFlow": { - "methods": [ + "ValidateFlow": { + "methods": [ "ValidateFlow" ] } @@ -245,33 +245,33 @@ } } }, - "Intents": { - "clients": { - "grpc": { - "libraryClient": "IntentsClient", - "rpcs": { - "CreateIntent": { - "methods": [ + "Intents": { + "clients": { + "grpc": { + "libraryClient": "IntentsClient", + "rpcs": { + "CreateIntent": { + "methods": [ "CreateIntent" ] }, - "DeleteIntent": { - "methods": [ + "DeleteIntent": { + "methods": [ "DeleteIntent" ] }, - "GetIntent": { - "methods": [ + "GetIntent": { + "methods": [ "GetIntent" ] }, - "ListIntents": { - "methods": [ + "ListIntents": { + "methods": [ "ListIntents" ] }, - "UpdateIntent": { - "methods": [ + "UpdateIntent": { + "methods": [ "UpdateIntent" ] } @@ -279,33 +279,33 @@ } } }, - "Pages": { - "clients": { - "grpc": { - "libraryClient": "PagesClient", - "rpcs": { - "CreatePage": { - "methods": [ + "Pages": { + "clients": { + "grpc": { + "libraryClient": "PagesClient", + "rpcs": { + "CreatePage": { + "methods": [ "CreatePage" ] }, - "DeletePage": { - "methods": [ + "DeletePage": { + "methods": [ "DeletePage" ] }, - "GetPage": { - "methods": [ + "GetPage": { + "methods": [ "GetPage" ] }, - "ListPages": { - "methods": [ + "ListPages": { + "methods": [ "ListPages" ] }, - "UpdatePage": { - "methods": [ + "UpdatePage": { + "methods": [ "UpdatePage" ] } @@ -313,33 +313,33 @@ } } }, - "SecuritySettingsService": { - "clients": { - "grpc": { - "libraryClient": "SecuritySettingsClient", - "rpcs": { - "CreateSecuritySettings": { - "methods": [ + "SecuritySettingsService": { + "clients": { + "grpc": { + "libraryClient": "SecuritySettingsClient", + "rpcs": { + "CreateSecuritySettings": { + "methods": [ "CreateSecuritySettings" ] }, - "DeleteSecuritySettings": { - "methods": [ + "DeleteSecuritySettings": { + "methods": [ "DeleteSecuritySettings" ] }, - "GetSecuritySettings": { - "methods": [ + "GetSecuritySettings": { + "methods": [ "GetSecuritySettings" ] }, - "ListSecuritySettings": { - "methods": [ + "ListSecuritySettings": { + "methods": [ "ListSecuritySettings" ] }, - "UpdateSecuritySettings": { - "methods": [ + "UpdateSecuritySettings": { + "methods": [ "UpdateSecuritySettings" ] } @@ -347,33 +347,33 @@ } } }, - "SessionEntityTypes": { - "clients": { - "grpc": { - "libraryClient": "SessionEntityTypesClient", - "rpcs": { - "CreateSessionEntityType": { - "methods": [ + "SessionEntityTypes": { + "clients": { + "grpc": { + "libraryClient": "SessionEntityTypesClient", + "rpcs": { + "CreateSessionEntityType": { + "methods": [ "CreateSessionEntityType" ] }, - "DeleteSessionEntityType": { - "methods": [ + "DeleteSessionEntityType": { + "methods": [ "DeleteSessionEntityType" ] }, - "GetSessionEntityType": { - "methods": [ + "GetSessionEntityType": { + "methods": [ "GetSessionEntityType" ] }, - "ListSessionEntityTypes": { - "methods": [ + "ListSessionEntityTypes": { + "methods": [ "ListSessionEntityTypes" ] }, - "UpdateSessionEntityType": { - "methods": [ + "UpdateSessionEntityType": { + "methods": [ "UpdateSessionEntityType" ] } @@ -381,28 +381,28 @@ } } }, - "Sessions": { - "clients": { - "grpc": { - "libraryClient": "SessionsClient", - "rpcs": { - "DetectIntent": { - "methods": [ + "Sessions": { + "clients": { + "grpc": { + "libraryClient": "SessionsClient", + "rpcs": { + "DetectIntent": { + "methods": [ "DetectIntent" ] }, - "FulfillIntent": { - "methods": [ + "FulfillIntent": { + "methods": [ "FulfillIntent" ] }, - "MatchIntent": { - "methods": [ + "MatchIntent": { + "methods": [ "MatchIntent" ] }, - "StreamingDetectIntent": { - "methods": [ + "StreamingDetectIntent": { + "methods": [ "StreamingDetectIntent" ] } @@ -410,68 +410,68 @@ } } }, - "TestCases": { - "clients": { - "grpc": { - "libraryClient": "TestCasesClient", - "rpcs": { - "BatchDeleteTestCases": { - "methods": [ + "TestCases": { + "clients": { + "grpc": { + "libraryClient": "TestCasesClient", + "rpcs": { + "BatchDeleteTestCases": { + "methods": [ "BatchDeleteTestCases" ] }, - "BatchRunTestCases": { - "methods": [ + "BatchRunTestCases": { + "methods": [ "BatchRunTestCases" ] }, - "CalculateCoverage": { - "methods": [ + "CalculateCoverage": { + "methods": [ "CalculateCoverage" ] }, - "CreateTestCase": { - "methods": [ + "CreateTestCase": { + "methods": [ "CreateTestCase" ] }, - "ExportTestCases": { - "methods": [ + "ExportTestCases": { + "methods": [ "ExportTestCases" ] }, - "GetTestCase": { - "methods": [ + "GetTestCase": { + "methods": [ "GetTestCase" ] }, - "GetTestCaseResult": { - "methods": [ + "GetTestCaseResult": { + "methods": [ "GetTestCaseResult" ] }, - "ImportTestCases": { - "methods": [ + "ImportTestCases": { + "methods": [ "ImportTestCases" ] }, - "ListTestCaseResults": { - "methods": [ + "ListTestCaseResults": { + "methods": [ "ListTestCaseResults" ] }, - "ListTestCases": { - "methods": [ + "ListTestCases": { + "methods": [ "ListTestCases" ] }, - "RunTestCase": { - "methods": [ + "RunTestCase": { + "methods": [ "RunTestCase" ] }, - "UpdateTestCase": { - "methods": [ + "UpdateTestCase": { + "methods": [ "UpdateTestCase" ] } @@ -479,33 +479,33 @@ } } }, - "TransitionRouteGroups": { - "clients": { - "grpc": { - "libraryClient": "TransitionRouteGroupsClient", - "rpcs": { - "CreateTransitionRouteGroup": { - "methods": [ + "TransitionRouteGroups": { + "clients": { + "grpc": { + "libraryClient": "TransitionRouteGroupsClient", + "rpcs": { + "CreateTransitionRouteGroup": { + "methods": [ "CreateTransitionRouteGroup" ] }, - "DeleteTransitionRouteGroup": { - "methods": [ + "DeleteTransitionRouteGroup": { + "methods": [ "DeleteTransitionRouteGroup" ] }, - "GetTransitionRouteGroup": { - "methods": [ + "GetTransitionRouteGroup": { + "methods": [ "GetTransitionRouteGroup" ] }, - "ListTransitionRouteGroups": { - "methods": [ + "ListTransitionRouteGroups": { + "methods": [ "ListTransitionRouteGroups" ] }, - "UpdateTransitionRouteGroup": { - "methods": [ + "UpdateTransitionRouteGroup": { + "methods": [ "UpdateTransitionRouteGroup" ] } @@ -513,38 +513,38 @@ } } }, - "Versions": { - "clients": { - "grpc": { - "libraryClient": "VersionsClient", - "rpcs": { - "CreateVersion": { - "methods": [ + "Versions": { + "clients": { + "grpc": { + "libraryClient": "VersionsClient", + "rpcs": { + "CreateVersion": { + "methods": [ "CreateVersion" ] }, - "DeleteVersion": { - "methods": [ + "DeleteVersion": { + "methods": [ "DeleteVersion" ] }, - "GetVersion": { - "methods": [ + "GetVersion": { + "methods": [ "GetVersion" ] }, - "ListVersions": { - "methods": [ + "ListVersions": { + "methods": [ "ListVersions" ] }, - "LoadVersion": { - "methods": [ + "LoadVersion": { + "methods": [ "LoadVersion" ] }, - "UpdateVersion": { - "methods": [ + "UpdateVersion": { + "methods": [ "UpdateVersion" ] } @@ -552,33 +552,33 @@ } } }, - "Webhooks": { - "clients": { - "grpc": { - "libraryClient": "WebhooksClient", - "rpcs": { - "CreateWebhook": { - "methods": [ + "Webhooks": { + "clients": { + "grpc": { + "libraryClient": "WebhooksClient", + "rpcs": { + "CreateWebhook": { + "methods": [ "CreateWebhook" ] }, - "DeleteWebhook": { - "methods": [ + "DeleteWebhook": { + "methods": [ "DeleteWebhook" ] }, - "GetWebhook": { - "methods": [ + "GetWebhook": { + "methods": [ "GetWebhook" ] }, - "ListWebhooks": { - "methods": [ + "ListWebhooks": { + "methods": [ "ListWebhooks" ] }, - "UpdateWebhook": { - "methods": [ + "UpdateWebhook": { + "methods": [ "UpdateWebhook" ] } diff --git a/dialogflow/cx/apiv3beta1/intents_client.go b/dialogflow/cx/apiv3beta1/intents_client.go index ebb8125f371..baac27b6c38 100644 --- a/dialogflow/cx/apiv3beta1/intents_client.go +++ b/dialogflow/cx/apiv3beta1/intents_client.go @@ -23,7 +23,6 @@ import ( "net/url" "time" - "github.com/golang/protobuf/proto" gax "github.com/googleapis/gax-go/v2" "google.golang.org/api/iterator" "google.golang.org/api/option" @@ -33,6 +32,7 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/proto" ) var newIntentsClientHook clientHook @@ -175,16 +175,28 @@ func (c *IntentsClient) GetIntent(ctx context.Context, req *cxpb.GetIntentReques } // CreateIntent creates an intent in the specified agent. +// +// Note: You should always train a flow prior to sending it queries. See the +// training +// documentation (at https://cloud.google.com/dialogflow/cx/docs/concept/training). func (c *IntentsClient) CreateIntent(ctx context.Context, req *cxpb.CreateIntentRequest, opts ...gax.CallOption) (*cxpb.Intent, error) { return c.internalClient.CreateIntent(ctx, req, opts...) } // UpdateIntent updates the specified intent. +// +// Note: You should always train a flow prior to sending it queries. See the +// training +// documentation (at https://cloud.google.com/dialogflow/cx/docs/concept/training). func (c *IntentsClient) UpdateIntent(ctx context.Context, req *cxpb.UpdateIntentRequest, opts ...gax.CallOption) (*cxpb.Intent, error) { return c.internalClient.UpdateIntent(ctx, req, opts...) } // DeleteIntent deletes the specified intent. +// +// Note: You should always train a flow prior to sending it queries. See the +// training +// documentation (at https://cloud.google.com/dialogflow/cx/docs/concept/training). func (c *IntentsClient) DeleteIntent(ctx context.Context, req *cxpb.DeleteIntentRequest, opts ...gax.CallOption) error { return c.internalClient.DeleteIntent(ctx, req, opts...) } diff --git a/dialogflow/cx/apiv3beta1/pages_client.go b/dialogflow/cx/apiv3beta1/pages_client.go index 82ef5a19765..7f1ea6f0112 100644 --- a/dialogflow/cx/apiv3beta1/pages_client.go +++ b/dialogflow/cx/apiv3beta1/pages_client.go @@ -23,7 +23,6 @@ import ( "net/url" "time" - "github.com/golang/protobuf/proto" gax "github.com/googleapis/gax-go/v2" "google.golang.org/api/iterator" "google.golang.org/api/option" @@ -33,6 +32,7 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/proto" ) var newPagesClientHook clientHook diff --git a/dialogflow/cx/apiv3beta1/security_settings_client.go b/dialogflow/cx/apiv3beta1/security_settings_client.go index 53dd1439a45..e9ea29c26f1 100644 --- a/dialogflow/cx/apiv3beta1/security_settings_client.go +++ b/dialogflow/cx/apiv3beta1/security_settings_client.go @@ -23,7 +23,6 @@ import ( "net/url" "time" - "github.com/golang/protobuf/proto" gax "github.com/googleapis/gax-go/v2" "google.golang.org/api/iterator" "google.golang.org/api/option" @@ -33,6 +32,7 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/proto" ) var newSecuritySettingsClientHook clientHook diff --git a/dialogflow/cx/apiv3beta1/session_entity_types_client.go b/dialogflow/cx/apiv3beta1/session_entity_types_client.go index 35dff68574f..c00d1bec4b6 100644 --- a/dialogflow/cx/apiv3beta1/session_entity_types_client.go +++ b/dialogflow/cx/apiv3beta1/session_entity_types_client.go @@ -23,7 +23,6 @@ import ( "net/url" "time" - "github.com/golang/protobuf/proto" gax "github.com/googleapis/gax-go/v2" "google.golang.org/api/iterator" "google.golang.org/api/option" @@ -33,6 +32,7 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/proto" ) var newSessionEntityTypesClientHook clientHook diff --git a/dialogflow/cx/apiv3beta1/test_cases_client.go b/dialogflow/cx/apiv3beta1/test_cases_client.go index 401ee2e80a3..9b35caef34a 100644 --- a/dialogflow/cx/apiv3beta1/test_cases_client.go +++ b/dialogflow/cx/apiv3beta1/test_cases_client.go @@ -25,7 +25,6 @@ import ( "cloud.google.com/go/longrunning" lroauto "cloud.google.com/go/longrunning/autogen" - "github.com/golang/protobuf/proto" gax "github.com/googleapis/gax-go/v2" "google.golang.org/api/iterator" "google.golang.org/api/option" @@ -36,6 +35,7 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/proto" ) var newTestCasesClientHook clientHook diff --git a/dialogflow/cx/apiv3beta1/transition_route_groups_client.go b/dialogflow/cx/apiv3beta1/transition_route_groups_client.go index ceaad6f3d00..159d3ab7813 100644 --- a/dialogflow/cx/apiv3beta1/transition_route_groups_client.go +++ b/dialogflow/cx/apiv3beta1/transition_route_groups_client.go @@ -23,7 +23,6 @@ import ( "net/url" "time" - "github.com/golang/protobuf/proto" gax "github.com/googleapis/gax-go/v2" "google.golang.org/api/iterator" "google.golang.org/api/option" @@ -33,6 +32,7 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/proto" ) var newTransitionRouteGroupsClientHook clientHook @@ -175,16 +175,28 @@ func (c *TransitionRouteGroupsClient) GetTransitionRouteGroup(ctx context.Contex } // CreateTransitionRouteGroup creates an TransitionRouteGroup in the specified flow. +// +// Note: You should always train a flow prior to sending it queries. See the +// training +// documentation (at https://cloud.google.com/dialogflow/cx/docs/concept/training). func (c *TransitionRouteGroupsClient) CreateTransitionRouteGroup(ctx context.Context, req *cxpb.CreateTransitionRouteGroupRequest, opts ...gax.CallOption) (*cxpb.TransitionRouteGroup, error) { return c.internalClient.CreateTransitionRouteGroup(ctx, req, opts...) } // UpdateTransitionRouteGroup updates the specified TransitionRouteGroup. +// +// Note: You should always train a flow prior to sending it queries. See the +// training +// documentation (at https://cloud.google.com/dialogflow/cx/docs/concept/training). func (c *TransitionRouteGroupsClient) UpdateTransitionRouteGroup(ctx context.Context, req *cxpb.UpdateTransitionRouteGroupRequest, opts ...gax.CallOption) (*cxpb.TransitionRouteGroup, error) { return c.internalClient.UpdateTransitionRouteGroup(ctx, req, opts...) } // DeleteTransitionRouteGroup deletes the specified TransitionRouteGroup. +// +// Note: You should always train a flow prior to sending it queries. See the +// training +// documentation (at https://cloud.google.com/dialogflow/cx/docs/concept/training). func (c *TransitionRouteGroupsClient) DeleteTransitionRouteGroup(ctx context.Context, req *cxpb.DeleteTransitionRouteGroupRequest, opts ...gax.CallOption) error { return c.internalClient.DeleteTransitionRouteGroup(ctx, req, opts...) } diff --git a/dialogflow/cx/apiv3beta1/versions_client.go b/dialogflow/cx/apiv3beta1/versions_client.go index a08e8faeada..7d68c971a59 100644 --- a/dialogflow/cx/apiv3beta1/versions_client.go +++ b/dialogflow/cx/apiv3beta1/versions_client.go @@ -25,7 +25,6 @@ import ( "cloud.google.com/go/longrunning" lroauto "cloud.google.com/go/longrunning/autogen" - "github.com/golang/protobuf/proto" structpb "github.com/golang/protobuf/ptypes/struct" gax "github.com/googleapis/gax-go/v2" "google.golang.org/api/iterator" @@ -37,6 +36,7 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/proto" ) var newVersionsClientHook clientHook diff --git a/dialogflow/cx/apiv3beta1/webhooks_client.go b/dialogflow/cx/apiv3beta1/webhooks_client.go index c97635e74a5..f9dcf20328f 100644 --- a/dialogflow/cx/apiv3beta1/webhooks_client.go +++ b/dialogflow/cx/apiv3beta1/webhooks_client.go @@ -23,7 +23,6 @@ import ( "net/url" "time" - "github.com/golang/protobuf/proto" gax "github.com/googleapis/gax-go/v2" "google.golang.org/api/iterator" "google.golang.org/api/option" @@ -33,6 +32,7 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/proto" ) var newWebhooksClientHook clientHook diff --git a/dlp/apiv2/dlp_client.go b/dlp/apiv2/dlp_client.go index 99546de6fe6..9f058c73041 100644 --- a/dlp/apiv2/dlp_client.go +++ b/dlp/apiv2/dlp_client.go @@ -23,7 +23,6 @@ import ( "net/url" "time" - "github.com/golang/protobuf/proto" gax "github.com/googleapis/gax-go/v2" "google.golang.org/api/iterator" "google.golang.org/api/option" @@ -33,6 +32,7 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/proto" ) var newClientHook clientHook diff --git a/dlp/apiv2/doc.go b/dlp/apiv2/doc.go index d726b9713e8..75d8a69a7d1 100644 --- a/dlp/apiv2/doc.go +++ b/dlp/apiv2/doc.go @@ -50,7 +50,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210612" +const versionClient = "20210624" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/dlp/apiv2/gapic_metadata.json b/dlp/apiv2/gapic_metadata.json index fa53d4da4be..9fac0297b7d 100644 --- a/dlp/apiv2/gapic_metadata.json +++ b/dlp/apiv2/gapic_metadata.json @@ -1,182 +1,182 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.privacy.dlp.v2", - "libraryPackage": "cloud.google.com/go/dlp/apiv2", - "services": { - "DlpService": { - "clients": { - "grpc": { - "libraryClient": "Client", - "rpcs": { - "ActivateJobTrigger": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.privacy.dlp.v2", + "libraryPackage": "cloud.google.com/go/dlp/apiv2", + "services": { + "DlpService": { + "clients": { + "grpc": { + "libraryClient": "Client", + "rpcs": { + "ActivateJobTrigger": { + "methods": [ "ActivateJobTrigger" ] }, - "CancelDlpJob": { - "methods": [ + "CancelDlpJob": { + "methods": [ "CancelDlpJob" ] }, - "CreateDeidentifyTemplate": { - "methods": [ + "CreateDeidentifyTemplate": { + "methods": [ "CreateDeidentifyTemplate" ] }, - "CreateDlpJob": { - "methods": [ + "CreateDlpJob": { + "methods": [ "CreateDlpJob" ] }, - "CreateInspectTemplate": { - "methods": [ + "CreateInspectTemplate": { + "methods": [ "CreateInspectTemplate" ] }, - "CreateJobTrigger": { - "methods": [ + "CreateJobTrigger": { + "methods": [ "CreateJobTrigger" ] }, - "CreateStoredInfoType": { - "methods": [ + "CreateStoredInfoType": { + "methods": [ "CreateStoredInfoType" ] }, - "DeidentifyContent": { - "methods": [ + "DeidentifyContent": { + "methods": [ "DeidentifyContent" ] }, - "DeleteDeidentifyTemplate": { - "methods": [ + "DeleteDeidentifyTemplate": { + "methods": [ "DeleteDeidentifyTemplate" ] }, - "DeleteDlpJob": { - "methods": [ + "DeleteDlpJob": { + "methods": [ "DeleteDlpJob" ] }, - "DeleteInspectTemplate": { - "methods": [ + "DeleteInspectTemplate": { + "methods": [ "DeleteInspectTemplate" ] }, - "DeleteJobTrigger": { - "methods": [ + "DeleteJobTrigger": { + "methods": [ "DeleteJobTrigger" ] }, - "DeleteStoredInfoType": { - "methods": [ + "DeleteStoredInfoType": { + "methods": [ "DeleteStoredInfoType" ] }, - "FinishDlpJob": { - "methods": [ + "FinishDlpJob": { + "methods": [ "FinishDlpJob" ] }, - "GetDeidentifyTemplate": { - "methods": [ + "GetDeidentifyTemplate": { + "methods": [ "GetDeidentifyTemplate" ] }, - "GetDlpJob": { - "methods": [ + "GetDlpJob": { + "methods": [ "GetDlpJob" ] }, - "GetInspectTemplate": { - "methods": [ + "GetInspectTemplate": { + "methods": [ "GetInspectTemplate" ] }, - "GetJobTrigger": { - "methods": [ + "GetJobTrigger": { + "methods": [ "GetJobTrigger" ] }, - "GetStoredInfoType": { - "methods": [ + "GetStoredInfoType": { + "methods": [ "GetStoredInfoType" ] }, - "HybridInspectDlpJob": { - "methods": [ + "HybridInspectDlpJob": { + "methods": [ "HybridInspectDlpJob" ] }, - "HybridInspectJobTrigger": { - "methods": [ + "HybridInspectJobTrigger": { + "methods": [ "HybridInspectJobTrigger" ] }, - "InspectContent": { - "methods": [ + "InspectContent": { + "methods": [ "InspectContent" ] }, - "ListDeidentifyTemplates": { - "methods": [ + "ListDeidentifyTemplates": { + "methods": [ "ListDeidentifyTemplates" ] }, - "ListDlpJobs": { - "methods": [ + "ListDlpJobs": { + "methods": [ "ListDlpJobs" ] }, - "ListInfoTypes": { - "methods": [ + "ListInfoTypes": { + "methods": [ "ListInfoTypes" ] }, - "ListInspectTemplates": { - "methods": [ + "ListInspectTemplates": { + "methods": [ "ListInspectTemplates" ] }, - "ListJobTriggers": { - "methods": [ + "ListJobTriggers": { + "methods": [ "ListJobTriggers" ] }, - "ListStoredInfoTypes": { - "methods": [ + "ListStoredInfoTypes": { + "methods": [ "ListStoredInfoTypes" ] }, - "RedactImage": { - "methods": [ + "RedactImage": { + "methods": [ "RedactImage" ] }, - "ReidentifyContent": { - "methods": [ + "ReidentifyContent": { + "methods": [ "ReidentifyContent" ] }, - "UpdateDeidentifyTemplate": { - "methods": [ + "UpdateDeidentifyTemplate": { + "methods": [ "UpdateDeidentifyTemplate" ] }, - "UpdateInspectTemplate": { - "methods": [ + "UpdateInspectTemplate": { + "methods": [ "UpdateInspectTemplate" ] }, - "UpdateJobTrigger": { - "methods": [ + "UpdateJobTrigger": { + "methods": [ "UpdateJobTrigger" ] }, - "UpdateStoredInfoType": { - "methods": [ + "UpdateStoredInfoType": { + "methods": [ "UpdateStoredInfoType" ] } diff --git a/documentai/apiv1/doc.go b/documentai/apiv1/doc.go index 177d3ae80c4..013c010e2eb 100644 --- a/documentai/apiv1/doc.go +++ b/documentai/apiv1/doc.go @@ -52,7 +52,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210612" +const versionClient = "20210624" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/documentai/apiv1/gapic_metadata.json b/documentai/apiv1/gapic_metadata.json index 0e0f7bb5065..766c5629f92 100644 --- a/documentai/apiv1/gapic_metadata.json +++ b/documentai/apiv1/gapic_metadata.json @@ -1,27 +1,27 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.documentai.v1", - "libraryPackage": "cloud.google.com/go/documentai/apiv1", - "services": { - "DocumentProcessorService": { - "clients": { - "grpc": { - "libraryClient": "DocumentProcessorClient", - "rpcs": { - "BatchProcessDocuments": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.documentai.v1", + "libraryPackage": "cloud.google.com/go/documentai/apiv1", + "services": { + "DocumentProcessorService": { + "clients": { + "grpc": { + "libraryClient": "DocumentProcessorClient", + "rpcs": { + "BatchProcessDocuments": { + "methods": [ "BatchProcessDocuments" ] }, - "ProcessDocument": { - "methods": [ + "ProcessDocument": { + "methods": [ "ProcessDocument" ] }, - "ReviewDocument": { - "methods": [ + "ReviewDocument": { + "methods": [ "ReviewDocument" ] } diff --git a/documentai/apiv1beta3/doc.go b/documentai/apiv1beta3/doc.go index dbe6588c055..be6d9be4fa2 100644 --- a/documentai/apiv1beta3/doc.go +++ b/documentai/apiv1beta3/doc.go @@ -52,7 +52,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210617" +const versionClient = "20210624" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/documentai/apiv1beta3/document_processor_client.go b/documentai/apiv1beta3/document_processor_client.go index 7448033b082..10b4694eb14 100644 --- a/documentai/apiv1beta3/document_processor_client.go +++ b/documentai/apiv1beta3/document_processor_client.go @@ -25,7 +25,6 @@ import ( "cloud.google.com/go/longrunning" lroauto "cloud.google.com/go/longrunning/autogen" - "github.com/golang/protobuf/proto" gax "github.com/googleapis/gax-go/v2" "google.golang.org/api/iterator" "google.golang.org/api/option" @@ -36,6 +35,7 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/proto" ) var newDocumentProcessorClientHook clientHook diff --git a/documentai/apiv1beta3/gapic_metadata.json b/documentai/apiv1beta3/gapic_metadata.json index d63304cab99..9621d9c6b2d 100644 --- a/documentai/apiv1beta3/gapic_metadata.json +++ b/documentai/apiv1beta3/gapic_metadata.json @@ -1,57 +1,57 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.documentai.v1beta3", - "libraryPackage": "cloud.google.com/go/documentai/apiv1beta3", - "services": { - "DocumentProcessorService": { - "clients": { - "grpc": { - "libraryClient": "DocumentProcessorClient", - "rpcs": { - "BatchProcessDocuments": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.documentai.v1beta3", + "libraryPackage": "cloud.google.com/go/documentai/apiv1beta3", + "services": { + "DocumentProcessorService": { + "clients": { + "grpc": { + "libraryClient": "DocumentProcessorClient", + "rpcs": { + "BatchProcessDocuments": { + "methods": [ "BatchProcessDocuments" ] }, - "CreateProcessor": { - "methods": [ + "CreateProcessor": { + "methods": [ "CreateProcessor" ] }, - "DeleteProcessor": { - "methods": [ + "DeleteProcessor": { + "methods": [ "DeleteProcessor" ] }, - "DisableProcessor": { - "methods": [ + "DisableProcessor": { + "methods": [ "DisableProcessor" ] }, - "EnableProcessor": { - "methods": [ + "EnableProcessor": { + "methods": [ "EnableProcessor" ] }, - "FetchProcessorTypes": { - "methods": [ + "FetchProcessorTypes": { + "methods": [ "FetchProcessorTypes" ] }, - "ListProcessors": { - "methods": [ + "ListProcessors": { + "methods": [ "ListProcessors" ] }, - "ProcessDocument": { - "methods": [ + "ProcessDocument": { + "methods": [ "ProcessDocument" ] }, - "ReviewDocument": { - "methods": [ + "ReviewDocument": { + "methods": [ "ReviewDocument" ] } diff --git a/domains/apiv1beta1/doc.go b/domains/apiv1beta1/doc.go index f3bdc2a7d13..797b22f48dc 100644 --- a/domains/apiv1beta1/doc.go +++ b/domains/apiv1beta1/doc.go @@ -50,7 +50,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210612" +const versionClient = "20210624" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/domains/apiv1beta1/domains_client.go b/domains/apiv1beta1/domains_client.go index 2de29930c59..02bc17a425c 100644 --- a/domains/apiv1beta1/domains_client.go +++ b/domains/apiv1beta1/domains_client.go @@ -25,7 +25,6 @@ import ( "cloud.google.com/go/longrunning" lroauto "cloud.google.com/go/longrunning/autogen" - "github.com/golang/protobuf/proto" gax "github.com/googleapis/gax-go/v2" "google.golang.org/api/iterator" "google.golang.org/api/option" @@ -35,6 +34,7 @@ import ( longrunningpb "google.golang.org/genproto/googleapis/longrunning" "google.golang.org/grpc" "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/proto" ) var newClientHook clientHook diff --git a/domains/apiv1beta1/gapic_metadata.json b/domains/apiv1beta1/gapic_metadata.json index 3055d077988..4bb45dc1a51 100644 --- a/domains/apiv1beta1/gapic_metadata.json +++ b/domains/apiv1beta1/gapic_metadata.json @@ -1,77 +1,77 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.domains.v1beta1", - "libraryPackage": "cloud.google.com/go/domains/apiv1beta1", - "services": { - "Domains": { - "clients": { - "grpc": { - "libraryClient": "Client", - "rpcs": { - "ConfigureContactSettings": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.domains.v1beta1", + "libraryPackage": "cloud.google.com/go/domains/apiv1beta1", + "services": { + "Domains": { + "clients": { + "grpc": { + "libraryClient": "Client", + "rpcs": { + "ConfigureContactSettings": { + "methods": [ "ConfigureContactSettings" ] }, - "ConfigureDnsSettings": { - "methods": [ + "ConfigureDnsSettings": { + "methods": [ "ConfigureDnsSettings" ] }, - "ConfigureManagementSettings": { - "methods": [ + "ConfigureManagementSettings": { + "methods": [ "ConfigureManagementSettings" ] }, - "DeleteRegistration": { - "methods": [ + "DeleteRegistration": { + "methods": [ "DeleteRegistration" ] }, - "ExportRegistration": { - "methods": [ + "ExportRegistration": { + "methods": [ "ExportRegistration" ] }, - "GetRegistration": { - "methods": [ + "GetRegistration": { + "methods": [ "GetRegistration" ] }, - "ListRegistrations": { - "methods": [ + "ListRegistrations": { + "methods": [ "ListRegistrations" ] }, - "RegisterDomain": { - "methods": [ + "RegisterDomain": { + "methods": [ "RegisterDomain" ] }, - "ResetAuthorizationCode": { - "methods": [ + "ResetAuthorizationCode": { + "methods": [ "ResetAuthorizationCode" ] }, - "RetrieveAuthorizationCode": { - "methods": [ + "RetrieveAuthorizationCode": { + "methods": [ "RetrieveAuthorizationCode" ] }, - "RetrieveRegisterParameters": { - "methods": [ + "RetrieveRegisterParameters": { + "methods": [ "RetrieveRegisterParameters" ] }, - "SearchDomains": { - "methods": [ + "SearchDomains": { + "methods": [ "SearchDomains" ] }, - "UpdateRegistration": { - "methods": [ + "UpdateRegistration": { + "methods": [ "UpdateRegistration" ] } diff --git a/errorreporting/apiv1beta1/doc.go b/errorreporting/apiv1beta1/doc.go index aac2058ccaf..68ab7365317 100644 --- a/errorreporting/apiv1beta1/doc.go +++ b/errorreporting/apiv1beta1/doc.go @@ -52,7 +52,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210612" +const versionClient = "20210624" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/errorreporting/apiv1beta1/error_stats_client.go b/errorreporting/apiv1beta1/error_stats_client.go index 8e15939ceb9..5f1069f9ce2 100644 --- a/errorreporting/apiv1beta1/error_stats_client.go +++ b/errorreporting/apiv1beta1/error_stats_client.go @@ -23,7 +23,6 @@ import ( "net/url" "time" - "github.com/golang/protobuf/proto" gax "github.com/googleapis/gax-go/v2" "google.golang.org/api/iterator" "google.golang.org/api/option" @@ -33,6 +32,7 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/proto" ) var newErrorStatsClientHook clientHook diff --git a/errorreporting/apiv1beta1/gapic_metadata.json b/errorreporting/apiv1beta1/gapic_metadata.json index 8e6727a953a..2c82cbeb583 100644 --- a/errorreporting/apiv1beta1/gapic_metadata.json +++ b/errorreporting/apiv1beta1/gapic_metadata.json @@ -1,22 +1,22 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.devtools.clouderrorreporting.v1beta1", - "libraryPackage": "cloud.google.com/go/errorreporting/apiv1beta1", - "services": { - "ErrorGroupService": { - "clients": { - "grpc": { - "libraryClient": "ErrorGroupClient", - "rpcs": { - "GetGroup": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.devtools.clouderrorreporting.v1beta1", + "libraryPackage": "cloud.google.com/go/errorreporting/apiv1beta1", + "services": { + "ErrorGroupService": { + "clients": { + "grpc": { + "libraryClient": "ErrorGroupClient", + "rpcs": { + "GetGroup": { + "methods": [ "GetGroup" ] }, - "UpdateGroup": { - "methods": [ + "UpdateGroup": { + "methods": [ "UpdateGroup" ] } @@ -24,23 +24,23 @@ } } }, - "ErrorStatsService": { - "clients": { - "grpc": { - "libraryClient": "ErrorStatsClient", - "rpcs": { - "DeleteEvents": { - "methods": [ + "ErrorStatsService": { + "clients": { + "grpc": { + "libraryClient": "ErrorStatsClient", + "rpcs": { + "DeleteEvents": { + "methods": [ "DeleteEvents" ] }, - "ListEvents": { - "methods": [ + "ListEvents": { + "methods": [ "ListEvents" ] }, - "ListGroupStats": { - "methods": [ + "ListGroupStats": { + "methods": [ "ListGroupStats" ] } @@ -48,13 +48,13 @@ } } }, - "ReportErrorsService": { - "clients": { - "grpc": { - "libraryClient": "ReportErrorsClient", - "rpcs": { - "ReportErrorEvent": { - "methods": [ + "ReportErrorsService": { + "clients": { + "grpc": { + "libraryClient": "ReportErrorsClient", + "rpcs": { + "ReportErrorEvent": { + "methods": [ "ReportErrorEvent" ] } diff --git a/essentialcontacts/apiv1/doc.go b/essentialcontacts/apiv1/doc.go index 1bdb1641e65..6f479d2d71c 100644 --- a/essentialcontacts/apiv1/doc.go +++ b/essentialcontacts/apiv1/doc.go @@ -48,7 +48,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210612" +const versionClient = "20210624" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/essentialcontacts/apiv1/essential_contacts_client.go b/essentialcontacts/apiv1/essential_contacts_client.go index 892e1502341..f9feae3c37c 100644 --- a/essentialcontacts/apiv1/essential_contacts_client.go +++ b/essentialcontacts/apiv1/essential_contacts_client.go @@ -23,7 +23,6 @@ import ( "net/url" "time" - "github.com/golang/protobuf/proto" gax "github.com/googleapis/gax-go/v2" "google.golang.org/api/iterator" "google.golang.org/api/option" @@ -33,6 +32,7 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/proto" ) var newClientHook clientHook diff --git a/essentialcontacts/apiv1/gapic_metadata.json b/essentialcontacts/apiv1/gapic_metadata.json index cfebdf9707d..b4d22d04984 100644 --- a/essentialcontacts/apiv1/gapic_metadata.json +++ b/essentialcontacts/apiv1/gapic_metadata.json @@ -1,47 +1,47 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.essentialcontacts.v1", - "libraryPackage": "cloud.google.com/go/essentialcontacts/apiv1", - "services": { - "EssentialContactsService": { - "clients": { - "grpc": { - "libraryClient": "Client", - "rpcs": { - "ComputeContacts": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.essentialcontacts.v1", + "libraryPackage": "cloud.google.com/go/essentialcontacts/apiv1", + "services": { + "EssentialContactsService": { + "clients": { + "grpc": { + "libraryClient": "Client", + "rpcs": { + "ComputeContacts": { + "methods": [ "ComputeContacts" ] }, - "CreateContact": { - "methods": [ + "CreateContact": { + "methods": [ "CreateContact" ] }, - "DeleteContact": { - "methods": [ + "DeleteContact": { + "methods": [ "DeleteContact" ] }, - "GetContact": { - "methods": [ + "GetContact": { + "methods": [ "GetContact" ] }, - "ListContacts": { - "methods": [ + "ListContacts": { + "methods": [ "ListContacts" ] }, - "SendTestMessage": { - "methods": [ + "SendTestMessage": { + "methods": [ "SendTestMessage" ] }, - "UpdateContact": { - "methods": [ + "UpdateContact": { + "methods": [ "UpdateContact" ] } diff --git a/firestore/apiv1/admin/doc.go b/firestore/apiv1/admin/doc.go index 96ac39dce44..a883dcae01f 100644 --- a/firestore/apiv1/admin/doc.go +++ b/firestore/apiv1/admin/doc.go @@ -49,7 +49,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210612" +const versionClient = "20210624" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/firestore/apiv1/admin/firestore_admin_client.go b/firestore/apiv1/admin/firestore_admin_client.go index 2c561682d62..bb192c5c35f 100644 --- a/firestore/apiv1/admin/firestore_admin_client.go +++ b/firestore/apiv1/admin/firestore_admin_client.go @@ -25,7 +25,6 @@ import ( "cloud.google.com/go/longrunning" lroauto "cloud.google.com/go/longrunning/autogen" - "github.com/golang/protobuf/proto" gax "github.com/googleapis/gax-go/v2" "google.golang.org/api/iterator" "google.golang.org/api/option" @@ -36,6 +35,7 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/proto" ) var newFirestoreAdminClientHook clientHook diff --git a/firestore/apiv1/admin/gapic_metadata.json b/firestore/apiv1/admin/gapic_metadata.json index 9cb25c1be64..715aec1a348 100644 --- a/firestore/apiv1/admin/gapic_metadata.json +++ b/firestore/apiv1/admin/gapic_metadata.json @@ -1,57 +1,57 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.firestore.admin.v1", - "libraryPackage": "cloud.google.com/go/firestore/apiv1/admin", - "services": { - "FirestoreAdmin": { - "clients": { - "grpc": { - "libraryClient": "FirestoreAdminClient", - "rpcs": { - "CreateIndex": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.firestore.admin.v1", + "libraryPackage": "cloud.google.com/go/firestore/apiv1/admin", + "services": { + "FirestoreAdmin": { + "clients": { + "grpc": { + "libraryClient": "FirestoreAdminClient", + "rpcs": { + "CreateIndex": { + "methods": [ "CreateIndex" ] }, - "DeleteIndex": { - "methods": [ + "DeleteIndex": { + "methods": [ "DeleteIndex" ] }, - "ExportDocuments": { - "methods": [ + "ExportDocuments": { + "methods": [ "ExportDocuments" ] }, - "GetField": { - "methods": [ + "GetField": { + "methods": [ "GetField" ] }, - "GetIndex": { - "methods": [ + "GetIndex": { + "methods": [ "GetIndex" ] }, - "ImportDocuments": { - "methods": [ + "ImportDocuments": { + "methods": [ "ImportDocuments" ] }, - "ListFields": { - "methods": [ + "ListFields": { + "methods": [ "ListFields" ] }, - "ListIndexes": { - "methods": [ + "ListIndexes": { + "methods": [ "ListIndexes" ] }, - "UpdateField": { - "methods": [ + "UpdateField": { + "methods": [ "UpdateField" ] } diff --git a/firestore/apiv1/doc.go b/firestore/apiv1/doc.go index 347af8c6aac..32d81432614 100644 --- a/firestore/apiv1/doc.go +++ b/firestore/apiv1/doc.go @@ -49,7 +49,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210612" +const versionClient = "20210624" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/firestore/apiv1/firestore_client.go b/firestore/apiv1/firestore_client.go index 6d30017d08e..0459cf95be8 100644 --- a/firestore/apiv1/firestore_client.go +++ b/firestore/apiv1/firestore_client.go @@ -23,7 +23,6 @@ import ( "net/url" "time" - "github.com/golang/protobuf/proto" gax "github.com/googleapis/gax-go/v2" "google.golang.org/api/iterator" "google.golang.org/api/option" @@ -33,6 +32,7 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/proto" ) var newClientHook clientHook diff --git a/firestore/apiv1/gapic_metadata.json b/firestore/apiv1/gapic_metadata.json index f5503bc5d27..60baab5f463 100644 --- a/firestore/apiv1/gapic_metadata.json +++ b/firestore/apiv1/gapic_metadata.json @@ -1,87 +1,87 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.firestore.v1", - "libraryPackage": "cloud.google.com/go/firestore/apiv1", - "services": { - "Firestore": { - "clients": { - "grpc": { - "libraryClient": "Client", - "rpcs": { - "BatchGetDocuments": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.firestore.v1", + "libraryPackage": "cloud.google.com/go/firestore/apiv1", + "services": { + "Firestore": { + "clients": { + "grpc": { + "libraryClient": "Client", + "rpcs": { + "BatchGetDocuments": { + "methods": [ "BatchGetDocuments" ] }, - "BatchWrite": { - "methods": [ + "BatchWrite": { + "methods": [ "BatchWrite" ] }, - "BeginTransaction": { - "methods": [ + "BeginTransaction": { + "methods": [ "BeginTransaction" ] }, - "Commit": { - "methods": [ + "Commit": { + "methods": [ "Commit" ] }, - "CreateDocument": { - "methods": [ + "CreateDocument": { + "methods": [ "CreateDocument" ] }, - "DeleteDocument": { - "methods": [ + "DeleteDocument": { + "methods": [ "DeleteDocument" ] }, - "GetDocument": { - "methods": [ + "GetDocument": { + "methods": [ "GetDocument" ] }, - "ListCollectionIds": { - "methods": [ + "ListCollectionIds": { + "methods": [ "ListCollectionIds" ] }, - "ListDocuments": { - "methods": [ + "ListDocuments": { + "methods": [ "ListDocuments" ] }, - "Listen": { - "methods": [ + "Listen": { + "methods": [ "Listen" ] }, - "PartitionQuery": { - "methods": [ + "PartitionQuery": { + "methods": [ "PartitionQuery" ] }, - "Rollback": { - "methods": [ + "Rollback": { + "methods": [ "Rollback" ] }, - "RunQuery": { - "methods": [ + "RunQuery": { + "methods": [ "RunQuery" ] }, - "UpdateDocument": { - "methods": [ + "UpdateDocument": { + "methods": [ "UpdateDocument" ] }, - "Write": { - "methods": [ + "Write": { + "methods": [ "Write" ] } diff --git a/firestore/go.mod b/firestore/go.mod index 2d462040952..5768e102ccc 100644 --- a/firestore/go.mod +++ b/firestore/go.mod @@ -7,7 +7,8 @@ require ( github.com/golang/protobuf v1.5.2 github.com/google/go-cmp v0.5.6 github.com/googleapis/gax-go/v2 v2.0.5 - google.golang.org/api v0.48.0 - google.golang.org/genproto v0.0.0-20210614143202-012ab6975634 + google.golang.org/api v0.49.0 + google.golang.org/genproto v0.0.0-20210624174822-c5cf32407d0a google.golang.org/grpc v1.38.0 + google.golang.org/protobuf v1.26.0 ) diff --git a/firestore/go.sum b/firestore/go.sum index 51829ee2af9..edb7eff7904 100644 --- a/firestore/go.sum +++ b/firestore/go.sum @@ -248,8 +248,9 @@ golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5/go.mod h1:KelEdhl1UZF7XfJ golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210220000619-9bb904979d93/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210313182246-cd4f82c27b84/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c h1:pkQiBZBvdos9qq4wBAHqlzuZHEXo07pqV06ef90u1WI= golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210615190721-d04028783cf1 h1:x622Z2o4hgCr/4CiKWc51jHVKaWdtVpBNmEI8wI9Qns= +golang.org/x/oauth2 v0.0.0-20210615190721-d04028783cf1/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -300,8 +301,9 @@ golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210514084401-e8d321eab015/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210603125802-9665404d3644 h1:CA1DEQ4NdKphKeL70tvsWNdT5oFh1lOjihRcEDROi0I= golang.org/x/sys v0.0.0-20210603125802-9665404d3644/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210616094352-59db8d763f22 h1:RqytpXGR1iVNX7psjB3ff8y7sNFinVFvkx1c8SjBkio= +golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -392,8 +394,9 @@ google.golang.org/api v0.40.0/go.mod h1:fYKFpnQN0DsDSKRVRcQSDQNtqWPfM9i+zNPxepjR google.golang.org/api v0.41.0/go.mod h1:RkxM5lITDfTzmyKFPt+wGrCJbVfniCr2ool8kTBzRTU= google.golang.org/api v0.43.0/go.mod h1:nQsDGjRXMo4lvh5hP0TKqF244gqhGcr/YSIykhUk/94= google.golang.org/api v0.47.0/go.mod h1:Wbvgpq1HddcWVtzsVLyfLp8lDg6AA241LmgIL59tHXo= -google.golang.org/api v0.48.0 h1:RDAPWfNFY06dffEXfn7hZF5Fr1ZbnChzfQZAPyBd1+I= google.golang.org/api v0.48.0/go.mod h1:71Pr1vy+TAZRPkPs/xlCf5SsU8WjuAWv1Pfjbtukyy4= +google.golang.org/api v0.49.0 h1:gjIBDxlTG7vnzMmEnYwTnvLTF8Rjzo+ETCgEX1YZ/fY= +google.golang.org/api v0.49.0/go.mod h1:BECiH72wsfwUvOVn3+btPD5WHi0LzavZReBndi42L18= 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.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= @@ -445,8 +448,9 @@ google.golang.org/genproto v0.0.0-20210513213006-bf773b8c8384/go.mod h1:P3QM42oQ google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= google.golang.org/genproto v0.0.0-20210604141403-392c879c8b08/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= google.golang.org/genproto v0.0.0-20210608205507-b6d2f5bf0d7d/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= -google.golang.org/genproto v0.0.0-20210614143202-012ab6975634 h1:LnkHrvncK4mYysgs+R1wPeMAILrmunf0Tzl0Li71pxo= -google.golang.org/genproto v0.0.0-20210614143202-012ab6975634/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24= +google.golang.org/genproto v0.0.0-20210617175327-b9e0b3197ced/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24= +google.golang.org/genproto v0.0.0-20210624174822-c5cf32407d0a h1:b5Bhxmy6Tppar7Yl4J6c6xF33YSBhkm2FtV9/ZQuBkQ= +google.golang.org/genproto v0.0.0-20210624174822-c5cf32407d0a/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= diff --git a/functions/apiv1/cloud_functions_client.go b/functions/apiv1/cloud_functions_client.go index df2718fe933..06958d19ee7 100644 --- a/functions/apiv1/cloud_functions_client.go +++ b/functions/apiv1/cloud_functions_client.go @@ -25,7 +25,6 @@ import ( "cloud.google.com/go/longrunning" lroauto "cloud.google.com/go/longrunning/autogen" - "github.com/golang/protobuf/proto" gax "github.com/googleapis/gax-go/v2" "google.golang.org/api/iterator" "google.golang.org/api/option" @@ -37,6 +36,7 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/proto" ) var newCloudFunctionsClientHook clientHook diff --git a/functions/apiv1/doc.go b/functions/apiv1/doc.go index 4bde116d95f..624d14df15f 100644 --- a/functions/apiv1/doc.go +++ b/functions/apiv1/doc.go @@ -49,7 +49,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210612" +const versionClient = "20210624" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/functions/apiv1/gapic_metadata.json b/functions/apiv1/gapic_metadata.json index 176b9f45521..311de14e0f4 100644 --- a/functions/apiv1/gapic_metadata.json +++ b/functions/apiv1/gapic_metadata.json @@ -1,67 +1,67 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.functions.v1", - "libraryPackage": "cloud.google.com/go/functions/apiv1", - "services": { - "CloudFunctionsService": { - "clients": { - "grpc": { - "libraryClient": "CloudFunctionsClient", - "rpcs": { - "CallFunction": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.functions.v1", + "libraryPackage": "cloud.google.com/go/functions/apiv1", + "services": { + "CloudFunctionsService": { + "clients": { + "grpc": { + "libraryClient": "CloudFunctionsClient", + "rpcs": { + "CallFunction": { + "methods": [ "CallFunction" ] }, - "CreateFunction": { - "methods": [ + "CreateFunction": { + "methods": [ "CreateFunction" ] }, - "DeleteFunction": { - "methods": [ + "DeleteFunction": { + "methods": [ "DeleteFunction" ] }, - "GenerateDownloadUrl": { - "methods": [ + "GenerateDownloadUrl": { + "methods": [ "GenerateDownloadUrl" ] }, - "GenerateUploadUrl": { - "methods": [ + "GenerateUploadUrl": { + "methods": [ "GenerateUploadUrl" ] }, - "GetFunction": { - "methods": [ + "GetFunction": { + "methods": [ "GetFunction" ] }, - "GetIamPolicy": { - "methods": [ + "GetIamPolicy": { + "methods": [ "GetIamPolicy" ] }, - "ListFunctions": { - "methods": [ + "ListFunctions": { + "methods": [ "ListFunctions" ] }, - "SetIamPolicy": { - "methods": [ + "SetIamPolicy": { + "methods": [ "SetIamPolicy" ] }, - "TestIamPermissions": { - "methods": [ + "TestIamPermissions": { + "methods": [ "TestIamPermissions" ] }, - "UpdateFunction": { - "methods": [ + "UpdateFunction": { + "methods": [ "UpdateFunction" ] } diff --git a/gaming/apiv1/doc.go b/gaming/apiv1/doc.go index 42dbf2e7808..0e4f481fc59 100644 --- a/gaming/apiv1/doc.go +++ b/gaming/apiv1/doc.go @@ -49,7 +49,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210612" +const versionClient = "20210624" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/gaming/apiv1/game_server_clusters_client.go b/gaming/apiv1/game_server_clusters_client.go index b85d8fc04d2..dea79cd4f30 100644 --- a/gaming/apiv1/game_server_clusters_client.go +++ b/gaming/apiv1/game_server_clusters_client.go @@ -25,7 +25,6 @@ import ( "cloud.google.com/go/longrunning" lroauto "cloud.google.com/go/longrunning/autogen" - "github.com/golang/protobuf/proto" gax "github.com/googleapis/gax-go/v2" "google.golang.org/api/iterator" "google.golang.org/api/option" @@ -36,6 +35,7 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/proto" ) var newGameServerClustersClientHook clientHook diff --git a/gaming/apiv1/game_server_configs_client.go b/gaming/apiv1/game_server_configs_client.go index 306df815e77..f428810bddd 100644 --- a/gaming/apiv1/game_server_configs_client.go +++ b/gaming/apiv1/game_server_configs_client.go @@ -25,7 +25,6 @@ import ( "cloud.google.com/go/longrunning" lroauto "cloud.google.com/go/longrunning/autogen" - "github.com/golang/protobuf/proto" gax "github.com/googleapis/gax-go/v2" "google.golang.org/api/iterator" "google.golang.org/api/option" @@ -36,6 +35,7 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/proto" ) var newGameServerConfigsClientHook clientHook diff --git a/gaming/apiv1/game_server_deployments_client.go b/gaming/apiv1/game_server_deployments_client.go index d4c7c5bcfe3..fa13c8c20aa 100644 --- a/gaming/apiv1/game_server_deployments_client.go +++ b/gaming/apiv1/game_server_deployments_client.go @@ -25,7 +25,6 @@ import ( "cloud.google.com/go/longrunning" lroauto "cloud.google.com/go/longrunning/autogen" - "github.com/golang/protobuf/proto" gax "github.com/googleapis/gax-go/v2" "google.golang.org/api/iterator" "google.golang.org/api/option" @@ -36,6 +35,7 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/proto" ) var newGameServerDeploymentsClientHook clientHook diff --git a/gaming/apiv1/gapic_metadata.json b/gaming/apiv1/gapic_metadata.json index a7aa70f78b6..d72302d3de5 100644 --- a/gaming/apiv1/gapic_metadata.json +++ b/gaming/apiv1/gapic_metadata.json @@ -1,52 +1,52 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.gaming.v1", - "libraryPackage": "cloud.google.com/go/gaming/apiv1", - "services": { - "GameServerClustersService": { - "clients": { - "grpc": { - "libraryClient": "GameServerClustersClient", - "rpcs": { - "CreateGameServerCluster": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.gaming.v1", + "libraryPackage": "cloud.google.com/go/gaming/apiv1", + "services": { + "GameServerClustersService": { + "clients": { + "grpc": { + "libraryClient": "GameServerClustersClient", + "rpcs": { + "CreateGameServerCluster": { + "methods": [ "CreateGameServerCluster" ] }, - "DeleteGameServerCluster": { - "methods": [ + "DeleteGameServerCluster": { + "methods": [ "DeleteGameServerCluster" ] }, - "GetGameServerCluster": { - "methods": [ + "GetGameServerCluster": { + "methods": [ "GetGameServerCluster" ] }, - "ListGameServerClusters": { - "methods": [ + "ListGameServerClusters": { + "methods": [ "ListGameServerClusters" ] }, - "PreviewCreateGameServerCluster": { - "methods": [ + "PreviewCreateGameServerCluster": { + "methods": [ "PreviewCreateGameServerCluster" ] }, - "PreviewDeleteGameServerCluster": { - "methods": [ + "PreviewDeleteGameServerCluster": { + "methods": [ "PreviewDeleteGameServerCluster" ] }, - "PreviewUpdateGameServerCluster": { - "methods": [ + "PreviewUpdateGameServerCluster": { + "methods": [ "PreviewUpdateGameServerCluster" ] }, - "UpdateGameServerCluster": { - "methods": [ + "UpdateGameServerCluster": { + "methods": [ "UpdateGameServerCluster" ] } @@ -54,28 +54,28 @@ } } }, - "GameServerConfigsService": { - "clients": { - "grpc": { - "libraryClient": "GameServerConfigsClient", - "rpcs": { - "CreateGameServerConfig": { - "methods": [ + "GameServerConfigsService": { + "clients": { + "grpc": { + "libraryClient": "GameServerConfigsClient", + "rpcs": { + "CreateGameServerConfig": { + "methods": [ "CreateGameServerConfig" ] }, - "DeleteGameServerConfig": { - "methods": [ + "DeleteGameServerConfig": { + "methods": [ "DeleteGameServerConfig" ] }, - "GetGameServerConfig": { - "methods": [ + "GetGameServerConfig": { + "methods": [ "GetGameServerConfig" ] }, - "ListGameServerConfigs": { - "methods": [ + "ListGameServerConfigs": { + "methods": [ "ListGameServerConfigs" ] } @@ -83,53 +83,53 @@ } } }, - "GameServerDeploymentsService": { - "clients": { - "grpc": { - "libraryClient": "GameServerDeploymentsClient", - "rpcs": { - "CreateGameServerDeployment": { - "methods": [ + "GameServerDeploymentsService": { + "clients": { + "grpc": { + "libraryClient": "GameServerDeploymentsClient", + "rpcs": { + "CreateGameServerDeployment": { + "methods": [ "CreateGameServerDeployment" ] }, - "DeleteGameServerDeployment": { - "methods": [ + "DeleteGameServerDeployment": { + "methods": [ "DeleteGameServerDeployment" ] }, - "FetchDeploymentState": { - "methods": [ + "FetchDeploymentState": { + "methods": [ "FetchDeploymentState" ] }, - "GetGameServerDeployment": { - "methods": [ + "GetGameServerDeployment": { + "methods": [ "GetGameServerDeployment" ] }, - "GetGameServerDeploymentRollout": { - "methods": [ + "GetGameServerDeploymentRollout": { + "methods": [ "GetGameServerDeploymentRollout" ] }, - "ListGameServerDeployments": { - "methods": [ + "ListGameServerDeployments": { + "methods": [ "ListGameServerDeployments" ] }, - "PreviewGameServerDeploymentRollout": { - "methods": [ + "PreviewGameServerDeploymentRollout": { + "methods": [ "PreviewGameServerDeploymentRollout" ] }, - "UpdateGameServerDeployment": { - "methods": [ + "UpdateGameServerDeployment": { + "methods": [ "UpdateGameServerDeployment" ] }, - "UpdateGameServerDeploymentRollout": { - "methods": [ + "UpdateGameServerDeploymentRollout": { + "methods": [ "UpdateGameServerDeploymentRollout" ] } @@ -137,38 +137,38 @@ } } }, - "RealmsService": { - "clients": { - "grpc": { - "libraryClient": "RealmsClient", - "rpcs": { - "CreateRealm": { - "methods": [ + "RealmsService": { + "clients": { + "grpc": { + "libraryClient": "RealmsClient", + "rpcs": { + "CreateRealm": { + "methods": [ "CreateRealm" ] }, - "DeleteRealm": { - "methods": [ + "DeleteRealm": { + "methods": [ "DeleteRealm" ] }, - "GetRealm": { - "methods": [ + "GetRealm": { + "methods": [ "GetRealm" ] }, - "ListRealms": { - "methods": [ + "ListRealms": { + "methods": [ "ListRealms" ] }, - "PreviewRealmUpdate": { - "methods": [ + "PreviewRealmUpdate": { + "methods": [ "PreviewRealmUpdate" ] }, - "UpdateRealm": { - "methods": [ + "UpdateRealm": { + "methods": [ "UpdateRealm" ] } diff --git a/gaming/apiv1/realms_client.go b/gaming/apiv1/realms_client.go index 552d18a3e5b..98383d25dc9 100644 --- a/gaming/apiv1/realms_client.go +++ b/gaming/apiv1/realms_client.go @@ -25,7 +25,6 @@ import ( "cloud.google.com/go/longrunning" lroauto "cloud.google.com/go/longrunning/autogen" - "github.com/golang/protobuf/proto" gax "github.com/googleapis/gax-go/v2" "google.golang.org/api/iterator" "google.golang.org/api/option" @@ -36,6 +35,7 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/proto" ) var newRealmsClientHook clientHook diff --git a/gaming/apiv1beta/doc.go b/gaming/apiv1beta/doc.go index 28da66d096e..f4f31b44349 100644 --- a/gaming/apiv1beta/doc.go +++ b/gaming/apiv1beta/doc.go @@ -51,7 +51,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210612" +const versionClient = "20210624" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/gaming/apiv1beta/game_server_clusters_client.go b/gaming/apiv1beta/game_server_clusters_client.go index 48817c1edc3..3bfd481ac66 100644 --- a/gaming/apiv1beta/game_server_clusters_client.go +++ b/gaming/apiv1beta/game_server_clusters_client.go @@ -25,7 +25,6 @@ import ( "cloud.google.com/go/longrunning" lroauto "cloud.google.com/go/longrunning/autogen" - "github.com/golang/protobuf/proto" gax "github.com/googleapis/gax-go/v2" "google.golang.org/api/iterator" "google.golang.org/api/option" @@ -36,6 +35,7 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/proto" ) var newGameServerClustersClientHook clientHook diff --git a/gaming/apiv1beta/game_server_configs_client.go b/gaming/apiv1beta/game_server_configs_client.go index f3b91fd85ec..033f65f6e32 100644 --- a/gaming/apiv1beta/game_server_configs_client.go +++ b/gaming/apiv1beta/game_server_configs_client.go @@ -25,7 +25,6 @@ import ( "cloud.google.com/go/longrunning" lroauto "cloud.google.com/go/longrunning/autogen" - "github.com/golang/protobuf/proto" gax "github.com/googleapis/gax-go/v2" "google.golang.org/api/iterator" "google.golang.org/api/option" @@ -36,6 +35,7 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/proto" ) var newGameServerConfigsClientHook clientHook diff --git a/gaming/apiv1beta/game_server_deployments_client.go b/gaming/apiv1beta/game_server_deployments_client.go index 76a2bb8bdc8..959bd647ec1 100644 --- a/gaming/apiv1beta/game_server_deployments_client.go +++ b/gaming/apiv1beta/game_server_deployments_client.go @@ -25,7 +25,6 @@ import ( "cloud.google.com/go/longrunning" lroauto "cloud.google.com/go/longrunning/autogen" - "github.com/golang/protobuf/proto" gax "github.com/googleapis/gax-go/v2" "google.golang.org/api/iterator" "google.golang.org/api/option" @@ -36,6 +35,7 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/proto" ) var newGameServerDeploymentsClientHook clientHook diff --git a/gaming/apiv1beta/gapic_metadata.json b/gaming/apiv1beta/gapic_metadata.json index 110a8289a84..14b4cbb680c 100644 --- a/gaming/apiv1beta/gapic_metadata.json +++ b/gaming/apiv1beta/gapic_metadata.json @@ -1,52 +1,52 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.gaming.v1beta", - "libraryPackage": "cloud.google.com/go/gaming/apiv1beta", - "services": { - "GameServerClustersService": { - "clients": { - "grpc": { - "libraryClient": "GameServerClustersClient", - "rpcs": { - "CreateGameServerCluster": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.gaming.v1beta", + "libraryPackage": "cloud.google.com/go/gaming/apiv1beta", + "services": { + "GameServerClustersService": { + "clients": { + "grpc": { + "libraryClient": "GameServerClustersClient", + "rpcs": { + "CreateGameServerCluster": { + "methods": [ "CreateGameServerCluster" ] }, - "DeleteGameServerCluster": { - "methods": [ + "DeleteGameServerCluster": { + "methods": [ "DeleteGameServerCluster" ] }, - "GetGameServerCluster": { - "methods": [ + "GetGameServerCluster": { + "methods": [ "GetGameServerCluster" ] }, - "ListGameServerClusters": { - "methods": [ + "ListGameServerClusters": { + "methods": [ "ListGameServerClusters" ] }, - "PreviewCreateGameServerCluster": { - "methods": [ + "PreviewCreateGameServerCluster": { + "methods": [ "PreviewCreateGameServerCluster" ] }, - "PreviewDeleteGameServerCluster": { - "methods": [ + "PreviewDeleteGameServerCluster": { + "methods": [ "PreviewDeleteGameServerCluster" ] }, - "PreviewUpdateGameServerCluster": { - "methods": [ + "PreviewUpdateGameServerCluster": { + "methods": [ "PreviewUpdateGameServerCluster" ] }, - "UpdateGameServerCluster": { - "methods": [ + "UpdateGameServerCluster": { + "methods": [ "UpdateGameServerCluster" ] } @@ -54,28 +54,28 @@ } } }, - "GameServerConfigsService": { - "clients": { - "grpc": { - "libraryClient": "GameServerConfigsClient", - "rpcs": { - "CreateGameServerConfig": { - "methods": [ + "GameServerConfigsService": { + "clients": { + "grpc": { + "libraryClient": "GameServerConfigsClient", + "rpcs": { + "CreateGameServerConfig": { + "methods": [ "CreateGameServerConfig" ] }, - "DeleteGameServerConfig": { - "methods": [ + "DeleteGameServerConfig": { + "methods": [ "DeleteGameServerConfig" ] }, - "GetGameServerConfig": { - "methods": [ + "GetGameServerConfig": { + "methods": [ "GetGameServerConfig" ] }, - "ListGameServerConfigs": { - "methods": [ + "ListGameServerConfigs": { + "methods": [ "ListGameServerConfigs" ] } @@ -83,53 +83,53 @@ } } }, - "GameServerDeploymentsService": { - "clients": { - "grpc": { - "libraryClient": "GameServerDeploymentsClient", - "rpcs": { - "CreateGameServerDeployment": { - "methods": [ + "GameServerDeploymentsService": { + "clients": { + "grpc": { + "libraryClient": "GameServerDeploymentsClient", + "rpcs": { + "CreateGameServerDeployment": { + "methods": [ "CreateGameServerDeployment" ] }, - "DeleteGameServerDeployment": { - "methods": [ + "DeleteGameServerDeployment": { + "methods": [ "DeleteGameServerDeployment" ] }, - "FetchDeploymentState": { - "methods": [ + "FetchDeploymentState": { + "methods": [ "FetchDeploymentState" ] }, - "GetGameServerDeployment": { - "methods": [ + "GetGameServerDeployment": { + "methods": [ "GetGameServerDeployment" ] }, - "GetGameServerDeploymentRollout": { - "methods": [ + "GetGameServerDeploymentRollout": { + "methods": [ "GetGameServerDeploymentRollout" ] }, - "ListGameServerDeployments": { - "methods": [ + "ListGameServerDeployments": { + "methods": [ "ListGameServerDeployments" ] }, - "PreviewGameServerDeploymentRollout": { - "methods": [ + "PreviewGameServerDeploymentRollout": { + "methods": [ "PreviewGameServerDeploymentRollout" ] }, - "UpdateGameServerDeployment": { - "methods": [ + "UpdateGameServerDeployment": { + "methods": [ "UpdateGameServerDeployment" ] }, - "UpdateGameServerDeploymentRollout": { - "methods": [ + "UpdateGameServerDeploymentRollout": { + "methods": [ "UpdateGameServerDeploymentRollout" ] } @@ -137,38 +137,38 @@ } } }, - "RealmsService": { - "clients": { - "grpc": { - "libraryClient": "RealmsClient", - "rpcs": { - "CreateRealm": { - "methods": [ + "RealmsService": { + "clients": { + "grpc": { + "libraryClient": "RealmsClient", + "rpcs": { + "CreateRealm": { + "methods": [ "CreateRealm" ] }, - "DeleteRealm": { - "methods": [ + "DeleteRealm": { + "methods": [ "DeleteRealm" ] }, - "GetRealm": { - "methods": [ + "GetRealm": { + "methods": [ "GetRealm" ] }, - "ListRealms": { - "methods": [ + "ListRealms": { + "methods": [ "ListRealms" ] }, - "PreviewRealmUpdate": { - "methods": [ + "PreviewRealmUpdate": { + "methods": [ "PreviewRealmUpdate" ] }, - "UpdateRealm": { - "methods": [ + "UpdateRealm": { + "methods": [ "UpdateRealm" ] } diff --git a/gaming/apiv1beta/realms_client.go b/gaming/apiv1beta/realms_client.go index 28b33654ba1..72cb1ad841e 100644 --- a/gaming/apiv1beta/realms_client.go +++ b/gaming/apiv1beta/realms_client.go @@ -25,7 +25,6 @@ import ( "cloud.google.com/go/longrunning" lroauto "cloud.google.com/go/longrunning/autogen" - "github.com/golang/protobuf/proto" gax "github.com/googleapis/gax-go/v2" "google.golang.org/api/iterator" "google.golang.org/api/option" @@ -36,6 +35,7 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/proto" ) var newRealmsClientHook clientHook diff --git a/gkeconnect/gateway/apiv1beta1/doc.go b/gkeconnect/gateway/apiv1beta1/doc.go index e25dfe6f9d5..0212560c4d4 100644 --- a/gkeconnect/gateway/apiv1beta1/doc.go +++ b/gkeconnect/gateway/apiv1beta1/doc.go @@ -51,7 +51,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210612" +const versionClient = "20210624" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/gkeconnect/gateway/apiv1beta1/gapic_metadata.json b/gkeconnect/gateway/apiv1beta1/gapic_metadata.json index 40cfe97e1d9..c7a368a972c 100644 --- a/gkeconnect/gateway/apiv1beta1/gapic_metadata.json +++ b/gkeconnect/gateway/apiv1beta1/gapic_metadata.json @@ -1,37 +1,37 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.gkeconnect.gateway.v1beta1", - "libraryPackage": "cloud.google.com/go/gkeconnect/gateway/apiv1beta1", - "services": { - "GatewayService": { - "clients": { - "grpc": { - "libraryClient": "Client", - "rpcs": { - "DeleteResource": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.gkeconnect.gateway.v1beta1", + "libraryPackage": "cloud.google.com/go/gkeconnect/gateway/apiv1beta1", + "services": { + "GatewayService": { + "clients": { + "grpc": { + "libraryClient": "Client", + "rpcs": { + "DeleteResource": { + "methods": [ "DeleteResource" ] }, - "GetResource": { - "methods": [ + "GetResource": { + "methods": [ "GetResource" ] }, - "PatchResource": { - "methods": [ + "PatchResource": { + "methods": [ "PatchResource" ] }, - "PostResource": { - "methods": [ + "PostResource": { + "methods": [ "PostResource" ] }, - "PutResource": { - "methods": [ + "PutResource": { + "methods": [ "PutResource" ] } diff --git a/gkehub/apiv1beta1/doc.go b/gkehub/apiv1beta1/doc.go index 6202711ef04..35abd5d983e 100644 --- a/gkehub/apiv1beta1/doc.go +++ b/gkehub/apiv1beta1/doc.go @@ -48,7 +48,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210612" +const versionClient = "20210624" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/gkehub/apiv1beta1/gapic_metadata.json b/gkehub/apiv1beta1/gapic_metadata.json index 21ff5f263f9..7d081742c3a 100644 --- a/gkehub/apiv1beta1/gapic_metadata.json +++ b/gkehub/apiv1beta1/gapic_metadata.json @@ -1,52 +1,52 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.gkehub.v1beta1", - "libraryPackage": "cloud.google.com/go/gkehub/apiv1beta1", - "services": { - "GkeHubMembershipService": { - "clients": { - "grpc": { - "libraryClient": "GkeHubMembershipClient", - "rpcs": { - "CreateMembership": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.gkehub.v1beta1", + "libraryPackage": "cloud.google.com/go/gkehub/apiv1beta1", + "services": { + "GkeHubMembershipService": { + "clients": { + "grpc": { + "libraryClient": "GkeHubMembershipClient", + "rpcs": { + "CreateMembership": { + "methods": [ "CreateMembership" ] }, - "DeleteMembership": { - "methods": [ + "DeleteMembership": { + "methods": [ "DeleteMembership" ] }, - "GenerateConnectManifest": { - "methods": [ + "GenerateConnectManifest": { + "methods": [ "GenerateConnectManifest" ] }, - "GenerateExclusivityManifest": { - "methods": [ + "GenerateExclusivityManifest": { + "methods": [ "GenerateExclusivityManifest" ] }, - "GetMembership": { - "methods": [ + "GetMembership": { + "methods": [ "GetMembership" ] }, - "ListMemberships": { - "methods": [ + "ListMemberships": { + "methods": [ "ListMemberships" ] }, - "UpdateMembership": { - "methods": [ + "UpdateMembership": { + "methods": [ "UpdateMembership" ] }, - "ValidateExclusivity": { - "methods": [ + "ValidateExclusivity": { + "methods": [ "ValidateExclusivity" ] } diff --git a/gkehub/apiv1beta1/gke_hub_membership_client.go b/gkehub/apiv1beta1/gke_hub_membership_client.go index f45e246303c..cc33c60b545 100644 --- a/gkehub/apiv1beta1/gke_hub_membership_client.go +++ b/gkehub/apiv1beta1/gke_hub_membership_client.go @@ -25,7 +25,6 @@ import ( "cloud.google.com/go/longrunning" lroauto "cloud.google.com/go/longrunning/autogen" - "github.com/golang/protobuf/proto" gax "github.com/googleapis/gax-go/v2" "google.golang.org/api/iterator" "google.golang.org/api/option" @@ -36,6 +35,7 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/proto" ) var newGkeHubMembershipClientHook clientHook diff --git a/go.mod b/go.mod index a070bd00dde..eff2b9b740f 100644 --- a/go.mod +++ b/go.mod @@ -16,8 +16,8 @@ require ( golang.org/x/oauth2 v0.0.0-20210615190721-d04028783cf1 golang.org/x/text v0.3.6 golang.org/x/tools v0.1.3 - google.golang.org/api v0.48.0 - google.golang.org/genproto v0.0.0-20210617175327-b9e0b3197ced + google.golang.org/api v0.49.0 + google.golang.org/genproto v0.0.0-20210624174822-c5cf32407d0a google.golang.org/grpc v1.38.0 google.golang.org/protobuf v1.26.0 ) diff --git a/go.sum b/go.sum index a65100f3d21..063eb2fb248 100644 --- a/go.sum +++ b/go.sum @@ -19,6 +19,7 @@ cloud.google.com/go v0.78.0/go.mod h1:QjdrLG0uq+YwhjoVOLsS1t7TW8fs36kLs4XO5R5ECH cloud.google.com/go v0.79.0/go.mod h1:3bzgcEeQlzbuEAYu4mrWhKqWjmpprinYgKJLgKHnbb8= cloud.google.com/go v0.81.0/go.mod h1:mk/AM35KwGk/Nm2YSeZbxXdrNK3KZOYHmLkOqC2V6E0= cloud.google.com/go v0.83.0/go.mod h1:Z7MJUsANfY0pYPdw0lbnivPx4/vhy/e2FEkSkF7vAVY= +cloud.google.com/go v0.84.0/go.mod h1:RazrYuxIK6Kb7YrzzhPoLmCVzl7Sup4NrbKPg8KHSUM= cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= @@ -308,8 +309,9 @@ golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210514084401-e8d321eab015/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210603125802-9665404d3644 h1:CA1DEQ4NdKphKeL70tvsWNdT5oFh1lOjihRcEDROi0I= golang.org/x/sys v0.0.0-20210603125802-9665404d3644/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210616094352-59db8d763f22 h1:RqytpXGR1iVNX7psjB3ff8y7sNFinVFvkx1c8SjBkio= +golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -400,8 +402,9 @@ google.golang.org/api v0.40.0/go.mod h1:fYKFpnQN0DsDSKRVRcQSDQNtqWPfM9i+zNPxepjR google.golang.org/api v0.41.0/go.mod h1:RkxM5lITDfTzmyKFPt+wGrCJbVfniCr2ool8kTBzRTU= google.golang.org/api v0.43.0/go.mod h1:nQsDGjRXMo4lvh5hP0TKqF244gqhGcr/YSIykhUk/94= google.golang.org/api v0.47.0/go.mod h1:Wbvgpq1HddcWVtzsVLyfLp8lDg6AA241LmgIL59tHXo= -google.golang.org/api v0.48.0 h1:RDAPWfNFY06dffEXfn7hZF5Fr1ZbnChzfQZAPyBd1+I= google.golang.org/api v0.48.0/go.mod h1:71Pr1vy+TAZRPkPs/xlCf5SsU8WjuAWv1Pfjbtukyy4= +google.golang.org/api v0.49.0 h1:gjIBDxlTG7vnzMmEnYwTnvLTF8Rjzo+ETCgEX1YZ/fY= +google.golang.org/api v0.49.0/go.mod h1:BECiH72wsfwUvOVn3+btPD5WHi0LzavZReBndi42L18= 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.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= @@ -452,8 +455,10 @@ google.golang.org/genproto v0.0.0-20210402141018-6c239bbf2bb1/go.mod h1:9lPAdzaE google.golang.org/genproto v0.0.0-20210513213006-bf773b8c8384/go.mod h1:P3QM42oQyzQSnHPnZ/vqoCdDmzH28fzWByN9asMeM8A= google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= google.golang.org/genproto v0.0.0-20210604141403-392c879c8b08/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= -google.golang.org/genproto v0.0.0-20210617175327-b9e0b3197ced h1:c5geK1iMU3cDKtFrCVQIcjR3W+JOZMuhIyICMCTbtus= +google.golang.org/genproto v0.0.0-20210608205507-b6d2f5bf0d7d/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= google.golang.org/genproto v0.0.0-20210617175327-b9e0b3197ced/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24= +google.golang.org/genproto v0.0.0-20210624174822-c5cf32407d0a h1:b5Bhxmy6Tppar7Yl4J6c6xF33YSBhkm2FtV9/ZQuBkQ= +google.golang.org/genproto v0.0.0-20210624174822-c5cf32407d0a/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= diff --git a/gsuiteaddons/apiv1/doc.go b/gsuiteaddons/apiv1/doc.go index 480185bb2aa..236663d7d71 100644 --- a/gsuiteaddons/apiv1/doc.go +++ b/gsuiteaddons/apiv1/doc.go @@ -48,7 +48,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210612" +const versionClient = "20210624" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/gsuiteaddons/apiv1/g_suite_add_ons_client.go b/gsuiteaddons/apiv1/g_suite_add_ons_client.go index 621a3399a19..117ee461089 100644 --- a/gsuiteaddons/apiv1/g_suite_add_ons_client.go +++ b/gsuiteaddons/apiv1/g_suite_add_ons_client.go @@ -23,7 +23,6 @@ import ( "net/url" "time" - "github.com/golang/protobuf/proto" gax "github.com/googleapis/gax-go/v2" "google.golang.org/api/iterator" "google.golang.org/api/option" @@ -33,6 +32,7 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/proto" ) var newClientHook clientHook diff --git a/gsuiteaddons/apiv1/gapic_metadata.json b/gsuiteaddons/apiv1/gapic_metadata.json index 178d0b85085..d4725fdf979 100644 --- a/gsuiteaddons/apiv1/gapic_metadata.json +++ b/gsuiteaddons/apiv1/gapic_metadata.json @@ -1,57 +1,57 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.gsuiteaddons.v1", - "libraryPackage": "cloud.google.com/go/gsuiteaddons/apiv1", - "services": { - "GSuiteAddOns": { - "clients": { - "grpc": { - "libraryClient": "Client", - "rpcs": { - "CreateDeployment": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.gsuiteaddons.v1", + "libraryPackage": "cloud.google.com/go/gsuiteaddons/apiv1", + "services": { + "GSuiteAddOns": { + "clients": { + "grpc": { + "libraryClient": "Client", + "rpcs": { + "CreateDeployment": { + "methods": [ "CreateDeployment" ] }, - "DeleteDeployment": { - "methods": [ + "DeleteDeployment": { + "methods": [ "DeleteDeployment" ] }, - "GetAuthorization": { - "methods": [ + "GetAuthorization": { + "methods": [ "GetAuthorization" ] }, - "GetDeployment": { - "methods": [ + "GetDeployment": { + "methods": [ "GetDeployment" ] }, - "GetInstallStatus": { - "methods": [ + "GetInstallStatus": { + "methods": [ "GetInstallStatus" ] }, - "InstallDeployment": { - "methods": [ + "InstallDeployment": { + "methods": [ "InstallDeployment" ] }, - "ListDeployments": { - "methods": [ + "ListDeployments": { + "methods": [ "ListDeployments" ] }, - "ReplaceDeployment": { - "methods": [ + "ReplaceDeployment": { + "methods": [ "ReplaceDeployment" ] }, - "UninstallDeployment": { - "methods": [ + "UninstallDeployment": { + "methods": [ "UninstallDeployment" ] } diff --git a/iam/credentials/apiv1/doc.go b/iam/credentials/apiv1/doc.go index 2ae8af9b648..78abc51b632 100644 --- a/iam/credentials/apiv1/doc.go +++ b/iam/credentials/apiv1/doc.go @@ -49,7 +49,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210612" +const versionClient = "20210624" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/iam/credentials/apiv1/gapic_metadata.json b/iam/credentials/apiv1/gapic_metadata.json index 7e1edb5bfd2..735b6169ffe 100644 --- a/iam/credentials/apiv1/gapic_metadata.json +++ b/iam/credentials/apiv1/gapic_metadata.json @@ -1,32 +1,32 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.iam.credentials.v1", - "libraryPackage": "cloud.google.com/go/iam/credentials/apiv1", - "services": { - "IAMCredentials": { - "clients": { - "grpc": { - "libraryClient": "IamCredentialsClient", - "rpcs": { - "GenerateAccessToken": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.iam.credentials.v1", + "libraryPackage": "cloud.google.com/go/iam/credentials/apiv1", + "services": { + "IAMCredentials": { + "clients": { + "grpc": { + "libraryClient": "IamCredentialsClient", + "rpcs": { + "GenerateAccessToken": { + "methods": [ "GenerateAccessToken" ] }, - "GenerateIdToken": { - "methods": [ + "GenerateIdToken": { + "methods": [ "GenerateIdToken" ] }, - "SignBlob": { - "methods": [ + "SignBlob": { + "methods": [ "SignBlob" ] }, - "SignJwt": { - "methods": [ + "SignJwt": { + "methods": [ "SignJwt" ] } diff --git a/internal/examples/fake/go.mod b/internal/examples/fake/go.mod index a28b07053e3..186c772f8c9 100644 --- a/internal/examples/fake/go.mod +++ b/internal/examples/fake/go.mod @@ -3,8 +3,8 @@ module cloud.google.com/go/internal/examples/fake go 1.15 require ( - cloud.google.com/go v0.81.0 - google.golang.org/api v0.46.0 - google.golang.org/genproto v0.0.0-20210601144548-a796c710e9b6 - google.golang.org/grpc v1.37.1 + cloud.google.com/go v0.84.0 + google.golang.org/api v0.49.0 + google.golang.org/genproto v0.0.0-20210624174822-c5cf32407d0a + google.golang.org/grpc v1.38.0 ) diff --git a/internal/examples/fake/go.sum b/internal/examples/fake/go.sum index d9ac81ca88b..28eb0db10c5 100644 --- a/internal/examples/fake/go.sum +++ b/internal/examples/fake/go.sum @@ -17,8 +17,10 @@ cloud.google.com/go v0.72.0/go.mod h1:M+5Vjvlc2wnp6tjzE102Dw08nGShTscUx2nZMufOKP cloud.google.com/go v0.74.0/go.mod h1:VV1xSbzvo+9QJOxLDaJfTjx5e+MePCpCWwvftOeQmWk= cloud.google.com/go v0.78.0/go.mod h1:QjdrLG0uq+YwhjoVOLsS1t7TW8fs36kLs4XO5R5ECHg= cloud.google.com/go v0.79.0/go.mod h1:3bzgcEeQlzbuEAYu4mrWhKqWjmpprinYgKJLgKHnbb8= -cloud.google.com/go v0.81.0 h1:at8Tk2zUz63cLPR0JPWm5vp77pEZmzxEQBEfRKn1VV8= cloud.google.com/go v0.81.0/go.mod h1:mk/AM35KwGk/Nm2YSeZbxXdrNK3KZOYHmLkOqC2V6E0= +cloud.google.com/go v0.83.0/go.mod h1:Z7MJUsANfY0pYPdw0lbnivPx4/vhy/e2FEkSkF7vAVY= +cloud.google.com/go v0.84.0 h1:hVhK90DwCdOAYGME/FJd9vNIZye9HBR6Yy3fu4js3N8= +cloud.google.com/go v0.84.0/go.mod h1:RazrYuxIK6Kb7YrzzhPoLmCVzl7Sup4NrbKPg8KHSUM= cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= @@ -89,6 +91,7 @@ github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaS github.com/golang/protobuf v1.5.1/go.mod h1:DopwsBzvsk0Fs44TXzsVbJyPhcCPeIwnvohx4u74HPM= github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= @@ -101,11 +104,13 @@ github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.6 h1:BKbKCqvP6I+rmFHt06ZmyQtvB8xAkWdhFyr0ZUNZcxQ= +github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= github.com/google/martian/v3 v3.1.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= +github.com/google/martian/v3 v3.2.1/go.mod h1:oBOf6HBosgwRXnUGWUB05QECsc6uvmMiJ3+6W4l/CUk= github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= @@ -117,6 +122,7 @@ github.com/google/pprof v0.0.0-20201023163331-3e6fc7fc9c4c/go.mod h1:kpwsk12EmLe github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210122040257-d980be63207e/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210226084205-cbba55b83ad5/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20210601050228-01bbb1931b22/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= @@ -143,6 +149,7 @@ github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9de github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= @@ -179,6 +186,7 @@ golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRu golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/lint v0.0.0-20210508222113-6edffad5e616/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= @@ -189,6 +197,7 @@ golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -222,6 +231,7 @@ golang.org/x/net v0.0.0-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v golang.org/x/net v0.0.0-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLdyRGr576XBO4/greRjx4P4O3yc= +golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= golang.org/x/net v0.0.0-20210503060351-7fd8e65b6420 h1:a8jGStKg0XqKDlKqjLrXn0ioF5MH36pT7Z0BRTqLhbk= golang.org/x/net v0.0.0-20210503060351-7fd8e65b6420/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= @@ -235,8 +245,9 @@ golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5/go.mod h1:KelEdhl1UZF7XfJ golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210220000619-9bb904979d93/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210313182246-cd4f82c27b84/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210427180440-81ed05c6b58c h1:SgVl/sCtkicsS7psKkje4H9YtjdEl3xsYh7N+5TDHqY= -golang.org/x/oauth2 v0.0.0-20210427180440-81ed05c6b58c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210615190721-d04028783cf1 h1:x622Z2o4hgCr/4CiKWc51jHVKaWdtVpBNmEI8wI9Qns= +golang.org/x/oauth2 v0.0.0-20210615190721-d04028783cf1/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -283,9 +294,13 @@ golang.org/x/sys v0.0.0-20210220050731-9a76102bfb43/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210305230114-8fe3ee5dd75b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210315160823-c6e025ad8005/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210503080704-8803ae5d1324 h1:pAwJxDByZctfPwzlNGrDN2BQLsdPb9NkhoTJtUkAO28= -golang.org/x/sys v0.0.0-20210503080704-8803ae5d1324/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210514084401-e8d321eab015/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210603125802-9665404d3644/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210616094352-59db8d763f22 h1:RqytpXGR1iVNX7psjB3ff8y7sNFinVFvkx1c8SjBkio= +golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -345,6 +360,9 @@ golang.org/x/tools v0.0.0-20201201161351-ac6f37ff4c2a/go.mod h1:emZCQorbCU4vsT4f golang.org/x/tools v0.0.0-20201208233053-a543418bbed2/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= +golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= 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= @@ -371,8 +389,10 @@ google.golang.org/api v0.36.0/go.mod h1:+z5ficQTmoYpPn8LCUNVpK5I7hwkpjbcgqA7I34q google.golang.org/api v0.40.0/go.mod h1:fYKFpnQN0DsDSKRVRcQSDQNtqWPfM9i+zNPxepjRCQ8= google.golang.org/api v0.41.0/go.mod h1:RkxM5lITDfTzmyKFPt+wGrCJbVfniCr2ool8kTBzRTU= google.golang.org/api v0.43.0/go.mod h1:nQsDGjRXMo4lvh5hP0TKqF244gqhGcr/YSIykhUk/94= -google.golang.org/api v0.46.0 h1:jkDWHOBIoNSD0OQpq4rtBVu+Rh325MPjXG1rakAp8JU= -google.golang.org/api v0.46.0/go.mod h1:ceL4oozhkAiTID8XMmJBsIxID/9wMXJVVFXPg4ylg3I= +google.golang.org/api v0.47.0/go.mod h1:Wbvgpq1HddcWVtzsVLyfLp8lDg6AA241LmgIL59tHXo= +google.golang.org/api v0.48.0/go.mod h1:71Pr1vy+TAZRPkPs/xlCf5SsU8WjuAWv1Pfjbtukyy4= +google.golang.org/api v0.49.0 h1:gjIBDxlTG7vnzMmEnYwTnvLTF8Rjzo+ETCgEX1YZ/fY= +google.golang.org/api v0.49.0/go.mod h1:BECiH72wsfwUvOVn3+btPD5WHi0LzavZReBndi42L18= 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.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= @@ -420,9 +440,13 @@ google.golang.org/genproto v0.0.0-20210303154014-9728d6b83eeb/go.mod h1:FWY/as6D google.golang.org/genproto v0.0.0-20210310155132-4ce2db91004e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210319143718-93e7006c17a6/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210402141018-6c239bbf2bb1/go.mod h1:9lPAdzaEmUacj36I+k7YKbEc5CXzPIeORRgDAUOu28A= -google.golang.org/genproto v0.0.0-20210429181445-86c259c2b4ab/go.mod h1:P3QM42oQyzQSnHPnZ/vqoCdDmzH28fzWByN9asMeM8A= -google.golang.org/genproto v0.0.0-20210601144548-a796c710e9b6 h1:zWmI+1Z2ZiKs1ceiAn4gjBd1v/d/AuWf/b+bLPe9aNw= -google.golang.org/genproto v0.0.0-20210601144548-a796c710e9b6/go.mod h1:P3QM42oQyzQSnHPnZ/vqoCdDmzH28fzWByN9asMeM8A= +google.golang.org/genproto v0.0.0-20210513213006-bf773b8c8384/go.mod h1:P3QM42oQyzQSnHPnZ/vqoCdDmzH28fzWByN9asMeM8A= +google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= +google.golang.org/genproto v0.0.0-20210604141403-392c879c8b08/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= +google.golang.org/genproto v0.0.0-20210608205507-b6d2f5bf0d7d/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= +google.golang.org/genproto v0.0.0-20210617175327-b9e0b3197ced/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24= +google.golang.org/genproto v0.0.0-20210624174822-c5cf32407d0a h1:b5Bhxmy6Tppar7Yl4J6c6xF33YSBhkm2FtV9/ZQuBkQ= +google.golang.org/genproto v0.0.0-20210624174822-c5cf32407d0a/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= @@ -442,8 +466,10 @@ google.golang.org/grpc v1.35.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAG google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= google.golang.org/grpc v1.36.1/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= google.golang.org/grpc v1.37.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= -google.golang.org/grpc v1.37.1 h1:ARnQJNWxGyYJpdf/JXscNlQr/uv607ZPU9Z7ogHi+iI= google.golang.org/grpc v1.37.1/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= +google.golang.org/grpc v1.38.0 h1:/9BgsAsa5nWe26HqOlvlgJnqBuktYOLCgjCPqsa56W0= +google.golang.org/grpc v1.38.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= +google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw= 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= diff --git a/internal/examples/mock/go.mod b/internal/examples/mock/go.mod index 1502350dc08..44100a374eb 100644 --- a/internal/examples/mock/go.mod +++ b/internal/examples/mock/go.mod @@ -3,6 +3,9 @@ module cloud.google.com/go/internal/examples/mock go 1.15 require ( + github.com/google/go-cmp v0.5.6 // indirect github.com/googleapis/gax-go/v2 v2.0.5 - google.golang.org/genproto v0.0.0-20210601144548-a796c710e9b6 + golang.org/x/net v0.0.0-20210503060351-7fd8e65b6420 // indirect + golang.org/x/sys v0.0.0-20210616094352-59db8d763f22 // indirect + google.golang.org/genproto v0.0.0-20210624174822-c5cf32407d0a ) diff --git a/internal/examples/mock/go.sum b/internal/examples/mock/go.sum index 9f22d276f25..28127469ce2 100644 --- a/internal/examples/mock/go.sum +++ b/internal/examples/mock/go.sum @@ -7,7 +7,7 @@ github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnht github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= -github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= +github.com/envoyproxy/go-control-plane v0.9.9-0.20210217033140-668b12f5399d/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= @@ -28,8 +28,9 @@ github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMyw github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.6 h1:BKbKCqvP6I+rmFHt06ZmyQtvB8xAkWdhFyr0ZUNZcxQ= +github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/gax-go/v2 v2.0.5 h1:sjZBwGj9Jlw33ImPtvFviGYvseOtDM7hkSKB7+Tv3SM= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= @@ -37,45 +38,45 @@ github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZN github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= -github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/lint v0.0.0-20210508222113-6edffad5e616/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= -golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4 h1:b0LrWgu8+q7z4J+0Y3Umo5q1dL7NXBkKBWkaVkAq17E= -golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLdyRGr576XBO4/greRjx4P4O3yc= +golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= +golang.org/x/net v0.0.0-20210503060351-7fd8e65b6420 h1:a8jGStKg0XqKDlKqjLrXn0ioF5MH36pT7Z0BRTqLhbk= +golang.org/x/net v0.0.0-20210503060351-7fd8e65b6420/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210315160823-c6e025ad8005/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4 h1:EZ2mChiOa8udjfp6rRmswTbtZN/QzUQp4ptM4rnjHvc= -golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210616094352-59db8d763f22 h1:RqytpXGR1iVNX7psjB3ff8y7sNFinVFvkx1c8SjBkio= +golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.5 h1:i6eZZ+zk0SOf0xgBpEpPD18qWcJda6q1sxt3S0kzyUQ= golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.6 h1:aRYxNxv6iGQlyVaZmk6ZgYEDa+Jg18DxebPSrd6bg1M= +golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= @@ -83,7 +84,7 @@ golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3 golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= +golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= 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= @@ -94,14 +95,14 @@ google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7 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-20210601144548-a796c710e9b6 h1:zWmI+1Z2ZiKs1ceiAn4gjBd1v/d/AuWf/b+bLPe9aNw= -google.golang.org/genproto v0.0.0-20210601144548-a796c710e9b6/go.mod h1:P3QM42oQyzQSnHPnZ/vqoCdDmzH28fzWByN9asMeM8A= +google.golang.org/genproto v0.0.0-20210624174822-c5cf32407d0a h1:b5Bhxmy6Tppar7Yl4J6c6xF33YSBhkm2FtV9/ZQuBkQ= +google.golang.org/genproto v0.0.0-20210624174822-c5cf32407d0a/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= 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.36.1 h1:cmUfbeGKnz9+2DD/UYsMQXeqbHZqZDs4eQwW0sFOpBY= -google.golang.org/grpc v1.36.1/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= +google.golang.org/grpc v1.38.0 h1:/9BgsAsa5nWe26HqOlvlgJnqBuktYOLCgjCPqsa56W0= +google.golang.org/grpc v1.38.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= 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= diff --git a/internal/gapicgen/go.mod b/internal/gapicgen/go.mod index d4447f9c15f..f243d9f1913 100644 --- a/internal/gapicgen/go.mod +++ b/internal/gapicgen/go.mod @@ -11,7 +11,7 @@ require ( golang.org/x/oauth2 v0.0.0-20210615190721-d04028783cf1 golang.org/x/sync v0.0.0-20210220032951-036812b2e83c golang.org/x/sys v0.0.0-20210616094352-59db8d763f22 - google.golang.org/genproto v0.0.0-20210608205507-b6d2f5bf0d7d + google.golang.org/genproto v0.0.0-20210624174822-c5cf32407d0a google.golang.org/protobuf v1.26.0 gopkg.in/src-d/go-git.v4 v4.13.1 gopkg.in/yaml.v2 v2.4.0 diff --git a/internal/gapicgen/go.sum b/internal/gapicgen/go.sum index 746a4bde0a6..cdcc1fbaf71 100644 --- a/internal/gapicgen/go.sum +++ b/internal/gapicgen/go.sum @@ -501,8 +501,9 @@ google.golang.org/genproto v0.0.0-20210402141018-6c239bbf2bb1/go.mod h1:9lPAdzaE google.golang.org/genproto v0.0.0-20210513213006-bf773b8c8384/go.mod h1:P3QM42oQyzQSnHPnZ/vqoCdDmzH28fzWByN9asMeM8A= google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= google.golang.org/genproto v0.0.0-20210604141403-392c879c8b08/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= -google.golang.org/genproto v0.0.0-20210608205507-b6d2f5bf0d7d h1:KzwjikDymrEmYYbdyfievTwjEeGlu+OM6oiKBkF3Jfg= google.golang.org/genproto v0.0.0-20210608205507-b6d2f5bf0d7d/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= +google.golang.org/genproto v0.0.0-20210624174822-c5cf32407d0a h1:b5Bhxmy6Tppar7Yl4J6c6xF33YSBhkm2FtV9/ZQuBkQ= +google.golang.org/genproto v0.0.0-20210624174822-c5cf32407d0a/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= diff --git a/internal/generated/snippets/go.mod b/internal/generated/snippets/go.mod index 12bd2fffe4f..cd9d99660cc 100644 --- a/internal/generated/snippets/go.mod +++ b/internal/generated/snippets/go.mod @@ -31,6 +31,6 @@ require ( cloud.google.com/go/pubsub v1.9.1 cloud.google.com/go/pubsublite v0.84.0 cloud.google.com/go/spanner v0.84.0 - google.golang.org/api v0.48.0 - google.golang.org/genproto v0.0.0-20210617175327-b9e0b3197ced + google.golang.org/api v0.49.0 + google.golang.org/genproto v0.0.0-20210624174822-c5cf32407d0a ) diff --git a/internal/generated/snippets/go.sum b/internal/generated/snippets/go.sum index 6da54d93c2c..ae6fb5433cc 100644 --- a/internal/generated/snippets/go.sum +++ b/internal/generated/snippets/go.sum @@ -81,7 +81,6 @@ golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96b golang.org/x/net v0.0.0-20210503060351-7fd8e65b6420 h1:a8jGStKg0XqKDlKqjLrXn0ioF5MH36pT7Z0BRTqLhbk= golang.org/x/net v0.0.0-20210503060351-7fd8e65b6420/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= -golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210615190721-d04028783cf1 h1:x622Z2o4hgCr/4CiKWc51jHVKaWdtVpBNmEI8wI9Qns= golang.org/x/oauth2 v0.0.0-20210615190721-d04028783cf1/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -98,8 +97,8 @@ golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210603125802-9665404d3644 h1:CA1DEQ4NdKphKeL70tvsWNdT5oFh1lOjihRcEDROi0I= -golang.org/x/sys v0.0.0-20210603125802-9665404d3644/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210616094352-59db8d763f22 h1:RqytpXGR1iVNX7psjB3ff8y7sNFinVFvkx1c8SjBkio= +golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= @@ -116,15 +115,14 @@ golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBn golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= 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 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -google.golang.org/api v0.48.0 h1:RDAPWfNFY06dffEXfn7hZF5Fr1ZbnChzfQZAPyBd1+I= -google.golang.org/api v0.48.0/go.mod h1:71Pr1vy+TAZRPkPs/xlCf5SsU8WjuAWv1Pfjbtukyy4= +google.golang.org/api v0.49.0 h1:gjIBDxlTG7vnzMmEnYwTnvLTF8Rjzo+ETCgEX1YZ/fY= +google.golang.org/api v0.49.0/go.mod h1:BECiH72wsfwUvOVn3+btPD5WHi0LzavZReBndi42L18= 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.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= @@ -133,11 +131,9 @@ google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCID 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-20210604141403-392c879c8b08/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= -google.golang.org/genproto v0.0.0-20210608205507-b6d2f5bf0d7d/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= -google.golang.org/genproto v0.0.0-20210614143202-012ab6975634/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24= -google.golang.org/genproto v0.0.0-20210617175327-b9e0b3197ced h1:c5geK1iMU3cDKtFrCVQIcjR3W+JOZMuhIyICMCTbtus= google.golang.org/genproto v0.0.0-20210617175327-b9e0b3197ced/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24= +google.golang.org/genproto v0.0.0-20210624174822-c5cf32407d0a h1:b5Bhxmy6Tppar7Yl4J6c6xF33YSBhkm2FtV9/ZQuBkQ= +google.golang.org/genproto v0.0.0-20210624174822-c5cf32407d0a/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= diff --git a/internal/godocfx/go.sum b/internal/godocfx/go.sum index c5bb7e54c2a..8ed3c541bed 100644 --- a/internal/godocfx/go.sum +++ b/internal/godocfx/go.sum @@ -169,7 +169,6 @@ golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAG golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210615190721-d04028783cf1 h1:x622Z2o4hgCr/4CiKWc51jHVKaWdtVpBNmEI8wI9Qns= golang.org/x/oauth2 v0.0.0-20210615190721-d04028783cf1/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -206,8 +205,8 @@ golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210603125802-9665404d3644 h1:CA1DEQ4NdKphKeL70tvsWNdT5oFh1lOjihRcEDROi0I= -golang.org/x/sys v0.0.0-20210603125802-9665404d3644/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210616094352-59db8d763f22 h1:RqytpXGR1iVNX7psjB3ff8y7sNFinVFvkx1c8SjBkio= +golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= @@ -245,7 +244,6 @@ golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roY golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200827163409-021d7c6f1ec3/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.3 h1:L69ShwSZEyCsLKoAxDKeMvLDZkumEe8gXUZAjab0tX8= golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -265,8 +263,8 @@ google.golang.org/api v0.22.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/ google.golang.org/api v0.24.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= google.golang.org/api v0.28.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz5138Fc= -google.golang.org/api v0.48.0 h1:RDAPWfNFY06dffEXfn7hZF5Fr1ZbnChzfQZAPyBd1+I= -google.golang.org/api v0.48.0/go.mod h1:71Pr1vy+TAZRPkPs/xlCf5SsU8WjuAWv1Pfjbtukyy4= +google.golang.org/api v0.49.0 h1:gjIBDxlTG7vnzMmEnYwTnvLTF8Rjzo+ETCgEX1YZ/fY= +google.golang.org/api v0.49.0/go.mod h1:BECiH72wsfwUvOVn3+btPD5WHi0LzavZReBndi42L18= 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.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= @@ -297,9 +295,9 @@ google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEY google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20200827165113-ac2560b5e952/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210604141403-392c879c8b08/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= -google.golang.org/genproto v0.0.0-20210617175327-b9e0b3197ced h1:c5geK1iMU3cDKtFrCVQIcjR3W+JOZMuhIyICMCTbtus= google.golang.org/genproto v0.0.0-20210617175327-b9e0b3197ced/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24= +google.golang.org/genproto v0.0.0-20210624174822-c5cf32407d0a h1:b5Bhxmy6Tppar7Yl4J6c6xF33YSBhkm2FtV9/ZQuBkQ= +google.golang.org/genproto v0.0.0-20210624174822-c5cf32407d0a/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= diff --git a/iot/apiv1/device_manager_client.go b/iot/apiv1/device_manager_client.go index 2d38b0e8c14..f4eff633406 100644 --- a/iot/apiv1/device_manager_client.go +++ b/iot/apiv1/device_manager_client.go @@ -23,7 +23,6 @@ import ( "net/url" "time" - "github.com/golang/protobuf/proto" gax "github.com/googleapis/gax-go/v2" "google.golang.org/api/iterator" "google.golang.org/api/option" @@ -34,6 +33,7 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/proto" ) var newDeviceManagerClientHook clientHook diff --git a/iot/apiv1/doc.go b/iot/apiv1/doc.go index dc9fb05871b..cec8d20d98e 100644 --- a/iot/apiv1/doc.go +++ b/iot/apiv1/doc.go @@ -49,7 +49,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210612" +const versionClient = "20210624" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/iot/apiv1/gapic_metadata.json b/iot/apiv1/gapic_metadata.json index 75dfb965b17..d8c779156b3 100644 --- a/iot/apiv1/gapic_metadata.json +++ b/iot/apiv1/gapic_metadata.json @@ -1,107 +1,107 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.iot.v1", - "libraryPackage": "cloud.google.com/go/iot/apiv1", - "services": { - "DeviceManager": { - "clients": { - "grpc": { - "libraryClient": "DeviceManagerClient", - "rpcs": { - "BindDeviceToGateway": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.iot.v1", + "libraryPackage": "cloud.google.com/go/iot/apiv1", + "services": { + "DeviceManager": { + "clients": { + "grpc": { + "libraryClient": "DeviceManagerClient", + "rpcs": { + "BindDeviceToGateway": { + "methods": [ "BindDeviceToGateway" ] }, - "CreateDevice": { - "methods": [ + "CreateDevice": { + "methods": [ "CreateDevice" ] }, - "CreateDeviceRegistry": { - "methods": [ + "CreateDeviceRegistry": { + "methods": [ "CreateDeviceRegistry" ] }, - "DeleteDevice": { - "methods": [ + "DeleteDevice": { + "methods": [ "DeleteDevice" ] }, - "DeleteDeviceRegistry": { - "methods": [ + "DeleteDeviceRegistry": { + "methods": [ "DeleteDeviceRegistry" ] }, - "GetDevice": { - "methods": [ + "GetDevice": { + "methods": [ "GetDevice" ] }, - "GetDeviceRegistry": { - "methods": [ + "GetDeviceRegistry": { + "methods": [ "GetDeviceRegistry" ] }, - "GetIamPolicy": { - "methods": [ + "GetIamPolicy": { + "methods": [ "GetIamPolicy" ] }, - "ListDeviceConfigVersions": { - "methods": [ + "ListDeviceConfigVersions": { + "methods": [ "ListDeviceConfigVersions" ] }, - "ListDeviceRegistries": { - "methods": [ + "ListDeviceRegistries": { + "methods": [ "ListDeviceRegistries" ] }, - "ListDeviceStates": { - "methods": [ + "ListDeviceStates": { + "methods": [ "ListDeviceStates" ] }, - "ListDevices": { - "methods": [ + "ListDevices": { + "methods": [ "ListDevices" ] }, - "ModifyCloudToDeviceConfig": { - "methods": [ + "ModifyCloudToDeviceConfig": { + "methods": [ "ModifyCloudToDeviceConfig" ] }, - "SendCommandToDevice": { - "methods": [ + "SendCommandToDevice": { + "methods": [ "SendCommandToDevice" ] }, - "SetIamPolicy": { - "methods": [ + "SetIamPolicy": { + "methods": [ "SetIamPolicy" ] }, - "TestIamPermissions": { - "methods": [ + "TestIamPermissions": { + "methods": [ "TestIamPermissions" ] }, - "UnbindDeviceFromGateway": { - "methods": [ + "UnbindDeviceFromGateway": { + "methods": [ "UnbindDeviceFromGateway" ] }, - "UpdateDevice": { - "methods": [ + "UpdateDevice": { + "methods": [ "UpdateDevice" ] }, - "UpdateDeviceRegistry": { - "methods": [ + "UpdateDeviceRegistry": { + "methods": [ "UpdateDeviceRegistry" ] } diff --git a/kms/apiv1/doc.go b/kms/apiv1/doc.go index 3df03db477b..06b3b2f3fef 100644 --- a/kms/apiv1/doc.go +++ b/kms/apiv1/doc.go @@ -49,7 +49,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210617" +const versionClient = "20210624" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/kms/apiv1/gapic_metadata.json b/kms/apiv1/gapic_metadata.json index 37d3fd6d549..fdc6f4e7582 100644 --- a/kms/apiv1/gapic_metadata.json +++ b/kms/apiv1/gapic_metadata.json @@ -1,142 +1,142 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.kms.v1", - "libraryPackage": "cloud.google.com/go/kms/apiv1", - "services": { - "KeyManagementService": { - "clients": { - "grpc": { - "libraryClient": "KeyManagementClient", - "rpcs": { - "AsymmetricDecrypt": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.kms.v1", + "libraryPackage": "cloud.google.com/go/kms/apiv1", + "services": { + "KeyManagementService": { + "clients": { + "grpc": { + "libraryClient": "KeyManagementClient", + "rpcs": { + "AsymmetricDecrypt": { + "methods": [ "AsymmetricDecrypt" ] }, - "AsymmetricSign": { - "methods": [ + "AsymmetricSign": { + "methods": [ "AsymmetricSign" ] }, - "CreateCryptoKey": { - "methods": [ + "CreateCryptoKey": { + "methods": [ "CreateCryptoKey" ] }, - "CreateCryptoKeyVersion": { - "methods": [ + "CreateCryptoKeyVersion": { + "methods": [ "CreateCryptoKeyVersion" ] }, - "CreateImportJob": { - "methods": [ + "CreateImportJob": { + "methods": [ "CreateImportJob" ] }, - "CreateKeyRing": { - "methods": [ + "CreateKeyRing": { + "methods": [ "CreateKeyRing" ] }, - "Decrypt": { - "methods": [ + "Decrypt": { + "methods": [ "Decrypt" ] }, - "DestroyCryptoKeyVersion": { - "methods": [ + "DestroyCryptoKeyVersion": { + "methods": [ "DestroyCryptoKeyVersion" ] }, - "Encrypt": { - "methods": [ + "Encrypt": { + "methods": [ "Encrypt" ] }, - "GetCryptoKey": { - "methods": [ + "GetCryptoKey": { + "methods": [ "GetCryptoKey" ] }, - "GetCryptoKeyVersion": { - "methods": [ + "GetCryptoKeyVersion": { + "methods": [ "GetCryptoKeyVersion" ] }, - "GetIamPolicy": { - "methods": [ + "GetIamPolicy": { + "methods": [ "GetIamPolicy" ] }, - "GetImportJob": { - "methods": [ + "GetImportJob": { + "methods": [ "GetImportJob" ] }, - "GetKeyRing": { - "methods": [ + "GetKeyRing": { + "methods": [ "GetKeyRing" ] }, - "GetPublicKey": { - "methods": [ + "GetPublicKey": { + "methods": [ "GetPublicKey" ] }, - "ImportCryptoKeyVersion": { - "methods": [ + "ImportCryptoKeyVersion": { + "methods": [ "ImportCryptoKeyVersion" ] }, - "ListCryptoKeyVersions": { - "methods": [ + "ListCryptoKeyVersions": { + "methods": [ "ListCryptoKeyVersions" ] }, - "ListCryptoKeys": { - "methods": [ + "ListCryptoKeys": { + "methods": [ "ListCryptoKeys" ] }, - "ListImportJobs": { - "methods": [ + "ListImportJobs": { + "methods": [ "ListImportJobs" ] }, - "ListKeyRings": { - "methods": [ + "ListKeyRings": { + "methods": [ "ListKeyRings" ] }, - "RestoreCryptoKeyVersion": { - "methods": [ + "RestoreCryptoKeyVersion": { + "methods": [ "RestoreCryptoKeyVersion" ] }, - "SetIamPolicy": { - "methods": [ + "SetIamPolicy": { + "methods": [ "SetIamPolicy" ] }, - "TestIamPermissions": { - "methods": [ + "TestIamPermissions": { + "methods": [ "TestIamPermissions" ] }, - "UpdateCryptoKey": { - "methods": [ + "UpdateCryptoKey": { + "methods": [ "UpdateCryptoKey" ] }, - "UpdateCryptoKeyPrimaryVersion": { - "methods": [ + "UpdateCryptoKeyPrimaryVersion": { + "methods": [ "UpdateCryptoKeyPrimaryVersion" ] }, - "UpdateCryptoKeyVersion": { - "methods": [ + "UpdateCryptoKeyVersion": { + "methods": [ "UpdateCryptoKeyVersion" ] } diff --git a/kms/apiv1/key_management_client.go b/kms/apiv1/key_management_client.go index 9f4c7917a9e..d68b1d5626f 100644 --- a/kms/apiv1/key_management_client.go +++ b/kms/apiv1/key_management_client.go @@ -23,7 +23,6 @@ import ( "net/url" "time" - "github.com/golang/protobuf/proto" gax "github.com/googleapis/gax-go/v2" "google.golang.org/api/iterator" "google.golang.org/api/option" @@ -34,6 +33,7 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/proto" ) var newKeyManagementClientHook clientHook diff --git a/language/apiv1/doc.go b/language/apiv1/doc.go index 84bf34b6755..2e28b2a2ec6 100644 --- a/language/apiv1/doc.go +++ b/language/apiv1/doc.go @@ -50,7 +50,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210612" +const versionClient = "20210624" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/language/apiv1/gapic_metadata.json b/language/apiv1/gapic_metadata.json index f49ef2f8a6a..18ce7e22ac8 100644 --- a/language/apiv1/gapic_metadata.json +++ b/language/apiv1/gapic_metadata.json @@ -1,42 +1,42 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.language.v1", - "libraryPackage": "cloud.google.com/go/language/apiv1", - "services": { - "LanguageService": { - "clients": { - "grpc": { - "libraryClient": "Client", - "rpcs": { - "AnalyzeEntities": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.language.v1", + "libraryPackage": "cloud.google.com/go/language/apiv1", + "services": { + "LanguageService": { + "clients": { + "grpc": { + "libraryClient": "Client", + "rpcs": { + "AnalyzeEntities": { + "methods": [ "AnalyzeEntities" ] }, - "AnalyzeEntitySentiment": { - "methods": [ + "AnalyzeEntitySentiment": { + "methods": [ "AnalyzeEntitySentiment" ] }, - "AnalyzeSentiment": { - "methods": [ + "AnalyzeSentiment": { + "methods": [ "AnalyzeSentiment" ] }, - "AnalyzeSyntax": { - "methods": [ + "AnalyzeSyntax": { + "methods": [ "AnalyzeSyntax" ] }, - "AnnotateText": { - "methods": [ + "AnnotateText": { + "methods": [ "AnnotateText" ] }, - "ClassifyText": { - "methods": [ + "ClassifyText": { + "methods": [ "ClassifyText" ] } diff --git a/language/apiv1beta2/doc.go b/language/apiv1beta2/doc.go index 59062085934..293b4a3a19e 100644 --- a/language/apiv1beta2/doc.go +++ b/language/apiv1beta2/doc.go @@ -52,7 +52,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210612" +const versionClient = "20210624" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/language/apiv1beta2/gapic_metadata.json b/language/apiv1beta2/gapic_metadata.json index 8e23997306c..bf3be50c7f0 100644 --- a/language/apiv1beta2/gapic_metadata.json +++ b/language/apiv1beta2/gapic_metadata.json @@ -1,42 +1,42 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.language.v1beta2", - "libraryPackage": "cloud.google.com/go/language/apiv1beta2", - "services": { - "LanguageService": { - "clients": { - "grpc": { - "libraryClient": "Client", - "rpcs": { - "AnalyzeEntities": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.language.v1beta2", + "libraryPackage": "cloud.google.com/go/language/apiv1beta2", + "services": { + "LanguageService": { + "clients": { + "grpc": { + "libraryClient": "Client", + "rpcs": { + "AnalyzeEntities": { + "methods": [ "AnalyzeEntities" ] }, - "AnalyzeEntitySentiment": { - "methods": [ + "AnalyzeEntitySentiment": { + "methods": [ "AnalyzeEntitySentiment" ] }, - "AnalyzeSentiment": { - "methods": [ + "AnalyzeSentiment": { + "methods": [ "AnalyzeSentiment" ] }, - "AnalyzeSyntax": { - "methods": [ + "AnalyzeSyntax": { + "methods": [ "AnalyzeSyntax" ] }, - "AnnotateText": { - "methods": [ + "AnnotateText": { + "methods": [ "AnnotateText" ] }, - "ClassifyText": { - "methods": [ + "ClassifyText": { + "methods": [ "ClassifyText" ] } diff --git a/lifesciences/apiv2beta/doc.go b/lifesciences/apiv2beta/doc.go index 2daa57e8e23..47994d7136b 100644 --- a/lifesciences/apiv2beta/doc.go +++ b/lifesciences/apiv2beta/doc.go @@ -51,7 +51,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210612" +const versionClient = "20210624" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/lifesciences/apiv2beta/gapic_metadata.json b/lifesciences/apiv2beta/gapic_metadata.json index d809365ae65..c125f28e080 100644 --- a/lifesciences/apiv2beta/gapic_metadata.json +++ b/lifesciences/apiv2beta/gapic_metadata.json @@ -1,17 +1,17 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.lifesciences.v2beta", - "libraryPackage": "cloud.google.com/go/lifesciences/apiv2beta", - "services": { - "WorkflowsServiceV2Beta": { - "clients": { - "grpc": { - "libraryClient": "WorkflowsServiceV2BetaClient", - "rpcs": { - "RunPipeline": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.lifesciences.v2beta", + "libraryPackage": "cloud.google.com/go/lifesciences/apiv2beta", + "services": { + "WorkflowsServiceV2Beta": { + "clients": { + "grpc": { + "libraryClient": "WorkflowsServiceV2BetaClient", + "rpcs": { + "RunPipeline": { + "methods": [ "RunPipeline" ] } diff --git a/logging/apiv2/config_client.go b/logging/apiv2/config_client.go index 685f020f6ec..c61a17d2dd5 100644 --- a/logging/apiv2/config_client.go +++ b/logging/apiv2/config_client.go @@ -23,7 +23,6 @@ import ( "net/url" "time" - "github.com/golang/protobuf/proto" gax "github.com/googleapis/gax-go/v2" "google.golang.org/api/iterator" "google.golang.org/api/option" @@ -33,6 +32,7 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/proto" ) var newConfigClientHook clientHook diff --git a/logging/apiv2/doc.go b/logging/apiv2/doc.go index 27245ed42c0..03ddaa30e6a 100644 --- a/logging/apiv2/doc.go +++ b/logging/apiv2/doc.go @@ -52,7 +52,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210612" +const versionClient = "20210624" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/logging/apiv2/gapic_metadata.json b/logging/apiv2/gapic_metadata.json index 9636e5a0ced..63cb6a90b3d 100644 --- a/logging/apiv2/gapic_metadata.json +++ b/logging/apiv2/gapic_metadata.json @@ -1,127 +1,127 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.logging.v2", - "libraryPackage": "cloud.google.com/go/logging/apiv2", - "services": { - "ConfigServiceV2": { - "clients": { - "grpc": { - "libraryClient": "ConfigClient", - "rpcs": { - "CreateBucket": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.logging.v2", + "libraryPackage": "cloud.google.com/go/logging/apiv2", + "services": { + "ConfigServiceV2": { + "clients": { + "grpc": { + "libraryClient": "ConfigClient", + "rpcs": { + "CreateBucket": { + "methods": [ "CreateBucket" ] }, - "CreateExclusion": { - "methods": [ + "CreateExclusion": { + "methods": [ "CreateExclusion" ] }, - "CreateSink": { - "methods": [ + "CreateSink": { + "methods": [ "CreateSink" ] }, - "CreateView": { - "methods": [ + "CreateView": { + "methods": [ "CreateView" ] }, - "DeleteBucket": { - "methods": [ + "DeleteBucket": { + "methods": [ "DeleteBucket" ] }, - "DeleteExclusion": { - "methods": [ + "DeleteExclusion": { + "methods": [ "DeleteExclusion" ] }, - "DeleteSink": { - "methods": [ + "DeleteSink": { + "methods": [ "DeleteSink" ] }, - "DeleteView": { - "methods": [ + "DeleteView": { + "methods": [ "DeleteView" ] }, - "GetBucket": { - "methods": [ + "GetBucket": { + "methods": [ "GetBucket" ] }, - "GetCmekSettings": { - "methods": [ + "GetCmekSettings": { + "methods": [ "GetCmekSettings" ] }, - "GetExclusion": { - "methods": [ + "GetExclusion": { + "methods": [ "GetExclusion" ] }, - "GetSink": { - "methods": [ + "GetSink": { + "methods": [ "GetSink" ] }, - "GetView": { - "methods": [ + "GetView": { + "methods": [ "GetView" ] }, - "ListBuckets": { - "methods": [ + "ListBuckets": { + "methods": [ "ListBuckets" ] }, - "ListExclusions": { - "methods": [ + "ListExclusions": { + "methods": [ "ListExclusions" ] }, - "ListSinks": { - "methods": [ + "ListSinks": { + "methods": [ "ListSinks" ] }, - "ListViews": { - "methods": [ + "ListViews": { + "methods": [ "ListViews" ] }, - "UndeleteBucket": { - "methods": [ + "UndeleteBucket": { + "methods": [ "UndeleteBucket" ] }, - "UpdateBucket": { - "methods": [ + "UpdateBucket": { + "methods": [ "UpdateBucket" ] }, - "UpdateCmekSettings": { - "methods": [ + "UpdateCmekSettings": { + "methods": [ "UpdateCmekSettings" ] }, - "UpdateExclusion": { - "methods": [ + "UpdateExclusion": { + "methods": [ "UpdateExclusion" ] }, - "UpdateSink": { - "methods": [ + "UpdateSink": { + "methods": [ "UpdateSink" ] }, - "UpdateView": { - "methods": [ + "UpdateView": { + "methods": [ "UpdateView" ] } @@ -129,38 +129,38 @@ } } }, - "LoggingServiceV2": { - "clients": { - "grpc": { - "libraryClient": "Client", - "rpcs": { - "DeleteLog": { - "methods": [ + "LoggingServiceV2": { + "clients": { + "grpc": { + "libraryClient": "Client", + "rpcs": { + "DeleteLog": { + "methods": [ "DeleteLog" ] }, - "ListLogEntries": { - "methods": [ + "ListLogEntries": { + "methods": [ "ListLogEntries" ] }, - "ListLogs": { - "methods": [ + "ListLogs": { + "methods": [ "ListLogs" ] }, - "ListMonitoredResourceDescriptors": { - "methods": [ + "ListMonitoredResourceDescriptors": { + "methods": [ "ListMonitoredResourceDescriptors" ] }, - "TailLogEntries": { - "methods": [ + "TailLogEntries": { + "methods": [ "TailLogEntries" ] }, - "WriteLogEntries": { - "methods": [ + "WriteLogEntries": { + "methods": [ "WriteLogEntries" ] } @@ -168,33 +168,33 @@ } } }, - "MetricsServiceV2": { - "clients": { - "grpc": { - "libraryClient": "MetricsClient", - "rpcs": { - "CreateLogMetric": { - "methods": [ + "MetricsServiceV2": { + "clients": { + "grpc": { + "libraryClient": "MetricsClient", + "rpcs": { + "CreateLogMetric": { + "methods": [ "CreateLogMetric" ] }, - "DeleteLogMetric": { - "methods": [ + "DeleteLogMetric": { + "methods": [ "DeleteLogMetric" ] }, - "GetLogMetric": { - "methods": [ + "GetLogMetric": { + "methods": [ "GetLogMetric" ] }, - "ListLogMetrics": { - "methods": [ + "ListLogMetrics": { + "methods": [ "ListLogMetrics" ] }, - "UpdateLogMetric": { - "methods": [ + "UpdateLogMetric": { + "methods": [ "UpdateLogMetric" ] } diff --git a/logging/apiv2/logging_client.go b/logging/apiv2/logging_client.go index 4f3aa6224d6..b937729eedb 100644 --- a/logging/apiv2/logging_client.go +++ b/logging/apiv2/logging_client.go @@ -23,7 +23,6 @@ import ( "net/url" "time" - "github.com/golang/protobuf/proto" gax "github.com/googleapis/gax-go/v2" "google.golang.org/api/iterator" "google.golang.org/api/option" @@ -34,6 +33,7 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/proto" ) var newClientHook clientHook diff --git a/logging/apiv2/metrics_client.go b/logging/apiv2/metrics_client.go index df616772d59..c6c8fef4677 100644 --- a/logging/apiv2/metrics_client.go +++ b/logging/apiv2/metrics_client.go @@ -23,7 +23,6 @@ import ( "net/url" "time" - "github.com/golang/protobuf/proto" gax "github.com/googleapis/gax-go/v2" "google.golang.org/api/iterator" "google.golang.org/api/option" @@ -33,6 +32,7 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/proto" ) var newMetricsClientHook clientHook diff --git a/logging/go.mod b/logging/go.mod index 72b5a17cf39..e95d2ad7c46 100644 --- a/logging/go.mod +++ b/logging/go.mod @@ -10,7 +10,8 @@ require ( github.com/googleapis/gax-go/v2 v2.0.5 go.opencensus.io v0.23.0 golang.org/x/oauth2 v0.0.0-20210615190721-d04028783cf1 - google.golang.org/api v0.48.0 - google.golang.org/genproto v0.0.0-20210614143202-012ab6975634 + google.golang.org/api v0.49.0 + google.golang.org/genproto v0.0.0-20210624174822-c5cf32407d0a google.golang.org/grpc v1.38.0 + google.golang.org/protobuf v1.26.0 ) diff --git a/logging/go.sum b/logging/go.sum index 3631c91394f..12b9d118fa1 100644 --- a/logging/go.sum +++ b/logging/go.sum @@ -306,8 +306,9 @@ golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210514084401-e8d321eab015/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210603125802-9665404d3644 h1:CA1DEQ4NdKphKeL70tvsWNdT5oFh1lOjihRcEDROi0I= golang.org/x/sys v0.0.0-20210603125802-9665404d3644/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210616094352-59db8d763f22 h1:RqytpXGR1iVNX7psjB3ff8y7sNFinVFvkx1c8SjBkio= +golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -398,8 +399,9 @@ google.golang.org/api v0.40.0/go.mod h1:fYKFpnQN0DsDSKRVRcQSDQNtqWPfM9i+zNPxepjR google.golang.org/api v0.41.0/go.mod h1:RkxM5lITDfTzmyKFPt+wGrCJbVfniCr2ool8kTBzRTU= google.golang.org/api v0.43.0/go.mod h1:nQsDGjRXMo4lvh5hP0TKqF244gqhGcr/YSIykhUk/94= google.golang.org/api v0.47.0/go.mod h1:Wbvgpq1HddcWVtzsVLyfLp8lDg6AA241LmgIL59tHXo= -google.golang.org/api v0.48.0 h1:RDAPWfNFY06dffEXfn7hZF5Fr1ZbnChzfQZAPyBd1+I= google.golang.org/api v0.48.0/go.mod h1:71Pr1vy+TAZRPkPs/xlCf5SsU8WjuAWv1Pfjbtukyy4= +google.golang.org/api v0.49.0 h1:gjIBDxlTG7vnzMmEnYwTnvLTF8Rjzo+ETCgEX1YZ/fY= +google.golang.org/api v0.49.0/go.mod h1:BECiH72wsfwUvOVn3+btPD5WHi0LzavZReBndi42L18= 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.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= @@ -451,8 +453,9 @@ google.golang.org/genproto v0.0.0-20210513213006-bf773b8c8384/go.mod h1:P3QM42oQ google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= google.golang.org/genproto v0.0.0-20210604141403-392c879c8b08/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= google.golang.org/genproto v0.0.0-20210608205507-b6d2f5bf0d7d/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= -google.golang.org/genproto v0.0.0-20210614143202-012ab6975634 h1:LnkHrvncK4mYysgs+R1wPeMAILrmunf0Tzl0Li71pxo= -google.golang.org/genproto v0.0.0-20210614143202-012ab6975634/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24= +google.golang.org/genproto v0.0.0-20210617175327-b9e0b3197ced/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24= +google.golang.org/genproto v0.0.0-20210624174822-c5cf32407d0a h1:b5Bhxmy6Tppar7Yl4J6c6xF33YSBhkm2FtV9/ZQuBkQ= +google.golang.org/genproto v0.0.0-20210624174822-c5cf32407d0a/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= diff --git a/longrunning/autogen/doc.go b/longrunning/autogen/doc.go index 2fbfa1d27b4..6f783b4a371 100644 --- a/longrunning/autogen/doc.go +++ b/longrunning/autogen/doc.go @@ -48,7 +48,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210612" +const versionClient = "20210624" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/longrunning/autogen/gapic_metadata.json b/longrunning/autogen/gapic_metadata.json index eff1271b207..8489336a675 100644 --- a/longrunning/autogen/gapic_metadata.json +++ b/longrunning/autogen/gapic_metadata.json @@ -1,37 +1,37 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.longrunning", - "libraryPackage": "cloud.google.com/go/longrunning/autogen", - "services": { - "Operations": { - "clients": { - "grpc": { - "libraryClient": "OperationsClient", - "rpcs": { - "CancelOperation": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.longrunning", + "libraryPackage": "cloud.google.com/go/longrunning/autogen", + "services": { + "Operations": { + "clients": { + "grpc": { + "libraryClient": "OperationsClient", + "rpcs": { + "CancelOperation": { + "methods": [ "CancelOperation" ] }, - "DeleteOperation": { - "methods": [ + "DeleteOperation": { + "methods": [ "DeleteOperation" ] }, - "GetOperation": { - "methods": [ + "GetOperation": { + "methods": [ "GetOperation" ] }, - "ListOperations": { - "methods": [ + "ListOperations": { + "methods": [ "ListOperations" ] }, - "WaitOperation": { - "methods": [ + "WaitOperation": { + "methods": [ "WaitOperation" ] } diff --git a/longrunning/autogen/operations_client.go b/longrunning/autogen/operations_client.go index 3fd6b76bf5c..72704acc4f8 100644 --- a/longrunning/autogen/operations_client.go +++ b/longrunning/autogen/operations_client.go @@ -23,7 +23,6 @@ import ( "net/url" "time" - "github.com/golang/protobuf/proto" gax "github.com/googleapis/gax-go/v2" "google.golang.org/api/iterator" "google.golang.org/api/option" @@ -33,6 +32,7 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/proto" ) var newOperationsClientHook clientHook diff --git a/managedidentities/apiv1/doc.go b/managedidentities/apiv1/doc.go index 8f7403bbc84..a72b7b76bc7 100644 --- a/managedidentities/apiv1/doc.go +++ b/managedidentities/apiv1/doc.go @@ -50,7 +50,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210612" +const versionClient = "20210624" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/managedidentities/apiv1/gapic_metadata.json b/managedidentities/apiv1/gapic_metadata.json index 4277b2fe80f..d1c3eaa8899 100644 --- a/managedidentities/apiv1/gapic_metadata.json +++ b/managedidentities/apiv1/gapic_metadata.json @@ -1,62 +1,62 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.managedidentities.v1", - "libraryPackage": "cloud.google.com/go/managedidentities/apiv1", - "services": { - "ManagedIdentitiesService": { - "clients": { - "grpc": { - "libraryClient": "Client", - "rpcs": { - "AttachTrust": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.managedidentities.v1", + "libraryPackage": "cloud.google.com/go/managedidentities/apiv1", + "services": { + "ManagedIdentitiesService": { + "clients": { + "grpc": { + "libraryClient": "Client", + "rpcs": { + "AttachTrust": { + "methods": [ "AttachTrust" ] }, - "CreateMicrosoftAdDomain": { - "methods": [ + "CreateMicrosoftAdDomain": { + "methods": [ "CreateMicrosoftAdDomain" ] }, - "DeleteDomain": { - "methods": [ + "DeleteDomain": { + "methods": [ "DeleteDomain" ] }, - "DetachTrust": { - "methods": [ + "DetachTrust": { + "methods": [ "DetachTrust" ] }, - "GetDomain": { - "methods": [ + "GetDomain": { + "methods": [ "GetDomain" ] }, - "ListDomains": { - "methods": [ + "ListDomains": { + "methods": [ "ListDomains" ] }, - "ReconfigureTrust": { - "methods": [ + "ReconfigureTrust": { + "methods": [ "ReconfigureTrust" ] }, - "ResetAdminPassword": { - "methods": [ + "ResetAdminPassword": { + "methods": [ "ResetAdminPassword" ] }, - "UpdateDomain": { - "methods": [ + "UpdateDomain": { + "methods": [ "UpdateDomain" ] }, - "ValidateTrust": { - "methods": [ + "ValidateTrust": { + "methods": [ "ValidateTrust" ] } diff --git a/managedidentities/apiv1/managed_identities_client.go b/managedidentities/apiv1/managed_identities_client.go index e1919a6525a..519bca9cd49 100644 --- a/managedidentities/apiv1/managed_identities_client.go +++ b/managedidentities/apiv1/managed_identities_client.go @@ -25,7 +25,6 @@ import ( "cloud.google.com/go/longrunning" lroauto "cloud.google.com/go/longrunning/autogen" - "github.com/golang/protobuf/proto" gax "github.com/googleapis/gax-go/v2" "google.golang.org/api/iterator" "google.golang.org/api/option" @@ -35,6 +34,7 @@ import ( longrunningpb "google.golang.org/genproto/googleapis/longrunning" "google.golang.org/grpc" "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/proto" ) var newClientHook clientHook diff --git a/mediatranslation/apiv1beta1/doc.go b/mediatranslation/apiv1beta1/doc.go index 496d83daba4..61521b5dc13 100644 --- a/mediatranslation/apiv1beta1/doc.go +++ b/mediatranslation/apiv1beta1/doc.go @@ -48,7 +48,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210612" +const versionClient = "20210624" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/mediatranslation/apiv1beta1/gapic_metadata.json b/mediatranslation/apiv1beta1/gapic_metadata.json index 8ce9729bf44..720f4cab379 100644 --- a/mediatranslation/apiv1beta1/gapic_metadata.json +++ b/mediatranslation/apiv1beta1/gapic_metadata.json @@ -1,17 +1,17 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.mediatranslation.v1beta1", - "libraryPackage": "cloud.google.com/go/mediatranslation/apiv1beta1", - "services": { - "SpeechTranslationService": { - "clients": { - "grpc": { - "libraryClient": "SpeechTranslationClient", - "rpcs": { - "StreamingTranslateSpeech": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.mediatranslation.v1beta1", + "libraryPackage": "cloud.google.com/go/mediatranslation/apiv1beta1", + "services": { + "SpeechTranslationService": { + "clients": { + "grpc": { + "libraryClient": "SpeechTranslationClient", + "rpcs": { + "StreamingTranslateSpeech": { + "methods": [ "StreamingTranslateSpeech" ] } diff --git a/memcache/apiv1/cloud_memcache_client.go b/memcache/apiv1/cloud_memcache_client.go index 0843235c94a..21433cb9945 100644 --- a/memcache/apiv1/cloud_memcache_client.go +++ b/memcache/apiv1/cloud_memcache_client.go @@ -25,7 +25,6 @@ import ( "cloud.google.com/go/longrunning" lroauto "cloud.google.com/go/longrunning/autogen" - "github.com/golang/protobuf/proto" gax "github.com/googleapis/gax-go/v2" "google.golang.org/api/iterator" "google.golang.org/api/option" @@ -35,6 +34,7 @@ import ( longrunningpb "google.golang.org/genproto/googleapis/longrunning" "google.golang.org/grpc" "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/proto" ) var newCloudMemcacheClientHook clientHook diff --git a/memcache/apiv1/doc.go b/memcache/apiv1/doc.go index 6ceb30b0d76..a20fc3620c5 100644 --- a/memcache/apiv1/doc.go +++ b/memcache/apiv1/doc.go @@ -49,7 +49,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210612" +const versionClient = "20210624" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/memcache/apiv1/gapic_metadata.json b/memcache/apiv1/gapic_metadata.json index 5ceb74dbd7f..3d1d457865d 100644 --- a/memcache/apiv1/gapic_metadata.json +++ b/memcache/apiv1/gapic_metadata.json @@ -1,47 +1,47 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.memcache.v1", - "libraryPackage": "cloud.google.com/go/memcache/apiv1", - "services": { - "CloudMemcache": { - "clients": { - "grpc": { - "libraryClient": "CloudMemcacheClient", - "rpcs": { - "ApplyParameters": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.memcache.v1", + "libraryPackage": "cloud.google.com/go/memcache/apiv1", + "services": { + "CloudMemcache": { + "clients": { + "grpc": { + "libraryClient": "CloudMemcacheClient", + "rpcs": { + "ApplyParameters": { + "methods": [ "ApplyParameters" ] }, - "CreateInstance": { - "methods": [ + "CreateInstance": { + "methods": [ "CreateInstance" ] }, - "DeleteInstance": { - "methods": [ + "DeleteInstance": { + "methods": [ "DeleteInstance" ] }, - "GetInstance": { - "methods": [ + "GetInstance": { + "methods": [ "GetInstance" ] }, - "ListInstances": { - "methods": [ + "ListInstances": { + "methods": [ "ListInstances" ] }, - "UpdateInstance": { - "methods": [ + "UpdateInstance": { + "methods": [ "UpdateInstance" ] }, - "UpdateParameters": { - "methods": [ + "UpdateParameters": { + "methods": [ "UpdateParameters" ] } diff --git a/memcache/apiv1beta2/cloud_memcache_client.go b/memcache/apiv1beta2/cloud_memcache_client.go index 7778682ddb0..5524ec0b093 100644 --- a/memcache/apiv1beta2/cloud_memcache_client.go +++ b/memcache/apiv1beta2/cloud_memcache_client.go @@ -25,7 +25,6 @@ import ( "cloud.google.com/go/longrunning" lroauto "cloud.google.com/go/longrunning/autogen" - "github.com/golang/protobuf/proto" gax "github.com/googleapis/gax-go/v2" "google.golang.org/api/iterator" "google.golang.org/api/option" @@ -35,6 +34,7 @@ import ( longrunningpb "google.golang.org/genproto/googleapis/longrunning" "google.golang.org/grpc" "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/proto" ) var newCloudMemcacheClientHook clientHook diff --git a/memcache/apiv1beta2/doc.go b/memcache/apiv1beta2/doc.go index 04005be9126..7200a3862d4 100644 --- a/memcache/apiv1beta2/doc.go +++ b/memcache/apiv1beta2/doc.go @@ -51,7 +51,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210612" +const versionClient = "20210624" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/memcache/apiv1beta2/gapic_metadata.json b/memcache/apiv1beta2/gapic_metadata.json index 6efa801fe86..5e76a018271 100644 --- a/memcache/apiv1beta2/gapic_metadata.json +++ b/memcache/apiv1beta2/gapic_metadata.json @@ -1,52 +1,52 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.memcache.v1beta2", - "libraryPackage": "cloud.google.com/go/memcache/apiv1beta2", - "services": { - "CloudMemcache": { - "clients": { - "grpc": { - "libraryClient": "CloudMemcacheClient", - "rpcs": { - "ApplyParameters": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.memcache.v1beta2", + "libraryPackage": "cloud.google.com/go/memcache/apiv1beta2", + "services": { + "CloudMemcache": { + "clients": { + "grpc": { + "libraryClient": "CloudMemcacheClient", + "rpcs": { + "ApplyParameters": { + "methods": [ "ApplyParameters" ] }, - "ApplySoftwareUpdate": { - "methods": [ + "ApplySoftwareUpdate": { + "methods": [ "ApplySoftwareUpdate" ] }, - "CreateInstance": { - "methods": [ + "CreateInstance": { + "methods": [ "CreateInstance" ] }, - "DeleteInstance": { - "methods": [ + "DeleteInstance": { + "methods": [ "DeleteInstance" ] }, - "GetInstance": { - "methods": [ + "GetInstance": { + "methods": [ "GetInstance" ] }, - "ListInstances": { - "methods": [ + "ListInstances": { + "methods": [ "ListInstances" ] }, - "UpdateInstance": { - "methods": [ + "UpdateInstance": { + "methods": [ "UpdateInstance" ] }, - "UpdateParameters": { - "methods": [ + "UpdateParameters": { + "methods": [ "UpdateParameters" ] } diff --git a/metastore/apiv1/dataproc_metastore_client.go b/metastore/apiv1/dataproc_metastore_client.go index 69a6531f7f9..626216134b8 100644 --- a/metastore/apiv1/dataproc_metastore_client.go +++ b/metastore/apiv1/dataproc_metastore_client.go @@ -25,7 +25,6 @@ import ( "cloud.google.com/go/longrunning" lroauto "cloud.google.com/go/longrunning/autogen" - "github.com/golang/protobuf/proto" gax "github.com/googleapis/gax-go/v2" "google.golang.org/api/iterator" "google.golang.org/api/option" @@ -36,6 +35,7 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/proto" ) var newDataprocMetastoreClientHook clientHook diff --git a/metastore/apiv1/doc.go b/metastore/apiv1/doc.go index 513aabcc507..d5416465e8c 100644 --- a/metastore/apiv1/doc.go +++ b/metastore/apiv1/doc.go @@ -51,7 +51,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210612" +const versionClient = "20210624" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/metastore/apiv1/gapic_metadata.json b/metastore/apiv1/gapic_metadata.json index 373a5e1dcb4..e5ec3bd4e15 100644 --- a/metastore/apiv1/gapic_metadata.json +++ b/metastore/apiv1/gapic_metadata.json @@ -1,62 +1,62 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.metastore.v1", - "libraryPackage": "cloud.google.com/go/metastore/apiv1", - "services": { - "DataprocMetastore": { - "clients": { - "grpc": { - "libraryClient": "DataprocMetastoreClient", - "rpcs": { - "CreateMetadataImport": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.metastore.v1", + "libraryPackage": "cloud.google.com/go/metastore/apiv1", + "services": { + "DataprocMetastore": { + "clients": { + "grpc": { + "libraryClient": "DataprocMetastoreClient", + "rpcs": { + "CreateMetadataImport": { + "methods": [ "CreateMetadataImport" ] }, - "CreateService": { - "methods": [ + "CreateService": { + "methods": [ "CreateService" ] }, - "DeleteService": { - "methods": [ + "DeleteService": { + "methods": [ "DeleteService" ] }, - "ExportMetadata": { - "methods": [ + "ExportMetadata": { + "methods": [ "ExportMetadata" ] }, - "GetMetadataImport": { - "methods": [ + "GetMetadataImport": { + "methods": [ "GetMetadataImport" ] }, - "GetService": { - "methods": [ + "GetService": { + "methods": [ "GetService" ] }, - "ListMetadataImports": { - "methods": [ + "ListMetadataImports": { + "methods": [ "ListMetadataImports" ] }, - "ListServices": { - "methods": [ + "ListServices": { + "methods": [ "ListServices" ] }, - "UpdateMetadataImport": { - "methods": [ + "UpdateMetadataImport": { + "methods": [ "UpdateMetadataImport" ] }, - "UpdateService": { - "methods": [ + "UpdateService": { + "methods": [ "UpdateService" ] } diff --git a/metastore/apiv1alpha/dataproc_metastore_client.go b/metastore/apiv1alpha/dataproc_metastore_client.go index 56b0147b99a..22c922a3e13 100644 --- a/metastore/apiv1alpha/dataproc_metastore_client.go +++ b/metastore/apiv1alpha/dataproc_metastore_client.go @@ -25,7 +25,6 @@ import ( "cloud.google.com/go/longrunning" lroauto "cloud.google.com/go/longrunning/autogen" - "github.com/golang/protobuf/proto" gax "github.com/googleapis/gax-go/v2" "google.golang.org/api/iterator" "google.golang.org/api/option" @@ -36,6 +35,7 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/proto" ) var newDataprocMetastoreClientHook clientHook diff --git a/metastore/apiv1alpha/doc.go b/metastore/apiv1alpha/doc.go index 52f579ac643..96f60b3506c 100644 --- a/metastore/apiv1alpha/doc.go +++ b/metastore/apiv1alpha/doc.go @@ -51,7 +51,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210612" +const versionClient = "20210624" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/metastore/apiv1alpha/gapic_metadata.json b/metastore/apiv1alpha/gapic_metadata.json index 868989b8406..682ed11bb1d 100644 --- a/metastore/apiv1alpha/gapic_metadata.json +++ b/metastore/apiv1alpha/gapic_metadata.json @@ -1,87 +1,87 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.metastore.v1alpha", - "libraryPackage": "cloud.google.com/go/metastore/apiv1alpha", - "services": { - "DataprocMetastore": { - "clients": { - "grpc": { - "libraryClient": "DataprocMetastoreClient", - "rpcs": { - "CreateBackup": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.metastore.v1alpha", + "libraryPackage": "cloud.google.com/go/metastore/apiv1alpha", + "services": { + "DataprocMetastore": { + "clients": { + "grpc": { + "libraryClient": "DataprocMetastoreClient", + "rpcs": { + "CreateBackup": { + "methods": [ "CreateBackup" ] }, - "CreateMetadataImport": { - "methods": [ + "CreateMetadataImport": { + "methods": [ "CreateMetadataImport" ] }, - "CreateService": { - "methods": [ + "CreateService": { + "methods": [ "CreateService" ] }, - "DeleteBackup": { - "methods": [ + "DeleteBackup": { + "methods": [ "DeleteBackup" ] }, - "DeleteService": { - "methods": [ + "DeleteService": { + "methods": [ "DeleteService" ] }, - "ExportMetadata": { - "methods": [ + "ExportMetadata": { + "methods": [ "ExportMetadata" ] }, - "GetBackup": { - "methods": [ + "GetBackup": { + "methods": [ "GetBackup" ] }, - "GetMetadataImport": { - "methods": [ + "GetMetadataImport": { + "methods": [ "GetMetadataImport" ] }, - "GetService": { - "methods": [ + "GetService": { + "methods": [ "GetService" ] }, - "ListBackups": { - "methods": [ + "ListBackups": { + "methods": [ "ListBackups" ] }, - "ListMetadataImports": { - "methods": [ + "ListMetadataImports": { + "methods": [ "ListMetadataImports" ] }, - "ListServices": { - "methods": [ + "ListServices": { + "methods": [ "ListServices" ] }, - "RestoreService": { - "methods": [ + "RestoreService": { + "methods": [ "RestoreService" ] }, - "UpdateMetadataImport": { - "methods": [ + "UpdateMetadataImport": { + "methods": [ "UpdateMetadataImport" ] }, - "UpdateService": { - "methods": [ + "UpdateService": { + "methods": [ "UpdateService" ] } diff --git a/metastore/apiv1beta/dataproc_metastore_client.go b/metastore/apiv1beta/dataproc_metastore_client.go index 00098d7258d..15edd30c42a 100644 --- a/metastore/apiv1beta/dataproc_metastore_client.go +++ b/metastore/apiv1beta/dataproc_metastore_client.go @@ -25,7 +25,6 @@ import ( "cloud.google.com/go/longrunning" lroauto "cloud.google.com/go/longrunning/autogen" - "github.com/golang/protobuf/proto" gax "github.com/googleapis/gax-go/v2" "google.golang.org/api/iterator" "google.golang.org/api/option" @@ -36,6 +35,7 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/proto" ) var newDataprocMetastoreClientHook clientHook diff --git a/metastore/apiv1beta/doc.go b/metastore/apiv1beta/doc.go index c11cc59d0b9..d70b86ef847 100644 --- a/metastore/apiv1beta/doc.go +++ b/metastore/apiv1beta/doc.go @@ -51,7 +51,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210612" +const versionClient = "20210624" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/metastore/apiv1beta/gapic_metadata.json b/metastore/apiv1beta/gapic_metadata.json index 187c5316678..fb3f0a82e73 100644 --- a/metastore/apiv1beta/gapic_metadata.json +++ b/metastore/apiv1beta/gapic_metadata.json @@ -1,87 +1,87 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.metastore.v1beta", - "libraryPackage": "cloud.google.com/go/metastore/apiv1beta", - "services": { - "DataprocMetastore": { - "clients": { - "grpc": { - "libraryClient": "DataprocMetastoreClient", - "rpcs": { - "CreateBackup": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.metastore.v1beta", + "libraryPackage": "cloud.google.com/go/metastore/apiv1beta", + "services": { + "DataprocMetastore": { + "clients": { + "grpc": { + "libraryClient": "DataprocMetastoreClient", + "rpcs": { + "CreateBackup": { + "methods": [ "CreateBackup" ] }, - "CreateMetadataImport": { - "methods": [ + "CreateMetadataImport": { + "methods": [ "CreateMetadataImport" ] }, - "CreateService": { - "methods": [ + "CreateService": { + "methods": [ "CreateService" ] }, - "DeleteBackup": { - "methods": [ + "DeleteBackup": { + "methods": [ "DeleteBackup" ] }, - "DeleteService": { - "methods": [ + "DeleteService": { + "methods": [ "DeleteService" ] }, - "ExportMetadata": { - "methods": [ + "ExportMetadata": { + "methods": [ "ExportMetadata" ] }, - "GetBackup": { - "methods": [ + "GetBackup": { + "methods": [ "GetBackup" ] }, - "GetMetadataImport": { - "methods": [ + "GetMetadataImport": { + "methods": [ "GetMetadataImport" ] }, - "GetService": { - "methods": [ + "GetService": { + "methods": [ "GetService" ] }, - "ListBackups": { - "methods": [ + "ListBackups": { + "methods": [ "ListBackups" ] }, - "ListMetadataImports": { - "methods": [ + "ListMetadataImports": { + "methods": [ "ListMetadataImports" ] }, - "ListServices": { - "methods": [ + "ListServices": { + "methods": [ "ListServices" ] }, - "RestoreService": { - "methods": [ + "RestoreService": { + "methods": [ "RestoreService" ] }, - "UpdateMetadataImport": { - "methods": [ + "UpdateMetadataImport": { + "methods": [ "UpdateMetadataImport" ] }, - "UpdateService": { - "methods": [ + "UpdateService": { + "methods": [ "UpdateService" ] } diff --git a/monitoring/apiv3/v2/alert_policy_client.go b/monitoring/apiv3/v2/alert_policy_client.go index 1082d0edae0..08cbaea0f1d 100644 --- a/monitoring/apiv3/v2/alert_policy_client.go +++ b/monitoring/apiv3/v2/alert_policy_client.go @@ -23,7 +23,6 @@ import ( "net/url" "time" - "github.com/golang/protobuf/proto" gax "github.com/googleapis/gax-go/v2" "google.golang.org/api/iterator" "google.golang.org/api/option" @@ -33,6 +32,7 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/proto" ) var newAlertPolicyClientHook clientHook diff --git a/monitoring/apiv3/v2/doc.go b/monitoring/apiv3/v2/doc.go index 70f497d7dd7..c4273f0d1c6 100644 --- a/monitoring/apiv3/v2/doc.go +++ b/monitoring/apiv3/v2/doc.go @@ -53,7 +53,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210612" +const versionClient = "20210624" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/monitoring/apiv3/v2/gapic_metadata.json b/monitoring/apiv3/v2/gapic_metadata.json index c522dbe1359..8b42e15d29b 100644 --- a/monitoring/apiv3/v2/gapic_metadata.json +++ b/monitoring/apiv3/v2/gapic_metadata.json @@ -1,37 +1,37 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.monitoring.v3", - "libraryPackage": "cloud.google.com/go/monitoring/apiv3/v2", - "services": { - "AlertPolicyService": { - "clients": { - "grpc": { - "libraryClient": "AlertPolicyClient", - "rpcs": { - "CreateAlertPolicy": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.monitoring.v3", + "libraryPackage": "cloud.google.com/go/monitoring/apiv3/v2", + "services": { + "AlertPolicyService": { + "clients": { + "grpc": { + "libraryClient": "AlertPolicyClient", + "rpcs": { + "CreateAlertPolicy": { + "methods": [ "CreateAlertPolicy" ] }, - "DeleteAlertPolicy": { - "methods": [ + "DeleteAlertPolicy": { + "methods": [ "DeleteAlertPolicy" ] }, - "GetAlertPolicy": { - "methods": [ + "GetAlertPolicy": { + "methods": [ "GetAlertPolicy" ] }, - "ListAlertPolicies": { - "methods": [ + "ListAlertPolicies": { + "methods": [ "ListAlertPolicies" ] }, - "UpdateAlertPolicy": { - "methods": [ + "UpdateAlertPolicy": { + "methods": [ "UpdateAlertPolicy" ] } @@ -39,38 +39,38 @@ } } }, - "GroupService": { - "clients": { - "grpc": { - "libraryClient": "GroupClient", - "rpcs": { - "CreateGroup": { - "methods": [ + "GroupService": { + "clients": { + "grpc": { + "libraryClient": "GroupClient", + "rpcs": { + "CreateGroup": { + "methods": [ "CreateGroup" ] }, - "DeleteGroup": { - "methods": [ + "DeleteGroup": { + "methods": [ "DeleteGroup" ] }, - "GetGroup": { - "methods": [ + "GetGroup": { + "methods": [ "GetGroup" ] }, - "ListGroupMembers": { - "methods": [ + "ListGroupMembers": { + "methods": [ "ListGroupMembers" ] }, - "ListGroups": { - "methods": [ + "ListGroups": { + "methods": [ "ListGroups" ] }, - "UpdateGroup": { - "methods": [ + "UpdateGroup": { + "methods": [ "UpdateGroup" ] } @@ -78,48 +78,48 @@ } } }, - "MetricService": { - "clients": { - "grpc": { - "libraryClient": "MetricClient", - "rpcs": { - "CreateMetricDescriptor": { - "methods": [ + "MetricService": { + "clients": { + "grpc": { + "libraryClient": "MetricClient", + "rpcs": { + "CreateMetricDescriptor": { + "methods": [ "CreateMetricDescriptor" ] }, - "CreateTimeSeries": { - "methods": [ + "CreateTimeSeries": { + "methods": [ "CreateTimeSeries" ] }, - "DeleteMetricDescriptor": { - "methods": [ + "DeleteMetricDescriptor": { + "methods": [ "DeleteMetricDescriptor" ] }, - "GetMetricDescriptor": { - "methods": [ + "GetMetricDescriptor": { + "methods": [ "GetMetricDescriptor" ] }, - "GetMonitoredResourceDescriptor": { - "methods": [ + "GetMonitoredResourceDescriptor": { + "methods": [ "GetMonitoredResourceDescriptor" ] }, - "ListMetricDescriptors": { - "methods": [ + "ListMetricDescriptors": { + "methods": [ "ListMetricDescriptors" ] }, - "ListMonitoredResourceDescriptors": { - "methods": [ + "ListMonitoredResourceDescriptors": { + "methods": [ "ListMonitoredResourceDescriptors" ] }, - "ListTimeSeries": { - "methods": [ + "ListTimeSeries": { + "methods": [ "ListTimeSeries" ] } @@ -127,58 +127,58 @@ } } }, - "NotificationChannelService": { - "clients": { - "grpc": { - "libraryClient": "NotificationChannelClient", - "rpcs": { - "CreateNotificationChannel": { - "methods": [ + "NotificationChannelService": { + "clients": { + "grpc": { + "libraryClient": "NotificationChannelClient", + "rpcs": { + "CreateNotificationChannel": { + "methods": [ "CreateNotificationChannel" ] }, - "DeleteNotificationChannel": { - "methods": [ + "DeleteNotificationChannel": { + "methods": [ "DeleteNotificationChannel" ] }, - "GetNotificationChannel": { - "methods": [ + "GetNotificationChannel": { + "methods": [ "GetNotificationChannel" ] }, - "GetNotificationChannelDescriptor": { - "methods": [ + "GetNotificationChannelDescriptor": { + "methods": [ "GetNotificationChannelDescriptor" ] }, - "GetNotificationChannelVerificationCode": { - "methods": [ + "GetNotificationChannelVerificationCode": { + "methods": [ "GetNotificationChannelVerificationCode" ] }, - "ListNotificationChannelDescriptors": { - "methods": [ + "ListNotificationChannelDescriptors": { + "methods": [ "ListNotificationChannelDescriptors" ] }, - "ListNotificationChannels": { - "methods": [ + "ListNotificationChannels": { + "methods": [ "ListNotificationChannels" ] }, - "SendNotificationChannelVerificationCode": { - "methods": [ + "SendNotificationChannelVerificationCode": { + "methods": [ "SendNotificationChannelVerificationCode" ] }, - "UpdateNotificationChannel": { - "methods": [ + "UpdateNotificationChannel": { + "methods": [ "UpdateNotificationChannel" ] }, - "VerifyNotificationChannel": { - "methods": [ + "VerifyNotificationChannel": { + "methods": [ "VerifyNotificationChannel" ] } @@ -186,13 +186,13 @@ } } }, - "QueryService": { - "clients": { - "grpc": { - "libraryClient": "QueryClient", - "rpcs": { - "QueryTimeSeries": { - "methods": [ + "QueryService": { + "clients": { + "grpc": { + "libraryClient": "QueryClient", + "rpcs": { + "QueryTimeSeries": { + "methods": [ "QueryTimeSeries" ] } @@ -200,58 +200,58 @@ } } }, - "ServiceMonitoringService": { - "clients": { - "grpc": { - "libraryClient": "ServiceMonitoringClient", - "rpcs": { - "CreateService": { - "methods": [ + "ServiceMonitoringService": { + "clients": { + "grpc": { + "libraryClient": "ServiceMonitoringClient", + "rpcs": { + "CreateService": { + "methods": [ "CreateService" ] }, - "CreateServiceLevelObjective": { - "methods": [ + "CreateServiceLevelObjective": { + "methods": [ "CreateServiceLevelObjective" ] }, - "DeleteService": { - "methods": [ + "DeleteService": { + "methods": [ "DeleteService" ] }, - "DeleteServiceLevelObjective": { - "methods": [ + "DeleteServiceLevelObjective": { + "methods": [ "DeleteServiceLevelObjective" ] }, - "GetService": { - "methods": [ + "GetService": { + "methods": [ "GetService" ] }, - "GetServiceLevelObjective": { - "methods": [ + "GetServiceLevelObjective": { + "methods": [ "GetServiceLevelObjective" ] }, - "ListServiceLevelObjectives": { - "methods": [ + "ListServiceLevelObjectives": { + "methods": [ "ListServiceLevelObjectives" ] }, - "ListServices": { - "methods": [ + "ListServices": { + "methods": [ "ListServices" ] }, - "UpdateService": { - "methods": [ + "UpdateService": { + "methods": [ "UpdateService" ] }, - "UpdateServiceLevelObjective": { - "methods": [ + "UpdateServiceLevelObjective": { + "methods": [ "UpdateServiceLevelObjective" ] } @@ -259,38 +259,38 @@ } } }, - "UptimeCheckService": { - "clients": { - "grpc": { - "libraryClient": "UptimeCheckClient", - "rpcs": { - "CreateUptimeCheckConfig": { - "methods": [ + "UptimeCheckService": { + "clients": { + "grpc": { + "libraryClient": "UptimeCheckClient", + "rpcs": { + "CreateUptimeCheckConfig": { + "methods": [ "CreateUptimeCheckConfig" ] }, - "DeleteUptimeCheckConfig": { - "methods": [ + "DeleteUptimeCheckConfig": { + "methods": [ "DeleteUptimeCheckConfig" ] }, - "GetUptimeCheckConfig": { - "methods": [ + "GetUptimeCheckConfig": { + "methods": [ "GetUptimeCheckConfig" ] }, - "ListUptimeCheckConfigs": { - "methods": [ + "ListUptimeCheckConfigs": { + "methods": [ "ListUptimeCheckConfigs" ] }, - "ListUptimeCheckIps": { - "methods": [ + "ListUptimeCheckIps": { + "methods": [ "ListUptimeCheckIps" ] }, - "UpdateUptimeCheckConfig": { - "methods": [ + "UpdateUptimeCheckConfig": { + "methods": [ "UpdateUptimeCheckConfig" ] } diff --git a/monitoring/apiv3/v2/group_client.go b/monitoring/apiv3/v2/group_client.go index 4c2e897dc26..3ee8f498ab8 100644 --- a/monitoring/apiv3/v2/group_client.go +++ b/monitoring/apiv3/v2/group_client.go @@ -23,7 +23,6 @@ import ( "net/url" "time" - "github.com/golang/protobuf/proto" gax "github.com/googleapis/gax-go/v2" "google.golang.org/api/iterator" "google.golang.org/api/option" @@ -34,6 +33,7 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/proto" ) var newGroupClientHook clientHook diff --git a/monitoring/apiv3/v2/metric_client.go b/monitoring/apiv3/v2/metric_client.go index 4220a46c043..f294f7e08ba 100644 --- a/monitoring/apiv3/v2/metric_client.go +++ b/monitoring/apiv3/v2/metric_client.go @@ -23,7 +23,6 @@ import ( "net/url" "time" - "github.com/golang/protobuf/proto" gax "github.com/googleapis/gax-go/v2" "google.golang.org/api/iterator" "google.golang.org/api/option" @@ -35,6 +34,7 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/proto" ) var newMetricClientHook clientHook diff --git a/monitoring/apiv3/v2/notification_channel_client.go b/monitoring/apiv3/v2/notification_channel_client.go index f9bc9436619..b1f50db8b53 100644 --- a/monitoring/apiv3/v2/notification_channel_client.go +++ b/monitoring/apiv3/v2/notification_channel_client.go @@ -23,7 +23,6 @@ import ( "net/url" "time" - "github.com/golang/protobuf/proto" gax "github.com/googleapis/gax-go/v2" "google.golang.org/api/iterator" "google.golang.org/api/option" @@ -33,6 +32,7 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/proto" ) var newNotificationChannelClientHook clientHook diff --git a/monitoring/apiv3/v2/query_client.go b/monitoring/apiv3/v2/query_client.go index 9fceb1efb25..e2f8cbba0ab 100644 --- a/monitoring/apiv3/v2/query_client.go +++ b/monitoring/apiv3/v2/query_client.go @@ -22,7 +22,6 @@ import ( "math" "net/url" - "github.com/golang/protobuf/proto" gax "github.com/googleapis/gax-go/v2" "google.golang.org/api/iterator" "google.golang.org/api/option" @@ -31,6 +30,7 @@ import ( monitoringpb "google.golang.org/genproto/googleapis/monitoring/v3" "google.golang.org/grpc" "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/proto" ) var newQueryClientHook clientHook diff --git a/monitoring/apiv3/v2/service_monitoring_client.go b/monitoring/apiv3/v2/service_monitoring_client.go index b8fcfade00d..07cff2f8a41 100644 --- a/monitoring/apiv3/v2/service_monitoring_client.go +++ b/monitoring/apiv3/v2/service_monitoring_client.go @@ -23,7 +23,6 @@ import ( "net/url" "time" - "github.com/golang/protobuf/proto" gax "github.com/googleapis/gax-go/v2" "google.golang.org/api/iterator" "google.golang.org/api/option" @@ -33,6 +32,7 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/proto" ) var newServiceMonitoringClientHook clientHook diff --git a/monitoring/apiv3/v2/uptime_check_client.go b/monitoring/apiv3/v2/uptime_check_client.go index 2bcff7dec4d..37634947dd2 100644 --- a/monitoring/apiv3/v2/uptime_check_client.go +++ b/monitoring/apiv3/v2/uptime_check_client.go @@ -23,7 +23,6 @@ import ( "net/url" "time" - "github.com/golang/protobuf/proto" gax "github.com/googleapis/gax-go/v2" "google.golang.org/api/iterator" "google.golang.org/api/option" @@ -33,6 +32,7 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/proto" ) var newUptimeCheckClientHook clientHook diff --git a/monitoring/dashboard/apiv1/dashboards_client.go b/monitoring/dashboard/apiv1/dashboards_client.go index 59ac8478ea2..70e39b89c8b 100644 --- a/monitoring/dashboard/apiv1/dashboards_client.go +++ b/monitoring/dashboard/apiv1/dashboards_client.go @@ -23,7 +23,6 @@ import ( "net/url" "time" - "github.com/golang/protobuf/proto" gax "github.com/googleapis/gax-go/v2" "google.golang.org/api/iterator" "google.golang.org/api/option" @@ -33,6 +32,7 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/proto" ) var newDashboardsClientHook clientHook diff --git a/monitoring/dashboard/apiv1/doc.go b/monitoring/dashboard/apiv1/doc.go index 8e3e36e30b8..e6039b0085c 100644 --- a/monitoring/dashboard/apiv1/doc.go +++ b/monitoring/dashboard/apiv1/doc.go @@ -53,7 +53,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210612" +const versionClient = "20210624" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/monitoring/dashboard/apiv1/gapic_metadata.json b/monitoring/dashboard/apiv1/gapic_metadata.json index 28ca5eb4c1c..09b473804ce 100644 --- a/monitoring/dashboard/apiv1/gapic_metadata.json +++ b/monitoring/dashboard/apiv1/gapic_metadata.json @@ -1,37 +1,37 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.monitoring.dashboard.v1", - "libraryPackage": "cloud.google.com/go/monitoring/dashboard/apiv1", - "services": { - "DashboardsService": { - "clients": { - "grpc": { - "libraryClient": "DashboardsClient", - "rpcs": { - "CreateDashboard": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.monitoring.dashboard.v1", + "libraryPackage": "cloud.google.com/go/monitoring/dashboard/apiv1", + "services": { + "DashboardsService": { + "clients": { + "grpc": { + "libraryClient": "DashboardsClient", + "rpcs": { + "CreateDashboard": { + "methods": [ "CreateDashboard" ] }, - "DeleteDashboard": { - "methods": [ + "DeleteDashboard": { + "methods": [ "DeleteDashboard" ] }, - "GetDashboard": { - "methods": [ + "GetDashboard": { + "methods": [ "GetDashboard" ] }, - "ListDashboards": { - "methods": [ + "ListDashboards": { + "methods": [ "ListDashboards" ] }, - "UpdateDashboard": { - "methods": [ + "UpdateDashboard": { + "methods": [ "UpdateDashboard" ] } diff --git a/networkconnectivity/apiv1alpha1/doc.go b/networkconnectivity/apiv1alpha1/doc.go index 574ca7aa093..f9e121de625 100644 --- a/networkconnectivity/apiv1alpha1/doc.go +++ b/networkconnectivity/apiv1alpha1/doc.go @@ -51,7 +51,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210612" +const versionClient = "20210624" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/networkconnectivity/apiv1alpha1/gapic_metadata.json b/networkconnectivity/apiv1alpha1/gapic_metadata.json index 500541cde0f..350849dea78 100644 --- a/networkconnectivity/apiv1alpha1/gapic_metadata.json +++ b/networkconnectivity/apiv1alpha1/gapic_metadata.json @@ -1,62 +1,62 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.networkconnectivity.v1alpha1", - "libraryPackage": "cloud.google.com/go/networkconnectivity/apiv1alpha1", - "services": { - "HubService": { - "clients": { - "grpc": { - "libraryClient": "HubClient", - "rpcs": { - "CreateHub": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.networkconnectivity.v1alpha1", + "libraryPackage": "cloud.google.com/go/networkconnectivity/apiv1alpha1", + "services": { + "HubService": { + "clients": { + "grpc": { + "libraryClient": "HubClient", + "rpcs": { + "CreateHub": { + "methods": [ "CreateHub" ] }, - "CreateSpoke": { - "methods": [ + "CreateSpoke": { + "methods": [ "CreateSpoke" ] }, - "DeleteHub": { - "methods": [ + "DeleteHub": { + "methods": [ "DeleteHub" ] }, - "DeleteSpoke": { - "methods": [ + "DeleteSpoke": { + "methods": [ "DeleteSpoke" ] }, - "GetHub": { - "methods": [ + "GetHub": { + "methods": [ "GetHub" ] }, - "GetSpoke": { - "methods": [ + "GetSpoke": { + "methods": [ "GetSpoke" ] }, - "ListHubs": { - "methods": [ + "ListHubs": { + "methods": [ "ListHubs" ] }, - "ListSpokes": { - "methods": [ + "ListSpokes": { + "methods": [ "ListSpokes" ] }, - "UpdateHub": { - "methods": [ + "UpdateHub": { + "methods": [ "UpdateHub" ] }, - "UpdateSpoke": { - "methods": [ + "UpdateSpoke": { + "methods": [ "UpdateSpoke" ] } diff --git a/networkconnectivity/apiv1alpha1/hub_client.go b/networkconnectivity/apiv1alpha1/hub_client.go index fe06cfa963d..20b4e2088e2 100644 --- a/networkconnectivity/apiv1alpha1/hub_client.go +++ b/networkconnectivity/apiv1alpha1/hub_client.go @@ -25,7 +25,6 @@ import ( "cloud.google.com/go/longrunning" lroauto "cloud.google.com/go/longrunning/autogen" - "github.com/golang/protobuf/proto" gax "github.com/googleapis/gax-go/v2" "google.golang.org/api/iterator" "google.golang.org/api/option" @@ -36,6 +35,7 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/proto" ) var newHubClientHook clientHook diff --git a/notebooks/apiv1beta1/doc.go b/notebooks/apiv1beta1/doc.go index 81378add14d..f47af480b54 100644 --- a/notebooks/apiv1beta1/doc.go +++ b/notebooks/apiv1beta1/doc.go @@ -51,7 +51,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210612" +const versionClient = "20210624" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/notebooks/apiv1beta1/gapic_metadata.json b/notebooks/apiv1beta1/gapic_metadata.json index a344cd6d96b..e3e3dce499b 100644 --- a/notebooks/apiv1beta1/gapic_metadata.json +++ b/notebooks/apiv1beta1/gapic_metadata.json @@ -1,107 +1,107 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.notebooks.v1beta1", - "libraryPackage": "cloud.google.com/go/notebooks/apiv1beta1", - "services": { - "NotebookService": { - "clients": { - "grpc": { - "libraryClient": "NotebookClient", - "rpcs": { - "CreateEnvironment": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.notebooks.v1beta1", + "libraryPackage": "cloud.google.com/go/notebooks/apiv1beta1", + "services": { + "NotebookService": { + "clients": { + "grpc": { + "libraryClient": "NotebookClient", + "rpcs": { + "CreateEnvironment": { + "methods": [ "CreateEnvironment" ] }, - "CreateInstance": { - "methods": [ + "CreateInstance": { + "methods": [ "CreateInstance" ] }, - "DeleteEnvironment": { - "methods": [ + "DeleteEnvironment": { + "methods": [ "DeleteEnvironment" ] }, - "DeleteInstance": { - "methods": [ + "DeleteInstance": { + "methods": [ "DeleteInstance" ] }, - "GetEnvironment": { - "methods": [ + "GetEnvironment": { + "methods": [ "GetEnvironment" ] }, - "GetInstance": { - "methods": [ + "GetInstance": { + "methods": [ "GetInstance" ] }, - "IsInstanceUpgradeable": { - "methods": [ + "IsInstanceUpgradeable": { + "methods": [ "IsInstanceUpgradeable" ] }, - "ListEnvironments": { - "methods": [ + "ListEnvironments": { + "methods": [ "ListEnvironments" ] }, - "ListInstances": { - "methods": [ + "ListInstances": { + "methods": [ "ListInstances" ] }, - "RegisterInstance": { - "methods": [ + "RegisterInstance": { + "methods": [ "RegisterInstance" ] }, - "ReportInstanceInfo": { - "methods": [ + "ReportInstanceInfo": { + "methods": [ "ReportInstanceInfo" ] }, - "ResetInstance": { - "methods": [ + "ResetInstance": { + "methods": [ "ResetInstance" ] }, - "SetInstanceAccelerator": { - "methods": [ + "SetInstanceAccelerator": { + "methods": [ "SetInstanceAccelerator" ] }, - "SetInstanceLabels": { - "methods": [ + "SetInstanceLabels": { + "methods": [ "SetInstanceLabels" ] }, - "SetInstanceMachineType": { - "methods": [ + "SetInstanceMachineType": { + "methods": [ "SetInstanceMachineType" ] }, - "StartInstance": { - "methods": [ + "StartInstance": { + "methods": [ "StartInstance" ] }, - "StopInstance": { - "methods": [ + "StopInstance": { + "methods": [ "StopInstance" ] }, - "UpgradeInstance": { - "methods": [ + "UpgradeInstance": { + "methods": [ "UpgradeInstance" ] }, - "UpgradeInstanceInternal": { - "methods": [ + "UpgradeInstanceInternal": { + "methods": [ "UpgradeInstanceInternal" ] } diff --git a/notebooks/apiv1beta1/notebook_client.go b/notebooks/apiv1beta1/notebook_client.go index 1208d7ab60c..58557df52d9 100644 --- a/notebooks/apiv1beta1/notebook_client.go +++ b/notebooks/apiv1beta1/notebook_client.go @@ -25,7 +25,6 @@ import ( "cloud.google.com/go/longrunning" lroauto "cloud.google.com/go/longrunning/autogen" - "github.com/golang/protobuf/proto" gax "github.com/googleapis/gax-go/v2" "google.golang.org/api/iterator" "google.golang.org/api/option" @@ -35,6 +34,7 @@ import ( longrunningpb "google.golang.org/genproto/googleapis/longrunning" "google.golang.org/grpc" "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/proto" ) var newNotebookClientHook clientHook diff --git a/orgpolicy/apiv2/doc.go b/orgpolicy/apiv2/doc.go index 9d0a474f0fc..576f37df166 100644 --- a/orgpolicy/apiv2/doc.go +++ b/orgpolicy/apiv2/doc.go @@ -49,7 +49,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210612" +const versionClient = "20210624" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/orgpolicy/apiv2/gapic_metadata.json b/orgpolicy/apiv2/gapic_metadata.json index c07306a370e..c9c26e4e516 100644 --- a/orgpolicy/apiv2/gapic_metadata.json +++ b/orgpolicy/apiv2/gapic_metadata.json @@ -1,47 +1,47 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.orgpolicy.v2", - "libraryPackage": "cloud.google.com/go/orgpolicy/apiv2", - "services": { - "OrgPolicy": { - "clients": { - "grpc": { - "libraryClient": "Client", - "rpcs": { - "CreatePolicy": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.orgpolicy.v2", + "libraryPackage": "cloud.google.com/go/orgpolicy/apiv2", + "services": { + "OrgPolicy": { + "clients": { + "grpc": { + "libraryClient": "Client", + "rpcs": { + "CreatePolicy": { + "methods": [ "CreatePolicy" ] }, - "DeletePolicy": { - "methods": [ + "DeletePolicy": { + "methods": [ "DeletePolicy" ] }, - "GetEffectivePolicy": { - "methods": [ + "GetEffectivePolicy": { + "methods": [ "GetEffectivePolicy" ] }, - "GetPolicy": { - "methods": [ + "GetPolicy": { + "methods": [ "GetPolicy" ] }, - "ListConstraints": { - "methods": [ + "ListConstraints": { + "methods": [ "ListConstraints" ] }, - "ListPolicies": { - "methods": [ + "ListPolicies": { + "methods": [ "ListPolicies" ] }, - "UpdatePolicy": { - "methods": [ + "UpdatePolicy": { + "methods": [ "UpdatePolicy" ] } diff --git a/orgpolicy/apiv2/org_policy_client.go b/orgpolicy/apiv2/org_policy_client.go index 3a9368d5eab..53c4803ca71 100644 --- a/orgpolicy/apiv2/org_policy_client.go +++ b/orgpolicy/apiv2/org_policy_client.go @@ -23,7 +23,6 @@ import ( "net/url" "time" - "github.com/golang/protobuf/proto" gax "github.com/googleapis/gax-go/v2" "google.golang.org/api/iterator" "google.golang.org/api/option" @@ -33,6 +32,7 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/proto" ) var newClientHook clientHook diff --git a/osconfig/agentendpoint/apiv1/doc.go b/osconfig/agentendpoint/apiv1/doc.go index 5ce173a2fe6..c79007e5f3d 100644 --- a/osconfig/agentendpoint/apiv1/doc.go +++ b/osconfig/agentendpoint/apiv1/doc.go @@ -49,7 +49,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210612" +const versionClient = "20210624" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/osconfig/agentendpoint/apiv1/gapic_metadata.json b/osconfig/agentendpoint/apiv1/gapic_metadata.json index a1becd79620..10311f0ebc9 100644 --- a/osconfig/agentendpoint/apiv1/gapic_metadata.json +++ b/osconfig/agentendpoint/apiv1/gapic_metadata.json @@ -1,42 +1,42 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.osconfig.agentendpoint.v1", - "libraryPackage": "cloud.google.com/go/osconfig/agentendpoint/apiv1", - "services": { - "AgentEndpointService": { - "clients": { - "grpc": { - "libraryClient": "Client", - "rpcs": { - "ReceiveTaskNotification": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.osconfig.agentendpoint.v1", + "libraryPackage": "cloud.google.com/go/osconfig/agentendpoint/apiv1", + "services": { + "AgentEndpointService": { + "clients": { + "grpc": { + "libraryClient": "Client", + "rpcs": { + "ReceiveTaskNotification": { + "methods": [ "ReceiveTaskNotification" ] }, - "RegisterAgent": { - "methods": [ + "RegisterAgent": { + "methods": [ "RegisterAgent" ] }, - "ReportInventory": { - "methods": [ + "ReportInventory": { + "methods": [ "ReportInventory" ] }, - "ReportTaskComplete": { - "methods": [ + "ReportTaskComplete": { + "methods": [ "ReportTaskComplete" ] }, - "ReportTaskProgress": { - "methods": [ + "ReportTaskProgress": { + "methods": [ "ReportTaskProgress" ] }, - "StartNextTask": { - "methods": [ + "StartNextTask": { + "methods": [ "StartNextTask" ] } diff --git a/osconfig/agentendpoint/apiv1beta/doc.go b/osconfig/agentendpoint/apiv1beta/doc.go index 14bb88927af..a6d659fcc8b 100644 --- a/osconfig/agentendpoint/apiv1beta/doc.go +++ b/osconfig/agentendpoint/apiv1beta/doc.go @@ -51,7 +51,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210612" +const versionClient = "20210624" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/osconfig/agentendpoint/apiv1beta/gapic_metadata.json b/osconfig/agentendpoint/apiv1beta/gapic_metadata.json index 3d302165c76..31ec346d10d 100644 --- a/osconfig/agentendpoint/apiv1beta/gapic_metadata.json +++ b/osconfig/agentendpoint/apiv1beta/gapic_metadata.json @@ -1,42 +1,42 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.osconfig.agentendpoint.v1beta", - "libraryPackage": "cloud.google.com/go/osconfig/agentendpoint/apiv1beta", - "services": { - "AgentEndpointService": { - "clients": { - "grpc": { - "libraryClient": "Client", - "rpcs": { - "LookupEffectiveGuestPolicy": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.osconfig.agentendpoint.v1beta", + "libraryPackage": "cloud.google.com/go/osconfig/agentendpoint/apiv1beta", + "services": { + "AgentEndpointService": { + "clients": { + "grpc": { + "libraryClient": "Client", + "rpcs": { + "LookupEffectiveGuestPolicy": { + "methods": [ "LookupEffectiveGuestPolicy" ] }, - "ReceiveTaskNotification": { - "methods": [ + "ReceiveTaskNotification": { + "methods": [ "ReceiveTaskNotification" ] }, - "RegisterAgent": { - "methods": [ + "RegisterAgent": { + "methods": [ "RegisterAgent" ] }, - "ReportTaskComplete": { - "methods": [ + "ReportTaskComplete": { + "methods": [ "ReportTaskComplete" ] }, - "ReportTaskProgress": { - "methods": [ + "ReportTaskProgress": { + "methods": [ "ReportTaskProgress" ] }, - "StartNextTask": { - "methods": [ + "StartNextTask": { + "methods": [ "StartNextTask" ] } diff --git a/osconfig/apiv1/doc.go b/osconfig/apiv1/doc.go index 27d82dd045c..ad284825e88 100644 --- a/osconfig/apiv1/doc.go +++ b/osconfig/apiv1/doc.go @@ -49,7 +49,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210612" +const versionClient = "20210624" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/osconfig/apiv1/gapic_metadata.json b/osconfig/apiv1/gapic_metadata.json index 1b0d0f460a2..eb5c0df8398 100644 --- a/osconfig/apiv1/gapic_metadata.json +++ b/osconfig/apiv1/gapic_metadata.json @@ -1,57 +1,57 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.osconfig.v1", - "libraryPackage": "cloud.google.com/go/osconfig/apiv1", - "services": { - "OsConfigService": { - "clients": { - "grpc": { - "libraryClient": "Client", - "rpcs": { - "CancelPatchJob": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.osconfig.v1", + "libraryPackage": "cloud.google.com/go/osconfig/apiv1", + "services": { + "OsConfigService": { + "clients": { + "grpc": { + "libraryClient": "Client", + "rpcs": { + "CancelPatchJob": { + "methods": [ "CancelPatchJob" ] }, - "CreatePatchDeployment": { - "methods": [ + "CreatePatchDeployment": { + "methods": [ "CreatePatchDeployment" ] }, - "DeletePatchDeployment": { - "methods": [ + "DeletePatchDeployment": { + "methods": [ "DeletePatchDeployment" ] }, - "ExecutePatchJob": { - "methods": [ + "ExecutePatchJob": { + "methods": [ "ExecutePatchJob" ] }, - "GetPatchDeployment": { - "methods": [ + "GetPatchDeployment": { + "methods": [ "GetPatchDeployment" ] }, - "GetPatchJob": { - "methods": [ + "GetPatchJob": { + "methods": [ "GetPatchJob" ] }, - "ListPatchDeployments": { - "methods": [ + "ListPatchDeployments": { + "methods": [ "ListPatchDeployments" ] }, - "ListPatchJobInstanceDetails": { - "methods": [ + "ListPatchJobInstanceDetails": { + "methods": [ "ListPatchJobInstanceDetails" ] }, - "ListPatchJobs": { - "methods": [ + "ListPatchJobs": { + "methods": [ "ListPatchJobs" ] } diff --git a/osconfig/apiv1/os_config_client.go b/osconfig/apiv1/os_config_client.go index 30729927a4d..46398532f8e 100644 --- a/osconfig/apiv1/os_config_client.go +++ b/osconfig/apiv1/os_config_client.go @@ -23,7 +23,6 @@ import ( "net/url" "time" - "github.com/golang/protobuf/proto" gax "github.com/googleapis/gax-go/v2" "google.golang.org/api/iterator" "google.golang.org/api/option" @@ -33,6 +32,7 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/proto" ) var newClientHook clientHook diff --git a/osconfig/apiv1alpha/doc.go b/osconfig/apiv1alpha/doc.go index 06161c49883..a60f17c6a53 100644 --- a/osconfig/apiv1alpha/doc.go +++ b/osconfig/apiv1alpha/doc.go @@ -51,7 +51,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210612" +const versionClient = "20210624" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/osconfig/apiv1alpha/gapic_metadata.json b/osconfig/apiv1alpha/gapic_metadata.json index 68645256d0c..7a423634f9b 100644 --- a/osconfig/apiv1alpha/gapic_metadata.json +++ b/osconfig/apiv1alpha/gapic_metadata.json @@ -1,72 +1,72 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.osconfig.v1alpha", - "libraryPackage": "cloud.google.com/go/osconfig/apiv1alpha", - "services": { - "OsConfigZonalService": { - "clients": { - "grpc": { - "libraryClient": "OsConfigZonalClient", - "rpcs": { - "CreateOSPolicyAssignment": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.osconfig.v1alpha", + "libraryPackage": "cloud.google.com/go/osconfig/apiv1alpha", + "services": { + "OsConfigZonalService": { + "clients": { + "grpc": { + "libraryClient": "OsConfigZonalClient", + "rpcs": { + "CreateOSPolicyAssignment": { + "methods": [ "CreateOSPolicyAssignment" ] }, - "DeleteOSPolicyAssignment": { - "methods": [ + "DeleteOSPolicyAssignment": { + "methods": [ "DeleteOSPolicyAssignment" ] }, - "GetInstanceOSPoliciesCompliance": { - "methods": [ + "GetInstanceOSPoliciesCompliance": { + "methods": [ "GetInstanceOSPoliciesCompliance" ] }, - "GetInventory": { - "methods": [ + "GetInventory": { + "methods": [ "GetInventory" ] }, - "GetOSPolicyAssignment": { - "methods": [ + "GetOSPolicyAssignment": { + "methods": [ "GetOSPolicyAssignment" ] }, - "GetVulnerabilityReport": { - "methods": [ + "GetVulnerabilityReport": { + "methods": [ "GetVulnerabilityReport" ] }, - "ListInstanceOSPoliciesCompliances": { - "methods": [ + "ListInstanceOSPoliciesCompliances": { + "methods": [ "ListInstanceOSPoliciesCompliances" ] }, - "ListInventories": { - "methods": [ + "ListInventories": { + "methods": [ "ListInventories" ] }, - "ListOSPolicyAssignmentRevisions": { - "methods": [ + "ListOSPolicyAssignmentRevisions": { + "methods": [ "ListOSPolicyAssignmentRevisions" ] }, - "ListOSPolicyAssignments": { - "methods": [ + "ListOSPolicyAssignments": { + "methods": [ "ListOSPolicyAssignments" ] }, - "ListVulnerabilityReports": { - "methods": [ + "ListVulnerabilityReports": { + "methods": [ "ListVulnerabilityReports" ] }, - "UpdateOSPolicyAssignment": { - "methods": [ + "UpdateOSPolicyAssignment": { + "methods": [ "UpdateOSPolicyAssignment" ] } diff --git a/osconfig/apiv1alpha/os_config_zonal_client.go b/osconfig/apiv1alpha/os_config_zonal_client.go index 1d20992ee28..f97528abef3 100644 --- a/osconfig/apiv1alpha/os_config_zonal_client.go +++ b/osconfig/apiv1alpha/os_config_zonal_client.go @@ -25,7 +25,6 @@ import ( "cloud.google.com/go/longrunning" lroauto "cloud.google.com/go/longrunning/autogen" - "github.com/golang/protobuf/proto" gax "github.com/googleapis/gax-go/v2" "google.golang.org/api/iterator" "google.golang.org/api/option" @@ -36,6 +35,7 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/proto" ) var newOsConfigZonalClientHook clientHook diff --git a/osconfig/apiv1beta/doc.go b/osconfig/apiv1beta/doc.go index fc3b4047975..bd797ba1fcd 100644 --- a/osconfig/apiv1beta/doc.go +++ b/osconfig/apiv1beta/doc.go @@ -51,7 +51,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210612" +const versionClient = "20210624" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/osconfig/apiv1beta/gapic_metadata.json b/osconfig/apiv1beta/gapic_metadata.json index 08c5c3128d3..74a643af24a 100644 --- a/osconfig/apiv1beta/gapic_metadata.json +++ b/osconfig/apiv1beta/gapic_metadata.json @@ -1,87 +1,87 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.osconfig.v1beta", - "libraryPackage": "cloud.google.com/go/osconfig/apiv1beta", - "services": { - "OsConfigService": { - "clients": { - "grpc": { - "libraryClient": "Client", - "rpcs": { - "CancelPatchJob": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.osconfig.v1beta", + "libraryPackage": "cloud.google.com/go/osconfig/apiv1beta", + "services": { + "OsConfigService": { + "clients": { + "grpc": { + "libraryClient": "Client", + "rpcs": { + "CancelPatchJob": { + "methods": [ "CancelPatchJob" ] }, - "CreateGuestPolicy": { - "methods": [ + "CreateGuestPolicy": { + "methods": [ "CreateGuestPolicy" ] }, - "CreatePatchDeployment": { - "methods": [ + "CreatePatchDeployment": { + "methods": [ "CreatePatchDeployment" ] }, - "DeleteGuestPolicy": { - "methods": [ + "DeleteGuestPolicy": { + "methods": [ "DeleteGuestPolicy" ] }, - "DeletePatchDeployment": { - "methods": [ + "DeletePatchDeployment": { + "methods": [ "DeletePatchDeployment" ] }, - "ExecutePatchJob": { - "methods": [ + "ExecutePatchJob": { + "methods": [ "ExecutePatchJob" ] }, - "GetGuestPolicy": { - "methods": [ + "GetGuestPolicy": { + "methods": [ "GetGuestPolicy" ] }, - "GetPatchDeployment": { - "methods": [ + "GetPatchDeployment": { + "methods": [ "GetPatchDeployment" ] }, - "GetPatchJob": { - "methods": [ + "GetPatchJob": { + "methods": [ "GetPatchJob" ] }, - "ListGuestPolicies": { - "methods": [ + "ListGuestPolicies": { + "methods": [ "ListGuestPolicies" ] }, - "ListPatchDeployments": { - "methods": [ + "ListPatchDeployments": { + "methods": [ "ListPatchDeployments" ] }, - "ListPatchJobInstanceDetails": { - "methods": [ + "ListPatchJobInstanceDetails": { + "methods": [ "ListPatchJobInstanceDetails" ] }, - "ListPatchJobs": { - "methods": [ + "ListPatchJobs": { + "methods": [ "ListPatchJobs" ] }, - "LookupEffectiveGuestPolicy": { - "methods": [ + "LookupEffectiveGuestPolicy": { + "methods": [ "LookupEffectiveGuestPolicy" ] }, - "UpdateGuestPolicy": { - "methods": [ + "UpdateGuestPolicy": { + "methods": [ "UpdateGuestPolicy" ] } diff --git a/osconfig/apiv1beta/os_config_client.go b/osconfig/apiv1beta/os_config_client.go index ce907ff9c6b..0a727347fc2 100644 --- a/osconfig/apiv1beta/os_config_client.go +++ b/osconfig/apiv1beta/os_config_client.go @@ -23,7 +23,6 @@ import ( "net/url" "time" - "github.com/golang/protobuf/proto" gax "github.com/googleapis/gax-go/v2" "google.golang.org/api/iterator" "google.golang.org/api/option" @@ -33,6 +32,7 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/proto" ) var newClientHook clientHook diff --git a/oslogin/apiv1/doc.go b/oslogin/apiv1/doc.go index f5cdb1f29ff..d6e4f0131d3 100644 --- a/oslogin/apiv1/doc.go +++ b/oslogin/apiv1/doc.go @@ -49,7 +49,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210612" +const versionClient = "20210624" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/oslogin/apiv1/gapic_metadata.json b/oslogin/apiv1/gapic_metadata.json index 36ddc426625..20947412631 100644 --- a/oslogin/apiv1/gapic_metadata.json +++ b/oslogin/apiv1/gapic_metadata.json @@ -1,42 +1,42 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.oslogin.v1", - "libraryPackage": "cloud.google.com/go/oslogin/apiv1", - "services": { - "OsLoginService": { - "clients": { - "grpc": { - "libraryClient": "Client", - "rpcs": { - "DeletePosixAccount": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.oslogin.v1", + "libraryPackage": "cloud.google.com/go/oslogin/apiv1", + "services": { + "OsLoginService": { + "clients": { + "grpc": { + "libraryClient": "Client", + "rpcs": { + "DeletePosixAccount": { + "methods": [ "DeletePosixAccount" ] }, - "DeleteSshPublicKey": { - "methods": [ + "DeleteSshPublicKey": { + "methods": [ "DeleteSshPublicKey" ] }, - "GetLoginProfile": { - "methods": [ + "GetLoginProfile": { + "methods": [ "GetLoginProfile" ] }, - "GetSshPublicKey": { - "methods": [ + "GetSshPublicKey": { + "methods": [ "GetSshPublicKey" ] }, - "ImportSshPublicKey": { - "methods": [ + "ImportSshPublicKey": { + "methods": [ "ImportSshPublicKey" ] }, - "UpdateSshPublicKey": { - "methods": [ + "UpdateSshPublicKey": { + "methods": [ "UpdateSshPublicKey" ] } diff --git a/oslogin/apiv1beta/doc.go b/oslogin/apiv1beta/doc.go index 2f260a64f78..14268a60b9d 100644 --- a/oslogin/apiv1beta/doc.go +++ b/oslogin/apiv1beta/doc.go @@ -51,7 +51,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210612" +const versionClient = "20210624" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/oslogin/apiv1beta/gapic_metadata.json b/oslogin/apiv1beta/gapic_metadata.json index ddd46bd0590..d517bb07a29 100644 --- a/oslogin/apiv1beta/gapic_metadata.json +++ b/oslogin/apiv1beta/gapic_metadata.json @@ -1,42 +1,42 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.oslogin.v1beta", - "libraryPackage": "cloud.google.com/go/oslogin/apiv1beta", - "services": { - "OsLoginService": { - "clients": { - "grpc": { - "libraryClient": "Client", - "rpcs": { - "DeletePosixAccount": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.oslogin.v1beta", + "libraryPackage": "cloud.google.com/go/oslogin/apiv1beta", + "services": { + "OsLoginService": { + "clients": { + "grpc": { + "libraryClient": "Client", + "rpcs": { + "DeletePosixAccount": { + "methods": [ "DeletePosixAccount" ] }, - "DeleteSshPublicKey": { - "methods": [ + "DeleteSshPublicKey": { + "methods": [ "DeleteSshPublicKey" ] }, - "GetLoginProfile": { - "methods": [ + "GetLoginProfile": { + "methods": [ "GetLoginProfile" ] }, - "GetSshPublicKey": { - "methods": [ + "GetSshPublicKey": { + "methods": [ "GetSshPublicKey" ] }, - "ImportSshPublicKey": { - "methods": [ + "ImportSshPublicKey": { + "methods": [ "ImportSshPublicKey" ] }, - "UpdateSshPublicKey": { - "methods": [ + "UpdateSshPublicKey": { + "methods": [ "UpdateSshPublicKey" ] } diff --git a/phishingprotection/apiv1beta1/doc.go b/phishingprotection/apiv1beta1/doc.go index 6189411b9a4..27b119b671e 100644 --- a/phishingprotection/apiv1beta1/doc.go +++ b/phishingprotection/apiv1beta1/doc.go @@ -48,7 +48,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210612" +const versionClient = "20210624" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/phishingprotection/apiv1beta1/gapic_metadata.json b/phishingprotection/apiv1beta1/gapic_metadata.json index fafe97d9d87..aa808a1c319 100644 --- a/phishingprotection/apiv1beta1/gapic_metadata.json +++ b/phishingprotection/apiv1beta1/gapic_metadata.json @@ -1,17 +1,17 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.phishingprotection.v1beta1", - "libraryPackage": "cloud.google.com/go/phishingprotection/apiv1beta1", - "services": { - "PhishingProtectionServiceV1Beta1": { - "clients": { - "grpc": { - "libraryClient": "PhishingProtectionServiceV1Beta1Client", - "rpcs": { - "ReportPhishing": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.phishingprotection.v1beta1", + "libraryPackage": "cloud.google.com/go/phishingprotection/apiv1beta1", + "services": { + "PhishingProtectionServiceV1Beta1": { + "clients": { + "grpc": { + "libraryClient": "PhishingProtectionServiceV1Beta1Client", + "rpcs": { + "ReportPhishing": { + "methods": [ "ReportPhishing" ] } diff --git a/policytroubleshooter/apiv1/doc.go b/policytroubleshooter/apiv1/doc.go index b3646e405d8..3229d999a45 100644 --- a/policytroubleshooter/apiv1/doc.go +++ b/policytroubleshooter/apiv1/doc.go @@ -46,7 +46,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210612" +const versionClient = "20210624" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/policytroubleshooter/apiv1/gapic_metadata.json b/policytroubleshooter/apiv1/gapic_metadata.json index d2e85d11364..225f08d3e54 100644 --- a/policytroubleshooter/apiv1/gapic_metadata.json +++ b/policytroubleshooter/apiv1/gapic_metadata.json @@ -1,17 +1,17 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.policytroubleshooter.v1", - "libraryPackage": "cloud.google.com/go/policytroubleshooter/apiv1", - "services": { - "IamChecker": { - "clients": { - "grpc": { - "libraryClient": "IamCheckerClient", - "rpcs": { - "TroubleshootIamPolicy": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.policytroubleshooter.v1", + "libraryPackage": "cloud.google.com/go/policytroubleshooter/apiv1", + "services": { + "IamChecker": { + "clients": { + "grpc": { + "libraryClient": "IamCheckerClient", + "rpcs": { + "TroubleshootIamPolicy": { + "methods": [ "TroubleshootIamPolicy" ] } diff --git a/privatecatalog/apiv1beta1/doc.go b/privatecatalog/apiv1beta1/doc.go index 3297377305f..2e2ed145a4c 100644 --- a/privatecatalog/apiv1beta1/doc.go +++ b/privatecatalog/apiv1beta1/doc.go @@ -51,7 +51,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210612" +const versionClient = "20210624" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/privatecatalog/apiv1beta1/gapic_metadata.json b/privatecatalog/apiv1beta1/gapic_metadata.json index a549a3afcb2..768bec96390 100644 --- a/privatecatalog/apiv1beta1/gapic_metadata.json +++ b/privatecatalog/apiv1beta1/gapic_metadata.json @@ -1,27 +1,27 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.privatecatalog.v1beta1", - "libraryPackage": "cloud.google.com/go/privatecatalog/apiv1beta1", - "services": { - "PrivateCatalog": { - "clients": { - "grpc": { - "libraryClient": "Client", - "rpcs": { - "SearchCatalogs": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.privatecatalog.v1beta1", + "libraryPackage": "cloud.google.com/go/privatecatalog/apiv1beta1", + "services": { + "PrivateCatalog": { + "clients": { + "grpc": { + "libraryClient": "Client", + "rpcs": { + "SearchCatalogs": { + "methods": [ "SearchCatalogs" ] }, - "SearchProducts": { - "methods": [ + "SearchProducts": { + "methods": [ "SearchProducts" ] }, - "SearchVersions": { - "methods": [ + "SearchVersions": { + "methods": [ "SearchVersions" ] } diff --git a/privatecatalog/apiv1beta1/private_catalog_client.go b/privatecatalog/apiv1beta1/private_catalog_client.go index 2f848409fcb..9add8238b6f 100644 --- a/privatecatalog/apiv1beta1/private_catalog_client.go +++ b/privatecatalog/apiv1beta1/private_catalog_client.go @@ -22,7 +22,6 @@ import ( "math" "net/url" - "github.com/golang/protobuf/proto" gax "github.com/googleapis/gax-go/v2" "google.golang.org/api/iterator" "google.golang.org/api/option" @@ -31,6 +30,7 @@ import ( privatecatalogpb "google.golang.org/genproto/googleapis/cloud/privatecatalog/v1beta1" "google.golang.org/grpc" "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/proto" ) var newClientHook clientHook diff --git a/pubsub/apiv1/doc.go b/pubsub/apiv1/doc.go index 8e3353b7e64..41af5aefd0e 100644 --- a/pubsub/apiv1/doc.go +++ b/pubsub/apiv1/doc.go @@ -49,7 +49,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210612" +const versionClient = "20210624" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/pubsub/apiv1/gapic_metadata.json b/pubsub/apiv1/gapic_metadata.json index 64b2999668a..0923be3c70d 100644 --- a/pubsub/apiv1/gapic_metadata.json +++ b/pubsub/apiv1/gapic_metadata.json @@ -1,72 +1,72 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.pubsub.v1", - "libraryPackage": "cloud.google.com/go/pubsub/apiv1", - "services": { - "Publisher": { - "clients": { - "grpc": { - "libraryClient": "PublisherClient", - "rpcs": { - "CreateTopic": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.pubsub.v1", + "libraryPackage": "cloud.google.com/go/pubsub/apiv1", + "services": { + "Publisher": { + "clients": { + "grpc": { + "libraryClient": "PublisherClient", + "rpcs": { + "CreateTopic": { + "methods": [ "CreateTopic" ] }, - "DeleteTopic": { - "methods": [ + "DeleteTopic": { + "methods": [ "DeleteTopic" ] }, - "DetachSubscription": { - "methods": [ + "DetachSubscription": { + "methods": [ "DetachSubscription" ] }, - "GetIamPolicy": { - "methods": [ + "GetIamPolicy": { + "methods": [ "GetIamPolicy" ] }, - "GetTopic": { - "methods": [ + "GetTopic": { + "methods": [ "GetTopic" ] }, - "ListTopicSnapshots": { - "methods": [ + "ListTopicSnapshots": { + "methods": [ "ListTopicSnapshots" ] }, - "ListTopicSubscriptions": { - "methods": [ + "ListTopicSubscriptions": { + "methods": [ "ListTopicSubscriptions" ] }, - "ListTopics": { - "methods": [ + "ListTopics": { + "methods": [ "ListTopics" ] }, - "Publish": { - "methods": [ + "Publish": { + "methods": [ "Publish" ] }, - "SetIamPolicy": { - "methods": [ + "SetIamPolicy": { + "methods": [ "SetIamPolicy" ] }, - "TestIamPermissions": { - "methods": [ + "TestIamPermissions": { + "methods": [ "TestIamPermissions" ] }, - "UpdateTopic": { - "methods": [ + "UpdateTopic": { + "methods": [ "UpdateTopic" ] } @@ -74,53 +74,53 @@ } } }, - "SchemaService": { - "clients": { - "grpc": { - "libraryClient": "SchemaClient", - "rpcs": { - "CreateSchema": { - "methods": [ + "SchemaService": { + "clients": { + "grpc": { + "libraryClient": "SchemaClient", + "rpcs": { + "CreateSchema": { + "methods": [ "CreateSchema" ] }, - "DeleteSchema": { - "methods": [ + "DeleteSchema": { + "methods": [ "DeleteSchema" ] }, - "GetIamPolicy": { - "methods": [ + "GetIamPolicy": { + "methods": [ "GetIamPolicy" ] }, - "GetSchema": { - "methods": [ + "GetSchema": { + "methods": [ "GetSchema" ] }, - "ListSchemas": { - "methods": [ + "ListSchemas": { + "methods": [ "ListSchemas" ] }, - "SetIamPolicy": { - "methods": [ + "SetIamPolicy": { + "methods": [ "SetIamPolicy" ] }, - "TestIamPermissions": { - "methods": [ + "TestIamPermissions": { + "methods": [ "TestIamPermissions" ] }, - "ValidateMessage": { - "methods": [ + "ValidateMessage": { + "methods": [ "ValidateMessage" ] }, - "ValidateSchema": { - "methods": [ + "ValidateSchema": { + "methods": [ "ValidateSchema" ] } @@ -128,103 +128,103 @@ } } }, - "Subscriber": { - "clients": { - "grpc": { - "libraryClient": "SubscriberClient", - "rpcs": { - "Acknowledge": { - "methods": [ + "Subscriber": { + "clients": { + "grpc": { + "libraryClient": "SubscriberClient", + "rpcs": { + "Acknowledge": { + "methods": [ "Acknowledge" ] }, - "CreateSnapshot": { - "methods": [ + "CreateSnapshot": { + "methods": [ "CreateSnapshot" ] }, - "CreateSubscription": { - "methods": [ + "CreateSubscription": { + "methods": [ "CreateSubscription" ] }, - "DeleteSnapshot": { - "methods": [ + "DeleteSnapshot": { + "methods": [ "DeleteSnapshot" ] }, - "DeleteSubscription": { - "methods": [ + "DeleteSubscription": { + "methods": [ "DeleteSubscription" ] }, - "GetIamPolicy": { - "methods": [ + "GetIamPolicy": { + "methods": [ "GetIamPolicy" ] }, - "GetSnapshot": { - "methods": [ + "GetSnapshot": { + "methods": [ "GetSnapshot" ] }, - "GetSubscription": { - "methods": [ + "GetSubscription": { + "methods": [ "GetSubscription" ] }, - "ListSnapshots": { - "methods": [ + "ListSnapshots": { + "methods": [ "ListSnapshots" ] }, - "ListSubscriptions": { - "methods": [ + "ListSubscriptions": { + "methods": [ "ListSubscriptions" ] }, - "ModifyAckDeadline": { - "methods": [ + "ModifyAckDeadline": { + "methods": [ "ModifyAckDeadline" ] }, - "ModifyPushConfig": { - "methods": [ + "ModifyPushConfig": { + "methods": [ "ModifyPushConfig" ] }, - "Pull": { - "methods": [ + "Pull": { + "methods": [ "Pull" ] }, - "Seek": { - "methods": [ + "Seek": { + "methods": [ "Seek" ] }, - "SetIamPolicy": { - "methods": [ + "SetIamPolicy": { + "methods": [ "SetIamPolicy" ] }, - "StreamingPull": { - "methods": [ + "StreamingPull": { + "methods": [ "StreamingPull" ] }, - "TestIamPermissions": { - "methods": [ + "TestIamPermissions": { + "methods": [ "TestIamPermissions" ] }, - "UpdateSnapshot": { - "methods": [ + "UpdateSnapshot": { + "methods": [ "UpdateSnapshot" ] }, - "UpdateSubscription": { - "methods": [ + "UpdateSubscription": { + "methods": [ "UpdateSubscription" ] } diff --git a/pubsub/apiv1/publisher_client.go b/pubsub/apiv1/publisher_client.go index 8eb7a8cc6ce..ba42d687cbc 100644 --- a/pubsub/apiv1/publisher_client.go +++ b/pubsub/apiv1/publisher_client.go @@ -23,7 +23,6 @@ import ( "net/url" "time" - "github.com/golang/protobuf/proto" gax "github.com/googleapis/gax-go/v2" "google.golang.org/api/iterator" "google.golang.org/api/option" @@ -34,6 +33,7 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/proto" ) var newPublisherClientHook clientHook diff --git a/pubsub/apiv1/schema_client.go b/pubsub/apiv1/schema_client.go index cc77f14ff8b..a66430ec007 100644 --- a/pubsub/apiv1/schema_client.go +++ b/pubsub/apiv1/schema_client.go @@ -22,7 +22,6 @@ import ( "math" "net/url" - "github.com/golang/protobuf/proto" gax "github.com/googleapis/gax-go/v2" "google.golang.org/api/iterator" "google.golang.org/api/option" @@ -32,6 +31,7 @@ import ( pubsubpb "google.golang.org/genproto/googleapis/pubsub/v1" "google.golang.org/grpc" "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/proto" ) var newSchemaClientHook clientHook diff --git a/pubsub/apiv1/subscriber_client.go b/pubsub/apiv1/subscriber_client.go index 136462f4772..be8b9908d6c 100644 --- a/pubsub/apiv1/subscriber_client.go +++ b/pubsub/apiv1/subscriber_client.go @@ -23,7 +23,6 @@ import ( "net/url" "time" - "github.com/golang/protobuf/proto" gax "github.com/googleapis/gax-go/v2" "google.golang.org/api/iterator" "google.golang.org/api/option" @@ -34,6 +33,7 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/proto" ) var newSubscriberClientHook clientHook diff --git a/pubsub/go.mod b/pubsub/go.mod index da99e396ca0..fed0966d5a2 100644 --- a/pubsub/go.mod +++ b/pubsub/go.mod @@ -11,8 +11,8 @@ require ( golang.org/x/oauth2 v0.0.0-20210615190721-d04028783cf1 golang.org/x/sync v0.0.0-20210220032951-036812b2e83c golang.org/x/time v0.0.0-20210611083556-38a9dc6acbc6 - google.golang.org/api v0.48.0 - google.golang.org/genproto v0.0.0-20210614143202-012ab6975634 + google.golang.org/api v0.49.0 + google.golang.org/genproto v0.0.0-20210624174822-c5cf32407d0a google.golang.org/grpc v1.38.0 google.golang.org/protobuf v1.26.0 ) diff --git a/pubsub/go.sum b/pubsub/go.sum index 0d513311ab2..2082f40cf0d 100644 --- a/pubsub/go.sum +++ b/pubsub/go.sum @@ -302,8 +302,9 @@ golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210514084401-e8d321eab015/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210603125802-9665404d3644 h1:CA1DEQ4NdKphKeL70tvsWNdT5oFh1lOjihRcEDROi0I= golang.org/x/sys v0.0.0-20210603125802-9665404d3644/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210616094352-59db8d763f22 h1:RqytpXGR1iVNX7psjB3ff8y7sNFinVFvkx1c8SjBkio= +golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -396,8 +397,9 @@ google.golang.org/api v0.40.0/go.mod h1:fYKFpnQN0DsDSKRVRcQSDQNtqWPfM9i+zNPxepjR google.golang.org/api v0.41.0/go.mod h1:RkxM5lITDfTzmyKFPt+wGrCJbVfniCr2ool8kTBzRTU= google.golang.org/api v0.43.0/go.mod h1:nQsDGjRXMo4lvh5hP0TKqF244gqhGcr/YSIykhUk/94= google.golang.org/api v0.47.0/go.mod h1:Wbvgpq1HddcWVtzsVLyfLp8lDg6AA241LmgIL59tHXo= -google.golang.org/api v0.48.0 h1:RDAPWfNFY06dffEXfn7hZF5Fr1ZbnChzfQZAPyBd1+I= google.golang.org/api v0.48.0/go.mod h1:71Pr1vy+TAZRPkPs/xlCf5SsU8WjuAWv1Pfjbtukyy4= +google.golang.org/api v0.49.0 h1:gjIBDxlTG7vnzMmEnYwTnvLTF8Rjzo+ETCgEX1YZ/fY= +google.golang.org/api v0.49.0/go.mod h1:BECiH72wsfwUvOVn3+btPD5WHi0LzavZReBndi42L18= 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.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= @@ -449,8 +451,9 @@ google.golang.org/genproto v0.0.0-20210513213006-bf773b8c8384/go.mod h1:P3QM42oQ google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= google.golang.org/genproto v0.0.0-20210604141403-392c879c8b08/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= google.golang.org/genproto v0.0.0-20210608205507-b6d2f5bf0d7d/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= -google.golang.org/genproto v0.0.0-20210614143202-012ab6975634 h1:LnkHrvncK4mYysgs+R1wPeMAILrmunf0Tzl0Li71pxo= -google.golang.org/genproto v0.0.0-20210614143202-012ab6975634/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24= +google.golang.org/genproto v0.0.0-20210617175327-b9e0b3197ced/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24= +google.golang.org/genproto v0.0.0-20210624174822-c5cf32407d0a h1:b5Bhxmy6Tppar7Yl4J6c6xF33YSBhkm2FtV9/ZQuBkQ= +google.golang.org/genproto v0.0.0-20210624174822-c5cf32407d0a/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= diff --git a/pubsublite/apiv1/admin_client.go b/pubsublite/apiv1/admin_client.go index 81339cdfd02..29181291c39 100644 --- a/pubsublite/apiv1/admin_client.go +++ b/pubsublite/apiv1/admin_client.go @@ -23,16 +23,19 @@ import ( "net/url" "time" - "github.com/golang/protobuf/proto" + "cloud.google.com/go/longrunning" + lroauto "cloud.google.com/go/longrunning/autogen" gax "github.com/googleapis/gax-go/v2" "google.golang.org/api/iterator" "google.golang.org/api/option" "google.golang.org/api/option/internaloption" gtransport "google.golang.org/api/transport/grpc" pubsublitepb "google.golang.org/genproto/googleapis/cloud/pubsublite/v1" + longrunningpb "google.golang.org/genproto/googleapis/longrunning" "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/proto" ) var newAdminClientHook clientHook @@ -51,6 +54,7 @@ type AdminCallOptions struct { ListSubscriptions []gax.CallOption UpdateSubscription []gax.CallOption DeleteSubscription []gax.CallOption + SeekSubscription []gax.CallOption CreateReservation []gax.CallOption GetReservation []gax.CallOption ListReservations []gax.CallOption @@ -253,6 +257,21 @@ func defaultAdminCallOptions() *AdminCallOptions { }) }), }, + SeekSubscription: []gax.CallOption{ + gax.WithRetry(func() gax.Retryer { + return gax.OnCodes([]codes.Code{ + codes.DeadlineExceeded, + codes.Unavailable, + codes.Aborted, + codes.Internal, + codes.Unknown, + }, gax.Backoff{ + Initial: 100 * time.Millisecond, + Max: 60000 * time.Millisecond, + Multiplier: 1.30, + }) + }), + }, CreateReservation: []gax.CallOption{ gax.WithRetry(func() gax.Retryer { return gax.OnCodes([]codes.Code{ @@ -363,6 +382,8 @@ type internalAdminClient interface { ListSubscriptions(context.Context, *pubsublitepb.ListSubscriptionsRequest, ...gax.CallOption) *SubscriptionIterator UpdateSubscription(context.Context, *pubsublitepb.UpdateSubscriptionRequest, ...gax.CallOption) (*pubsublitepb.Subscription, error) DeleteSubscription(context.Context, *pubsublitepb.DeleteSubscriptionRequest, ...gax.CallOption) error + SeekSubscription(context.Context, *pubsublitepb.SeekSubscriptionRequest, ...gax.CallOption) (*SeekSubscriptionOperation, error) + SeekSubscriptionOperation(name string) *SeekSubscriptionOperation CreateReservation(context.Context, *pubsublitepb.CreateReservationRequest, ...gax.CallOption) (*pubsublitepb.Reservation, error) GetReservation(context.Context, *pubsublitepb.GetReservationRequest, ...gax.CallOption) (*pubsublitepb.Reservation, error) ListReservations(context.Context, *pubsublitepb.ListReservationsRequest, ...gax.CallOption) *ReservationIterator @@ -382,6 +403,11 @@ type AdminClient struct { // The call options for this service. CallOptions *AdminCallOptions + + // LROClient is used internally to handle long-running operations. + // It is exposed so that its CallOptions can be modified if required. + // Users should not Close this client. + LROClient *lroauto.OperationsClient } // Wrapper methods routed to the internal client. @@ -466,6 +492,37 @@ func (c *AdminClient) DeleteSubscription(ctx context.Context, req *pubsublitepb. return c.internalClient.DeleteSubscription(ctx, req, opts...) } +// SeekSubscription performs an out-of-band seek for a subscription to a specified target, +// which may be timestamps or named positions within the message backlog. +// Seek translates these targets to cursors for each partition and +// orchestrates subscribers to start consuming messages from these seek +// cursors. +// +// If an operation is returned, the seek has been registered and subscribers +// will eventually receive messages from the seek cursors (i.e. eventual +// consistency), as long as they are using a minimum supported client library +// version and not a system that tracks cursors independently of Pub/Sub Lite +// (e.g. Apache Beam, Dataflow, Spark). The seek operation will fail for +// unsupported clients. +// +// If clients would like to know when subscribers react to the seek (or not), +// they can poll the operation. The seek operation will succeed and complete +// once subscribers are ready to receive messages from the seek cursors for +// all partitions of the topic. This means that the seek operation will not +// complete until all subscribers come online. +// +// If the previous seek operation has not yet completed, it will be aborted +// and the new invocation of seek will supersede it. +func (c *AdminClient) SeekSubscription(ctx context.Context, req *pubsublitepb.SeekSubscriptionRequest, opts ...gax.CallOption) (*SeekSubscriptionOperation, error) { + return c.internalClient.SeekSubscription(ctx, req, opts...) +} + +// SeekSubscriptionOperation returns a new SeekSubscriptionOperation from a given name. +// The name must be that of a previously created SeekSubscriptionOperation, possibly from a different process. +func (c *AdminClient) SeekSubscriptionOperation(name string) *SeekSubscriptionOperation { + return c.internalClient.SeekSubscriptionOperation(name) +} + // CreateReservation creates a new reservation. func (c *AdminClient) CreateReservation(ctx context.Context, req *pubsublitepb.CreateReservationRequest, opts ...gax.CallOption) (*pubsublitepb.Reservation, error) { return c.internalClient.CreateReservation(ctx, req, opts...) @@ -512,6 +569,11 @@ type adminGRPCClient struct { // The gRPC API client. adminClient pubsublitepb.AdminServiceClient + // LROClient is used internally to handle long-running operations. + // It is exposed so that its CallOptions can be modified if required. + // Users should not Close this client. + LROClient **lroauto.OperationsClient + // The x-goog-* metadata to be sent with each request. xGoogMetadata metadata.MD } @@ -552,6 +614,17 @@ func NewAdminClient(ctx context.Context, opts ...option.ClientOption) (*AdminCli client.internalClient = c + client.LROClient, err = lroauto.NewOperationsClient(ctx, gtransport.WithConnPool(connPool)) + if err != nil { + // This error "should not happen", since we are just reusing old connection pool + // and never actually need to dial. + // If this does happen, we could leak connp. However, we cannot close conn: + // If the user invoked the constructor with option.WithGRPCConn, + // we would close a connection that's still in use. + // TODO: investigate error conditions. + return nil, err + } + c.LROClient = &client.LROClient return &client, nil } @@ -878,6 +951,29 @@ func (c *adminGRPCClient) DeleteSubscription(ctx context.Context, req *pubsublit return err } +func (c *adminGRPCClient) SeekSubscription(ctx context.Context, req *pubsublitepb.SeekSubscriptionRequest, opts ...gax.CallOption) (*SeekSubscriptionOperation, error) { + if _, ok := ctx.Deadline(); !ok && !c.disableDeadlines { + cctx, cancel := context.WithTimeout(ctx, 600000*time.Millisecond) + defer cancel() + ctx = cctx + } + md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))) + ctx = insertMetadata(ctx, c.xGoogMetadata, md) + opts = append((*c.CallOptions).SeekSubscription[0:len((*c.CallOptions).SeekSubscription):len((*c.CallOptions).SeekSubscription)], opts...) + var resp *longrunningpb.Operation + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + resp, err = c.adminClient.SeekSubscription(ctx, req, settings.GRPC...) + return err + }, opts...) + if err != nil { + return nil, err + } + return &SeekSubscriptionOperation{ + lro: longrunning.InternalNewOperation(*c.LROClient, resp), + }, nil +} + func (c *adminGRPCClient) CreateReservation(ctx context.Context, req *pubsublitepb.CreateReservationRequest, opts ...gax.CallOption) (*pubsublitepb.Reservation, error) { if _, ok := ctx.Deadline(); !ok && !c.disableDeadlines { cctx, cancel := context.WithTimeout(ctx, 600000*time.Millisecond) @@ -1038,6 +1134,75 @@ func (c *adminGRPCClient) ListReservationTopics(ctx context.Context, req *pubsub return it } +// SeekSubscriptionOperation manages a long-running operation from SeekSubscription. +type SeekSubscriptionOperation struct { + lro *longrunning.Operation +} + +// SeekSubscriptionOperation returns a new SeekSubscriptionOperation from a given name. +// The name must be that of a previously created SeekSubscriptionOperation, possibly from a different process. +func (c *adminGRPCClient) SeekSubscriptionOperation(name string) *SeekSubscriptionOperation { + return &SeekSubscriptionOperation{ + lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}), + } +} + +// Wait blocks until the long-running operation is completed, returning the response and any errors encountered. +// +// See documentation of Poll for error-handling information. +func (op *SeekSubscriptionOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*pubsublitepb.SeekSubscriptionResponse, error) { + var resp pubsublitepb.SeekSubscriptionResponse + if err := op.lro.WaitWithInterval(ctx, &resp, time.Minute, opts...); err != nil { + return nil, err + } + return &resp, nil +} + +// Poll fetches the latest state of the long-running operation. +// +// Poll also fetches the latest metadata, which can be retrieved by Metadata. +// +// If Poll fails, the error is returned and op is unmodified. If Poll succeeds and +// the operation has completed with failure, the error is returned and op.Done will return true. +// If Poll succeeds and the operation has completed successfully, +// op.Done will return true, and the response of the operation is returned. +// If Poll succeeds and the operation has not completed, the returned response and error are both nil. +func (op *SeekSubscriptionOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*pubsublitepb.SeekSubscriptionResponse, error) { + var resp pubsublitepb.SeekSubscriptionResponse + if err := op.lro.Poll(ctx, &resp, opts...); err != nil { + return nil, err + } + if !op.Done() { + return nil, nil + } + return &resp, nil +} + +// Metadata returns metadata associated with the long-running operation. +// Metadata itself does not contact the server, but Poll does. +// To get the latest metadata, call this method after a successful call to Poll. +// If the metadata is not available, the returned metadata and error are both nil. +func (op *SeekSubscriptionOperation) Metadata() (*pubsublitepb.OperationMetadata, error) { + var meta pubsublitepb.OperationMetadata + if err := op.lro.Metadata(&meta); err == longrunning.ErrNoMetadata { + return nil, nil + } else if err != nil { + return nil, err + } + return &meta, nil +} + +// Done reports whether the long-running operation has completed. +func (op *SeekSubscriptionOperation) Done() bool { + return op.lro.Done() +} + +// Name returns the name of the long-running operation. +// The name is assigned by the server and is unique within the service from which the operation is created. +func (op *SeekSubscriptionOperation) Name() string { + return op.lro.Name() +} + // ReservationIterator manages a stream of *pubsublitepb.Reservation. type ReservationIterator struct { items []*pubsublitepb.Reservation diff --git a/pubsublite/apiv1/admin_client_example_test.go b/pubsublite/apiv1/admin_client_example_test.go index dcec2c2a66f..f7eaf6d7260 100644 --- a/pubsublite/apiv1/admin_client_example_test.go +++ b/pubsublite/apiv1/admin_client_example_test.go @@ -278,6 +278,30 @@ func ExampleAdminClient_DeleteSubscription() { } } +func ExampleAdminClient_SeekSubscription() { + ctx := context.Background() + c, err := pubsublite.NewAdminClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &pubsublitepb.SeekSubscriptionRequest{ + // TODO: Fill request struct fields. + } + op, err := c.SeekSubscription(ctx, req) + if err != nil { + // TODO: Handle error. + } + + resp, err := op.Wait(ctx) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + func ExampleAdminClient_CreateReservation() { ctx := context.Background() c, err := pubsublite.NewAdminClient(ctx) diff --git a/pubsublite/apiv1/cursor_client.go b/pubsublite/apiv1/cursor_client.go index 298dc93b2d9..aa07a7acc1c 100644 --- a/pubsublite/apiv1/cursor_client.go +++ b/pubsublite/apiv1/cursor_client.go @@ -23,7 +23,6 @@ import ( "net/url" "time" - "github.com/golang/protobuf/proto" gax "github.com/googleapis/gax-go/v2" "google.golang.org/api/iterator" "google.golang.org/api/option" @@ -33,6 +32,7 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/proto" ) var newCursorClientHook clientHook diff --git a/pubsublite/apiv1/doc.go b/pubsublite/apiv1/doc.go index a90a5562647..8e6770380b5 100644 --- a/pubsublite/apiv1/doc.go +++ b/pubsublite/apiv1/doc.go @@ -48,7 +48,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210612" +const versionClient = "20210624" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/pubsublite/apiv1/gapic_metadata.json b/pubsublite/apiv1/gapic_metadata.json index 3c04ceb94cf..1714ec611fa 100644 --- a/pubsublite/apiv1/gapic_metadata.json +++ b/pubsublite/apiv1/gapic_metadata.json @@ -1,102 +1,107 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.pubsublite.v1", - "libraryPackage": "cloud.google.com/go/pubsublite/apiv1", - "services": { - "AdminService": { - "clients": { - "grpc": { - "libraryClient": "AdminClient", - "rpcs": { - "CreateReservation": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.pubsublite.v1", + "libraryPackage": "cloud.google.com/go/pubsublite/apiv1", + "services": { + "AdminService": { + "clients": { + "grpc": { + "libraryClient": "AdminClient", + "rpcs": { + "CreateReservation": { + "methods": [ "CreateReservation" ] }, - "CreateSubscription": { - "methods": [ + "CreateSubscription": { + "methods": [ "CreateSubscription" ] }, - "CreateTopic": { - "methods": [ + "CreateTopic": { + "methods": [ "CreateTopic" ] }, - "DeleteReservation": { - "methods": [ + "DeleteReservation": { + "methods": [ "DeleteReservation" ] }, - "DeleteSubscription": { - "methods": [ + "DeleteSubscription": { + "methods": [ "DeleteSubscription" ] }, - "DeleteTopic": { - "methods": [ + "DeleteTopic": { + "methods": [ "DeleteTopic" ] }, - "GetReservation": { - "methods": [ + "GetReservation": { + "methods": [ "GetReservation" ] }, - "GetSubscription": { - "methods": [ + "GetSubscription": { + "methods": [ "GetSubscription" ] }, - "GetTopic": { - "methods": [ + "GetTopic": { + "methods": [ "GetTopic" ] }, - "GetTopicPartitions": { - "methods": [ + "GetTopicPartitions": { + "methods": [ "GetTopicPartitions" ] }, - "ListReservationTopics": { - "methods": [ + "ListReservationTopics": { + "methods": [ "ListReservationTopics" ] }, - "ListReservations": { - "methods": [ + "ListReservations": { + "methods": [ "ListReservations" ] }, - "ListSubscriptions": { - "methods": [ + "ListSubscriptions": { + "methods": [ "ListSubscriptions" ] }, - "ListTopicSubscriptions": { - "methods": [ + "ListTopicSubscriptions": { + "methods": [ "ListTopicSubscriptions" ] }, - "ListTopics": { - "methods": [ + "ListTopics": { + "methods": [ "ListTopics" ] }, - "UpdateReservation": { - "methods": [ + "SeekSubscription": { + "methods": [ + "SeekSubscription" + ] + }, + "UpdateReservation": { + "methods": [ "UpdateReservation" ] }, - "UpdateSubscription": { - "methods": [ + "UpdateSubscription": { + "methods": [ "UpdateSubscription" ] }, - "UpdateTopic": { - "methods": [ + "UpdateTopic": { + "methods": [ "UpdateTopic" ] } @@ -104,23 +109,23 @@ } } }, - "CursorService": { - "clients": { - "grpc": { - "libraryClient": "CursorClient", - "rpcs": { - "CommitCursor": { - "methods": [ + "CursorService": { + "clients": { + "grpc": { + "libraryClient": "CursorClient", + "rpcs": { + "CommitCursor": { + "methods": [ "CommitCursor" ] }, - "ListPartitionCursors": { - "methods": [ + "ListPartitionCursors": { + "methods": [ "ListPartitionCursors" ] }, - "StreamingCommitCursor": { - "methods": [ + "StreamingCommitCursor": { + "methods": [ "StreamingCommitCursor" ] } @@ -128,13 +133,13 @@ } } }, - "PartitionAssignmentService": { - "clients": { - "grpc": { - "libraryClient": "PartitionAssignmentClient", - "rpcs": { - "AssignPartitions": { - "methods": [ + "PartitionAssignmentService": { + "clients": { + "grpc": { + "libraryClient": "PartitionAssignmentClient", + "rpcs": { + "AssignPartitions": { + "methods": [ "AssignPartitions" ] } @@ -142,13 +147,13 @@ } } }, - "PublisherService": { - "clients": { - "grpc": { - "libraryClient": "PublisherClient", - "rpcs": { - "Publish": { - "methods": [ + "PublisherService": { + "clients": { + "grpc": { + "libraryClient": "PublisherClient", + "rpcs": { + "Publish": { + "methods": [ "Publish" ] } @@ -156,13 +161,13 @@ } } }, - "SubscriberService": { - "clients": { - "grpc": { - "libraryClient": "SubscriberClient", - "rpcs": { - "Subscribe": { - "methods": [ + "SubscriberService": { + "clients": { + "grpc": { + "libraryClient": "SubscriberClient", + "rpcs": { + "Subscribe": { + "methods": [ "Subscribe" ] } @@ -170,23 +175,23 @@ } } }, - "TopicStatsService": { - "clients": { - "grpc": { - "libraryClient": "TopicStatsClient", - "rpcs": { - "ComputeHeadCursor": { - "methods": [ + "TopicStatsService": { + "clients": { + "grpc": { + "libraryClient": "TopicStatsClient", + "rpcs": { + "ComputeHeadCursor": { + "methods": [ "ComputeHeadCursor" ] }, - "ComputeMessageStats": { - "methods": [ + "ComputeMessageStats": { + "methods": [ "ComputeMessageStats" ] }, - "ComputeTimeCursor": { - "methods": [ + "ComputeTimeCursor": { + "methods": [ "ComputeTimeCursor" ] } diff --git a/pubsublite/go.mod b/pubsublite/go.mod index 17ec3b3de9f..6c9994d26de 100644 --- a/pubsublite/go.mod +++ b/pubsublite/go.mod @@ -11,8 +11,8 @@ require ( github.com/googleapis/gax-go/v2 v2.0.5 golang.org/x/sync v0.0.0-20210220032951-036812b2e83c golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 - google.golang.org/api v0.48.0 - google.golang.org/genproto v0.0.0-20210614143202-012ab6975634 + google.golang.org/api v0.49.0 + google.golang.org/genproto v0.0.0-20210624174822-c5cf32407d0a google.golang.org/grpc v1.38.0 google.golang.org/protobuf v1.26.0 ) diff --git a/pubsublite/go.sum b/pubsublite/go.sum index d67a6aa2b3a..4042ac5faf2 100644 --- a/pubsublite/go.sum +++ b/pubsublite/go.sum @@ -254,8 +254,9 @@ golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5/go.mod h1:KelEdhl1UZF7XfJ golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210220000619-9bb904979d93/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210313182246-cd4f82c27b84/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c h1:pkQiBZBvdos9qq4wBAHqlzuZHEXo07pqV06ef90u1WI= golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210615190721-d04028783cf1 h1:x622Z2o4hgCr/4CiKWc51jHVKaWdtVpBNmEI8wI9Qns= +golang.org/x/oauth2 v0.0.0-20210615190721-d04028783cf1/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -307,8 +308,9 @@ golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210514084401-e8d321eab015/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210603125802-9665404d3644 h1:CA1DEQ4NdKphKeL70tvsWNdT5oFh1lOjihRcEDROi0I= golang.org/x/sys v0.0.0-20210603125802-9665404d3644/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210616094352-59db8d763f22 h1:RqytpXGR1iVNX7psjB3ff8y7sNFinVFvkx1c8SjBkio= +golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -401,8 +403,9 @@ google.golang.org/api v0.40.0/go.mod h1:fYKFpnQN0DsDSKRVRcQSDQNtqWPfM9i+zNPxepjR google.golang.org/api v0.41.0/go.mod h1:RkxM5lITDfTzmyKFPt+wGrCJbVfniCr2ool8kTBzRTU= google.golang.org/api v0.43.0/go.mod h1:nQsDGjRXMo4lvh5hP0TKqF244gqhGcr/YSIykhUk/94= google.golang.org/api v0.47.0/go.mod h1:Wbvgpq1HddcWVtzsVLyfLp8lDg6AA241LmgIL59tHXo= -google.golang.org/api v0.48.0 h1:RDAPWfNFY06dffEXfn7hZF5Fr1ZbnChzfQZAPyBd1+I= google.golang.org/api v0.48.0/go.mod h1:71Pr1vy+TAZRPkPs/xlCf5SsU8WjuAWv1Pfjbtukyy4= +google.golang.org/api v0.49.0 h1:gjIBDxlTG7vnzMmEnYwTnvLTF8Rjzo+ETCgEX1YZ/fY= +google.golang.org/api v0.49.0/go.mod h1:BECiH72wsfwUvOVn3+btPD5WHi0LzavZReBndi42L18= 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.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= @@ -456,8 +459,9 @@ google.golang.org/genproto v0.0.0-20210513213006-bf773b8c8384/go.mod h1:P3QM42oQ google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= google.golang.org/genproto v0.0.0-20210604141403-392c879c8b08/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= google.golang.org/genproto v0.0.0-20210608205507-b6d2f5bf0d7d/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= -google.golang.org/genproto v0.0.0-20210614143202-012ab6975634 h1:LnkHrvncK4mYysgs+R1wPeMAILrmunf0Tzl0Li71pxo= -google.golang.org/genproto v0.0.0-20210614143202-012ab6975634/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24= +google.golang.org/genproto v0.0.0-20210617175327-b9e0b3197ced/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24= +google.golang.org/genproto v0.0.0-20210624174822-c5cf32407d0a h1:b5Bhxmy6Tppar7Yl4J6c6xF33YSBhkm2FtV9/ZQuBkQ= +google.golang.org/genproto v0.0.0-20210624174822-c5cf32407d0a/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= diff --git a/recaptchaenterprise/apiv1/doc.go b/recaptchaenterprise/apiv1/doc.go index ffca0f14bbc..90d720ca3e5 100644 --- a/recaptchaenterprise/apiv1/doc.go +++ b/recaptchaenterprise/apiv1/doc.go @@ -46,7 +46,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210612" +const versionClient = "20210624" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/recaptchaenterprise/apiv1/gapic_metadata.json b/recaptchaenterprise/apiv1/gapic_metadata.json index 3b6837f105d..0db6a363aa7 100644 --- a/recaptchaenterprise/apiv1/gapic_metadata.json +++ b/recaptchaenterprise/apiv1/gapic_metadata.json @@ -1,47 +1,47 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.recaptchaenterprise.v1", - "libraryPackage": "cloud.google.com/go/recaptchaenterprise/apiv1", - "services": { - "RecaptchaEnterpriseService": { - "clients": { - "grpc": { - "libraryClient": "Client", - "rpcs": { - "AnnotateAssessment": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.recaptchaenterprise.v1", + "libraryPackage": "cloud.google.com/go/recaptchaenterprise/apiv1", + "services": { + "RecaptchaEnterpriseService": { + "clients": { + "grpc": { + "libraryClient": "Client", + "rpcs": { + "AnnotateAssessment": { + "methods": [ "AnnotateAssessment" ] }, - "CreateAssessment": { - "methods": [ + "CreateAssessment": { + "methods": [ "CreateAssessment" ] }, - "CreateKey": { - "methods": [ + "CreateKey": { + "methods": [ "CreateKey" ] }, - "DeleteKey": { - "methods": [ + "DeleteKey": { + "methods": [ "DeleteKey" ] }, - "GetKey": { - "methods": [ + "GetKey": { + "methods": [ "GetKey" ] }, - "ListKeys": { - "methods": [ + "ListKeys": { + "methods": [ "ListKeys" ] }, - "UpdateKey": { - "methods": [ + "UpdateKey": { + "methods": [ "UpdateKey" ] } diff --git a/recaptchaenterprise/apiv1/recaptcha_enterprise_client.go b/recaptchaenterprise/apiv1/recaptcha_enterprise_client.go index a844c4d0222..e656ee2a42a 100644 --- a/recaptchaenterprise/apiv1/recaptcha_enterprise_client.go +++ b/recaptchaenterprise/apiv1/recaptcha_enterprise_client.go @@ -23,7 +23,6 @@ import ( "net/url" "time" - "github.com/golang/protobuf/proto" gax "github.com/googleapis/gax-go/v2" "google.golang.org/api/iterator" "google.golang.org/api/option" @@ -32,6 +31,7 @@ import ( recaptchaenterprisepb "google.golang.org/genproto/googleapis/cloud/recaptchaenterprise/v1" "google.golang.org/grpc" "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/proto" ) var newClientHook clientHook diff --git a/recaptchaenterprise/apiv1beta1/doc.go b/recaptchaenterprise/apiv1beta1/doc.go index c99a071410e..80cb5e44213 100644 --- a/recaptchaenterprise/apiv1beta1/doc.go +++ b/recaptchaenterprise/apiv1beta1/doc.go @@ -48,7 +48,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210612" +const versionClient = "20210624" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/recaptchaenterprise/apiv1beta1/gapic_metadata.json b/recaptchaenterprise/apiv1beta1/gapic_metadata.json index 18538c3a3a1..65354db9612 100644 --- a/recaptchaenterprise/apiv1beta1/gapic_metadata.json +++ b/recaptchaenterprise/apiv1beta1/gapic_metadata.json @@ -1,47 +1,47 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.recaptchaenterprise.v1beta1", - "libraryPackage": "cloud.google.com/go/recaptchaenterprise/apiv1beta1", - "services": { - "RecaptchaEnterpriseServiceV1Beta1": { - "clients": { - "grpc": { - "libraryClient": "RecaptchaEnterpriseServiceV1Beta1Client", - "rpcs": { - "AnnotateAssessment": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.recaptchaenterprise.v1beta1", + "libraryPackage": "cloud.google.com/go/recaptchaenterprise/apiv1beta1", + "services": { + "RecaptchaEnterpriseServiceV1Beta1": { + "clients": { + "grpc": { + "libraryClient": "RecaptchaEnterpriseServiceV1Beta1Client", + "rpcs": { + "AnnotateAssessment": { + "methods": [ "AnnotateAssessment" ] }, - "CreateAssessment": { - "methods": [ + "CreateAssessment": { + "methods": [ "CreateAssessment" ] }, - "CreateKey": { - "methods": [ + "CreateKey": { + "methods": [ "CreateKey" ] }, - "DeleteKey": { - "methods": [ + "DeleteKey": { + "methods": [ "DeleteKey" ] }, - "GetKey": { - "methods": [ + "GetKey": { + "methods": [ "GetKey" ] }, - "ListKeys": { - "methods": [ + "ListKeys": { + "methods": [ "ListKeys" ] }, - "UpdateKey": { - "methods": [ + "UpdateKey": { + "methods": [ "UpdateKey" ] } diff --git a/recaptchaenterprise/apiv1beta1/recaptcha_enterprise_service_v1_beta1_client.go b/recaptchaenterprise/apiv1beta1/recaptcha_enterprise_service_v1_beta1_client.go index 8bb1bbb5dd1..3a154403baa 100644 --- a/recaptchaenterprise/apiv1beta1/recaptcha_enterprise_service_v1_beta1_client.go +++ b/recaptchaenterprise/apiv1beta1/recaptcha_enterprise_service_v1_beta1_client.go @@ -23,7 +23,6 @@ import ( "net/url" "time" - "github.com/golang/protobuf/proto" gax "github.com/googleapis/gax-go/v2" "google.golang.org/api/iterator" "google.golang.org/api/option" @@ -32,6 +31,7 @@ import ( recaptchaenterprisepb "google.golang.org/genproto/googleapis/cloud/recaptchaenterprise/v1beta1" "google.golang.org/grpc" "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/proto" ) var newRecaptchaEnterpriseServiceV1Beta1ClientHook clientHook diff --git a/recommender/apiv1/doc.go b/recommender/apiv1/doc.go index 25a08ec3868..34cb493ec7a 100644 --- a/recommender/apiv1/doc.go +++ b/recommender/apiv1/doc.go @@ -46,7 +46,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210612" +const versionClient = "20210624" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/recommender/apiv1/gapic_metadata.json b/recommender/apiv1/gapic_metadata.json index 2a268577a48..3f5463513fa 100644 --- a/recommender/apiv1/gapic_metadata.json +++ b/recommender/apiv1/gapic_metadata.json @@ -1,52 +1,52 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.recommender.v1", - "libraryPackage": "cloud.google.com/go/recommender/apiv1", - "services": { - "Recommender": { - "clients": { - "grpc": { - "libraryClient": "Client", - "rpcs": { - "GetInsight": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.recommender.v1", + "libraryPackage": "cloud.google.com/go/recommender/apiv1", + "services": { + "Recommender": { + "clients": { + "grpc": { + "libraryClient": "Client", + "rpcs": { + "GetInsight": { + "methods": [ "GetInsight" ] }, - "GetRecommendation": { - "methods": [ + "GetRecommendation": { + "methods": [ "GetRecommendation" ] }, - "ListInsights": { - "methods": [ + "ListInsights": { + "methods": [ "ListInsights" ] }, - "ListRecommendations": { - "methods": [ + "ListRecommendations": { + "methods": [ "ListRecommendations" ] }, - "MarkInsightAccepted": { - "methods": [ + "MarkInsightAccepted": { + "methods": [ "MarkInsightAccepted" ] }, - "MarkRecommendationClaimed": { - "methods": [ + "MarkRecommendationClaimed": { + "methods": [ "MarkRecommendationClaimed" ] }, - "MarkRecommendationFailed": { - "methods": [ + "MarkRecommendationFailed": { + "methods": [ "MarkRecommendationFailed" ] }, - "MarkRecommendationSucceeded": { - "methods": [ + "MarkRecommendationSucceeded": { + "methods": [ "MarkRecommendationSucceeded" ] } diff --git a/recommender/apiv1/recommender_client.go b/recommender/apiv1/recommender_client.go index 09fb9364b26..a6e5b228fa6 100644 --- a/recommender/apiv1/recommender_client.go +++ b/recommender/apiv1/recommender_client.go @@ -23,7 +23,6 @@ import ( "net/url" "time" - "github.com/golang/protobuf/proto" gax "github.com/googleapis/gax-go/v2" "google.golang.org/api/iterator" "google.golang.org/api/option" @@ -33,6 +32,7 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/proto" ) var newClientHook clientHook diff --git a/recommender/apiv1beta1/doc.go b/recommender/apiv1beta1/doc.go index 33bb57b4643..1df94bcdc52 100644 --- a/recommender/apiv1beta1/doc.go +++ b/recommender/apiv1beta1/doc.go @@ -48,7 +48,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210612" +const versionClient = "20210624" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/recommender/apiv1beta1/gapic_metadata.json b/recommender/apiv1beta1/gapic_metadata.json index 23bf63068e4..b5feebfdba3 100644 --- a/recommender/apiv1beta1/gapic_metadata.json +++ b/recommender/apiv1beta1/gapic_metadata.json @@ -1,52 +1,52 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.recommender.v1beta1", - "libraryPackage": "cloud.google.com/go/recommender/apiv1beta1", - "services": { - "Recommender": { - "clients": { - "grpc": { - "libraryClient": "Client", - "rpcs": { - "GetInsight": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.recommender.v1beta1", + "libraryPackage": "cloud.google.com/go/recommender/apiv1beta1", + "services": { + "Recommender": { + "clients": { + "grpc": { + "libraryClient": "Client", + "rpcs": { + "GetInsight": { + "methods": [ "GetInsight" ] }, - "GetRecommendation": { - "methods": [ + "GetRecommendation": { + "methods": [ "GetRecommendation" ] }, - "ListInsights": { - "methods": [ + "ListInsights": { + "methods": [ "ListInsights" ] }, - "ListRecommendations": { - "methods": [ + "ListRecommendations": { + "methods": [ "ListRecommendations" ] }, - "MarkInsightAccepted": { - "methods": [ + "MarkInsightAccepted": { + "methods": [ "MarkInsightAccepted" ] }, - "MarkRecommendationClaimed": { - "methods": [ + "MarkRecommendationClaimed": { + "methods": [ "MarkRecommendationClaimed" ] }, - "MarkRecommendationFailed": { - "methods": [ + "MarkRecommendationFailed": { + "methods": [ "MarkRecommendationFailed" ] }, - "MarkRecommendationSucceeded": { - "methods": [ + "MarkRecommendationSucceeded": { + "methods": [ "MarkRecommendationSucceeded" ] } diff --git a/recommender/apiv1beta1/recommender_client.go b/recommender/apiv1beta1/recommender_client.go index fb5414e9b8d..66b3632c9a2 100644 --- a/recommender/apiv1beta1/recommender_client.go +++ b/recommender/apiv1beta1/recommender_client.go @@ -23,7 +23,6 @@ import ( "net/url" "time" - "github.com/golang/protobuf/proto" gax "github.com/googleapis/gax-go/v2" "google.golang.org/api/iterator" "google.golang.org/api/option" @@ -33,6 +32,7 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/proto" ) var newClientHook clientHook diff --git a/redis/apiv1/cloud_redis_client.go b/redis/apiv1/cloud_redis_client.go index 9512205699c..e5bd71f8298 100644 --- a/redis/apiv1/cloud_redis_client.go +++ b/redis/apiv1/cloud_redis_client.go @@ -25,7 +25,6 @@ import ( "cloud.google.com/go/longrunning" lroauto "cloud.google.com/go/longrunning/autogen" - "github.com/golang/protobuf/proto" gax "github.com/googleapis/gax-go/v2" "google.golang.org/api/iterator" "google.golang.org/api/option" @@ -35,6 +34,7 @@ import ( longrunningpb "google.golang.org/genproto/googleapis/longrunning" "google.golang.org/grpc" "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/proto" ) var newCloudRedisClientHook clientHook diff --git a/redis/apiv1/doc.go b/redis/apiv1/doc.go index 6c063479359..40be1df0d29 100644 --- a/redis/apiv1/doc.go +++ b/redis/apiv1/doc.go @@ -48,7 +48,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210612" +const versionClient = "20210624" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/redis/apiv1/gapic_metadata.json b/redis/apiv1/gapic_metadata.json index 3898343a3c4..b50e74d5d19 100644 --- a/redis/apiv1/gapic_metadata.json +++ b/redis/apiv1/gapic_metadata.json @@ -1,57 +1,57 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.redis.v1", - "libraryPackage": "cloud.google.com/go/redis/apiv1", - "services": { - "CloudRedis": { - "clients": { - "grpc": { - "libraryClient": "CloudRedisClient", - "rpcs": { - "CreateInstance": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.redis.v1", + "libraryPackage": "cloud.google.com/go/redis/apiv1", + "services": { + "CloudRedis": { + "clients": { + "grpc": { + "libraryClient": "CloudRedisClient", + "rpcs": { + "CreateInstance": { + "methods": [ "CreateInstance" ] }, - "DeleteInstance": { - "methods": [ + "DeleteInstance": { + "methods": [ "DeleteInstance" ] }, - "ExportInstance": { - "methods": [ + "ExportInstance": { + "methods": [ "ExportInstance" ] }, - "FailoverInstance": { - "methods": [ + "FailoverInstance": { + "methods": [ "FailoverInstance" ] }, - "GetInstance": { - "methods": [ + "GetInstance": { + "methods": [ "GetInstance" ] }, - "ImportInstance": { - "methods": [ + "ImportInstance": { + "methods": [ "ImportInstance" ] }, - "ListInstances": { - "methods": [ + "ListInstances": { + "methods": [ "ListInstances" ] }, - "UpdateInstance": { - "methods": [ + "UpdateInstance": { + "methods": [ "UpdateInstance" ] }, - "UpgradeInstance": { - "methods": [ + "UpgradeInstance": { + "methods": [ "UpgradeInstance" ] } diff --git a/redis/apiv1beta1/cloud_redis_client.go b/redis/apiv1beta1/cloud_redis_client.go index a31e5147a0f..d739b5abe30 100644 --- a/redis/apiv1beta1/cloud_redis_client.go +++ b/redis/apiv1beta1/cloud_redis_client.go @@ -25,7 +25,6 @@ import ( "cloud.google.com/go/longrunning" lroauto "cloud.google.com/go/longrunning/autogen" - "github.com/golang/protobuf/proto" anypb "github.com/golang/protobuf/ptypes/any" gax "github.com/googleapis/gax-go/v2" "google.golang.org/api/iterator" @@ -36,6 +35,7 @@ import ( longrunningpb "google.golang.org/genproto/googleapis/longrunning" "google.golang.org/grpc" "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/proto" ) var newCloudRedisClientHook clientHook diff --git a/redis/apiv1beta1/doc.go b/redis/apiv1beta1/doc.go index 817b3d05ad9..c9d684db700 100644 --- a/redis/apiv1beta1/doc.go +++ b/redis/apiv1beta1/doc.go @@ -50,7 +50,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210612" +const versionClient = "20210624" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/redis/apiv1beta1/gapic_metadata.json b/redis/apiv1beta1/gapic_metadata.json index a7d95307cec..928126e482a 100644 --- a/redis/apiv1beta1/gapic_metadata.json +++ b/redis/apiv1beta1/gapic_metadata.json @@ -1,57 +1,57 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.redis.v1beta1", - "libraryPackage": "cloud.google.com/go/redis/apiv1beta1", - "services": { - "CloudRedis": { - "clients": { - "grpc": { - "libraryClient": "CloudRedisClient", - "rpcs": { - "CreateInstance": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.redis.v1beta1", + "libraryPackage": "cloud.google.com/go/redis/apiv1beta1", + "services": { + "CloudRedis": { + "clients": { + "grpc": { + "libraryClient": "CloudRedisClient", + "rpcs": { + "CreateInstance": { + "methods": [ "CreateInstance" ] }, - "DeleteInstance": { - "methods": [ + "DeleteInstance": { + "methods": [ "DeleteInstance" ] }, - "ExportInstance": { - "methods": [ + "ExportInstance": { + "methods": [ "ExportInstance" ] }, - "FailoverInstance": { - "methods": [ + "FailoverInstance": { + "methods": [ "FailoverInstance" ] }, - "GetInstance": { - "methods": [ + "GetInstance": { + "methods": [ "GetInstance" ] }, - "ImportInstance": { - "methods": [ + "ImportInstance": { + "methods": [ "ImportInstance" ] }, - "ListInstances": { - "methods": [ + "ListInstances": { + "methods": [ "ListInstances" ] }, - "UpdateInstance": { - "methods": [ + "UpdateInstance": { + "methods": [ "UpdateInstance" ] }, - "UpgradeInstance": { - "methods": [ + "UpgradeInstance": { + "methods": [ "UpgradeInstance" ] } diff --git a/resourcemanager/apiv2/doc.go b/resourcemanager/apiv2/doc.go index 495d5f230a1..7c68c311aad 100644 --- a/resourcemanager/apiv2/doc.go +++ b/resourcemanager/apiv2/doc.go @@ -49,7 +49,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210612" +const versionClient = "20210624" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/resourcemanager/apiv2/folders_client.go b/resourcemanager/apiv2/folders_client.go index a5bc2ffd578..f0436b3a02e 100644 --- a/resourcemanager/apiv2/folders_client.go +++ b/resourcemanager/apiv2/folders_client.go @@ -25,7 +25,6 @@ import ( "cloud.google.com/go/longrunning" lroauto "cloud.google.com/go/longrunning/autogen" - "github.com/golang/protobuf/proto" gax "github.com/googleapis/gax-go/v2" "google.golang.org/api/iterator" "google.golang.org/api/option" @@ -36,6 +35,7 @@ import ( longrunningpb "google.golang.org/genproto/googleapis/longrunning" "google.golang.org/grpc" "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/proto" ) var newFoldersClientHook clientHook diff --git a/resourcemanager/apiv2/gapic_metadata.json b/resourcemanager/apiv2/gapic_metadata.json index 6f709286f1f..f34cfab5b5a 100644 --- a/resourcemanager/apiv2/gapic_metadata.json +++ b/resourcemanager/apiv2/gapic_metadata.json @@ -1,67 +1,67 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.resourcemanager.v2", - "libraryPackage": "cloud.google.com/go/resourcemanager/apiv2", - "services": { - "Folders": { - "clients": { - "grpc": { - "libraryClient": "FoldersClient", - "rpcs": { - "CreateFolder": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.resourcemanager.v2", + "libraryPackage": "cloud.google.com/go/resourcemanager/apiv2", + "services": { + "Folders": { + "clients": { + "grpc": { + "libraryClient": "FoldersClient", + "rpcs": { + "CreateFolder": { + "methods": [ "CreateFolder" ] }, - "DeleteFolder": { - "methods": [ + "DeleteFolder": { + "methods": [ "DeleteFolder" ] }, - "GetFolder": { - "methods": [ + "GetFolder": { + "methods": [ "GetFolder" ] }, - "GetIamPolicy": { - "methods": [ + "GetIamPolicy": { + "methods": [ "GetIamPolicy" ] }, - "ListFolders": { - "methods": [ + "ListFolders": { + "methods": [ "ListFolders" ] }, - "MoveFolder": { - "methods": [ + "MoveFolder": { + "methods": [ "MoveFolder" ] }, - "SearchFolders": { - "methods": [ + "SearchFolders": { + "methods": [ "SearchFolders" ] }, - "SetIamPolicy": { - "methods": [ + "SetIamPolicy": { + "methods": [ "SetIamPolicy" ] }, - "TestIamPermissions": { - "methods": [ + "TestIamPermissions": { + "methods": [ "TestIamPermissions" ] }, - "UndeleteFolder": { - "methods": [ + "UndeleteFolder": { + "methods": [ "UndeleteFolder" ] }, - "UpdateFolder": { - "methods": [ + "UpdateFolder": { + "methods": [ "UpdateFolder" ] } diff --git a/resourcesettings/apiv1/doc.go b/resourcesettings/apiv1/doc.go index f972343d62a..ace04f2ff04 100644 --- a/resourcesettings/apiv1/doc.go +++ b/resourcesettings/apiv1/doc.go @@ -52,7 +52,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210612" +const versionClient = "20210624" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/resourcesettings/apiv1/gapic_metadata.json b/resourcesettings/apiv1/gapic_metadata.json index a07edb31e64..d31e8b223ff 100644 --- a/resourcesettings/apiv1/gapic_metadata.json +++ b/resourcesettings/apiv1/gapic_metadata.json @@ -1,27 +1,27 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.resourcesettings.v1", - "libraryPackage": "cloud.google.com/go/resourcesettings/apiv1", - "services": { - "ResourceSettingsService": { - "clients": { - "grpc": { - "libraryClient": "Client", - "rpcs": { - "GetSetting": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.resourcesettings.v1", + "libraryPackage": "cloud.google.com/go/resourcesettings/apiv1", + "services": { + "ResourceSettingsService": { + "clients": { + "grpc": { + "libraryClient": "Client", + "rpcs": { + "GetSetting": { + "methods": [ "GetSetting" ] }, - "ListSettings": { - "methods": [ + "ListSettings": { + "methods": [ "ListSettings" ] }, - "UpdateSetting": { - "methods": [ + "UpdateSetting": { + "methods": [ "UpdateSetting" ] } diff --git a/resourcesettings/apiv1/resource_settings_client.go b/resourcesettings/apiv1/resource_settings_client.go index ca109f991f2..fd32386b65b 100644 --- a/resourcesettings/apiv1/resource_settings_client.go +++ b/resourcesettings/apiv1/resource_settings_client.go @@ -23,7 +23,6 @@ import ( "net/url" "time" - "github.com/golang/protobuf/proto" gax "github.com/googleapis/gax-go/v2" "google.golang.org/api/iterator" "google.golang.org/api/option" @@ -33,6 +32,7 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/proto" ) var newClientHook clientHook diff --git a/retail/apiv2/catalog_client.go b/retail/apiv2/catalog_client.go index aec48be83c6..062693c55d9 100644 --- a/retail/apiv2/catalog_client.go +++ b/retail/apiv2/catalog_client.go @@ -23,7 +23,6 @@ import ( "net/url" "time" - "github.com/golang/protobuf/proto" gax "github.com/googleapis/gax-go/v2" "google.golang.org/api/iterator" "google.golang.org/api/option" @@ -33,6 +32,7 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/proto" ) var newCatalogClientHook clientHook diff --git a/retail/apiv2/doc.go b/retail/apiv2/doc.go index e5e7c73591d..b79f9834051 100644 --- a/retail/apiv2/doc.go +++ b/retail/apiv2/doc.go @@ -50,7 +50,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210612" +const versionClient = "20210624" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/retail/apiv2/gapic_metadata.json b/retail/apiv2/gapic_metadata.json index 946693b2fc6..7318b6367c2 100644 --- a/retail/apiv2/gapic_metadata.json +++ b/retail/apiv2/gapic_metadata.json @@ -1,22 +1,22 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.retail.v2", - "libraryPackage": "cloud.google.com/go/retail/apiv2", - "services": { - "CatalogService": { - "clients": { - "grpc": { - "libraryClient": "CatalogClient", - "rpcs": { - "ListCatalogs": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.retail.v2", + "libraryPackage": "cloud.google.com/go/retail/apiv2", + "services": { + "CatalogService": { + "clients": { + "grpc": { + "libraryClient": "CatalogClient", + "rpcs": { + "ListCatalogs": { + "methods": [ "ListCatalogs" ] }, - "UpdateCatalog": { - "methods": [ + "UpdateCatalog": { + "methods": [ "UpdateCatalog" ] } @@ -24,13 +24,13 @@ } } }, - "PredictionService": { - "clients": { - "grpc": { - "libraryClient": "PredictionClient", - "rpcs": { - "Predict": { - "methods": [ + "PredictionService": { + "clients": { + "grpc": { + "libraryClient": "PredictionClient", + "rpcs": { + "Predict": { + "methods": [ "Predict" ] } @@ -38,33 +38,33 @@ } } }, - "ProductService": { - "clients": { - "grpc": { - "libraryClient": "ProductClient", - "rpcs": { - "CreateProduct": { - "methods": [ + "ProductService": { + "clients": { + "grpc": { + "libraryClient": "ProductClient", + "rpcs": { + "CreateProduct": { + "methods": [ "CreateProduct" ] }, - "DeleteProduct": { - "methods": [ + "DeleteProduct": { + "methods": [ "DeleteProduct" ] }, - "GetProduct": { - "methods": [ + "GetProduct": { + "methods": [ "GetProduct" ] }, - "ImportProducts": { - "methods": [ + "ImportProducts": { + "methods": [ "ImportProducts" ] }, - "UpdateProduct": { - "methods": [ + "UpdateProduct": { + "methods": [ "UpdateProduct" ] } @@ -72,33 +72,33 @@ } } }, - "UserEventService": { - "clients": { - "grpc": { - "libraryClient": "UserEventClient", - "rpcs": { - "CollectUserEvent": { - "methods": [ + "UserEventService": { + "clients": { + "grpc": { + "libraryClient": "UserEventClient", + "rpcs": { + "CollectUserEvent": { + "methods": [ "CollectUserEvent" ] }, - "ImportUserEvents": { - "methods": [ + "ImportUserEvents": { + "methods": [ "ImportUserEvents" ] }, - "PurgeUserEvents": { - "methods": [ + "PurgeUserEvents": { + "methods": [ "PurgeUserEvents" ] }, - "RejoinUserEvents": { - "methods": [ + "RejoinUserEvents": { + "methods": [ "RejoinUserEvents" ] }, - "WriteUserEvent": { - "methods": [ + "WriteUserEvent": { + "methods": [ "WriteUserEvent" ] } diff --git a/scheduler/apiv1/cloud_scheduler_client.go b/scheduler/apiv1/cloud_scheduler_client.go index 303d89be095..8c71458d9cc 100644 --- a/scheduler/apiv1/cloud_scheduler_client.go +++ b/scheduler/apiv1/cloud_scheduler_client.go @@ -23,7 +23,6 @@ import ( "net/url" "time" - "github.com/golang/protobuf/proto" gax "github.com/googleapis/gax-go/v2" "google.golang.org/api/iterator" "google.golang.org/api/option" @@ -33,6 +32,7 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/proto" ) var newCloudSchedulerClientHook clientHook diff --git a/scheduler/apiv1/doc.go b/scheduler/apiv1/doc.go index f3e2743fbe0..796b6a156f7 100644 --- a/scheduler/apiv1/doc.go +++ b/scheduler/apiv1/doc.go @@ -48,7 +48,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210612" +const versionClient = "20210624" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/scheduler/apiv1/gapic_metadata.json b/scheduler/apiv1/gapic_metadata.json index d0dd864d7ee..40668090202 100644 --- a/scheduler/apiv1/gapic_metadata.json +++ b/scheduler/apiv1/gapic_metadata.json @@ -1,52 +1,52 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.scheduler.v1", - "libraryPackage": "cloud.google.com/go/scheduler/apiv1", - "services": { - "CloudScheduler": { - "clients": { - "grpc": { - "libraryClient": "CloudSchedulerClient", - "rpcs": { - "CreateJob": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.scheduler.v1", + "libraryPackage": "cloud.google.com/go/scheduler/apiv1", + "services": { + "CloudScheduler": { + "clients": { + "grpc": { + "libraryClient": "CloudSchedulerClient", + "rpcs": { + "CreateJob": { + "methods": [ "CreateJob" ] }, - "DeleteJob": { - "methods": [ + "DeleteJob": { + "methods": [ "DeleteJob" ] }, - "GetJob": { - "methods": [ + "GetJob": { + "methods": [ "GetJob" ] }, - "ListJobs": { - "methods": [ + "ListJobs": { + "methods": [ "ListJobs" ] }, - "PauseJob": { - "methods": [ + "PauseJob": { + "methods": [ "PauseJob" ] }, - "ResumeJob": { - "methods": [ + "ResumeJob": { + "methods": [ "ResumeJob" ] }, - "RunJob": { - "methods": [ + "RunJob": { + "methods": [ "RunJob" ] }, - "UpdateJob": { - "methods": [ + "UpdateJob": { + "methods": [ "UpdateJob" ] } diff --git a/scheduler/apiv1beta1/cloud_scheduler_client.go b/scheduler/apiv1beta1/cloud_scheduler_client.go index 9ec0cb77023..df096a80227 100644 --- a/scheduler/apiv1beta1/cloud_scheduler_client.go +++ b/scheduler/apiv1beta1/cloud_scheduler_client.go @@ -23,7 +23,6 @@ import ( "net/url" "time" - "github.com/golang/protobuf/proto" gax "github.com/googleapis/gax-go/v2" "google.golang.org/api/iterator" "google.golang.org/api/option" @@ -33,6 +32,7 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/proto" ) var newCloudSchedulerClientHook clientHook diff --git a/scheduler/apiv1beta1/doc.go b/scheduler/apiv1beta1/doc.go index 1f65d87e86a..6bacfce11e1 100644 --- a/scheduler/apiv1beta1/doc.go +++ b/scheduler/apiv1beta1/doc.go @@ -50,7 +50,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210612" +const versionClient = "20210624" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/scheduler/apiv1beta1/gapic_metadata.json b/scheduler/apiv1beta1/gapic_metadata.json index 0af02b964f9..7d4c4f943be 100644 --- a/scheduler/apiv1beta1/gapic_metadata.json +++ b/scheduler/apiv1beta1/gapic_metadata.json @@ -1,52 +1,52 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.scheduler.v1beta1", - "libraryPackage": "cloud.google.com/go/scheduler/apiv1beta1", - "services": { - "CloudScheduler": { - "clients": { - "grpc": { - "libraryClient": "CloudSchedulerClient", - "rpcs": { - "CreateJob": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.scheduler.v1beta1", + "libraryPackage": "cloud.google.com/go/scheduler/apiv1beta1", + "services": { + "CloudScheduler": { + "clients": { + "grpc": { + "libraryClient": "CloudSchedulerClient", + "rpcs": { + "CreateJob": { + "methods": [ "CreateJob" ] }, - "DeleteJob": { - "methods": [ + "DeleteJob": { + "methods": [ "DeleteJob" ] }, - "GetJob": { - "methods": [ + "GetJob": { + "methods": [ "GetJob" ] }, - "ListJobs": { - "methods": [ + "ListJobs": { + "methods": [ "ListJobs" ] }, - "PauseJob": { - "methods": [ + "PauseJob": { + "methods": [ "PauseJob" ] }, - "ResumeJob": { - "methods": [ + "ResumeJob": { + "methods": [ "ResumeJob" ] }, - "RunJob": { - "methods": [ + "RunJob": { + "methods": [ "RunJob" ] }, - "UpdateJob": { - "methods": [ + "UpdateJob": { + "methods": [ "UpdateJob" ] } diff --git a/secretmanager/apiv1/doc.go b/secretmanager/apiv1/doc.go index 6456f2382e2..e6b672bcebd 100644 --- a/secretmanager/apiv1/doc.go +++ b/secretmanager/apiv1/doc.go @@ -49,7 +49,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210612" +const versionClient = "20210624" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/secretmanager/apiv1/gapic_metadata.json b/secretmanager/apiv1/gapic_metadata.json index a5049c72dad..0b7c538e1fe 100644 --- a/secretmanager/apiv1/gapic_metadata.json +++ b/secretmanager/apiv1/gapic_metadata.json @@ -1,87 +1,87 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.secretmanager.v1", - "libraryPackage": "cloud.google.com/go/secretmanager/apiv1", - "services": { - "SecretManagerService": { - "clients": { - "grpc": { - "libraryClient": "Client", - "rpcs": { - "AccessSecretVersion": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.secretmanager.v1", + "libraryPackage": "cloud.google.com/go/secretmanager/apiv1", + "services": { + "SecretManagerService": { + "clients": { + "grpc": { + "libraryClient": "Client", + "rpcs": { + "AccessSecretVersion": { + "methods": [ "AccessSecretVersion" ] }, - "AddSecretVersion": { - "methods": [ + "AddSecretVersion": { + "methods": [ "AddSecretVersion" ] }, - "CreateSecret": { - "methods": [ + "CreateSecret": { + "methods": [ "CreateSecret" ] }, - "DeleteSecret": { - "methods": [ + "DeleteSecret": { + "methods": [ "DeleteSecret" ] }, - "DestroySecretVersion": { - "methods": [ + "DestroySecretVersion": { + "methods": [ "DestroySecretVersion" ] }, - "DisableSecretVersion": { - "methods": [ + "DisableSecretVersion": { + "methods": [ "DisableSecretVersion" ] }, - "EnableSecretVersion": { - "methods": [ + "EnableSecretVersion": { + "methods": [ "EnableSecretVersion" ] }, - "GetIamPolicy": { - "methods": [ + "GetIamPolicy": { + "methods": [ "GetIamPolicy" ] }, - "GetSecret": { - "methods": [ + "GetSecret": { + "methods": [ "GetSecret" ] }, - "GetSecretVersion": { - "methods": [ + "GetSecretVersion": { + "methods": [ "GetSecretVersion" ] }, - "ListSecretVersions": { - "methods": [ + "ListSecretVersions": { + "methods": [ "ListSecretVersions" ] }, - "ListSecrets": { - "methods": [ + "ListSecrets": { + "methods": [ "ListSecrets" ] }, - "SetIamPolicy": { - "methods": [ + "SetIamPolicy": { + "methods": [ "SetIamPolicy" ] }, - "TestIamPermissions": { - "methods": [ + "TestIamPermissions": { + "methods": [ "TestIamPermissions" ] }, - "UpdateSecret": { - "methods": [ + "UpdateSecret": { + "methods": [ "UpdateSecret" ] } diff --git a/secretmanager/apiv1/secret_manager_client.go b/secretmanager/apiv1/secret_manager_client.go index b6e735954fe..def41a41941 100644 --- a/secretmanager/apiv1/secret_manager_client.go +++ b/secretmanager/apiv1/secret_manager_client.go @@ -23,7 +23,6 @@ import ( "net/url" "time" - "github.com/golang/protobuf/proto" gax "github.com/googleapis/gax-go/v2" "google.golang.org/api/iterator" "google.golang.org/api/option" @@ -34,6 +33,7 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/proto" ) var newClientHook clientHook diff --git a/secretmanager/apiv1beta1/doc.go b/secretmanager/apiv1beta1/doc.go index 18740d2e74e..2291878c721 100644 --- a/secretmanager/apiv1beta1/doc.go +++ b/secretmanager/apiv1beta1/doc.go @@ -51,7 +51,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210612" +const versionClient = "20210624" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/secretmanager/apiv1beta1/gapic_metadata.json b/secretmanager/apiv1beta1/gapic_metadata.json index 31f38b730d9..0b85afa83a4 100644 --- a/secretmanager/apiv1beta1/gapic_metadata.json +++ b/secretmanager/apiv1beta1/gapic_metadata.json @@ -1,87 +1,87 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.secrets.v1beta1", - "libraryPackage": "cloud.google.com/go/secretmanager/apiv1beta1", - "services": { - "SecretManagerService": { - "clients": { - "grpc": { - "libraryClient": "Client", - "rpcs": { - "AccessSecretVersion": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.secrets.v1beta1", + "libraryPackage": "cloud.google.com/go/secretmanager/apiv1beta1", + "services": { + "SecretManagerService": { + "clients": { + "grpc": { + "libraryClient": "Client", + "rpcs": { + "AccessSecretVersion": { + "methods": [ "AccessSecretVersion" ] }, - "AddSecretVersion": { - "methods": [ + "AddSecretVersion": { + "methods": [ "AddSecretVersion" ] }, - "CreateSecret": { - "methods": [ + "CreateSecret": { + "methods": [ "CreateSecret" ] }, - "DeleteSecret": { - "methods": [ + "DeleteSecret": { + "methods": [ "DeleteSecret" ] }, - "DestroySecretVersion": { - "methods": [ + "DestroySecretVersion": { + "methods": [ "DestroySecretVersion" ] }, - "DisableSecretVersion": { - "methods": [ + "DisableSecretVersion": { + "methods": [ "DisableSecretVersion" ] }, - "EnableSecretVersion": { - "methods": [ + "EnableSecretVersion": { + "methods": [ "EnableSecretVersion" ] }, - "GetIamPolicy": { - "methods": [ + "GetIamPolicy": { + "methods": [ "GetIamPolicy" ] }, - "GetSecret": { - "methods": [ + "GetSecret": { + "methods": [ "GetSecret" ] }, - "GetSecretVersion": { - "methods": [ + "GetSecretVersion": { + "methods": [ "GetSecretVersion" ] }, - "ListSecretVersions": { - "methods": [ + "ListSecretVersions": { + "methods": [ "ListSecretVersions" ] }, - "ListSecrets": { - "methods": [ + "ListSecrets": { + "methods": [ "ListSecrets" ] }, - "SetIamPolicy": { - "methods": [ + "SetIamPolicy": { + "methods": [ "SetIamPolicy" ] }, - "TestIamPermissions": { - "methods": [ + "TestIamPermissions": { + "methods": [ "TestIamPermissions" ] }, - "UpdateSecret": { - "methods": [ + "UpdateSecret": { + "methods": [ "UpdateSecret" ] } diff --git a/secretmanager/apiv1beta1/secret_manager_client.go b/secretmanager/apiv1beta1/secret_manager_client.go index 1be0e0142ba..e7230938ef6 100644 --- a/secretmanager/apiv1beta1/secret_manager_client.go +++ b/secretmanager/apiv1beta1/secret_manager_client.go @@ -23,7 +23,6 @@ import ( "net/url" "time" - "github.com/golang/protobuf/proto" gax "github.com/googleapis/gax-go/v2" "google.golang.org/api/iterator" "google.golang.org/api/option" @@ -34,6 +33,7 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/proto" ) var newClientHook clientHook diff --git a/security/privateca/apiv1/certificate_authority_client.go b/security/privateca/apiv1/certificate_authority_client.go index 3866f65828c..014e1f46527 100644 --- a/security/privateca/apiv1/certificate_authority_client.go +++ b/security/privateca/apiv1/certificate_authority_client.go @@ -25,7 +25,6 @@ import ( "cloud.google.com/go/longrunning" lroauto "cloud.google.com/go/longrunning/autogen" - "github.com/golang/protobuf/proto" gax "github.com/googleapis/gax-go/v2" "google.golang.org/api/iterator" "google.golang.org/api/option" @@ -36,6 +35,7 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/proto" ) var newCertificateAuthorityClientHook clientHook diff --git a/security/privateca/apiv1/doc.go b/security/privateca/apiv1/doc.go index b08acff0edf..b742d7d407b 100644 --- a/security/privateca/apiv1/doc.go +++ b/security/privateca/apiv1/doc.go @@ -53,7 +53,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210617" +const versionClient = "20210624" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/security/privateca/apiv1/gapic_metadata.json b/security/privateca/apiv1/gapic_metadata.json index c979b6d151b..8f5e39723a8 100644 --- a/security/privateca/apiv1/gapic_metadata.json +++ b/security/privateca/apiv1/gapic_metadata.json @@ -1,157 +1,157 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.security.privateca.v1", - "libraryPackage": "cloud.google.com/go/security/privateca/apiv1", - "services": { - "CertificateAuthorityService": { - "clients": { - "grpc": { - "libraryClient": "CertificateAuthorityClient", - "rpcs": { - "ActivateCertificateAuthority": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.security.privateca.v1", + "libraryPackage": "cloud.google.com/go/security/privateca/apiv1", + "services": { + "CertificateAuthorityService": { + "clients": { + "grpc": { + "libraryClient": "CertificateAuthorityClient", + "rpcs": { + "ActivateCertificateAuthority": { + "methods": [ "ActivateCertificateAuthority" ] }, - "CreateCaPool": { - "methods": [ + "CreateCaPool": { + "methods": [ "CreateCaPool" ] }, - "CreateCertificate": { - "methods": [ + "CreateCertificate": { + "methods": [ "CreateCertificate" ] }, - "CreateCertificateAuthority": { - "methods": [ + "CreateCertificateAuthority": { + "methods": [ "CreateCertificateAuthority" ] }, - "CreateCertificateTemplate": { - "methods": [ + "CreateCertificateTemplate": { + "methods": [ "CreateCertificateTemplate" ] }, - "DeleteCaPool": { - "methods": [ + "DeleteCaPool": { + "methods": [ "DeleteCaPool" ] }, - "DeleteCertificateAuthority": { - "methods": [ + "DeleteCertificateAuthority": { + "methods": [ "DeleteCertificateAuthority" ] }, - "DeleteCertificateTemplate": { - "methods": [ + "DeleteCertificateTemplate": { + "methods": [ "DeleteCertificateTemplate" ] }, - "DisableCertificateAuthority": { - "methods": [ + "DisableCertificateAuthority": { + "methods": [ "DisableCertificateAuthority" ] }, - "EnableCertificateAuthority": { - "methods": [ + "EnableCertificateAuthority": { + "methods": [ "EnableCertificateAuthority" ] }, - "FetchCaCerts": { - "methods": [ + "FetchCaCerts": { + "methods": [ "FetchCaCerts" ] }, - "FetchCertificateAuthorityCsr": { - "methods": [ + "FetchCertificateAuthorityCsr": { + "methods": [ "FetchCertificateAuthorityCsr" ] }, - "GetCaPool": { - "methods": [ + "GetCaPool": { + "methods": [ "GetCaPool" ] }, - "GetCertificate": { - "methods": [ + "GetCertificate": { + "methods": [ "GetCertificate" ] }, - "GetCertificateAuthority": { - "methods": [ + "GetCertificateAuthority": { + "methods": [ "GetCertificateAuthority" ] }, - "GetCertificateRevocationList": { - "methods": [ + "GetCertificateRevocationList": { + "methods": [ "GetCertificateRevocationList" ] }, - "GetCertificateTemplate": { - "methods": [ + "GetCertificateTemplate": { + "methods": [ "GetCertificateTemplate" ] }, - "ListCaPools": { - "methods": [ + "ListCaPools": { + "methods": [ "ListCaPools" ] }, - "ListCertificateAuthorities": { - "methods": [ + "ListCertificateAuthorities": { + "methods": [ "ListCertificateAuthorities" ] }, - "ListCertificateRevocationLists": { - "methods": [ + "ListCertificateRevocationLists": { + "methods": [ "ListCertificateRevocationLists" ] }, - "ListCertificateTemplates": { - "methods": [ + "ListCertificateTemplates": { + "methods": [ "ListCertificateTemplates" ] }, - "ListCertificates": { - "methods": [ + "ListCertificates": { + "methods": [ "ListCertificates" ] }, - "RevokeCertificate": { - "methods": [ + "RevokeCertificate": { + "methods": [ "RevokeCertificate" ] }, - "UndeleteCertificateAuthority": { - "methods": [ + "UndeleteCertificateAuthority": { + "methods": [ "UndeleteCertificateAuthority" ] }, - "UpdateCaPool": { - "methods": [ + "UpdateCaPool": { + "methods": [ "UpdateCaPool" ] }, - "UpdateCertificate": { - "methods": [ + "UpdateCertificate": { + "methods": [ "UpdateCertificate" ] }, - "UpdateCertificateAuthority": { - "methods": [ + "UpdateCertificateAuthority": { + "methods": [ "UpdateCertificateAuthority" ] }, - "UpdateCertificateRevocationList": { - "methods": [ + "UpdateCertificateRevocationList": { + "methods": [ "UpdateCertificateRevocationList" ] }, - "UpdateCertificateTemplate": { - "methods": [ + "UpdateCertificateTemplate": { + "methods": [ "UpdateCertificateTemplate" ] } diff --git a/security/privateca/apiv1beta1/certificate_authority_client.go b/security/privateca/apiv1beta1/certificate_authority_client.go index 2dcfc4c1354..b63606c9d87 100644 --- a/security/privateca/apiv1beta1/certificate_authority_client.go +++ b/security/privateca/apiv1beta1/certificate_authority_client.go @@ -25,7 +25,6 @@ import ( "cloud.google.com/go/longrunning" lroauto "cloud.google.com/go/longrunning/autogen" - "github.com/golang/protobuf/proto" gax "github.com/googleapis/gax-go/v2" "google.golang.org/api/iterator" "google.golang.org/api/option" @@ -36,6 +35,7 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/proto" ) var newCertificateAuthorityClientHook clientHook diff --git a/security/privateca/apiv1beta1/doc.go b/security/privateca/apiv1beta1/doc.go index 9ccc060ef6b..576b02875bc 100644 --- a/security/privateca/apiv1beta1/doc.go +++ b/security/privateca/apiv1beta1/doc.go @@ -48,7 +48,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210612" +const versionClient = "20210624" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/security/privateca/apiv1beta1/gapic_metadata.json b/security/privateca/apiv1beta1/gapic_metadata.json index d6c24e8707a..3ea3f6113ae 100644 --- a/security/privateca/apiv1beta1/gapic_metadata.json +++ b/security/privateca/apiv1beta1/gapic_metadata.json @@ -1,112 +1,112 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.security.privateca.v1beta1", - "libraryPackage": "cloud.google.com/go/security/privateca/apiv1beta1", - "services": { - "CertificateAuthorityService": { - "clients": { - "grpc": { - "libraryClient": "CertificateAuthorityClient", - "rpcs": { - "ActivateCertificateAuthority": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.security.privateca.v1beta1", + "libraryPackage": "cloud.google.com/go/security/privateca/apiv1beta1", + "services": { + "CertificateAuthorityService": { + "clients": { + "grpc": { + "libraryClient": "CertificateAuthorityClient", + "rpcs": { + "ActivateCertificateAuthority": { + "methods": [ "ActivateCertificateAuthority" ] }, - "CreateCertificate": { - "methods": [ + "CreateCertificate": { + "methods": [ "CreateCertificate" ] }, - "CreateCertificateAuthority": { - "methods": [ + "CreateCertificateAuthority": { + "methods": [ "CreateCertificateAuthority" ] }, - "DisableCertificateAuthority": { - "methods": [ + "DisableCertificateAuthority": { + "methods": [ "DisableCertificateAuthority" ] }, - "EnableCertificateAuthority": { - "methods": [ + "EnableCertificateAuthority": { + "methods": [ "EnableCertificateAuthority" ] }, - "FetchCertificateAuthorityCsr": { - "methods": [ + "FetchCertificateAuthorityCsr": { + "methods": [ "FetchCertificateAuthorityCsr" ] }, - "GetCertificate": { - "methods": [ + "GetCertificate": { + "methods": [ "GetCertificate" ] }, - "GetCertificateAuthority": { - "methods": [ + "GetCertificateAuthority": { + "methods": [ "GetCertificateAuthority" ] }, - "GetCertificateRevocationList": { - "methods": [ + "GetCertificateRevocationList": { + "methods": [ "GetCertificateRevocationList" ] }, - "GetReusableConfig": { - "methods": [ + "GetReusableConfig": { + "methods": [ "GetReusableConfig" ] }, - "ListCertificateAuthorities": { - "methods": [ + "ListCertificateAuthorities": { + "methods": [ "ListCertificateAuthorities" ] }, - "ListCertificateRevocationLists": { - "methods": [ + "ListCertificateRevocationLists": { + "methods": [ "ListCertificateRevocationLists" ] }, - "ListCertificates": { - "methods": [ + "ListCertificates": { + "methods": [ "ListCertificates" ] }, - "ListReusableConfigs": { - "methods": [ + "ListReusableConfigs": { + "methods": [ "ListReusableConfigs" ] }, - "RestoreCertificateAuthority": { - "methods": [ + "RestoreCertificateAuthority": { + "methods": [ "RestoreCertificateAuthority" ] }, - "RevokeCertificate": { - "methods": [ + "RevokeCertificate": { + "methods": [ "RevokeCertificate" ] }, - "ScheduleDeleteCertificateAuthority": { - "methods": [ + "ScheduleDeleteCertificateAuthority": { + "methods": [ "ScheduleDeleteCertificateAuthority" ] }, - "UpdateCertificate": { - "methods": [ + "UpdateCertificate": { + "methods": [ "UpdateCertificate" ] }, - "UpdateCertificateAuthority": { - "methods": [ + "UpdateCertificateAuthority": { + "methods": [ "UpdateCertificateAuthority" ] }, - "UpdateCertificateRevocationList": { - "methods": [ + "UpdateCertificateRevocationList": { + "methods": [ "UpdateCertificateRevocationList" ] } diff --git a/securitycenter/apiv1/doc.go b/securitycenter/apiv1/doc.go index 68b359c489e..45e0e45ea5a 100644 --- a/securitycenter/apiv1/doc.go +++ b/securitycenter/apiv1/doc.go @@ -49,7 +49,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210612" +const versionClient = "20210624" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/securitycenter/apiv1/gapic_metadata.json b/securitycenter/apiv1/gapic_metadata.json index 9c8c2592c22..ce8878f4e07 100644 --- a/securitycenter/apiv1/gapic_metadata.json +++ b/securitycenter/apiv1/gapic_metadata.json @@ -1,127 +1,127 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.securitycenter.v1", - "libraryPackage": "cloud.google.com/go/securitycenter/apiv1", - "services": { - "SecurityCenter": { - "clients": { - "grpc": { - "libraryClient": "Client", - "rpcs": { - "CreateFinding": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.securitycenter.v1", + "libraryPackage": "cloud.google.com/go/securitycenter/apiv1", + "services": { + "SecurityCenter": { + "clients": { + "grpc": { + "libraryClient": "Client", + "rpcs": { + "CreateFinding": { + "methods": [ "CreateFinding" ] }, - "CreateNotificationConfig": { - "methods": [ + "CreateNotificationConfig": { + "methods": [ "CreateNotificationConfig" ] }, - "CreateSource": { - "methods": [ + "CreateSource": { + "methods": [ "CreateSource" ] }, - "DeleteNotificationConfig": { - "methods": [ + "DeleteNotificationConfig": { + "methods": [ "DeleteNotificationConfig" ] }, - "GetIamPolicy": { - "methods": [ + "GetIamPolicy": { + "methods": [ "GetIamPolicy" ] }, - "GetNotificationConfig": { - "methods": [ + "GetNotificationConfig": { + "methods": [ "GetNotificationConfig" ] }, - "GetOrganizationSettings": { - "methods": [ + "GetOrganizationSettings": { + "methods": [ "GetOrganizationSettings" ] }, - "GetSource": { - "methods": [ + "GetSource": { + "methods": [ "GetSource" ] }, - "GroupAssets": { - "methods": [ + "GroupAssets": { + "methods": [ "GroupAssets" ] }, - "GroupFindings": { - "methods": [ + "GroupFindings": { + "methods": [ "GroupFindings" ] }, - "ListAssets": { - "methods": [ + "ListAssets": { + "methods": [ "ListAssets" ] }, - "ListFindings": { - "methods": [ + "ListFindings": { + "methods": [ "ListFindings" ] }, - "ListNotificationConfigs": { - "methods": [ + "ListNotificationConfigs": { + "methods": [ "ListNotificationConfigs" ] }, - "ListSources": { - "methods": [ + "ListSources": { + "methods": [ "ListSources" ] }, - "RunAssetDiscovery": { - "methods": [ + "RunAssetDiscovery": { + "methods": [ "RunAssetDiscovery" ] }, - "SetFindingState": { - "methods": [ + "SetFindingState": { + "methods": [ "SetFindingState" ] }, - "SetIamPolicy": { - "methods": [ + "SetIamPolicy": { + "methods": [ "SetIamPolicy" ] }, - "TestIamPermissions": { - "methods": [ + "TestIamPermissions": { + "methods": [ "TestIamPermissions" ] }, - "UpdateFinding": { - "methods": [ + "UpdateFinding": { + "methods": [ "UpdateFinding" ] }, - "UpdateNotificationConfig": { - "methods": [ + "UpdateNotificationConfig": { + "methods": [ "UpdateNotificationConfig" ] }, - "UpdateOrganizationSettings": { - "methods": [ + "UpdateOrganizationSettings": { + "methods": [ "UpdateOrganizationSettings" ] }, - "UpdateSecurityMarks": { - "methods": [ + "UpdateSecurityMarks": { + "methods": [ "UpdateSecurityMarks" ] }, - "UpdateSource": { - "methods": [ + "UpdateSource": { + "methods": [ "UpdateSource" ] } diff --git a/securitycenter/apiv1/security_center_client.go b/securitycenter/apiv1/security_center_client.go index 30cbaffc834..2472574f889 100644 --- a/securitycenter/apiv1/security_center_client.go +++ b/securitycenter/apiv1/security_center_client.go @@ -25,7 +25,6 @@ import ( "cloud.google.com/go/longrunning" lroauto "cloud.google.com/go/longrunning/autogen" - "github.com/golang/protobuf/proto" emptypb "github.com/golang/protobuf/ptypes/empty" gax "github.com/googleapis/gax-go/v2" "google.golang.org/api/iterator" @@ -38,6 +37,7 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/proto" ) var newClientHook clientHook diff --git a/securitycenter/apiv1beta1/doc.go b/securitycenter/apiv1beta1/doc.go index 2d6e15815ed..f5233144269 100644 --- a/securitycenter/apiv1beta1/doc.go +++ b/securitycenter/apiv1beta1/doc.go @@ -51,7 +51,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210612" +const versionClient = "20210624" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/securitycenter/apiv1beta1/gapic_metadata.json b/securitycenter/apiv1beta1/gapic_metadata.json index 0bafa06cf3c..c5c1ac80636 100644 --- a/securitycenter/apiv1beta1/gapic_metadata.json +++ b/securitycenter/apiv1beta1/gapic_metadata.json @@ -1,102 +1,102 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.securitycenter.v1beta1", - "libraryPackage": "cloud.google.com/go/securitycenter/apiv1beta1", - "services": { - "SecurityCenter": { - "clients": { - "grpc": { - "libraryClient": "Client", - "rpcs": { - "CreateFinding": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.securitycenter.v1beta1", + "libraryPackage": "cloud.google.com/go/securitycenter/apiv1beta1", + "services": { + "SecurityCenter": { + "clients": { + "grpc": { + "libraryClient": "Client", + "rpcs": { + "CreateFinding": { + "methods": [ "CreateFinding" ] }, - "CreateSource": { - "methods": [ + "CreateSource": { + "methods": [ "CreateSource" ] }, - "GetIamPolicy": { - "methods": [ + "GetIamPolicy": { + "methods": [ "GetIamPolicy" ] }, - "GetOrganizationSettings": { - "methods": [ + "GetOrganizationSettings": { + "methods": [ "GetOrganizationSettings" ] }, - "GetSource": { - "methods": [ + "GetSource": { + "methods": [ "GetSource" ] }, - "GroupAssets": { - "methods": [ + "GroupAssets": { + "methods": [ "GroupAssets" ] }, - "GroupFindings": { - "methods": [ + "GroupFindings": { + "methods": [ "GroupFindings" ] }, - "ListAssets": { - "methods": [ + "ListAssets": { + "methods": [ "ListAssets" ] }, - "ListFindings": { - "methods": [ + "ListFindings": { + "methods": [ "ListFindings" ] }, - "ListSources": { - "methods": [ + "ListSources": { + "methods": [ "ListSources" ] }, - "RunAssetDiscovery": { - "methods": [ + "RunAssetDiscovery": { + "methods": [ "RunAssetDiscovery" ] }, - "SetFindingState": { - "methods": [ + "SetFindingState": { + "methods": [ "SetFindingState" ] }, - "SetIamPolicy": { - "methods": [ + "SetIamPolicy": { + "methods": [ "SetIamPolicy" ] }, - "TestIamPermissions": { - "methods": [ + "TestIamPermissions": { + "methods": [ "TestIamPermissions" ] }, - "UpdateFinding": { - "methods": [ + "UpdateFinding": { + "methods": [ "UpdateFinding" ] }, - "UpdateOrganizationSettings": { - "methods": [ + "UpdateOrganizationSettings": { + "methods": [ "UpdateOrganizationSettings" ] }, - "UpdateSecurityMarks": { - "methods": [ + "UpdateSecurityMarks": { + "methods": [ "UpdateSecurityMarks" ] }, - "UpdateSource": { - "methods": [ + "UpdateSource": { + "methods": [ "UpdateSource" ] } diff --git a/securitycenter/apiv1beta1/security_center_client.go b/securitycenter/apiv1beta1/security_center_client.go index faef96b77b4..2770a2c189a 100644 --- a/securitycenter/apiv1beta1/security_center_client.go +++ b/securitycenter/apiv1beta1/security_center_client.go @@ -25,7 +25,6 @@ import ( "cloud.google.com/go/longrunning" lroauto "cloud.google.com/go/longrunning/autogen" - "github.com/golang/protobuf/proto" emptypb "github.com/golang/protobuf/ptypes/empty" gax "github.com/googleapis/gax-go/v2" "google.golang.org/api/iterator" @@ -38,6 +37,7 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/proto" ) var newClientHook clientHook diff --git a/securitycenter/apiv1p1beta1/doc.go b/securitycenter/apiv1p1beta1/doc.go index d11dca063a0..886323d2b35 100644 --- a/securitycenter/apiv1p1beta1/doc.go +++ b/securitycenter/apiv1p1beta1/doc.go @@ -51,7 +51,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210612" +const versionClient = "20210624" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/securitycenter/apiv1p1beta1/gapic_metadata.json b/securitycenter/apiv1p1beta1/gapic_metadata.json index 57386d58d3e..bf1f551d0ae 100644 --- a/securitycenter/apiv1p1beta1/gapic_metadata.json +++ b/securitycenter/apiv1p1beta1/gapic_metadata.json @@ -1,127 +1,127 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.securitycenter.v1p1beta1", - "libraryPackage": "cloud.google.com/go/securitycenter/apiv1p1beta1", - "services": { - "SecurityCenter": { - "clients": { - "grpc": { - "libraryClient": "Client", - "rpcs": { - "CreateFinding": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.securitycenter.v1p1beta1", + "libraryPackage": "cloud.google.com/go/securitycenter/apiv1p1beta1", + "services": { + "SecurityCenter": { + "clients": { + "grpc": { + "libraryClient": "Client", + "rpcs": { + "CreateFinding": { + "methods": [ "CreateFinding" ] }, - "CreateNotificationConfig": { - "methods": [ + "CreateNotificationConfig": { + "methods": [ "CreateNotificationConfig" ] }, - "CreateSource": { - "methods": [ + "CreateSource": { + "methods": [ "CreateSource" ] }, - "DeleteNotificationConfig": { - "methods": [ + "DeleteNotificationConfig": { + "methods": [ "DeleteNotificationConfig" ] }, - "GetIamPolicy": { - "methods": [ + "GetIamPolicy": { + "methods": [ "GetIamPolicy" ] }, - "GetNotificationConfig": { - "methods": [ + "GetNotificationConfig": { + "methods": [ "GetNotificationConfig" ] }, - "GetOrganizationSettings": { - "methods": [ + "GetOrganizationSettings": { + "methods": [ "GetOrganizationSettings" ] }, - "GetSource": { - "methods": [ + "GetSource": { + "methods": [ "GetSource" ] }, - "GroupAssets": { - "methods": [ + "GroupAssets": { + "methods": [ "GroupAssets" ] }, - "GroupFindings": { - "methods": [ + "GroupFindings": { + "methods": [ "GroupFindings" ] }, - "ListAssets": { - "methods": [ + "ListAssets": { + "methods": [ "ListAssets" ] }, - "ListFindings": { - "methods": [ + "ListFindings": { + "methods": [ "ListFindings" ] }, - "ListNotificationConfigs": { - "methods": [ + "ListNotificationConfigs": { + "methods": [ "ListNotificationConfigs" ] }, - "ListSources": { - "methods": [ + "ListSources": { + "methods": [ "ListSources" ] }, - "RunAssetDiscovery": { - "methods": [ + "RunAssetDiscovery": { + "methods": [ "RunAssetDiscovery" ] }, - "SetFindingState": { - "methods": [ + "SetFindingState": { + "methods": [ "SetFindingState" ] }, - "SetIamPolicy": { - "methods": [ + "SetIamPolicy": { + "methods": [ "SetIamPolicy" ] }, - "TestIamPermissions": { - "methods": [ + "TestIamPermissions": { + "methods": [ "TestIamPermissions" ] }, - "UpdateFinding": { - "methods": [ + "UpdateFinding": { + "methods": [ "UpdateFinding" ] }, - "UpdateNotificationConfig": { - "methods": [ + "UpdateNotificationConfig": { + "methods": [ "UpdateNotificationConfig" ] }, - "UpdateOrganizationSettings": { - "methods": [ + "UpdateOrganizationSettings": { + "methods": [ "UpdateOrganizationSettings" ] }, - "UpdateSecurityMarks": { - "methods": [ + "UpdateSecurityMarks": { + "methods": [ "UpdateSecurityMarks" ] }, - "UpdateSource": { - "methods": [ + "UpdateSource": { + "methods": [ "UpdateSource" ] } diff --git a/securitycenter/apiv1p1beta1/security_center_client.go b/securitycenter/apiv1p1beta1/security_center_client.go index c6abd15f6a2..3bbad64a625 100644 --- a/securitycenter/apiv1p1beta1/security_center_client.go +++ b/securitycenter/apiv1p1beta1/security_center_client.go @@ -25,7 +25,6 @@ import ( "cloud.google.com/go/longrunning" lroauto "cloud.google.com/go/longrunning/autogen" - "github.com/golang/protobuf/proto" emptypb "github.com/golang/protobuf/ptypes/empty" gax "github.com/googleapis/gax-go/v2" "google.golang.org/api/iterator" @@ -38,6 +37,7 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/proto" ) var newClientHook clientHook diff --git a/securitycenter/settings/apiv1beta1/doc.go b/securitycenter/settings/apiv1beta1/doc.go index 26dd0350710..420f9b87051 100644 --- a/securitycenter/settings/apiv1beta1/doc.go +++ b/securitycenter/settings/apiv1beta1/doc.go @@ -51,7 +51,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210612" +const versionClient = "20210624" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/securitycenter/settings/apiv1beta1/gapic_metadata.json b/securitycenter/settings/apiv1beta1/gapic_metadata.json index ef3a6db6dc7..8cc28a604b1 100644 --- a/securitycenter/settings/apiv1beta1/gapic_metadata.json +++ b/securitycenter/settings/apiv1beta1/gapic_metadata.json @@ -1,77 +1,77 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.securitycenter.settings.v1beta1", - "libraryPackage": "cloud.google.com/go/securitycenter/settings/apiv1beta1", - "services": { - "SecurityCenterSettingsService": { - "clients": { - "grpc": { - "libraryClient": "SecurityCenterSettingsClient", - "rpcs": { - "BatchCalculateEffectiveSettings": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.securitycenter.settings.v1beta1", + "libraryPackage": "cloud.google.com/go/securitycenter/settings/apiv1beta1", + "services": { + "SecurityCenterSettingsService": { + "clients": { + "grpc": { + "libraryClient": "SecurityCenterSettingsClient", + "rpcs": { + "BatchCalculateEffectiveSettings": { + "methods": [ "BatchCalculateEffectiveSettings" ] }, - "BatchGetSettings": { - "methods": [ + "BatchGetSettings": { + "methods": [ "BatchGetSettings" ] }, - "CalculateEffectiveComponentSettings": { - "methods": [ + "CalculateEffectiveComponentSettings": { + "methods": [ "CalculateEffectiveComponentSettings" ] }, - "CalculateEffectiveSettings": { - "methods": [ + "CalculateEffectiveSettings": { + "methods": [ "CalculateEffectiveSettings" ] }, - "GetComponentSettings": { - "methods": [ + "GetComponentSettings": { + "methods": [ "GetComponentSettings" ] }, - "GetServiceAccount": { - "methods": [ + "GetServiceAccount": { + "methods": [ "GetServiceAccount" ] }, - "GetSettings": { - "methods": [ + "GetSettings": { + "methods": [ "GetSettings" ] }, - "ListComponents": { - "methods": [ + "ListComponents": { + "methods": [ "ListComponents" ] }, - "ListDetectors": { - "methods": [ + "ListDetectors": { + "methods": [ "ListDetectors" ] }, - "ResetComponentSettings": { - "methods": [ + "ResetComponentSettings": { + "methods": [ "ResetComponentSettings" ] }, - "ResetSettings": { - "methods": [ + "ResetSettings": { + "methods": [ "ResetSettings" ] }, - "UpdateComponentSettings": { - "methods": [ + "UpdateComponentSettings": { + "methods": [ "UpdateComponentSettings" ] }, - "UpdateSettings": { - "methods": [ + "UpdateSettings": { + "methods": [ "UpdateSettings" ] } diff --git a/securitycenter/settings/apiv1beta1/security_center_settings_client.go b/securitycenter/settings/apiv1beta1/security_center_settings_client.go index 6937378ba46..ed95707e8e2 100644 --- a/securitycenter/settings/apiv1beta1/security_center_settings_client.go +++ b/securitycenter/settings/apiv1beta1/security_center_settings_client.go @@ -23,7 +23,6 @@ import ( "net/url" "time" - "github.com/golang/protobuf/proto" gax "github.com/googleapis/gax-go/v2" "google.golang.org/api/iterator" "google.golang.org/api/option" @@ -33,6 +32,7 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/proto" ) var newSecurityCenterSettingsClientHook clientHook diff --git a/servicecontrol/apiv1/doc.go b/servicecontrol/apiv1/doc.go index 9aca6d9cb05..01b21c2d93f 100644 --- a/servicecontrol/apiv1/doc.go +++ b/servicecontrol/apiv1/doc.go @@ -49,7 +49,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210612" +const versionClient = "20210624" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/servicecontrol/apiv1/gapic_metadata.json b/servicecontrol/apiv1/gapic_metadata.json index 6ae77225005..6e2938974f1 100644 --- a/servicecontrol/apiv1/gapic_metadata.json +++ b/servicecontrol/apiv1/gapic_metadata.json @@ -1,17 +1,17 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.api.servicecontrol.v1", - "libraryPackage": "cloud.google.com/go/servicecontrol/apiv1", - "services": { - "QuotaController": { - "clients": { - "grpc": { - "libraryClient": "QuotaControllerClient", - "rpcs": { - "AllocateQuota": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.api.servicecontrol.v1", + "libraryPackage": "cloud.google.com/go/servicecontrol/apiv1", + "services": { + "QuotaController": { + "clients": { + "grpc": { + "libraryClient": "QuotaControllerClient", + "rpcs": { + "AllocateQuota": { + "methods": [ "AllocateQuota" ] } @@ -19,18 +19,18 @@ } } }, - "ServiceController": { - "clients": { - "grpc": { - "libraryClient": "ServiceControllerClient", - "rpcs": { - "Check": { - "methods": [ + "ServiceController": { + "clients": { + "grpc": { + "libraryClient": "ServiceControllerClient", + "rpcs": { + "Check": { + "methods": [ "Check" ] }, - "Report": { - "methods": [ + "Report": { + "methods": [ "Report" ] } diff --git a/servicedirectory/apiv1/doc.go b/servicedirectory/apiv1/doc.go index f93f136dbf0..e6d205a5298 100644 --- a/servicedirectory/apiv1/doc.go +++ b/servicedirectory/apiv1/doc.go @@ -49,7 +49,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210612" +const versionClient = "20210624" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/servicedirectory/apiv1/gapic_metadata.json b/servicedirectory/apiv1/gapic_metadata.json index 0cfd6fd3345..a3b82c3fc73 100644 --- a/servicedirectory/apiv1/gapic_metadata.json +++ b/servicedirectory/apiv1/gapic_metadata.json @@ -1,17 +1,17 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.servicedirectory.v1", - "libraryPackage": "cloud.google.com/go/servicedirectory/apiv1", - "services": { - "LookupService": { - "clients": { - "grpc": { - "libraryClient": "LookupClient", - "rpcs": { - "ResolveService": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.servicedirectory.v1", + "libraryPackage": "cloud.google.com/go/servicedirectory/apiv1", + "services": { + "LookupService": { + "clients": { + "grpc": { + "libraryClient": "LookupClient", + "rpcs": { + "ResolveService": { + "methods": [ "ResolveService" ] } @@ -19,98 +19,98 @@ } } }, - "RegistrationService": { - "clients": { - "grpc": { - "libraryClient": "RegistrationClient", - "rpcs": { - "CreateEndpoint": { - "methods": [ + "RegistrationService": { + "clients": { + "grpc": { + "libraryClient": "RegistrationClient", + "rpcs": { + "CreateEndpoint": { + "methods": [ "CreateEndpoint" ] }, - "CreateNamespace": { - "methods": [ + "CreateNamespace": { + "methods": [ "CreateNamespace" ] }, - "CreateService": { - "methods": [ + "CreateService": { + "methods": [ "CreateService" ] }, - "DeleteEndpoint": { - "methods": [ + "DeleteEndpoint": { + "methods": [ "DeleteEndpoint" ] }, - "DeleteNamespace": { - "methods": [ + "DeleteNamespace": { + "methods": [ "DeleteNamespace" ] }, - "DeleteService": { - "methods": [ + "DeleteService": { + "methods": [ "DeleteService" ] }, - "GetEndpoint": { - "methods": [ + "GetEndpoint": { + "methods": [ "GetEndpoint" ] }, - "GetIamPolicy": { - "methods": [ + "GetIamPolicy": { + "methods": [ "GetIamPolicy" ] }, - "GetNamespace": { - "methods": [ + "GetNamespace": { + "methods": [ "GetNamespace" ] }, - "GetService": { - "methods": [ + "GetService": { + "methods": [ "GetService" ] }, - "ListEndpoints": { - "methods": [ + "ListEndpoints": { + "methods": [ "ListEndpoints" ] }, - "ListNamespaces": { - "methods": [ + "ListNamespaces": { + "methods": [ "ListNamespaces" ] }, - "ListServices": { - "methods": [ + "ListServices": { + "methods": [ "ListServices" ] }, - "SetIamPolicy": { - "methods": [ + "SetIamPolicy": { + "methods": [ "SetIamPolicy" ] }, - "TestIamPermissions": { - "methods": [ + "TestIamPermissions": { + "methods": [ "TestIamPermissions" ] }, - "UpdateEndpoint": { - "methods": [ + "UpdateEndpoint": { + "methods": [ "UpdateEndpoint" ] }, - "UpdateNamespace": { - "methods": [ + "UpdateNamespace": { + "methods": [ "UpdateNamespace" ] }, - "UpdateService": { - "methods": [ + "UpdateService": { + "methods": [ "UpdateService" ] } diff --git a/servicedirectory/apiv1/registration_client.go b/servicedirectory/apiv1/registration_client.go index 3d34574d02a..84a6433bb10 100644 --- a/servicedirectory/apiv1/registration_client.go +++ b/servicedirectory/apiv1/registration_client.go @@ -23,7 +23,6 @@ import ( "net/url" "time" - "github.com/golang/protobuf/proto" gax "github.com/googleapis/gax-go/v2" "google.golang.org/api/iterator" "google.golang.org/api/option" @@ -34,6 +33,7 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/proto" ) var newRegistrationClientHook clientHook diff --git a/servicedirectory/apiv1beta1/doc.go b/servicedirectory/apiv1beta1/doc.go index 19602a22a18..84eaaa761a1 100644 --- a/servicedirectory/apiv1beta1/doc.go +++ b/servicedirectory/apiv1beta1/doc.go @@ -17,7 +17,8 @@ // Package servicedirectory is an auto-generated package for the // Service Directory API. // -// Allows the registration and lookup of services. +// Service Directory is a platform for discovering, publishing, and +// connecting services. // // NOTE: This package is in beta. It is not stable, and may be subject to changes. // @@ -50,7 +51,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210612" +const versionClient = "20210624" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/servicedirectory/apiv1beta1/gapic_metadata.json b/servicedirectory/apiv1beta1/gapic_metadata.json index 13f4d2fec39..da14be6c39b 100644 --- a/servicedirectory/apiv1beta1/gapic_metadata.json +++ b/servicedirectory/apiv1beta1/gapic_metadata.json @@ -1,17 +1,17 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.servicedirectory.v1beta1", - "libraryPackage": "cloud.google.com/go/servicedirectory/apiv1beta1", - "services": { - "LookupService": { - "clients": { - "grpc": { - "libraryClient": "LookupClient", - "rpcs": { - "ResolveService": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.servicedirectory.v1beta1", + "libraryPackage": "cloud.google.com/go/servicedirectory/apiv1beta1", + "services": { + "LookupService": { + "clients": { + "grpc": { + "libraryClient": "LookupClient", + "rpcs": { + "ResolveService": { + "methods": [ "ResolveService" ] } @@ -19,98 +19,98 @@ } } }, - "RegistrationService": { - "clients": { - "grpc": { - "libraryClient": "RegistrationClient", - "rpcs": { - "CreateEndpoint": { - "methods": [ + "RegistrationService": { + "clients": { + "grpc": { + "libraryClient": "RegistrationClient", + "rpcs": { + "CreateEndpoint": { + "methods": [ "CreateEndpoint" ] }, - "CreateNamespace": { - "methods": [ + "CreateNamespace": { + "methods": [ "CreateNamespace" ] }, - "CreateService": { - "methods": [ + "CreateService": { + "methods": [ "CreateService" ] }, - "DeleteEndpoint": { - "methods": [ + "DeleteEndpoint": { + "methods": [ "DeleteEndpoint" ] }, - "DeleteNamespace": { - "methods": [ + "DeleteNamespace": { + "methods": [ "DeleteNamespace" ] }, - "DeleteService": { - "methods": [ + "DeleteService": { + "methods": [ "DeleteService" ] }, - "GetEndpoint": { - "methods": [ + "GetEndpoint": { + "methods": [ "GetEndpoint" ] }, - "GetIamPolicy": { - "methods": [ + "GetIamPolicy": { + "methods": [ "GetIamPolicy" ] }, - "GetNamespace": { - "methods": [ + "GetNamespace": { + "methods": [ "GetNamespace" ] }, - "GetService": { - "methods": [ + "GetService": { + "methods": [ "GetService" ] }, - "ListEndpoints": { - "methods": [ + "ListEndpoints": { + "methods": [ "ListEndpoints" ] }, - "ListNamespaces": { - "methods": [ + "ListNamespaces": { + "methods": [ "ListNamespaces" ] }, - "ListServices": { - "methods": [ + "ListServices": { + "methods": [ "ListServices" ] }, - "SetIamPolicy": { - "methods": [ + "SetIamPolicy": { + "methods": [ "SetIamPolicy" ] }, - "TestIamPermissions": { - "methods": [ + "TestIamPermissions": { + "methods": [ "TestIamPermissions" ] }, - "UpdateEndpoint": { - "methods": [ + "UpdateEndpoint": { + "methods": [ "UpdateEndpoint" ] }, - "UpdateNamespace": { - "methods": [ + "UpdateNamespace": { + "methods": [ "UpdateNamespace" ] }, - "UpdateService": { - "methods": [ + "UpdateService": { + "methods": [ "UpdateService" ] } diff --git a/servicedirectory/apiv1beta1/registration_client.go b/servicedirectory/apiv1beta1/registration_client.go index fd720de9409..793c87234f3 100644 --- a/servicedirectory/apiv1beta1/registration_client.go +++ b/servicedirectory/apiv1beta1/registration_client.go @@ -23,7 +23,6 @@ import ( "net/url" "time" - "github.com/golang/protobuf/proto" gax "github.com/googleapis/gax-go/v2" "google.golang.org/api/iterator" "google.golang.org/api/option" @@ -34,6 +33,7 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/proto" ) var newRegistrationClientHook clientHook @@ -366,7 +366,7 @@ func (c *RegistrationClient) Connection() *grpc.ClientConn { return c.internalClient.Connection() } -// CreateNamespace creates a namespace, and returns the new Namespace. +// CreateNamespace creates a namespace, and returns the new namespace. func (c *RegistrationClient) CreateNamespace(ctx context.Context, req *servicedirectorypb.CreateNamespaceRequest, opts ...gax.CallOption) (*servicedirectorypb.Namespace, error) { return c.internalClient.CreateNamespace(ctx, req, opts...) } @@ -392,7 +392,7 @@ func (c *RegistrationClient) DeleteNamespace(ctx context.Context, req *servicedi return c.internalClient.DeleteNamespace(ctx, req, opts...) } -// CreateService creates a service, and returns the new Service. +// CreateService creates a service, and returns the new service. func (c *RegistrationClient) CreateService(ctx context.Context, req *servicedirectorypb.CreateServiceRequest, opts ...gax.CallOption) (*servicedirectorypb.Service, error) { return c.internalClient.CreateService(ctx, req, opts...) } @@ -418,7 +418,7 @@ func (c *RegistrationClient) DeleteService(ctx context.Context, req *servicedire return c.internalClient.DeleteService(ctx, req, opts...) } -// CreateEndpoint creates a endpoint, and returns the new Endpoint. +// CreateEndpoint creates an endpoint, and returns the new endpoint. func (c *RegistrationClient) CreateEndpoint(ctx context.Context, req *servicedirectorypb.CreateEndpointRequest, opts ...gax.CallOption) (*servicedirectorypb.Endpoint, error) { return c.internalClient.CreateEndpoint(ctx, req, opts...) } @@ -428,17 +428,17 @@ func (c *RegistrationClient) ListEndpoints(ctx context.Context, req *servicedire return c.internalClient.ListEndpoints(ctx, req, opts...) } -// GetEndpoint gets a endpoint. +// GetEndpoint gets an endpoint. func (c *RegistrationClient) GetEndpoint(ctx context.Context, req *servicedirectorypb.GetEndpointRequest, opts ...gax.CallOption) (*servicedirectorypb.Endpoint, error) { return c.internalClient.GetEndpoint(ctx, req, opts...) } -// UpdateEndpoint updates a endpoint. +// UpdateEndpoint updates an endpoint. func (c *RegistrationClient) UpdateEndpoint(ctx context.Context, req *servicedirectorypb.UpdateEndpointRequest, opts ...gax.CallOption) (*servicedirectorypb.Endpoint, error) { return c.internalClient.UpdateEndpoint(ctx, req, opts...) } -// DeleteEndpoint deletes a endpoint. +// DeleteEndpoint deletes an endpoint. func (c *RegistrationClient) DeleteEndpoint(ctx context.Context, req *servicedirectorypb.DeleteEndpointRequest, opts ...gax.CallOption) error { return c.internalClient.DeleteEndpoint(ctx, req, opts...) } diff --git a/servicemanagement/apiv1/doc.go b/servicemanagement/apiv1/doc.go index dd2760f31c6..c756a141309 100644 --- a/servicemanagement/apiv1/doc.go +++ b/servicemanagement/apiv1/doc.go @@ -50,7 +50,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210612" +const versionClient = "20210624" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/servicemanagement/apiv1/gapic_metadata.json b/servicemanagement/apiv1/gapic_metadata.json index 76ab2fcdbc3..d494f0192d0 100644 --- a/servicemanagement/apiv1/gapic_metadata.json +++ b/servicemanagement/apiv1/gapic_metadata.json @@ -1,87 +1,87 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.api.servicemanagement.v1", - "libraryPackage": "cloud.google.com/go/servicemanagement/apiv1", - "services": { - "ServiceManager": { - "clients": { - "grpc": { - "libraryClient": "ServiceManagerClient", - "rpcs": { - "CreateService": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.api.servicemanagement.v1", + "libraryPackage": "cloud.google.com/go/servicemanagement/apiv1", + "services": { + "ServiceManager": { + "clients": { + "grpc": { + "libraryClient": "ServiceManagerClient", + "rpcs": { + "CreateService": { + "methods": [ "CreateService" ] }, - "CreateServiceConfig": { - "methods": [ + "CreateServiceConfig": { + "methods": [ "CreateServiceConfig" ] }, - "CreateServiceRollout": { - "methods": [ + "CreateServiceRollout": { + "methods": [ "CreateServiceRollout" ] }, - "DeleteService": { - "methods": [ + "DeleteService": { + "methods": [ "DeleteService" ] }, - "DisableService": { - "methods": [ + "DisableService": { + "methods": [ "DisableService" ] }, - "EnableService": { - "methods": [ + "EnableService": { + "methods": [ "EnableService" ] }, - "GenerateConfigReport": { - "methods": [ + "GenerateConfigReport": { + "methods": [ "GenerateConfigReport" ] }, - "GetService": { - "methods": [ + "GetService": { + "methods": [ "GetService" ] }, - "GetServiceConfig": { - "methods": [ + "GetServiceConfig": { + "methods": [ "GetServiceConfig" ] }, - "GetServiceRollout": { - "methods": [ + "GetServiceRollout": { + "methods": [ "GetServiceRollout" ] }, - "ListServiceConfigs": { - "methods": [ + "ListServiceConfigs": { + "methods": [ "ListServiceConfigs" ] }, - "ListServiceRollouts": { - "methods": [ + "ListServiceRollouts": { + "methods": [ "ListServiceRollouts" ] }, - "ListServices": { - "methods": [ + "ListServices": { + "methods": [ "ListServices" ] }, - "SubmitConfigSource": { - "methods": [ + "SubmitConfigSource": { + "methods": [ "SubmitConfigSource" ] }, - "UndeleteService": { - "methods": [ + "UndeleteService": { + "methods": [ "UndeleteService" ] } diff --git a/servicemanagement/apiv1/service_manager_client.go b/servicemanagement/apiv1/service_manager_client.go index 8069cc18457..f667221e496 100644 --- a/servicemanagement/apiv1/service_manager_client.go +++ b/servicemanagement/apiv1/service_manager_client.go @@ -25,7 +25,6 @@ import ( "cloud.google.com/go/longrunning" lroauto "cloud.google.com/go/longrunning/autogen" - "github.com/golang/protobuf/proto" gax "github.com/googleapis/gax-go/v2" "google.golang.org/api/iterator" "google.golang.org/api/option" @@ -36,6 +35,7 @@ import ( longrunningpb "google.golang.org/genproto/googleapis/longrunning" "google.golang.org/grpc" "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/proto" ) var newServiceManagerClientHook clientHook diff --git a/serviceusage/apiv1/doc.go b/serviceusage/apiv1/doc.go index 3e8607a539c..321e23d599d 100644 --- a/serviceusage/apiv1/doc.go +++ b/serviceusage/apiv1/doc.go @@ -52,7 +52,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210612" +const versionClient = "20210624" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/serviceusage/apiv1/gapic_metadata.json b/serviceusage/apiv1/gapic_metadata.json index 9c9213fb2f5..5df488bbece 100644 --- a/serviceusage/apiv1/gapic_metadata.json +++ b/serviceusage/apiv1/gapic_metadata.json @@ -1,42 +1,42 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.api.serviceusage.v1", - "libraryPackage": "cloud.google.com/go/serviceusage/apiv1", - "services": { - "ServiceUsage": { - "clients": { - "grpc": { - "libraryClient": "Client", - "rpcs": { - "BatchEnableServices": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.api.serviceusage.v1", + "libraryPackage": "cloud.google.com/go/serviceusage/apiv1", + "services": { + "ServiceUsage": { + "clients": { + "grpc": { + "libraryClient": "Client", + "rpcs": { + "BatchEnableServices": { + "methods": [ "BatchEnableServices" ] }, - "BatchGetServices": { - "methods": [ + "BatchGetServices": { + "methods": [ "BatchGetServices" ] }, - "DisableService": { - "methods": [ + "DisableService": { + "methods": [ "DisableService" ] }, - "EnableService": { - "methods": [ + "EnableService": { + "methods": [ "EnableService" ] }, - "GetService": { - "methods": [ + "GetService": { + "methods": [ "GetService" ] }, - "ListServices": { - "methods": [ + "ListServices": { + "methods": [ "ListServices" ] } diff --git a/serviceusage/apiv1/service_usage_client.go b/serviceusage/apiv1/service_usage_client.go index 2865f4750d2..6647a47d09a 100644 --- a/serviceusage/apiv1/service_usage_client.go +++ b/serviceusage/apiv1/service_usage_client.go @@ -25,7 +25,6 @@ import ( "cloud.google.com/go/longrunning" lroauto "cloud.google.com/go/longrunning/autogen" - "github.com/golang/protobuf/proto" gax "github.com/googleapis/gax-go/v2" "google.golang.org/api/iterator" "google.golang.org/api/option" @@ -35,6 +34,7 @@ import ( longrunningpb "google.golang.org/genproto/googleapis/longrunning" "google.golang.org/grpc" "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/proto" ) var newClientHook clientHook diff --git a/shell/apiv1/doc.go b/shell/apiv1/doc.go index b4bf82126c5..6e091e59893 100644 --- a/shell/apiv1/doc.go +++ b/shell/apiv1/doc.go @@ -51,7 +51,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210612" +const versionClient = "20210624" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/shell/apiv1/gapic_metadata.json b/shell/apiv1/gapic_metadata.json index 9f2bef8962e..9ed4b9782fe 100644 --- a/shell/apiv1/gapic_metadata.json +++ b/shell/apiv1/gapic_metadata.json @@ -1,37 +1,37 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.shell.v1", - "libraryPackage": "cloud.google.com/go/shell/apiv1", - "services": { - "CloudShellService": { - "clients": { - "grpc": { - "libraryClient": "CloudShellClient", - "rpcs": { - "AddPublicKey": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.shell.v1", + "libraryPackage": "cloud.google.com/go/shell/apiv1", + "services": { + "CloudShellService": { + "clients": { + "grpc": { + "libraryClient": "CloudShellClient", + "rpcs": { + "AddPublicKey": { + "methods": [ "AddPublicKey" ] }, - "AuthorizeEnvironment": { - "methods": [ + "AuthorizeEnvironment": { + "methods": [ "AuthorizeEnvironment" ] }, - "GetEnvironment": { - "methods": [ + "GetEnvironment": { + "methods": [ "GetEnvironment" ] }, - "RemovePublicKey": { - "methods": [ + "RemovePublicKey": { + "methods": [ "RemovePublicKey" ] }, - "StartEnvironment": { - "methods": [ + "StartEnvironment": { + "methods": [ "StartEnvironment" ] } diff --git a/spanner/admin/database/apiv1/database_admin_client.go b/spanner/admin/database/apiv1/database_admin_client.go index 20f6dcfb4be..01f8fa01303 100644 --- a/spanner/admin/database/apiv1/database_admin_client.go +++ b/spanner/admin/database/apiv1/database_admin_client.go @@ -25,7 +25,6 @@ import ( "cloud.google.com/go/longrunning" lroauto "cloud.google.com/go/longrunning/autogen" - "github.com/golang/protobuf/proto" gax "github.com/googleapis/gax-go/v2" "google.golang.org/api/iterator" "google.golang.org/api/option" @@ -37,6 +36,7 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/proto" ) var newDatabaseAdminClientHook clientHook diff --git a/spanner/admin/database/apiv1/doc.go b/spanner/admin/database/apiv1/doc.go index 850b41026c6..42f3fac44fc 100644 --- a/spanner/admin/database/apiv1/doc.go +++ b/spanner/admin/database/apiv1/doc.go @@ -46,7 +46,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210612" +const versionClient = "20210624" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/spanner/admin/database/apiv1/gapic_metadata.json b/spanner/admin/database/apiv1/gapic_metadata.json index e99be310982..7d6e483909f 100644 --- a/spanner/admin/database/apiv1/gapic_metadata.json +++ b/spanner/admin/database/apiv1/gapic_metadata.json @@ -1,97 +1,97 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.spanner.admin.database.v1", - "libraryPackage": "cloud.google.com/go/spanner/admin/database/apiv1", - "services": { - "DatabaseAdmin": { - "clients": { - "grpc": { - "libraryClient": "DatabaseAdminClient", - "rpcs": { - "CreateBackup": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.spanner.admin.database.v1", + "libraryPackage": "cloud.google.com/go/spanner/admin/database/apiv1", + "services": { + "DatabaseAdmin": { + "clients": { + "grpc": { + "libraryClient": "DatabaseAdminClient", + "rpcs": { + "CreateBackup": { + "methods": [ "CreateBackup" ] }, - "CreateDatabase": { - "methods": [ + "CreateDatabase": { + "methods": [ "CreateDatabase" ] }, - "DeleteBackup": { - "methods": [ + "DeleteBackup": { + "methods": [ "DeleteBackup" ] }, - "DropDatabase": { - "methods": [ + "DropDatabase": { + "methods": [ "DropDatabase" ] }, - "GetBackup": { - "methods": [ + "GetBackup": { + "methods": [ "GetBackup" ] }, - "GetDatabase": { - "methods": [ + "GetDatabase": { + "methods": [ "GetDatabase" ] }, - "GetDatabaseDdl": { - "methods": [ + "GetDatabaseDdl": { + "methods": [ "GetDatabaseDdl" ] }, - "GetIamPolicy": { - "methods": [ + "GetIamPolicy": { + "methods": [ "GetIamPolicy" ] }, - "ListBackupOperations": { - "methods": [ + "ListBackupOperations": { + "methods": [ "ListBackupOperations" ] }, - "ListBackups": { - "methods": [ + "ListBackups": { + "methods": [ "ListBackups" ] }, - "ListDatabaseOperations": { - "methods": [ + "ListDatabaseOperations": { + "methods": [ "ListDatabaseOperations" ] }, - "ListDatabases": { - "methods": [ + "ListDatabases": { + "methods": [ "ListDatabases" ] }, - "RestoreDatabase": { - "methods": [ + "RestoreDatabase": { + "methods": [ "RestoreDatabase" ] }, - "SetIamPolicy": { - "methods": [ + "SetIamPolicy": { + "methods": [ "SetIamPolicy" ] }, - "TestIamPermissions": { - "methods": [ + "TestIamPermissions": { + "methods": [ "TestIamPermissions" ] }, - "UpdateBackup": { - "methods": [ + "UpdateBackup": { + "methods": [ "UpdateBackup" ] }, - "UpdateDatabaseDdl": { - "methods": [ + "UpdateDatabaseDdl": { + "methods": [ "UpdateDatabaseDdl" ] } diff --git a/spanner/admin/instance/apiv1/doc.go b/spanner/admin/instance/apiv1/doc.go index dd79429bdf7..792995f9482 100644 --- a/spanner/admin/instance/apiv1/doc.go +++ b/spanner/admin/instance/apiv1/doc.go @@ -46,7 +46,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210612" +const versionClient = "20210624" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/spanner/admin/instance/apiv1/gapic_metadata.json b/spanner/admin/instance/apiv1/gapic_metadata.json index 641de7334ae..c3ff88742f9 100644 --- a/spanner/admin/instance/apiv1/gapic_metadata.json +++ b/spanner/admin/instance/apiv1/gapic_metadata.json @@ -1,62 +1,62 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.spanner.admin.instance.v1", - "libraryPackage": "cloud.google.com/go/spanner/admin/instance/apiv1", - "services": { - "InstanceAdmin": { - "clients": { - "grpc": { - "libraryClient": "InstanceAdminClient", - "rpcs": { - "CreateInstance": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.spanner.admin.instance.v1", + "libraryPackage": "cloud.google.com/go/spanner/admin/instance/apiv1", + "services": { + "InstanceAdmin": { + "clients": { + "grpc": { + "libraryClient": "InstanceAdminClient", + "rpcs": { + "CreateInstance": { + "methods": [ "CreateInstance" ] }, - "DeleteInstance": { - "methods": [ + "DeleteInstance": { + "methods": [ "DeleteInstance" ] }, - "GetIamPolicy": { - "methods": [ + "GetIamPolicy": { + "methods": [ "GetIamPolicy" ] }, - "GetInstance": { - "methods": [ + "GetInstance": { + "methods": [ "GetInstance" ] }, - "GetInstanceConfig": { - "methods": [ + "GetInstanceConfig": { + "methods": [ "GetInstanceConfig" ] }, - "ListInstanceConfigs": { - "methods": [ + "ListInstanceConfigs": { + "methods": [ "ListInstanceConfigs" ] }, - "ListInstances": { - "methods": [ + "ListInstances": { + "methods": [ "ListInstances" ] }, - "SetIamPolicy": { - "methods": [ + "SetIamPolicy": { + "methods": [ "SetIamPolicy" ] }, - "TestIamPermissions": { - "methods": [ + "TestIamPermissions": { + "methods": [ "TestIamPermissions" ] }, - "UpdateInstance": { - "methods": [ + "UpdateInstance": { + "methods": [ "UpdateInstance" ] } diff --git a/spanner/admin/instance/apiv1/instance_admin_client.go b/spanner/admin/instance/apiv1/instance_admin_client.go index be3e807205e..2353f7c498e 100644 --- a/spanner/admin/instance/apiv1/instance_admin_client.go +++ b/spanner/admin/instance/apiv1/instance_admin_client.go @@ -25,7 +25,6 @@ import ( "cloud.google.com/go/longrunning" lroauto "cloud.google.com/go/longrunning/autogen" - "github.com/golang/protobuf/proto" gax "github.com/googleapis/gax-go/v2" "google.golang.org/api/iterator" "google.golang.org/api/option" @@ -37,6 +36,7 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/proto" ) var newInstanceAdminClientHook clientHook diff --git a/spanner/apiv1/doc.go b/spanner/apiv1/doc.go index 25796fd9e0f..2db56e4e302 100644 --- a/spanner/apiv1/doc.go +++ b/spanner/apiv1/doc.go @@ -49,7 +49,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210612" +const versionClient = "20210624" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/spanner/apiv1/gapic_metadata.json b/spanner/apiv1/gapic_metadata.json index 7a47d346784..1a3d6364729 100644 --- a/spanner/apiv1/gapic_metadata.json +++ b/spanner/apiv1/gapic_metadata.json @@ -1,87 +1,87 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.spanner.v1", - "libraryPackage": "cloud.google.com/go/spanner/apiv1", - "services": { - "Spanner": { - "clients": { - "grpc": { - "libraryClient": "Client", - "rpcs": { - "BatchCreateSessions": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.spanner.v1", + "libraryPackage": "cloud.google.com/go/spanner/apiv1", + "services": { + "Spanner": { + "clients": { + "grpc": { + "libraryClient": "Client", + "rpcs": { + "BatchCreateSessions": { + "methods": [ "BatchCreateSessions" ] }, - "BeginTransaction": { - "methods": [ + "BeginTransaction": { + "methods": [ "BeginTransaction" ] }, - "Commit": { - "methods": [ + "Commit": { + "methods": [ "Commit" ] }, - "CreateSession": { - "methods": [ + "CreateSession": { + "methods": [ "CreateSession" ] }, - "DeleteSession": { - "methods": [ + "DeleteSession": { + "methods": [ "DeleteSession" ] }, - "ExecuteBatchDml": { - "methods": [ + "ExecuteBatchDml": { + "methods": [ "ExecuteBatchDml" ] }, - "ExecuteSql": { - "methods": [ + "ExecuteSql": { + "methods": [ "ExecuteSql" ] }, - "ExecuteStreamingSql": { - "methods": [ + "ExecuteStreamingSql": { + "methods": [ "ExecuteStreamingSql" ] }, - "GetSession": { - "methods": [ + "GetSession": { + "methods": [ "GetSession" ] }, - "ListSessions": { - "methods": [ + "ListSessions": { + "methods": [ "ListSessions" ] }, - "PartitionQuery": { - "methods": [ + "PartitionQuery": { + "methods": [ "PartitionQuery" ] }, - "PartitionRead": { - "methods": [ + "PartitionRead": { + "methods": [ "PartitionRead" ] }, - "Read": { - "methods": [ + "Read": { + "methods": [ "Read" ] }, - "Rollback": { - "methods": [ + "Rollback": { + "methods": [ "Rollback" ] }, - "StreamingRead": { - "methods": [ + "StreamingRead": { + "methods": [ "StreamingRead" ] } diff --git a/spanner/apiv1/spanner_client.go b/spanner/apiv1/spanner_client.go index daf6c274cb4..0ed8a259694 100644 --- a/spanner/apiv1/spanner_client.go +++ b/spanner/apiv1/spanner_client.go @@ -23,7 +23,6 @@ import ( "net/url" "time" - "github.com/golang/protobuf/proto" gax "github.com/googleapis/gax-go/v2" "google.golang.org/api/iterator" "google.golang.org/api/option" @@ -33,6 +32,7 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/proto" ) var newClientHook clientHook diff --git a/spanner/go.mod b/spanner/go.mod index 5740b19b27c..893ca20c52c 100644 --- a/spanner/go.mod +++ b/spanner/go.mod @@ -9,8 +9,8 @@ require ( github.com/googleapis/gax-go/v2 v2.0.5 go.opencensus.io v0.23.0 golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 - google.golang.org/api v0.48.0 - google.golang.org/genproto v0.0.0-20210614143202-012ab6975634 + google.golang.org/api v0.49.0 + google.golang.org/genproto v0.0.0-20210624174822-c5cf32407d0a google.golang.org/grpc v1.38.0 google.golang.org/protobuf v1.26.0 ) diff --git a/spanner/go.sum b/spanner/go.sum index 51829ee2af9..edb7eff7904 100644 --- a/spanner/go.sum +++ b/spanner/go.sum @@ -248,8 +248,9 @@ golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5/go.mod h1:KelEdhl1UZF7XfJ golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210220000619-9bb904979d93/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210313182246-cd4f82c27b84/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c h1:pkQiBZBvdos9qq4wBAHqlzuZHEXo07pqV06ef90u1WI= golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210615190721-d04028783cf1 h1:x622Z2o4hgCr/4CiKWc51jHVKaWdtVpBNmEI8wI9Qns= +golang.org/x/oauth2 v0.0.0-20210615190721-d04028783cf1/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -300,8 +301,9 @@ golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210514084401-e8d321eab015/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210603125802-9665404d3644 h1:CA1DEQ4NdKphKeL70tvsWNdT5oFh1lOjihRcEDROi0I= golang.org/x/sys v0.0.0-20210603125802-9665404d3644/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210616094352-59db8d763f22 h1:RqytpXGR1iVNX7psjB3ff8y7sNFinVFvkx1c8SjBkio= +golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -392,8 +394,9 @@ google.golang.org/api v0.40.0/go.mod h1:fYKFpnQN0DsDSKRVRcQSDQNtqWPfM9i+zNPxepjR google.golang.org/api v0.41.0/go.mod h1:RkxM5lITDfTzmyKFPt+wGrCJbVfniCr2ool8kTBzRTU= google.golang.org/api v0.43.0/go.mod h1:nQsDGjRXMo4lvh5hP0TKqF244gqhGcr/YSIykhUk/94= google.golang.org/api v0.47.0/go.mod h1:Wbvgpq1HddcWVtzsVLyfLp8lDg6AA241LmgIL59tHXo= -google.golang.org/api v0.48.0 h1:RDAPWfNFY06dffEXfn7hZF5Fr1ZbnChzfQZAPyBd1+I= google.golang.org/api v0.48.0/go.mod h1:71Pr1vy+TAZRPkPs/xlCf5SsU8WjuAWv1Pfjbtukyy4= +google.golang.org/api v0.49.0 h1:gjIBDxlTG7vnzMmEnYwTnvLTF8Rjzo+ETCgEX1YZ/fY= +google.golang.org/api v0.49.0/go.mod h1:BECiH72wsfwUvOVn3+btPD5WHi0LzavZReBndi42L18= 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.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= @@ -445,8 +448,9 @@ google.golang.org/genproto v0.0.0-20210513213006-bf773b8c8384/go.mod h1:P3QM42oQ google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= google.golang.org/genproto v0.0.0-20210604141403-392c879c8b08/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= google.golang.org/genproto v0.0.0-20210608205507-b6d2f5bf0d7d/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= -google.golang.org/genproto v0.0.0-20210614143202-012ab6975634 h1:LnkHrvncK4mYysgs+R1wPeMAILrmunf0Tzl0Li71pxo= -google.golang.org/genproto v0.0.0-20210614143202-012ab6975634/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24= +google.golang.org/genproto v0.0.0-20210617175327-b9e0b3197ced/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24= +google.golang.org/genproto v0.0.0-20210624174822-c5cf32407d0a h1:b5Bhxmy6Tppar7Yl4J6c6xF33YSBhkm2FtV9/ZQuBkQ= +google.golang.org/genproto v0.0.0-20210624174822-c5cf32407d0a/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= diff --git a/speech/apiv1/doc.go b/speech/apiv1/doc.go index 87a2a09a70f..897c3a18ea1 100644 --- a/speech/apiv1/doc.go +++ b/speech/apiv1/doc.go @@ -48,7 +48,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210612" +const versionClient = "20210624" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/speech/apiv1/gapic_metadata.json b/speech/apiv1/gapic_metadata.json index 299da42f5ed..cdc96357a36 100644 --- a/speech/apiv1/gapic_metadata.json +++ b/speech/apiv1/gapic_metadata.json @@ -1,27 +1,27 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.speech.v1", - "libraryPackage": "cloud.google.com/go/speech/apiv1", - "services": { - "Speech": { - "clients": { - "grpc": { - "libraryClient": "Client", - "rpcs": { - "LongRunningRecognize": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.speech.v1", + "libraryPackage": "cloud.google.com/go/speech/apiv1", + "services": { + "Speech": { + "clients": { + "grpc": { + "libraryClient": "Client", + "rpcs": { + "LongRunningRecognize": { + "methods": [ "LongRunningRecognize" ] }, - "Recognize": { - "methods": [ + "Recognize": { + "methods": [ "Recognize" ] }, - "StreamingRecognize": { - "methods": [ + "StreamingRecognize": { + "methods": [ "StreamingRecognize" ] } diff --git a/speech/apiv1p1beta1/adaptation_client.go b/speech/apiv1p1beta1/adaptation_client.go index 826101772e9..9c1348c84f7 100644 --- a/speech/apiv1p1beta1/adaptation_client.go +++ b/speech/apiv1p1beta1/adaptation_client.go @@ -22,7 +22,6 @@ import ( "math" "net/url" - "github.com/golang/protobuf/proto" gax "github.com/googleapis/gax-go/v2" "google.golang.org/api/iterator" "google.golang.org/api/option" @@ -31,6 +30,7 @@ import ( speechpb "google.golang.org/genproto/googleapis/cloud/speech/v1p1beta1" "google.golang.org/grpc" "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/proto" ) var newAdaptationClientHook clientHook diff --git a/speech/apiv1p1beta1/doc.go b/speech/apiv1p1beta1/doc.go index 79816a293b3..9d0317a959d 100644 --- a/speech/apiv1p1beta1/doc.go +++ b/speech/apiv1p1beta1/doc.go @@ -50,7 +50,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210612" +const versionClient = "20210624" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/speech/apiv1p1beta1/gapic_metadata.json b/speech/apiv1p1beta1/gapic_metadata.json index 37520a28aee..99d872caa8f 100644 --- a/speech/apiv1p1beta1/gapic_metadata.json +++ b/speech/apiv1p1beta1/gapic_metadata.json @@ -1,62 +1,62 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.speech.v1p1beta1", - "libraryPackage": "cloud.google.com/go/speech/apiv1p1beta1", - "services": { - "Adaptation": { - "clients": { - "grpc": { - "libraryClient": "AdaptationClient", - "rpcs": { - "CreateCustomClass": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.speech.v1p1beta1", + "libraryPackage": "cloud.google.com/go/speech/apiv1p1beta1", + "services": { + "Adaptation": { + "clients": { + "grpc": { + "libraryClient": "AdaptationClient", + "rpcs": { + "CreateCustomClass": { + "methods": [ "CreateCustomClass" ] }, - "CreatePhraseSet": { - "methods": [ + "CreatePhraseSet": { + "methods": [ "CreatePhraseSet" ] }, - "DeleteCustomClass": { - "methods": [ + "DeleteCustomClass": { + "methods": [ "DeleteCustomClass" ] }, - "DeletePhraseSet": { - "methods": [ + "DeletePhraseSet": { + "methods": [ "DeletePhraseSet" ] }, - "GetCustomClass": { - "methods": [ + "GetCustomClass": { + "methods": [ "GetCustomClass" ] }, - "GetPhraseSet": { - "methods": [ + "GetPhraseSet": { + "methods": [ "GetPhraseSet" ] }, - "ListCustomClasses": { - "methods": [ + "ListCustomClasses": { + "methods": [ "ListCustomClasses" ] }, - "ListPhraseSet": { - "methods": [ + "ListPhraseSet": { + "methods": [ "ListPhraseSet" ] }, - "UpdateCustomClass": { - "methods": [ + "UpdateCustomClass": { + "methods": [ "UpdateCustomClass" ] }, - "UpdatePhraseSet": { - "methods": [ + "UpdatePhraseSet": { + "methods": [ "UpdatePhraseSet" ] } @@ -64,23 +64,23 @@ } } }, - "Speech": { - "clients": { - "grpc": { - "libraryClient": "Client", - "rpcs": { - "LongRunningRecognize": { - "methods": [ + "Speech": { + "clients": { + "grpc": { + "libraryClient": "Client", + "rpcs": { + "LongRunningRecognize": { + "methods": [ "LongRunningRecognize" ] }, - "Recognize": { - "methods": [ + "Recognize": { + "methods": [ "Recognize" ] }, - "StreamingRecognize": { - "methods": [ + "StreamingRecognize": { + "methods": [ "StreamingRecognize" ] } diff --git a/storage/go.mod b/storage/go.mod index 49afaa129d5..8c26dec3407 100644 --- a/storage/go.mod +++ b/storage/go.mod @@ -9,7 +9,7 @@ require ( github.com/googleapis/gax-go/v2 v2.0.5 golang.org/x/oauth2 v0.0.0-20210615190721-d04028783cf1 golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 - google.golang.org/api v0.48.0 - google.golang.org/genproto v0.0.0-20210608205507-b6d2f5bf0d7d + google.golang.org/api v0.49.0 + google.golang.org/genproto v0.0.0-20210624174822-c5cf32407d0a google.golang.org/grpc v1.38.0 ) diff --git a/storage/go.sum b/storage/go.sum index 33b470ce572..85fa87a6d5d 100644 --- a/storage/go.sum +++ b/storage/go.sum @@ -304,8 +304,9 @@ golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210514084401-e8d321eab015/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210603125802-9665404d3644 h1:CA1DEQ4NdKphKeL70tvsWNdT5oFh1lOjihRcEDROi0I= golang.org/x/sys v0.0.0-20210603125802-9665404d3644/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210616094352-59db8d763f22 h1:RqytpXGR1iVNX7psjB3ff8y7sNFinVFvkx1c8SjBkio= +golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -366,8 +367,9 @@ golang.org/x/tools v0.0.0-20201208233053-a543418bbed2/go.mod h1:emZCQorbCU4vsT4f golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/tools v0.1.2 h1:kRBLX7v7Af8W7Gdbbc908OJcdgtK8bOz9Uaj8/F1ACA= golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/tools v0.1.3 h1:L69ShwSZEyCsLKoAxDKeMvLDZkumEe8gXUZAjab0tX8= +golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= 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= @@ -395,8 +397,9 @@ google.golang.org/api v0.40.0/go.mod h1:fYKFpnQN0DsDSKRVRcQSDQNtqWPfM9i+zNPxepjR google.golang.org/api v0.41.0/go.mod h1:RkxM5lITDfTzmyKFPt+wGrCJbVfniCr2ool8kTBzRTU= google.golang.org/api v0.43.0/go.mod h1:nQsDGjRXMo4lvh5hP0TKqF244gqhGcr/YSIykhUk/94= google.golang.org/api v0.47.0/go.mod h1:Wbvgpq1HddcWVtzsVLyfLp8lDg6AA241LmgIL59tHXo= -google.golang.org/api v0.48.0 h1:RDAPWfNFY06dffEXfn7hZF5Fr1ZbnChzfQZAPyBd1+I= google.golang.org/api v0.48.0/go.mod h1:71Pr1vy+TAZRPkPs/xlCf5SsU8WjuAWv1Pfjbtukyy4= +google.golang.org/api v0.49.0 h1:gjIBDxlTG7vnzMmEnYwTnvLTF8Rjzo+ETCgEX1YZ/fY= +google.golang.org/api v0.49.0/go.mod h1:BECiH72wsfwUvOVn3+btPD5WHi0LzavZReBndi42L18= 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.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= @@ -447,8 +450,10 @@ google.golang.org/genproto v0.0.0-20210402141018-6c239bbf2bb1/go.mod h1:9lPAdzaE google.golang.org/genproto v0.0.0-20210513213006-bf773b8c8384/go.mod h1:P3QM42oQyzQSnHPnZ/vqoCdDmzH28fzWByN9asMeM8A= google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= google.golang.org/genproto v0.0.0-20210604141403-392c879c8b08/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= -google.golang.org/genproto v0.0.0-20210608205507-b6d2f5bf0d7d h1:KzwjikDymrEmYYbdyfievTwjEeGlu+OM6oiKBkF3Jfg= google.golang.org/genproto v0.0.0-20210608205507-b6d2f5bf0d7d/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= +google.golang.org/genproto v0.0.0-20210617175327-b9e0b3197ced/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24= +google.golang.org/genproto v0.0.0-20210624174822-c5cf32407d0a h1:b5Bhxmy6Tppar7Yl4J6c6xF33YSBhkm2FtV9/ZQuBkQ= +google.golang.org/genproto v0.0.0-20210624174822-c5cf32407d0a/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= diff --git a/talent/apiv4/company_client.go b/talent/apiv4/company_client.go index 55a1a3a8313..9466b8deb75 100644 --- a/talent/apiv4/company_client.go +++ b/talent/apiv4/company_client.go @@ -23,7 +23,6 @@ import ( "net/url" "time" - "github.com/golang/protobuf/proto" gax "github.com/googleapis/gax-go/v2" "google.golang.org/api/iterator" "google.golang.org/api/option" @@ -33,6 +32,7 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/proto" ) var newCompanyClientHook clientHook diff --git a/talent/apiv4/doc.go b/talent/apiv4/doc.go index 8da945dceb9..fd584b93567 100644 --- a/talent/apiv4/doc.go +++ b/talent/apiv4/doc.go @@ -51,7 +51,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210612" +const versionClient = "20210624" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/talent/apiv4/gapic_metadata.json b/talent/apiv4/gapic_metadata.json index 864dcdd90bd..d61c4881dc0 100644 --- a/talent/apiv4/gapic_metadata.json +++ b/talent/apiv4/gapic_metadata.json @@ -1,37 +1,37 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.talent.v4", - "libraryPackage": "cloud.google.com/go/talent/apiv4", - "services": { - "CompanyService": { - "clients": { - "grpc": { - "libraryClient": "CompanyClient", - "rpcs": { - "CreateCompany": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.talent.v4", + "libraryPackage": "cloud.google.com/go/talent/apiv4", + "services": { + "CompanyService": { + "clients": { + "grpc": { + "libraryClient": "CompanyClient", + "rpcs": { + "CreateCompany": { + "methods": [ "CreateCompany" ] }, - "DeleteCompany": { - "methods": [ + "DeleteCompany": { + "methods": [ "DeleteCompany" ] }, - "GetCompany": { - "methods": [ + "GetCompany": { + "methods": [ "GetCompany" ] }, - "ListCompanies": { - "methods": [ + "ListCompanies": { + "methods": [ "ListCompanies" ] }, - "UpdateCompany": { - "methods": [ + "UpdateCompany": { + "methods": [ "UpdateCompany" ] } @@ -39,13 +39,13 @@ } } }, - "Completion": { - "clients": { - "grpc": { - "libraryClient": "CompletionClient", - "rpcs": { - "CompleteQuery": { - "methods": [ + "Completion": { + "clients": { + "grpc": { + "libraryClient": "CompletionClient", + "rpcs": { + "CompleteQuery": { + "methods": [ "CompleteQuery" ] } @@ -53,13 +53,13 @@ } } }, - "EventService": { - "clients": { - "grpc": { - "libraryClient": "EventClient", - "rpcs": { - "CreateClientEvent": { - "methods": [ + "EventService": { + "clients": { + "grpc": { + "libraryClient": "EventClient", + "rpcs": { + "CreateClientEvent": { + "methods": [ "CreateClientEvent" ] } @@ -67,58 +67,58 @@ } } }, - "JobService": { - "clients": { - "grpc": { - "libraryClient": "JobClient", - "rpcs": { - "BatchCreateJobs": { - "methods": [ + "JobService": { + "clients": { + "grpc": { + "libraryClient": "JobClient", + "rpcs": { + "BatchCreateJobs": { + "methods": [ "BatchCreateJobs" ] }, - "BatchDeleteJobs": { - "methods": [ + "BatchDeleteJobs": { + "methods": [ "BatchDeleteJobs" ] }, - "BatchUpdateJobs": { - "methods": [ + "BatchUpdateJobs": { + "methods": [ "BatchUpdateJobs" ] }, - "CreateJob": { - "methods": [ + "CreateJob": { + "methods": [ "CreateJob" ] }, - "DeleteJob": { - "methods": [ + "DeleteJob": { + "methods": [ "DeleteJob" ] }, - "GetJob": { - "methods": [ + "GetJob": { + "methods": [ "GetJob" ] }, - "ListJobs": { - "methods": [ + "ListJobs": { + "methods": [ "ListJobs" ] }, - "SearchJobs": { - "methods": [ + "SearchJobs": { + "methods": [ "SearchJobs" ] }, - "SearchJobsForAlert": { - "methods": [ + "SearchJobsForAlert": { + "methods": [ "SearchJobsForAlert" ] }, - "UpdateJob": { - "methods": [ + "UpdateJob": { + "methods": [ "UpdateJob" ] } @@ -126,33 +126,33 @@ } } }, - "TenantService": { - "clients": { - "grpc": { - "libraryClient": "TenantClient", - "rpcs": { - "CreateTenant": { - "methods": [ + "TenantService": { + "clients": { + "grpc": { + "libraryClient": "TenantClient", + "rpcs": { + "CreateTenant": { + "methods": [ "CreateTenant" ] }, - "DeleteTenant": { - "methods": [ + "DeleteTenant": { + "methods": [ "DeleteTenant" ] }, - "GetTenant": { - "methods": [ + "GetTenant": { + "methods": [ "GetTenant" ] }, - "ListTenants": { - "methods": [ + "ListTenants": { + "methods": [ "ListTenants" ] }, - "UpdateTenant": { - "methods": [ + "UpdateTenant": { + "methods": [ "UpdateTenant" ] } diff --git a/talent/apiv4/job_client.go b/talent/apiv4/job_client.go index 80364f9cdae..a47197170b8 100644 --- a/talent/apiv4/job_client.go +++ b/talent/apiv4/job_client.go @@ -25,7 +25,6 @@ import ( "cloud.google.com/go/longrunning" lroauto "cloud.google.com/go/longrunning/autogen" - "github.com/golang/protobuf/proto" gax "github.com/googleapis/gax-go/v2" "google.golang.org/api/iterator" "google.golang.org/api/option" @@ -36,6 +35,7 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/proto" ) var newJobClientHook clientHook diff --git a/talent/apiv4/tenant_client.go b/talent/apiv4/tenant_client.go index dd0d84a4602..d12b895a231 100644 --- a/talent/apiv4/tenant_client.go +++ b/talent/apiv4/tenant_client.go @@ -23,7 +23,6 @@ import ( "net/url" "time" - "github.com/golang/protobuf/proto" gax "github.com/googleapis/gax-go/v2" "google.golang.org/api/iterator" "google.golang.org/api/option" @@ -33,6 +32,7 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/proto" ) var newTenantClientHook clientHook diff --git a/talent/apiv4beta1/application_client.go b/talent/apiv4beta1/application_client.go index 04c6c850346..ffd562915c2 100644 --- a/talent/apiv4beta1/application_client.go +++ b/talent/apiv4beta1/application_client.go @@ -23,7 +23,6 @@ import ( "net/url" "time" - "github.com/golang/protobuf/proto" gax "github.com/googleapis/gax-go/v2" "google.golang.org/api/iterator" "google.golang.org/api/option" @@ -33,6 +32,7 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/proto" ) var newApplicationClientHook clientHook diff --git a/talent/apiv4beta1/company_client.go b/talent/apiv4beta1/company_client.go index adc945b34c1..6e2f976e794 100644 --- a/talent/apiv4beta1/company_client.go +++ b/talent/apiv4beta1/company_client.go @@ -23,7 +23,6 @@ import ( "net/url" "time" - "github.com/golang/protobuf/proto" gax "github.com/googleapis/gax-go/v2" "google.golang.org/api/iterator" "google.golang.org/api/option" @@ -33,6 +32,7 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/proto" ) var newCompanyClientHook clientHook diff --git a/talent/apiv4beta1/doc.go b/talent/apiv4beta1/doc.go index 3740f9943b3..ffb43e644cf 100644 --- a/talent/apiv4beta1/doc.go +++ b/talent/apiv4beta1/doc.go @@ -51,7 +51,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210612" +const versionClient = "20210624" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/talent/apiv4beta1/gapic_metadata.json b/talent/apiv4beta1/gapic_metadata.json index 5bfc350233b..f51c8de5b4d 100644 --- a/talent/apiv4beta1/gapic_metadata.json +++ b/talent/apiv4beta1/gapic_metadata.json @@ -1,37 +1,37 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.talent.v4beta1", - "libraryPackage": "cloud.google.com/go/talent/apiv4beta1", - "services": { - "ApplicationService": { - "clients": { - "grpc": { - "libraryClient": "ApplicationClient", - "rpcs": { - "CreateApplication": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.talent.v4beta1", + "libraryPackage": "cloud.google.com/go/talent/apiv4beta1", + "services": { + "ApplicationService": { + "clients": { + "grpc": { + "libraryClient": "ApplicationClient", + "rpcs": { + "CreateApplication": { + "methods": [ "CreateApplication" ] }, - "DeleteApplication": { - "methods": [ + "DeleteApplication": { + "methods": [ "DeleteApplication" ] }, - "GetApplication": { - "methods": [ + "GetApplication": { + "methods": [ "GetApplication" ] }, - "ListApplications": { - "methods": [ + "ListApplications": { + "methods": [ "ListApplications" ] }, - "UpdateApplication": { - "methods": [ + "UpdateApplication": { + "methods": [ "UpdateApplication" ] } @@ -39,33 +39,33 @@ } } }, - "CompanyService": { - "clients": { - "grpc": { - "libraryClient": "CompanyClient", - "rpcs": { - "CreateCompany": { - "methods": [ + "CompanyService": { + "clients": { + "grpc": { + "libraryClient": "CompanyClient", + "rpcs": { + "CreateCompany": { + "methods": [ "CreateCompany" ] }, - "DeleteCompany": { - "methods": [ + "DeleteCompany": { + "methods": [ "DeleteCompany" ] }, - "GetCompany": { - "methods": [ + "GetCompany": { + "methods": [ "GetCompany" ] }, - "ListCompanies": { - "methods": [ + "ListCompanies": { + "methods": [ "ListCompanies" ] }, - "UpdateCompany": { - "methods": [ + "UpdateCompany": { + "methods": [ "UpdateCompany" ] } @@ -73,13 +73,13 @@ } } }, - "Completion": { - "clients": { - "grpc": { - "libraryClient": "CompletionClient", - "rpcs": { - "CompleteQuery": { - "methods": [ + "Completion": { + "clients": { + "grpc": { + "libraryClient": "CompletionClient", + "rpcs": { + "CompleteQuery": { + "methods": [ "CompleteQuery" ] } @@ -87,13 +87,13 @@ } } }, - "EventService": { - "clients": { - "grpc": { - "libraryClient": "EventClient", - "rpcs": { - "CreateClientEvent": { - "methods": [ + "EventService": { + "clients": { + "grpc": { + "libraryClient": "EventClient", + "rpcs": { + "CreateClientEvent": { + "methods": [ "CreateClientEvent" ] } @@ -101,58 +101,58 @@ } } }, - "JobService": { - "clients": { - "grpc": { - "libraryClient": "JobClient", - "rpcs": { - "BatchCreateJobs": { - "methods": [ + "JobService": { + "clients": { + "grpc": { + "libraryClient": "JobClient", + "rpcs": { + "BatchCreateJobs": { + "methods": [ "BatchCreateJobs" ] }, - "BatchDeleteJobs": { - "methods": [ + "BatchDeleteJobs": { + "methods": [ "BatchDeleteJobs" ] }, - "BatchUpdateJobs": { - "methods": [ + "BatchUpdateJobs": { + "methods": [ "BatchUpdateJobs" ] }, - "CreateJob": { - "methods": [ + "CreateJob": { + "methods": [ "CreateJob" ] }, - "DeleteJob": { - "methods": [ + "DeleteJob": { + "methods": [ "DeleteJob" ] }, - "GetJob": { - "methods": [ + "GetJob": { + "methods": [ "GetJob" ] }, - "ListJobs": { - "methods": [ + "ListJobs": { + "methods": [ "ListJobs" ] }, - "SearchJobs": { - "methods": [ + "SearchJobs": { + "methods": [ "SearchJobs" ] }, - "SearchJobsForAlert": { - "methods": [ + "SearchJobsForAlert": { + "methods": [ "SearchJobsForAlert" ] }, - "UpdateJob": { - "methods": [ + "UpdateJob": { + "methods": [ "UpdateJob" ] } @@ -160,38 +160,38 @@ } } }, - "ProfileService": { - "clients": { - "grpc": { - "libraryClient": "ProfileClient", - "rpcs": { - "CreateProfile": { - "methods": [ + "ProfileService": { + "clients": { + "grpc": { + "libraryClient": "ProfileClient", + "rpcs": { + "CreateProfile": { + "methods": [ "CreateProfile" ] }, - "DeleteProfile": { - "methods": [ + "DeleteProfile": { + "methods": [ "DeleteProfile" ] }, - "GetProfile": { - "methods": [ + "GetProfile": { + "methods": [ "GetProfile" ] }, - "ListProfiles": { - "methods": [ + "ListProfiles": { + "methods": [ "ListProfiles" ] }, - "SearchProfiles": { - "methods": [ + "SearchProfiles": { + "methods": [ "SearchProfiles" ] }, - "UpdateProfile": { - "methods": [ + "UpdateProfile": { + "methods": [ "UpdateProfile" ] } @@ -199,33 +199,33 @@ } } }, - "TenantService": { - "clients": { - "grpc": { - "libraryClient": "TenantClient", - "rpcs": { - "CreateTenant": { - "methods": [ + "TenantService": { + "clients": { + "grpc": { + "libraryClient": "TenantClient", + "rpcs": { + "CreateTenant": { + "methods": [ "CreateTenant" ] }, - "DeleteTenant": { - "methods": [ + "DeleteTenant": { + "methods": [ "DeleteTenant" ] }, - "GetTenant": { - "methods": [ + "GetTenant": { + "methods": [ "GetTenant" ] }, - "ListTenants": { - "methods": [ + "ListTenants": { + "methods": [ "ListTenants" ] }, - "UpdateTenant": { - "methods": [ + "UpdateTenant": { + "methods": [ "UpdateTenant" ] } diff --git a/talent/apiv4beta1/job_client.go b/talent/apiv4beta1/job_client.go index eb3db308caf..82361f32844 100644 --- a/talent/apiv4beta1/job_client.go +++ b/talent/apiv4beta1/job_client.go @@ -25,7 +25,6 @@ import ( "cloud.google.com/go/longrunning" lroauto "cloud.google.com/go/longrunning/autogen" - "github.com/golang/protobuf/proto" gax "github.com/googleapis/gax-go/v2" "google.golang.org/api/iterator" "google.golang.org/api/option" @@ -36,6 +35,7 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/proto" ) var newJobClientHook clientHook diff --git a/talent/apiv4beta1/profile_client.go b/talent/apiv4beta1/profile_client.go index c560b18913c..107ddff8bad 100644 --- a/talent/apiv4beta1/profile_client.go +++ b/talent/apiv4beta1/profile_client.go @@ -23,7 +23,6 @@ import ( "net/url" "time" - "github.com/golang/protobuf/proto" gax "github.com/googleapis/gax-go/v2" "google.golang.org/api/iterator" "google.golang.org/api/option" @@ -33,6 +32,7 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/proto" ) var newProfileClientHook clientHook diff --git a/talent/apiv4beta1/tenant_client.go b/talent/apiv4beta1/tenant_client.go index 43185d4be66..0a387119e50 100644 --- a/talent/apiv4beta1/tenant_client.go +++ b/talent/apiv4beta1/tenant_client.go @@ -23,7 +23,6 @@ import ( "net/url" "time" - "github.com/golang/protobuf/proto" gax "github.com/googleapis/gax-go/v2" "google.golang.org/api/iterator" "google.golang.org/api/option" @@ -33,6 +32,7 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/proto" ) var newTenantClientHook clientHook diff --git a/texttospeech/apiv1/doc.go b/texttospeech/apiv1/doc.go index 8b517b678b9..14ec6d91de7 100644 --- a/texttospeech/apiv1/doc.go +++ b/texttospeech/apiv1/doc.go @@ -49,7 +49,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210612" +const versionClient = "20210624" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/texttospeech/apiv1/gapic_metadata.json b/texttospeech/apiv1/gapic_metadata.json index 111b0361dca..db921930a9e 100644 --- a/texttospeech/apiv1/gapic_metadata.json +++ b/texttospeech/apiv1/gapic_metadata.json @@ -1,22 +1,22 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.texttospeech.v1", - "libraryPackage": "cloud.google.com/go/texttospeech/apiv1", - "services": { - "TextToSpeech": { - "clients": { - "grpc": { - "libraryClient": "Client", - "rpcs": { - "ListVoices": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.texttospeech.v1", + "libraryPackage": "cloud.google.com/go/texttospeech/apiv1", + "services": { + "TextToSpeech": { + "clients": { + "grpc": { + "libraryClient": "Client", + "rpcs": { + "ListVoices": { + "methods": [ "ListVoices" ] }, - "SynthesizeSpeech": { - "methods": [ + "SynthesizeSpeech": { + "methods": [ "SynthesizeSpeech" ] } diff --git a/tpu/apiv1/doc.go b/tpu/apiv1/doc.go index cef448e3407..cfebc7eb24d 100644 --- a/tpu/apiv1/doc.go +++ b/tpu/apiv1/doc.go @@ -50,7 +50,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210612" +const versionClient = "20210624" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/tpu/apiv1/gapic_metadata.json b/tpu/apiv1/gapic_metadata.json index 3144ece1f5d..78db6c59e59 100644 --- a/tpu/apiv1/gapic_metadata.json +++ b/tpu/apiv1/gapic_metadata.json @@ -1,67 +1,67 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.tpu.v1", - "libraryPackage": "cloud.google.com/go/tpu/apiv1", - "services": { - "Tpu": { - "clients": { - "grpc": { - "libraryClient": "Client", - "rpcs": { - "CreateNode": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.tpu.v1", + "libraryPackage": "cloud.google.com/go/tpu/apiv1", + "services": { + "Tpu": { + "clients": { + "grpc": { + "libraryClient": "Client", + "rpcs": { + "CreateNode": { + "methods": [ "CreateNode" ] }, - "DeleteNode": { - "methods": [ + "DeleteNode": { + "methods": [ "DeleteNode" ] }, - "GetAcceleratorType": { - "methods": [ + "GetAcceleratorType": { + "methods": [ "GetAcceleratorType" ] }, - "GetNode": { - "methods": [ + "GetNode": { + "methods": [ "GetNode" ] }, - "GetTensorFlowVersion": { - "methods": [ + "GetTensorFlowVersion": { + "methods": [ "GetTensorFlowVersion" ] }, - "ListAcceleratorTypes": { - "methods": [ + "ListAcceleratorTypes": { + "methods": [ "ListAcceleratorTypes" ] }, - "ListNodes": { - "methods": [ + "ListNodes": { + "methods": [ "ListNodes" ] }, - "ListTensorFlowVersions": { - "methods": [ + "ListTensorFlowVersions": { + "methods": [ "ListTensorFlowVersions" ] }, - "ReimageNode": { - "methods": [ + "ReimageNode": { + "methods": [ "ReimageNode" ] }, - "StartNode": { - "methods": [ + "StartNode": { + "methods": [ "StartNode" ] }, - "StopNode": { - "methods": [ + "StopNode": { + "methods": [ "StopNode" ] } diff --git a/tpu/apiv1/tpu_client.go b/tpu/apiv1/tpu_client.go index baa260c9317..ba66f1e388c 100644 --- a/tpu/apiv1/tpu_client.go +++ b/tpu/apiv1/tpu_client.go @@ -25,7 +25,6 @@ import ( "cloud.google.com/go/longrunning" lroauto "cloud.google.com/go/longrunning/autogen" - "github.com/golang/protobuf/proto" gax "github.com/googleapis/gax-go/v2" "google.golang.org/api/iterator" "google.golang.org/api/option" @@ -35,6 +34,7 @@ import ( longrunningpb "google.golang.org/genproto/googleapis/longrunning" "google.golang.org/grpc" "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/proto" ) var newClientHook clientHook diff --git a/trace/apiv1/doc.go b/trace/apiv1/doc.go index 2d939089be3..407e7783902 100644 --- a/trace/apiv1/doc.go +++ b/trace/apiv1/doc.go @@ -52,7 +52,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210612" +const versionClient = "20210624" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/trace/apiv1/gapic_metadata.json b/trace/apiv1/gapic_metadata.json index 173594929e9..8e90e970426 100644 --- a/trace/apiv1/gapic_metadata.json +++ b/trace/apiv1/gapic_metadata.json @@ -1,27 +1,27 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.devtools.cloudtrace.v1", - "libraryPackage": "cloud.google.com/go/trace/apiv1", - "services": { - "TraceService": { - "clients": { - "grpc": { - "libraryClient": "Client", - "rpcs": { - "GetTrace": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.devtools.cloudtrace.v1", + "libraryPackage": "cloud.google.com/go/trace/apiv1", + "services": { + "TraceService": { + "clients": { + "grpc": { + "libraryClient": "Client", + "rpcs": { + "GetTrace": { + "methods": [ "GetTrace" ] }, - "ListTraces": { - "methods": [ + "ListTraces": { + "methods": [ "ListTraces" ] }, - "PatchTraces": { - "methods": [ + "PatchTraces": { + "methods": [ "PatchTraces" ] } diff --git a/trace/apiv1/trace_client.go b/trace/apiv1/trace_client.go index 62a3071395e..3b06fbf5845 100644 --- a/trace/apiv1/trace_client.go +++ b/trace/apiv1/trace_client.go @@ -23,7 +23,6 @@ import ( "net/url" "time" - "github.com/golang/protobuf/proto" gax "github.com/googleapis/gax-go/v2" "google.golang.org/api/iterator" "google.golang.org/api/option" @@ -33,6 +32,7 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/proto" ) var newClientHook clientHook diff --git a/trace/apiv2/doc.go b/trace/apiv2/doc.go index 7e3bc4729c2..7929e74396d 100644 --- a/trace/apiv2/doc.go +++ b/trace/apiv2/doc.go @@ -52,7 +52,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210612" +const versionClient = "20210624" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/trace/apiv2/gapic_metadata.json b/trace/apiv2/gapic_metadata.json index ef3c8d6d045..30874dcba3d 100644 --- a/trace/apiv2/gapic_metadata.json +++ b/trace/apiv2/gapic_metadata.json @@ -1,22 +1,22 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.devtools.cloudtrace.v2", - "libraryPackage": "cloud.google.com/go/trace/apiv2", - "services": { - "TraceService": { - "clients": { - "grpc": { - "libraryClient": "Client", - "rpcs": { - "BatchWriteSpans": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.devtools.cloudtrace.v2", + "libraryPackage": "cloud.google.com/go/trace/apiv2", + "services": { + "TraceService": { + "clients": { + "grpc": { + "libraryClient": "Client", + "rpcs": { + "BatchWriteSpans": { + "methods": [ "BatchWriteSpans" ] }, - "CreateSpan": { - "methods": [ + "CreateSpan": { + "methods": [ "CreateSpan" ] } diff --git a/translate/apiv3/doc.go b/translate/apiv3/doc.go index af8810b26d3..498366c5a4e 100644 --- a/translate/apiv3/doc.go +++ b/translate/apiv3/doc.go @@ -48,7 +48,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210612" +const versionClient = "20210624" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/translate/apiv3/gapic_metadata.json b/translate/apiv3/gapic_metadata.json index cc792ac4728..674769576bf 100644 --- a/translate/apiv3/gapic_metadata.json +++ b/translate/apiv3/gapic_metadata.json @@ -1,52 +1,52 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.translation.v3", - "libraryPackage": "cloud.google.com/go/translate/apiv3", - "services": { - "TranslationService": { - "clients": { - "grpc": { - "libraryClient": "TranslationClient", - "rpcs": { - "BatchTranslateText": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.translation.v3", + "libraryPackage": "cloud.google.com/go/translate/apiv3", + "services": { + "TranslationService": { + "clients": { + "grpc": { + "libraryClient": "TranslationClient", + "rpcs": { + "BatchTranslateText": { + "methods": [ "BatchTranslateText" ] }, - "CreateGlossary": { - "methods": [ + "CreateGlossary": { + "methods": [ "CreateGlossary" ] }, - "DeleteGlossary": { - "methods": [ + "DeleteGlossary": { + "methods": [ "DeleteGlossary" ] }, - "DetectLanguage": { - "methods": [ + "DetectLanguage": { + "methods": [ "DetectLanguage" ] }, - "GetGlossary": { - "methods": [ + "GetGlossary": { + "methods": [ "GetGlossary" ] }, - "GetSupportedLanguages": { - "methods": [ + "GetSupportedLanguages": { + "methods": [ "GetSupportedLanguages" ] }, - "ListGlossaries": { - "methods": [ + "ListGlossaries": { + "methods": [ "ListGlossaries" ] }, - "TranslateText": { - "methods": [ + "TranslateText": { + "methods": [ "TranslateText" ] } diff --git a/translate/apiv3/translation_client.go b/translate/apiv3/translation_client.go index cf5d6fd2016..e13dc053ae5 100644 --- a/translate/apiv3/translation_client.go +++ b/translate/apiv3/translation_client.go @@ -25,7 +25,6 @@ import ( "cloud.google.com/go/longrunning" lroauto "cloud.google.com/go/longrunning/autogen" - "github.com/golang/protobuf/proto" gax "github.com/googleapis/gax-go/v2" "google.golang.org/api/iterator" "google.golang.org/api/option" @@ -36,6 +35,7 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/proto" ) var newTranslationClientHook clientHook diff --git a/video/transcoder/apiv1beta1/doc.go b/video/transcoder/apiv1beta1/doc.go index 55550282a65..71dcd8bbf55 100644 --- a/video/transcoder/apiv1beta1/doc.go +++ b/video/transcoder/apiv1beta1/doc.go @@ -51,7 +51,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210612" +const versionClient = "20210624" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/video/transcoder/apiv1beta1/gapic_metadata.json b/video/transcoder/apiv1beta1/gapic_metadata.json index 4a92159ad67..84e3d7d1ab5 100644 --- a/video/transcoder/apiv1beta1/gapic_metadata.json +++ b/video/transcoder/apiv1beta1/gapic_metadata.json @@ -1,52 +1,52 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.video.transcoder.v1beta1", - "libraryPackage": "cloud.google.com/go/video/transcoder/apiv1beta1", - "services": { - "TranscoderService": { - "clients": { - "grpc": { - "libraryClient": "Client", - "rpcs": { - "CreateJob": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.video.transcoder.v1beta1", + "libraryPackage": "cloud.google.com/go/video/transcoder/apiv1beta1", + "services": { + "TranscoderService": { + "clients": { + "grpc": { + "libraryClient": "Client", + "rpcs": { + "CreateJob": { + "methods": [ "CreateJob" ] }, - "CreateJobTemplate": { - "methods": [ + "CreateJobTemplate": { + "methods": [ "CreateJobTemplate" ] }, - "DeleteJob": { - "methods": [ + "DeleteJob": { + "methods": [ "DeleteJob" ] }, - "DeleteJobTemplate": { - "methods": [ + "DeleteJobTemplate": { + "methods": [ "DeleteJobTemplate" ] }, - "GetJob": { - "methods": [ + "GetJob": { + "methods": [ "GetJob" ] }, - "GetJobTemplate": { - "methods": [ + "GetJobTemplate": { + "methods": [ "GetJobTemplate" ] }, - "ListJobTemplates": { - "methods": [ + "ListJobTemplates": { + "methods": [ "ListJobTemplates" ] }, - "ListJobs": { - "methods": [ + "ListJobs": { + "methods": [ "ListJobs" ] } diff --git a/video/transcoder/apiv1beta1/transcoder_client.go b/video/transcoder/apiv1beta1/transcoder_client.go index 8e992d5aa01..d7ab587b238 100644 --- a/video/transcoder/apiv1beta1/transcoder_client.go +++ b/video/transcoder/apiv1beta1/transcoder_client.go @@ -23,7 +23,6 @@ import ( "net/url" "time" - "github.com/golang/protobuf/proto" gax "github.com/googleapis/gax-go/v2" "google.golang.org/api/iterator" "google.golang.org/api/option" @@ -32,6 +31,7 @@ import ( transcoderpb "google.golang.org/genproto/googleapis/cloud/video/transcoder/v1beta1" "google.golang.org/grpc" "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/proto" ) var newClientHook clientHook diff --git a/videointelligence/apiv1/doc.go b/videointelligence/apiv1/doc.go index 0c34e7e22f1..9c4cc354253 100644 --- a/videointelligence/apiv1/doc.go +++ b/videointelligence/apiv1/doc.go @@ -50,7 +50,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210612" +const versionClient = "20210624" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/videointelligence/apiv1/gapic_metadata.json b/videointelligence/apiv1/gapic_metadata.json index ff747ce5951..a2525d44302 100644 --- a/videointelligence/apiv1/gapic_metadata.json +++ b/videointelligence/apiv1/gapic_metadata.json @@ -1,17 +1,17 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.videointelligence.v1", - "libraryPackage": "cloud.google.com/go/videointelligence/apiv1", - "services": { - "VideoIntelligenceService": { - "clients": { - "grpc": { - "libraryClient": "Client", - "rpcs": { - "AnnotateVideo": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.videointelligence.v1", + "libraryPackage": "cloud.google.com/go/videointelligence/apiv1", + "services": { + "VideoIntelligenceService": { + "clients": { + "grpc": { + "libraryClient": "Client", + "rpcs": { + "AnnotateVideo": { + "methods": [ "AnnotateVideo" ] } diff --git a/videointelligence/apiv1beta2/doc.go b/videointelligence/apiv1beta2/doc.go index 0bce103e07f..5e585c32abd 100644 --- a/videointelligence/apiv1beta2/doc.go +++ b/videointelligence/apiv1beta2/doc.go @@ -52,7 +52,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210612" +const versionClient = "20210624" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/videointelligence/apiv1beta2/gapic_metadata.json b/videointelligence/apiv1beta2/gapic_metadata.json index 48b64ef04a3..922cd9bc58d 100644 --- a/videointelligence/apiv1beta2/gapic_metadata.json +++ b/videointelligence/apiv1beta2/gapic_metadata.json @@ -1,17 +1,17 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.videointelligence.v1beta2", - "libraryPackage": "cloud.google.com/go/videointelligence/apiv1beta2", - "services": { - "VideoIntelligenceService": { - "clients": { - "grpc": { - "libraryClient": "Client", - "rpcs": { - "AnnotateVideo": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.videointelligence.v1beta2", + "libraryPackage": "cloud.google.com/go/videointelligence/apiv1beta2", + "services": { + "VideoIntelligenceService": { + "clients": { + "grpc": { + "libraryClient": "Client", + "rpcs": { + "AnnotateVideo": { + "methods": [ "AnnotateVideo" ] } diff --git a/vision/apiv1/doc.go b/vision/apiv1/doc.go index fd64d2e8775..40a388e6fa1 100644 --- a/vision/apiv1/doc.go +++ b/vision/apiv1/doc.go @@ -50,7 +50,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210612" +const versionClient = "20210624" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/vision/apiv1/gapic_metadata.json b/vision/apiv1/gapic_metadata.json index 98867fffb09..52725dbf9d2 100644 --- a/vision/apiv1/gapic_metadata.json +++ b/vision/apiv1/gapic_metadata.json @@ -1,32 +1,32 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.vision.v1", - "libraryPackage": "cloud.google.com/go/vision/apiv1", - "services": { - "ImageAnnotator": { - "clients": { - "grpc": { - "libraryClient": "ImageAnnotatorClient", - "rpcs": { - "AsyncBatchAnnotateFiles": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.vision.v1", + "libraryPackage": "cloud.google.com/go/vision/apiv1", + "services": { + "ImageAnnotator": { + "clients": { + "grpc": { + "libraryClient": "ImageAnnotatorClient", + "rpcs": { + "AsyncBatchAnnotateFiles": { + "methods": [ "AsyncBatchAnnotateFiles" ] }, - "AsyncBatchAnnotateImages": { - "methods": [ + "AsyncBatchAnnotateImages": { + "methods": [ "AsyncBatchAnnotateImages" ] }, - "BatchAnnotateFiles": { - "methods": [ + "BatchAnnotateFiles": { + "methods": [ "BatchAnnotateFiles" ] }, - "BatchAnnotateImages": { - "methods": [ + "BatchAnnotateImages": { + "methods": [ "BatchAnnotateImages" ] } @@ -34,103 +34,103 @@ } } }, - "ProductSearch": { - "clients": { - "grpc": { - "libraryClient": "ProductSearchClient", - "rpcs": { - "AddProductToProductSet": { - "methods": [ + "ProductSearch": { + "clients": { + "grpc": { + "libraryClient": "ProductSearchClient", + "rpcs": { + "AddProductToProductSet": { + "methods": [ "AddProductToProductSet" ] }, - "CreateProduct": { - "methods": [ + "CreateProduct": { + "methods": [ "CreateProduct" ] }, - "CreateProductSet": { - "methods": [ + "CreateProductSet": { + "methods": [ "CreateProductSet" ] }, - "CreateReferenceImage": { - "methods": [ + "CreateReferenceImage": { + "methods": [ "CreateReferenceImage" ] }, - "DeleteProduct": { - "methods": [ + "DeleteProduct": { + "methods": [ "DeleteProduct" ] }, - "DeleteProductSet": { - "methods": [ + "DeleteProductSet": { + "methods": [ "DeleteProductSet" ] }, - "DeleteReferenceImage": { - "methods": [ + "DeleteReferenceImage": { + "methods": [ "DeleteReferenceImage" ] }, - "GetProduct": { - "methods": [ + "GetProduct": { + "methods": [ "GetProduct" ] }, - "GetProductSet": { - "methods": [ + "GetProductSet": { + "methods": [ "GetProductSet" ] }, - "GetReferenceImage": { - "methods": [ + "GetReferenceImage": { + "methods": [ "GetReferenceImage" ] }, - "ImportProductSets": { - "methods": [ + "ImportProductSets": { + "methods": [ "ImportProductSets" ] }, - "ListProductSets": { - "methods": [ + "ListProductSets": { + "methods": [ "ListProductSets" ] }, - "ListProducts": { - "methods": [ + "ListProducts": { + "methods": [ "ListProducts" ] }, - "ListProductsInProductSet": { - "methods": [ + "ListProductsInProductSet": { + "methods": [ "ListProductsInProductSet" ] }, - "ListReferenceImages": { - "methods": [ + "ListReferenceImages": { + "methods": [ "ListReferenceImages" ] }, - "PurgeProducts": { - "methods": [ + "PurgeProducts": { + "methods": [ "PurgeProducts" ] }, - "RemoveProductFromProductSet": { - "methods": [ + "RemoveProductFromProductSet": { + "methods": [ "RemoveProductFromProductSet" ] }, - "UpdateProduct": { - "methods": [ + "UpdateProduct": { + "methods": [ "UpdateProduct" ] }, - "UpdateProductSet": { - "methods": [ + "UpdateProductSet": { + "methods": [ "UpdateProductSet" ] } diff --git a/vision/apiv1/product_search_client.go b/vision/apiv1/product_search_client.go index 9ea807f529a..4cb9a625630 100644 --- a/vision/apiv1/product_search_client.go +++ b/vision/apiv1/product_search_client.go @@ -25,7 +25,6 @@ import ( "cloud.google.com/go/longrunning" lroauto "cloud.google.com/go/longrunning/autogen" - "github.com/golang/protobuf/proto" gax "github.com/googleapis/gax-go/v2" "google.golang.org/api/iterator" "google.golang.org/api/option" @@ -36,6 +35,7 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/proto" ) var newProductSearchClientHook clientHook diff --git a/vision/apiv1p1beta1/doc.go b/vision/apiv1p1beta1/doc.go index dbad2cdbae6..702b6762f5b 100644 --- a/vision/apiv1p1beta1/doc.go +++ b/vision/apiv1p1beta1/doc.go @@ -52,7 +52,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210612" +const versionClient = "20210624" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/vision/apiv1p1beta1/gapic_metadata.json b/vision/apiv1p1beta1/gapic_metadata.json index 04778b0b3e3..1d1f4da4420 100644 --- a/vision/apiv1p1beta1/gapic_metadata.json +++ b/vision/apiv1p1beta1/gapic_metadata.json @@ -1,17 +1,17 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.vision.v1p1beta1", - "libraryPackage": "cloud.google.com/go/vision/apiv1p1beta1", - "services": { - "ImageAnnotator": { - "clients": { - "grpc": { - "libraryClient": "ImageAnnotatorClient", - "rpcs": { - "BatchAnnotateImages": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.vision.v1p1beta1", + "libraryPackage": "cloud.google.com/go/vision/apiv1p1beta1", + "services": { + "ImageAnnotator": { + "clients": { + "grpc": { + "libraryClient": "ImageAnnotatorClient", + "rpcs": { + "BatchAnnotateImages": { + "methods": [ "BatchAnnotateImages" ] } diff --git a/vpcaccess/apiv1/doc.go b/vpcaccess/apiv1/doc.go index 741bf3d2af8..d4324508ed1 100644 --- a/vpcaccess/apiv1/doc.go +++ b/vpcaccess/apiv1/doc.go @@ -50,7 +50,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210612" +const versionClient = "20210624" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/vpcaccess/apiv1/gapic_metadata.json b/vpcaccess/apiv1/gapic_metadata.json index bc096e30bbd..619b6dce04d 100644 --- a/vpcaccess/apiv1/gapic_metadata.json +++ b/vpcaccess/apiv1/gapic_metadata.json @@ -1,32 +1,32 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.vpcaccess.v1", - "libraryPackage": "cloud.google.com/go/vpcaccess/apiv1", - "services": { - "VpcAccessService": { - "clients": { - "grpc": { - "libraryClient": "Client", - "rpcs": { - "CreateConnector": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.vpcaccess.v1", + "libraryPackage": "cloud.google.com/go/vpcaccess/apiv1", + "services": { + "VpcAccessService": { + "clients": { + "grpc": { + "libraryClient": "Client", + "rpcs": { + "CreateConnector": { + "methods": [ "CreateConnector" ] }, - "DeleteConnector": { - "methods": [ + "DeleteConnector": { + "methods": [ "DeleteConnector" ] }, - "GetConnector": { - "methods": [ + "GetConnector": { + "methods": [ "GetConnector" ] }, - "ListConnectors": { - "methods": [ + "ListConnectors": { + "methods": [ "ListConnectors" ] } diff --git a/vpcaccess/apiv1/vpc_access_client.go b/vpcaccess/apiv1/vpc_access_client.go index 443261256c3..6064885a8ee 100644 --- a/vpcaccess/apiv1/vpc_access_client.go +++ b/vpcaccess/apiv1/vpc_access_client.go @@ -25,7 +25,6 @@ import ( "cloud.google.com/go/longrunning" lroauto "cloud.google.com/go/longrunning/autogen" - "github.com/golang/protobuf/proto" gax "github.com/googleapis/gax-go/v2" "google.golang.org/api/iterator" "google.golang.org/api/option" @@ -35,6 +34,7 @@ import ( longrunningpb "google.golang.org/genproto/googleapis/longrunning" "google.golang.org/grpc" "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/proto" ) var newClientHook clientHook diff --git a/webrisk/apiv1/doc.go b/webrisk/apiv1/doc.go index 3b63631ed00..466d0d464f6 100644 --- a/webrisk/apiv1/doc.go +++ b/webrisk/apiv1/doc.go @@ -46,7 +46,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210612" +const versionClient = "20210624" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/webrisk/apiv1/gapic_metadata.json b/webrisk/apiv1/gapic_metadata.json index f8d27fd7028..fed41bc485d 100644 --- a/webrisk/apiv1/gapic_metadata.json +++ b/webrisk/apiv1/gapic_metadata.json @@ -1,32 +1,32 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.webrisk.v1", - "libraryPackage": "cloud.google.com/go/webrisk/apiv1", - "services": { - "WebRiskService": { - "clients": { - "grpc": { - "libraryClient": "Client", - "rpcs": { - "ComputeThreatListDiff": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.webrisk.v1", + "libraryPackage": "cloud.google.com/go/webrisk/apiv1", + "services": { + "WebRiskService": { + "clients": { + "grpc": { + "libraryClient": "Client", + "rpcs": { + "ComputeThreatListDiff": { + "methods": [ "ComputeThreatListDiff" ] }, - "CreateSubmission": { - "methods": [ + "CreateSubmission": { + "methods": [ "CreateSubmission" ] }, - "SearchHashes": { - "methods": [ + "SearchHashes": { + "methods": [ "SearchHashes" ] }, - "SearchUris": { - "methods": [ + "SearchUris": { + "methods": [ "SearchUris" ] } diff --git a/webrisk/apiv1beta1/doc.go b/webrisk/apiv1beta1/doc.go index 8a097b68896..4747efdf6b9 100644 --- a/webrisk/apiv1beta1/doc.go +++ b/webrisk/apiv1beta1/doc.go @@ -48,7 +48,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210612" +const versionClient = "20210624" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/webrisk/apiv1beta1/gapic_metadata.json b/webrisk/apiv1beta1/gapic_metadata.json index 75941f478c8..7da7ea74a1c 100644 --- a/webrisk/apiv1beta1/gapic_metadata.json +++ b/webrisk/apiv1beta1/gapic_metadata.json @@ -1,27 +1,27 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.webrisk.v1beta1", - "libraryPackage": "cloud.google.com/go/webrisk/apiv1beta1", - "services": { - "WebRiskServiceV1Beta1": { - "clients": { - "grpc": { - "libraryClient": "WebRiskServiceV1Beta1Client", - "rpcs": { - "ComputeThreatListDiff": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.webrisk.v1beta1", + "libraryPackage": "cloud.google.com/go/webrisk/apiv1beta1", + "services": { + "WebRiskServiceV1Beta1": { + "clients": { + "grpc": { + "libraryClient": "WebRiskServiceV1Beta1Client", + "rpcs": { + "ComputeThreatListDiff": { + "methods": [ "ComputeThreatListDiff" ] }, - "SearchHashes": { - "methods": [ + "SearchHashes": { + "methods": [ "SearchHashes" ] }, - "SearchUris": { - "methods": [ + "SearchUris": { + "methods": [ "SearchUris" ] } diff --git a/websecurityscanner/apiv1/doc.go b/websecurityscanner/apiv1/doc.go index 6b53c0b753c..a0d4a10a859 100644 --- a/websecurityscanner/apiv1/doc.go +++ b/websecurityscanner/apiv1/doc.go @@ -48,7 +48,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210612" +const versionClient = "20210624" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/websecurityscanner/apiv1/gapic_metadata.json b/websecurityscanner/apiv1/gapic_metadata.json index 9fc5f875602..26bb0feab78 100644 --- a/websecurityscanner/apiv1/gapic_metadata.json +++ b/websecurityscanner/apiv1/gapic_metadata.json @@ -1,77 +1,77 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.websecurityscanner.v1", - "libraryPackage": "cloud.google.com/go/websecurityscanner/apiv1", - "services": { - "WebSecurityScanner": { - "clients": { - "grpc": { - "libraryClient": "Client", - "rpcs": { - "CreateScanConfig": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.websecurityscanner.v1", + "libraryPackage": "cloud.google.com/go/websecurityscanner/apiv1", + "services": { + "WebSecurityScanner": { + "clients": { + "grpc": { + "libraryClient": "Client", + "rpcs": { + "CreateScanConfig": { + "methods": [ "CreateScanConfig" ] }, - "DeleteScanConfig": { - "methods": [ + "DeleteScanConfig": { + "methods": [ "DeleteScanConfig" ] }, - "GetFinding": { - "methods": [ + "GetFinding": { + "methods": [ "GetFinding" ] }, - "GetScanConfig": { - "methods": [ + "GetScanConfig": { + "methods": [ "GetScanConfig" ] }, - "GetScanRun": { - "methods": [ + "GetScanRun": { + "methods": [ "GetScanRun" ] }, - "ListCrawledUrls": { - "methods": [ + "ListCrawledUrls": { + "methods": [ "ListCrawledUrls" ] }, - "ListFindingTypeStats": { - "methods": [ + "ListFindingTypeStats": { + "methods": [ "ListFindingTypeStats" ] }, - "ListFindings": { - "methods": [ + "ListFindings": { + "methods": [ "ListFindings" ] }, - "ListScanConfigs": { - "methods": [ + "ListScanConfigs": { + "methods": [ "ListScanConfigs" ] }, - "ListScanRuns": { - "methods": [ + "ListScanRuns": { + "methods": [ "ListScanRuns" ] }, - "StartScanRun": { - "methods": [ + "StartScanRun": { + "methods": [ "StartScanRun" ] }, - "StopScanRun": { - "methods": [ + "StopScanRun": { + "methods": [ "StopScanRun" ] }, - "UpdateScanConfig": { - "methods": [ + "UpdateScanConfig": { + "methods": [ "UpdateScanConfig" ] } diff --git a/websecurityscanner/apiv1/web_security_scanner_client.go b/websecurityscanner/apiv1/web_security_scanner_client.go index 28192840014..42bdb777dd8 100644 --- a/websecurityscanner/apiv1/web_security_scanner_client.go +++ b/websecurityscanner/apiv1/web_security_scanner_client.go @@ -23,7 +23,6 @@ import ( "net/url" "time" - "github.com/golang/protobuf/proto" gax "github.com/googleapis/gax-go/v2" "google.golang.org/api/iterator" "google.golang.org/api/option" @@ -33,6 +32,7 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/proto" ) var newClientHook clientHook diff --git a/workflows/apiv1beta/doc.go b/workflows/apiv1beta/doc.go index 581dd2f7cdb..5d122965998 100644 --- a/workflows/apiv1beta/doc.go +++ b/workflows/apiv1beta/doc.go @@ -48,7 +48,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210612" +const versionClient = "20210624" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/workflows/apiv1beta/gapic_metadata.json b/workflows/apiv1beta/gapic_metadata.json index 78b97d5169f..4b57d1c9199 100644 --- a/workflows/apiv1beta/gapic_metadata.json +++ b/workflows/apiv1beta/gapic_metadata.json @@ -1,37 +1,37 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.workflows.v1beta", - "libraryPackage": "cloud.google.com/go/workflows/apiv1beta", - "services": { - "Workflows": { - "clients": { - "grpc": { - "libraryClient": "Client", - "rpcs": { - "CreateWorkflow": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.workflows.v1beta", + "libraryPackage": "cloud.google.com/go/workflows/apiv1beta", + "services": { + "Workflows": { + "clients": { + "grpc": { + "libraryClient": "Client", + "rpcs": { + "CreateWorkflow": { + "methods": [ "CreateWorkflow" ] }, - "DeleteWorkflow": { - "methods": [ + "DeleteWorkflow": { + "methods": [ "DeleteWorkflow" ] }, - "GetWorkflow": { - "methods": [ + "GetWorkflow": { + "methods": [ "GetWorkflow" ] }, - "ListWorkflows": { - "methods": [ + "ListWorkflows": { + "methods": [ "ListWorkflows" ] }, - "UpdateWorkflow": { - "methods": [ + "UpdateWorkflow": { + "methods": [ "UpdateWorkflow" ] } diff --git a/workflows/apiv1beta/workflows_client.go b/workflows/apiv1beta/workflows_client.go index 406ddf8ce52..741652714de 100644 --- a/workflows/apiv1beta/workflows_client.go +++ b/workflows/apiv1beta/workflows_client.go @@ -25,7 +25,6 @@ import ( "cloud.google.com/go/longrunning" lroauto "cloud.google.com/go/longrunning/autogen" - "github.com/golang/protobuf/proto" gax "github.com/googleapis/gax-go/v2" "google.golang.org/api/iterator" "google.golang.org/api/option" @@ -35,6 +34,7 @@ import ( longrunningpb "google.golang.org/genproto/googleapis/longrunning" "google.golang.org/grpc" "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/proto" ) var newClientHook clientHook diff --git a/workflows/executions/apiv1beta/doc.go b/workflows/executions/apiv1beta/doc.go index d11a0b320ee..2df764e3581 100644 --- a/workflows/executions/apiv1beta/doc.go +++ b/workflows/executions/apiv1beta/doc.go @@ -50,7 +50,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210612" +const versionClient = "20210624" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/workflows/executions/apiv1beta/executions_client.go b/workflows/executions/apiv1beta/executions_client.go index d8934360c7d..6140dabac94 100644 --- a/workflows/executions/apiv1beta/executions_client.go +++ b/workflows/executions/apiv1beta/executions_client.go @@ -22,7 +22,6 @@ import ( "math" "net/url" - "github.com/golang/protobuf/proto" gax "github.com/googleapis/gax-go/v2" "google.golang.org/api/iterator" "google.golang.org/api/option" @@ -31,6 +30,7 @@ import ( executionspb "google.golang.org/genproto/googleapis/cloud/workflows/executions/v1beta" "google.golang.org/grpc" "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/proto" ) var newClientHook clientHook diff --git a/workflows/executions/apiv1beta/gapic_metadata.json b/workflows/executions/apiv1beta/gapic_metadata.json index df3144a708a..f9d5dca3cbf 100644 --- a/workflows/executions/apiv1beta/gapic_metadata.json +++ b/workflows/executions/apiv1beta/gapic_metadata.json @@ -1,32 +1,32 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.workflows.executions.v1beta", - "libraryPackage": "cloud.google.com/go/workflows/executions/apiv1beta", - "services": { - "Executions": { - "clients": { - "grpc": { - "libraryClient": "Client", - "rpcs": { - "CancelExecution": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.workflows.executions.v1beta", + "libraryPackage": "cloud.google.com/go/workflows/executions/apiv1beta", + "services": { + "Executions": { + "clients": { + "grpc": { + "libraryClient": "Client", + "rpcs": { + "CancelExecution": { + "methods": [ "CancelExecution" ] }, - "CreateExecution": { - "methods": [ + "CreateExecution": { + "methods": [ "CreateExecution" ] }, - "GetExecution": { - "methods": [ + "GetExecution": { + "methods": [ "GetExecution" ] }, - "ListExecutions": { - "methods": [ + "ListExecutions": { + "methods": [ "ListExecutions" ] } From de654ebfcf23a53b4d1fee0aa48c73999a55c1a6 Mon Sep 17 00:00:00 2001 From: Cody Oss <6331106+codyoss@users.noreply.github.com> Date: Thu, 24 Jun 2021 14:02:33 -0500 Subject: [PATCH 07/50] feat(internal): add force option for regen (#4310) The forceAll option indicates that all proto files should be regenerated. --- internal/gapicgen/cmd/genbot/bot.go | 22 +++++++++---- internal/gapicgen/cmd/genbot/generate.go | 3 +- internal/gapicgen/cmd/genbot/main.go | 9 +++++- internal/gapicgen/generator/config.go | 1 + internal/gapicgen/generator/generator.go | 1 + internal/gapicgen/generator/genproto.go | 41 ++++++++++++++++++++++++ 6 files changed, 68 insertions(+), 9 deletions(-) diff --git a/internal/gapicgen/cmd/genbot/bot.go b/internal/gapicgen/cmd/genbot/bot.go index b75115b32b4..5ab3c3b3ff4 100644 --- a/internal/gapicgen/cmd/genbot/bot.go +++ b/internal/gapicgen/cmd/genbot/bot.go @@ -26,12 +26,20 @@ import ( "cloud.google.com/go/internal/gapicgen/git" ) -func genBot(ctx context.Context, githubAccessToken, githubUsername, githubName, githubEmail string) error { +type botConfig struct { + githubAccessToken string + githubUsername string + githubName string + githubEmail string + forceAll bool +} + +func genBot(ctx context.Context, c botConfig) error { for k, v := range map[string]string{ - "githubAccessToken": githubAccessToken, - "githubUsername": githubUsername, - "githubName": githubName, - "githubEmail": githubEmail, + "githubAccessToken": c.githubAccessToken, + "githubUsername": c.githubUsername, + "githubName": c.githubName, + "githubEmail": c.githubEmail, } { if v == "" { log.Printf("missing or empty value for required flag --%s\n", k) @@ -40,7 +48,7 @@ func genBot(ctx context.Context, githubAccessToken, githubUsername, githubName, } // Setup the client and git environment. - githubClient, err := git.NewGithubClient(ctx, githubUsername, githubName, githubEmail, githubAccessToken) + githubClient, err := git.NewGithubClient(ctx, c.githubUsername, c.githubName, c.githubEmail, c.githubAccessToken) if err != nil { return err } @@ -73,7 +81,7 @@ func genBot(ctx context.Context, githubAccessToken, githubUsername, githubName, return nil } - return generate(ctx, githubClient) + return generate(ctx, githubClient, c.forceAll) } // hasCreatedPRToday checks if the created time of a PR is from today. diff --git a/internal/gapicgen/cmd/genbot/generate.go b/internal/gapicgen/cmd/genbot/generate.go index 170090a34ba..ac6903866de 100644 --- a/internal/gapicgen/cmd/genbot/generate.go +++ b/internal/gapicgen/cmd/genbot/generate.go @@ -31,7 +31,7 @@ import ( // generate downloads sources and generates pull requests for go-genproto and // google-cloud-go if needed. -func generate(ctx context.Context, githubClient *git.GithubClient) error { +func generate(ctx context.Context, githubClient *git.GithubClient, forceAll bool) error { log.Println("creating temp dir") tmpDir, err := ioutil.TempDir("", "update-genproto") if err != nil { @@ -71,6 +71,7 @@ func generate(ctx context.Context, githubClient *git.GithubClient) error { GenprotoDir: genprotoDir, GapicDir: gocloudDir, ProtoDir: protoDir, + ForceAll: forceAll, } changes, err := generator.Generate(ctx, conf) if err != nil { diff --git a/internal/gapicgen/cmd/genbot/main.go b/internal/gapicgen/cmd/genbot/main.go index 7f90115eccf..ddaa4f302e1 100644 --- a/internal/gapicgen/cmd/genbot/main.go +++ b/internal/gapicgen/cmd/genbot/main.go @@ -41,6 +41,7 @@ func main() { githubName := flag.String("githubName", os.Getenv("GITHUB_NAME"), "The name of the author for git commits.") githubEmail := flag.String("githubEmail", os.Getenv("GITHUB_EMAIL"), "The email address of the author.") localMode := flag.Bool("local", strToBool(os.Getenv("GENBOT_LOCAL_MODE")), "Enables generating sources locally. This mode will not open any pull requests.") + forceAll := flag.Bool("forceAll", strToBool(os.Getenv("GENBOT_FORCE_ALL")), "Enables regenerating everything regardless of changes in googleapis.") // flags for local mode googleapisDir := flag.String("googleapis-dir", os.Getenv("GOOGLEAPIS_DIR"), "Directory where sources of googleapis/googleapis resides. If unset the sources will be cloned to a temporary directory that is not cleaned up.") @@ -67,7 +68,13 @@ func main() { } return } - if err := genBot(ctx, *githubAccessToken, *githubUsername, *githubName, *githubEmail); err != nil { + if err := genBot(ctx, botConfig{ + githubAccessToken: *githubAccessToken, + githubUsername: *githubUsername, + githubName: *githubName, + githubEmail: *githubEmail, + forceAll: *forceAll, + }); err != nil { log.Fatal(err) } } diff --git a/internal/gapicgen/generator/config.go b/internal/gapicgen/generator/config.go index 17afd1b2ebf..7c25b1acddd 100644 --- a/internal/gapicgen/generator/config.go +++ b/internal/gapicgen/generator/config.go @@ -1021,6 +1021,7 @@ var microgenGapicConfigs = []*microgenConfig{ gRPCServiceConfigPath: "google/cloud/recommendationengine/v1beta1/recommendationengine_grpc_service_config.json", apiServiceConfigPath: "google/cloud/recommendationengine/v1beta1/recommendationengine_v1beta1.yaml", releaseLevel: "beta", + stopGeneration: true, }, { inputDirectoryPath: "google/cloud/gkehub/v1beta1", diff --git a/internal/gapicgen/generator/generator.go b/internal/gapicgen/generator/generator.go index 1c17e0e43d9..fa644e43ca4 100644 --- a/internal/gapicgen/generator/generator.go +++ b/internal/gapicgen/generator/generator.go @@ -37,6 +37,7 @@ type Config struct { OnlyGenerateGapic bool LocalMode bool RegenOnly bool + ForceAll bool } // Generate generates genproto and gapics. diff --git a/internal/gapicgen/generator/genproto.go b/internal/gapicgen/generator/genproto.go index 0314bdf5a0e..33b1b7b6390 100644 --- a/internal/gapicgen/generator/genproto.go +++ b/internal/gapicgen/generator/genproto.go @@ -20,6 +20,7 @@ import ( "fmt" "io/ioutil" "log" + "os" "path/filepath" "regexp" "strconv" @@ -57,6 +58,7 @@ type GenprotoGenerator struct { genprotoDir string googleapisDir string protoSrcDir string + forceAll bool } // NewGenprotoGenerator creates a new GenprotoGenerator. @@ -65,6 +67,7 @@ func NewGenprotoGenerator(c *Config) *GenprotoGenerator { genprotoDir: c.GenprotoDir, googleapisDir: c.GoogleapisDir, protoSrcDir: filepath.Join(c.ProtoDir, "/src"), + forceAll: c.ForceAll, } } @@ -186,6 +189,9 @@ func (g *GenprotoGenerator) protoc(fileNames []string) error { // getUpdatedPackages parses all of the new commits to find what packages need // to be regenerated. func (g *GenprotoGenerator) getUpdatedPackages(googleapisHash string) (map[string][]string, error) { + if g.forceAll { + return g.getAllPackages() + } files, err := git.UpdateFilesSinceHash(g.googleapisDir, googleapisHash) if err != nil { return nil, err @@ -205,6 +211,41 @@ func (g *GenprotoGenerator) getUpdatedPackages(googleapisHash string) (map[strin return pkgFiles, nil } +func (g *GenprotoGenerator) getAllPackages() (map[string][]string, error) { + seenFiles := make(map[string]bool) + pkgFiles := make(map[string][]string) + for _, root := range []string{g.googleapisDir} { + walkFn := func(path string, info os.FileInfo, err error) error { + if err != nil { + return err + } + if !info.Mode().IsRegular() || !strings.HasSuffix(path, ".proto") { + return nil + } + + switch rel, err := filepath.Rel(root, path); { + case err != nil: + return err + case seenFiles[rel]: + return nil + default: + seenFiles[rel] = true + } + + pkg, err := goPkg(path) + if err != nil { + return err + } + pkgFiles[pkg] = append(pkgFiles[pkg], path) + return nil + } + if err := filepath.Walk(root, walkFn); err != nil { + return nil, err + } + } + return pkgFiles, nil +} + // moveAndCleanupGeneratedSrc moves all generated src to their correct locations // in the repository, because protoc puts it in a folder called `generated/``. func (g *GenprotoGenerator) moveAndCleanupGeneratedSrc() error { From 8ebbf6ba796673021f95626c81f7a45f688a8bbe Mon Sep 17 00:00:00 2001 From: Noah Dietz Date: Thu, 24 Jun 2021 13:11:15 -0700 Subject: [PATCH 08/50] chore(internal): gen googleapis-discovery compute genproto (#4306) --- internal/gapicgen/cmd/genbot/generate.go | 15 ++++++--- internal/gapicgen/cmd/genbot/local.go | 34 +++++++++++--------- internal/gapicgen/cmd/genbot/main.go | 16 +++++----- internal/gapicgen/generator/generator.go | 19 +++++------ internal/gapicgen/generator/genproto.go | 40 +++++++++++++++++------- 5 files changed, 76 insertions(+), 48 deletions(-) diff --git a/internal/gapicgen/cmd/genbot/generate.go b/internal/gapicgen/cmd/genbot/generate.go index ac6903866de..b4ea82b336c 100644 --- a/internal/gapicgen/cmd/genbot/generate.go +++ b/internal/gapicgen/cmd/genbot/generate.go @@ -42,6 +42,7 @@ func generate(ctx context.Context, githubClient *git.GithubClient, forceAll bool log.Printf("working out %s\n", tmpDir) googleapisDir := filepath.Join(tmpDir, "googleapis") + googleapisDiscoDir := filepath.Join(tmpDir, "googleapis-discovery") gocloudDir := filepath.Join(tmpDir, "gocloud") genprotoDir := filepath.Join(tmpDir, "genproto") protoDir := filepath.Join(tmpDir, "proto") @@ -52,6 +53,9 @@ func generate(ctx context.Context, githubClient *git.GithubClient, forceAll bool grp.Go(func() error { return git.DeepClone("https://github.com/googleapis/googleapis", googleapisDir) }) + grp.Go(func() error { + return git.DeepClone("https://github.com/googleapis/googleapis-discovery", googleapisDiscoDir) + }) grp.Go(func() error { return git.DeepClone("https://github.com/googleapis/go-genproto", genprotoDir) }) @@ -67,11 +71,12 @@ func generate(ctx context.Context, githubClient *git.GithubClient, forceAll bool // Regen. conf := &generator.Config{ - GoogleapisDir: googleapisDir, - GenprotoDir: genprotoDir, - GapicDir: gocloudDir, - ProtoDir: protoDir, - ForceAll: forceAll, + GoogleapisDir: googleapisDir, + GoogleapisDiscoDir: googleapisDiscoDir, + GenprotoDir: genprotoDir, + GapicDir: gocloudDir, + ProtoDir: protoDir, + ForceAll: forceAll, } changes, err := generator.Generate(ctx, conf) if err != nil { diff --git a/internal/gapicgen/cmd/genbot/local.go b/internal/gapicgen/cmd/genbot/local.go index 0848ef3d5c5..c7cab8bfaa4 100644 --- a/internal/gapicgen/cmd/genbot/local.go +++ b/internal/gapicgen/cmd/genbot/local.go @@ -29,13 +29,14 @@ import ( ) type localConfig struct { - googleapisDir string - gocloudDir string - genprotoDir string - protoDir string - gapicToGenerate string - onlyGapics bool - regenOnly bool + googleapisDir string + googleapisDiscoDir string + gocloudDir string + genprotoDir string + protoDir string + gapicToGenerate string + onlyGapics bool + regenOnly bool } func genLocal(ctx context.Context, c localConfig) error { @@ -46,6 +47,7 @@ func genLocal(ctx context.Context, c localConfig) error { } log.Printf("temp dir created at %s\n", tmpDir) tmpGoogleapisDir := filepath.Join(tmpDir, "googleapis") + tmpGoogleapisDiscoDir := filepath.Join(tmpDir, "googleapis-discovery") tmpGenprotoDir := filepath.Join(tmpDir, "genproto") tmpGocloudDir := filepath.Join(tmpDir, "gocloud") tmpProtoDir := filepath.Join(tmpDir, "proto") @@ -53,6 +55,7 @@ func genLocal(ctx context.Context, c localConfig) error { // Clone repositories if needed. grp, _ := errgroup.WithContext(ctx) gitShallowClone(grp, "https://github.com/googleapis/googleapis.git", c.googleapisDir, tmpGoogleapisDir) + gitShallowClone(grp, "https://github.com/googleapis/googleapis-discovery.git", c.googleapisDiscoDir, tmpGoogleapisDiscoDir) gitShallowClone(grp, "https://github.com/googleapis/go-genproto", c.genprotoDir, tmpGenprotoDir) gitShallowClone(grp, "https://github.com/googleapis/google-cloud-go", c.gocloudDir, tmpGocloudDir) gitShallowClone(grp, "https://github.com/protocolbuffers/protobuf", c.protoDir, tmpProtoDir) @@ -62,14 +65,15 @@ func genLocal(ctx context.Context, c localConfig) error { // Regen. conf := &generator.Config{ - GoogleapisDir: deafultDir(tmpGoogleapisDir, c.googleapisDir), - GenprotoDir: deafultDir(tmpGenprotoDir, c.genprotoDir), - GapicDir: deafultDir(tmpGocloudDir, c.gocloudDir), - ProtoDir: deafultDir(tmpProtoDir, c.protoDir), - GapicToGenerate: c.gapicToGenerate, - OnlyGenerateGapic: c.onlyGapics, - LocalMode: true, - RegenOnly: c.regenOnly, + GoogleapisDir: deafultDir(tmpGoogleapisDir, c.googleapisDir), + GoogleapisDiscoDir: deafultDir(tmpGoogleapisDiscoDir, c.googleapisDiscoDir), + GenprotoDir: deafultDir(tmpGenprotoDir, c.genprotoDir), + GapicDir: deafultDir(tmpGocloudDir, c.gocloudDir), + ProtoDir: deafultDir(tmpProtoDir, c.protoDir), + GapicToGenerate: c.gapicToGenerate, + OnlyGenerateGapic: c.onlyGapics, + LocalMode: true, + RegenOnly: c.regenOnly, } if _, err := generator.Generate(ctx, conf); err != nil { log.Printf("Generator ran (and failed) in %s\n", tmpDir) diff --git a/internal/gapicgen/cmd/genbot/main.go b/internal/gapicgen/cmd/genbot/main.go index ddaa4f302e1..89f941959f6 100644 --- a/internal/gapicgen/cmd/genbot/main.go +++ b/internal/gapicgen/cmd/genbot/main.go @@ -45,6 +45,7 @@ func main() { // flags for local mode googleapisDir := flag.String("googleapis-dir", os.Getenv("GOOGLEAPIS_DIR"), "Directory where sources of googleapis/googleapis resides. If unset the sources will be cloned to a temporary directory that is not cleaned up.") + googleapisDiscoDir := flag.String("googleapis-disco-dir", os.Getenv("GOOGLEAPIS_DISCO_DIR"), "Directory where sources of googleapis/googleapis-discovery resides. If unset the sources will be cloned to a temporary directory that is not cleaned up.") gocloudDir := flag.String("gocloud-dir", os.Getenv("GOCLOUD_DIR"), "Directory where sources of googleapis/google-cloud-go resides. If unset the sources will be cloned to a temporary directory that is not cleaned up.") genprotoDir := flag.String("genproto-dir", os.Getenv("GENPROTO_DIR"), "Directory where sources of googleapis/go-genproto resides. If unset the sources will be cloned to a temporary directory that is not cleaned up.") protoDir := flag.String("proto-dir", os.Getenv("PROTO_DIR"), "Directory where sources of google/protobuf resides. If unset the sources will be cloned to a temporary directory that is not cleaned up.") @@ -56,13 +57,14 @@ func main() { if *localMode { if err := genLocal(ctx, localConfig{ - googleapisDir: *googleapisDir, - gocloudDir: *gocloudDir, - genprotoDir: *genprotoDir, - protoDir: *protoDir, - gapicToGenerate: *gapicToGenerate, - onlyGapics: *onlyGapics, - regenOnly: *regenOnly, + googleapisDir: *googleapisDir, + googleapisDiscoDir: *googleapisDiscoDir, + gocloudDir: *gocloudDir, + genprotoDir: *genprotoDir, + protoDir: *protoDir, + gapicToGenerate: *gapicToGenerate, + onlyGapics: *onlyGapics, + regenOnly: *regenOnly, }); err != nil { log.Fatal(err) } diff --git a/internal/gapicgen/generator/generator.go b/internal/gapicgen/generator/generator.go index fa644e43ca4..bea74721bc2 100644 --- a/internal/gapicgen/generator/generator.go +++ b/internal/gapicgen/generator/generator.go @@ -29,15 +29,16 @@ import ( // Config contains inputs needed to generate sources. type Config struct { - GoogleapisDir string - GenprotoDir string - GapicDir string - ProtoDir string - GapicToGenerate string - OnlyGenerateGapic bool - LocalMode bool - RegenOnly bool - ForceAll bool + GoogleapisDir string + GoogleapisDiscoDir string + GenprotoDir string + GapicDir string + ProtoDir string + GapicToGenerate string + OnlyGenerateGapic bool + LocalMode bool + RegenOnly bool + ForceAll bool } // Generate generates genproto and gapics. diff --git a/internal/gapicgen/generator/genproto.go b/internal/gapicgen/generator/genproto.go index 33b1b7b6390..2d18bf0dd56 100644 --- a/internal/gapicgen/generator/genproto.go +++ b/internal/gapicgen/generator/genproto.go @@ -55,19 +55,21 @@ var denylist = map[string]bool{ // GenprotoGenerator is used to generate code for googleapis/go-genproto. type GenprotoGenerator struct { - genprotoDir string - googleapisDir string - protoSrcDir string - forceAll bool + genprotoDir string + googleapisDir string + googleapisDiscoDir string + protoSrcDir string + forceAll bool } // NewGenprotoGenerator creates a new GenprotoGenerator. func NewGenprotoGenerator(c *Config) *GenprotoGenerator { return &GenprotoGenerator{ - genprotoDir: c.GenprotoDir, - googleapisDir: c.GoogleapisDir, - protoSrcDir: filepath.Join(c.ProtoDir, "/src"), - forceAll: c.ForceAll, + genprotoDir: c.GenprotoDir, + googleapisDir: c.GoogleapisDir, + googleapisDiscoDir: c.GoogleapisDiscoDir, + protoSrcDir: filepath.Join(c.ProtoDir, "/src"), + forceAll: c.ForceAll, } } @@ -102,7 +104,7 @@ func (g *GenprotoGenerator) Regen(ctx context.Context) error { log.Println("regenerating genproto") // Create space to put generated .pb.go's. - c := execv.Command("mkdir", "generated") + c := execv.Command("mkdir", "-p", "generated") c.Dir = g.genprotoDir if err := c.Run(); err != nil { return err @@ -114,6 +116,10 @@ func (g *GenprotoGenerator) Regen(ctx context.Context) error { return err } + // TODO(noahdietz): In local mode, since it clones a shallow copy with 1 commit, + // if the last regenerated hash is earlier than the top commit, the git diff-tree + // command fails. This is is a bit of a rough edge. Using my local clone of + // googleapis rectified the issue. pkgFiles, err := g.getUpdatedPackages(string(lastHash)) if err != nil { return err @@ -132,9 +138,15 @@ func (g *GenprotoGenerator) Regen(ctx context.Context) error { fn := fileNames grp.Go(func() error { log.Println("running protoc on", pk) - return g.protoc(fn) + return g.protoc(fn, true /* grpc */) }) } + // TODO(noahdietz): This needs to be generalized to support any proto in googleapis-discovery. + // It's hard because the regen.txt contains the committish from googleapis last used to regen. + grp.Go(func() error { + log.Println("running protoc on compute") + return g.protoc([]string{"google/cloud/compute/v1/compute.proto"}, false /* grpc */) + }) if err := grp.Wait(); err != nil { return err } @@ -178,8 +190,12 @@ func goPkg(fileName string) (string, error) { // protoc executes the "protoc" command on files named in fileNames, and outputs // to "/generated". -func (g *GenprotoGenerator) protoc(fileNames []string) error { - args := []string{"--experimental_allow_proto3_optional", fmt.Sprintf("--go_out=plugins=grpc:%s/generated", g.genprotoDir), "-I", g.googleapisDir, "-I", g.protoSrcDir} +func (g *GenprotoGenerator) protoc(fileNames []string, grpc bool) error { + stubs := fmt.Sprintf("--go_out=%s/generated", g.genprotoDir) + if grpc { + stubs = fmt.Sprintf("--go_out=plugins=grpc:%s/generated", g.genprotoDir) + } + args := []string{"--experimental_allow_proto3_optional", stubs, "-I", g.googleapisDiscoDir, "-I", g.googleapisDir, "-I", g.protoSrcDir} args = append(args, fileNames...) c := execv.Command("protoc", args...) c.Dir = g.genprotoDir From 267787eb245d9307cf78304c1ce34bdfb2aaf5ab Mon Sep 17 00:00:00 2001 From: shollyman Date: Thu, 24 Jun 2021 14:06:47 -0700 Subject: [PATCH 09/50] feat(bigquery): enable project autodetection, expose project ids further (#4312) PR supersedes: https://github.com/googleapis/google-cloud-go/pull/4076 Related: https://github.com/googleapis/google-cloud-go/issues/1294 With this change, project autodetection is enabled via use of a sentinel value, and the retained project identifier is now exposed on the Client and Job resources via the Project() function. --- bigquery/bigquery.go | 39 ++++++++++++++++++++++++++++++++++++ bigquery/integration_test.go | 18 +++++++++++++++++ bigquery/job.go | 5 +++++ 3 files changed, 62 insertions(+) diff --git a/bigquery/bigquery.go b/bigquery/bigquery.go index 0a32f02c3d5..28ea5446f1f 100644 --- a/bigquery/bigquery.go +++ b/bigquery/bigquery.go @@ -16,6 +16,7 @@ package bigquery import ( "context" + "errors" "fmt" "io" "net/http" @@ -29,6 +30,7 @@ import ( bq "google.golang.org/api/bigquery/v2" "google.golang.org/api/googleapi" "google.golang.org/api/option" + "google.golang.org/api/transport" ) const ( @@ -56,8 +58,20 @@ type Client struct { bqs *bq.Service } +// DetectProjectID is a sentinel value that instructs NewClient to detect the +// project ID. It is given in place of the projectID argument. NewClient will +// use the project ID from the given credentials or the default credentials +// (https://developers.google.com/accounts/docs/application-default-credentials) +// if no credentials were provided. When providing credentials, not all +// options will allow NewClient to extract the project ID. Specifically a JWT +// does not have the project ID encoded. +const DetectProjectID = "*detect-project-id*" + // NewClient constructs a new Client which can perform BigQuery operations. // Operations performed via the client are billed to the specified GCP project. +// +// If the project ID is set to DetectProjectID, NewClient will attempt to detect +// the project ID from credentials. func NewClient(ctx context.Context, projectID string, opts ...option.ClientOption) (*Client, error) { o := []option.ClientOption{ option.WithScopes(Scope), @@ -68,6 +82,14 @@ func NewClient(ctx context.Context, projectID string, opts ...option.ClientOptio if err != nil { return nil, fmt.Errorf("bigquery: constructing client: %v", err) } + + if projectID == DetectProjectID { + projectID, err = detectProjectID(ctx, opts...) + if err != nil { + return nil, fmt.Errorf("failed to detect project: %v", err) + } + } + c := &Client{ projectID: projectID, bqs: bqs, @@ -75,6 +97,12 @@ func NewClient(ctx context.Context, projectID string, opts ...option.ClientOptio return c, nil } +// Project returns the project ID or number for this instance of the client, which may have +// either been explicitly specified or autodetected. +func (c *Client) Project() string { + return c.projectID +} + // Close closes any resources held by the client. // Close should be called when the client is no longer needed. // It need not be called at program exit. @@ -82,6 +110,17 @@ func (c *Client) Close() error { return nil } +func detectProjectID(ctx context.Context, opts ...option.ClientOption) (string, error) { + creds, err := transport.Creds(ctx, opts...) + if err != nil { + return "", fmt.Errorf("fetching creds: %v", err) + } + if creds.ProjectID == "" { + return "", errors.New("credentials did not provide a valid ProjectID") + } + return creds.ProjectID, nil +} + // Calls the Jobs.Insert RPC and returns a Job. func (c *Client) insertJob(ctx context.Context, job *bq.Job, media io.Reader) (*Job, error) { call := c.bqs.Jobs.Insert(c.projectID, job).Context(ctx) diff --git a/bigquery/integration_test.go b/bigquery/integration_test.go index 9cca940d876..8b7b2a1e5ad 100644 --- a/bigquery/integration_test.go +++ b/bigquery/integration_test.go @@ -228,6 +228,24 @@ func initTestState(client *Client, t time.Time) func() { } } +func TestIntegration_DetectProjectID(t *testing.T) { + ctx := context.Background() + testCreds := testutil.Credentials(ctx) + if testCreds == nil { + t.Skip("test credentials not present, skipping") + } + + if _, err := NewClient(ctx, DetectProjectID, option.WithCredentials(testCreds)); err != nil { + t.Errorf("test NewClient: %v", err) + } + + badTS := testutil.ErroringTokenSource{} + + if badClient, err := NewClient(ctx, DetectProjectID, option.WithTokenSource(badTS)); err == nil { + t.Errorf("expected error from bad token source, NewClient succeeded with project: %s", badClient.Project()) + } +} + func TestIntegration_TableCreate(t *testing.T) { // Check that creating a record field with an empty schema is an error. if client == nil { diff --git a/bigquery/job.go b/bigquery/job.go index 2d259f910b4..725775dfd68 100644 --- a/bigquery/job.go +++ b/bigquery/job.go @@ -63,6 +63,11 @@ func (c *Client) JobFromIDLocation(ctx context.Context, id, location string) (j return bqToJob(bqjob, c) } +// Project returns the job's project. +func (j *Job) Project() string { + return j.projectID +} + // ID returns the job's ID. func (j *Job) ID() string { return j.jobID From b34783a4d7a8c88204e0f44bd411795d8267d811 Mon Sep 17 00:00:00 2001 From: Christopher Wilcox Date: Fri, 25 Jun 2021 11:19:16 -0700 Subject: [PATCH 10/50] feat(firestore): Add support for PartitionQuery (#4206) --- firestore/collgroupref.go | 148 +++++++++++++++++++++++++++++++++ firestore/collgroupref_test.go | 73 ++++++++++++++++ firestore/integration_test.go | 85 +++++++++++++++++++ firestore/order.go | 8 ++ 4 files changed, 314 insertions(+) create mode 100644 firestore/collgroupref_test.go diff --git a/firestore/collgroupref.go b/firestore/collgroupref.go index e43a7e648c5..c13ff1f160b 100644 --- a/firestore/collgroupref.go +++ b/firestore/collgroupref.go @@ -14,6 +14,16 @@ package firestore +import ( + "context" + "errors" + "fmt" + "sort" + + "google.golang.org/api/iterator" + firestorepb "google.golang.org/genproto/googleapis/firestore/v1" +) + // A CollectionGroupRef is a reference to a group of collections sharing the // same ID. type CollectionGroupRef struct { @@ -36,3 +46,141 @@ func newCollectionGroupRef(c *Client, dbPath, collectionID string) *CollectionGr }, } } + +// GetPartitionedQueries returns a slice of Query objects, each containing a +// partition of a collection group. partitionCount must be a positive value and +// the number of returned partitions may be less than the requested number if +// providing the desired number would result in partitions with very few documents. +// +// If a Collection Group Query would return a large number of documents, this +// can help to subdivide the query to smaller working units that can be distributed. +func (cgr CollectionGroupRef) GetPartitionedQueries(ctx context.Context, partitionCount int) ([]Query, error) { + qp, err := cgr.getPartitions(ctx, partitionCount) + if err != nil { + return nil, err + } + queries := make([]Query, len(qp)) + for _, part := range qp { + queries = append(queries, part.toQuery()) + } + return queries, nil +} + +// getPartitions returns a slice of queryPartition objects, describing a start +// and end range to query a subsection of the collection group. partitionCount +// must be a positive value and the number of returned partitions may be less +// than the requested number if providing the desired number would result in +// partitions with very few documents. +func (cgr CollectionGroupRef) getPartitions(ctx context.Context, partitionCount int) ([]queryPartition, error) { + orderedQuery := cgr.query().OrderBy(DocumentID, Asc) + + if partitionCount <= 0 { + return nil, errors.New("a positive partitionCount must be provided") + } else if partitionCount == 1 { + return []queryPartition{{CollectionGroupQuery: orderedQuery}}, nil + } + + db := cgr.c.path() + ctx = withResourceHeader(ctx, db) + + // CollectionGroup Queries need to be ordered by __name__ ASC. + query, err := orderedQuery.toProto() + if err != nil { + return nil, err + } + structuredQuery := &firestorepb.PartitionQueryRequest_StructuredQuery{ + StructuredQuery: query, + } + + // Uses default PageSize + pbr := &firestorepb.PartitionQueryRequest{ + Parent: db + "/documents", + PartitionCount: int64(partitionCount), + QueryType: structuredQuery, + } + cursorReferences := make([]*firestorepb.Value, 0, partitionCount) + iter := cgr.c.c.PartitionQuery(ctx, pbr) + for { + cursor, err := iter.Next() + if err == iterator.Done { + break + } + if err != nil { + return nil, fmt.Errorf("GetPartitions: %v", err) + } + cursorReferences = append(cursorReferences, cursor.GetValues()...) + } + + // From Proto documentation: + // To obtain a complete result set ordered with respect to the results of the + // query supplied to PartitionQuery, the results sets should be merged: + // cursor A, cursor B, cursor M, cursor Q, cursor U, cursor W + // Once we have exhausted the pages, the cursor values need to be sorted in + // lexicographical order by segment (areas between '/'). + sort.Sort(byFirestoreValue(cursorReferences)) + + queryPartitions := make([]queryPartition, 0, len(cursorReferences)) + previousCursor := "" + + for _, cursor := range cursorReferences { + cursorRef := cursor.GetReferenceValue() + + // remove the root path from the reference, as queries take cursors + // relative to a collection + cursorRef = cursorRef[len(orderedQuery.path)+1:] + + qp := queryPartition{ + CollectionGroupQuery: orderedQuery, + StartAt: previousCursor, + EndBefore: cursorRef, + } + queryPartitions = append(queryPartitions, qp) + previousCursor = cursorRef + } + + // In the case there were no partitions, we still add a single partition to + // the result, that covers the complete range. + lastPart := queryPartition{CollectionGroupQuery: orderedQuery} + if len(cursorReferences) > 0 { + cursorRef := cursorReferences[len(cursorReferences)-1].GetReferenceValue() + lastPart.StartAt = cursorRef[len(orderedQuery.path)+1:] + } + queryPartitions = append(queryPartitions, lastPart) + + return queryPartitions, nil +} + +// queryPartition provides a Collection Group Reference and start and end split +// points allowing for a section of a collection group to be queried. This is +// used by GetPartitions which, given a CollectionGroupReference returns smaller +// sub-queries or partitions +type queryPartition struct { + // CollectionGroupQuery is an ordered query on a CollectionGroupReference. + // This query must be ordered Asc on __name__. + // Example: client.CollectionGroup("collectionID").query().OrderBy(DocumentID, Asc) + CollectionGroupQuery Query + + // StartAt is a document reference value, relative to the collection, not + // a complete parent path. + // Example: "documents/collectionName/documentName" + StartAt string + + // EndBefore is a document reference value, relative to the collection, not + // a complete parent path. + // Example: "documents/collectionName/documentName" + EndBefore string +} + +// toQuery converts a queryPartition object to a Query object +func (qp queryPartition) toQuery() Query { + q := *qp.CollectionGroupQuery.query() + + // Remove the leading path before calling StartAt, EndBefore + if qp.StartAt != "" { + q = q.StartAt(qp.StartAt) + } + if qp.EndBefore != "" { + q = q.EndBefore(qp.EndBefore) + } + return q +} diff --git a/firestore/collgroupref_test.go b/firestore/collgroupref_test.go new file mode 100644 index 00000000000..bbcbfe4ebb6 --- /dev/null +++ b/firestore/collgroupref_test.go @@ -0,0 +1,73 @@ +// Copyright 2021 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 +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package firestore + +import ( + "context" + "testing" +) + +func TestCGR_TestQueryPartition_ToQuery(t *testing.T) { + cgr := newCollectionGroupRef(testClient, testClient.path(), "collectionID") + qp := queryPartition{ + CollectionGroupQuery: cgr.Query.OrderBy(DocumentID, Asc), + StartAt: "documents/start/at", + EndBefore: "documents/end/before", + } + + got := qp.toQuery() + + want := Query{ + c: testClient, + path: "projects/projectID/databases/(default)", + parentPath: "projects/projectID/databases/(default)/documents", + collectionID: "collectionID", + startVals: []interface{}{"documents/start/at"}, + endVals: []interface{}{"documents/end/before"}, + startBefore: true, + endBefore: true, + allDescendants: true, + orders: []order{{fieldPath: []string{"__name__"}, dir: 1}}, + } + + if !testEqual(got, want) { + t.Errorf("got %+v, want %+v", got, want) + } +} + +func TestCGR_TestGetPartitions(t *testing.T) { + cgr := newCollectionGroupRef(testClient, testClient.path(), "collectionID") + _, err := cgr.getPartitions(context.Background(), 0) + if err == nil { + t.Error("Expected an error when requested partition count is < 1") + } + + parts, err := cgr.getPartitions(context.Background(), 1) + if err != nil { + t.Error("Didn't expect an error when requested partition count is 1") + } + if len(parts) != 1 { + t.Fatal("Expected 1 queryPartition") + } + got := parts[0] + want := queryPartition{ + CollectionGroupQuery: cgr.Query.OrderBy(DocumentID, Asc), + StartAt: "", + EndBefore: "", + } + if !testEqual(got, want) { + t.Errorf("got %+v, want %+v", got, want) + } +} diff --git a/firestore/integration_test.go b/firestore/integration_test.go index e398150f84f..ca841858f98 100644 --- a/firestore/integration_test.go +++ b/firestore/integration_test.go @@ -1601,3 +1601,88 @@ func TestDetectProjectID(t *testing.T) { t.Errorf("expected an error while using TokenSource that does not have a project ID") } } + +func TestIntegration_ColGroupRefPartitions(t *testing.T) { + h := testHelper{t} + coll := integrationColl(t) + ctx := context.Background() + + // Create a doc in the test collection so a collectionID is live for testing + doc := coll.NewDoc() + h.mustCreate(doc, integrationTestMap) + + for _, tc := range []struct { + collectionID string + expectedPartitionCount int + }{ + // Verify no failures if a collection doesn't exist + {collectionID: "does-not-exist", expectedPartitionCount: 1}, + // Verify a collectionID with a small number of results returns a partition + {collectionID: coll.collectionID, expectedPartitionCount: 1}, + } { + colGroup := iClient.CollectionGroup(tc.collectionID) + partitions, err := colGroup.getPartitions(ctx, 10) + if err != nil { + t.Fatalf("getPartitions: received unexpected error: %v", err) + } + if got, want := len(partitions), tc.expectedPartitionCount; got != want { + t.Errorf("Unexpected Partition Count: got %d, want %d", got, want) + } + } +} + +func TestIntegration_ColGroupRefPartitionsLarge(t *testing.T) { + // Create collection with enough documents to have multiple partitions. + coll := integrationColl(t) + collectionID := coll.collectionID + "largeCollection" + coll = iClient.Collection(collectionID) + + ctx := context.Background() + + documentCount := 2*128 + 127 // Minimum partition size is 128. + + // Create documents in a collection sufficient to trigger multiple partitions. + batch := iClient.Batch() + deleteBatch := iClient.Batch() + for i := 0; i < documentCount; i++ { + doc := coll.Doc(fmt.Sprintf("doc%d", i)) + batch.Create(doc, integrationTestMap) + deleteBatch.Delete(doc) + } + batch.Commit(ctx) + defer deleteBatch.Commit(ctx) + + // Verify that we retrieve 383 documents for the colGroup (128*2 + 127) + colGroup := iClient.CollectionGroup(collectionID) + docs, err := colGroup.Documents(ctx).GetAll() + if err != nil { + t.Fatalf("GetAll(): received unexpected error: %v", err) + } + if got, want := len(docs), documentCount; got != want { + t.Errorf("Unexpected number of documents in collection group: got %d, want %d", got, want) + } + + // Get partitions, allow up to 10 to come back, expect less will be returned. + partitions, err := colGroup.GetPartitionedQueries(ctx, 10) + if err != nil { + t.Fatalf("GetPartitionedQueries: received unexpected error: %v", err) + } + if len(partitions) < 2 { + t.Errorf("Unexpected Partition Count. Expected 2 or more: got %d, want 2+", len(partitions)) + } + + // Verify that we retrieve 383 documents across all partitions. (128*2 + 127) + totalCount := 0 + for _, query := range partitions { + + allDocs, err := query.Documents(ctx).GetAll() + if err != nil { + t.Fatalf("GetAll(): received unexpected error: %v", err) + } + totalCount += len(allDocs) + } + + if got, want := totalCount, documentCount; got != want { + t.Errorf("Unexpected number of documents across partitions: got %d, want %d", got, want) + } +} diff --git a/firestore/order.go b/firestore/order.go index e5ee1e09fb5..c495a141fd3 100644 --- a/firestore/order.go +++ b/firestore/order.go @@ -22,6 +22,7 @@ import ( "strings" tspb "github.com/golang/protobuf/ptypes/timestamp" + firestorepb "google.golang.org/genproto/googleapis/firestore/v1" pb "google.golang.org/genproto/googleapis/firestore/v1" ) @@ -214,3 +215,10 @@ func typeOrder(v *pb.Value) int { panic(fmt.Sprintf("bad value type: %v", v)) } } + +// byReferenceValue implements sort.Interface for []*firestorepb.Value +type byFirestoreValue []*firestorepb.Value + +func (a byFirestoreValue) Len() int { return len(a) } +func (a byFirestoreValue) Swap(i, j int) { a[i], a[j] = a[j], a[i] } +func (a byFirestoreValue) Less(i, j int) bool { return compareValues(a[i], a[j]) < 0 } From ae34396b1a2a970a0d871cd5496527294f3310d4 Mon Sep 17 00:00:00 2001 From: tmdiep Date: Sat, 26 Jun 2021 07:17:55 +1000 Subject: [PATCH 11/50] fix(pubsublite): wire user context to api clients (#4318) --- pubsublite/pscompat/integration_test.go | 60 ++++++++++++++++++++----- pubsublite/pscompat/publisher.go | 5 +-- pubsublite/pscompat/subscriber.go | 23 +++++----- pubsublite/pscompat/subscriber_test.go | 4 +- 4 files changed, 66 insertions(+), 26 deletions(-) diff --git a/pubsublite/pscompat/integration_test.go b/pubsublite/pscompat/integration_test.go index a22358ead8e..ab14ad7b973 100644 --- a/pubsublite/pscompat/integration_test.go +++ b/pubsublite/pscompat/integration_test.go @@ -30,7 +30,9 @@ import ( "cloud.google.com/go/pubsublite/internal/wire" "github.com/google/go-cmp/cmp/cmpopts" "golang.org/x/sync/errgroup" + "golang.org/x/xerrors" "google.golang.org/api/option" + "google.golang.org/grpc/codes" vkit "cloud.google.com/go/pubsublite/apiv1" pb "google.golang.org/genproto/googleapis/cloud/pubsublite/v1" @@ -167,7 +169,7 @@ func partitionNumbers(partitionCount int) []int { func publishMessages(t *testing.T, settings PublishSettings, topic wire.TopicPath, msgs ...*pubsub.Message) { ctx := context.Background() - publisher := publisherClient(ctx, t, settings, topic) + publisher := publisherClient(context.Background(), t, settings, topic) defer publisher.Stop() var pubResults []*pubsub.PublishResult @@ -179,7 +181,7 @@ func publishMessages(t *testing.T, settings PublishSettings, topic wire.TopicPat func publishPrefixedMessages(t *testing.T, settings PublishSettings, topic wire.TopicPath, msgPrefix string, msgCount, msgSize int) []string { ctx := context.Background() - publisher := publisherClient(ctx, t, settings, topic) + publisher := publisherClient(context.Background(), t, settings, topic) defer publisher.Stop() orderingSender := test.NewOrderingSender() @@ -271,7 +273,7 @@ func receiveAllMessages(t *testing.T, msgTracker *test.MsgTracker, settings Rece } } - subscriber := subscriberClient(cctx, t, settings, subscription) + subscriber := subscriberClient(context.Background(), t, settings, subscription) if err := subscriber.Receive(cctx, messageReceiver); err != nil { t.Errorf("Receive() got err: %v", err) } @@ -298,7 +300,7 @@ func receiveAndVerifyMessage(t *testing.T, want *pubsub.Message, settings Receiv } } - subscriber := subscriberClient(cctx, t, settings, subscription) + subscriber := subscriberClient(context.Background(), t, settings, subscription) if err := subscriber.Receive(cctx, messageReceiver); err != nil { t.Errorf("Receive() got err: %v", err) } @@ -383,7 +385,7 @@ func TestIntegration_PublishSubscribeSinglePartition(t *testing.T) { } got.Nack() } - subscriber := subscriberClient(cctx, t, recvSettings, subscriptionPath) + subscriber := subscriberClient(context.Background(), t, recvSettings, subscriptionPath) if gotErr := subscriber.Receive(cctx, messageReceiver1); !test.ErrorEqual(gotErr, errNackCalled) { t.Errorf("Receive() got err: (%v), want err: (%v)", gotErr, errNackCalled) } @@ -400,7 +402,7 @@ func TestIntegration_PublishSubscribeSinglePartition(t *testing.T) { } return fmt.Errorf("Received unexpected message: %q", truncateMsg(string(msg.Data))) } - subscriber = subscriberClient(cctx, t, customSettings, subscriptionPath) + subscriber = subscriberClient(context.Background(), t, customSettings, subscriptionPath) messageReceiver2 := func(ctx context.Context, got *pubsub.Message) { got.Nack() @@ -434,7 +436,7 @@ func TestIntegration_PublishSubscribeSinglePartition(t *testing.T) { got.Ack() stopSubscriber() } - subscriber := subscriberClient(cctx, t, recvSettings, subscriptionPath) + subscriber := subscriberClient(context.Background(), t, recvSettings, subscriptionPath) // The message receiver stops the subscriber after receiving the first // message. However, the subscriber isn't guaranteed to immediately stop, so @@ -485,7 +487,7 @@ func TestIntegration_PublishSubscribeSinglePartition(t *testing.T) { // next test, which would receive an incorrect message. got.Ack() } - subscriber := subscriberClient(cctx, t, recvSettings, subscriptionPath) + subscriber := subscriberClient(context.Background(), t, recvSettings, subscriptionPath) if err := subscriber.Receive(cctx, messageReceiver); err != nil { t.Errorf("Receive() got err: %v", err) @@ -539,6 +541,44 @@ func TestIntegration_PublishSubscribeSinglePartition(t *testing.T) { receiveAllMessages(t, msgTracker, recvSettings, subscriptionPath) }) + // Verifies that cancelling the context passed to NewPublisherClient can shut + // down the publisher. + t.Run("CancelPublisherContext", func(t *testing.T) { + cctx, cancel := context.WithCancel(context.Background()) + publisher := publisherClient(cctx, t, DefaultPublishSettings, topicPath) + + cancel() + + wantCode := codes.Canceled + result := publisher.Publish(ctx, &pubsub.Message{Data: []byte("cancel_publisher_context")}) + if _, err := result.Get(ctx); !test.ErrorHasCode(err, wantCode) { + t.Errorf("Publish() got err: %v, want code: %v", err, wantCode) + } + if err := xerrors.Unwrap(publisher.Error()); !test.ErrorHasCode(err, wantCode) { + t.Errorf("Error() got err: %v, want code: %v", err, wantCode) + } + publisher.Stop() + }) + + // Verifies that cancelling the context passed to NewSubscriberClient can shut + // down the subscriber. + t.Run("CancelSubscriberContext", func(t *testing.T) { + msg := &pubsub.Message{Data: []byte("cancel_subscriber_context")} + publishMessages(t, DefaultPublishSettings, topicPath, msg) + + cctx, cancel := context.WithCancel(context.Background()) + subscriber := subscriberClient(cctx, t, recvSettings, subscriptionPath) + + subsErr := subscriber.Receive(context.Background(), func(ctx context.Context, got *pubsub.Message) { + got.Ack() + cancel() + }) + + if err, wantCode := xerrors.Unwrap(subsErr), codes.Canceled; !test.ErrorHasCode(err, wantCode) { + t.Errorf("Receive() got err: %v, want code: %v", err, wantCode) + } + }) + // NOTE: This should be the last test case. // Verifies that increasing the number of topic partitions is handled // correctly by publishers. @@ -547,7 +587,7 @@ func TestIntegration_PublishSubscribeSinglePartition(t *testing.T) { const pollPeriod = 5 * time.Second pubSettings := DefaultPublishSettings pubSettings.configPollPeriod = pollPeriod // Poll updates more frequently - publisher := publisherClient(ctx, t, pubSettings, topicPath) + publisher := publisherClient(context.Background(), t, pubSettings, topicPath) defer publisher.Stop() // Update the number of partitions. @@ -661,7 +701,7 @@ func TestIntegration_PublishSubscribeMultiPartition(t *testing.T) { for i := 0; i < subscriberCount; i++ { // Subscribers must be started in a goroutine as Receive() blocks. g.Go(func() error { - subscriber := subscriberClient(cctx, t, DefaultReceiveSettings, subscriptionPath) + subscriber := subscriberClient(context.Background(), t, DefaultReceiveSettings, subscriptionPath) err := subscriber.Receive(cctx, messageReceiver) if err != nil { t.Errorf("Receive() got err: %v", err) diff --git a/pubsublite/pscompat/publisher.go b/pubsublite/pscompat/publisher.go index 6f4e9415a82..b9f8c82e19a 100644 --- a/pubsublite/pscompat/publisher.go +++ b/pubsublite/pscompat/publisher.go @@ -82,10 +82,7 @@ func NewPublisherClientWithSettings(ctx context.Context, topic string, settings return nil, err } - // Note: ctx is not used to create the wire publisher, because if it is - // cancelled, the publisher will not be able to perform graceful shutdown - // (e.g. flush pending messages). - wirePub, err := wire.NewPublisher(context.Background(), settings.toWireSettings(), region, topic, opts...) + wirePub, err := wire.NewPublisher(ctx, settings.toWireSettings(), region, topic, opts...) if err != nil { return nil, err } diff --git a/pubsublite/pscompat/subscriber.go b/pubsublite/pscompat/subscriber.go index dafb25ee526..d76cc9d290b 100644 --- a/pubsublite/pscompat/subscriber.go +++ b/pubsublite/pscompat/subscriber.go @@ -72,7 +72,7 @@ func (ah *pslAckHandler) OnNack() { // wireSubscriberFactory is a factory for creating wire subscribers, which can // be overridden with a mock in unit tests. type wireSubscriberFactory interface { - New(wire.MessageReceiverFunc) (wire.Subscriber, error) + New(context.Context, wire.MessageReceiverFunc) (wire.Subscriber, error) } type wireSubscriberFactoryImpl struct { @@ -82,8 +82,8 @@ type wireSubscriberFactoryImpl struct { options []option.ClientOption } -func (f *wireSubscriberFactoryImpl) New(receiver wire.MessageReceiverFunc) (wire.Subscriber, error) { - return wire.NewSubscriber(context.Background(), f.settings, receiver, f.region, f.subscription.String(), f.options...) +func (f *wireSubscriberFactoryImpl) New(ctx context.Context, receiver wire.MessageReceiverFunc) (wire.Subscriber, error) { + return wire.NewSubscriber(ctx, f.settings, receiver, f.region, f.subscription.String(), f.options...) } type messageReceiverFunc = func(context.Context, *pubsub.Message) @@ -103,8 +103,8 @@ type subscriberInstance struct { err error } -func newSubscriberInstance(ctx context.Context, factory wireSubscriberFactory, settings ReceiveSettings, receiver messageReceiverFunc) (*subscriberInstance, error) { - recvCtx, recvCancel := context.WithCancel(ctx) +func newSubscriberInstance(recvCtx, clientCtx context.Context, factory wireSubscriberFactory, settings ReceiveSettings, receiver messageReceiverFunc) (*subscriberInstance, error) { + recvCtx, recvCancel := context.WithCancel(recvCtx) subInstance := &subscriberInstance{ settings: settings, recvCtx: recvCtx, @@ -112,10 +112,11 @@ func newSubscriberInstance(ctx context.Context, factory wireSubscriberFactory, s receiver: receiver, } - // Note: ctx is not used to create the wire subscriber, because if it is - // cancelled, the subscriber will not be able to perform graceful shutdown - // (e.g. process acks and commit the final cursor offset). - wireSub, err := factory.New(subInstance.onMessage) + // Note: The context from Receive (recvCtx) should not be used, as when it is + // cancelled, the gRPC streams will be disconnected and the subscriber will + // not be able to process acks and commit the final cursor offset. Use the + // context from NewSubscriberClient (clientCtx) instead. + wireSub, err := factory.New(clientCtx, subInstance.onMessage) if err != nil { return nil, err } @@ -229,6 +230,7 @@ func (si *subscriberInstance) Wait(ctx context.Context) error { // See https://cloud.google.com/pubsub/lite/docs/subscribing for more // information about receiving messages. type SubscriberClient struct { + clientCtx context.Context settings ReceiveSettings wireSubFactory wireSubscriberFactory @@ -265,6 +267,7 @@ func NewSubscriberClientWithSettings(ctx context.Context, subscription string, s options: opts, } subClient := &SubscriberClient{ + clientCtx: ctx, settings: settings, wireSubFactory: factory, } @@ -303,7 +306,7 @@ func (s *SubscriberClient) Receive(ctx context.Context, f func(context.Context, defer s.setReceiveActive(false) // Initialize a subscriber instance. - subInstance, err := newSubscriberInstance(ctx, s.wireSubFactory, s.settings, f) + subInstance, err := newSubscriberInstance(ctx, s.clientCtx, s.wireSubFactory, s.settings, f) if err != nil { return err } diff --git a/pubsublite/pscompat/subscriber_test.go b/pubsublite/pscompat/subscriber_test.go index 429c9f55141..5c737f8ff42 100644 --- a/pubsublite/pscompat/subscriber_test.go +++ b/pubsublite/pscompat/subscriber_test.go @@ -113,7 +113,7 @@ func (ms *mockWireSubscriber) WaitStopped() error { type mockWireSubscriberFactory struct{} -func (f *mockWireSubscriberFactory) New(receiver wire.MessageReceiverFunc) (wire.Subscriber, error) { +func (f *mockWireSubscriberFactory) New(ctx context.Context, receiver wire.MessageReceiverFunc) (wire.Subscriber, error) { return &mockWireSubscriber{ receiver: receiver, msgsC: make(chan *wire.ReceivedMessage, 10), @@ -122,7 +122,7 @@ func (f *mockWireSubscriberFactory) New(receiver wire.MessageReceiverFunc) (wire } func newTestSubscriberInstance(ctx context.Context, settings ReceiveSettings, receiver messageReceiverFunc) *subscriberInstance { - sub, _ := newSubscriberInstance(ctx, new(mockWireSubscriberFactory), settings, receiver) + sub, _ := newSubscriberInstance(ctx, context.Background(), new(mockWireSubscriberFactory), settings, receiver) return sub } From 12f3042716d51fb0d7a23071d00a20f9751bac91 Mon Sep 17 00:00:00 2001 From: shollyman Date: Mon, 28 Jun 2021 10:50:55 -0700 Subject: [PATCH 12/50] fix(bigquery): update streaming insert error test (#4321) More backend changes appear to be inducing two forms of error message, depending on which component intercepts the error first. This test captures both outcomes (we always get an error). Co-authored-by: Tyler Bui-Palsulich <26876514+tbpg@users.noreply.github.com> --- bigquery/integration_test.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/bigquery/integration_test.go b/bigquery/integration_test.go index 8b7b2a1e5ad..9bf2f91030e 100644 --- a/bigquery/integration_test.go +++ b/bigquery/integration_test.go @@ -1378,9 +1378,11 @@ func TestIntegration_InsertErrors(t *testing.T) { if !ok { t.Errorf("Wanted googleapi.Error, got: %v", err) } - want := "Request payload size exceeds the limit" - if !strings.Contains(e.Message, want) { - t.Errorf("Error didn't contain expected message (%s): %s", want, e.Message) + if e.Code != http.StatusRequestEntityTooLarge { + want := "Request payload size exceeds the limit" + if !strings.Contains(e.Message, want) { + t.Errorf("Error didn't contain expected message (%s): %#v", want, e) + } } // Case 2: Very Large Request // Request so large it gets rejected by intermediate infra (3x 10MB rows) From 99bc782fb50a47602b45278384ef5d5b5da9263b Mon Sep 17 00:00:00 2001 From: Chris Cotter Date: Mon, 28 Jun 2021 14:37:40 -0400 Subject: [PATCH 13/50] feat(storage): support PublicAccessPrevention (#3608) This is a new field in the IAM configuration for buckets. Support viewing/setting via bucket attrs, and add an integration test for the feature. Closes #3203 --- storage/bucket.go | 82 +++++++++++++++++++++++++++++++++++-- storage/bucket_test.go | 41 +++++++++++++++++++ storage/integration_test.go | 82 +++++++++++++++++++++++++++++++++++++ 3 files changed, 201 insertions(+), 4 deletions(-) diff --git a/storage/bucket.go b/storage/bucket.go index 7b1757b83de..7208f577e66 100644 --- a/storage/bucket.go +++ b/storage/bucket.go @@ -244,6 +244,13 @@ type BucketAttrs struct { // for more information. UniformBucketLevelAccess UniformBucketLevelAccess + // PublicAccessPrevention is the setting for the bucket's + // PublicAccessPrevention policy, which can be used to prevent public access + // of data in the bucket. See + // https://cloud.google.com/storage/docs/public-access-prevention for more + // information. + PublicAccessPrevention PublicAccessPrevention + // DefaultObjectACL is the list of access controls to // apply to new objects when no object ACL is provided. DefaultObjectACL []ACLRule @@ -353,6 +360,41 @@ type UniformBucketLevelAccess struct { LockedTime time.Time } +// PublicAccessPrevention configures the Public Access Prevention feature, which +// can be used to disallow public access to any data in a bucket. See +// https://cloud.google.com/storage/docs/public-access-prevention for more +// information. +type PublicAccessPrevention int + +const ( + // PublicAccessPreventionUnknown is a zero value, used only if this field is + // not set in a call to GCS. + PublicAccessPreventionUnknown PublicAccessPrevention = iota + + // PublicAccessPreventionUnspecified corresponds to a value of "unspecified" + // and is the default for buckets. + PublicAccessPreventionUnspecified + + // PublicAccessPreventionEnforced corresponds to a value of "enforced". This + // enforces Public Access Prevention on the bucket. + PublicAccessPreventionEnforced + + publicAccessPreventionUnknown string = "" + publicAccessPreventionUnspecified = "unspecified" + publicAccessPreventionEnforced = "enforced" +) + +func (p PublicAccessPrevention) String() string { + switch p { + case PublicAccessPreventionUnspecified: + return publicAccessPreventionUnspecified + case PublicAccessPreventionEnforced: + return publicAccessPreventionEnforced + default: + return publicAccessPreventionUnknown + } +} + // Lifecycle is the lifecycle configuration for objects in the bucket. type Lifecycle struct { Rules []LifecycleRule @@ -551,6 +593,7 @@ func newBucket(b *raw.Bucket) (*BucketAttrs, error) { Website: toBucketWebsite(b.Website), BucketPolicyOnly: toBucketPolicyOnly(b.IamConfiguration), UniformBucketLevelAccess: toUniformBucketLevelAccess(b.IamConfiguration), + PublicAccessPrevention: toPublicAccessPrevention(b.IamConfiguration), Etag: b.Etag, LocationType: b.LocationType, }, nil @@ -578,11 +621,15 @@ func (b *BucketAttrs) toRawBucket() *raw.Bucket { bb = &raw.BucketBilling{RequesterPays: true} } var bktIAM *raw.BucketIamConfiguration - if b.UniformBucketLevelAccess.Enabled || b.BucketPolicyOnly.Enabled { - bktIAM = &raw.BucketIamConfiguration{ - UniformBucketLevelAccess: &raw.BucketIamConfigurationUniformBucketLevelAccess{ + if b.UniformBucketLevelAccess.Enabled || b.BucketPolicyOnly.Enabled || b.PublicAccessPrevention != PublicAccessPreventionUnknown { + bktIAM = &raw.BucketIamConfiguration{} + if b.UniformBucketLevelAccess.Enabled || b.BucketPolicyOnly.Enabled { + bktIAM.UniformBucketLevelAccess = &raw.BucketIamConfigurationUniformBucketLevelAccess{ Enabled: true, - }, + } + } + if b.PublicAccessPrevention != PublicAccessPreventionUnknown { + bktIAM.PublicAccessPrevention = b.PublicAccessPrevention.String() } } return &raw.Bucket{ @@ -661,6 +708,13 @@ type BucketAttrsToUpdate struct { // for more information. UniformBucketLevelAccess *UniformBucketLevelAccess + // PublicAccessPrevention is the setting for the bucket's + // PublicAccessPrevention policy, which can be used to prevent public access + // of data in the bucket. See + // https://cloud.google.com/storage/docs/public-access-prevention for more + // information. + PublicAccessPrevention PublicAccessPrevention + // StorageClass is the default storage class of the bucket. This defines // how objects in the bucket are stored and determines the SLA // and the cost of storage. Typical values are "STANDARD", "NEARLINE", @@ -771,6 +825,12 @@ func (ua *BucketAttrsToUpdate) toRawBucket() *raw.Bucket { }, } } + if ua.PublicAccessPrevention != PublicAccessPreventionUnknown { + if rb.IamConfiguration == nil { + rb.IamConfiguration = &raw.BucketIamConfiguration{} + } + rb.IamConfiguration.PublicAccessPrevention = ua.PublicAccessPrevention.String() + } if ua.Encryption != nil { if ua.Encryption.DefaultKMSKeyName == "" { rb.NullFields = append(rb.NullFields, "Encryption") @@ -1139,6 +1199,20 @@ func toUniformBucketLevelAccess(b *raw.BucketIamConfiguration) UniformBucketLeve } } +func toPublicAccessPrevention(b *raw.BucketIamConfiguration) PublicAccessPrevention { + if b == nil { + return PublicAccessPreventionUnknown + } + switch b.PublicAccessPrevention { + case publicAccessPreventionUnspecified: + return PublicAccessPreventionUnspecified + case publicAccessPreventionEnforced: + return PublicAccessPreventionEnforced + default: + return PublicAccessPreventionUnknown + } +} + // Objects returns an iterator over the objects in the bucket that match the // Query q. If q is nil, no filtering is done. Objects will be iterated over // lexicographically by name. diff --git a/storage/bucket_test.go b/storage/bucket_test.go index 123e319a84e..4ff5f5cc5ed 100644 --- a/storage/bucket_test.go +++ b/storage/bucket_test.go @@ -42,6 +42,7 @@ func TestBucketAttrsToRawBucket(t *testing.T) { }, BucketPolicyOnly: BucketPolicyOnly{Enabled: true}, UniformBucketLevelAccess: UniformBucketLevelAccess{Enabled: true}, + PublicAccessPrevention: PublicAccessPreventionEnforced, VersioningEnabled: false, // should be ignored: MetaGeneration: 39, @@ -121,6 +122,7 @@ func TestBucketAttrsToRawBucket(t *testing.T) { UniformBucketLevelAccess: &raw.BucketIamConfigurationUniformBucketLevelAccess{ Enabled: true, }, + PublicAccessPrevention: "enforced", }, Versioning: nil, // ignore VersioningEnabled if false Labels: map[string]string{"label": "value"}, @@ -205,6 +207,7 @@ func TestBucketAttrsToRawBucket(t *testing.T) { UniformBucketLevelAccess: &raw.BucketIamConfigurationUniformBucketLevelAccess{ Enabled: true, }, + PublicAccessPrevention: "enforced", } if msg := testutil.Diff(got, want); msg != "" { t.Errorf(msg) @@ -219,6 +222,7 @@ func TestBucketAttrsToRawBucket(t *testing.T) { UniformBucketLevelAccess: &raw.BucketIamConfigurationUniformBucketLevelAccess{ Enabled: true, }, + PublicAccessPrevention: "enforced", } if msg := testutil.Diff(got, want); msg != "" { t.Errorf(msg) @@ -234,6 +238,7 @@ func TestBucketAttrsToRawBucket(t *testing.T) { UniformBucketLevelAccess: &raw.BucketIamConfigurationUniformBucketLevelAccess{ Enabled: true, }, + PublicAccessPrevention: "enforced", } if msg := testutil.Diff(got, want); msg != "" { t.Errorf(msg) @@ -244,6 +249,42 @@ func TestBucketAttrsToRawBucket(t *testing.T) { attrs.BucketPolicyOnly = BucketPolicyOnly{} attrs.UniformBucketLevelAccess = UniformBucketLevelAccess{} got = attrs.toRawBucket() + want.IamConfiguration = &raw.BucketIamConfiguration{ + PublicAccessPrevention: "enforced", + } + if msg := testutil.Diff(got, want); msg != "" { + t.Errorf(msg) + } + + // Test that setting PublicAccessPrevention to "unspecified" leads to the + // setting being propagated in the proto. + attrs.PublicAccessPrevention = PublicAccessPreventionUnspecified + got = attrs.toRawBucket() + want.IamConfiguration = &raw.BucketIamConfiguration{ + PublicAccessPrevention: "unspecified", + } + if msg := testutil.Diff(got, want); msg != "" { + t.Errorf(msg) + } + + // Re-enable UBLA and confirm that it does not affect the PAP setting. + attrs.UniformBucketLevelAccess = UniformBucketLevelAccess{Enabled: true} + got = attrs.toRawBucket() + want.IamConfiguration = &raw.BucketIamConfiguration{ + UniformBucketLevelAccess: &raw.BucketIamConfigurationUniformBucketLevelAccess{ + Enabled: true, + }, + PublicAccessPrevention: "unspecified", + } + if msg := testutil.Diff(got, want); msg != "" { + t.Errorf(msg) + } + + // Disable UBLA and reset PAP to default. Confirm that the IAM config is set + // to nil in the proto. + attrs.UniformBucketLevelAccess = UniformBucketLevelAccess{Enabled: false} + attrs.PublicAccessPrevention = PublicAccessPreventionUnknown + got = attrs.toRawBucket() want.IamConfiguration = nil if msg := testutil.Diff(got, want); msg != "" { t.Errorf(msg) diff --git a/storage/integration_test.go b/storage/integration_test.go index 16fd736f486..043cc5a8bd5 100644 --- a/storage/integration_test.go +++ b/storage/integration_test.go @@ -52,6 +52,7 @@ import ( "google.golang.org/api/iterator" itesting "google.golang.org/api/iterator/testing" "google.golang.org/api/option" + iampb "google.golang.org/genproto/googleapis/iam/v1" ) const ( @@ -575,6 +576,87 @@ func TestIntegration_UniformBucketLevelAccess(t *testing.T) { } } +func TestIntegration_PublicAccessPrevention(t *testing.T) { + ctx := context.Background() + client := testConfig(ctx, t) + defer client.Close() + h := testHelper{t} + + // Create a bucket with PublicAccessPrevention enforced. + bkt := client.Bucket(uidSpace.New()) + h.mustCreate(bkt, testutil.ProjID(), &BucketAttrs{PublicAccessPrevention: PublicAccessPreventionEnforced}) + defer h.mustDeleteBucket(bkt) + + // Making bucket public should fail. + policy, err := bkt.IAM().V3().Policy(ctx) + if err != nil { + t.Fatalf("fetching bucket IAM policy: %v", err) + } + policy.Bindings = append(policy.Bindings, &iampb.Binding{ + Role: "roles/storage.objectViewer", + Members: []string{iam.AllUsers}, + }) + if err := bkt.IAM().V3().SetPolicy(ctx, policy); err == nil { + t.Error("SetPolicy: expected adding AllUsers policy to bucket should fail") + } + + // Making object public via ACL should fail. + o := bkt.Object("publicAccessPrevention") + defer func() { + if err := o.Delete(ctx); err != nil { + log.Printf("failed to delete test object: %v", err) + } + }() + wc := o.NewWriter(ctx) + wc.ContentType = "text/plain" + h.mustWrite(wc, []byte("test")) + a := o.ACL() + if err := a.Set(ctx, AllUsers, RoleReader); err == nil { + t.Error("ACL.Set: expected adding AllUsers ACL to object should fail") + } + + // Update PAP setting to unspecified should work and not affect UBLA setting. + attrs, err := bkt.Update(ctx, BucketAttrsToUpdate{PublicAccessPrevention: PublicAccessPreventionUnspecified}) + if err != nil { + t.Fatalf("updating PublicAccessPrevention failed: %v", err) + } + if attrs.PublicAccessPrevention != PublicAccessPreventionUnspecified { + t.Errorf("updating PublicAccessPrevention: got %s, want %s", attrs.PublicAccessPrevention, PublicAccessPreventionUnspecified) + } + if attrs.UniformBucketLevelAccess.Enabled || attrs.BucketPolicyOnly.Enabled { + t.Error("updating PublicAccessPrevention changed UBLA setting") + } + + // Now, making object public or making bucket public should succeed. + a = o.ACL() + if err := a.Set(ctx, AllUsers, RoleReader); err != nil { + t.Errorf("ACL.Set: making object public failed: %v", err) + } + policy, err = bkt.IAM().V3().Policy(ctx) + if err != nil { + t.Fatalf("fetching bucket IAM policy: %v", err) + } + policy.Bindings = append(policy.Bindings, &iampb.Binding{ + Role: "roles/storage.objectViewer", + Members: []string{iam.AllUsers}, + }) + if err := bkt.IAM().V3().SetPolicy(ctx, policy); err != nil { + t.Errorf("SetPolicy: making bucket public failed: %v", err) + } + + // Updating UBLA should not affect PAP setting. + attrs, err = bkt.Update(ctx, BucketAttrsToUpdate{UniformBucketLevelAccess: &UniformBucketLevelAccess{Enabled: true}}) + if err != nil { + t.Fatalf("updating UBLA failed: %v", err) + } + if !attrs.UniformBucketLevelAccess.Enabled { + t.Error("updating UBLA: got UBLA not enabled, want enabled") + } + if attrs.PublicAccessPrevention != PublicAccessPreventionUnspecified { + t.Errorf("updating UBLA: got %s, want %s", attrs.PublicAccessPrevention, PublicAccessPreventionUnspecified) + } +} + func TestIntegration_ConditionalDelete(t *testing.T) { ctx := context.Background() client := testConfig(ctx, t) From 5ac09d911f9e65fd15acb7c0c7acb0dd635f364f Mon Sep 17 00:00:00 2001 From: yoshi-code-bot <70984784+yoshi-code-bot@users.noreply.github.com> Date: Mon, 28 Jun 2021 12:11:46 -0700 Subject: [PATCH 14/50] chore: release storage 1.16.0 (#4332) --- storage/CHANGES.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/storage/CHANGES.md b/storage/CHANGES.md index 661e0b1cb4b..8b4754edc44 100644 --- a/storage/CHANGES.md +++ b/storage/CHANGES.md @@ -1,5 +1,18 @@ # Changes +## [1.16.0](https://www.github.com/googleapis/google-cloud-go/compare/storage/v1.15.0...storage/v1.16.0) (2021-06-28) + + +### Features + +* **storage:** support PublicAccessPrevention ([#3608](https://www.github.com/googleapis/google-cloud-go/issues/3608)) ([99bc782](https://www.github.com/googleapis/google-cloud-go/commit/99bc782fb50a47602b45278384ef5d5b5da9263b)), refs [#3203](https://www.github.com/googleapis/google-cloud-go/issues/3203) + + +### Bug Fixes + +* **storage:** fix Writer.ChunkSize validation ([#4255](https://www.github.com/googleapis/google-cloud-go/issues/4255)) ([69c2e9d](https://www.github.com/googleapis/google-cloud-go/commit/69c2e9dc6303e1a004d3104a8178532fa738e742)), refs [#4167](https://www.github.com/googleapis/google-cloud-go/issues/4167) +* **storage:** try to reopen for failed Reads ([#4226](https://www.github.com/googleapis/google-cloud-go/issues/4226)) ([564102b](https://www.github.com/googleapis/google-cloud-go/commit/564102b335dbfb558bec8af883e5f898efb5dd10)), refs [#3040](https://www.github.com/googleapis/google-cloud-go/issues/3040) + ## [1.15.0](https://www.github.com/googleapis/google-cloud-go/compare/storage/v1.13.0...storage/v1.15.0) (2021-04-21) From e75262cf5eba845271965eab3c28c0a23bec14c4 Mon Sep 17 00:00:00 2001 From: tmdiep Date: Tue, 29 Jun 2021 06:46:12 +1000 Subject: [PATCH 15/50] fix(pubsublite): ensure timeout settings are respected (#4329) Fixes for retryableStream and partitionCountWatcher to ensure PublisherSettings.Timeout and ReceiveSettings.Timeout are respected. --- pubsublite/internal/wire/partition_count.go | 40 +++++++--- .../internal/wire/partition_count_test.go | 56 ++++++++++++- pubsublite/internal/wire/publisher_test.go | 5 +- pubsublite/internal/wire/request_timer.go | 78 +++++++++++++++++++ .../internal/wire/request_timer_test.go | 61 +++++++++++++++ pubsublite/internal/wire/streams.go | 65 +++++++++++----- pubsublite/internal/wire/streams_test.go | 41 ++++++++++ 7 files changed, 311 insertions(+), 35 deletions(-) create mode 100644 pubsublite/internal/wire/request_timer.go create mode 100644 pubsublite/internal/wire/request_timer_test.go diff --git a/pubsublite/internal/wire/partition_count.go b/pubsublite/internal/wire/partition_count.go index c4319a536f0..4255a647443 100644 --- a/pubsublite/internal/wire/partition_count.go +++ b/pubsublite/internal/wire/partition_count.go @@ -16,6 +16,9 @@ package wire import ( "context" "fmt" + "time" + + "golang.org/x/xerrors" vkit "cloud.google.com/go/pubsublite/apiv1" gax "github.com/googleapis/gax-go/v2" @@ -30,11 +33,13 @@ type partitionCountReceiver func(partitionCount int) // topic and notifies a receiver if it changes. type partitionCountWatcher struct { // Immutable after creation. - ctx context.Context - adminClient *vkit.AdminClient - topicPath string - receiver partitionCountReceiver - callOption gax.CallOption + ctx context.Context + adminClient *vkit.AdminClient + topicPath string + receiver partitionCountReceiver + callOption gax.CallOption + initialTimeout time.Duration + pollPeriod time.Duration // Fields below must be guarded with mu. partitionCount int @@ -47,11 +52,13 @@ func newPartitionCountWatcher(ctx context.Context, adminClient *vkit.AdminClient settings PublishSettings, topicPath string, receiver partitionCountReceiver) *partitionCountWatcher { p := &partitionCountWatcher{ - ctx: ctx, - adminClient: adminClient, - topicPath: topicPath, - receiver: receiver, - callOption: resourceExhaustedRetryer(), + ctx: ctx, + adminClient: adminClient, + topicPath: topicPath, + receiver: receiver, + callOption: resourceExhaustedRetryer(), + initialTimeout: settings.Timeout, + pollPeriod: settings.ConfigPollPeriod, } // Polling the topic partition count can be disabled in settings if the period @@ -88,8 +95,17 @@ func (p *partitionCountWatcher) updatePartitionCount() { p.mu.Unlock() newPartitionCount, err := func() (int, error) { + // Ensure the first update respects PublishSettings.Timeout. + timeout := p.initialTimeout + if prevPartitionCount > 0 { + timeout = p.pollPeriod + } + cctx, cancel := context.WithCancel(p.ctx) + rt := newRequestTimer(timeout, cancel, ErrBackendUnavailable) + req := &pb.GetTopicPartitionsRequest{Name: p.topicPath} - resp, err := p.adminClient.GetTopicPartitions(p.ctx, req, p.callOption) + resp, err := p.adminClient.GetTopicPartitions(cctx, req, p.callOption) + rt.Stop() p.mu.Lock() defer p.mu.Unlock() @@ -105,7 +121,7 @@ func (p *partitionCountWatcher) updatePartitionCount() { // TODO: Log the error. return p.partitionCount, nil } - err = fmt.Errorf("pubsublite: failed to update topic partition count: %v", err) + err = xerrors.Errorf("pubsublite: failed to update topic partition count: %w", rt.ResolveError(err)) p.unsafeInitiateShutdown(err) return 0, err } diff --git a/pubsublite/internal/wire/partition_count_test.go b/pubsublite/internal/wire/partition_count_test.go index aef4387e0b9..b203425eecf 100644 --- a/pubsublite/internal/wire/partition_count_test.go +++ b/pubsublite/internal/wire/partition_count_test.go @@ -16,6 +16,7 @@ package wire import ( "context" "testing" + "time" "cloud.google.com/go/internal/testutil" "cloud.google.com/go/pubsublite/internal/test" @@ -54,7 +55,7 @@ func newTestPartitionCountWatcher(t *testing.T, topicPath string, settings Publi tw := &testPartitionCountWatcher{ t: t, } - tw.watcher = newPartitionCountWatcher(ctx, adminClient, testPublishSettings(), topicPath, tw.onCountChanged) + tw.watcher = newPartitionCountWatcher(ctx, adminClient, settings, topicPath, tw.onCountChanged) tw.initAndStart(t, tw.watcher, "PartitionCountWatcher", adminClient) return tw } @@ -95,6 +96,59 @@ func TestPartitionCountWatcherZeroPartitionCountFails(t *testing.T) { watcher.VerifyCounts(nil) } +func TestPartitionCountWatcherInitialRequestTimesOut(t *testing.T) { + const topic = "projects/123456/locations/us-central1-b/topics/my-topic" + + verifiers := test.NewVerifiers(t) + barrier := verifiers.GlobalVerifier.PushWithBarrier(topicPartitionsReq(topic), topicPartitionsResp(1), nil) + + mockServer.OnTestStart(verifiers) + defer mockServer.OnTestEnd() + + settings := testPublishSettings() + settings.Timeout = 20 * time.Millisecond // Set low timeout for initial request + watcher := newTestPartitionCountWatcher(t, topic, settings) + + if gotErr, wantErr := watcher.StartError(), ErrBackendUnavailable; !test.ErrorEqual(gotErr, wantErr) { + t.Errorf("Start() got err: (%v), want err: (%v)", gotErr, wantErr) + } + barrier.Release() + watcher.VerifyCounts(nil) +} + +func TestPartitionCountWatcherUpdateLongerTimeouts(t *testing.T) { + const topic = "projects/123456/locations/us-central1-b/topics/my-topic" + wantPartitionCount1 := 1 + wantPartitionCount2 := 2 + + verifiers := test.NewVerifiers(t) + verifiers.GlobalVerifier.Push(topicPartitionsReq(topic), topicPartitionsResp(wantPartitionCount1), nil) + // Barrier used to delay response. + barrier := verifiers.GlobalVerifier.PushWithBarrier(topicPartitionsReq(topic), topicPartitionsResp(wantPartitionCount2), nil) + + mockServer.OnTestStart(verifiers) + defer mockServer.OnTestEnd() + + watcher := newTestPartitionCountWatcher(t, topic, testPublishSettings()) + if gotErr := watcher.StartError(); gotErr != nil { + t.Errorf("Start() got err: (%v)", gotErr) + } + watcher.VerifyCounts([]int{wantPartitionCount1}) + + // Override the initial timeout after the first request to verify that it + // isn't used. If set at creation, the first request will fail. + const timeout = time.Millisecond + watcher.watcher.initialTimeout = timeout + go func() { + barrier.ReleaseAfter(func() { + time.Sleep(5 * timeout) + }) + }() + watcher.UpdatePartitionCount() + watcher.VerifyCounts([]int{wantPartitionCount1, wantPartitionCount2}) + watcher.StopVerifyNoError() +} + func TestPartitionCountWatcherPartitionCountUnchanged(t *testing.T) { const topic = "projects/123456/locations/us-central1-b/topics/my-topic" wantPartitionCount1 := 4 diff --git a/pubsublite/internal/wire/publisher_test.go b/pubsublite/internal/wire/publisher_test.go index b407c651dc4..47eda71f5be 100644 --- a/pubsublite/internal/wire/publisher_test.go +++ b/pubsublite/internal/wire/publisher_test.go @@ -34,8 +34,9 @@ func testPublishSettings() PublishSettings { // Send messages with minimal delay to speed up tests. settings.DelayThreshold = time.Millisecond settings.Timeout = 5 * time.Second - // Disable topic partition count background polling. - settings.ConfigPollPeriod = 0 + // Set long poll period to prevent background update, but still have non-zero + // request timeout. + settings.ConfigPollPeriod = 1 * time.Minute return settings } diff --git a/pubsublite/internal/wire/request_timer.go b/pubsublite/internal/wire/request_timer.go new file mode 100644 index 00000000000..ee3a1565e54 --- /dev/null +++ b/pubsublite/internal/wire/request_timer.go @@ -0,0 +1,78 @@ +// Copyright 2021 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 + +package wire + +import ( + "sync" + "time" +) + +type requestTimerStatus int + +const ( + requestTimerNew requestTimerStatus = iota + requestTimerStopped + requestTimerTriggered +) + +// requestTimer bounds the duration of a request and executes `onTimeout` if +// the timer is triggered. +type requestTimer struct { + onTimeout func() + timeoutErr error + timer *time.Timer + mu sync.Mutex + status requestTimerStatus +} + +func newRequestTimer(duration time.Duration, onTimeout func(), timeoutErr error) *requestTimer { + rt := &requestTimer{ + onTimeout: onTimeout, + timeoutErr: timeoutErr, + status: requestTimerNew, + } + rt.timer = time.AfterFunc(duration, rt.onTriggered) + return rt +} + +func (rt *requestTimer) onTriggered() { + rt.mu.Lock() + defer rt.mu.Unlock() + if rt.status == requestTimerNew { + rt.status = requestTimerTriggered + rt.onTimeout() + } +} + +// Stop should be called upon a successful request to prevent the timer from +// expiring. +func (rt *requestTimer) Stop() { + rt.mu.Lock() + defer rt.mu.Unlock() + if rt.status == requestTimerNew { + rt.status = requestTimerStopped + rt.timer.Stop() + } +} + +// ResolveError returns `timeoutErr` if the timer triggered, or otherwise +// `originalErr`. +func (rt *requestTimer) ResolveError(originalErr error) error { + rt.mu.Lock() + defer rt.mu.Unlock() + if rt.status == requestTimerTriggered { + return rt.timeoutErr + } + return originalErr +} diff --git a/pubsublite/internal/wire/request_timer_test.go b/pubsublite/internal/wire/request_timer_test.go new file mode 100644 index 00000000000..86c96c2b9dd --- /dev/null +++ b/pubsublite/internal/wire/request_timer_test.go @@ -0,0 +1,61 @@ +// Copyright 2021 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 + +package wire + +import ( + "errors" + "testing" + "time" + + "cloud.google.com/go/pubsublite/internal/test" +) + +func TestRequestTimerStop(t *testing.T) { + const timeout = 5 * time.Millisecond + onTimeout := func() { + t.Error("onTimeout should not be called") + } + + rt := newRequestTimer(timeout, onTimeout, errors.New("unused")) + rt.Stop() + time.Sleep(2 * timeout) + + if err := rt.ResolveError(nil); err != nil { + t.Errorf("ResolveError() got gotErr: %v", err) + } + wantErr := errors.New("original error") + if gotErr := rt.ResolveError(wantErr); !test.ErrorEqual(gotErr, wantErr) { + t.Errorf("ResolveError() got err: %v, want err: %v", gotErr, wantErr) + } +} + +func TestRequestTimerExpires(t *testing.T) { + const timeout = 5 * time.Millisecond + timeoutErr := errors.New("on timeout") + + expired := test.NewCondition("request timer expired") + onTimeout := func() { + expired.SetDone() + } + + rt := newRequestTimer(timeout, onTimeout, timeoutErr) + expired.WaitUntilDone(t, serviceTestWaitTimeout) + + if gotErr := rt.ResolveError(nil); !test.ErrorEqual(gotErr, timeoutErr) { + t.Errorf("ResolveError() got err: %v, want err: %v", gotErr, timeoutErr) + } + if gotErr := rt.ResolveError(errors.New("ignored")); !test.ErrorEqual(gotErr, timeoutErr) { + t.Errorf("ResolveError() got err: %v, want err: %v", gotErr, timeoutErr) + } +} diff --git a/pubsublite/internal/wire/streams.go b/pubsublite/internal/wire/streams.go index a8cc1edacba..76624178c07 100644 --- a/pubsublite/internal/wire/streams.go +++ b/pubsublite/internal/wire/streams.go @@ -22,6 +22,8 @@ import ( "golang.org/x/xerrors" "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" gax "github.com/googleapis/gax-go/v2" ) @@ -40,6 +42,11 @@ const ( streamTerminated ) +// Abort a stream initialization attempt after this duration to mitigate delays. +const defaultInitTimeout = 2 * time.Minute + +var errStreamInitTimeout = status.Error(codes.DeadlineExceeded, "pubsublite: stream initialization timed out") + type initialResponseRequired bool type notifyReset bool @@ -95,10 +102,11 @@ type streamHandler interface { // are private implementation. type retryableStream struct { // Immutable after creation. - ctx context.Context - handler streamHandler - responseType reflect.Type - timeout time.Duration + ctx context.Context + handler streamHandler + responseType reflect.Type + connectTimeout time.Duration + initTimeout time.Duration // Guards access to fields below. mu sync.Mutex @@ -115,11 +123,16 @@ type retryableStream struct { // maximum duration for reconnection. `responseType` is the type of the response // proto received on the stream. func newRetryableStream(ctx context.Context, handler streamHandler, timeout time.Duration, responseType reflect.Type) *retryableStream { + initTimeout := defaultInitTimeout + if timeout < defaultInitTimeout { + initTimeout = timeout + } return &retryableStream{ - ctx: ctx, - handler: handler, - responseType: responseType, - timeout: timeout, + ctx: ctx, + handler: handler, + responseType: responseType, + connectTimeout: timeout, + initTimeout: initTimeout, } } @@ -198,12 +211,14 @@ func (rs *retryableStream) unsafeClearStream() { } } -func (rs *retryableStream) setCancel(cancel context.CancelFunc) { +func (rs *retryableStream) newStreamContext() (ctx context.Context, cancel context.CancelFunc) { rs.mu.Lock() defer rs.mu.Unlock() rs.unsafeClearStream() + ctx, cancel = context.WithCancel(rs.ctx) rs.cancelStream = cancel + return } // connectStream attempts to establish a valid connection with the server. Due @@ -241,7 +256,7 @@ func (rs *retryableStream) connectStream(notifyReset notifyReset) { return } - newStream, cancelFunc, err := rs.initNewStream() + newStream, err := rs.initNewStream() if err != nil { rs.terminate(err) return @@ -257,7 +272,6 @@ func (rs *retryableStream) connectStream(notifyReset notifyReset) { } rs.status = streamConnected rs.stream = newStream - rs.cancelStream = cancelFunc return true } if !connected() { @@ -268,27 +282,32 @@ func (rs *retryableStream) connectStream(notifyReset notifyReset) { rs.listen(newStream) } -func (rs *retryableStream) initNewStream() (newStream grpc.ClientStream, cancelFunc context.CancelFunc, err error) { - r := newStreamRetryer(rs.timeout) +func (rs *retryableStream) newInitTimer(cancelFunc func()) *requestTimer { + return newRequestTimer(rs.initTimeout, cancelFunc, errStreamInitTimeout) +} + +func (rs *retryableStream) initNewStream() (newStream grpc.ClientStream, err error) { + var cancelFunc context.CancelFunc + r := newStreamRetryer(rs.connectTimeout) for { backoff, shouldRetry := func() (time.Duration, bool) { var cctx context.Context - cctx, cancelFunc = context.WithCancel(rs.ctx) - // Store the cancel func to quickly cancel reconnecting if the stream is - // terminated. - rs.setCancel(cancelFunc) + cctx, cancelFunc = rs.newStreamContext() + // Bound the duration of the stream initialization attempt. + it := rs.newInitTimer(cancelFunc) + defer it.Stop() newStream, err = rs.handler.newStream(cctx) - if err != nil { + if err = it.ResolveError(err); err != nil { return r.RetryRecv(err) } initReq, needsResponse := rs.handler.initialRequest() - if err = newStream.SendMsg(initReq); err != nil { + if err = it.ResolveError(newStream.SendMsg(initReq)); err != nil { return r.RetrySend(err) } if needsResponse { response := reflect.New(rs.responseType).Interface() - if err = newStream.RecvMsg(response); err != nil { + if err = it.ResolveError(newStream.RecvMsg(response)); err != nil { if isStreamResetSignal(err) { rs.handler.onStreamStatusChange(streamResetState) } @@ -301,6 +320,12 @@ func (rs *retryableStream) initNewStream() (newStream grpc.ClientStream, cancelF } } + // If the init timer fired due to a race, the stream would be unusable. + it.Stop() + if err = it.ResolveError(nil); err != nil { + return r.RetryRecv(err) + } + // We have a valid connection and should break from the outer loop. return 0, false }() diff --git a/pubsublite/internal/wire/streams_test.go b/pubsublite/internal/wire/streams_test.go index fb8e84e414e..368f39dacaf 100644 --- a/pubsublite/internal/wire/streams_test.go +++ b/pubsublite/internal/wire/streams_test.go @@ -284,6 +284,7 @@ func TestRetryableStreamConnectTimeout(t *testing.T) { // Set a very low timeout to ensure no retries. timeout := time.Millisecond pub := newTestStreamHandler(t, timeout) + pub.Stream.initTimeout = defaultInitTimeout wantErr := status.Error(codes.DeadlineExceeded, "timeout") verifiers := test.NewVerifiers(t) @@ -314,6 +315,46 @@ func TestRetryableStreamConnectTimeout(t *testing.T) { } } +func TestRetryableStreamInitTimeout(t *testing.T) { + const streamInitTimeout = 50 * time.Millisecond + const streamResponseDelay = 75 * time.Millisecond + + pub := newTestStreamHandler(t, defaultStreamTimeout) + pub.Stream.initTimeout = streamInitTimeout + + verifiers := test.NewVerifiers(t) + + // First stream will have a delayed response. + stream1 := test.NewRPCVerifier(t) + barrier := stream1.PushWithBarrier(pub.InitialReq, initPubResp(), nil) + verifiers.AddPublishStream(pub.Topic.Path, pub.Topic.Partition, stream1) + + // Second stream should succeed. + stream2 := test.NewRPCVerifier(t) + stream2.Push(pub.InitialReq, initPubResp(), nil) + verifiers.AddPublishStream(pub.Topic.Path, pub.Topic.Partition, stream2) + + mockServer.OnTestStart(verifiers) + defer mockServer.OnTestEnd() + + pub.Stream.Start() + if got, want := pub.NextStatus(), streamReconnecting; got != want { + t.Errorf("Stream status change: got %d, want %d", got, want) + } + + barrier.ReleaseAfter(func() { + time.Sleep(streamResponseDelay) + }) + if got, want := pub.NextStatus(), streamConnected; got != want { + t.Errorf("Stream status change: got %d, want %d", got, want) + } + + pub.Stream.Stop() + if got, want := pub.NextStatus(), streamTerminated; got != want { + t.Errorf("Stream status change: got %d, want %d", got, want) + } +} + func TestRetryableStreamSendReceive(t *testing.T) { pub := newTestStreamHandler(t, defaultStreamTimeout) req := msgPubReq(&pb.PubSubMessage{Data: []byte("msg")}) From 7076fef5fef81cce47dbfbab3d7257cc7d3776bc Mon Sep 17 00:00:00 2001 From: Alex Hong <9397363+hongalex@users.noreply.github.com> Date: Mon, 28 Jun 2021 18:18:24 -0700 Subject: [PATCH 16/50] fix(pubsub): retry GOAWAY errors (#4313) The frontend server for Pub/Sub might occasionally emit GOAWAY errors which are currently not retried. This is not unique to the Go client, though the categorization as `UNKNOWN` vs `UNVAILABLE` is a golang-GRPC issue. Although UNKNOWN [should not generally be retried](https://google.aip.dev/194), this will unblock users of `Receive` until the grpc library can be changed. See internal cl/377393940 for a similar fix in another Go library. Fixes #4257. --- pubsub/service.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pubsub/service.go b/pubsub/service.go index d9a00021eb0..0c24be25a69 100644 --- a/pubsub/service.go +++ b/pubsub/service.go @@ -62,6 +62,14 @@ func (r *defaultRetryer) Retry(err error) (pause time.Duration, shouldRetry bool return r.bo.Pause(), true } return 0, false + case codes.Unknown: + // Retry GOAWAY, see https://github.com/googleapis/google-cloud-go/issues/4257. + isGoaway := strings.Contains(s.Message(), "error reading from server: EOF") && + strings.Contains(s.Message(), "received prior goaway") + if isGoaway { + return r.bo.Pause(), true + } + return 0, false default: return 0, false } From 5451b30fe450266461e89ac4a9dfd95f11aa5d36 Mon Sep 17 00:00:00 2001 From: yoshi-code-bot <70984784+yoshi-code-bot@users.noreply.github.com> Date: Mon, 28 Jun 2021 23:16:41 -0700 Subject: [PATCH 17/50] chore: release pubsublite 0.10.2 (#4324) --- pubsublite/CHANGES.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pubsublite/CHANGES.md b/pubsublite/CHANGES.md index 1e8ca888e3a..e66499929ca 100644 --- a/pubsublite/CHANGES.md +++ b/pubsublite/CHANGES.md @@ -1,5 +1,13 @@ # Changes +### [0.10.2](https://www.github.com/googleapis/google-cloud-go/compare/pubsublite/v0.10.1...pubsublite/v0.10.2) (2021-06-29) + + +### Bug Fixes + +* **pubsublite:** ensure timeout settings are respected ([#4329](https://www.github.com/googleapis/google-cloud-go/issues/4329)) ([e75262c](https://www.github.com/googleapis/google-cloud-go/commit/e75262cf5eba845271965eab3c28c0a23bec14c4)) +* **pubsublite:** wire user context to api clients ([#4318](https://www.github.com/googleapis/google-cloud-go/issues/4318)) ([ae34396](https://www.github.com/googleapis/google-cloud-go/commit/ae34396b1a2a970a0d871cd5496527294f3310d4)) + ### [0.10.1](https://www.github.com/googleapis/google-cloud-go/compare/pubsublite/v0.10.0...pubsublite/v0.10.1) (2021-06-22) From f08c73a75e2d2a8b9a0b184179346cb97c82e9e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Knut=20Olav=20L=C3=B8ite?= Date: Tue, 29 Jun 2021 13:54:31 +0200 Subject: [PATCH 18/50] Revert "revert(spanner): support request and transaction tags (#3233) (#3989)" (#4336) This reverts commit a18f1bc60135beddaaceb3723de5aa350f7f9e54. --- spanner/client.go | 14 +++- spanner/client_test.go | 154 +++++++++++++++++++++++++++++++++++++++++ spanner/pdml.go | 2 +- spanner/pdml_test.go | 12 ++++ spanner/transaction.go | 81 +++++++++++++--------- 5 files changed, 227 insertions(+), 36 deletions(-) diff --git a/spanner/client.go b/spanner/client.go index 9659bb566fc..254468a0a90 100644 --- a/spanner/client.go +++ b/spanner/client.go @@ -497,6 +497,8 @@ type applyOption struct { // If atLeastOnce == true, Client.Apply will execute the mutations on Cloud // Spanner at least once. atLeastOnce bool + // transactionTag will be included with the CommitRequest. + transactionTag string // priority is the RPC priority that is used for the commit operation. priority sppb.RequestOptions_Priority } @@ -521,6 +523,14 @@ func ApplyAtLeastOnce() ApplyOption { } } +// TransactionTag returns an ApplyOption that will include the given tag as a +// transaction tag for a write-only transaction. +func TransactionTag(tag string) ApplyOption { + return func(ao *applyOption) { + ao.transactionTag = tag + } +} + // Priority returns an ApplyOptions that sets the RPC priority to use for the // commit operation. func Priority(priority sppb.RequestOptions_Priority) ApplyOption { @@ -542,10 +552,10 @@ func (c *Client) Apply(ctx context.Context, ms []*Mutation, opts ...ApplyOption) if !ao.atLeastOnce { resp, err := c.ReadWriteTransactionWithOptions(ctx, func(ctx context.Context, t *ReadWriteTransaction) error { return t.BufferWrite(ms) - }, TransactionOptions{CommitPriority: ao.priority}) + }, TransactionOptions{CommitPriority: ao.priority, TransactionTag: ao.transactionTag}) return resp.CommitTs, err } - t := &writeOnlyTransaction{sp: c.idleSessions, commitPriority: ao.priority} + t := &writeOnlyTransaction{sp: c.idleSessions, commitPriority: ao.priority, transactionTag: ao.transactionTag} return t.applyAtLeastOnce(ctx, ms...) } diff --git a/spanner/client_test.go b/spanner/client_test.go index 2b09d1b5ee2..099f1825c39 100644 --- a/spanner/client_test.go +++ b/spanner/client_test.go @@ -2530,6 +2530,141 @@ func TestClient_Apply_Priority(t *testing.T) { checkCommitForExpectedRequestOptions(t, server.TestSpanner, sppb.RequestOptions{Priority: sppb.RequestOptions_PRIORITY_MEDIUM}) } +func TestClient_ReadOnlyTransaction_Tag(t *testing.T) { + t.Parallel() + + server, client, teardown := setupMockedTestServer(t) + defer teardown() + for _, qo := range []QueryOptions{ + {}, + {RequestTag: "tag-1"}, + } { + for _, tx := range []*ReadOnlyTransaction{ + client.Single(), + client.ReadOnlyTransaction(), + } { + iter := tx.QueryWithOptions(context.Background(), NewStatement(SelectSingerIDAlbumIDAlbumTitleFromAlbums), qo) + iter.Next() + iter.Stop() + + if tx.singleUse { + tx = client.Single() + } + iter = tx.ReadWithOptions(context.Background(), "FOO", AllKeys(), []string{"BAR"}, &ReadOptions{RequestTag: qo.RequestTag}) + iter.Next() + iter.Stop() + + checkRequestsForExpectedRequestOptions(t, server.TestSpanner, 2, sppb.RequestOptions{RequestTag: qo.RequestTag}) + tx.Close() + } + } +} + +func TestClient_ReadWriteTransaction_Tag(t *testing.T) { + t.Parallel() + + server, client, teardown := setupMockedTestServer(t) + defer teardown() + for _, to := range []TransactionOptions{ + {}, + {TransactionTag: "tx-tag-1"}, + } { + for _, qo := range []QueryOptions{ + {}, + {RequestTag: "request-tag-1"}, + } { + client.ReadWriteTransactionWithOptions(context.Background(), func(ctx context.Context, tx *ReadWriteTransaction) error { + iter := tx.QueryWithOptions(context.Background(), NewStatement(SelectSingerIDAlbumIDAlbumTitleFromAlbums), qo) + iter.Next() + iter.Stop() + + iter = tx.ReadWithOptions(context.Background(), "FOO", AllKeys(), []string{"BAR"}, &ReadOptions{RequestTag: qo.RequestTag}) + iter.Next() + iter.Stop() + + tx.UpdateWithOptions(context.Background(), NewStatement(UpdateBarSetFoo), qo) + tx.BatchUpdateWithOptions(context.Background(), []Statement{ + NewStatement(UpdateBarSetFoo), + }, qo) + + // Check for SQL requests inside the transaction to prevent the check to + // drain the commit request from the server. + checkRequestsForExpectedRequestOptions(t, server.TestSpanner, 4, sppb.RequestOptions{RequestTag: qo.RequestTag, TransactionTag: to.TransactionTag}) + return nil + }, to) + checkCommitForExpectedRequestOptions(t, server.TestSpanner, sppb.RequestOptions{TransactionTag: to.TransactionTag}) + } + } +} + +func TestClient_StmtBasedReadWriteTransaction_Tag(t *testing.T) { + t.Parallel() + + server, client, teardown := setupMockedTestServer(t) + defer teardown() + for _, to := range []TransactionOptions{ + {}, + {TransactionTag: "tx-tag-1"}, + } { + for _, qo := range []QueryOptions{ + {}, + {RequestTag: "request-tag-1"}, + } { + tx, _ := NewReadWriteStmtBasedTransactionWithOptions(context.Background(), client, to) + iter := tx.QueryWithOptions(context.Background(), NewStatement(SelectSingerIDAlbumIDAlbumTitleFromAlbums), qo) + iter.Next() + iter.Stop() + + iter = tx.ReadWithOptions(context.Background(), "FOO", AllKeys(), []string{"BAR"}, &ReadOptions{RequestTag: qo.RequestTag}) + iter.Next() + iter.Stop() + + tx.UpdateWithOptions(context.Background(), NewStatement(UpdateBarSetFoo), qo) + tx.BatchUpdateWithOptions(context.Background(), []Statement{ + NewStatement(UpdateBarSetFoo), + }, qo) + checkRequestsForExpectedRequestOptions(t, server.TestSpanner, 4, sppb.RequestOptions{RequestTag: qo.RequestTag, TransactionTag: to.TransactionTag}) + + tx.Commit(context.Background()) + checkCommitForExpectedRequestOptions(t, server.TestSpanner, sppb.RequestOptions{TransactionTag: to.TransactionTag}) + } + } +} + +func TestClient_PDML_Tag(t *testing.T) { + t.Parallel() + + server, client, teardown := setupMockedTestServer(t) + defer teardown() + + for _, qo := range []QueryOptions{ + {}, + {RequestTag: "request-tag-1"}, + } { + client.PartitionedUpdateWithOptions(context.Background(), NewStatement(UpdateBarSetFoo), qo) + checkRequestsForExpectedRequestOptions(t, server.TestSpanner, 1, sppb.RequestOptions{RequestTag: qo.RequestTag}) + } +} + +func TestClient_Apply_Tagging(t *testing.T) { + t.Parallel() + + server, client, teardown := setupMockedTestServer(t) + defer teardown() + + client.Apply(context.Background(), []*Mutation{Insert("foo", []string{"col1"}, []interface{}{"val1"})}) + checkCommitForExpectedRequestOptions(t, server.TestSpanner, sppb.RequestOptions{}) + + client.Apply(context.Background(), []*Mutation{Insert("foo", []string{"col1"}, []interface{}{"val1"})}, TransactionTag("tx-tag")) + checkCommitForExpectedRequestOptions(t, server.TestSpanner, sppb.RequestOptions{TransactionTag: "tx-tag"}) + + client.Apply(context.Background(), []*Mutation{Insert("foo", []string{"col1"}, []interface{}{"val1"})}, ApplyAtLeastOnce()) + checkCommitForExpectedRequestOptions(t, server.TestSpanner, sppb.RequestOptions{}) + + client.Apply(context.Background(), []*Mutation{Insert("foo", []string{"col1"}, []interface{}{"val1"})}, ApplyAtLeastOnce(), TransactionTag("tx-tag")) + checkCommitForExpectedRequestOptions(t, server.TestSpanner, sppb.RequestOptions{TransactionTag: "tx-tag"}) +} + func checkRequestsForExpectedRequestOptions(t *testing.T, server InMemSpannerServer, reqCount int, ro sppb.RequestOptions) { reqs := drainRequestsFromServer(server) reqOptions := []*sppb.RequestOptions{} @@ -2559,6 +2694,12 @@ func checkRequestsForExpectedRequestOptions(t *testing.T, server InMemSpannerSer if got != want { t.Fatalf("Request priority mismatch\nGot: %v\nWant: %v", got, want) } + if got, want := opts.RequestTag, ro.RequestTag; got != want { + t.Fatalf("Request tag mismatch\nGot: %v\nWant: %v", got, want) + } + if got, want := opts.TransactionTag, ro.TransactionTag; got != want { + t.Fatalf("Transaction tag mismatch\nGot: %v\nWant: %v", got, want) + } } } @@ -2585,6 +2726,19 @@ func checkCommitForExpectedRequestOptions(t *testing.T, server InMemSpannerServe if got != want { t.Fatalf("Commit priority mismatch\nGot: %v\nWant: %v", got, want) } + + var requestTag string + var transactionTag string + if commit.RequestOptions != nil { + requestTag = commit.RequestOptions.RequestTag + transactionTag = commit.RequestOptions.TransactionTag + } + if got, want := requestTag, ro.RequestTag; got != want { + t.Fatalf("Commit request tag mismatch\nGot: %v\nWant: %v", got, want) + } + if got, want := transactionTag, ro.TransactionTag; got != want { + t.Fatalf("Commit transaction tag mismatch\nGot: %v\nWant: %v", got, want) + } } func TestClient_Single_Read_WithNumericKey(t *testing.T) { diff --git a/spanner/pdml.go b/spanner/pdml.go index 5a663ee1ecf..d24a8767ab9 100644 --- a/spanner/pdml.go +++ b/spanner/pdml.go @@ -69,7 +69,7 @@ func (c *Client) partitionedUpdate(ctx context.Context, statement Statement, opt Params: params, ParamTypes: paramTypes, QueryOptions: options.Options, - RequestOptions: createRequestOptions(&options), + RequestOptions: createRequestOptions(options.Priority, options.RequestTag, ""), } // Make a retryer for Aborted and certain Internal errors. diff --git a/spanner/pdml_test.go b/spanner/pdml_test.go index ca4ac323044..45fcf8b7eb0 100644 --- a/spanner/pdml_test.go +++ b/spanner/pdml_test.go @@ -166,3 +166,15 @@ func TestPartitionedUpdate_QueryOptions(t *testing.T) { }) } } + +func TestPartitionedUpdate_Tagging(t *testing.T) { + ctx := context.Background() + server, client, teardown := setupMockedTestServer(t) + defer teardown() + + _, err := client.PartitionedUpdateWithOptions(ctx, NewStatement(UpdateBarSetFoo), QueryOptions{RequestTag: "pdml-tag"}) + if err != nil { + t.Fatalf("expect no errors, but got %v", err) + } + checkRequestsForExpectedRequestOptions(t, server.TestSpanner, 1, sppb.RequestOptions{RequestTag: "pdml-tag"}) +} diff --git a/spanner/transaction.go b/spanner/transaction.go index 019d35f5a2c..b9da4f401fe 100644 --- a/spanner/transaction.go +++ b/spanner/transaction.go @@ -77,15 +77,15 @@ type txReadOnly struct { txOpts TransactionOptions } -// Internal interface for types that can configure the priority of an RPC. -type requestPrioritizer interface { - requestPriority() sppb.RequestOptions_Priority -} - // TransactionOptions provides options for a transaction. type TransactionOptions struct { CommitOptions CommitOptions + // The transaction tag to use for a read/write transaction. + // This tag is automatically included with each statement and the commit + // request of a read/write transaction. + TransactionTag string + // CommitPriority is the priority to use for the Commit RPC for the // transaction. CommitPriority sppb.RequestOptions_Priority @@ -95,6 +95,10 @@ func (to *TransactionOptions) requestPriority() sppb.RequestOptions_Priority { return to.CommitPriority } +func (to *TransactionOptions) requestTag() string { + return "" +} + // errSessionClosed returns error for using a recycled/destroyed session func errSessionClosed(sh *sessionHandle) error { return spannerErrorf(codes.FailedPrecondition, @@ -122,12 +126,11 @@ type ReadOptions struct { // limit. Limit int - // Priority is the RPC priority to use for the read operation. + // Priority is the RPC priority to use for the operation. Priority sppb.RequestOptions_Priority -} -func (ro *ReadOptions) requestPriority() sppb.RequestOptions_Priority { - return ro.Priority + // The request tag to use for this request. + RequestTag string } // ReadWithOptions returns a RowIterator for reading multiple rows from the @@ -155,13 +158,15 @@ func (t *txReadOnly) ReadWithOptions(ctx context.Context, table string, keys Key } index := "" limit := 0 - var ro *sppb.RequestOptions + prio := sppb.RequestOptions_PRIORITY_UNSPECIFIED + requestTag := "" if opts != nil { index = opts.Index if opts.Limit > 0 { limit = opts.Limit } - ro = createRequestOptions(opts) + prio = opts.Priority + requestTag = opts.RequestTag } return streamWithReplaceSessionFunc( contextWithOutgoingMetadata(ctx, sh.getMetadata()), @@ -177,7 +182,7 @@ func (t *txReadOnly) ReadWithOptions(ctx context.Context, table string, keys Key KeySet: kset, ResumeToken: resumeToken, Limit: int64(limit), - RequestOptions: ro, + RequestOptions: createRequestOptions(prio, requestTag, t.txOpts.TransactionTag), }) }, t.replaceSessionFunc, @@ -257,23 +262,26 @@ type QueryOptions struct { // Priority is the RPC priority to use for the query/update. Priority sppb.RequestOptions_Priority -} -func (qo *QueryOptions) requestPriority() sppb.RequestOptions_Priority { - return qo.Priority + // The request tag to use for this request. + RequestTag string } // merge combines two QueryOptions that the input parameter will have higher // order of precedence. func (qo QueryOptions) merge(opts QueryOptions) QueryOptions { merged := QueryOptions{ - Mode: qo.Mode, - Options: &sppb.ExecuteSqlRequest_QueryOptions{}, - Priority: qo.Priority, + Mode: qo.Mode, + Options: &sppb.ExecuteSqlRequest_QueryOptions{}, + RequestTag: qo.RequestTag, + Priority: qo.Priority, } if opts.Mode != nil { merged.Mode = opts.Mode } + if opts.RequestTag != "" { + merged.RequestTag = opts.RequestTag + } if opts.Priority != sppb.RequestOptions_PRIORITY_UNSPECIFIED { merged.Priority = opts.Priority } @@ -282,12 +290,16 @@ func (qo QueryOptions) merge(opts QueryOptions) QueryOptions { return merged } -func createRequestOptions(prioritizer requestPrioritizer) (ro *sppb.RequestOptions) { - if prioritizer == nil { - return nil +func createRequestOptions(prio sppb.RequestOptions_Priority, requestTag, transactionTag string) (ro *sppb.RequestOptions) { + ro = &sppb.RequestOptions{} + if prio != sppb.RequestOptions_PRIORITY_UNSPECIFIED { + ro.Priority = prio } - if prioritizer.requestPriority() != sppb.RequestOptions_PRIORITY_UNSPECIFIED { - ro = &sppb.RequestOptions{Priority: prioritizer.requestPriority()} + if requestTag != "" { + ro.RequestTag = requestTag + } + if transactionTag != "" { + ro.TransactionTag = transactionTag } return ro } @@ -396,7 +408,7 @@ func (t *txReadOnly) prepareExecuteSQL(ctx context.Context, stmt Statement, opti Params: params, ParamTypes: paramTypes, QueryOptions: options.Options, - RequestOptions: createRequestOptions(&options), + RequestOptions: createRequestOptions(options.Priority, options.RequestTag, t.txOpts.TransactionTag), } return req, sh, nil } @@ -902,9 +914,13 @@ func (t *ReadWriteTransaction) BatchUpdate(ctx context.Context, stmts []Statemen // affected rows for the given query at the same index. If an error occurs, // counts will be returned up to the query that encountered the error. // -// The priority given in the QueryOptions will be included with the RPC. -// Any other options that are set in the QueryOptions struct will be ignored. +// The request tag and priority given in the QueryOptions are included with the +// RPC. Any other options that are set in the QueryOptions struct are ignored. func (t *ReadWriteTransaction) BatchUpdateWithOptions(ctx context.Context, stmts []Statement, opts QueryOptions) (_ []int64, err error) { + return t.batchUpdateWithOptions(ctx, stmts, t.qo.merge(opts)) +} + +func (t *ReadWriteTransaction) batchUpdateWithOptions(ctx context.Context, stmts []Statement, opts QueryOptions) (_ []int64, err error) { ctx = trace.StartSpan(ctx, "cloud.google.com/go/spanner.BatchUpdate") defer func() { trace.EndSpan(ctx, err) }() @@ -937,7 +953,7 @@ func (t *ReadWriteTransaction) BatchUpdateWithOptions(ctx context.Context, stmts Transaction: ts, Statements: sppbStmts, Seqno: atomic.AddInt64(&t.sequenceNumber, 1), - RequestOptions: createRequestOptions(&opts), + RequestOptions: createRequestOptions(opts.Priority, opts.RequestTag, t.txOpts.TransactionTag), }) if err != nil { return nil, ToSpannerError(err) @@ -1059,7 +1075,7 @@ func (t *ReadWriteTransaction) commit(ctx context.Context, options CommitOptions Transaction: &sppb.CommitRequest_TransactionId{ TransactionId: t.tx, }, - RequestOptions: createRequestOptions(&t.txOpts), + RequestOptions: createRequestOptions(t.txOpts.CommitPriority, "", t.txOpts.TransactionTag), Mutations: mPb, ReturnCommitStats: options.ReturnCommitStats, }) @@ -1240,14 +1256,13 @@ type writeOnlyTransaction struct { // sp is the session pool which writeOnlyTransaction uses to get Cloud // Spanner sessions for blind writes. sp *sessionPool + // transactionTag is the tag that will be included with the CommitRequest + // of the write-only transaction. + transactionTag string // commitPriority is the RPC priority to use for the commit operation. commitPriority sppb.RequestOptions_Priority } -func (t *writeOnlyTransaction) requestPriority() sppb.RequestOptions_Priority { - return t.commitPriority -} - // applyAtLeastOnce commits a list of mutations to Cloud Spanner at least once, // unless one of the following happens: // @@ -1288,7 +1303,7 @@ func (t *writeOnlyTransaction) applyAtLeastOnce(ctx context.Context, ms ...*Muta }, }, Mutations: mPb, - RequestOptions: createRequestOptions(t), + RequestOptions: createRequestOptions(t.commitPriority, "", t.transactionTag), }) if err != nil && !isAbortedErr(err) { if isSessionNotFoundError(err) { From 4c7e38105cbc5bad0814f0b03a324e2fe4829c24 Mon Sep 17 00:00:00 2001 From: Nicole Zhu <69952136+nicoleczhu@users.noreply.github.com> Date: Tue, 29 Jun 2021 20:50:26 +0700 Subject: [PATCH 19/50] chore: update blunderbuss.yml (#4319) --- .github/blunderbuss.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/blunderbuss.yml b/.github/blunderbuss.yml index ee6a8c7b7e2..a339964791c 100644 --- a/.github/blunderbuss.yml +++ b/.github/blunderbuss.yml @@ -25,4 +25,4 @@ assign_issues_by: - 'api: logging' - 'api: clouderrorreporting' to: - - nicoleczhu + - googleapis/api-logging From 1672234f50c879a974e9646ef50893381b22ecb4 Mon Sep 17 00:00:00 2001 From: Nicole Zhu <69952136+nicoleczhu@users.noreply.github.com> Date: Tue, 29 Jun 2021 21:02:44 +0700 Subject: [PATCH 20/50] chore: remove nicole (#4333) From 8c78e6c509bd5efbb45d33f9fb9deaf57d7b723e Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Tue, 29 Jun 2021 08:36:56 -0700 Subject: [PATCH 21/50] chore(all): auto-regenerate gapics (#4314) This is an auto-generated regeneration of the gapic clients by cloud.google.com/go/internal/gapicgen. Once the corresponding genproto PR is submitted, genbot will update this PR with a newer dependency to the newer version of genproto and assign reviewers to this PR. If you have been assigned to review this PR, please: - Ensure that the version of genproto in go.mod has been updated. - Ensure that CI is passing. If it's failing, it requires your manual attention. - Approve and submit this PR if you believe it's ready to ship. Corresponding genproto PR: https://github.com/googleapis/go-genproto/pull/624 Changes: fix!(aiplatform): Add C#, PHP and Ruby options for all AI Platform protos This is a breaking change for C#, PHP and Ruby, but none of those languages have published libraries for AI Platform. PiperOrigin-RevId: 381271921 Source-Link: https://github.com/googleapis/googleapis/commit/955fee2ad50e496885a6239d68e6bbc1e4f378c3 --- cloudbuild/apiv1/doc.go | 2 +- containeranalysis/apiv1/doc.go | 2 +- firestore/apiv1beta1/doc.go | 2 +- go.mod | 2 +- go.sum | 4 +- grafeas/apiv1/doc.go | 2 +- iam/admin/apiv1/doc.go | 2 +- .../AdminClient/SeekSubscription/main.go | 52 +++++++++++++++++++ monitoring/apiv3/doc.go | 2 +- recommendationengine/apiv1beta1/doc.go | 2 +- 10 files changed, 62 insertions(+), 10 deletions(-) create mode 100644 internal/generated/snippets/pubsublite/apiv1/AdminClient/SeekSubscription/main.go diff --git a/cloudbuild/apiv1/doc.go b/cloudbuild/apiv1/doc.go index c7f6781ec6c..c108da5d84c 100644 --- a/cloudbuild/apiv1/doc.go +++ b/cloudbuild/apiv1/doc.go @@ -96,4 +96,4 @@ func versionGo() string { return "UNKNOWN" } -const versionClient = "20210612" +const versionClient = "20210624" diff --git a/containeranalysis/apiv1/doc.go b/containeranalysis/apiv1/doc.go index fdda05dcc3c..f1900dc7333 100644 --- a/containeranalysis/apiv1/doc.go +++ b/containeranalysis/apiv1/doc.go @@ -98,4 +98,4 @@ func versionGo() string { return "UNKNOWN" } -const versionClient = "20210612" +const versionClient = "20210624" diff --git a/firestore/apiv1beta1/doc.go b/firestore/apiv1beta1/doc.go index d5d7a2c2c9c..75dcfa86000 100644 --- a/firestore/apiv1beta1/doc.go +++ b/firestore/apiv1beta1/doc.go @@ -46,7 +46,7 @@ import ( "google.golang.org/grpc/metadata" ) -const versionClient = "20210612" +const versionClient = "20210624" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/go.mod b/go.mod index eff2b9b740f..5a80c4ef0cd 100644 --- a/go.mod +++ b/go.mod @@ -17,7 +17,7 @@ require ( golang.org/x/text v0.3.6 golang.org/x/tools v0.1.3 google.golang.org/api v0.49.0 - google.golang.org/genproto v0.0.0-20210624174822-c5cf32407d0a + google.golang.org/genproto v0.0.0-20210624195500-8bfb893ecb84 google.golang.org/grpc v1.38.0 google.golang.org/protobuf v1.26.0 ) diff --git a/go.sum b/go.sum index 063eb2fb248..4ade1298e7c 100644 --- a/go.sum +++ b/go.sum @@ -457,8 +457,8 @@ google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxH google.golang.org/genproto v0.0.0-20210604141403-392c879c8b08/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= google.golang.org/genproto v0.0.0-20210608205507-b6d2f5bf0d7d/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= google.golang.org/genproto v0.0.0-20210617175327-b9e0b3197ced/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24= -google.golang.org/genproto v0.0.0-20210624174822-c5cf32407d0a h1:b5Bhxmy6Tppar7Yl4J6c6xF33YSBhkm2FtV9/ZQuBkQ= -google.golang.org/genproto v0.0.0-20210624174822-c5cf32407d0a/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24= +google.golang.org/genproto v0.0.0-20210624195500-8bfb893ecb84 h1:R1r5J0u6Cx+RNl/6mezTw6oA14cmKC96FeUwL6A9bd4= +google.golang.org/genproto v0.0.0-20210624195500-8bfb893ecb84/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= diff --git a/grafeas/apiv1/doc.go b/grafeas/apiv1/doc.go index e6cd315b80f..b495225f0d3 100644 --- a/grafeas/apiv1/doc.go +++ b/grafeas/apiv1/doc.go @@ -92,4 +92,4 @@ func versionGo() string { return "UNKNOWN" } -const versionClient = "20210612" +const versionClient = "20210624" diff --git a/iam/admin/apiv1/doc.go b/iam/admin/apiv1/doc.go index 49e8451cbe5..39d55c6b280 100644 --- a/iam/admin/apiv1/doc.go +++ b/iam/admin/apiv1/doc.go @@ -100,4 +100,4 @@ func versionGo() string { return "UNKNOWN" } -const versionClient = "20210612" +const versionClient = "20210624" diff --git a/internal/generated/snippets/pubsublite/apiv1/AdminClient/SeekSubscription/main.go b/internal/generated/snippets/pubsublite/apiv1/AdminClient/SeekSubscription/main.go new file mode 100644 index 00000000000..617794932d1 --- /dev/null +++ b/internal/generated/snippets/pubsublite/apiv1/AdminClient/SeekSubscription/main.go @@ -0,0 +1,52 @@ +// Copyright 2021 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 +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by cloud.google.com/go/internal/gapicgen/gensnippets. DO NOT EDIT. + +// [START pubsublite_v1_generated_AdminService_SeekSubscription_sync] + +package main + +import ( + "context" + + pubsublite "cloud.google.com/go/pubsublite/apiv1" + pubsublitepb "google.golang.org/genproto/googleapis/cloud/pubsublite/v1" +) + +func main() { + ctx := context.Background() + c, err := pubsublite.NewAdminClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &pubsublitepb.SeekSubscriptionRequest{ + // TODO: Fill request struct fields. + } + op, err := c.SeekSubscription(ctx, req) + if err != nil { + // TODO: Handle error. + } + + resp, err := op.Wait(ctx) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +// [END pubsublite_v1_generated_AdminService_SeekSubscription_sync] diff --git a/monitoring/apiv3/doc.go b/monitoring/apiv3/doc.go index 0cc49957692..1a6d259f5df 100644 --- a/monitoring/apiv3/doc.go +++ b/monitoring/apiv3/doc.go @@ -53,7 +53,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210612" +const versionClient = "20210624" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/recommendationengine/apiv1beta1/doc.go b/recommendationengine/apiv1beta1/doc.go index ddf6c16d07d..e2d95502e79 100644 --- a/recommendationengine/apiv1beta1/doc.go +++ b/recommendationengine/apiv1beta1/doc.go @@ -52,7 +52,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210612" +const versionClient = "20210624" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) From b9081c36ed6495a67f8e458ad884bdb8da5b7fbc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Knut=20Olav=20L=C3=B8ite?= Date: Tue, 29 Jun 2021 18:20:37 +0200 Subject: [PATCH 22/50] feat(spanner): enable request options for batch read (#4337) Reverts googleapis/google-cloud-go#3987 (Reverts the revert of #3905) --- spanner/batch.go | 44 +++++++++++---- spanner/client_test.go | 56 +++++++++++++++++-- .../internal/testutil/inmem_spanner_server.go | 19 ++++--- 3 files changed, 94 insertions(+), 25 deletions(-) diff --git a/spanner/batch.go b/spanner/batch.go index 0e38768ae1c..82346bfcebd 100644 --- a/spanner/batch.go +++ b/spanner/batch.go @@ -94,9 +94,25 @@ func (t *BatchReadOnlyTransaction) PartitionRead(ctx context.Context, table stri return t.PartitionReadUsingIndex(ctx, table, "", keys, columns, opt) } +// PartitionReadWithOptions returns a list of Partitions that can be used to +// read rows from the database. These partitions can be executed across multiple +// processes, even across different machines. The partition size and count hints +// can be configured using PartitionOptions. Pass a ReadOptions to modify the +// read operation. +func (t *BatchReadOnlyTransaction) PartitionReadWithOptions(ctx context.Context, table string, keys KeySet, columns []string, opt PartitionOptions, readOptions ReadOptions) ([]*Partition, error) { + return t.PartitionReadUsingIndexWithOptions(ctx, table, "", keys, columns, opt, readOptions) +} + // PartitionReadUsingIndex returns a list of Partitions that can be used to read // rows from the database using an index. func (t *BatchReadOnlyTransaction) PartitionReadUsingIndex(ctx context.Context, table, index string, keys KeySet, columns []string, opt PartitionOptions) ([]*Partition, error) { + return t.PartitionReadUsingIndexWithOptions(ctx, table, index, keys, columns, opt, ReadOptions{}) +} + +// PartitionReadUsingIndexWithOptions returns a list of Partitions that can be +// used to read rows from the database using an index. Pass a ReadOptions to +// modify the read operation. +func (t *BatchReadOnlyTransaction) PartitionReadUsingIndexWithOptions(ctx context.Context, table, index string, keys KeySet, columns []string, opt PartitionOptions, readOptions ReadOptions) ([]*Partition, error) { sh, ts, err := t.acquire(ctx) if err != nil { return nil, err @@ -123,12 +139,13 @@ func (t *BatchReadOnlyTransaction) PartitionReadUsingIndex(ctx context.Context, }) // Prepare ReadRequest. req := &sppb.ReadRequest{ - Session: sid, - Transaction: ts, - Table: table, - Index: index, - Columns: columns, - KeySet: kset, + Session: sid, + Transaction: ts, + Table: table, + Index: index, + Columns: columns, + KeySet: kset, + RequestOptions: createRequestOptions(readOptions.Priority, readOptions.RequestTag, ""), } // Generate partitions. for _, p := range resp.GetPartitions() { @@ -177,12 +194,13 @@ func (t *BatchReadOnlyTransaction) partitionQuery(ctx context.Context, statement // prepare ExecuteSqlRequest r := &sppb.ExecuteSqlRequest{ - Session: sid, - Transaction: ts, - Sql: statement.SQL, - Params: params, - ParamTypes: paramTypes, - QueryOptions: qOpts.Options, + Session: sid, + Transaction: ts, + Sql: statement.SQL, + Params: params, + ParamTypes: paramTypes, + QueryOptions: qOpts.Options, + RequestOptions: createRequestOptions(qOpts.Priority, qOpts.RequestTag, ""), } // generate Partitions @@ -270,6 +288,7 @@ func (t *BatchReadOnlyTransaction) Execute(ctx context.Context, p *Partition) *R Columns: p.rreq.Columns, KeySet: p.rreq.KeySet, PartitionToken: p.pt, + RequestOptions: p.rreq.RequestOptions, ResumeToken: resumeToken, }) } @@ -283,6 +302,7 @@ func (t *BatchReadOnlyTransaction) Execute(ctx context.Context, p *Partition) *R ParamTypes: p.qreq.ParamTypes, QueryOptions: p.qreq.QueryOptions, PartitionToken: p.pt, + RequestOptions: p.qreq.RequestOptions, ResumeToken: resumeToken, }) } diff --git a/spanner/client_test.go b/spanner/client_test.go index 099f1825c39..faae43dbe84 100644 --- a/spanner/client_test.go +++ b/spanner/client_test.go @@ -2665,6 +2665,54 @@ func TestClient_Apply_Tagging(t *testing.T) { checkCommitForExpectedRequestOptions(t, server.TestSpanner, sppb.RequestOptions{TransactionTag: "tx-tag"}) } +func TestClient_PartitionQuery_RequestOptions(t *testing.T) { + t.Parallel() + + server, client, teardown := setupMockedTestServer(t) + defer teardown() + + for _, qo := range []QueryOptions{ + {}, + {Priority: sppb.RequestOptions_PRIORITY_LOW}, + {RequestTag: "batch-query-tag"}, + {Priority: sppb.RequestOptions_PRIORITY_MEDIUM, RequestTag: "batch-query-with-medium-prio"}, + } { + ctx := context.Background() + txn, _ := client.BatchReadOnlyTransaction(ctx, StrongRead()) + partitions, _ := txn.PartitionQueryWithOptions(ctx, NewStatement(SelectFooFromBar), PartitionOptions{MaxPartitions: 10}, qo) + for _, p := range partitions { + iter := txn.Execute(ctx, p) + iter.Next() + iter.Stop() + } + checkRequestsForExpectedRequestOptions(t, server.TestSpanner, len(partitions), sppb.RequestOptions{RequestTag: qo.RequestTag, Priority: qo.Priority}) + } +} + +func TestClient_PartitionRead_RequestOptions(t *testing.T) { + t.Parallel() + + server, client, teardown := setupMockedTestServer(t) + defer teardown() + + for _, ro := range []ReadOptions{ + {}, + {Priority: sppb.RequestOptions_PRIORITY_LOW}, + {RequestTag: "batch-read-tag"}, + {Priority: sppb.RequestOptions_PRIORITY_MEDIUM, RequestTag: "batch-read-with-medium-prio"}, + } { + ctx := context.Background() + txn, _ := client.BatchReadOnlyTransaction(ctx, StrongRead()) + partitions, _ := txn.PartitionReadWithOptions(ctx, "Albums", KeySets(Key{"foo"}), []string{"SingerId", "AlbumId", "AlbumTitle"}, PartitionOptions{MaxPartitions: 10}, ro) + for _, p := range partitions { + iter := txn.Execute(ctx, p) + iter.Next() + iter.Stop() + } + checkRequestsForExpectedRequestOptions(t, server.TestSpanner, len(partitions), sppb.RequestOptions{RequestTag: ro.RequestTag, Priority: ro.Priority}) + } +} + func checkRequestsForExpectedRequestOptions(t *testing.T, server InMemSpannerServer, reqCount int, ro sppb.RequestOptions) { reqs := drainRequestsFromServer(server) reqOptions := []*sppb.RequestOptions{} @@ -2686,12 +2734,10 @@ func checkRequestsForExpectedRequestOptions(t *testing.T, server InMemSpannerSer } for _, opts := range reqOptions { - var got sppb.RequestOptions_Priority - if opts != nil { - got = opts.Priority + if opts == nil { + opts = &sppb.RequestOptions{} } - want := ro.Priority - if got != want { + if got, want := opts.Priority, ro.Priority; got != want { t.Fatalf("Request priority mismatch\nGot: %v\nWant: %v", got, want) } if got, want := opts.RequestTag, ro.RequestTag; got != want { diff --git a/spanner/internal/testutil/inmem_spanner_server.go b/spanner/internal/testutil/inmem_spanner_server.go index c2b1b8894e4..ac6f9bdfd04 100644 --- a/spanner/internal/testutil/inmem_spanner_server.go +++ b/spanner/internal/testutil/inmem_spanner_server.go @@ -1057,14 +1057,17 @@ func (s *inMemSpannerServer) PartitionQuery(ctx context.Context, req *spannerpb. } func (s *inMemSpannerServer) PartitionRead(ctx context.Context, req *spannerpb.PartitionReadRequest) (*spannerpb.PartitionResponse, error) { - s.mu.Lock() - if s.stopped { - s.mu.Unlock() - return nil, gstatus.Error(codes.Unavailable, "server has been stopped") - } - s.receivedRequests <- req - s.mu.Unlock() - return nil, gstatus.Error(codes.Unimplemented, "Method not yet implemented") + return s.PartitionQuery(ctx, &spannerpb.PartitionQueryRequest{ + Session: req.Session, + Transaction: req.Transaction, + PartitionOptions: req.PartitionOptions, + // KeySet is currently ignored. + Sql: fmt.Sprintf( + "SELECT %s FROM %s", + strings.Join(req.Columns, ", "), + req.Table, + ), + }) } // EncodeResumeToken return mock resume token encoding for an uint64 integer. From f32dd72ec6af8ac7fbdce68f7913baa552fb0d2d Mon Sep 17 00:00:00 2001 From: Nicole Zhu <69952136+nicoleczhu@users.noreply.github.com> Date: Wed, 30 Jun 2021 00:02:23 +0700 Subject: [PATCH 23/50] feat(logging)!: increase DefaultEntryByteThreshold to 8Mb (#4247) Fixes: #3823 DefaultEntryByteThreshold = `1 << 20 // 1MiB` ===> `1 << 23 // 8MiB` since size of an entries.write request can be up to 10 MB. `DefaultBufferedByteLimit` is unchanged as that's more a cap on memory utilization. --- logging/logging.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/logging/logging.go b/logging/logging.go index d478ac0f060..6f990f26a14 100644 --- a/logging/logging.go +++ b/logging/logging.go @@ -75,7 +75,7 @@ const ( DefaultEntryCountThreshold = 1000 // DefaultEntryByteThreshold is the default value for the EntryByteThreshold LoggerOption. - DefaultEntryByteThreshold = 1 << 20 // 1MiB + DefaultEntryByteThreshold = 1 << 23 // 8MiB // DefaultBufferedByteLimit is the default value for the BufferedByteLimit LoggerOption. DefaultBufferedByteLimit = 1 << 30 // 1GiB From ef8d1386149cff28ae6258ab167789bae6af6407 Mon Sep 17 00:00:00 2001 From: shollyman Date: Tue, 29 Jun 2021 10:15:29 -0700 Subject: [PATCH 24/50] fix(bigquery): minor rename to feature that's not yet in a release (#4320) This adds a minor correction to Job's access to the underlying project. While the access on the Client is more accurately called `Project()` as it accepts project ID or project number, in this case the field is part of the underlying JobReference type. This was added yesterday in https://github.com/googleapis/google-cloud-go/pull/4312 and hasn't made it into a release cut yet, so addressing this now before release. --- bigquery/job.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bigquery/job.go b/bigquery/job.go index 725775dfd68..6bdcbcc3c32 100644 --- a/bigquery/job.go +++ b/bigquery/job.go @@ -63,8 +63,8 @@ func (c *Client) JobFromIDLocation(ctx context.Context, id, location string) (j return bqToJob(bqjob, c) } -// Project returns the job's project. -func (j *Job) Project() string { +// ProjectID returns the job's associated project. +func (j *Job) ProjectID() string { return j.projectID } From 3604ef2b16c3e1a4bacb137ae54c1e3ebf283211 Mon Sep 17 00:00:00 2001 From: yoshi-code-bot <70984784+yoshi-code-bot@users.noreply.github.com> Date: Tue, 29 Jun 2021 10:37:19 -0700 Subject: [PATCH 25/50] chore: release bigquery 1.19.0 (#4101) --- bigquery/CHANGES.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/bigquery/CHANGES.md b/bigquery/CHANGES.md index aa538162b3a..5bde60e6ae2 100644 --- a/bigquery/CHANGES.md +++ b/bigquery/CHANGES.md @@ -1,5 +1,25 @@ # Changes +## [1.19.0](https://www.github.com/googleapis/google-cloud-go/compare/bigquery/v1.18.0...bigquery/v1.19.0) (2021-06-29) + + +### Features + +* **bigquery/storage:** Add ZSTD compression as an option for Arrow. ([770db30](https://www.github.com/googleapis/google-cloud-go/commit/770db3083270d485d265362fe5a4b2a1b23619ff)) +* **bigquery/storage:** remove alpha client ([#4100](https://www.github.com/googleapis/google-cloud-go/issues/4100)) ([a2d137d](https://www.github.com/googleapis/google-cloud-go/commit/a2d137d233e7a401976fbe1fd8ff81145dda515d)), refs [#4098](https://www.github.com/googleapis/google-cloud-go/issues/4098) +* **bigquery:** add support for parameterized types ([#4103](https://www.github.com/googleapis/google-cloud-go/issues/4103)) ([a2330e4](https://www.github.com/googleapis/google-cloud-go/commit/a2330e4d66c0a1832fb3b9e23a33c006c9345c28)) +* **bigquery:** add support for snapshot/restore ([#4112](https://www.github.com/googleapis/google-cloud-go/issues/4112)) ([4c12b42](https://www.github.com/googleapis/google-cloud-go/commit/4c12b424eec06c7d87244eaa922995bbe6e46e7e)) +* **bigquery:** add support for user defined TVF ([#4043](https://www.github.com/googleapis/google-cloud-go/issues/4043)) ([37607b4](https://www.github.com/googleapis/google-cloud-go/commit/37607b4afbc4c42baa4a931a9a86cddcc6d885ca)) +* **bigquery:** enable project autodetection, expose project ids further ([#4312](https://www.github.com/googleapis/google-cloud-go/issues/4312)) ([267787e](https://www.github.com/googleapis/google-cloud-go/commit/267787eb245d9307cf78304c1ce34bdfb2aaf5ab)) +* **bigquery:** support job deletion ([#3935](https://www.github.com/googleapis/google-cloud-go/issues/3935)) ([363ba03](https://www.github.com/googleapis/google-cloud-go/commit/363ba03e1c3c813749a65ff3c050877ce4f60016)) +* **bigquery:** support nullable params and geography params ([#4225](https://www.github.com/googleapis/google-cloud-go/issues/4225)) ([43755d3](https://www.github.com/googleapis/google-cloud-go/commit/43755d38b5d928222127cc6be26183d6bfbb1cb4)) + + +### Bug Fixes + +* **bigquery:** minor rename to feature that's not yet in a release ([#4320](https://www.github.com/googleapis/google-cloud-go/issues/4320)) ([ef8d138](https://www.github.com/googleapis/google-cloud-go/commit/ef8d1386149cff28ae6258ab167789bae6af6407)) +* **bigquery:** update streaming insert error test ([#4321](https://www.github.com/googleapis/google-cloud-go/issues/4321)) ([12f3042](https://www.github.com/googleapis/google-cloud-go/commit/12f3042716d51fb0d7a23071d00a20f9751bac91)) + ## [1.18.0](https://www.github.com/googleapis/google-cloud-go/compare/bigquery/v1.17.0...bigquery/v1.18.0) (2021-05-06) From 949a9532021873185768b2ba02f826155b1ed845 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 29 Jun 2021 21:43:51 +0200 Subject: [PATCH 26/50] chore(all): update all (#4326) Co-authored-by: Cody Oss <6331106+codyoss@users.noreply.github.com> --- bigquery/go.mod | 2 +- bigquery/go.sum | 3 +- bigtable/go.mod | 4 +- bigtable/go.sum | 6 +- datastore/go.mod | 2 +- datastore/go.sum | 3 +- firestore/go.mod | 2 +- firestore/go.sum | 3 +- go.mod | 6 +- go.sum | 9 +- internal/gapicgen/go.mod | 6 +- internal/gapicgen/go.sum | 13 +-- internal/godocfx/go.mod | 4 +- internal/godocfx/go.sum | 207 ++++++++++++++++++++++++++++++++++++--- logging/go.mod | 4 +- logging/go.sum | 6 +- pubsub/go.mod | 4 +- pubsub/go.sum | 6 +- pubsublite/go.mod | 2 +- pubsublite/go.sum | 3 +- spanner/go.mod | 2 +- spanner/go.sum | 3 +- storage/go.mod | 2 +- storage/go.sum | 3 +- 24 files changed, 249 insertions(+), 56 deletions(-) diff --git a/bigquery/go.mod b/bigquery/go.mod index 5c3ddb8b9db..60c8ce04778 100644 --- a/bigquery/go.mod +++ b/bigquery/go.mod @@ -12,5 +12,5 @@ require ( google.golang.org/api v0.49.0 google.golang.org/genproto v0.0.0-20210624174822-c5cf32407d0a google.golang.org/grpc v1.38.0 - google.golang.org/protobuf v1.26.0 + google.golang.org/protobuf v1.27.1 ) diff --git a/bigquery/go.sum b/bigquery/go.sum index 432875bfea3..4e3360fdd58 100644 --- a/bigquery/go.sum +++ b/bigquery/go.sum @@ -489,8 +489,9 @@ google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpAD google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= -google.golang.org/protobuf v1.26.0 h1:bxAC2xTBsZGibn2RTntX0oH50xLsqy1OxA9tTL3p/lk= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.27.1 h1:SnqbnDw1V7RiZcXPx5MEeqPv2s79L9i7BJUlG/+RurQ= +google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= diff --git a/bigtable/go.mod b/bigtable/go.mod index 464fb0185e6..c69f977e326 100644 --- a/bigtable/go.mod +++ b/bigtable/go.mod @@ -8,11 +8,11 @@ require ( github.com/google/btree v1.0.1 github.com/google/go-cmp v0.5.6 github.com/googleapis/gax-go/v2 v2.0.5 - golang.org/x/oauth2 v0.0.0-20210615190721-d04028783cf1 + golang.org/x/oauth2 v0.0.0-20210628180205-a41e5a781914 golang.org/x/sys v0.0.0-20210616094352-59db8d763f22 google.golang.org/api v0.49.0 google.golang.org/genproto v0.0.0-20210624174822-c5cf32407d0a google.golang.org/grpc v1.38.0 - google.golang.org/protobuf v1.26.0 + google.golang.org/protobuf v1.27.1 rsc.io/binaryregexp v0.2.0 ) diff --git a/bigtable/go.sum b/bigtable/go.sum index e51b7d83f54..f2cab4de1aa 100644 --- a/bigtable/go.sum +++ b/bigtable/go.sum @@ -251,8 +251,9 @@ golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ golang.org/x/oauth2 v0.0.0-20210220000619-9bb904979d93/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210313182246-cd4f82c27b84/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210615190721-d04028783cf1 h1:x622Z2o4hgCr/4CiKWc51jHVKaWdtVpBNmEI8wI9Qns= golang.org/x/oauth2 v0.0.0-20210615190721-d04028783cf1/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210628180205-a41e5a781914 h1:3B43BWw0xEBsLZ/NO1VALz6fppU3481pik+2Ksv45z8= +golang.org/x/oauth2 v0.0.0-20210628180205-a41e5a781914/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -487,8 +488,9 @@ google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpAD google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= -google.golang.org/protobuf v1.26.0 h1:bxAC2xTBsZGibn2RTntX0oH50xLsqy1OxA9tTL3p/lk= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.27.1 h1:SnqbnDw1V7RiZcXPx5MEeqPv2s79L9i7BJUlG/+RurQ= +google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= diff --git a/datastore/go.mod b/datastore/go.mod index 4bfd1801c5c..8db8e8d5640 100644 --- a/datastore/go.mod +++ b/datastore/go.mod @@ -10,5 +10,5 @@ require ( google.golang.org/api v0.49.0 google.golang.org/genproto v0.0.0-20210624174822-c5cf32407d0a google.golang.org/grpc v1.38.0 - google.golang.org/protobuf v1.26.0 + google.golang.org/protobuf v1.27.1 ) diff --git a/datastore/go.sum b/datastore/go.sum index edb7eff7904..1567ab6a27e 100644 --- a/datastore/go.sum +++ b/datastore/go.sum @@ -485,8 +485,9 @@ google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpAD google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= -google.golang.org/protobuf v1.26.0 h1:bxAC2xTBsZGibn2RTntX0oH50xLsqy1OxA9tTL3p/lk= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.27.1 h1:SnqbnDw1V7RiZcXPx5MEeqPv2s79L9i7BJUlG/+RurQ= +google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= diff --git a/firestore/go.mod b/firestore/go.mod index 5768e102ccc..f5f80c3f6ad 100644 --- a/firestore/go.mod +++ b/firestore/go.mod @@ -10,5 +10,5 @@ require ( google.golang.org/api v0.49.0 google.golang.org/genproto v0.0.0-20210624174822-c5cf32407d0a google.golang.org/grpc v1.38.0 - google.golang.org/protobuf v1.26.0 + google.golang.org/protobuf v1.27.1 ) diff --git a/firestore/go.sum b/firestore/go.sum index edb7eff7904..1567ab6a27e 100644 --- a/firestore/go.sum +++ b/firestore/go.sum @@ -485,8 +485,9 @@ google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpAD google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= -google.golang.org/protobuf v1.26.0 h1:bxAC2xTBsZGibn2RTntX0oH50xLsqy1OxA9tTL3p/lk= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.27.1 h1:SnqbnDw1V7RiZcXPx5MEeqPv2s79L9i7BJUlG/+RurQ= +google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= diff --git a/go.mod b/go.mod index 5a80c4ef0cd..787e3a5f41c 100644 --- a/go.mod +++ b/go.mod @@ -13,11 +13,11 @@ require ( github.com/jstemmer/go-junit-report v0.9.1 go.opencensus.io v0.23.0 golang.org/x/lint v0.0.0-20210508222113-6edffad5e616 - golang.org/x/oauth2 v0.0.0-20210615190721-d04028783cf1 + golang.org/x/oauth2 v0.0.0-20210628180205-a41e5a781914 golang.org/x/text v0.3.6 - golang.org/x/tools v0.1.3 + golang.org/x/tools v0.1.4 google.golang.org/api v0.49.0 google.golang.org/genproto v0.0.0-20210624195500-8bfb893ecb84 google.golang.org/grpc v1.38.0 - google.golang.org/protobuf v1.26.0 + google.golang.org/protobuf v1.27.1 ) diff --git a/go.sum b/go.sum index 4ade1298e7c..9a8de8842b9 100644 --- a/go.sum +++ b/go.sum @@ -256,8 +256,9 @@ golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ golang.org/x/oauth2 v0.0.0-20210220000619-9bb904979d93/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210313182246-cd4f82c27b84/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210615190721-d04028783cf1 h1:x622Z2o4hgCr/4CiKWc51jHVKaWdtVpBNmEI8wI9Qns= golang.org/x/oauth2 v0.0.0-20210615190721-d04028783cf1/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210628180205-a41e5a781914 h1:3B43BWw0xEBsLZ/NO1VALz6fppU3481pik+2Ksv45z8= +golang.org/x/oauth2 v0.0.0-20210628180205-a41e5a781914/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -373,8 +374,9 @@ golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4f golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/tools v0.1.3 h1:L69ShwSZEyCsLKoAxDKeMvLDZkumEe8gXUZAjab0tX8= golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/tools v0.1.4 h1:cVngSRcfgyZCzys3KYOpCFa+4dqX/Oub9tAq00ttGVs= +golang.org/x/tools v0.1.4/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= 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= @@ -493,8 +495,9 @@ google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpAD google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= -google.golang.org/protobuf v1.26.0 h1:bxAC2xTBsZGibn2RTntX0oH50xLsqy1OxA9tTL3p/lk= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.27.1 h1:SnqbnDw1V7RiZcXPx5MEeqPv2s79L9i7BJUlG/+RurQ= +google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= diff --git a/internal/gapicgen/go.mod b/internal/gapicgen/go.mod index f243d9f1913..3a104af6f00 100644 --- a/internal/gapicgen/go.mod +++ b/internal/gapicgen/go.mod @@ -4,15 +4,15 @@ go 1.16 require ( cloud.google.com/go v0.84.0 - cloud.google.com/go/internal/godocfx v0.0.0-20210621170140-22ffc18e522c + cloud.google.com/go/internal/godocfx v0.0.0-20210629140244-1672234f50c8 github.com/google/go-github/v35 v35.3.0 github.com/shurcooL/githubv4 v0.0.0-20201206200315-234843c633fa github.com/shurcooL/graphql v0.0.0-20200928012149-18c5c3165e3a // indirect - golang.org/x/oauth2 v0.0.0-20210615190721-d04028783cf1 + golang.org/x/oauth2 v0.0.0-20210628180205-a41e5a781914 golang.org/x/sync v0.0.0-20210220032951-036812b2e83c golang.org/x/sys v0.0.0-20210616094352-59db8d763f22 google.golang.org/genproto v0.0.0-20210624174822-c5cf32407d0a - google.golang.org/protobuf v1.26.0 + google.golang.org/protobuf v1.27.1 gopkg.in/src-d/go-git.v4 v4.13.1 gopkg.in/yaml.v2 v2.4.0 ) diff --git a/internal/gapicgen/go.sum b/internal/gapicgen/go.sum index cdcc1fbaf71..b038dccb032 100644 --- a/internal/gapicgen/go.sum +++ b/internal/gapicgen/go.sum @@ -30,8 +30,8 @@ cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4g cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ= cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= -cloud.google.com/go/internal/godocfx v0.0.0-20210621170140-22ffc18e522c h1:c3v7d0rhtI8Sz5ysyMhZRAbqR5v3njasTlRtb5JVqfU= -cloud.google.com/go/internal/godocfx v0.0.0-20210621170140-22ffc18e522c/go.mod h1:NFLrMLw/yENI4t6bupRMhFJ/WMAeT81B2nJmqkPdPaQ= +cloud.google.com/go/internal/godocfx v0.0.0-20210629140244-1672234f50c8 h1:Sz/TijbG39Ku7vRa2uBB9QguitOqr6krqWSPQEx3eYU= +cloud.google.com/go/internal/godocfx v0.0.0-20210629140244-1672234f50c8/go.mod h1:rla1u/NA8QrJKFqEh9/xJRhI5X3BSYLpaePjjuEG3qo= cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= @@ -197,7 +197,7 @@ github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9de github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= -github.com/yuin/goldmark v1.3.7/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= +github.com/yuin/goldmark v1.3.8/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= @@ -298,8 +298,8 @@ golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ golang.org/x/oauth2 v0.0.0-20210220000619-9bb904979d93/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210313182246-cd4f82c27b84/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210615190721-d04028783cf1 h1:x622Z2o4hgCr/4CiKWc51jHVKaWdtVpBNmEI8wI9Qns= -golang.org/x/oauth2 v0.0.0-20210615190721-d04028783cf1/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210628180205-a41e5a781914 h1:3B43BWw0xEBsLZ/NO1VALz6fppU3481pik+2Ksv45z8= +golang.org/x/oauth2 v0.0.0-20210628180205-a41e5a781914/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -537,8 +537,9 @@ google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpAD google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= -google.golang.org/protobuf v1.26.0 h1:bxAC2xTBsZGibn2RTntX0oH50xLsqy1OxA9tTL3p/lk= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.27.1 h1:SnqbnDw1V7RiZcXPx5MEeqPv2s79L9i7BJUlG/+RurQ= +google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/internal/godocfx/go.mod b/internal/godocfx/go.mod index 4a36b56fe3c..63f394b4daf 100644 --- a/internal/godocfx/go.mod +++ b/internal/godocfx/go.mod @@ -8,8 +8,8 @@ require ( cloud.google.com/go/datastore v1.1.0 cloud.google.com/go/storage v1.11.0 github.com/google/go-cmp v0.5.6 - github.com/yuin/goldmark v1.3.8 - golang.org/x/tools v0.1.3 + github.com/yuin/goldmark v1.3.9 + golang.org/x/tools v0.1.4 gopkg.in/yaml.v2 v2.4.0 ) diff --git a/internal/godocfx/go.sum b/internal/godocfx/go.sum index 8ed3c541bed..ea66b6af2ca 100644 --- a/internal/godocfx/go.sum +++ b/internal/godocfx/go.sum @@ -1,11 +1,38 @@ +cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= +cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= +cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= +cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= +cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= +cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To= +cloud.google.com/go v0.52.0/go.mod h1:pXajvRH/6o3+F9jDHZWQ5PbGhn+o8w9qiu/CffaVdO4= +cloud.google.com/go v0.53.0/go.mod h1:fp/UouUEsRkN6ryDKNW/Upv/JBKnv6WDthjR6+vze6M= +cloud.google.com/go v0.54.0/go.mod h1:1rq2OEkV3YMf6n/9ZvGWI3GWw0VoqH/1x2nd8Is/bPc= +cloud.google.com/go v0.56.0/go.mod h1:jr7tqZxxKOVYizybht9+26Z/gUq7tiRzu+ACVAMbKVk= +cloud.google.com/go v0.57.0/go.mod h1:oXiQ6Rzq3RAkkY7N6t3TcE6jE+CIBBbA36lwQ1JyzZs= +cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOYc= +cloud.google.com/go v0.64.0/go.mod h1:xfORb36jGvE+6EexW71nMEtL025s3x6xvuYUKM4JLv4= +cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY= +cloud.google.com/go v0.72.0/go.mod h1:M+5Vjvlc2wnp6tjzE102Dw08nGShTscUx2nZMufOKPI= +cloud.google.com/go v0.74.0/go.mod h1:VV1xSbzvo+9QJOxLDaJfTjx5e+MePCpCWwvftOeQmWk= +cloud.google.com/go v0.78.0/go.mod h1:QjdrLG0uq+YwhjoVOLsS1t7TW8fs36kLs4XO5R5ECHg= +cloud.google.com/go v0.79.0/go.mod h1:3bzgcEeQlzbuEAYu4mrWhKqWjmpprinYgKJLgKHnbb8= +cloud.google.com/go v0.81.0/go.mod h1:mk/AM35KwGk/Nm2YSeZbxXdrNK3KZOYHmLkOqC2V6E0= +cloud.google.com/go v0.83.0/go.mod h1:Z7MJUsANfY0pYPdw0lbnivPx4/vhy/e2FEkSkF7vAVY= +cloud.google.com/go v0.84.0 h1:hVhK90DwCdOAYGME/FJd9vNIZye9HBR6Yy3fu4js3N8= +cloud.google.com/go v0.84.0/go.mod h1:RazrYuxIK6Kb7YrzzhPoLmCVzl7Sup4NrbKPg8KHSUM= +cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg= cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc= cloud.google.com/go/bigquery v1.8.0 h1:PQcPefKFdaIzjQFbiyOgAqyx8q5djaE7x9Sqe712DPA= cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ= +cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= cloud.google.com/go/datastore v1.1.0 h1:/May9ojXjRkPBNVrq+oWLqmWCkr4OU5uRY29bu0mRyQ= cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= +cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= cloud.google.com/go/pubsub v1.3.1/go.mod h1:i+ucay31+CNRpDW4Lu78I4xXG+O1r/MAHgjpRVR+TSU= @@ -25,11 +52,14 @@ github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5P github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= 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/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= +github.com/envoyproxy/go-control-plane v0.9.7/go.mod h1:cwu0lG7PUMfa9snN8LXBig5ynNVH9qI8YYLbd1fK2po= +github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= github.com/envoyproxy/go-control-plane v0.9.9-0.20210217033140-668b12f5399d/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= @@ -41,12 +71,19 @@ github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4er github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e h1:1r7pUrabqp18hOBcwBwiTsbnFeTZHV9eER/QT5JVZxY= github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= -github.com/golang/mock v1.6.0/go.mod h1:p6yTPP+5HYm5mzsMV8JkE6ZKdX+/wYM6Hr+LicevLPs= +github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= +github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= +github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= +github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= +github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= +github.com/golang/mock v1.5.0/go.mod h1:CWnOUgYIOo4TcNZ0wHX3YZCqsaM1I1Jvs6v3mP3KVu8= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= +github.com/golang/protobuf v1.3.5/go.mod h1:6O5/vntMXwX2lRkT1hjjk0nAC1IDOTvTlVgjlRvqsdk= github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= @@ -56,10 +93,13 @@ github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QD github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= +github.com/golang/protobuf v1.5.1/go.mod h1:DopwsBzvsk0Fs44TXzsVbJyPhcCPeIwnvohx4u74HPM= github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/golang/snappy v0.0.3 h1:fHPg5GQYlCeLIPB9BZqMVR5nR9A+IM5zcgeTdjMYmLA= github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= +github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= +github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= @@ -67,20 +107,40 @@ github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.6 h1:BKbKCqvP6I+rmFHt06ZmyQtvB8xAkWdhFyr0ZUNZcxQ= github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/martian v2.1.0+incompatible h1:/CP5g8u/VJHijgedC/Legn3BAbAaWPgecwXBIDzw5no= +github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= +github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= +github.com/google/martian/v3 v3.1.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= github.com/google/martian/v3 v3.2.1 h1:d8MncMlErDFTwQGBK1xhv026j9kqhvw1Qv9IbWT1VLQ= github.com/google/martian/v3 v3.2.1/go.mod h1:oBOf6HBosgwRXnUGWUB05QECsc6uvmMiJ3+6W4l/CUk= -github.com/google/pprof v0.0.0-20210609004039-a478d1d731e9/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= +github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= +github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20201023163331-3e6fc7fc9c4c/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20210122040257-d980be63207e/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20210226084205-cbba55b83ad5/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20210601050228-01bbb1931b22/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5 h1:sjZBwGj9Jlw33ImPtvFviGYvseOtDM7hkSKB7+Tv3SM= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= +github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= github.com/jstemmer/go-junit-report v0.9.1 h1:6QPYqodiu3GuPL+7mfx+NwDdp2eTkp9IfEUpgAwUN0o= github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= @@ -99,23 +159,29 @@ github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= -github.com/yuin/goldmark v1.3.8 h1:Nw158Q8QN+CPgTmVRByhVwapp8Mm1e2blinhmx4wx5E= -github.com/yuin/goldmark v1.3.8/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= +github.com/yuin/goldmark v1.3.9 h1:XsVHmzm4P6g84IBbAj+WYMF/IEZ3J9+3I1wlqCNa/SQ= +github.com/yuin/goldmark v1.3.9/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= go.opencensus.io v0.23.0 h1:gqCw0LfLxScz8irSi8exQc7fyQ0fKQU/qnC/X8+V/1M= go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= +golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY= +golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= @@ -124,13 +190,18 @@ golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMx golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= +golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs= golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/lint v0.0.0-20210508222113-6edffad5e616 h1:VLliZ0d+/avPrXXH+OakdXhpJuEoBZuwh1m2j7U6Iug= golang.org/x/lint v0.0.0-20210508222113-6edffad5e616/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= @@ -138,6 +209,8 @@ golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzB golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2 h1:Gz96sIWK3OalVv/I/qNygP42zyoKp3xptRVCWRFEBvo= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -151,26 +224,45 @@ golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200222125558-5a598a2470a0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200501053045-e0ff5e5a1de5/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20200813134508-3edf25e44fcc/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20201031054903-ff519b6c9102/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLdyRGr576XBO4/greRjx4P4O3yc= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= golang.org/x/net v0.0.0-20210503060351-7fd8e65b6420 h1:a8jGStKg0XqKDlKqjLrXn0ioF5MH36pT7Z0BRTqLhbk= golang.org/x/net v0.0.0-20210503060351-7fd8e65b6420/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= +golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20210615190721-d04028783cf1 h1:x622Z2o4hgCr/4CiKWc51jHVKaWdtVpBNmEI8wI9Qns= -golang.org/x/oauth2 v0.0.0-20210615190721-d04028783cf1/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20201109201403-9fd604954f58/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210220000619-9bb904979d93/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210313182246-cd4f82c27b84/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c h1:pkQiBZBvdos9qq4wBAHqlzuZHEXo07pqV06ef90u1WI= +golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -179,6 +271,8 @@ golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -186,13 +280,18 @@ golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200331124033-c3d80250170d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200501052902-10377860bb8e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -200,34 +299,58 @@ golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200905004654-be1d3432aa8f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210104204734-6f8348627aad/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210220050731-9a76102bfb43/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210305230114-8fe3ee5dd75b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210315160823-c6e025ad8005/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210616094352-59db8d763f22 h1:RqytpXGR1iVNX7psjB3ff8y7sNFinVFvkx1c8SjBkio= -golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210514084401-e8d321eab015/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210603125802-9665404d3644 h1:CA1DEQ4NdKphKeL70tvsWNdT5oFh1lOjihRcEDROi0I= +golang.org/x/sys v0.0.0-20210603125802-9665404d3644/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= +golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6 h1:aRYxNxv6iGQlyVaZmk6ZgYEDa+Jg18DxebPSrd6bg1M= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200204074204-1cc6d1ef6c74/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= @@ -235,22 +358,36 @@ golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapK golang.org/x/tools v0.0.0-20200212150539-ea181f53ac56/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200224181240-023911ca70b2/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200227222343-706bc42d1f0d/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= golang.org/x/tools v0.0.0-20200312045724-11d5b4c81c7d/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= golang.org/x/tools v0.0.0-20200331025713-a30bf2db82d4/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200817023811-d00afeaade8f/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200827163409-021d7c6f1ec3/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200904185747-39188db58858/go.mod h1:Cj7w3i3Rnn0Xh82ur9kSqwfTHTeVxaDqrfMjpcNT6bE= +golang.org/x/tools v0.0.0-20201110124207-079ba7bd75cd/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20201201161351-ac6f37ff4c2a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20201208233053-a543418bbed2/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/tools v0.1.3 h1:L69ShwSZEyCsLKoAxDKeMvLDZkumEe8gXUZAjab0tX8= -golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/tools v0.1.4 h1:cVngSRcfgyZCzys3KYOpCFa+4dqX/Oub9tAq00ttGVs= +golang.org/x/tools v0.1.4/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= 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 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= +google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= +google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= google.golang.org/api v0.14.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= @@ -262,30 +399,43 @@ google.golang.org/api v0.20.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/ google.golang.org/api v0.22.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= google.golang.org/api v0.24.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= google.golang.org/api v0.28.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= +google.golang.org/api v0.29.0/go.mod h1:Lcubydp8VUV7KeIHD9z2Bys/sm/vGKnG1UHuDBSrHWM= google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz5138Fc= -google.golang.org/api v0.49.0 h1:gjIBDxlTG7vnzMmEnYwTnvLTF8Rjzo+ETCgEX1YZ/fY= -google.golang.org/api v0.49.0/go.mod h1:BECiH72wsfwUvOVn3+btPD5WHi0LzavZReBndi42L18= +google.golang.org/api v0.35.0/go.mod h1:/XrVsuzM0rZmrsbjJutiuftIzeuTQcEeaYcSk/mQ1dg= +google.golang.org/api v0.36.0/go.mod h1:+z5ficQTmoYpPn8LCUNVpK5I7hwkpjbcgqA7I34qYtE= +google.golang.org/api v0.40.0/go.mod h1:fYKFpnQN0DsDSKRVRcQSDQNtqWPfM9i+zNPxepjRCQ8= +google.golang.org/api v0.41.0/go.mod h1:RkxM5lITDfTzmyKFPt+wGrCJbVfniCr2ool8kTBzRTU= +google.golang.org/api v0.43.0/go.mod h1:nQsDGjRXMo4lvh5hP0TKqF244gqhGcr/YSIykhUk/94= +google.golang.org/api v0.47.0/go.mod h1:Wbvgpq1HddcWVtzsVLyfLp8lDg6AA241LmgIL59tHXo= +google.golang.org/api v0.48.0 h1:RDAPWfNFY06dffEXfn7hZF5Fr1ZbnChzfQZAPyBd1+I= +google.golang.org/api v0.48.0/go.mod h1:71Pr1vy+TAZRPkPs/xlCf5SsU8WjuAWv1Pfjbtukyy4= 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.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c= google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= google.golang.org/genproto v0.0.0-20191115194625-c23dd37a84c9/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200115191322-ca5a22157cba/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= google.golang.org/genproto v0.0.0-20200122232147-0452cf42e150/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= google.golang.org/genproto v0.0.0-20200204135345-fa8e72b47b90/go.mod h1:GmwEX6Z4W5gMy59cAlVYjN9JhxgbQH6Gn+gFDQe2lzA= google.golang.org/genproto v0.0.0-20200212174721-66ed5ce911ce/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200228133532-8c2c7df3a383/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200305110556-506484158171/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200312145019-da6875a35672/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200331122359-1ee6d9798940/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= @@ -293,11 +443,26 @@ google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfG google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U= google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= +google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20200815001618-f69a88009b70/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20200827165113-ac2560b5e952/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210617175327-b9e0b3197ced/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24= -google.golang.org/genproto v0.0.0-20210624174822-c5cf32407d0a h1:b5Bhxmy6Tppar7Yl4J6c6xF33YSBhkm2FtV9/ZQuBkQ= -google.golang.org/genproto v0.0.0-20210624174822-c5cf32407d0a/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24= +google.golang.org/genproto v0.0.0-20200904004341-0bd0a958aa1d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20201109203340-2640f1f9cdfb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20201201144952-b05cb90ed32e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20201210142538-e3217bee35cc/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20201214200347-8c77b98c765d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210222152913-aa3ee6e6a81c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210303154014-9728d6b83eeb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210310155132-4ce2db91004e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210319143718-93e7006c17a6/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210402141018-6c239bbf2bb1/go.mod h1:9lPAdzaEmUacj36I+k7YKbEc5CXzPIeORRgDAUOu28A= +google.golang.org/genproto v0.0.0-20210513213006-bf773b8c8384/go.mod h1:P3QM42oQyzQSnHPnZ/vqoCdDmzH28fzWByN9asMeM8A= +google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= +google.golang.org/genproto v0.0.0-20210604141403-392c879c8b08/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= +google.golang.org/genproto v0.0.0-20210608205507-b6d2f5bf0d7d h1:KzwjikDymrEmYYbdyfievTwjEeGlu+OM6oiKBkF3Jfg= +google.golang.org/genproto v0.0.0-20210608205507-b6d2f5bf0d7d/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= @@ -308,9 +473,16 @@ google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8 google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60= google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= +google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/grpc v1.31.1/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= +google.golang.org/grpc v1.34.0/go.mod h1:WotjhfgOW/POjDeRt8vscBtXq+2VjORFy659qA51WJ8= +google.golang.org/grpc v1.35.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= +google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= +google.golang.org/grpc v1.36.1/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= google.golang.org/grpc v1.37.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= +google.golang.org/grpc v1.37.1/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= google.golang.org/grpc v1.38.0 h1:/9BgsAsa5nWe26HqOlvlgJnqBuktYOLCgjCPqsa56W0= google.golang.org/grpc v1.38.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw= @@ -336,7 +508,12 @@ gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= +rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= +rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= +rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= diff --git a/logging/go.mod b/logging/go.mod index e95d2ad7c46..947dc0fe49e 100644 --- a/logging/go.mod +++ b/logging/go.mod @@ -9,9 +9,9 @@ require ( github.com/google/go-cmp v0.5.6 github.com/googleapis/gax-go/v2 v2.0.5 go.opencensus.io v0.23.0 - golang.org/x/oauth2 v0.0.0-20210615190721-d04028783cf1 + golang.org/x/oauth2 v0.0.0-20210628180205-a41e5a781914 google.golang.org/api v0.49.0 google.golang.org/genproto v0.0.0-20210624174822-c5cf32407d0a google.golang.org/grpc v1.38.0 - google.golang.org/protobuf v1.26.0 + google.golang.org/protobuf v1.27.1 ) diff --git a/logging/go.sum b/logging/go.sum index 12b9d118fa1..7af34dad03a 100644 --- a/logging/go.sum +++ b/logging/go.sum @@ -253,8 +253,9 @@ golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ golang.org/x/oauth2 v0.0.0-20210220000619-9bb904979d93/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210313182246-cd4f82c27b84/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210615190721-d04028783cf1 h1:x622Z2o4hgCr/4CiKWc51jHVKaWdtVpBNmEI8wI9Qns= golang.org/x/oauth2 v0.0.0-20210615190721-d04028783cf1/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210628180205-a41e5a781914 h1:3B43BWw0xEBsLZ/NO1VALz6fppU3481pik+2Ksv45z8= +golang.org/x/oauth2 v0.0.0-20210628180205-a41e5a781914/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -490,8 +491,9 @@ google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpAD google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= -google.golang.org/protobuf v1.26.0 h1:bxAC2xTBsZGibn2RTntX0oH50xLsqy1OxA9tTL3p/lk= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.27.1 h1:SnqbnDw1V7RiZcXPx5MEeqPv2s79L9i7BJUlG/+RurQ= +google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= diff --git a/pubsub/go.mod b/pubsub/go.mod index fed0966d5a2..8462fdcd223 100644 --- a/pubsub/go.mod +++ b/pubsub/go.mod @@ -8,11 +8,11 @@ require ( github.com/google/go-cmp v0.5.6 github.com/googleapis/gax-go/v2 v2.0.5 go.opencensus.io v0.23.0 - golang.org/x/oauth2 v0.0.0-20210615190721-d04028783cf1 + golang.org/x/oauth2 v0.0.0-20210628180205-a41e5a781914 golang.org/x/sync v0.0.0-20210220032951-036812b2e83c golang.org/x/time v0.0.0-20210611083556-38a9dc6acbc6 google.golang.org/api v0.49.0 google.golang.org/genproto v0.0.0-20210624174822-c5cf32407d0a google.golang.org/grpc v1.38.0 - google.golang.org/protobuf v1.26.0 + google.golang.org/protobuf v1.27.1 ) diff --git a/pubsub/go.sum b/pubsub/go.sum index 2082f40cf0d..af1167b29f2 100644 --- a/pubsub/go.sum +++ b/pubsub/go.sum @@ -249,8 +249,9 @@ golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ golang.org/x/oauth2 v0.0.0-20210220000619-9bb904979d93/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210313182246-cd4f82c27b84/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210615190721-d04028783cf1 h1:x622Z2o4hgCr/4CiKWc51jHVKaWdtVpBNmEI8wI9Qns= golang.org/x/oauth2 v0.0.0-20210615190721-d04028783cf1/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210628180205-a41e5a781914 h1:3B43BWw0xEBsLZ/NO1VALz6fppU3481pik+2Ksv45z8= +golang.org/x/oauth2 v0.0.0-20210628180205-a41e5a781914/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -488,8 +489,9 @@ google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpAD google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= -google.golang.org/protobuf v1.26.0 h1:bxAC2xTBsZGibn2RTntX0oH50xLsqy1OxA9tTL3p/lk= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.27.1 h1:SnqbnDw1V7RiZcXPx5MEeqPv2s79L9i7BJUlG/+RurQ= +google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= diff --git a/pubsublite/go.mod b/pubsublite/go.mod index 6c9994d26de..f655870221b 100644 --- a/pubsublite/go.mod +++ b/pubsublite/go.mod @@ -14,5 +14,5 @@ require ( google.golang.org/api v0.49.0 google.golang.org/genproto v0.0.0-20210624174822-c5cf32407d0a google.golang.org/grpc v1.38.0 - google.golang.org/protobuf v1.26.0 + google.golang.org/protobuf v1.27.1 ) diff --git a/pubsublite/go.sum b/pubsublite/go.sum index 4042ac5faf2..cb361ab194a 100644 --- a/pubsublite/go.sum +++ b/pubsublite/go.sum @@ -496,8 +496,9 @@ google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpAD google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= -google.golang.org/protobuf v1.26.0 h1:bxAC2xTBsZGibn2RTntX0oH50xLsqy1OxA9tTL3p/lk= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.27.1 h1:SnqbnDw1V7RiZcXPx5MEeqPv2s79L9i7BJUlG/+RurQ= +google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= diff --git a/spanner/go.mod b/spanner/go.mod index 893ca20c52c..f03220525b0 100644 --- a/spanner/go.mod +++ b/spanner/go.mod @@ -12,5 +12,5 @@ require ( google.golang.org/api v0.49.0 google.golang.org/genproto v0.0.0-20210624174822-c5cf32407d0a google.golang.org/grpc v1.38.0 - google.golang.org/protobuf v1.26.0 + google.golang.org/protobuf v1.27.1 ) diff --git a/spanner/go.sum b/spanner/go.sum index edb7eff7904..1567ab6a27e 100644 --- a/spanner/go.sum +++ b/spanner/go.sum @@ -485,8 +485,9 @@ google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpAD google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= -google.golang.org/protobuf v1.26.0 h1:bxAC2xTBsZGibn2RTntX0oH50xLsqy1OxA9tTL3p/lk= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.27.1 h1:SnqbnDw1V7RiZcXPx5MEeqPv2s79L9i7BJUlG/+RurQ= +google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= diff --git a/storage/go.mod b/storage/go.mod index 8c26dec3407..528ae7da6fc 100644 --- a/storage/go.mod +++ b/storage/go.mod @@ -7,7 +7,7 @@ require ( github.com/golang/protobuf v1.5.2 github.com/google/go-cmp v0.5.6 github.com/googleapis/gax-go/v2 v2.0.5 - golang.org/x/oauth2 v0.0.0-20210615190721-d04028783cf1 + golang.org/x/oauth2 v0.0.0-20210628180205-a41e5a781914 golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 google.golang.org/api v0.49.0 google.golang.org/genproto v0.0.0-20210624174822-c5cf32407d0a diff --git a/storage/go.sum b/storage/go.sum index 85fa87a6d5d..50ab8d21775 100644 --- a/storage/go.sum +++ b/storage/go.sum @@ -252,8 +252,9 @@ golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ golang.org/x/oauth2 v0.0.0-20210220000619-9bb904979d93/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210313182246-cd4f82c27b84/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210615190721-d04028783cf1 h1:x622Z2o4hgCr/4CiKWc51jHVKaWdtVpBNmEI8wI9Qns= golang.org/x/oauth2 v0.0.0-20210615190721-d04028783cf1/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210628180205-a41e5a781914 h1:3B43BWw0xEBsLZ/NO1VALz6fppU3481pik+2Ksv45z8= +golang.org/x/oauth2 v0.0.0-20210628180205-a41e5a781914/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= From e4a5791501ee721226b62963b4282267911779a9 Mon Sep 17 00:00:00 2001 From: Noah Dietz Date: Tue, 29 Jun 2021 13:28:36 -0700 Subject: [PATCH 27/50] chore(internal): update microgen to v0.21.2 (#4315) Changes include: - add initial `rest` client generation (behind `transport=rest` flag) - add `EnableJwtWithScope` default client options cc @shinfan - dependency updates --- internal/gapicgen/cmd/genbot/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/gapicgen/cmd/genbot/Dockerfile b/internal/gapicgen/cmd/genbot/Dockerfile index b097205cae9..7290674a78d 100644 --- a/internal/gapicgen/cmd/genbot/Dockerfile +++ b/internal/gapicgen/cmd/genbot/Dockerfile @@ -28,7 +28,7 @@ RUN GO111MODULE=on go get \ golang.org/x/lint/golint@latest \ golang.org/x/tools/cmd/goimports@latest \ honnef.co/go/tools/cmd/staticcheck@latest \ - github.com/googleapis/gapic-generator-go/cmd/protoc-gen-go_gapic@v0.20.4 + github.com/googleapis/gapic-generator-go/cmd/protoc-gen-go_gapic@v0.21.2 ENV PATH="${PATH}:/root/go/bin" # Source: http://debuggable.com/posts/disable-strict-host-checking-for-git-clone:49896ff3-0ac0-4263-9703-1eae4834cda3 From a89d341d45cf25d80fad37834599e8869ed2d63a Mon Sep 17 00:00:00 2001 From: Noah Dietz Date: Tue, 29 Jun 2021 13:52:34 -0700 Subject: [PATCH 28/50] chore(internal/gapicgen): gen googleapis-discovery compute gapic (#4307) Adds generation of a `compute` gapic that uses googleapis-discovery. Note: we need to capture some fixes in gapic-generator-go with a release there and update here before this will work. cc: @software-dov @vchudnov-g --- internal/gapicgen/generator/config.go | 18 ++++++++++ internal/gapicgen/generator/gapics.go | 51 +++++++++++++++++---------- 2 files changed, 50 insertions(+), 19 deletions(-) diff --git a/internal/gapicgen/generator/config.go b/internal/gapicgen/generator/config.go index 7c25b1acddd..8234ba35578 100644 --- a/internal/gapicgen/generator/config.go +++ b/internal/gapicgen/generator/config.go @@ -46,10 +46,28 @@ type microgenConfig struct { // disableMetadata is used to toggle generation of the gapic_metadata.json // file for the client library. disableMetadata bool + + // transports is a list of transports to generate a client for. Acceptable + // values are 'grpc' and 'rest' + transports []string + + // googleapisDiscovery indicates if the protos reside in googleapis-discovery + // or not. Default is false, and will be looked up in googleapis. + googleapisDiscovery bool } var microgenGapicConfigs = []*microgenConfig{ // Cloud APIs + { + inputDirectoryPath: "google/cloud/compute/v1", + pkg: "compute", + importPath: "cloud.google.com/go/compute/apiv1", + apiServiceConfigPath: "google/cloud/compute/v1/compute_v1.yaml", + transports: []string{"rest"}, + // TODO(dovs): Change to "ga" when ready. + releaseLevel: "alpha", + googleapisDiscovery: true, + }, { inputDirectoryPath: "google/cloud/texttospeech/v1", pkg: "texttospeech", diff --git a/internal/gapicgen/generator/gapics.go b/internal/gapicgen/generator/gapics.go index 8362dffc32b..48a16e67acc 100644 --- a/internal/gapicgen/generator/gapics.go +++ b/internal/gapicgen/generator/gapics.go @@ -32,27 +32,29 @@ import ( // GapicGenerator is used to regenerate gapic libraries. type GapicGenerator struct { - googleapisDir string - protoDir string - googleCloudDir string - genprotoDir string - gapicToGenerate string - regenOnly bool - onlyGenerateGapic bool - modifiedPkgs []string + googleapisDir string + googleapisDiscoDir string + protoDir string + googleCloudDir string + genprotoDir string + gapicToGenerate string + regenOnly bool + onlyGenerateGapic bool + modifiedPkgs []string } // NewGapicGenerator creates a GapicGenerator. func NewGapicGenerator(c *Config, modifiedPkgs []string) *GapicGenerator { return &GapicGenerator{ - googleapisDir: c.GoogleapisDir, - protoDir: c.ProtoDir, - googleCloudDir: c.GapicDir, - genprotoDir: c.GenprotoDir, - gapicToGenerate: c.GapicToGenerate, - regenOnly: c.RegenOnly, - onlyGenerateGapic: c.OnlyGenerateGapic, - modifiedPkgs: modifiedPkgs, + googleapisDir: c.GoogleapisDir, + googleapisDiscoDir: c.GoogleapisDiscoDir, + protoDir: c.ProtoDir, + googleCloudDir: c.GapicDir, + genprotoDir: c.GenprotoDir, + gapicToGenerate: c.GapicToGenerate, + regenOnly: c.RegenOnly, + onlyGenerateGapic: c.OnlyGenerateGapic, + modifiedPkgs: modifiedPkgs, } } @@ -267,13 +269,20 @@ find . -name '*.backup' -delete // microgen runs the microgenerator on a single microgen config. func (g *GapicGenerator) microgen(conf *microgenConfig) error { log.Println("microgen generating", conf.pkg) + dir := g.googleapisDir + if conf.googleapisDiscovery { + dir = g.googleapisDiscoDir + } var protoFiles []string - if err := filepath.Walk(g.googleapisDir+"/"+conf.inputDirectoryPath, func(path string, info os.FileInfo, err error) error { + if err := filepath.Walk(dir+"/"+conf.inputDirectoryPath, func(path string, info os.FileInfo, err error) error { if err != nil { return err } - if strings.Contains(info.Name(), ".proto") { + // Ignore compute_small.proto which is just for testing and would cause a collision if used in generation. + // + // TODO(noahdietz): Remove this when it is no longer needed. + if strings.Contains(info.Name(), ".proto") && !strings.Contains(info.Name(), "compute_small.proto") { protoFiles = append(protoFiles, path) } return nil @@ -282,6 +291,7 @@ func (g *GapicGenerator) microgen(conf *microgenConfig) error { } args := []string{"-I", g.googleapisDir, + "-I", g.googleapisDiscoDir, "--experimental_allow_proto3_optional", "-I", g.protoDir, "--go_gapic_out", g.googleCloudDir, @@ -297,9 +307,12 @@ func (g *GapicGenerator) microgen(conf *microgenConfig) error { if !conf.disableMetadata { args = append(args, "--go_gapic_opt", "metadata") } + if len(conf.transports) > 0 { + args = append(args, "--go_gapic_opt", fmt.Sprintf("transport=%s", strings.Join(conf.transports, "+"))) + } args = append(args, protoFiles...) c := execv.Command("protoc", args...) - c.Dir = g.googleapisDir + c.Dir = dir return c.Run() } From 63fdb2ee21d70e2de71641a5c19a448fd1c39f56 Mon Sep 17 00:00:00 2001 From: Noah Dietz Date: Tue, 29 Jun 2021 14:22:35 -0700 Subject: [PATCH 29/50] chore(storage): generate GAPIC under internal subdir (#4018) Add a gRPC Go GAPIC for the Storage API under an internal subdirectory of the submodule to ensure no one can import it. This GAPIC is being added for proof of concept development and should not be used in production or by any other client library. Generated with the following: ```bash $ cd google-cloud-go $ export GOOGLE_CLOUD_GO=$(pwd) $ cd internal/gapicgen $ go run cloud.google.com/go/internal/gapicgen/cmd/genbot \ -local \ -regen-only \ -only-gapics \ -gapic=cloud.google.com/go/storage/internal/apiv1 \ -gocloud-dir=$GOOGLE_CLOUD_GO ``` --- internal/gapicgen/generator/config.go | 8 + internal/gapicgen/generator/config_test.go | 5 +- storage/internal/apiv1/doc.go | 120 + storage/internal/apiv1/gapic_metadata.json | 298 ++ storage/internal/apiv1/storage_client.go | 2388 +++++++++++++++++ .../apiv1/storage_client_example_test.go | 1046 ++++++++ 6 files changed, 3863 insertions(+), 2 deletions(-) create mode 100644 storage/internal/apiv1/doc.go create mode 100644 storage/internal/apiv1/gapic_metadata.json create mode 100644 storage/internal/apiv1/storage_client.go create mode 100644 storage/internal/apiv1/storage_client_example_test.go diff --git a/internal/gapicgen/generator/config.go b/internal/gapicgen/generator/config.go index 8234ba35578..b7f4ea4fb3e 100644 --- a/internal/gapicgen/generator/config.go +++ b/internal/gapicgen/generator/config.go @@ -1222,4 +1222,12 @@ var microgenGapicConfigs = []*microgenConfig{ // GA after 2021/06/10 releaseLevel: "beta", }, + { + inputDirectoryPath: "google/storage/v1", + pkg: "storage", + importPath: "cloud.google.com/go/storage/internal/apiv1", + gRPCServiceConfigPath: "google/storage/v1/storage_grpc_service_config.json", + apiServiceConfigPath: "google/storage/v1/storage_v1.yaml", + releaseLevel: "alpha", + }, } diff --git a/internal/gapicgen/generator/config_test.go b/internal/gapicgen/generator/config_test.go index b5d61a77b51..9460acf0c85 100644 --- a/internal/gapicgen/generator/config_test.go +++ b/internal/gapicgen/generator/config_test.go @@ -33,8 +33,9 @@ var apivExceptions = map[string]bool{ } var packagePathExceptions = map[string]bool{ - "cloud.google.com/go/longrunning/autogen": true, - "cloud.google.com/go/firestore/apiv1/admin": true, + "cloud.google.com/go/longrunning/autogen": true, + "cloud.google.com/go/firestore/apiv1/admin": true, + "cloud.google.com/go/storage/internal/apiv1": true, } // TestMicrogenConfigs validates config entries. diff --git a/storage/internal/apiv1/doc.go b/storage/internal/apiv1/doc.go new file mode 100644 index 00000000000..ea45239e75c --- /dev/null +++ b/storage/internal/apiv1/doc.go @@ -0,0 +1,120 @@ +// Copyright 2021 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 storage is an auto-generated package for the +// Cloud Storage API. +// +// Lets you store and retrieve potentially-large, immutable data objects. +// +// Use of Context +// +// The ctx passed to NewClient is used for authentication requests and +// for creating the underlying connection, but is not used for subsequent calls. +// Individual methods on the client use the ctx given to them. +// +// To close the open connection, use the Close() method. +// +// For information about setting deadlines, reusing contexts, and more +// please visit https://pkg.go.dev/cloud.google.com/go. +package storage // import "cloud.google.com/go/storage/internal/apiv1" + +import ( + "context" + "os" + "runtime" + "strconv" + "strings" + "unicode" + + "google.golang.org/api/option" + "google.golang.org/grpc/metadata" +) + +// For more information on implementing a client constructor hook, see +// https://github.com/googleapis/google-cloud-go/wiki/Customizing-constructors. +type clientHookParams struct{} +type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) + +const versionClient = "UNKNOWN" + +func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { + out, _ := metadata.FromOutgoingContext(ctx) + out = out.Copy() + for _, md := range mds { + for k, v := range md { + out[k] = append(out[k], v...) + } + } + return metadata.NewOutgoingContext(ctx, out) +} + +func checkDisableDeadlines() (bool, error) { + raw, ok := os.LookupEnv("GOOGLE_API_GO_EXPERIMENTAL_DISABLE_DEFAULT_DEADLINE") + if !ok { + return false, nil + } + + b, err := strconv.ParseBool(raw) + return b, err +} + +// DefaultAuthScopes reports the default set of authentication scopes to use with this package. +func DefaultAuthScopes() []string { + return []string{ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/devstorage.full_control", + "https://www.googleapis.com/auth/devstorage.read_only", + "https://www.googleapis.com/auth/devstorage.read_write", + } +} + +// versionGo returns the Go runtime version. The returned string +// has no whitespace, suitable for reporting in header. +func versionGo() string { + const develPrefix = "devel +" + + s := runtime.Version() + if strings.HasPrefix(s, develPrefix) { + s = s[len(develPrefix):] + if p := strings.IndexFunc(s, unicode.IsSpace); p >= 0 { + s = s[:p] + } + return s + } + + notSemverRune := func(r rune) bool { + return !strings.ContainsRune("0123456789.", r) + } + + if strings.HasPrefix(s, "go1") { + s = s[2:] + var prerelease string + if p := strings.IndexFunc(s, notSemverRune); p >= 0 { + s, prerelease = s[:p], s[p:] + } + if strings.HasSuffix(s, ".") { + s += "0" + } else if strings.Count(s, ".") < 2 { + s += ".0" + } + if prerelease != "" { + s += "-" + prerelease + } + return s + } + return "UNKNOWN" +} diff --git a/storage/internal/apiv1/gapic_metadata.json b/storage/internal/apiv1/gapic_metadata.json new file mode 100644 index 00000000000..b3a8f901993 --- /dev/null +++ b/storage/internal/apiv1/gapic_metadata.json @@ -0,0 +1,298 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.storage.v1", + "libraryPackage": "cloud.google.com/go/storage/internal/apiv1", + "services": { + "Storage": { + "clients": { + "grpc": { + "libraryClient": "Client", + "rpcs": { + "ComposeObject": { + "methods": [ + "ComposeObject" + ] + }, + "CopyObject": { + "methods": [ + "CopyObject" + ] + }, + "CreateHmacKey": { + "methods": [ + "CreateHmacKey" + ] + }, + "DeleteBucket": { + "methods": [ + "DeleteBucket" + ] + }, + "DeleteBucketAccessControl": { + "methods": [ + "DeleteBucketAccessControl" + ] + }, + "DeleteDefaultObjectAccessControl": { + "methods": [ + "DeleteDefaultObjectAccessControl" + ] + }, + "DeleteHmacKey": { + "methods": [ + "DeleteHmacKey" + ] + }, + "DeleteNotification": { + "methods": [ + "DeleteNotification" + ] + }, + "DeleteObject": { + "methods": [ + "DeleteObject" + ] + }, + "DeleteObjectAccessControl": { + "methods": [ + "DeleteObjectAccessControl" + ] + }, + "GetBucket": { + "methods": [ + "GetBucket" + ] + }, + "GetBucketAccessControl": { + "methods": [ + "GetBucketAccessControl" + ] + }, + "GetBucketIamPolicy": { + "methods": [ + "GetBucketIamPolicy" + ] + }, + "GetDefaultObjectAccessControl": { + "methods": [ + "GetDefaultObjectAccessControl" + ] + }, + "GetHmacKey": { + "methods": [ + "GetHmacKey" + ] + }, + "GetNotification": { + "methods": [ + "GetNotification" + ] + }, + "GetObject": { + "methods": [ + "GetObject" + ] + }, + "GetObjectAccessControl": { + "methods": [ + "GetObjectAccessControl" + ] + }, + "GetObjectIamPolicy": { + "methods": [ + "GetObjectIamPolicy" + ] + }, + "GetObjectMedia": { + "methods": [ + "GetObjectMedia" + ] + }, + "GetServiceAccount": { + "methods": [ + "GetServiceAccount" + ] + }, + "InsertBucket": { + "methods": [ + "InsertBucket" + ] + }, + "InsertBucketAccessControl": { + "methods": [ + "InsertBucketAccessControl" + ] + }, + "InsertDefaultObjectAccessControl": { + "methods": [ + "InsertDefaultObjectAccessControl" + ] + }, + "InsertNotification": { + "methods": [ + "InsertNotification" + ] + }, + "InsertObject": { + "methods": [ + "InsertObject" + ] + }, + "InsertObjectAccessControl": { + "methods": [ + "InsertObjectAccessControl" + ] + }, + "ListBucketAccessControls": { + "methods": [ + "ListBucketAccessControls" + ] + }, + "ListBuckets": { + "methods": [ + "ListBuckets" + ] + }, + "ListChannels": { + "methods": [ + "ListChannels" + ] + }, + "ListDefaultObjectAccessControls": { + "methods": [ + "ListDefaultObjectAccessControls" + ] + }, + "ListHmacKeys": { + "methods": [ + "ListHmacKeys" + ] + }, + "ListNotifications": { + "methods": [ + "ListNotifications" + ] + }, + "ListObjectAccessControls": { + "methods": [ + "ListObjectAccessControls" + ] + }, + "ListObjects": { + "methods": [ + "ListObjects" + ] + }, + "LockBucketRetentionPolicy": { + "methods": [ + "LockBucketRetentionPolicy" + ] + }, + "PatchBucket": { + "methods": [ + "PatchBucket" + ] + }, + "PatchBucketAccessControl": { + "methods": [ + "PatchBucketAccessControl" + ] + }, + "PatchDefaultObjectAccessControl": { + "methods": [ + "PatchDefaultObjectAccessControl" + ] + }, + "PatchObject": { + "methods": [ + "PatchObject" + ] + }, + "PatchObjectAccessControl": { + "methods": [ + "PatchObjectAccessControl" + ] + }, + "QueryWriteStatus": { + "methods": [ + "QueryWriteStatus" + ] + }, + "RewriteObject": { + "methods": [ + "RewriteObject" + ] + }, + "SetBucketIamPolicy": { + "methods": [ + "SetBucketIamPolicy" + ] + }, + "SetObjectIamPolicy": { + "methods": [ + "SetObjectIamPolicy" + ] + }, + "StartResumableWrite": { + "methods": [ + "StartResumableWrite" + ] + }, + "StopChannel": { + "methods": [ + "StopChannel" + ] + }, + "TestBucketIamPermissions": { + "methods": [ + "TestBucketIamPermissions" + ] + }, + "TestObjectIamPermissions": { + "methods": [ + "TestObjectIamPermissions" + ] + }, + "UpdateBucket": { + "methods": [ + "UpdateBucket" + ] + }, + "UpdateBucketAccessControl": { + "methods": [ + "UpdateBucketAccessControl" + ] + }, + "UpdateDefaultObjectAccessControl": { + "methods": [ + "UpdateDefaultObjectAccessControl" + ] + }, + "UpdateHmacKey": { + "methods": [ + "UpdateHmacKey" + ] + }, + "UpdateObject": { + "methods": [ + "UpdateObject" + ] + }, + "UpdateObjectAccessControl": { + "methods": [ + "UpdateObjectAccessControl" + ] + }, + "WatchAllObjects": { + "methods": [ + "WatchAllObjects" + ] + } + } + } + } + } + } +} diff --git a/storage/internal/apiv1/storage_client.go b/storage/internal/apiv1/storage_client.go new file mode 100644 index 00000000000..994ed4556f9 --- /dev/null +++ b/storage/internal/apiv1/storage_client.go @@ -0,0 +1,2388 @@ +// Copyright 2021 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 storage + +import ( + "context" + "math" + "time" + + gax "github.com/googleapis/gax-go/v2" + "google.golang.org/api/option" + "google.golang.org/api/option/internaloption" + gtransport "google.golang.org/api/transport/grpc" + iampb "google.golang.org/genproto/googleapis/iam/v1" + storagepb "google.golang.org/genproto/googleapis/storage/v1" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/metadata" +) + +var newClientHook clientHook + +// CallOptions contains the retry settings for each method of Client. +type CallOptions struct { + DeleteBucketAccessControl []gax.CallOption + GetBucketAccessControl []gax.CallOption + InsertBucketAccessControl []gax.CallOption + ListBucketAccessControls []gax.CallOption + UpdateBucketAccessControl []gax.CallOption + PatchBucketAccessControl []gax.CallOption + DeleteBucket []gax.CallOption + GetBucket []gax.CallOption + InsertBucket []gax.CallOption + ListChannels []gax.CallOption + ListBuckets []gax.CallOption + LockBucketRetentionPolicy []gax.CallOption + GetBucketIamPolicy []gax.CallOption + SetBucketIamPolicy []gax.CallOption + TestBucketIamPermissions []gax.CallOption + PatchBucket []gax.CallOption + UpdateBucket []gax.CallOption + StopChannel []gax.CallOption + DeleteDefaultObjectAccessControl []gax.CallOption + GetDefaultObjectAccessControl []gax.CallOption + InsertDefaultObjectAccessControl []gax.CallOption + ListDefaultObjectAccessControls []gax.CallOption + PatchDefaultObjectAccessControl []gax.CallOption + UpdateDefaultObjectAccessControl []gax.CallOption + DeleteNotification []gax.CallOption + GetNotification []gax.CallOption + InsertNotification []gax.CallOption + ListNotifications []gax.CallOption + DeleteObjectAccessControl []gax.CallOption + GetObjectAccessControl []gax.CallOption + InsertObjectAccessControl []gax.CallOption + ListObjectAccessControls []gax.CallOption + PatchObjectAccessControl []gax.CallOption + UpdateObjectAccessControl []gax.CallOption + ComposeObject []gax.CallOption + CopyObject []gax.CallOption + DeleteObject []gax.CallOption + GetObject []gax.CallOption + GetObjectMedia []gax.CallOption + InsertObject []gax.CallOption + ListObjects []gax.CallOption + RewriteObject []gax.CallOption + StartResumableWrite []gax.CallOption + QueryWriteStatus []gax.CallOption + PatchObject []gax.CallOption + UpdateObject []gax.CallOption + GetObjectIamPolicy []gax.CallOption + SetObjectIamPolicy []gax.CallOption + TestObjectIamPermissions []gax.CallOption + WatchAllObjects []gax.CallOption + GetServiceAccount []gax.CallOption + CreateHmacKey []gax.CallOption + DeleteHmacKey []gax.CallOption + GetHmacKey []gax.CallOption + ListHmacKeys []gax.CallOption + UpdateHmacKey []gax.CallOption +} + +func defaultGRPCClientOptions() []option.ClientOption { + return []option.ClientOption{ + internaloption.WithDefaultEndpoint("storage.googleapis.com:443"), + internaloption.WithDefaultMTLSEndpoint("storage.mtls.googleapis.com:443"), + internaloption.WithDefaultAudience("https://storage.googleapis.com/"), + internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), + option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), + option.WithGRPCDialOption(grpc.WithDefaultCallOptions( + grpc.MaxCallRecvMsgSize(math.MaxInt32))), + } +} + +func defaultCallOptions() *CallOptions { + return &CallOptions{ + DeleteBucketAccessControl: []gax.CallOption{ + gax.WithRetry(func() gax.Retryer { + return gax.OnCodes([]codes.Code{ + codes.DeadlineExceeded, + codes.Unavailable, + }, gax.Backoff{ + Initial: 1000 * time.Millisecond, + Max: 60000 * time.Millisecond, + Multiplier: 2.00, + }) + }), + }, + GetBucketAccessControl: []gax.CallOption{ + gax.WithRetry(func() gax.Retryer { + return gax.OnCodes([]codes.Code{ + codes.DeadlineExceeded, + codes.Unavailable, + }, gax.Backoff{ + Initial: 1000 * time.Millisecond, + Max: 60000 * time.Millisecond, + Multiplier: 2.00, + }) + }), + }, + InsertBucketAccessControl: []gax.CallOption{ + gax.WithRetry(func() gax.Retryer { + return gax.OnCodes([]codes.Code{ + codes.DeadlineExceeded, + codes.Unavailable, + }, gax.Backoff{ + Initial: 1000 * time.Millisecond, + Max: 60000 * time.Millisecond, + Multiplier: 2.00, + }) + }), + }, + ListBucketAccessControls: []gax.CallOption{ + gax.WithRetry(func() gax.Retryer { + return gax.OnCodes([]codes.Code{ + codes.DeadlineExceeded, + codes.Unavailable, + }, gax.Backoff{ + Initial: 1000 * time.Millisecond, + Max: 60000 * time.Millisecond, + Multiplier: 2.00, + }) + }), + }, + UpdateBucketAccessControl: []gax.CallOption{ + gax.WithRetry(func() gax.Retryer { + return gax.OnCodes([]codes.Code{ + codes.DeadlineExceeded, + codes.Unavailable, + }, gax.Backoff{ + Initial: 1000 * time.Millisecond, + Max: 60000 * time.Millisecond, + Multiplier: 2.00, + }) + }), + }, + PatchBucketAccessControl: []gax.CallOption{ + gax.WithRetry(func() gax.Retryer { + return gax.OnCodes([]codes.Code{ + codes.DeadlineExceeded, + codes.Unavailable, + }, gax.Backoff{ + Initial: 1000 * time.Millisecond, + Max: 60000 * time.Millisecond, + Multiplier: 2.00, + }) + }), + }, + DeleteBucket: []gax.CallOption{ + gax.WithRetry(func() gax.Retryer { + return gax.OnCodes([]codes.Code{ + codes.DeadlineExceeded, + codes.Unavailable, + }, gax.Backoff{ + Initial: 1000 * time.Millisecond, + Max: 60000 * time.Millisecond, + Multiplier: 2.00, + }) + }), + }, + GetBucket: []gax.CallOption{ + gax.WithRetry(func() gax.Retryer { + return gax.OnCodes([]codes.Code{ + codes.DeadlineExceeded, + codes.Unavailable, + }, gax.Backoff{ + Initial: 1000 * time.Millisecond, + Max: 60000 * time.Millisecond, + Multiplier: 2.00, + }) + }), + }, + InsertBucket: []gax.CallOption{ + gax.WithRetry(func() gax.Retryer { + return gax.OnCodes([]codes.Code{ + codes.DeadlineExceeded, + codes.Unavailable, + }, gax.Backoff{ + Initial: 1000 * time.Millisecond, + Max: 60000 * time.Millisecond, + Multiplier: 2.00, + }) + }), + }, + ListChannels: []gax.CallOption{ + gax.WithRetry(func() gax.Retryer { + return gax.OnCodes([]codes.Code{ + codes.DeadlineExceeded, + codes.Unavailable, + }, gax.Backoff{ + Initial: 1000 * time.Millisecond, + Max: 60000 * time.Millisecond, + Multiplier: 2.00, + }) + }), + }, + ListBuckets: []gax.CallOption{ + gax.WithRetry(func() gax.Retryer { + return gax.OnCodes([]codes.Code{ + codes.DeadlineExceeded, + codes.Unavailable, + }, gax.Backoff{ + Initial: 1000 * time.Millisecond, + Max: 60000 * time.Millisecond, + Multiplier: 2.00, + }) + }), + }, + LockBucketRetentionPolicy: []gax.CallOption{ + gax.WithRetry(func() gax.Retryer { + return gax.OnCodes([]codes.Code{ + codes.DeadlineExceeded, + codes.Unavailable, + }, gax.Backoff{ + Initial: 1000 * time.Millisecond, + Max: 60000 * time.Millisecond, + Multiplier: 2.00, + }) + }), + }, + GetBucketIamPolicy: []gax.CallOption{ + gax.WithRetry(func() gax.Retryer { + return gax.OnCodes([]codes.Code{ + codes.DeadlineExceeded, + codes.Unavailable, + }, gax.Backoff{ + Initial: 1000 * time.Millisecond, + Max: 60000 * time.Millisecond, + Multiplier: 2.00, + }) + }), + }, + SetBucketIamPolicy: []gax.CallOption{ + gax.WithRetry(func() gax.Retryer { + return gax.OnCodes([]codes.Code{ + codes.DeadlineExceeded, + codes.Unavailable, + }, gax.Backoff{ + Initial: 1000 * time.Millisecond, + Max: 60000 * time.Millisecond, + Multiplier: 2.00, + }) + }), + }, + TestBucketIamPermissions: []gax.CallOption{ + gax.WithRetry(func() gax.Retryer { + return gax.OnCodes([]codes.Code{ + codes.DeadlineExceeded, + codes.Unavailable, + }, gax.Backoff{ + Initial: 1000 * time.Millisecond, + Max: 60000 * time.Millisecond, + Multiplier: 2.00, + }) + }), + }, + PatchBucket: []gax.CallOption{ + gax.WithRetry(func() gax.Retryer { + return gax.OnCodes([]codes.Code{ + codes.DeadlineExceeded, + codes.Unavailable, + }, gax.Backoff{ + Initial: 1000 * time.Millisecond, + Max: 60000 * time.Millisecond, + Multiplier: 2.00, + }) + }), + }, + UpdateBucket: []gax.CallOption{ + gax.WithRetry(func() gax.Retryer { + return gax.OnCodes([]codes.Code{ + codes.DeadlineExceeded, + codes.Unavailable, + }, gax.Backoff{ + Initial: 1000 * time.Millisecond, + Max: 60000 * time.Millisecond, + Multiplier: 2.00, + }) + }), + }, + StopChannel: []gax.CallOption{ + gax.WithRetry(func() gax.Retryer { + return gax.OnCodes([]codes.Code{ + codes.DeadlineExceeded, + codes.Unavailable, + }, gax.Backoff{ + Initial: 1000 * time.Millisecond, + Max: 60000 * time.Millisecond, + Multiplier: 2.00, + }) + }), + }, + DeleteDefaultObjectAccessControl: []gax.CallOption{ + gax.WithRetry(func() gax.Retryer { + return gax.OnCodes([]codes.Code{ + codes.DeadlineExceeded, + codes.Unavailable, + }, gax.Backoff{ + Initial: 1000 * time.Millisecond, + Max: 60000 * time.Millisecond, + Multiplier: 2.00, + }) + }), + }, + GetDefaultObjectAccessControl: []gax.CallOption{ + gax.WithRetry(func() gax.Retryer { + return gax.OnCodes([]codes.Code{ + codes.DeadlineExceeded, + codes.Unavailable, + }, gax.Backoff{ + Initial: 1000 * time.Millisecond, + Max: 60000 * time.Millisecond, + Multiplier: 2.00, + }) + }), + }, + InsertDefaultObjectAccessControl: []gax.CallOption{ + gax.WithRetry(func() gax.Retryer { + return gax.OnCodes([]codes.Code{ + codes.DeadlineExceeded, + codes.Unavailable, + }, gax.Backoff{ + Initial: 1000 * time.Millisecond, + Max: 60000 * time.Millisecond, + Multiplier: 2.00, + }) + }), + }, + ListDefaultObjectAccessControls: []gax.CallOption{ + gax.WithRetry(func() gax.Retryer { + return gax.OnCodes([]codes.Code{ + codes.DeadlineExceeded, + codes.Unavailable, + }, gax.Backoff{ + Initial: 1000 * time.Millisecond, + Max: 60000 * time.Millisecond, + Multiplier: 2.00, + }) + }), + }, + PatchDefaultObjectAccessControl: []gax.CallOption{ + gax.WithRetry(func() gax.Retryer { + return gax.OnCodes([]codes.Code{ + codes.DeadlineExceeded, + codes.Unavailable, + }, gax.Backoff{ + Initial: 1000 * time.Millisecond, + Max: 60000 * time.Millisecond, + Multiplier: 2.00, + }) + }), + }, + UpdateDefaultObjectAccessControl: []gax.CallOption{ + gax.WithRetry(func() gax.Retryer { + return gax.OnCodes([]codes.Code{ + codes.DeadlineExceeded, + codes.Unavailable, + }, gax.Backoff{ + Initial: 1000 * time.Millisecond, + Max: 60000 * time.Millisecond, + Multiplier: 2.00, + }) + }), + }, + DeleteNotification: []gax.CallOption{ + gax.WithRetry(func() gax.Retryer { + return gax.OnCodes([]codes.Code{ + codes.DeadlineExceeded, + codes.Unavailable, + }, gax.Backoff{ + Initial: 1000 * time.Millisecond, + Max: 60000 * time.Millisecond, + Multiplier: 2.00, + }) + }), + }, + GetNotification: []gax.CallOption{ + gax.WithRetry(func() gax.Retryer { + return gax.OnCodes([]codes.Code{ + codes.DeadlineExceeded, + codes.Unavailable, + }, gax.Backoff{ + Initial: 1000 * time.Millisecond, + Max: 60000 * time.Millisecond, + Multiplier: 2.00, + }) + }), + }, + InsertNotification: []gax.CallOption{ + gax.WithRetry(func() gax.Retryer { + return gax.OnCodes([]codes.Code{ + codes.DeadlineExceeded, + codes.Unavailable, + }, gax.Backoff{ + Initial: 1000 * time.Millisecond, + Max: 60000 * time.Millisecond, + Multiplier: 2.00, + }) + }), + }, + ListNotifications: []gax.CallOption{ + gax.WithRetry(func() gax.Retryer { + return gax.OnCodes([]codes.Code{ + codes.DeadlineExceeded, + codes.Unavailable, + }, gax.Backoff{ + Initial: 1000 * time.Millisecond, + Max: 60000 * time.Millisecond, + Multiplier: 2.00, + }) + }), + }, + DeleteObjectAccessControl: []gax.CallOption{ + gax.WithRetry(func() gax.Retryer { + return gax.OnCodes([]codes.Code{ + codes.DeadlineExceeded, + codes.Unavailable, + }, gax.Backoff{ + Initial: 1000 * time.Millisecond, + Max: 60000 * time.Millisecond, + Multiplier: 2.00, + }) + }), + }, + GetObjectAccessControl: []gax.CallOption{ + gax.WithRetry(func() gax.Retryer { + return gax.OnCodes([]codes.Code{ + codes.DeadlineExceeded, + codes.Unavailable, + }, gax.Backoff{ + Initial: 1000 * time.Millisecond, + Max: 60000 * time.Millisecond, + Multiplier: 2.00, + }) + }), + }, + InsertObjectAccessControl: []gax.CallOption{ + gax.WithRetry(func() gax.Retryer { + return gax.OnCodes([]codes.Code{ + codes.DeadlineExceeded, + codes.Unavailable, + }, gax.Backoff{ + Initial: 1000 * time.Millisecond, + Max: 60000 * time.Millisecond, + Multiplier: 2.00, + }) + }), + }, + ListObjectAccessControls: []gax.CallOption{ + gax.WithRetry(func() gax.Retryer { + return gax.OnCodes([]codes.Code{ + codes.DeadlineExceeded, + codes.Unavailable, + }, gax.Backoff{ + Initial: 1000 * time.Millisecond, + Max: 60000 * time.Millisecond, + Multiplier: 2.00, + }) + }), + }, + PatchObjectAccessControl: []gax.CallOption{ + gax.WithRetry(func() gax.Retryer { + return gax.OnCodes([]codes.Code{ + codes.DeadlineExceeded, + codes.Unavailable, + }, gax.Backoff{ + Initial: 1000 * time.Millisecond, + Max: 60000 * time.Millisecond, + Multiplier: 2.00, + }) + }), + }, + UpdateObjectAccessControl: []gax.CallOption{ + gax.WithRetry(func() gax.Retryer { + return gax.OnCodes([]codes.Code{ + codes.DeadlineExceeded, + codes.Unavailable, + }, gax.Backoff{ + Initial: 1000 * time.Millisecond, + Max: 60000 * time.Millisecond, + Multiplier: 2.00, + }) + }), + }, + ComposeObject: []gax.CallOption{ + gax.WithRetry(func() gax.Retryer { + return gax.OnCodes([]codes.Code{ + codes.DeadlineExceeded, + codes.Unavailable, + }, gax.Backoff{ + Initial: 1000 * time.Millisecond, + Max: 60000 * time.Millisecond, + Multiplier: 2.00, + }) + }), + }, + CopyObject: []gax.CallOption{ + gax.WithRetry(func() gax.Retryer { + return gax.OnCodes([]codes.Code{ + codes.DeadlineExceeded, + codes.Unavailable, + }, gax.Backoff{ + Initial: 1000 * time.Millisecond, + Max: 60000 * time.Millisecond, + Multiplier: 2.00, + }) + }), + }, + DeleteObject: []gax.CallOption{ + gax.WithRetry(func() gax.Retryer { + return gax.OnCodes([]codes.Code{ + codes.DeadlineExceeded, + codes.Unavailable, + }, gax.Backoff{ + Initial: 1000 * time.Millisecond, + Max: 60000 * time.Millisecond, + Multiplier: 2.00, + }) + }), + }, + GetObject: []gax.CallOption{ + gax.WithRetry(func() gax.Retryer { + return gax.OnCodes([]codes.Code{ + codes.DeadlineExceeded, + codes.Unavailable, + }, gax.Backoff{ + Initial: 1000 * time.Millisecond, + Max: 60000 * time.Millisecond, + Multiplier: 2.00, + }) + }), + }, + GetObjectMedia: []gax.CallOption{ + gax.WithRetry(func() gax.Retryer { + return gax.OnCodes([]codes.Code{ + codes.DeadlineExceeded, + codes.Unavailable, + }, gax.Backoff{ + Initial: 1000 * time.Millisecond, + Max: 60000 * time.Millisecond, + Multiplier: 2.00, + }) + }), + }, + InsertObject: []gax.CallOption{ + gax.WithRetry(func() gax.Retryer { + return gax.OnCodes([]codes.Code{ + codes.DeadlineExceeded, + codes.Unavailable, + }, gax.Backoff{ + Initial: 1000 * time.Millisecond, + Max: 60000 * time.Millisecond, + Multiplier: 2.00, + }) + }), + }, + ListObjects: []gax.CallOption{ + gax.WithRetry(func() gax.Retryer { + return gax.OnCodes([]codes.Code{ + codes.DeadlineExceeded, + codes.Unavailable, + }, gax.Backoff{ + Initial: 1000 * time.Millisecond, + Max: 60000 * time.Millisecond, + Multiplier: 2.00, + }) + }), + }, + RewriteObject: []gax.CallOption{ + gax.WithRetry(func() gax.Retryer { + return gax.OnCodes([]codes.Code{ + codes.DeadlineExceeded, + codes.Unavailable, + }, gax.Backoff{ + Initial: 1000 * time.Millisecond, + Max: 60000 * time.Millisecond, + Multiplier: 2.00, + }) + }), + }, + StartResumableWrite: []gax.CallOption{ + gax.WithRetry(func() gax.Retryer { + return gax.OnCodes([]codes.Code{ + codes.DeadlineExceeded, + codes.Unavailable, + }, gax.Backoff{ + Initial: 1000 * time.Millisecond, + Max: 60000 * time.Millisecond, + Multiplier: 2.00, + }) + }), + }, + QueryWriteStatus: []gax.CallOption{ + gax.WithRetry(func() gax.Retryer { + return gax.OnCodes([]codes.Code{ + codes.DeadlineExceeded, + codes.Unavailable, + }, gax.Backoff{ + Initial: 1000 * time.Millisecond, + Max: 60000 * time.Millisecond, + Multiplier: 2.00, + }) + }), + }, + PatchObject: []gax.CallOption{ + gax.WithRetry(func() gax.Retryer { + return gax.OnCodes([]codes.Code{ + codes.DeadlineExceeded, + codes.Unavailable, + }, gax.Backoff{ + Initial: 1000 * time.Millisecond, + Max: 60000 * time.Millisecond, + Multiplier: 2.00, + }) + }), + }, + UpdateObject: []gax.CallOption{ + gax.WithRetry(func() gax.Retryer { + return gax.OnCodes([]codes.Code{ + codes.DeadlineExceeded, + codes.Unavailable, + }, gax.Backoff{ + Initial: 1000 * time.Millisecond, + Max: 60000 * time.Millisecond, + Multiplier: 2.00, + }) + }), + }, + GetObjectIamPolicy: []gax.CallOption{ + gax.WithRetry(func() gax.Retryer { + return gax.OnCodes([]codes.Code{ + codes.DeadlineExceeded, + codes.Unavailable, + }, gax.Backoff{ + Initial: 1000 * time.Millisecond, + Max: 60000 * time.Millisecond, + Multiplier: 2.00, + }) + }), + }, + SetObjectIamPolicy: []gax.CallOption{ + gax.WithRetry(func() gax.Retryer { + return gax.OnCodes([]codes.Code{ + codes.DeadlineExceeded, + codes.Unavailable, + }, gax.Backoff{ + Initial: 1000 * time.Millisecond, + Max: 60000 * time.Millisecond, + Multiplier: 2.00, + }) + }), + }, + TestObjectIamPermissions: []gax.CallOption{ + gax.WithRetry(func() gax.Retryer { + return gax.OnCodes([]codes.Code{ + codes.DeadlineExceeded, + codes.Unavailable, + }, gax.Backoff{ + Initial: 1000 * time.Millisecond, + Max: 60000 * time.Millisecond, + Multiplier: 2.00, + }) + }), + }, + WatchAllObjects: []gax.CallOption{ + gax.WithRetry(func() gax.Retryer { + return gax.OnCodes([]codes.Code{ + codes.DeadlineExceeded, + codes.Unavailable, + }, gax.Backoff{ + Initial: 1000 * time.Millisecond, + Max: 60000 * time.Millisecond, + Multiplier: 2.00, + }) + }), + }, + GetServiceAccount: []gax.CallOption{ + gax.WithRetry(func() gax.Retryer { + return gax.OnCodes([]codes.Code{ + codes.DeadlineExceeded, + codes.Unavailable, + }, gax.Backoff{ + Initial: 1000 * time.Millisecond, + Max: 60000 * time.Millisecond, + Multiplier: 2.00, + }) + }), + }, + CreateHmacKey: []gax.CallOption{ + gax.WithRetry(func() gax.Retryer { + return gax.OnCodes([]codes.Code{ + codes.DeadlineExceeded, + codes.Unavailable, + }, gax.Backoff{ + Initial: 1000 * time.Millisecond, + Max: 60000 * time.Millisecond, + Multiplier: 2.00, + }) + }), + }, + DeleteHmacKey: []gax.CallOption{ + gax.WithRetry(func() gax.Retryer { + return gax.OnCodes([]codes.Code{ + codes.DeadlineExceeded, + codes.Unavailable, + }, gax.Backoff{ + Initial: 1000 * time.Millisecond, + Max: 60000 * time.Millisecond, + Multiplier: 2.00, + }) + }), + }, + GetHmacKey: []gax.CallOption{ + gax.WithRetry(func() gax.Retryer { + return gax.OnCodes([]codes.Code{ + codes.DeadlineExceeded, + codes.Unavailable, + }, gax.Backoff{ + Initial: 1000 * time.Millisecond, + Max: 60000 * time.Millisecond, + Multiplier: 2.00, + }) + }), + }, + ListHmacKeys: []gax.CallOption{ + gax.WithRetry(func() gax.Retryer { + return gax.OnCodes([]codes.Code{ + codes.DeadlineExceeded, + codes.Unavailable, + }, gax.Backoff{ + Initial: 1000 * time.Millisecond, + Max: 60000 * time.Millisecond, + Multiplier: 2.00, + }) + }), + }, + UpdateHmacKey: []gax.CallOption{ + gax.WithRetry(func() gax.Retryer { + return gax.OnCodes([]codes.Code{ + codes.DeadlineExceeded, + codes.Unavailable, + }, gax.Backoff{ + Initial: 1000 * time.Millisecond, + Max: 60000 * time.Millisecond, + Multiplier: 2.00, + }) + }), + }, + } +} + +// internalClient is an interface that defines the methods availaible from Cloud Storage API. +type internalClient interface { + Close() error + setGoogleClientInfo(...string) + Connection() *grpc.ClientConn + DeleteBucketAccessControl(context.Context, *storagepb.DeleteBucketAccessControlRequest, ...gax.CallOption) error + GetBucketAccessControl(context.Context, *storagepb.GetBucketAccessControlRequest, ...gax.CallOption) (*storagepb.BucketAccessControl, error) + InsertBucketAccessControl(context.Context, *storagepb.InsertBucketAccessControlRequest, ...gax.CallOption) (*storagepb.BucketAccessControl, error) + ListBucketAccessControls(context.Context, *storagepb.ListBucketAccessControlsRequest, ...gax.CallOption) (*storagepb.ListBucketAccessControlsResponse, error) + UpdateBucketAccessControl(context.Context, *storagepb.UpdateBucketAccessControlRequest, ...gax.CallOption) (*storagepb.BucketAccessControl, error) + PatchBucketAccessControl(context.Context, *storagepb.PatchBucketAccessControlRequest, ...gax.CallOption) (*storagepb.BucketAccessControl, error) + DeleteBucket(context.Context, *storagepb.DeleteBucketRequest, ...gax.CallOption) error + GetBucket(context.Context, *storagepb.GetBucketRequest, ...gax.CallOption) (*storagepb.Bucket, error) + InsertBucket(context.Context, *storagepb.InsertBucketRequest, ...gax.CallOption) (*storagepb.Bucket, error) + ListChannels(context.Context, *storagepb.ListChannelsRequest, ...gax.CallOption) (*storagepb.ListChannelsResponse, error) + ListBuckets(context.Context, *storagepb.ListBucketsRequest, ...gax.CallOption) (*storagepb.ListBucketsResponse, error) + LockBucketRetentionPolicy(context.Context, *storagepb.LockRetentionPolicyRequest, ...gax.CallOption) (*storagepb.Bucket, error) + GetBucketIamPolicy(context.Context, *storagepb.GetIamPolicyRequest, ...gax.CallOption) (*iampb.Policy, error) + SetBucketIamPolicy(context.Context, *storagepb.SetIamPolicyRequest, ...gax.CallOption) (*iampb.Policy, error) + TestBucketIamPermissions(context.Context, *storagepb.TestIamPermissionsRequest, ...gax.CallOption) (*iampb.TestIamPermissionsResponse, error) + PatchBucket(context.Context, *storagepb.PatchBucketRequest, ...gax.CallOption) (*storagepb.Bucket, error) + UpdateBucket(context.Context, *storagepb.UpdateBucketRequest, ...gax.CallOption) (*storagepb.Bucket, error) + StopChannel(context.Context, *storagepb.StopChannelRequest, ...gax.CallOption) error + DeleteDefaultObjectAccessControl(context.Context, *storagepb.DeleteDefaultObjectAccessControlRequest, ...gax.CallOption) error + GetDefaultObjectAccessControl(context.Context, *storagepb.GetDefaultObjectAccessControlRequest, ...gax.CallOption) (*storagepb.ObjectAccessControl, error) + InsertDefaultObjectAccessControl(context.Context, *storagepb.InsertDefaultObjectAccessControlRequest, ...gax.CallOption) (*storagepb.ObjectAccessControl, error) + ListDefaultObjectAccessControls(context.Context, *storagepb.ListDefaultObjectAccessControlsRequest, ...gax.CallOption) (*storagepb.ListObjectAccessControlsResponse, error) + PatchDefaultObjectAccessControl(context.Context, *storagepb.PatchDefaultObjectAccessControlRequest, ...gax.CallOption) (*storagepb.ObjectAccessControl, error) + UpdateDefaultObjectAccessControl(context.Context, *storagepb.UpdateDefaultObjectAccessControlRequest, ...gax.CallOption) (*storagepb.ObjectAccessControl, error) + DeleteNotification(context.Context, *storagepb.DeleteNotificationRequest, ...gax.CallOption) error + GetNotification(context.Context, *storagepb.GetNotificationRequest, ...gax.CallOption) (*storagepb.Notification, error) + InsertNotification(context.Context, *storagepb.InsertNotificationRequest, ...gax.CallOption) (*storagepb.Notification, error) + ListNotifications(context.Context, *storagepb.ListNotificationsRequest, ...gax.CallOption) (*storagepb.ListNotificationsResponse, error) + DeleteObjectAccessControl(context.Context, *storagepb.DeleteObjectAccessControlRequest, ...gax.CallOption) error + GetObjectAccessControl(context.Context, *storagepb.GetObjectAccessControlRequest, ...gax.CallOption) (*storagepb.ObjectAccessControl, error) + InsertObjectAccessControl(context.Context, *storagepb.InsertObjectAccessControlRequest, ...gax.CallOption) (*storagepb.ObjectAccessControl, error) + ListObjectAccessControls(context.Context, *storagepb.ListObjectAccessControlsRequest, ...gax.CallOption) (*storagepb.ListObjectAccessControlsResponse, error) + PatchObjectAccessControl(context.Context, *storagepb.PatchObjectAccessControlRequest, ...gax.CallOption) (*storagepb.ObjectAccessControl, error) + UpdateObjectAccessControl(context.Context, *storagepb.UpdateObjectAccessControlRequest, ...gax.CallOption) (*storagepb.ObjectAccessControl, error) + ComposeObject(context.Context, *storagepb.ComposeObjectRequest, ...gax.CallOption) (*storagepb.Object, error) + CopyObject(context.Context, *storagepb.CopyObjectRequest, ...gax.CallOption) (*storagepb.Object, error) + DeleteObject(context.Context, *storagepb.DeleteObjectRequest, ...gax.CallOption) error + GetObject(context.Context, *storagepb.GetObjectRequest, ...gax.CallOption) (*storagepb.Object, error) + GetObjectMedia(context.Context, *storagepb.GetObjectMediaRequest, ...gax.CallOption) (storagepb.Storage_GetObjectMediaClient, error) + InsertObject(context.Context, ...gax.CallOption) (storagepb.Storage_InsertObjectClient, error) + ListObjects(context.Context, *storagepb.ListObjectsRequest, ...gax.CallOption) (*storagepb.ListObjectsResponse, error) + RewriteObject(context.Context, *storagepb.RewriteObjectRequest, ...gax.CallOption) (*storagepb.RewriteResponse, error) + StartResumableWrite(context.Context, *storagepb.StartResumableWriteRequest, ...gax.CallOption) (*storagepb.StartResumableWriteResponse, error) + QueryWriteStatus(context.Context, *storagepb.QueryWriteStatusRequest, ...gax.CallOption) (*storagepb.QueryWriteStatusResponse, error) + PatchObject(context.Context, *storagepb.PatchObjectRequest, ...gax.CallOption) (*storagepb.Object, error) + UpdateObject(context.Context, *storagepb.UpdateObjectRequest, ...gax.CallOption) (*storagepb.Object, error) + GetObjectIamPolicy(context.Context, *storagepb.GetIamPolicyRequest, ...gax.CallOption) (*iampb.Policy, error) + SetObjectIamPolicy(context.Context, *storagepb.SetIamPolicyRequest, ...gax.CallOption) (*iampb.Policy, error) + TestObjectIamPermissions(context.Context, *storagepb.TestIamPermissionsRequest, ...gax.CallOption) (*iampb.TestIamPermissionsResponse, error) + WatchAllObjects(context.Context, *storagepb.WatchAllObjectsRequest, ...gax.CallOption) (*storagepb.Channel, error) + GetServiceAccount(context.Context, *storagepb.GetProjectServiceAccountRequest, ...gax.CallOption) (*storagepb.ServiceAccount, error) + CreateHmacKey(context.Context, *storagepb.CreateHmacKeyRequest, ...gax.CallOption) (*storagepb.CreateHmacKeyResponse, error) + DeleteHmacKey(context.Context, *storagepb.DeleteHmacKeyRequest, ...gax.CallOption) error + GetHmacKey(context.Context, *storagepb.GetHmacKeyRequest, ...gax.CallOption) (*storagepb.HmacKeyMetadata, error) + ListHmacKeys(context.Context, *storagepb.ListHmacKeysRequest, ...gax.CallOption) (*storagepb.ListHmacKeysResponse, error) + UpdateHmacKey(context.Context, *storagepb.UpdateHmacKeyRequest, ...gax.CallOption) (*storagepb.HmacKeyMetadata, error) +} + +// Client is a client for interacting with Cloud Storage API. +// Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls. +// +// Manages Google Cloud Storage resources. +type Client struct { + // The internal transport-dependent client. + internalClient internalClient + + // The call options for this service. + CallOptions *CallOptions +} + +// 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 *Client) 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 *Client) setGoogleClientInfo(keyval ...string) { + c.internalClient.setGoogleClientInfo(keyval...) +} + +// Connection returns a connection to the API service. +// +// Deprecated. +func (c *Client) Connection() *grpc.ClientConn { + return c.internalClient.Connection() +} + +// DeleteBucketAccessControl permanently deletes the ACL entry for the specified entity on the specified +// bucket. +func (c *Client) DeleteBucketAccessControl(ctx context.Context, req *storagepb.DeleteBucketAccessControlRequest, opts ...gax.CallOption) error { + return c.internalClient.DeleteBucketAccessControl(ctx, req, opts...) +} + +// GetBucketAccessControl returns the ACL entry for the specified entity on the specified bucket. +func (c *Client) GetBucketAccessControl(ctx context.Context, req *storagepb.GetBucketAccessControlRequest, opts ...gax.CallOption) (*storagepb.BucketAccessControl, error) { + return c.internalClient.GetBucketAccessControl(ctx, req, opts...) +} + +// InsertBucketAccessControl creates a new ACL entry on the specified bucket. +func (c *Client) InsertBucketAccessControl(ctx context.Context, req *storagepb.InsertBucketAccessControlRequest, opts ...gax.CallOption) (*storagepb.BucketAccessControl, error) { + return c.internalClient.InsertBucketAccessControl(ctx, req, opts...) +} + +// ListBucketAccessControls retrieves ACL entries on the specified bucket. +func (c *Client) ListBucketAccessControls(ctx context.Context, req *storagepb.ListBucketAccessControlsRequest, opts ...gax.CallOption) (*storagepb.ListBucketAccessControlsResponse, error) { + return c.internalClient.ListBucketAccessControls(ctx, req, opts...) +} + +// UpdateBucketAccessControl updates an ACL entry on the specified bucket. Equivalent to +// PatchBucketAccessControl, but all unspecified fields will be +// reset to their default values. +func (c *Client) UpdateBucketAccessControl(ctx context.Context, req *storagepb.UpdateBucketAccessControlRequest, opts ...gax.CallOption) (*storagepb.BucketAccessControl, error) { + return c.internalClient.UpdateBucketAccessControl(ctx, req, opts...) +} + +// PatchBucketAccessControl updates an ACL entry on the specified bucket. +func (c *Client) PatchBucketAccessControl(ctx context.Context, req *storagepb.PatchBucketAccessControlRequest, opts ...gax.CallOption) (*storagepb.BucketAccessControl, error) { + return c.internalClient.PatchBucketAccessControl(ctx, req, opts...) +} + +// DeleteBucket permanently deletes an empty bucket. +func (c *Client) DeleteBucket(ctx context.Context, req *storagepb.DeleteBucketRequest, opts ...gax.CallOption) error { + return c.internalClient.DeleteBucket(ctx, req, opts...) +} + +// GetBucket returns metadata for the specified bucket. +func (c *Client) GetBucket(ctx context.Context, req *storagepb.GetBucketRequest, opts ...gax.CallOption) (*storagepb.Bucket, error) { + return c.internalClient.GetBucket(ctx, req, opts...) +} + +// InsertBucket creates a new bucket. +func (c *Client) InsertBucket(ctx context.Context, req *storagepb.InsertBucketRequest, opts ...gax.CallOption) (*storagepb.Bucket, error) { + return c.internalClient.InsertBucket(ctx, req, opts...) +} + +// ListChannels list active object change notification channels for this bucket. +func (c *Client) ListChannels(ctx context.Context, req *storagepb.ListChannelsRequest, opts ...gax.CallOption) (*storagepb.ListChannelsResponse, error) { + return c.internalClient.ListChannels(ctx, req, opts...) +} + +// ListBuckets retrieves a list of buckets for a given project. +func (c *Client) ListBuckets(ctx context.Context, req *storagepb.ListBucketsRequest, opts ...gax.CallOption) (*storagepb.ListBucketsResponse, error) { + return c.internalClient.ListBuckets(ctx, req, opts...) +} + +// LockBucketRetentionPolicy locks retention policy on a bucket. +func (c *Client) LockBucketRetentionPolicy(ctx context.Context, req *storagepb.LockRetentionPolicyRequest, opts ...gax.CallOption) (*storagepb.Bucket, error) { + return c.internalClient.LockBucketRetentionPolicy(ctx, req, opts...) +} + +// GetBucketIamPolicy gets the IAM policy for the specified bucket. +func (c *Client) GetBucketIamPolicy(ctx context.Context, req *storagepb.GetIamPolicyRequest, opts ...gax.CallOption) (*iampb.Policy, error) { + return c.internalClient.GetBucketIamPolicy(ctx, req, opts...) +} + +// SetBucketIamPolicy updates an IAM policy for the specified bucket. +func (c *Client) SetBucketIamPolicy(ctx context.Context, req *storagepb.SetIamPolicyRequest, opts ...gax.CallOption) (*iampb.Policy, error) { + return c.internalClient.SetBucketIamPolicy(ctx, req, opts...) +} + +// TestBucketIamPermissions tests a set of permissions on the given bucket to see which, if +// any, are held by the caller. +func (c *Client) TestBucketIamPermissions(ctx context.Context, req *storagepb.TestIamPermissionsRequest, opts ...gax.CallOption) (*iampb.TestIamPermissionsResponse, error) { + return c.internalClient.TestBucketIamPermissions(ctx, req, opts...) +} + +// PatchBucket updates a bucket. Changes to the bucket will be readable immediately after +// writing, but configuration changes may take time to propagate. +func (c *Client) PatchBucket(ctx context.Context, req *storagepb.PatchBucketRequest, opts ...gax.CallOption) (*storagepb.Bucket, error) { + return c.internalClient.PatchBucket(ctx, req, opts...) +} + +// UpdateBucket updates a bucket. Equivalent to PatchBucket, but always replaces all +// mutatable fields of the bucket with new values, reverting all +// unspecified fields to their default values. +// Like PatchBucket, Changes to the bucket will be readable immediately after +// writing, but configuration changes may take time to propagate. +func (c *Client) UpdateBucket(ctx context.Context, req *storagepb.UpdateBucketRequest, opts ...gax.CallOption) (*storagepb.Bucket, error) { + return c.internalClient.UpdateBucket(ctx, req, opts...) +} + +// StopChannel halts “Object Change Notification” push messagages. +// See https://cloud.google.com/storage/docs/object-change-notification (at https://cloud.google.com/storage/docs/object-change-notification) +// Note: this is not related to the newer “Notifications” resource, which +// are stopped using DeleteNotification. +func (c *Client) StopChannel(ctx context.Context, req *storagepb.StopChannelRequest, opts ...gax.CallOption) error { + return c.internalClient.StopChannel(ctx, req, opts...) +} + +// DeleteDefaultObjectAccessControl permanently deletes the default object ACL entry for the specified entity +// on the specified bucket. +func (c *Client) DeleteDefaultObjectAccessControl(ctx context.Context, req *storagepb.DeleteDefaultObjectAccessControlRequest, opts ...gax.CallOption) error { + return c.internalClient.DeleteDefaultObjectAccessControl(ctx, req, opts...) +} + +// GetDefaultObjectAccessControl returns the default object ACL entry for the specified entity on the +// specified bucket. +func (c *Client) GetDefaultObjectAccessControl(ctx context.Context, req *storagepb.GetDefaultObjectAccessControlRequest, opts ...gax.CallOption) (*storagepb.ObjectAccessControl, error) { + return c.internalClient.GetDefaultObjectAccessControl(ctx, req, opts...) +} + +// InsertDefaultObjectAccessControl creates a new default object ACL entry on the specified bucket. +func (c *Client) InsertDefaultObjectAccessControl(ctx context.Context, req *storagepb.InsertDefaultObjectAccessControlRequest, opts ...gax.CallOption) (*storagepb.ObjectAccessControl, error) { + return c.internalClient.InsertDefaultObjectAccessControl(ctx, req, opts...) +} + +// ListDefaultObjectAccessControls retrieves default object ACL entries on the specified bucket. +func (c *Client) ListDefaultObjectAccessControls(ctx context.Context, req *storagepb.ListDefaultObjectAccessControlsRequest, opts ...gax.CallOption) (*storagepb.ListObjectAccessControlsResponse, error) { + return c.internalClient.ListDefaultObjectAccessControls(ctx, req, opts...) +} + +// PatchDefaultObjectAccessControl updates a default object ACL entry on the specified bucket. +func (c *Client) PatchDefaultObjectAccessControl(ctx context.Context, req *storagepb.PatchDefaultObjectAccessControlRequest, opts ...gax.CallOption) (*storagepb.ObjectAccessControl, error) { + return c.internalClient.PatchDefaultObjectAccessControl(ctx, req, opts...) +} + +// UpdateDefaultObjectAccessControl updates a default object ACL entry on the specified bucket. Equivalent to +// PatchDefaultObjectAccessControl, but modifies all unspecified fields to +// their default values. +func (c *Client) UpdateDefaultObjectAccessControl(ctx context.Context, req *storagepb.UpdateDefaultObjectAccessControlRequest, opts ...gax.CallOption) (*storagepb.ObjectAccessControl, error) { + return c.internalClient.UpdateDefaultObjectAccessControl(ctx, req, opts...) +} + +// DeleteNotification permanently deletes a notification subscription. +// Note: Older, “Object Change Notification” push subscriptions should be +// deleted using StopChannel instead. +func (c *Client) DeleteNotification(ctx context.Context, req *storagepb.DeleteNotificationRequest, opts ...gax.CallOption) error { + return c.internalClient.DeleteNotification(ctx, req, opts...) +} + +// GetNotification view a notification configuration. +func (c *Client) GetNotification(ctx context.Context, req *storagepb.GetNotificationRequest, opts ...gax.CallOption) (*storagepb.Notification, error) { + return c.internalClient.GetNotification(ctx, req, opts...) +} + +// InsertNotification creates a notification subscription for a given bucket. +// These notifications, when triggered, publish messages to the specified +// Cloud Pub/Sub topics. +// See https://cloud.google.com/storage/docs/pubsub-notifications (at https://cloud.google.com/storage/docs/pubsub-notifications). +func (c *Client) InsertNotification(ctx context.Context, req *storagepb.InsertNotificationRequest, opts ...gax.CallOption) (*storagepb.Notification, error) { + return c.internalClient.InsertNotification(ctx, req, opts...) +} + +// ListNotifications retrieves a list of notification subscriptions for a given bucket. +func (c *Client) ListNotifications(ctx context.Context, req *storagepb.ListNotificationsRequest, opts ...gax.CallOption) (*storagepb.ListNotificationsResponse, error) { + return c.internalClient.ListNotifications(ctx, req, opts...) +} + +// DeleteObjectAccessControl permanently deletes the ACL entry for the specified entity on the specified +// object. +func (c *Client) DeleteObjectAccessControl(ctx context.Context, req *storagepb.DeleteObjectAccessControlRequest, opts ...gax.CallOption) error { + return c.internalClient.DeleteObjectAccessControl(ctx, req, opts...) +} + +// GetObjectAccessControl returns the ACL entry for the specified entity on the specified object. +func (c *Client) GetObjectAccessControl(ctx context.Context, req *storagepb.GetObjectAccessControlRequest, opts ...gax.CallOption) (*storagepb.ObjectAccessControl, error) { + return c.internalClient.GetObjectAccessControl(ctx, req, opts...) +} + +// InsertObjectAccessControl creates a new ACL entry on the specified object. +func (c *Client) InsertObjectAccessControl(ctx context.Context, req *storagepb.InsertObjectAccessControlRequest, opts ...gax.CallOption) (*storagepb.ObjectAccessControl, error) { + return c.internalClient.InsertObjectAccessControl(ctx, req, opts...) +} + +// ListObjectAccessControls retrieves ACL entries on the specified object. +func (c *Client) ListObjectAccessControls(ctx context.Context, req *storagepb.ListObjectAccessControlsRequest, opts ...gax.CallOption) (*storagepb.ListObjectAccessControlsResponse, error) { + return c.internalClient.ListObjectAccessControls(ctx, req, opts...) +} + +// PatchObjectAccessControl patches an ACL entry on the specified object. Patch is similar to update, +// but only applies or appends the specified fields in the +// object_access_control object. Other fields are unaffected. +func (c *Client) PatchObjectAccessControl(ctx context.Context, req *storagepb.PatchObjectAccessControlRequest, opts ...gax.CallOption) (*storagepb.ObjectAccessControl, error) { + return c.internalClient.PatchObjectAccessControl(ctx, req, opts...) +} + +// UpdateObjectAccessControl updates an ACL entry on the specified object. +func (c *Client) UpdateObjectAccessControl(ctx context.Context, req *storagepb.UpdateObjectAccessControlRequest, opts ...gax.CallOption) (*storagepb.ObjectAccessControl, error) { + return c.internalClient.UpdateObjectAccessControl(ctx, req, opts...) +} + +// ComposeObject concatenates a list of existing objects into a new object in the same +// bucket. +func (c *Client) ComposeObject(ctx context.Context, req *storagepb.ComposeObjectRequest, opts ...gax.CallOption) (*storagepb.Object, error) { + return c.internalClient.ComposeObject(ctx, req, opts...) +} + +// CopyObject copies a source object to a destination object. Optionally overrides +// metadata. +func (c *Client) CopyObject(ctx context.Context, req *storagepb.CopyObjectRequest, opts ...gax.CallOption) (*storagepb.Object, error) { + return c.internalClient.CopyObject(ctx, req, opts...) +} + +// DeleteObject deletes an object and its metadata. Deletions are permanent if versioning +// is not enabled for the bucket, or if the generation parameter +// is used. +func (c *Client) DeleteObject(ctx context.Context, req *storagepb.DeleteObjectRequest, opts ...gax.CallOption) error { + return c.internalClient.DeleteObject(ctx, req, opts...) +} + +// GetObject retrieves an object’s metadata. +func (c *Client) GetObject(ctx context.Context, req *storagepb.GetObjectRequest, opts ...gax.CallOption) (*storagepb.Object, error) { + return c.internalClient.GetObject(ctx, req, opts...) +} + +// GetObjectMedia reads an object’s data. +func (c *Client) GetObjectMedia(ctx context.Context, req *storagepb.GetObjectMediaRequest, opts ...gax.CallOption) (storagepb.Storage_GetObjectMediaClient, error) { + return c.internalClient.GetObjectMedia(ctx, req, opts...) +} + +// InsertObject stores a new object and metadata. +// +// An object can be written either in a single message stream or in a +// resumable sequence of message streams. To write using a single stream, +// the client should include in the first message of the stream an +// InsertObjectSpec describing the destination bucket, object, and any +// preconditions. Additionally, the final message must set ‘finish_write’ to +// true, or else it is an error. +// +// For a resumable write, the client should instead call +// StartResumableWrite() and provide that method an InsertObjectSpec. +// They should then attach the returned upload_id to the first message of +// each following call to Insert. If there is an error or the connection is +// broken during the resumable Insert(), the client should check the status +// of the Insert() by calling QueryWriteStatus() and continue writing from +// the returned committed_size. This may be less than the amount of data the +// client previously sent. +// +// The service will not view the object as complete until the client has +// sent an Insert with finish_write set to true. Sending any +// requests on a stream after sending a request with finish_write set to +// true will cause an error. The client should check the +// Object it receives to determine how much data the service was +// able to commit and whether the service views the object as complete. +func (c *Client) InsertObject(ctx context.Context, opts ...gax.CallOption) (storagepb.Storage_InsertObjectClient, error) { + return c.internalClient.InsertObject(ctx, opts...) +} + +// ListObjects retrieves a list of objects matching the criteria. +func (c *Client) ListObjects(ctx context.Context, req *storagepb.ListObjectsRequest, opts ...gax.CallOption) (*storagepb.ListObjectsResponse, error) { + return c.internalClient.ListObjects(ctx, req, opts...) +} + +// RewriteObject rewrites a source object to a destination object. Optionally overrides +// metadata. +func (c *Client) RewriteObject(ctx context.Context, req *storagepb.RewriteObjectRequest, opts ...gax.CallOption) (*storagepb.RewriteResponse, error) { + return c.internalClient.RewriteObject(ctx, req, opts...) +} + +// StartResumableWrite starts a resumable write. How long the write operation remains valid, and +// what happens when the write operation becomes invalid, are +// service-dependent. +func (c *Client) StartResumableWrite(ctx context.Context, req *storagepb.StartResumableWriteRequest, opts ...gax.CallOption) (*storagepb.StartResumableWriteResponse, error) { + return c.internalClient.StartResumableWrite(ctx, req, opts...) +} + +// QueryWriteStatus determines the committed_size for an object that is being written, which +// can then be used as the write_offset for the next Write() call. +// +// If the object does not exist (i.e., the object has been deleted, or the +// first Write() has not yet reached the service), this method returns the +// error NOT_FOUND. +// +// The client may call QueryWriteStatus() at any time to determine how +// much data has been processed for this object. This is useful if the +// client is buffering data and needs to know which data can be safely +// evicted. For any sequence of QueryWriteStatus() calls for a given +// object name, the sequence of returned committed_size values will be +// non-decreasing. +func (c *Client) QueryWriteStatus(ctx context.Context, req *storagepb.QueryWriteStatusRequest, opts ...gax.CallOption) (*storagepb.QueryWriteStatusResponse, error) { + return c.internalClient.QueryWriteStatus(ctx, req, opts...) +} + +// PatchObject updates an object’s metadata. +func (c *Client) PatchObject(ctx context.Context, req *storagepb.PatchObjectRequest, opts ...gax.CallOption) (*storagepb.Object, error) { + return c.internalClient.PatchObject(ctx, req, opts...) +} + +// UpdateObject updates an object’s metadata. Equivalent to PatchObject, but always +// replaces all mutatable fields of the bucket with new values, reverting all +// unspecified fields to their default values. +func (c *Client) UpdateObject(ctx context.Context, req *storagepb.UpdateObjectRequest, opts ...gax.CallOption) (*storagepb.Object, error) { + return c.internalClient.UpdateObject(ctx, req, opts...) +} + +// GetObjectIamPolicy gets the IAM policy for the specified object. +func (c *Client) GetObjectIamPolicy(ctx context.Context, req *storagepb.GetIamPolicyRequest, opts ...gax.CallOption) (*iampb.Policy, error) { + return c.internalClient.GetObjectIamPolicy(ctx, req, opts...) +} + +// SetObjectIamPolicy updates an IAM policy for the specified object. +func (c *Client) SetObjectIamPolicy(ctx context.Context, req *storagepb.SetIamPolicyRequest, opts ...gax.CallOption) (*iampb.Policy, error) { + return c.internalClient.SetObjectIamPolicy(ctx, req, opts...) +} + +// TestObjectIamPermissions tests a set of permissions on the given object to see which, if +// any, are held by the caller. +func (c *Client) TestObjectIamPermissions(ctx context.Context, req *storagepb.TestIamPermissionsRequest, opts ...gax.CallOption) (*iampb.TestIamPermissionsResponse, error) { + return c.internalClient.TestObjectIamPermissions(ctx, req, opts...) +} + +// WatchAllObjects watch for changes on all objects in a bucket. +func (c *Client) WatchAllObjects(ctx context.Context, req *storagepb.WatchAllObjectsRequest, opts ...gax.CallOption) (*storagepb.Channel, error) { + return c.internalClient.WatchAllObjects(ctx, req, opts...) +} + +// GetServiceAccount retrieves the name of a project’s Google Cloud Storage service account. +func (c *Client) GetServiceAccount(ctx context.Context, req *storagepb.GetProjectServiceAccountRequest, opts ...gax.CallOption) (*storagepb.ServiceAccount, error) { + return c.internalClient.GetServiceAccount(ctx, req, opts...) +} + +// CreateHmacKey creates a new HMAC key for the given service account. +func (c *Client) CreateHmacKey(ctx context.Context, req *storagepb.CreateHmacKeyRequest, opts ...gax.CallOption) (*storagepb.CreateHmacKeyResponse, error) { + return c.internalClient.CreateHmacKey(ctx, req, opts...) +} + +// DeleteHmacKey deletes a given HMAC key. Key must be in an INACTIVE state. +func (c *Client) DeleteHmacKey(ctx context.Context, req *storagepb.DeleteHmacKeyRequest, opts ...gax.CallOption) error { + return c.internalClient.DeleteHmacKey(ctx, req, opts...) +} + +// GetHmacKey gets an existing HMAC key metadata for the given id. +func (c *Client) GetHmacKey(ctx context.Context, req *storagepb.GetHmacKeyRequest, opts ...gax.CallOption) (*storagepb.HmacKeyMetadata, error) { + return c.internalClient.GetHmacKey(ctx, req, opts...) +} + +// ListHmacKeys lists HMAC keys under a given project with the additional filters provided. +func (c *Client) ListHmacKeys(ctx context.Context, req *storagepb.ListHmacKeysRequest, opts ...gax.CallOption) (*storagepb.ListHmacKeysResponse, error) { + return c.internalClient.ListHmacKeys(ctx, req, opts...) +} + +// UpdateHmacKey updates a given HMAC key state between ACTIVE and INACTIVE. +func (c *Client) UpdateHmacKey(ctx context.Context, req *storagepb.UpdateHmacKeyRequest, opts ...gax.CallOption) (*storagepb.HmacKeyMetadata, error) { + return c.internalClient.UpdateHmacKey(ctx, req, opts...) +} + +// gRPCClient is a client for interacting with Cloud Storage API over gRPC transport. +// +// Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls. +type gRPCClient struct { + // Connection pool of gRPC connections to the service. + connPool gtransport.ConnPool + + // flag to opt out of default deadlines via GOOGLE_API_GO_EXPERIMENTAL_DISABLE_DEFAULT_DEADLINE + disableDeadlines bool + + // Points back to the CallOptions field of the containing Client + CallOptions **CallOptions + + // The gRPC API client. + client storagepb.StorageClient + + // The x-goog-* metadata to be sent with each request. + xGoogMetadata metadata.MD +} + +// NewClient creates a new storage client based on gRPC. +// The returned client must be Closed when it is done being used to clean up its underlying connections. +// +// Manages Google Cloud Storage resources. +func NewClient(ctx context.Context, opts ...option.ClientOption) (*Client, error) { + clientOpts := defaultGRPCClientOptions() + if newClientHook != nil { + hookOpts, err := newClientHook(ctx, clientHookParams{}) + if err != nil { + return nil, err + } + clientOpts = append(clientOpts, hookOpts...) + } + + disableDeadlines, err := checkDisableDeadlines() + if err != nil { + return nil, err + } + + connPool, err := gtransport.DialPool(ctx, append(clientOpts, opts...)...) + if err != nil { + return nil, err + } + client := Client{CallOptions: defaultCallOptions()} + + c := &gRPCClient{ + connPool: connPool, + disableDeadlines: disableDeadlines, + client: storagepb.NewStorageClient(connPool), + CallOptions: &client.CallOptions, + } + c.setGoogleClientInfo() + + client.internalClient = c + + return &client, nil +} + +// Connection returns a connection to the API service. +// +// Deprecated. +func (c *gRPCClient) Connection() *grpc.ClientConn { + return c.connPool.Conn() +} + +// 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 *gRPCClient) setGoogleClientInfo(keyval ...string) { + kv := append([]string{"gl-go", versionGo()}, keyval...) + kv = append(kv, "gapic", versionClient, "gax", gax.Version, "grpc", grpc.Version) + c.xGoogMetadata = metadata.Pairs("x-goog-api-client", gax.XGoogHeader(kv...)) +} + +// Close closes the connection to the API service. The user should invoke this when +// the client is no longer required. +func (c *gRPCClient) Close() error { + return c.connPool.Close() +} + +func (c *gRPCClient) DeleteBucketAccessControl(ctx context.Context, req *storagepb.DeleteBucketAccessControlRequest, opts ...gax.CallOption) error { + if _, ok := ctx.Deadline(); !ok && !c.disableDeadlines { + cctx, cancel := context.WithTimeout(ctx, 60000*time.Millisecond) + defer cancel() + ctx = cctx + } + ctx = insertMetadata(ctx, c.xGoogMetadata) + opts = append((*c.CallOptions).DeleteBucketAccessControl[0:len((*c.CallOptions).DeleteBucketAccessControl):len((*c.CallOptions).DeleteBucketAccessControl)], opts...) + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + _, err = c.client.DeleteBucketAccessControl(ctx, req, settings.GRPC...) + return err + }, opts...) + return err +} + +func (c *gRPCClient) GetBucketAccessControl(ctx context.Context, req *storagepb.GetBucketAccessControlRequest, opts ...gax.CallOption) (*storagepb.BucketAccessControl, error) { + if _, ok := ctx.Deadline(); !ok && !c.disableDeadlines { + cctx, cancel := context.WithTimeout(ctx, 60000*time.Millisecond) + defer cancel() + ctx = cctx + } + ctx = insertMetadata(ctx, c.xGoogMetadata) + opts = append((*c.CallOptions).GetBucketAccessControl[0:len((*c.CallOptions).GetBucketAccessControl):len((*c.CallOptions).GetBucketAccessControl)], opts...) + var resp *storagepb.BucketAccessControl + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + resp, err = c.client.GetBucketAccessControl(ctx, req, settings.GRPC...) + return err + }, opts...) + if err != nil { + return nil, err + } + return resp, nil +} + +func (c *gRPCClient) InsertBucketAccessControl(ctx context.Context, req *storagepb.InsertBucketAccessControlRequest, opts ...gax.CallOption) (*storagepb.BucketAccessControl, error) { + if _, ok := ctx.Deadline(); !ok && !c.disableDeadlines { + cctx, cancel := context.WithTimeout(ctx, 60000*time.Millisecond) + defer cancel() + ctx = cctx + } + ctx = insertMetadata(ctx, c.xGoogMetadata) + opts = append((*c.CallOptions).InsertBucketAccessControl[0:len((*c.CallOptions).InsertBucketAccessControl):len((*c.CallOptions).InsertBucketAccessControl)], opts...) + var resp *storagepb.BucketAccessControl + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + resp, err = c.client.InsertBucketAccessControl(ctx, req, settings.GRPC...) + return err + }, opts...) + if err != nil { + return nil, err + } + return resp, nil +} + +func (c *gRPCClient) ListBucketAccessControls(ctx context.Context, req *storagepb.ListBucketAccessControlsRequest, opts ...gax.CallOption) (*storagepb.ListBucketAccessControlsResponse, error) { + if _, ok := ctx.Deadline(); !ok && !c.disableDeadlines { + cctx, cancel := context.WithTimeout(ctx, 60000*time.Millisecond) + defer cancel() + ctx = cctx + } + ctx = insertMetadata(ctx, c.xGoogMetadata) + opts = append((*c.CallOptions).ListBucketAccessControls[0:len((*c.CallOptions).ListBucketAccessControls):len((*c.CallOptions).ListBucketAccessControls)], opts...) + var resp *storagepb.ListBucketAccessControlsResponse + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + resp, err = c.client.ListBucketAccessControls(ctx, req, settings.GRPC...) + return err + }, opts...) + if err != nil { + return nil, err + } + return resp, nil +} + +func (c *gRPCClient) UpdateBucketAccessControl(ctx context.Context, req *storagepb.UpdateBucketAccessControlRequest, opts ...gax.CallOption) (*storagepb.BucketAccessControl, error) { + if _, ok := ctx.Deadline(); !ok && !c.disableDeadlines { + cctx, cancel := context.WithTimeout(ctx, 60000*time.Millisecond) + defer cancel() + ctx = cctx + } + ctx = insertMetadata(ctx, c.xGoogMetadata) + opts = append((*c.CallOptions).UpdateBucketAccessControl[0:len((*c.CallOptions).UpdateBucketAccessControl):len((*c.CallOptions).UpdateBucketAccessControl)], opts...) + var resp *storagepb.BucketAccessControl + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + resp, err = c.client.UpdateBucketAccessControl(ctx, req, settings.GRPC...) + return err + }, opts...) + if err != nil { + return nil, err + } + return resp, nil +} + +func (c *gRPCClient) PatchBucketAccessControl(ctx context.Context, req *storagepb.PatchBucketAccessControlRequest, opts ...gax.CallOption) (*storagepb.BucketAccessControl, error) { + if _, ok := ctx.Deadline(); !ok && !c.disableDeadlines { + cctx, cancel := context.WithTimeout(ctx, 60000*time.Millisecond) + defer cancel() + ctx = cctx + } + ctx = insertMetadata(ctx, c.xGoogMetadata) + opts = append((*c.CallOptions).PatchBucketAccessControl[0:len((*c.CallOptions).PatchBucketAccessControl):len((*c.CallOptions).PatchBucketAccessControl)], opts...) + var resp *storagepb.BucketAccessControl + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + resp, err = c.client.PatchBucketAccessControl(ctx, req, settings.GRPC...) + return err + }, opts...) + if err != nil { + return nil, err + } + return resp, nil +} + +func (c *gRPCClient) DeleteBucket(ctx context.Context, req *storagepb.DeleteBucketRequest, opts ...gax.CallOption) error { + if _, ok := ctx.Deadline(); !ok && !c.disableDeadlines { + cctx, cancel := context.WithTimeout(ctx, 60000*time.Millisecond) + defer cancel() + ctx = cctx + } + ctx = insertMetadata(ctx, c.xGoogMetadata) + opts = append((*c.CallOptions).DeleteBucket[0:len((*c.CallOptions).DeleteBucket):len((*c.CallOptions).DeleteBucket)], opts...) + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + _, err = c.client.DeleteBucket(ctx, req, settings.GRPC...) + return err + }, opts...) + return err +} + +func (c *gRPCClient) GetBucket(ctx context.Context, req *storagepb.GetBucketRequest, opts ...gax.CallOption) (*storagepb.Bucket, error) { + if _, ok := ctx.Deadline(); !ok && !c.disableDeadlines { + cctx, cancel := context.WithTimeout(ctx, 60000*time.Millisecond) + defer cancel() + ctx = cctx + } + ctx = insertMetadata(ctx, c.xGoogMetadata) + opts = append((*c.CallOptions).GetBucket[0:len((*c.CallOptions).GetBucket):len((*c.CallOptions).GetBucket)], opts...) + var resp *storagepb.Bucket + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + resp, err = c.client.GetBucket(ctx, req, settings.GRPC...) + return err + }, opts...) + if err != nil { + return nil, err + } + return resp, nil +} + +func (c *gRPCClient) InsertBucket(ctx context.Context, req *storagepb.InsertBucketRequest, opts ...gax.CallOption) (*storagepb.Bucket, error) { + if _, ok := ctx.Deadline(); !ok && !c.disableDeadlines { + cctx, cancel := context.WithTimeout(ctx, 60000*time.Millisecond) + defer cancel() + ctx = cctx + } + ctx = insertMetadata(ctx, c.xGoogMetadata) + opts = append((*c.CallOptions).InsertBucket[0:len((*c.CallOptions).InsertBucket):len((*c.CallOptions).InsertBucket)], opts...) + var resp *storagepb.Bucket + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + resp, err = c.client.InsertBucket(ctx, req, settings.GRPC...) + return err + }, opts...) + if err != nil { + return nil, err + } + return resp, nil +} + +func (c *gRPCClient) ListChannels(ctx context.Context, req *storagepb.ListChannelsRequest, opts ...gax.CallOption) (*storagepb.ListChannelsResponse, error) { + if _, ok := ctx.Deadline(); !ok && !c.disableDeadlines { + cctx, cancel := context.WithTimeout(ctx, 60000*time.Millisecond) + defer cancel() + ctx = cctx + } + ctx = insertMetadata(ctx, c.xGoogMetadata) + opts = append((*c.CallOptions).ListChannels[0:len((*c.CallOptions).ListChannels):len((*c.CallOptions).ListChannels)], opts...) + var resp *storagepb.ListChannelsResponse + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + resp, err = c.client.ListChannels(ctx, req, settings.GRPC...) + return err + }, opts...) + if err != nil { + return nil, err + } + return resp, nil +} + +func (c *gRPCClient) ListBuckets(ctx context.Context, req *storagepb.ListBucketsRequest, opts ...gax.CallOption) (*storagepb.ListBucketsResponse, error) { + if _, ok := ctx.Deadline(); !ok && !c.disableDeadlines { + cctx, cancel := context.WithTimeout(ctx, 60000*time.Millisecond) + defer cancel() + ctx = cctx + } + ctx = insertMetadata(ctx, c.xGoogMetadata) + opts = append((*c.CallOptions).ListBuckets[0:len((*c.CallOptions).ListBuckets):len((*c.CallOptions).ListBuckets)], opts...) + var resp *storagepb.ListBucketsResponse + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + resp, err = c.client.ListBuckets(ctx, req, settings.GRPC...) + return err + }, opts...) + if err != nil { + return nil, err + } + return resp, nil +} + +func (c *gRPCClient) LockBucketRetentionPolicy(ctx context.Context, req *storagepb.LockRetentionPolicyRequest, opts ...gax.CallOption) (*storagepb.Bucket, error) { + if _, ok := ctx.Deadline(); !ok && !c.disableDeadlines { + cctx, cancel := context.WithTimeout(ctx, 60000*time.Millisecond) + defer cancel() + ctx = cctx + } + ctx = insertMetadata(ctx, c.xGoogMetadata) + opts = append((*c.CallOptions).LockBucketRetentionPolicy[0:len((*c.CallOptions).LockBucketRetentionPolicy):len((*c.CallOptions).LockBucketRetentionPolicy)], opts...) + var resp *storagepb.Bucket + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + resp, err = c.client.LockBucketRetentionPolicy(ctx, req, settings.GRPC...) + return err + }, opts...) + if err != nil { + return nil, err + } + return resp, nil +} + +func (c *gRPCClient) GetBucketIamPolicy(ctx context.Context, req *storagepb.GetIamPolicyRequest, opts ...gax.CallOption) (*iampb.Policy, error) { + if _, ok := ctx.Deadline(); !ok && !c.disableDeadlines { + cctx, cancel := context.WithTimeout(ctx, 60000*time.Millisecond) + defer cancel() + ctx = cctx + } + ctx = insertMetadata(ctx, c.xGoogMetadata) + opts = append((*c.CallOptions).GetBucketIamPolicy[0:len((*c.CallOptions).GetBucketIamPolicy):len((*c.CallOptions).GetBucketIamPolicy)], opts...) + var resp *iampb.Policy + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + resp, err = c.client.GetBucketIamPolicy(ctx, req, settings.GRPC...) + return err + }, opts...) + if err != nil { + return nil, err + } + return resp, nil +} + +func (c *gRPCClient) SetBucketIamPolicy(ctx context.Context, req *storagepb.SetIamPolicyRequest, opts ...gax.CallOption) (*iampb.Policy, error) { + if _, ok := ctx.Deadline(); !ok && !c.disableDeadlines { + cctx, cancel := context.WithTimeout(ctx, 60000*time.Millisecond) + defer cancel() + ctx = cctx + } + ctx = insertMetadata(ctx, c.xGoogMetadata) + opts = append((*c.CallOptions).SetBucketIamPolicy[0:len((*c.CallOptions).SetBucketIamPolicy):len((*c.CallOptions).SetBucketIamPolicy)], opts...) + var resp *iampb.Policy + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + resp, err = c.client.SetBucketIamPolicy(ctx, req, settings.GRPC...) + return err + }, opts...) + if err != nil { + return nil, err + } + return resp, nil +} + +func (c *gRPCClient) TestBucketIamPermissions(ctx context.Context, req *storagepb.TestIamPermissionsRequest, opts ...gax.CallOption) (*iampb.TestIamPermissionsResponse, error) { + if _, ok := ctx.Deadline(); !ok && !c.disableDeadlines { + cctx, cancel := context.WithTimeout(ctx, 60000*time.Millisecond) + defer cancel() + ctx = cctx + } + ctx = insertMetadata(ctx, c.xGoogMetadata) + opts = append((*c.CallOptions).TestBucketIamPermissions[0:len((*c.CallOptions).TestBucketIamPermissions):len((*c.CallOptions).TestBucketIamPermissions)], opts...) + var resp *iampb.TestIamPermissionsResponse + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + resp, err = c.client.TestBucketIamPermissions(ctx, req, settings.GRPC...) + return err + }, opts...) + if err != nil { + return nil, err + } + return resp, nil +} + +func (c *gRPCClient) PatchBucket(ctx context.Context, req *storagepb.PatchBucketRequest, opts ...gax.CallOption) (*storagepb.Bucket, error) { + if _, ok := ctx.Deadline(); !ok && !c.disableDeadlines { + cctx, cancel := context.WithTimeout(ctx, 60000*time.Millisecond) + defer cancel() + ctx = cctx + } + ctx = insertMetadata(ctx, c.xGoogMetadata) + opts = append((*c.CallOptions).PatchBucket[0:len((*c.CallOptions).PatchBucket):len((*c.CallOptions).PatchBucket)], opts...) + var resp *storagepb.Bucket + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + resp, err = c.client.PatchBucket(ctx, req, settings.GRPC...) + return err + }, opts...) + if err != nil { + return nil, err + } + return resp, nil +} + +func (c *gRPCClient) UpdateBucket(ctx context.Context, req *storagepb.UpdateBucketRequest, opts ...gax.CallOption) (*storagepb.Bucket, error) { + if _, ok := ctx.Deadline(); !ok && !c.disableDeadlines { + cctx, cancel := context.WithTimeout(ctx, 60000*time.Millisecond) + defer cancel() + ctx = cctx + } + ctx = insertMetadata(ctx, c.xGoogMetadata) + opts = append((*c.CallOptions).UpdateBucket[0:len((*c.CallOptions).UpdateBucket):len((*c.CallOptions).UpdateBucket)], opts...) + var resp *storagepb.Bucket + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + resp, err = c.client.UpdateBucket(ctx, req, settings.GRPC...) + return err + }, opts...) + if err != nil { + return nil, err + } + return resp, nil +} + +func (c *gRPCClient) StopChannel(ctx context.Context, req *storagepb.StopChannelRequest, opts ...gax.CallOption) error { + if _, ok := ctx.Deadline(); !ok && !c.disableDeadlines { + cctx, cancel := context.WithTimeout(ctx, 60000*time.Millisecond) + defer cancel() + ctx = cctx + } + ctx = insertMetadata(ctx, c.xGoogMetadata) + opts = append((*c.CallOptions).StopChannel[0:len((*c.CallOptions).StopChannel):len((*c.CallOptions).StopChannel)], opts...) + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + _, err = c.client.StopChannel(ctx, req, settings.GRPC...) + return err + }, opts...) + return err +} + +func (c *gRPCClient) DeleteDefaultObjectAccessControl(ctx context.Context, req *storagepb.DeleteDefaultObjectAccessControlRequest, opts ...gax.CallOption) error { + if _, ok := ctx.Deadline(); !ok && !c.disableDeadlines { + cctx, cancel := context.WithTimeout(ctx, 60000*time.Millisecond) + defer cancel() + ctx = cctx + } + ctx = insertMetadata(ctx, c.xGoogMetadata) + opts = append((*c.CallOptions).DeleteDefaultObjectAccessControl[0:len((*c.CallOptions).DeleteDefaultObjectAccessControl):len((*c.CallOptions).DeleteDefaultObjectAccessControl)], opts...) + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + _, err = c.client.DeleteDefaultObjectAccessControl(ctx, req, settings.GRPC...) + return err + }, opts...) + return err +} + +func (c *gRPCClient) GetDefaultObjectAccessControl(ctx context.Context, req *storagepb.GetDefaultObjectAccessControlRequest, opts ...gax.CallOption) (*storagepb.ObjectAccessControl, error) { + if _, ok := ctx.Deadline(); !ok && !c.disableDeadlines { + cctx, cancel := context.WithTimeout(ctx, 60000*time.Millisecond) + defer cancel() + ctx = cctx + } + ctx = insertMetadata(ctx, c.xGoogMetadata) + opts = append((*c.CallOptions).GetDefaultObjectAccessControl[0:len((*c.CallOptions).GetDefaultObjectAccessControl):len((*c.CallOptions).GetDefaultObjectAccessControl)], opts...) + var resp *storagepb.ObjectAccessControl + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + resp, err = c.client.GetDefaultObjectAccessControl(ctx, req, settings.GRPC...) + return err + }, opts...) + if err != nil { + return nil, err + } + return resp, nil +} + +func (c *gRPCClient) InsertDefaultObjectAccessControl(ctx context.Context, req *storagepb.InsertDefaultObjectAccessControlRequest, opts ...gax.CallOption) (*storagepb.ObjectAccessControl, error) { + if _, ok := ctx.Deadline(); !ok && !c.disableDeadlines { + cctx, cancel := context.WithTimeout(ctx, 60000*time.Millisecond) + defer cancel() + ctx = cctx + } + ctx = insertMetadata(ctx, c.xGoogMetadata) + opts = append((*c.CallOptions).InsertDefaultObjectAccessControl[0:len((*c.CallOptions).InsertDefaultObjectAccessControl):len((*c.CallOptions).InsertDefaultObjectAccessControl)], opts...) + var resp *storagepb.ObjectAccessControl + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + resp, err = c.client.InsertDefaultObjectAccessControl(ctx, req, settings.GRPC...) + return err + }, opts...) + if err != nil { + return nil, err + } + return resp, nil +} + +func (c *gRPCClient) ListDefaultObjectAccessControls(ctx context.Context, req *storagepb.ListDefaultObjectAccessControlsRequest, opts ...gax.CallOption) (*storagepb.ListObjectAccessControlsResponse, error) { + if _, ok := ctx.Deadline(); !ok && !c.disableDeadlines { + cctx, cancel := context.WithTimeout(ctx, 60000*time.Millisecond) + defer cancel() + ctx = cctx + } + ctx = insertMetadata(ctx, c.xGoogMetadata) + opts = append((*c.CallOptions).ListDefaultObjectAccessControls[0:len((*c.CallOptions).ListDefaultObjectAccessControls):len((*c.CallOptions).ListDefaultObjectAccessControls)], opts...) + var resp *storagepb.ListObjectAccessControlsResponse + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + resp, err = c.client.ListDefaultObjectAccessControls(ctx, req, settings.GRPC...) + return err + }, opts...) + if err != nil { + return nil, err + } + return resp, nil +} + +func (c *gRPCClient) PatchDefaultObjectAccessControl(ctx context.Context, req *storagepb.PatchDefaultObjectAccessControlRequest, opts ...gax.CallOption) (*storagepb.ObjectAccessControl, error) { + if _, ok := ctx.Deadline(); !ok && !c.disableDeadlines { + cctx, cancel := context.WithTimeout(ctx, 60000*time.Millisecond) + defer cancel() + ctx = cctx + } + ctx = insertMetadata(ctx, c.xGoogMetadata) + opts = append((*c.CallOptions).PatchDefaultObjectAccessControl[0:len((*c.CallOptions).PatchDefaultObjectAccessControl):len((*c.CallOptions).PatchDefaultObjectAccessControl)], opts...) + var resp *storagepb.ObjectAccessControl + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + resp, err = c.client.PatchDefaultObjectAccessControl(ctx, req, settings.GRPC...) + return err + }, opts...) + if err != nil { + return nil, err + } + return resp, nil +} + +func (c *gRPCClient) UpdateDefaultObjectAccessControl(ctx context.Context, req *storagepb.UpdateDefaultObjectAccessControlRequest, opts ...gax.CallOption) (*storagepb.ObjectAccessControl, error) { + if _, ok := ctx.Deadline(); !ok && !c.disableDeadlines { + cctx, cancel := context.WithTimeout(ctx, 60000*time.Millisecond) + defer cancel() + ctx = cctx + } + ctx = insertMetadata(ctx, c.xGoogMetadata) + opts = append((*c.CallOptions).UpdateDefaultObjectAccessControl[0:len((*c.CallOptions).UpdateDefaultObjectAccessControl):len((*c.CallOptions).UpdateDefaultObjectAccessControl)], opts...) + var resp *storagepb.ObjectAccessControl + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + resp, err = c.client.UpdateDefaultObjectAccessControl(ctx, req, settings.GRPC...) + return err + }, opts...) + if err != nil { + return nil, err + } + return resp, nil +} + +func (c *gRPCClient) DeleteNotification(ctx context.Context, req *storagepb.DeleteNotificationRequest, opts ...gax.CallOption) error { + if _, ok := ctx.Deadline(); !ok && !c.disableDeadlines { + cctx, cancel := context.WithTimeout(ctx, 60000*time.Millisecond) + defer cancel() + ctx = cctx + } + ctx = insertMetadata(ctx, c.xGoogMetadata) + opts = append((*c.CallOptions).DeleteNotification[0:len((*c.CallOptions).DeleteNotification):len((*c.CallOptions).DeleteNotification)], opts...) + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + _, err = c.client.DeleteNotification(ctx, req, settings.GRPC...) + return err + }, opts...) + return err +} + +func (c *gRPCClient) GetNotification(ctx context.Context, req *storagepb.GetNotificationRequest, opts ...gax.CallOption) (*storagepb.Notification, error) { + if _, ok := ctx.Deadline(); !ok && !c.disableDeadlines { + cctx, cancel := context.WithTimeout(ctx, 60000*time.Millisecond) + defer cancel() + ctx = cctx + } + ctx = insertMetadata(ctx, c.xGoogMetadata) + opts = append((*c.CallOptions).GetNotification[0:len((*c.CallOptions).GetNotification):len((*c.CallOptions).GetNotification)], opts...) + var resp *storagepb.Notification + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + resp, err = c.client.GetNotification(ctx, req, settings.GRPC...) + return err + }, opts...) + if err != nil { + return nil, err + } + return resp, nil +} + +func (c *gRPCClient) InsertNotification(ctx context.Context, req *storagepb.InsertNotificationRequest, opts ...gax.CallOption) (*storagepb.Notification, error) { + if _, ok := ctx.Deadline(); !ok && !c.disableDeadlines { + cctx, cancel := context.WithTimeout(ctx, 60000*time.Millisecond) + defer cancel() + ctx = cctx + } + ctx = insertMetadata(ctx, c.xGoogMetadata) + opts = append((*c.CallOptions).InsertNotification[0:len((*c.CallOptions).InsertNotification):len((*c.CallOptions).InsertNotification)], opts...) + var resp *storagepb.Notification + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + resp, err = c.client.InsertNotification(ctx, req, settings.GRPC...) + return err + }, opts...) + if err != nil { + return nil, err + } + return resp, nil +} + +func (c *gRPCClient) ListNotifications(ctx context.Context, req *storagepb.ListNotificationsRequest, opts ...gax.CallOption) (*storagepb.ListNotificationsResponse, error) { + if _, ok := ctx.Deadline(); !ok && !c.disableDeadlines { + cctx, cancel := context.WithTimeout(ctx, 60000*time.Millisecond) + defer cancel() + ctx = cctx + } + ctx = insertMetadata(ctx, c.xGoogMetadata) + opts = append((*c.CallOptions).ListNotifications[0:len((*c.CallOptions).ListNotifications):len((*c.CallOptions).ListNotifications)], opts...) + var resp *storagepb.ListNotificationsResponse + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + resp, err = c.client.ListNotifications(ctx, req, settings.GRPC...) + return err + }, opts...) + if err != nil { + return nil, err + } + return resp, nil +} + +func (c *gRPCClient) DeleteObjectAccessControl(ctx context.Context, req *storagepb.DeleteObjectAccessControlRequest, opts ...gax.CallOption) error { + if _, ok := ctx.Deadline(); !ok && !c.disableDeadlines { + cctx, cancel := context.WithTimeout(ctx, 60000*time.Millisecond) + defer cancel() + ctx = cctx + } + ctx = insertMetadata(ctx, c.xGoogMetadata) + opts = append((*c.CallOptions).DeleteObjectAccessControl[0:len((*c.CallOptions).DeleteObjectAccessControl):len((*c.CallOptions).DeleteObjectAccessControl)], opts...) + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + _, err = c.client.DeleteObjectAccessControl(ctx, req, settings.GRPC...) + return err + }, opts...) + return err +} + +func (c *gRPCClient) GetObjectAccessControl(ctx context.Context, req *storagepb.GetObjectAccessControlRequest, opts ...gax.CallOption) (*storagepb.ObjectAccessControl, error) { + if _, ok := ctx.Deadline(); !ok && !c.disableDeadlines { + cctx, cancel := context.WithTimeout(ctx, 60000*time.Millisecond) + defer cancel() + ctx = cctx + } + ctx = insertMetadata(ctx, c.xGoogMetadata) + opts = append((*c.CallOptions).GetObjectAccessControl[0:len((*c.CallOptions).GetObjectAccessControl):len((*c.CallOptions).GetObjectAccessControl)], opts...) + var resp *storagepb.ObjectAccessControl + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + resp, err = c.client.GetObjectAccessControl(ctx, req, settings.GRPC...) + return err + }, opts...) + if err != nil { + return nil, err + } + return resp, nil +} + +func (c *gRPCClient) InsertObjectAccessControl(ctx context.Context, req *storagepb.InsertObjectAccessControlRequest, opts ...gax.CallOption) (*storagepb.ObjectAccessControl, error) { + if _, ok := ctx.Deadline(); !ok && !c.disableDeadlines { + cctx, cancel := context.WithTimeout(ctx, 60000*time.Millisecond) + defer cancel() + ctx = cctx + } + ctx = insertMetadata(ctx, c.xGoogMetadata) + opts = append((*c.CallOptions).InsertObjectAccessControl[0:len((*c.CallOptions).InsertObjectAccessControl):len((*c.CallOptions).InsertObjectAccessControl)], opts...) + var resp *storagepb.ObjectAccessControl + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + resp, err = c.client.InsertObjectAccessControl(ctx, req, settings.GRPC...) + return err + }, opts...) + if err != nil { + return nil, err + } + return resp, nil +} + +func (c *gRPCClient) ListObjectAccessControls(ctx context.Context, req *storagepb.ListObjectAccessControlsRequest, opts ...gax.CallOption) (*storagepb.ListObjectAccessControlsResponse, error) { + if _, ok := ctx.Deadline(); !ok && !c.disableDeadlines { + cctx, cancel := context.WithTimeout(ctx, 60000*time.Millisecond) + defer cancel() + ctx = cctx + } + ctx = insertMetadata(ctx, c.xGoogMetadata) + opts = append((*c.CallOptions).ListObjectAccessControls[0:len((*c.CallOptions).ListObjectAccessControls):len((*c.CallOptions).ListObjectAccessControls)], opts...) + var resp *storagepb.ListObjectAccessControlsResponse + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + resp, err = c.client.ListObjectAccessControls(ctx, req, settings.GRPC...) + return err + }, opts...) + if err != nil { + return nil, err + } + return resp, nil +} + +func (c *gRPCClient) PatchObjectAccessControl(ctx context.Context, req *storagepb.PatchObjectAccessControlRequest, opts ...gax.CallOption) (*storagepb.ObjectAccessControl, error) { + if _, ok := ctx.Deadline(); !ok && !c.disableDeadlines { + cctx, cancel := context.WithTimeout(ctx, 60000*time.Millisecond) + defer cancel() + ctx = cctx + } + ctx = insertMetadata(ctx, c.xGoogMetadata) + opts = append((*c.CallOptions).PatchObjectAccessControl[0:len((*c.CallOptions).PatchObjectAccessControl):len((*c.CallOptions).PatchObjectAccessControl)], opts...) + var resp *storagepb.ObjectAccessControl + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + resp, err = c.client.PatchObjectAccessControl(ctx, req, settings.GRPC...) + return err + }, opts...) + if err != nil { + return nil, err + } + return resp, nil +} + +func (c *gRPCClient) UpdateObjectAccessControl(ctx context.Context, req *storagepb.UpdateObjectAccessControlRequest, opts ...gax.CallOption) (*storagepb.ObjectAccessControl, error) { + if _, ok := ctx.Deadline(); !ok && !c.disableDeadlines { + cctx, cancel := context.WithTimeout(ctx, 60000*time.Millisecond) + defer cancel() + ctx = cctx + } + ctx = insertMetadata(ctx, c.xGoogMetadata) + opts = append((*c.CallOptions).UpdateObjectAccessControl[0:len((*c.CallOptions).UpdateObjectAccessControl):len((*c.CallOptions).UpdateObjectAccessControl)], opts...) + var resp *storagepb.ObjectAccessControl + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + resp, err = c.client.UpdateObjectAccessControl(ctx, req, settings.GRPC...) + return err + }, opts...) + if err != nil { + return nil, err + } + return resp, nil +} + +func (c *gRPCClient) ComposeObject(ctx context.Context, req *storagepb.ComposeObjectRequest, opts ...gax.CallOption) (*storagepb.Object, error) { + if _, ok := ctx.Deadline(); !ok && !c.disableDeadlines { + cctx, cancel := context.WithTimeout(ctx, 60000*time.Millisecond) + defer cancel() + ctx = cctx + } + ctx = insertMetadata(ctx, c.xGoogMetadata) + opts = append((*c.CallOptions).ComposeObject[0:len((*c.CallOptions).ComposeObject):len((*c.CallOptions).ComposeObject)], opts...) + var resp *storagepb.Object + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + resp, err = c.client.ComposeObject(ctx, req, settings.GRPC...) + return err + }, opts...) + if err != nil { + return nil, err + } + return resp, nil +} + +func (c *gRPCClient) CopyObject(ctx context.Context, req *storagepb.CopyObjectRequest, opts ...gax.CallOption) (*storagepb.Object, error) { + if _, ok := ctx.Deadline(); !ok && !c.disableDeadlines { + cctx, cancel := context.WithTimeout(ctx, 60000*time.Millisecond) + defer cancel() + ctx = cctx + } + ctx = insertMetadata(ctx, c.xGoogMetadata) + opts = append((*c.CallOptions).CopyObject[0:len((*c.CallOptions).CopyObject):len((*c.CallOptions).CopyObject)], opts...) + var resp *storagepb.Object + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + resp, err = c.client.CopyObject(ctx, req, settings.GRPC...) + return err + }, opts...) + if err != nil { + return nil, err + } + return resp, nil +} + +func (c *gRPCClient) DeleteObject(ctx context.Context, req *storagepb.DeleteObjectRequest, opts ...gax.CallOption) error { + if _, ok := ctx.Deadline(); !ok && !c.disableDeadlines { + cctx, cancel := context.WithTimeout(ctx, 60000*time.Millisecond) + defer cancel() + ctx = cctx + } + ctx = insertMetadata(ctx, c.xGoogMetadata) + opts = append((*c.CallOptions).DeleteObject[0:len((*c.CallOptions).DeleteObject):len((*c.CallOptions).DeleteObject)], opts...) + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + _, err = c.client.DeleteObject(ctx, req, settings.GRPC...) + return err + }, opts...) + return err +} + +func (c *gRPCClient) GetObject(ctx context.Context, req *storagepb.GetObjectRequest, opts ...gax.CallOption) (*storagepb.Object, error) { + if _, ok := ctx.Deadline(); !ok && !c.disableDeadlines { + cctx, cancel := context.WithTimeout(ctx, 60000*time.Millisecond) + defer cancel() + ctx = cctx + } + ctx = insertMetadata(ctx, c.xGoogMetadata) + opts = append((*c.CallOptions).GetObject[0:len((*c.CallOptions).GetObject):len((*c.CallOptions).GetObject)], opts...) + var resp *storagepb.Object + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + resp, err = c.client.GetObject(ctx, req, settings.GRPC...) + return err + }, opts...) + if err != nil { + return nil, err + } + return resp, nil +} + +func (c *gRPCClient) GetObjectMedia(ctx context.Context, req *storagepb.GetObjectMediaRequest, opts ...gax.CallOption) (storagepb.Storage_GetObjectMediaClient, error) { + ctx = insertMetadata(ctx, c.xGoogMetadata) + var resp storagepb.Storage_GetObjectMediaClient + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + resp, err = c.client.GetObjectMedia(ctx, req, settings.GRPC...) + return err + }, opts...) + if err != nil { + return nil, err + } + return resp, nil +} + +func (c *gRPCClient) InsertObject(ctx context.Context, opts ...gax.CallOption) (storagepb.Storage_InsertObjectClient, error) { + ctx = insertMetadata(ctx, c.xGoogMetadata) + var resp storagepb.Storage_InsertObjectClient + opts = append((*c.CallOptions).InsertObject[0:len((*c.CallOptions).InsertObject):len((*c.CallOptions).InsertObject)], opts...) + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + resp, err = c.client.InsertObject(ctx, settings.GRPC...) + return err + }, opts...) + if err != nil { + return nil, err + } + return resp, nil +} + +func (c *gRPCClient) ListObjects(ctx context.Context, req *storagepb.ListObjectsRequest, opts ...gax.CallOption) (*storagepb.ListObjectsResponse, error) { + if _, ok := ctx.Deadline(); !ok && !c.disableDeadlines { + cctx, cancel := context.WithTimeout(ctx, 60000*time.Millisecond) + defer cancel() + ctx = cctx + } + ctx = insertMetadata(ctx, c.xGoogMetadata) + opts = append((*c.CallOptions).ListObjects[0:len((*c.CallOptions).ListObjects):len((*c.CallOptions).ListObjects)], opts...) + var resp *storagepb.ListObjectsResponse + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + resp, err = c.client.ListObjects(ctx, req, settings.GRPC...) + return err + }, opts...) + if err != nil { + return nil, err + } + return resp, nil +} + +func (c *gRPCClient) RewriteObject(ctx context.Context, req *storagepb.RewriteObjectRequest, opts ...gax.CallOption) (*storagepb.RewriteResponse, error) { + if _, ok := ctx.Deadline(); !ok && !c.disableDeadlines { + cctx, cancel := context.WithTimeout(ctx, 60000*time.Millisecond) + defer cancel() + ctx = cctx + } + ctx = insertMetadata(ctx, c.xGoogMetadata) + opts = append((*c.CallOptions).RewriteObject[0:len((*c.CallOptions).RewriteObject):len((*c.CallOptions).RewriteObject)], opts...) + var resp *storagepb.RewriteResponse + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + resp, err = c.client.RewriteObject(ctx, req, settings.GRPC...) + return err + }, opts...) + if err != nil { + return nil, err + } + return resp, nil +} + +func (c *gRPCClient) StartResumableWrite(ctx context.Context, req *storagepb.StartResumableWriteRequest, opts ...gax.CallOption) (*storagepb.StartResumableWriteResponse, error) { + if _, ok := ctx.Deadline(); !ok && !c.disableDeadlines { + cctx, cancel := context.WithTimeout(ctx, 60000*time.Millisecond) + defer cancel() + ctx = cctx + } + ctx = insertMetadata(ctx, c.xGoogMetadata) + opts = append((*c.CallOptions).StartResumableWrite[0:len((*c.CallOptions).StartResumableWrite):len((*c.CallOptions).StartResumableWrite)], opts...) + var resp *storagepb.StartResumableWriteResponse + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + resp, err = c.client.StartResumableWrite(ctx, req, settings.GRPC...) + return err + }, opts...) + if err != nil { + return nil, err + } + return resp, nil +} + +func (c *gRPCClient) QueryWriteStatus(ctx context.Context, req *storagepb.QueryWriteStatusRequest, opts ...gax.CallOption) (*storagepb.QueryWriteStatusResponse, error) { + if _, ok := ctx.Deadline(); !ok && !c.disableDeadlines { + cctx, cancel := context.WithTimeout(ctx, 60000*time.Millisecond) + defer cancel() + ctx = cctx + } + ctx = insertMetadata(ctx, c.xGoogMetadata) + opts = append((*c.CallOptions).QueryWriteStatus[0:len((*c.CallOptions).QueryWriteStatus):len((*c.CallOptions).QueryWriteStatus)], opts...) + var resp *storagepb.QueryWriteStatusResponse + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + resp, err = c.client.QueryWriteStatus(ctx, req, settings.GRPC...) + return err + }, opts...) + if err != nil { + return nil, err + } + return resp, nil +} + +func (c *gRPCClient) PatchObject(ctx context.Context, req *storagepb.PatchObjectRequest, opts ...gax.CallOption) (*storagepb.Object, error) { + if _, ok := ctx.Deadline(); !ok && !c.disableDeadlines { + cctx, cancel := context.WithTimeout(ctx, 60000*time.Millisecond) + defer cancel() + ctx = cctx + } + ctx = insertMetadata(ctx, c.xGoogMetadata) + opts = append((*c.CallOptions).PatchObject[0:len((*c.CallOptions).PatchObject):len((*c.CallOptions).PatchObject)], opts...) + var resp *storagepb.Object + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + resp, err = c.client.PatchObject(ctx, req, settings.GRPC...) + return err + }, opts...) + if err != nil { + return nil, err + } + return resp, nil +} + +func (c *gRPCClient) UpdateObject(ctx context.Context, req *storagepb.UpdateObjectRequest, opts ...gax.CallOption) (*storagepb.Object, error) { + if _, ok := ctx.Deadline(); !ok && !c.disableDeadlines { + cctx, cancel := context.WithTimeout(ctx, 60000*time.Millisecond) + defer cancel() + ctx = cctx + } + ctx = insertMetadata(ctx, c.xGoogMetadata) + opts = append((*c.CallOptions).UpdateObject[0:len((*c.CallOptions).UpdateObject):len((*c.CallOptions).UpdateObject)], opts...) + var resp *storagepb.Object + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + resp, err = c.client.UpdateObject(ctx, req, settings.GRPC...) + return err + }, opts...) + if err != nil { + return nil, err + } + return resp, nil +} + +func (c *gRPCClient) GetObjectIamPolicy(ctx context.Context, req *storagepb.GetIamPolicyRequest, opts ...gax.CallOption) (*iampb.Policy, error) { + if _, ok := ctx.Deadline(); !ok && !c.disableDeadlines { + cctx, cancel := context.WithTimeout(ctx, 60000*time.Millisecond) + defer cancel() + ctx = cctx + } + ctx = insertMetadata(ctx, c.xGoogMetadata) + opts = append((*c.CallOptions).GetObjectIamPolicy[0:len((*c.CallOptions).GetObjectIamPolicy):len((*c.CallOptions).GetObjectIamPolicy)], opts...) + var resp *iampb.Policy + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + resp, err = c.client.GetObjectIamPolicy(ctx, req, settings.GRPC...) + return err + }, opts...) + if err != nil { + return nil, err + } + return resp, nil +} + +func (c *gRPCClient) SetObjectIamPolicy(ctx context.Context, req *storagepb.SetIamPolicyRequest, opts ...gax.CallOption) (*iampb.Policy, error) { + if _, ok := ctx.Deadline(); !ok && !c.disableDeadlines { + cctx, cancel := context.WithTimeout(ctx, 60000*time.Millisecond) + defer cancel() + ctx = cctx + } + ctx = insertMetadata(ctx, c.xGoogMetadata) + opts = append((*c.CallOptions).SetObjectIamPolicy[0:len((*c.CallOptions).SetObjectIamPolicy):len((*c.CallOptions).SetObjectIamPolicy)], opts...) + var resp *iampb.Policy + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + resp, err = c.client.SetObjectIamPolicy(ctx, req, settings.GRPC...) + return err + }, opts...) + if err != nil { + return nil, err + } + return resp, nil +} + +func (c *gRPCClient) TestObjectIamPermissions(ctx context.Context, req *storagepb.TestIamPermissionsRequest, opts ...gax.CallOption) (*iampb.TestIamPermissionsResponse, error) { + if _, ok := ctx.Deadline(); !ok && !c.disableDeadlines { + cctx, cancel := context.WithTimeout(ctx, 60000*time.Millisecond) + defer cancel() + ctx = cctx + } + ctx = insertMetadata(ctx, c.xGoogMetadata) + opts = append((*c.CallOptions).TestObjectIamPermissions[0:len((*c.CallOptions).TestObjectIamPermissions):len((*c.CallOptions).TestObjectIamPermissions)], opts...) + var resp *iampb.TestIamPermissionsResponse + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + resp, err = c.client.TestObjectIamPermissions(ctx, req, settings.GRPC...) + return err + }, opts...) + if err != nil { + return nil, err + } + return resp, nil +} + +func (c *gRPCClient) WatchAllObjects(ctx context.Context, req *storagepb.WatchAllObjectsRequest, opts ...gax.CallOption) (*storagepb.Channel, error) { + if _, ok := ctx.Deadline(); !ok && !c.disableDeadlines { + cctx, cancel := context.WithTimeout(ctx, 60000*time.Millisecond) + defer cancel() + ctx = cctx + } + ctx = insertMetadata(ctx, c.xGoogMetadata) + opts = append((*c.CallOptions).WatchAllObjects[0:len((*c.CallOptions).WatchAllObjects):len((*c.CallOptions).WatchAllObjects)], opts...) + var resp *storagepb.Channel + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + resp, err = c.client.WatchAllObjects(ctx, req, settings.GRPC...) + return err + }, opts...) + if err != nil { + return nil, err + } + return resp, nil +} + +func (c *gRPCClient) GetServiceAccount(ctx context.Context, req *storagepb.GetProjectServiceAccountRequest, opts ...gax.CallOption) (*storagepb.ServiceAccount, error) { + if _, ok := ctx.Deadline(); !ok && !c.disableDeadlines { + cctx, cancel := context.WithTimeout(ctx, 60000*time.Millisecond) + defer cancel() + ctx = cctx + } + ctx = insertMetadata(ctx, c.xGoogMetadata) + opts = append((*c.CallOptions).GetServiceAccount[0:len((*c.CallOptions).GetServiceAccount):len((*c.CallOptions).GetServiceAccount)], opts...) + var resp *storagepb.ServiceAccount + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + resp, err = c.client.GetServiceAccount(ctx, req, settings.GRPC...) + return err + }, opts...) + if err != nil { + return nil, err + } + return resp, nil +} + +func (c *gRPCClient) CreateHmacKey(ctx context.Context, req *storagepb.CreateHmacKeyRequest, opts ...gax.CallOption) (*storagepb.CreateHmacKeyResponse, error) { + if _, ok := ctx.Deadline(); !ok && !c.disableDeadlines { + cctx, cancel := context.WithTimeout(ctx, 60000*time.Millisecond) + defer cancel() + ctx = cctx + } + ctx = insertMetadata(ctx, c.xGoogMetadata) + opts = append((*c.CallOptions).CreateHmacKey[0:len((*c.CallOptions).CreateHmacKey):len((*c.CallOptions).CreateHmacKey)], opts...) + var resp *storagepb.CreateHmacKeyResponse + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + resp, err = c.client.CreateHmacKey(ctx, req, settings.GRPC...) + return err + }, opts...) + if err != nil { + return nil, err + } + return resp, nil +} + +func (c *gRPCClient) DeleteHmacKey(ctx context.Context, req *storagepb.DeleteHmacKeyRequest, opts ...gax.CallOption) error { + if _, ok := ctx.Deadline(); !ok && !c.disableDeadlines { + cctx, cancel := context.WithTimeout(ctx, 60000*time.Millisecond) + defer cancel() + ctx = cctx + } + ctx = insertMetadata(ctx, c.xGoogMetadata) + opts = append((*c.CallOptions).DeleteHmacKey[0:len((*c.CallOptions).DeleteHmacKey):len((*c.CallOptions).DeleteHmacKey)], opts...) + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + _, err = c.client.DeleteHmacKey(ctx, req, settings.GRPC...) + return err + }, opts...) + return err +} + +func (c *gRPCClient) GetHmacKey(ctx context.Context, req *storagepb.GetHmacKeyRequest, opts ...gax.CallOption) (*storagepb.HmacKeyMetadata, error) { + if _, ok := ctx.Deadline(); !ok && !c.disableDeadlines { + cctx, cancel := context.WithTimeout(ctx, 60000*time.Millisecond) + defer cancel() + ctx = cctx + } + ctx = insertMetadata(ctx, c.xGoogMetadata) + opts = append((*c.CallOptions).GetHmacKey[0:len((*c.CallOptions).GetHmacKey):len((*c.CallOptions).GetHmacKey)], opts...) + var resp *storagepb.HmacKeyMetadata + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + resp, err = c.client.GetHmacKey(ctx, req, settings.GRPC...) + return err + }, opts...) + if err != nil { + return nil, err + } + return resp, nil +} + +func (c *gRPCClient) ListHmacKeys(ctx context.Context, req *storagepb.ListHmacKeysRequest, opts ...gax.CallOption) (*storagepb.ListHmacKeysResponse, error) { + if _, ok := ctx.Deadline(); !ok && !c.disableDeadlines { + cctx, cancel := context.WithTimeout(ctx, 60000*time.Millisecond) + defer cancel() + ctx = cctx + } + ctx = insertMetadata(ctx, c.xGoogMetadata) + opts = append((*c.CallOptions).ListHmacKeys[0:len((*c.CallOptions).ListHmacKeys):len((*c.CallOptions).ListHmacKeys)], opts...) + var resp *storagepb.ListHmacKeysResponse + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + resp, err = c.client.ListHmacKeys(ctx, req, settings.GRPC...) + return err + }, opts...) + if err != nil { + return nil, err + } + return resp, nil +} + +func (c *gRPCClient) UpdateHmacKey(ctx context.Context, req *storagepb.UpdateHmacKeyRequest, opts ...gax.CallOption) (*storagepb.HmacKeyMetadata, error) { + if _, ok := ctx.Deadline(); !ok && !c.disableDeadlines { + cctx, cancel := context.WithTimeout(ctx, 60000*time.Millisecond) + defer cancel() + ctx = cctx + } + ctx = insertMetadata(ctx, c.xGoogMetadata) + opts = append((*c.CallOptions).UpdateHmacKey[0:len((*c.CallOptions).UpdateHmacKey):len((*c.CallOptions).UpdateHmacKey)], opts...) + var resp *storagepb.HmacKeyMetadata + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + resp, err = c.client.UpdateHmacKey(ctx, req, settings.GRPC...) + return err + }, opts...) + if err != nil { + return nil, err + } + return resp, nil +} diff --git a/storage/internal/apiv1/storage_client_example_test.go b/storage/internal/apiv1/storage_client_example_test.go new file mode 100644 index 00000000000..8dbd77f7fbe --- /dev/null +++ b/storage/internal/apiv1/storage_client_example_test.go @@ -0,0 +1,1046 @@ +// Copyright 2021 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 storage_test + +import ( + "context" + + storage "cloud.google.com/go/storage/internal/apiv1" + storagepb "google.golang.org/genproto/googleapis/storage/v1" +) + +func ExampleNewClient() { + ctx := context.Background() + c, err := storage.NewClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + // TODO: Use client. + _ = c +} + +func ExampleClient_DeleteBucketAccessControl() { + ctx := context.Background() + c, err := storage.NewClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &storagepb.DeleteBucketAccessControlRequest{ + // TODO: Fill request struct fields. + } + err = c.DeleteBucketAccessControl(ctx, req) + if err != nil { + // TODO: Handle error. + } +} + +func ExampleClient_GetBucketAccessControl() { + ctx := context.Background() + c, err := storage.NewClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &storagepb.GetBucketAccessControlRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.GetBucketAccessControl(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleClient_InsertBucketAccessControl() { + ctx := context.Background() + c, err := storage.NewClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &storagepb.InsertBucketAccessControlRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.InsertBucketAccessControl(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleClient_ListBucketAccessControls() { + ctx := context.Background() + c, err := storage.NewClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &storagepb.ListBucketAccessControlsRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.ListBucketAccessControls(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleClient_UpdateBucketAccessControl() { + ctx := context.Background() + c, err := storage.NewClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &storagepb.UpdateBucketAccessControlRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.UpdateBucketAccessControl(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleClient_PatchBucketAccessControl() { + ctx := context.Background() + c, err := storage.NewClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &storagepb.PatchBucketAccessControlRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.PatchBucketAccessControl(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleClient_DeleteBucket() { + ctx := context.Background() + c, err := storage.NewClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &storagepb.DeleteBucketRequest{ + // TODO: Fill request struct fields. + } + err = c.DeleteBucket(ctx, req) + if err != nil { + // TODO: Handle error. + } +} + +func ExampleClient_GetBucket() { + ctx := context.Background() + c, err := storage.NewClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &storagepb.GetBucketRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.GetBucket(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleClient_InsertBucket() { + ctx := context.Background() + c, err := storage.NewClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &storagepb.InsertBucketRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.InsertBucket(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleClient_ListChannels() { + ctx := context.Background() + c, err := storage.NewClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &storagepb.ListChannelsRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.ListChannels(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleClient_ListBuckets() { + ctx := context.Background() + c, err := storage.NewClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &storagepb.ListBucketsRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.ListBuckets(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleClient_LockBucketRetentionPolicy() { + ctx := context.Background() + c, err := storage.NewClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &storagepb.LockRetentionPolicyRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.LockBucketRetentionPolicy(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleClient_GetBucketIamPolicy() { + ctx := context.Background() + c, err := storage.NewClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &storagepb.GetIamPolicyRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.GetBucketIamPolicy(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleClient_SetBucketIamPolicy() { + ctx := context.Background() + c, err := storage.NewClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &storagepb.SetIamPolicyRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.SetBucketIamPolicy(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleClient_TestBucketIamPermissions() { + ctx := context.Background() + c, err := storage.NewClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &storagepb.TestIamPermissionsRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.TestBucketIamPermissions(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleClient_PatchBucket() { + ctx := context.Background() + c, err := storage.NewClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &storagepb.PatchBucketRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.PatchBucket(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleClient_UpdateBucket() { + ctx := context.Background() + c, err := storage.NewClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &storagepb.UpdateBucketRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.UpdateBucket(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleClient_StopChannel() { + ctx := context.Background() + c, err := storage.NewClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &storagepb.StopChannelRequest{ + // TODO: Fill request struct fields. + } + err = c.StopChannel(ctx, req) + if err != nil { + // TODO: Handle error. + } +} + +func ExampleClient_DeleteDefaultObjectAccessControl() { + ctx := context.Background() + c, err := storage.NewClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &storagepb.DeleteDefaultObjectAccessControlRequest{ + // TODO: Fill request struct fields. + } + err = c.DeleteDefaultObjectAccessControl(ctx, req) + if err != nil { + // TODO: Handle error. + } +} + +func ExampleClient_GetDefaultObjectAccessControl() { + ctx := context.Background() + c, err := storage.NewClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &storagepb.GetDefaultObjectAccessControlRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.GetDefaultObjectAccessControl(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleClient_InsertDefaultObjectAccessControl() { + ctx := context.Background() + c, err := storage.NewClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &storagepb.InsertDefaultObjectAccessControlRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.InsertDefaultObjectAccessControl(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleClient_ListDefaultObjectAccessControls() { + ctx := context.Background() + c, err := storage.NewClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &storagepb.ListDefaultObjectAccessControlsRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.ListDefaultObjectAccessControls(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleClient_PatchDefaultObjectAccessControl() { + ctx := context.Background() + c, err := storage.NewClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &storagepb.PatchDefaultObjectAccessControlRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.PatchDefaultObjectAccessControl(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleClient_UpdateDefaultObjectAccessControl() { + ctx := context.Background() + c, err := storage.NewClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &storagepb.UpdateDefaultObjectAccessControlRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.UpdateDefaultObjectAccessControl(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleClient_DeleteNotification() { + ctx := context.Background() + c, err := storage.NewClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &storagepb.DeleteNotificationRequest{ + // TODO: Fill request struct fields. + } + err = c.DeleteNotification(ctx, req) + if err != nil { + // TODO: Handle error. + } +} + +func ExampleClient_GetNotification() { + ctx := context.Background() + c, err := storage.NewClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &storagepb.GetNotificationRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.GetNotification(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleClient_InsertNotification() { + ctx := context.Background() + c, err := storage.NewClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &storagepb.InsertNotificationRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.InsertNotification(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleClient_ListNotifications() { + ctx := context.Background() + c, err := storage.NewClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &storagepb.ListNotificationsRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.ListNotifications(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleClient_DeleteObjectAccessControl() { + ctx := context.Background() + c, err := storage.NewClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &storagepb.DeleteObjectAccessControlRequest{ + // TODO: Fill request struct fields. + } + err = c.DeleteObjectAccessControl(ctx, req) + if err != nil { + // TODO: Handle error. + } +} + +func ExampleClient_GetObjectAccessControl() { + ctx := context.Background() + c, err := storage.NewClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &storagepb.GetObjectAccessControlRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.GetObjectAccessControl(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleClient_InsertObjectAccessControl() { + ctx := context.Background() + c, err := storage.NewClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &storagepb.InsertObjectAccessControlRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.InsertObjectAccessControl(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleClient_ListObjectAccessControls() { + ctx := context.Background() + c, err := storage.NewClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &storagepb.ListObjectAccessControlsRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.ListObjectAccessControls(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleClient_PatchObjectAccessControl() { + ctx := context.Background() + c, err := storage.NewClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &storagepb.PatchObjectAccessControlRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.PatchObjectAccessControl(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleClient_UpdateObjectAccessControl() { + ctx := context.Background() + c, err := storage.NewClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &storagepb.UpdateObjectAccessControlRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.UpdateObjectAccessControl(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleClient_ComposeObject() { + ctx := context.Background() + c, err := storage.NewClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &storagepb.ComposeObjectRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.ComposeObject(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleClient_CopyObject() { + ctx := context.Background() + c, err := storage.NewClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &storagepb.CopyObjectRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.CopyObject(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleClient_DeleteObject() { + ctx := context.Background() + c, err := storage.NewClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &storagepb.DeleteObjectRequest{ + // TODO: Fill request struct fields. + } + err = c.DeleteObject(ctx, req) + if err != nil { + // TODO: Handle error. + } +} + +func ExampleClient_GetObject() { + ctx := context.Background() + c, err := storage.NewClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &storagepb.GetObjectRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.GetObject(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleClient_ListObjects() { + ctx := context.Background() + c, err := storage.NewClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &storagepb.ListObjectsRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.ListObjects(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleClient_RewriteObject() { + ctx := context.Background() + c, err := storage.NewClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &storagepb.RewriteObjectRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.RewriteObject(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleClient_StartResumableWrite() { + ctx := context.Background() + c, err := storage.NewClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &storagepb.StartResumableWriteRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.StartResumableWrite(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleClient_QueryWriteStatus() { + ctx := context.Background() + c, err := storage.NewClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &storagepb.QueryWriteStatusRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.QueryWriteStatus(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleClient_PatchObject() { + ctx := context.Background() + c, err := storage.NewClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &storagepb.PatchObjectRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.PatchObject(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleClient_UpdateObject() { + ctx := context.Background() + c, err := storage.NewClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &storagepb.UpdateObjectRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.UpdateObject(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleClient_GetObjectIamPolicy() { + ctx := context.Background() + c, err := storage.NewClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &storagepb.GetIamPolicyRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.GetObjectIamPolicy(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleClient_SetObjectIamPolicy() { + ctx := context.Background() + c, err := storage.NewClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &storagepb.SetIamPolicyRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.SetObjectIamPolicy(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleClient_TestObjectIamPermissions() { + ctx := context.Background() + c, err := storage.NewClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &storagepb.TestIamPermissionsRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.TestObjectIamPermissions(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleClient_WatchAllObjects() { + ctx := context.Background() + c, err := storage.NewClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &storagepb.WatchAllObjectsRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.WatchAllObjects(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleClient_GetServiceAccount() { + ctx := context.Background() + c, err := storage.NewClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &storagepb.GetProjectServiceAccountRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.GetServiceAccount(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleClient_CreateHmacKey() { + ctx := context.Background() + c, err := storage.NewClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &storagepb.CreateHmacKeyRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.CreateHmacKey(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleClient_DeleteHmacKey() { + ctx := context.Background() + c, err := storage.NewClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &storagepb.DeleteHmacKeyRequest{ + // TODO: Fill request struct fields. + } + err = c.DeleteHmacKey(ctx, req) + if err != nil { + // TODO: Handle error. + } +} + +func ExampleClient_GetHmacKey() { + ctx := context.Background() + c, err := storage.NewClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &storagepb.GetHmacKeyRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.GetHmacKey(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleClient_ListHmacKeys() { + ctx := context.Background() + c, err := storage.NewClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &storagepb.ListHmacKeysRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.ListHmacKeys(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleClient_UpdateHmacKey() { + ctx := context.Background() + c, err := storage.NewClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &storagepb.UpdateHmacKeyRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.UpdateHmacKey(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} From f31fac6c2674a1bb9180a75ae7dbeda55721482d Mon Sep 17 00:00:00 2001 From: tmdiep Date: Wed, 30 Jun 2021 09:04:52 +1000 Subject: [PATCH 30/50] fix(pubsublite)!: hide CreateSubscriptionOption.apply (#4344) Since the createSubscriptionSettings struct is not exposed, hide apply(). --- pubsublite/admin.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pubsublite/admin.go b/pubsublite/admin.go index 5cd00800490..ec83aff3778 100644 --- a/pubsublite/admin.go +++ b/pubsublite/admin.go @@ -165,14 +165,14 @@ type createSubscriptionSettings struct { // CreateSubscriptionOption is an option for AdminClient.CreateSubscription. type CreateSubscriptionOption interface { - Apply(*createSubscriptionSettings) + apply(*createSubscriptionSettings) } type startingOffset struct { backlogLocation BacklogLocation } -func (so startingOffset) Apply(settings *createSubscriptionSettings) { +func (so startingOffset) apply(settings *createSubscriptionSettings) { settings.backlogLocation = so.backlogLocation } @@ -190,7 +190,7 @@ func StartingOffset(location BacklogLocation) CreateSubscriptionOption { func (ac *AdminClient) CreateSubscription(ctx context.Context, config SubscriptionConfig, opts ...CreateSubscriptionOption) (*SubscriptionConfig, error) { var settings createSubscriptionSettings for _, opt := range opts { - opt.Apply(&settings) + opt.apply(&settings) } subsPath, err := wire.ParseSubscriptionPath(config.Name) From b2a61719b3caf43b095fc290b23de245a2135512 Mon Sep 17 00:00:00 2001 From: Christopher Wilcox Date: Tue, 29 Jun 2021 17:10:59 -0700 Subject: [PATCH 31/50] fix(firestore): correct an issue with returning empty paritions from GetPartionedQueries (#4346) --- firestore/collgroupref.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/firestore/collgroupref.go b/firestore/collgroupref.go index c13ff1f160b..90986ad71f6 100644 --- a/firestore/collgroupref.go +++ b/firestore/collgroupref.go @@ -60,8 +60,8 @@ func (cgr CollectionGroupRef) GetPartitionedQueries(ctx context.Context, partiti return nil, err } queries := make([]Query, len(qp)) - for _, part := range qp { - queries = append(queries, part.toQuery()) + for i, part := range qp { + queries[i] = part.toQuery() } return queries, nil } From 6e1be41279d660c15443dc9bd7ddd88798641fd3 Mon Sep 17 00:00:00 2001 From: yoshi-code-bot <70984784+yoshi-code-bot@users.noreply.github.com> Date: Wed, 30 Jun 2021 06:02:22 -0700 Subject: [PATCH 32/50] chore: release spanner 1.22.0 (#4339) * chore: release spanner 1.22.0 * Update CHANGES.md Co-authored-by: Hengfeng Li --- spanner/CHANGES.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/spanner/CHANGES.md b/spanner/CHANGES.md index c94a9da05fa..7e8c701e379 100644 --- a/spanner/CHANGES.md +++ b/spanner/CHANGES.md @@ -1,5 +1,13 @@ # Changes +## [1.22.0](https://www.github.com/googleapis/google-cloud-go/compare/spanner/v1.21.0...spanner/v1.22.0) (2021-06-30) + + +### Features + +* **spanner:** support request and transaction tags ([#4336](https://www.github.com/googleapis/google-cloud-go/issues/4336)) ([f08c73a](https://www.github.com/googleapis/google-cloud-go/commit/f08c73a75e2d2a8b9a0b184179346cb97c82e9e5)) +* **spanner:** enable request options for batch read ([#4337](https://www.github.com/googleapis/google-cloud-go/issues/4337)) ([b9081c3](https://www.github.com/googleapis/google-cloud-go/commit/b9081c36ed6495a67f8e458ad884bdb8da5b7fbc)) + ## [1.21.0](https://www.github.com/googleapis/google-cloud-go/compare/spanner/v1.20.0...spanner/v1.21.0) (2021-06-23) From 8fb464956f0ca51d30e8e14dc625ff9fa150c437 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Wed, 30 Jun 2021 06:32:22 -0700 Subject: [PATCH 33/50] chore(all): auto-regenerate gapics (#4342) This is an auto-generated regeneration of the gapic clients by cloud.google.com/go/internal/gapicgen. Once the corresponding genproto PR is submitted, genbot will update this PR with a newer dependency to the newer version of genproto and assign reviewers to this PR. If you have been assigned to review this PR, please: - Ensure that the version of genproto in go.mod has been updated. - Ensure that CI is passing. If it's failing, it requires your manual attention. - Approve and submit this PR if you believe it's ready to ship. Corresponding genproto PR: https://github.com/googleapis/go-genproto/pull/627 Changes: Synchronize new proto/yaml changes. PiperOrigin-RevId: 381955863 Source-Link: https://github.com/googleapis/googleapis/commit/24443e8a67e256360067cdfc4105545fde620bf0 build(apigeeconnect): name should be @google-cloud/apigee-connect PiperOrigin-RevId: 381518921 Source-Link: https://github.com/googleapis/googleapis/commit/8b4a440aa7de03da4d1f3c38d593d2f0baf82857 feat(servicecontrol): Added the gRPC service config for the Service Controller v1 API docs: Updated some comments. PiperOrigin-RevId: 381355331 Source-Link: https://github.com/googleapis/googleapis/commit/da5f84269f0dcdd50554c974cfa968d5137c2300 feat(gkehub): added v1alpha messages and client for gkehub Clients can now target the v1alpha GKE Hub API to interact with Feature resources. PiperOrigin-RevId: 381332895 Source-Link: https://github.com/googleapis/googleapis/commit/3bd91d545c8eb384c398e755f35645187f9d08eb --- apigeeconnect/apiv1/doc.go | 2 +- bigquery/go.mod | 2 +- bigquery/go.sum | 7 +- bigtable/go.mod | 2 +- bigtable/go.sum | 7 +- cloudbuild/apiv1/v2/cloud_build_client.go | 14 +- cloudbuild/apiv1/v2/doc.go | 2 +- datastore/go.mod | 2 +- datastore/go.sum | 7 +- firestore/go.mod | 2 +- firestore/go.sum | 7 +- gkehub/apiv1beta1/doc.go | 2 +- go.mod | 2 +- go.sum | 4 +- internal/examples/fake/go.mod | 2 +- internal/examples/fake/go.sum | 8 +- internal/examples/mock/go.mod | 2 +- internal/examples/mock/go.sum | 9 +- internal/gapicgen/go.mod | 2 +- internal/gapicgen/go.sum | 7 +- internal/generated/snippets/go.mod | 2 +- internal/generated/snippets/go.sum | 11 +- internal/godocfx/go.sum | 204 ++---------------- logging/go.mod | 2 +- logging/go.sum | 7 +- pubsub/go.mod | 2 +- pubsub/go.sum | 7 +- pubsublite/go.mod | 2 +- pubsublite/go.sum | 7 +- servicecontrol/apiv1/doc.go | 6 +- .../apiv1/quota_controller_client.go | 4 +- .../apiv1/service_controller_client.go | 11 +- spanner/go.mod | 2 +- spanner/go.sum | 7 +- storage/go.mod | 2 +- storage/go.sum | 10 +- 36 files changed, 111 insertions(+), 267 deletions(-) diff --git a/apigeeconnect/apiv1/doc.go b/apigeeconnect/apiv1/doc.go index cafc83804d5..5b437a3a194 100644 --- a/apigeeconnect/apiv1/doc.go +++ b/apigeeconnect/apiv1/doc.go @@ -48,7 +48,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210624" +const versionClient = "20210629" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/bigquery/go.mod b/bigquery/go.mod index 60c8ce04778..48b9e8098bb 100644 --- a/bigquery/go.mod +++ b/bigquery/go.mod @@ -10,7 +10,7 @@ require ( github.com/googleapis/gax-go/v2 v2.0.5 golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 google.golang.org/api v0.49.0 - google.golang.org/genproto v0.0.0-20210624174822-c5cf32407d0a + google.golang.org/genproto v0.0.0-20210629200056-84d6f6074151 google.golang.org/grpc v1.38.0 google.golang.org/protobuf v1.27.1 ) diff --git a/bigquery/go.sum b/bigquery/go.sum index 4e3360fdd58..96aa2e4a6bc 100644 --- a/bigquery/go.sum +++ b/bigquery/go.sum @@ -369,8 +369,9 @@ golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4f golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/tools v0.1.3 h1:L69ShwSZEyCsLKoAxDKeMvLDZkumEe8gXUZAjab0tX8= golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/tools v0.1.4 h1:cVngSRcfgyZCzys3KYOpCFa+4dqX/Oub9tAq00ttGVs= +golang.org/x/tools v0.1.4/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= 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= @@ -453,8 +454,8 @@ google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxH google.golang.org/genproto v0.0.0-20210604141403-392c879c8b08/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= google.golang.org/genproto v0.0.0-20210608205507-b6d2f5bf0d7d/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= google.golang.org/genproto v0.0.0-20210617175327-b9e0b3197ced/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24= -google.golang.org/genproto v0.0.0-20210624174822-c5cf32407d0a h1:b5Bhxmy6Tppar7Yl4J6c6xF33YSBhkm2FtV9/ZQuBkQ= -google.golang.org/genproto v0.0.0-20210624174822-c5cf32407d0a/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24= +google.golang.org/genproto v0.0.0-20210629200056-84d6f6074151 h1:H/uPzsolsGjhl3CVT6Wb7bK+mf+hmkEvUVu+FBKyNlc= +google.golang.org/genproto v0.0.0-20210629200056-84d6f6074151/go.mod h1:yiaVoXHpRzHGyxV3o4DktVWY4mSUErTKaeEOq6C3t3U= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= diff --git a/bigtable/go.mod b/bigtable/go.mod index c69f977e326..bdb3ed4432d 100644 --- a/bigtable/go.mod +++ b/bigtable/go.mod @@ -11,7 +11,7 @@ require ( golang.org/x/oauth2 v0.0.0-20210628180205-a41e5a781914 golang.org/x/sys v0.0.0-20210616094352-59db8d763f22 google.golang.org/api v0.49.0 - google.golang.org/genproto v0.0.0-20210624174822-c5cf32407d0a + google.golang.org/genproto v0.0.0-20210629200056-84d6f6074151 google.golang.org/grpc v1.38.0 google.golang.org/protobuf v1.27.1 rsc.io/binaryregexp v0.2.0 diff --git a/bigtable/go.sum b/bigtable/go.sum index f2cab4de1aa..44672e22553 100644 --- a/bigtable/go.sum +++ b/bigtable/go.sum @@ -368,8 +368,9 @@ golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4f golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/tools v0.1.3 h1:L69ShwSZEyCsLKoAxDKeMvLDZkumEe8gXUZAjab0tX8= golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/tools v0.1.4 h1:cVngSRcfgyZCzys3KYOpCFa+4dqX/Oub9tAq00ttGVs= +golang.org/x/tools v0.1.4/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= 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= @@ -452,8 +453,8 @@ google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxH google.golang.org/genproto v0.0.0-20210604141403-392c879c8b08/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= google.golang.org/genproto v0.0.0-20210608205507-b6d2f5bf0d7d/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= google.golang.org/genproto v0.0.0-20210617175327-b9e0b3197ced/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24= -google.golang.org/genproto v0.0.0-20210624174822-c5cf32407d0a h1:b5Bhxmy6Tppar7Yl4J6c6xF33YSBhkm2FtV9/ZQuBkQ= -google.golang.org/genproto v0.0.0-20210624174822-c5cf32407d0a/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24= +google.golang.org/genproto v0.0.0-20210629200056-84d6f6074151 h1:H/uPzsolsGjhl3CVT6Wb7bK+mf+hmkEvUVu+FBKyNlc= +google.golang.org/genproto v0.0.0-20210629200056-84d6f6074151/go.mod h1:yiaVoXHpRzHGyxV3o4DktVWY4mSUErTKaeEOq6C3t3U= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= diff --git a/cloudbuild/apiv1/v2/cloud_build_client.go b/cloudbuild/apiv1/v2/cloud_build_client.go index bde219b32df..1ca6670a012 100644 --- a/cloudbuild/apiv1/v2/cloud_build_client.go +++ b/cloudbuild/apiv1/v2/cloud_build_client.go @@ -644,7 +644,7 @@ func (c *gRPCClient) CreateBuildTrigger(ctx context.Context, req *cloudbuildpb.C defer cancel() ctx = cctx } - md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "project_id", url.QueryEscape(req.GetProjectId()))) + md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v&%s=%v", "project_id", url.QueryEscape(req.GetProjectId()), "parent", url.QueryEscape(req.GetParent()))) ctx = insertMetadata(ctx, c.xGoogMetadata, md) opts = append((*c.CallOptions).CreateBuildTrigger[0:len((*c.CallOptions).CreateBuildTrigger):len((*c.CallOptions).CreateBuildTrigger)], opts...) var resp *cloudbuildpb.BuildTrigger @@ -665,7 +665,7 @@ func (c *gRPCClient) GetBuildTrigger(ctx context.Context, req *cloudbuildpb.GetB defer cancel() ctx = cctx } - md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v&%s=%v", "project_id", url.QueryEscape(req.GetProjectId()), "trigger_id", url.QueryEscape(req.GetTriggerId()))) + md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v&%s=%v&%s=%v", "project_id", url.QueryEscape(req.GetProjectId()), "trigger_id", url.QueryEscape(req.GetTriggerId()), "name", url.QueryEscape(req.GetName()))) ctx = insertMetadata(ctx, c.xGoogMetadata, md) opts = append((*c.CallOptions).GetBuildTrigger[0:len((*c.CallOptions).GetBuildTrigger):len((*c.CallOptions).GetBuildTrigger)], opts...) var resp *cloudbuildpb.BuildTrigger @@ -681,7 +681,7 @@ func (c *gRPCClient) GetBuildTrigger(ctx context.Context, req *cloudbuildpb.GetB } func (c *gRPCClient) ListBuildTriggers(ctx context.Context, req *cloudbuildpb.ListBuildTriggersRequest, opts ...gax.CallOption) *BuildTriggerIterator { - md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "project_id", url.QueryEscape(req.GetProjectId()))) + md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v&%s=%v", "project_id", url.QueryEscape(req.GetProjectId()), "parent", url.QueryEscape(req.GetParent()))) ctx = insertMetadata(ctx, c.xGoogMetadata, md) opts = append((*c.CallOptions).ListBuildTriggers[0:len((*c.CallOptions).ListBuildTriggers):len((*c.CallOptions).ListBuildTriggers)], opts...) it := &BuildTriggerIterator{} @@ -726,7 +726,7 @@ func (c *gRPCClient) DeleteBuildTrigger(ctx context.Context, req *cloudbuildpb.D defer cancel() ctx = cctx } - md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v&%s=%v", "project_id", url.QueryEscape(req.GetProjectId()), "trigger_id", url.QueryEscape(req.GetTriggerId()))) + md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v&%s=%v&%s=%v", "project_id", url.QueryEscape(req.GetProjectId()), "trigger_id", url.QueryEscape(req.GetTriggerId()), "name", url.QueryEscape(req.GetName()))) ctx = insertMetadata(ctx, c.xGoogMetadata, md) opts = append((*c.CallOptions).DeleteBuildTrigger[0:len((*c.CallOptions).DeleteBuildTrigger):len((*c.CallOptions).DeleteBuildTrigger)], opts...) err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { @@ -743,7 +743,7 @@ func (c *gRPCClient) UpdateBuildTrigger(ctx context.Context, req *cloudbuildpb.U defer cancel() ctx = cctx } - md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v&%s=%v", "project_id", url.QueryEscape(req.GetProjectId()), "trigger_id", url.QueryEscape(req.GetTriggerId()))) + md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v&%s=%v&%s=%v", "project_id", url.QueryEscape(req.GetProjectId()), "trigger_id", url.QueryEscape(req.GetTriggerId()), "trigger.resource_name", url.QueryEscape(req.GetTrigger().GetResourceName()))) ctx = insertMetadata(ctx, c.xGoogMetadata, md) opts = append((*c.CallOptions).UpdateBuildTrigger[0:len((*c.CallOptions).UpdateBuildTrigger):len((*c.CallOptions).UpdateBuildTrigger)], opts...) var resp *cloudbuildpb.BuildTrigger @@ -764,7 +764,7 @@ func (c *gRPCClient) RunBuildTrigger(ctx context.Context, req *cloudbuildpb.RunB defer cancel() ctx = cctx } - md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v&%s=%v", "project_id", url.QueryEscape(req.GetProjectId()), "trigger_id", url.QueryEscape(req.GetTriggerId()))) + md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v&%s=%v&%s=%v", "project_id", url.QueryEscape(req.GetProjectId()), "trigger_id", url.QueryEscape(req.GetTriggerId()), "name", url.QueryEscape(req.GetName()))) ctx = insertMetadata(ctx, c.xGoogMetadata, md) opts = append((*c.CallOptions).RunBuildTrigger[0:len((*c.CallOptions).RunBuildTrigger):len((*c.CallOptions).RunBuildTrigger)], opts...) var resp *longrunningpb.Operation @@ -782,7 +782,7 @@ func (c *gRPCClient) RunBuildTrigger(ctx context.Context, req *cloudbuildpb.RunB } func (c *gRPCClient) ReceiveTriggerWebhook(ctx context.Context, req *cloudbuildpb.ReceiveTriggerWebhookRequest, opts ...gax.CallOption) (*cloudbuildpb.ReceiveTriggerWebhookResponse, error) { - md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v&%s=%v", "project_id", url.QueryEscape(req.GetProjectId()), "trigger", url.QueryEscape(req.GetTrigger()))) + md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v&%s=%v&%s=%v", "project_id", url.QueryEscape(req.GetProjectId()), "trigger", url.QueryEscape(req.GetTrigger()), "name", url.QueryEscape(req.GetName()))) ctx = insertMetadata(ctx, c.xGoogMetadata, md) opts = append((*c.CallOptions).ReceiveTriggerWebhook[0:len((*c.CallOptions).ReceiveTriggerWebhook):len((*c.CallOptions).ReceiveTriggerWebhook)], opts...) var resp *cloudbuildpb.ReceiveTriggerWebhookResponse diff --git a/cloudbuild/apiv1/v2/doc.go b/cloudbuild/apiv1/v2/doc.go index 6d520a99bc4..95c1596f973 100644 --- a/cloudbuild/apiv1/v2/doc.go +++ b/cloudbuild/apiv1/v2/doc.go @@ -48,7 +48,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210624" +const versionClient = "20210629" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/datastore/go.mod b/datastore/go.mod index 8db8e8d5640..2f5b2532544 100644 --- a/datastore/go.mod +++ b/datastore/go.mod @@ -8,7 +8,7 @@ require ( github.com/google/go-cmp v0.5.6 github.com/googleapis/gax-go/v2 v2.0.5 google.golang.org/api v0.49.0 - google.golang.org/genproto v0.0.0-20210624174822-c5cf32407d0a + google.golang.org/genproto v0.0.0-20210629200056-84d6f6074151 google.golang.org/grpc v1.38.0 google.golang.org/protobuf v1.27.1 ) diff --git a/datastore/go.sum b/datastore/go.sum index 1567ab6a27e..8b897debcbf 100644 --- a/datastore/go.sum +++ b/datastore/go.sum @@ -365,8 +365,9 @@ golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4f golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/tools v0.1.3 h1:L69ShwSZEyCsLKoAxDKeMvLDZkumEe8gXUZAjab0tX8= golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/tools v0.1.4 h1:cVngSRcfgyZCzys3KYOpCFa+4dqX/Oub9tAq00ttGVs= +golang.org/x/tools v0.1.4/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= 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= @@ -449,8 +450,8 @@ google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxH google.golang.org/genproto v0.0.0-20210604141403-392c879c8b08/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= google.golang.org/genproto v0.0.0-20210608205507-b6d2f5bf0d7d/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= google.golang.org/genproto v0.0.0-20210617175327-b9e0b3197ced/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24= -google.golang.org/genproto v0.0.0-20210624174822-c5cf32407d0a h1:b5Bhxmy6Tppar7Yl4J6c6xF33YSBhkm2FtV9/ZQuBkQ= -google.golang.org/genproto v0.0.0-20210624174822-c5cf32407d0a/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24= +google.golang.org/genproto v0.0.0-20210629200056-84d6f6074151 h1:H/uPzsolsGjhl3CVT6Wb7bK+mf+hmkEvUVu+FBKyNlc= +google.golang.org/genproto v0.0.0-20210629200056-84d6f6074151/go.mod h1:yiaVoXHpRzHGyxV3o4DktVWY4mSUErTKaeEOq6C3t3U= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= diff --git a/firestore/go.mod b/firestore/go.mod index f5f80c3f6ad..2663995e148 100644 --- a/firestore/go.mod +++ b/firestore/go.mod @@ -8,7 +8,7 @@ require ( github.com/google/go-cmp v0.5.6 github.com/googleapis/gax-go/v2 v2.0.5 google.golang.org/api v0.49.0 - google.golang.org/genproto v0.0.0-20210624174822-c5cf32407d0a + google.golang.org/genproto v0.0.0-20210629200056-84d6f6074151 google.golang.org/grpc v1.38.0 google.golang.org/protobuf v1.27.1 ) diff --git a/firestore/go.sum b/firestore/go.sum index 1567ab6a27e..8b897debcbf 100644 --- a/firestore/go.sum +++ b/firestore/go.sum @@ -365,8 +365,9 @@ golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4f golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/tools v0.1.3 h1:L69ShwSZEyCsLKoAxDKeMvLDZkumEe8gXUZAjab0tX8= golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/tools v0.1.4 h1:cVngSRcfgyZCzys3KYOpCFa+4dqX/Oub9tAq00ttGVs= +golang.org/x/tools v0.1.4/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= 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= @@ -449,8 +450,8 @@ google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxH google.golang.org/genproto v0.0.0-20210604141403-392c879c8b08/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= google.golang.org/genproto v0.0.0-20210608205507-b6d2f5bf0d7d/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= google.golang.org/genproto v0.0.0-20210617175327-b9e0b3197ced/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24= -google.golang.org/genproto v0.0.0-20210624174822-c5cf32407d0a h1:b5Bhxmy6Tppar7Yl4J6c6xF33YSBhkm2FtV9/ZQuBkQ= -google.golang.org/genproto v0.0.0-20210624174822-c5cf32407d0a/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24= +google.golang.org/genproto v0.0.0-20210629200056-84d6f6074151 h1:H/uPzsolsGjhl3CVT6Wb7bK+mf+hmkEvUVu+FBKyNlc= +google.golang.org/genproto v0.0.0-20210629200056-84d6f6074151/go.mod h1:yiaVoXHpRzHGyxV3o4DktVWY4mSUErTKaeEOq6C3t3U= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= diff --git a/gkehub/apiv1beta1/doc.go b/gkehub/apiv1beta1/doc.go index 35abd5d983e..6ffdf1e8317 100644 --- a/gkehub/apiv1beta1/doc.go +++ b/gkehub/apiv1beta1/doc.go @@ -48,7 +48,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210624" +const versionClient = "20210629" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/go.mod b/go.mod index 787e3a5f41c..f9ff5016b5c 100644 --- a/go.mod +++ b/go.mod @@ -17,7 +17,7 @@ require ( golang.org/x/text v0.3.6 golang.org/x/tools v0.1.4 google.golang.org/api v0.49.0 - google.golang.org/genproto v0.0.0-20210624195500-8bfb893ecb84 + google.golang.org/genproto v0.0.0-20210629200056-84d6f6074151 google.golang.org/grpc v1.38.0 google.golang.org/protobuf v1.27.1 ) diff --git a/go.sum b/go.sum index 9a8de8842b9..a13fe6fe1e4 100644 --- a/go.sum +++ b/go.sum @@ -459,8 +459,8 @@ google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxH google.golang.org/genproto v0.0.0-20210604141403-392c879c8b08/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= google.golang.org/genproto v0.0.0-20210608205507-b6d2f5bf0d7d/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= google.golang.org/genproto v0.0.0-20210617175327-b9e0b3197ced/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24= -google.golang.org/genproto v0.0.0-20210624195500-8bfb893ecb84 h1:R1r5J0u6Cx+RNl/6mezTw6oA14cmKC96FeUwL6A9bd4= -google.golang.org/genproto v0.0.0-20210624195500-8bfb893ecb84/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24= +google.golang.org/genproto v0.0.0-20210629200056-84d6f6074151 h1:H/uPzsolsGjhl3CVT6Wb7bK+mf+hmkEvUVu+FBKyNlc= +google.golang.org/genproto v0.0.0-20210629200056-84d6f6074151/go.mod h1:yiaVoXHpRzHGyxV3o4DktVWY4mSUErTKaeEOq6C3t3U= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= diff --git a/internal/examples/fake/go.mod b/internal/examples/fake/go.mod index 186c772f8c9..00a09169a04 100644 --- a/internal/examples/fake/go.mod +++ b/internal/examples/fake/go.mod @@ -5,6 +5,6 @@ go 1.15 require ( cloud.google.com/go v0.84.0 google.golang.org/api v0.49.0 - google.golang.org/genproto v0.0.0-20210624174822-c5cf32407d0a + google.golang.org/genproto v0.0.0-20210629200056-84d6f6074151 google.golang.org/grpc v1.38.0 ) diff --git a/internal/examples/fake/go.sum b/internal/examples/fake/go.sum index 28eb0db10c5..5cb73adaa90 100644 --- a/internal/examples/fake/go.sum +++ b/internal/examples/fake/go.sum @@ -363,6 +363,7 @@ golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/tools v0.1.4/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= 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= @@ -445,8 +446,8 @@ google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxH google.golang.org/genproto v0.0.0-20210604141403-392c879c8b08/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= google.golang.org/genproto v0.0.0-20210608205507-b6d2f5bf0d7d/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= google.golang.org/genproto v0.0.0-20210617175327-b9e0b3197ced/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24= -google.golang.org/genproto v0.0.0-20210624174822-c5cf32407d0a h1:b5Bhxmy6Tppar7Yl4J6c6xF33YSBhkm2FtV9/ZQuBkQ= -google.golang.org/genproto v0.0.0-20210624174822-c5cf32407d0a/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24= +google.golang.org/genproto v0.0.0-20210629200056-84d6f6074151 h1:H/uPzsolsGjhl3CVT6Wb7bK+mf+hmkEvUVu+FBKyNlc= +google.golang.org/genproto v0.0.0-20210629200056-84d6f6074151/go.mod h1:yiaVoXHpRzHGyxV3o4DktVWY4mSUErTKaeEOq6C3t3U= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= @@ -481,8 +482,9 @@ google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpAD google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= -google.golang.org/protobuf v1.26.0 h1:bxAC2xTBsZGibn2RTntX0oH50xLsqy1OxA9tTL3p/lk= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.27.1 h1:SnqbnDw1V7RiZcXPx5MEeqPv2s79L9i7BJUlG/+RurQ= +google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= diff --git a/internal/examples/mock/go.mod b/internal/examples/mock/go.mod index 44100a374eb..50df88ef047 100644 --- a/internal/examples/mock/go.mod +++ b/internal/examples/mock/go.mod @@ -7,5 +7,5 @@ require ( github.com/googleapis/gax-go/v2 v2.0.5 golang.org/x/net v0.0.0-20210503060351-7fd8e65b6420 // indirect golang.org/x/sys v0.0.0-20210616094352-59db8d763f22 // indirect - google.golang.org/genproto v0.0.0-20210624174822-c5cf32407d0a + google.golang.org/genproto v0.0.0-20210629200056-84d6f6074151 ) diff --git a/internal/examples/mock/go.sum b/internal/examples/mock/go.sum index 28127469ce2..e8c633cd3dd 100644 --- a/internal/examples/mock/go.sum +++ b/internal/examples/mock/go.sum @@ -84,7 +84,7 @@ golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3 golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/tools v0.1.4/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= 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= @@ -95,8 +95,8 @@ google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7 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-20210624174822-c5cf32407d0a h1:b5Bhxmy6Tppar7Yl4J6c6xF33YSBhkm2FtV9/ZQuBkQ= -google.golang.org/genproto v0.0.0-20210624174822-c5cf32407d0a/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24= +google.golang.org/genproto v0.0.0-20210629200056-84d6f6074151 h1:H/uPzsolsGjhl3CVT6Wb7bK+mf+hmkEvUVu+FBKyNlc= +google.golang.org/genproto v0.0.0-20210629200056-84d6f6074151/go.mod h1:yiaVoXHpRzHGyxV3o4DktVWY4mSUErTKaeEOq6C3t3U= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= @@ -113,8 +113,9 @@ google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2 google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= -google.golang.org/protobuf v1.26.0 h1:bxAC2xTBsZGibn2RTntX0oH50xLsqy1OxA9tTL3p/lk= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.27.1 h1:SnqbnDw1V7RiZcXPx5MEeqPv2s79L9i7BJUlG/+RurQ= +google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= diff --git a/internal/gapicgen/go.mod b/internal/gapicgen/go.mod index 3a104af6f00..9130fbdb720 100644 --- a/internal/gapicgen/go.mod +++ b/internal/gapicgen/go.mod @@ -11,7 +11,7 @@ require ( golang.org/x/oauth2 v0.0.0-20210628180205-a41e5a781914 golang.org/x/sync v0.0.0-20210220032951-036812b2e83c golang.org/x/sys v0.0.0-20210616094352-59db8d763f22 - google.golang.org/genproto v0.0.0-20210624174822-c5cf32407d0a + google.golang.org/genproto v0.0.0-20210629200056-84d6f6074151 google.golang.org/protobuf v1.27.1 gopkg.in/src-d/go-git.v4 v4.13.1 gopkg.in/yaml.v2 v2.4.0 diff --git a/internal/gapicgen/go.sum b/internal/gapicgen/go.sum index b038dccb032..0a16bd5b57e 100644 --- a/internal/gapicgen/go.sum +++ b/internal/gapicgen/go.sum @@ -419,8 +419,9 @@ golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4f golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/tools v0.1.3 h1:L69ShwSZEyCsLKoAxDKeMvLDZkumEe8gXUZAjab0tX8= golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/tools v0.1.4 h1:cVngSRcfgyZCzys3KYOpCFa+4dqX/Oub9tAq00ttGVs= +golang.org/x/tools v0.1.4/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= 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= @@ -502,8 +503,8 @@ google.golang.org/genproto v0.0.0-20210513213006-bf773b8c8384/go.mod h1:P3QM42oQ google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= google.golang.org/genproto v0.0.0-20210604141403-392c879c8b08/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= google.golang.org/genproto v0.0.0-20210608205507-b6d2f5bf0d7d/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= -google.golang.org/genproto v0.0.0-20210624174822-c5cf32407d0a h1:b5Bhxmy6Tppar7Yl4J6c6xF33YSBhkm2FtV9/ZQuBkQ= -google.golang.org/genproto v0.0.0-20210624174822-c5cf32407d0a/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24= +google.golang.org/genproto v0.0.0-20210629200056-84d6f6074151 h1:H/uPzsolsGjhl3CVT6Wb7bK+mf+hmkEvUVu+FBKyNlc= +google.golang.org/genproto v0.0.0-20210629200056-84d6f6074151/go.mod h1:yiaVoXHpRzHGyxV3o4DktVWY4mSUErTKaeEOq6C3t3U= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= diff --git a/internal/generated/snippets/go.mod b/internal/generated/snippets/go.mod index cd9d99660cc..ffe17313edc 100644 --- a/internal/generated/snippets/go.mod +++ b/internal/generated/snippets/go.mod @@ -32,5 +32,5 @@ require ( cloud.google.com/go/pubsublite v0.84.0 cloud.google.com/go/spanner v0.84.0 google.golang.org/api v0.49.0 - google.golang.org/genproto v0.0.0-20210624174822-c5cf32407d0a + google.golang.org/genproto v0.0.0-20210629200056-84d6f6074151 ) diff --git a/internal/generated/snippets/go.sum b/internal/generated/snippets/go.sum index ae6fb5433cc..c3d12cb8f30 100644 --- a/internal/generated/snippets/go.sum +++ b/internal/generated/snippets/go.sum @@ -81,8 +81,9 @@ golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96b golang.org/x/net v0.0.0-20210503060351-7fd8e65b6420 h1:a8jGStKg0XqKDlKqjLrXn0ioF5MH36pT7Z0BRTqLhbk= golang.org/x/net v0.0.0-20210503060351-7fd8e65b6420/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= -golang.org/x/oauth2 v0.0.0-20210615190721-d04028783cf1 h1:x622Z2o4hgCr/4CiKWc51jHVKaWdtVpBNmEI8wI9Qns= golang.org/x/oauth2 v0.0.0-20210615190721-d04028783cf1/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210628180205-a41e5a781914 h1:3B43BWw0xEBsLZ/NO1VALz6fppU3481pik+2Ksv45z8= +golang.org/x/oauth2 v0.0.0-20210628180205-a41e5a781914/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -116,6 +117,7 @@ golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtn golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/tools v0.1.4/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= 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= @@ -132,8 +134,8 @@ google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoA 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-20210617175327-b9e0b3197ced/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24= -google.golang.org/genproto v0.0.0-20210624174822-c5cf32407d0a h1:b5Bhxmy6Tppar7Yl4J6c6xF33YSBhkm2FtV9/ZQuBkQ= -google.golang.org/genproto v0.0.0-20210624174822-c5cf32407d0a/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24= +google.golang.org/genproto v0.0.0-20210629200056-84d6f6074151 h1:H/uPzsolsGjhl3CVT6Wb7bK+mf+hmkEvUVu+FBKyNlc= +google.golang.org/genproto v0.0.0-20210629200056-84d6f6074151/go.mod h1:yiaVoXHpRzHGyxV3o4DktVWY4mSUErTKaeEOq6C3t3U= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= @@ -153,8 +155,9 @@ google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2 google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= -google.golang.org/protobuf v1.26.0 h1:bxAC2xTBsZGibn2RTntX0oH50xLsqy1OxA9tTL3p/lk= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.27.1 h1:SnqbnDw1V7RiZcXPx5MEeqPv2s79L9i7BJUlG/+RurQ= +google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/internal/godocfx/go.sum b/internal/godocfx/go.sum index ea66b6af2ca..a519bf7fe51 100644 --- a/internal/godocfx/go.sum +++ b/internal/godocfx/go.sum @@ -1,38 +1,11 @@ -cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= -cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= -cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= -cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= -cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= -cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To= -cloud.google.com/go v0.52.0/go.mod h1:pXajvRH/6o3+F9jDHZWQ5PbGhn+o8w9qiu/CffaVdO4= -cloud.google.com/go v0.53.0/go.mod h1:fp/UouUEsRkN6ryDKNW/Upv/JBKnv6WDthjR6+vze6M= -cloud.google.com/go v0.54.0/go.mod h1:1rq2OEkV3YMf6n/9ZvGWI3GWw0VoqH/1x2nd8Is/bPc= -cloud.google.com/go v0.56.0/go.mod h1:jr7tqZxxKOVYizybht9+26Z/gUq7tiRzu+ACVAMbKVk= -cloud.google.com/go v0.57.0/go.mod h1:oXiQ6Rzq3RAkkY7N6t3TcE6jE+CIBBbA36lwQ1JyzZs= -cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOYc= -cloud.google.com/go v0.64.0/go.mod h1:xfORb36jGvE+6EexW71nMEtL025s3x6xvuYUKM4JLv4= -cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY= -cloud.google.com/go v0.72.0/go.mod h1:M+5Vjvlc2wnp6tjzE102Dw08nGShTscUx2nZMufOKPI= -cloud.google.com/go v0.74.0/go.mod h1:VV1xSbzvo+9QJOxLDaJfTjx5e+MePCpCWwvftOeQmWk= -cloud.google.com/go v0.78.0/go.mod h1:QjdrLG0uq+YwhjoVOLsS1t7TW8fs36kLs4XO5R5ECHg= -cloud.google.com/go v0.79.0/go.mod h1:3bzgcEeQlzbuEAYu4mrWhKqWjmpprinYgKJLgKHnbb8= -cloud.google.com/go v0.81.0/go.mod h1:mk/AM35KwGk/Nm2YSeZbxXdrNK3KZOYHmLkOqC2V6E0= -cloud.google.com/go v0.83.0/go.mod h1:Z7MJUsANfY0pYPdw0lbnivPx4/vhy/e2FEkSkF7vAVY= -cloud.google.com/go v0.84.0 h1:hVhK90DwCdOAYGME/FJd9vNIZye9HBR6Yy3fu4js3N8= -cloud.google.com/go v0.84.0/go.mod h1:RazrYuxIK6Kb7YrzzhPoLmCVzl7Sup4NrbKPg8KHSUM= -cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg= cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc= cloud.google.com/go/bigquery v1.8.0 h1:PQcPefKFdaIzjQFbiyOgAqyx8q5djaE7x9Sqe712DPA= cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ= -cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= cloud.google.com/go/datastore v1.1.0 h1:/May9ojXjRkPBNVrq+oWLqmWCkr4OU5uRY29bu0mRyQ= cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= -cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= cloud.google.com/go/pubsub v1.3.1/go.mod h1:i+ucay31+CNRpDW4Lu78I4xXG+O1r/MAHgjpRVR+TSU= @@ -52,14 +25,11 @@ github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5P github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= 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/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= -github.com/envoyproxy/go-control-plane v0.9.7/go.mod h1:cwu0lG7PUMfa9snN8LXBig5ynNVH9qI8YYLbd1fK2po= -github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= github.com/envoyproxy/go-control-plane v0.9.9-0.20210217033140-668b12f5399d/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= @@ -71,19 +41,12 @@ github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4er github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e h1:1r7pUrabqp18hOBcwBwiTsbnFeTZHV9eER/QT5JVZxY= github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= -github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= -github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= -github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= -github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= -github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= -github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= -github.com/golang/mock v1.5.0/go.mod h1:CWnOUgYIOo4TcNZ0wHX3YZCqsaM1I1Jvs6v3mP3KVu8= +github.com/golang/mock v1.6.0/go.mod h1:p6yTPP+5HYm5mzsMV8JkE6ZKdX+/wYM6Hr+LicevLPs= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= -github.com/golang/protobuf v1.3.5/go.mod h1:6O5/vntMXwX2lRkT1hjjk0nAC1IDOTvTlVgjlRvqsdk= github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= @@ -93,13 +56,10 @@ github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QD github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= -github.com/golang/protobuf v1.5.1/go.mod h1:DopwsBzvsk0Fs44TXzsVbJyPhcCPeIwnvohx4u74HPM= github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/golang/snappy v0.0.3 h1:fHPg5GQYlCeLIPB9BZqMVR5nR9A+IM5zcgeTdjMYmLA= github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= -github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= @@ -107,40 +67,20 @@ github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.6 h1:BKbKCqvP6I+rmFHt06ZmyQtvB8xAkWdhFyr0ZUNZcxQ= github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/martian v2.1.0+incompatible h1:/CP5g8u/VJHijgedC/Legn3BAbAaWPgecwXBIDzw5no= -github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= -github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= -github.com/google/martian/v3 v3.1.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= github.com/google/martian/v3 v3.2.1 h1:d8MncMlErDFTwQGBK1xhv026j9kqhvw1Qv9IbWT1VLQ= github.com/google/martian/v3 v3.2.1/go.mod h1:oBOf6HBosgwRXnUGWUB05QECsc6uvmMiJ3+6W4l/CUk= -github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= -github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= -github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20201023163331-3e6fc7fc9c4c/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20210122040257-d980be63207e/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20210226084205-cbba55b83ad5/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20210601050228-01bbb1931b22/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20210609004039-a478d1d731e9/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5 h1:sjZBwGj9Jlw33ImPtvFviGYvseOtDM7hkSKB7+Tv3SM= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= -github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= -github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= github.com/jstemmer/go-junit-report v0.9.1 h1:6QPYqodiu3GuPL+7mfx+NwDdp2eTkp9IfEUpgAwUN0o= github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= @@ -159,7 +99,6 @@ github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/yuin/goldmark v1.3.9 h1:XsVHmzm4P6g84IBbAj+WYMF/IEZ3J9+3I1wlqCNa/SQ= github.com/yuin/goldmark v1.3.9/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= @@ -168,20 +107,15 @@ go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= -go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= go.opencensus.io v0.23.0 h1:gqCw0LfLxScz8irSi8exQc7fyQ0fKQU/qnC/X8+V/1M= go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= -golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY= -golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= @@ -190,18 +124,13 @@ golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMx golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= -golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs= golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/lint v0.0.0-20210508222113-6edffad5e616 h1:VLliZ0d+/avPrXXH+OakdXhpJuEoBZuwh1m2j7U6Iug= golang.org/x/lint v0.0.0-20210508222113-6edffad5e616/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= @@ -209,8 +138,6 @@ golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzB golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2 h1:Gz96sIWK3OalVv/I/qNygP42zyoKp3xptRVCWRFEBvo= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -224,45 +151,27 @@ golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200222125558-5a598a2470a0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200501053045-e0ff5e5a1de5/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.0.0-20200813134508-3edf25e44fcc/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20201031054903-ff519b6c9102/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLdyRGr576XBO4/greRjx4P4O3yc= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= golang.org/x/net v0.0.0-20210503060351-7fd8e65b6420 h1:a8jGStKg0XqKDlKqjLrXn0ioF5MH36pT7Z0BRTqLhbk= golang.org/x/net v0.0.0-20210503060351-7fd8e65b6420/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= -golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20201109201403-9fd604954f58/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210220000619-9bb904979d93/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210313182246-cd4f82c27b84/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c h1:pkQiBZBvdos9qq4wBAHqlzuZHEXo07pqV06ef90u1WI= -golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210615190721-d04028783cf1/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210628180205-a41e5a781914 h1:3B43BWw0xEBsLZ/NO1VALz6fppU3481pik+2Ksv45z8= +golang.org/x/oauth2 v0.0.0-20210628180205-a41e5a781914/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -271,8 +180,6 @@ golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -280,18 +187,13 @@ golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200331124033-c3d80250170d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200501052902-10377860bb8e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -299,58 +201,34 @@ golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200905004654-be1d3432aa8f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210104204734-6f8348627aad/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210220050731-9a76102bfb43/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210305230114-8fe3ee5dd75b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210315160823-c6e025ad8005/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210514084401-e8d321eab015/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210603125802-9665404d3644 h1:CA1DEQ4NdKphKeL70tvsWNdT5oFh1lOjihRcEDROi0I= -golang.org/x/sys v0.0.0-20210603125802-9665404d3644/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210616094352-59db8d763f22 h1:RqytpXGR1iVNX7psjB3ff8y7sNFinVFvkx1c8SjBkio= +golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= -golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6 h1:aRYxNxv6iGQlyVaZmk6ZgYEDa+Jg18DxebPSrd6bg1M= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200204074204-1cc6d1ef6c74/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= @@ -358,26 +236,16 @@ golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapK golang.org/x/tools v0.0.0-20200212150539-ea181f53ac56/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200224181240-023911ca70b2/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200227222343-706bc42d1f0d/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= golang.org/x/tools v0.0.0-20200312045724-11d5b4c81c7d/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= golang.org/x/tools v0.0.0-20200331025713-a30bf2db82d4/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.0.0-20200817023811-d00afeaade8f/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200827163409-021d7c6f1ec3/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.0.0-20200904185747-39188db58858/go.mod h1:Cj7w3i3Rnn0Xh82ur9kSqwfTHTeVxaDqrfMjpcNT6bE= -golang.org/x/tools v0.0.0-20201110124207-079ba7bd75cd/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.0.0-20201201161351-ac6f37ff4c2a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.0.0-20201208233053-a543418bbed2/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.4 h1:cVngSRcfgyZCzys3KYOpCFa+4dqX/Oub9tAq00ttGVs= golang.org/x/tools v0.1.4/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -385,9 +253,6 @@ golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= -google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= -google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= google.golang.org/api v0.14.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= @@ -399,43 +264,30 @@ google.golang.org/api v0.20.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/ google.golang.org/api v0.22.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= google.golang.org/api v0.24.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= google.golang.org/api v0.28.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= -google.golang.org/api v0.29.0/go.mod h1:Lcubydp8VUV7KeIHD9z2Bys/sm/vGKnG1UHuDBSrHWM= google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz5138Fc= -google.golang.org/api v0.35.0/go.mod h1:/XrVsuzM0rZmrsbjJutiuftIzeuTQcEeaYcSk/mQ1dg= -google.golang.org/api v0.36.0/go.mod h1:+z5ficQTmoYpPn8LCUNVpK5I7hwkpjbcgqA7I34qYtE= -google.golang.org/api v0.40.0/go.mod h1:fYKFpnQN0DsDSKRVRcQSDQNtqWPfM9i+zNPxepjRCQ8= -google.golang.org/api v0.41.0/go.mod h1:RkxM5lITDfTzmyKFPt+wGrCJbVfniCr2ool8kTBzRTU= -google.golang.org/api v0.43.0/go.mod h1:nQsDGjRXMo4lvh5hP0TKqF244gqhGcr/YSIykhUk/94= -google.golang.org/api v0.47.0/go.mod h1:Wbvgpq1HddcWVtzsVLyfLp8lDg6AA241LmgIL59tHXo= -google.golang.org/api v0.48.0 h1:RDAPWfNFY06dffEXfn7hZF5Fr1ZbnChzfQZAPyBd1+I= -google.golang.org/api v0.48.0/go.mod h1:71Pr1vy+TAZRPkPs/xlCf5SsU8WjuAWv1Pfjbtukyy4= +google.golang.org/api v0.49.0 h1:gjIBDxlTG7vnzMmEnYwTnvLTF8Rjzo+ETCgEX1YZ/fY= +google.golang.org/api v0.49.0/go.mod h1:BECiH72wsfwUvOVn3+btPD5WHi0LzavZReBndi42L18= 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.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c= google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= google.golang.org/genproto v0.0.0-20191115194625-c23dd37a84c9/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20200115191322-ca5a22157cba/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= google.golang.org/genproto v0.0.0-20200122232147-0452cf42e150/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= google.golang.org/genproto v0.0.0-20200204135345-fa8e72b47b90/go.mod h1:GmwEX6Z4W5gMy59cAlVYjN9JhxgbQH6Gn+gFDQe2lzA= google.golang.org/genproto v0.0.0-20200212174721-66ed5ce911ce/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200228133532-8c2c7df3a383/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200305110556-506484158171/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200312145019-da6875a35672/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200331122359-1ee6d9798940/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= @@ -443,26 +295,11 @@ google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfG google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U= google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= -google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20200815001618-f69a88009b70/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20200827165113-ac2560b5e952/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20200904004341-0bd0a958aa1d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20201109203340-2640f1f9cdfb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20201201144952-b05cb90ed32e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20201210142538-e3217bee35cc/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20201214200347-8c77b98c765d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210222152913-aa3ee6e6a81c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210303154014-9728d6b83eeb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210310155132-4ce2db91004e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210319143718-93e7006c17a6/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210402141018-6c239bbf2bb1/go.mod h1:9lPAdzaEmUacj36I+k7YKbEc5CXzPIeORRgDAUOu28A= -google.golang.org/genproto v0.0.0-20210513213006-bf773b8c8384/go.mod h1:P3QM42oQyzQSnHPnZ/vqoCdDmzH28fzWByN9asMeM8A= -google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= -google.golang.org/genproto v0.0.0-20210604141403-392c879c8b08/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= -google.golang.org/genproto v0.0.0-20210608205507-b6d2f5bf0d7d h1:KzwjikDymrEmYYbdyfievTwjEeGlu+OM6oiKBkF3Jfg= -google.golang.org/genproto v0.0.0-20210608205507-b6d2f5bf0d7d/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= +google.golang.org/genproto v0.0.0-20210617175327-b9e0b3197ced/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24= +google.golang.org/genproto v0.0.0-20210629200056-84d6f6074151 h1:H/uPzsolsGjhl3CVT6Wb7bK+mf+hmkEvUVu+FBKyNlc= +google.golang.org/genproto v0.0.0-20210629200056-84d6f6074151/go.mod h1:yiaVoXHpRzHGyxV3o4DktVWY4mSUErTKaeEOq6C3t3U= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= @@ -473,16 +310,9 @@ google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8 google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60= google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= -google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= -google.golang.org/grpc v1.31.1/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= -google.golang.org/grpc v1.34.0/go.mod h1:WotjhfgOW/POjDeRt8vscBtXq+2VjORFy659qA51WJ8= -google.golang.org/grpc v1.35.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= -google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= -google.golang.org/grpc v1.36.1/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= google.golang.org/grpc v1.37.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= -google.golang.org/grpc v1.37.1/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= google.golang.org/grpc v1.38.0 h1:/9BgsAsa5nWe26HqOlvlgJnqBuktYOLCgjCPqsa56W0= google.golang.org/grpc v1.38.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw= @@ -497,8 +327,9 @@ google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpAD google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= -google.golang.org/protobuf v1.26.0 h1:bxAC2xTBsZGibn2RTntX0oH50xLsqy1OxA9tTL3p/lk= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.27.1 h1:SnqbnDw1V7RiZcXPx5MEeqPv2s79L9i7BJUlG/+RurQ= +google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= @@ -508,12 +339,7 @@ gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= -rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= -rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= -rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= diff --git a/logging/go.mod b/logging/go.mod index 947dc0fe49e..f86d8fcfe35 100644 --- a/logging/go.mod +++ b/logging/go.mod @@ -11,7 +11,7 @@ require ( go.opencensus.io v0.23.0 golang.org/x/oauth2 v0.0.0-20210628180205-a41e5a781914 google.golang.org/api v0.49.0 - google.golang.org/genproto v0.0.0-20210624174822-c5cf32407d0a + google.golang.org/genproto v0.0.0-20210629200056-84d6f6074151 google.golang.org/grpc v1.38.0 google.golang.org/protobuf v1.27.1 ) diff --git a/logging/go.sum b/logging/go.sum index 7af34dad03a..5a67c1ea1d1 100644 --- a/logging/go.sum +++ b/logging/go.sum @@ -371,8 +371,9 @@ golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4f golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/tools v0.1.3 h1:L69ShwSZEyCsLKoAxDKeMvLDZkumEe8gXUZAjab0tX8= golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/tools v0.1.4 h1:cVngSRcfgyZCzys3KYOpCFa+4dqX/Oub9tAq00ttGVs= +golang.org/x/tools v0.1.4/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= 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= @@ -455,8 +456,8 @@ google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxH google.golang.org/genproto v0.0.0-20210604141403-392c879c8b08/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= google.golang.org/genproto v0.0.0-20210608205507-b6d2f5bf0d7d/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= google.golang.org/genproto v0.0.0-20210617175327-b9e0b3197ced/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24= -google.golang.org/genproto v0.0.0-20210624174822-c5cf32407d0a h1:b5Bhxmy6Tppar7Yl4J6c6xF33YSBhkm2FtV9/ZQuBkQ= -google.golang.org/genproto v0.0.0-20210624174822-c5cf32407d0a/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24= +google.golang.org/genproto v0.0.0-20210629200056-84d6f6074151 h1:H/uPzsolsGjhl3CVT6Wb7bK+mf+hmkEvUVu+FBKyNlc= +google.golang.org/genproto v0.0.0-20210629200056-84d6f6074151/go.mod h1:yiaVoXHpRzHGyxV3o4DktVWY4mSUErTKaeEOq6C3t3U= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= diff --git a/pubsub/go.mod b/pubsub/go.mod index 8462fdcd223..ca89d5a3f3d 100644 --- a/pubsub/go.mod +++ b/pubsub/go.mod @@ -12,7 +12,7 @@ require ( golang.org/x/sync v0.0.0-20210220032951-036812b2e83c golang.org/x/time v0.0.0-20210611083556-38a9dc6acbc6 google.golang.org/api v0.49.0 - google.golang.org/genproto v0.0.0-20210624174822-c5cf32407d0a + google.golang.org/genproto v0.0.0-20210629200056-84d6f6074151 google.golang.org/grpc v1.38.0 google.golang.org/protobuf v1.27.1 ) diff --git a/pubsub/go.sum b/pubsub/go.sum index af1167b29f2..e1ca5a5cf44 100644 --- a/pubsub/go.sum +++ b/pubsub/go.sum @@ -369,8 +369,9 @@ golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4f golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/tools v0.1.3 h1:L69ShwSZEyCsLKoAxDKeMvLDZkumEe8gXUZAjab0tX8= golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/tools v0.1.4 h1:cVngSRcfgyZCzys3KYOpCFa+4dqX/Oub9tAq00ttGVs= +golang.org/x/tools v0.1.4/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= 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= @@ -453,8 +454,8 @@ google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxH google.golang.org/genproto v0.0.0-20210604141403-392c879c8b08/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= google.golang.org/genproto v0.0.0-20210608205507-b6d2f5bf0d7d/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= google.golang.org/genproto v0.0.0-20210617175327-b9e0b3197ced/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24= -google.golang.org/genproto v0.0.0-20210624174822-c5cf32407d0a h1:b5Bhxmy6Tppar7Yl4J6c6xF33YSBhkm2FtV9/ZQuBkQ= -google.golang.org/genproto v0.0.0-20210624174822-c5cf32407d0a/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24= +google.golang.org/genproto v0.0.0-20210629200056-84d6f6074151 h1:H/uPzsolsGjhl3CVT6Wb7bK+mf+hmkEvUVu+FBKyNlc= +google.golang.org/genproto v0.0.0-20210629200056-84d6f6074151/go.mod h1:yiaVoXHpRzHGyxV3o4DktVWY4mSUErTKaeEOq6C3t3U= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= diff --git a/pubsublite/go.mod b/pubsublite/go.mod index f655870221b..e632bb49b68 100644 --- a/pubsublite/go.mod +++ b/pubsublite/go.mod @@ -12,7 +12,7 @@ require ( golang.org/x/sync v0.0.0-20210220032951-036812b2e83c golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 google.golang.org/api v0.49.0 - google.golang.org/genproto v0.0.0-20210624174822-c5cf32407d0a + google.golang.org/genproto v0.0.0-20210629200056-84d6f6074151 google.golang.org/grpc v1.38.0 google.golang.org/protobuf v1.27.1 ) diff --git a/pubsublite/go.sum b/pubsublite/go.sum index cb361ab194a..f57f8077c1e 100644 --- a/pubsublite/go.sum +++ b/pubsublite/go.sum @@ -374,8 +374,9 @@ golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4f golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/tools v0.1.3 h1:L69ShwSZEyCsLKoAxDKeMvLDZkumEe8gXUZAjab0tX8= golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/tools v0.1.4 h1:cVngSRcfgyZCzys3KYOpCFa+4dqX/Oub9tAq00ttGVs= +golang.org/x/tools v0.1.4/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= 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= @@ -460,8 +461,8 @@ google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxH google.golang.org/genproto v0.0.0-20210604141403-392c879c8b08/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= google.golang.org/genproto v0.0.0-20210608205507-b6d2f5bf0d7d/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= google.golang.org/genproto v0.0.0-20210617175327-b9e0b3197ced/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24= -google.golang.org/genproto v0.0.0-20210624174822-c5cf32407d0a h1:b5Bhxmy6Tppar7Yl4J6c6xF33YSBhkm2FtV9/ZQuBkQ= -google.golang.org/genproto v0.0.0-20210624174822-c5cf32407d0a/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24= +google.golang.org/genproto v0.0.0-20210629200056-84d6f6074151 h1:H/uPzsolsGjhl3CVT6Wb7bK+mf+hmkEvUVu+FBKyNlc= +google.golang.org/genproto v0.0.0-20210629200056-84d6f6074151/go.mod h1:yiaVoXHpRzHGyxV3o4DktVWY4mSUErTKaeEOq6C3t3U= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= diff --git a/servicecontrol/apiv1/doc.go b/servicecontrol/apiv1/doc.go index 01b21c2d93f..4f98398eb1a 100644 --- a/servicecontrol/apiv1/doc.go +++ b/servicecontrol/apiv1/doc.go @@ -17,8 +17,8 @@ // Package servicecontrol is an auto-generated package for the // Service Control API. // -// Provides control plane functionality to managed services, such as logging, -// monitoring, and status checks. +// Provides admission control and telemetry reporting for services integrated +// with Service Infrastructure. // // Use of Context // @@ -49,7 +49,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210624" +const versionClient = "20210629" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/servicecontrol/apiv1/quota_controller_client.go b/servicecontrol/apiv1/quota_controller_client.go index 531210a45b9..da8125e0393 100644 --- a/servicecontrol/apiv1/quota_controller_client.go +++ b/servicecontrol/apiv1/quota_controller_client.go @@ -67,7 +67,7 @@ type internalQuotaControllerClient interface { // QuotaControllerClient is a client for interacting with Service Control API. // Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls. // -// Google Quota Control API (at https://cloud.google.com/service-control/overview) +// Google Quota Control API (at /service-control/overview) // // Allows clients to allocate and release quota against a managed // service (at https://cloud.google.com/service-management/reference/rpc/google.api/servicemanagement.v1#google.api.servicemanagement.v1.ManagedService). @@ -139,7 +139,7 @@ type quotaControllerGRPCClient struct { // NewQuotaControllerClient creates a new quota controller client based on gRPC. // The returned client must be Closed when it is done being used to clean up its underlying connections. // -// Google Quota Control API (at https://cloud.google.com/service-control/overview) +// Google Quota Control API (at /service-control/overview) // // Allows clients to allocate and release quota against a managed // service (at https://cloud.google.com/service-management/reference/rpc/google.api/servicemanagement.v1#google.api.servicemanagement.v1.ManagedService). diff --git a/servicecontrol/apiv1/service_controller_client.go b/servicecontrol/apiv1/service_controller_client.go index e7541ad1428..01985624342 100644 --- a/servicecontrol/apiv1/service_controller_client.go +++ b/servicecontrol/apiv1/service_controller_client.go @@ -70,7 +70,7 @@ type internalServiceControllerClient interface { // ServiceControllerClient is a client for interacting with Service Control API. // Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls. // -// Google Service Control API (at https://cloud.google.com/service-control/overview) +// Google Service Control API (at /service-control/overview) // // Lets clients check and report operations against a managed // service (at https://cloud.google.com/service-management/reference/rpc/google.api/servicemanagement.v1#google.api.servicemanagement.v1.ManagedService). @@ -115,7 +115,8 @@ func (c *ServiceControllerClient) Connection() *grpc.ClientConn { // propagation, therefore callers MUST NOT depend on the Check method having // the latest policy information. // -// NOTE: the CheckRequest has the size limit of 64KB. +// NOTE: the CheckRequest has +// the size limit (wire-format byte size) of 1MB. // // This method requires the servicemanagement.services.check permission // on the specified service. For more information, see @@ -133,8 +134,8 @@ func (c *ServiceControllerClient) Check(ctx context.Context, req *servicecontrol // the aggregation time window to avoid data loss risk more than 0.01% // for business and compliance reasons. // -// NOTE: the ReportRequest has the size limit (wire-format byte size) of -// 1MB. +// NOTE: the ReportRequest has +// the size limit (wire-format byte size) of 1MB. // // This method requires the servicemanagement.services.report permission // on the specified service. For more information, see @@ -166,7 +167,7 @@ type serviceControllerGRPCClient struct { // NewServiceControllerClient creates a new service controller client based on gRPC. // The returned client must be Closed when it is done being used to clean up its underlying connections. // -// Google Service Control API (at https://cloud.google.com/service-control/overview) +// Google Service Control API (at /service-control/overview) // // Lets clients check and report operations against a managed // service (at https://cloud.google.com/service-management/reference/rpc/google.api/servicemanagement.v1#google.api.servicemanagement.v1.ManagedService). diff --git a/spanner/go.mod b/spanner/go.mod index f03220525b0..18144dd6138 100644 --- a/spanner/go.mod +++ b/spanner/go.mod @@ -10,7 +10,7 @@ require ( go.opencensus.io v0.23.0 golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 google.golang.org/api v0.49.0 - google.golang.org/genproto v0.0.0-20210624174822-c5cf32407d0a + google.golang.org/genproto v0.0.0-20210629200056-84d6f6074151 google.golang.org/grpc v1.38.0 google.golang.org/protobuf v1.27.1 ) diff --git a/spanner/go.sum b/spanner/go.sum index 1567ab6a27e..8b897debcbf 100644 --- a/spanner/go.sum +++ b/spanner/go.sum @@ -365,8 +365,9 @@ golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4f golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/tools v0.1.3 h1:L69ShwSZEyCsLKoAxDKeMvLDZkumEe8gXUZAjab0tX8= golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/tools v0.1.4 h1:cVngSRcfgyZCzys3KYOpCFa+4dqX/Oub9tAq00ttGVs= +golang.org/x/tools v0.1.4/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= 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= @@ -449,8 +450,8 @@ google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxH google.golang.org/genproto v0.0.0-20210604141403-392c879c8b08/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= google.golang.org/genproto v0.0.0-20210608205507-b6d2f5bf0d7d/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= google.golang.org/genproto v0.0.0-20210617175327-b9e0b3197ced/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24= -google.golang.org/genproto v0.0.0-20210624174822-c5cf32407d0a h1:b5Bhxmy6Tppar7Yl4J6c6xF33YSBhkm2FtV9/ZQuBkQ= -google.golang.org/genproto v0.0.0-20210624174822-c5cf32407d0a/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24= +google.golang.org/genproto v0.0.0-20210629200056-84d6f6074151 h1:H/uPzsolsGjhl3CVT6Wb7bK+mf+hmkEvUVu+FBKyNlc= +google.golang.org/genproto v0.0.0-20210629200056-84d6f6074151/go.mod h1:yiaVoXHpRzHGyxV3o4DktVWY4mSUErTKaeEOq6C3t3U= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= diff --git a/storage/go.mod b/storage/go.mod index 528ae7da6fc..0e0c8018e85 100644 --- a/storage/go.mod +++ b/storage/go.mod @@ -10,6 +10,6 @@ require ( golang.org/x/oauth2 v0.0.0-20210628180205-a41e5a781914 golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 google.golang.org/api v0.49.0 - google.golang.org/genproto v0.0.0-20210624174822-c5cf32407d0a + google.golang.org/genproto v0.0.0-20210629200056-84d6f6074151 google.golang.org/grpc v1.38.0 ) diff --git a/storage/go.sum b/storage/go.sum index 50ab8d21775..cf41d224d75 100644 --- a/storage/go.sum +++ b/storage/go.sum @@ -369,8 +369,9 @@ golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4f golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/tools v0.1.3 h1:L69ShwSZEyCsLKoAxDKeMvLDZkumEe8gXUZAjab0tX8= golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/tools v0.1.4 h1:cVngSRcfgyZCzys3KYOpCFa+4dqX/Oub9tAq00ttGVs= +golang.org/x/tools v0.1.4/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= 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= @@ -453,8 +454,8 @@ google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxH google.golang.org/genproto v0.0.0-20210604141403-392c879c8b08/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= google.golang.org/genproto v0.0.0-20210608205507-b6d2f5bf0d7d/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= google.golang.org/genproto v0.0.0-20210617175327-b9e0b3197ced/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24= -google.golang.org/genproto v0.0.0-20210624174822-c5cf32407d0a h1:b5Bhxmy6Tppar7Yl4J6c6xF33YSBhkm2FtV9/ZQuBkQ= -google.golang.org/genproto v0.0.0-20210624174822-c5cf32407d0a/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24= +google.golang.org/genproto v0.0.0-20210629200056-84d6f6074151 h1:H/uPzsolsGjhl3CVT6Wb7bK+mf+hmkEvUVu+FBKyNlc= +google.golang.org/genproto v0.0.0-20210629200056-84d6f6074151/go.mod h1:yiaVoXHpRzHGyxV3o4DktVWY4mSUErTKaeEOq6C3t3U= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= @@ -489,8 +490,9 @@ google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpAD google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= -google.golang.org/protobuf v1.26.0 h1:bxAC2xTBsZGibn2RTntX0oH50xLsqy1OxA9tTL3p/lk= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.27.1 h1:SnqbnDw1V7RiZcXPx5MEeqPv2s79L9i7BJUlG/+RurQ= +google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= From cfee36161d41e3a0f769e51ab96c25d0967af273 Mon Sep 17 00:00:00 2001 From: Cody Oss <6331106+codyoss@users.noreply.github.com> Date: Wed, 30 Jun 2021 12:46:34 -0500 Subject: [PATCH 34/50] chore: bulk release clients (#4350) Changes: feat(dataflow): start generating apiv1beta3 feat(datastream): start generating apiv1alpha1 feat(eventarc): start generating apiv1 feat(workflows/executions): start generating apiv1 Release-As: 0.85.0 --- dataflow/apiv1beta3/doc.go | 121 + dataflow/apiv1beta3/flex_templates_client.go | 198 ++ .../flex_templates_client_example_test.go | 55 + dataflow/apiv1beta3/gapic_metadata.json | 153 ++ dataflow/apiv1beta3/jobs_v1_beta3_client.go | 486 ++++ .../jobs_v1_beta3_client_example_test.go | 182 ++ .../apiv1beta3/messages_v1_beta3_client.go | 279 +++ .../messages_v1_beta3_client_example_test.go | 62 + .../apiv1beta3/metrics_v1_beta3_client.go | 407 ++++ .../metrics_v1_beta3_client_example_test.go | 106 + .../apiv1beta3/snapshots_v1_beta3_client.go | 260 +++ .../snapshots_v1_beta3_client_example_test.go | 93 + dataflow/apiv1beta3/templates_client.go | 260 +++ .../templates_client_example_test.go | 93 + datastream/apiv1alpha1/datastream_client.go | 2077 +++++++++++++++++ .../datastream_client_example_test.go | 513 ++++ datastream/apiv1alpha1/doc.go | 116 + datastream/apiv1alpha1/gapic_metadata.json | 123 + eventarc/apiv1/doc.go | 116 + eventarc/apiv1/eventarc_client.go | 631 +++++ .../apiv1/eventarc_client_example_test.go | 153 ++ eventarc/apiv1/gapic_metadata.json | 43 + internal/gapicgen/generator/config.go | 58 +- workflows/executions/apiv1/doc.go | 118 + .../executions/apiv1/executions_client.go | 351 +++ .../apiv1/executions_client_example_test.go | 119 + .../executions/apiv1/gapic_metadata.json | 38 + 27 files changed, 7195 insertions(+), 16 deletions(-) create mode 100644 dataflow/apiv1beta3/doc.go create mode 100644 dataflow/apiv1beta3/flex_templates_client.go create mode 100644 dataflow/apiv1beta3/flex_templates_client_example_test.go create mode 100644 dataflow/apiv1beta3/gapic_metadata.json create mode 100644 dataflow/apiv1beta3/jobs_v1_beta3_client.go create mode 100644 dataflow/apiv1beta3/jobs_v1_beta3_client_example_test.go create mode 100644 dataflow/apiv1beta3/messages_v1_beta3_client.go create mode 100644 dataflow/apiv1beta3/messages_v1_beta3_client_example_test.go create mode 100644 dataflow/apiv1beta3/metrics_v1_beta3_client.go create mode 100644 dataflow/apiv1beta3/metrics_v1_beta3_client_example_test.go create mode 100644 dataflow/apiv1beta3/snapshots_v1_beta3_client.go create mode 100644 dataflow/apiv1beta3/snapshots_v1_beta3_client_example_test.go create mode 100644 dataflow/apiv1beta3/templates_client.go create mode 100644 dataflow/apiv1beta3/templates_client_example_test.go create mode 100644 datastream/apiv1alpha1/datastream_client.go create mode 100644 datastream/apiv1alpha1/datastream_client_example_test.go create mode 100644 datastream/apiv1alpha1/doc.go create mode 100644 datastream/apiv1alpha1/gapic_metadata.json create mode 100644 eventarc/apiv1/doc.go create mode 100644 eventarc/apiv1/eventarc_client.go create mode 100644 eventarc/apiv1/eventarc_client_example_test.go create mode 100644 eventarc/apiv1/gapic_metadata.json create mode 100644 workflows/executions/apiv1/doc.go create mode 100644 workflows/executions/apiv1/executions_client.go create mode 100644 workflows/executions/apiv1/executions_client_example_test.go create mode 100644 workflows/executions/apiv1/gapic_metadata.json diff --git a/dataflow/apiv1beta3/doc.go b/dataflow/apiv1beta3/doc.go new file mode 100644 index 00000000000..850564f3c3a --- /dev/null +++ b/dataflow/apiv1beta3/doc.go @@ -0,0 +1,121 @@ +// Copyright 2021 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 dataflow is an auto-generated package for the +// Dataflow API. +// +// Manages Google Cloud Dataflow projects on Google Cloud Platform. +// +// NOTE: This package is in beta. It is not stable, and may be subject to changes. +// +// Use of Context +// +// The ctx passed to NewClient is used for authentication requests and +// for creating the underlying connection, but is not used for subsequent calls. +// Individual methods on the client use the ctx given to them. +// +// To close the open connection, use the Close() method. +// +// For information about setting deadlines, reusing contexts, and more +// please visit https://pkg.go.dev/cloud.google.com/go. +package dataflow // import "cloud.google.com/go/dataflow/apiv1beta3" + +import ( + "context" + "os" + "runtime" + "strconv" + "strings" + "unicode" + + "google.golang.org/api/option" + "google.golang.org/grpc/metadata" +) + +// For more information on implementing a client constructor hook, see +// https://github.com/googleapis/google-cloud-go/wiki/Customizing-constructors. +type clientHookParams struct{} +type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) + +const versionClient = "UNKNOWN" + +func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { + out, _ := metadata.FromOutgoingContext(ctx) + out = out.Copy() + for _, md := range mds { + for k, v := range md { + out[k] = append(out[k], v...) + } + } + return metadata.NewOutgoingContext(ctx, out) +} + +func checkDisableDeadlines() (bool, error) { + raw, ok := os.LookupEnv("GOOGLE_API_GO_EXPERIMENTAL_DISABLE_DEFAULT_DEADLINE") + if !ok { + return false, nil + } + + b, err := strconv.ParseBool(raw) + return b, err +} + +// DefaultAuthScopes reports the default set of authentication scopes to use with this package. +func DefaultAuthScopes() []string { + return []string{ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly", + "https://www.googleapis.com/auth/userinfo.email", + } +} + +// versionGo returns the Go runtime version. The returned string +// has no whitespace, suitable for reporting in header. +func versionGo() string { + const develPrefix = "devel +" + + s := runtime.Version() + if strings.HasPrefix(s, develPrefix) { + s = s[len(develPrefix):] + if p := strings.IndexFunc(s, unicode.IsSpace); p >= 0 { + s = s[:p] + } + return s + } + + notSemverRune := func(r rune) bool { + return !strings.ContainsRune("0123456789.", r) + } + + if strings.HasPrefix(s, "go1") { + s = s[2:] + var prerelease string + if p := strings.IndexFunc(s, notSemverRune); p >= 0 { + s, prerelease = s[:p], s[p:] + } + if strings.HasSuffix(s, ".") { + s += "0" + } else if strings.Count(s, ".") < 2 { + s += ".0" + } + if prerelease != "" { + s += "-" + prerelease + } + return s + } + return "UNKNOWN" +} diff --git a/dataflow/apiv1beta3/flex_templates_client.go b/dataflow/apiv1beta3/flex_templates_client.go new file mode 100644 index 00000000000..9e7917b2aae --- /dev/null +++ b/dataflow/apiv1beta3/flex_templates_client.go @@ -0,0 +1,198 @@ +// Copyright 2021 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 dataflow + +import ( + "context" + "math" + + gax "github.com/googleapis/gax-go/v2" + "google.golang.org/api/option" + "google.golang.org/api/option/internaloption" + gtransport "google.golang.org/api/transport/grpc" + dataflowpb "google.golang.org/genproto/googleapis/dataflow/v1beta3" + "google.golang.org/grpc" + "google.golang.org/grpc/metadata" +) + +var newFlexTemplatesClientHook clientHook + +// FlexTemplatesCallOptions contains the retry settings for each method of FlexTemplatesClient. +type FlexTemplatesCallOptions struct { + LaunchFlexTemplate []gax.CallOption +} + +func defaultFlexTemplatesGRPCClientOptions() []option.ClientOption { + return []option.ClientOption{ + internaloption.WithDefaultEndpoint("dataflow.googleapis.com:443"), + internaloption.WithDefaultMTLSEndpoint("dataflow.mtls.googleapis.com:443"), + internaloption.WithDefaultAudience("https://dataflow.googleapis.com/"), + internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), + option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), + option.WithGRPCDialOption(grpc.WithDefaultCallOptions( + grpc.MaxCallRecvMsgSize(math.MaxInt32))), + } +} + +func defaultFlexTemplatesCallOptions() *FlexTemplatesCallOptions { + return &FlexTemplatesCallOptions{ + LaunchFlexTemplate: []gax.CallOption{}, + } +} + +// internalFlexTemplatesClient is an interface that defines the methods availaible from Dataflow API. +type internalFlexTemplatesClient interface { + Close() error + setGoogleClientInfo(...string) + Connection() *grpc.ClientConn + LaunchFlexTemplate(context.Context, *dataflowpb.LaunchFlexTemplateRequest, ...gax.CallOption) (*dataflowpb.LaunchFlexTemplateResponse, error) +} + +// FlexTemplatesClient is a client for interacting with Dataflow API. +// Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls. +// +// Provides a service for Flex templates. This feature is not ready yet. +type FlexTemplatesClient struct { + // The internal transport-dependent client. + internalClient internalFlexTemplatesClient + + // The call options for this service. + CallOptions *FlexTemplatesCallOptions +} + +// 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 *FlexTemplatesClient) 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 *FlexTemplatesClient) setGoogleClientInfo(keyval ...string) { + c.internalClient.setGoogleClientInfo(keyval...) +} + +// Connection returns a connection to the API service. +// +// Deprecated. +func (c *FlexTemplatesClient) Connection() *grpc.ClientConn { + return c.internalClient.Connection() +} + +// LaunchFlexTemplate launch a job with a FlexTemplate. +func (c *FlexTemplatesClient) LaunchFlexTemplate(ctx context.Context, req *dataflowpb.LaunchFlexTemplateRequest, opts ...gax.CallOption) (*dataflowpb.LaunchFlexTemplateResponse, error) { + return c.internalClient.LaunchFlexTemplate(ctx, req, opts...) +} + +// flexTemplatesGRPCClient is a client for interacting with Dataflow API over gRPC transport. +// +// Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls. +type flexTemplatesGRPCClient struct { + // Connection pool of gRPC connections to the service. + connPool gtransport.ConnPool + + // flag to opt out of default deadlines via GOOGLE_API_GO_EXPERIMENTAL_DISABLE_DEFAULT_DEADLINE + disableDeadlines bool + + // Points back to the CallOptions field of the containing FlexTemplatesClient + CallOptions **FlexTemplatesCallOptions + + // The gRPC API client. + flexTemplatesClient dataflowpb.FlexTemplatesServiceClient + + // The x-goog-* metadata to be sent with each request. + xGoogMetadata metadata.MD +} + +// NewFlexTemplatesClient creates a new flex templates service client based on gRPC. +// The returned client must be Closed when it is done being used to clean up its underlying connections. +// +// Provides a service for Flex templates. This feature is not ready yet. +func NewFlexTemplatesClient(ctx context.Context, opts ...option.ClientOption) (*FlexTemplatesClient, error) { + clientOpts := defaultFlexTemplatesGRPCClientOptions() + if newFlexTemplatesClientHook != nil { + hookOpts, err := newFlexTemplatesClientHook(ctx, clientHookParams{}) + if err != nil { + return nil, err + } + clientOpts = append(clientOpts, hookOpts...) + } + + disableDeadlines, err := checkDisableDeadlines() + if err != nil { + return nil, err + } + + connPool, err := gtransport.DialPool(ctx, append(clientOpts, opts...)...) + if err != nil { + return nil, err + } + client := FlexTemplatesClient{CallOptions: defaultFlexTemplatesCallOptions()} + + c := &flexTemplatesGRPCClient{ + connPool: connPool, + disableDeadlines: disableDeadlines, + flexTemplatesClient: dataflowpb.NewFlexTemplatesServiceClient(connPool), + CallOptions: &client.CallOptions, + } + c.setGoogleClientInfo() + + client.internalClient = c + + return &client, nil +} + +// Connection returns a connection to the API service. +// +// Deprecated. +func (c *flexTemplatesGRPCClient) Connection() *grpc.ClientConn { + return c.connPool.Conn() +} + +// 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 *flexTemplatesGRPCClient) setGoogleClientInfo(keyval ...string) { + kv := append([]string{"gl-go", versionGo()}, keyval...) + kv = append(kv, "gapic", versionClient, "gax", gax.Version, "grpc", grpc.Version) + c.xGoogMetadata = metadata.Pairs("x-goog-api-client", gax.XGoogHeader(kv...)) +} + +// Close closes the connection to the API service. The user should invoke this when +// the client is no longer required. +func (c *flexTemplatesGRPCClient) Close() error { + return c.connPool.Close() +} + +func (c *flexTemplatesGRPCClient) LaunchFlexTemplate(ctx context.Context, req *dataflowpb.LaunchFlexTemplateRequest, opts ...gax.CallOption) (*dataflowpb.LaunchFlexTemplateResponse, error) { + ctx = insertMetadata(ctx, c.xGoogMetadata) + opts = append((*c.CallOptions).LaunchFlexTemplate[0:len((*c.CallOptions).LaunchFlexTemplate):len((*c.CallOptions).LaunchFlexTemplate)], opts...) + var resp *dataflowpb.LaunchFlexTemplateResponse + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + resp, err = c.flexTemplatesClient.LaunchFlexTemplate(ctx, req, settings.GRPC...) + return err + }, opts...) + if err != nil { + return nil, err + } + return resp, nil +} diff --git a/dataflow/apiv1beta3/flex_templates_client_example_test.go b/dataflow/apiv1beta3/flex_templates_client_example_test.go new file mode 100644 index 00000000000..04876acb107 --- /dev/null +++ b/dataflow/apiv1beta3/flex_templates_client_example_test.go @@ -0,0 +1,55 @@ +// Copyright 2021 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 dataflow_test + +import ( + "context" + + dataflow "cloud.google.com/go/dataflow/apiv1beta3" + dataflowpb "google.golang.org/genproto/googleapis/dataflow/v1beta3" +) + +func ExampleNewFlexTemplatesClient() { + ctx := context.Background() + c, err := dataflow.NewFlexTemplatesClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + // TODO: Use client. + _ = c +} + +func ExampleFlexTemplatesClient_LaunchFlexTemplate() { + ctx := context.Background() + c, err := dataflow.NewFlexTemplatesClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &dataflowpb.LaunchFlexTemplateRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.LaunchFlexTemplate(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} diff --git a/dataflow/apiv1beta3/gapic_metadata.json b/dataflow/apiv1beta3/gapic_metadata.json new file mode 100644 index 00000000000..b918aaea24e --- /dev/null +++ b/dataflow/apiv1beta3/gapic_metadata.json @@ -0,0 +1,153 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.dataflow.v1beta3", + "libraryPackage": "cloud.google.com/go/dataflow/apiv1beta3", + "services": { + "FlexTemplatesService": { + "clients": { + "grpc": { + "libraryClient": "FlexTemplatesClient", + "rpcs": { + "LaunchFlexTemplate": { + "methods": [ + "LaunchFlexTemplate" + ] + } + } + } + } + }, + "JobsV1Beta3": { + "clients": { + "grpc": { + "libraryClient": "JobsV1Beta3Client", + "rpcs": { + "AggregatedListJobs": { + "methods": [ + "AggregatedListJobs" + ] + }, + "CheckActiveJobs": { + "methods": [ + "CheckActiveJobs" + ] + }, + "CreateJob": { + "methods": [ + "CreateJob" + ] + }, + "GetJob": { + "methods": [ + "GetJob" + ] + }, + "ListJobs": { + "methods": [ + "ListJobs" + ] + }, + "SnapshotJob": { + "methods": [ + "SnapshotJob" + ] + }, + "UpdateJob": { + "methods": [ + "UpdateJob" + ] + } + } + } + } + }, + "MessagesV1Beta3": { + "clients": { + "grpc": { + "libraryClient": "MessagesV1Beta3Client", + "rpcs": { + "ListJobMessages": { + "methods": [ + "ListJobMessages" + ] + } + } + } + } + }, + "MetricsV1Beta3": { + "clients": { + "grpc": { + "libraryClient": "MetricsV1Beta3Client", + "rpcs": { + "GetJobExecutionDetails": { + "methods": [ + "GetJobExecutionDetails" + ] + }, + "GetJobMetrics": { + "methods": [ + "GetJobMetrics" + ] + }, + "GetStageExecutionDetails": { + "methods": [ + "GetStageExecutionDetails" + ] + } + } + } + } + }, + "SnapshotsV1Beta3": { + "clients": { + "grpc": { + "libraryClient": "SnapshotsV1Beta3Client", + "rpcs": { + "DeleteSnapshot": { + "methods": [ + "DeleteSnapshot" + ] + }, + "GetSnapshot": { + "methods": [ + "GetSnapshot" + ] + }, + "ListSnapshots": { + "methods": [ + "ListSnapshots" + ] + } + } + } + } + }, + "TemplatesService": { + "clients": { + "grpc": { + "libraryClient": "TemplatesClient", + "rpcs": { + "CreateJobFromTemplate": { + "methods": [ + "CreateJobFromTemplate" + ] + }, + "GetTemplate": { + "methods": [ + "GetTemplate" + ] + }, + "LaunchTemplate": { + "methods": [ + "LaunchTemplate" + ] + } + } + } + } + } + } +} diff --git a/dataflow/apiv1beta3/jobs_v1_beta3_client.go b/dataflow/apiv1beta3/jobs_v1_beta3_client.go new file mode 100644 index 00000000000..e477258d858 --- /dev/null +++ b/dataflow/apiv1beta3/jobs_v1_beta3_client.go @@ -0,0 +1,486 @@ +// Copyright 2021 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 dataflow + +import ( + "context" + "math" + "time" + + gax "github.com/googleapis/gax-go/v2" + "google.golang.org/api/iterator" + "google.golang.org/api/option" + "google.golang.org/api/option/internaloption" + gtransport "google.golang.org/api/transport/grpc" + dataflowpb "google.golang.org/genproto/googleapis/dataflow/v1beta3" + "google.golang.org/grpc" + "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/proto" +) + +var newJobsV1Beta3ClientHook clientHook + +// JobsV1Beta3CallOptions contains the retry settings for each method of JobsV1Beta3Client. +type JobsV1Beta3CallOptions struct { + CreateJob []gax.CallOption + GetJob []gax.CallOption + UpdateJob []gax.CallOption + ListJobs []gax.CallOption + AggregatedListJobs []gax.CallOption + CheckActiveJobs []gax.CallOption + SnapshotJob []gax.CallOption +} + +func defaultJobsV1Beta3GRPCClientOptions() []option.ClientOption { + return []option.ClientOption{ + internaloption.WithDefaultEndpoint("dataflow.googleapis.com:443"), + internaloption.WithDefaultMTLSEndpoint("dataflow.mtls.googleapis.com:443"), + internaloption.WithDefaultAudience("https://dataflow.googleapis.com/"), + internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), + option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), + option.WithGRPCDialOption(grpc.WithDefaultCallOptions( + grpc.MaxCallRecvMsgSize(math.MaxInt32))), + } +} + +func defaultJobsV1Beta3CallOptions() *JobsV1Beta3CallOptions { + return &JobsV1Beta3CallOptions{ + CreateJob: []gax.CallOption{}, + GetJob: []gax.CallOption{}, + UpdateJob: []gax.CallOption{}, + ListJobs: []gax.CallOption{}, + AggregatedListJobs: []gax.CallOption{}, + CheckActiveJobs: []gax.CallOption{}, + SnapshotJob: []gax.CallOption{}, + } +} + +// internalJobsV1Beta3Client is an interface that defines the methods availaible from Dataflow API. +type internalJobsV1Beta3Client interface { + Close() error + setGoogleClientInfo(...string) + Connection() *grpc.ClientConn + CreateJob(context.Context, *dataflowpb.CreateJobRequest, ...gax.CallOption) (*dataflowpb.Job, error) + GetJob(context.Context, *dataflowpb.GetJobRequest, ...gax.CallOption) (*dataflowpb.Job, error) + UpdateJob(context.Context, *dataflowpb.UpdateJobRequest, ...gax.CallOption) (*dataflowpb.Job, error) + ListJobs(context.Context, *dataflowpb.ListJobsRequest, ...gax.CallOption) *JobIterator + AggregatedListJobs(context.Context, *dataflowpb.ListJobsRequest, ...gax.CallOption) *JobIterator + CheckActiveJobs(context.Context, *dataflowpb.CheckActiveJobsRequest, ...gax.CallOption) (*dataflowpb.CheckActiveJobsResponse, error) + SnapshotJob(context.Context, *dataflowpb.SnapshotJobRequest, ...gax.CallOption) (*dataflowpb.Snapshot, error) +} + +// JobsV1Beta3Client is a client for interacting with Dataflow API. +// Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls. +// +// Provides a method to create and modify Google Cloud Dataflow jobs. +// A Job is a multi-stage computation graph run by the Cloud Dataflow service. +type JobsV1Beta3Client struct { + // The internal transport-dependent client. + internalClient internalJobsV1Beta3Client + + // The call options for this service. + CallOptions *JobsV1Beta3CallOptions +} + +// 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 *JobsV1Beta3Client) 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 *JobsV1Beta3Client) setGoogleClientInfo(keyval ...string) { + c.internalClient.setGoogleClientInfo(keyval...) +} + +// Connection returns a connection to the API service. +// +// Deprecated. +func (c *JobsV1Beta3Client) Connection() *grpc.ClientConn { + return c.internalClient.Connection() +} + +// CreateJob creates a Cloud Dataflow job. +// +// To create a job, we recommend using projects.locations.jobs.create with a +// [regional endpoint] +// (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints (at https://cloud.google.com/dataflow/docs/concepts/regional-endpoints)). Using +// projects.jobs.create is not recommended, as your job will always start +// in us-central1. +func (c *JobsV1Beta3Client) CreateJob(ctx context.Context, req *dataflowpb.CreateJobRequest, opts ...gax.CallOption) (*dataflowpb.Job, error) { + return c.internalClient.CreateJob(ctx, req, opts...) +} + +// GetJob gets the state of the specified Cloud Dataflow job. +// +// To get the state of a job, we recommend using projects.locations.jobs.get +// with a [regional endpoint] +// (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints (at https://cloud.google.com/dataflow/docs/concepts/regional-endpoints)). Using +// projects.jobs.get is not recommended, as you can only get the state of +// jobs that are running in us-central1. +func (c *JobsV1Beta3Client) GetJob(ctx context.Context, req *dataflowpb.GetJobRequest, opts ...gax.CallOption) (*dataflowpb.Job, error) { + return c.internalClient.GetJob(ctx, req, opts...) +} + +// UpdateJob updates the state of an existing Cloud Dataflow job. +// +// To update the state of an existing job, we recommend using +// projects.locations.jobs.update with a [regional endpoint] +// (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints (at https://cloud.google.com/dataflow/docs/concepts/regional-endpoints)). Using +// projects.jobs.update is not recommended, as you can only update the state +// of jobs that are running in us-central1. +func (c *JobsV1Beta3Client) UpdateJob(ctx context.Context, req *dataflowpb.UpdateJobRequest, opts ...gax.CallOption) (*dataflowpb.Job, error) { + return c.internalClient.UpdateJob(ctx, req, opts...) +} + +// ListJobs list the jobs of a project. +// +// To list the jobs of a project in a region, we recommend using +// projects.locations.jobs.list with a [regional endpoint] +// (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints (at https://cloud.google.com/dataflow/docs/concepts/regional-endpoints)). To +// list the all jobs across all regions, use projects.jobs.aggregated. Using +// projects.jobs.list is not recommended, as you can only get the list of +// jobs that are running in us-central1. +func (c *JobsV1Beta3Client) ListJobs(ctx context.Context, req *dataflowpb.ListJobsRequest, opts ...gax.CallOption) *JobIterator { + return c.internalClient.ListJobs(ctx, req, opts...) +} + +// AggregatedListJobs list the jobs of a project across all regions. +func (c *JobsV1Beta3Client) AggregatedListJobs(ctx context.Context, req *dataflowpb.ListJobsRequest, opts ...gax.CallOption) *JobIterator { + return c.internalClient.AggregatedListJobs(ctx, req, opts...) +} + +// CheckActiveJobs check for existence of active jobs in the given project across all regions. +func (c *JobsV1Beta3Client) CheckActiveJobs(ctx context.Context, req *dataflowpb.CheckActiveJobsRequest, opts ...gax.CallOption) (*dataflowpb.CheckActiveJobsResponse, error) { + return c.internalClient.CheckActiveJobs(ctx, req, opts...) +} + +// SnapshotJob snapshot the state of a streaming job. +func (c *JobsV1Beta3Client) SnapshotJob(ctx context.Context, req *dataflowpb.SnapshotJobRequest, opts ...gax.CallOption) (*dataflowpb.Snapshot, error) { + return c.internalClient.SnapshotJob(ctx, req, opts...) +} + +// jobsV1Beta3GRPCClient is a client for interacting with Dataflow API over gRPC transport. +// +// Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls. +type jobsV1Beta3GRPCClient struct { + // Connection pool of gRPC connections to the service. + connPool gtransport.ConnPool + + // flag to opt out of default deadlines via GOOGLE_API_GO_EXPERIMENTAL_DISABLE_DEFAULT_DEADLINE + disableDeadlines bool + + // Points back to the CallOptions field of the containing JobsV1Beta3Client + CallOptions **JobsV1Beta3CallOptions + + // The gRPC API client. + jobsV1Beta3Client dataflowpb.JobsV1Beta3Client + + // The x-goog-* metadata to be sent with each request. + xGoogMetadata metadata.MD +} + +// NewJobsV1Beta3Client creates a new jobs v1 beta3 client based on gRPC. +// The returned client must be Closed when it is done being used to clean up its underlying connections. +// +// Provides a method to create and modify Google Cloud Dataflow jobs. +// A Job is a multi-stage computation graph run by the Cloud Dataflow service. +func NewJobsV1Beta3Client(ctx context.Context, opts ...option.ClientOption) (*JobsV1Beta3Client, error) { + clientOpts := defaultJobsV1Beta3GRPCClientOptions() + if newJobsV1Beta3ClientHook != nil { + hookOpts, err := newJobsV1Beta3ClientHook(ctx, clientHookParams{}) + if err != nil { + return nil, err + } + clientOpts = append(clientOpts, hookOpts...) + } + + disableDeadlines, err := checkDisableDeadlines() + if err != nil { + return nil, err + } + + connPool, err := gtransport.DialPool(ctx, append(clientOpts, opts...)...) + if err != nil { + return nil, err + } + client := JobsV1Beta3Client{CallOptions: defaultJobsV1Beta3CallOptions()} + + c := &jobsV1Beta3GRPCClient{ + connPool: connPool, + disableDeadlines: disableDeadlines, + jobsV1Beta3Client: dataflowpb.NewJobsV1Beta3Client(connPool), + CallOptions: &client.CallOptions, + } + c.setGoogleClientInfo() + + client.internalClient = c + + return &client, nil +} + +// Connection returns a connection to the API service. +// +// Deprecated. +func (c *jobsV1Beta3GRPCClient) Connection() *grpc.ClientConn { + return c.connPool.Conn() +} + +// 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 *jobsV1Beta3GRPCClient) setGoogleClientInfo(keyval ...string) { + kv := append([]string{"gl-go", versionGo()}, keyval...) + kv = append(kv, "gapic", versionClient, "gax", gax.Version, "grpc", grpc.Version) + c.xGoogMetadata = metadata.Pairs("x-goog-api-client", gax.XGoogHeader(kv...)) +} + +// Close closes the connection to the API service. The user should invoke this when +// the client is no longer required. +func (c *jobsV1Beta3GRPCClient) Close() error { + return c.connPool.Close() +} + +func (c *jobsV1Beta3GRPCClient) CreateJob(ctx context.Context, req *dataflowpb.CreateJobRequest, opts ...gax.CallOption) (*dataflowpb.Job, error) { + if _, ok := ctx.Deadline(); !ok && !c.disableDeadlines { + cctx, cancel := context.WithTimeout(ctx, 60000*time.Millisecond) + defer cancel() + ctx = cctx + } + ctx = insertMetadata(ctx, c.xGoogMetadata) + opts = append((*c.CallOptions).CreateJob[0:len((*c.CallOptions).CreateJob):len((*c.CallOptions).CreateJob)], opts...) + var resp *dataflowpb.Job + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + resp, err = c.jobsV1Beta3Client.CreateJob(ctx, req, settings.GRPC...) + return err + }, opts...) + if err != nil { + return nil, err + } + return resp, nil +} + +func (c *jobsV1Beta3GRPCClient) GetJob(ctx context.Context, req *dataflowpb.GetJobRequest, opts ...gax.CallOption) (*dataflowpb.Job, error) { + if _, ok := ctx.Deadline(); !ok && !c.disableDeadlines { + cctx, cancel := context.WithTimeout(ctx, 60000*time.Millisecond) + defer cancel() + ctx = cctx + } + ctx = insertMetadata(ctx, c.xGoogMetadata) + opts = append((*c.CallOptions).GetJob[0:len((*c.CallOptions).GetJob):len((*c.CallOptions).GetJob)], opts...) + var resp *dataflowpb.Job + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + resp, err = c.jobsV1Beta3Client.GetJob(ctx, req, settings.GRPC...) + return err + }, opts...) + if err != nil { + return nil, err + } + return resp, nil +} + +func (c *jobsV1Beta3GRPCClient) UpdateJob(ctx context.Context, req *dataflowpb.UpdateJobRequest, opts ...gax.CallOption) (*dataflowpb.Job, error) { + if _, ok := ctx.Deadline(); !ok && !c.disableDeadlines { + cctx, cancel := context.WithTimeout(ctx, 60000*time.Millisecond) + defer cancel() + ctx = cctx + } + ctx = insertMetadata(ctx, c.xGoogMetadata) + opts = append((*c.CallOptions).UpdateJob[0:len((*c.CallOptions).UpdateJob):len((*c.CallOptions).UpdateJob)], opts...) + var resp *dataflowpb.Job + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + resp, err = c.jobsV1Beta3Client.UpdateJob(ctx, req, settings.GRPC...) + return err + }, opts...) + if err != nil { + return nil, err + } + return resp, nil +} + +func (c *jobsV1Beta3GRPCClient) ListJobs(ctx context.Context, req *dataflowpb.ListJobsRequest, opts ...gax.CallOption) *JobIterator { + ctx = insertMetadata(ctx, c.xGoogMetadata) + opts = append((*c.CallOptions).ListJobs[0:len((*c.CallOptions).ListJobs):len((*c.CallOptions).ListJobs)], opts...) + it := &JobIterator{} + req = proto.Clone(req).(*dataflowpb.ListJobsRequest) + it.InternalFetch = func(pageSize int, pageToken string) ([]*dataflowpb.Job, string, error) { + var resp *dataflowpb.ListJobsResponse + req.PageToken = pageToken + if pageSize > math.MaxInt32 { + req.PageSize = math.MaxInt32 + } else { + req.PageSize = int32(pageSize) + } + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + resp, err = c.jobsV1Beta3Client.ListJobs(ctx, req, settings.GRPC...) + return err + }, opts...) + if err != nil { + return nil, "", err + } + + it.Response = resp + return resp.GetJobs(), 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.GetPageSize()) + it.pageInfo.Token = req.GetPageToken() + return it +} + +func (c *jobsV1Beta3GRPCClient) AggregatedListJobs(ctx context.Context, req *dataflowpb.ListJobsRequest, opts ...gax.CallOption) *JobIterator { + ctx = insertMetadata(ctx, c.xGoogMetadata) + opts = append((*c.CallOptions).AggregatedListJobs[0:len((*c.CallOptions).AggregatedListJobs):len((*c.CallOptions).AggregatedListJobs)], opts...) + it := &JobIterator{} + req = proto.Clone(req).(*dataflowpb.ListJobsRequest) + it.InternalFetch = func(pageSize int, pageToken string) ([]*dataflowpb.Job, string, error) { + var resp *dataflowpb.ListJobsResponse + req.PageToken = pageToken + if pageSize > math.MaxInt32 { + req.PageSize = math.MaxInt32 + } else { + req.PageSize = int32(pageSize) + } + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + resp, err = c.jobsV1Beta3Client.AggregatedListJobs(ctx, req, settings.GRPC...) + return err + }, opts...) + if err != nil { + return nil, "", err + } + + it.Response = resp + return resp.GetJobs(), 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.GetPageSize()) + it.pageInfo.Token = req.GetPageToken() + return it +} + +func (c *jobsV1Beta3GRPCClient) CheckActiveJobs(ctx context.Context, req *dataflowpb.CheckActiveJobsRequest, opts ...gax.CallOption) (*dataflowpb.CheckActiveJobsResponse, error) { + if _, ok := ctx.Deadline(); !ok && !c.disableDeadlines { + cctx, cancel := context.WithTimeout(ctx, 60000*time.Millisecond) + defer cancel() + ctx = cctx + } + ctx = insertMetadata(ctx, c.xGoogMetadata) + opts = append((*c.CallOptions).CheckActiveJobs[0:len((*c.CallOptions).CheckActiveJobs):len((*c.CallOptions).CheckActiveJobs)], opts...) + var resp *dataflowpb.CheckActiveJobsResponse + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + resp, err = c.jobsV1Beta3Client.CheckActiveJobs(ctx, req, settings.GRPC...) + return err + }, opts...) + if err != nil { + return nil, err + } + return resp, nil +} + +func (c *jobsV1Beta3GRPCClient) SnapshotJob(ctx context.Context, req *dataflowpb.SnapshotJobRequest, opts ...gax.CallOption) (*dataflowpb.Snapshot, error) { + if _, ok := ctx.Deadline(); !ok && !c.disableDeadlines { + cctx, cancel := context.WithTimeout(ctx, 60000*time.Millisecond) + defer cancel() + ctx = cctx + } + ctx = insertMetadata(ctx, c.xGoogMetadata) + opts = append((*c.CallOptions).SnapshotJob[0:len((*c.CallOptions).SnapshotJob):len((*c.CallOptions).SnapshotJob)], opts...) + var resp *dataflowpb.Snapshot + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + resp, err = c.jobsV1Beta3Client.SnapshotJob(ctx, req, settings.GRPC...) + return err + }, opts...) + if err != nil { + return nil, err + } + return resp, nil +} + +// JobIterator manages a stream of *dataflowpb.Job. +type JobIterator struct { + items []*dataflowpb.Job + 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 []*dataflowpb.Job, nextPageToken string, err error) +} + +// PageInfo supports pagination. See the google.golang.org/api/iterator package for details. +func (it *JobIterator) 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 *JobIterator) Next() (*dataflowpb.Job, error) { + var item *dataflowpb.Job + if err := it.nextFunc(); err != nil { + return item, err + } + item = it.items[0] + it.items = it.items[1:] + return item, nil +} + +func (it *JobIterator) bufLen() int { + return len(it.items) +} + +func (it *JobIterator) takeBuf() interface{} { + b := it.items + it.items = nil + return b +} diff --git a/dataflow/apiv1beta3/jobs_v1_beta3_client_example_test.go b/dataflow/apiv1beta3/jobs_v1_beta3_client_example_test.go new file mode 100644 index 00000000000..101dc40be89 --- /dev/null +++ b/dataflow/apiv1beta3/jobs_v1_beta3_client_example_test.go @@ -0,0 +1,182 @@ +// Copyright 2021 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 dataflow_test + +import ( + "context" + + dataflow "cloud.google.com/go/dataflow/apiv1beta3" + "google.golang.org/api/iterator" + dataflowpb "google.golang.org/genproto/googleapis/dataflow/v1beta3" +) + +func ExampleNewJobsV1Beta3Client() { + ctx := context.Background() + c, err := dataflow.NewJobsV1Beta3Client(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + // TODO: Use client. + _ = c +} + +func ExampleJobsV1Beta3Client_CreateJob() { + ctx := context.Background() + c, err := dataflow.NewJobsV1Beta3Client(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &dataflowpb.CreateJobRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.CreateJob(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleJobsV1Beta3Client_GetJob() { + ctx := context.Background() + c, err := dataflow.NewJobsV1Beta3Client(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &dataflowpb.GetJobRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.GetJob(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleJobsV1Beta3Client_UpdateJob() { + ctx := context.Background() + c, err := dataflow.NewJobsV1Beta3Client(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &dataflowpb.UpdateJobRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.UpdateJob(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleJobsV1Beta3Client_ListJobs() { + ctx := context.Background() + c, err := dataflow.NewJobsV1Beta3Client(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &dataflowpb.ListJobsRequest{ + // TODO: Fill request struct fields. + } + it := c.ListJobs(ctx, req) + for { + resp, err := it.Next() + if err == iterator.Done { + break + } + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp + } +} + +func ExampleJobsV1Beta3Client_AggregatedListJobs() { + ctx := context.Background() + c, err := dataflow.NewJobsV1Beta3Client(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &dataflowpb.ListJobsRequest{ + // TODO: Fill request struct fields. + } + it := c.AggregatedListJobs(ctx, req) + for { + resp, err := it.Next() + if err == iterator.Done { + break + } + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp + } +} + +func ExampleJobsV1Beta3Client_CheckActiveJobs() { + ctx := context.Background() + c, err := dataflow.NewJobsV1Beta3Client(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &dataflowpb.CheckActiveJobsRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.CheckActiveJobs(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleJobsV1Beta3Client_SnapshotJob() { + ctx := context.Background() + c, err := dataflow.NewJobsV1Beta3Client(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &dataflowpb.SnapshotJobRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.SnapshotJob(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} diff --git a/dataflow/apiv1beta3/messages_v1_beta3_client.go b/dataflow/apiv1beta3/messages_v1_beta3_client.go new file mode 100644 index 00000000000..cc2ccb08df0 --- /dev/null +++ b/dataflow/apiv1beta3/messages_v1_beta3_client.go @@ -0,0 +1,279 @@ +// Copyright 2021 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 dataflow + +import ( + "context" + "math" + + gax "github.com/googleapis/gax-go/v2" + "google.golang.org/api/iterator" + "google.golang.org/api/option" + "google.golang.org/api/option/internaloption" + gtransport "google.golang.org/api/transport/grpc" + dataflowpb "google.golang.org/genproto/googleapis/dataflow/v1beta3" + "google.golang.org/grpc" + "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/proto" +) + +var newMessagesV1Beta3ClientHook clientHook + +// MessagesV1Beta3CallOptions contains the retry settings for each method of MessagesV1Beta3Client. +type MessagesV1Beta3CallOptions struct { + ListJobMessages []gax.CallOption +} + +func defaultMessagesV1Beta3GRPCClientOptions() []option.ClientOption { + return []option.ClientOption{ + internaloption.WithDefaultEndpoint("dataflow.googleapis.com:443"), + internaloption.WithDefaultMTLSEndpoint("dataflow.mtls.googleapis.com:443"), + internaloption.WithDefaultAudience("https://dataflow.googleapis.com/"), + internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), + option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), + option.WithGRPCDialOption(grpc.WithDefaultCallOptions( + grpc.MaxCallRecvMsgSize(math.MaxInt32))), + } +} + +func defaultMessagesV1Beta3CallOptions() *MessagesV1Beta3CallOptions { + return &MessagesV1Beta3CallOptions{ + ListJobMessages: []gax.CallOption{}, + } +} + +// internalMessagesV1Beta3Client is an interface that defines the methods availaible from Dataflow API. +type internalMessagesV1Beta3Client interface { + Close() error + setGoogleClientInfo(...string) + Connection() *grpc.ClientConn + ListJobMessages(context.Context, *dataflowpb.ListJobMessagesRequest, ...gax.CallOption) *JobMessageIterator +} + +// MessagesV1Beta3Client is a client for interacting with Dataflow API. +// Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls. +// +// The Dataflow Messages API is used for monitoring the progress of +// Dataflow jobs. +type MessagesV1Beta3Client struct { + // The internal transport-dependent client. + internalClient internalMessagesV1Beta3Client + + // The call options for this service. + CallOptions *MessagesV1Beta3CallOptions +} + +// 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 *MessagesV1Beta3Client) 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 *MessagesV1Beta3Client) setGoogleClientInfo(keyval ...string) { + c.internalClient.setGoogleClientInfo(keyval...) +} + +// Connection returns a connection to the API service. +// +// Deprecated. +func (c *MessagesV1Beta3Client) Connection() *grpc.ClientConn { + return c.internalClient.Connection() +} + +// ListJobMessages request the job status. +// +// To request the status of a job, we recommend using +// projects.locations.jobs.messages.list with a [regional endpoint] +// (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints (at https://cloud.google.com/dataflow/docs/concepts/regional-endpoints)). Using +// projects.jobs.messages.list is not recommended, as you can only request +// the status of jobs that are running in us-central1. +func (c *MessagesV1Beta3Client) ListJobMessages(ctx context.Context, req *dataflowpb.ListJobMessagesRequest, opts ...gax.CallOption) *JobMessageIterator { + return c.internalClient.ListJobMessages(ctx, req, opts...) +} + +// messagesV1Beta3GRPCClient is a client for interacting with Dataflow API over gRPC transport. +// +// Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls. +type messagesV1Beta3GRPCClient struct { + // Connection pool of gRPC connections to the service. + connPool gtransport.ConnPool + + // flag to opt out of default deadlines via GOOGLE_API_GO_EXPERIMENTAL_DISABLE_DEFAULT_DEADLINE + disableDeadlines bool + + // Points back to the CallOptions field of the containing MessagesV1Beta3Client + CallOptions **MessagesV1Beta3CallOptions + + // The gRPC API client. + messagesV1Beta3Client dataflowpb.MessagesV1Beta3Client + + // The x-goog-* metadata to be sent with each request. + xGoogMetadata metadata.MD +} + +// NewMessagesV1Beta3Client creates a new messages v1 beta3 client based on gRPC. +// The returned client must be Closed when it is done being used to clean up its underlying connections. +// +// The Dataflow Messages API is used for monitoring the progress of +// Dataflow jobs. +func NewMessagesV1Beta3Client(ctx context.Context, opts ...option.ClientOption) (*MessagesV1Beta3Client, error) { + clientOpts := defaultMessagesV1Beta3GRPCClientOptions() + if newMessagesV1Beta3ClientHook != nil { + hookOpts, err := newMessagesV1Beta3ClientHook(ctx, clientHookParams{}) + if err != nil { + return nil, err + } + clientOpts = append(clientOpts, hookOpts...) + } + + disableDeadlines, err := checkDisableDeadlines() + if err != nil { + return nil, err + } + + connPool, err := gtransport.DialPool(ctx, append(clientOpts, opts...)...) + if err != nil { + return nil, err + } + client := MessagesV1Beta3Client{CallOptions: defaultMessagesV1Beta3CallOptions()} + + c := &messagesV1Beta3GRPCClient{ + connPool: connPool, + disableDeadlines: disableDeadlines, + messagesV1Beta3Client: dataflowpb.NewMessagesV1Beta3Client(connPool), + CallOptions: &client.CallOptions, + } + c.setGoogleClientInfo() + + client.internalClient = c + + return &client, nil +} + +// Connection returns a connection to the API service. +// +// Deprecated. +func (c *messagesV1Beta3GRPCClient) Connection() *grpc.ClientConn { + return c.connPool.Conn() +} + +// 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 *messagesV1Beta3GRPCClient) setGoogleClientInfo(keyval ...string) { + kv := append([]string{"gl-go", versionGo()}, keyval...) + kv = append(kv, "gapic", versionClient, "gax", gax.Version, "grpc", grpc.Version) + c.xGoogMetadata = metadata.Pairs("x-goog-api-client", gax.XGoogHeader(kv...)) +} + +// Close closes the connection to the API service. The user should invoke this when +// the client is no longer required. +func (c *messagesV1Beta3GRPCClient) Close() error { + return c.connPool.Close() +} + +func (c *messagesV1Beta3GRPCClient) ListJobMessages(ctx context.Context, req *dataflowpb.ListJobMessagesRequest, opts ...gax.CallOption) *JobMessageIterator { + ctx = insertMetadata(ctx, c.xGoogMetadata) + opts = append((*c.CallOptions).ListJobMessages[0:len((*c.CallOptions).ListJobMessages):len((*c.CallOptions).ListJobMessages)], opts...) + it := &JobMessageIterator{} + req = proto.Clone(req).(*dataflowpb.ListJobMessagesRequest) + it.InternalFetch = func(pageSize int, pageToken string) ([]*dataflowpb.JobMessage, string, error) { + var resp *dataflowpb.ListJobMessagesResponse + req.PageToken = pageToken + if pageSize > math.MaxInt32 { + req.PageSize = math.MaxInt32 + } else { + req.PageSize = int32(pageSize) + } + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + resp, err = c.messagesV1Beta3Client.ListJobMessages(ctx, req, settings.GRPC...) + return err + }, opts...) + if err != nil { + return nil, "", err + } + + it.Response = resp + return resp.GetJobMessages(), 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.GetPageSize()) + it.pageInfo.Token = req.GetPageToken() + return it +} + +// JobMessageIterator manages a stream of *dataflowpb.JobMessage. +type JobMessageIterator struct { + items []*dataflowpb.JobMessage + 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 []*dataflowpb.JobMessage, nextPageToken string, err error) +} + +// PageInfo supports pagination. See the google.golang.org/api/iterator package for details. +func (it *JobMessageIterator) 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 *JobMessageIterator) Next() (*dataflowpb.JobMessage, error) { + var item *dataflowpb.JobMessage + if err := it.nextFunc(); err != nil { + return item, err + } + item = it.items[0] + it.items = it.items[1:] + return item, nil +} + +func (it *JobMessageIterator) bufLen() int { + return len(it.items) +} + +func (it *JobMessageIterator) takeBuf() interface{} { + b := it.items + it.items = nil + return b +} diff --git a/dataflow/apiv1beta3/messages_v1_beta3_client_example_test.go b/dataflow/apiv1beta3/messages_v1_beta3_client_example_test.go new file mode 100644 index 00000000000..d07cbb34975 --- /dev/null +++ b/dataflow/apiv1beta3/messages_v1_beta3_client_example_test.go @@ -0,0 +1,62 @@ +// Copyright 2021 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 dataflow_test + +import ( + "context" + + dataflow "cloud.google.com/go/dataflow/apiv1beta3" + "google.golang.org/api/iterator" + dataflowpb "google.golang.org/genproto/googleapis/dataflow/v1beta3" +) + +func ExampleNewMessagesV1Beta3Client() { + ctx := context.Background() + c, err := dataflow.NewMessagesV1Beta3Client(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + // TODO: Use client. + _ = c +} + +func ExampleMessagesV1Beta3Client_ListJobMessages() { + ctx := context.Background() + c, err := dataflow.NewMessagesV1Beta3Client(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &dataflowpb.ListJobMessagesRequest{ + // TODO: Fill request struct fields. + } + it := c.ListJobMessages(ctx, req) + for { + resp, err := it.Next() + if err == iterator.Done { + break + } + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp + } +} diff --git a/dataflow/apiv1beta3/metrics_v1_beta3_client.go b/dataflow/apiv1beta3/metrics_v1_beta3_client.go new file mode 100644 index 00000000000..76bf3af545b --- /dev/null +++ b/dataflow/apiv1beta3/metrics_v1_beta3_client.go @@ -0,0 +1,407 @@ +// Copyright 2021 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 dataflow + +import ( + "context" + "math" + "time" + + gax "github.com/googleapis/gax-go/v2" + "google.golang.org/api/iterator" + "google.golang.org/api/option" + "google.golang.org/api/option/internaloption" + gtransport "google.golang.org/api/transport/grpc" + dataflowpb "google.golang.org/genproto/googleapis/dataflow/v1beta3" + "google.golang.org/grpc" + "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/proto" +) + +var newMetricsV1Beta3ClientHook clientHook + +// MetricsV1Beta3CallOptions contains the retry settings for each method of MetricsV1Beta3Client. +type MetricsV1Beta3CallOptions struct { + GetJobMetrics []gax.CallOption + GetJobExecutionDetails []gax.CallOption + GetStageExecutionDetails []gax.CallOption +} + +func defaultMetricsV1Beta3GRPCClientOptions() []option.ClientOption { + return []option.ClientOption{ + internaloption.WithDefaultEndpoint("dataflow.googleapis.com:443"), + internaloption.WithDefaultMTLSEndpoint("dataflow.mtls.googleapis.com:443"), + internaloption.WithDefaultAudience("https://dataflow.googleapis.com/"), + internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), + option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), + option.WithGRPCDialOption(grpc.WithDefaultCallOptions( + grpc.MaxCallRecvMsgSize(math.MaxInt32))), + } +} + +func defaultMetricsV1Beta3CallOptions() *MetricsV1Beta3CallOptions { + return &MetricsV1Beta3CallOptions{ + GetJobMetrics: []gax.CallOption{}, + GetJobExecutionDetails: []gax.CallOption{}, + GetStageExecutionDetails: []gax.CallOption{}, + } +} + +// internalMetricsV1Beta3Client is an interface that defines the methods availaible from Dataflow API. +type internalMetricsV1Beta3Client interface { + Close() error + setGoogleClientInfo(...string) + Connection() *grpc.ClientConn + GetJobMetrics(context.Context, *dataflowpb.GetJobMetricsRequest, ...gax.CallOption) (*dataflowpb.JobMetrics, error) + GetJobExecutionDetails(context.Context, *dataflowpb.GetJobExecutionDetailsRequest, ...gax.CallOption) *StageSummaryIterator + GetStageExecutionDetails(context.Context, *dataflowpb.GetStageExecutionDetailsRequest, ...gax.CallOption) *WorkerDetailsIterator +} + +// MetricsV1Beta3Client is a client for interacting with Dataflow API. +// Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls. +// +// The Dataflow Metrics API lets you monitor the progress of Dataflow +// jobs. +type MetricsV1Beta3Client struct { + // The internal transport-dependent client. + internalClient internalMetricsV1Beta3Client + + // The call options for this service. + CallOptions *MetricsV1Beta3CallOptions +} + +// 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 *MetricsV1Beta3Client) 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 *MetricsV1Beta3Client) setGoogleClientInfo(keyval ...string) { + c.internalClient.setGoogleClientInfo(keyval...) +} + +// Connection returns a connection to the API service. +// +// Deprecated. +func (c *MetricsV1Beta3Client) Connection() *grpc.ClientConn { + return c.internalClient.Connection() +} + +// GetJobMetrics request the job status. +// +// To request the status of a job, we recommend using +// projects.locations.jobs.getMetrics with a [regional endpoint] +// (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints (at https://cloud.google.com/dataflow/docs/concepts/regional-endpoints)). Using +// projects.jobs.getMetrics is not recommended, as you can only request the +// status of jobs that are running in us-central1. +func (c *MetricsV1Beta3Client) GetJobMetrics(ctx context.Context, req *dataflowpb.GetJobMetricsRequest, opts ...gax.CallOption) (*dataflowpb.JobMetrics, error) { + return c.internalClient.GetJobMetrics(ctx, req, opts...) +} + +// GetJobExecutionDetails request detailed information about the execution status of the job. +// +// EXPERIMENTAL. This API is subject to change or removal without notice. +func (c *MetricsV1Beta3Client) GetJobExecutionDetails(ctx context.Context, req *dataflowpb.GetJobExecutionDetailsRequest, opts ...gax.CallOption) *StageSummaryIterator { + return c.internalClient.GetJobExecutionDetails(ctx, req, opts...) +} + +// GetStageExecutionDetails request detailed information about the execution status of a stage of the +// job. +// +// EXPERIMENTAL. This API is subject to change or removal without notice. +func (c *MetricsV1Beta3Client) GetStageExecutionDetails(ctx context.Context, req *dataflowpb.GetStageExecutionDetailsRequest, opts ...gax.CallOption) *WorkerDetailsIterator { + return c.internalClient.GetStageExecutionDetails(ctx, req, opts...) +} + +// metricsV1Beta3GRPCClient is a client for interacting with Dataflow API over gRPC transport. +// +// Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls. +type metricsV1Beta3GRPCClient struct { + // Connection pool of gRPC connections to the service. + connPool gtransport.ConnPool + + // flag to opt out of default deadlines via GOOGLE_API_GO_EXPERIMENTAL_DISABLE_DEFAULT_DEADLINE + disableDeadlines bool + + // Points back to the CallOptions field of the containing MetricsV1Beta3Client + CallOptions **MetricsV1Beta3CallOptions + + // The gRPC API client. + metricsV1Beta3Client dataflowpb.MetricsV1Beta3Client + + // The x-goog-* metadata to be sent with each request. + xGoogMetadata metadata.MD +} + +// NewMetricsV1Beta3Client creates a new metrics v1 beta3 client based on gRPC. +// The returned client must be Closed when it is done being used to clean up its underlying connections. +// +// The Dataflow Metrics API lets you monitor the progress of Dataflow +// jobs. +func NewMetricsV1Beta3Client(ctx context.Context, opts ...option.ClientOption) (*MetricsV1Beta3Client, error) { + clientOpts := defaultMetricsV1Beta3GRPCClientOptions() + if newMetricsV1Beta3ClientHook != nil { + hookOpts, err := newMetricsV1Beta3ClientHook(ctx, clientHookParams{}) + if err != nil { + return nil, err + } + clientOpts = append(clientOpts, hookOpts...) + } + + disableDeadlines, err := checkDisableDeadlines() + if err != nil { + return nil, err + } + + connPool, err := gtransport.DialPool(ctx, append(clientOpts, opts...)...) + if err != nil { + return nil, err + } + client := MetricsV1Beta3Client{CallOptions: defaultMetricsV1Beta3CallOptions()} + + c := &metricsV1Beta3GRPCClient{ + connPool: connPool, + disableDeadlines: disableDeadlines, + metricsV1Beta3Client: dataflowpb.NewMetricsV1Beta3Client(connPool), + CallOptions: &client.CallOptions, + } + c.setGoogleClientInfo() + + client.internalClient = c + + return &client, nil +} + +// Connection returns a connection to the API service. +// +// Deprecated. +func (c *metricsV1Beta3GRPCClient) Connection() *grpc.ClientConn { + return c.connPool.Conn() +} + +// 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 *metricsV1Beta3GRPCClient) setGoogleClientInfo(keyval ...string) { + kv := append([]string{"gl-go", versionGo()}, keyval...) + kv = append(kv, "gapic", versionClient, "gax", gax.Version, "grpc", grpc.Version) + c.xGoogMetadata = metadata.Pairs("x-goog-api-client", gax.XGoogHeader(kv...)) +} + +// Close closes the connection to the API service. The user should invoke this when +// the client is no longer required. +func (c *metricsV1Beta3GRPCClient) Close() error { + return c.connPool.Close() +} + +func (c *metricsV1Beta3GRPCClient) GetJobMetrics(ctx context.Context, req *dataflowpb.GetJobMetricsRequest, opts ...gax.CallOption) (*dataflowpb.JobMetrics, error) { + if _, ok := ctx.Deadline(); !ok && !c.disableDeadlines { + cctx, cancel := context.WithTimeout(ctx, 60000*time.Millisecond) + defer cancel() + ctx = cctx + } + ctx = insertMetadata(ctx, c.xGoogMetadata) + opts = append((*c.CallOptions).GetJobMetrics[0:len((*c.CallOptions).GetJobMetrics):len((*c.CallOptions).GetJobMetrics)], opts...) + var resp *dataflowpb.JobMetrics + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + resp, err = c.metricsV1Beta3Client.GetJobMetrics(ctx, req, settings.GRPC...) + return err + }, opts...) + if err != nil { + return nil, err + } + return resp, nil +} + +func (c *metricsV1Beta3GRPCClient) GetJobExecutionDetails(ctx context.Context, req *dataflowpb.GetJobExecutionDetailsRequest, opts ...gax.CallOption) *StageSummaryIterator { + ctx = insertMetadata(ctx, c.xGoogMetadata) + opts = append((*c.CallOptions).GetJobExecutionDetails[0:len((*c.CallOptions).GetJobExecutionDetails):len((*c.CallOptions).GetJobExecutionDetails)], opts...) + it := &StageSummaryIterator{} + req = proto.Clone(req).(*dataflowpb.GetJobExecutionDetailsRequest) + it.InternalFetch = func(pageSize int, pageToken string) ([]*dataflowpb.StageSummary, string, error) { + var resp *dataflowpb.JobExecutionDetails + req.PageToken = pageToken + if pageSize > math.MaxInt32 { + req.PageSize = math.MaxInt32 + } else { + req.PageSize = int32(pageSize) + } + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + resp, err = c.metricsV1Beta3Client.GetJobExecutionDetails(ctx, req, settings.GRPC...) + return err + }, opts...) + if err != nil { + return nil, "", err + } + + it.Response = resp + return resp.GetStages(), 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.GetPageSize()) + it.pageInfo.Token = req.GetPageToken() + return it +} + +func (c *metricsV1Beta3GRPCClient) GetStageExecutionDetails(ctx context.Context, req *dataflowpb.GetStageExecutionDetailsRequest, opts ...gax.CallOption) *WorkerDetailsIterator { + ctx = insertMetadata(ctx, c.xGoogMetadata) + opts = append((*c.CallOptions).GetStageExecutionDetails[0:len((*c.CallOptions).GetStageExecutionDetails):len((*c.CallOptions).GetStageExecutionDetails)], opts...) + it := &WorkerDetailsIterator{} + req = proto.Clone(req).(*dataflowpb.GetStageExecutionDetailsRequest) + it.InternalFetch = func(pageSize int, pageToken string) ([]*dataflowpb.WorkerDetails, string, error) { + var resp *dataflowpb.StageExecutionDetails + req.PageToken = pageToken + if pageSize > math.MaxInt32 { + req.PageSize = math.MaxInt32 + } else { + req.PageSize = int32(pageSize) + } + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + resp, err = c.metricsV1Beta3Client.GetStageExecutionDetails(ctx, req, settings.GRPC...) + return err + }, opts...) + if err != nil { + return nil, "", err + } + + it.Response = resp + return resp.GetWorkers(), 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.GetPageSize()) + it.pageInfo.Token = req.GetPageToken() + return it +} + +// StageSummaryIterator manages a stream of *dataflowpb.StageSummary. +type StageSummaryIterator struct { + items []*dataflowpb.StageSummary + 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 []*dataflowpb.StageSummary, nextPageToken string, err error) +} + +// PageInfo supports pagination. See the google.golang.org/api/iterator package for details. +func (it *StageSummaryIterator) 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 *StageSummaryIterator) Next() (*dataflowpb.StageSummary, error) { + var item *dataflowpb.StageSummary + if err := it.nextFunc(); err != nil { + return item, err + } + item = it.items[0] + it.items = it.items[1:] + return item, nil +} + +func (it *StageSummaryIterator) bufLen() int { + return len(it.items) +} + +func (it *StageSummaryIterator) takeBuf() interface{} { + b := it.items + it.items = nil + return b +} + +// WorkerDetailsIterator manages a stream of *dataflowpb.WorkerDetails. +type WorkerDetailsIterator struct { + items []*dataflowpb.WorkerDetails + 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 []*dataflowpb.WorkerDetails, nextPageToken string, err error) +} + +// PageInfo supports pagination. See the google.golang.org/api/iterator package for details. +func (it *WorkerDetailsIterator) 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 *WorkerDetailsIterator) Next() (*dataflowpb.WorkerDetails, error) { + var item *dataflowpb.WorkerDetails + if err := it.nextFunc(); err != nil { + return item, err + } + item = it.items[0] + it.items = it.items[1:] + return item, nil +} + +func (it *WorkerDetailsIterator) bufLen() int { + return len(it.items) +} + +func (it *WorkerDetailsIterator) takeBuf() interface{} { + b := it.items + it.items = nil + return b +} diff --git a/dataflow/apiv1beta3/metrics_v1_beta3_client_example_test.go b/dataflow/apiv1beta3/metrics_v1_beta3_client_example_test.go new file mode 100644 index 00000000000..7677189c786 --- /dev/null +++ b/dataflow/apiv1beta3/metrics_v1_beta3_client_example_test.go @@ -0,0 +1,106 @@ +// Copyright 2021 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 dataflow_test + +import ( + "context" + + dataflow "cloud.google.com/go/dataflow/apiv1beta3" + "google.golang.org/api/iterator" + dataflowpb "google.golang.org/genproto/googleapis/dataflow/v1beta3" +) + +func ExampleNewMetricsV1Beta3Client() { + ctx := context.Background() + c, err := dataflow.NewMetricsV1Beta3Client(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + // TODO: Use client. + _ = c +} + +func ExampleMetricsV1Beta3Client_GetJobMetrics() { + ctx := context.Background() + c, err := dataflow.NewMetricsV1Beta3Client(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &dataflowpb.GetJobMetricsRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.GetJobMetrics(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleMetricsV1Beta3Client_GetJobExecutionDetails() { + ctx := context.Background() + c, err := dataflow.NewMetricsV1Beta3Client(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &dataflowpb.GetJobExecutionDetailsRequest{ + // TODO: Fill request struct fields. + } + it := c.GetJobExecutionDetails(ctx, req) + for { + resp, err := it.Next() + if err == iterator.Done { + break + } + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp + } +} + +func ExampleMetricsV1Beta3Client_GetStageExecutionDetails() { + ctx := context.Background() + c, err := dataflow.NewMetricsV1Beta3Client(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &dataflowpb.GetStageExecutionDetailsRequest{ + // TODO: Fill request struct fields. + } + it := c.GetStageExecutionDetails(ctx, req) + for { + resp, err := it.Next() + if err == iterator.Done { + break + } + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp + } +} diff --git a/dataflow/apiv1beta3/snapshots_v1_beta3_client.go b/dataflow/apiv1beta3/snapshots_v1_beta3_client.go new file mode 100644 index 00000000000..212281bc7d4 --- /dev/null +++ b/dataflow/apiv1beta3/snapshots_v1_beta3_client.go @@ -0,0 +1,260 @@ +// Copyright 2021 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 dataflow + +import ( + "context" + "math" + "time" + + gax "github.com/googleapis/gax-go/v2" + "google.golang.org/api/option" + "google.golang.org/api/option/internaloption" + gtransport "google.golang.org/api/transport/grpc" + dataflowpb "google.golang.org/genproto/googleapis/dataflow/v1beta3" + "google.golang.org/grpc" + "google.golang.org/grpc/metadata" +) + +var newSnapshotsV1Beta3ClientHook clientHook + +// SnapshotsV1Beta3CallOptions contains the retry settings for each method of SnapshotsV1Beta3Client. +type SnapshotsV1Beta3CallOptions struct { + GetSnapshot []gax.CallOption + DeleteSnapshot []gax.CallOption + ListSnapshots []gax.CallOption +} + +func defaultSnapshotsV1Beta3GRPCClientOptions() []option.ClientOption { + return []option.ClientOption{ + internaloption.WithDefaultEndpoint("dataflow.googleapis.com:443"), + internaloption.WithDefaultMTLSEndpoint("dataflow.mtls.googleapis.com:443"), + internaloption.WithDefaultAudience("https://dataflow.googleapis.com/"), + internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), + option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), + option.WithGRPCDialOption(grpc.WithDefaultCallOptions( + grpc.MaxCallRecvMsgSize(math.MaxInt32))), + } +} + +func defaultSnapshotsV1Beta3CallOptions() *SnapshotsV1Beta3CallOptions { + return &SnapshotsV1Beta3CallOptions{ + GetSnapshot: []gax.CallOption{}, + DeleteSnapshot: []gax.CallOption{}, + ListSnapshots: []gax.CallOption{}, + } +} + +// internalSnapshotsV1Beta3Client is an interface that defines the methods availaible from Dataflow API. +type internalSnapshotsV1Beta3Client interface { + Close() error + setGoogleClientInfo(...string) + Connection() *grpc.ClientConn + GetSnapshot(context.Context, *dataflowpb.GetSnapshotRequest, ...gax.CallOption) (*dataflowpb.Snapshot, error) + DeleteSnapshot(context.Context, *dataflowpb.DeleteSnapshotRequest, ...gax.CallOption) (*dataflowpb.DeleteSnapshotResponse, error) + ListSnapshots(context.Context, *dataflowpb.ListSnapshotsRequest, ...gax.CallOption) (*dataflowpb.ListSnapshotsResponse, error) +} + +// SnapshotsV1Beta3Client is a client for interacting with Dataflow API. +// Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls. +// +// Provides methods to manage snapshots of Google Cloud Dataflow jobs. +type SnapshotsV1Beta3Client struct { + // The internal transport-dependent client. + internalClient internalSnapshotsV1Beta3Client + + // The call options for this service. + CallOptions *SnapshotsV1Beta3CallOptions +} + +// 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 *SnapshotsV1Beta3Client) 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 *SnapshotsV1Beta3Client) setGoogleClientInfo(keyval ...string) { + c.internalClient.setGoogleClientInfo(keyval...) +} + +// Connection returns a connection to the API service. +// +// Deprecated. +func (c *SnapshotsV1Beta3Client) Connection() *grpc.ClientConn { + return c.internalClient.Connection() +} + +// GetSnapshot gets information about a snapshot. +func (c *SnapshotsV1Beta3Client) GetSnapshot(ctx context.Context, req *dataflowpb.GetSnapshotRequest, opts ...gax.CallOption) (*dataflowpb.Snapshot, error) { + return c.internalClient.GetSnapshot(ctx, req, opts...) +} + +// DeleteSnapshot deletes a snapshot. +func (c *SnapshotsV1Beta3Client) DeleteSnapshot(ctx context.Context, req *dataflowpb.DeleteSnapshotRequest, opts ...gax.CallOption) (*dataflowpb.DeleteSnapshotResponse, error) { + return c.internalClient.DeleteSnapshot(ctx, req, opts...) +} + +// ListSnapshots lists snapshots. +func (c *SnapshotsV1Beta3Client) ListSnapshots(ctx context.Context, req *dataflowpb.ListSnapshotsRequest, opts ...gax.CallOption) (*dataflowpb.ListSnapshotsResponse, error) { + return c.internalClient.ListSnapshots(ctx, req, opts...) +} + +// snapshotsV1Beta3GRPCClient is a client for interacting with Dataflow API over gRPC transport. +// +// Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls. +type snapshotsV1Beta3GRPCClient struct { + // Connection pool of gRPC connections to the service. + connPool gtransport.ConnPool + + // flag to opt out of default deadlines via GOOGLE_API_GO_EXPERIMENTAL_DISABLE_DEFAULT_DEADLINE + disableDeadlines bool + + // Points back to the CallOptions field of the containing SnapshotsV1Beta3Client + CallOptions **SnapshotsV1Beta3CallOptions + + // The gRPC API client. + snapshotsV1Beta3Client dataflowpb.SnapshotsV1Beta3Client + + // The x-goog-* metadata to be sent with each request. + xGoogMetadata metadata.MD +} + +// NewSnapshotsV1Beta3Client creates a new snapshots v1 beta3 client based on gRPC. +// The returned client must be Closed when it is done being used to clean up its underlying connections. +// +// Provides methods to manage snapshots of Google Cloud Dataflow jobs. +func NewSnapshotsV1Beta3Client(ctx context.Context, opts ...option.ClientOption) (*SnapshotsV1Beta3Client, error) { + clientOpts := defaultSnapshotsV1Beta3GRPCClientOptions() + if newSnapshotsV1Beta3ClientHook != nil { + hookOpts, err := newSnapshotsV1Beta3ClientHook(ctx, clientHookParams{}) + if err != nil { + return nil, err + } + clientOpts = append(clientOpts, hookOpts...) + } + + disableDeadlines, err := checkDisableDeadlines() + if err != nil { + return nil, err + } + + connPool, err := gtransport.DialPool(ctx, append(clientOpts, opts...)...) + if err != nil { + return nil, err + } + client := SnapshotsV1Beta3Client{CallOptions: defaultSnapshotsV1Beta3CallOptions()} + + c := &snapshotsV1Beta3GRPCClient{ + connPool: connPool, + disableDeadlines: disableDeadlines, + snapshotsV1Beta3Client: dataflowpb.NewSnapshotsV1Beta3Client(connPool), + CallOptions: &client.CallOptions, + } + c.setGoogleClientInfo() + + client.internalClient = c + + return &client, nil +} + +// Connection returns a connection to the API service. +// +// Deprecated. +func (c *snapshotsV1Beta3GRPCClient) Connection() *grpc.ClientConn { + return c.connPool.Conn() +} + +// 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 *snapshotsV1Beta3GRPCClient) setGoogleClientInfo(keyval ...string) { + kv := append([]string{"gl-go", versionGo()}, keyval...) + kv = append(kv, "gapic", versionClient, "gax", gax.Version, "grpc", grpc.Version) + c.xGoogMetadata = metadata.Pairs("x-goog-api-client", gax.XGoogHeader(kv...)) +} + +// Close closes the connection to the API service. The user should invoke this when +// the client is no longer required. +func (c *snapshotsV1Beta3GRPCClient) Close() error { + return c.connPool.Close() +} + +func (c *snapshotsV1Beta3GRPCClient) GetSnapshot(ctx context.Context, req *dataflowpb.GetSnapshotRequest, opts ...gax.CallOption) (*dataflowpb.Snapshot, error) { + if _, ok := ctx.Deadline(); !ok && !c.disableDeadlines { + cctx, cancel := context.WithTimeout(ctx, 60000*time.Millisecond) + defer cancel() + ctx = cctx + } + ctx = insertMetadata(ctx, c.xGoogMetadata) + opts = append((*c.CallOptions).GetSnapshot[0:len((*c.CallOptions).GetSnapshot):len((*c.CallOptions).GetSnapshot)], opts...) + var resp *dataflowpb.Snapshot + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + resp, err = c.snapshotsV1Beta3Client.GetSnapshot(ctx, req, settings.GRPC...) + return err + }, opts...) + if err != nil { + return nil, err + } + return resp, nil +} + +func (c *snapshotsV1Beta3GRPCClient) DeleteSnapshot(ctx context.Context, req *dataflowpb.DeleteSnapshotRequest, opts ...gax.CallOption) (*dataflowpb.DeleteSnapshotResponse, error) { + if _, ok := ctx.Deadline(); !ok && !c.disableDeadlines { + cctx, cancel := context.WithTimeout(ctx, 60000*time.Millisecond) + defer cancel() + ctx = cctx + } + ctx = insertMetadata(ctx, c.xGoogMetadata) + opts = append((*c.CallOptions).DeleteSnapshot[0:len((*c.CallOptions).DeleteSnapshot):len((*c.CallOptions).DeleteSnapshot)], opts...) + var resp *dataflowpb.DeleteSnapshotResponse + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + resp, err = c.snapshotsV1Beta3Client.DeleteSnapshot(ctx, req, settings.GRPC...) + return err + }, opts...) + if err != nil { + return nil, err + } + return resp, nil +} + +func (c *snapshotsV1Beta3GRPCClient) ListSnapshots(ctx context.Context, req *dataflowpb.ListSnapshotsRequest, opts ...gax.CallOption) (*dataflowpb.ListSnapshotsResponse, error) { + if _, ok := ctx.Deadline(); !ok && !c.disableDeadlines { + cctx, cancel := context.WithTimeout(ctx, 60000*time.Millisecond) + defer cancel() + ctx = cctx + } + ctx = insertMetadata(ctx, c.xGoogMetadata) + opts = append((*c.CallOptions).ListSnapshots[0:len((*c.CallOptions).ListSnapshots):len((*c.CallOptions).ListSnapshots)], opts...) + var resp *dataflowpb.ListSnapshotsResponse + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + resp, err = c.snapshotsV1Beta3Client.ListSnapshots(ctx, req, settings.GRPC...) + return err + }, opts...) + if err != nil { + return nil, err + } + return resp, nil +} diff --git a/dataflow/apiv1beta3/snapshots_v1_beta3_client_example_test.go b/dataflow/apiv1beta3/snapshots_v1_beta3_client_example_test.go new file mode 100644 index 00000000000..3c41e38f62b --- /dev/null +++ b/dataflow/apiv1beta3/snapshots_v1_beta3_client_example_test.go @@ -0,0 +1,93 @@ +// Copyright 2021 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 dataflow_test + +import ( + "context" + + dataflow "cloud.google.com/go/dataflow/apiv1beta3" + dataflowpb "google.golang.org/genproto/googleapis/dataflow/v1beta3" +) + +func ExampleNewSnapshotsV1Beta3Client() { + ctx := context.Background() + c, err := dataflow.NewSnapshotsV1Beta3Client(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + // TODO: Use client. + _ = c +} + +func ExampleSnapshotsV1Beta3Client_GetSnapshot() { + ctx := context.Background() + c, err := dataflow.NewSnapshotsV1Beta3Client(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &dataflowpb.GetSnapshotRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.GetSnapshot(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleSnapshotsV1Beta3Client_DeleteSnapshot() { + ctx := context.Background() + c, err := dataflow.NewSnapshotsV1Beta3Client(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &dataflowpb.DeleteSnapshotRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.DeleteSnapshot(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleSnapshotsV1Beta3Client_ListSnapshots() { + ctx := context.Background() + c, err := dataflow.NewSnapshotsV1Beta3Client(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &dataflowpb.ListSnapshotsRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.ListSnapshots(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} diff --git a/dataflow/apiv1beta3/templates_client.go b/dataflow/apiv1beta3/templates_client.go new file mode 100644 index 00000000000..856ad73d5e4 --- /dev/null +++ b/dataflow/apiv1beta3/templates_client.go @@ -0,0 +1,260 @@ +// Copyright 2021 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 dataflow + +import ( + "context" + "math" + "time" + + gax "github.com/googleapis/gax-go/v2" + "google.golang.org/api/option" + "google.golang.org/api/option/internaloption" + gtransport "google.golang.org/api/transport/grpc" + dataflowpb "google.golang.org/genproto/googleapis/dataflow/v1beta3" + "google.golang.org/grpc" + "google.golang.org/grpc/metadata" +) + +var newTemplatesClientHook clientHook + +// TemplatesCallOptions contains the retry settings for each method of TemplatesClient. +type TemplatesCallOptions struct { + CreateJobFromTemplate []gax.CallOption + LaunchTemplate []gax.CallOption + GetTemplate []gax.CallOption +} + +func defaultTemplatesGRPCClientOptions() []option.ClientOption { + return []option.ClientOption{ + internaloption.WithDefaultEndpoint("dataflow.googleapis.com:443"), + internaloption.WithDefaultMTLSEndpoint("dataflow.mtls.googleapis.com:443"), + internaloption.WithDefaultAudience("https://dataflow.googleapis.com/"), + internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), + option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), + option.WithGRPCDialOption(grpc.WithDefaultCallOptions( + grpc.MaxCallRecvMsgSize(math.MaxInt32))), + } +} + +func defaultTemplatesCallOptions() *TemplatesCallOptions { + return &TemplatesCallOptions{ + CreateJobFromTemplate: []gax.CallOption{}, + LaunchTemplate: []gax.CallOption{}, + GetTemplate: []gax.CallOption{}, + } +} + +// internalTemplatesClient is an interface that defines the methods availaible from Dataflow API. +type internalTemplatesClient interface { + Close() error + setGoogleClientInfo(...string) + Connection() *grpc.ClientConn + CreateJobFromTemplate(context.Context, *dataflowpb.CreateJobFromTemplateRequest, ...gax.CallOption) (*dataflowpb.Job, error) + LaunchTemplate(context.Context, *dataflowpb.LaunchTemplateRequest, ...gax.CallOption) (*dataflowpb.LaunchTemplateResponse, error) + GetTemplate(context.Context, *dataflowpb.GetTemplateRequest, ...gax.CallOption) (*dataflowpb.GetTemplateResponse, error) +} + +// TemplatesClient is a client for interacting with Dataflow API. +// Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls. +// +// Provides a method to create Cloud Dataflow jobs from templates. +type TemplatesClient struct { + // The internal transport-dependent client. + internalClient internalTemplatesClient + + // The call options for this service. + CallOptions *TemplatesCallOptions +} + +// 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 *TemplatesClient) 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 *TemplatesClient) setGoogleClientInfo(keyval ...string) { + c.internalClient.setGoogleClientInfo(keyval...) +} + +// Connection returns a connection to the API service. +// +// Deprecated. +func (c *TemplatesClient) Connection() *grpc.ClientConn { + return c.internalClient.Connection() +} + +// CreateJobFromTemplate creates a Cloud Dataflow job from a template. +func (c *TemplatesClient) CreateJobFromTemplate(ctx context.Context, req *dataflowpb.CreateJobFromTemplateRequest, opts ...gax.CallOption) (*dataflowpb.Job, error) { + return c.internalClient.CreateJobFromTemplate(ctx, req, opts...) +} + +// LaunchTemplate launch a template. +func (c *TemplatesClient) LaunchTemplate(ctx context.Context, req *dataflowpb.LaunchTemplateRequest, opts ...gax.CallOption) (*dataflowpb.LaunchTemplateResponse, error) { + return c.internalClient.LaunchTemplate(ctx, req, opts...) +} + +// GetTemplate get the template associated with a template. +func (c *TemplatesClient) GetTemplate(ctx context.Context, req *dataflowpb.GetTemplateRequest, opts ...gax.CallOption) (*dataflowpb.GetTemplateResponse, error) { + return c.internalClient.GetTemplate(ctx, req, opts...) +} + +// templatesGRPCClient is a client for interacting with Dataflow API over gRPC transport. +// +// Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls. +type templatesGRPCClient struct { + // Connection pool of gRPC connections to the service. + connPool gtransport.ConnPool + + // flag to opt out of default deadlines via GOOGLE_API_GO_EXPERIMENTAL_DISABLE_DEFAULT_DEADLINE + disableDeadlines bool + + // Points back to the CallOptions field of the containing TemplatesClient + CallOptions **TemplatesCallOptions + + // The gRPC API client. + templatesClient dataflowpb.TemplatesServiceClient + + // The x-goog-* metadata to be sent with each request. + xGoogMetadata metadata.MD +} + +// NewTemplatesClient creates a new templates service client based on gRPC. +// The returned client must be Closed when it is done being used to clean up its underlying connections. +// +// Provides a method to create Cloud Dataflow jobs from templates. +func NewTemplatesClient(ctx context.Context, opts ...option.ClientOption) (*TemplatesClient, error) { + clientOpts := defaultTemplatesGRPCClientOptions() + if newTemplatesClientHook != nil { + hookOpts, err := newTemplatesClientHook(ctx, clientHookParams{}) + if err != nil { + return nil, err + } + clientOpts = append(clientOpts, hookOpts...) + } + + disableDeadlines, err := checkDisableDeadlines() + if err != nil { + return nil, err + } + + connPool, err := gtransport.DialPool(ctx, append(clientOpts, opts...)...) + if err != nil { + return nil, err + } + client := TemplatesClient{CallOptions: defaultTemplatesCallOptions()} + + c := &templatesGRPCClient{ + connPool: connPool, + disableDeadlines: disableDeadlines, + templatesClient: dataflowpb.NewTemplatesServiceClient(connPool), + CallOptions: &client.CallOptions, + } + c.setGoogleClientInfo() + + client.internalClient = c + + return &client, nil +} + +// Connection returns a connection to the API service. +// +// Deprecated. +func (c *templatesGRPCClient) Connection() *grpc.ClientConn { + return c.connPool.Conn() +} + +// 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 *templatesGRPCClient) setGoogleClientInfo(keyval ...string) { + kv := append([]string{"gl-go", versionGo()}, keyval...) + kv = append(kv, "gapic", versionClient, "gax", gax.Version, "grpc", grpc.Version) + c.xGoogMetadata = metadata.Pairs("x-goog-api-client", gax.XGoogHeader(kv...)) +} + +// Close closes the connection to the API service. The user should invoke this when +// the client is no longer required. +func (c *templatesGRPCClient) Close() error { + return c.connPool.Close() +} + +func (c *templatesGRPCClient) CreateJobFromTemplate(ctx context.Context, req *dataflowpb.CreateJobFromTemplateRequest, opts ...gax.CallOption) (*dataflowpb.Job, error) { + if _, ok := ctx.Deadline(); !ok && !c.disableDeadlines { + cctx, cancel := context.WithTimeout(ctx, 60000*time.Millisecond) + defer cancel() + ctx = cctx + } + ctx = insertMetadata(ctx, c.xGoogMetadata) + opts = append((*c.CallOptions).CreateJobFromTemplate[0:len((*c.CallOptions).CreateJobFromTemplate):len((*c.CallOptions).CreateJobFromTemplate)], opts...) + var resp *dataflowpb.Job + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + resp, err = c.templatesClient.CreateJobFromTemplate(ctx, req, settings.GRPC...) + return err + }, opts...) + if err != nil { + return nil, err + } + return resp, nil +} + +func (c *templatesGRPCClient) LaunchTemplate(ctx context.Context, req *dataflowpb.LaunchTemplateRequest, opts ...gax.CallOption) (*dataflowpb.LaunchTemplateResponse, error) { + if _, ok := ctx.Deadline(); !ok && !c.disableDeadlines { + cctx, cancel := context.WithTimeout(ctx, 60000*time.Millisecond) + defer cancel() + ctx = cctx + } + ctx = insertMetadata(ctx, c.xGoogMetadata) + opts = append((*c.CallOptions).LaunchTemplate[0:len((*c.CallOptions).LaunchTemplate):len((*c.CallOptions).LaunchTemplate)], opts...) + var resp *dataflowpb.LaunchTemplateResponse + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + resp, err = c.templatesClient.LaunchTemplate(ctx, req, settings.GRPC...) + return err + }, opts...) + if err != nil { + return nil, err + } + return resp, nil +} + +func (c *templatesGRPCClient) GetTemplate(ctx context.Context, req *dataflowpb.GetTemplateRequest, opts ...gax.CallOption) (*dataflowpb.GetTemplateResponse, error) { + if _, ok := ctx.Deadline(); !ok && !c.disableDeadlines { + cctx, cancel := context.WithTimeout(ctx, 60000*time.Millisecond) + defer cancel() + ctx = cctx + } + ctx = insertMetadata(ctx, c.xGoogMetadata) + opts = append((*c.CallOptions).GetTemplate[0:len((*c.CallOptions).GetTemplate):len((*c.CallOptions).GetTemplate)], opts...) + var resp *dataflowpb.GetTemplateResponse + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + resp, err = c.templatesClient.GetTemplate(ctx, req, settings.GRPC...) + return err + }, opts...) + if err != nil { + return nil, err + } + return resp, nil +} diff --git a/dataflow/apiv1beta3/templates_client_example_test.go b/dataflow/apiv1beta3/templates_client_example_test.go new file mode 100644 index 00000000000..16bc0ab021b --- /dev/null +++ b/dataflow/apiv1beta3/templates_client_example_test.go @@ -0,0 +1,93 @@ +// Copyright 2021 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 dataflow_test + +import ( + "context" + + dataflow "cloud.google.com/go/dataflow/apiv1beta3" + dataflowpb "google.golang.org/genproto/googleapis/dataflow/v1beta3" +) + +func ExampleNewTemplatesClient() { + ctx := context.Background() + c, err := dataflow.NewTemplatesClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + // TODO: Use client. + _ = c +} + +func ExampleTemplatesClient_CreateJobFromTemplate() { + ctx := context.Background() + c, err := dataflow.NewTemplatesClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &dataflowpb.CreateJobFromTemplateRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.CreateJobFromTemplate(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleTemplatesClient_LaunchTemplate() { + ctx := context.Background() + c, err := dataflow.NewTemplatesClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &dataflowpb.LaunchTemplateRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.LaunchTemplate(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleTemplatesClient_GetTemplate() { + ctx := context.Background() + c, err := dataflow.NewTemplatesClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &dataflowpb.GetTemplateRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.GetTemplate(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} diff --git a/datastream/apiv1alpha1/datastream_client.go b/datastream/apiv1alpha1/datastream_client.go new file mode 100644 index 00000000000..37d76bb99e9 --- /dev/null +++ b/datastream/apiv1alpha1/datastream_client.go @@ -0,0 +1,2077 @@ +// Copyright 2021 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 datastream + +import ( + "context" + "fmt" + "math" + "net/url" + "time" + + "cloud.google.com/go/longrunning" + lroauto "cloud.google.com/go/longrunning/autogen" + gax "github.com/googleapis/gax-go/v2" + "google.golang.org/api/iterator" + "google.golang.org/api/option" + "google.golang.org/api/option/internaloption" + gtransport "google.golang.org/api/transport/grpc" + datastreampb "google.golang.org/genproto/googleapis/cloud/datastream/v1alpha1" + longrunningpb "google.golang.org/genproto/googleapis/longrunning" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/proto" +) + +var newClientHook clientHook + +// CallOptions contains the retry settings for each method of Client. +type CallOptions struct { + ListConnectionProfiles []gax.CallOption + GetConnectionProfile []gax.CallOption + CreateConnectionProfile []gax.CallOption + UpdateConnectionProfile []gax.CallOption + DeleteConnectionProfile []gax.CallOption + DiscoverConnectionProfile []gax.CallOption + ListStreams []gax.CallOption + GetStream []gax.CallOption + CreateStream []gax.CallOption + UpdateStream []gax.CallOption + DeleteStream []gax.CallOption + FetchErrors []gax.CallOption + FetchStaticIps []gax.CallOption + CreatePrivateConnection []gax.CallOption + GetPrivateConnection []gax.CallOption + ListPrivateConnections []gax.CallOption + DeletePrivateConnection []gax.CallOption + CreateRoute []gax.CallOption + GetRoute []gax.CallOption + ListRoutes []gax.CallOption + DeleteRoute []gax.CallOption +} + +func defaultGRPCClientOptions() []option.ClientOption { + return []option.ClientOption{ + internaloption.WithDefaultEndpoint("datastream.googleapis.com:443"), + internaloption.WithDefaultMTLSEndpoint("datastream.mtls.googleapis.com:443"), + internaloption.WithDefaultAudience("https://datastream.googleapis.com/"), + internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), + option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), + option.WithGRPCDialOption(grpc.WithDefaultCallOptions( + grpc.MaxCallRecvMsgSize(math.MaxInt32))), + } +} + +func defaultCallOptions() *CallOptions { + return &CallOptions{ + ListConnectionProfiles: []gax.CallOption{ + gax.WithRetry(func() gax.Retryer { + return gax.OnCodes([]codes.Code{ + codes.Unavailable, + }, gax.Backoff{ + Initial: 1000 * time.Millisecond, + Max: 10000 * time.Millisecond, + Multiplier: 1.30, + }) + }), + }, + GetConnectionProfile: []gax.CallOption{ + gax.WithRetry(func() gax.Retryer { + return gax.OnCodes([]codes.Code{ + codes.Unavailable, + }, gax.Backoff{ + Initial: 1000 * time.Millisecond, + Max: 10000 * time.Millisecond, + Multiplier: 1.30, + }) + }), + }, + CreateConnectionProfile: []gax.CallOption{}, + UpdateConnectionProfile: []gax.CallOption{}, + DeleteConnectionProfile: []gax.CallOption{}, + DiscoverConnectionProfile: []gax.CallOption{ + gax.WithRetry(func() gax.Retryer { + return gax.OnCodes([]codes.Code{ + codes.Unavailable, + }, gax.Backoff{ + Initial: 1000 * time.Millisecond, + Max: 10000 * time.Millisecond, + Multiplier: 1.30, + }) + }), + }, + ListStreams: []gax.CallOption{ + gax.WithRetry(func() gax.Retryer { + return gax.OnCodes([]codes.Code{ + codes.Unavailable, + }, gax.Backoff{ + Initial: 1000 * time.Millisecond, + Max: 10000 * time.Millisecond, + Multiplier: 1.30, + }) + }), + }, + GetStream: []gax.CallOption{ + gax.WithRetry(func() gax.Retryer { + return gax.OnCodes([]codes.Code{ + codes.Unavailable, + }, gax.Backoff{ + Initial: 1000 * time.Millisecond, + Max: 10000 * time.Millisecond, + Multiplier: 1.30, + }) + }), + }, + CreateStream: []gax.CallOption{}, + UpdateStream: []gax.CallOption{}, + DeleteStream: []gax.CallOption{}, + FetchErrors: []gax.CallOption{ + gax.WithRetry(func() gax.Retryer { + return gax.OnCodes([]codes.Code{ + codes.Unavailable, + }, gax.Backoff{ + Initial: 1000 * time.Millisecond, + Max: 10000 * time.Millisecond, + Multiplier: 1.30, + }) + }), + }, + FetchStaticIps: []gax.CallOption{ + gax.WithRetry(func() gax.Retryer { + return gax.OnCodes([]codes.Code{ + codes.Unavailable, + }, gax.Backoff{ + Initial: 1000 * time.Millisecond, + Max: 10000 * time.Millisecond, + Multiplier: 1.30, + }) + }), + }, + CreatePrivateConnection: []gax.CallOption{}, + GetPrivateConnection: []gax.CallOption{ + gax.WithRetry(func() gax.Retryer { + return gax.OnCodes([]codes.Code{ + codes.Unavailable, + }, gax.Backoff{ + Initial: 1000 * time.Millisecond, + Max: 10000 * time.Millisecond, + Multiplier: 1.30, + }) + }), + }, + ListPrivateConnections: []gax.CallOption{ + gax.WithRetry(func() gax.Retryer { + return gax.OnCodes([]codes.Code{ + codes.Unavailable, + }, gax.Backoff{ + Initial: 1000 * time.Millisecond, + Max: 10000 * time.Millisecond, + Multiplier: 1.30, + }) + }), + }, + DeletePrivateConnection: []gax.CallOption{}, + CreateRoute: []gax.CallOption{}, + GetRoute: []gax.CallOption{ + gax.WithRetry(func() gax.Retryer { + return gax.OnCodes([]codes.Code{ + codes.Unavailable, + }, gax.Backoff{ + Initial: 1000 * time.Millisecond, + Max: 10000 * time.Millisecond, + Multiplier: 1.30, + }) + }), + }, + ListRoutes: []gax.CallOption{ + gax.WithRetry(func() gax.Retryer { + return gax.OnCodes([]codes.Code{ + codes.Unavailable, + }, gax.Backoff{ + Initial: 1000 * time.Millisecond, + Max: 10000 * time.Millisecond, + Multiplier: 1.30, + }) + }), + }, + DeleteRoute: []gax.CallOption{}, + } +} + +// internalClient is an interface that defines the methods availaible from DataStream API. +type internalClient interface { + Close() error + setGoogleClientInfo(...string) + Connection() *grpc.ClientConn + ListConnectionProfiles(context.Context, *datastreampb.ListConnectionProfilesRequest, ...gax.CallOption) *ConnectionProfileIterator + GetConnectionProfile(context.Context, *datastreampb.GetConnectionProfileRequest, ...gax.CallOption) (*datastreampb.ConnectionProfile, error) + CreateConnectionProfile(context.Context, *datastreampb.CreateConnectionProfileRequest, ...gax.CallOption) (*CreateConnectionProfileOperation, error) + CreateConnectionProfileOperation(name string) *CreateConnectionProfileOperation + UpdateConnectionProfile(context.Context, *datastreampb.UpdateConnectionProfileRequest, ...gax.CallOption) (*UpdateConnectionProfileOperation, error) + UpdateConnectionProfileOperation(name string) *UpdateConnectionProfileOperation + DeleteConnectionProfile(context.Context, *datastreampb.DeleteConnectionProfileRequest, ...gax.CallOption) (*DeleteConnectionProfileOperation, error) + DeleteConnectionProfileOperation(name string) *DeleteConnectionProfileOperation + DiscoverConnectionProfile(context.Context, *datastreampb.DiscoverConnectionProfileRequest, ...gax.CallOption) (*datastreampb.DiscoverConnectionProfileResponse, error) + ListStreams(context.Context, *datastreampb.ListStreamsRequest, ...gax.CallOption) *StreamIterator + GetStream(context.Context, *datastreampb.GetStreamRequest, ...gax.CallOption) (*datastreampb.Stream, error) + CreateStream(context.Context, *datastreampb.CreateStreamRequest, ...gax.CallOption) (*CreateStreamOperation, error) + CreateStreamOperation(name string) *CreateStreamOperation + UpdateStream(context.Context, *datastreampb.UpdateStreamRequest, ...gax.CallOption) (*UpdateStreamOperation, error) + UpdateStreamOperation(name string) *UpdateStreamOperation + DeleteStream(context.Context, *datastreampb.DeleteStreamRequest, ...gax.CallOption) (*DeleteStreamOperation, error) + DeleteStreamOperation(name string) *DeleteStreamOperation + FetchErrors(context.Context, *datastreampb.FetchErrorsRequest, ...gax.CallOption) (*FetchErrorsOperation, error) + FetchErrorsOperation(name string) *FetchErrorsOperation + FetchStaticIps(context.Context, *datastreampb.FetchStaticIpsRequest, ...gax.CallOption) *StringIterator + CreatePrivateConnection(context.Context, *datastreampb.CreatePrivateConnectionRequest, ...gax.CallOption) (*CreatePrivateConnectionOperation, error) + CreatePrivateConnectionOperation(name string) *CreatePrivateConnectionOperation + GetPrivateConnection(context.Context, *datastreampb.GetPrivateConnectionRequest, ...gax.CallOption) (*datastreampb.PrivateConnection, error) + ListPrivateConnections(context.Context, *datastreampb.ListPrivateConnectionsRequest, ...gax.CallOption) *PrivateConnectionIterator + DeletePrivateConnection(context.Context, *datastreampb.DeletePrivateConnectionRequest, ...gax.CallOption) (*DeletePrivateConnectionOperation, error) + DeletePrivateConnectionOperation(name string) *DeletePrivateConnectionOperation + CreateRoute(context.Context, *datastreampb.CreateRouteRequest, ...gax.CallOption) (*CreateRouteOperation, error) + CreateRouteOperation(name string) *CreateRouteOperation + GetRoute(context.Context, *datastreampb.GetRouteRequest, ...gax.CallOption) (*datastreampb.Route, error) + ListRoutes(context.Context, *datastreampb.ListRoutesRequest, ...gax.CallOption) *RouteIterator + DeleteRoute(context.Context, *datastreampb.DeleteRouteRequest, ...gax.CallOption) (*DeleteRouteOperation, error) + DeleteRouteOperation(name string) *DeleteRouteOperation +} + +// Client is a client for interacting with DataStream API. +// Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls. +// +// Datastream service +type Client struct { + // The internal transport-dependent client. + internalClient internalClient + + // The call options for this service. + CallOptions *CallOptions + + // LROClient is used internally to handle long-running operations. + // It is exposed so that its CallOptions can be modified if required. + // Users should not Close this client. + LROClient *lroauto.OperationsClient +} + +// 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 *Client) 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 *Client) setGoogleClientInfo(keyval ...string) { + c.internalClient.setGoogleClientInfo(keyval...) +} + +// Connection returns a connection to the API service. +// +// Deprecated. +func (c *Client) Connection() *grpc.ClientConn { + return c.internalClient.Connection() +} + +// ListConnectionProfiles use this method to list connection profiles created in a project and +// location. +func (c *Client) ListConnectionProfiles(ctx context.Context, req *datastreampb.ListConnectionProfilesRequest, opts ...gax.CallOption) *ConnectionProfileIterator { + return c.internalClient.ListConnectionProfiles(ctx, req, opts...) +} + +// GetConnectionProfile use this method to get details about a connection profile. +func (c *Client) GetConnectionProfile(ctx context.Context, req *datastreampb.GetConnectionProfileRequest, opts ...gax.CallOption) (*datastreampb.ConnectionProfile, error) { + return c.internalClient.GetConnectionProfile(ctx, req, opts...) +} + +// CreateConnectionProfile use this method to create a connection profile in a project and location. +func (c *Client) CreateConnectionProfile(ctx context.Context, req *datastreampb.CreateConnectionProfileRequest, opts ...gax.CallOption) (*CreateConnectionProfileOperation, error) { + return c.internalClient.CreateConnectionProfile(ctx, req, opts...) +} + +// CreateConnectionProfileOperation returns a new CreateConnectionProfileOperation from a given name. +// The name must be that of a previously created CreateConnectionProfileOperation, possibly from a different process. +func (c *Client) CreateConnectionProfileOperation(name string) *CreateConnectionProfileOperation { + return c.internalClient.CreateConnectionProfileOperation(name) +} + +// UpdateConnectionProfile use this method to update the parameters of a connection profile. +func (c *Client) UpdateConnectionProfile(ctx context.Context, req *datastreampb.UpdateConnectionProfileRequest, opts ...gax.CallOption) (*UpdateConnectionProfileOperation, error) { + return c.internalClient.UpdateConnectionProfile(ctx, req, opts...) +} + +// UpdateConnectionProfileOperation returns a new UpdateConnectionProfileOperation from a given name. +// The name must be that of a previously created UpdateConnectionProfileOperation, possibly from a different process. +func (c *Client) UpdateConnectionProfileOperation(name string) *UpdateConnectionProfileOperation { + return c.internalClient.UpdateConnectionProfileOperation(name) +} + +// DeleteConnectionProfile use this method to delete a connection profile… +func (c *Client) DeleteConnectionProfile(ctx context.Context, req *datastreampb.DeleteConnectionProfileRequest, opts ...gax.CallOption) (*DeleteConnectionProfileOperation, error) { + return c.internalClient.DeleteConnectionProfile(ctx, req, opts...) +} + +// DeleteConnectionProfileOperation returns a new DeleteConnectionProfileOperation from a given name. +// The name must be that of a previously created DeleteConnectionProfileOperation, possibly from a different process. +func (c *Client) DeleteConnectionProfileOperation(name string) *DeleteConnectionProfileOperation { + return c.internalClient.DeleteConnectionProfileOperation(name) +} + +// DiscoverConnectionProfile use this method to discover a connection profile. +// The discover API call exposes the data objects and metadata belonging to +// the profile. Typically, a request returns children data objects under a +// parent data object that’s optionally supplied in the request. +func (c *Client) DiscoverConnectionProfile(ctx context.Context, req *datastreampb.DiscoverConnectionProfileRequest, opts ...gax.CallOption) (*datastreampb.DiscoverConnectionProfileResponse, error) { + return c.internalClient.DiscoverConnectionProfile(ctx, req, opts...) +} + +// ListStreams use this method to list streams in a project and location. +func (c *Client) ListStreams(ctx context.Context, req *datastreampb.ListStreamsRequest, opts ...gax.CallOption) *StreamIterator { + return c.internalClient.ListStreams(ctx, req, opts...) +} + +// GetStream use this method to get details about a stream. +func (c *Client) GetStream(ctx context.Context, req *datastreampb.GetStreamRequest, opts ...gax.CallOption) (*datastreampb.Stream, error) { + return c.internalClient.GetStream(ctx, req, opts...) +} + +// CreateStream use this method to create a stream. +func (c *Client) CreateStream(ctx context.Context, req *datastreampb.CreateStreamRequest, opts ...gax.CallOption) (*CreateStreamOperation, error) { + return c.internalClient.CreateStream(ctx, req, opts...) +} + +// CreateStreamOperation returns a new CreateStreamOperation from a given name. +// The name must be that of a previously created CreateStreamOperation, possibly from a different process. +func (c *Client) CreateStreamOperation(name string) *CreateStreamOperation { + return c.internalClient.CreateStreamOperation(name) +} + +// UpdateStream use this method to update the configuration of a stream. +func (c *Client) UpdateStream(ctx context.Context, req *datastreampb.UpdateStreamRequest, opts ...gax.CallOption) (*UpdateStreamOperation, error) { + return c.internalClient.UpdateStream(ctx, req, opts...) +} + +// UpdateStreamOperation returns a new UpdateStreamOperation from a given name. +// The name must be that of a previously created UpdateStreamOperation, possibly from a different process. +func (c *Client) UpdateStreamOperation(name string) *UpdateStreamOperation { + return c.internalClient.UpdateStreamOperation(name) +} + +// DeleteStream use this method to delete a stream. +func (c *Client) DeleteStream(ctx context.Context, req *datastreampb.DeleteStreamRequest, opts ...gax.CallOption) (*DeleteStreamOperation, error) { + return c.internalClient.DeleteStream(ctx, req, opts...) +} + +// DeleteStreamOperation returns a new DeleteStreamOperation from a given name. +// The name must be that of a previously created DeleteStreamOperation, possibly from a different process. +func (c *Client) DeleteStreamOperation(name string) *DeleteStreamOperation { + return c.internalClient.DeleteStreamOperation(name) +} + +// FetchErrors use this method to fetch any errors associated with a stream. +func (c *Client) FetchErrors(ctx context.Context, req *datastreampb.FetchErrorsRequest, opts ...gax.CallOption) (*FetchErrorsOperation, error) { + return c.internalClient.FetchErrors(ctx, req, opts...) +} + +// FetchErrorsOperation returns a new FetchErrorsOperation from a given name. +// The name must be that of a previously created FetchErrorsOperation, possibly from a different process. +func (c *Client) FetchErrorsOperation(name string) *FetchErrorsOperation { + return c.internalClient.FetchErrorsOperation(name) +} + +// FetchStaticIps the FetchStaticIps API call exposes the static ips used by Datastream. +// Typically, a request returns children data objects under +// a parent data object that’s optionally supplied in the request. +func (c *Client) FetchStaticIps(ctx context.Context, req *datastreampb.FetchStaticIpsRequest, opts ...gax.CallOption) *StringIterator { + return c.internalClient.FetchStaticIps(ctx, req, opts...) +} + +// CreatePrivateConnection use this method to create a private connectivity configuration. +func (c *Client) CreatePrivateConnection(ctx context.Context, req *datastreampb.CreatePrivateConnectionRequest, opts ...gax.CallOption) (*CreatePrivateConnectionOperation, error) { + return c.internalClient.CreatePrivateConnection(ctx, req, opts...) +} + +// CreatePrivateConnectionOperation returns a new CreatePrivateConnectionOperation from a given name. +// The name must be that of a previously created CreatePrivateConnectionOperation, possibly from a different process. +func (c *Client) CreatePrivateConnectionOperation(name string) *CreatePrivateConnectionOperation { + return c.internalClient.CreatePrivateConnectionOperation(name) +} + +// GetPrivateConnection use this method to get details about a private connectivity configuration. +func (c *Client) GetPrivateConnection(ctx context.Context, req *datastreampb.GetPrivateConnectionRequest, opts ...gax.CallOption) (*datastreampb.PrivateConnection, error) { + return c.internalClient.GetPrivateConnection(ctx, req, opts...) +} + +// ListPrivateConnections use this method to list private connectivity configurations in a project +// and location. +func (c *Client) ListPrivateConnections(ctx context.Context, req *datastreampb.ListPrivateConnectionsRequest, opts ...gax.CallOption) *PrivateConnectionIterator { + return c.internalClient.ListPrivateConnections(ctx, req, opts...) +} + +// DeletePrivateConnection use this method to delete a private connectivity configuration. +func (c *Client) DeletePrivateConnection(ctx context.Context, req *datastreampb.DeletePrivateConnectionRequest, opts ...gax.CallOption) (*DeletePrivateConnectionOperation, error) { + return c.internalClient.DeletePrivateConnection(ctx, req, opts...) +} + +// DeletePrivateConnectionOperation returns a new DeletePrivateConnectionOperation from a given name. +// The name must be that of a previously created DeletePrivateConnectionOperation, possibly from a different process. +func (c *Client) DeletePrivateConnectionOperation(name string) *DeletePrivateConnectionOperation { + return c.internalClient.DeletePrivateConnectionOperation(name) +} + +// CreateRoute use this method to create a route for a private connectivity in a project +// and location. +func (c *Client) CreateRoute(ctx context.Context, req *datastreampb.CreateRouteRequest, opts ...gax.CallOption) (*CreateRouteOperation, error) { + return c.internalClient.CreateRoute(ctx, req, opts...) +} + +// CreateRouteOperation returns a new CreateRouteOperation from a given name. +// The name must be that of a previously created CreateRouteOperation, possibly from a different process. +func (c *Client) CreateRouteOperation(name string) *CreateRouteOperation { + return c.internalClient.CreateRouteOperation(name) +} + +// GetRoute use this method to get details about a route. +func (c *Client) GetRoute(ctx context.Context, req *datastreampb.GetRouteRequest, opts ...gax.CallOption) (*datastreampb.Route, error) { + return c.internalClient.GetRoute(ctx, req, opts...) +} + +// ListRoutes use this method to list routes created for a private connectivity in a +// project and location. +func (c *Client) ListRoutes(ctx context.Context, req *datastreampb.ListRoutesRequest, opts ...gax.CallOption) *RouteIterator { + return c.internalClient.ListRoutes(ctx, req, opts...) +} + +// DeleteRoute use this method to delete a route. +func (c *Client) DeleteRoute(ctx context.Context, req *datastreampb.DeleteRouteRequest, opts ...gax.CallOption) (*DeleteRouteOperation, error) { + return c.internalClient.DeleteRoute(ctx, req, opts...) +} + +// DeleteRouteOperation returns a new DeleteRouteOperation from a given name. +// The name must be that of a previously created DeleteRouteOperation, possibly from a different process. +func (c *Client) DeleteRouteOperation(name string) *DeleteRouteOperation { + return c.internalClient.DeleteRouteOperation(name) +} + +// gRPCClient is a client for interacting with DataStream API over gRPC transport. +// +// Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls. +type gRPCClient struct { + // Connection pool of gRPC connections to the service. + connPool gtransport.ConnPool + + // flag to opt out of default deadlines via GOOGLE_API_GO_EXPERIMENTAL_DISABLE_DEFAULT_DEADLINE + disableDeadlines bool + + // Points back to the CallOptions field of the containing Client + CallOptions **CallOptions + + // The gRPC API client. + client datastreampb.DatastreamClient + + // LROClient is used internally to handle long-running operations. + // It is exposed so that its CallOptions can be modified if required. + // Users should not Close this client. + LROClient **lroauto.OperationsClient + + // The x-goog-* metadata to be sent with each request. + xGoogMetadata metadata.MD +} + +// NewClient creates a new datastream client based on gRPC. +// The returned client must be Closed when it is done being used to clean up its underlying connections. +// +// Datastream service +func NewClient(ctx context.Context, opts ...option.ClientOption) (*Client, error) { + clientOpts := defaultGRPCClientOptions() + if newClientHook != nil { + hookOpts, err := newClientHook(ctx, clientHookParams{}) + if err != nil { + return nil, err + } + clientOpts = append(clientOpts, hookOpts...) + } + + disableDeadlines, err := checkDisableDeadlines() + if err != nil { + return nil, err + } + + connPool, err := gtransport.DialPool(ctx, append(clientOpts, opts...)...) + if err != nil { + return nil, err + } + client := Client{CallOptions: defaultCallOptions()} + + c := &gRPCClient{ + connPool: connPool, + disableDeadlines: disableDeadlines, + client: datastreampb.NewDatastreamClient(connPool), + CallOptions: &client.CallOptions, + } + c.setGoogleClientInfo() + + client.internalClient = c + + client.LROClient, err = lroauto.NewOperationsClient(ctx, gtransport.WithConnPool(connPool)) + if err != nil { + // This error "should not happen", since we are just reusing old connection pool + // and never actually need to dial. + // If this does happen, we could leak connp. However, we cannot close conn: + // If the user invoked the constructor with option.WithGRPCConn, + // we would close a connection that's still in use. + // TODO: investigate error conditions. + return nil, err + } + c.LROClient = &client.LROClient + return &client, nil +} + +// Connection returns a connection to the API service. +// +// Deprecated. +func (c *gRPCClient) Connection() *grpc.ClientConn { + return c.connPool.Conn() +} + +// 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 *gRPCClient) setGoogleClientInfo(keyval ...string) { + kv := append([]string{"gl-go", versionGo()}, keyval...) + kv = append(kv, "gapic", versionClient, "gax", gax.Version, "grpc", grpc.Version) + c.xGoogMetadata = metadata.Pairs("x-goog-api-client", gax.XGoogHeader(kv...)) +} + +// Close closes the connection to the API service. The user should invoke this when +// the client is no longer required. +func (c *gRPCClient) Close() error { + return c.connPool.Close() +} + +func (c *gRPCClient) ListConnectionProfiles(ctx context.Context, req *datastreampb.ListConnectionProfilesRequest, opts ...gax.CallOption) *ConnectionProfileIterator { + md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))) + ctx = insertMetadata(ctx, c.xGoogMetadata, md) + opts = append((*c.CallOptions).ListConnectionProfiles[0:len((*c.CallOptions).ListConnectionProfiles):len((*c.CallOptions).ListConnectionProfiles)], opts...) + it := &ConnectionProfileIterator{} + req = proto.Clone(req).(*datastreampb.ListConnectionProfilesRequest) + it.InternalFetch = func(pageSize int, pageToken string) ([]*datastreampb.ConnectionProfile, string, error) { + var resp *datastreampb.ListConnectionProfilesResponse + req.PageToken = pageToken + if pageSize > math.MaxInt32 { + req.PageSize = math.MaxInt32 + } else { + req.PageSize = int32(pageSize) + } + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + resp, err = c.client.ListConnectionProfiles(ctx, req, settings.GRPC...) + return err + }, opts...) + if err != nil { + return nil, "", err + } + + it.Response = resp + return resp.GetConnectionProfiles(), 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.GetPageSize()) + it.pageInfo.Token = req.GetPageToken() + return it +} + +func (c *gRPCClient) GetConnectionProfile(ctx context.Context, req *datastreampb.GetConnectionProfileRequest, opts ...gax.CallOption) (*datastreampb.ConnectionProfile, error) { + if _, ok := ctx.Deadline(); !ok && !c.disableDeadlines { + cctx, cancel := context.WithTimeout(ctx, 60000*time.Millisecond) + defer cancel() + ctx = cctx + } + md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))) + ctx = insertMetadata(ctx, c.xGoogMetadata, md) + opts = append((*c.CallOptions).GetConnectionProfile[0:len((*c.CallOptions).GetConnectionProfile):len((*c.CallOptions).GetConnectionProfile)], opts...) + var resp *datastreampb.ConnectionProfile + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + resp, err = c.client.GetConnectionProfile(ctx, req, settings.GRPC...) + return err + }, opts...) + if err != nil { + return nil, err + } + return resp, nil +} + +func (c *gRPCClient) CreateConnectionProfile(ctx context.Context, req *datastreampb.CreateConnectionProfileRequest, opts ...gax.CallOption) (*CreateConnectionProfileOperation, error) { + if _, ok := ctx.Deadline(); !ok && !c.disableDeadlines { + cctx, cancel := context.WithTimeout(ctx, 60000*time.Millisecond) + defer cancel() + ctx = cctx + } + md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))) + ctx = insertMetadata(ctx, c.xGoogMetadata, md) + opts = append((*c.CallOptions).CreateConnectionProfile[0:len((*c.CallOptions).CreateConnectionProfile):len((*c.CallOptions).CreateConnectionProfile)], opts...) + var resp *longrunningpb.Operation + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + resp, err = c.client.CreateConnectionProfile(ctx, req, settings.GRPC...) + return err + }, opts...) + if err != nil { + return nil, err + } + return &CreateConnectionProfileOperation{ + lro: longrunning.InternalNewOperation(*c.LROClient, resp), + }, nil +} + +func (c *gRPCClient) UpdateConnectionProfile(ctx context.Context, req *datastreampb.UpdateConnectionProfileRequest, opts ...gax.CallOption) (*UpdateConnectionProfileOperation, error) { + if _, ok := ctx.Deadline(); !ok && !c.disableDeadlines { + cctx, cancel := context.WithTimeout(ctx, 60000*time.Millisecond) + defer cancel() + ctx = cctx + } + md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "connection_profile.name", url.QueryEscape(req.GetConnectionProfile().GetName()))) + ctx = insertMetadata(ctx, c.xGoogMetadata, md) + opts = append((*c.CallOptions).UpdateConnectionProfile[0:len((*c.CallOptions).UpdateConnectionProfile):len((*c.CallOptions).UpdateConnectionProfile)], opts...) + var resp *longrunningpb.Operation + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + resp, err = c.client.UpdateConnectionProfile(ctx, req, settings.GRPC...) + return err + }, opts...) + if err != nil { + return nil, err + } + return &UpdateConnectionProfileOperation{ + lro: longrunning.InternalNewOperation(*c.LROClient, resp), + }, nil +} + +func (c *gRPCClient) DeleteConnectionProfile(ctx context.Context, req *datastreampb.DeleteConnectionProfileRequest, opts ...gax.CallOption) (*DeleteConnectionProfileOperation, error) { + if _, ok := ctx.Deadline(); !ok && !c.disableDeadlines { + cctx, cancel := context.WithTimeout(ctx, 60000*time.Millisecond) + defer cancel() + ctx = cctx + } + md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))) + ctx = insertMetadata(ctx, c.xGoogMetadata, md) + opts = append((*c.CallOptions).DeleteConnectionProfile[0:len((*c.CallOptions).DeleteConnectionProfile):len((*c.CallOptions).DeleteConnectionProfile)], opts...) + var resp *longrunningpb.Operation + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + resp, err = c.client.DeleteConnectionProfile(ctx, req, settings.GRPC...) + return err + }, opts...) + if err != nil { + return nil, err + } + return &DeleteConnectionProfileOperation{ + lro: longrunning.InternalNewOperation(*c.LROClient, resp), + }, nil +} + +func (c *gRPCClient) DiscoverConnectionProfile(ctx context.Context, req *datastreampb.DiscoverConnectionProfileRequest, opts ...gax.CallOption) (*datastreampb.DiscoverConnectionProfileResponse, error) { + if _, ok := ctx.Deadline(); !ok && !c.disableDeadlines { + cctx, cancel := context.WithTimeout(ctx, 60000*time.Millisecond) + defer cancel() + ctx = cctx + } + md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))) + ctx = insertMetadata(ctx, c.xGoogMetadata, md) + opts = append((*c.CallOptions).DiscoverConnectionProfile[0:len((*c.CallOptions).DiscoverConnectionProfile):len((*c.CallOptions).DiscoverConnectionProfile)], opts...) + var resp *datastreampb.DiscoverConnectionProfileResponse + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + resp, err = c.client.DiscoverConnectionProfile(ctx, req, settings.GRPC...) + return err + }, opts...) + if err != nil { + return nil, err + } + return resp, nil +} + +func (c *gRPCClient) ListStreams(ctx context.Context, req *datastreampb.ListStreamsRequest, opts ...gax.CallOption) *StreamIterator { + md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))) + ctx = insertMetadata(ctx, c.xGoogMetadata, md) + opts = append((*c.CallOptions).ListStreams[0:len((*c.CallOptions).ListStreams):len((*c.CallOptions).ListStreams)], opts...) + it := &StreamIterator{} + req = proto.Clone(req).(*datastreampb.ListStreamsRequest) + it.InternalFetch = func(pageSize int, pageToken string) ([]*datastreampb.Stream, string, error) { + var resp *datastreampb.ListStreamsResponse + req.PageToken = pageToken + if pageSize > math.MaxInt32 { + req.PageSize = math.MaxInt32 + } else { + req.PageSize = int32(pageSize) + } + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + resp, err = c.client.ListStreams(ctx, req, settings.GRPC...) + return err + }, opts...) + if err != nil { + return nil, "", err + } + + it.Response = resp + return resp.GetStreams(), 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.GetPageSize()) + it.pageInfo.Token = req.GetPageToken() + return it +} + +func (c *gRPCClient) GetStream(ctx context.Context, req *datastreampb.GetStreamRequest, opts ...gax.CallOption) (*datastreampb.Stream, error) { + if _, ok := ctx.Deadline(); !ok && !c.disableDeadlines { + cctx, cancel := context.WithTimeout(ctx, 60000*time.Millisecond) + defer cancel() + ctx = cctx + } + md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))) + ctx = insertMetadata(ctx, c.xGoogMetadata, md) + opts = append((*c.CallOptions).GetStream[0:len((*c.CallOptions).GetStream):len((*c.CallOptions).GetStream)], opts...) + var resp *datastreampb.Stream + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + resp, err = c.client.GetStream(ctx, req, settings.GRPC...) + return err + }, opts...) + if err != nil { + return nil, err + } + return resp, nil +} + +func (c *gRPCClient) CreateStream(ctx context.Context, req *datastreampb.CreateStreamRequest, opts ...gax.CallOption) (*CreateStreamOperation, error) { + if _, ok := ctx.Deadline(); !ok && !c.disableDeadlines { + cctx, cancel := context.WithTimeout(ctx, 60000*time.Millisecond) + defer cancel() + ctx = cctx + } + md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))) + ctx = insertMetadata(ctx, c.xGoogMetadata, md) + opts = append((*c.CallOptions).CreateStream[0:len((*c.CallOptions).CreateStream):len((*c.CallOptions).CreateStream)], opts...) + var resp *longrunningpb.Operation + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + resp, err = c.client.CreateStream(ctx, req, settings.GRPC...) + return err + }, opts...) + if err != nil { + return nil, err + } + return &CreateStreamOperation{ + lro: longrunning.InternalNewOperation(*c.LROClient, resp), + }, nil +} + +func (c *gRPCClient) UpdateStream(ctx context.Context, req *datastreampb.UpdateStreamRequest, opts ...gax.CallOption) (*UpdateStreamOperation, error) { + if _, ok := ctx.Deadline(); !ok && !c.disableDeadlines { + cctx, cancel := context.WithTimeout(ctx, 60000*time.Millisecond) + defer cancel() + ctx = cctx + } + md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "stream.name", url.QueryEscape(req.GetStream().GetName()))) + ctx = insertMetadata(ctx, c.xGoogMetadata, md) + opts = append((*c.CallOptions).UpdateStream[0:len((*c.CallOptions).UpdateStream):len((*c.CallOptions).UpdateStream)], opts...) + var resp *longrunningpb.Operation + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + resp, err = c.client.UpdateStream(ctx, req, settings.GRPC...) + return err + }, opts...) + if err != nil { + return nil, err + } + return &UpdateStreamOperation{ + lro: longrunning.InternalNewOperation(*c.LROClient, resp), + }, nil +} + +func (c *gRPCClient) DeleteStream(ctx context.Context, req *datastreampb.DeleteStreamRequest, opts ...gax.CallOption) (*DeleteStreamOperation, error) { + if _, ok := ctx.Deadline(); !ok && !c.disableDeadlines { + cctx, cancel := context.WithTimeout(ctx, 60000*time.Millisecond) + defer cancel() + ctx = cctx + } + md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))) + ctx = insertMetadata(ctx, c.xGoogMetadata, md) + opts = append((*c.CallOptions).DeleteStream[0:len((*c.CallOptions).DeleteStream):len((*c.CallOptions).DeleteStream)], opts...) + var resp *longrunningpb.Operation + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + resp, err = c.client.DeleteStream(ctx, req, settings.GRPC...) + return err + }, opts...) + if err != nil { + return nil, err + } + return &DeleteStreamOperation{ + lro: longrunning.InternalNewOperation(*c.LROClient, resp), + }, nil +} + +func (c *gRPCClient) FetchErrors(ctx context.Context, req *datastreampb.FetchErrorsRequest, opts ...gax.CallOption) (*FetchErrorsOperation, error) { + if _, ok := ctx.Deadline(); !ok && !c.disableDeadlines { + cctx, cancel := context.WithTimeout(ctx, 60000*time.Millisecond) + defer cancel() + ctx = cctx + } + md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "stream", url.QueryEscape(req.GetStream()))) + ctx = insertMetadata(ctx, c.xGoogMetadata, md) + opts = append((*c.CallOptions).FetchErrors[0:len((*c.CallOptions).FetchErrors):len((*c.CallOptions).FetchErrors)], opts...) + var resp *longrunningpb.Operation + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + resp, err = c.client.FetchErrors(ctx, req, settings.GRPC...) + return err + }, opts...) + if err != nil { + return nil, err + } + return &FetchErrorsOperation{ + lro: longrunning.InternalNewOperation(*c.LROClient, resp), + }, nil +} + +func (c *gRPCClient) FetchStaticIps(ctx context.Context, req *datastreampb.FetchStaticIpsRequest, opts ...gax.CallOption) *StringIterator { + md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))) + ctx = insertMetadata(ctx, c.xGoogMetadata, md) + opts = append((*c.CallOptions).FetchStaticIps[0:len((*c.CallOptions).FetchStaticIps):len((*c.CallOptions).FetchStaticIps)], opts...) + it := &StringIterator{} + req = proto.Clone(req).(*datastreampb.FetchStaticIpsRequest) + it.InternalFetch = func(pageSize int, pageToken string) ([]string, string, error) { + var resp *datastreampb.FetchStaticIpsResponse + req.PageToken = pageToken + if pageSize > math.MaxInt32 { + req.PageSize = math.MaxInt32 + } else { + req.PageSize = int32(pageSize) + } + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + resp, err = c.client.FetchStaticIps(ctx, req, settings.GRPC...) + return err + }, opts...) + if err != nil { + return nil, "", err + } + + it.Response = resp + return resp.GetStaticIps(), 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.GetPageSize()) + it.pageInfo.Token = req.GetPageToken() + return it +} + +func (c *gRPCClient) CreatePrivateConnection(ctx context.Context, req *datastreampb.CreatePrivateConnectionRequest, opts ...gax.CallOption) (*CreatePrivateConnectionOperation, error) { + if _, ok := ctx.Deadline(); !ok && !c.disableDeadlines { + cctx, cancel := context.WithTimeout(ctx, 60000*time.Millisecond) + defer cancel() + ctx = cctx + } + md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))) + ctx = insertMetadata(ctx, c.xGoogMetadata, md) + opts = append((*c.CallOptions).CreatePrivateConnection[0:len((*c.CallOptions).CreatePrivateConnection):len((*c.CallOptions).CreatePrivateConnection)], opts...) + var resp *longrunningpb.Operation + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + resp, err = c.client.CreatePrivateConnection(ctx, req, settings.GRPC...) + return err + }, opts...) + if err != nil { + return nil, err + } + return &CreatePrivateConnectionOperation{ + lro: longrunning.InternalNewOperation(*c.LROClient, resp), + }, nil +} + +func (c *gRPCClient) GetPrivateConnection(ctx context.Context, req *datastreampb.GetPrivateConnectionRequest, opts ...gax.CallOption) (*datastreampb.PrivateConnection, error) { + if _, ok := ctx.Deadline(); !ok && !c.disableDeadlines { + cctx, cancel := context.WithTimeout(ctx, 60000*time.Millisecond) + defer cancel() + ctx = cctx + } + md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))) + ctx = insertMetadata(ctx, c.xGoogMetadata, md) + opts = append((*c.CallOptions).GetPrivateConnection[0:len((*c.CallOptions).GetPrivateConnection):len((*c.CallOptions).GetPrivateConnection)], opts...) + var resp *datastreampb.PrivateConnection + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + resp, err = c.client.GetPrivateConnection(ctx, req, settings.GRPC...) + return err + }, opts...) + if err != nil { + return nil, err + } + return resp, nil +} + +func (c *gRPCClient) ListPrivateConnections(ctx context.Context, req *datastreampb.ListPrivateConnectionsRequest, opts ...gax.CallOption) *PrivateConnectionIterator { + md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))) + ctx = insertMetadata(ctx, c.xGoogMetadata, md) + opts = append((*c.CallOptions).ListPrivateConnections[0:len((*c.CallOptions).ListPrivateConnections):len((*c.CallOptions).ListPrivateConnections)], opts...) + it := &PrivateConnectionIterator{} + req = proto.Clone(req).(*datastreampb.ListPrivateConnectionsRequest) + it.InternalFetch = func(pageSize int, pageToken string) ([]*datastreampb.PrivateConnection, string, error) { + var resp *datastreampb.ListPrivateConnectionsResponse + req.PageToken = pageToken + if pageSize > math.MaxInt32 { + req.PageSize = math.MaxInt32 + } else { + req.PageSize = int32(pageSize) + } + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + resp, err = c.client.ListPrivateConnections(ctx, req, settings.GRPC...) + return err + }, opts...) + if err != nil { + return nil, "", err + } + + it.Response = resp + return resp.GetPrivateConnections(), 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.GetPageSize()) + it.pageInfo.Token = req.GetPageToken() + return it +} + +func (c *gRPCClient) DeletePrivateConnection(ctx context.Context, req *datastreampb.DeletePrivateConnectionRequest, opts ...gax.CallOption) (*DeletePrivateConnectionOperation, error) { + if _, ok := ctx.Deadline(); !ok && !c.disableDeadlines { + cctx, cancel := context.WithTimeout(ctx, 60000*time.Millisecond) + defer cancel() + ctx = cctx + } + md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))) + ctx = insertMetadata(ctx, c.xGoogMetadata, md) + opts = append((*c.CallOptions).DeletePrivateConnection[0:len((*c.CallOptions).DeletePrivateConnection):len((*c.CallOptions).DeletePrivateConnection)], opts...) + var resp *longrunningpb.Operation + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + resp, err = c.client.DeletePrivateConnection(ctx, req, settings.GRPC...) + return err + }, opts...) + if err != nil { + return nil, err + } + return &DeletePrivateConnectionOperation{ + lro: longrunning.InternalNewOperation(*c.LROClient, resp), + }, nil +} + +func (c *gRPCClient) CreateRoute(ctx context.Context, req *datastreampb.CreateRouteRequest, opts ...gax.CallOption) (*CreateRouteOperation, error) { + if _, ok := ctx.Deadline(); !ok && !c.disableDeadlines { + cctx, cancel := context.WithTimeout(ctx, 60000*time.Millisecond) + defer cancel() + ctx = cctx + } + md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))) + ctx = insertMetadata(ctx, c.xGoogMetadata, md) + opts = append((*c.CallOptions).CreateRoute[0:len((*c.CallOptions).CreateRoute):len((*c.CallOptions).CreateRoute)], opts...) + var resp *longrunningpb.Operation + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + resp, err = c.client.CreateRoute(ctx, req, settings.GRPC...) + return err + }, opts...) + if err != nil { + return nil, err + } + return &CreateRouteOperation{ + lro: longrunning.InternalNewOperation(*c.LROClient, resp), + }, nil +} + +func (c *gRPCClient) GetRoute(ctx context.Context, req *datastreampb.GetRouteRequest, opts ...gax.CallOption) (*datastreampb.Route, error) { + if _, ok := ctx.Deadline(); !ok && !c.disableDeadlines { + cctx, cancel := context.WithTimeout(ctx, 60000*time.Millisecond) + defer cancel() + ctx = cctx + } + md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))) + ctx = insertMetadata(ctx, c.xGoogMetadata, md) + opts = append((*c.CallOptions).GetRoute[0:len((*c.CallOptions).GetRoute):len((*c.CallOptions).GetRoute)], opts...) + var resp *datastreampb.Route + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + resp, err = c.client.GetRoute(ctx, req, settings.GRPC...) + return err + }, opts...) + if err != nil { + return nil, err + } + return resp, nil +} + +func (c *gRPCClient) ListRoutes(ctx context.Context, req *datastreampb.ListRoutesRequest, opts ...gax.CallOption) *RouteIterator { + md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))) + ctx = insertMetadata(ctx, c.xGoogMetadata, md) + opts = append((*c.CallOptions).ListRoutes[0:len((*c.CallOptions).ListRoutes):len((*c.CallOptions).ListRoutes)], opts...) + it := &RouteIterator{} + req = proto.Clone(req).(*datastreampb.ListRoutesRequest) + it.InternalFetch = func(pageSize int, pageToken string) ([]*datastreampb.Route, string, error) { + var resp *datastreampb.ListRoutesResponse + req.PageToken = pageToken + if pageSize > math.MaxInt32 { + req.PageSize = math.MaxInt32 + } else { + req.PageSize = int32(pageSize) + } + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + resp, err = c.client.ListRoutes(ctx, req, settings.GRPC...) + return err + }, opts...) + if err != nil { + return nil, "", err + } + + it.Response = resp + return resp.GetRoutes(), 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.GetPageSize()) + it.pageInfo.Token = req.GetPageToken() + return it +} + +func (c *gRPCClient) DeleteRoute(ctx context.Context, req *datastreampb.DeleteRouteRequest, opts ...gax.CallOption) (*DeleteRouteOperation, error) { + if _, ok := ctx.Deadline(); !ok && !c.disableDeadlines { + cctx, cancel := context.WithTimeout(ctx, 60000*time.Millisecond) + defer cancel() + ctx = cctx + } + md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))) + ctx = insertMetadata(ctx, c.xGoogMetadata, md) + opts = append((*c.CallOptions).DeleteRoute[0:len((*c.CallOptions).DeleteRoute):len((*c.CallOptions).DeleteRoute)], opts...) + var resp *longrunningpb.Operation + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + resp, err = c.client.DeleteRoute(ctx, req, settings.GRPC...) + return err + }, opts...) + if err != nil { + return nil, err + } + return &DeleteRouteOperation{ + lro: longrunning.InternalNewOperation(*c.LROClient, resp), + }, nil +} + +// CreateConnectionProfileOperation manages a long-running operation from CreateConnectionProfile. +type CreateConnectionProfileOperation struct { + lro *longrunning.Operation +} + +// CreateConnectionProfileOperation returns a new CreateConnectionProfileOperation from a given name. +// The name must be that of a previously created CreateConnectionProfileOperation, possibly from a different process. +func (c *gRPCClient) CreateConnectionProfileOperation(name string) *CreateConnectionProfileOperation { + return &CreateConnectionProfileOperation{ + lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}), + } +} + +// Wait blocks until the long-running operation is completed, returning the response and any errors encountered. +// +// See documentation of Poll for error-handling information. +func (op *CreateConnectionProfileOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*datastreampb.ConnectionProfile, error) { + var resp datastreampb.ConnectionProfile + if err := op.lro.WaitWithInterval(ctx, &resp, time.Minute, opts...); err != nil { + return nil, err + } + return &resp, nil +} + +// Poll fetches the latest state of the long-running operation. +// +// Poll also fetches the latest metadata, which can be retrieved by Metadata. +// +// If Poll fails, the error is returned and op is unmodified. If Poll succeeds and +// the operation has completed with failure, the error is returned and op.Done will return true. +// If Poll succeeds and the operation has completed successfully, +// op.Done will return true, and the response of the operation is returned. +// If Poll succeeds and the operation has not completed, the returned response and error are both nil. +func (op *CreateConnectionProfileOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*datastreampb.ConnectionProfile, error) { + var resp datastreampb.ConnectionProfile + if err := op.lro.Poll(ctx, &resp, opts...); err != nil { + return nil, err + } + if !op.Done() { + return nil, nil + } + return &resp, nil +} + +// Metadata returns metadata associated with the long-running operation. +// Metadata itself does not contact the server, but Poll does. +// To get the latest metadata, call this method after a successful call to Poll. +// If the metadata is not available, the returned metadata and error are both nil. +func (op *CreateConnectionProfileOperation) Metadata() (*datastreampb.OperationMetadata, error) { + var meta datastreampb.OperationMetadata + if err := op.lro.Metadata(&meta); err == longrunning.ErrNoMetadata { + return nil, nil + } else if err != nil { + return nil, err + } + return &meta, nil +} + +// Done reports whether the long-running operation has completed. +func (op *CreateConnectionProfileOperation) Done() bool { + return op.lro.Done() +} + +// Name returns the name of the long-running operation. +// The name is assigned by the server and is unique within the service from which the operation is created. +func (op *CreateConnectionProfileOperation) Name() string { + return op.lro.Name() +} + +// CreatePrivateConnectionOperation manages a long-running operation from CreatePrivateConnection. +type CreatePrivateConnectionOperation struct { + lro *longrunning.Operation +} + +// CreatePrivateConnectionOperation returns a new CreatePrivateConnectionOperation from a given name. +// The name must be that of a previously created CreatePrivateConnectionOperation, possibly from a different process. +func (c *gRPCClient) CreatePrivateConnectionOperation(name string) *CreatePrivateConnectionOperation { + return &CreatePrivateConnectionOperation{ + lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}), + } +} + +// Wait blocks until the long-running operation is completed, returning the response and any errors encountered. +// +// See documentation of Poll for error-handling information. +func (op *CreatePrivateConnectionOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*datastreampb.PrivateConnection, error) { + var resp datastreampb.PrivateConnection + if err := op.lro.WaitWithInterval(ctx, &resp, time.Minute, opts...); err != nil { + return nil, err + } + return &resp, nil +} + +// Poll fetches the latest state of the long-running operation. +// +// Poll also fetches the latest metadata, which can be retrieved by Metadata. +// +// If Poll fails, the error is returned and op is unmodified. If Poll succeeds and +// the operation has completed with failure, the error is returned and op.Done will return true. +// If Poll succeeds and the operation has completed successfully, +// op.Done will return true, and the response of the operation is returned. +// If Poll succeeds and the operation has not completed, the returned response and error are both nil. +func (op *CreatePrivateConnectionOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*datastreampb.PrivateConnection, error) { + var resp datastreampb.PrivateConnection + if err := op.lro.Poll(ctx, &resp, opts...); err != nil { + return nil, err + } + if !op.Done() { + return nil, nil + } + return &resp, nil +} + +// Metadata returns metadata associated with the long-running operation. +// Metadata itself does not contact the server, but Poll does. +// To get the latest metadata, call this method after a successful call to Poll. +// If the metadata is not available, the returned metadata and error are both nil. +func (op *CreatePrivateConnectionOperation) Metadata() (*datastreampb.OperationMetadata, error) { + var meta datastreampb.OperationMetadata + if err := op.lro.Metadata(&meta); err == longrunning.ErrNoMetadata { + return nil, nil + } else if err != nil { + return nil, err + } + return &meta, nil +} + +// Done reports whether the long-running operation has completed. +func (op *CreatePrivateConnectionOperation) Done() bool { + return op.lro.Done() +} + +// Name returns the name of the long-running operation. +// The name is assigned by the server and is unique within the service from which the operation is created. +func (op *CreatePrivateConnectionOperation) Name() string { + return op.lro.Name() +} + +// CreateRouteOperation manages a long-running operation from CreateRoute. +type CreateRouteOperation struct { + lro *longrunning.Operation +} + +// CreateRouteOperation returns a new CreateRouteOperation from a given name. +// The name must be that of a previously created CreateRouteOperation, possibly from a different process. +func (c *gRPCClient) CreateRouteOperation(name string) *CreateRouteOperation { + return &CreateRouteOperation{ + lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}), + } +} + +// Wait blocks until the long-running operation is completed, returning the response and any errors encountered. +// +// See documentation of Poll for error-handling information. +func (op *CreateRouteOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*datastreampb.Route, error) { + var resp datastreampb.Route + if err := op.lro.WaitWithInterval(ctx, &resp, time.Minute, opts...); err != nil { + return nil, err + } + return &resp, nil +} + +// Poll fetches the latest state of the long-running operation. +// +// Poll also fetches the latest metadata, which can be retrieved by Metadata. +// +// If Poll fails, the error is returned and op is unmodified. If Poll succeeds and +// the operation has completed with failure, the error is returned and op.Done will return true. +// If Poll succeeds and the operation has completed successfully, +// op.Done will return true, and the response of the operation is returned. +// If Poll succeeds and the operation has not completed, the returned response and error are both nil. +func (op *CreateRouteOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*datastreampb.Route, error) { + var resp datastreampb.Route + if err := op.lro.Poll(ctx, &resp, opts...); err != nil { + return nil, err + } + if !op.Done() { + return nil, nil + } + return &resp, nil +} + +// Metadata returns metadata associated with the long-running operation. +// Metadata itself does not contact the server, but Poll does. +// To get the latest metadata, call this method after a successful call to Poll. +// If the metadata is not available, the returned metadata and error are both nil. +func (op *CreateRouteOperation) Metadata() (*datastreampb.OperationMetadata, error) { + var meta datastreampb.OperationMetadata + if err := op.lro.Metadata(&meta); err == longrunning.ErrNoMetadata { + return nil, nil + } else if err != nil { + return nil, err + } + return &meta, nil +} + +// Done reports whether the long-running operation has completed. +func (op *CreateRouteOperation) Done() bool { + return op.lro.Done() +} + +// Name returns the name of the long-running operation. +// The name is assigned by the server and is unique within the service from which the operation is created. +func (op *CreateRouteOperation) Name() string { + return op.lro.Name() +} + +// CreateStreamOperation manages a long-running operation from CreateStream. +type CreateStreamOperation struct { + lro *longrunning.Operation +} + +// CreateStreamOperation returns a new CreateStreamOperation from a given name. +// The name must be that of a previously created CreateStreamOperation, possibly from a different process. +func (c *gRPCClient) CreateStreamOperation(name string) *CreateStreamOperation { + return &CreateStreamOperation{ + lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}), + } +} + +// Wait blocks until the long-running operation is completed, returning the response and any errors encountered. +// +// See documentation of Poll for error-handling information. +func (op *CreateStreamOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*datastreampb.Stream, error) { + var resp datastreampb.Stream + if err := op.lro.WaitWithInterval(ctx, &resp, time.Minute, opts...); err != nil { + return nil, err + } + return &resp, nil +} + +// Poll fetches the latest state of the long-running operation. +// +// Poll also fetches the latest metadata, which can be retrieved by Metadata. +// +// If Poll fails, the error is returned and op is unmodified. If Poll succeeds and +// the operation has completed with failure, the error is returned and op.Done will return true. +// If Poll succeeds and the operation has completed successfully, +// op.Done will return true, and the response of the operation is returned. +// If Poll succeeds and the operation has not completed, the returned response and error are both nil. +func (op *CreateStreamOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*datastreampb.Stream, error) { + var resp datastreampb.Stream + if err := op.lro.Poll(ctx, &resp, opts...); err != nil { + return nil, err + } + if !op.Done() { + return nil, nil + } + return &resp, nil +} + +// Metadata returns metadata associated with the long-running operation. +// Metadata itself does not contact the server, but Poll does. +// To get the latest metadata, call this method after a successful call to Poll. +// If the metadata is not available, the returned metadata and error are both nil. +func (op *CreateStreamOperation) Metadata() (*datastreampb.OperationMetadata, error) { + var meta datastreampb.OperationMetadata + if err := op.lro.Metadata(&meta); err == longrunning.ErrNoMetadata { + return nil, nil + } else if err != nil { + return nil, err + } + return &meta, nil +} + +// Done reports whether the long-running operation has completed. +func (op *CreateStreamOperation) Done() bool { + return op.lro.Done() +} + +// Name returns the name of the long-running operation. +// The name is assigned by the server and is unique within the service from which the operation is created. +func (op *CreateStreamOperation) Name() string { + return op.lro.Name() +} + +// DeleteConnectionProfileOperation manages a long-running operation from DeleteConnectionProfile. +type DeleteConnectionProfileOperation struct { + lro *longrunning.Operation +} + +// DeleteConnectionProfileOperation returns a new DeleteConnectionProfileOperation from a given name. +// The name must be that of a previously created DeleteConnectionProfileOperation, possibly from a different process. +func (c *gRPCClient) DeleteConnectionProfileOperation(name string) *DeleteConnectionProfileOperation { + return &DeleteConnectionProfileOperation{ + lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}), + } +} + +// Wait blocks until the long-running operation is completed, returning the response and any errors encountered. +// +// See documentation of Poll for error-handling information. +func (op *DeleteConnectionProfileOperation) Wait(ctx context.Context, opts ...gax.CallOption) error { + return op.lro.WaitWithInterval(ctx, nil, time.Minute, opts...) +} + +// Poll fetches the latest state of the long-running operation. +// +// Poll also fetches the latest metadata, which can be retrieved by Metadata. +// +// If Poll fails, the error is returned and op is unmodified. If Poll succeeds and +// the operation has completed with failure, the error is returned and op.Done will return true. +// If Poll succeeds and the operation has completed successfully, +// op.Done will return true, and the response of the operation is returned. +// If Poll succeeds and the operation has not completed, the returned response and error are both nil. +func (op *DeleteConnectionProfileOperation) Poll(ctx context.Context, opts ...gax.CallOption) error { + return op.lro.Poll(ctx, nil, opts...) +} + +// Metadata returns metadata associated with the long-running operation. +// Metadata itself does not contact the server, but Poll does. +// To get the latest metadata, call this method after a successful call to Poll. +// If the metadata is not available, the returned metadata and error are both nil. +func (op *DeleteConnectionProfileOperation) Metadata() (*datastreampb.OperationMetadata, error) { + var meta datastreampb.OperationMetadata + if err := op.lro.Metadata(&meta); err == longrunning.ErrNoMetadata { + return nil, nil + } else if err != nil { + return nil, err + } + return &meta, nil +} + +// Done reports whether the long-running operation has completed. +func (op *DeleteConnectionProfileOperation) Done() bool { + return op.lro.Done() +} + +// Name returns the name of the long-running operation. +// The name is assigned by the server and is unique within the service from which the operation is created. +func (op *DeleteConnectionProfileOperation) Name() string { + return op.lro.Name() +} + +// DeletePrivateConnectionOperation manages a long-running operation from DeletePrivateConnection. +type DeletePrivateConnectionOperation struct { + lro *longrunning.Operation +} + +// DeletePrivateConnectionOperation returns a new DeletePrivateConnectionOperation from a given name. +// The name must be that of a previously created DeletePrivateConnectionOperation, possibly from a different process. +func (c *gRPCClient) DeletePrivateConnectionOperation(name string) *DeletePrivateConnectionOperation { + return &DeletePrivateConnectionOperation{ + lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}), + } +} + +// Wait blocks until the long-running operation is completed, returning the response and any errors encountered. +// +// See documentation of Poll for error-handling information. +func (op *DeletePrivateConnectionOperation) Wait(ctx context.Context, opts ...gax.CallOption) error { + return op.lro.WaitWithInterval(ctx, nil, time.Minute, opts...) +} + +// Poll fetches the latest state of the long-running operation. +// +// Poll also fetches the latest metadata, which can be retrieved by Metadata. +// +// If Poll fails, the error is returned and op is unmodified. If Poll succeeds and +// the operation has completed with failure, the error is returned and op.Done will return true. +// If Poll succeeds and the operation has completed successfully, +// op.Done will return true, and the response of the operation is returned. +// If Poll succeeds and the operation has not completed, the returned response and error are both nil. +func (op *DeletePrivateConnectionOperation) Poll(ctx context.Context, opts ...gax.CallOption) error { + return op.lro.Poll(ctx, nil, opts...) +} + +// Metadata returns metadata associated with the long-running operation. +// Metadata itself does not contact the server, but Poll does. +// To get the latest metadata, call this method after a successful call to Poll. +// If the metadata is not available, the returned metadata and error are both nil. +func (op *DeletePrivateConnectionOperation) Metadata() (*datastreampb.OperationMetadata, error) { + var meta datastreampb.OperationMetadata + if err := op.lro.Metadata(&meta); err == longrunning.ErrNoMetadata { + return nil, nil + } else if err != nil { + return nil, err + } + return &meta, nil +} + +// Done reports whether the long-running operation has completed. +func (op *DeletePrivateConnectionOperation) Done() bool { + return op.lro.Done() +} + +// Name returns the name of the long-running operation. +// The name is assigned by the server and is unique within the service from which the operation is created. +func (op *DeletePrivateConnectionOperation) Name() string { + return op.lro.Name() +} + +// DeleteRouteOperation manages a long-running operation from DeleteRoute. +type DeleteRouteOperation struct { + lro *longrunning.Operation +} + +// DeleteRouteOperation returns a new DeleteRouteOperation from a given name. +// The name must be that of a previously created DeleteRouteOperation, possibly from a different process. +func (c *gRPCClient) DeleteRouteOperation(name string) *DeleteRouteOperation { + return &DeleteRouteOperation{ + lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}), + } +} + +// Wait blocks until the long-running operation is completed, returning the response and any errors encountered. +// +// See documentation of Poll for error-handling information. +func (op *DeleteRouteOperation) Wait(ctx context.Context, opts ...gax.CallOption) error { + return op.lro.WaitWithInterval(ctx, nil, time.Minute, opts...) +} + +// Poll fetches the latest state of the long-running operation. +// +// Poll also fetches the latest metadata, which can be retrieved by Metadata. +// +// If Poll fails, the error is returned and op is unmodified. If Poll succeeds and +// the operation has completed with failure, the error is returned and op.Done will return true. +// If Poll succeeds and the operation has completed successfully, +// op.Done will return true, and the response of the operation is returned. +// If Poll succeeds and the operation has not completed, the returned response and error are both nil. +func (op *DeleteRouteOperation) Poll(ctx context.Context, opts ...gax.CallOption) error { + return op.lro.Poll(ctx, nil, opts...) +} + +// Metadata returns metadata associated with the long-running operation. +// Metadata itself does not contact the server, but Poll does. +// To get the latest metadata, call this method after a successful call to Poll. +// If the metadata is not available, the returned metadata and error are both nil. +func (op *DeleteRouteOperation) Metadata() (*datastreampb.OperationMetadata, error) { + var meta datastreampb.OperationMetadata + if err := op.lro.Metadata(&meta); err == longrunning.ErrNoMetadata { + return nil, nil + } else if err != nil { + return nil, err + } + return &meta, nil +} + +// Done reports whether the long-running operation has completed. +func (op *DeleteRouteOperation) Done() bool { + return op.lro.Done() +} + +// Name returns the name of the long-running operation. +// The name is assigned by the server and is unique within the service from which the operation is created. +func (op *DeleteRouteOperation) Name() string { + return op.lro.Name() +} + +// DeleteStreamOperation manages a long-running operation from DeleteStream. +type DeleteStreamOperation struct { + lro *longrunning.Operation +} + +// DeleteStreamOperation returns a new DeleteStreamOperation from a given name. +// The name must be that of a previously created DeleteStreamOperation, possibly from a different process. +func (c *gRPCClient) DeleteStreamOperation(name string) *DeleteStreamOperation { + return &DeleteStreamOperation{ + lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}), + } +} + +// Wait blocks until the long-running operation is completed, returning the response and any errors encountered. +// +// See documentation of Poll for error-handling information. +func (op *DeleteStreamOperation) Wait(ctx context.Context, opts ...gax.CallOption) error { + return op.lro.WaitWithInterval(ctx, nil, time.Minute, opts...) +} + +// Poll fetches the latest state of the long-running operation. +// +// Poll also fetches the latest metadata, which can be retrieved by Metadata. +// +// If Poll fails, the error is returned and op is unmodified. If Poll succeeds and +// the operation has completed with failure, the error is returned and op.Done will return true. +// If Poll succeeds and the operation has completed successfully, +// op.Done will return true, and the response of the operation is returned. +// If Poll succeeds and the operation has not completed, the returned response and error are both nil. +func (op *DeleteStreamOperation) Poll(ctx context.Context, opts ...gax.CallOption) error { + return op.lro.Poll(ctx, nil, opts...) +} + +// Metadata returns metadata associated with the long-running operation. +// Metadata itself does not contact the server, but Poll does. +// To get the latest metadata, call this method after a successful call to Poll. +// If the metadata is not available, the returned metadata and error are both nil. +func (op *DeleteStreamOperation) Metadata() (*datastreampb.OperationMetadata, error) { + var meta datastreampb.OperationMetadata + if err := op.lro.Metadata(&meta); err == longrunning.ErrNoMetadata { + return nil, nil + } else if err != nil { + return nil, err + } + return &meta, nil +} + +// Done reports whether the long-running operation has completed. +func (op *DeleteStreamOperation) Done() bool { + return op.lro.Done() +} + +// Name returns the name of the long-running operation. +// The name is assigned by the server and is unique within the service from which the operation is created. +func (op *DeleteStreamOperation) Name() string { + return op.lro.Name() +} + +// FetchErrorsOperation manages a long-running operation from FetchErrors. +type FetchErrorsOperation struct { + lro *longrunning.Operation +} + +// FetchErrorsOperation returns a new FetchErrorsOperation from a given name. +// The name must be that of a previously created FetchErrorsOperation, possibly from a different process. +func (c *gRPCClient) FetchErrorsOperation(name string) *FetchErrorsOperation { + return &FetchErrorsOperation{ + lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}), + } +} + +// Wait blocks until the long-running operation is completed, returning the response and any errors encountered. +// +// See documentation of Poll for error-handling information. +func (op *FetchErrorsOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*datastreampb.FetchErrorsResponse, error) { + var resp datastreampb.FetchErrorsResponse + if err := op.lro.WaitWithInterval(ctx, &resp, time.Minute, opts...); err != nil { + return nil, err + } + return &resp, nil +} + +// Poll fetches the latest state of the long-running operation. +// +// Poll also fetches the latest metadata, which can be retrieved by Metadata. +// +// If Poll fails, the error is returned and op is unmodified. If Poll succeeds and +// the operation has completed with failure, the error is returned and op.Done will return true. +// If Poll succeeds and the operation has completed successfully, +// op.Done will return true, and the response of the operation is returned. +// If Poll succeeds and the operation has not completed, the returned response and error are both nil. +func (op *FetchErrorsOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*datastreampb.FetchErrorsResponse, error) { + var resp datastreampb.FetchErrorsResponse + if err := op.lro.Poll(ctx, &resp, opts...); err != nil { + return nil, err + } + if !op.Done() { + return nil, nil + } + return &resp, nil +} + +// Metadata returns metadata associated with the long-running operation. +// Metadata itself does not contact the server, but Poll does. +// To get the latest metadata, call this method after a successful call to Poll. +// If the metadata is not available, the returned metadata and error are both nil. +func (op *FetchErrorsOperation) Metadata() (*datastreampb.OperationMetadata, error) { + var meta datastreampb.OperationMetadata + if err := op.lro.Metadata(&meta); err == longrunning.ErrNoMetadata { + return nil, nil + } else if err != nil { + return nil, err + } + return &meta, nil +} + +// Done reports whether the long-running operation has completed. +func (op *FetchErrorsOperation) Done() bool { + return op.lro.Done() +} + +// Name returns the name of the long-running operation. +// The name is assigned by the server and is unique within the service from which the operation is created. +func (op *FetchErrorsOperation) Name() string { + return op.lro.Name() +} + +// UpdateConnectionProfileOperation manages a long-running operation from UpdateConnectionProfile. +type UpdateConnectionProfileOperation struct { + lro *longrunning.Operation +} + +// UpdateConnectionProfileOperation returns a new UpdateConnectionProfileOperation from a given name. +// The name must be that of a previously created UpdateConnectionProfileOperation, possibly from a different process. +func (c *gRPCClient) UpdateConnectionProfileOperation(name string) *UpdateConnectionProfileOperation { + return &UpdateConnectionProfileOperation{ + lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}), + } +} + +// Wait blocks until the long-running operation is completed, returning the response and any errors encountered. +// +// See documentation of Poll for error-handling information. +func (op *UpdateConnectionProfileOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*datastreampb.ConnectionProfile, error) { + var resp datastreampb.ConnectionProfile + if err := op.lro.WaitWithInterval(ctx, &resp, time.Minute, opts...); err != nil { + return nil, err + } + return &resp, nil +} + +// Poll fetches the latest state of the long-running operation. +// +// Poll also fetches the latest metadata, which can be retrieved by Metadata. +// +// If Poll fails, the error is returned and op is unmodified. If Poll succeeds and +// the operation has completed with failure, the error is returned and op.Done will return true. +// If Poll succeeds and the operation has completed successfully, +// op.Done will return true, and the response of the operation is returned. +// If Poll succeeds and the operation has not completed, the returned response and error are both nil. +func (op *UpdateConnectionProfileOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*datastreampb.ConnectionProfile, error) { + var resp datastreampb.ConnectionProfile + if err := op.lro.Poll(ctx, &resp, opts...); err != nil { + return nil, err + } + if !op.Done() { + return nil, nil + } + return &resp, nil +} + +// Metadata returns metadata associated with the long-running operation. +// Metadata itself does not contact the server, but Poll does. +// To get the latest metadata, call this method after a successful call to Poll. +// If the metadata is not available, the returned metadata and error are both nil. +func (op *UpdateConnectionProfileOperation) Metadata() (*datastreampb.OperationMetadata, error) { + var meta datastreampb.OperationMetadata + if err := op.lro.Metadata(&meta); err == longrunning.ErrNoMetadata { + return nil, nil + } else if err != nil { + return nil, err + } + return &meta, nil +} + +// Done reports whether the long-running operation has completed. +func (op *UpdateConnectionProfileOperation) Done() bool { + return op.lro.Done() +} + +// Name returns the name of the long-running operation. +// The name is assigned by the server and is unique within the service from which the operation is created. +func (op *UpdateConnectionProfileOperation) Name() string { + return op.lro.Name() +} + +// UpdateStreamOperation manages a long-running operation from UpdateStream. +type UpdateStreamOperation struct { + lro *longrunning.Operation +} + +// UpdateStreamOperation returns a new UpdateStreamOperation from a given name. +// The name must be that of a previously created UpdateStreamOperation, possibly from a different process. +func (c *gRPCClient) UpdateStreamOperation(name string) *UpdateStreamOperation { + return &UpdateStreamOperation{ + lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}), + } +} + +// Wait blocks until the long-running operation is completed, returning the response and any errors encountered. +// +// See documentation of Poll for error-handling information. +func (op *UpdateStreamOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*datastreampb.Stream, error) { + var resp datastreampb.Stream + if err := op.lro.WaitWithInterval(ctx, &resp, time.Minute, opts...); err != nil { + return nil, err + } + return &resp, nil +} + +// Poll fetches the latest state of the long-running operation. +// +// Poll also fetches the latest metadata, which can be retrieved by Metadata. +// +// If Poll fails, the error is returned and op is unmodified. If Poll succeeds and +// the operation has completed with failure, the error is returned and op.Done will return true. +// If Poll succeeds and the operation has completed successfully, +// op.Done will return true, and the response of the operation is returned. +// If Poll succeeds and the operation has not completed, the returned response and error are both nil. +func (op *UpdateStreamOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*datastreampb.Stream, error) { + var resp datastreampb.Stream + if err := op.lro.Poll(ctx, &resp, opts...); err != nil { + return nil, err + } + if !op.Done() { + return nil, nil + } + return &resp, nil +} + +// Metadata returns metadata associated with the long-running operation. +// Metadata itself does not contact the server, but Poll does. +// To get the latest metadata, call this method after a successful call to Poll. +// If the metadata is not available, the returned metadata and error are both nil. +func (op *UpdateStreamOperation) Metadata() (*datastreampb.OperationMetadata, error) { + var meta datastreampb.OperationMetadata + if err := op.lro.Metadata(&meta); err == longrunning.ErrNoMetadata { + return nil, nil + } else if err != nil { + return nil, err + } + return &meta, nil +} + +// Done reports whether the long-running operation has completed. +func (op *UpdateStreamOperation) Done() bool { + return op.lro.Done() +} + +// Name returns the name of the long-running operation. +// The name is assigned by the server and is unique within the service from which the operation is created. +func (op *UpdateStreamOperation) Name() string { + return op.lro.Name() +} + +// ConnectionProfileIterator manages a stream of *datastreampb.ConnectionProfile. +type ConnectionProfileIterator struct { + items []*datastreampb.ConnectionProfile + 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 []*datastreampb.ConnectionProfile, nextPageToken string, err error) +} + +// PageInfo supports pagination. See the google.golang.org/api/iterator package for details. +func (it *ConnectionProfileIterator) 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 *ConnectionProfileIterator) Next() (*datastreampb.ConnectionProfile, error) { + var item *datastreampb.ConnectionProfile + if err := it.nextFunc(); err != nil { + return item, err + } + item = it.items[0] + it.items = it.items[1:] + return item, nil +} + +func (it *ConnectionProfileIterator) bufLen() int { + return len(it.items) +} + +func (it *ConnectionProfileIterator) takeBuf() interface{} { + b := it.items + it.items = nil + return b +} + +// PrivateConnectionIterator manages a stream of *datastreampb.PrivateConnection. +type PrivateConnectionIterator struct { + items []*datastreampb.PrivateConnection + 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 []*datastreampb.PrivateConnection, nextPageToken string, err error) +} + +// PageInfo supports pagination. See the google.golang.org/api/iterator package for details. +func (it *PrivateConnectionIterator) 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 *PrivateConnectionIterator) Next() (*datastreampb.PrivateConnection, error) { + var item *datastreampb.PrivateConnection + if err := it.nextFunc(); err != nil { + return item, err + } + item = it.items[0] + it.items = it.items[1:] + return item, nil +} + +func (it *PrivateConnectionIterator) bufLen() int { + return len(it.items) +} + +func (it *PrivateConnectionIterator) takeBuf() interface{} { + b := it.items + it.items = nil + return b +} + +// RouteIterator manages a stream of *datastreampb.Route. +type RouteIterator struct { + items []*datastreampb.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 []*datastreampb.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() (*datastreampb.Route, error) { + var item *datastreampb.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 +} + +// StreamIterator manages a stream of *datastreampb.Stream. +type StreamIterator struct { + items []*datastreampb.Stream + 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 []*datastreampb.Stream, nextPageToken string, err error) +} + +// PageInfo supports pagination. See the google.golang.org/api/iterator package for details. +func (it *StreamIterator) 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 *StreamIterator) Next() (*datastreampb.Stream, error) { + var item *datastreampb.Stream + if err := it.nextFunc(); err != nil { + return item, err + } + item = it.items[0] + it.items = it.items[1:] + return item, nil +} + +func (it *StreamIterator) bufLen() int { + return len(it.items) +} + +func (it *StreamIterator) takeBuf() interface{} { + b := it.items + it.items = nil + return b +} + +// StringIterator manages a stream of string. +type StringIterator struct { + items []string + 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 []string, nextPageToken string, err error) +} + +// PageInfo supports pagination. See the google.golang.org/api/iterator package for details. +func (it *StringIterator) 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 *StringIterator) Next() (string, error) { + var item string + if err := it.nextFunc(); err != nil { + return item, err + } + item = it.items[0] + it.items = it.items[1:] + return item, nil +} + +func (it *StringIterator) bufLen() int { + return len(it.items) +} + +func (it *StringIterator) takeBuf() interface{} { + b := it.items + it.items = nil + return b +} diff --git a/datastream/apiv1alpha1/datastream_client_example_test.go b/datastream/apiv1alpha1/datastream_client_example_test.go new file mode 100644 index 00000000000..c2fdcb2e2ad --- /dev/null +++ b/datastream/apiv1alpha1/datastream_client_example_test.go @@ -0,0 +1,513 @@ +// Copyright 2021 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 datastream_test + +import ( + "context" + + datastream "cloud.google.com/go/datastream/apiv1alpha1" + "google.golang.org/api/iterator" + datastreampb "google.golang.org/genproto/googleapis/cloud/datastream/v1alpha1" +) + +func ExampleNewClient() { + ctx := context.Background() + c, err := datastream.NewClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + // TODO: Use client. + _ = c +} + +func ExampleClient_ListConnectionProfiles() { + ctx := context.Background() + c, err := datastream.NewClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &datastreampb.ListConnectionProfilesRequest{ + // TODO: Fill request struct fields. + } + it := c.ListConnectionProfiles(ctx, req) + for { + resp, err := it.Next() + if err == iterator.Done { + break + } + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp + } +} + +func ExampleClient_GetConnectionProfile() { + ctx := context.Background() + c, err := datastream.NewClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &datastreampb.GetConnectionProfileRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.GetConnectionProfile(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleClient_CreateConnectionProfile() { + ctx := context.Background() + c, err := datastream.NewClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &datastreampb.CreateConnectionProfileRequest{ + // TODO: Fill request struct fields. + } + op, err := c.CreateConnectionProfile(ctx, req) + if err != nil { + // TODO: Handle error. + } + + resp, err := op.Wait(ctx) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleClient_UpdateConnectionProfile() { + ctx := context.Background() + c, err := datastream.NewClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &datastreampb.UpdateConnectionProfileRequest{ + // TODO: Fill request struct fields. + } + op, err := c.UpdateConnectionProfile(ctx, req) + if err != nil { + // TODO: Handle error. + } + + resp, err := op.Wait(ctx) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleClient_DeleteConnectionProfile() { + ctx := context.Background() + c, err := datastream.NewClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &datastreampb.DeleteConnectionProfileRequest{ + // TODO: Fill request struct fields. + } + op, err := c.DeleteConnectionProfile(ctx, req) + if err != nil { + // TODO: Handle error. + } + + err = op.Wait(ctx) + if err != nil { + // TODO: Handle error. + } +} + +func ExampleClient_DiscoverConnectionProfile() { + ctx := context.Background() + c, err := datastream.NewClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &datastreampb.DiscoverConnectionProfileRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.DiscoverConnectionProfile(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleClient_ListStreams() { + ctx := context.Background() + c, err := datastream.NewClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &datastreampb.ListStreamsRequest{ + // TODO: Fill request struct fields. + } + it := c.ListStreams(ctx, req) + for { + resp, err := it.Next() + if err == iterator.Done { + break + } + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp + } +} + +func ExampleClient_GetStream() { + ctx := context.Background() + c, err := datastream.NewClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &datastreampb.GetStreamRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.GetStream(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleClient_CreateStream() { + ctx := context.Background() + c, err := datastream.NewClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &datastreampb.CreateStreamRequest{ + // TODO: Fill request struct fields. + } + op, err := c.CreateStream(ctx, req) + if err != nil { + // TODO: Handle error. + } + + resp, err := op.Wait(ctx) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleClient_UpdateStream() { + ctx := context.Background() + c, err := datastream.NewClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &datastreampb.UpdateStreamRequest{ + // TODO: Fill request struct fields. + } + op, err := c.UpdateStream(ctx, req) + if err != nil { + // TODO: Handle error. + } + + resp, err := op.Wait(ctx) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleClient_DeleteStream() { + ctx := context.Background() + c, err := datastream.NewClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &datastreampb.DeleteStreamRequest{ + // TODO: Fill request struct fields. + } + op, err := c.DeleteStream(ctx, req) + if err != nil { + // TODO: Handle error. + } + + err = op.Wait(ctx) + if err != nil { + // TODO: Handle error. + } +} + +func ExampleClient_FetchErrors() { + ctx := context.Background() + c, err := datastream.NewClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &datastreampb.FetchErrorsRequest{ + // TODO: Fill request struct fields. + } + op, err := c.FetchErrors(ctx, req) + if err != nil { + // TODO: Handle error. + } + + resp, err := op.Wait(ctx) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleClient_FetchStaticIps() { + ctx := context.Background() + c, err := datastream.NewClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &datastreampb.FetchStaticIpsRequest{ + // TODO: Fill request struct fields. + } + it := c.FetchStaticIps(ctx, req) + for { + resp, err := it.Next() + if err == iterator.Done { + break + } + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp + } +} + +func ExampleClient_CreatePrivateConnection() { + ctx := context.Background() + c, err := datastream.NewClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &datastreampb.CreatePrivateConnectionRequest{ + // TODO: Fill request struct fields. + } + op, err := c.CreatePrivateConnection(ctx, req) + if err != nil { + // TODO: Handle error. + } + + resp, err := op.Wait(ctx) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleClient_GetPrivateConnection() { + ctx := context.Background() + c, err := datastream.NewClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &datastreampb.GetPrivateConnectionRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.GetPrivateConnection(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleClient_ListPrivateConnections() { + ctx := context.Background() + c, err := datastream.NewClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &datastreampb.ListPrivateConnectionsRequest{ + // TODO: Fill request struct fields. + } + it := c.ListPrivateConnections(ctx, req) + for { + resp, err := it.Next() + if err == iterator.Done { + break + } + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp + } +} + +func ExampleClient_DeletePrivateConnection() { + ctx := context.Background() + c, err := datastream.NewClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &datastreampb.DeletePrivateConnectionRequest{ + // TODO: Fill request struct fields. + } + op, err := c.DeletePrivateConnection(ctx, req) + if err != nil { + // TODO: Handle error. + } + + err = op.Wait(ctx) + if err != nil { + // TODO: Handle error. + } +} + +func ExampleClient_CreateRoute() { + ctx := context.Background() + c, err := datastream.NewClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &datastreampb.CreateRouteRequest{ + // TODO: Fill request struct fields. + } + op, err := c.CreateRoute(ctx, req) + if err != nil { + // TODO: Handle error. + } + + resp, err := op.Wait(ctx) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleClient_GetRoute() { + ctx := context.Background() + c, err := datastream.NewClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &datastreampb.GetRouteRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.GetRoute(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleClient_ListRoutes() { + ctx := context.Background() + c, err := datastream.NewClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &datastreampb.ListRoutesRequest{ + // TODO: Fill request struct fields. + } + it := c.ListRoutes(ctx, req) + for { + resp, err := it.Next() + if err == iterator.Done { + break + } + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp + } +} + +func ExampleClient_DeleteRoute() { + ctx := context.Background() + c, err := datastream.NewClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &datastreampb.DeleteRouteRequest{ + // TODO: Fill request struct fields. + } + op, err := c.DeleteRoute(ctx, req) + if err != nil { + // TODO: Handle error. + } + + err = op.Wait(ctx) + if err != nil { + // TODO: Handle error. + } +} diff --git a/datastream/apiv1alpha1/doc.go b/datastream/apiv1alpha1/doc.go new file mode 100644 index 00000000000..d435cf0162b --- /dev/null +++ b/datastream/apiv1alpha1/doc.go @@ -0,0 +1,116 @@ +// Copyright 2021 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 datastream is an auto-generated package for the +// DataStream API. +// +// NOTE: This package is in alpha. It is not stable, and is likely to change. +// +// Use of Context +// +// The ctx passed to NewClient is used for authentication requests and +// for creating the underlying connection, but is not used for subsequent calls. +// Individual methods on the client use the ctx given to them. +// +// To close the open connection, use the Close() method. +// +// For information about setting deadlines, reusing contexts, and more +// please visit https://pkg.go.dev/cloud.google.com/go. +package datastream // import "cloud.google.com/go/datastream/apiv1alpha1" + +import ( + "context" + "os" + "runtime" + "strconv" + "strings" + "unicode" + + "google.golang.org/api/option" + "google.golang.org/grpc/metadata" +) + +// For more information on implementing a client constructor hook, see +// https://github.com/googleapis/google-cloud-go/wiki/Customizing-constructors. +type clientHookParams struct{} +type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) + +const versionClient = "UNKNOWN" + +func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { + out, _ := metadata.FromOutgoingContext(ctx) + out = out.Copy() + for _, md := range mds { + for k, v := range md { + out[k] = append(out[k], v...) + } + } + return metadata.NewOutgoingContext(ctx, out) +} + +func checkDisableDeadlines() (bool, error) { + raw, ok := os.LookupEnv("GOOGLE_API_GO_EXPERIMENTAL_DISABLE_DEFAULT_DEADLINE") + if !ok { + return false, nil + } + + b, err := strconv.ParseBool(raw) + return b, err +} + +// DefaultAuthScopes reports the default set of authentication scopes to use with this package. +func DefaultAuthScopes() []string { + return []string{ + "https://www.googleapis.com/auth/cloud-platform", + } +} + +// versionGo returns the Go runtime version. The returned string +// has no whitespace, suitable for reporting in header. +func versionGo() string { + const develPrefix = "devel +" + + s := runtime.Version() + if strings.HasPrefix(s, develPrefix) { + s = s[len(develPrefix):] + if p := strings.IndexFunc(s, unicode.IsSpace); p >= 0 { + s = s[:p] + } + return s + } + + notSemverRune := func(r rune) bool { + return !strings.ContainsRune("0123456789.", r) + } + + if strings.HasPrefix(s, "go1") { + s = s[2:] + var prerelease string + if p := strings.IndexFunc(s, notSemverRune); p >= 0 { + s, prerelease = s[:p], s[p:] + } + if strings.HasSuffix(s, ".") { + s += "0" + } else if strings.Count(s, ".") < 2 { + s += ".0" + } + if prerelease != "" { + s += "-" + prerelease + } + return s + } + return "UNKNOWN" +} diff --git a/datastream/apiv1alpha1/gapic_metadata.json b/datastream/apiv1alpha1/gapic_metadata.json new file mode 100644 index 00000000000..86d55bde221 --- /dev/null +++ b/datastream/apiv1alpha1/gapic_metadata.json @@ -0,0 +1,123 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.datastream.v1alpha1", + "libraryPackage": "cloud.google.com/go/datastream/apiv1alpha1", + "services": { + "Datastream": { + "clients": { + "grpc": { + "libraryClient": "Client", + "rpcs": { + "CreateConnectionProfile": { + "methods": [ + "CreateConnectionProfile" + ] + }, + "CreatePrivateConnection": { + "methods": [ + "CreatePrivateConnection" + ] + }, + "CreateRoute": { + "methods": [ + "CreateRoute" + ] + }, + "CreateStream": { + "methods": [ + "CreateStream" + ] + }, + "DeleteConnectionProfile": { + "methods": [ + "DeleteConnectionProfile" + ] + }, + "DeletePrivateConnection": { + "methods": [ + "DeletePrivateConnection" + ] + }, + "DeleteRoute": { + "methods": [ + "DeleteRoute" + ] + }, + "DeleteStream": { + "methods": [ + "DeleteStream" + ] + }, + "DiscoverConnectionProfile": { + "methods": [ + "DiscoverConnectionProfile" + ] + }, + "FetchErrors": { + "methods": [ + "FetchErrors" + ] + }, + "FetchStaticIps": { + "methods": [ + "FetchStaticIps" + ] + }, + "GetConnectionProfile": { + "methods": [ + "GetConnectionProfile" + ] + }, + "GetPrivateConnection": { + "methods": [ + "GetPrivateConnection" + ] + }, + "GetRoute": { + "methods": [ + "GetRoute" + ] + }, + "GetStream": { + "methods": [ + "GetStream" + ] + }, + "ListConnectionProfiles": { + "methods": [ + "ListConnectionProfiles" + ] + }, + "ListPrivateConnections": { + "methods": [ + "ListPrivateConnections" + ] + }, + "ListRoutes": { + "methods": [ + "ListRoutes" + ] + }, + "ListStreams": { + "methods": [ + "ListStreams" + ] + }, + "UpdateConnectionProfile": { + "methods": [ + "UpdateConnectionProfile" + ] + }, + "UpdateStream": { + "methods": [ + "UpdateStream" + ] + } + } + } + } + } + } +} diff --git a/eventarc/apiv1/doc.go b/eventarc/apiv1/doc.go new file mode 100644 index 00000000000..917c37ef02e --- /dev/null +++ b/eventarc/apiv1/doc.go @@ -0,0 +1,116 @@ +// Copyright 2021 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 eventarc is an auto-generated package for the +// Eventarc API. +// +// NOTE: This package is in beta. It is not stable, and may be subject to changes. +// +// Use of Context +// +// The ctx passed to NewClient is used for authentication requests and +// for creating the underlying connection, but is not used for subsequent calls. +// Individual methods on the client use the ctx given to them. +// +// To close the open connection, use the Close() method. +// +// For information about setting deadlines, reusing contexts, and more +// please visit https://pkg.go.dev/cloud.google.com/go. +package eventarc // import "cloud.google.com/go/eventarc/apiv1" + +import ( + "context" + "os" + "runtime" + "strconv" + "strings" + "unicode" + + "google.golang.org/api/option" + "google.golang.org/grpc/metadata" +) + +// For more information on implementing a client constructor hook, see +// https://github.com/googleapis/google-cloud-go/wiki/Customizing-constructors. +type clientHookParams struct{} +type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) + +const versionClient = "UNKNOWN" + +func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { + out, _ := metadata.FromOutgoingContext(ctx) + out = out.Copy() + for _, md := range mds { + for k, v := range md { + out[k] = append(out[k], v...) + } + } + return metadata.NewOutgoingContext(ctx, out) +} + +func checkDisableDeadlines() (bool, error) { + raw, ok := os.LookupEnv("GOOGLE_API_GO_EXPERIMENTAL_DISABLE_DEFAULT_DEADLINE") + if !ok { + return false, nil + } + + b, err := strconv.ParseBool(raw) + return b, err +} + +// DefaultAuthScopes reports the default set of authentication scopes to use with this package. +func DefaultAuthScopes() []string { + return []string{ + "https://www.googleapis.com/auth/cloud-platform", + } +} + +// versionGo returns the Go runtime version. The returned string +// has no whitespace, suitable for reporting in header. +func versionGo() string { + const develPrefix = "devel +" + + s := runtime.Version() + if strings.HasPrefix(s, develPrefix) { + s = s[len(develPrefix):] + if p := strings.IndexFunc(s, unicode.IsSpace); p >= 0 { + s = s[:p] + } + return s + } + + notSemverRune := func(r rune) bool { + return !strings.ContainsRune("0123456789.", r) + } + + if strings.HasPrefix(s, "go1") { + s = s[2:] + var prerelease string + if p := strings.IndexFunc(s, notSemverRune); p >= 0 { + s, prerelease = s[:p], s[p:] + } + if strings.HasSuffix(s, ".") { + s += "0" + } else if strings.Count(s, ".") < 2 { + s += ".0" + } + if prerelease != "" { + s += "-" + prerelease + } + return s + } + return "UNKNOWN" +} diff --git a/eventarc/apiv1/eventarc_client.go b/eventarc/apiv1/eventarc_client.go new file mode 100644 index 00000000000..e5b3824500d --- /dev/null +++ b/eventarc/apiv1/eventarc_client.go @@ -0,0 +1,631 @@ +// Copyright 2021 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 eventarc + +import ( + "context" + "fmt" + "math" + "net/url" + "time" + + "cloud.google.com/go/longrunning" + lroauto "cloud.google.com/go/longrunning/autogen" + gax "github.com/googleapis/gax-go/v2" + "google.golang.org/api/iterator" + "google.golang.org/api/option" + "google.golang.org/api/option/internaloption" + gtransport "google.golang.org/api/transport/grpc" + eventarcpb "google.golang.org/genproto/googleapis/cloud/eventarc/v1" + longrunningpb "google.golang.org/genproto/googleapis/longrunning" + "google.golang.org/grpc" + "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/proto" +) + +var newClientHook clientHook + +// CallOptions contains the retry settings for each method of Client. +type CallOptions struct { + GetTrigger []gax.CallOption + ListTriggers []gax.CallOption + CreateTrigger []gax.CallOption + UpdateTrigger []gax.CallOption + DeleteTrigger []gax.CallOption +} + +func defaultGRPCClientOptions() []option.ClientOption { + return []option.ClientOption{ + internaloption.WithDefaultEndpoint("eventarc.googleapis.com:443"), + internaloption.WithDefaultMTLSEndpoint("eventarc.mtls.googleapis.com:443"), + internaloption.WithDefaultAudience("https://eventarc.googleapis.com/"), + internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), + option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), + option.WithGRPCDialOption(grpc.WithDefaultCallOptions( + grpc.MaxCallRecvMsgSize(math.MaxInt32))), + } +} + +func defaultCallOptions() *CallOptions { + return &CallOptions{ + GetTrigger: []gax.CallOption{}, + ListTriggers: []gax.CallOption{}, + CreateTrigger: []gax.CallOption{}, + UpdateTrigger: []gax.CallOption{}, + DeleteTrigger: []gax.CallOption{}, + } +} + +// internalClient is an interface that defines the methods availaible from Eventarc API. +type internalClient interface { + Close() error + setGoogleClientInfo(...string) + Connection() *grpc.ClientConn + GetTrigger(context.Context, *eventarcpb.GetTriggerRequest, ...gax.CallOption) (*eventarcpb.Trigger, error) + ListTriggers(context.Context, *eventarcpb.ListTriggersRequest, ...gax.CallOption) *TriggerIterator + CreateTrigger(context.Context, *eventarcpb.CreateTriggerRequest, ...gax.CallOption) (*CreateTriggerOperation, error) + CreateTriggerOperation(name string) *CreateTriggerOperation + UpdateTrigger(context.Context, *eventarcpb.UpdateTriggerRequest, ...gax.CallOption) (*UpdateTriggerOperation, error) + UpdateTriggerOperation(name string) *UpdateTriggerOperation + DeleteTrigger(context.Context, *eventarcpb.DeleteTriggerRequest, ...gax.CallOption) (*DeleteTriggerOperation, error) + DeleteTriggerOperation(name string) *DeleteTriggerOperation +} + +// Client is a client for interacting with Eventarc API. +// Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls. +// +// Eventarc allows users to subscribe to various events that are provided by +// Google Cloud services and forward them to supported destinations. +type Client struct { + // The internal transport-dependent client. + internalClient internalClient + + // The call options for this service. + CallOptions *CallOptions + + // LROClient is used internally to handle long-running operations. + // It is exposed so that its CallOptions can be modified if required. + // Users should not Close this client. + LROClient *lroauto.OperationsClient +} + +// 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 *Client) 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 *Client) setGoogleClientInfo(keyval ...string) { + c.internalClient.setGoogleClientInfo(keyval...) +} + +// Connection returns a connection to the API service. +// +// Deprecated. +func (c *Client) Connection() *grpc.ClientConn { + return c.internalClient.Connection() +} + +// GetTrigger get a single trigger. +func (c *Client) GetTrigger(ctx context.Context, req *eventarcpb.GetTriggerRequest, opts ...gax.CallOption) (*eventarcpb.Trigger, error) { + return c.internalClient.GetTrigger(ctx, req, opts...) +} + +// ListTriggers list triggers. +func (c *Client) ListTriggers(ctx context.Context, req *eventarcpb.ListTriggersRequest, opts ...gax.CallOption) *TriggerIterator { + return c.internalClient.ListTriggers(ctx, req, opts...) +} + +// CreateTrigger create a new trigger in a particular project and location. +func (c *Client) CreateTrigger(ctx context.Context, req *eventarcpb.CreateTriggerRequest, opts ...gax.CallOption) (*CreateTriggerOperation, error) { + return c.internalClient.CreateTrigger(ctx, req, opts...) +} + +// CreateTriggerOperation returns a new CreateTriggerOperation from a given name. +// The name must be that of a previously created CreateTriggerOperation, possibly from a different process. +func (c *Client) CreateTriggerOperation(name string) *CreateTriggerOperation { + return c.internalClient.CreateTriggerOperation(name) +} + +// UpdateTrigger update a single trigger. +func (c *Client) UpdateTrigger(ctx context.Context, req *eventarcpb.UpdateTriggerRequest, opts ...gax.CallOption) (*UpdateTriggerOperation, error) { + return c.internalClient.UpdateTrigger(ctx, req, opts...) +} + +// UpdateTriggerOperation returns a new UpdateTriggerOperation from a given name. +// The name must be that of a previously created UpdateTriggerOperation, possibly from a different process. +func (c *Client) UpdateTriggerOperation(name string) *UpdateTriggerOperation { + return c.internalClient.UpdateTriggerOperation(name) +} + +// DeleteTrigger delete a single trigger. +func (c *Client) DeleteTrigger(ctx context.Context, req *eventarcpb.DeleteTriggerRequest, opts ...gax.CallOption) (*DeleteTriggerOperation, error) { + return c.internalClient.DeleteTrigger(ctx, req, opts...) +} + +// DeleteTriggerOperation returns a new DeleteTriggerOperation from a given name. +// The name must be that of a previously created DeleteTriggerOperation, possibly from a different process. +func (c *Client) DeleteTriggerOperation(name string) *DeleteTriggerOperation { + return c.internalClient.DeleteTriggerOperation(name) +} + +// gRPCClient is a client for interacting with Eventarc API over gRPC transport. +// +// Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls. +type gRPCClient struct { + // Connection pool of gRPC connections to the service. + connPool gtransport.ConnPool + + // flag to opt out of default deadlines via GOOGLE_API_GO_EXPERIMENTAL_DISABLE_DEFAULT_DEADLINE + disableDeadlines bool + + // Points back to the CallOptions field of the containing Client + CallOptions **CallOptions + + // The gRPC API client. + client eventarcpb.EventarcClient + + // LROClient is used internally to handle long-running operations. + // It is exposed so that its CallOptions can be modified if required. + // Users should not Close this client. + LROClient **lroauto.OperationsClient + + // The x-goog-* metadata to be sent with each request. + xGoogMetadata metadata.MD +} + +// NewClient creates a new eventarc client based on gRPC. +// The returned client must be Closed when it is done being used to clean up its underlying connections. +// +// Eventarc allows users to subscribe to various events that are provided by +// Google Cloud services and forward them to supported destinations. +func NewClient(ctx context.Context, opts ...option.ClientOption) (*Client, error) { + clientOpts := defaultGRPCClientOptions() + if newClientHook != nil { + hookOpts, err := newClientHook(ctx, clientHookParams{}) + if err != nil { + return nil, err + } + clientOpts = append(clientOpts, hookOpts...) + } + + disableDeadlines, err := checkDisableDeadlines() + if err != nil { + return nil, err + } + + connPool, err := gtransport.DialPool(ctx, append(clientOpts, opts...)...) + if err != nil { + return nil, err + } + client := Client{CallOptions: defaultCallOptions()} + + c := &gRPCClient{ + connPool: connPool, + disableDeadlines: disableDeadlines, + client: eventarcpb.NewEventarcClient(connPool), + CallOptions: &client.CallOptions, + } + c.setGoogleClientInfo() + + client.internalClient = c + + client.LROClient, err = lroauto.NewOperationsClient(ctx, gtransport.WithConnPool(connPool)) + if err != nil { + // This error "should not happen", since we are just reusing old connection pool + // and never actually need to dial. + // If this does happen, we could leak connp. However, we cannot close conn: + // If the user invoked the constructor with option.WithGRPCConn, + // we would close a connection that's still in use. + // TODO: investigate error conditions. + return nil, err + } + c.LROClient = &client.LROClient + return &client, nil +} + +// Connection returns a connection to the API service. +// +// Deprecated. +func (c *gRPCClient) Connection() *grpc.ClientConn { + return c.connPool.Conn() +} + +// 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 *gRPCClient) setGoogleClientInfo(keyval ...string) { + kv := append([]string{"gl-go", versionGo()}, keyval...) + kv = append(kv, "gapic", versionClient, "gax", gax.Version, "grpc", grpc.Version) + c.xGoogMetadata = metadata.Pairs("x-goog-api-client", gax.XGoogHeader(kv...)) +} + +// Close closes the connection to the API service. The user should invoke this when +// the client is no longer required. +func (c *gRPCClient) Close() error { + return c.connPool.Close() +} + +func (c *gRPCClient) GetTrigger(ctx context.Context, req *eventarcpb.GetTriggerRequest, opts ...gax.CallOption) (*eventarcpb.Trigger, error) { + md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))) + ctx = insertMetadata(ctx, c.xGoogMetadata, md) + opts = append((*c.CallOptions).GetTrigger[0:len((*c.CallOptions).GetTrigger):len((*c.CallOptions).GetTrigger)], opts...) + var resp *eventarcpb.Trigger + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + resp, err = c.client.GetTrigger(ctx, req, settings.GRPC...) + return err + }, opts...) + if err != nil { + return nil, err + } + return resp, nil +} + +func (c *gRPCClient) ListTriggers(ctx context.Context, req *eventarcpb.ListTriggersRequest, opts ...gax.CallOption) *TriggerIterator { + md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))) + ctx = insertMetadata(ctx, c.xGoogMetadata, md) + opts = append((*c.CallOptions).ListTriggers[0:len((*c.CallOptions).ListTriggers):len((*c.CallOptions).ListTriggers)], opts...) + it := &TriggerIterator{} + req = proto.Clone(req).(*eventarcpb.ListTriggersRequest) + it.InternalFetch = func(pageSize int, pageToken string) ([]*eventarcpb.Trigger, string, error) { + var resp *eventarcpb.ListTriggersResponse + req.PageToken = pageToken + if pageSize > math.MaxInt32 { + req.PageSize = math.MaxInt32 + } else { + req.PageSize = int32(pageSize) + } + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + resp, err = c.client.ListTriggers(ctx, req, settings.GRPC...) + return err + }, opts...) + if err != nil { + return nil, "", err + } + + it.Response = resp + return resp.GetTriggers(), 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.GetPageSize()) + it.pageInfo.Token = req.GetPageToken() + return it +} + +func (c *gRPCClient) CreateTrigger(ctx context.Context, req *eventarcpb.CreateTriggerRequest, opts ...gax.CallOption) (*CreateTriggerOperation, error) { + md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))) + ctx = insertMetadata(ctx, c.xGoogMetadata, md) + opts = append((*c.CallOptions).CreateTrigger[0:len((*c.CallOptions).CreateTrigger):len((*c.CallOptions).CreateTrigger)], opts...) + var resp *longrunningpb.Operation + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + resp, err = c.client.CreateTrigger(ctx, req, settings.GRPC...) + return err + }, opts...) + if err != nil { + return nil, err + } + return &CreateTriggerOperation{ + lro: longrunning.InternalNewOperation(*c.LROClient, resp), + }, nil +} + +func (c *gRPCClient) UpdateTrigger(ctx context.Context, req *eventarcpb.UpdateTriggerRequest, opts ...gax.CallOption) (*UpdateTriggerOperation, error) { + md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "trigger.name", url.QueryEscape(req.GetTrigger().GetName()))) + ctx = insertMetadata(ctx, c.xGoogMetadata, md) + opts = append((*c.CallOptions).UpdateTrigger[0:len((*c.CallOptions).UpdateTrigger):len((*c.CallOptions).UpdateTrigger)], opts...) + var resp *longrunningpb.Operation + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + resp, err = c.client.UpdateTrigger(ctx, req, settings.GRPC...) + return err + }, opts...) + if err != nil { + return nil, err + } + return &UpdateTriggerOperation{ + lro: longrunning.InternalNewOperation(*c.LROClient, resp), + }, nil +} + +func (c *gRPCClient) DeleteTrigger(ctx context.Context, req *eventarcpb.DeleteTriggerRequest, opts ...gax.CallOption) (*DeleteTriggerOperation, error) { + md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))) + ctx = insertMetadata(ctx, c.xGoogMetadata, md) + opts = append((*c.CallOptions).DeleteTrigger[0:len((*c.CallOptions).DeleteTrigger):len((*c.CallOptions).DeleteTrigger)], opts...) + var resp *longrunningpb.Operation + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + resp, err = c.client.DeleteTrigger(ctx, req, settings.GRPC...) + return err + }, opts...) + if err != nil { + return nil, err + } + return &DeleteTriggerOperation{ + lro: longrunning.InternalNewOperation(*c.LROClient, resp), + }, nil +} + +// CreateTriggerOperation manages a long-running operation from CreateTrigger. +type CreateTriggerOperation struct { + lro *longrunning.Operation +} + +// CreateTriggerOperation returns a new CreateTriggerOperation from a given name. +// The name must be that of a previously created CreateTriggerOperation, possibly from a different process. +func (c *gRPCClient) CreateTriggerOperation(name string) *CreateTriggerOperation { + return &CreateTriggerOperation{ + lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}), + } +} + +// Wait blocks until the long-running operation is completed, returning the response and any errors encountered. +// +// See documentation of Poll for error-handling information. +func (op *CreateTriggerOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*eventarcpb.Trigger, error) { + var resp eventarcpb.Trigger + if err := op.lro.WaitWithInterval(ctx, &resp, time.Minute, opts...); err != nil { + return nil, err + } + return &resp, nil +} + +// Poll fetches the latest state of the long-running operation. +// +// Poll also fetches the latest metadata, which can be retrieved by Metadata. +// +// If Poll fails, the error is returned and op is unmodified. If Poll succeeds and +// the operation has completed with failure, the error is returned and op.Done will return true. +// If Poll succeeds and the operation has completed successfully, +// op.Done will return true, and the response of the operation is returned. +// If Poll succeeds and the operation has not completed, the returned response and error are both nil. +func (op *CreateTriggerOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*eventarcpb.Trigger, error) { + var resp eventarcpb.Trigger + if err := op.lro.Poll(ctx, &resp, opts...); err != nil { + return nil, err + } + if !op.Done() { + return nil, nil + } + return &resp, nil +} + +// Metadata returns metadata associated with the long-running operation. +// Metadata itself does not contact the server, but Poll does. +// To get the latest metadata, call this method after a successful call to Poll. +// If the metadata is not available, the returned metadata and error are both nil. +func (op *CreateTriggerOperation) Metadata() (*eventarcpb.OperationMetadata, error) { + var meta eventarcpb.OperationMetadata + if err := op.lro.Metadata(&meta); err == longrunning.ErrNoMetadata { + return nil, nil + } else if err != nil { + return nil, err + } + return &meta, nil +} + +// Done reports whether the long-running operation has completed. +func (op *CreateTriggerOperation) Done() bool { + return op.lro.Done() +} + +// Name returns the name of the long-running operation. +// The name is assigned by the server and is unique within the service from which the operation is created. +func (op *CreateTriggerOperation) Name() string { + return op.lro.Name() +} + +// DeleteTriggerOperation manages a long-running operation from DeleteTrigger. +type DeleteTriggerOperation struct { + lro *longrunning.Operation +} + +// DeleteTriggerOperation returns a new DeleteTriggerOperation from a given name. +// The name must be that of a previously created DeleteTriggerOperation, possibly from a different process. +func (c *gRPCClient) DeleteTriggerOperation(name string) *DeleteTriggerOperation { + return &DeleteTriggerOperation{ + lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}), + } +} + +// Wait blocks until the long-running operation is completed, returning the response and any errors encountered. +// +// See documentation of Poll for error-handling information. +func (op *DeleteTriggerOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*eventarcpb.Trigger, error) { + var resp eventarcpb.Trigger + if err := op.lro.WaitWithInterval(ctx, &resp, time.Minute, opts...); err != nil { + return nil, err + } + return &resp, nil +} + +// Poll fetches the latest state of the long-running operation. +// +// Poll also fetches the latest metadata, which can be retrieved by Metadata. +// +// If Poll fails, the error is returned and op is unmodified. If Poll succeeds and +// the operation has completed with failure, the error is returned and op.Done will return true. +// If Poll succeeds and the operation has completed successfully, +// op.Done will return true, and the response of the operation is returned. +// If Poll succeeds and the operation has not completed, the returned response and error are both nil. +func (op *DeleteTriggerOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*eventarcpb.Trigger, error) { + var resp eventarcpb.Trigger + if err := op.lro.Poll(ctx, &resp, opts...); err != nil { + return nil, err + } + if !op.Done() { + return nil, nil + } + return &resp, nil +} + +// Metadata returns metadata associated with the long-running operation. +// Metadata itself does not contact the server, but Poll does. +// To get the latest metadata, call this method after a successful call to Poll. +// If the metadata is not available, the returned metadata and error are both nil. +func (op *DeleteTriggerOperation) Metadata() (*eventarcpb.OperationMetadata, error) { + var meta eventarcpb.OperationMetadata + if err := op.lro.Metadata(&meta); err == longrunning.ErrNoMetadata { + return nil, nil + } else if err != nil { + return nil, err + } + return &meta, nil +} + +// Done reports whether the long-running operation has completed. +func (op *DeleteTriggerOperation) Done() bool { + return op.lro.Done() +} + +// Name returns the name of the long-running operation. +// The name is assigned by the server and is unique within the service from which the operation is created. +func (op *DeleteTriggerOperation) Name() string { + return op.lro.Name() +} + +// UpdateTriggerOperation manages a long-running operation from UpdateTrigger. +type UpdateTriggerOperation struct { + lro *longrunning.Operation +} + +// UpdateTriggerOperation returns a new UpdateTriggerOperation from a given name. +// The name must be that of a previously created UpdateTriggerOperation, possibly from a different process. +func (c *gRPCClient) UpdateTriggerOperation(name string) *UpdateTriggerOperation { + return &UpdateTriggerOperation{ + lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}), + } +} + +// Wait blocks until the long-running operation is completed, returning the response and any errors encountered. +// +// See documentation of Poll for error-handling information. +func (op *UpdateTriggerOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*eventarcpb.Trigger, error) { + var resp eventarcpb.Trigger + if err := op.lro.WaitWithInterval(ctx, &resp, time.Minute, opts...); err != nil { + return nil, err + } + return &resp, nil +} + +// Poll fetches the latest state of the long-running operation. +// +// Poll also fetches the latest metadata, which can be retrieved by Metadata. +// +// If Poll fails, the error is returned and op is unmodified. If Poll succeeds and +// the operation has completed with failure, the error is returned and op.Done will return true. +// If Poll succeeds and the operation has completed successfully, +// op.Done will return true, and the response of the operation is returned. +// If Poll succeeds and the operation has not completed, the returned response and error are both nil. +func (op *UpdateTriggerOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*eventarcpb.Trigger, error) { + var resp eventarcpb.Trigger + if err := op.lro.Poll(ctx, &resp, opts...); err != nil { + return nil, err + } + if !op.Done() { + return nil, nil + } + return &resp, nil +} + +// Metadata returns metadata associated with the long-running operation. +// Metadata itself does not contact the server, but Poll does. +// To get the latest metadata, call this method after a successful call to Poll. +// If the metadata is not available, the returned metadata and error are both nil. +func (op *UpdateTriggerOperation) Metadata() (*eventarcpb.OperationMetadata, error) { + var meta eventarcpb.OperationMetadata + if err := op.lro.Metadata(&meta); err == longrunning.ErrNoMetadata { + return nil, nil + } else if err != nil { + return nil, err + } + return &meta, nil +} + +// Done reports whether the long-running operation has completed. +func (op *UpdateTriggerOperation) Done() bool { + return op.lro.Done() +} + +// Name returns the name of the long-running operation. +// The name is assigned by the server and is unique within the service from which the operation is created. +func (op *UpdateTriggerOperation) Name() string { + return op.lro.Name() +} + +// TriggerIterator manages a stream of *eventarcpb.Trigger. +type TriggerIterator struct { + items []*eventarcpb.Trigger + 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 []*eventarcpb.Trigger, nextPageToken string, err error) +} + +// PageInfo supports pagination. See the google.golang.org/api/iterator package for details. +func (it *TriggerIterator) 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 *TriggerIterator) Next() (*eventarcpb.Trigger, error) { + var item *eventarcpb.Trigger + if err := it.nextFunc(); err != nil { + return item, err + } + item = it.items[0] + it.items = it.items[1:] + return item, nil +} + +func (it *TriggerIterator) bufLen() int { + return len(it.items) +} + +func (it *TriggerIterator) takeBuf() interface{} { + b := it.items + it.items = nil + return b +} diff --git a/eventarc/apiv1/eventarc_client_example_test.go b/eventarc/apiv1/eventarc_client_example_test.go new file mode 100644 index 00000000000..3829788aee3 --- /dev/null +++ b/eventarc/apiv1/eventarc_client_example_test.go @@ -0,0 +1,153 @@ +// Copyright 2021 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 eventarc_test + +import ( + "context" + + eventarc "cloud.google.com/go/eventarc/apiv1" + "google.golang.org/api/iterator" + eventarcpb "google.golang.org/genproto/googleapis/cloud/eventarc/v1" +) + +func ExampleNewClient() { + ctx := context.Background() + c, err := eventarc.NewClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + // TODO: Use client. + _ = c +} + +func ExampleClient_GetTrigger() { + ctx := context.Background() + c, err := eventarc.NewClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &eventarcpb.GetTriggerRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.GetTrigger(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleClient_ListTriggers() { + ctx := context.Background() + c, err := eventarc.NewClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &eventarcpb.ListTriggersRequest{ + // TODO: Fill request struct fields. + } + it := c.ListTriggers(ctx, req) + for { + resp, err := it.Next() + if err == iterator.Done { + break + } + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp + } +} + +func ExampleClient_CreateTrigger() { + ctx := context.Background() + c, err := eventarc.NewClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &eventarcpb.CreateTriggerRequest{ + // TODO: Fill request struct fields. + } + op, err := c.CreateTrigger(ctx, req) + if err != nil { + // TODO: Handle error. + } + + resp, err := op.Wait(ctx) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleClient_UpdateTrigger() { + ctx := context.Background() + c, err := eventarc.NewClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &eventarcpb.UpdateTriggerRequest{ + // TODO: Fill request struct fields. + } + op, err := c.UpdateTrigger(ctx, req) + if err != nil { + // TODO: Handle error. + } + + resp, err := op.Wait(ctx) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleClient_DeleteTrigger() { + ctx := context.Background() + c, err := eventarc.NewClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &eventarcpb.DeleteTriggerRequest{ + // TODO: Fill request struct fields. + } + op, err := c.DeleteTrigger(ctx, req) + if err != nil { + // TODO: Handle error. + } + + resp, err := op.Wait(ctx) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} diff --git a/eventarc/apiv1/gapic_metadata.json b/eventarc/apiv1/gapic_metadata.json new file mode 100644 index 00000000000..cc93d105421 --- /dev/null +++ b/eventarc/apiv1/gapic_metadata.json @@ -0,0 +1,43 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.eventarc.v1", + "libraryPackage": "cloud.google.com/go/eventarc/apiv1", + "services": { + "Eventarc": { + "clients": { + "grpc": { + "libraryClient": "Client", + "rpcs": { + "CreateTrigger": { + "methods": [ + "CreateTrigger" + ] + }, + "DeleteTrigger": { + "methods": [ + "DeleteTrigger" + ] + }, + "GetTrigger": { + "methods": [ + "GetTrigger" + ] + }, + "ListTriggers": { + "methods": [ + "ListTriggers" + ] + }, + "UpdateTrigger": { + "methods": [ + "UpdateTrigger" + ] + } + } + } + } + } + } +} diff --git a/internal/gapicgen/generator/config.go b/internal/gapicgen/generator/config.go index b7f4ea4fb3e..935d478b254 100644 --- a/internal/gapicgen/generator/config.go +++ b/internal/gapicgen/generator/config.go @@ -594,8 +594,7 @@ var microgenGapicConfigs = []*microgenConfig{ importPath: "cloud.google.com/go/dialogflow/cx/apiv3", gRPCServiceConfigPath: "google/cloud/dialogflow/cx/v3/dialogflow_grpc_service_config.json", apiServiceConfigPath: "google/cloud/dialogflow/cx/v3/dialogflow_v3.yaml", - // GA after 2021/04/23 - releaseLevel: "beta", + releaseLevel: "ga", }, { inputDirectoryPath: "google/cloud/dialogflow/v2", @@ -857,6 +856,15 @@ var microgenGapicConfigs = []*microgenConfig{ apiServiceConfigPath: "google/cloud/workflows/v1beta/workflows_v1beta.yaml", releaseLevel: "beta", }, + { + inputDirectoryPath: "google/cloud/workflows/executions/v1", + pkg: "executions", + importPath: "cloud.google.com/go/workflows/executions/apiv1", + gRPCServiceConfigPath: "google/cloud/workflows/executions/v1/executions_grpc_service_config.json", + apiServiceConfigPath: "google/cloud/workflows/executions/v1/workflowexecutions_v1.yaml", + // GA after 2021/07/30 + releaseLevel: "beta", + }, { inputDirectoryPath: "google/cloud/workflows/executions/v1beta", pkg: "executions", @@ -879,8 +887,7 @@ var microgenGapicConfigs = []*microgenConfig{ importPath: "cloud.google.com/go/security/privateca/apiv1", gRPCServiceConfigPath: "google/cloud/security/privateca/v1/privateca_grpc_service_config.json", apiServiceConfigPath: "google/cloud/security/privateca/v1/privateca_v1.yaml", - // GA after 2021/05/29 - releaseLevel: "beta", + releaseLevel: "ga", }, { inputDirectoryPath: "google/cloud/assuredworkloads/v1beta1", @@ -982,8 +989,7 @@ var microgenGapicConfigs = []*microgenConfig{ importPath: "cloud.google.com/go/documentai/apiv1", gRPCServiceConfigPath: "google/cloud/documentai/v1/documentai_v1_grpc_service_config.json", apiServiceConfigPath: "google/cloud/documentai/v1/documentai_v1.yaml", - // GA after 2021/04/23 - releaseLevel: "beta", + releaseLevel: "ga", }, { inputDirectoryPath: "google/cloud/documentai/v1beta3", @@ -1063,8 +1069,7 @@ var microgenGapicConfigs = []*microgenConfig{ importPath: "cloud.google.com/go/metastore/apiv1", gRPCServiceConfigPath: "google/cloud/metastore/v1/metastore_grpc_service_config.json", apiServiceConfigPath: "google/cloud/metastore/v1/metastore_v1.yaml", - // GA after 2021/06/10 - releaseLevel: "beta", + releaseLevel: "ga", }, { inputDirectoryPath: "google/cloud/metastore/v1alpha", @@ -1088,8 +1093,7 @@ var microgenGapicConfigs = []*microgenConfig{ importPath: "cloud.google.com/go/resourcesettings/apiv1", gRPCServiceConfigPath: "google/cloud/resourcesettings/v1/resourcesettings_grpc_service_config.json", apiServiceConfigPath: "google/cloud/resourcesettings/v1/resourcesettings_v1.yaml", - // GA after 2021/04/23 - releaseLevel: "beta", + releaseLevel: "ga", }, { inputDirectoryPath: "google/cloud/clouddms/v1", @@ -1097,8 +1101,7 @@ var microgenGapicConfigs = []*microgenConfig{ importPath: "cloud.google.com/go/clouddms/apiv1", gRPCServiceConfigPath: "google/cloud/clouddms/v1/library_grpc_service_config.json", apiServiceConfigPath: "google/cloud/clouddms/v1/datamigration_v1.yaml", - // GA after 2021/06/10 - releaseLevel: "beta", + releaseLevel: "ga", }, { inputDirectoryPath: "google/cloud/essentialcontacts/v1", @@ -1106,8 +1109,7 @@ var microgenGapicConfigs = []*microgenConfig{ importPath: "cloud.google.com/go/essentialcontacts/apiv1", gRPCServiceConfigPath: "google/cloud/essentialcontacts/v1/essentialcontacts_v1_grpc_service_config.json", apiServiceConfigPath: "google/cloud/essentialcontacts/v1/essentialcontacts_v1.yaml", - // GA after 2021/06/18 - releaseLevel: "beta", + releaseLevel: "ga", }, { inputDirectoryPath: "google/api/serviceusage/v1", @@ -1115,8 +1117,7 @@ var microgenGapicConfigs = []*microgenConfig{ importPath: "cloud.google.com/go/serviceusage/apiv1", gRPCServiceConfigPath: "google/api/serviceusage/v1/serviceusage_grpc_service_config.json", apiServiceConfigPath: "google/api/serviceusage/v1/serviceusage_v1.yaml", - // GA after 2021/06/18 - releaseLevel: "beta", + releaseLevel: "ga", }, { inputDirectoryPath: "google/cloud/shell/v1", @@ -1187,6 +1188,31 @@ var microgenGapicConfigs = []*microgenConfig{ apiServiceConfigPath: "google/cloud/gkeconnect/gateway/v1beta1/connectgateway_v1beta1.yaml", releaseLevel: "beta", }, + { + inputDirectoryPath: "google/cloud/datastream/v1alpha1", + pkg: "datastream", + importPath: "cloud.google.com/go/datastream/apiv1alpha1", + gRPCServiceConfigPath: "google/cloud/datastream/v1alpha1/datastream_grpc_service_config.json", + apiServiceConfigPath: "google/cloud/datastream/v1alpha1/datastream_v1alpha1.yaml", + releaseLevel: "alpha", + }, + { + inputDirectoryPath: "google/dataflow/v1beta3", + pkg: "dataflow", + importPath: "cloud.google.com/go/dataflow/apiv1beta3", + gRPCServiceConfigPath: "google/dataflow/v1beta3/dataflow_grpc_service_config.json", + apiServiceConfigPath: "google/dataflow/v1beta3/dataflow_v1beta3.yaml", + releaseLevel: "beta", + }, + { + inputDirectoryPath: "google/cloud/eventarc/v1", + pkg: "eventarc", + importPath: "cloud.google.com/go/eventarc/apiv1", + gRPCServiceConfigPath: "google/cloud/eventarc/v1/eventarc_grpc_service_config.json", + apiServiceConfigPath: "google/cloud/eventarc/v1/eventarc_v1.yaml", + // GA after 2021/07/30 + releaseLevel: "beta", + }, // Non-Cloud APIs { diff --git a/workflows/executions/apiv1/doc.go b/workflows/executions/apiv1/doc.go new file mode 100644 index 00000000000..ace2c66faf2 --- /dev/null +++ b/workflows/executions/apiv1/doc.go @@ -0,0 +1,118 @@ +// Copyright 2021 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 executions is an auto-generated package for the +// Workflow Executions API. +// +// Execute workflows created with Workflows API. +// +// NOTE: This package is in beta. It is not stable, and may be subject to changes. +// +// Use of Context +// +// The ctx passed to NewClient is used for authentication requests and +// for creating the underlying connection, but is not used for subsequent calls. +// Individual methods on the client use the ctx given to them. +// +// To close the open connection, use the Close() method. +// +// For information about setting deadlines, reusing contexts, and more +// please visit https://pkg.go.dev/cloud.google.com/go. +package executions // import "cloud.google.com/go/workflows/executions/apiv1" + +import ( + "context" + "os" + "runtime" + "strconv" + "strings" + "unicode" + + "google.golang.org/api/option" + "google.golang.org/grpc/metadata" +) + +// For more information on implementing a client constructor hook, see +// https://github.com/googleapis/google-cloud-go/wiki/Customizing-constructors. +type clientHookParams struct{} +type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) + +const versionClient = "UNKNOWN" + +func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { + out, _ := metadata.FromOutgoingContext(ctx) + out = out.Copy() + for _, md := range mds { + for k, v := range md { + out[k] = append(out[k], v...) + } + } + return metadata.NewOutgoingContext(ctx, out) +} + +func checkDisableDeadlines() (bool, error) { + raw, ok := os.LookupEnv("GOOGLE_API_GO_EXPERIMENTAL_DISABLE_DEFAULT_DEADLINE") + if !ok { + return false, nil + } + + b, err := strconv.ParseBool(raw) + return b, err +} + +// DefaultAuthScopes reports the default set of authentication scopes to use with this package. +func DefaultAuthScopes() []string { + return []string{ + "https://www.googleapis.com/auth/cloud-platform", + } +} + +// versionGo returns the Go runtime version. The returned string +// has no whitespace, suitable for reporting in header. +func versionGo() string { + const develPrefix = "devel +" + + s := runtime.Version() + if strings.HasPrefix(s, develPrefix) { + s = s[len(develPrefix):] + if p := strings.IndexFunc(s, unicode.IsSpace); p >= 0 { + s = s[:p] + } + return s + } + + notSemverRune := func(r rune) bool { + return !strings.ContainsRune("0123456789.", r) + } + + if strings.HasPrefix(s, "go1") { + s = s[2:] + var prerelease string + if p := strings.IndexFunc(s, notSemverRune); p >= 0 { + s, prerelease = s[:p], s[p:] + } + if strings.HasSuffix(s, ".") { + s += "0" + } else if strings.Count(s, ".") < 2 { + s += ".0" + } + if prerelease != "" { + s += "-" + prerelease + } + return s + } + return "UNKNOWN" +} diff --git a/workflows/executions/apiv1/executions_client.go b/workflows/executions/apiv1/executions_client.go new file mode 100644 index 00000000000..d83ac03b02c --- /dev/null +++ b/workflows/executions/apiv1/executions_client.go @@ -0,0 +1,351 @@ +// Copyright 2021 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 executions + +import ( + "context" + "fmt" + "math" + "net/url" + + gax "github.com/googleapis/gax-go/v2" + "google.golang.org/api/iterator" + "google.golang.org/api/option" + "google.golang.org/api/option/internaloption" + gtransport "google.golang.org/api/transport/grpc" + executionspb "google.golang.org/genproto/googleapis/cloud/workflows/executions/v1" + "google.golang.org/grpc" + "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/proto" +) + +var newClientHook clientHook + +// CallOptions contains the retry settings for each method of Client. +type CallOptions struct { + ListExecutions []gax.CallOption + CreateExecution []gax.CallOption + GetExecution []gax.CallOption + CancelExecution []gax.CallOption +} + +func defaultGRPCClientOptions() []option.ClientOption { + return []option.ClientOption{ + internaloption.WithDefaultEndpoint("workflowexecutions.googleapis.com:443"), + internaloption.WithDefaultMTLSEndpoint("workflowexecutions.mtls.googleapis.com:443"), + internaloption.WithDefaultAudience("https://workflowexecutions.googleapis.com/"), + internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), + option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), + option.WithGRPCDialOption(grpc.WithDefaultCallOptions( + grpc.MaxCallRecvMsgSize(math.MaxInt32))), + } +} + +func defaultCallOptions() *CallOptions { + return &CallOptions{ + ListExecutions: []gax.CallOption{}, + CreateExecution: []gax.CallOption{}, + GetExecution: []gax.CallOption{}, + CancelExecution: []gax.CallOption{}, + } +} + +// internalClient is an interface that defines the methods availaible from Workflow Executions API. +type internalClient interface { + Close() error + setGoogleClientInfo(...string) + Connection() *grpc.ClientConn + ListExecutions(context.Context, *executionspb.ListExecutionsRequest, ...gax.CallOption) *ExecutionIterator + CreateExecution(context.Context, *executionspb.CreateExecutionRequest, ...gax.CallOption) (*executionspb.Execution, error) + GetExecution(context.Context, *executionspb.GetExecutionRequest, ...gax.CallOption) (*executionspb.Execution, error) + CancelExecution(context.Context, *executionspb.CancelExecutionRequest, ...gax.CallOption) (*executionspb.Execution, error) +} + +// Client is a client for interacting with Workflow Executions API. +// Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls. +// +// Executions is used to start and manage running instances of +// Workflows called executions. +type Client struct { + // The internal transport-dependent client. + internalClient internalClient + + // The call options for this service. + CallOptions *CallOptions +} + +// 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 *Client) 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 *Client) setGoogleClientInfo(keyval ...string) { + c.internalClient.setGoogleClientInfo(keyval...) +} + +// Connection returns a connection to the API service. +// +// Deprecated. +func (c *Client) Connection() *grpc.ClientConn { + return c.internalClient.Connection() +} + +// ListExecutions returns a list of executions which belong to the workflow with +// the given name. The method returns executions of all workflow +// revisions. Returned executions are ordered by their start time (newest +// first). +func (c *Client) ListExecutions(ctx context.Context, req *executionspb.ListExecutionsRequest, opts ...gax.CallOption) *ExecutionIterator { + return c.internalClient.ListExecutions(ctx, req, opts...) +} + +// CreateExecution creates a new execution using the latest revision of the given workflow. +func (c *Client) CreateExecution(ctx context.Context, req *executionspb.CreateExecutionRequest, opts ...gax.CallOption) (*executionspb.Execution, error) { + return c.internalClient.CreateExecution(ctx, req, opts...) +} + +// GetExecution returns an execution of the given name. +func (c *Client) GetExecution(ctx context.Context, req *executionspb.GetExecutionRequest, opts ...gax.CallOption) (*executionspb.Execution, error) { + return c.internalClient.GetExecution(ctx, req, opts...) +} + +// CancelExecution cancels an execution of the given name. +func (c *Client) CancelExecution(ctx context.Context, req *executionspb.CancelExecutionRequest, opts ...gax.CallOption) (*executionspb.Execution, error) { + return c.internalClient.CancelExecution(ctx, req, opts...) +} + +// gRPCClient is a client for interacting with Workflow Executions API over gRPC transport. +// +// Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls. +type gRPCClient struct { + // Connection pool of gRPC connections to the service. + connPool gtransport.ConnPool + + // flag to opt out of default deadlines via GOOGLE_API_GO_EXPERIMENTAL_DISABLE_DEFAULT_DEADLINE + disableDeadlines bool + + // Points back to the CallOptions field of the containing Client + CallOptions **CallOptions + + // The gRPC API client. + client executionspb.ExecutionsClient + + // The x-goog-* metadata to be sent with each request. + xGoogMetadata metadata.MD +} + +// NewClient creates a new executions client based on gRPC. +// The returned client must be Closed when it is done being used to clean up its underlying connections. +// +// Executions is used to start and manage running instances of +// Workflows called executions. +func NewClient(ctx context.Context, opts ...option.ClientOption) (*Client, error) { + clientOpts := defaultGRPCClientOptions() + if newClientHook != nil { + hookOpts, err := newClientHook(ctx, clientHookParams{}) + if err != nil { + return nil, err + } + clientOpts = append(clientOpts, hookOpts...) + } + + disableDeadlines, err := checkDisableDeadlines() + if err != nil { + return nil, err + } + + connPool, err := gtransport.DialPool(ctx, append(clientOpts, opts...)...) + if err != nil { + return nil, err + } + client := Client{CallOptions: defaultCallOptions()} + + c := &gRPCClient{ + connPool: connPool, + disableDeadlines: disableDeadlines, + client: executionspb.NewExecutionsClient(connPool), + CallOptions: &client.CallOptions, + } + c.setGoogleClientInfo() + + client.internalClient = c + + return &client, nil +} + +// Connection returns a connection to the API service. +// +// Deprecated. +func (c *gRPCClient) Connection() *grpc.ClientConn { + return c.connPool.Conn() +} + +// 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 *gRPCClient) setGoogleClientInfo(keyval ...string) { + kv := append([]string{"gl-go", versionGo()}, keyval...) + kv = append(kv, "gapic", versionClient, "gax", gax.Version, "grpc", grpc.Version) + c.xGoogMetadata = metadata.Pairs("x-goog-api-client", gax.XGoogHeader(kv...)) +} + +// Close closes the connection to the API service. The user should invoke this when +// the client is no longer required. +func (c *gRPCClient) Close() error { + return c.connPool.Close() +} + +func (c *gRPCClient) ListExecutions(ctx context.Context, req *executionspb.ListExecutionsRequest, opts ...gax.CallOption) *ExecutionIterator { + md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))) + ctx = insertMetadata(ctx, c.xGoogMetadata, md) + opts = append((*c.CallOptions).ListExecutions[0:len((*c.CallOptions).ListExecutions):len((*c.CallOptions).ListExecutions)], opts...) + it := &ExecutionIterator{} + req = proto.Clone(req).(*executionspb.ListExecutionsRequest) + it.InternalFetch = func(pageSize int, pageToken string) ([]*executionspb.Execution, string, error) { + var resp *executionspb.ListExecutionsResponse + req.PageToken = pageToken + if pageSize > math.MaxInt32 { + req.PageSize = math.MaxInt32 + } else { + req.PageSize = int32(pageSize) + } + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + resp, err = c.client.ListExecutions(ctx, req, settings.GRPC...) + return err + }, opts...) + if err != nil { + return nil, "", err + } + + it.Response = resp + return resp.GetExecutions(), 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.GetPageSize()) + it.pageInfo.Token = req.GetPageToken() + return it +} + +func (c *gRPCClient) CreateExecution(ctx context.Context, req *executionspb.CreateExecutionRequest, opts ...gax.CallOption) (*executionspb.Execution, error) { + md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))) + ctx = insertMetadata(ctx, c.xGoogMetadata, md) + opts = append((*c.CallOptions).CreateExecution[0:len((*c.CallOptions).CreateExecution):len((*c.CallOptions).CreateExecution)], opts...) + var resp *executionspb.Execution + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + resp, err = c.client.CreateExecution(ctx, req, settings.GRPC...) + return err + }, opts...) + if err != nil { + return nil, err + } + return resp, nil +} + +func (c *gRPCClient) GetExecution(ctx context.Context, req *executionspb.GetExecutionRequest, opts ...gax.CallOption) (*executionspb.Execution, error) { + md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))) + ctx = insertMetadata(ctx, c.xGoogMetadata, md) + opts = append((*c.CallOptions).GetExecution[0:len((*c.CallOptions).GetExecution):len((*c.CallOptions).GetExecution)], opts...) + var resp *executionspb.Execution + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + resp, err = c.client.GetExecution(ctx, req, settings.GRPC...) + return err + }, opts...) + if err != nil { + return nil, err + } + return resp, nil +} + +func (c *gRPCClient) CancelExecution(ctx context.Context, req *executionspb.CancelExecutionRequest, opts ...gax.CallOption) (*executionspb.Execution, error) { + md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))) + ctx = insertMetadata(ctx, c.xGoogMetadata, md) + opts = append((*c.CallOptions).CancelExecution[0:len((*c.CallOptions).CancelExecution):len((*c.CallOptions).CancelExecution)], opts...) + var resp *executionspb.Execution + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + resp, err = c.client.CancelExecution(ctx, req, settings.GRPC...) + return err + }, opts...) + if err != nil { + return nil, err + } + return resp, nil +} + +// ExecutionIterator manages a stream of *executionspb.Execution. +type ExecutionIterator struct { + items []*executionspb.Execution + 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 []*executionspb.Execution, nextPageToken string, err error) +} + +// PageInfo supports pagination. See the google.golang.org/api/iterator package for details. +func (it *ExecutionIterator) 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 *ExecutionIterator) Next() (*executionspb.Execution, error) { + var item *executionspb.Execution + if err := it.nextFunc(); err != nil { + return item, err + } + item = it.items[0] + it.items = it.items[1:] + return item, nil +} + +func (it *ExecutionIterator) bufLen() int { + return len(it.items) +} + +func (it *ExecutionIterator) takeBuf() interface{} { + b := it.items + it.items = nil + return b +} diff --git a/workflows/executions/apiv1/executions_client_example_test.go b/workflows/executions/apiv1/executions_client_example_test.go new file mode 100644 index 00000000000..9e1166407f3 --- /dev/null +++ b/workflows/executions/apiv1/executions_client_example_test.go @@ -0,0 +1,119 @@ +// Copyright 2021 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 executions_test + +import ( + "context" + + executions "cloud.google.com/go/workflows/executions/apiv1" + "google.golang.org/api/iterator" + executionspb "google.golang.org/genproto/googleapis/cloud/workflows/executions/v1" +) + +func ExampleNewClient() { + ctx := context.Background() + c, err := executions.NewClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + // TODO: Use client. + _ = c +} + +func ExampleClient_ListExecutions() { + ctx := context.Background() + c, err := executions.NewClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &executionspb.ListExecutionsRequest{ + // TODO: Fill request struct fields. + } + it := c.ListExecutions(ctx, req) + for { + resp, err := it.Next() + if err == iterator.Done { + break + } + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp + } +} + +func ExampleClient_CreateExecution() { + ctx := context.Background() + c, err := executions.NewClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &executionspb.CreateExecutionRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.CreateExecution(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleClient_GetExecution() { + ctx := context.Background() + c, err := executions.NewClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &executionspb.GetExecutionRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.GetExecution(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleClient_CancelExecution() { + ctx := context.Background() + c, err := executions.NewClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &executionspb.CancelExecutionRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.CancelExecution(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} diff --git a/workflows/executions/apiv1/gapic_metadata.json b/workflows/executions/apiv1/gapic_metadata.json new file mode 100644 index 00000000000..bd49590ca4b --- /dev/null +++ b/workflows/executions/apiv1/gapic_metadata.json @@ -0,0 +1,38 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.workflows.executions.v1", + "libraryPackage": "cloud.google.com/go/workflows/executions/apiv1", + "services": { + "Executions": { + "clients": { + "grpc": { + "libraryClient": "Client", + "rpcs": { + "CancelExecution": { + "methods": [ + "CancelExecution" + ] + }, + "CreateExecution": { + "methods": [ + "CreateExecution" + ] + }, + "GetExecution": { + "methods": [ + "GetExecution" + ] + }, + "ListExecutions": { + "methods": [ + "ListExecutions" + ] + } + } + } + } + } + } +} From aeea1ce1e5dff3acdfe208932327b52c49851b41 Mon Sep 17 00:00:00 2001 From: Noah Dietz Date: Wed, 30 Jun 2021 11:19:13 -0700 Subject: [PATCH 35/50] fix(internal): fix googleapis-disco regen (#4354) --- internal/gapicgen/generator/gapics.go | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/internal/gapicgen/generator/gapics.go b/internal/gapicgen/generator/gapics.go index 48a16e67acc..e57315a91df 100644 --- a/internal/gapicgen/generator/gapics.go +++ b/internal/gapicgen/generator/gapics.go @@ -491,7 +491,11 @@ func (g *GapicGenerator) manifest(confs []*microgenConfig) error { entries[manual.DistributionName] = manual } for _, conf := range confs { - yamlPath := filepath.Join(g.googleapisDir, conf.apiServiceConfigPath) + dir := g.googleapisDir + if conf.googleapisDiscovery { + dir = g.googleapisDiscoDir + } + yamlPath := filepath.Join(dir, conf.apiServiceConfigPath) yamlFile, err := os.Open(yamlPath) if err != nil { return err @@ -535,7 +539,11 @@ func (g *GapicGenerator) copyMicrogenFiles() error { func (g *GapicGenerator) parseAPIShortnames(confs []*microgenConfig, manualEntries []manifestEntry) (map[string]string, error) { shortnames := map[string]string{} for _, conf := range confs { - yamlPath := filepath.Join(g.googleapisDir, conf.apiServiceConfigPath) + dir := g.googleapisDir + if conf.googleapisDiscovery { + dir = g.googleapisDiscoDir + } + yamlPath := filepath.Join(dir, conf.apiServiceConfigPath) yamlFile, err := os.Open(yamlPath) if err != nil { return nil, err From c03b54473e23d44bdadf3bd21cf69bd5f56ab23f Mon Sep 17 00:00:00 2001 From: yoshi-code-bot <70984784+yoshi-code-bot@users.noreply.github.com> Date: Wed, 30 Jun 2021 11:21:17 -0700 Subject: [PATCH 36/50] chore: release 0.85.0 (#4278) --- CHANGES.md | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/CHANGES.md b/CHANGES.md index ff6d1ec3e65..e2db8879fb4 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,5 +1,30 @@ # Changes +## [0.85.0](https://www.github.com/googleapis/google-cloud-go/compare/v0.84.0...v0.85.0) (2021-06-30) + + +### Features + +* **dataflow:** start generating apiv1beta3 ([cfee361](https://www.github.com/googleapis/google-cloud-go/commit/cfee36161d41e3a0f769e51ab96c25d0967af273)) +* **datastream:** start generating apiv1alpha1 ([cfee361](https://www.github.com/googleapis/google-cloud-go/commit/cfee36161d41e3a0f769e51ab96c25d0967af273)) +* **dialogflow:** added Automated agent reply type and allow cancellation flag for partial response feature. ([5a9c6ce](https://www.github.com/googleapis/google-cloud-go/commit/5a9c6ce781fb6a338e29d3dee72367998d834af0)) +* **documentai:** update document.proto, add the processor management methods. ([5a9c6ce](https://www.github.com/googleapis/google-cloud-go/commit/5a9c6ce781fb6a338e29d3dee72367998d834af0)) +* **eventarc:** start generating apiv1 ([cfee361](https://www.github.com/googleapis/google-cloud-go/commit/cfee36161d41e3a0f769e51ab96c25d0967af273)) +* **gkehub:** added v1alpha messages and client for gkehub ([8fb4649](https://www.github.com/googleapis/google-cloud-go/commit/8fb464956f0ca51d30e8e14dc625ff9fa150c437)) +* **internal/godocfx:** add support for other modules ([#4290](https://www.github.com/googleapis/google-cloud-go/issues/4290)) ([d52bae6](https://www.github.com/googleapis/google-cloud-go/commit/d52bae6cd77474174192c46236d309bf967dfa00)) +* **internal/godocfx:** different metadata for different modules ([#4297](https://www.github.com/googleapis/google-cloud-go/issues/4297)) ([598f5b9](https://www.github.com/googleapis/google-cloud-go/commit/598f5b93778b2e2e75265ae54484dd54477433f5)) +* **internal:** add force option for regen ([#4310](https://www.github.com/googleapis/google-cloud-go/issues/4310)) ([de654eb](https://www.github.com/googleapis/google-cloud-go/commit/de654ebfcf23a53b4d1fee0aa48c73999a55c1a6)) +* **servicecontrol:** Added the gRPC service config for the Service Controller v1 API docs: Updated some comments. ([8fb4649](https://www.github.com/googleapis/google-cloud-go/commit/8fb464956f0ca51d30e8e14dc625ff9fa150c437)) +* **workflows/executions:** start generating apiv1 ([cfee361](https://www.github.com/googleapis/google-cloud-go/commit/cfee36161d41e3a0f769e51ab96c25d0967af273)) + + +### Bug Fixes + +* **internal:** add autogenerated header to snippets ([#4261](https://www.github.com/googleapis/google-cloud-go/issues/4261)) ([2220787](https://www.github.com/googleapis/google-cloud-go/commit/222078722c37c3fdadec7bbbe0bcf81edd105f1a)), refs [#4260](https://www.github.com/googleapis/google-cloud-go/issues/4260) +* **internal:** fix googleapis-disco regen ([#4354](https://www.github.com/googleapis/google-cloud-go/issues/4354)) ([aeea1ce](https://www.github.com/googleapis/google-cloud-go/commit/aeea1ce1e5dff3acdfe208932327b52c49851b41)) +* **kms:** replace IAMPolicy mixin in service config. ([5a9c6ce](https://www.github.com/googleapis/google-cloud-go/commit/5a9c6ce781fb6a338e29d3dee72367998d834af0)) +* **security/privateca:** Fixed casing of the Ruby namespace ([5a9c6ce](https://www.github.com/googleapis/google-cloud-go/commit/5a9c6ce781fb6a338e29d3dee72367998d834af0)) + ## [0.84.0](https://www.github.com/googleapis/google-cloud-go/compare/v0.83.0...v0.84.0) (2021-06-09) From 1cf34b35e69127a57ab90be583c974a2467b3a97 Mon Sep 17 00:00:00 2001 From: Christopher Wilcox Date: Wed, 30 Jun 2021 12:55:02 -0700 Subject: [PATCH 37/50] fix(bigtable): fix #4338 by removing obsolete with block (#4353) --- bigtable/bigtable.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/bigtable/bigtable.go b/bigtable/bigtable.go index 26384139fba..a0ba9dfbf0a 100644 --- a/bigtable/bigtable.go +++ b/bigtable/bigtable.go @@ -79,9 +79,7 @@ func NewClientWithConfig(ctx context.Context, project, instance string, config C option.WithGRPCConnectionPool(4), // Set the max size to correspond to server-side limits. option.WithGRPCDialOption(grpc.WithDefaultCallOptions(grpc.MaxCallSendMsgSize(1<<28), grpc.MaxCallRecvMsgSize(1<<28))), - // TODO(grpc/grpc-go#1388) using connection pool without WithBlock - // can cause RPCs to fail randomly. We can delete this after the issue is fixed. - option.WithGRPCDialOption(grpc.WithBlock())) + ) // Attempts direct access to spanner service over gRPC to improve throughput, // whether the attempt is allowed is totally controlled by service owner. o = append(o, internaloption.EnableDirectPath(true)) From 8fe510f1e8d41f3a2924c11e37896172bc66aadd Mon Sep 17 00:00:00 2001 From: Noah Dietz Date: Wed, 30 Jun 2021 13:58:22 -0700 Subject: [PATCH 38/50] chore(internal): update microgen to v0.21.3 (#4358) --- internal/gapicgen/cmd/genbot/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/gapicgen/cmd/genbot/Dockerfile b/internal/gapicgen/cmd/genbot/Dockerfile index 7290674a78d..a63fd58728f 100644 --- a/internal/gapicgen/cmd/genbot/Dockerfile +++ b/internal/gapicgen/cmd/genbot/Dockerfile @@ -28,7 +28,7 @@ RUN GO111MODULE=on go get \ golang.org/x/lint/golint@latest \ golang.org/x/tools/cmd/goimports@latest \ honnef.co/go/tools/cmd/staticcheck@latest \ - github.com/googleapis/gapic-generator-go/cmd/protoc-gen-go_gapic@v0.21.2 + github.com/googleapis/gapic-generator-go/cmd/protoc-gen-go_gapic@v0.21.3 ENV PATH="${PATH}:/root/go/bin" # Source: http://debuggable.com/posts/disable-strict-host-checking-for-git-clone:49896ff3-0ac0-4263-9703-1eae4834cda3 From 13acf7fb3b081c1ae14c0ecd66ee31db5476835e Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Wed, 30 Jun 2021 14:44:51 -0700 Subject: [PATCH 39/50] chore(all): auto-regenerate gapics (#4355) * chore(all): auto-regenerate gapics This is an auto-generated regeneration of the gapic clients by cloud.google.com/go/internal/gapicgen. Once the corresponding genproto PR is submitted, genbot will update this PR with a newer dependency to the newer version of genproto and assign reviewers to this PR. If you have been assigned to review this PR, please: - Ensure that the version of genproto in go.mod has been updated. - Ensure that CI is passing. If it's failing, it requires your manual attention. - Approve and submit this PR if you believe it's ready to ship. Corresponding genproto PR: https://github.com/googleapis/go-genproto/pull/628 Changes: feat(pubsub): Adding subscription properties to streaming pull response in third party pubsub.proto. PiperOrigin-RevId: 382318016 Source-Link: https://github.com/googleapis/googleapis/commit/e9b2b616a20a11c97c7ac912536e82d33d006104 fix!(datastream): Remove DiscoverConnectionProfile method signature which didn't populate the request sufficiently fix!: Overhaul resource annotations, some of which were incorrect and some of which were just non-ideal PiperOrigin-RevId: 382316023 Source-Link: https://github.com/googleapis/googleapis/commit/125799dc997a0faea8b207b4e013f2c8371323d8 --- .../apiv1/access_approval_client.go | 1 + accessapproval/apiv1/doc.go | 2 +- aiplatform/apiv1/dataset_client.go | 1 + aiplatform/apiv1/doc.go | 2 +- aiplatform/apiv1/endpoint_client.go | 1 + aiplatform/apiv1/job_client.go | 1 + aiplatform/apiv1/migration_client.go | 1 + aiplatform/apiv1/model_client.go | 1 + aiplatform/apiv1/pipeline_client.go | 1 + aiplatform/apiv1/prediction_client.go | 1 + aiplatform/apiv1/specialist_pool_client.go | 1 + .../apiv1alpha/analytics_admin_client.go | 1 + analytics/admin/apiv1alpha/doc.go | 2 +- .../apiv1alpha/alpha_analytics_data_client.go | 1 + analytics/data/apiv1alpha/doc.go | 2 +- apigateway/apiv1/api_gateway_client.go | 1 + apigateway/apiv1/doc.go | 2 +- apigeeconnect/apiv1/connection_client.go | 1 + apigeeconnect/apiv1/doc.go | 2 +- apigeeconnect/apiv1/tether_client.go | 1 + appengine/apiv1/applications_client.go | 1 + .../apiv1/authorized_certificates_client.go | 1 + appengine/apiv1/authorized_domains_client.go | 1 + appengine/apiv1/doc.go | 2 +- appengine/apiv1/domain_mappings_client.go | 1 + appengine/apiv1/firewall_client.go | 1 + appengine/apiv1/instances_client.go | 1 + appengine/apiv1/services_client.go | 1 + appengine/apiv1/versions_client.go | 1 + area120/tables/apiv1alpha1/doc.go | 2 +- area120/tables/apiv1alpha1/tables_client.go | 1 + .../apiv1beta2/artifact_registry_client.go | 1 + artifactregistry/apiv1beta2/doc.go | 2 +- asset/apiv1/asset_client.go | 1 + asset/apiv1/doc.go | 2 +- asset/apiv1p2beta1/asset_client.go | 1 + asset/apiv1p2beta1/doc.go | 2 +- asset/apiv1p5beta1/asset_client.go | 1 + asset/apiv1p5beta1/doc.go | 2 +- .../apiv1beta1/assured_workloads_client.go | 1 + assuredworkloads/apiv1beta1/doc.go | 2 +- automl/apiv1/auto_ml_client.go | 1 + automl/apiv1/doc.go | 2 +- automl/apiv1/prediction_client.go | 1 + automl/apiv1beta1/auto_ml_client.go | 1 + automl/apiv1beta1/doc.go | 2 +- automl/apiv1beta1/prediction_client.go | 1 + .../connection/apiv1/connection_client.go | 1 + bigquery/connection/apiv1/doc.go | 2 +- .../apiv1beta1/connection_client.go | 1 + bigquery/connection/apiv1beta1/doc.go | 2 +- .../apiv1/data_transfer_client.go | 1 + bigquery/datatransfer/apiv1/doc.go | 2 +- bigquery/go.mod | 4 +- bigquery/go.sum | 14 ++--- bigquery/reservation/apiv1/doc.go | 2 +- .../reservation/apiv1/reservation_client.go | 1 + bigquery/reservation/apiv1beta1/doc.go | 2 +- .../apiv1beta1/reservation_client.go | 1 + .../storage/apiv1/big_query_read_client.go | 1 + bigquery/storage/apiv1/doc.go | 2 +- .../apiv1beta1/big_query_storage_client.go | 1 + bigquery/storage/apiv1beta1/doc.go | 2 +- .../apiv1beta2/big_query_read_client.go | 1 + .../apiv1beta2/big_query_write_client.go | 1 + bigquery/storage/apiv1beta2/doc.go | 2 +- bigtable/go.mod | 4 +- bigtable/go.sum | 11 ++-- billing/apiv1/cloud_billing_client.go | 1 + billing/apiv1/cloud_catalog_client.go | 1 + billing/apiv1/doc.go | 2 +- billing/budgets/apiv1/budget_client.go | 1 + billing/budgets/apiv1/doc.go | 2 +- billing/budgets/apiv1beta1/budget_client.go | 1 + billing/budgets/apiv1beta1/doc.go | 2 +- ...uthz_management_service_v1_beta1_client.go | 1 + binaryauthorization/apiv1beta1/doc.go | 2 +- channel/apiv1/cloud_channel_client.go | 1 + channel/apiv1/doc.go | 2 +- cloudbuild/apiv1/v2/cloud_build_client.go | 1 + cloudbuild/apiv1/v2/doc.go | 2 +- clouddms/apiv1/data_migration_client.go | 1 + clouddms/apiv1/doc.go | 4 +- cloudtasks/apiv2/cloud_tasks_client.go | 1 + cloudtasks/apiv2/doc.go | 2 +- cloudtasks/apiv2beta2/cloud_tasks_client.go | 1 + cloudtasks/apiv2beta2/doc.go | 2 +- cloudtasks/apiv2beta3/cloud_tasks_client.go | 1 + cloudtasks/apiv2beta3/doc.go | 2 +- container/apiv1/cluster_manager_client.go | 1 + container/apiv1/doc.go | 2 +- .../container_analysis_v1_beta1_client.go | 1 + containeranalysis/apiv1beta1/doc.go | 2 +- .../apiv1beta1/grafeas_v1_beta1_client.go | 1 + datacatalog/apiv1/data_catalog_client.go | 1 + datacatalog/apiv1/doc.go | 2 +- .../apiv1/policy_tag_manager_client.go | 1 + ...policy_tag_manager_serialization_client.go | 1 + datacatalog/apiv1beta1/data_catalog_client.go | 1 + datacatalog/apiv1beta1/doc.go | 2 +- .../apiv1beta1/policy_tag_manager_client.go | 1 + ...policy_tag_manager_serialization_client.go | 1 + .../apiv1beta1/data_labeling_client.go | 1 + datalabeling/apiv1beta1/doc.go | 2 +- dataproc/apiv1/autoscaling_policy_client.go | 1 + dataproc/apiv1/cluster_controller_client.go | 1 + dataproc/apiv1/doc.go | 2 +- dataproc/apiv1/job_controller_client.go | 1 + dataproc/apiv1/workflow_template_client.go | 1 + .../apiv1beta2/autoscaling_policy_client.go | 1 + .../apiv1beta2/cluster_controller_client.go | 1 + dataproc/apiv1beta2/doc.go | 2 +- dataproc/apiv1beta2/job_controller_client.go | 1 + .../apiv1beta2/workflow_template_client.go | 1 + dataqna/apiv1alpha/auto_suggestion_client.go | 1 + dataqna/apiv1alpha/doc.go | 2 +- dataqna/apiv1alpha/question_client.go | 1 + .../admin/apiv1/datastore_admin_client.go | 1 + datastore/admin/apiv1/doc.go | 2 +- datastore/go.mod | 4 +- datastore/go.sum | 14 ++--- datastream/apiv1alpha1/datastream_client.go | 6 +- datastream/apiv1alpha1/doc.go | 4 +- debugger/apiv2/controller2_client.go | 1 + debugger/apiv2/debugger2_client.go | 1 + debugger/apiv2/doc.go | 2 +- dialogflow/apiv2/agents_client.go | 1 + dialogflow/apiv2/answer_records_client.go | 1 + dialogflow/apiv2/contexts_client.go | 1 + .../apiv2/conversation_profiles_client.go | 1 + dialogflow/apiv2/conversations_client.go | 1 + dialogflow/apiv2/doc.go | 2 +- dialogflow/apiv2/documents_client.go | 1 + dialogflow/apiv2/entity_types_client.go | 1 + dialogflow/apiv2/environments_client.go | 1 + dialogflow/apiv2/fulfillments_client.go | 1 + dialogflow/apiv2/intents_client.go | 1 + dialogflow/apiv2/knowledge_bases_client.go | 1 + dialogflow/apiv2/participants_client.go | 1 + .../apiv2/session_entity_types_client.go | 1 + dialogflow/apiv2/sessions_client.go | 1 + dialogflow/apiv2/versions_client.go | 1 + dialogflow/cx/apiv3/agents_client.go | 1 + dialogflow/cx/apiv3/doc.go | 4 +- dialogflow/cx/apiv3/entity_types_client.go | 1 + dialogflow/cx/apiv3/environments_client.go | 1 + dialogflow/cx/apiv3/experiments_client.go | 1 + dialogflow/cx/apiv3/flows_client.go | 1 + dialogflow/cx/apiv3/intents_client.go | 1 + dialogflow/cx/apiv3/pages_client.go | 1 + .../cx/apiv3/security_settings_client.go | 1 + .../cx/apiv3/session_entity_types_client.go | 1 + dialogflow/cx/apiv3/sessions_client.go | 1 + dialogflow/cx/apiv3/test_cases_client.go | 1 + .../apiv3/transition_route_groups_client.go | 1 + dialogflow/cx/apiv3/versions_client.go | 1 + dialogflow/cx/apiv3/webhooks_client.go | 1 + dialogflow/cx/apiv3beta1/agents_client.go | 1 + dialogflow/cx/apiv3beta1/doc.go | 2 +- .../cx/apiv3beta1/entity_types_client.go | 1 + .../cx/apiv3beta1/environments_client.go | 1 + .../cx/apiv3beta1/experiments_client.go | 1 + dialogflow/cx/apiv3beta1/flows_client.go | 1 + dialogflow/cx/apiv3beta1/intents_client.go | 1 + dialogflow/cx/apiv3beta1/pages_client.go | 1 + .../cx/apiv3beta1/security_settings_client.go | 1 + .../apiv3beta1/session_entity_types_client.go | 1 + dialogflow/cx/apiv3beta1/sessions_client.go | 1 + dialogflow/cx/apiv3beta1/test_cases_client.go | 1 + .../transition_route_groups_client.go | 1 + dialogflow/cx/apiv3beta1/versions_client.go | 1 + dialogflow/cx/apiv3beta1/webhooks_client.go | 1 + dlp/apiv2/dlp_client.go | 1 + dlp/apiv2/doc.go | 2 +- documentai/apiv1/doc.go | 4 +- documentai/apiv1/document_processor_client.go | 1 + documentai/apiv1beta3/doc.go | 2 +- .../apiv1beta3/document_processor_client.go | 1 + domains/apiv1beta1/doc.go | 2 +- domains/apiv1beta1/domains_client.go | 1 + errorreporting/apiv1beta1/doc.go | 2 +- .../apiv1beta1/error_group_client.go | 1 + .../apiv1beta1/error_stats_client.go | 1 + .../apiv1beta1/report_errors_client.go | 1 + essentialcontacts/apiv1/doc.go | 4 +- .../apiv1/essential_contacts_client.go | 1 + firestore/apiv1/admin/doc.go | 2 +- .../apiv1/admin/firestore_admin_client.go | 1 + firestore/apiv1/doc.go | 2 +- firestore/apiv1/firestore_client.go | 1 + firestore/go.mod | 4 +- firestore/go.sum | 14 ++--- functions/apiv1/cloud_functions_client.go | 1 + functions/apiv1/doc.go | 2 +- gaming/apiv1/doc.go | 2 +- gaming/apiv1/game_server_clusters_client.go | 1 + gaming/apiv1/game_server_configs_client.go | 1 + .../apiv1/game_server_deployments_client.go | 1 + gaming/apiv1/realms_client.go | 1 + gaming/apiv1beta/doc.go | 2 +- .../apiv1beta/game_server_clusters_client.go | 1 + .../apiv1beta/game_server_configs_client.go | 1 + .../game_server_deployments_client.go | 1 + gaming/apiv1beta/realms_client.go | 1 + gkeconnect/gateway/apiv1beta1/doc.go | 2 +- .../gateway/apiv1beta1/gateway_client.go | 1 + gkehub/apiv1beta1/doc.go | 2 +- .../apiv1beta1/gke_hub_membership_client.go | 1 + go.mod | 4 +- go.sum | 11 ++-- gsuiteaddons/apiv1/doc.go | 2 +- gsuiteaddons/apiv1/g_suite_add_ons_client.go | 1 + iam/credentials/apiv1/doc.go | 2 +- .../apiv1/iam_credentials_client.go | 1 + internal/.repo-metadata-full.json | 59 ++++++++++++++++--- internal/examples/fake/go.mod | 2 +- internal/examples/fake/go.sum | 4 +- internal/examples/mock/go.mod | 2 +- internal/examples/mock/go.sum | 4 +- internal/gapicgen/go.mod | 2 +- internal/gapicgen/go.sum | 4 +- .../LaunchFlexTemplate/main.go | 47 +++++++++++++++ .../AggregatedListJobs/main.go | 54 +++++++++++++++++ .../JobsV1Beta3Client/CheckActiveJobs/main.go | 47 +++++++++++++++ .../JobsV1Beta3Client/CreateJob/main.go | 47 +++++++++++++++ .../JobsV1Beta3Client/GetJob/main.go | 47 +++++++++++++++ .../JobsV1Beta3Client/ListJobs/main.go | 54 +++++++++++++++++ .../JobsV1Beta3Client/SnapshotJob/main.go | 47 +++++++++++++++ .../JobsV1Beta3Client/UpdateJob/main.go | 47 +++++++++++++++ .../ListJobMessages/main.go | 54 +++++++++++++++++ .../GetJobExecutionDetails/main.go | 54 +++++++++++++++++ .../GetJobMetrics/main.go | 47 +++++++++++++++ .../GetStageExecutionDetails/main.go | 54 +++++++++++++++++ .../DeleteSnapshot/main.go | 47 +++++++++++++++ .../GetSnapshot/main.go | 47 +++++++++++++++ .../ListSnapshots/main.go | 47 +++++++++++++++ .../CreateJobFromTemplate/main.go | 47 +++++++++++++++ .../TemplatesClient/GetTemplate/main.go | 47 +++++++++++++++ .../TemplatesClient/LaunchTemplate/main.go | 47 +++++++++++++++ .../Client/CreateConnectionProfile/main.go | 52 ++++++++++++++++ .../Client/CreatePrivateConnection/main.go | 52 ++++++++++++++++ .../apiv1alpha1/Client/CreateRoute/main.go | 52 ++++++++++++++++ .../apiv1alpha1/Client/CreateStream/main.go | 52 ++++++++++++++++ .../Client/DeleteConnectionProfile/main.go | 50 ++++++++++++++++ .../Client/DeletePrivateConnection/main.go | 50 ++++++++++++++++ .../apiv1alpha1/Client/DeleteRoute/main.go | 50 ++++++++++++++++ .../apiv1alpha1/Client/DeleteStream/main.go | 50 ++++++++++++++++ .../Client/DiscoverConnectionProfile/main.go | 47 +++++++++++++++ .../apiv1alpha1/Client/FetchErrors/main.go | 52 ++++++++++++++++ .../apiv1alpha1/Client/FetchStaticIps/main.go | 54 +++++++++++++++++ .../Client/GetConnectionProfile/main.go | 47 +++++++++++++++ .../Client/GetPrivateConnection/main.go | 47 +++++++++++++++ .../apiv1alpha1/Client/GetRoute/main.go | 47 +++++++++++++++ .../apiv1alpha1/Client/GetStream/main.go | 47 +++++++++++++++ .../Client/ListConnectionProfiles/main.go | 54 +++++++++++++++++ .../Client/ListPrivateConnections/main.go | 54 +++++++++++++++++ .../apiv1alpha1/Client/ListRoutes/main.go | 54 +++++++++++++++++ .../apiv1alpha1/Client/ListStreams/main.go | 54 +++++++++++++++++ .../Client/UpdateConnectionProfile/main.go | 52 ++++++++++++++++ .../apiv1alpha1/Client/UpdateStream/main.go | 52 ++++++++++++++++ .../apiv1/Client/CreateTrigger/main.go | 52 ++++++++++++++++ .../apiv1/Client/DeleteTrigger/main.go | 52 ++++++++++++++++ .../eventarc/apiv1/Client/GetTrigger/main.go | 47 +++++++++++++++ .../apiv1/Client/ListTriggers/main.go | 54 +++++++++++++++++ .../apiv1/Client/UpdateTrigger/main.go | 52 ++++++++++++++++ internal/generated/snippets/go.mod | 2 +- internal/generated/snippets/go.sum | 3 +- .../apiv1/Client/CancelExecution/main.go | 47 +++++++++++++++ .../apiv1/Client/CreateExecution/main.go | 47 +++++++++++++++ .../apiv1/Client/GetExecution/main.go | 47 +++++++++++++++ .../apiv1/Client/ListExecutions/main.go | 54 +++++++++++++++++ internal/godocfx/go.sum | 4 +- iot/apiv1/device_manager_client.go | 1 + iot/apiv1/doc.go | 2 +- kms/apiv1/doc.go | 2 +- kms/apiv1/key_management_client.go | 1 + language/apiv1/doc.go | 2 +- language/apiv1/language_client.go | 1 + language/apiv1beta2/doc.go | 2 +- language/apiv1beta2/language_client.go | 1 + lifesciences/apiv2beta/doc.go | 2 +- .../workflows_service_v2_beta_client.go | 1 + logging/apiv2/config_client.go | 1 + logging/apiv2/doc.go | 2 +- logging/apiv2/logging_client.go | 1 + logging/apiv2/metrics_client.go | 1 + logging/go.mod | 4 +- logging/go.sum | 11 ++-- longrunning/autogen/doc.go | 2 +- longrunning/autogen/operations_client.go | 1 + managedidentities/apiv1/doc.go | 2 +- .../apiv1/managed_identities_client.go | 1 + mediatranslation/apiv1beta1/doc.go | 2 +- .../apiv1beta1/speech_translation_client.go | 1 + memcache/apiv1/cloud_memcache_client.go | 1 + memcache/apiv1/doc.go | 2 +- memcache/apiv1beta2/cloud_memcache_client.go | 1 + memcache/apiv1beta2/doc.go | 2 +- metastore/apiv1/dataproc_metastore_client.go | 1 + metastore/apiv1/doc.go | 4 +- .../apiv1alpha/dataproc_metastore_client.go | 1 + metastore/apiv1alpha/doc.go | 2 +- .../apiv1beta/dataproc_metastore_client.go | 1 + metastore/apiv1beta/doc.go | 2 +- monitoring/apiv3/v2/alert_policy_client.go | 1 + monitoring/apiv3/v2/doc.go | 2 +- monitoring/apiv3/v2/group_client.go | 1 + monitoring/apiv3/v2/metric_client.go | 1 + .../apiv3/v2/notification_channel_client.go | 1 + monitoring/apiv3/v2/query_client.go | 1 + .../apiv3/v2/service_monitoring_client.go | 1 + monitoring/apiv3/v2/uptime_check_client.go | 1 + .../dashboard/apiv1/dashboards_client.go | 1 + monitoring/dashboard/apiv1/doc.go | 2 +- networkconnectivity/apiv1alpha1/doc.go | 2 +- networkconnectivity/apiv1alpha1/hub_client.go | 1 + notebooks/apiv1beta1/doc.go | 2 +- notebooks/apiv1beta1/notebook_client.go | 1 + orgpolicy/apiv2/doc.go | 2 +- orgpolicy/apiv2/org_policy_client.go | 1 + .../apiv1/agent_endpoint_client.go | 1 + osconfig/agentendpoint/apiv1/doc.go | 2 +- .../apiv1beta/agent_endpoint_client.go | 1 + osconfig/agentendpoint/apiv1beta/doc.go | 2 +- osconfig/apiv1/doc.go | 2 +- osconfig/apiv1/os_config_client.go | 1 + osconfig/apiv1alpha/doc.go | 2 +- osconfig/apiv1alpha/os_config_zonal_client.go | 1 + osconfig/apiv1beta/doc.go | 2 +- osconfig/apiv1beta/os_config_client.go | 1 + oslogin/apiv1/doc.go | 2 +- oslogin/apiv1/os_login_client.go | 1 + oslogin/apiv1beta/doc.go | 2 +- oslogin/apiv1beta/os_login_client.go | 1 + phishingprotection/apiv1beta1/doc.go | 2 +- ...hing_protection_service_v1_beta1_client.go | 1 + policytroubleshooter/apiv1/doc.go | 2 +- .../apiv1/iam_checker_client.go | 1 + privatecatalog/apiv1beta1/doc.go | 2 +- .../apiv1beta1/private_catalog_client.go | 1 + pubsub/apiv1/doc.go | 2 +- pubsub/apiv1/publisher_client.go | 1 + pubsub/apiv1/schema_client.go | 1 + pubsub/apiv1/subscriber_client.go | 1 + pubsub/go.mod | 4 +- pubsub/go.sum | 11 ++-- pubsublite/apiv1/admin_client.go | 1 + pubsublite/apiv1/cursor_client.go | 1 + pubsublite/apiv1/doc.go | 2 +- .../apiv1/partition_assignment_client.go | 1 + pubsublite/apiv1/publisher_client.go | 1 + pubsublite/apiv1/subscriber_client.go | 1 + pubsublite/apiv1/topic_stats_client.go | 1 + pubsublite/go.mod | 4 +- pubsublite/go.sum | 14 ++--- recaptchaenterprise/apiv1/doc.go | 2 +- .../apiv1/recaptcha_enterprise_client.go | 1 + recaptchaenterprise/apiv1beta1/doc.go | 2 +- ...tcha_enterprise_service_v1_beta1_client.go | 1 + recommender/apiv1/doc.go | 2 +- recommender/apiv1/recommender_client.go | 1 + recommender/apiv1beta1/doc.go | 2 +- recommender/apiv1beta1/recommender_client.go | 1 + redis/apiv1/cloud_redis_client.go | 1 + redis/apiv1/doc.go | 2 +- redis/apiv1beta1/cloud_redis_client.go | 1 + redis/apiv1beta1/doc.go | 2 +- resourcemanager/apiv2/doc.go | 2 +- resourcemanager/apiv2/folders_client.go | 1 + resourcesettings/apiv1/doc.go | 4 +- .../apiv1/resource_settings_client.go | 1 + retail/apiv2/catalog_client.go | 1 + retail/apiv2/doc.go | 2 +- retail/apiv2/prediction_client.go | 1 + retail/apiv2/product_client.go | 1 + retail/apiv2/user_event_client.go | 1 + scheduler/apiv1/cloud_scheduler_client.go | 1 + scheduler/apiv1/doc.go | 2 +- .../apiv1beta1/cloud_scheduler_client.go | 1 + scheduler/apiv1beta1/doc.go | 2 +- secretmanager/apiv1/doc.go | 2 +- secretmanager/apiv1/secret_manager_client.go | 1 + secretmanager/apiv1beta1/doc.go | 2 +- .../apiv1beta1/secret_manager_client.go | 1 + .../apiv1/certificate_authority_client.go | 1 + security/privateca/apiv1/doc.go | 4 +- .../certificate_authority_client.go | 1 + security/privateca/apiv1beta1/doc.go | 2 +- securitycenter/apiv1/doc.go | 2 +- .../apiv1/security_center_client.go | 1 + securitycenter/apiv1beta1/doc.go | 2 +- .../apiv1beta1/security_center_client.go | 1 + securitycenter/apiv1p1beta1/doc.go | 2 +- .../apiv1p1beta1/security_center_client.go | 1 + securitycenter/settings/apiv1beta1/doc.go | 2 +- .../security_center_settings_client.go | 1 + servicecontrol/apiv1/doc.go | 2 +- .../apiv1/quota_controller_client.go | 1 + .../apiv1/service_controller_client.go | 1 + servicedirectory/apiv1/doc.go | 2 +- servicedirectory/apiv1/lookup_client.go | 1 + servicedirectory/apiv1/registration_client.go | 1 + servicedirectory/apiv1beta1/doc.go | 2 +- servicedirectory/apiv1beta1/lookup_client.go | 1 + .../apiv1beta1/registration_client.go | 1 + servicemanagement/apiv1/doc.go | 2 +- .../apiv1/service_manager_client.go | 1 + serviceusage/apiv1/doc.go | 4 +- serviceusage/apiv1/service_usage_client.go | 1 + shell/apiv1/cloud_shell_client.go | 1 + shell/apiv1/doc.go | 2 +- .../database/apiv1/database_admin_client.go | 1 + spanner/admin/database/apiv1/doc.go | 2 +- spanner/admin/instance/apiv1/doc.go | 2 +- .../instance/apiv1/instance_admin_client.go | 1 + spanner/apiv1/doc.go | 2 +- spanner/apiv1/spanner_client.go | 1 + spanner/go.mod | 4 +- spanner/go.sum | 14 ++--- speech/apiv1/doc.go | 2 +- speech/apiv1/speech_client.go | 1 + speech/apiv1p1beta1/adaptation_client.go | 1 + speech/apiv1p1beta1/doc.go | 2 +- speech/apiv1p1beta1/speech_client.go | 1 + storage/go.mod | 4 +- storage/go.sum | 11 ++-- storage/internal/apiv1/doc.go | 4 +- talent/apiv4/company_client.go | 1 + talent/apiv4/completion_client.go | 1 + talent/apiv4/doc.go | 2 +- talent/apiv4/event_client.go | 1 + talent/apiv4/job_client.go | 1 + talent/apiv4/tenant_client.go | 1 + talent/apiv4beta1/application_client.go | 1 + talent/apiv4beta1/company_client.go | 1 + talent/apiv4beta1/completion_client.go | 1 + talent/apiv4beta1/doc.go | 2 +- talent/apiv4beta1/event_client.go | 1 + talent/apiv4beta1/job_client.go | 1 + talent/apiv4beta1/profile_client.go | 1 + talent/apiv4beta1/tenant_client.go | 1 + texttospeech/apiv1/doc.go | 2 +- texttospeech/apiv1/text_to_speech_client.go | 1 + tpu/apiv1/doc.go | 2 +- tpu/apiv1/tpu_client.go | 1 + trace/apiv1/doc.go | 2 +- trace/apiv1/trace_client.go | 1 + trace/apiv2/doc.go | 2 +- trace/apiv2/trace_client.go | 1 + translate/apiv3/doc.go | 2 +- translate/apiv3/translation_client.go | 1 + video/transcoder/apiv1beta1/doc.go | 2 +- .../apiv1beta1/transcoder_client.go | 1 + videointelligence/apiv1/doc.go | 2 +- .../apiv1/video_intelligence_client.go | 1 + videointelligence/apiv1beta2/doc.go | 2 +- .../apiv1beta2/video_intelligence_client.go | 1 + vision/apiv1/doc.go | 2 +- vision/apiv1/image_annotator_client.go | 1 + vision/apiv1/product_search_client.go | 1 + vision/apiv1p1beta1/doc.go | 2 +- vision/apiv1p1beta1/image_annotator_client.go | 1 + vpcaccess/apiv1/doc.go | 2 +- vpcaccess/apiv1/vpc_access_client.go | 1 + webrisk/apiv1/doc.go | 2 +- webrisk/apiv1/web_risk_client.go | 1 + webrisk/apiv1beta1/doc.go | 2 +- .../web_risk_service_v1_beta1_client.go | 1 + websecurityscanner/apiv1/doc.go | 2 +- .../apiv1/web_security_scanner_client.go | 1 + workflows/apiv1beta/doc.go | 2 +- workflows/apiv1beta/workflows_client.go | 1 + workflows/executions/apiv1beta/doc.go | 2 +- .../executions/apiv1beta/executions_client.go | 1 + 474 files changed, 2949 insertions(+), 267 deletions(-) create mode 100644 internal/generated/snippets/dataflow/apiv1beta3/FlexTemplatesClient/LaunchFlexTemplate/main.go create mode 100644 internal/generated/snippets/dataflow/apiv1beta3/JobsV1Beta3Client/AggregatedListJobs/main.go create mode 100644 internal/generated/snippets/dataflow/apiv1beta3/JobsV1Beta3Client/CheckActiveJobs/main.go create mode 100644 internal/generated/snippets/dataflow/apiv1beta3/JobsV1Beta3Client/CreateJob/main.go create mode 100644 internal/generated/snippets/dataflow/apiv1beta3/JobsV1Beta3Client/GetJob/main.go create mode 100644 internal/generated/snippets/dataflow/apiv1beta3/JobsV1Beta3Client/ListJobs/main.go create mode 100644 internal/generated/snippets/dataflow/apiv1beta3/JobsV1Beta3Client/SnapshotJob/main.go create mode 100644 internal/generated/snippets/dataflow/apiv1beta3/JobsV1Beta3Client/UpdateJob/main.go create mode 100644 internal/generated/snippets/dataflow/apiv1beta3/MessagesV1Beta3Client/ListJobMessages/main.go create mode 100644 internal/generated/snippets/dataflow/apiv1beta3/MetricsV1Beta3Client/GetJobExecutionDetails/main.go create mode 100644 internal/generated/snippets/dataflow/apiv1beta3/MetricsV1Beta3Client/GetJobMetrics/main.go create mode 100644 internal/generated/snippets/dataflow/apiv1beta3/MetricsV1Beta3Client/GetStageExecutionDetails/main.go create mode 100644 internal/generated/snippets/dataflow/apiv1beta3/SnapshotsV1Beta3Client/DeleteSnapshot/main.go create mode 100644 internal/generated/snippets/dataflow/apiv1beta3/SnapshotsV1Beta3Client/GetSnapshot/main.go create mode 100644 internal/generated/snippets/dataflow/apiv1beta3/SnapshotsV1Beta3Client/ListSnapshots/main.go create mode 100644 internal/generated/snippets/dataflow/apiv1beta3/TemplatesClient/CreateJobFromTemplate/main.go create mode 100644 internal/generated/snippets/dataflow/apiv1beta3/TemplatesClient/GetTemplate/main.go create mode 100644 internal/generated/snippets/dataflow/apiv1beta3/TemplatesClient/LaunchTemplate/main.go create mode 100644 internal/generated/snippets/datastream/apiv1alpha1/Client/CreateConnectionProfile/main.go create mode 100644 internal/generated/snippets/datastream/apiv1alpha1/Client/CreatePrivateConnection/main.go create mode 100644 internal/generated/snippets/datastream/apiv1alpha1/Client/CreateRoute/main.go create mode 100644 internal/generated/snippets/datastream/apiv1alpha1/Client/CreateStream/main.go create mode 100644 internal/generated/snippets/datastream/apiv1alpha1/Client/DeleteConnectionProfile/main.go create mode 100644 internal/generated/snippets/datastream/apiv1alpha1/Client/DeletePrivateConnection/main.go create mode 100644 internal/generated/snippets/datastream/apiv1alpha1/Client/DeleteRoute/main.go create mode 100644 internal/generated/snippets/datastream/apiv1alpha1/Client/DeleteStream/main.go create mode 100644 internal/generated/snippets/datastream/apiv1alpha1/Client/DiscoverConnectionProfile/main.go create mode 100644 internal/generated/snippets/datastream/apiv1alpha1/Client/FetchErrors/main.go create mode 100644 internal/generated/snippets/datastream/apiv1alpha1/Client/FetchStaticIps/main.go create mode 100644 internal/generated/snippets/datastream/apiv1alpha1/Client/GetConnectionProfile/main.go create mode 100644 internal/generated/snippets/datastream/apiv1alpha1/Client/GetPrivateConnection/main.go create mode 100644 internal/generated/snippets/datastream/apiv1alpha1/Client/GetRoute/main.go create mode 100644 internal/generated/snippets/datastream/apiv1alpha1/Client/GetStream/main.go create mode 100644 internal/generated/snippets/datastream/apiv1alpha1/Client/ListConnectionProfiles/main.go create mode 100644 internal/generated/snippets/datastream/apiv1alpha1/Client/ListPrivateConnections/main.go create mode 100644 internal/generated/snippets/datastream/apiv1alpha1/Client/ListRoutes/main.go create mode 100644 internal/generated/snippets/datastream/apiv1alpha1/Client/ListStreams/main.go create mode 100644 internal/generated/snippets/datastream/apiv1alpha1/Client/UpdateConnectionProfile/main.go create mode 100644 internal/generated/snippets/datastream/apiv1alpha1/Client/UpdateStream/main.go create mode 100644 internal/generated/snippets/eventarc/apiv1/Client/CreateTrigger/main.go create mode 100644 internal/generated/snippets/eventarc/apiv1/Client/DeleteTrigger/main.go create mode 100644 internal/generated/snippets/eventarc/apiv1/Client/GetTrigger/main.go create mode 100644 internal/generated/snippets/eventarc/apiv1/Client/ListTriggers/main.go create mode 100644 internal/generated/snippets/eventarc/apiv1/Client/UpdateTrigger/main.go create mode 100644 internal/generated/snippets/workflows/executions/apiv1/Client/CancelExecution/main.go create mode 100644 internal/generated/snippets/workflows/executions/apiv1/Client/CreateExecution/main.go create mode 100644 internal/generated/snippets/workflows/executions/apiv1/Client/GetExecution/main.go create mode 100644 internal/generated/snippets/workflows/executions/apiv1/Client/ListExecutions/main.go diff --git a/accessapproval/apiv1/access_approval_client.go b/accessapproval/apiv1/access_approval_client.go index 0ae5314bc9f..fec2c79abc9 100644 --- a/accessapproval/apiv1/access_approval_client.go +++ b/accessapproval/apiv1/access_approval_client.go @@ -54,6 +54,7 @@ func defaultGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("accessapproval.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://accessapproval.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/accessapproval/apiv1/doc.go b/accessapproval/apiv1/doc.go index a4d44187f42..4c149e1b44e 100644 --- a/accessapproval/apiv1/doc.go +++ b/accessapproval/apiv1/doc.go @@ -48,7 +48,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210624" +const versionClient = "20210630" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/aiplatform/apiv1/dataset_client.go b/aiplatform/apiv1/dataset_client.go index 99e8c1d7038..4214aeaab7d 100644 --- a/aiplatform/apiv1/dataset_client.go +++ b/aiplatform/apiv1/dataset_client.go @@ -59,6 +59,7 @@ func defaultDatasetGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("aiplatform.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://aiplatform.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/aiplatform/apiv1/doc.go b/aiplatform/apiv1/doc.go index c86f004cf39..c78bb382cab 100644 --- a/aiplatform/apiv1/doc.go +++ b/aiplatform/apiv1/doc.go @@ -51,7 +51,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210624" +const versionClient = "20210630" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/aiplatform/apiv1/endpoint_client.go b/aiplatform/apiv1/endpoint_client.go index 05df6310148..636c46e522e 100644 --- a/aiplatform/apiv1/endpoint_client.go +++ b/aiplatform/apiv1/endpoint_client.go @@ -56,6 +56,7 @@ func defaultEndpointGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("aiplatform.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://aiplatform.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/aiplatform/apiv1/job_client.go b/aiplatform/apiv1/job_client.go index ae209e9642e..c4fecf637db 100644 --- a/aiplatform/apiv1/job_client.go +++ b/aiplatform/apiv1/job_client.go @@ -69,6 +69,7 @@ func defaultJobGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("aiplatform.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://aiplatform.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/aiplatform/apiv1/migration_client.go b/aiplatform/apiv1/migration_client.go index ad671a95012..447fc83ba47 100644 --- a/aiplatform/apiv1/migration_client.go +++ b/aiplatform/apiv1/migration_client.go @@ -51,6 +51,7 @@ func defaultMigrationGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("aiplatform.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://aiplatform.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/aiplatform/apiv1/model_client.go b/aiplatform/apiv1/model_client.go index 03dda8ed87f..2b52406a393 100644 --- a/aiplatform/apiv1/model_client.go +++ b/aiplatform/apiv1/model_client.go @@ -59,6 +59,7 @@ func defaultModelGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("aiplatform.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://aiplatform.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/aiplatform/apiv1/pipeline_client.go b/aiplatform/apiv1/pipeline_client.go index 08527d61ed3..757da517ef5 100644 --- a/aiplatform/apiv1/pipeline_client.go +++ b/aiplatform/apiv1/pipeline_client.go @@ -54,6 +54,7 @@ func defaultPipelineGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("aiplatform.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://aiplatform.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/aiplatform/apiv1/prediction_client.go b/aiplatform/apiv1/prediction_client.go index 5308483dbc7..2230c25f34e 100644 --- a/aiplatform/apiv1/prediction_client.go +++ b/aiplatform/apiv1/prediction_client.go @@ -45,6 +45,7 @@ func defaultPredictionGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("aiplatform.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://aiplatform.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/aiplatform/apiv1/specialist_pool_client.go b/aiplatform/apiv1/specialist_pool_client.go index 0e6c910fad0..1e43a1f661b 100644 --- a/aiplatform/apiv1/specialist_pool_client.go +++ b/aiplatform/apiv1/specialist_pool_client.go @@ -54,6 +54,7 @@ func defaultSpecialistPoolGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("aiplatform.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://aiplatform.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/analytics/admin/apiv1alpha/analytics_admin_client.go b/analytics/admin/apiv1alpha/analytics_admin_client.go index 8146580822e..66ac56428a2 100644 --- a/analytics/admin/apiv1alpha/analytics_admin_client.go +++ b/analytics/admin/apiv1alpha/analytics_admin_client.go @@ -115,6 +115,7 @@ func defaultAnalyticsAdminGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("analyticsadmin.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://analyticsadmin.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/analytics/admin/apiv1alpha/doc.go b/analytics/admin/apiv1alpha/doc.go index 9325b1374cc..99bd441af93 100644 --- a/analytics/admin/apiv1alpha/doc.go +++ b/analytics/admin/apiv1alpha/doc.go @@ -48,7 +48,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210624" +const versionClient = "20210630" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/analytics/data/apiv1alpha/alpha_analytics_data_client.go b/analytics/data/apiv1alpha/alpha_analytics_data_client.go index 36941b6eb24..af4865312ca 100644 --- a/analytics/data/apiv1alpha/alpha_analytics_data_client.go +++ b/analytics/data/apiv1alpha/alpha_analytics_data_client.go @@ -51,6 +51,7 @@ func defaultAlphaAnalyticsDataGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("analyticsdata.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://analyticsdata.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/analytics/data/apiv1alpha/doc.go b/analytics/data/apiv1alpha/doc.go index 64fe21a0a2b..51e245cecb2 100644 --- a/analytics/data/apiv1alpha/doc.go +++ b/analytics/data/apiv1alpha/doc.go @@ -50,7 +50,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210624" +const versionClient = "20210630" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/apigateway/apiv1/api_gateway_client.go b/apigateway/apiv1/api_gateway_client.go index f77136e9507..e84288806e8 100644 --- a/apigateway/apiv1/api_gateway_client.go +++ b/apigateway/apiv1/api_gateway_client.go @@ -65,6 +65,7 @@ func defaultGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("apigateway.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://apigateway.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/apigateway/apiv1/doc.go b/apigateway/apiv1/doc.go index 84e6b503ee3..4662a1ac1b5 100644 --- a/apigateway/apiv1/doc.go +++ b/apigateway/apiv1/doc.go @@ -46,7 +46,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210624" +const versionClient = "20210630" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/apigeeconnect/apiv1/connection_client.go b/apigeeconnect/apiv1/connection_client.go index bb387f12ac8..479a5ebcf3c 100644 --- a/apigeeconnect/apiv1/connection_client.go +++ b/apigeeconnect/apiv1/connection_client.go @@ -48,6 +48,7 @@ func defaultConnectionGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("apigeeconnect.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://apigeeconnect.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/apigeeconnect/apiv1/doc.go b/apigeeconnect/apiv1/doc.go index 5b437a3a194..d1f218d91fe 100644 --- a/apigeeconnect/apiv1/doc.go +++ b/apigeeconnect/apiv1/doc.go @@ -48,7 +48,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210629" +const versionClient = "20210630" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/apigeeconnect/apiv1/tether_client.go b/apigeeconnect/apiv1/tether_client.go index 374bc70cffb..e6aec6a875a 100644 --- a/apigeeconnect/apiv1/tether_client.go +++ b/apigeeconnect/apiv1/tether_client.go @@ -42,6 +42,7 @@ func defaultTetherGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("apigeeconnect.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://apigeeconnect.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/appengine/apiv1/applications_client.go b/appengine/apiv1/applications_client.go index 73b624338c7..fa9757bd434 100644 --- a/appengine/apiv1/applications_client.go +++ b/appengine/apiv1/applications_client.go @@ -51,6 +51,7 @@ func defaultApplicationsGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("appengine.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://appengine.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/appengine/apiv1/authorized_certificates_client.go b/appengine/apiv1/authorized_certificates_client.go index 341f69752d1..7f70f751d43 100644 --- a/appengine/apiv1/authorized_certificates_client.go +++ b/appengine/apiv1/authorized_certificates_client.go @@ -50,6 +50,7 @@ func defaultAuthorizedCertificatesGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("appengine.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://appengine.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/appengine/apiv1/authorized_domains_client.go b/appengine/apiv1/authorized_domains_client.go index 40d3bc37b4a..970a0b90745 100644 --- a/appengine/apiv1/authorized_domains_client.go +++ b/appengine/apiv1/authorized_domains_client.go @@ -46,6 +46,7 @@ func defaultAuthorizedDomainsGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("appengine.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://appengine.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/appengine/apiv1/doc.go b/appengine/apiv1/doc.go index 73ed39d498f..fc37155009a 100644 --- a/appengine/apiv1/doc.go +++ b/appengine/apiv1/doc.go @@ -48,7 +48,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210624" +const versionClient = "20210630" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/appengine/apiv1/domain_mappings_client.go b/appengine/apiv1/domain_mappings_client.go index f28220e6928..3b6c6b6f83a 100644 --- a/appengine/apiv1/domain_mappings_client.go +++ b/appengine/apiv1/domain_mappings_client.go @@ -54,6 +54,7 @@ func defaultDomainMappingsGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("appengine.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://appengine.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/appengine/apiv1/firewall_client.go b/appengine/apiv1/firewall_client.go index 931f057918a..f31e79829df 100644 --- a/appengine/apiv1/firewall_client.go +++ b/appengine/apiv1/firewall_client.go @@ -51,6 +51,7 @@ func defaultFirewallGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("appengine.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://appengine.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/appengine/apiv1/instances_client.go b/appengine/apiv1/instances_client.go index f4512dd8fe3..9e1cfec8bec 100644 --- a/appengine/apiv1/instances_client.go +++ b/appengine/apiv1/instances_client.go @@ -53,6 +53,7 @@ func defaultInstancesGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("appengine.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://appengine.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/appengine/apiv1/services_client.go b/appengine/apiv1/services_client.go index 4fa5ef0bfce..1f4f79193b9 100644 --- a/appengine/apiv1/services_client.go +++ b/appengine/apiv1/services_client.go @@ -53,6 +53,7 @@ func defaultServicesGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("appengine.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://appengine.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/appengine/apiv1/versions_client.go b/appengine/apiv1/versions_client.go index 81c88c3d359..33cf343a08f 100644 --- a/appengine/apiv1/versions_client.go +++ b/appengine/apiv1/versions_client.go @@ -54,6 +54,7 @@ func defaultVersionsGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("appengine.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://appengine.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/area120/tables/apiv1alpha1/doc.go b/area120/tables/apiv1alpha1/doc.go index 42f4c1ee7ab..8e4a5072d9e 100644 --- a/area120/tables/apiv1alpha1/doc.go +++ b/area120/tables/apiv1alpha1/doc.go @@ -48,7 +48,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210624" +const versionClient = "20210630" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/area120/tables/apiv1alpha1/tables_client.go b/area120/tables/apiv1alpha1/tables_client.go index b5ac43890a8..d165f012a5b 100644 --- a/area120/tables/apiv1alpha1/tables_client.go +++ b/area120/tables/apiv1alpha1/tables_client.go @@ -58,6 +58,7 @@ func defaultGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("area120tables.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://area120tables.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/artifactregistry/apiv1beta2/artifact_registry_client.go b/artifactregistry/apiv1beta2/artifact_registry_client.go index 425e01f9eba..684affc170f 100644 --- a/artifactregistry/apiv1beta2/artifact_registry_client.go +++ b/artifactregistry/apiv1beta2/artifact_registry_client.go @@ -72,6 +72,7 @@ func defaultGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("artifactregistry.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://artifactregistry.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/artifactregistry/apiv1beta2/doc.go b/artifactregistry/apiv1beta2/doc.go index 353bdb59229..0c527b5f917 100644 --- a/artifactregistry/apiv1beta2/doc.go +++ b/artifactregistry/apiv1beta2/doc.go @@ -49,7 +49,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210624" +const versionClient = "20210630" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/asset/apiv1/asset_client.go b/asset/apiv1/asset_client.go index c1005cd63d9..3dae3b1a3ae 100644 --- a/asset/apiv1/asset_client.go +++ b/asset/apiv1/asset_client.go @@ -62,6 +62,7 @@ func defaultGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("cloudasset.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://cloudasset.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/asset/apiv1/doc.go b/asset/apiv1/doc.go index ecf4935fca9..4ad5c306d79 100644 --- a/asset/apiv1/doc.go +++ b/asset/apiv1/doc.go @@ -48,7 +48,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210624" +const versionClient = "20210630" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/asset/apiv1p2beta1/asset_client.go b/asset/apiv1p2beta1/asset_client.go index 2822bcfc935..40417c17638 100644 --- a/asset/apiv1p2beta1/asset_client.go +++ b/asset/apiv1p2beta1/asset_client.go @@ -50,6 +50,7 @@ func defaultGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("cloudasset.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://cloudasset.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/asset/apiv1p2beta1/doc.go b/asset/apiv1p2beta1/doc.go index 071b7424e9e..30cd912a40a 100644 --- a/asset/apiv1p2beta1/doc.go +++ b/asset/apiv1p2beta1/doc.go @@ -50,7 +50,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210624" +const versionClient = "20210630" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/asset/apiv1p5beta1/asset_client.go b/asset/apiv1p5beta1/asset_client.go index f075b1ca1b1..3b08aff4bbc 100644 --- a/asset/apiv1p5beta1/asset_client.go +++ b/asset/apiv1p5beta1/asset_client.go @@ -48,6 +48,7 @@ func defaultGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("cloudasset.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://cloudasset.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/asset/apiv1p5beta1/doc.go b/asset/apiv1p5beta1/doc.go index a820baf58c9..a48287b7d9f 100644 --- a/asset/apiv1p5beta1/doc.go +++ b/asset/apiv1p5beta1/doc.go @@ -50,7 +50,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210624" +const versionClient = "20210630" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/assuredworkloads/apiv1beta1/assured_workloads_client.go b/assuredworkloads/apiv1beta1/assured_workloads_client.go index 3af6175f310..c6cdd18b7b9 100644 --- a/assuredworkloads/apiv1beta1/assured_workloads_client.go +++ b/assuredworkloads/apiv1beta1/assured_workloads_client.go @@ -55,6 +55,7 @@ func defaultGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("assuredworkloads.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://assuredworkloads.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/assuredworkloads/apiv1beta1/doc.go b/assuredworkloads/apiv1beta1/doc.go index 0a41bd280b2..b60af3decbb 100644 --- a/assuredworkloads/apiv1beta1/doc.go +++ b/assuredworkloads/apiv1beta1/doc.go @@ -48,7 +48,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210624" +const versionClient = "20210630" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/automl/apiv1/auto_ml_client.go b/automl/apiv1/auto_ml_client.go index 30e4cadafa2..c1cf25f4abe 100644 --- a/automl/apiv1/auto_ml_client.go +++ b/automl/apiv1/auto_ml_client.go @@ -68,6 +68,7 @@ func defaultGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("automl.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://automl.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/automl/apiv1/doc.go b/automl/apiv1/doc.go index cb7251363a3..108dd72b6cf 100644 --- a/automl/apiv1/doc.go +++ b/automl/apiv1/doc.go @@ -49,7 +49,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210624" +const versionClient = "20210630" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/automl/apiv1/prediction_client.go b/automl/apiv1/prediction_client.go index 8402aaa72fb..c11ee2a0cb2 100644 --- a/automl/apiv1/prediction_client.go +++ b/automl/apiv1/prediction_client.go @@ -49,6 +49,7 @@ func defaultPredictionGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("automl.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://automl.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/automl/apiv1beta1/auto_ml_client.go b/automl/apiv1beta1/auto_ml_client.go index cb8b9e07609..47e36dfc3f1 100644 --- a/automl/apiv1beta1/auto_ml_client.go +++ b/automl/apiv1beta1/auto_ml_client.go @@ -74,6 +74,7 @@ func defaultGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("automl.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://automl.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/automl/apiv1beta1/doc.go b/automl/apiv1beta1/doc.go index bf0e3ddba40..eecc7286463 100644 --- a/automl/apiv1beta1/doc.go +++ b/automl/apiv1beta1/doc.go @@ -51,7 +51,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210624" +const versionClient = "20210630" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/automl/apiv1beta1/prediction_client.go b/automl/apiv1beta1/prediction_client.go index c145b55204e..69d982c8246 100644 --- a/automl/apiv1beta1/prediction_client.go +++ b/automl/apiv1beta1/prediction_client.go @@ -49,6 +49,7 @@ func defaultPredictionGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("automl.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://automl.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/bigquery/connection/apiv1/connection_client.go b/bigquery/connection/apiv1/connection_client.go index d345b06ed40..3f2f69330f7 100644 --- a/bigquery/connection/apiv1/connection_client.go +++ b/bigquery/connection/apiv1/connection_client.go @@ -56,6 +56,7 @@ func defaultGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("bigqueryconnection.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://bigqueryconnection.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/bigquery/connection/apiv1/doc.go b/bigquery/connection/apiv1/doc.go index 5a23ce1087f..bf98d3aa7ea 100644 --- a/bigquery/connection/apiv1/doc.go +++ b/bigquery/connection/apiv1/doc.go @@ -48,7 +48,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210624" +const versionClient = "20210630" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/bigquery/connection/apiv1beta1/connection_client.go b/bigquery/connection/apiv1beta1/connection_client.go index 61f9881a4bd..dfa7fad606a 100644 --- a/bigquery/connection/apiv1beta1/connection_client.go +++ b/bigquery/connection/apiv1beta1/connection_client.go @@ -55,6 +55,7 @@ func defaultGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("bigqueryconnection.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://bigqueryconnection.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/bigquery/connection/apiv1beta1/doc.go b/bigquery/connection/apiv1beta1/doc.go index 8689f326f64..b4388c5c343 100644 --- a/bigquery/connection/apiv1beta1/doc.go +++ b/bigquery/connection/apiv1beta1/doc.go @@ -50,7 +50,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210624" +const versionClient = "20210630" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/bigquery/datatransfer/apiv1/data_transfer_client.go b/bigquery/datatransfer/apiv1/data_transfer_client.go index 352edbdcbd9..43ad4d4f6af 100644 --- a/bigquery/datatransfer/apiv1/data_transfer_client.go +++ b/bigquery/datatransfer/apiv1/data_transfer_client.go @@ -61,6 +61,7 @@ func defaultGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("bigquerydatatransfer.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://bigquerydatatransfer.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/bigquery/datatransfer/apiv1/doc.go b/bigquery/datatransfer/apiv1/doc.go index f3377268f1d..750648a95cc 100644 --- a/bigquery/datatransfer/apiv1/doc.go +++ b/bigquery/datatransfer/apiv1/doc.go @@ -49,7 +49,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210624" +const versionClient = "20210630" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/bigquery/go.mod b/bigquery/go.mod index 48b9e8098bb..42a6f09a84c 100644 --- a/bigquery/go.mod +++ b/bigquery/go.mod @@ -9,8 +9,8 @@ require ( github.com/google/go-cmp v0.5.6 github.com/googleapis/gax-go/v2 v2.0.5 golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 - google.golang.org/api v0.49.0 - google.golang.org/genproto v0.0.0-20210629200056-84d6f6074151 + google.golang.org/api v0.50.0 + google.golang.org/genproto v0.0.0-20210630183607-d20f26d13c79 google.golang.org/grpc v1.38.0 google.golang.org/protobuf v1.27.1 ) diff --git a/bigquery/go.sum b/bigquery/go.sum index 96aa2e4a6bc..fca947c8025 100644 --- a/bigquery/go.sum +++ b/bigquery/go.sum @@ -253,8 +253,8 @@ golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ golang.org/x/oauth2 v0.0.0-20210220000619-9bb904979d93/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210313182246-cd4f82c27b84/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210615190721-d04028783cf1 h1:x622Z2o4hgCr/4CiKWc51jHVKaWdtVpBNmEI8wI9Qns= -golang.org/x/oauth2 v0.0.0-20210615190721-d04028783cf1/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210628180205-a41e5a781914 h1:3B43BWw0xEBsLZ/NO1VALz6fppU3481pik+2Ksv45z8= +golang.org/x/oauth2 v0.0.0-20210628180205-a41e5a781914/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -400,8 +400,8 @@ google.golang.org/api v0.41.0/go.mod h1:RkxM5lITDfTzmyKFPt+wGrCJbVfniCr2ool8kTBz google.golang.org/api v0.43.0/go.mod h1:nQsDGjRXMo4lvh5hP0TKqF244gqhGcr/YSIykhUk/94= google.golang.org/api v0.47.0/go.mod h1:Wbvgpq1HddcWVtzsVLyfLp8lDg6AA241LmgIL59tHXo= google.golang.org/api v0.48.0/go.mod h1:71Pr1vy+TAZRPkPs/xlCf5SsU8WjuAWv1Pfjbtukyy4= -google.golang.org/api v0.49.0 h1:gjIBDxlTG7vnzMmEnYwTnvLTF8Rjzo+ETCgEX1YZ/fY= -google.golang.org/api v0.49.0/go.mod h1:BECiH72wsfwUvOVn3+btPD5WHi0LzavZReBndi42L18= +google.golang.org/api v0.50.0 h1:LX7NFCFYOHzr7WHaYiRUpeipZe9o5L8T+2F4Z798VDw= +google.golang.org/api v0.50.0/go.mod h1:4bNT5pAuq5ji4SRZm+5QIkjny9JAyVD/3gaSihNefaw= 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.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= @@ -453,9 +453,9 @@ google.golang.org/genproto v0.0.0-20210513213006-bf773b8c8384/go.mod h1:P3QM42oQ google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= google.golang.org/genproto v0.0.0-20210604141403-392c879c8b08/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= google.golang.org/genproto v0.0.0-20210608205507-b6d2f5bf0d7d/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= -google.golang.org/genproto v0.0.0-20210617175327-b9e0b3197ced/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24= -google.golang.org/genproto v0.0.0-20210629200056-84d6f6074151 h1:H/uPzsolsGjhl3CVT6Wb7bK+mf+hmkEvUVu+FBKyNlc= -google.golang.org/genproto v0.0.0-20210629200056-84d6f6074151/go.mod h1:yiaVoXHpRzHGyxV3o4DktVWY4mSUErTKaeEOq6C3t3U= +google.golang.org/genproto v0.0.0-20210624195500-8bfb893ecb84/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24= +google.golang.org/genproto v0.0.0-20210630183607-d20f26d13c79 h1:s1jFTXJryg4a1mew7xv03VZD8N9XjxFhk1o4Js4WvPQ= +google.golang.org/genproto v0.0.0-20210630183607-d20f26d13c79/go.mod h1:yiaVoXHpRzHGyxV3o4DktVWY4mSUErTKaeEOq6C3t3U= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= diff --git a/bigquery/reservation/apiv1/doc.go b/bigquery/reservation/apiv1/doc.go index 7b5da64b285..82c6a2d0b3c 100644 --- a/bigquery/reservation/apiv1/doc.go +++ b/bigquery/reservation/apiv1/doc.go @@ -48,7 +48,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210624" +const versionClient = "20210630" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/bigquery/reservation/apiv1/reservation_client.go b/bigquery/reservation/apiv1/reservation_client.go index ee600def6b6..9e8a419ff2b 100644 --- a/bigquery/reservation/apiv1/reservation_client.go +++ b/bigquery/reservation/apiv1/reservation_client.go @@ -66,6 +66,7 @@ func defaultGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("bigqueryreservation.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://bigqueryreservation.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/bigquery/reservation/apiv1beta1/doc.go b/bigquery/reservation/apiv1beta1/doc.go index c994cb989a0..96ce44a977e 100644 --- a/bigquery/reservation/apiv1beta1/doc.go +++ b/bigquery/reservation/apiv1beta1/doc.go @@ -50,7 +50,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210624" +const versionClient = "20210630" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/bigquery/reservation/apiv1beta1/reservation_client.go b/bigquery/reservation/apiv1beta1/reservation_client.go index 548db39e8a0..dfc99636407 100644 --- a/bigquery/reservation/apiv1beta1/reservation_client.go +++ b/bigquery/reservation/apiv1beta1/reservation_client.go @@ -66,6 +66,7 @@ func defaultGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("bigqueryreservation.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://bigqueryreservation.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/bigquery/storage/apiv1/big_query_read_client.go b/bigquery/storage/apiv1/big_query_read_client.go index 215191faa89..30d7cdc5146 100644 --- a/bigquery/storage/apiv1/big_query_read_client.go +++ b/bigquery/storage/apiv1/big_query_read_client.go @@ -48,6 +48,7 @@ func defaultBigQueryReadGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("bigquerystorage.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://bigquerystorage.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/bigquery/storage/apiv1/doc.go b/bigquery/storage/apiv1/doc.go index 8137ce3e85f..02df1ac6f65 100644 --- a/bigquery/storage/apiv1/doc.go +++ b/bigquery/storage/apiv1/doc.go @@ -46,7 +46,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210624" +const versionClient = "20210630" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/bigquery/storage/apiv1beta1/big_query_storage_client.go b/bigquery/storage/apiv1beta1/big_query_storage_client.go index 3f6a87fe766..a43b98eeca3 100644 --- a/bigquery/storage/apiv1beta1/big_query_storage_client.go +++ b/bigquery/storage/apiv1beta1/big_query_storage_client.go @@ -50,6 +50,7 @@ func defaultBigQueryStorageGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("bigquerystorage.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://bigquerystorage.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/bigquery/storage/apiv1beta1/doc.go b/bigquery/storage/apiv1beta1/doc.go index eff5d0a4023..ab478691d4a 100644 --- a/bigquery/storage/apiv1beta1/doc.go +++ b/bigquery/storage/apiv1beta1/doc.go @@ -48,7 +48,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210624" +const versionClient = "20210630" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/bigquery/storage/apiv1beta2/big_query_read_client.go b/bigquery/storage/apiv1beta2/big_query_read_client.go index fd3d79d2389..46324315221 100644 --- a/bigquery/storage/apiv1beta2/big_query_read_client.go +++ b/bigquery/storage/apiv1beta2/big_query_read_client.go @@ -48,6 +48,7 @@ func defaultBigQueryReadGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("bigquerystorage.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://bigquerystorage.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/bigquery/storage/apiv1beta2/big_query_write_client.go b/bigquery/storage/apiv1beta2/big_query_write_client.go index 74ceab7123b..659031bb4a3 100644 --- a/bigquery/storage/apiv1beta2/big_query_write_client.go +++ b/bigquery/storage/apiv1beta2/big_query_write_client.go @@ -51,6 +51,7 @@ func defaultBigQueryWriteGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("bigquerystorage.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://bigquerystorage.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/bigquery/storage/apiv1beta2/doc.go b/bigquery/storage/apiv1beta2/doc.go index c84226ca0dc..8f795615d12 100644 --- a/bigquery/storage/apiv1beta2/doc.go +++ b/bigquery/storage/apiv1beta2/doc.go @@ -48,7 +48,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210624" +const versionClient = "20210630" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/bigtable/go.mod b/bigtable/go.mod index bdb3ed4432d..a8eaf5a94a1 100644 --- a/bigtable/go.mod +++ b/bigtable/go.mod @@ -10,8 +10,8 @@ require ( github.com/googleapis/gax-go/v2 v2.0.5 golang.org/x/oauth2 v0.0.0-20210628180205-a41e5a781914 golang.org/x/sys v0.0.0-20210616094352-59db8d763f22 - google.golang.org/api v0.49.0 - google.golang.org/genproto v0.0.0-20210629200056-84d6f6074151 + google.golang.org/api v0.50.0 + google.golang.org/genproto v0.0.0-20210630183607-d20f26d13c79 google.golang.org/grpc v1.38.0 google.golang.org/protobuf v1.27.1 rsc.io/binaryregexp v0.2.0 diff --git a/bigtable/go.sum b/bigtable/go.sum index 44672e22553..d9e76a2b746 100644 --- a/bigtable/go.sum +++ b/bigtable/go.sum @@ -251,7 +251,6 @@ golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ golang.org/x/oauth2 v0.0.0-20210220000619-9bb904979d93/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210313182246-cd4f82c27b84/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210615190721-d04028783cf1/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210628180205-a41e5a781914 h1:3B43BWw0xEBsLZ/NO1VALz6fppU3481pik+2Ksv45z8= golang.org/x/oauth2 v0.0.0-20210628180205-a41e5a781914/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -399,8 +398,8 @@ google.golang.org/api v0.41.0/go.mod h1:RkxM5lITDfTzmyKFPt+wGrCJbVfniCr2ool8kTBz google.golang.org/api v0.43.0/go.mod h1:nQsDGjRXMo4lvh5hP0TKqF244gqhGcr/YSIykhUk/94= google.golang.org/api v0.47.0/go.mod h1:Wbvgpq1HddcWVtzsVLyfLp8lDg6AA241LmgIL59tHXo= google.golang.org/api v0.48.0/go.mod h1:71Pr1vy+TAZRPkPs/xlCf5SsU8WjuAWv1Pfjbtukyy4= -google.golang.org/api v0.49.0 h1:gjIBDxlTG7vnzMmEnYwTnvLTF8Rjzo+ETCgEX1YZ/fY= -google.golang.org/api v0.49.0/go.mod h1:BECiH72wsfwUvOVn3+btPD5WHi0LzavZReBndi42L18= +google.golang.org/api v0.50.0 h1:LX7NFCFYOHzr7WHaYiRUpeipZe9o5L8T+2F4Z798VDw= +google.golang.org/api v0.50.0/go.mod h1:4bNT5pAuq5ji4SRZm+5QIkjny9JAyVD/3gaSihNefaw= 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.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= @@ -452,9 +451,9 @@ google.golang.org/genproto v0.0.0-20210513213006-bf773b8c8384/go.mod h1:P3QM42oQ google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= google.golang.org/genproto v0.0.0-20210604141403-392c879c8b08/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= google.golang.org/genproto v0.0.0-20210608205507-b6d2f5bf0d7d/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= -google.golang.org/genproto v0.0.0-20210617175327-b9e0b3197ced/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24= -google.golang.org/genproto v0.0.0-20210629200056-84d6f6074151 h1:H/uPzsolsGjhl3CVT6Wb7bK+mf+hmkEvUVu+FBKyNlc= -google.golang.org/genproto v0.0.0-20210629200056-84d6f6074151/go.mod h1:yiaVoXHpRzHGyxV3o4DktVWY4mSUErTKaeEOq6C3t3U= +google.golang.org/genproto v0.0.0-20210624195500-8bfb893ecb84/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24= +google.golang.org/genproto v0.0.0-20210630183607-d20f26d13c79 h1:s1jFTXJryg4a1mew7xv03VZD8N9XjxFhk1o4Js4WvPQ= +google.golang.org/genproto v0.0.0-20210630183607-d20f26d13c79/go.mod h1:yiaVoXHpRzHGyxV3o4DktVWY4mSUErTKaeEOq6C3t3U= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= diff --git a/billing/apiv1/cloud_billing_client.go b/billing/apiv1/cloud_billing_client.go index 2d2fe53936d..bc013828f46 100644 --- a/billing/apiv1/cloud_billing_client.go +++ b/billing/apiv1/cloud_billing_client.go @@ -58,6 +58,7 @@ func defaultCloudBillingGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("cloudbilling.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://cloudbilling.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/billing/apiv1/cloud_catalog_client.go b/billing/apiv1/cloud_catalog_client.go index b262b8f5735..302e5881473 100644 --- a/billing/apiv1/cloud_catalog_client.go +++ b/billing/apiv1/cloud_catalog_client.go @@ -47,6 +47,7 @@ func defaultCloudCatalogGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("cloudbilling.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://cloudbilling.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/billing/apiv1/doc.go b/billing/apiv1/doc.go index 982c7dbabc2..fccd6324bae 100644 --- a/billing/apiv1/doc.go +++ b/billing/apiv1/doc.go @@ -49,7 +49,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210624" +const versionClient = "20210630" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/billing/budgets/apiv1/budget_client.go b/billing/budgets/apiv1/budget_client.go index e98a11e9eac..3def9224369 100644 --- a/billing/budgets/apiv1/budget_client.go +++ b/billing/budgets/apiv1/budget_client.go @@ -52,6 +52,7 @@ func defaultBudgetGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("billingbudgets.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://billingbudgets.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/billing/budgets/apiv1/doc.go b/billing/budgets/apiv1/doc.go index 67718c838ba..bc4554fe66c 100644 --- a/billing/budgets/apiv1/doc.go +++ b/billing/budgets/apiv1/doc.go @@ -50,7 +50,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210624" +const versionClient = "20210630" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/billing/budgets/apiv1beta1/budget_client.go b/billing/budgets/apiv1beta1/budget_client.go index 65a7cbb86ec..fc0901098bd 100644 --- a/billing/budgets/apiv1beta1/budget_client.go +++ b/billing/budgets/apiv1beta1/budget_client.go @@ -52,6 +52,7 @@ func defaultBudgetGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("billingbudgets.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://billingbudgets.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/billing/budgets/apiv1beta1/doc.go b/billing/budgets/apiv1beta1/doc.go index 7a578a17eb0..fbe74d4920c 100644 --- a/billing/budgets/apiv1beta1/doc.go +++ b/billing/budgets/apiv1beta1/doc.go @@ -52,7 +52,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210624" +const versionClient = "20210630" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/binaryauthorization/apiv1beta1/binauthz_management_service_v1_beta1_client.go b/binaryauthorization/apiv1beta1/binauthz_management_service_v1_beta1_client.go index ad959919841..d5461764464 100644 --- a/binaryauthorization/apiv1beta1/binauthz_management_service_v1_beta1_client.go +++ b/binaryauthorization/apiv1beta1/binauthz_management_service_v1_beta1_client.go @@ -54,6 +54,7 @@ func defaultBinauthzManagementServiceV1Beta1GRPCClientOptions() []option.ClientO internaloption.WithDefaultMTLSEndpoint("binaryauthorization.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://binaryauthorization.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/binaryauthorization/apiv1beta1/doc.go b/binaryauthorization/apiv1beta1/doc.go index 9b909abfec3..7dc21d77ace 100644 --- a/binaryauthorization/apiv1beta1/doc.go +++ b/binaryauthorization/apiv1beta1/doc.go @@ -51,7 +51,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210624" +const versionClient = "20210630" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/channel/apiv1/cloud_channel_client.go b/channel/apiv1/cloud_channel_client.go index ad45dc9f2d8..c42f798684c 100644 --- a/channel/apiv1/cloud_channel_client.go +++ b/channel/apiv1/cloud_channel_client.go @@ -84,6 +84,7 @@ func defaultCloudChannelGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("cloudchannel.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://cloudchannel.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/channel/apiv1/doc.go b/channel/apiv1/doc.go index e5be880ab39..2ea403dc0fa 100644 --- a/channel/apiv1/doc.go +++ b/channel/apiv1/doc.go @@ -46,7 +46,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210624" +const versionClient = "20210630" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/cloudbuild/apiv1/v2/cloud_build_client.go b/cloudbuild/apiv1/v2/cloud_build_client.go index 1ca6670a012..9cbf64437f1 100644 --- a/cloudbuild/apiv1/v2/cloud_build_client.go +++ b/cloudbuild/apiv1/v2/cloud_build_client.go @@ -67,6 +67,7 @@ func defaultGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("cloudbuild.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://cloudbuild.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/cloudbuild/apiv1/v2/doc.go b/cloudbuild/apiv1/v2/doc.go index 95c1596f973..80e595707a5 100644 --- a/cloudbuild/apiv1/v2/doc.go +++ b/cloudbuild/apiv1/v2/doc.go @@ -48,7 +48,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210629" +const versionClient = "20210630" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/clouddms/apiv1/data_migration_client.go b/clouddms/apiv1/data_migration_client.go index ea8ee366eb5..c8bb77072c1 100644 --- a/clouddms/apiv1/data_migration_client.go +++ b/clouddms/apiv1/data_migration_client.go @@ -66,6 +66,7 @@ func defaultDataMigrationGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("datamigration.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://datamigration.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/clouddms/apiv1/doc.go b/clouddms/apiv1/doc.go index e1caa5859a1..49978276c81 100644 --- a/clouddms/apiv1/doc.go +++ b/clouddms/apiv1/doc.go @@ -20,8 +20,6 @@ // Manage Cloud Database Migration Service resources on Google Cloud // Platform. // -// NOTE: This package is in beta. It is not stable, and may be subject to changes. -// // Use of Context // // The ctx passed to NewClient is used for authentication requests and @@ -51,7 +49,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210624" +const versionClient = "20210630" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/cloudtasks/apiv2/cloud_tasks_client.go b/cloudtasks/apiv2/cloud_tasks_client.go index ddba0312eb8..62eac06b08e 100644 --- a/cloudtasks/apiv2/cloud_tasks_client.go +++ b/cloudtasks/apiv2/cloud_tasks_client.go @@ -64,6 +64,7 @@ func defaultGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("cloudtasks.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://cloudtasks.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/cloudtasks/apiv2/doc.go b/cloudtasks/apiv2/doc.go index 0629315db3c..79dbb36ceb5 100644 --- a/cloudtasks/apiv2/doc.go +++ b/cloudtasks/apiv2/doc.go @@ -48,7 +48,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210624" +const versionClient = "20210630" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/cloudtasks/apiv2beta2/cloud_tasks_client.go b/cloudtasks/apiv2beta2/cloud_tasks_client.go index eb77d9e83ca..a07f21d6395 100644 --- a/cloudtasks/apiv2beta2/cloud_tasks_client.go +++ b/cloudtasks/apiv2beta2/cloud_tasks_client.go @@ -68,6 +68,7 @@ func defaultGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("cloudtasks.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://cloudtasks.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/cloudtasks/apiv2beta2/doc.go b/cloudtasks/apiv2beta2/doc.go index b87521ebac0..1271a8e3ba4 100644 --- a/cloudtasks/apiv2beta2/doc.go +++ b/cloudtasks/apiv2beta2/doc.go @@ -50,7 +50,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210624" +const versionClient = "20210630" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/cloudtasks/apiv2beta3/cloud_tasks_client.go b/cloudtasks/apiv2beta3/cloud_tasks_client.go index 25d19947ca0..95e97209664 100644 --- a/cloudtasks/apiv2beta3/cloud_tasks_client.go +++ b/cloudtasks/apiv2beta3/cloud_tasks_client.go @@ -64,6 +64,7 @@ func defaultGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("cloudtasks.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://cloudtasks.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/cloudtasks/apiv2beta3/doc.go b/cloudtasks/apiv2beta3/doc.go index e782b175247..2b44d88b1ae 100644 --- a/cloudtasks/apiv2beta3/doc.go +++ b/cloudtasks/apiv2beta3/doc.go @@ -50,7 +50,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210624" +const versionClient = "20210630" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/container/apiv1/cluster_manager_client.go b/container/apiv1/cluster_manager_client.go index eb8b77248aa..c922b2eb4d5 100644 --- a/container/apiv1/cluster_manager_client.go +++ b/container/apiv1/cluster_manager_client.go @@ -79,6 +79,7 @@ func defaultClusterManagerGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("container.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://container.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/container/apiv1/doc.go b/container/apiv1/doc.go index 34c204eb39f..f7566c5e524 100644 --- a/container/apiv1/doc.go +++ b/container/apiv1/doc.go @@ -49,7 +49,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210624" +const versionClient = "20210630" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/containeranalysis/apiv1beta1/container_analysis_v1_beta1_client.go b/containeranalysis/apiv1beta1/container_analysis_v1_beta1_client.go index fc81bf43fb5..341abafb6c1 100644 --- a/containeranalysis/apiv1beta1/container_analysis_v1_beta1_client.go +++ b/containeranalysis/apiv1beta1/container_analysis_v1_beta1_client.go @@ -54,6 +54,7 @@ func defaultContainerAnalysisV1Beta1GRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("containeranalysis.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://containeranalysis.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/containeranalysis/apiv1beta1/doc.go b/containeranalysis/apiv1beta1/doc.go index 5948917e79e..05c5104f245 100644 --- a/containeranalysis/apiv1beta1/doc.go +++ b/containeranalysis/apiv1beta1/doc.go @@ -51,7 +51,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210624" +const versionClient = "20210630" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/containeranalysis/apiv1beta1/grafeas_v1_beta1_client.go b/containeranalysis/apiv1beta1/grafeas_v1_beta1_client.go index 483a2c26235..6ba9a5b0a68 100644 --- a/containeranalysis/apiv1beta1/grafeas_v1_beta1_client.go +++ b/containeranalysis/apiv1beta1/grafeas_v1_beta1_client.go @@ -62,6 +62,7 @@ func defaultGrafeasV1Beta1GRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("containeranalysis.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://containeranalysis.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/datacatalog/apiv1/data_catalog_client.go b/datacatalog/apiv1/data_catalog_client.go index fbc68db5f61..567e84f10fa 100644 --- a/datacatalog/apiv1/data_catalog_client.go +++ b/datacatalog/apiv1/data_catalog_client.go @@ -76,6 +76,7 @@ func defaultGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("datacatalog.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://datacatalog.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/datacatalog/apiv1/doc.go b/datacatalog/apiv1/doc.go index 8e11b57656c..d0c0e0ed78e 100644 --- a/datacatalog/apiv1/doc.go +++ b/datacatalog/apiv1/doc.go @@ -49,7 +49,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210624" +const versionClient = "20210630" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/datacatalog/apiv1/policy_tag_manager_client.go b/datacatalog/apiv1/policy_tag_manager_client.go index ebc7691c9dd..09e41c757c5 100644 --- a/datacatalog/apiv1/policy_tag_manager_client.go +++ b/datacatalog/apiv1/policy_tag_manager_client.go @@ -60,6 +60,7 @@ func defaultPolicyTagManagerGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("datacatalog.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://datacatalog.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/datacatalog/apiv1/policy_tag_manager_serialization_client.go b/datacatalog/apiv1/policy_tag_manager_serialization_client.go index b863c393c17..cea7c6579c5 100644 --- a/datacatalog/apiv1/policy_tag_manager_serialization_client.go +++ b/datacatalog/apiv1/policy_tag_manager_serialization_client.go @@ -46,6 +46,7 @@ func defaultPolicyTagManagerSerializationGRPCClientOptions() []option.ClientOpti internaloption.WithDefaultMTLSEndpoint("datacatalog.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://datacatalog.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/datacatalog/apiv1beta1/data_catalog_client.go b/datacatalog/apiv1beta1/data_catalog_client.go index 539ecfec043..e3d6a16f448 100644 --- a/datacatalog/apiv1beta1/data_catalog_client.go +++ b/datacatalog/apiv1beta1/data_catalog_client.go @@ -75,6 +75,7 @@ func defaultGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("datacatalog.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://datacatalog.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/datacatalog/apiv1beta1/doc.go b/datacatalog/apiv1beta1/doc.go index 8cec8c617c4..8bfccbc4b5d 100644 --- a/datacatalog/apiv1beta1/doc.go +++ b/datacatalog/apiv1beta1/doc.go @@ -51,7 +51,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210624" +const versionClient = "20210630" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/datacatalog/apiv1beta1/policy_tag_manager_client.go b/datacatalog/apiv1beta1/policy_tag_manager_client.go index 4b3eb72a48d..9028e6e7776 100644 --- a/datacatalog/apiv1beta1/policy_tag_manager_client.go +++ b/datacatalog/apiv1beta1/policy_tag_manager_client.go @@ -59,6 +59,7 @@ func defaultPolicyTagManagerGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("datacatalog.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://datacatalog.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/datacatalog/apiv1beta1/policy_tag_manager_serialization_client.go b/datacatalog/apiv1beta1/policy_tag_manager_serialization_client.go index aea423fce33..46723d2ba02 100644 --- a/datacatalog/apiv1beta1/policy_tag_manager_serialization_client.go +++ b/datacatalog/apiv1beta1/policy_tag_manager_serialization_client.go @@ -45,6 +45,7 @@ func defaultPolicyTagManagerSerializationGRPCClientOptions() []option.ClientOpti internaloption.WithDefaultMTLSEndpoint("datacatalog.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://datacatalog.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/datalabeling/apiv1beta1/data_labeling_client.go b/datalabeling/apiv1beta1/data_labeling_client.go index 76a49b2be03..61a191faaaf 100644 --- a/datalabeling/apiv1beta1/data_labeling_client.go +++ b/datalabeling/apiv1beta1/data_labeling_client.go @@ -84,6 +84,7 @@ func defaultGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("datalabeling.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://datalabeling.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/datalabeling/apiv1beta1/doc.go b/datalabeling/apiv1beta1/doc.go index 52dabea2efd..7712dc3e77a 100644 --- a/datalabeling/apiv1beta1/doc.go +++ b/datalabeling/apiv1beta1/doc.go @@ -50,7 +50,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210624" +const versionClient = "20210630" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/dataproc/apiv1/autoscaling_policy_client.go b/dataproc/apiv1/autoscaling_policy_client.go index 8c0c5c82033..a94c109486a 100644 --- a/dataproc/apiv1/autoscaling_policy_client.go +++ b/dataproc/apiv1/autoscaling_policy_client.go @@ -52,6 +52,7 @@ func defaultAutoscalingPolicyGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("dataproc.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://dataproc.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/dataproc/apiv1/cluster_controller_client.go b/dataproc/apiv1/cluster_controller_client.go index 64198e225c1..d56b657af72 100644 --- a/dataproc/apiv1/cluster_controller_client.go +++ b/dataproc/apiv1/cluster_controller_client.go @@ -58,6 +58,7 @@ func defaultClusterControllerGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("dataproc.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://dataproc.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/dataproc/apiv1/doc.go b/dataproc/apiv1/doc.go index 5219788372d..22f8479d6d1 100644 --- a/dataproc/apiv1/doc.go +++ b/dataproc/apiv1/doc.go @@ -48,7 +48,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210624" +const versionClient = "20210630" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/dataproc/apiv1/job_controller_client.go b/dataproc/apiv1/job_controller_client.go index ea4ddc30393..55f7e6f68e5 100644 --- a/dataproc/apiv1/job_controller_client.go +++ b/dataproc/apiv1/job_controller_client.go @@ -57,6 +57,7 @@ func defaultJobControllerGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("dataproc.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://dataproc.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/dataproc/apiv1/workflow_template_client.go b/dataproc/apiv1/workflow_template_client.go index 7a542d0311a..20b85241a68 100644 --- a/dataproc/apiv1/workflow_template_client.go +++ b/dataproc/apiv1/workflow_template_client.go @@ -57,6 +57,7 @@ func defaultWorkflowTemplateGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("dataproc.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://dataproc.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/dataproc/apiv1beta2/autoscaling_policy_client.go b/dataproc/apiv1beta2/autoscaling_policy_client.go index 4694494ce22..13232d64c49 100644 --- a/dataproc/apiv1beta2/autoscaling_policy_client.go +++ b/dataproc/apiv1beta2/autoscaling_policy_client.go @@ -52,6 +52,7 @@ func defaultAutoscalingPolicyGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("dataproc.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://dataproc.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/dataproc/apiv1beta2/cluster_controller_client.go b/dataproc/apiv1beta2/cluster_controller_client.go index 40d74b6bcaf..f7847cbff80 100644 --- a/dataproc/apiv1beta2/cluster_controller_client.go +++ b/dataproc/apiv1beta2/cluster_controller_client.go @@ -56,6 +56,7 @@ func defaultClusterControllerGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("dataproc.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://dataproc.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/dataproc/apiv1beta2/doc.go b/dataproc/apiv1beta2/doc.go index be2ba6dcd11..659062ed7be 100644 --- a/dataproc/apiv1beta2/doc.go +++ b/dataproc/apiv1beta2/doc.go @@ -50,7 +50,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210624" +const versionClient = "20210630" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/dataproc/apiv1beta2/job_controller_client.go b/dataproc/apiv1beta2/job_controller_client.go index 70a9e09c0d4..4910000d2b1 100644 --- a/dataproc/apiv1beta2/job_controller_client.go +++ b/dataproc/apiv1beta2/job_controller_client.go @@ -57,6 +57,7 @@ func defaultJobControllerGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("dataproc.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://dataproc.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/dataproc/apiv1beta2/workflow_template_client.go b/dataproc/apiv1beta2/workflow_template_client.go index a2ae274917c..620f9441a5d 100644 --- a/dataproc/apiv1beta2/workflow_template_client.go +++ b/dataproc/apiv1beta2/workflow_template_client.go @@ -57,6 +57,7 @@ func defaultWorkflowTemplateGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("dataproc.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://dataproc.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/dataqna/apiv1alpha/auto_suggestion_client.go b/dataqna/apiv1alpha/auto_suggestion_client.go index 0ca05d234dc..783980ac9fd 100644 --- a/dataqna/apiv1alpha/auto_suggestion_client.go +++ b/dataqna/apiv1alpha/auto_suggestion_client.go @@ -45,6 +45,7 @@ func defaultAutoSuggestionGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("dataqna.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://dataqna.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/dataqna/apiv1alpha/doc.go b/dataqna/apiv1alpha/doc.go index fdf5a72013d..c9bbb72d570 100644 --- a/dataqna/apiv1alpha/doc.go +++ b/dataqna/apiv1alpha/doc.go @@ -51,7 +51,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210624" +const versionClient = "20210630" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/dataqna/apiv1alpha/question_client.go b/dataqna/apiv1alpha/question_client.go index 198a6334fd4..7958afba6fe 100644 --- a/dataqna/apiv1alpha/question_client.go +++ b/dataqna/apiv1alpha/question_client.go @@ -50,6 +50,7 @@ func defaultQuestionGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("dataqna.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://dataqna.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/datastore/admin/apiv1/datastore_admin_client.go b/datastore/admin/apiv1/datastore_admin_client.go index 7a58fc84f5f..a2225bf5a6d 100644 --- a/datastore/admin/apiv1/datastore_admin_client.go +++ b/datastore/admin/apiv1/datastore_admin_client.go @@ -56,6 +56,7 @@ func defaultDatastoreAdminGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("datastore.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://datastore.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/datastore/admin/apiv1/doc.go b/datastore/admin/apiv1/doc.go index 9148bebfbc1..6e5c06d8371 100644 --- a/datastore/admin/apiv1/doc.go +++ b/datastore/admin/apiv1/doc.go @@ -51,7 +51,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210624" +const versionClient = "20210630" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/datastore/go.mod b/datastore/go.mod index 2f5b2532544..74bd1b78895 100644 --- a/datastore/go.mod +++ b/datastore/go.mod @@ -7,8 +7,8 @@ require ( github.com/golang/protobuf v1.5.2 github.com/google/go-cmp v0.5.6 github.com/googleapis/gax-go/v2 v2.0.5 - google.golang.org/api v0.49.0 - google.golang.org/genproto v0.0.0-20210629200056-84d6f6074151 + google.golang.org/api v0.50.0 + google.golang.org/genproto v0.0.0-20210630183607-d20f26d13c79 google.golang.org/grpc v1.38.0 google.golang.org/protobuf v1.27.1 ) diff --git a/datastore/go.sum b/datastore/go.sum index 8b897debcbf..9e44f7fc0b6 100644 --- a/datastore/go.sum +++ b/datastore/go.sum @@ -249,8 +249,8 @@ golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ golang.org/x/oauth2 v0.0.0-20210220000619-9bb904979d93/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210313182246-cd4f82c27b84/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210615190721-d04028783cf1 h1:x622Z2o4hgCr/4CiKWc51jHVKaWdtVpBNmEI8wI9Qns= -golang.org/x/oauth2 v0.0.0-20210615190721-d04028783cf1/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210628180205-a41e5a781914 h1:3B43BWw0xEBsLZ/NO1VALz6fppU3481pik+2Ksv45z8= +golang.org/x/oauth2 v0.0.0-20210628180205-a41e5a781914/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -396,8 +396,8 @@ google.golang.org/api v0.41.0/go.mod h1:RkxM5lITDfTzmyKFPt+wGrCJbVfniCr2ool8kTBz google.golang.org/api v0.43.0/go.mod h1:nQsDGjRXMo4lvh5hP0TKqF244gqhGcr/YSIykhUk/94= google.golang.org/api v0.47.0/go.mod h1:Wbvgpq1HddcWVtzsVLyfLp8lDg6AA241LmgIL59tHXo= google.golang.org/api v0.48.0/go.mod h1:71Pr1vy+TAZRPkPs/xlCf5SsU8WjuAWv1Pfjbtukyy4= -google.golang.org/api v0.49.0 h1:gjIBDxlTG7vnzMmEnYwTnvLTF8Rjzo+ETCgEX1YZ/fY= -google.golang.org/api v0.49.0/go.mod h1:BECiH72wsfwUvOVn3+btPD5WHi0LzavZReBndi42L18= +google.golang.org/api v0.50.0 h1:LX7NFCFYOHzr7WHaYiRUpeipZe9o5L8T+2F4Z798VDw= +google.golang.org/api v0.50.0/go.mod h1:4bNT5pAuq5ji4SRZm+5QIkjny9JAyVD/3gaSihNefaw= 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.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= @@ -449,9 +449,9 @@ google.golang.org/genproto v0.0.0-20210513213006-bf773b8c8384/go.mod h1:P3QM42oQ google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= google.golang.org/genproto v0.0.0-20210604141403-392c879c8b08/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= google.golang.org/genproto v0.0.0-20210608205507-b6d2f5bf0d7d/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= -google.golang.org/genproto v0.0.0-20210617175327-b9e0b3197ced/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24= -google.golang.org/genproto v0.0.0-20210629200056-84d6f6074151 h1:H/uPzsolsGjhl3CVT6Wb7bK+mf+hmkEvUVu+FBKyNlc= -google.golang.org/genproto v0.0.0-20210629200056-84d6f6074151/go.mod h1:yiaVoXHpRzHGyxV3o4DktVWY4mSUErTKaeEOq6C3t3U= +google.golang.org/genproto v0.0.0-20210624195500-8bfb893ecb84/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24= +google.golang.org/genproto v0.0.0-20210630183607-d20f26d13c79 h1:s1jFTXJryg4a1mew7xv03VZD8N9XjxFhk1o4Js4WvPQ= +google.golang.org/genproto v0.0.0-20210630183607-d20f26d13c79/go.mod h1:yiaVoXHpRzHGyxV3o4DktVWY4mSUErTKaeEOq6C3t3U= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= diff --git a/datastream/apiv1alpha1/datastream_client.go b/datastream/apiv1alpha1/datastream_client.go index 37d76bb99e9..ad4aa195e4f 100644 --- a/datastream/apiv1alpha1/datastream_client.go +++ b/datastream/apiv1alpha1/datastream_client.go @@ -214,7 +214,7 @@ func defaultCallOptions() *CallOptions { } } -// internalClient is an interface that defines the methods availaible from DataStream API. +// internalClient is an interface that defines the methods availaible from Datastream API. type internalClient interface { Close() error setGoogleClientInfo(...string) @@ -253,7 +253,7 @@ type internalClient interface { DeleteRouteOperation(name string) *DeleteRouteOperation } -// Client is a client for interacting with DataStream API. +// Client is a client for interacting with Datastream API. // Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls. // // Datastream service @@ -472,7 +472,7 @@ func (c *Client) DeleteRouteOperation(name string) *DeleteRouteOperation { return c.internalClient.DeleteRouteOperation(name) } -// gRPCClient is a client for interacting with DataStream API over gRPC transport. +// gRPCClient is a client for interacting with Datastream API over gRPC transport. // // Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls. type gRPCClient struct { diff --git a/datastream/apiv1alpha1/doc.go b/datastream/apiv1alpha1/doc.go index d435cf0162b..29837f62a93 100644 --- a/datastream/apiv1alpha1/doc.go +++ b/datastream/apiv1alpha1/doc.go @@ -15,7 +15,7 @@ // Code generated by protoc-gen-go_gapic. DO NOT EDIT. // Package datastream is an auto-generated package for the -// DataStream API. +// Datastream API. // // NOTE: This package is in alpha. It is not stable, and is likely to change. // @@ -48,7 +48,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "UNKNOWN" +const versionClient = "20210630" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/debugger/apiv2/controller2_client.go b/debugger/apiv2/controller2_client.go index d8e887be439..5e06b37bcf7 100644 --- a/debugger/apiv2/controller2_client.go +++ b/debugger/apiv2/controller2_client.go @@ -48,6 +48,7 @@ func defaultController2GRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("clouddebugger.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://clouddebugger.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/debugger/apiv2/debugger2_client.go b/debugger/apiv2/debugger2_client.go index 868b90dee0d..ed6af24d20b 100644 --- a/debugger/apiv2/debugger2_client.go +++ b/debugger/apiv2/debugger2_client.go @@ -50,6 +50,7 @@ func defaultDebugger2GRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("clouddebugger.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://clouddebugger.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/debugger/apiv2/doc.go b/debugger/apiv2/doc.go index c8aebec454f..46c1001d446 100644 --- a/debugger/apiv2/doc.go +++ b/debugger/apiv2/doc.go @@ -49,7 +49,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210624" +const versionClient = "20210630" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/dialogflow/apiv2/agents_client.go b/dialogflow/apiv2/agents_client.go index 49004cc92af..c7af082de25 100644 --- a/dialogflow/apiv2/agents_client.go +++ b/dialogflow/apiv2/agents_client.go @@ -60,6 +60,7 @@ func defaultAgentsGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("dialogflow.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://dialogflow.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/dialogflow/apiv2/answer_records_client.go b/dialogflow/apiv2/answer_records_client.go index 29e728230e2..d5b41536174 100644 --- a/dialogflow/apiv2/answer_records_client.go +++ b/dialogflow/apiv2/answer_records_client.go @@ -49,6 +49,7 @@ func defaultAnswerRecordsGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("dialogflow.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://dialogflow.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/dialogflow/apiv2/contexts_client.go b/dialogflow/apiv2/contexts_client.go index 6b90b50a834..88148448c87 100644 --- a/dialogflow/apiv2/contexts_client.go +++ b/dialogflow/apiv2/contexts_client.go @@ -53,6 +53,7 @@ func defaultContextsGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("dialogflow.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://dialogflow.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/dialogflow/apiv2/conversation_profiles_client.go b/dialogflow/apiv2/conversation_profiles_client.go index 3cb9c771f3f..71adba384d6 100644 --- a/dialogflow/apiv2/conversation_profiles_client.go +++ b/dialogflow/apiv2/conversation_profiles_client.go @@ -52,6 +52,7 @@ func defaultConversationProfilesGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("dialogflow.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://dialogflow.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/dialogflow/apiv2/conversations_client.go b/dialogflow/apiv2/conversations_client.go index d1497245dce..66450e377a4 100644 --- a/dialogflow/apiv2/conversations_client.go +++ b/dialogflow/apiv2/conversations_client.go @@ -52,6 +52,7 @@ func defaultConversationsGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("dialogflow.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://dialogflow.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/dialogflow/apiv2/doc.go b/dialogflow/apiv2/doc.go index 90292d8d2c9..9bcf37c93e1 100644 --- a/dialogflow/apiv2/doc.go +++ b/dialogflow/apiv2/doc.go @@ -49,7 +49,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210624" +const versionClient = "20210630" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/dialogflow/apiv2/documents_client.go b/dialogflow/apiv2/documents_client.go index 21614f56fe7..9ccc6e10b61 100644 --- a/dialogflow/apiv2/documents_client.go +++ b/dialogflow/apiv2/documents_client.go @@ -56,6 +56,7 @@ func defaultDocumentsGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("dialogflow.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://dialogflow.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/dialogflow/apiv2/entity_types_client.go b/dialogflow/apiv2/entity_types_client.go index 99af19d68cc..81431a15203 100644 --- a/dialogflow/apiv2/entity_types_client.go +++ b/dialogflow/apiv2/entity_types_client.go @@ -61,6 +61,7 @@ func defaultEntityTypesGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("dialogflow.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://dialogflow.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/dialogflow/apiv2/environments_client.go b/dialogflow/apiv2/environments_client.go index a91f65842fb..4710977241f 100644 --- a/dialogflow/apiv2/environments_client.go +++ b/dialogflow/apiv2/environments_client.go @@ -53,6 +53,7 @@ func defaultEnvironmentsGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("dialogflow.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://dialogflow.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/dialogflow/apiv2/fulfillments_client.go b/dialogflow/apiv2/fulfillments_client.go index 0853a8bcee2..06fcd7116fc 100644 --- a/dialogflow/apiv2/fulfillments_client.go +++ b/dialogflow/apiv2/fulfillments_client.go @@ -47,6 +47,7 @@ func defaultFulfillmentsGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("dialogflow.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://dialogflow.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/dialogflow/apiv2/intents_client.go b/dialogflow/apiv2/intents_client.go index e6b0158a708..943fcad720b 100644 --- a/dialogflow/apiv2/intents_client.go +++ b/dialogflow/apiv2/intents_client.go @@ -58,6 +58,7 @@ func defaultIntentsGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("dialogflow.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://dialogflow.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/dialogflow/apiv2/knowledge_bases_client.go b/dialogflow/apiv2/knowledge_bases_client.go index f57400e31b6..7772de6bf35 100644 --- a/dialogflow/apiv2/knowledge_bases_client.go +++ b/dialogflow/apiv2/knowledge_bases_client.go @@ -52,6 +52,7 @@ func defaultKnowledgeBasesGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("dialogflow.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://dialogflow.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/dialogflow/apiv2/participants_client.go b/dialogflow/apiv2/participants_client.go index 1706d5317f4..3e10e0ce495 100644 --- a/dialogflow/apiv2/participants_client.go +++ b/dialogflow/apiv2/participants_client.go @@ -54,6 +54,7 @@ func defaultParticipantsGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("dialogflow.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://dialogflow.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/dialogflow/apiv2/session_entity_types_client.go b/dialogflow/apiv2/session_entity_types_client.go index 2342f4060fe..077bf4ab083 100644 --- a/dialogflow/apiv2/session_entity_types_client.go +++ b/dialogflow/apiv2/session_entity_types_client.go @@ -52,6 +52,7 @@ func defaultSessionEntityTypesGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("dialogflow.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://dialogflow.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/dialogflow/apiv2/sessions_client.go b/dialogflow/apiv2/sessions_client.go index 05dd73c3229..878f22f45d6 100644 --- a/dialogflow/apiv2/sessions_client.go +++ b/dialogflow/apiv2/sessions_client.go @@ -47,6 +47,7 @@ func defaultSessionsGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("dialogflow.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://dialogflow.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/dialogflow/apiv2/versions_client.go b/dialogflow/apiv2/versions_client.go index 4eb375f6855..b813a24bce6 100644 --- a/dialogflow/apiv2/versions_client.go +++ b/dialogflow/apiv2/versions_client.go @@ -52,6 +52,7 @@ func defaultVersionsGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("dialogflow.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://dialogflow.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/dialogflow/cx/apiv3/agents_client.go b/dialogflow/cx/apiv3/agents_client.go index f7671d8a97b..21623d410fb 100644 --- a/dialogflow/cx/apiv3/agents_client.go +++ b/dialogflow/cx/apiv3/agents_client.go @@ -60,6 +60,7 @@ func defaultAgentsGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("dialogflow.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://dialogflow.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/dialogflow/cx/apiv3/doc.go b/dialogflow/cx/apiv3/doc.go index 6623135f975..731cf46746e 100644 --- a/dialogflow/cx/apiv3/doc.go +++ b/dialogflow/cx/apiv3/doc.go @@ -20,8 +20,6 @@ // Builds conversational interfaces (for example, chatbots, and voice-powered // apps and devices). // -// NOTE: This package is in beta. It is not stable, and may be subject to changes. -// // Use of Context // // The ctx passed to NewClient is used for authentication requests and @@ -51,7 +49,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210624" +const versionClient = "20210630" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/dialogflow/cx/apiv3/entity_types_client.go b/dialogflow/cx/apiv3/entity_types_client.go index e8d99c6f5c3..b83a0712ee2 100644 --- a/dialogflow/cx/apiv3/entity_types_client.go +++ b/dialogflow/cx/apiv3/entity_types_client.go @@ -52,6 +52,7 @@ func defaultEntityTypesGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("dialogflow.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://dialogflow.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/dialogflow/cx/apiv3/environments_client.go b/dialogflow/cx/apiv3/environments_client.go index 2d87bdd6b93..fe106fbf731 100644 --- a/dialogflow/cx/apiv3/environments_client.go +++ b/dialogflow/cx/apiv3/environments_client.go @@ -59,6 +59,7 @@ func defaultEnvironmentsGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("dialogflow.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://dialogflow.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/dialogflow/cx/apiv3/experiments_client.go b/dialogflow/cx/apiv3/experiments_client.go index d42b703f3de..e3effcf44be 100644 --- a/dialogflow/cx/apiv3/experiments_client.go +++ b/dialogflow/cx/apiv3/experiments_client.go @@ -54,6 +54,7 @@ func defaultExperimentsGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("dialogflow.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://dialogflow.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/dialogflow/cx/apiv3/flows_client.go b/dialogflow/cx/apiv3/flows_client.go index 9f2c6c75846..925c3737c07 100644 --- a/dialogflow/cx/apiv3/flows_client.go +++ b/dialogflow/cx/apiv3/flows_client.go @@ -61,6 +61,7 @@ func defaultFlowsGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("dialogflow.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://dialogflow.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/dialogflow/cx/apiv3/intents_client.go b/dialogflow/cx/apiv3/intents_client.go index e2b2fb76862..bcd010bb58d 100644 --- a/dialogflow/cx/apiv3/intents_client.go +++ b/dialogflow/cx/apiv3/intents_client.go @@ -52,6 +52,7 @@ func defaultIntentsGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("dialogflow.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://dialogflow.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/dialogflow/cx/apiv3/pages_client.go b/dialogflow/cx/apiv3/pages_client.go index 4bb883a8001..72666daa72b 100644 --- a/dialogflow/cx/apiv3/pages_client.go +++ b/dialogflow/cx/apiv3/pages_client.go @@ -52,6 +52,7 @@ func defaultPagesGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("dialogflow.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://dialogflow.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/dialogflow/cx/apiv3/security_settings_client.go b/dialogflow/cx/apiv3/security_settings_client.go index 19525b722f5..9c6fe124670 100644 --- a/dialogflow/cx/apiv3/security_settings_client.go +++ b/dialogflow/cx/apiv3/security_settings_client.go @@ -52,6 +52,7 @@ func defaultSecuritySettingsGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("dialogflow.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://dialogflow.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/dialogflow/cx/apiv3/session_entity_types_client.go b/dialogflow/cx/apiv3/session_entity_types_client.go index f8ef1c50ce6..c9f0380baff 100644 --- a/dialogflow/cx/apiv3/session_entity_types_client.go +++ b/dialogflow/cx/apiv3/session_entity_types_client.go @@ -52,6 +52,7 @@ func defaultSessionEntityTypesGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("dialogflow.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://dialogflow.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/dialogflow/cx/apiv3/sessions_client.go b/dialogflow/cx/apiv3/sessions_client.go index d83dd24d87b..54de3d9551e 100644 --- a/dialogflow/cx/apiv3/sessions_client.go +++ b/dialogflow/cx/apiv3/sessions_client.go @@ -49,6 +49,7 @@ func defaultSessionsGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("dialogflow.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://dialogflow.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/dialogflow/cx/apiv3/test_cases_client.go b/dialogflow/cx/apiv3/test_cases_client.go index cb243cafc06..c780c3c5c95 100644 --- a/dialogflow/cx/apiv3/test_cases_client.go +++ b/dialogflow/cx/apiv3/test_cases_client.go @@ -62,6 +62,7 @@ func defaultTestCasesGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("dialogflow.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://dialogflow.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/dialogflow/cx/apiv3/transition_route_groups_client.go b/dialogflow/cx/apiv3/transition_route_groups_client.go index a71d3bf795d..9963cdc2073 100644 --- a/dialogflow/cx/apiv3/transition_route_groups_client.go +++ b/dialogflow/cx/apiv3/transition_route_groups_client.go @@ -52,6 +52,7 @@ func defaultTransitionRouteGroupsGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("dialogflow.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://dialogflow.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/dialogflow/cx/apiv3/versions_client.go b/dialogflow/cx/apiv3/versions_client.go index 0191353c143..b400500eaf1 100644 --- a/dialogflow/cx/apiv3/versions_client.go +++ b/dialogflow/cx/apiv3/versions_client.go @@ -57,6 +57,7 @@ func defaultVersionsGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("dialogflow.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://dialogflow.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/dialogflow/cx/apiv3/webhooks_client.go b/dialogflow/cx/apiv3/webhooks_client.go index a159f717d74..b589171ae2e 100644 --- a/dialogflow/cx/apiv3/webhooks_client.go +++ b/dialogflow/cx/apiv3/webhooks_client.go @@ -52,6 +52,7 @@ func defaultWebhooksGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("dialogflow.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://dialogflow.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/dialogflow/cx/apiv3beta1/agents_client.go b/dialogflow/cx/apiv3beta1/agents_client.go index 3522935de1e..2aadca15813 100644 --- a/dialogflow/cx/apiv3beta1/agents_client.go +++ b/dialogflow/cx/apiv3beta1/agents_client.go @@ -60,6 +60,7 @@ func defaultAgentsGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("dialogflow.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://dialogflow.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/dialogflow/cx/apiv3beta1/doc.go b/dialogflow/cx/apiv3beta1/doc.go index bf72fa8fde0..4f5d8532759 100644 --- a/dialogflow/cx/apiv3beta1/doc.go +++ b/dialogflow/cx/apiv3beta1/doc.go @@ -51,7 +51,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210624" +const versionClient = "20210630" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/dialogflow/cx/apiv3beta1/entity_types_client.go b/dialogflow/cx/apiv3beta1/entity_types_client.go index 532e475b2a5..1356e6a40b8 100644 --- a/dialogflow/cx/apiv3beta1/entity_types_client.go +++ b/dialogflow/cx/apiv3beta1/entity_types_client.go @@ -52,6 +52,7 @@ func defaultEntityTypesGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("dialogflow.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://dialogflow.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/dialogflow/cx/apiv3beta1/environments_client.go b/dialogflow/cx/apiv3beta1/environments_client.go index b15e83faa7c..d5262806e2e 100644 --- a/dialogflow/cx/apiv3beta1/environments_client.go +++ b/dialogflow/cx/apiv3beta1/environments_client.go @@ -59,6 +59,7 @@ func defaultEnvironmentsGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("dialogflow.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://dialogflow.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/dialogflow/cx/apiv3beta1/experiments_client.go b/dialogflow/cx/apiv3beta1/experiments_client.go index e19e4a96c5c..60a5d6e51f0 100644 --- a/dialogflow/cx/apiv3beta1/experiments_client.go +++ b/dialogflow/cx/apiv3beta1/experiments_client.go @@ -54,6 +54,7 @@ func defaultExperimentsGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("dialogflow.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://dialogflow.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/dialogflow/cx/apiv3beta1/flows_client.go b/dialogflow/cx/apiv3beta1/flows_client.go index b83da23f24d..ba2b783d087 100644 --- a/dialogflow/cx/apiv3beta1/flows_client.go +++ b/dialogflow/cx/apiv3beta1/flows_client.go @@ -61,6 +61,7 @@ func defaultFlowsGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("dialogflow.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://dialogflow.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/dialogflow/cx/apiv3beta1/intents_client.go b/dialogflow/cx/apiv3beta1/intents_client.go index baac27b6c38..e321664e981 100644 --- a/dialogflow/cx/apiv3beta1/intents_client.go +++ b/dialogflow/cx/apiv3beta1/intents_client.go @@ -52,6 +52,7 @@ func defaultIntentsGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("dialogflow.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://dialogflow.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/dialogflow/cx/apiv3beta1/pages_client.go b/dialogflow/cx/apiv3beta1/pages_client.go index 7f1ea6f0112..9e980d34e3f 100644 --- a/dialogflow/cx/apiv3beta1/pages_client.go +++ b/dialogflow/cx/apiv3beta1/pages_client.go @@ -52,6 +52,7 @@ func defaultPagesGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("dialogflow.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://dialogflow.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/dialogflow/cx/apiv3beta1/security_settings_client.go b/dialogflow/cx/apiv3beta1/security_settings_client.go index e9ea29c26f1..36ab26c693e 100644 --- a/dialogflow/cx/apiv3beta1/security_settings_client.go +++ b/dialogflow/cx/apiv3beta1/security_settings_client.go @@ -52,6 +52,7 @@ func defaultSecuritySettingsGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("dialogflow.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://dialogflow.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/dialogflow/cx/apiv3beta1/session_entity_types_client.go b/dialogflow/cx/apiv3beta1/session_entity_types_client.go index c00d1bec4b6..08799a17047 100644 --- a/dialogflow/cx/apiv3beta1/session_entity_types_client.go +++ b/dialogflow/cx/apiv3beta1/session_entity_types_client.go @@ -52,6 +52,7 @@ func defaultSessionEntityTypesGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("dialogflow.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://dialogflow.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/dialogflow/cx/apiv3beta1/sessions_client.go b/dialogflow/cx/apiv3beta1/sessions_client.go index 7206183b897..4fea31d5e43 100644 --- a/dialogflow/cx/apiv3beta1/sessions_client.go +++ b/dialogflow/cx/apiv3beta1/sessions_client.go @@ -49,6 +49,7 @@ func defaultSessionsGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("dialogflow.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://dialogflow.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/dialogflow/cx/apiv3beta1/test_cases_client.go b/dialogflow/cx/apiv3beta1/test_cases_client.go index 9b35caef34a..5b8729fcd04 100644 --- a/dialogflow/cx/apiv3beta1/test_cases_client.go +++ b/dialogflow/cx/apiv3beta1/test_cases_client.go @@ -62,6 +62,7 @@ func defaultTestCasesGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("dialogflow.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://dialogflow.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/dialogflow/cx/apiv3beta1/transition_route_groups_client.go b/dialogflow/cx/apiv3beta1/transition_route_groups_client.go index 159d3ab7813..46117280f8b 100644 --- a/dialogflow/cx/apiv3beta1/transition_route_groups_client.go +++ b/dialogflow/cx/apiv3beta1/transition_route_groups_client.go @@ -52,6 +52,7 @@ func defaultTransitionRouteGroupsGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("dialogflow.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://dialogflow.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/dialogflow/cx/apiv3beta1/versions_client.go b/dialogflow/cx/apiv3beta1/versions_client.go index 7d68c971a59..0035da11c55 100644 --- a/dialogflow/cx/apiv3beta1/versions_client.go +++ b/dialogflow/cx/apiv3beta1/versions_client.go @@ -57,6 +57,7 @@ func defaultVersionsGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("dialogflow.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://dialogflow.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/dialogflow/cx/apiv3beta1/webhooks_client.go b/dialogflow/cx/apiv3beta1/webhooks_client.go index f9dcf20328f..56e62b18405 100644 --- a/dialogflow/cx/apiv3beta1/webhooks_client.go +++ b/dialogflow/cx/apiv3beta1/webhooks_client.go @@ -52,6 +52,7 @@ func defaultWebhooksGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("dialogflow.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://dialogflow.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/dlp/apiv2/dlp_client.go b/dlp/apiv2/dlp_client.go index 9f058c73041..810a3565c0b 100644 --- a/dlp/apiv2/dlp_client.go +++ b/dlp/apiv2/dlp_client.go @@ -81,6 +81,7 @@ func defaultGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("dlp.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://dlp.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/dlp/apiv2/doc.go b/dlp/apiv2/doc.go index 75d8a69a7d1..ccd03828adf 100644 --- a/dlp/apiv2/doc.go +++ b/dlp/apiv2/doc.go @@ -50,7 +50,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210624" +const versionClient = "20210630" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/documentai/apiv1/doc.go b/documentai/apiv1/doc.go index 013c010e2eb..8e9c17eb985 100644 --- a/documentai/apiv1/doc.go +++ b/documentai/apiv1/doc.go @@ -21,8 +21,6 @@ // semi-structured documents using state-of-the-art Google AI such as natural // language, computer vision, translation, and AutoML. // -// NOTE: This package is in beta. It is not stable, and may be subject to changes. -// // Use of Context // // The ctx passed to NewClient is used for authentication requests and @@ -52,7 +50,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210624" +const versionClient = "20210630" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/documentai/apiv1/document_processor_client.go b/documentai/apiv1/document_processor_client.go index 775ce5195ca..8e87c607dac 100644 --- a/documentai/apiv1/document_processor_client.go +++ b/documentai/apiv1/document_processor_client.go @@ -51,6 +51,7 @@ func defaultDocumentProcessorGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("documentai.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://documentai.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/documentai/apiv1beta3/doc.go b/documentai/apiv1beta3/doc.go index be6d9be4fa2..511ee4e9758 100644 --- a/documentai/apiv1beta3/doc.go +++ b/documentai/apiv1beta3/doc.go @@ -52,7 +52,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210624" +const versionClient = "20210630" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/documentai/apiv1beta3/document_processor_client.go b/documentai/apiv1beta3/document_processor_client.go index 10b4694eb14..1a006861380 100644 --- a/documentai/apiv1beta3/document_processor_client.go +++ b/documentai/apiv1beta3/document_processor_client.go @@ -59,6 +59,7 @@ func defaultDocumentProcessorGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("documentai.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://documentai.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/domains/apiv1beta1/doc.go b/domains/apiv1beta1/doc.go index 797b22f48dc..1a4eaf1ce67 100644 --- a/domains/apiv1beta1/doc.go +++ b/domains/apiv1beta1/doc.go @@ -50,7 +50,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210624" +const versionClient = "20210630" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/domains/apiv1beta1/domains_client.go b/domains/apiv1beta1/domains_client.go index 02bc17a425c..a298686dc7f 100644 --- a/domains/apiv1beta1/domains_client.go +++ b/domains/apiv1beta1/domains_client.go @@ -62,6 +62,7 @@ func defaultGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("domains.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://domains.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/errorreporting/apiv1beta1/doc.go b/errorreporting/apiv1beta1/doc.go index 68ab7365317..d305ddc76c5 100644 --- a/errorreporting/apiv1beta1/doc.go +++ b/errorreporting/apiv1beta1/doc.go @@ -52,7 +52,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210624" +const versionClient = "20210630" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/errorreporting/apiv1beta1/error_group_client.go b/errorreporting/apiv1beta1/error_group_client.go index 12409a232b5..9440d1f0cc0 100644 --- a/errorreporting/apiv1beta1/error_group_client.go +++ b/errorreporting/apiv1beta1/error_group_client.go @@ -47,6 +47,7 @@ func defaultErrorGroupGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("clouderrorreporting.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://clouderrorreporting.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/errorreporting/apiv1beta1/error_stats_client.go b/errorreporting/apiv1beta1/error_stats_client.go index 5f1069f9ce2..e12bc96f20c 100644 --- a/errorreporting/apiv1beta1/error_stats_client.go +++ b/errorreporting/apiv1beta1/error_stats_client.go @@ -50,6 +50,7 @@ func defaultErrorStatsGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("clouderrorreporting.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://clouderrorreporting.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/errorreporting/apiv1beta1/report_errors_client.go b/errorreporting/apiv1beta1/report_errors_client.go index 3c91faa4296..796e5675d86 100644 --- a/errorreporting/apiv1beta1/report_errors_client.go +++ b/errorreporting/apiv1beta1/report_errors_client.go @@ -45,6 +45,7 @@ func defaultReportErrorsGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("clouderrorreporting.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://clouderrorreporting.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/essentialcontacts/apiv1/doc.go b/essentialcontacts/apiv1/doc.go index 6f479d2d71c..436f0358d87 100644 --- a/essentialcontacts/apiv1/doc.go +++ b/essentialcontacts/apiv1/doc.go @@ -17,8 +17,6 @@ // Package essentialcontacts is an auto-generated package for the // Essential Contacts API. // -// NOTE: This package is in beta. It is not stable, and may be subject to changes. -// // Use of Context // // The ctx passed to NewClient is used for authentication requests and @@ -48,7 +46,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210624" +const versionClient = "20210630" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/essentialcontacts/apiv1/essential_contacts_client.go b/essentialcontacts/apiv1/essential_contacts_client.go index f9feae3c37c..7485c6c69b2 100644 --- a/essentialcontacts/apiv1/essential_contacts_client.go +++ b/essentialcontacts/apiv1/essential_contacts_client.go @@ -54,6 +54,7 @@ func defaultGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("essentialcontacts.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://essentialcontacts.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/firestore/apiv1/admin/doc.go b/firestore/apiv1/admin/doc.go index a883dcae01f..85034acb541 100644 --- a/firestore/apiv1/admin/doc.go +++ b/firestore/apiv1/admin/doc.go @@ -49,7 +49,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210624" +const versionClient = "20210630" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/firestore/apiv1/admin/firestore_admin_client.go b/firestore/apiv1/admin/firestore_admin_client.go index bb192c5c35f..5dcbbdd2152 100644 --- a/firestore/apiv1/admin/firestore_admin_client.go +++ b/firestore/apiv1/admin/firestore_admin_client.go @@ -59,6 +59,7 @@ func defaultFirestoreAdminGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("firestore.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://firestore.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/firestore/apiv1/doc.go b/firestore/apiv1/doc.go index 32d81432614..fbb012af1f5 100644 --- a/firestore/apiv1/doc.go +++ b/firestore/apiv1/doc.go @@ -49,7 +49,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210624" +const versionClient = "20210630" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/firestore/apiv1/firestore_client.go b/firestore/apiv1/firestore_client.go index 0459cf95be8..deec0b20090 100644 --- a/firestore/apiv1/firestore_client.go +++ b/firestore/apiv1/firestore_client.go @@ -62,6 +62,7 @@ func defaultGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("firestore.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://firestore.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/firestore/go.mod b/firestore/go.mod index 2663995e148..1c2b1f03488 100644 --- a/firestore/go.mod +++ b/firestore/go.mod @@ -7,8 +7,8 @@ require ( github.com/golang/protobuf v1.5.2 github.com/google/go-cmp v0.5.6 github.com/googleapis/gax-go/v2 v2.0.5 - google.golang.org/api v0.49.0 - google.golang.org/genproto v0.0.0-20210629200056-84d6f6074151 + google.golang.org/api v0.50.0 + google.golang.org/genproto v0.0.0-20210630183607-d20f26d13c79 google.golang.org/grpc v1.38.0 google.golang.org/protobuf v1.27.1 ) diff --git a/firestore/go.sum b/firestore/go.sum index 8b897debcbf..9e44f7fc0b6 100644 --- a/firestore/go.sum +++ b/firestore/go.sum @@ -249,8 +249,8 @@ golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ golang.org/x/oauth2 v0.0.0-20210220000619-9bb904979d93/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210313182246-cd4f82c27b84/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210615190721-d04028783cf1 h1:x622Z2o4hgCr/4CiKWc51jHVKaWdtVpBNmEI8wI9Qns= -golang.org/x/oauth2 v0.0.0-20210615190721-d04028783cf1/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210628180205-a41e5a781914 h1:3B43BWw0xEBsLZ/NO1VALz6fppU3481pik+2Ksv45z8= +golang.org/x/oauth2 v0.0.0-20210628180205-a41e5a781914/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -396,8 +396,8 @@ google.golang.org/api v0.41.0/go.mod h1:RkxM5lITDfTzmyKFPt+wGrCJbVfniCr2ool8kTBz google.golang.org/api v0.43.0/go.mod h1:nQsDGjRXMo4lvh5hP0TKqF244gqhGcr/YSIykhUk/94= google.golang.org/api v0.47.0/go.mod h1:Wbvgpq1HddcWVtzsVLyfLp8lDg6AA241LmgIL59tHXo= google.golang.org/api v0.48.0/go.mod h1:71Pr1vy+TAZRPkPs/xlCf5SsU8WjuAWv1Pfjbtukyy4= -google.golang.org/api v0.49.0 h1:gjIBDxlTG7vnzMmEnYwTnvLTF8Rjzo+ETCgEX1YZ/fY= -google.golang.org/api v0.49.0/go.mod h1:BECiH72wsfwUvOVn3+btPD5WHi0LzavZReBndi42L18= +google.golang.org/api v0.50.0 h1:LX7NFCFYOHzr7WHaYiRUpeipZe9o5L8T+2F4Z798VDw= +google.golang.org/api v0.50.0/go.mod h1:4bNT5pAuq5ji4SRZm+5QIkjny9JAyVD/3gaSihNefaw= 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.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= @@ -449,9 +449,9 @@ google.golang.org/genproto v0.0.0-20210513213006-bf773b8c8384/go.mod h1:P3QM42oQ google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= google.golang.org/genproto v0.0.0-20210604141403-392c879c8b08/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= google.golang.org/genproto v0.0.0-20210608205507-b6d2f5bf0d7d/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= -google.golang.org/genproto v0.0.0-20210617175327-b9e0b3197ced/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24= -google.golang.org/genproto v0.0.0-20210629200056-84d6f6074151 h1:H/uPzsolsGjhl3CVT6Wb7bK+mf+hmkEvUVu+FBKyNlc= -google.golang.org/genproto v0.0.0-20210629200056-84d6f6074151/go.mod h1:yiaVoXHpRzHGyxV3o4DktVWY4mSUErTKaeEOq6C3t3U= +google.golang.org/genproto v0.0.0-20210624195500-8bfb893ecb84/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24= +google.golang.org/genproto v0.0.0-20210630183607-d20f26d13c79 h1:s1jFTXJryg4a1mew7xv03VZD8N9XjxFhk1o4Js4WvPQ= +google.golang.org/genproto v0.0.0-20210630183607-d20f26d13c79/go.mod h1:yiaVoXHpRzHGyxV3o4DktVWY4mSUErTKaeEOq6C3t3U= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= diff --git a/functions/apiv1/cloud_functions_client.go b/functions/apiv1/cloud_functions_client.go index 06958d19ee7..4f342917b6b 100644 --- a/functions/apiv1/cloud_functions_client.go +++ b/functions/apiv1/cloud_functions_client.go @@ -62,6 +62,7 @@ func defaultCloudFunctionsGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("cloudfunctions.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://cloudfunctions.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/functions/apiv1/doc.go b/functions/apiv1/doc.go index 624d14df15f..9651891f975 100644 --- a/functions/apiv1/doc.go +++ b/functions/apiv1/doc.go @@ -49,7 +49,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210624" +const versionClient = "20210630" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/gaming/apiv1/doc.go b/gaming/apiv1/doc.go index 0e4f481fc59..aebd85c3fb0 100644 --- a/gaming/apiv1/doc.go +++ b/gaming/apiv1/doc.go @@ -49,7 +49,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210624" +const versionClient = "20210630" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/gaming/apiv1/game_server_clusters_client.go b/gaming/apiv1/game_server_clusters_client.go index dea79cd4f30..85b83e1c8b8 100644 --- a/gaming/apiv1/game_server_clusters_client.go +++ b/gaming/apiv1/game_server_clusters_client.go @@ -58,6 +58,7 @@ func defaultGameServerClustersGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("gameservices.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://gameservices.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/gaming/apiv1/game_server_configs_client.go b/gaming/apiv1/game_server_configs_client.go index f428810bddd..63cbca4f35d 100644 --- a/gaming/apiv1/game_server_configs_client.go +++ b/gaming/apiv1/game_server_configs_client.go @@ -54,6 +54,7 @@ func defaultGameServerConfigsGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("gameservices.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://gameservices.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/gaming/apiv1/game_server_deployments_client.go b/gaming/apiv1/game_server_deployments_client.go index fa13c8c20aa..c393a74567c 100644 --- a/gaming/apiv1/game_server_deployments_client.go +++ b/gaming/apiv1/game_server_deployments_client.go @@ -59,6 +59,7 @@ func defaultGameServerDeploymentsGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("gameservices.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://gameservices.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/gaming/apiv1/realms_client.go b/gaming/apiv1/realms_client.go index 98383d25dc9..75e54f399cf 100644 --- a/gaming/apiv1/realms_client.go +++ b/gaming/apiv1/realms_client.go @@ -56,6 +56,7 @@ func defaultRealmsGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("gameservices.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://gameservices.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/gaming/apiv1beta/doc.go b/gaming/apiv1beta/doc.go index f4f31b44349..fee932c7861 100644 --- a/gaming/apiv1beta/doc.go +++ b/gaming/apiv1beta/doc.go @@ -51,7 +51,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210624" +const versionClient = "20210630" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/gaming/apiv1beta/game_server_clusters_client.go b/gaming/apiv1beta/game_server_clusters_client.go index 3bfd481ac66..e780ddb8094 100644 --- a/gaming/apiv1beta/game_server_clusters_client.go +++ b/gaming/apiv1beta/game_server_clusters_client.go @@ -58,6 +58,7 @@ func defaultGameServerClustersGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("gameservices.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://gameservices.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/gaming/apiv1beta/game_server_configs_client.go b/gaming/apiv1beta/game_server_configs_client.go index 033f65f6e32..0d60f4411fc 100644 --- a/gaming/apiv1beta/game_server_configs_client.go +++ b/gaming/apiv1beta/game_server_configs_client.go @@ -54,6 +54,7 @@ func defaultGameServerConfigsGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("gameservices.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://gameservices.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/gaming/apiv1beta/game_server_deployments_client.go b/gaming/apiv1beta/game_server_deployments_client.go index 959bd647ec1..04f2749fe6c 100644 --- a/gaming/apiv1beta/game_server_deployments_client.go +++ b/gaming/apiv1beta/game_server_deployments_client.go @@ -59,6 +59,7 @@ func defaultGameServerDeploymentsGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("gameservices.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://gameservices.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/gaming/apiv1beta/realms_client.go b/gaming/apiv1beta/realms_client.go index 72cb1ad841e..0c719ea776b 100644 --- a/gaming/apiv1beta/realms_client.go +++ b/gaming/apiv1beta/realms_client.go @@ -56,6 +56,7 @@ func defaultRealmsGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("gameservices.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://gameservices.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/gkeconnect/gateway/apiv1beta1/doc.go b/gkeconnect/gateway/apiv1beta1/doc.go index 0212560c4d4..9a8af36e3ea 100644 --- a/gkeconnect/gateway/apiv1beta1/doc.go +++ b/gkeconnect/gateway/apiv1beta1/doc.go @@ -51,7 +51,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210624" +const versionClient = "20210630" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/gkeconnect/gateway/apiv1beta1/gateway_client.go b/gkeconnect/gateway/apiv1beta1/gateway_client.go index fdfa650992b..756cbbf38fe 100644 --- a/gkeconnect/gateway/apiv1beta1/gateway_client.go +++ b/gkeconnect/gateway/apiv1beta1/gateway_client.go @@ -47,6 +47,7 @@ func defaultGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("connectgateway.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://connectgateway.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/gkehub/apiv1beta1/doc.go b/gkehub/apiv1beta1/doc.go index 6ffdf1e8317..b840f51faa0 100644 --- a/gkehub/apiv1beta1/doc.go +++ b/gkehub/apiv1beta1/doc.go @@ -48,7 +48,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210629" +const versionClient = "20210630" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/gkehub/apiv1beta1/gke_hub_membership_client.go b/gkehub/apiv1beta1/gke_hub_membership_client.go index cc33c60b545..7eb98cdd428 100644 --- a/gkehub/apiv1beta1/gke_hub_membership_client.go +++ b/gkehub/apiv1beta1/gke_hub_membership_client.go @@ -58,6 +58,7 @@ func defaultGkeHubMembershipGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("gkehub.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://gkehub.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/go.mod b/go.mod index f9ff5016b5c..e3f528d3490 100644 --- a/go.mod +++ b/go.mod @@ -16,8 +16,8 @@ require ( golang.org/x/oauth2 v0.0.0-20210628180205-a41e5a781914 golang.org/x/text v0.3.6 golang.org/x/tools v0.1.4 - google.golang.org/api v0.49.0 - google.golang.org/genproto v0.0.0-20210629200056-84d6f6074151 + google.golang.org/api v0.50.0 + google.golang.org/genproto v0.0.0-20210630183607-d20f26d13c79 google.golang.org/grpc v1.38.0 google.golang.org/protobuf v1.27.1 ) diff --git a/go.sum b/go.sum index a13fe6fe1e4..e72672ec7de 100644 --- a/go.sum +++ b/go.sum @@ -256,7 +256,6 @@ golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ golang.org/x/oauth2 v0.0.0-20210220000619-9bb904979d93/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210313182246-cd4f82c27b84/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210615190721-d04028783cf1/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210628180205-a41e5a781914 h1:3B43BWw0xEBsLZ/NO1VALz6fppU3481pik+2Ksv45z8= golang.org/x/oauth2 v0.0.0-20210628180205-a41e5a781914/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -405,8 +404,8 @@ google.golang.org/api v0.41.0/go.mod h1:RkxM5lITDfTzmyKFPt+wGrCJbVfniCr2ool8kTBz google.golang.org/api v0.43.0/go.mod h1:nQsDGjRXMo4lvh5hP0TKqF244gqhGcr/YSIykhUk/94= google.golang.org/api v0.47.0/go.mod h1:Wbvgpq1HddcWVtzsVLyfLp8lDg6AA241LmgIL59tHXo= google.golang.org/api v0.48.0/go.mod h1:71Pr1vy+TAZRPkPs/xlCf5SsU8WjuAWv1Pfjbtukyy4= -google.golang.org/api v0.49.0 h1:gjIBDxlTG7vnzMmEnYwTnvLTF8Rjzo+ETCgEX1YZ/fY= -google.golang.org/api v0.49.0/go.mod h1:BECiH72wsfwUvOVn3+btPD5WHi0LzavZReBndi42L18= +google.golang.org/api v0.50.0 h1:LX7NFCFYOHzr7WHaYiRUpeipZe9o5L8T+2F4Z798VDw= +google.golang.org/api v0.50.0/go.mod h1:4bNT5pAuq5ji4SRZm+5QIkjny9JAyVD/3gaSihNefaw= 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.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= @@ -458,9 +457,9 @@ google.golang.org/genproto v0.0.0-20210513213006-bf773b8c8384/go.mod h1:P3QM42oQ google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= google.golang.org/genproto v0.0.0-20210604141403-392c879c8b08/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= google.golang.org/genproto v0.0.0-20210608205507-b6d2f5bf0d7d/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= -google.golang.org/genproto v0.0.0-20210617175327-b9e0b3197ced/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24= -google.golang.org/genproto v0.0.0-20210629200056-84d6f6074151 h1:H/uPzsolsGjhl3CVT6Wb7bK+mf+hmkEvUVu+FBKyNlc= -google.golang.org/genproto v0.0.0-20210629200056-84d6f6074151/go.mod h1:yiaVoXHpRzHGyxV3o4DktVWY4mSUErTKaeEOq6C3t3U= +google.golang.org/genproto v0.0.0-20210624195500-8bfb893ecb84/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24= +google.golang.org/genproto v0.0.0-20210630183607-d20f26d13c79 h1:s1jFTXJryg4a1mew7xv03VZD8N9XjxFhk1o4Js4WvPQ= +google.golang.org/genproto v0.0.0-20210630183607-d20f26d13c79/go.mod h1:yiaVoXHpRzHGyxV3o4DktVWY4mSUErTKaeEOq6C3t3U= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= diff --git a/gsuiteaddons/apiv1/doc.go b/gsuiteaddons/apiv1/doc.go index 236663d7d71..90625432e32 100644 --- a/gsuiteaddons/apiv1/doc.go +++ b/gsuiteaddons/apiv1/doc.go @@ -48,7 +48,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210624" +const versionClient = "20210630" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/gsuiteaddons/apiv1/g_suite_add_ons_client.go b/gsuiteaddons/apiv1/g_suite_add_ons_client.go index 117ee461089..2ca35d0799f 100644 --- a/gsuiteaddons/apiv1/g_suite_add_ons_client.go +++ b/gsuiteaddons/apiv1/g_suite_add_ons_client.go @@ -56,6 +56,7 @@ func defaultGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("gsuiteaddons.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://gsuiteaddons.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/iam/credentials/apiv1/doc.go b/iam/credentials/apiv1/doc.go index 78abc51b632..6053de60b6b 100644 --- a/iam/credentials/apiv1/doc.go +++ b/iam/credentials/apiv1/doc.go @@ -49,7 +49,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210624" +const versionClient = "20210630" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/iam/credentials/apiv1/iam_credentials_client.go b/iam/credentials/apiv1/iam_credentials_client.go index 8569451ac30..e9924a15354 100644 --- a/iam/credentials/apiv1/iam_credentials_client.go +++ b/iam/credentials/apiv1/iam_credentials_client.go @@ -49,6 +49,7 @@ func defaultIamCredentialsGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("iamcredentials.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://iamcredentials.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/internal/.repo-metadata-full.json b/internal/.repo-metadata-full.json index 13bb34a67ca..1d782ddcefa 100644 --- a/internal/.repo-metadata-full.json +++ b/internal/.repo-metadata-full.json @@ -284,7 +284,7 @@ "language": "Go", "client_library_type": "generated", "docs_url": "https://cloud.google.com/go/docs/reference/cloud.google.com/go/latest/clouddms/apiv1", - "release_level": "beta", + "release_level": "ga", "library_type": "" }, "cloud.google.com/go/cloudtasks/apiv2": { @@ -359,6 +359,15 @@ "release_level": "beta", "library_type": "" }, + "cloud.google.com/go/dataflow/apiv1beta3": { + "distribution_name": "cloud.google.com/go/dataflow/apiv1beta3", + "description": "Dataflow API", + "language": "Go", + "client_library_type": "generated", + "docs_url": "https://cloud.google.com/go/docs/reference/cloud.google.com/go/latest/dataflow/apiv1beta3", + "release_level": "beta", + "library_type": "" + }, "cloud.google.com/go/datalabeling/apiv1beta1": { "distribution_name": "cloud.google.com/go/datalabeling/apiv1beta1", "description": "Data Labeling API", @@ -413,6 +422,15 @@ "release_level": "alpha", "library_type": "" }, + "cloud.google.com/go/datastream/apiv1alpha1": { + "distribution_name": "cloud.google.com/go/datastream/apiv1alpha1", + "description": "Datastream API", + "language": "Go", + "client_library_type": "generated", + "docs_url": "https://cloud.google.com/go/docs/reference/cloud.google.com/go/latest/datastream/apiv1alpha1", + "release_level": "alpha", + "library_type": "" + }, "cloud.google.com/go/debugger/apiv2": { "distribution_name": "cloud.google.com/go/debugger/apiv2", "description": "Stackdriver Debugger API", @@ -437,7 +455,7 @@ "language": "Go", "client_library_type": "generated", "docs_url": "https://cloud.google.com/go/docs/reference/cloud.google.com/go/latest/dialogflow/cx/apiv3", - "release_level": "beta", + "release_level": "ga", "library_type": "" }, "cloud.google.com/go/dialogflow/cx/apiv3beta1": { @@ -464,7 +482,7 @@ "language": "Go", "client_library_type": "generated", "docs_url": "https://cloud.google.com/go/docs/reference/cloud.google.com/go/latest/documentai/apiv1", - "release_level": "beta", + "release_level": "ga", "library_type": "" }, "cloud.google.com/go/documentai/apiv1beta3": { @@ -509,6 +527,15 @@ "language": "Go", "client_library_type": "generated", "docs_url": "https://cloud.google.com/go/docs/reference/cloud.google.com/go/latest/essentialcontacts/apiv1", + "release_level": "ga", + "library_type": "" + }, + "cloud.google.com/go/eventarc/apiv1": { + "distribution_name": "cloud.google.com/go/eventarc/apiv1", + "description": "Eventarc API", + "language": "Go", + "client_library_type": "generated", + "docs_url": "https://cloud.google.com/go/docs/reference/cloud.google.com/go/latest/eventarc/apiv1", "release_level": "beta", "library_type": "" }, @@ -734,7 +761,7 @@ "language": "Go", "client_library_type": "generated", "docs_url": "https://cloud.google.com/go/docs/reference/cloud.google.com/go/latest/metastore/apiv1", - "release_level": "beta", + "release_level": "ga", "library_type": "" }, "cloud.google.com/go/metastore/apiv1alpha": { @@ -1013,7 +1040,7 @@ "language": "Go", "client_library_type": "generated", "docs_url": "https://cloud.google.com/go/docs/reference/cloud.google.com/go/latest/resourcesettings/apiv1", - "release_level": "beta", + "release_level": "ga", "library_type": "" }, "cloud.google.com/go/retail/apiv2": { @@ -1076,7 +1103,7 @@ "language": "Go", "client_library_type": "generated", "docs_url": "https://cloud.google.com/go/docs/reference/cloud.google.com/go/latest/security/privateca/apiv1", - "release_level": "beta", + "release_level": "ga", "library_type": "" }, "cloud.google.com/go/security/privateca/apiv1beta1": { @@ -1166,7 +1193,7 @@ "language": "Go", "client_library_type": "generated", "docs_url": "https://cloud.google.com/go/docs/reference/cloud.google.com/go/latest/serviceusage/apiv1", - "release_level": "beta", + "release_level": "ga", "library_type": "" }, "cloud.google.com/go/shell/apiv1": { @@ -1241,6 +1268,15 @@ "release_level": "ga", "library_type": "GAPIC_MANUAL" }, + "cloud.google.com/go/storage/internal/apiv1": { + "distribution_name": "cloud.google.com/go/storage/internal/apiv1", + "description": "Cloud Storage API", + "language": "Go", + "client_library_type": "generated", + "docs_url": "https://cloud.google.com/go/docs/reference/cloud.google.com/go/latest/storage/internal/apiv1", + "release_level": "alpha", + "library_type": "" + }, "cloud.google.com/go/talent/apiv4": { "distribution_name": "cloud.google.com/go/talent/apiv4", "description": "Cloud Talent Solution API", @@ -1394,6 +1430,15 @@ "release_level": "beta", "library_type": "" }, + "cloud.google.com/go/workflows/executions/apiv1": { + "distribution_name": "cloud.google.com/go/workflows/executions/apiv1", + "description": "Workflow Executions API", + "language": "Go", + "client_library_type": "generated", + "docs_url": "https://cloud.google.com/go/docs/reference/cloud.google.com/go/latest/workflows/executions/apiv1", + "release_level": "beta", + "library_type": "" + }, "cloud.google.com/go/workflows/executions/apiv1beta": { "distribution_name": "cloud.google.com/go/workflows/executions/apiv1beta", "description": "Workflow Executions API", diff --git a/internal/examples/fake/go.mod b/internal/examples/fake/go.mod index 00a09169a04..c0c4fb663e2 100644 --- a/internal/examples/fake/go.mod +++ b/internal/examples/fake/go.mod @@ -5,6 +5,6 @@ go 1.15 require ( cloud.google.com/go v0.84.0 google.golang.org/api v0.49.0 - google.golang.org/genproto v0.0.0-20210629200056-84d6f6074151 + google.golang.org/genproto v0.0.0-20210630183607-d20f26d13c79 google.golang.org/grpc v1.38.0 ) diff --git a/internal/examples/fake/go.sum b/internal/examples/fake/go.sum index 5cb73adaa90..a536cf14e91 100644 --- a/internal/examples/fake/go.sum +++ b/internal/examples/fake/go.sum @@ -446,8 +446,8 @@ google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxH google.golang.org/genproto v0.0.0-20210604141403-392c879c8b08/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= google.golang.org/genproto v0.0.0-20210608205507-b6d2f5bf0d7d/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= google.golang.org/genproto v0.0.0-20210617175327-b9e0b3197ced/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24= -google.golang.org/genproto v0.0.0-20210629200056-84d6f6074151 h1:H/uPzsolsGjhl3CVT6Wb7bK+mf+hmkEvUVu+FBKyNlc= -google.golang.org/genproto v0.0.0-20210629200056-84d6f6074151/go.mod h1:yiaVoXHpRzHGyxV3o4DktVWY4mSUErTKaeEOq6C3t3U= +google.golang.org/genproto v0.0.0-20210630183607-d20f26d13c79 h1:s1jFTXJryg4a1mew7xv03VZD8N9XjxFhk1o4Js4WvPQ= +google.golang.org/genproto v0.0.0-20210630183607-d20f26d13c79/go.mod h1:yiaVoXHpRzHGyxV3o4DktVWY4mSUErTKaeEOq6C3t3U= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= diff --git a/internal/examples/mock/go.mod b/internal/examples/mock/go.mod index 50df88ef047..acc420a8cb6 100644 --- a/internal/examples/mock/go.mod +++ b/internal/examples/mock/go.mod @@ -7,5 +7,5 @@ require ( github.com/googleapis/gax-go/v2 v2.0.5 golang.org/x/net v0.0.0-20210503060351-7fd8e65b6420 // indirect golang.org/x/sys v0.0.0-20210616094352-59db8d763f22 // indirect - google.golang.org/genproto v0.0.0-20210629200056-84d6f6074151 + google.golang.org/genproto v0.0.0-20210630183607-d20f26d13c79 ) diff --git a/internal/examples/mock/go.sum b/internal/examples/mock/go.sum index e8c633cd3dd..6869245539f 100644 --- a/internal/examples/mock/go.sum +++ b/internal/examples/mock/go.sum @@ -95,8 +95,8 @@ google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7 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-20210629200056-84d6f6074151 h1:H/uPzsolsGjhl3CVT6Wb7bK+mf+hmkEvUVu+FBKyNlc= -google.golang.org/genproto v0.0.0-20210629200056-84d6f6074151/go.mod h1:yiaVoXHpRzHGyxV3o4DktVWY4mSUErTKaeEOq6C3t3U= +google.golang.org/genproto v0.0.0-20210630183607-d20f26d13c79 h1:s1jFTXJryg4a1mew7xv03VZD8N9XjxFhk1o4Js4WvPQ= +google.golang.org/genproto v0.0.0-20210630183607-d20f26d13c79/go.mod h1:yiaVoXHpRzHGyxV3o4DktVWY4mSUErTKaeEOq6C3t3U= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= diff --git a/internal/gapicgen/go.mod b/internal/gapicgen/go.mod index 9130fbdb720..05519980cae 100644 --- a/internal/gapicgen/go.mod +++ b/internal/gapicgen/go.mod @@ -11,7 +11,7 @@ require ( golang.org/x/oauth2 v0.0.0-20210628180205-a41e5a781914 golang.org/x/sync v0.0.0-20210220032951-036812b2e83c golang.org/x/sys v0.0.0-20210616094352-59db8d763f22 - google.golang.org/genproto v0.0.0-20210629200056-84d6f6074151 + google.golang.org/genproto v0.0.0-20210630183607-d20f26d13c79 google.golang.org/protobuf v1.27.1 gopkg.in/src-d/go-git.v4 v4.13.1 gopkg.in/yaml.v2 v2.4.0 diff --git a/internal/gapicgen/go.sum b/internal/gapicgen/go.sum index 0a16bd5b57e..caf147b10f4 100644 --- a/internal/gapicgen/go.sum +++ b/internal/gapicgen/go.sum @@ -503,8 +503,8 @@ google.golang.org/genproto v0.0.0-20210513213006-bf773b8c8384/go.mod h1:P3QM42oQ google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= google.golang.org/genproto v0.0.0-20210604141403-392c879c8b08/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= google.golang.org/genproto v0.0.0-20210608205507-b6d2f5bf0d7d/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= -google.golang.org/genproto v0.0.0-20210629200056-84d6f6074151 h1:H/uPzsolsGjhl3CVT6Wb7bK+mf+hmkEvUVu+FBKyNlc= -google.golang.org/genproto v0.0.0-20210629200056-84d6f6074151/go.mod h1:yiaVoXHpRzHGyxV3o4DktVWY4mSUErTKaeEOq6C3t3U= +google.golang.org/genproto v0.0.0-20210630183607-d20f26d13c79 h1:s1jFTXJryg4a1mew7xv03VZD8N9XjxFhk1o4Js4WvPQ= +google.golang.org/genproto v0.0.0-20210630183607-d20f26d13c79/go.mod h1:yiaVoXHpRzHGyxV3o4DktVWY4mSUErTKaeEOq6C3t3U= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= diff --git a/internal/generated/snippets/dataflow/apiv1beta3/FlexTemplatesClient/LaunchFlexTemplate/main.go b/internal/generated/snippets/dataflow/apiv1beta3/FlexTemplatesClient/LaunchFlexTemplate/main.go new file mode 100644 index 00000000000..cd47c65b129 --- /dev/null +++ b/internal/generated/snippets/dataflow/apiv1beta3/FlexTemplatesClient/LaunchFlexTemplate/main.go @@ -0,0 +1,47 @@ +// Copyright 2021 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 +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by cloud.google.com/go/internal/gapicgen/gensnippets. DO NOT EDIT. + +// [START dataflow_v1beta3_generated_FlexTemplatesService_LaunchFlexTemplate_sync] + +package main + +import ( + "context" + + dataflow "cloud.google.com/go/dataflow/apiv1beta3" + dataflowpb "google.golang.org/genproto/googleapis/dataflow/v1beta3" +) + +func main() { + ctx := context.Background() + c, err := dataflow.NewFlexTemplatesClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &dataflowpb.LaunchFlexTemplateRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.LaunchFlexTemplate(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +// [END dataflow_v1beta3_generated_FlexTemplatesService_LaunchFlexTemplate_sync] diff --git a/internal/generated/snippets/dataflow/apiv1beta3/JobsV1Beta3Client/AggregatedListJobs/main.go b/internal/generated/snippets/dataflow/apiv1beta3/JobsV1Beta3Client/AggregatedListJobs/main.go new file mode 100644 index 00000000000..1cdb96de836 --- /dev/null +++ b/internal/generated/snippets/dataflow/apiv1beta3/JobsV1Beta3Client/AggregatedListJobs/main.go @@ -0,0 +1,54 @@ +// Copyright 2021 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 +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by cloud.google.com/go/internal/gapicgen/gensnippets. DO NOT EDIT. + +// [START dataflow_v1beta3_generated_JobsV1Beta3_AggregatedListJobs_sync] + +package main + +import ( + "context" + + dataflow "cloud.google.com/go/dataflow/apiv1beta3" + "google.golang.org/api/iterator" + dataflowpb "google.golang.org/genproto/googleapis/dataflow/v1beta3" +) + +func main() { + ctx := context.Background() + c, err := dataflow.NewJobsV1Beta3Client(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &dataflowpb.ListJobsRequest{ + // TODO: Fill request struct fields. + } + it := c.AggregatedListJobs(ctx, req) + for { + resp, err := it.Next() + if err == iterator.Done { + break + } + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp + } +} + +// [END dataflow_v1beta3_generated_JobsV1Beta3_AggregatedListJobs_sync] diff --git a/internal/generated/snippets/dataflow/apiv1beta3/JobsV1Beta3Client/CheckActiveJobs/main.go b/internal/generated/snippets/dataflow/apiv1beta3/JobsV1Beta3Client/CheckActiveJobs/main.go new file mode 100644 index 00000000000..30533616e1c --- /dev/null +++ b/internal/generated/snippets/dataflow/apiv1beta3/JobsV1Beta3Client/CheckActiveJobs/main.go @@ -0,0 +1,47 @@ +// Copyright 2021 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 +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by cloud.google.com/go/internal/gapicgen/gensnippets. DO NOT EDIT. + +// [START dataflow_v1beta3_generated_JobsV1Beta3_CheckActiveJobs_sync] + +package main + +import ( + "context" + + dataflow "cloud.google.com/go/dataflow/apiv1beta3" + dataflowpb "google.golang.org/genproto/googleapis/dataflow/v1beta3" +) + +func main() { + ctx := context.Background() + c, err := dataflow.NewJobsV1Beta3Client(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &dataflowpb.CheckActiveJobsRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.CheckActiveJobs(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +// [END dataflow_v1beta3_generated_JobsV1Beta3_CheckActiveJobs_sync] diff --git a/internal/generated/snippets/dataflow/apiv1beta3/JobsV1Beta3Client/CreateJob/main.go b/internal/generated/snippets/dataflow/apiv1beta3/JobsV1Beta3Client/CreateJob/main.go new file mode 100644 index 00000000000..32087203c33 --- /dev/null +++ b/internal/generated/snippets/dataflow/apiv1beta3/JobsV1Beta3Client/CreateJob/main.go @@ -0,0 +1,47 @@ +// Copyright 2021 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 +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by cloud.google.com/go/internal/gapicgen/gensnippets. DO NOT EDIT. + +// [START dataflow_v1beta3_generated_JobsV1Beta3_CreateJob_sync] + +package main + +import ( + "context" + + dataflow "cloud.google.com/go/dataflow/apiv1beta3" + dataflowpb "google.golang.org/genproto/googleapis/dataflow/v1beta3" +) + +func main() { + ctx := context.Background() + c, err := dataflow.NewJobsV1Beta3Client(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &dataflowpb.CreateJobRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.CreateJob(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +// [END dataflow_v1beta3_generated_JobsV1Beta3_CreateJob_sync] diff --git a/internal/generated/snippets/dataflow/apiv1beta3/JobsV1Beta3Client/GetJob/main.go b/internal/generated/snippets/dataflow/apiv1beta3/JobsV1Beta3Client/GetJob/main.go new file mode 100644 index 00000000000..8a57334e4a1 --- /dev/null +++ b/internal/generated/snippets/dataflow/apiv1beta3/JobsV1Beta3Client/GetJob/main.go @@ -0,0 +1,47 @@ +// Copyright 2021 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 +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by cloud.google.com/go/internal/gapicgen/gensnippets. DO NOT EDIT. + +// [START dataflow_v1beta3_generated_JobsV1Beta3_GetJob_sync] + +package main + +import ( + "context" + + dataflow "cloud.google.com/go/dataflow/apiv1beta3" + dataflowpb "google.golang.org/genproto/googleapis/dataflow/v1beta3" +) + +func main() { + ctx := context.Background() + c, err := dataflow.NewJobsV1Beta3Client(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &dataflowpb.GetJobRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.GetJob(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +// [END dataflow_v1beta3_generated_JobsV1Beta3_GetJob_sync] diff --git a/internal/generated/snippets/dataflow/apiv1beta3/JobsV1Beta3Client/ListJobs/main.go b/internal/generated/snippets/dataflow/apiv1beta3/JobsV1Beta3Client/ListJobs/main.go new file mode 100644 index 00000000000..81dd44e621f --- /dev/null +++ b/internal/generated/snippets/dataflow/apiv1beta3/JobsV1Beta3Client/ListJobs/main.go @@ -0,0 +1,54 @@ +// Copyright 2021 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 +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by cloud.google.com/go/internal/gapicgen/gensnippets. DO NOT EDIT. + +// [START dataflow_v1beta3_generated_JobsV1Beta3_ListJobs_sync] + +package main + +import ( + "context" + + dataflow "cloud.google.com/go/dataflow/apiv1beta3" + "google.golang.org/api/iterator" + dataflowpb "google.golang.org/genproto/googleapis/dataflow/v1beta3" +) + +func main() { + ctx := context.Background() + c, err := dataflow.NewJobsV1Beta3Client(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &dataflowpb.ListJobsRequest{ + // TODO: Fill request struct fields. + } + it := c.ListJobs(ctx, req) + for { + resp, err := it.Next() + if err == iterator.Done { + break + } + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp + } +} + +// [END dataflow_v1beta3_generated_JobsV1Beta3_ListJobs_sync] diff --git a/internal/generated/snippets/dataflow/apiv1beta3/JobsV1Beta3Client/SnapshotJob/main.go b/internal/generated/snippets/dataflow/apiv1beta3/JobsV1Beta3Client/SnapshotJob/main.go new file mode 100644 index 00000000000..be232a1cadc --- /dev/null +++ b/internal/generated/snippets/dataflow/apiv1beta3/JobsV1Beta3Client/SnapshotJob/main.go @@ -0,0 +1,47 @@ +// Copyright 2021 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 +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by cloud.google.com/go/internal/gapicgen/gensnippets. DO NOT EDIT. + +// [START dataflow_v1beta3_generated_JobsV1Beta3_SnapshotJob_sync] + +package main + +import ( + "context" + + dataflow "cloud.google.com/go/dataflow/apiv1beta3" + dataflowpb "google.golang.org/genproto/googleapis/dataflow/v1beta3" +) + +func main() { + ctx := context.Background() + c, err := dataflow.NewJobsV1Beta3Client(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &dataflowpb.SnapshotJobRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.SnapshotJob(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +// [END dataflow_v1beta3_generated_JobsV1Beta3_SnapshotJob_sync] diff --git a/internal/generated/snippets/dataflow/apiv1beta3/JobsV1Beta3Client/UpdateJob/main.go b/internal/generated/snippets/dataflow/apiv1beta3/JobsV1Beta3Client/UpdateJob/main.go new file mode 100644 index 00000000000..5e4912c751e --- /dev/null +++ b/internal/generated/snippets/dataflow/apiv1beta3/JobsV1Beta3Client/UpdateJob/main.go @@ -0,0 +1,47 @@ +// Copyright 2021 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 +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by cloud.google.com/go/internal/gapicgen/gensnippets. DO NOT EDIT. + +// [START dataflow_v1beta3_generated_JobsV1Beta3_UpdateJob_sync] + +package main + +import ( + "context" + + dataflow "cloud.google.com/go/dataflow/apiv1beta3" + dataflowpb "google.golang.org/genproto/googleapis/dataflow/v1beta3" +) + +func main() { + ctx := context.Background() + c, err := dataflow.NewJobsV1Beta3Client(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &dataflowpb.UpdateJobRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.UpdateJob(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +// [END dataflow_v1beta3_generated_JobsV1Beta3_UpdateJob_sync] diff --git a/internal/generated/snippets/dataflow/apiv1beta3/MessagesV1Beta3Client/ListJobMessages/main.go b/internal/generated/snippets/dataflow/apiv1beta3/MessagesV1Beta3Client/ListJobMessages/main.go new file mode 100644 index 00000000000..f1c51e885ed --- /dev/null +++ b/internal/generated/snippets/dataflow/apiv1beta3/MessagesV1Beta3Client/ListJobMessages/main.go @@ -0,0 +1,54 @@ +// Copyright 2021 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 +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by cloud.google.com/go/internal/gapicgen/gensnippets. DO NOT EDIT. + +// [START dataflow_v1beta3_generated_MessagesV1Beta3_ListJobMessages_sync] + +package main + +import ( + "context" + + dataflow "cloud.google.com/go/dataflow/apiv1beta3" + "google.golang.org/api/iterator" + dataflowpb "google.golang.org/genproto/googleapis/dataflow/v1beta3" +) + +func main() { + ctx := context.Background() + c, err := dataflow.NewMessagesV1Beta3Client(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &dataflowpb.ListJobMessagesRequest{ + // TODO: Fill request struct fields. + } + it := c.ListJobMessages(ctx, req) + for { + resp, err := it.Next() + if err == iterator.Done { + break + } + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp + } +} + +// [END dataflow_v1beta3_generated_MessagesV1Beta3_ListJobMessages_sync] diff --git a/internal/generated/snippets/dataflow/apiv1beta3/MetricsV1Beta3Client/GetJobExecutionDetails/main.go b/internal/generated/snippets/dataflow/apiv1beta3/MetricsV1Beta3Client/GetJobExecutionDetails/main.go new file mode 100644 index 00000000000..92445f65612 --- /dev/null +++ b/internal/generated/snippets/dataflow/apiv1beta3/MetricsV1Beta3Client/GetJobExecutionDetails/main.go @@ -0,0 +1,54 @@ +// Copyright 2021 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 +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by cloud.google.com/go/internal/gapicgen/gensnippets. DO NOT EDIT. + +// [START dataflow_v1beta3_generated_MetricsV1Beta3_GetJobExecutionDetails_sync] + +package main + +import ( + "context" + + dataflow "cloud.google.com/go/dataflow/apiv1beta3" + "google.golang.org/api/iterator" + dataflowpb "google.golang.org/genproto/googleapis/dataflow/v1beta3" +) + +func main() { + ctx := context.Background() + c, err := dataflow.NewMetricsV1Beta3Client(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &dataflowpb.GetJobExecutionDetailsRequest{ + // TODO: Fill request struct fields. + } + it := c.GetJobExecutionDetails(ctx, req) + for { + resp, err := it.Next() + if err == iterator.Done { + break + } + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp + } +} + +// [END dataflow_v1beta3_generated_MetricsV1Beta3_GetJobExecutionDetails_sync] diff --git a/internal/generated/snippets/dataflow/apiv1beta3/MetricsV1Beta3Client/GetJobMetrics/main.go b/internal/generated/snippets/dataflow/apiv1beta3/MetricsV1Beta3Client/GetJobMetrics/main.go new file mode 100644 index 00000000000..accdb4ba03a --- /dev/null +++ b/internal/generated/snippets/dataflow/apiv1beta3/MetricsV1Beta3Client/GetJobMetrics/main.go @@ -0,0 +1,47 @@ +// Copyright 2021 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 +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by cloud.google.com/go/internal/gapicgen/gensnippets. DO NOT EDIT. + +// [START dataflow_v1beta3_generated_MetricsV1Beta3_GetJobMetrics_sync] + +package main + +import ( + "context" + + dataflow "cloud.google.com/go/dataflow/apiv1beta3" + dataflowpb "google.golang.org/genproto/googleapis/dataflow/v1beta3" +) + +func main() { + ctx := context.Background() + c, err := dataflow.NewMetricsV1Beta3Client(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &dataflowpb.GetJobMetricsRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.GetJobMetrics(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +// [END dataflow_v1beta3_generated_MetricsV1Beta3_GetJobMetrics_sync] diff --git a/internal/generated/snippets/dataflow/apiv1beta3/MetricsV1Beta3Client/GetStageExecutionDetails/main.go b/internal/generated/snippets/dataflow/apiv1beta3/MetricsV1Beta3Client/GetStageExecutionDetails/main.go new file mode 100644 index 00000000000..fcb77b62f80 --- /dev/null +++ b/internal/generated/snippets/dataflow/apiv1beta3/MetricsV1Beta3Client/GetStageExecutionDetails/main.go @@ -0,0 +1,54 @@ +// Copyright 2021 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 +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by cloud.google.com/go/internal/gapicgen/gensnippets. DO NOT EDIT. + +// [START dataflow_v1beta3_generated_MetricsV1Beta3_GetStageExecutionDetails_sync] + +package main + +import ( + "context" + + dataflow "cloud.google.com/go/dataflow/apiv1beta3" + "google.golang.org/api/iterator" + dataflowpb "google.golang.org/genproto/googleapis/dataflow/v1beta3" +) + +func main() { + ctx := context.Background() + c, err := dataflow.NewMetricsV1Beta3Client(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &dataflowpb.GetStageExecutionDetailsRequest{ + // TODO: Fill request struct fields. + } + it := c.GetStageExecutionDetails(ctx, req) + for { + resp, err := it.Next() + if err == iterator.Done { + break + } + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp + } +} + +// [END dataflow_v1beta3_generated_MetricsV1Beta3_GetStageExecutionDetails_sync] diff --git a/internal/generated/snippets/dataflow/apiv1beta3/SnapshotsV1Beta3Client/DeleteSnapshot/main.go b/internal/generated/snippets/dataflow/apiv1beta3/SnapshotsV1Beta3Client/DeleteSnapshot/main.go new file mode 100644 index 00000000000..cd6f98438f6 --- /dev/null +++ b/internal/generated/snippets/dataflow/apiv1beta3/SnapshotsV1Beta3Client/DeleteSnapshot/main.go @@ -0,0 +1,47 @@ +// Copyright 2021 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 +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by cloud.google.com/go/internal/gapicgen/gensnippets. DO NOT EDIT. + +// [START dataflow_v1beta3_generated_SnapshotsV1Beta3_DeleteSnapshot_sync] + +package main + +import ( + "context" + + dataflow "cloud.google.com/go/dataflow/apiv1beta3" + dataflowpb "google.golang.org/genproto/googleapis/dataflow/v1beta3" +) + +func main() { + ctx := context.Background() + c, err := dataflow.NewSnapshotsV1Beta3Client(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &dataflowpb.DeleteSnapshotRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.DeleteSnapshot(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +// [END dataflow_v1beta3_generated_SnapshotsV1Beta3_DeleteSnapshot_sync] diff --git a/internal/generated/snippets/dataflow/apiv1beta3/SnapshotsV1Beta3Client/GetSnapshot/main.go b/internal/generated/snippets/dataflow/apiv1beta3/SnapshotsV1Beta3Client/GetSnapshot/main.go new file mode 100644 index 00000000000..bddb53d155f --- /dev/null +++ b/internal/generated/snippets/dataflow/apiv1beta3/SnapshotsV1Beta3Client/GetSnapshot/main.go @@ -0,0 +1,47 @@ +// Copyright 2021 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 +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by cloud.google.com/go/internal/gapicgen/gensnippets. DO NOT EDIT. + +// [START dataflow_v1beta3_generated_SnapshotsV1Beta3_GetSnapshot_sync] + +package main + +import ( + "context" + + dataflow "cloud.google.com/go/dataflow/apiv1beta3" + dataflowpb "google.golang.org/genproto/googleapis/dataflow/v1beta3" +) + +func main() { + ctx := context.Background() + c, err := dataflow.NewSnapshotsV1Beta3Client(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &dataflowpb.GetSnapshotRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.GetSnapshot(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +// [END dataflow_v1beta3_generated_SnapshotsV1Beta3_GetSnapshot_sync] diff --git a/internal/generated/snippets/dataflow/apiv1beta3/SnapshotsV1Beta3Client/ListSnapshots/main.go b/internal/generated/snippets/dataflow/apiv1beta3/SnapshotsV1Beta3Client/ListSnapshots/main.go new file mode 100644 index 00000000000..5a0542fea0a --- /dev/null +++ b/internal/generated/snippets/dataflow/apiv1beta3/SnapshotsV1Beta3Client/ListSnapshots/main.go @@ -0,0 +1,47 @@ +// Copyright 2021 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 +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by cloud.google.com/go/internal/gapicgen/gensnippets. DO NOT EDIT. + +// [START dataflow_v1beta3_generated_SnapshotsV1Beta3_ListSnapshots_sync] + +package main + +import ( + "context" + + dataflow "cloud.google.com/go/dataflow/apiv1beta3" + dataflowpb "google.golang.org/genproto/googleapis/dataflow/v1beta3" +) + +func main() { + ctx := context.Background() + c, err := dataflow.NewSnapshotsV1Beta3Client(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &dataflowpb.ListSnapshotsRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.ListSnapshots(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +// [END dataflow_v1beta3_generated_SnapshotsV1Beta3_ListSnapshots_sync] diff --git a/internal/generated/snippets/dataflow/apiv1beta3/TemplatesClient/CreateJobFromTemplate/main.go b/internal/generated/snippets/dataflow/apiv1beta3/TemplatesClient/CreateJobFromTemplate/main.go new file mode 100644 index 00000000000..861997eb98e --- /dev/null +++ b/internal/generated/snippets/dataflow/apiv1beta3/TemplatesClient/CreateJobFromTemplate/main.go @@ -0,0 +1,47 @@ +// Copyright 2021 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 +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by cloud.google.com/go/internal/gapicgen/gensnippets. DO NOT EDIT. + +// [START dataflow_v1beta3_generated_TemplatesService_CreateJobFromTemplate_sync] + +package main + +import ( + "context" + + dataflow "cloud.google.com/go/dataflow/apiv1beta3" + dataflowpb "google.golang.org/genproto/googleapis/dataflow/v1beta3" +) + +func main() { + ctx := context.Background() + c, err := dataflow.NewTemplatesClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &dataflowpb.CreateJobFromTemplateRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.CreateJobFromTemplate(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +// [END dataflow_v1beta3_generated_TemplatesService_CreateJobFromTemplate_sync] diff --git a/internal/generated/snippets/dataflow/apiv1beta3/TemplatesClient/GetTemplate/main.go b/internal/generated/snippets/dataflow/apiv1beta3/TemplatesClient/GetTemplate/main.go new file mode 100644 index 00000000000..e4c49448997 --- /dev/null +++ b/internal/generated/snippets/dataflow/apiv1beta3/TemplatesClient/GetTemplate/main.go @@ -0,0 +1,47 @@ +// Copyright 2021 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 +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by cloud.google.com/go/internal/gapicgen/gensnippets. DO NOT EDIT. + +// [START dataflow_v1beta3_generated_TemplatesService_GetTemplate_sync] + +package main + +import ( + "context" + + dataflow "cloud.google.com/go/dataflow/apiv1beta3" + dataflowpb "google.golang.org/genproto/googleapis/dataflow/v1beta3" +) + +func main() { + ctx := context.Background() + c, err := dataflow.NewTemplatesClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &dataflowpb.GetTemplateRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.GetTemplate(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +// [END dataflow_v1beta3_generated_TemplatesService_GetTemplate_sync] diff --git a/internal/generated/snippets/dataflow/apiv1beta3/TemplatesClient/LaunchTemplate/main.go b/internal/generated/snippets/dataflow/apiv1beta3/TemplatesClient/LaunchTemplate/main.go new file mode 100644 index 00000000000..6331330a8a7 --- /dev/null +++ b/internal/generated/snippets/dataflow/apiv1beta3/TemplatesClient/LaunchTemplate/main.go @@ -0,0 +1,47 @@ +// Copyright 2021 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 +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by cloud.google.com/go/internal/gapicgen/gensnippets. DO NOT EDIT. + +// [START dataflow_v1beta3_generated_TemplatesService_LaunchTemplate_sync] + +package main + +import ( + "context" + + dataflow "cloud.google.com/go/dataflow/apiv1beta3" + dataflowpb "google.golang.org/genproto/googleapis/dataflow/v1beta3" +) + +func main() { + ctx := context.Background() + c, err := dataflow.NewTemplatesClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &dataflowpb.LaunchTemplateRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.LaunchTemplate(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +// [END dataflow_v1beta3_generated_TemplatesService_LaunchTemplate_sync] diff --git a/internal/generated/snippets/datastream/apiv1alpha1/Client/CreateConnectionProfile/main.go b/internal/generated/snippets/datastream/apiv1alpha1/Client/CreateConnectionProfile/main.go new file mode 100644 index 00000000000..e723189121c --- /dev/null +++ b/internal/generated/snippets/datastream/apiv1alpha1/Client/CreateConnectionProfile/main.go @@ -0,0 +1,52 @@ +// Copyright 2021 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 +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by cloud.google.com/go/internal/gapicgen/gensnippets. DO NOT EDIT. + +// [START datastream_v1alpha1_generated_Datastream_CreateConnectionProfile_sync] + +package main + +import ( + "context" + + datastream "cloud.google.com/go/datastream/apiv1alpha1" + datastreampb "google.golang.org/genproto/googleapis/cloud/datastream/v1alpha1" +) + +func main() { + ctx := context.Background() + c, err := datastream.NewClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &datastreampb.CreateConnectionProfileRequest{ + // TODO: Fill request struct fields. + } + op, err := c.CreateConnectionProfile(ctx, req) + if err != nil { + // TODO: Handle error. + } + + resp, err := op.Wait(ctx) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +// [END datastream_v1alpha1_generated_Datastream_CreateConnectionProfile_sync] diff --git a/internal/generated/snippets/datastream/apiv1alpha1/Client/CreatePrivateConnection/main.go b/internal/generated/snippets/datastream/apiv1alpha1/Client/CreatePrivateConnection/main.go new file mode 100644 index 00000000000..e7c955af5a1 --- /dev/null +++ b/internal/generated/snippets/datastream/apiv1alpha1/Client/CreatePrivateConnection/main.go @@ -0,0 +1,52 @@ +// Copyright 2021 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 +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by cloud.google.com/go/internal/gapicgen/gensnippets. DO NOT EDIT. + +// [START datastream_v1alpha1_generated_Datastream_CreatePrivateConnection_sync] + +package main + +import ( + "context" + + datastream "cloud.google.com/go/datastream/apiv1alpha1" + datastreampb "google.golang.org/genproto/googleapis/cloud/datastream/v1alpha1" +) + +func main() { + ctx := context.Background() + c, err := datastream.NewClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &datastreampb.CreatePrivateConnectionRequest{ + // TODO: Fill request struct fields. + } + op, err := c.CreatePrivateConnection(ctx, req) + if err != nil { + // TODO: Handle error. + } + + resp, err := op.Wait(ctx) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +// [END datastream_v1alpha1_generated_Datastream_CreatePrivateConnection_sync] diff --git a/internal/generated/snippets/datastream/apiv1alpha1/Client/CreateRoute/main.go b/internal/generated/snippets/datastream/apiv1alpha1/Client/CreateRoute/main.go new file mode 100644 index 00000000000..22f97c8e0ba --- /dev/null +++ b/internal/generated/snippets/datastream/apiv1alpha1/Client/CreateRoute/main.go @@ -0,0 +1,52 @@ +// Copyright 2021 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 +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by cloud.google.com/go/internal/gapicgen/gensnippets. DO NOT EDIT. + +// [START datastream_v1alpha1_generated_Datastream_CreateRoute_sync] + +package main + +import ( + "context" + + datastream "cloud.google.com/go/datastream/apiv1alpha1" + datastreampb "google.golang.org/genproto/googleapis/cloud/datastream/v1alpha1" +) + +func main() { + ctx := context.Background() + c, err := datastream.NewClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &datastreampb.CreateRouteRequest{ + // TODO: Fill request struct fields. + } + op, err := c.CreateRoute(ctx, req) + if err != nil { + // TODO: Handle error. + } + + resp, err := op.Wait(ctx) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +// [END datastream_v1alpha1_generated_Datastream_CreateRoute_sync] diff --git a/internal/generated/snippets/datastream/apiv1alpha1/Client/CreateStream/main.go b/internal/generated/snippets/datastream/apiv1alpha1/Client/CreateStream/main.go new file mode 100644 index 00000000000..f574bf4c330 --- /dev/null +++ b/internal/generated/snippets/datastream/apiv1alpha1/Client/CreateStream/main.go @@ -0,0 +1,52 @@ +// Copyright 2021 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 +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by cloud.google.com/go/internal/gapicgen/gensnippets. DO NOT EDIT. + +// [START datastream_v1alpha1_generated_Datastream_CreateStream_sync] + +package main + +import ( + "context" + + datastream "cloud.google.com/go/datastream/apiv1alpha1" + datastreampb "google.golang.org/genproto/googleapis/cloud/datastream/v1alpha1" +) + +func main() { + ctx := context.Background() + c, err := datastream.NewClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &datastreampb.CreateStreamRequest{ + // TODO: Fill request struct fields. + } + op, err := c.CreateStream(ctx, req) + if err != nil { + // TODO: Handle error. + } + + resp, err := op.Wait(ctx) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +// [END datastream_v1alpha1_generated_Datastream_CreateStream_sync] diff --git a/internal/generated/snippets/datastream/apiv1alpha1/Client/DeleteConnectionProfile/main.go b/internal/generated/snippets/datastream/apiv1alpha1/Client/DeleteConnectionProfile/main.go new file mode 100644 index 00000000000..7cf078c85e1 --- /dev/null +++ b/internal/generated/snippets/datastream/apiv1alpha1/Client/DeleteConnectionProfile/main.go @@ -0,0 +1,50 @@ +// Copyright 2021 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 +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by cloud.google.com/go/internal/gapicgen/gensnippets. DO NOT EDIT. + +// [START datastream_v1alpha1_generated_Datastream_DeleteConnectionProfile_sync] + +package main + +import ( + "context" + + datastream "cloud.google.com/go/datastream/apiv1alpha1" + datastreampb "google.golang.org/genproto/googleapis/cloud/datastream/v1alpha1" +) + +func main() { + ctx := context.Background() + c, err := datastream.NewClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &datastreampb.DeleteConnectionProfileRequest{ + // TODO: Fill request struct fields. + } + op, err := c.DeleteConnectionProfile(ctx, req) + if err != nil { + // TODO: Handle error. + } + + err = op.Wait(ctx) + if err != nil { + // TODO: Handle error. + } +} + +// [END datastream_v1alpha1_generated_Datastream_DeleteConnectionProfile_sync] diff --git a/internal/generated/snippets/datastream/apiv1alpha1/Client/DeletePrivateConnection/main.go b/internal/generated/snippets/datastream/apiv1alpha1/Client/DeletePrivateConnection/main.go new file mode 100644 index 00000000000..3578a7bb0bb --- /dev/null +++ b/internal/generated/snippets/datastream/apiv1alpha1/Client/DeletePrivateConnection/main.go @@ -0,0 +1,50 @@ +// Copyright 2021 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 +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by cloud.google.com/go/internal/gapicgen/gensnippets. DO NOT EDIT. + +// [START datastream_v1alpha1_generated_Datastream_DeletePrivateConnection_sync] + +package main + +import ( + "context" + + datastream "cloud.google.com/go/datastream/apiv1alpha1" + datastreampb "google.golang.org/genproto/googleapis/cloud/datastream/v1alpha1" +) + +func main() { + ctx := context.Background() + c, err := datastream.NewClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &datastreampb.DeletePrivateConnectionRequest{ + // TODO: Fill request struct fields. + } + op, err := c.DeletePrivateConnection(ctx, req) + if err != nil { + // TODO: Handle error. + } + + err = op.Wait(ctx) + if err != nil { + // TODO: Handle error. + } +} + +// [END datastream_v1alpha1_generated_Datastream_DeletePrivateConnection_sync] diff --git a/internal/generated/snippets/datastream/apiv1alpha1/Client/DeleteRoute/main.go b/internal/generated/snippets/datastream/apiv1alpha1/Client/DeleteRoute/main.go new file mode 100644 index 00000000000..9a9ddedb4e9 --- /dev/null +++ b/internal/generated/snippets/datastream/apiv1alpha1/Client/DeleteRoute/main.go @@ -0,0 +1,50 @@ +// Copyright 2021 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 +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by cloud.google.com/go/internal/gapicgen/gensnippets. DO NOT EDIT. + +// [START datastream_v1alpha1_generated_Datastream_DeleteRoute_sync] + +package main + +import ( + "context" + + datastream "cloud.google.com/go/datastream/apiv1alpha1" + datastreampb "google.golang.org/genproto/googleapis/cloud/datastream/v1alpha1" +) + +func main() { + ctx := context.Background() + c, err := datastream.NewClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &datastreampb.DeleteRouteRequest{ + // TODO: Fill request struct fields. + } + op, err := c.DeleteRoute(ctx, req) + if err != nil { + // TODO: Handle error. + } + + err = op.Wait(ctx) + if err != nil { + // TODO: Handle error. + } +} + +// [END datastream_v1alpha1_generated_Datastream_DeleteRoute_sync] diff --git a/internal/generated/snippets/datastream/apiv1alpha1/Client/DeleteStream/main.go b/internal/generated/snippets/datastream/apiv1alpha1/Client/DeleteStream/main.go new file mode 100644 index 00000000000..4ca4c07c414 --- /dev/null +++ b/internal/generated/snippets/datastream/apiv1alpha1/Client/DeleteStream/main.go @@ -0,0 +1,50 @@ +// Copyright 2021 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 +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by cloud.google.com/go/internal/gapicgen/gensnippets. DO NOT EDIT. + +// [START datastream_v1alpha1_generated_Datastream_DeleteStream_sync] + +package main + +import ( + "context" + + datastream "cloud.google.com/go/datastream/apiv1alpha1" + datastreampb "google.golang.org/genproto/googleapis/cloud/datastream/v1alpha1" +) + +func main() { + ctx := context.Background() + c, err := datastream.NewClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &datastreampb.DeleteStreamRequest{ + // TODO: Fill request struct fields. + } + op, err := c.DeleteStream(ctx, req) + if err != nil { + // TODO: Handle error. + } + + err = op.Wait(ctx) + if err != nil { + // TODO: Handle error. + } +} + +// [END datastream_v1alpha1_generated_Datastream_DeleteStream_sync] diff --git a/internal/generated/snippets/datastream/apiv1alpha1/Client/DiscoverConnectionProfile/main.go b/internal/generated/snippets/datastream/apiv1alpha1/Client/DiscoverConnectionProfile/main.go new file mode 100644 index 00000000000..e616aa7abff --- /dev/null +++ b/internal/generated/snippets/datastream/apiv1alpha1/Client/DiscoverConnectionProfile/main.go @@ -0,0 +1,47 @@ +// Copyright 2021 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 +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by cloud.google.com/go/internal/gapicgen/gensnippets. DO NOT EDIT. + +// [START datastream_v1alpha1_generated_Datastream_DiscoverConnectionProfile_sync] + +package main + +import ( + "context" + + datastream "cloud.google.com/go/datastream/apiv1alpha1" + datastreampb "google.golang.org/genproto/googleapis/cloud/datastream/v1alpha1" +) + +func main() { + ctx := context.Background() + c, err := datastream.NewClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &datastreampb.DiscoverConnectionProfileRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.DiscoverConnectionProfile(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +// [END datastream_v1alpha1_generated_Datastream_DiscoverConnectionProfile_sync] diff --git a/internal/generated/snippets/datastream/apiv1alpha1/Client/FetchErrors/main.go b/internal/generated/snippets/datastream/apiv1alpha1/Client/FetchErrors/main.go new file mode 100644 index 00000000000..e5cd267aff7 --- /dev/null +++ b/internal/generated/snippets/datastream/apiv1alpha1/Client/FetchErrors/main.go @@ -0,0 +1,52 @@ +// Copyright 2021 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 +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by cloud.google.com/go/internal/gapicgen/gensnippets. DO NOT EDIT. + +// [START datastream_v1alpha1_generated_Datastream_FetchErrors_sync] + +package main + +import ( + "context" + + datastream "cloud.google.com/go/datastream/apiv1alpha1" + datastreampb "google.golang.org/genproto/googleapis/cloud/datastream/v1alpha1" +) + +func main() { + ctx := context.Background() + c, err := datastream.NewClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &datastreampb.FetchErrorsRequest{ + // TODO: Fill request struct fields. + } + op, err := c.FetchErrors(ctx, req) + if err != nil { + // TODO: Handle error. + } + + resp, err := op.Wait(ctx) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +// [END datastream_v1alpha1_generated_Datastream_FetchErrors_sync] diff --git a/internal/generated/snippets/datastream/apiv1alpha1/Client/FetchStaticIps/main.go b/internal/generated/snippets/datastream/apiv1alpha1/Client/FetchStaticIps/main.go new file mode 100644 index 00000000000..deb583ac14e --- /dev/null +++ b/internal/generated/snippets/datastream/apiv1alpha1/Client/FetchStaticIps/main.go @@ -0,0 +1,54 @@ +// Copyright 2021 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 +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by cloud.google.com/go/internal/gapicgen/gensnippets. DO NOT EDIT. + +// [START datastream_v1alpha1_generated_Datastream_FetchStaticIps_sync] + +package main + +import ( + "context" + + datastream "cloud.google.com/go/datastream/apiv1alpha1" + "google.golang.org/api/iterator" + datastreampb "google.golang.org/genproto/googleapis/cloud/datastream/v1alpha1" +) + +func main() { + ctx := context.Background() + c, err := datastream.NewClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &datastreampb.FetchStaticIpsRequest{ + // TODO: Fill request struct fields. + } + it := c.FetchStaticIps(ctx, req) + for { + resp, err := it.Next() + if err == iterator.Done { + break + } + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp + } +} + +// [END datastream_v1alpha1_generated_Datastream_FetchStaticIps_sync] diff --git a/internal/generated/snippets/datastream/apiv1alpha1/Client/GetConnectionProfile/main.go b/internal/generated/snippets/datastream/apiv1alpha1/Client/GetConnectionProfile/main.go new file mode 100644 index 00000000000..61392165af4 --- /dev/null +++ b/internal/generated/snippets/datastream/apiv1alpha1/Client/GetConnectionProfile/main.go @@ -0,0 +1,47 @@ +// Copyright 2021 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 +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by cloud.google.com/go/internal/gapicgen/gensnippets. DO NOT EDIT. + +// [START datastream_v1alpha1_generated_Datastream_GetConnectionProfile_sync] + +package main + +import ( + "context" + + datastream "cloud.google.com/go/datastream/apiv1alpha1" + datastreampb "google.golang.org/genproto/googleapis/cloud/datastream/v1alpha1" +) + +func main() { + ctx := context.Background() + c, err := datastream.NewClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &datastreampb.GetConnectionProfileRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.GetConnectionProfile(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +// [END datastream_v1alpha1_generated_Datastream_GetConnectionProfile_sync] diff --git a/internal/generated/snippets/datastream/apiv1alpha1/Client/GetPrivateConnection/main.go b/internal/generated/snippets/datastream/apiv1alpha1/Client/GetPrivateConnection/main.go new file mode 100644 index 00000000000..05cd5a6f28e --- /dev/null +++ b/internal/generated/snippets/datastream/apiv1alpha1/Client/GetPrivateConnection/main.go @@ -0,0 +1,47 @@ +// Copyright 2021 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 +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by cloud.google.com/go/internal/gapicgen/gensnippets. DO NOT EDIT. + +// [START datastream_v1alpha1_generated_Datastream_GetPrivateConnection_sync] + +package main + +import ( + "context" + + datastream "cloud.google.com/go/datastream/apiv1alpha1" + datastreampb "google.golang.org/genproto/googleapis/cloud/datastream/v1alpha1" +) + +func main() { + ctx := context.Background() + c, err := datastream.NewClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &datastreampb.GetPrivateConnectionRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.GetPrivateConnection(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +// [END datastream_v1alpha1_generated_Datastream_GetPrivateConnection_sync] diff --git a/internal/generated/snippets/datastream/apiv1alpha1/Client/GetRoute/main.go b/internal/generated/snippets/datastream/apiv1alpha1/Client/GetRoute/main.go new file mode 100644 index 00000000000..67fd497cce2 --- /dev/null +++ b/internal/generated/snippets/datastream/apiv1alpha1/Client/GetRoute/main.go @@ -0,0 +1,47 @@ +// Copyright 2021 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 +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by cloud.google.com/go/internal/gapicgen/gensnippets. DO NOT EDIT. + +// [START datastream_v1alpha1_generated_Datastream_GetRoute_sync] + +package main + +import ( + "context" + + datastream "cloud.google.com/go/datastream/apiv1alpha1" + datastreampb "google.golang.org/genproto/googleapis/cloud/datastream/v1alpha1" +) + +func main() { + ctx := context.Background() + c, err := datastream.NewClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &datastreampb.GetRouteRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.GetRoute(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +// [END datastream_v1alpha1_generated_Datastream_GetRoute_sync] diff --git a/internal/generated/snippets/datastream/apiv1alpha1/Client/GetStream/main.go b/internal/generated/snippets/datastream/apiv1alpha1/Client/GetStream/main.go new file mode 100644 index 00000000000..3f312d5ca98 --- /dev/null +++ b/internal/generated/snippets/datastream/apiv1alpha1/Client/GetStream/main.go @@ -0,0 +1,47 @@ +// Copyright 2021 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 +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by cloud.google.com/go/internal/gapicgen/gensnippets. DO NOT EDIT. + +// [START datastream_v1alpha1_generated_Datastream_GetStream_sync] + +package main + +import ( + "context" + + datastream "cloud.google.com/go/datastream/apiv1alpha1" + datastreampb "google.golang.org/genproto/googleapis/cloud/datastream/v1alpha1" +) + +func main() { + ctx := context.Background() + c, err := datastream.NewClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &datastreampb.GetStreamRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.GetStream(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +// [END datastream_v1alpha1_generated_Datastream_GetStream_sync] diff --git a/internal/generated/snippets/datastream/apiv1alpha1/Client/ListConnectionProfiles/main.go b/internal/generated/snippets/datastream/apiv1alpha1/Client/ListConnectionProfiles/main.go new file mode 100644 index 00000000000..4b90347cbcc --- /dev/null +++ b/internal/generated/snippets/datastream/apiv1alpha1/Client/ListConnectionProfiles/main.go @@ -0,0 +1,54 @@ +// Copyright 2021 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 +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by cloud.google.com/go/internal/gapicgen/gensnippets. DO NOT EDIT. + +// [START datastream_v1alpha1_generated_Datastream_ListConnectionProfiles_sync] + +package main + +import ( + "context" + + datastream "cloud.google.com/go/datastream/apiv1alpha1" + "google.golang.org/api/iterator" + datastreampb "google.golang.org/genproto/googleapis/cloud/datastream/v1alpha1" +) + +func main() { + ctx := context.Background() + c, err := datastream.NewClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &datastreampb.ListConnectionProfilesRequest{ + // TODO: Fill request struct fields. + } + it := c.ListConnectionProfiles(ctx, req) + for { + resp, err := it.Next() + if err == iterator.Done { + break + } + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp + } +} + +// [END datastream_v1alpha1_generated_Datastream_ListConnectionProfiles_sync] diff --git a/internal/generated/snippets/datastream/apiv1alpha1/Client/ListPrivateConnections/main.go b/internal/generated/snippets/datastream/apiv1alpha1/Client/ListPrivateConnections/main.go new file mode 100644 index 00000000000..b2c5a56afd9 --- /dev/null +++ b/internal/generated/snippets/datastream/apiv1alpha1/Client/ListPrivateConnections/main.go @@ -0,0 +1,54 @@ +// Copyright 2021 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 +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by cloud.google.com/go/internal/gapicgen/gensnippets. DO NOT EDIT. + +// [START datastream_v1alpha1_generated_Datastream_ListPrivateConnections_sync] + +package main + +import ( + "context" + + datastream "cloud.google.com/go/datastream/apiv1alpha1" + "google.golang.org/api/iterator" + datastreampb "google.golang.org/genproto/googleapis/cloud/datastream/v1alpha1" +) + +func main() { + ctx := context.Background() + c, err := datastream.NewClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &datastreampb.ListPrivateConnectionsRequest{ + // TODO: Fill request struct fields. + } + it := c.ListPrivateConnections(ctx, req) + for { + resp, err := it.Next() + if err == iterator.Done { + break + } + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp + } +} + +// [END datastream_v1alpha1_generated_Datastream_ListPrivateConnections_sync] diff --git a/internal/generated/snippets/datastream/apiv1alpha1/Client/ListRoutes/main.go b/internal/generated/snippets/datastream/apiv1alpha1/Client/ListRoutes/main.go new file mode 100644 index 00000000000..c3e3964067b --- /dev/null +++ b/internal/generated/snippets/datastream/apiv1alpha1/Client/ListRoutes/main.go @@ -0,0 +1,54 @@ +// Copyright 2021 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 +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by cloud.google.com/go/internal/gapicgen/gensnippets. DO NOT EDIT. + +// [START datastream_v1alpha1_generated_Datastream_ListRoutes_sync] + +package main + +import ( + "context" + + datastream "cloud.google.com/go/datastream/apiv1alpha1" + "google.golang.org/api/iterator" + datastreampb "google.golang.org/genproto/googleapis/cloud/datastream/v1alpha1" +) + +func main() { + ctx := context.Background() + c, err := datastream.NewClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &datastreampb.ListRoutesRequest{ + // TODO: Fill request struct fields. + } + it := c.ListRoutes(ctx, req) + for { + resp, err := it.Next() + if err == iterator.Done { + break + } + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp + } +} + +// [END datastream_v1alpha1_generated_Datastream_ListRoutes_sync] diff --git a/internal/generated/snippets/datastream/apiv1alpha1/Client/ListStreams/main.go b/internal/generated/snippets/datastream/apiv1alpha1/Client/ListStreams/main.go new file mode 100644 index 00000000000..33a20779315 --- /dev/null +++ b/internal/generated/snippets/datastream/apiv1alpha1/Client/ListStreams/main.go @@ -0,0 +1,54 @@ +// Copyright 2021 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 +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by cloud.google.com/go/internal/gapicgen/gensnippets. DO NOT EDIT. + +// [START datastream_v1alpha1_generated_Datastream_ListStreams_sync] + +package main + +import ( + "context" + + datastream "cloud.google.com/go/datastream/apiv1alpha1" + "google.golang.org/api/iterator" + datastreampb "google.golang.org/genproto/googleapis/cloud/datastream/v1alpha1" +) + +func main() { + ctx := context.Background() + c, err := datastream.NewClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &datastreampb.ListStreamsRequest{ + // TODO: Fill request struct fields. + } + it := c.ListStreams(ctx, req) + for { + resp, err := it.Next() + if err == iterator.Done { + break + } + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp + } +} + +// [END datastream_v1alpha1_generated_Datastream_ListStreams_sync] diff --git a/internal/generated/snippets/datastream/apiv1alpha1/Client/UpdateConnectionProfile/main.go b/internal/generated/snippets/datastream/apiv1alpha1/Client/UpdateConnectionProfile/main.go new file mode 100644 index 00000000000..805f8dd36d4 --- /dev/null +++ b/internal/generated/snippets/datastream/apiv1alpha1/Client/UpdateConnectionProfile/main.go @@ -0,0 +1,52 @@ +// Copyright 2021 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 +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by cloud.google.com/go/internal/gapicgen/gensnippets. DO NOT EDIT. + +// [START datastream_v1alpha1_generated_Datastream_UpdateConnectionProfile_sync] + +package main + +import ( + "context" + + datastream "cloud.google.com/go/datastream/apiv1alpha1" + datastreampb "google.golang.org/genproto/googleapis/cloud/datastream/v1alpha1" +) + +func main() { + ctx := context.Background() + c, err := datastream.NewClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &datastreampb.UpdateConnectionProfileRequest{ + // TODO: Fill request struct fields. + } + op, err := c.UpdateConnectionProfile(ctx, req) + if err != nil { + // TODO: Handle error. + } + + resp, err := op.Wait(ctx) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +// [END datastream_v1alpha1_generated_Datastream_UpdateConnectionProfile_sync] diff --git a/internal/generated/snippets/datastream/apiv1alpha1/Client/UpdateStream/main.go b/internal/generated/snippets/datastream/apiv1alpha1/Client/UpdateStream/main.go new file mode 100644 index 00000000000..f276bbfe416 --- /dev/null +++ b/internal/generated/snippets/datastream/apiv1alpha1/Client/UpdateStream/main.go @@ -0,0 +1,52 @@ +// Copyright 2021 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 +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by cloud.google.com/go/internal/gapicgen/gensnippets. DO NOT EDIT. + +// [START datastream_v1alpha1_generated_Datastream_UpdateStream_sync] + +package main + +import ( + "context" + + datastream "cloud.google.com/go/datastream/apiv1alpha1" + datastreampb "google.golang.org/genproto/googleapis/cloud/datastream/v1alpha1" +) + +func main() { + ctx := context.Background() + c, err := datastream.NewClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &datastreampb.UpdateStreamRequest{ + // TODO: Fill request struct fields. + } + op, err := c.UpdateStream(ctx, req) + if err != nil { + // TODO: Handle error. + } + + resp, err := op.Wait(ctx) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +// [END datastream_v1alpha1_generated_Datastream_UpdateStream_sync] diff --git a/internal/generated/snippets/eventarc/apiv1/Client/CreateTrigger/main.go b/internal/generated/snippets/eventarc/apiv1/Client/CreateTrigger/main.go new file mode 100644 index 00000000000..74fac44dd11 --- /dev/null +++ b/internal/generated/snippets/eventarc/apiv1/Client/CreateTrigger/main.go @@ -0,0 +1,52 @@ +// Copyright 2021 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 +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by cloud.google.com/go/internal/gapicgen/gensnippets. DO NOT EDIT. + +// [START eventarc_v1_generated_Eventarc_CreateTrigger_sync] + +package main + +import ( + "context" + + eventarc "cloud.google.com/go/eventarc/apiv1" + eventarcpb "google.golang.org/genproto/googleapis/cloud/eventarc/v1" +) + +func main() { + ctx := context.Background() + c, err := eventarc.NewClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &eventarcpb.CreateTriggerRequest{ + // TODO: Fill request struct fields. + } + op, err := c.CreateTrigger(ctx, req) + if err != nil { + // TODO: Handle error. + } + + resp, err := op.Wait(ctx) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +// [END eventarc_v1_generated_Eventarc_CreateTrigger_sync] diff --git a/internal/generated/snippets/eventarc/apiv1/Client/DeleteTrigger/main.go b/internal/generated/snippets/eventarc/apiv1/Client/DeleteTrigger/main.go new file mode 100644 index 00000000000..0e75aeff8fb --- /dev/null +++ b/internal/generated/snippets/eventarc/apiv1/Client/DeleteTrigger/main.go @@ -0,0 +1,52 @@ +// Copyright 2021 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 +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by cloud.google.com/go/internal/gapicgen/gensnippets. DO NOT EDIT. + +// [START eventarc_v1_generated_Eventarc_DeleteTrigger_sync] + +package main + +import ( + "context" + + eventarc "cloud.google.com/go/eventarc/apiv1" + eventarcpb "google.golang.org/genproto/googleapis/cloud/eventarc/v1" +) + +func main() { + ctx := context.Background() + c, err := eventarc.NewClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &eventarcpb.DeleteTriggerRequest{ + // TODO: Fill request struct fields. + } + op, err := c.DeleteTrigger(ctx, req) + if err != nil { + // TODO: Handle error. + } + + resp, err := op.Wait(ctx) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +// [END eventarc_v1_generated_Eventarc_DeleteTrigger_sync] diff --git a/internal/generated/snippets/eventarc/apiv1/Client/GetTrigger/main.go b/internal/generated/snippets/eventarc/apiv1/Client/GetTrigger/main.go new file mode 100644 index 00000000000..ff021d175a6 --- /dev/null +++ b/internal/generated/snippets/eventarc/apiv1/Client/GetTrigger/main.go @@ -0,0 +1,47 @@ +// Copyright 2021 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 +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by cloud.google.com/go/internal/gapicgen/gensnippets. DO NOT EDIT. + +// [START eventarc_v1_generated_Eventarc_GetTrigger_sync] + +package main + +import ( + "context" + + eventarc "cloud.google.com/go/eventarc/apiv1" + eventarcpb "google.golang.org/genproto/googleapis/cloud/eventarc/v1" +) + +func main() { + ctx := context.Background() + c, err := eventarc.NewClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &eventarcpb.GetTriggerRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.GetTrigger(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +// [END eventarc_v1_generated_Eventarc_GetTrigger_sync] diff --git a/internal/generated/snippets/eventarc/apiv1/Client/ListTriggers/main.go b/internal/generated/snippets/eventarc/apiv1/Client/ListTriggers/main.go new file mode 100644 index 00000000000..02fb96631e2 --- /dev/null +++ b/internal/generated/snippets/eventarc/apiv1/Client/ListTriggers/main.go @@ -0,0 +1,54 @@ +// Copyright 2021 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 +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by cloud.google.com/go/internal/gapicgen/gensnippets. DO NOT EDIT. + +// [START eventarc_v1_generated_Eventarc_ListTriggers_sync] + +package main + +import ( + "context" + + eventarc "cloud.google.com/go/eventarc/apiv1" + "google.golang.org/api/iterator" + eventarcpb "google.golang.org/genproto/googleapis/cloud/eventarc/v1" +) + +func main() { + ctx := context.Background() + c, err := eventarc.NewClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &eventarcpb.ListTriggersRequest{ + // TODO: Fill request struct fields. + } + it := c.ListTriggers(ctx, req) + for { + resp, err := it.Next() + if err == iterator.Done { + break + } + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp + } +} + +// [END eventarc_v1_generated_Eventarc_ListTriggers_sync] diff --git a/internal/generated/snippets/eventarc/apiv1/Client/UpdateTrigger/main.go b/internal/generated/snippets/eventarc/apiv1/Client/UpdateTrigger/main.go new file mode 100644 index 00000000000..9b5748b2dfc --- /dev/null +++ b/internal/generated/snippets/eventarc/apiv1/Client/UpdateTrigger/main.go @@ -0,0 +1,52 @@ +// Copyright 2021 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 +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by cloud.google.com/go/internal/gapicgen/gensnippets. DO NOT EDIT. + +// [START eventarc_v1_generated_Eventarc_UpdateTrigger_sync] + +package main + +import ( + "context" + + eventarc "cloud.google.com/go/eventarc/apiv1" + eventarcpb "google.golang.org/genproto/googleapis/cloud/eventarc/v1" +) + +func main() { + ctx := context.Background() + c, err := eventarc.NewClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &eventarcpb.UpdateTriggerRequest{ + // TODO: Fill request struct fields. + } + op, err := c.UpdateTrigger(ctx, req) + if err != nil { + // TODO: Handle error. + } + + resp, err := op.Wait(ctx) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +// [END eventarc_v1_generated_Eventarc_UpdateTrigger_sync] diff --git a/internal/generated/snippets/go.mod b/internal/generated/snippets/go.mod index ffe17313edc..23d7f936c8e 100644 --- a/internal/generated/snippets/go.mod +++ b/internal/generated/snippets/go.mod @@ -32,5 +32,5 @@ require ( cloud.google.com/go/pubsublite v0.84.0 cloud.google.com/go/spanner v0.84.0 google.golang.org/api v0.49.0 - google.golang.org/genproto v0.0.0-20210629200056-84d6f6074151 + google.golang.org/genproto v0.0.0-20210630183607-d20f26d13c79 ) diff --git a/internal/generated/snippets/go.sum b/internal/generated/snippets/go.sum index c3d12cb8f30..4d8866856df 100644 --- a/internal/generated/snippets/go.sum +++ b/internal/generated/snippets/go.sum @@ -134,8 +134,9 @@ google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoA 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-20210617175327-b9e0b3197ced/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24= -google.golang.org/genproto v0.0.0-20210629200056-84d6f6074151 h1:H/uPzsolsGjhl3CVT6Wb7bK+mf+hmkEvUVu+FBKyNlc= google.golang.org/genproto v0.0.0-20210629200056-84d6f6074151/go.mod h1:yiaVoXHpRzHGyxV3o4DktVWY4mSUErTKaeEOq6C3t3U= +google.golang.org/genproto v0.0.0-20210630183607-d20f26d13c79 h1:s1jFTXJryg4a1mew7xv03VZD8N9XjxFhk1o4Js4WvPQ= +google.golang.org/genproto v0.0.0-20210630183607-d20f26d13c79/go.mod h1:yiaVoXHpRzHGyxV3o4DktVWY4mSUErTKaeEOq6C3t3U= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= diff --git a/internal/generated/snippets/workflows/executions/apiv1/Client/CancelExecution/main.go b/internal/generated/snippets/workflows/executions/apiv1/Client/CancelExecution/main.go new file mode 100644 index 00000000000..5b3b578c7e7 --- /dev/null +++ b/internal/generated/snippets/workflows/executions/apiv1/Client/CancelExecution/main.go @@ -0,0 +1,47 @@ +// Copyright 2021 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 +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by cloud.google.com/go/internal/gapicgen/gensnippets. DO NOT EDIT. + +// [START workflowexecutions_v1_generated_Executions_CancelExecution_sync] + +package main + +import ( + "context" + + executions "cloud.google.com/go/workflows/executions/apiv1" + executionspb "google.golang.org/genproto/googleapis/cloud/workflows/executions/v1" +) + +func main() { + ctx := context.Background() + c, err := executions.NewClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &executionspb.CancelExecutionRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.CancelExecution(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +// [END workflowexecutions_v1_generated_Executions_CancelExecution_sync] diff --git a/internal/generated/snippets/workflows/executions/apiv1/Client/CreateExecution/main.go b/internal/generated/snippets/workflows/executions/apiv1/Client/CreateExecution/main.go new file mode 100644 index 00000000000..6e897df78ff --- /dev/null +++ b/internal/generated/snippets/workflows/executions/apiv1/Client/CreateExecution/main.go @@ -0,0 +1,47 @@ +// Copyright 2021 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 +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by cloud.google.com/go/internal/gapicgen/gensnippets. DO NOT EDIT. + +// [START workflowexecutions_v1_generated_Executions_CreateExecution_sync] + +package main + +import ( + "context" + + executions "cloud.google.com/go/workflows/executions/apiv1" + executionspb "google.golang.org/genproto/googleapis/cloud/workflows/executions/v1" +) + +func main() { + ctx := context.Background() + c, err := executions.NewClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &executionspb.CreateExecutionRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.CreateExecution(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +// [END workflowexecutions_v1_generated_Executions_CreateExecution_sync] diff --git a/internal/generated/snippets/workflows/executions/apiv1/Client/GetExecution/main.go b/internal/generated/snippets/workflows/executions/apiv1/Client/GetExecution/main.go new file mode 100644 index 00000000000..6cd08576fee --- /dev/null +++ b/internal/generated/snippets/workflows/executions/apiv1/Client/GetExecution/main.go @@ -0,0 +1,47 @@ +// Copyright 2021 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 +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by cloud.google.com/go/internal/gapicgen/gensnippets. DO NOT EDIT. + +// [START workflowexecutions_v1_generated_Executions_GetExecution_sync] + +package main + +import ( + "context" + + executions "cloud.google.com/go/workflows/executions/apiv1" + executionspb "google.golang.org/genproto/googleapis/cloud/workflows/executions/v1" +) + +func main() { + ctx := context.Background() + c, err := executions.NewClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &executionspb.GetExecutionRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.GetExecution(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +// [END workflowexecutions_v1_generated_Executions_GetExecution_sync] diff --git a/internal/generated/snippets/workflows/executions/apiv1/Client/ListExecutions/main.go b/internal/generated/snippets/workflows/executions/apiv1/Client/ListExecutions/main.go new file mode 100644 index 00000000000..875a9825717 --- /dev/null +++ b/internal/generated/snippets/workflows/executions/apiv1/Client/ListExecutions/main.go @@ -0,0 +1,54 @@ +// Copyright 2021 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 +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by cloud.google.com/go/internal/gapicgen/gensnippets. DO NOT EDIT. + +// [START workflowexecutions_v1_generated_Executions_ListExecutions_sync] + +package main + +import ( + "context" + + executions "cloud.google.com/go/workflows/executions/apiv1" + "google.golang.org/api/iterator" + executionspb "google.golang.org/genproto/googleapis/cloud/workflows/executions/v1" +) + +func main() { + ctx := context.Background() + c, err := executions.NewClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &executionspb.ListExecutionsRequest{ + // TODO: Fill request struct fields. + } + it := c.ListExecutions(ctx, req) + for { + resp, err := it.Next() + if err == iterator.Done { + break + } + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp + } +} + +// [END workflowexecutions_v1_generated_Executions_ListExecutions_sync] diff --git a/internal/godocfx/go.sum b/internal/godocfx/go.sum index a519bf7fe51..390cdff2ac3 100644 --- a/internal/godocfx/go.sum +++ b/internal/godocfx/go.sum @@ -298,8 +298,8 @@ google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7Fc google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20200827165113-ac2560b5e952/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210617175327-b9e0b3197ced/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24= -google.golang.org/genproto v0.0.0-20210629200056-84d6f6074151 h1:H/uPzsolsGjhl3CVT6Wb7bK+mf+hmkEvUVu+FBKyNlc= -google.golang.org/genproto v0.0.0-20210629200056-84d6f6074151/go.mod h1:yiaVoXHpRzHGyxV3o4DktVWY4mSUErTKaeEOq6C3t3U= +google.golang.org/genproto v0.0.0-20210630183607-d20f26d13c79 h1:s1jFTXJryg4a1mew7xv03VZD8N9XjxFhk1o4Js4WvPQ= +google.golang.org/genproto v0.0.0-20210630183607-d20f26d13c79/go.mod h1:yiaVoXHpRzHGyxV3o4DktVWY4mSUErTKaeEOq6C3t3U= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= diff --git a/iot/apiv1/device_manager_client.go b/iot/apiv1/device_manager_client.go index f4eff633406..fe512496d00 100644 --- a/iot/apiv1/device_manager_client.go +++ b/iot/apiv1/device_manager_client.go @@ -67,6 +67,7 @@ func defaultDeviceManagerGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("cloudiot.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://cloudiot.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/iot/apiv1/doc.go b/iot/apiv1/doc.go index cec8d20d98e..3c0d3ab6fad 100644 --- a/iot/apiv1/doc.go +++ b/iot/apiv1/doc.go @@ -49,7 +49,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210624" +const versionClient = "20210630" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/kms/apiv1/doc.go b/kms/apiv1/doc.go index 06b3b2f3fef..43162dae432 100644 --- a/kms/apiv1/doc.go +++ b/kms/apiv1/doc.go @@ -49,7 +49,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210624" +const versionClient = "20210630" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/kms/apiv1/key_management_client.go b/kms/apiv1/key_management_client.go index d68b1d5626f..9f25b6d6fca 100644 --- a/kms/apiv1/key_management_client.go +++ b/kms/apiv1/key_management_client.go @@ -74,6 +74,7 @@ func defaultKeyManagementGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("cloudkms.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://cloudkms.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/language/apiv1/doc.go b/language/apiv1/doc.go index 2e28b2a2ec6..67e00822880 100644 --- a/language/apiv1/doc.go +++ b/language/apiv1/doc.go @@ -50,7 +50,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210624" +const versionClient = "20210630" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/language/apiv1/language_client.go b/language/apiv1/language_client.go index 1eaca05eb5b..2ab47ab4259 100644 --- a/language/apiv1/language_client.go +++ b/language/apiv1/language_client.go @@ -49,6 +49,7 @@ func defaultGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("language.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://language.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/language/apiv1beta2/doc.go b/language/apiv1beta2/doc.go index 293b4a3a19e..b2c16b145ee 100644 --- a/language/apiv1beta2/doc.go +++ b/language/apiv1beta2/doc.go @@ -52,7 +52,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210624" +const versionClient = "20210630" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/language/apiv1beta2/language_client.go b/language/apiv1beta2/language_client.go index 4cec1c63fb1..2b6e0ae509c 100644 --- a/language/apiv1beta2/language_client.go +++ b/language/apiv1beta2/language_client.go @@ -49,6 +49,7 @@ func defaultGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("language.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://language.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/lifesciences/apiv2beta/doc.go b/lifesciences/apiv2beta/doc.go index 47994d7136b..ffd83191ee9 100644 --- a/lifesciences/apiv2beta/doc.go +++ b/lifesciences/apiv2beta/doc.go @@ -51,7 +51,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210624" +const versionClient = "20210630" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/lifesciences/apiv2beta/workflows_service_v2_beta_client.go b/lifesciences/apiv2beta/workflows_service_v2_beta_client.go index 1f4c81814a4..13dcac8ab09 100644 --- a/lifesciences/apiv2beta/workflows_service_v2_beta_client.go +++ b/lifesciences/apiv2beta/workflows_service_v2_beta_client.go @@ -48,6 +48,7 @@ func defaultWorkflowsServiceV2BetaGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("lifesciences.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://lifesciences.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/logging/apiv2/config_client.go b/logging/apiv2/config_client.go index c61a17d2dd5..e6ff0a9a0d3 100644 --- a/logging/apiv2/config_client.go +++ b/logging/apiv2/config_client.go @@ -70,6 +70,7 @@ func defaultConfigGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("logging.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://logging.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/logging/apiv2/doc.go b/logging/apiv2/doc.go index 03ddaa30e6a..157799f9ebb 100644 --- a/logging/apiv2/doc.go +++ b/logging/apiv2/doc.go @@ -52,7 +52,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210624" +const versionClient = "20210630" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/logging/apiv2/logging_client.go b/logging/apiv2/logging_client.go index b937729eedb..42c529d019e 100644 --- a/logging/apiv2/logging_client.go +++ b/logging/apiv2/logging_client.go @@ -54,6 +54,7 @@ func defaultGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("logging.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://logging.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/logging/apiv2/metrics_client.go b/logging/apiv2/metrics_client.go index c6c8fef4677..0eb53c5bf7b 100644 --- a/logging/apiv2/metrics_client.go +++ b/logging/apiv2/metrics_client.go @@ -52,6 +52,7 @@ func defaultMetricsGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("logging.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://logging.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/logging/go.mod b/logging/go.mod index f86d8fcfe35..5842c20700e 100644 --- a/logging/go.mod +++ b/logging/go.mod @@ -10,8 +10,8 @@ require ( github.com/googleapis/gax-go/v2 v2.0.5 go.opencensus.io v0.23.0 golang.org/x/oauth2 v0.0.0-20210628180205-a41e5a781914 - google.golang.org/api v0.49.0 - google.golang.org/genproto v0.0.0-20210629200056-84d6f6074151 + google.golang.org/api v0.50.0 + google.golang.org/genproto v0.0.0-20210630183607-d20f26d13c79 google.golang.org/grpc v1.38.0 google.golang.org/protobuf v1.27.1 ) diff --git a/logging/go.sum b/logging/go.sum index 5a67c1ea1d1..ccd16df4d1b 100644 --- a/logging/go.sum +++ b/logging/go.sum @@ -253,7 +253,6 @@ golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ golang.org/x/oauth2 v0.0.0-20210220000619-9bb904979d93/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210313182246-cd4f82c27b84/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210615190721-d04028783cf1/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210628180205-a41e5a781914 h1:3B43BWw0xEBsLZ/NO1VALz6fppU3481pik+2Ksv45z8= golang.org/x/oauth2 v0.0.0-20210628180205-a41e5a781914/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -402,8 +401,8 @@ google.golang.org/api v0.41.0/go.mod h1:RkxM5lITDfTzmyKFPt+wGrCJbVfniCr2ool8kTBz google.golang.org/api v0.43.0/go.mod h1:nQsDGjRXMo4lvh5hP0TKqF244gqhGcr/YSIykhUk/94= google.golang.org/api v0.47.0/go.mod h1:Wbvgpq1HddcWVtzsVLyfLp8lDg6AA241LmgIL59tHXo= google.golang.org/api v0.48.0/go.mod h1:71Pr1vy+TAZRPkPs/xlCf5SsU8WjuAWv1Pfjbtukyy4= -google.golang.org/api v0.49.0 h1:gjIBDxlTG7vnzMmEnYwTnvLTF8Rjzo+ETCgEX1YZ/fY= -google.golang.org/api v0.49.0/go.mod h1:BECiH72wsfwUvOVn3+btPD5WHi0LzavZReBndi42L18= +google.golang.org/api v0.50.0 h1:LX7NFCFYOHzr7WHaYiRUpeipZe9o5L8T+2F4Z798VDw= +google.golang.org/api v0.50.0/go.mod h1:4bNT5pAuq5ji4SRZm+5QIkjny9JAyVD/3gaSihNefaw= 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.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= @@ -455,9 +454,9 @@ google.golang.org/genproto v0.0.0-20210513213006-bf773b8c8384/go.mod h1:P3QM42oQ google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= google.golang.org/genproto v0.0.0-20210604141403-392c879c8b08/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= google.golang.org/genproto v0.0.0-20210608205507-b6d2f5bf0d7d/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= -google.golang.org/genproto v0.0.0-20210617175327-b9e0b3197ced/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24= -google.golang.org/genproto v0.0.0-20210629200056-84d6f6074151 h1:H/uPzsolsGjhl3CVT6Wb7bK+mf+hmkEvUVu+FBKyNlc= -google.golang.org/genproto v0.0.0-20210629200056-84d6f6074151/go.mod h1:yiaVoXHpRzHGyxV3o4DktVWY4mSUErTKaeEOq6C3t3U= +google.golang.org/genproto v0.0.0-20210624195500-8bfb893ecb84/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24= +google.golang.org/genproto v0.0.0-20210630183607-d20f26d13c79 h1:s1jFTXJryg4a1mew7xv03VZD8N9XjxFhk1o4Js4WvPQ= +google.golang.org/genproto v0.0.0-20210630183607-d20f26d13c79/go.mod h1:yiaVoXHpRzHGyxV3o4DktVWY4mSUErTKaeEOq6C3t3U= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= diff --git a/longrunning/autogen/doc.go b/longrunning/autogen/doc.go index 6f783b4a371..7aee7d39003 100644 --- a/longrunning/autogen/doc.go +++ b/longrunning/autogen/doc.go @@ -48,7 +48,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210624" +const versionClient = "20210630" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/longrunning/autogen/operations_client.go b/longrunning/autogen/operations_client.go index 72704acc4f8..4d96cbc08c3 100644 --- a/longrunning/autogen/operations_client.go +++ b/longrunning/autogen/operations_client.go @@ -52,6 +52,7 @@ func defaultOperationsGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("longrunning.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://longrunning.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/managedidentities/apiv1/doc.go b/managedidentities/apiv1/doc.go index a72b7b76bc7..6225a551cdd 100644 --- a/managedidentities/apiv1/doc.go +++ b/managedidentities/apiv1/doc.go @@ -50,7 +50,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210624" +const versionClient = "20210630" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/managedidentities/apiv1/managed_identities_client.go b/managedidentities/apiv1/managed_identities_client.go index 519bca9cd49..6f9f83464f4 100644 --- a/managedidentities/apiv1/managed_identities_client.go +++ b/managedidentities/apiv1/managed_identities_client.go @@ -59,6 +59,7 @@ func defaultGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("managedidentities.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://managedidentities.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/mediatranslation/apiv1beta1/doc.go b/mediatranslation/apiv1beta1/doc.go index 61521b5dc13..8b6811bef26 100644 --- a/mediatranslation/apiv1beta1/doc.go +++ b/mediatranslation/apiv1beta1/doc.go @@ -48,7 +48,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210624" +const versionClient = "20210630" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/mediatranslation/apiv1beta1/speech_translation_client.go b/mediatranslation/apiv1beta1/speech_translation_client.go index 22e27a76ebd..3108120637c 100644 --- a/mediatranslation/apiv1beta1/speech_translation_client.go +++ b/mediatranslation/apiv1beta1/speech_translation_client.go @@ -42,6 +42,7 @@ func defaultSpeechTranslationGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("mediatranslation.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://mediatranslation.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/memcache/apiv1/cloud_memcache_client.go b/memcache/apiv1/cloud_memcache_client.go index 21433cb9945..0980f443293 100644 --- a/memcache/apiv1/cloud_memcache_client.go +++ b/memcache/apiv1/cloud_memcache_client.go @@ -56,6 +56,7 @@ func defaultCloudMemcacheGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("memcache.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://memcache.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/memcache/apiv1/doc.go b/memcache/apiv1/doc.go index a20fc3620c5..53c4fa8bf59 100644 --- a/memcache/apiv1/doc.go +++ b/memcache/apiv1/doc.go @@ -49,7 +49,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210624" +const versionClient = "20210630" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/memcache/apiv1beta2/cloud_memcache_client.go b/memcache/apiv1beta2/cloud_memcache_client.go index 5524ec0b093..02c60899004 100644 --- a/memcache/apiv1beta2/cloud_memcache_client.go +++ b/memcache/apiv1beta2/cloud_memcache_client.go @@ -57,6 +57,7 @@ func defaultCloudMemcacheGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("memcache.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://memcache.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/memcache/apiv1beta2/doc.go b/memcache/apiv1beta2/doc.go index 7200a3862d4..f4fcbf8e7af 100644 --- a/memcache/apiv1beta2/doc.go +++ b/memcache/apiv1beta2/doc.go @@ -51,7 +51,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210624" +const versionClient = "20210630" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/metastore/apiv1/dataproc_metastore_client.go b/metastore/apiv1/dataproc_metastore_client.go index 626216134b8..4563813e357 100644 --- a/metastore/apiv1/dataproc_metastore_client.go +++ b/metastore/apiv1/dataproc_metastore_client.go @@ -60,6 +60,7 @@ func defaultDataprocMetastoreGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("metastore.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://metastore.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/metastore/apiv1/doc.go b/metastore/apiv1/doc.go index d5416465e8c..30a894666f8 100644 --- a/metastore/apiv1/doc.go +++ b/metastore/apiv1/doc.go @@ -20,8 +20,6 @@ // The Dataproc Metastore API is used to manage the lifecycle and // configuration of metastore services. // -// NOTE: This package is in beta. It is not stable, and may be subject to changes. -// // Use of Context // // The ctx passed to NewClient is used for authentication requests and @@ -51,7 +49,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210624" +const versionClient = "20210630" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/metastore/apiv1alpha/dataproc_metastore_client.go b/metastore/apiv1alpha/dataproc_metastore_client.go index 22c922a3e13..dd5d147d91f 100644 --- a/metastore/apiv1alpha/dataproc_metastore_client.go +++ b/metastore/apiv1alpha/dataproc_metastore_client.go @@ -65,6 +65,7 @@ func defaultDataprocMetastoreGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("metastore.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://metastore.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/metastore/apiv1alpha/doc.go b/metastore/apiv1alpha/doc.go index 96f60b3506c..157b3d77723 100644 --- a/metastore/apiv1alpha/doc.go +++ b/metastore/apiv1alpha/doc.go @@ -51,7 +51,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210624" +const versionClient = "20210630" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/metastore/apiv1beta/dataproc_metastore_client.go b/metastore/apiv1beta/dataproc_metastore_client.go index 15edd30c42a..f949c53524e 100644 --- a/metastore/apiv1beta/dataproc_metastore_client.go +++ b/metastore/apiv1beta/dataproc_metastore_client.go @@ -65,6 +65,7 @@ func defaultDataprocMetastoreGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("metastore.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://metastore.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/metastore/apiv1beta/doc.go b/metastore/apiv1beta/doc.go index d70b86ef847..22c07e96de8 100644 --- a/metastore/apiv1beta/doc.go +++ b/metastore/apiv1beta/doc.go @@ -51,7 +51,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210624" +const versionClient = "20210630" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/monitoring/apiv3/v2/alert_policy_client.go b/monitoring/apiv3/v2/alert_policy_client.go index 08cbaea0f1d..e875fec123e 100644 --- a/monitoring/apiv3/v2/alert_policy_client.go +++ b/monitoring/apiv3/v2/alert_policy_client.go @@ -52,6 +52,7 @@ func defaultAlertPolicyGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("monitoring.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://monitoring.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/monitoring/apiv3/v2/doc.go b/monitoring/apiv3/v2/doc.go index c4273f0d1c6..27fe565031f 100644 --- a/monitoring/apiv3/v2/doc.go +++ b/monitoring/apiv3/v2/doc.go @@ -53,7 +53,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210624" +const versionClient = "20210630" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/monitoring/apiv3/v2/group_client.go b/monitoring/apiv3/v2/group_client.go index 3ee8f498ab8..29291c164c6 100644 --- a/monitoring/apiv3/v2/group_client.go +++ b/monitoring/apiv3/v2/group_client.go @@ -54,6 +54,7 @@ func defaultGroupGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("monitoring.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://monitoring.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/monitoring/apiv3/v2/metric_client.go b/monitoring/apiv3/v2/metric_client.go index f294f7e08ba..59949cb7bfd 100644 --- a/monitoring/apiv3/v2/metric_client.go +++ b/monitoring/apiv3/v2/metric_client.go @@ -57,6 +57,7 @@ func defaultMetricGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("monitoring.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://monitoring.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/monitoring/apiv3/v2/notification_channel_client.go b/monitoring/apiv3/v2/notification_channel_client.go index b1f50db8b53..a7d17a01105 100644 --- a/monitoring/apiv3/v2/notification_channel_client.go +++ b/monitoring/apiv3/v2/notification_channel_client.go @@ -57,6 +57,7 @@ func defaultNotificationChannelGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("monitoring.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://monitoring.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/monitoring/apiv3/v2/query_client.go b/monitoring/apiv3/v2/query_client.go index e2f8cbba0ab..adef424e002 100644 --- a/monitoring/apiv3/v2/query_client.go +++ b/monitoring/apiv3/v2/query_client.go @@ -46,6 +46,7 @@ func defaultQueryGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("monitoring.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://monitoring.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/monitoring/apiv3/v2/service_monitoring_client.go b/monitoring/apiv3/v2/service_monitoring_client.go index 07cff2f8a41..84ad1a302f8 100644 --- a/monitoring/apiv3/v2/service_monitoring_client.go +++ b/monitoring/apiv3/v2/service_monitoring_client.go @@ -57,6 +57,7 @@ func defaultServiceMonitoringGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("monitoring.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://monitoring.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/monitoring/apiv3/v2/uptime_check_client.go b/monitoring/apiv3/v2/uptime_check_client.go index 37634947dd2..cb9591d708e 100644 --- a/monitoring/apiv3/v2/uptime_check_client.go +++ b/monitoring/apiv3/v2/uptime_check_client.go @@ -53,6 +53,7 @@ func defaultUptimeCheckGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("monitoring.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://monitoring.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/monitoring/dashboard/apiv1/dashboards_client.go b/monitoring/dashboard/apiv1/dashboards_client.go index 70e39b89c8b..3d0b2951c70 100644 --- a/monitoring/dashboard/apiv1/dashboards_client.go +++ b/monitoring/dashboard/apiv1/dashboards_client.go @@ -52,6 +52,7 @@ func defaultDashboardsGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("monitoring.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://monitoring.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/monitoring/dashboard/apiv1/doc.go b/monitoring/dashboard/apiv1/doc.go index e6039b0085c..729b4640d95 100644 --- a/monitoring/dashboard/apiv1/doc.go +++ b/monitoring/dashboard/apiv1/doc.go @@ -53,7 +53,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210624" +const versionClient = "20210630" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/networkconnectivity/apiv1alpha1/doc.go b/networkconnectivity/apiv1alpha1/doc.go index f9e121de625..e6011482360 100644 --- a/networkconnectivity/apiv1alpha1/doc.go +++ b/networkconnectivity/apiv1alpha1/doc.go @@ -51,7 +51,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210624" +const versionClient = "20210630" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/networkconnectivity/apiv1alpha1/hub_client.go b/networkconnectivity/apiv1alpha1/hub_client.go index 20b4e2088e2..21dda2292ef 100644 --- a/networkconnectivity/apiv1alpha1/hub_client.go +++ b/networkconnectivity/apiv1alpha1/hub_client.go @@ -60,6 +60,7 @@ func defaultHubGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("networkconnectivity.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://networkconnectivity.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/notebooks/apiv1beta1/doc.go b/notebooks/apiv1beta1/doc.go index f47af480b54..0c93c0dcf6c 100644 --- a/notebooks/apiv1beta1/doc.go +++ b/notebooks/apiv1beta1/doc.go @@ -51,7 +51,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210624" +const versionClient = "20210630" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/notebooks/apiv1beta1/notebook_client.go b/notebooks/apiv1beta1/notebook_client.go index 58557df52d9..dd8dc76fd89 100644 --- a/notebooks/apiv1beta1/notebook_client.go +++ b/notebooks/apiv1beta1/notebook_client.go @@ -68,6 +68,7 @@ func defaultNotebookGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("notebooks.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://notebooks.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/orgpolicy/apiv2/doc.go b/orgpolicy/apiv2/doc.go index 576f37df166..d55489e4dec 100644 --- a/orgpolicy/apiv2/doc.go +++ b/orgpolicy/apiv2/doc.go @@ -49,7 +49,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210624" +const versionClient = "20210630" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/orgpolicy/apiv2/org_policy_client.go b/orgpolicy/apiv2/org_policy_client.go index 53c4803ca71..d61e2ff57dd 100644 --- a/orgpolicy/apiv2/org_policy_client.go +++ b/orgpolicy/apiv2/org_policy_client.go @@ -54,6 +54,7 @@ func defaultGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("orgpolicy.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://orgpolicy.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/osconfig/agentendpoint/apiv1/agent_endpoint_client.go b/osconfig/agentendpoint/apiv1/agent_endpoint_client.go index 90e9fdbb100..ec28aef02c5 100644 --- a/osconfig/agentendpoint/apiv1/agent_endpoint_client.go +++ b/osconfig/agentendpoint/apiv1/agent_endpoint_client.go @@ -49,6 +49,7 @@ func defaultGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("osconfig.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://osconfig.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/osconfig/agentendpoint/apiv1/doc.go b/osconfig/agentendpoint/apiv1/doc.go index c79007e5f3d..89b757f3fa2 100644 --- a/osconfig/agentendpoint/apiv1/doc.go +++ b/osconfig/agentendpoint/apiv1/doc.go @@ -49,7 +49,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210624" +const versionClient = "20210630" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/osconfig/agentendpoint/apiv1beta/agent_endpoint_client.go b/osconfig/agentendpoint/apiv1beta/agent_endpoint_client.go index f66140bac7e..67a079bc9fb 100644 --- a/osconfig/agentendpoint/apiv1beta/agent_endpoint_client.go +++ b/osconfig/agentendpoint/apiv1beta/agent_endpoint_client.go @@ -49,6 +49,7 @@ func defaultGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("osconfig.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://osconfig.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/osconfig/agentendpoint/apiv1beta/doc.go b/osconfig/agentendpoint/apiv1beta/doc.go index a6d659fcc8b..10b866c4d9e 100644 --- a/osconfig/agentendpoint/apiv1beta/doc.go +++ b/osconfig/agentendpoint/apiv1beta/doc.go @@ -51,7 +51,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210624" +const versionClient = "20210630" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/osconfig/apiv1/doc.go b/osconfig/apiv1/doc.go index ad284825e88..7f30e0d4f36 100644 --- a/osconfig/apiv1/doc.go +++ b/osconfig/apiv1/doc.go @@ -49,7 +49,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210624" +const versionClient = "20210630" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/osconfig/apiv1/os_config_client.go b/osconfig/apiv1/os_config_client.go index 46398532f8e..3da4c4e7d24 100644 --- a/osconfig/apiv1/os_config_client.go +++ b/osconfig/apiv1/os_config_client.go @@ -56,6 +56,7 @@ func defaultGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("osconfig.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://osconfig.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/osconfig/apiv1alpha/doc.go b/osconfig/apiv1alpha/doc.go index a60f17c6a53..f536fe15e1b 100644 --- a/osconfig/apiv1alpha/doc.go +++ b/osconfig/apiv1alpha/doc.go @@ -51,7 +51,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210624" +const versionClient = "20210630" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/osconfig/apiv1alpha/os_config_zonal_client.go b/osconfig/apiv1alpha/os_config_zonal_client.go index f97528abef3..05cd54e5c0f 100644 --- a/osconfig/apiv1alpha/os_config_zonal_client.go +++ b/osconfig/apiv1alpha/os_config_zonal_client.go @@ -62,6 +62,7 @@ func defaultOsConfigZonalGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("osconfig.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://osconfig.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/osconfig/apiv1beta/doc.go b/osconfig/apiv1beta/doc.go index bd797ba1fcd..28a1bacd5f9 100644 --- a/osconfig/apiv1beta/doc.go +++ b/osconfig/apiv1beta/doc.go @@ -51,7 +51,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210624" +const versionClient = "20210630" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/osconfig/apiv1beta/os_config_client.go b/osconfig/apiv1beta/os_config_client.go index 0a727347fc2..eed122d4b10 100644 --- a/osconfig/apiv1beta/os_config_client.go +++ b/osconfig/apiv1beta/os_config_client.go @@ -62,6 +62,7 @@ func defaultGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("osconfig.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://osconfig.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/oslogin/apiv1/doc.go b/oslogin/apiv1/doc.go index d6e4f0131d3..29cd8bc06dd 100644 --- a/oslogin/apiv1/doc.go +++ b/oslogin/apiv1/doc.go @@ -49,7 +49,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210624" +const versionClient = "20210630" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/oslogin/apiv1/os_login_client.go b/oslogin/apiv1/os_login_client.go index 1594af36ba0..7c8b2581864 100644 --- a/oslogin/apiv1/os_login_client.go +++ b/oslogin/apiv1/os_login_client.go @@ -52,6 +52,7 @@ func defaultGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("oslogin.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://oslogin.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/oslogin/apiv1beta/doc.go b/oslogin/apiv1beta/doc.go index 14268a60b9d..513a6d8f831 100644 --- a/oslogin/apiv1beta/doc.go +++ b/oslogin/apiv1beta/doc.go @@ -51,7 +51,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210624" +const versionClient = "20210630" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/oslogin/apiv1beta/os_login_client.go b/oslogin/apiv1beta/os_login_client.go index 8e63d4706a8..3bc85d090bf 100644 --- a/oslogin/apiv1beta/os_login_client.go +++ b/oslogin/apiv1beta/os_login_client.go @@ -52,6 +52,7 @@ func defaultGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("oslogin.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://oslogin.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/phishingprotection/apiv1beta1/doc.go b/phishingprotection/apiv1beta1/doc.go index 27b119b671e..f8d1981beb4 100644 --- a/phishingprotection/apiv1beta1/doc.go +++ b/phishingprotection/apiv1beta1/doc.go @@ -48,7 +48,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210624" +const versionClient = "20210630" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/phishingprotection/apiv1beta1/phishing_protection_service_v1_beta1_client.go b/phishingprotection/apiv1beta1/phishing_protection_service_v1_beta1_client.go index 64943acc500..70769c204d2 100644 --- a/phishingprotection/apiv1beta1/phishing_protection_service_v1_beta1_client.go +++ b/phishingprotection/apiv1beta1/phishing_protection_service_v1_beta1_client.go @@ -45,6 +45,7 @@ func defaultPhishingProtectionServiceV1Beta1GRPCClientOptions() []option.ClientO internaloption.WithDefaultMTLSEndpoint("phishingprotection.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://phishingprotection.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/policytroubleshooter/apiv1/doc.go b/policytroubleshooter/apiv1/doc.go index 3229d999a45..98329ea8d12 100644 --- a/policytroubleshooter/apiv1/doc.go +++ b/policytroubleshooter/apiv1/doc.go @@ -46,7 +46,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210624" +const versionClient = "20210630" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/policytroubleshooter/apiv1/iam_checker_client.go b/policytroubleshooter/apiv1/iam_checker_client.go index 47dcd1c9bb2..e7286bb16e9 100644 --- a/policytroubleshooter/apiv1/iam_checker_client.go +++ b/policytroubleshooter/apiv1/iam_checker_client.go @@ -43,6 +43,7 @@ func defaultIamCheckerGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("policytroubleshooter.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://policytroubleshooter.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/privatecatalog/apiv1beta1/doc.go b/privatecatalog/apiv1beta1/doc.go index 2e2ed145a4c..fc9e625eebb 100644 --- a/privatecatalog/apiv1beta1/doc.go +++ b/privatecatalog/apiv1beta1/doc.go @@ -51,7 +51,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210624" +const versionClient = "20210630" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/privatecatalog/apiv1beta1/private_catalog_client.go b/privatecatalog/apiv1beta1/private_catalog_client.go index 9add8238b6f..858e0a2a12a 100644 --- a/privatecatalog/apiv1beta1/private_catalog_client.go +++ b/privatecatalog/apiv1beta1/private_catalog_client.go @@ -48,6 +48,7 @@ func defaultGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("cloudprivatecatalog.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://cloudprivatecatalog.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/pubsub/apiv1/doc.go b/pubsub/apiv1/doc.go index 41af5aefd0e..4f7c31c86b3 100644 --- a/pubsub/apiv1/doc.go +++ b/pubsub/apiv1/doc.go @@ -49,7 +49,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210624" +const versionClient = "20210630" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/pubsub/apiv1/publisher_client.go b/pubsub/apiv1/publisher_client.go index ba42d687cbc..c91def3a905 100644 --- a/pubsub/apiv1/publisher_client.go +++ b/pubsub/apiv1/publisher_client.go @@ -60,6 +60,7 @@ func defaultPublisherGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("pubsub.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://pubsub.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/pubsub/apiv1/schema_client.go b/pubsub/apiv1/schema_client.go index a66430ec007..7d9774ef3f3 100644 --- a/pubsub/apiv1/schema_client.go +++ b/pubsub/apiv1/schema_client.go @@ -55,6 +55,7 @@ func defaultSchemaGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("pubsub.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://pubsub.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/pubsub/apiv1/subscriber_client.go b/pubsub/apiv1/subscriber_client.go index be8b9908d6c..eb78a4d41e8 100644 --- a/pubsub/apiv1/subscriber_client.go +++ b/pubsub/apiv1/subscriber_client.go @@ -67,6 +67,7 @@ func defaultSubscriberGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("pubsub.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://pubsub.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/pubsub/go.mod b/pubsub/go.mod index ca89d5a3f3d..3b84c79b4a7 100644 --- a/pubsub/go.mod +++ b/pubsub/go.mod @@ -11,8 +11,8 @@ require ( golang.org/x/oauth2 v0.0.0-20210628180205-a41e5a781914 golang.org/x/sync v0.0.0-20210220032951-036812b2e83c golang.org/x/time v0.0.0-20210611083556-38a9dc6acbc6 - google.golang.org/api v0.49.0 - google.golang.org/genproto v0.0.0-20210629200056-84d6f6074151 + google.golang.org/api v0.50.0 + google.golang.org/genproto v0.0.0-20210630183607-d20f26d13c79 google.golang.org/grpc v1.38.0 google.golang.org/protobuf v1.27.1 ) diff --git a/pubsub/go.sum b/pubsub/go.sum index e1ca5a5cf44..abf3e80d543 100644 --- a/pubsub/go.sum +++ b/pubsub/go.sum @@ -249,7 +249,6 @@ golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ golang.org/x/oauth2 v0.0.0-20210220000619-9bb904979d93/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210313182246-cd4f82c27b84/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210615190721-d04028783cf1/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210628180205-a41e5a781914 h1:3B43BWw0xEBsLZ/NO1VALz6fppU3481pik+2Ksv45z8= golang.org/x/oauth2 v0.0.0-20210628180205-a41e5a781914/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -400,8 +399,8 @@ google.golang.org/api v0.41.0/go.mod h1:RkxM5lITDfTzmyKFPt+wGrCJbVfniCr2ool8kTBz google.golang.org/api v0.43.0/go.mod h1:nQsDGjRXMo4lvh5hP0TKqF244gqhGcr/YSIykhUk/94= google.golang.org/api v0.47.0/go.mod h1:Wbvgpq1HddcWVtzsVLyfLp8lDg6AA241LmgIL59tHXo= google.golang.org/api v0.48.0/go.mod h1:71Pr1vy+TAZRPkPs/xlCf5SsU8WjuAWv1Pfjbtukyy4= -google.golang.org/api v0.49.0 h1:gjIBDxlTG7vnzMmEnYwTnvLTF8Rjzo+ETCgEX1YZ/fY= -google.golang.org/api v0.49.0/go.mod h1:BECiH72wsfwUvOVn3+btPD5WHi0LzavZReBndi42L18= +google.golang.org/api v0.50.0 h1:LX7NFCFYOHzr7WHaYiRUpeipZe9o5L8T+2F4Z798VDw= +google.golang.org/api v0.50.0/go.mod h1:4bNT5pAuq5ji4SRZm+5QIkjny9JAyVD/3gaSihNefaw= 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.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= @@ -453,9 +452,9 @@ google.golang.org/genproto v0.0.0-20210513213006-bf773b8c8384/go.mod h1:P3QM42oQ google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= google.golang.org/genproto v0.0.0-20210604141403-392c879c8b08/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= google.golang.org/genproto v0.0.0-20210608205507-b6d2f5bf0d7d/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= -google.golang.org/genproto v0.0.0-20210617175327-b9e0b3197ced/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24= -google.golang.org/genproto v0.0.0-20210629200056-84d6f6074151 h1:H/uPzsolsGjhl3CVT6Wb7bK+mf+hmkEvUVu+FBKyNlc= -google.golang.org/genproto v0.0.0-20210629200056-84d6f6074151/go.mod h1:yiaVoXHpRzHGyxV3o4DktVWY4mSUErTKaeEOq6C3t3U= +google.golang.org/genproto v0.0.0-20210624195500-8bfb893ecb84/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24= +google.golang.org/genproto v0.0.0-20210630183607-d20f26d13c79 h1:s1jFTXJryg4a1mew7xv03VZD8N9XjxFhk1o4Js4WvPQ= +google.golang.org/genproto v0.0.0-20210630183607-d20f26d13c79/go.mod h1:yiaVoXHpRzHGyxV3o4DktVWY4mSUErTKaeEOq6C3t3U= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= diff --git a/pubsublite/apiv1/admin_client.go b/pubsublite/apiv1/admin_client.go index 29181291c39..c4097fdcd54 100644 --- a/pubsublite/apiv1/admin_client.go +++ b/pubsublite/apiv1/admin_client.go @@ -69,6 +69,7 @@ func defaultAdminGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("pubsublite.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://pubsublite.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/pubsublite/apiv1/cursor_client.go b/pubsublite/apiv1/cursor_client.go index aa07a7acc1c..4bf0e3779a9 100644 --- a/pubsublite/apiv1/cursor_client.go +++ b/pubsublite/apiv1/cursor_client.go @@ -50,6 +50,7 @@ func defaultCursorGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("pubsublite.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://pubsublite.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/pubsublite/apiv1/doc.go b/pubsublite/apiv1/doc.go index 8e6770380b5..facfd16cabc 100644 --- a/pubsublite/apiv1/doc.go +++ b/pubsublite/apiv1/doc.go @@ -48,7 +48,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210624" +const versionClient = "20210630" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/pubsublite/apiv1/partition_assignment_client.go b/pubsublite/apiv1/partition_assignment_client.go index 29b9ec8578f..46fcdae435c 100644 --- a/pubsublite/apiv1/partition_assignment_client.go +++ b/pubsublite/apiv1/partition_assignment_client.go @@ -42,6 +42,7 @@ func defaultPartitionAssignmentGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("pubsublite.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://pubsublite.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/pubsublite/apiv1/publisher_client.go b/pubsublite/apiv1/publisher_client.go index 41ed5b94ba0..34722003252 100644 --- a/pubsublite/apiv1/publisher_client.go +++ b/pubsublite/apiv1/publisher_client.go @@ -42,6 +42,7 @@ func defaultPublisherGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("pubsublite.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://pubsublite.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/pubsublite/apiv1/subscriber_client.go b/pubsublite/apiv1/subscriber_client.go index 7b076748002..995bc80c55e 100644 --- a/pubsublite/apiv1/subscriber_client.go +++ b/pubsublite/apiv1/subscriber_client.go @@ -42,6 +42,7 @@ func defaultSubscriberGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("pubsublite.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://pubsublite.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/pubsublite/apiv1/topic_stats_client.go b/pubsublite/apiv1/topic_stats_client.go index 6b43a3a69bd..dd1c5afc1cb 100644 --- a/pubsublite/apiv1/topic_stats_client.go +++ b/pubsublite/apiv1/topic_stats_client.go @@ -48,6 +48,7 @@ func defaultTopicStatsGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("pubsublite.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://pubsublite.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/pubsublite/go.mod b/pubsublite/go.mod index e632bb49b68..16fc15756cf 100644 --- a/pubsublite/go.mod +++ b/pubsublite/go.mod @@ -11,8 +11,8 @@ require ( github.com/googleapis/gax-go/v2 v2.0.5 golang.org/x/sync v0.0.0-20210220032951-036812b2e83c golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 - google.golang.org/api v0.49.0 - google.golang.org/genproto v0.0.0-20210629200056-84d6f6074151 + google.golang.org/api v0.50.0 + google.golang.org/genproto v0.0.0-20210630183607-d20f26d13c79 google.golang.org/grpc v1.38.0 google.golang.org/protobuf v1.27.1 ) diff --git a/pubsublite/go.sum b/pubsublite/go.sum index f57f8077c1e..9c7faf2ef99 100644 --- a/pubsublite/go.sum +++ b/pubsublite/go.sum @@ -255,8 +255,8 @@ golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ golang.org/x/oauth2 v0.0.0-20210220000619-9bb904979d93/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210313182246-cd4f82c27b84/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210615190721-d04028783cf1 h1:x622Z2o4hgCr/4CiKWc51jHVKaWdtVpBNmEI8wI9Qns= -golang.org/x/oauth2 v0.0.0-20210615190721-d04028783cf1/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210628180205-a41e5a781914 h1:3B43BWw0xEBsLZ/NO1VALz6fppU3481pik+2Ksv45z8= +golang.org/x/oauth2 v0.0.0-20210628180205-a41e5a781914/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -405,8 +405,8 @@ google.golang.org/api v0.41.0/go.mod h1:RkxM5lITDfTzmyKFPt+wGrCJbVfniCr2ool8kTBz google.golang.org/api v0.43.0/go.mod h1:nQsDGjRXMo4lvh5hP0TKqF244gqhGcr/YSIykhUk/94= google.golang.org/api v0.47.0/go.mod h1:Wbvgpq1HddcWVtzsVLyfLp8lDg6AA241LmgIL59tHXo= google.golang.org/api v0.48.0/go.mod h1:71Pr1vy+TAZRPkPs/xlCf5SsU8WjuAWv1Pfjbtukyy4= -google.golang.org/api v0.49.0 h1:gjIBDxlTG7vnzMmEnYwTnvLTF8Rjzo+ETCgEX1YZ/fY= -google.golang.org/api v0.49.0/go.mod h1:BECiH72wsfwUvOVn3+btPD5WHi0LzavZReBndi42L18= +google.golang.org/api v0.50.0 h1:LX7NFCFYOHzr7WHaYiRUpeipZe9o5L8T+2F4Z798VDw= +google.golang.org/api v0.50.0/go.mod h1:4bNT5pAuq5ji4SRZm+5QIkjny9JAyVD/3gaSihNefaw= 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.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= @@ -460,9 +460,9 @@ google.golang.org/genproto v0.0.0-20210513213006-bf773b8c8384/go.mod h1:P3QM42oQ google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= google.golang.org/genproto v0.0.0-20210604141403-392c879c8b08/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= google.golang.org/genproto v0.0.0-20210608205507-b6d2f5bf0d7d/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= -google.golang.org/genproto v0.0.0-20210617175327-b9e0b3197ced/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24= -google.golang.org/genproto v0.0.0-20210629200056-84d6f6074151 h1:H/uPzsolsGjhl3CVT6Wb7bK+mf+hmkEvUVu+FBKyNlc= -google.golang.org/genproto v0.0.0-20210629200056-84d6f6074151/go.mod h1:yiaVoXHpRzHGyxV3o4DktVWY4mSUErTKaeEOq6C3t3U= +google.golang.org/genproto v0.0.0-20210624195500-8bfb893ecb84/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24= +google.golang.org/genproto v0.0.0-20210630183607-d20f26d13c79 h1:s1jFTXJryg4a1mew7xv03VZD8N9XjxFhk1o4Js4WvPQ= +google.golang.org/genproto v0.0.0-20210630183607-d20f26d13c79/go.mod h1:yiaVoXHpRzHGyxV3o4DktVWY4mSUErTKaeEOq6C3t3U= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= diff --git a/recaptchaenterprise/apiv1/doc.go b/recaptchaenterprise/apiv1/doc.go index 90d720ca3e5..f71d43aa545 100644 --- a/recaptchaenterprise/apiv1/doc.go +++ b/recaptchaenterprise/apiv1/doc.go @@ -46,7 +46,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210624" +const versionClient = "20210630" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/recaptchaenterprise/apiv1/recaptcha_enterprise_client.go b/recaptchaenterprise/apiv1/recaptcha_enterprise_client.go index e656ee2a42a..35c8184e0ad 100644 --- a/recaptchaenterprise/apiv1/recaptcha_enterprise_client.go +++ b/recaptchaenterprise/apiv1/recaptcha_enterprise_client.go @@ -53,6 +53,7 @@ func defaultGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("recaptchaenterprise.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://recaptchaenterprise.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/recaptchaenterprise/apiv1beta1/doc.go b/recaptchaenterprise/apiv1beta1/doc.go index 80cb5e44213..f4a33838174 100644 --- a/recaptchaenterprise/apiv1beta1/doc.go +++ b/recaptchaenterprise/apiv1beta1/doc.go @@ -48,7 +48,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210624" +const versionClient = "20210630" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/recaptchaenterprise/apiv1beta1/recaptcha_enterprise_service_v1_beta1_client.go b/recaptchaenterprise/apiv1beta1/recaptcha_enterprise_service_v1_beta1_client.go index 3a154403baa..14f4f9d8789 100644 --- a/recaptchaenterprise/apiv1beta1/recaptcha_enterprise_service_v1_beta1_client.go +++ b/recaptchaenterprise/apiv1beta1/recaptcha_enterprise_service_v1_beta1_client.go @@ -53,6 +53,7 @@ func defaultRecaptchaEnterpriseServiceV1Beta1GRPCClientOptions() []option.Client internaloption.WithDefaultMTLSEndpoint("recaptchaenterprise.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://recaptchaenterprise.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/recommender/apiv1/doc.go b/recommender/apiv1/doc.go index 34cb493ec7a..f487bf7ac7c 100644 --- a/recommender/apiv1/doc.go +++ b/recommender/apiv1/doc.go @@ -46,7 +46,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210624" +const versionClient = "20210630" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/recommender/apiv1/recommender_client.go b/recommender/apiv1/recommender_client.go index a6e5b228fa6..970818a5c33 100644 --- a/recommender/apiv1/recommender_client.go +++ b/recommender/apiv1/recommender_client.go @@ -55,6 +55,7 @@ func defaultGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("recommender.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://recommender.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/recommender/apiv1beta1/doc.go b/recommender/apiv1beta1/doc.go index 1df94bcdc52..439ea9ae942 100644 --- a/recommender/apiv1beta1/doc.go +++ b/recommender/apiv1beta1/doc.go @@ -48,7 +48,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210624" +const versionClient = "20210630" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/recommender/apiv1beta1/recommender_client.go b/recommender/apiv1beta1/recommender_client.go index 66b3632c9a2..78b7508dfc0 100644 --- a/recommender/apiv1beta1/recommender_client.go +++ b/recommender/apiv1beta1/recommender_client.go @@ -55,6 +55,7 @@ func defaultGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("recommender.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://recommender.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/redis/apiv1/cloud_redis_client.go b/redis/apiv1/cloud_redis_client.go index e5bd71f8298..513bb8ec2a5 100644 --- a/redis/apiv1/cloud_redis_client.go +++ b/redis/apiv1/cloud_redis_client.go @@ -58,6 +58,7 @@ func defaultCloudRedisGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("redis.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://redis.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/redis/apiv1/doc.go b/redis/apiv1/doc.go index 40be1df0d29..309eb9c97e9 100644 --- a/redis/apiv1/doc.go +++ b/redis/apiv1/doc.go @@ -48,7 +48,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210624" +const versionClient = "20210630" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/redis/apiv1beta1/cloud_redis_client.go b/redis/apiv1beta1/cloud_redis_client.go index d739b5abe30..6d4ed1fe6b2 100644 --- a/redis/apiv1beta1/cloud_redis_client.go +++ b/redis/apiv1beta1/cloud_redis_client.go @@ -59,6 +59,7 @@ func defaultCloudRedisGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("redis.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://redis.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/redis/apiv1beta1/doc.go b/redis/apiv1beta1/doc.go index c9d684db700..c11875d34c1 100644 --- a/redis/apiv1beta1/doc.go +++ b/redis/apiv1beta1/doc.go @@ -50,7 +50,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210624" +const versionClient = "20210630" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/resourcemanager/apiv2/doc.go b/resourcemanager/apiv2/doc.go index 7c68c311aad..323ca943a43 100644 --- a/resourcemanager/apiv2/doc.go +++ b/resourcemanager/apiv2/doc.go @@ -49,7 +49,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210624" +const versionClient = "20210630" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/resourcemanager/apiv2/folders_client.go b/resourcemanager/apiv2/folders_client.go index f0436b3a02e..647b4f42190 100644 --- a/resourcemanager/apiv2/folders_client.go +++ b/resourcemanager/apiv2/folders_client.go @@ -61,6 +61,7 @@ func defaultFoldersGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("cloudresourcemanager.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://cloudresourcemanager.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/resourcesettings/apiv1/doc.go b/resourcesettings/apiv1/doc.go index ace04f2ff04..74794a8b9a5 100644 --- a/resourcesettings/apiv1/doc.go +++ b/resourcesettings/apiv1/doc.go @@ -21,8 +21,6 @@ // of their GCP resources (e.g., VM, firewall, Project, etc.) across the // Cloud Resource Hierarchy. // -// NOTE: This package is in beta. It is not stable, and may be subject to changes. -// // Use of Context // // The ctx passed to NewClient is used for authentication requests and @@ -52,7 +50,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210624" +const versionClient = "20210630" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/resourcesettings/apiv1/resource_settings_client.go b/resourcesettings/apiv1/resource_settings_client.go index fd32386b65b..90df08f7465 100644 --- a/resourcesettings/apiv1/resource_settings_client.go +++ b/resourcesettings/apiv1/resource_settings_client.go @@ -50,6 +50,7 @@ func defaultGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("resourcesettings.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://resourcesettings.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/retail/apiv2/catalog_client.go b/retail/apiv2/catalog_client.go index 062693c55d9..9dcf9fa8f79 100644 --- a/retail/apiv2/catalog_client.go +++ b/retail/apiv2/catalog_client.go @@ -49,6 +49,7 @@ func defaultCatalogGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("retail.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://retail.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/retail/apiv2/doc.go b/retail/apiv2/doc.go index b79f9834051..06b272ce5b1 100644 --- a/retail/apiv2/doc.go +++ b/retail/apiv2/doc.go @@ -50,7 +50,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210624" +const versionClient = "20210630" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/retail/apiv2/prediction_client.go b/retail/apiv2/prediction_client.go index a07bba9331d..6e0f384adcc 100644 --- a/retail/apiv2/prediction_client.go +++ b/retail/apiv2/prediction_client.go @@ -46,6 +46,7 @@ func defaultPredictionGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("retail.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://retail.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/retail/apiv2/product_client.go b/retail/apiv2/product_client.go index 93054baf414..44cb5bbc0ea 100644 --- a/retail/apiv2/product_client.go +++ b/retail/apiv2/product_client.go @@ -53,6 +53,7 @@ func defaultProductGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("retail.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://retail.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/retail/apiv2/user_event_client.go b/retail/apiv2/user_event_client.go index 28f6e7ec233..b4cc464f4f6 100644 --- a/retail/apiv2/user_event_client.go +++ b/retail/apiv2/user_event_client.go @@ -54,6 +54,7 @@ func defaultUserEventGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("retail.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://retail.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/scheduler/apiv1/cloud_scheduler_client.go b/scheduler/apiv1/cloud_scheduler_client.go index 8c71458d9cc..b8452e56e52 100644 --- a/scheduler/apiv1/cloud_scheduler_client.go +++ b/scheduler/apiv1/cloud_scheduler_client.go @@ -55,6 +55,7 @@ func defaultCloudSchedulerGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("cloudscheduler.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://cloudscheduler.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/scheduler/apiv1/doc.go b/scheduler/apiv1/doc.go index 796b6a156f7..b4576410e7a 100644 --- a/scheduler/apiv1/doc.go +++ b/scheduler/apiv1/doc.go @@ -48,7 +48,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210624" +const versionClient = "20210630" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/scheduler/apiv1beta1/cloud_scheduler_client.go b/scheduler/apiv1beta1/cloud_scheduler_client.go index df096a80227..3c9e663d978 100644 --- a/scheduler/apiv1beta1/cloud_scheduler_client.go +++ b/scheduler/apiv1beta1/cloud_scheduler_client.go @@ -55,6 +55,7 @@ func defaultCloudSchedulerGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("cloudscheduler.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://cloudscheduler.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/scheduler/apiv1beta1/doc.go b/scheduler/apiv1beta1/doc.go index 6bacfce11e1..6751ab7c053 100644 --- a/scheduler/apiv1beta1/doc.go +++ b/scheduler/apiv1beta1/doc.go @@ -50,7 +50,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210624" +const versionClient = "20210630" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/secretmanager/apiv1/doc.go b/secretmanager/apiv1/doc.go index e6b672bcebd..1c0eb0450b7 100644 --- a/secretmanager/apiv1/doc.go +++ b/secretmanager/apiv1/doc.go @@ -49,7 +49,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210624" +const versionClient = "20210630" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/secretmanager/apiv1/secret_manager_client.go b/secretmanager/apiv1/secret_manager_client.go index def41a41941..eb17f812bed 100644 --- a/secretmanager/apiv1/secret_manager_client.go +++ b/secretmanager/apiv1/secret_manager_client.go @@ -63,6 +63,7 @@ func defaultGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("secretmanager.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://secretmanager.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/secretmanager/apiv1beta1/doc.go b/secretmanager/apiv1beta1/doc.go index 2291878c721..14e5b7cefdf 100644 --- a/secretmanager/apiv1beta1/doc.go +++ b/secretmanager/apiv1beta1/doc.go @@ -51,7 +51,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210624" +const versionClient = "20210630" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/secretmanager/apiv1beta1/secret_manager_client.go b/secretmanager/apiv1beta1/secret_manager_client.go index e7230938ef6..6a5dcab8395 100644 --- a/secretmanager/apiv1beta1/secret_manager_client.go +++ b/secretmanager/apiv1beta1/secret_manager_client.go @@ -63,6 +63,7 @@ func defaultGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("secretmanager.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://secretmanager.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/security/privateca/apiv1/certificate_authority_client.go b/security/privateca/apiv1/certificate_authority_client.go index 014e1f46527..e8526626769 100644 --- a/security/privateca/apiv1/certificate_authority_client.go +++ b/security/privateca/apiv1/certificate_authority_client.go @@ -79,6 +79,7 @@ func defaultCertificateAuthorityGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("privateca.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://privateca.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/security/privateca/apiv1/doc.go b/security/privateca/apiv1/doc.go index b742d7d407b..b905a6daf0f 100644 --- a/security/privateca/apiv1/doc.go +++ b/security/privateca/apiv1/doc.go @@ -22,8 +22,6 @@ // private certificate authorities (CAs) while staying in control of your // private keys." // -// NOTE: This package is in beta. It is not stable, and may be subject to changes. -// // Use of Context // // The ctx passed to NewClient is used for authentication requests and @@ -53,7 +51,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210624" +const versionClient = "20210630" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/security/privateca/apiv1beta1/certificate_authority_client.go b/security/privateca/apiv1beta1/certificate_authority_client.go index b63606c9d87..4f5f9c043e5 100644 --- a/security/privateca/apiv1beta1/certificate_authority_client.go +++ b/security/privateca/apiv1beta1/certificate_authority_client.go @@ -70,6 +70,7 @@ func defaultCertificateAuthorityGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("privateca.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://privateca.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/security/privateca/apiv1beta1/doc.go b/security/privateca/apiv1beta1/doc.go index 576b02875bc..008aaa9c967 100644 --- a/security/privateca/apiv1beta1/doc.go +++ b/security/privateca/apiv1beta1/doc.go @@ -48,7 +48,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210624" +const versionClient = "20210630" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/securitycenter/apiv1/doc.go b/securitycenter/apiv1/doc.go index 45e0e45ea5a..bcd3fc0248b 100644 --- a/securitycenter/apiv1/doc.go +++ b/securitycenter/apiv1/doc.go @@ -49,7 +49,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210624" +const versionClient = "20210630" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/securitycenter/apiv1/security_center_client.go b/securitycenter/apiv1/security_center_client.go index 2472574f889..f9fa23a6181 100644 --- a/securitycenter/apiv1/security_center_client.go +++ b/securitycenter/apiv1/security_center_client.go @@ -75,6 +75,7 @@ func defaultGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("securitycenter.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://securitycenter.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/securitycenter/apiv1beta1/doc.go b/securitycenter/apiv1beta1/doc.go index f5233144269..63d23ba9a0a 100644 --- a/securitycenter/apiv1beta1/doc.go +++ b/securitycenter/apiv1beta1/doc.go @@ -51,7 +51,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210624" +const versionClient = "20210630" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/securitycenter/apiv1beta1/security_center_client.go b/securitycenter/apiv1beta1/security_center_client.go index 2770a2c189a..1068c0c2b9a 100644 --- a/securitycenter/apiv1beta1/security_center_client.go +++ b/securitycenter/apiv1beta1/security_center_client.go @@ -70,6 +70,7 @@ func defaultGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("securitycenter.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://securitycenter.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/securitycenter/apiv1p1beta1/doc.go b/securitycenter/apiv1p1beta1/doc.go index 886323d2b35..f49364ff423 100644 --- a/securitycenter/apiv1p1beta1/doc.go +++ b/securitycenter/apiv1p1beta1/doc.go @@ -51,7 +51,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210624" +const versionClient = "20210630" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/securitycenter/apiv1p1beta1/security_center_client.go b/securitycenter/apiv1p1beta1/security_center_client.go index 3bbad64a625..a61c3830b4c 100644 --- a/securitycenter/apiv1p1beta1/security_center_client.go +++ b/securitycenter/apiv1p1beta1/security_center_client.go @@ -75,6 +75,7 @@ func defaultGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("securitycenter.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://securitycenter.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/securitycenter/settings/apiv1beta1/doc.go b/securitycenter/settings/apiv1beta1/doc.go index 420f9b87051..9043c6fdb9d 100644 --- a/securitycenter/settings/apiv1beta1/doc.go +++ b/securitycenter/settings/apiv1beta1/doc.go @@ -51,7 +51,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210624" +const versionClient = "20210630" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/securitycenter/settings/apiv1beta1/security_center_settings_client.go b/securitycenter/settings/apiv1beta1/security_center_settings_client.go index ed95707e8e2..4e97fad52f4 100644 --- a/securitycenter/settings/apiv1beta1/security_center_settings_client.go +++ b/securitycenter/settings/apiv1beta1/security_center_settings_client.go @@ -60,6 +60,7 @@ func defaultSecurityCenterSettingsGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("securitycenter.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://securitycenter.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/servicecontrol/apiv1/doc.go b/servicecontrol/apiv1/doc.go index 4f98398eb1a..790142cb65a 100644 --- a/servicecontrol/apiv1/doc.go +++ b/servicecontrol/apiv1/doc.go @@ -49,7 +49,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210629" +const versionClient = "20210630" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/servicecontrol/apiv1/quota_controller_client.go b/servicecontrol/apiv1/quota_controller_client.go index da8125e0393..d8fe6b93b86 100644 --- a/servicecontrol/apiv1/quota_controller_client.go +++ b/servicecontrol/apiv1/quota_controller_client.go @@ -44,6 +44,7 @@ func defaultQuotaControllerGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("servicecontrol.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://servicecontrol.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/servicecontrol/apiv1/service_controller_client.go b/servicecontrol/apiv1/service_controller_client.go index 01985624342..6755e31039a 100644 --- a/servicecontrol/apiv1/service_controller_client.go +++ b/servicecontrol/apiv1/service_controller_client.go @@ -45,6 +45,7 @@ func defaultServiceControllerGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("servicecontrol.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://servicecontrol.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/servicedirectory/apiv1/doc.go b/servicedirectory/apiv1/doc.go index e6d205a5298..991a0be48e2 100644 --- a/servicedirectory/apiv1/doc.go +++ b/servicedirectory/apiv1/doc.go @@ -49,7 +49,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210624" +const versionClient = "20210630" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/servicedirectory/apiv1/lookup_client.go b/servicedirectory/apiv1/lookup_client.go index 703884d9612..c11a74ac8d4 100644 --- a/servicedirectory/apiv1/lookup_client.go +++ b/servicedirectory/apiv1/lookup_client.go @@ -46,6 +46,7 @@ func defaultLookupGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("servicedirectory.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://servicedirectory.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/servicedirectory/apiv1/registration_client.go b/servicedirectory/apiv1/registration_client.go index 84a6433bb10..00256e4996e 100644 --- a/servicedirectory/apiv1/registration_client.go +++ b/servicedirectory/apiv1/registration_client.go @@ -66,6 +66,7 @@ func defaultRegistrationGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("servicedirectory.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://servicedirectory.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/servicedirectory/apiv1beta1/doc.go b/servicedirectory/apiv1beta1/doc.go index 84eaaa761a1..b63b25ff36d 100644 --- a/servicedirectory/apiv1beta1/doc.go +++ b/servicedirectory/apiv1beta1/doc.go @@ -51,7 +51,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210624" +const versionClient = "20210630" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/servicedirectory/apiv1beta1/lookup_client.go b/servicedirectory/apiv1beta1/lookup_client.go index 5d2aa982639..c0ff1660231 100644 --- a/servicedirectory/apiv1beta1/lookup_client.go +++ b/servicedirectory/apiv1beta1/lookup_client.go @@ -46,6 +46,7 @@ func defaultLookupGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("servicedirectory.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://servicedirectory.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/servicedirectory/apiv1beta1/registration_client.go b/servicedirectory/apiv1beta1/registration_client.go index 793c87234f3..deda537b10e 100644 --- a/servicedirectory/apiv1beta1/registration_client.go +++ b/servicedirectory/apiv1beta1/registration_client.go @@ -66,6 +66,7 @@ func defaultRegistrationGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("servicedirectory.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://servicedirectory.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/servicemanagement/apiv1/doc.go b/servicemanagement/apiv1/doc.go index c756a141309..a9a150052eb 100644 --- a/servicemanagement/apiv1/doc.go +++ b/servicemanagement/apiv1/doc.go @@ -50,7 +50,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210624" +const versionClient = "20210630" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/servicemanagement/apiv1/service_manager_client.go b/servicemanagement/apiv1/service_manager_client.go index f667221e496..c9ee320b88c 100644 --- a/servicemanagement/apiv1/service_manager_client.go +++ b/servicemanagement/apiv1/service_manager_client.go @@ -65,6 +65,7 @@ func defaultServiceManagerGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("servicemanagement.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://servicemanagement.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/serviceusage/apiv1/doc.go b/serviceusage/apiv1/doc.go index 321e23d599d..e3e2054b1f7 100644 --- a/serviceusage/apiv1/doc.go +++ b/serviceusage/apiv1/doc.go @@ -21,8 +21,6 @@ // Platform, lists the available or enabled services, or disables services // that service consumers no longer use. // -// NOTE: This package is in beta. It is not stable, and may be subject to changes. -// // Use of Context // // The ctx passed to NewClient is used for authentication requests and @@ -52,7 +50,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210624" +const versionClient = "20210630" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/serviceusage/apiv1/service_usage_client.go b/serviceusage/apiv1/service_usage_client.go index 6647a47d09a..acba7fe148d 100644 --- a/serviceusage/apiv1/service_usage_client.go +++ b/serviceusage/apiv1/service_usage_client.go @@ -55,6 +55,7 @@ func defaultGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("serviceusage.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://serviceusage.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/shell/apiv1/cloud_shell_client.go b/shell/apiv1/cloud_shell_client.go index 8917de48634..6f3affcf05b 100644 --- a/shell/apiv1/cloud_shell_client.go +++ b/shell/apiv1/cloud_shell_client.go @@ -53,6 +53,7 @@ func defaultCloudShellGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("cloudshell.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://cloudshell.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/shell/apiv1/doc.go b/shell/apiv1/doc.go index 6e091e59893..1f964173959 100644 --- a/shell/apiv1/doc.go +++ b/shell/apiv1/doc.go @@ -51,7 +51,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210624" +const versionClient = "20210630" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/spanner/admin/database/apiv1/database_admin_client.go b/spanner/admin/database/apiv1/database_admin_client.go index 01f8fa01303..6829ec0e5ef 100644 --- a/spanner/admin/database/apiv1/database_admin_client.go +++ b/spanner/admin/database/apiv1/database_admin_client.go @@ -68,6 +68,7 @@ func defaultDatabaseAdminGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("spanner.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://spanner.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/spanner/admin/database/apiv1/doc.go b/spanner/admin/database/apiv1/doc.go index 42f3fac44fc..c31d02ef04e 100644 --- a/spanner/admin/database/apiv1/doc.go +++ b/spanner/admin/database/apiv1/doc.go @@ -46,7 +46,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210624" +const versionClient = "20210630" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/spanner/admin/instance/apiv1/doc.go b/spanner/admin/instance/apiv1/doc.go index 792995f9482..9aa40e6eab9 100644 --- a/spanner/admin/instance/apiv1/doc.go +++ b/spanner/admin/instance/apiv1/doc.go @@ -46,7 +46,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210624" +const versionClient = "20210630" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/spanner/admin/instance/apiv1/instance_admin_client.go b/spanner/admin/instance/apiv1/instance_admin_client.go index 2353f7c498e..a5441e56aaa 100644 --- a/spanner/admin/instance/apiv1/instance_admin_client.go +++ b/spanner/admin/instance/apiv1/instance_admin_client.go @@ -61,6 +61,7 @@ func defaultInstanceAdminGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("spanner.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://spanner.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/spanner/apiv1/doc.go b/spanner/apiv1/doc.go index 2db56e4e302..91c6e30ead7 100644 --- a/spanner/apiv1/doc.go +++ b/spanner/apiv1/doc.go @@ -49,7 +49,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210624" +const versionClient = "20210630" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/spanner/apiv1/spanner_client.go b/spanner/apiv1/spanner_client.go index 0ed8a259694..1067e2f3885 100644 --- a/spanner/apiv1/spanner_client.go +++ b/spanner/apiv1/spanner_client.go @@ -62,6 +62,7 @@ func defaultGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("spanner.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://spanner.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/spanner/go.mod b/spanner/go.mod index 18144dd6138..36160c00fc5 100644 --- a/spanner/go.mod +++ b/spanner/go.mod @@ -9,8 +9,8 @@ require ( github.com/googleapis/gax-go/v2 v2.0.5 go.opencensus.io v0.23.0 golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 - google.golang.org/api v0.49.0 - google.golang.org/genproto v0.0.0-20210629200056-84d6f6074151 + google.golang.org/api v0.50.0 + google.golang.org/genproto v0.0.0-20210630183607-d20f26d13c79 google.golang.org/grpc v1.38.0 google.golang.org/protobuf v1.27.1 ) diff --git a/spanner/go.sum b/spanner/go.sum index 8b897debcbf..9e44f7fc0b6 100644 --- a/spanner/go.sum +++ b/spanner/go.sum @@ -249,8 +249,8 @@ golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ golang.org/x/oauth2 v0.0.0-20210220000619-9bb904979d93/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210313182246-cd4f82c27b84/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210615190721-d04028783cf1 h1:x622Z2o4hgCr/4CiKWc51jHVKaWdtVpBNmEI8wI9Qns= -golang.org/x/oauth2 v0.0.0-20210615190721-d04028783cf1/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210628180205-a41e5a781914 h1:3B43BWw0xEBsLZ/NO1VALz6fppU3481pik+2Ksv45z8= +golang.org/x/oauth2 v0.0.0-20210628180205-a41e5a781914/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -396,8 +396,8 @@ google.golang.org/api v0.41.0/go.mod h1:RkxM5lITDfTzmyKFPt+wGrCJbVfniCr2ool8kTBz google.golang.org/api v0.43.0/go.mod h1:nQsDGjRXMo4lvh5hP0TKqF244gqhGcr/YSIykhUk/94= google.golang.org/api v0.47.0/go.mod h1:Wbvgpq1HddcWVtzsVLyfLp8lDg6AA241LmgIL59tHXo= google.golang.org/api v0.48.0/go.mod h1:71Pr1vy+TAZRPkPs/xlCf5SsU8WjuAWv1Pfjbtukyy4= -google.golang.org/api v0.49.0 h1:gjIBDxlTG7vnzMmEnYwTnvLTF8Rjzo+ETCgEX1YZ/fY= -google.golang.org/api v0.49.0/go.mod h1:BECiH72wsfwUvOVn3+btPD5WHi0LzavZReBndi42L18= +google.golang.org/api v0.50.0 h1:LX7NFCFYOHzr7WHaYiRUpeipZe9o5L8T+2F4Z798VDw= +google.golang.org/api v0.50.0/go.mod h1:4bNT5pAuq5ji4SRZm+5QIkjny9JAyVD/3gaSihNefaw= 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.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= @@ -449,9 +449,9 @@ google.golang.org/genproto v0.0.0-20210513213006-bf773b8c8384/go.mod h1:P3QM42oQ google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= google.golang.org/genproto v0.0.0-20210604141403-392c879c8b08/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= google.golang.org/genproto v0.0.0-20210608205507-b6d2f5bf0d7d/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= -google.golang.org/genproto v0.0.0-20210617175327-b9e0b3197ced/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24= -google.golang.org/genproto v0.0.0-20210629200056-84d6f6074151 h1:H/uPzsolsGjhl3CVT6Wb7bK+mf+hmkEvUVu+FBKyNlc= -google.golang.org/genproto v0.0.0-20210629200056-84d6f6074151/go.mod h1:yiaVoXHpRzHGyxV3o4DktVWY4mSUErTKaeEOq6C3t3U= +google.golang.org/genproto v0.0.0-20210624195500-8bfb893ecb84/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24= +google.golang.org/genproto v0.0.0-20210630183607-d20f26d13c79 h1:s1jFTXJryg4a1mew7xv03VZD8N9XjxFhk1o4Js4WvPQ= +google.golang.org/genproto v0.0.0-20210630183607-d20f26d13c79/go.mod h1:yiaVoXHpRzHGyxV3o4DktVWY4mSUErTKaeEOq6C3t3U= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= diff --git a/speech/apiv1/doc.go b/speech/apiv1/doc.go index 897c3a18ea1..9457d7d7a5a 100644 --- a/speech/apiv1/doc.go +++ b/speech/apiv1/doc.go @@ -48,7 +48,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210624" +const versionClient = "20210630" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/speech/apiv1/speech_client.go b/speech/apiv1/speech_client.go index a14239940c3..c418232d7e9 100644 --- a/speech/apiv1/speech_client.go +++ b/speech/apiv1/speech_client.go @@ -49,6 +49,7 @@ func defaultGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("speech.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://speech.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/speech/apiv1p1beta1/adaptation_client.go b/speech/apiv1p1beta1/adaptation_client.go index 9c1348c84f7..4c75b8e46c5 100644 --- a/speech/apiv1p1beta1/adaptation_client.go +++ b/speech/apiv1p1beta1/adaptation_client.go @@ -55,6 +55,7 @@ func defaultAdaptationGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("speech.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://speech.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/speech/apiv1p1beta1/doc.go b/speech/apiv1p1beta1/doc.go index 9d0317a959d..3da928467c2 100644 --- a/speech/apiv1p1beta1/doc.go +++ b/speech/apiv1p1beta1/doc.go @@ -50,7 +50,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210624" +const versionClient = "20210630" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/speech/apiv1p1beta1/speech_client.go b/speech/apiv1p1beta1/speech_client.go index 115574e5ee0..32decf2ba5a 100644 --- a/speech/apiv1p1beta1/speech_client.go +++ b/speech/apiv1p1beta1/speech_client.go @@ -49,6 +49,7 @@ func defaultGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("speech.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://speech.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/storage/go.mod b/storage/go.mod index 0e0c8018e85..9bc83147503 100644 --- a/storage/go.mod +++ b/storage/go.mod @@ -9,7 +9,7 @@ require ( github.com/googleapis/gax-go/v2 v2.0.5 golang.org/x/oauth2 v0.0.0-20210628180205-a41e5a781914 golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 - google.golang.org/api v0.49.0 - google.golang.org/genproto v0.0.0-20210629200056-84d6f6074151 + google.golang.org/api v0.50.0 + google.golang.org/genproto v0.0.0-20210630183607-d20f26d13c79 google.golang.org/grpc v1.38.0 ) diff --git a/storage/go.sum b/storage/go.sum index cf41d224d75..936f162bac7 100644 --- a/storage/go.sum +++ b/storage/go.sum @@ -252,7 +252,6 @@ golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ golang.org/x/oauth2 v0.0.0-20210220000619-9bb904979d93/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210313182246-cd4f82c27b84/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210615190721-d04028783cf1/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210628180205-a41e5a781914 h1:3B43BWw0xEBsLZ/NO1VALz6fppU3481pik+2Ksv45z8= golang.org/x/oauth2 v0.0.0-20210628180205-a41e5a781914/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -400,8 +399,8 @@ google.golang.org/api v0.41.0/go.mod h1:RkxM5lITDfTzmyKFPt+wGrCJbVfniCr2ool8kTBz google.golang.org/api v0.43.0/go.mod h1:nQsDGjRXMo4lvh5hP0TKqF244gqhGcr/YSIykhUk/94= google.golang.org/api v0.47.0/go.mod h1:Wbvgpq1HddcWVtzsVLyfLp8lDg6AA241LmgIL59tHXo= google.golang.org/api v0.48.0/go.mod h1:71Pr1vy+TAZRPkPs/xlCf5SsU8WjuAWv1Pfjbtukyy4= -google.golang.org/api v0.49.0 h1:gjIBDxlTG7vnzMmEnYwTnvLTF8Rjzo+ETCgEX1YZ/fY= -google.golang.org/api v0.49.0/go.mod h1:BECiH72wsfwUvOVn3+btPD5WHi0LzavZReBndi42L18= +google.golang.org/api v0.50.0 h1:LX7NFCFYOHzr7WHaYiRUpeipZe9o5L8T+2F4Z798VDw= +google.golang.org/api v0.50.0/go.mod h1:4bNT5pAuq5ji4SRZm+5QIkjny9JAyVD/3gaSihNefaw= 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.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= @@ -453,9 +452,9 @@ google.golang.org/genproto v0.0.0-20210513213006-bf773b8c8384/go.mod h1:P3QM42oQ google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= google.golang.org/genproto v0.0.0-20210604141403-392c879c8b08/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= google.golang.org/genproto v0.0.0-20210608205507-b6d2f5bf0d7d/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= -google.golang.org/genproto v0.0.0-20210617175327-b9e0b3197ced/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24= -google.golang.org/genproto v0.0.0-20210629200056-84d6f6074151 h1:H/uPzsolsGjhl3CVT6Wb7bK+mf+hmkEvUVu+FBKyNlc= -google.golang.org/genproto v0.0.0-20210629200056-84d6f6074151/go.mod h1:yiaVoXHpRzHGyxV3o4DktVWY4mSUErTKaeEOq6C3t3U= +google.golang.org/genproto v0.0.0-20210624195500-8bfb893ecb84/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24= +google.golang.org/genproto v0.0.0-20210630183607-d20f26d13c79 h1:s1jFTXJryg4a1mew7xv03VZD8N9XjxFhk1o4Js4WvPQ= +google.golang.org/genproto v0.0.0-20210630183607-d20f26d13c79/go.mod h1:yiaVoXHpRzHGyxV3o4DktVWY4mSUErTKaeEOq6C3t3U= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= diff --git a/storage/internal/apiv1/doc.go b/storage/internal/apiv1/doc.go index ea45239e75c..3a6b9595fde 100644 --- a/storage/internal/apiv1/doc.go +++ b/storage/internal/apiv1/doc.go @@ -19,6 +19,8 @@ // // Lets you store and retrieve potentially-large, immutable data objects. // +// NOTE: This package is in alpha. It is not stable, and is likely to change. +// // Use of Context // // The ctx passed to NewClient is used for authentication requests and @@ -48,7 +50,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "UNKNOWN" +const versionClient = "20210630" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/talent/apiv4/company_client.go b/talent/apiv4/company_client.go index 9466b8deb75..5ab5da229ef 100644 --- a/talent/apiv4/company_client.go +++ b/talent/apiv4/company_client.go @@ -52,6 +52,7 @@ func defaultCompanyGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("jobs.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://jobs.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/talent/apiv4/completion_client.go b/talent/apiv4/completion_client.go index b87afb21b22..86e33e83766 100644 --- a/talent/apiv4/completion_client.go +++ b/talent/apiv4/completion_client.go @@ -46,6 +46,7 @@ func defaultCompletionGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("jobs.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://jobs.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/talent/apiv4/doc.go b/talent/apiv4/doc.go index fd584b93567..80d229064f9 100644 --- a/talent/apiv4/doc.go +++ b/talent/apiv4/doc.go @@ -51,7 +51,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210624" +const versionClient = "20210630" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/talent/apiv4/event_client.go b/talent/apiv4/event_client.go index ae43881bb5d..24a7b46360a 100644 --- a/talent/apiv4/event_client.go +++ b/talent/apiv4/event_client.go @@ -45,6 +45,7 @@ func defaultEventGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("jobs.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://jobs.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/talent/apiv4/job_client.go b/talent/apiv4/job_client.go index a47197170b8..835d0bd9957 100644 --- a/talent/apiv4/job_client.go +++ b/talent/apiv4/job_client.go @@ -60,6 +60,7 @@ func defaultJobGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("jobs.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://jobs.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/talent/apiv4/tenant_client.go b/talent/apiv4/tenant_client.go index d12b895a231..5e7623443b5 100644 --- a/talent/apiv4/tenant_client.go +++ b/talent/apiv4/tenant_client.go @@ -52,6 +52,7 @@ func defaultTenantGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("jobs.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://jobs.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/talent/apiv4beta1/application_client.go b/talent/apiv4beta1/application_client.go index ffd562915c2..aaf972f68f4 100644 --- a/talent/apiv4beta1/application_client.go +++ b/talent/apiv4beta1/application_client.go @@ -52,6 +52,7 @@ func defaultApplicationGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("jobs.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://jobs.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/talent/apiv4beta1/company_client.go b/talent/apiv4beta1/company_client.go index 6e2f976e794..0d1ff8027e2 100644 --- a/talent/apiv4beta1/company_client.go +++ b/talent/apiv4beta1/company_client.go @@ -52,6 +52,7 @@ func defaultCompanyGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("jobs.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://jobs.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/talent/apiv4beta1/completion_client.go b/talent/apiv4beta1/completion_client.go index 9ce07f67213..47ee671726f 100644 --- a/talent/apiv4beta1/completion_client.go +++ b/talent/apiv4beta1/completion_client.go @@ -46,6 +46,7 @@ func defaultCompletionGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("jobs.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://jobs.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/talent/apiv4beta1/doc.go b/talent/apiv4beta1/doc.go index ffb43e644cf..1d595b4bfa4 100644 --- a/talent/apiv4beta1/doc.go +++ b/talent/apiv4beta1/doc.go @@ -51,7 +51,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210624" +const versionClient = "20210630" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/talent/apiv4beta1/event_client.go b/talent/apiv4beta1/event_client.go index 0b4fb355e95..bd75be01c44 100644 --- a/talent/apiv4beta1/event_client.go +++ b/talent/apiv4beta1/event_client.go @@ -45,6 +45,7 @@ func defaultEventGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("jobs.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://jobs.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/talent/apiv4beta1/job_client.go b/talent/apiv4beta1/job_client.go index 82361f32844..6b177c3802d 100644 --- a/talent/apiv4beta1/job_client.go +++ b/talent/apiv4beta1/job_client.go @@ -60,6 +60,7 @@ func defaultJobGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("jobs.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://jobs.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/talent/apiv4beta1/profile_client.go b/talent/apiv4beta1/profile_client.go index 107ddff8bad..059aa352933 100644 --- a/talent/apiv4beta1/profile_client.go +++ b/talent/apiv4beta1/profile_client.go @@ -53,6 +53,7 @@ func defaultProfileGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("jobs.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://jobs.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/talent/apiv4beta1/tenant_client.go b/talent/apiv4beta1/tenant_client.go index 0a387119e50..c3e95c8afc1 100644 --- a/talent/apiv4beta1/tenant_client.go +++ b/talent/apiv4beta1/tenant_client.go @@ -52,6 +52,7 @@ func defaultTenantGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("jobs.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://jobs.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/texttospeech/apiv1/doc.go b/texttospeech/apiv1/doc.go index 14ec6d91de7..97ce4c977a5 100644 --- a/texttospeech/apiv1/doc.go +++ b/texttospeech/apiv1/doc.go @@ -49,7 +49,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210624" +const versionClient = "20210630" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/texttospeech/apiv1/text_to_speech_client.go b/texttospeech/apiv1/text_to_speech_client.go index 6d13f31d4ba..aae16301c18 100644 --- a/texttospeech/apiv1/text_to_speech_client.go +++ b/texttospeech/apiv1/text_to_speech_client.go @@ -45,6 +45,7 @@ func defaultGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("texttospeech.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://texttospeech.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/tpu/apiv1/doc.go b/tpu/apiv1/doc.go index cfebc7eb24d..5b6b6483715 100644 --- a/tpu/apiv1/doc.go +++ b/tpu/apiv1/doc.go @@ -50,7 +50,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210624" +const versionClient = "20210630" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/tpu/apiv1/tpu_client.go b/tpu/apiv1/tpu_client.go index ba66f1e388c..6852cce80a5 100644 --- a/tpu/apiv1/tpu_client.go +++ b/tpu/apiv1/tpu_client.go @@ -60,6 +60,7 @@ func defaultGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("tpu.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://tpu.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/trace/apiv1/doc.go b/trace/apiv1/doc.go index 407e7783902..90f7779e41d 100644 --- a/trace/apiv1/doc.go +++ b/trace/apiv1/doc.go @@ -52,7 +52,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210624" +const versionClient = "20210630" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/trace/apiv1/trace_client.go b/trace/apiv1/trace_client.go index 3b06fbf5845..f9ad4b2a130 100644 --- a/trace/apiv1/trace_client.go +++ b/trace/apiv1/trace_client.go @@ -50,6 +50,7 @@ func defaultGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("cloudtrace.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://cloudtrace.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/trace/apiv2/doc.go b/trace/apiv2/doc.go index 7929e74396d..c24cb4af159 100644 --- a/trace/apiv2/doc.go +++ b/trace/apiv2/doc.go @@ -52,7 +52,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210624" +const versionClient = "20210630" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/trace/apiv2/trace_client.go b/trace/apiv2/trace_client.go index e0b33f60c75..3159d1fbd65 100644 --- a/trace/apiv2/trace_client.go +++ b/trace/apiv2/trace_client.go @@ -47,6 +47,7 @@ func defaultGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("cloudtrace.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://cloudtrace.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/translate/apiv3/doc.go b/translate/apiv3/doc.go index 498366c5a4e..04cb0f9e719 100644 --- a/translate/apiv3/doc.go +++ b/translate/apiv3/doc.go @@ -48,7 +48,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210624" +const versionClient = "20210630" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/translate/apiv3/translation_client.go b/translate/apiv3/translation_client.go index e13dc053ae5..d350b0276f5 100644 --- a/translate/apiv3/translation_client.go +++ b/translate/apiv3/translation_client.go @@ -58,6 +58,7 @@ func defaultTranslationGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("translate.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://translate.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/video/transcoder/apiv1beta1/doc.go b/video/transcoder/apiv1beta1/doc.go index 71dcd8bbf55..0bd836c8609 100644 --- a/video/transcoder/apiv1beta1/doc.go +++ b/video/transcoder/apiv1beta1/doc.go @@ -51,7 +51,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210624" +const versionClient = "20210630" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/video/transcoder/apiv1beta1/transcoder_client.go b/video/transcoder/apiv1beta1/transcoder_client.go index d7ab587b238..8bf2e8ceb15 100644 --- a/video/transcoder/apiv1beta1/transcoder_client.go +++ b/video/transcoder/apiv1beta1/transcoder_client.go @@ -54,6 +54,7 @@ func defaultGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("transcoder.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://transcoder.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/videointelligence/apiv1/doc.go b/videointelligence/apiv1/doc.go index 9c4cc354253..830d968e4a2 100644 --- a/videointelligence/apiv1/doc.go +++ b/videointelligence/apiv1/doc.go @@ -50,7 +50,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210624" +const versionClient = "20210630" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/videointelligence/apiv1/video_intelligence_client.go b/videointelligence/apiv1/video_intelligence_client.go index 1f113b78865..1cb25f30be7 100644 --- a/videointelligence/apiv1/video_intelligence_client.go +++ b/videointelligence/apiv1/video_intelligence_client.go @@ -47,6 +47,7 @@ func defaultGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("videointelligence.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://videointelligence.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/videointelligence/apiv1beta2/doc.go b/videointelligence/apiv1beta2/doc.go index 5e585c32abd..65d81c70734 100644 --- a/videointelligence/apiv1beta2/doc.go +++ b/videointelligence/apiv1beta2/doc.go @@ -52,7 +52,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210624" +const versionClient = "20210630" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/videointelligence/apiv1beta2/video_intelligence_client.go b/videointelligence/apiv1beta2/video_intelligence_client.go index f33c1ece815..d83c966514b 100644 --- a/videointelligence/apiv1beta2/video_intelligence_client.go +++ b/videointelligence/apiv1beta2/video_intelligence_client.go @@ -47,6 +47,7 @@ func defaultGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("videointelligence.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://videointelligence.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/vision/apiv1/doc.go b/vision/apiv1/doc.go index 40a388e6fa1..74aa0a134b6 100644 --- a/vision/apiv1/doc.go +++ b/vision/apiv1/doc.go @@ -50,7 +50,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210624" +const versionClient = "20210630" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/vision/apiv1/image_annotator_client.go b/vision/apiv1/image_annotator_client.go index c2b8198f946..2d0f169cf58 100644 --- a/vision/apiv1/image_annotator_client.go +++ b/vision/apiv1/image_annotator_client.go @@ -52,6 +52,7 @@ func defaultImageAnnotatorGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("vision.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://vision.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/vision/apiv1/product_search_client.go b/vision/apiv1/product_search_client.go index 4cb9a625630..695b7553b04 100644 --- a/vision/apiv1/product_search_client.go +++ b/vision/apiv1/product_search_client.go @@ -69,6 +69,7 @@ func defaultProductSearchGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("vision.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://vision.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/vision/apiv1p1beta1/doc.go b/vision/apiv1p1beta1/doc.go index 702b6762f5b..806c795fda5 100644 --- a/vision/apiv1p1beta1/doc.go +++ b/vision/apiv1p1beta1/doc.go @@ -52,7 +52,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210624" +const versionClient = "20210630" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/vision/apiv1p1beta1/image_annotator_client.go b/vision/apiv1p1beta1/image_annotator_client.go index ba8fcbd3cc2..13c3299477a 100644 --- a/vision/apiv1p1beta1/image_annotator_client.go +++ b/vision/apiv1p1beta1/image_annotator_client.go @@ -44,6 +44,7 @@ func defaultImageAnnotatorGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("vision.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://vision.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/vpcaccess/apiv1/doc.go b/vpcaccess/apiv1/doc.go index d4324508ed1..3cc5efa3233 100644 --- a/vpcaccess/apiv1/doc.go +++ b/vpcaccess/apiv1/doc.go @@ -50,7 +50,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210624" +const versionClient = "20210630" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/vpcaccess/apiv1/vpc_access_client.go b/vpcaccess/apiv1/vpc_access_client.go index 6064885a8ee..f1a0dee1e7f 100644 --- a/vpcaccess/apiv1/vpc_access_client.go +++ b/vpcaccess/apiv1/vpc_access_client.go @@ -53,6 +53,7 @@ func defaultGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("vpcaccess.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://vpcaccess.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/webrisk/apiv1/doc.go b/webrisk/apiv1/doc.go index 466d0d464f6..05153fe9590 100644 --- a/webrisk/apiv1/doc.go +++ b/webrisk/apiv1/doc.go @@ -46,7 +46,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210624" +const versionClient = "20210630" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/webrisk/apiv1/web_risk_client.go b/webrisk/apiv1/web_risk_client.go index a0bf0628c11..96c72b018f6 100644 --- a/webrisk/apiv1/web_risk_client.go +++ b/webrisk/apiv1/web_risk_client.go @@ -49,6 +49,7 @@ func defaultGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("webrisk.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://webrisk.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/webrisk/apiv1beta1/doc.go b/webrisk/apiv1beta1/doc.go index 4747efdf6b9..9eead0d77c4 100644 --- a/webrisk/apiv1beta1/doc.go +++ b/webrisk/apiv1beta1/doc.go @@ -48,7 +48,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210624" +const versionClient = "20210630" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/webrisk/apiv1beta1/web_risk_service_v1_beta1_client.go b/webrisk/apiv1beta1/web_risk_service_v1_beta1_client.go index 346b784f070..639818d30a0 100644 --- a/webrisk/apiv1beta1/web_risk_service_v1_beta1_client.go +++ b/webrisk/apiv1beta1/web_risk_service_v1_beta1_client.go @@ -46,6 +46,7 @@ func defaultWebRiskServiceV1Beta1GRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("webrisk.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://webrisk.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/websecurityscanner/apiv1/doc.go b/websecurityscanner/apiv1/doc.go index a0d4a10a859..ce6539a3d19 100644 --- a/websecurityscanner/apiv1/doc.go +++ b/websecurityscanner/apiv1/doc.go @@ -48,7 +48,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210624" +const versionClient = "20210630" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/websecurityscanner/apiv1/web_security_scanner_client.go b/websecurityscanner/apiv1/web_security_scanner_client.go index 42bdb777dd8..02474402de7 100644 --- a/websecurityscanner/apiv1/web_security_scanner_client.go +++ b/websecurityscanner/apiv1/web_security_scanner_client.go @@ -60,6 +60,7 @@ func defaultGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("websecurityscanner.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://websecurityscanner.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/workflows/apiv1beta/doc.go b/workflows/apiv1beta/doc.go index 5d122965998..54b8d332017 100644 --- a/workflows/apiv1beta/doc.go +++ b/workflows/apiv1beta/doc.go @@ -48,7 +48,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210624" +const versionClient = "20210630" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/workflows/apiv1beta/workflows_client.go b/workflows/apiv1beta/workflows_client.go index 741652714de..9169f065f0c 100644 --- a/workflows/apiv1beta/workflows_client.go +++ b/workflows/apiv1beta/workflows_client.go @@ -54,6 +54,7 @@ func defaultGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("workflows.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://workflows.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/workflows/executions/apiv1beta/doc.go b/workflows/executions/apiv1beta/doc.go index 2df764e3581..c358413800a 100644 --- a/workflows/executions/apiv1beta/doc.go +++ b/workflows/executions/apiv1beta/doc.go @@ -50,7 +50,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210624" +const versionClient = "20210630" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/workflows/executions/apiv1beta/executions_client.go b/workflows/executions/apiv1beta/executions_client.go index 6140dabac94..a074fd6e3b1 100644 --- a/workflows/executions/apiv1beta/executions_client.go +++ b/workflows/executions/apiv1beta/executions_client.go @@ -49,6 +49,7 @@ func defaultGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultMTLSEndpoint("workflowexecutions.mtls.googleapis.com:443"), internaloption.WithDefaultAudience("https://workflowexecutions.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), From 7aa0e195a5536dd060a1fca871bd3c6f946d935e Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Thu, 1 Jul 2021 09:03:25 -0700 Subject: [PATCH 40/50] chore(all): auto-regenerate gapics (#4360) * chore(all): auto-regenerate gapics This is an auto-generated regeneration of the gapic clients by cloud.google.com/go/internal/gapicgen. Once the corresponding genproto PR is submitted, genbot will update this PR with a newer dependency to the newer version of genproto and assign reviewers to this PR. If you have been assigned to review this PR, please: - Ensure that the version of genproto in go.mod has been updated. - Ensure that CI is passing. If it's failing, it requires your manual attention. - Approve and submit this PR if you believe it's ready to ship. Corresponding genproto PR: https://github.com/googleapis/go-genproto/pull/629 Changes: feat(spanner/admin/database): add leader_options to InstanceConfig and default_leader to Database PiperOrigin-RevId: 382409094 Source-Link: https://github.com/googleapis/googleapis/commit/2c6e4dd22260e34403b468cc6d19aa43a9c684ed build(privatecatalog): name should be @google-cloud/private-cataglog PiperOrigin-RevId: 382382058 Source-Link: https://github.com/googleapis/googleapis/commit/b8b50f18a68f695a4623021b99d1901a6ebd3ec8 --- accessapproval/apiv1/doc.go | 2 +- accessapproval/apiv1/gapic_metadata.json | 50 +- aiplatform/apiv1/doc.go | 2 +- aiplatform/apiv1/gapic_metadata.json | 332 +++++------ analytics/admin/apiv1alpha/doc.go | 2 +- .../admin/apiv1alpha/gapic_metadata.json | 294 +++++----- analytics/data/apiv1alpha/doc.go | 2 +- analytics/data/apiv1alpha/gapic_metadata.json | 46 +- apigateway/apiv1/doc.go | 2 +- apigateway/apiv1/gapic_metadata.json | 82 +-- apigeeconnect/apiv1/doc.go | 2 +- apigeeconnect/apiv1/gapic_metadata.json | 40 +- appengine/apiv1/doc.go | 2 +- appengine/apiv1/gapic_metadata.json | 228 ++++---- area120/tables/apiv1alpha1/doc.go | 2 +- .../tables/apiv1alpha1/gapic_metadata.json | 70 +-- artifactregistry/apiv1beta2/doc.go | 2 +- .../apiv1beta2/gapic_metadata.json | 106 ++-- asset/apiv1/doc.go | 2 +- asset/apiv1/gapic_metadata.json | 70 +-- asset/apiv1p2beta1/doc.go | 2 +- asset/apiv1p2beta1/gapic_metadata.json | 42 +- asset/apiv1p5beta1/doc.go | 2 +- asset/apiv1p5beta1/gapic_metadata.json | 26 +- assuredworkloads/apiv1beta1/doc.go | 2 +- .../apiv1beta1/gapic_metadata.json | 42 +- automl/apiv1/doc.go | 2 +- automl/apiv1/gapic_metadata.json | 112 ++-- automl/apiv1beta1/doc.go | 2 +- automl/apiv1beta1/gapic_metadata.json | 136 ++--- bigquery/connection/apiv1/doc.go | 2 +- bigquery/connection/apiv1/gapic_metadata.json | 54 +- bigquery/connection/apiv1beta1/doc.go | 2 +- .../connection/apiv1beta1/gapic_metadata.json | 58 +- bigquery/datatransfer/apiv1/doc.go | 2 +- .../datatransfer/apiv1/gapic_metadata.json | 78 +-- bigquery/go.mod | 2 +- bigquery/go.sum | 4 +- bigquery/reservation/apiv1/doc.go | 2 +- .../reservation/apiv1/gapic_metadata.json | 98 ++-- bigquery/reservation/apiv1beta1/doc.go | 2 +- .../apiv1beta1/gapic_metadata.json | 98 ++-- bigquery/storage/apiv1/doc.go | 2 +- bigquery/storage/apiv1/gapic_metadata.json | 34 +- bigquery/storage/apiv1beta1/doc.go | 2 +- .../storage/apiv1beta1/gapic_metadata.json | 42 +- bigquery/storage/apiv1beta2/doc.go | 2 +- .../storage/apiv1beta2/gapic_metadata.json | 68 +-- billing/apiv1/doc.go | 2 +- billing/apiv1/gapic_metadata.json | 80 +-- billing/budgets/apiv1/doc.go | 2 +- billing/budgets/apiv1/gapic_metadata.json | 42 +- billing/budgets/apiv1beta1/doc.go | 2 +- .../budgets/apiv1beta1/gapic_metadata.json | 42 +- binaryauthorization/apiv1beta1/doc.go | 2 +- .../apiv1beta1/gapic_metadata.json | 50 +- channel/apiv1/doc.go | 2 +- channel/apiv1/gapic_metadata.json | 158 +++--- cloudbuild/apiv1/v2/doc.go | 2 +- cloudbuild/apiv1/v2/gapic_metadata.json | 90 +-- clouddms/apiv1/doc.go | 2 +- clouddms/apiv1/gapic_metadata.json | 90 +-- cloudtasks/apiv2/doc.go | 2 +- cloudtasks/apiv2/gapic_metadata.json | 86 +-- cloudtasks/apiv2beta2/doc.go | 2 +- cloudtasks/apiv2beta2/gapic_metadata.json | 102 ++-- cloudtasks/apiv2beta3/doc.go | 2 +- cloudtasks/apiv2beta3/gapic_metadata.json | 86 +-- container/apiv1/doc.go | 2 +- container/apiv1/gapic_metadata.json | 150 ++--- containeranalysis/apiv1beta1/doc.go | 2 +- .../apiv1beta1/gapic_metadata.json | 82 +-- datacatalog/apiv1/doc.go | 2 +- datacatalog/apiv1/gapic_metadata.json | 214 ++++---- datacatalog/apiv1beta1/doc.go | 2 +- datacatalog/apiv1beta1/gapic_metadata.json | 210 +++---- dataflow/apiv1beta3/doc.go | 2 +- dataflow/apiv1beta3/gapic_metadata.json | 144 ++--- datalabeling/apiv1beta1/doc.go | 2 +- datalabeling/apiv1beta1/gapic_metadata.json | 158 +++--- dataproc/apiv1/doc.go | 2 +- dataproc/apiv1/gapic_metadata.json | 160 +++--- dataproc/apiv1beta2/doc.go | 2 +- dataproc/apiv1beta2/gapic_metadata.json | 152 +++--- dataqna/apiv1alpha/doc.go | 2 +- dataqna/apiv1alpha/gapic_metadata.json | 56 +- datastore/admin/apiv1/doc.go | 2 +- datastore/admin/apiv1/gapic_metadata.json | 46 +- datastore/go.mod | 2 +- datastore/go.sum | 4 +- datastream/apiv1alpha1/doc.go | 2 +- datastream/apiv1alpha1/gapic_metadata.json | 106 ++-- debugger/apiv2/doc.go | 2 +- debugger/apiv2/gapic_metadata.json | 64 +-- dialogflow/apiv2/doc.go | 2 +- dialogflow/apiv2/gapic_metadata.json | 490 ++++++++--------- dialogflow/cx/apiv3/doc.go | 2 +- dialogflow/cx/apiv3/gapic_metadata.json | 516 +++++++++--------- dialogflow/cx/apiv3beta1/doc.go | 2 +- dialogflow/cx/apiv3beta1/gapic_metadata.json | 516 +++++++++--------- dlp/apiv2/doc.go | 2 +- dlp/apiv2/gapic_metadata.json | 158 +++--- documentai/apiv1/doc.go | 2 +- documentai/apiv1/gapic_metadata.json | 34 +- documentai/apiv1beta3/doc.go | 2 +- documentai/apiv1beta3/gapic_metadata.json | 58 +- domains/apiv1beta1/doc.go | 2 +- domains/apiv1beta1/gapic_metadata.json | 74 +-- errorreporting/apiv1beta1/doc.go | 2 +- errorreporting/apiv1beta1/gapic_metadata.json | 66 +-- essentialcontacts/apiv1/doc.go | 2 +- essentialcontacts/apiv1/gapic_metadata.json | 50 +- eventarc/apiv1/doc.go | 2 +- eventarc/apiv1/gapic_metadata.json | 42 +- firestore/apiv1/admin/doc.go | 2 +- firestore/apiv1/admin/gapic_metadata.json | 58 +- firestore/apiv1/doc.go | 2 +- firestore/apiv1/gapic_metadata.json | 82 +-- firestore/go.mod | 2 +- firestore/go.sum | 4 +- functions/apiv1/doc.go | 2 +- functions/apiv1/gapic_metadata.json | 66 +-- gaming/apiv1/doc.go | 2 +- gaming/apiv1/gapic_metadata.json | 160 +++--- gaming/apiv1beta/doc.go | 2 +- gaming/apiv1beta/gapic_metadata.json | 160 +++--- gkeconnect/gateway/apiv1beta1/doc.go | 2 +- .../gateway/apiv1beta1/gapic_metadata.json | 42 +- gkehub/apiv1beta1/doc.go | 2 +- gkehub/apiv1beta1/gapic_metadata.json | 54 +- go.mod | 2 +- go.sum | 4 +- gsuiteaddons/apiv1/doc.go | 2 +- gsuiteaddons/apiv1/gapic_metadata.json | 58 +- iam/credentials/apiv1/doc.go | 2 +- iam/credentials/apiv1/gapic_metadata.json | 38 +- .../CreateIosAppDataStream/main.go | 46 -- internal/generated/snippets/go.mod | 2 +- internal/generated/snippets/go.sum | 8 +- iot/apiv1/doc.go | 2 +- iot/apiv1/gapic_metadata.json | 98 ++-- kms/apiv1/doc.go | 2 +- kms/apiv1/gapic_metadata.json | 126 ++--- language/apiv1/doc.go | 2 +- language/apiv1/gapic_metadata.json | 46 +- language/apiv1beta2/doc.go | 2 +- language/apiv1beta2/gapic_metadata.json | 46 +- lifesciences/apiv2beta/doc.go | 2 +- lifesciences/apiv2beta/gapic_metadata.json | 26 +- logging/apiv2/doc.go | 2 +- logging/apiv2/gapic_metadata.json | 178 +++--- logging/go.mod | 2 +- logging/go.sum | 4 +- longrunning/autogen/doc.go | 2 +- longrunning/autogen/gapic_metadata.json | 42 +- managedidentities/apiv1/doc.go | 2 +- managedidentities/apiv1/gapic_metadata.json | 62 +-- mediatranslation/apiv1beta1/doc.go | 2 +- .../apiv1beta1/gapic_metadata.json | 26 +- memcache/apiv1/doc.go | 2 +- memcache/apiv1/gapic_metadata.json | 50 +- memcache/apiv1beta2/doc.go | 2 +- memcache/apiv1beta2/gapic_metadata.json | 54 +- metastore/apiv1/doc.go | 2 +- metastore/apiv1/gapic_metadata.json | 62 +-- metastore/apiv1alpha/doc.go | 2 +- metastore/apiv1alpha/gapic_metadata.json | 82 +-- metastore/apiv1beta/doc.go | 2 +- metastore/apiv1beta/gapic_metadata.json | 82 +-- monitoring/apiv3/v2/doc.go | 2 +- monitoring/apiv3/v2/gapic_metadata.json | 266 ++++----- monitoring/dashboard/apiv1/doc.go | 2 +- .../dashboard/apiv1/gapic_metadata.json | 42 +- networkconnectivity/apiv1alpha1/doc.go | 2 +- .../apiv1alpha1/gapic_metadata.json | 62 +-- notebooks/apiv1beta1/doc.go | 2 +- notebooks/apiv1beta1/gapic_metadata.json | 98 ++-- orgpolicy/apiv2/doc.go | 2 +- orgpolicy/apiv2/gapic_metadata.json | 50 +- osconfig/agentendpoint/apiv1/doc.go | 2 +- .../agentendpoint/apiv1/gapic_metadata.json | 46 +- osconfig/agentendpoint/apiv1beta/doc.go | 2 +- .../apiv1beta/gapic_metadata.json | 46 +- osconfig/apiv1/doc.go | 2 +- osconfig/apiv1/gapic_metadata.json | 58 +- osconfig/apiv1alpha/doc.go | 2 +- osconfig/apiv1alpha/gapic_metadata.json | 70 +-- osconfig/apiv1beta/doc.go | 2 +- osconfig/apiv1beta/gapic_metadata.json | 82 +-- oslogin/apiv1/doc.go | 2 +- oslogin/apiv1/gapic_metadata.json | 46 +- oslogin/apiv1beta/doc.go | 2 +- oslogin/apiv1beta/gapic_metadata.json | 46 +- phishingprotection/apiv1beta1/doc.go | 2 +- .../apiv1beta1/gapic_metadata.json | 26 +- policytroubleshooter/apiv1/doc.go | 2 +- .../apiv1/gapic_metadata.json | 26 +- privatecatalog/apiv1beta1/doc.go | 2 +- privatecatalog/apiv1beta1/gapic_metadata.json | 34 +- pubsub/apiv1/doc.go | 2 +- pubsub/apiv1/gapic_metadata.json | 202 +++---- pubsub/go.mod | 2 +- pubsub/go.sum | 4 +- pubsublite/apiv1/doc.go | 2 +- pubsublite/apiv1/gapic_metadata.json | 184 +++---- pubsublite/go.mod | 2 +- pubsublite/go.sum | 4 +- recaptchaenterprise/apiv1/doc.go | 2 +- recaptchaenterprise/apiv1/gapic_metadata.json | 50 +- recaptchaenterprise/apiv1beta1/doc.go | 2 +- .../apiv1beta1/gapic_metadata.json | 50 +- recommender/apiv1/doc.go | 2 +- recommender/apiv1/gapic_metadata.json | 54 +- recommender/apiv1beta1/doc.go | 2 +- recommender/apiv1beta1/gapic_metadata.json | 54 +- redis/apiv1/doc.go | 2 +- redis/apiv1/gapic_metadata.json | 58 +- redis/apiv1beta1/doc.go | 2 +- redis/apiv1beta1/gapic_metadata.json | 58 +- resourcemanager/apiv2/doc.go | 2 +- resourcemanager/apiv2/gapic_metadata.json | 66 +-- resourcesettings/apiv1/doc.go | 2 +- resourcesettings/apiv1/gapic_metadata.json | 34 +- retail/apiv2/doc.go | 2 +- retail/apiv2/gapic_metadata.json | 104 ++-- scheduler/apiv1/doc.go | 2 +- scheduler/apiv1/gapic_metadata.json | 54 +- scheduler/apiv1beta1/doc.go | 2 +- scheduler/apiv1beta1/gapic_metadata.json | 54 +- secretmanager/apiv1/doc.go | 2 +- secretmanager/apiv1/gapic_metadata.json | 82 +-- secretmanager/apiv1beta1/doc.go | 2 +- secretmanager/apiv1beta1/gapic_metadata.json | 82 +-- security/privateca/apiv1/doc.go | 2 +- security/privateca/apiv1/gapic_metadata.json | 138 ++--- security/privateca/apiv1beta1/doc.go | 2 +- .../privateca/apiv1beta1/gapic_metadata.json | 102 ++-- securitycenter/apiv1/doc.go | 2 +- securitycenter/apiv1/gapic_metadata.json | 114 ++-- securitycenter/apiv1beta1/doc.go | 2 +- securitycenter/apiv1beta1/gapic_metadata.json | 94 ++-- securitycenter/apiv1p1beta1/doc.go | 2 +- .../apiv1p1beta1/gapic_metadata.json | 114 ++-- securitycenter/settings/apiv1beta1/doc.go | 2 +- .../settings/apiv1beta1/gapic_metadata.json | 74 +-- servicecontrol/apiv1/doc.go | 2 +- servicecontrol/apiv1/gapic_metadata.json | 44 +- servicedirectory/apiv1/doc.go | 2 +- servicedirectory/apiv1/gapic_metadata.json | 108 ++-- servicedirectory/apiv1beta1/doc.go | 2 +- .../apiv1beta1/gapic_metadata.json | 108 ++-- servicemanagement/apiv1/doc.go | 2 +- servicemanagement/apiv1/gapic_metadata.json | 82 +-- serviceusage/apiv1/doc.go | 2 +- serviceusage/apiv1/gapic_metadata.json | 46 +- shell/apiv1/doc.go | 2 +- shell/apiv1/gapic_metadata.json | 42 +- spanner/admin/database/apiv1/doc.go | 2 +- .../admin/database/apiv1/gapic_metadata.json | 90 +-- spanner/admin/instance/apiv1/doc.go | 2 +- .../admin/instance/apiv1/gapic_metadata.json | 62 +-- spanner/apiv1/doc.go | 2 +- spanner/apiv1/gapic_metadata.json | 82 +-- spanner/go.mod | 2 +- spanner/go.sum | 4 +- speech/apiv1/doc.go | 2 +- speech/apiv1/gapic_metadata.json | 34 +- speech/apiv1p1beta1/doc.go | 2 +- speech/apiv1p1beta1/gapic_metadata.json | 84 +-- storage/go.mod | 2 +- storage/go.sum | 4 +- storage/internal/apiv1/doc.go | 2 +- storage/internal/apiv1/gapic_metadata.json | 246 ++++----- talent/apiv4/doc.go | 2 +- talent/apiv4/gapic_metadata.json | 150 ++--- talent/apiv4beta1/doc.go | 2 +- talent/apiv4beta1/gapic_metadata.json | 214 ++++---- texttospeech/apiv1/doc.go | 2 +- texttospeech/apiv1/gapic_metadata.json | 30 +- tpu/apiv1/doc.go | 2 +- tpu/apiv1/gapic_metadata.json | 66 +-- trace/apiv1/doc.go | 2 +- trace/apiv1/gapic_metadata.json | 34 +- trace/apiv2/doc.go | 2 +- trace/apiv2/gapic_metadata.json | 30 +- translate/apiv3/doc.go | 2 +- translate/apiv3/gapic_metadata.json | 54 +- video/transcoder/apiv1beta1/doc.go | 2 +- .../transcoder/apiv1beta1/gapic_metadata.json | 54 +- videointelligence/apiv1/doc.go | 2 +- videointelligence/apiv1/gapic_metadata.json | 26 +- videointelligence/apiv1beta2/doc.go | 2 +- .../apiv1beta2/gapic_metadata.json | 26 +- vision/apiv1/doc.go | 2 +- vision/apiv1/gapic_metadata.json | 124 ++--- vision/apiv1p1beta1/doc.go | 2 +- vision/apiv1p1beta1/gapic_metadata.json | 26 +- vpcaccess/apiv1/doc.go | 2 +- vpcaccess/apiv1/gapic_metadata.json | 38 +- webrisk/apiv1/doc.go | 2 +- webrisk/apiv1/gapic_metadata.json | 38 +- webrisk/apiv1beta1/doc.go | 2 +- webrisk/apiv1beta1/gapic_metadata.json | 34 +- websecurityscanner/apiv1/doc.go | 2 +- websecurityscanner/apiv1/gapic_metadata.json | 74 +-- workflows/apiv1beta/doc.go | 2 +- workflows/apiv1beta/gapic_metadata.json | 42 +- workflows/executions/apiv1/doc.go | 2 +- .../executions/apiv1/gapic_metadata.json | 38 +- workflows/executions/apiv1beta/doc.go | 2 +- .../executions/apiv1beta/gapic_metadata.json | 38 +- 311 files changed, 6806 insertions(+), 6854 deletions(-) delete mode 100644 internal/generated/snippets/analytics/admin/apiv1alpha/AnalyticsAdminClient/CreateIosAppDataStream/main.go diff --git a/accessapproval/apiv1/doc.go b/accessapproval/apiv1/doc.go index 4c149e1b44e..aee0b5b99f4 100644 --- a/accessapproval/apiv1/doc.go +++ b/accessapproval/apiv1/doc.go @@ -48,7 +48,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210630" +const versionClient = "20210701" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/accessapproval/apiv1/gapic_metadata.json b/accessapproval/apiv1/gapic_metadata.json index 51393e9d3f1..25dd99519b2 100644 --- a/accessapproval/apiv1/gapic_metadata.json +++ b/accessapproval/apiv1/gapic_metadata.json @@ -1,47 +1,47 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.accessapproval.v1", - "libraryPackage": "cloud.google.com/go/accessapproval/apiv1", - "services": { - "AccessApproval": { - "clients": { - "grpc": { - "libraryClient": "Client", - "rpcs": { - "ApproveApprovalRequest": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.accessapproval.v1", + "libraryPackage": "cloud.google.com/go/accessapproval/apiv1", + "services": { + "AccessApproval": { + "clients": { + "grpc": { + "libraryClient": "Client", + "rpcs": { + "ApproveApprovalRequest": { + "methods": [ "ApproveApprovalRequest" ] }, - "DeleteAccessApprovalSettings": { - "methods": [ + "DeleteAccessApprovalSettings": { + "methods": [ "DeleteAccessApprovalSettings" ] }, - "DismissApprovalRequest": { - "methods": [ + "DismissApprovalRequest": { + "methods": [ "DismissApprovalRequest" ] }, - "GetAccessApprovalSettings": { - "methods": [ + "GetAccessApprovalSettings": { + "methods": [ "GetAccessApprovalSettings" ] }, - "GetApprovalRequest": { - "methods": [ + "GetApprovalRequest": { + "methods": [ "GetApprovalRequest" ] }, - "ListApprovalRequests": { - "methods": [ + "ListApprovalRequests": { + "methods": [ "ListApprovalRequests" ] }, - "UpdateAccessApprovalSettings": { - "methods": [ + "UpdateAccessApprovalSettings": { + "methods": [ "UpdateAccessApprovalSettings" ] } diff --git a/aiplatform/apiv1/doc.go b/aiplatform/apiv1/doc.go index c78bb382cab..ed83992c68f 100644 --- a/aiplatform/apiv1/doc.go +++ b/aiplatform/apiv1/doc.go @@ -51,7 +51,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210630" +const versionClient = "20210701" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/aiplatform/apiv1/gapic_metadata.json b/aiplatform/apiv1/gapic_metadata.json index da1d3982b2a..b0e687801dd 100644 --- a/aiplatform/apiv1/gapic_metadata.json +++ b/aiplatform/apiv1/gapic_metadata.json @@ -1,62 +1,62 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.aiplatform.v1", - "libraryPackage": "cloud.google.com/go/aiplatform/apiv1", - "services": { - "DatasetService": { - "clients": { - "grpc": { - "libraryClient": "DatasetClient", - "rpcs": { - "CreateDataset": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.aiplatform.v1", + "libraryPackage": "cloud.google.com/go/aiplatform/apiv1", + "services": { + "DatasetService": { + "clients": { + "grpc": { + "libraryClient": "DatasetClient", + "rpcs": { + "CreateDataset": { + "methods": [ "CreateDataset" ] }, - "DeleteDataset": { - "methods": [ + "DeleteDataset": { + "methods": [ "DeleteDataset" ] }, - "ExportData": { - "methods": [ + "ExportData": { + "methods": [ "ExportData" ] }, - "GetAnnotationSpec": { - "methods": [ + "GetAnnotationSpec": { + "methods": [ "GetAnnotationSpec" ] }, - "GetDataset": { - "methods": [ + "GetDataset": { + "methods": [ "GetDataset" ] }, - "ImportData": { - "methods": [ + "ImportData": { + "methods": [ "ImportData" ] }, - "ListAnnotations": { - "methods": [ + "ListAnnotations": { + "methods": [ "ListAnnotations" ] }, - "ListDataItems": { - "methods": [ + "ListDataItems": { + "methods": [ "ListDataItems" ] }, - "ListDatasets": { - "methods": [ + "ListDatasets": { + "methods": [ "ListDatasets" ] }, - "UpdateDataset": { - "methods": [ + "UpdateDataset": { + "methods": [ "UpdateDataset" ] } @@ -64,43 +64,43 @@ } } }, - "EndpointService": { - "clients": { - "grpc": { - "libraryClient": "EndpointClient", - "rpcs": { - "CreateEndpoint": { - "methods": [ + "EndpointService": { + "clients": { + "grpc": { + "libraryClient": "EndpointClient", + "rpcs": { + "CreateEndpoint": { + "methods": [ "CreateEndpoint" ] }, - "DeleteEndpoint": { - "methods": [ + "DeleteEndpoint": { + "methods": [ "DeleteEndpoint" ] }, - "DeployModel": { - "methods": [ + "DeployModel": { + "methods": [ "DeployModel" ] }, - "GetEndpoint": { - "methods": [ + "GetEndpoint": { + "methods": [ "GetEndpoint" ] }, - "ListEndpoints": { - "methods": [ + "ListEndpoints": { + "methods": [ "ListEndpoints" ] }, - "UndeployModel": { - "methods": [ + "UndeployModel": { + "methods": [ "UndeployModel" ] }, - "UpdateEndpoint": { - "methods": [ + "UpdateEndpoint": { + "methods": [ "UpdateEndpoint" ] } @@ -108,108 +108,108 @@ } } }, - "JobService": { - "clients": { - "grpc": { - "libraryClient": "JobClient", - "rpcs": { - "CancelBatchPredictionJob": { - "methods": [ + "JobService": { + "clients": { + "grpc": { + "libraryClient": "JobClient", + "rpcs": { + "CancelBatchPredictionJob": { + "methods": [ "CancelBatchPredictionJob" ] }, - "CancelCustomJob": { - "methods": [ + "CancelCustomJob": { + "methods": [ "CancelCustomJob" ] }, - "CancelDataLabelingJob": { - "methods": [ + "CancelDataLabelingJob": { + "methods": [ "CancelDataLabelingJob" ] }, - "CancelHyperparameterTuningJob": { - "methods": [ + "CancelHyperparameterTuningJob": { + "methods": [ "CancelHyperparameterTuningJob" ] }, - "CreateBatchPredictionJob": { - "methods": [ + "CreateBatchPredictionJob": { + "methods": [ "CreateBatchPredictionJob" ] }, - "CreateCustomJob": { - "methods": [ + "CreateCustomJob": { + "methods": [ "CreateCustomJob" ] }, - "CreateDataLabelingJob": { - "methods": [ + "CreateDataLabelingJob": { + "methods": [ "CreateDataLabelingJob" ] }, - "CreateHyperparameterTuningJob": { - "methods": [ + "CreateHyperparameterTuningJob": { + "methods": [ "CreateHyperparameterTuningJob" ] }, - "DeleteBatchPredictionJob": { - "methods": [ + "DeleteBatchPredictionJob": { + "methods": [ "DeleteBatchPredictionJob" ] }, - "DeleteCustomJob": { - "methods": [ + "DeleteCustomJob": { + "methods": [ "DeleteCustomJob" ] }, - "DeleteDataLabelingJob": { - "methods": [ + "DeleteDataLabelingJob": { + "methods": [ "DeleteDataLabelingJob" ] }, - "DeleteHyperparameterTuningJob": { - "methods": [ + "DeleteHyperparameterTuningJob": { + "methods": [ "DeleteHyperparameterTuningJob" ] }, - "GetBatchPredictionJob": { - "methods": [ + "GetBatchPredictionJob": { + "methods": [ "GetBatchPredictionJob" ] }, - "GetCustomJob": { - "methods": [ + "GetCustomJob": { + "methods": [ "GetCustomJob" ] }, - "GetDataLabelingJob": { - "methods": [ + "GetDataLabelingJob": { + "methods": [ "GetDataLabelingJob" ] }, - "GetHyperparameterTuningJob": { - "methods": [ + "GetHyperparameterTuningJob": { + "methods": [ "GetHyperparameterTuningJob" ] }, - "ListBatchPredictionJobs": { - "methods": [ + "ListBatchPredictionJobs": { + "methods": [ "ListBatchPredictionJobs" ] }, - "ListCustomJobs": { - "methods": [ + "ListCustomJobs": { + "methods": [ "ListCustomJobs" ] }, - "ListDataLabelingJobs": { - "methods": [ + "ListDataLabelingJobs": { + "methods": [ "ListDataLabelingJobs" ] }, - "ListHyperparameterTuningJobs": { - "methods": [ + "ListHyperparameterTuningJobs": { + "methods": [ "ListHyperparameterTuningJobs" ] } @@ -217,18 +217,18 @@ } } }, - "MigrationService": { - "clients": { - "grpc": { - "libraryClient": "MigrationClient", - "rpcs": { - "BatchMigrateResources": { - "methods": [ + "MigrationService": { + "clients": { + "grpc": { + "libraryClient": "MigrationClient", + "rpcs": { + "BatchMigrateResources": { + "methods": [ "BatchMigrateResources" ] }, - "SearchMigratableResources": { - "methods": [ + "SearchMigratableResources": { + "methods": [ "SearchMigratableResources" ] } @@ -236,58 +236,58 @@ } } }, - "ModelService": { - "clients": { - "grpc": { - "libraryClient": "ModelClient", - "rpcs": { - "DeleteModel": { - "methods": [ + "ModelService": { + "clients": { + "grpc": { + "libraryClient": "ModelClient", + "rpcs": { + "DeleteModel": { + "methods": [ "DeleteModel" ] }, - "ExportModel": { - "methods": [ + "ExportModel": { + "methods": [ "ExportModel" ] }, - "GetModel": { - "methods": [ + "GetModel": { + "methods": [ "GetModel" ] }, - "GetModelEvaluation": { - "methods": [ + "GetModelEvaluation": { + "methods": [ "GetModelEvaluation" ] }, - "GetModelEvaluationSlice": { - "methods": [ + "GetModelEvaluationSlice": { + "methods": [ "GetModelEvaluationSlice" ] }, - "ListModelEvaluationSlices": { - "methods": [ + "ListModelEvaluationSlices": { + "methods": [ "ListModelEvaluationSlices" ] }, - "ListModelEvaluations": { - "methods": [ + "ListModelEvaluations": { + "methods": [ "ListModelEvaluations" ] }, - "ListModels": { - "methods": [ + "ListModels": { + "methods": [ "ListModels" ] }, - "UpdateModel": { - "methods": [ + "UpdateModel": { + "methods": [ "UpdateModel" ] }, - "UploadModel": { - "methods": [ + "UploadModel": { + "methods": [ "UploadModel" ] } @@ -295,33 +295,33 @@ } } }, - "PipelineService": { - "clients": { - "grpc": { - "libraryClient": "PipelineClient", - "rpcs": { - "CancelTrainingPipeline": { - "methods": [ + "PipelineService": { + "clients": { + "grpc": { + "libraryClient": "PipelineClient", + "rpcs": { + "CancelTrainingPipeline": { + "methods": [ "CancelTrainingPipeline" ] }, - "CreateTrainingPipeline": { - "methods": [ + "CreateTrainingPipeline": { + "methods": [ "CreateTrainingPipeline" ] }, - "DeleteTrainingPipeline": { - "methods": [ + "DeleteTrainingPipeline": { + "methods": [ "DeleteTrainingPipeline" ] }, - "GetTrainingPipeline": { - "methods": [ + "GetTrainingPipeline": { + "methods": [ "GetTrainingPipeline" ] }, - "ListTrainingPipelines": { - "methods": [ + "ListTrainingPipelines": { + "methods": [ "ListTrainingPipelines" ] } @@ -329,13 +329,13 @@ } } }, - "PredictionService": { - "clients": { - "grpc": { - "libraryClient": "PredictionClient", - "rpcs": { - "Predict": { - "methods": [ + "PredictionService": { + "clients": { + "grpc": { + "libraryClient": "PredictionClient", + "rpcs": { + "Predict": { + "methods": [ "Predict" ] } @@ -343,33 +343,33 @@ } } }, - "SpecialistPoolService": { - "clients": { - "grpc": { - "libraryClient": "SpecialistPoolClient", - "rpcs": { - "CreateSpecialistPool": { - "methods": [ + "SpecialistPoolService": { + "clients": { + "grpc": { + "libraryClient": "SpecialistPoolClient", + "rpcs": { + "CreateSpecialistPool": { + "methods": [ "CreateSpecialistPool" ] }, - "DeleteSpecialistPool": { - "methods": [ + "DeleteSpecialistPool": { + "methods": [ "DeleteSpecialistPool" ] }, - "GetSpecialistPool": { - "methods": [ + "GetSpecialistPool": { + "methods": [ "GetSpecialistPool" ] }, - "ListSpecialistPools": { - "methods": [ + "ListSpecialistPools": { + "methods": [ "ListSpecialistPools" ] }, - "UpdateSpecialistPool": { - "methods": [ + "UpdateSpecialistPool": { + "methods": [ "UpdateSpecialistPool" ] } diff --git a/analytics/admin/apiv1alpha/doc.go b/analytics/admin/apiv1alpha/doc.go index 99bd441af93..45b5491c685 100644 --- a/analytics/admin/apiv1alpha/doc.go +++ b/analytics/admin/apiv1alpha/doc.go @@ -48,7 +48,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210630" +const versionClient = "20210701" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/analytics/admin/apiv1alpha/gapic_metadata.json b/analytics/admin/apiv1alpha/gapic_metadata.json index b7e9628c956..582fd4892aa 100644 --- a/analytics/admin/apiv1alpha/gapic_metadata.json +++ b/analytics/admin/apiv1alpha/gapic_metadata.json @@ -1,352 +1,352 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.analytics.admin.v1alpha", - "libraryPackage": "cloud.google.com/go/analytics/admin/apiv1alpha", - "services": { - "AnalyticsAdminService": { - "clients": { - "grpc": { - "libraryClient": "AnalyticsAdminClient", - "rpcs": { - "ArchiveCustomDimension": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.analytics.admin.v1alpha", + "libraryPackage": "cloud.google.com/go/analytics/admin/apiv1alpha", + "services": { + "AnalyticsAdminService": { + "clients": { + "grpc": { + "libraryClient": "AnalyticsAdminClient", + "rpcs": { + "ArchiveCustomDimension": { + "methods": [ "ArchiveCustomDimension" ] }, - "ArchiveCustomMetric": { - "methods": [ + "ArchiveCustomMetric": { + "methods": [ "ArchiveCustomMetric" ] }, - "AuditUserLinks": { - "methods": [ + "AuditUserLinks": { + "methods": [ "AuditUserLinks" ] }, - "BatchCreateUserLinks": { - "methods": [ + "BatchCreateUserLinks": { + "methods": [ "BatchCreateUserLinks" ] }, - "BatchDeleteUserLinks": { - "methods": [ + "BatchDeleteUserLinks": { + "methods": [ "BatchDeleteUserLinks" ] }, - "BatchGetUserLinks": { - "methods": [ + "BatchGetUserLinks": { + "methods": [ "BatchGetUserLinks" ] }, - "BatchUpdateUserLinks": { - "methods": [ + "BatchUpdateUserLinks": { + "methods": [ "BatchUpdateUserLinks" ] }, - "CreateConversionEvent": { - "methods": [ + "CreateConversionEvent": { + "methods": [ "CreateConversionEvent" ] }, - "CreateCustomDimension": { - "methods": [ + "CreateCustomDimension": { + "methods": [ "CreateCustomDimension" ] }, - "CreateCustomMetric": { - "methods": [ + "CreateCustomMetric": { + "methods": [ "CreateCustomMetric" ] }, - "CreateFirebaseLink": { - "methods": [ + "CreateFirebaseLink": { + "methods": [ "CreateFirebaseLink" ] }, - "CreateGoogleAdsLink": { - "methods": [ + "CreateGoogleAdsLink": { + "methods": [ "CreateGoogleAdsLink" ] }, - "CreateMeasurementProtocolSecret": { - "methods": [ + "CreateMeasurementProtocolSecret": { + "methods": [ "CreateMeasurementProtocolSecret" ] }, - "CreateProperty": { - "methods": [ + "CreateProperty": { + "methods": [ "CreateProperty" ] }, - "CreateUserLink": { - "methods": [ + "CreateUserLink": { + "methods": [ "CreateUserLink" ] }, - "CreateWebDataStream": { - "methods": [ + "CreateWebDataStream": { + "methods": [ "CreateWebDataStream" ] }, - "DeleteAccount": { - "methods": [ + "DeleteAccount": { + "methods": [ "DeleteAccount" ] }, - "DeleteAndroidAppDataStream": { - "methods": [ + "DeleteAndroidAppDataStream": { + "methods": [ "DeleteAndroidAppDataStream" ] }, - "DeleteConversionEvent": { - "methods": [ + "DeleteConversionEvent": { + "methods": [ "DeleteConversionEvent" ] }, - "DeleteFirebaseLink": { - "methods": [ + "DeleteFirebaseLink": { + "methods": [ "DeleteFirebaseLink" ] }, - "DeleteGoogleAdsLink": { - "methods": [ + "DeleteGoogleAdsLink": { + "methods": [ "DeleteGoogleAdsLink" ] }, - "DeleteIosAppDataStream": { - "methods": [ + "DeleteIosAppDataStream": { + "methods": [ "DeleteIosAppDataStream" ] }, - "DeleteMeasurementProtocolSecret": { - "methods": [ + "DeleteMeasurementProtocolSecret": { + "methods": [ "DeleteMeasurementProtocolSecret" ] }, - "DeleteProperty": { - "methods": [ + "DeleteProperty": { + "methods": [ "DeleteProperty" ] }, - "DeleteUserLink": { - "methods": [ + "DeleteUserLink": { + "methods": [ "DeleteUserLink" ] }, - "DeleteWebDataStream": { - "methods": [ + "DeleteWebDataStream": { + "methods": [ "DeleteWebDataStream" ] }, - "GetAccount": { - "methods": [ + "GetAccount": { + "methods": [ "GetAccount" ] }, - "GetAndroidAppDataStream": { - "methods": [ + "GetAndroidAppDataStream": { + "methods": [ "GetAndroidAppDataStream" ] }, - "GetConversionEvent": { - "methods": [ + "GetConversionEvent": { + "methods": [ "GetConversionEvent" ] }, - "GetCustomDimension": { - "methods": [ + "GetCustomDimension": { + "methods": [ "GetCustomDimension" ] }, - "GetCustomMetric": { - "methods": [ + "GetCustomMetric": { + "methods": [ "GetCustomMetric" ] }, - "GetDataSharingSettings": { - "methods": [ + "GetDataSharingSettings": { + "methods": [ "GetDataSharingSettings" ] }, - "GetEnhancedMeasurementSettings": { - "methods": [ + "GetEnhancedMeasurementSettings": { + "methods": [ "GetEnhancedMeasurementSettings" ] }, - "GetGlobalSiteTag": { - "methods": [ + "GetGlobalSiteTag": { + "methods": [ "GetGlobalSiteTag" ] }, - "GetGoogleSignalsSettings": { - "methods": [ + "GetGoogleSignalsSettings": { + "methods": [ "GetGoogleSignalsSettings" ] }, - "GetIosAppDataStream": { - "methods": [ + "GetIosAppDataStream": { + "methods": [ "GetIosAppDataStream" ] }, - "GetMeasurementProtocolSecret": { - "methods": [ + "GetMeasurementProtocolSecret": { + "methods": [ "GetMeasurementProtocolSecret" ] }, - "GetProperty": { - "methods": [ + "GetProperty": { + "methods": [ "GetProperty" ] }, - "GetUserLink": { - "methods": [ + "GetUserLink": { + "methods": [ "GetUserLink" ] }, - "GetWebDataStream": { - "methods": [ + "GetWebDataStream": { + "methods": [ "GetWebDataStream" ] }, - "ListAccountSummaries": { - "methods": [ + "ListAccountSummaries": { + "methods": [ "ListAccountSummaries" ] }, - "ListAccounts": { - "methods": [ + "ListAccounts": { + "methods": [ "ListAccounts" ] }, - "ListAndroidAppDataStreams": { - "methods": [ + "ListAndroidAppDataStreams": { + "methods": [ "ListAndroidAppDataStreams" ] }, - "ListConversionEvents": { - "methods": [ + "ListConversionEvents": { + "methods": [ "ListConversionEvents" ] }, - "ListCustomDimensions": { - "methods": [ + "ListCustomDimensions": { + "methods": [ "ListCustomDimensions" ] }, - "ListCustomMetrics": { - "methods": [ + "ListCustomMetrics": { + "methods": [ "ListCustomMetrics" ] }, - "ListFirebaseLinks": { - "methods": [ + "ListFirebaseLinks": { + "methods": [ "ListFirebaseLinks" ] }, - "ListGoogleAdsLinks": { - "methods": [ + "ListGoogleAdsLinks": { + "methods": [ "ListGoogleAdsLinks" ] }, - "ListIosAppDataStreams": { - "methods": [ + "ListIosAppDataStreams": { + "methods": [ "ListIosAppDataStreams" ] }, - "ListMeasurementProtocolSecrets": { - "methods": [ + "ListMeasurementProtocolSecrets": { + "methods": [ "ListMeasurementProtocolSecrets" ] }, - "ListProperties": { - "methods": [ + "ListProperties": { + "methods": [ "ListProperties" ] }, - "ListUserLinks": { - "methods": [ + "ListUserLinks": { + "methods": [ "ListUserLinks" ] }, - "ListWebDataStreams": { - "methods": [ + "ListWebDataStreams": { + "methods": [ "ListWebDataStreams" ] }, - "ProvisionAccountTicket": { - "methods": [ + "ProvisionAccountTicket": { + "methods": [ "ProvisionAccountTicket" ] }, - "SearchChangeHistoryEvents": { - "methods": [ + "SearchChangeHistoryEvents": { + "methods": [ "SearchChangeHistoryEvents" ] }, - "UpdateAccount": { - "methods": [ + "UpdateAccount": { + "methods": [ "UpdateAccount" ] }, - "UpdateAndroidAppDataStream": { - "methods": [ + "UpdateAndroidAppDataStream": { + "methods": [ "UpdateAndroidAppDataStream" ] }, - "UpdateCustomDimension": { - "methods": [ + "UpdateCustomDimension": { + "methods": [ "UpdateCustomDimension" ] }, - "UpdateCustomMetric": { - "methods": [ + "UpdateCustomMetric": { + "methods": [ "UpdateCustomMetric" ] }, - "UpdateEnhancedMeasurementSettings": { - "methods": [ + "UpdateEnhancedMeasurementSettings": { + "methods": [ "UpdateEnhancedMeasurementSettings" ] }, - "UpdateFirebaseLink": { - "methods": [ + "UpdateFirebaseLink": { + "methods": [ "UpdateFirebaseLink" ] }, - "UpdateGoogleAdsLink": { - "methods": [ + "UpdateGoogleAdsLink": { + "methods": [ "UpdateGoogleAdsLink" ] }, - "UpdateGoogleSignalsSettings": { - "methods": [ + "UpdateGoogleSignalsSettings": { + "methods": [ "UpdateGoogleSignalsSettings" ] }, - "UpdateIosAppDataStream": { - "methods": [ + "UpdateIosAppDataStream": { + "methods": [ "UpdateIosAppDataStream" ] }, - "UpdateMeasurementProtocolSecret": { - "methods": [ + "UpdateMeasurementProtocolSecret": { + "methods": [ "UpdateMeasurementProtocolSecret" ] }, - "UpdateProperty": { - "methods": [ + "UpdateProperty": { + "methods": [ "UpdateProperty" ] }, - "UpdateUserLink": { - "methods": [ + "UpdateUserLink": { + "methods": [ "UpdateUserLink" ] }, - "UpdateWebDataStream": { - "methods": [ + "UpdateWebDataStream": { + "methods": [ "UpdateWebDataStream" ] } diff --git a/analytics/data/apiv1alpha/doc.go b/analytics/data/apiv1alpha/doc.go index 51e245cecb2..910b0e116d2 100644 --- a/analytics/data/apiv1alpha/doc.go +++ b/analytics/data/apiv1alpha/doc.go @@ -50,7 +50,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210630" +const versionClient = "20210701" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/analytics/data/apiv1alpha/gapic_metadata.json b/analytics/data/apiv1alpha/gapic_metadata.json index 5ad1bb6317e..88df4f94f55 100644 --- a/analytics/data/apiv1alpha/gapic_metadata.json +++ b/analytics/data/apiv1alpha/gapic_metadata.json @@ -1,42 +1,42 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.analytics.data.v1alpha", - "libraryPackage": "cloud.google.com/go/analytics/data/apiv1alpha", - "services": { - "AlphaAnalyticsData": { - "clients": { - "grpc": { - "libraryClient": "AlphaAnalyticsDataClient", - "rpcs": { - "BatchRunPivotReports": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.analytics.data.v1alpha", + "libraryPackage": "cloud.google.com/go/analytics/data/apiv1alpha", + "services": { + "AlphaAnalyticsData": { + "clients": { + "grpc": { + "libraryClient": "AlphaAnalyticsDataClient", + "rpcs": { + "BatchRunPivotReports": { + "methods": [ "BatchRunPivotReports" ] }, - "BatchRunReports": { - "methods": [ + "BatchRunReports": { + "methods": [ "BatchRunReports" ] }, - "GetMetadata": { - "methods": [ + "GetMetadata": { + "methods": [ "GetMetadata" ] }, - "RunPivotReport": { - "methods": [ + "RunPivotReport": { + "methods": [ "RunPivotReport" ] }, - "RunRealtimeReport": { - "methods": [ + "RunRealtimeReport": { + "methods": [ "RunRealtimeReport" ] }, - "RunReport": { - "methods": [ + "RunReport": { + "methods": [ "RunReport" ] } diff --git a/apigateway/apiv1/doc.go b/apigateway/apiv1/doc.go index 4662a1ac1b5..c82a2e66029 100644 --- a/apigateway/apiv1/doc.go +++ b/apigateway/apiv1/doc.go @@ -46,7 +46,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210630" +const versionClient = "20210701" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/apigateway/apiv1/gapic_metadata.json b/apigateway/apiv1/gapic_metadata.json index af901b73b0f..80e7cec7f00 100644 --- a/apigateway/apiv1/gapic_metadata.json +++ b/apigateway/apiv1/gapic_metadata.json @@ -1,87 +1,87 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.apigateway.v1", - "libraryPackage": "cloud.google.com/go/apigateway/apiv1", - "services": { - "ApiGatewayService": { - "clients": { - "grpc": { - "libraryClient": "Client", - "rpcs": { - "CreateApi": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.apigateway.v1", + "libraryPackage": "cloud.google.com/go/apigateway/apiv1", + "services": { + "ApiGatewayService": { + "clients": { + "grpc": { + "libraryClient": "Client", + "rpcs": { + "CreateApi": { + "methods": [ "CreateApi" ] }, - "CreateApiConfig": { - "methods": [ + "CreateApiConfig": { + "methods": [ "CreateApiConfig" ] }, - "CreateGateway": { - "methods": [ + "CreateGateway": { + "methods": [ "CreateGateway" ] }, - "DeleteApi": { - "methods": [ + "DeleteApi": { + "methods": [ "DeleteApi" ] }, - "DeleteApiConfig": { - "methods": [ + "DeleteApiConfig": { + "methods": [ "DeleteApiConfig" ] }, - "DeleteGateway": { - "methods": [ + "DeleteGateway": { + "methods": [ "DeleteGateway" ] }, - "GetApi": { - "methods": [ + "GetApi": { + "methods": [ "GetApi" ] }, - "GetApiConfig": { - "methods": [ + "GetApiConfig": { + "methods": [ "GetApiConfig" ] }, - "GetGateway": { - "methods": [ + "GetGateway": { + "methods": [ "GetGateway" ] }, - "ListApiConfigs": { - "methods": [ + "ListApiConfigs": { + "methods": [ "ListApiConfigs" ] }, - "ListApis": { - "methods": [ + "ListApis": { + "methods": [ "ListApis" ] }, - "ListGateways": { - "methods": [ + "ListGateways": { + "methods": [ "ListGateways" ] }, - "UpdateApi": { - "methods": [ + "UpdateApi": { + "methods": [ "UpdateApi" ] }, - "UpdateApiConfig": { - "methods": [ + "UpdateApiConfig": { + "methods": [ "UpdateApiConfig" ] }, - "UpdateGateway": { - "methods": [ + "UpdateGateway": { + "methods": [ "UpdateGateway" ] } diff --git a/apigeeconnect/apiv1/doc.go b/apigeeconnect/apiv1/doc.go index d1f218d91fe..0cd7905ed55 100644 --- a/apigeeconnect/apiv1/doc.go +++ b/apigeeconnect/apiv1/doc.go @@ -48,7 +48,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210630" +const versionClient = "20210701" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/apigeeconnect/apiv1/gapic_metadata.json b/apigeeconnect/apiv1/gapic_metadata.json index c07a734a1f4..9840b14ee63 100644 --- a/apigeeconnect/apiv1/gapic_metadata.json +++ b/apigeeconnect/apiv1/gapic_metadata.json @@ -1,17 +1,17 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.apigeeconnect.v1", - "libraryPackage": "cloud.google.com/go/apigeeconnect/apiv1", - "services": { - "ConnectionService": { - "clients": { - "grpc": { - "libraryClient": "ConnectionClient", - "rpcs": { - "ListConnections": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.apigeeconnect.v1", + "libraryPackage": "cloud.google.com/go/apigeeconnect/apiv1", + "services": { + "ConnectionService": { + "clients": { + "grpc": { + "libraryClient": "ConnectionClient", + "rpcs": { + "ListConnections": { + "methods": [ "ListConnections" ] } @@ -19,13 +19,13 @@ } } }, - "Tether": { - "clients": { - "grpc": { - "libraryClient": "TetherClient", - "rpcs": { - "Egress": { - "methods": [ + "Tether": { + "clients": { + "grpc": { + "libraryClient": "TetherClient", + "rpcs": { + "Egress": { + "methods": [ "Egress" ] } diff --git a/appengine/apiv1/doc.go b/appengine/apiv1/doc.go index fc37155009a..a2deb21f60e 100644 --- a/appengine/apiv1/doc.go +++ b/appengine/apiv1/doc.go @@ -48,7 +48,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210630" +const versionClient = "20210701" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/appengine/apiv1/gapic_metadata.json b/appengine/apiv1/gapic_metadata.json index aa7fd194333..c8dde65ebcc 100644 --- a/appengine/apiv1/gapic_metadata.json +++ b/appengine/apiv1/gapic_metadata.json @@ -1,32 +1,32 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.appengine.v1", - "libraryPackage": "cloud.google.com/go/appengine/apiv1", - "services": { - "Applications": { - "clients": { - "grpc": { - "libraryClient": "ApplicationsClient", - "rpcs": { - "CreateApplication": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.appengine.v1", + "libraryPackage": "cloud.google.com/go/appengine/apiv1", + "services": { + "Applications": { + "clients": { + "grpc": { + "libraryClient": "ApplicationsClient", + "rpcs": { + "CreateApplication": { + "methods": [ "CreateApplication" ] }, - "GetApplication": { - "methods": [ + "GetApplication": { + "methods": [ "GetApplication" ] }, - "RepairApplication": { - "methods": [ + "RepairApplication": { + "methods": [ "RepairApplication" ] }, - "UpdateApplication": { - "methods": [ + "UpdateApplication": { + "methods": [ "UpdateApplication" ] } @@ -34,33 +34,33 @@ } } }, - "AuthorizedCertificates": { - "clients": { - "grpc": { - "libraryClient": "AuthorizedCertificatesClient", - "rpcs": { - "CreateAuthorizedCertificate": { - "methods": [ + "AuthorizedCertificates": { + "clients": { + "grpc": { + "libraryClient": "AuthorizedCertificatesClient", + "rpcs": { + "CreateAuthorizedCertificate": { + "methods": [ "CreateAuthorizedCertificate" ] }, - "DeleteAuthorizedCertificate": { - "methods": [ + "DeleteAuthorizedCertificate": { + "methods": [ "DeleteAuthorizedCertificate" ] }, - "GetAuthorizedCertificate": { - "methods": [ + "GetAuthorizedCertificate": { + "methods": [ "GetAuthorizedCertificate" ] }, - "ListAuthorizedCertificates": { - "methods": [ + "ListAuthorizedCertificates": { + "methods": [ "ListAuthorizedCertificates" ] }, - "UpdateAuthorizedCertificate": { - "methods": [ + "UpdateAuthorizedCertificate": { + "methods": [ "UpdateAuthorizedCertificate" ] } @@ -68,13 +68,13 @@ } } }, - "AuthorizedDomains": { - "clients": { - "grpc": { - "libraryClient": "AuthorizedDomainsClient", - "rpcs": { - "ListAuthorizedDomains": { - "methods": [ + "AuthorizedDomains": { + "clients": { + "grpc": { + "libraryClient": "AuthorizedDomainsClient", + "rpcs": { + "ListAuthorizedDomains": { + "methods": [ "ListAuthorizedDomains" ] } @@ -82,33 +82,33 @@ } } }, - "DomainMappings": { - "clients": { - "grpc": { - "libraryClient": "DomainMappingsClient", - "rpcs": { - "CreateDomainMapping": { - "methods": [ + "DomainMappings": { + "clients": { + "grpc": { + "libraryClient": "DomainMappingsClient", + "rpcs": { + "CreateDomainMapping": { + "methods": [ "CreateDomainMapping" ] }, - "DeleteDomainMapping": { - "methods": [ + "DeleteDomainMapping": { + "methods": [ "DeleteDomainMapping" ] }, - "GetDomainMapping": { - "methods": [ + "GetDomainMapping": { + "methods": [ "GetDomainMapping" ] }, - "ListDomainMappings": { - "methods": [ + "ListDomainMappings": { + "methods": [ "ListDomainMappings" ] }, - "UpdateDomainMapping": { - "methods": [ + "UpdateDomainMapping": { + "methods": [ "UpdateDomainMapping" ] } @@ -116,38 +116,38 @@ } } }, - "Firewall": { - "clients": { - "grpc": { - "libraryClient": "FirewallClient", - "rpcs": { - "BatchUpdateIngressRules": { - "methods": [ + "Firewall": { + "clients": { + "grpc": { + "libraryClient": "FirewallClient", + "rpcs": { + "BatchUpdateIngressRules": { + "methods": [ "BatchUpdateIngressRules" ] }, - "CreateIngressRule": { - "methods": [ + "CreateIngressRule": { + "methods": [ "CreateIngressRule" ] }, - "DeleteIngressRule": { - "methods": [ + "DeleteIngressRule": { + "methods": [ "DeleteIngressRule" ] }, - "GetIngressRule": { - "methods": [ + "GetIngressRule": { + "methods": [ "GetIngressRule" ] }, - "ListIngressRules": { - "methods": [ + "ListIngressRules": { + "methods": [ "ListIngressRules" ] }, - "UpdateIngressRule": { - "methods": [ + "UpdateIngressRule": { + "methods": [ "UpdateIngressRule" ] } @@ -155,28 +155,28 @@ } } }, - "Instances": { - "clients": { - "grpc": { - "libraryClient": "InstancesClient", - "rpcs": { - "DebugInstance": { - "methods": [ + "Instances": { + "clients": { + "grpc": { + "libraryClient": "InstancesClient", + "rpcs": { + "DebugInstance": { + "methods": [ "DebugInstance" ] }, - "DeleteInstance": { - "methods": [ + "DeleteInstance": { + "methods": [ "DeleteInstance" ] }, - "GetInstance": { - "methods": [ + "GetInstance": { + "methods": [ "GetInstance" ] }, - "ListInstances": { - "methods": [ + "ListInstances": { + "methods": [ "ListInstances" ] } @@ -184,28 +184,28 @@ } } }, - "Services": { - "clients": { - "grpc": { - "libraryClient": "ServicesClient", - "rpcs": { - "DeleteService": { - "methods": [ + "Services": { + "clients": { + "grpc": { + "libraryClient": "ServicesClient", + "rpcs": { + "DeleteService": { + "methods": [ "DeleteService" ] }, - "GetService": { - "methods": [ + "GetService": { + "methods": [ "GetService" ] }, - "ListServices": { - "methods": [ + "ListServices": { + "methods": [ "ListServices" ] }, - "UpdateService": { - "methods": [ + "UpdateService": { + "methods": [ "UpdateService" ] } @@ -213,33 +213,33 @@ } } }, - "Versions": { - "clients": { - "grpc": { - "libraryClient": "VersionsClient", - "rpcs": { - "CreateVersion": { - "methods": [ + "Versions": { + "clients": { + "grpc": { + "libraryClient": "VersionsClient", + "rpcs": { + "CreateVersion": { + "methods": [ "CreateVersion" ] }, - "DeleteVersion": { - "methods": [ + "DeleteVersion": { + "methods": [ "DeleteVersion" ] }, - "GetVersion": { - "methods": [ + "GetVersion": { + "methods": [ "GetVersion" ] }, - "ListVersions": { - "methods": [ + "ListVersions": { + "methods": [ "ListVersions" ] }, - "UpdateVersion": { - "methods": [ + "UpdateVersion": { + "methods": [ "UpdateVersion" ] } diff --git a/area120/tables/apiv1alpha1/doc.go b/area120/tables/apiv1alpha1/doc.go index 8e4a5072d9e..8ad0b3b2cda 100644 --- a/area120/tables/apiv1alpha1/doc.go +++ b/area120/tables/apiv1alpha1/doc.go @@ -48,7 +48,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210630" +const versionClient = "20210701" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/area120/tables/apiv1alpha1/gapic_metadata.json b/area120/tables/apiv1alpha1/gapic_metadata.json index 784712b0fcb..5e6200fc68e 100644 --- a/area120/tables/apiv1alpha1/gapic_metadata.json +++ b/area120/tables/apiv1alpha1/gapic_metadata.json @@ -1,72 +1,72 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.area120.tables.v1alpha1", - "libraryPackage": "cloud.google.com/go/area120/tables/apiv1alpha1", - "services": { - "TablesService": { - "clients": { - "grpc": { - "libraryClient": "Client", - "rpcs": { - "BatchCreateRows": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.area120.tables.v1alpha1", + "libraryPackage": "cloud.google.com/go/area120/tables/apiv1alpha1", + "services": { + "TablesService": { + "clients": { + "grpc": { + "libraryClient": "Client", + "rpcs": { + "BatchCreateRows": { + "methods": [ "BatchCreateRows" ] }, - "BatchDeleteRows": { - "methods": [ + "BatchDeleteRows": { + "methods": [ "BatchDeleteRows" ] }, - "BatchUpdateRows": { - "methods": [ + "BatchUpdateRows": { + "methods": [ "BatchUpdateRows" ] }, - "CreateRow": { - "methods": [ + "CreateRow": { + "methods": [ "CreateRow" ] }, - "DeleteRow": { - "methods": [ + "DeleteRow": { + "methods": [ "DeleteRow" ] }, - "GetRow": { - "methods": [ + "GetRow": { + "methods": [ "GetRow" ] }, - "GetTable": { - "methods": [ + "GetTable": { + "methods": [ "GetTable" ] }, - "GetWorkspace": { - "methods": [ + "GetWorkspace": { + "methods": [ "GetWorkspace" ] }, - "ListRows": { - "methods": [ + "ListRows": { + "methods": [ "ListRows" ] }, - "ListTables": { - "methods": [ + "ListTables": { + "methods": [ "ListTables" ] }, - "ListWorkspaces": { - "methods": [ + "ListWorkspaces": { + "methods": [ "ListWorkspaces" ] }, - "UpdateRow": { - "methods": [ + "UpdateRow": { + "methods": [ "UpdateRow" ] } diff --git a/artifactregistry/apiv1beta2/doc.go b/artifactregistry/apiv1beta2/doc.go index 0c527b5f917..b9b06bfa24e 100644 --- a/artifactregistry/apiv1beta2/doc.go +++ b/artifactregistry/apiv1beta2/doc.go @@ -49,7 +49,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210630" +const versionClient = "20210701" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/artifactregistry/apiv1beta2/gapic_metadata.json b/artifactregistry/apiv1beta2/gapic_metadata.json index 796c707d3a8..8777a1d7cce 100644 --- a/artifactregistry/apiv1beta2/gapic_metadata.json +++ b/artifactregistry/apiv1beta2/gapic_metadata.json @@ -1,117 +1,117 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.devtools.artifactregistry.v1beta2", - "libraryPackage": "cloud.google.com/go/artifactregistry/apiv1beta2", - "services": { - "ArtifactRegistry": { - "clients": { - "grpc": { - "libraryClient": "Client", - "rpcs": { - "CreateRepository": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.devtools.artifactregistry.v1beta2", + "libraryPackage": "cloud.google.com/go/artifactregistry/apiv1beta2", + "services": { + "ArtifactRegistry": { + "clients": { + "grpc": { + "libraryClient": "Client", + "rpcs": { + "CreateRepository": { + "methods": [ "CreateRepository" ] }, - "CreateTag": { - "methods": [ + "CreateTag": { + "methods": [ "CreateTag" ] }, - "DeletePackage": { - "methods": [ + "DeletePackage": { + "methods": [ "DeletePackage" ] }, - "DeleteRepository": { - "methods": [ + "DeleteRepository": { + "methods": [ "DeleteRepository" ] }, - "DeleteTag": { - "methods": [ + "DeleteTag": { + "methods": [ "DeleteTag" ] }, - "DeleteVersion": { - "methods": [ + "DeleteVersion": { + "methods": [ "DeleteVersion" ] }, - "GetFile": { - "methods": [ + "GetFile": { + "methods": [ "GetFile" ] }, - "GetIamPolicy": { - "methods": [ + "GetIamPolicy": { + "methods": [ "GetIamPolicy" ] }, - "GetPackage": { - "methods": [ + "GetPackage": { + "methods": [ "GetPackage" ] }, - "GetRepository": { - "methods": [ + "GetRepository": { + "methods": [ "GetRepository" ] }, - "GetTag": { - "methods": [ + "GetTag": { + "methods": [ "GetTag" ] }, - "GetVersion": { - "methods": [ + "GetVersion": { + "methods": [ "GetVersion" ] }, - "ListFiles": { - "methods": [ + "ListFiles": { + "methods": [ "ListFiles" ] }, - "ListPackages": { - "methods": [ + "ListPackages": { + "methods": [ "ListPackages" ] }, - "ListRepositories": { - "methods": [ + "ListRepositories": { + "methods": [ "ListRepositories" ] }, - "ListTags": { - "methods": [ + "ListTags": { + "methods": [ "ListTags" ] }, - "ListVersions": { - "methods": [ + "ListVersions": { + "methods": [ "ListVersions" ] }, - "SetIamPolicy": { - "methods": [ + "SetIamPolicy": { + "methods": [ "SetIamPolicy" ] }, - "TestIamPermissions": { - "methods": [ + "TestIamPermissions": { + "methods": [ "TestIamPermissions" ] }, - "UpdateRepository": { - "methods": [ + "UpdateRepository": { + "methods": [ "UpdateRepository" ] }, - "UpdateTag": { - "methods": [ + "UpdateTag": { + "methods": [ "UpdateTag" ] } diff --git a/asset/apiv1/doc.go b/asset/apiv1/doc.go index 4ad5c306d79..daac2897766 100644 --- a/asset/apiv1/doc.go +++ b/asset/apiv1/doc.go @@ -48,7 +48,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210630" +const versionClient = "20210701" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/asset/apiv1/gapic_metadata.json b/asset/apiv1/gapic_metadata.json index 9fac653bb97..dd6e9fda56a 100644 --- a/asset/apiv1/gapic_metadata.json +++ b/asset/apiv1/gapic_metadata.json @@ -1,72 +1,72 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.asset.v1", - "libraryPackage": "cloud.google.com/go/asset/apiv1", - "services": { - "AssetService": { - "clients": { - "grpc": { - "libraryClient": "Client", - "rpcs": { - "AnalyzeIamPolicy": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.asset.v1", + "libraryPackage": "cloud.google.com/go/asset/apiv1", + "services": { + "AssetService": { + "clients": { + "grpc": { + "libraryClient": "Client", + "rpcs": { + "AnalyzeIamPolicy": { + "methods": [ "AnalyzeIamPolicy" ] }, - "AnalyzeIamPolicyLongrunning": { - "methods": [ + "AnalyzeIamPolicyLongrunning": { + "methods": [ "AnalyzeIamPolicyLongrunning" ] }, - "BatchGetAssetsHistory": { - "methods": [ + "BatchGetAssetsHistory": { + "methods": [ "BatchGetAssetsHistory" ] }, - "CreateFeed": { - "methods": [ + "CreateFeed": { + "methods": [ "CreateFeed" ] }, - "DeleteFeed": { - "methods": [ + "DeleteFeed": { + "methods": [ "DeleteFeed" ] }, - "ExportAssets": { - "methods": [ + "ExportAssets": { + "methods": [ "ExportAssets" ] }, - "GetFeed": { - "methods": [ + "GetFeed": { + "methods": [ "GetFeed" ] }, - "ListAssets": { - "methods": [ + "ListAssets": { + "methods": [ "ListAssets" ] }, - "ListFeeds": { - "methods": [ + "ListFeeds": { + "methods": [ "ListFeeds" ] }, - "SearchAllIamPolicies": { - "methods": [ + "SearchAllIamPolicies": { + "methods": [ "SearchAllIamPolicies" ] }, - "SearchAllResources": { - "methods": [ + "SearchAllResources": { + "methods": [ "SearchAllResources" ] }, - "UpdateFeed": { - "methods": [ + "UpdateFeed": { + "methods": [ "UpdateFeed" ] } diff --git a/asset/apiv1p2beta1/doc.go b/asset/apiv1p2beta1/doc.go index 30cd912a40a..6016dbea501 100644 --- a/asset/apiv1p2beta1/doc.go +++ b/asset/apiv1p2beta1/doc.go @@ -50,7 +50,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210630" +const versionClient = "20210701" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/asset/apiv1p2beta1/gapic_metadata.json b/asset/apiv1p2beta1/gapic_metadata.json index 606a6f8f023..ea91937f100 100644 --- a/asset/apiv1p2beta1/gapic_metadata.json +++ b/asset/apiv1p2beta1/gapic_metadata.json @@ -1,37 +1,37 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.asset.v1p2beta1", - "libraryPackage": "cloud.google.com/go/asset/apiv1p2beta1", - "services": { - "AssetService": { - "clients": { - "grpc": { - "libraryClient": "Client", - "rpcs": { - "CreateFeed": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.asset.v1p2beta1", + "libraryPackage": "cloud.google.com/go/asset/apiv1p2beta1", + "services": { + "AssetService": { + "clients": { + "grpc": { + "libraryClient": "Client", + "rpcs": { + "CreateFeed": { + "methods": [ "CreateFeed" ] }, - "DeleteFeed": { - "methods": [ + "DeleteFeed": { + "methods": [ "DeleteFeed" ] }, - "GetFeed": { - "methods": [ + "GetFeed": { + "methods": [ "GetFeed" ] }, - "ListFeeds": { - "methods": [ + "ListFeeds": { + "methods": [ "ListFeeds" ] }, - "UpdateFeed": { - "methods": [ + "UpdateFeed": { + "methods": [ "UpdateFeed" ] } diff --git a/asset/apiv1p5beta1/doc.go b/asset/apiv1p5beta1/doc.go index a48287b7d9f..ea4ba08b1e5 100644 --- a/asset/apiv1p5beta1/doc.go +++ b/asset/apiv1p5beta1/doc.go @@ -50,7 +50,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210630" +const versionClient = "20210701" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/asset/apiv1p5beta1/gapic_metadata.json b/asset/apiv1p5beta1/gapic_metadata.json index 19e22893b65..f8255c2a8b3 100644 --- a/asset/apiv1p5beta1/gapic_metadata.json +++ b/asset/apiv1p5beta1/gapic_metadata.json @@ -1,17 +1,17 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.asset.v1p5beta1", - "libraryPackage": "cloud.google.com/go/asset/apiv1p5beta1", - "services": { - "AssetService": { - "clients": { - "grpc": { - "libraryClient": "Client", - "rpcs": { - "ListAssets": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.asset.v1p5beta1", + "libraryPackage": "cloud.google.com/go/asset/apiv1p5beta1", + "services": { + "AssetService": { + "clients": { + "grpc": { + "libraryClient": "Client", + "rpcs": { + "ListAssets": { + "methods": [ "ListAssets" ] } diff --git a/assuredworkloads/apiv1beta1/doc.go b/assuredworkloads/apiv1beta1/doc.go index b60af3decbb..4045dda7a78 100644 --- a/assuredworkloads/apiv1beta1/doc.go +++ b/assuredworkloads/apiv1beta1/doc.go @@ -48,7 +48,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210630" +const versionClient = "20210701" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/assuredworkloads/apiv1beta1/gapic_metadata.json b/assuredworkloads/apiv1beta1/gapic_metadata.json index a7cf211d9ce..fca15a740bd 100644 --- a/assuredworkloads/apiv1beta1/gapic_metadata.json +++ b/assuredworkloads/apiv1beta1/gapic_metadata.json @@ -1,37 +1,37 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.assuredworkloads.v1beta1", - "libraryPackage": "cloud.google.com/go/assuredworkloads/apiv1beta1", - "services": { - "AssuredWorkloadsService": { - "clients": { - "grpc": { - "libraryClient": "Client", - "rpcs": { - "CreateWorkload": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.assuredworkloads.v1beta1", + "libraryPackage": "cloud.google.com/go/assuredworkloads/apiv1beta1", + "services": { + "AssuredWorkloadsService": { + "clients": { + "grpc": { + "libraryClient": "Client", + "rpcs": { + "CreateWorkload": { + "methods": [ "CreateWorkload" ] }, - "DeleteWorkload": { - "methods": [ + "DeleteWorkload": { + "methods": [ "DeleteWorkload" ] }, - "GetWorkload": { - "methods": [ + "GetWorkload": { + "methods": [ "GetWorkload" ] }, - "ListWorkloads": { - "methods": [ + "ListWorkloads": { + "methods": [ "ListWorkloads" ] }, - "UpdateWorkload": { - "methods": [ + "UpdateWorkload": { + "methods": [ "UpdateWorkload" ] } diff --git a/automl/apiv1/doc.go b/automl/apiv1/doc.go index 108dd72b6cf..6fac611d1b1 100644 --- a/automl/apiv1/doc.go +++ b/automl/apiv1/doc.go @@ -49,7 +49,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210630" +const versionClient = "20210701" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/automl/apiv1/gapic_metadata.json b/automl/apiv1/gapic_metadata.json index 4f529c50ce0..e31b1eb209b 100644 --- a/automl/apiv1/gapic_metadata.json +++ b/automl/apiv1/gapic_metadata.json @@ -1,102 +1,102 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.automl.v1", - "libraryPackage": "cloud.google.com/go/automl/apiv1", - "services": { - "AutoMl": { - "clients": { - "grpc": { - "libraryClient": "Client", - "rpcs": { - "CreateDataset": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.automl.v1", + "libraryPackage": "cloud.google.com/go/automl/apiv1", + "services": { + "AutoMl": { + "clients": { + "grpc": { + "libraryClient": "Client", + "rpcs": { + "CreateDataset": { + "methods": [ "CreateDataset" ] }, - "CreateModel": { - "methods": [ + "CreateModel": { + "methods": [ "CreateModel" ] }, - "DeleteDataset": { - "methods": [ + "DeleteDataset": { + "methods": [ "DeleteDataset" ] }, - "DeleteModel": { - "methods": [ + "DeleteModel": { + "methods": [ "DeleteModel" ] }, - "DeployModel": { - "methods": [ + "DeployModel": { + "methods": [ "DeployModel" ] }, - "ExportData": { - "methods": [ + "ExportData": { + "methods": [ "ExportData" ] }, - "ExportModel": { - "methods": [ + "ExportModel": { + "methods": [ "ExportModel" ] }, - "GetAnnotationSpec": { - "methods": [ + "GetAnnotationSpec": { + "methods": [ "GetAnnotationSpec" ] }, - "GetDataset": { - "methods": [ + "GetDataset": { + "methods": [ "GetDataset" ] }, - "GetModel": { - "methods": [ + "GetModel": { + "methods": [ "GetModel" ] }, - "GetModelEvaluation": { - "methods": [ + "GetModelEvaluation": { + "methods": [ "GetModelEvaluation" ] }, - "ImportData": { - "methods": [ + "ImportData": { + "methods": [ "ImportData" ] }, - "ListDatasets": { - "methods": [ + "ListDatasets": { + "methods": [ "ListDatasets" ] }, - "ListModelEvaluations": { - "methods": [ + "ListModelEvaluations": { + "methods": [ "ListModelEvaluations" ] }, - "ListModels": { - "methods": [ + "ListModels": { + "methods": [ "ListModels" ] }, - "UndeployModel": { - "methods": [ + "UndeployModel": { + "methods": [ "UndeployModel" ] }, - "UpdateDataset": { - "methods": [ + "UpdateDataset": { + "methods": [ "UpdateDataset" ] }, - "UpdateModel": { - "methods": [ + "UpdateModel": { + "methods": [ "UpdateModel" ] } @@ -104,18 +104,18 @@ } } }, - "PredictionService": { - "clients": { - "grpc": { - "libraryClient": "PredictionClient", - "rpcs": { - "BatchPredict": { - "methods": [ + "PredictionService": { + "clients": { + "grpc": { + "libraryClient": "PredictionClient", + "rpcs": { + "BatchPredict": { + "methods": [ "BatchPredict" ] }, - "Predict": { - "methods": [ + "Predict": { + "methods": [ "Predict" ] } diff --git a/automl/apiv1beta1/doc.go b/automl/apiv1beta1/doc.go index eecc7286463..047fd5676a8 100644 --- a/automl/apiv1beta1/doc.go +++ b/automl/apiv1beta1/doc.go @@ -51,7 +51,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210630" +const versionClient = "20210701" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/automl/apiv1beta1/gapic_metadata.json b/automl/apiv1beta1/gapic_metadata.json index c53df53d62f..d7f1ce28366 100644 --- a/automl/apiv1beta1/gapic_metadata.json +++ b/automl/apiv1beta1/gapic_metadata.json @@ -1,132 +1,132 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.automl.v1beta1", - "libraryPackage": "cloud.google.com/go/automl/apiv1beta1", - "services": { - "AutoMl": { - "clients": { - "grpc": { - "libraryClient": "Client", - "rpcs": { - "CreateDataset": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.automl.v1beta1", + "libraryPackage": "cloud.google.com/go/automl/apiv1beta1", + "services": { + "AutoMl": { + "clients": { + "grpc": { + "libraryClient": "Client", + "rpcs": { + "CreateDataset": { + "methods": [ "CreateDataset" ] }, - "CreateModel": { - "methods": [ + "CreateModel": { + "methods": [ "CreateModel" ] }, - "DeleteDataset": { - "methods": [ + "DeleteDataset": { + "methods": [ "DeleteDataset" ] }, - "DeleteModel": { - "methods": [ + "DeleteModel": { + "methods": [ "DeleteModel" ] }, - "DeployModel": { - "methods": [ + "DeployModel": { + "methods": [ "DeployModel" ] }, - "ExportData": { - "methods": [ + "ExportData": { + "methods": [ "ExportData" ] }, - "ExportEvaluatedExamples": { - "methods": [ + "ExportEvaluatedExamples": { + "methods": [ "ExportEvaluatedExamples" ] }, - "ExportModel": { - "methods": [ + "ExportModel": { + "methods": [ "ExportModel" ] }, - "GetAnnotationSpec": { - "methods": [ + "GetAnnotationSpec": { + "methods": [ "GetAnnotationSpec" ] }, - "GetColumnSpec": { - "methods": [ + "GetColumnSpec": { + "methods": [ "GetColumnSpec" ] }, - "GetDataset": { - "methods": [ + "GetDataset": { + "methods": [ "GetDataset" ] }, - "GetModel": { - "methods": [ + "GetModel": { + "methods": [ "GetModel" ] }, - "GetModelEvaluation": { - "methods": [ + "GetModelEvaluation": { + "methods": [ "GetModelEvaluation" ] }, - "GetTableSpec": { - "methods": [ + "GetTableSpec": { + "methods": [ "GetTableSpec" ] }, - "ImportData": { - "methods": [ + "ImportData": { + "methods": [ "ImportData" ] }, - "ListColumnSpecs": { - "methods": [ + "ListColumnSpecs": { + "methods": [ "ListColumnSpecs" ] }, - "ListDatasets": { - "methods": [ + "ListDatasets": { + "methods": [ "ListDatasets" ] }, - "ListModelEvaluations": { - "methods": [ + "ListModelEvaluations": { + "methods": [ "ListModelEvaluations" ] }, - "ListModels": { - "methods": [ + "ListModels": { + "methods": [ "ListModels" ] }, - "ListTableSpecs": { - "methods": [ + "ListTableSpecs": { + "methods": [ "ListTableSpecs" ] }, - "UndeployModel": { - "methods": [ + "UndeployModel": { + "methods": [ "UndeployModel" ] }, - "UpdateColumnSpec": { - "methods": [ + "UpdateColumnSpec": { + "methods": [ "UpdateColumnSpec" ] }, - "UpdateDataset": { - "methods": [ + "UpdateDataset": { + "methods": [ "UpdateDataset" ] }, - "UpdateTableSpec": { - "methods": [ + "UpdateTableSpec": { + "methods": [ "UpdateTableSpec" ] } @@ -134,18 +134,18 @@ } } }, - "PredictionService": { - "clients": { - "grpc": { - "libraryClient": "PredictionClient", - "rpcs": { - "BatchPredict": { - "methods": [ + "PredictionService": { + "clients": { + "grpc": { + "libraryClient": "PredictionClient", + "rpcs": { + "BatchPredict": { + "methods": [ "BatchPredict" ] }, - "Predict": { - "methods": [ + "Predict": { + "methods": [ "Predict" ] } diff --git a/bigquery/connection/apiv1/doc.go b/bigquery/connection/apiv1/doc.go index bf98d3aa7ea..1822652c996 100644 --- a/bigquery/connection/apiv1/doc.go +++ b/bigquery/connection/apiv1/doc.go @@ -48,7 +48,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210630" +const versionClient = "20210701" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/bigquery/connection/apiv1/gapic_metadata.json b/bigquery/connection/apiv1/gapic_metadata.json index 378c994be01..c073c217bfb 100644 --- a/bigquery/connection/apiv1/gapic_metadata.json +++ b/bigquery/connection/apiv1/gapic_metadata.json @@ -1,52 +1,52 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.bigquery.connection.v1", - "libraryPackage": "cloud.google.com/go/bigquery/connection/apiv1", - "services": { - "ConnectionService": { - "clients": { - "grpc": { - "libraryClient": "Client", - "rpcs": { - "CreateConnection": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.bigquery.connection.v1", + "libraryPackage": "cloud.google.com/go/bigquery/connection/apiv1", + "services": { + "ConnectionService": { + "clients": { + "grpc": { + "libraryClient": "Client", + "rpcs": { + "CreateConnection": { + "methods": [ "CreateConnection" ] }, - "DeleteConnection": { - "methods": [ + "DeleteConnection": { + "methods": [ "DeleteConnection" ] }, - "GetConnection": { - "methods": [ + "GetConnection": { + "methods": [ "GetConnection" ] }, - "GetIamPolicy": { - "methods": [ + "GetIamPolicy": { + "methods": [ "GetIamPolicy" ] }, - "ListConnections": { - "methods": [ + "ListConnections": { + "methods": [ "ListConnections" ] }, - "SetIamPolicy": { - "methods": [ + "SetIamPolicy": { + "methods": [ "SetIamPolicy" ] }, - "TestIamPermissions": { - "methods": [ + "TestIamPermissions": { + "methods": [ "TestIamPermissions" ] }, - "UpdateConnection": { - "methods": [ + "UpdateConnection": { + "methods": [ "UpdateConnection" ] } diff --git a/bigquery/connection/apiv1beta1/doc.go b/bigquery/connection/apiv1beta1/doc.go index b4388c5c343..85a960e5796 100644 --- a/bigquery/connection/apiv1beta1/doc.go +++ b/bigquery/connection/apiv1beta1/doc.go @@ -50,7 +50,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210630" +const versionClient = "20210701" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/bigquery/connection/apiv1beta1/gapic_metadata.json b/bigquery/connection/apiv1beta1/gapic_metadata.json index d3e727f89c5..380ae9f12c3 100644 --- a/bigquery/connection/apiv1beta1/gapic_metadata.json +++ b/bigquery/connection/apiv1beta1/gapic_metadata.json @@ -1,57 +1,57 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.bigquery.connection.v1beta1", - "libraryPackage": "cloud.google.com/go/bigquery/connection/apiv1beta1", - "services": { - "ConnectionService": { - "clients": { - "grpc": { - "libraryClient": "Client", - "rpcs": { - "CreateConnection": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.bigquery.connection.v1beta1", + "libraryPackage": "cloud.google.com/go/bigquery/connection/apiv1beta1", + "services": { + "ConnectionService": { + "clients": { + "grpc": { + "libraryClient": "Client", + "rpcs": { + "CreateConnection": { + "methods": [ "CreateConnection" ] }, - "DeleteConnection": { - "methods": [ + "DeleteConnection": { + "methods": [ "DeleteConnection" ] }, - "GetConnection": { - "methods": [ + "GetConnection": { + "methods": [ "GetConnection" ] }, - "GetIamPolicy": { - "methods": [ + "GetIamPolicy": { + "methods": [ "GetIamPolicy" ] }, - "ListConnections": { - "methods": [ + "ListConnections": { + "methods": [ "ListConnections" ] }, - "SetIamPolicy": { - "methods": [ + "SetIamPolicy": { + "methods": [ "SetIamPolicy" ] }, - "TestIamPermissions": { - "methods": [ + "TestIamPermissions": { + "methods": [ "TestIamPermissions" ] }, - "UpdateConnection": { - "methods": [ + "UpdateConnection": { + "methods": [ "UpdateConnection" ] }, - "UpdateConnectionCredential": { - "methods": [ + "UpdateConnectionCredential": { + "methods": [ "UpdateConnectionCredential" ] } diff --git a/bigquery/datatransfer/apiv1/doc.go b/bigquery/datatransfer/apiv1/doc.go index 750648a95cc..b55bc21e9aa 100644 --- a/bigquery/datatransfer/apiv1/doc.go +++ b/bigquery/datatransfer/apiv1/doc.go @@ -49,7 +49,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210630" +const versionClient = "20210701" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/bigquery/datatransfer/apiv1/gapic_metadata.json b/bigquery/datatransfer/apiv1/gapic_metadata.json index caa81c5a3c4..fd8f604f9b8 100644 --- a/bigquery/datatransfer/apiv1/gapic_metadata.json +++ b/bigquery/datatransfer/apiv1/gapic_metadata.json @@ -1,82 +1,82 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.bigquery.datatransfer.v1", - "libraryPackage": "cloud.google.com/go/bigquery/datatransfer/apiv1", - "services": { - "DataTransferService": { - "clients": { - "grpc": { - "libraryClient": "Client", - "rpcs": { - "CheckValidCreds": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.bigquery.datatransfer.v1", + "libraryPackage": "cloud.google.com/go/bigquery/datatransfer/apiv1", + "services": { + "DataTransferService": { + "clients": { + "grpc": { + "libraryClient": "Client", + "rpcs": { + "CheckValidCreds": { + "methods": [ "CheckValidCreds" ] }, - "CreateTransferConfig": { - "methods": [ + "CreateTransferConfig": { + "methods": [ "CreateTransferConfig" ] }, - "DeleteTransferConfig": { - "methods": [ + "DeleteTransferConfig": { + "methods": [ "DeleteTransferConfig" ] }, - "DeleteTransferRun": { - "methods": [ + "DeleteTransferRun": { + "methods": [ "DeleteTransferRun" ] }, - "GetDataSource": { - "methods": [ + "GetDataSource": { + "methods": [ "GetDataSource" ] }, - "GetTransferConfig": { - "methods": [ + "GetTransferConfig": { + "methods": [ "GetTransferConfig" ] }, - "GetTransferRun": { - "methods": [ + "GetTransferRun": { + "methods": [ "GetTransferRun" ] }, - "ListDataSources": { - "methods": [ + "ListDataSources": { + "methods": [ "ListDataSources" ] }, - "ListTransferConfigs": { - "methods": [ + "ListTransferConfigs": { + "methods": [ "ListTransferConfigs" ] }, - "ListTransferLogs": { - "methods": [ + "ListTransferLogs": { + "methods": [ "ListTransferLogs" ] }, - "ListTransferRuns": { - "methods": [ + "ListTransferRuns": { + "methods": [ "ListTransferRuns" ] }, - "ScheduleTransferRuns": { - "methods": [ + "ScheduleTransferRuns": { + "methods": [ "ScheduleTransferRuns" ] }, - "StartManualTransferRuns": { - "methods": [ + "StartManualTransferRuns": { + "methods": [ "StartManualTransferRuns" ] }, - "UpdateTransferConfig": { - "methods": [ + "UpdateTransferConfig": { + "methods": [ "UpdateTransferConfig" ] } diff --git a/bigquery/go.mod b/bigquery/go.mod index 42a6f09a84c..5a64aeeb87d 100644 --- a/bigquery/go.mod +++ b/bigquery/go.mod @@ -10,7 +10,7 @@ require ( github.com/googleapis/gax-go/v2 v2.0.5 golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 google.golang.org/api v0.50.0 - google.golang.org/genproto v0.0.0-20210630183607-d20f26d13c79 + google.golang.org/genproto v0.0.0-20210701133433-6b8dcf568a95 google.golang.org/grpc v1.38.0 google.golang.org/protobuf v1.27.1 ) diff --git a/bigquery/go.sum b/bigquery/go.sum index fca947c8025..cb33ac8204c 100644 --- a/bigquery/go.sum +++ b/bigquery/go.sum @@ -454,8 +454,8 @@ google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxH google.golang.org/genproto v0.0.0-20210604141403-392c879c8b08/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= google.golang.org/genproto v0.0.0-20210608205507-b6d2f5bf0d7d/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= google.golang.org/genproto v0.0.0-20210624195500-8bfb893ecb84/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24= -google.golang.org/genproto v0.0.0-20210630183607-d20f26d13c79 h1:s1jFTXJryg4a1mew7xv03VZD8N9XjxFhk1o4Js4WvPQ= -google.golang.org/genproto v0.0.0-20210630183607-d20f26d13c79/go.mod h1:yiaVoXHpRzHGyxV3o4DktVWY4mSUErTKaeEOq6C3t3U= +google.golang.org/genproto v0.0.0-20210701133433-6b8dcf568a95 h1:xyRjacsGcaSoZ2fTcaLCSzh2JEceLLOT4X8k32Q0xAQ= +google.golang.org/genproto v0.0.0-20210701133433-6b8dcf568a95/go.mod h1:yiaVoXHpRzHGyxV3o4DktVWY4mSUErTKaeEOq6C3t3U= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= diff --git a/bigquery/reservation/apiv1/doc.go b/bigquery/reservation/apiv1/doc.go index 82c6a2d0b3c..fe2140eba81 100644 --- a/bigquery/reservation/apiv1/doc.go +++ b/bigquery/reservation/apiv1/doc.go @@ -48,7 +48,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210630" +const versionClient = "20210701" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/bigquery/reservation/apiv1/gapic_metadata.json b/bigquery/reservation/apiv1/gapic_metadata.json index 4fc5a04ad6b..091d66bb845 100644 --- a/bigquery/reservation/apiv1/gapic_metadata.json +++ b/bigquery/reservation/apiv1/gapic_metadata.json @@ -1,107 +1,107 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.bigquery.reservation.v1", - "libraryPackage": "cloud.google.com/go/bigquery/reservation/apiv1", - "services": { - "ReservationService": { - "clients": { - "grpc": { - "libraryClient": "Client", - "rpcs": { - "CreateAssignment": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.bigquery.reservation.v1", + "libraryPackage": "cloud.google.com/go/bigquery/reservation/apiv1", + "services": { + "ReservationService": { + "clients": { + "grpc": { + "libraryClient": "Client", + "rpcs": { + "CreateAssignment": { + "methods": [ "CreateAssignment" ] }, - "CreateCapacityCommitment": { - "methods": [ + "CreateCapacityCommitment": { + "methods": [ "CreateCapacityCommitment" ] }, - "CreateReservation": { - "methods": [ + "CreateReservation": { + "methods": [ "CreateReservation" ] }, - "DeleteAssignment": { - "methods": [ + "DeleteAssignment": { + "methods": [ "DeleteAssignment" ] }, - "DeleteCapacityCommitment": { - "methods": [ + "DeleteCapacityCommitment": { + "methods": [ "DeleteCapacityCommitment" ] }, - "DeleteReservation": { - "methods": [ + "DeleteReservation": { + "methods": [ "DeleteReservation" ] }, - "GetBiReservation": { - "methods": [ + "GetBiReservation": { + "methods": [ "GetBiReservation" ] }, - "GetCapacityCommitment": { - "methods": [ + "GetCapacityCommitment": { + "methods": [ "GetCapacityCommitment" ] }, - "GetReservation": { - "methods": [ + "GetReservation": { + "methods": [ "GetReservation" ] }, - "ListAssignments": { - "methods": [ + "ListAssignments": { + "methods": [ "ListAssignments" ] }, - "ListCapacityCommitments": { - "methods": [ + "ListCapacityCommitments": { + "methods": [ "ListCapacityCommitments" ] }, - "ListReservations": { - "methods": [ + "ListReservations": { + "methods": [ "ListReservations" ] }, - "MergeCapacityCommitments": { - "methods": [ + "MergeCapacityCommitments": { + "methods": [ "MergeCapacityCommitments" ] }, - "MoveAssignment": { - "methods": [ + "MoveAssignment": { + "methods": [ "MoveAssignment" ] }, - "SearchAssignments": { - "methods": [ + "SearchAssignments": { + "methods": [ "SearchAssignments" ] }, - "SplitCapacityCommitment": { - "methods": [ + "SplitCapacityCommitment": { + "methods": [ "SplitCapacityCommitment" ] }, - "UpdateBiReservation": { - "methods": [ + "UpdateBiReservation": { + "methods": [ "UpdateBiReservation" ] }, - "UpdateCapacityCommitment": { - "methods": [ + "UpdateCapacityCommitment": { + "methods": [ "UpdateCapacityCommitment" ] }, - "UpdateReservation": { - "methods": [ + "UpdateReservation": { + "methods": [ "UpdateReservation" ] } diff --git a/bigquery/reservation/apiv1beta1/doc.go b/bigquery/reservation/apiv1beta1/doc.go index 96ce44a977e..fe50baf00b9 100644 --- a/bigquery/reservation/apiv1beta1/doc.go +++ b/bigquery/reservation/apiv1beta1/doc.go @@ -50,7 +50,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210630" +const versionClient = "20210701" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/bigquery/reservation/apiv1beta1/gapic_metadata.json b/bigquery/reservation/apiv1beta1/gapic_metadata.json index c3240ac48df..25fd839f9e2 100644 --- a/bigquery/reservation/apiv1beta1/gapic_metadata.json +++ b/bigquery/reservation/apiv1beta1/gapic_metadata.json @@ -1,107 +1,107 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.bigquery.reservation.v1beta1", - "libraryPackage": "cloud.google.com/go/bigquery/reservation/apiv1beta1", - "services": { - "ReservationService": { - "clients": { - "grpc": { - "libraryClient": "Client", - "rpcs": { - "CreateAssignment": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.bigquery.reservation.v1beta1", + "libraryPackage": "cloud.google.com/go/bigquery/reservation/apiv1beta1", + "services": { + "ReservationService": { + "clients": { + "grpc": { + "libraryClient": "Client", + "rpcs": { + "CreateAssignment": { + "methods": [ "CreateAssignment" ] }, - "CreateCapacityCommitment": { - "methods": [ + "CreateCapacityCommitment": { + "methods": [ "CreateCapacityCommitment" ] }, - "CreateReservation": { - "methods": [ + "CreateReservation": { + "methods": [ "CreateReservation" ] }, - "DeleteAssignment": { - "methods": [ + "DeleteAssignment": { + "methods": [ "DeleteAssignment" ] }, - "DeleteCapacityCommitment": { - "methods": [ + "DeleteCapacityCommitment": { + "methods": [ "DeleteCapacityCommitment" ] }, - "DeleteReservation": { - "methods": [ + "DeleteReservation": { + "methods": [ "DeleteReservation" ] }, - "GetBiReservation": { - "methods": [ + "GetBiReservation": { + "methods": [ "GetBiReservation" ] }, - "GetCapacityCommitment": { - "methods": [ + "GetCapacityCommitment": { + "methods": [ "GetCapacityCommitment" ] }, - "GetReservation": { - "methods": [ + "GetReservation": { + "methods": [ "GetReservation" ] }, - "ListAssignments": { - "methods": [ + "ListAssignments": { + "methods": [ "ListAssignments" ] }, - "ListCapacityCommitments": { - "methods": [ + "ListCapacityCommitments": { + "methods": [ "ListCapacityCommitments" ] }, - "ListReservations": { - "methods": [ + "ListReservations": { + "methods": [ "ListReservations" ] }, - "MergeCapacityCommitments": { - "methods": [ + "MergeCapacityCommitments": { + "methods": [ "MergeCapacityCommitments" ] }, - "MoveAssignment": { - "methods": [ + "MoveAssignment": { + "methods": [ "MoveAssignment" ] }, - "SearchAssignments": { - "methods": [ + "SearchAssignments": { + "methods": [ "SearchAssignments" ] }, - "SplitCapacityCommitment": { - "methods": [ + "SplitCapacityCommitment": { + "methods": [ "SplitCapacityCommitment" ] }, - "UpdateBiReservation": { - "methods": [ + "UpdateBiReservation": { + "methods": [ "UpdateBiReservation" ] }, - "UpdateCapacityCommitment": { - "methods": [ + "UpdateCapacityCommitment": { + "methods": [ "UpdateCapacityCommitment" ] }, - "UpdateReservation": { - "methods": [ + "UpdateReservation": { + "methods": [ "UpdateReservation" ] } diff --git a/bigquery/storage/apiv1/doc.go b/bigquery/storage/apiv1/doc.go index 02df1ac6f65..928b143116b 100644 --- a/bigquery/storage/apiv1/doc.go +++ b/bigquery/storage/apiv1/doc.go @@ -46,7 +46,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210630" +const versionClient = "20210701" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/bigquery/storage/apiv1/gapic_metadata.json b/bigquery/storage/apiv1/gapic_metadata.json index 42c1fad16df..2c9099af368 100644 --- a/bigquery/storage/apiv1/gapic_metadata.json +++ b/bigquery/storage/apiv1/gapic_metadata.json @@ -1,27 +1,27 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.bigquery.storage.v1", - "libraryPackage": "cloud.google.com/go/bigquery/storage/apiv1", - "services": { - "BigQueryRead": { - "clients": { - "grpc": { - "libraryClient": "BigQueryReadClient", - "rpcs": { - "CreateReadSession": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.bigquery.storage.v1", + "libraryPackage": "cloud.google.com/go/bigquery/storage/apiv1", + "services": { + "BigQueryRead": { + "clients": { + "grpc": { + "libraryClient": "BigQueryReadClient", + "rpcs": { + "CreateReadSession": { + "methods": [ "CreateReadSession" ] }, - "ReadRows": { - "methods": [ + "ReadRows": { + "methods": [ "ReadRows" ] }, - "SplitReadStream": { - "methods": [ + "SplitReadStream": { + "methods": [ "SplitReadStream" ] } diff --git a/bigquery/storage/apiv1beta1/doc.go b/bigquery/storage/apiv1beta1/doc.go index ab478691d4a..d0873afd2bc 100644 --- a/bigquery/storage/apiv1beta1/doc.go +++ b/bigquery/storage/apiv1beta1/doc.go @@ -48,7 +48,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210630" +const versionClient = "20210701" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/bigquery/storage/apiv1beta1/gapic_metadata.json b/bigquery/storage/apiv1beta1/gapic_metadata.json index 6d78fdb0d84..95235bc516a 100644 --- a/bigquery/storage/apiv1beta1/gapic_metadata.json +++ b/bigquery/storage/apiv1beta1/gapic_metadata.json @@ -1,37 +1,37 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.bigquery.storage.v1beta1", - "libraryPackage": "cloud.google.com/go/bigquery/storage/apiv1beta1", - "services": { - "BigQueryStorage": { - "clients": { - "grpc": { - "libraryClient": "BigQueryStorageClient", - "rpcs": { - "BatchCreateReadSessionStreams": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.bigquery.storage.v1beta1", + "libraryPackage": "cloud.google.com/go/bigquery/storage/apiv1beta1", + "services": { + "BigQueryStorage": { + "clients": { + "grpc": { + "libraryClient": "BigQueryStorageClient", + "rpcs": { + "BatchCreateReadSessionStreams": { + "methods": [ "BatchCreateReadSessionStreams" ] }, - "CreateReadSession": { - "methods": [ + "CreateReadSession": { + "methods": [ "CreateReadSession" ] }, - "FinalizeStream": { - "methods": [ + "FinalizeStream": { + "methods": [ "FinalizeStream" ] }, - "ReadRows": { - "methods": [ + "ReadRows": { + "methods": [ "ReadRows" ] }, - "SplitReadStream": { - "methods": [ + "SplitReadStream": { + "methods": [ "SplitReadStream" ] } diff --git a/bigquery/storage/apiv1beta2/doc.go b/bigquery/storage/apiv1beta2/doc.go index 8f795615d12..aa879f71d40 100644 --- a/bigquery/storage/apiv1beta2/doc.go +++ b/bigquery/storage/apiv1beta2/doc.go @@ -48,7 +48,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210630" +const versionClient = "20210701" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/bigquery/storage/apiv1beta2/gapic_metadata.json b/bigquery/storage/apiv1beta2/gapic_metadata.json index 052802eb4eb..13e265e06a7 100644 --- a/bigquery/storage/apiv1beta2/gapic_metadata.json +++ b/bigquery/storage/apiv1beta2/gapic_metadata.json @@ -1,27 +1,27 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.bigquery.storage.v1beta2", - "libraryPackage": "cloud.google.com/go/bigquery/storage/apiv1beta2", - "services": { - "BigQueryRead": { - "clients": { - "grpc": { - "libraryClient": "BigQueryReadClient", - "rpcs": { - "CreateReadSession": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.bigquery.storage.v1beta2", + "libraryPackage": "cloud.google.com/go/bigquery/storage/apiv1beta2", + "services": { + "BigQueryRead": { + "clients": { + "grpc": { + "libraryClient": "BigQueryReadClient", + "rpcs": { + "CreateReadSession": { + "methods": [ "CreateReadSession" ] }, - "ReadRows": { - "methods": [ + "ReadRows": { + "methods": [ "ReadRows" ] }, - "SplitReadStream": { - "methods": [ + "SplitReadStream": { + "methods": [ "SplitReadStream" ] } @@ -29,38 +29,38 @@ } } }, - "BigQueryWrite": { - "clients": { - "grpc": { - "libraryClient": "BigQueryWriteClient", - "rpcs": { - "AppendRows": { - "methods": [ + "BigQueryWrite": { + "clients": { + "grpc": { + "libraryClient": "BigQueryWriteClient", + "rpcs": { + "AppendRows": { + "methods": [ "AppendRows" ] }, - "BatchCommitWriteStreams": { - "methods": [ + "BatchCommitWriteStreams": { + "methods": [ "BatchCommitWriteStreams" ] }, - "CreateWriteStream": { - "methods": [ + "CreateWriteStream": { + "methods": [ "CreateWriteStream" ] }, - "FinalizeWriteStream": { - "methods": [ + "FinalizeWriteStream": { + "methods": [ "FinalizeWriteStream" ] }, - "FlushRows": { - "methods": [ + "FlushRows": { + "methods": [ "FlushRows" ] }, - "GetWriteStream": { - "methods": [ + "GetWriteStream": { + "methods": [ "GetWriteStream" ] } diff --git a/billing/apiv1/doc.go b/billing/apiv1/doc.go index fccd6324bae..deece9709c2 100644 --- a/billing/apiv1/doc.go +++ b/billing/apiv1/doc.go @@ -49,7 +49,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210630" +const versionClient = "20210701" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/billing/apiv1/gapic_metadata.json b/billing/apiv1/gapic_metadata.json index b74bdd800f7..b5571d8762f 100644 --- a/billing/apiv1/gapic_metadata.json +++ b/billing/apiv1/gapic_metadata.json @@ -1,62 +1,62 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.billing.v1", - "libraryPackage": "cloud.google.com/go/billing/apiv1", - "services": { - "CloudBilling": { - "clients": { - "grpc": { - "libraryClient": "CloudBillingClient", - "rpcs": { - "CreateBillingAccount": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.billing.v1", + "libraryPackage": "cloud.google.com/go/billing/apiv1", + "services": { + "CloudBilling": { + "clients": { + "grpc": { + "libraryClient": "CloudBillingClient", + "rpcs": { + "CreateBillingAccount": { + "methods": [ "CreateBillingAccount" ] }, - "GetBillingAccount": { - "methods": [ + "GetBillingAccount": { + "methods": [ "GetBillingAccount" ] }, - "GetIamPolicy": { - "methods": [ + "GetIamPolicy": { + "methods": [ "GetIamPolicy" ] }, - "GetProjectBillingInfo": { - "methods": [ + "GetProjectBillingInfo": { + "methods": [ "GetProjectBillingInfo" ] }, - "ListBillingAccounts": { - "methods": [ + "ListBillingAccounts": { + "methods": [ "ListBillingAccounts" ] }, - "ListProjectBillingInfo": { - "methods": [ + "ListProjectBillingInfo": { + "methods": [ "ListProjectBillingInfo" ] }, - "SetIamPolicy": { - "methods": [ + "SetIamPolicy": { + "methods": [ "SetIamPolicy" ] }, - "TestIamPermissions": { - "methods": [ + "TestIamPermissions": { + "methods": [ "TestIamPermissions" ] }, - "UpdateBillingAccount": { - "methods": [ + "UpdateBillingAccount": { + "methods": [ "UpdateBillingAccount" ] }, - "UpdateProjectBillingInfo": { - "methods": [ + "UpdateProjectBillingInfo": { + "methods": [ "UpdateProjectBillingInfo" ] } @@ -64,18 +64,18 @@ } } }, - "CloudCatalog": { - "clients": { - "grpc": { - "libraryClient": "CloudCatalogClient", - "rpcs": { - "ListServices": { - "methods": [ + "CloudCatalog": { + "clients": { + "grpc": { + "libraryClient": "CloudCatalogClient", + "rpcs": { + "ListServices": { + "methods": [ "ListServices" ] }, - "ListSkus": { - "methods": [ + "ListSkus": { + "methods": [ "ListSkus" ] } diff --git a/billing/budgets/apiv1/doc.go b/billing/budgets/apiv1/doc.go index bc4554fe66c..c451523c8d6 100644 --- a/billing/budgets/apiv1/doc.go +++ b/billing/budgets/apiv1/doc.go @@ -50,7 +50,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210630" +const versionClient = "20210701" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/billing/budgets/apiv1/gapic_metadata.json b/billing/budgets/apiv1/gapic_metadata.json index 05ad6bfd1d1..71de553dd86 100644 --- a/billing/budgets/apiv1/gapic_metadata.json +++ b/billing/budgets/apiv1/gapic_metadata.json @@ -1,37 +1,37 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.billing.budgets.v1", - "libraryPackage": "cloud.google.com/go/billing/budgets/apiv1", - "services": { - "BudgetService": { - "clients": { - "grpc": { - "libraryClient": "BudgetClient", - "rpcs": { - "CreateBudget": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.billing.budgets.v1", + "libraryPackage": "cloud.google.com/go/billing/budgets/apiv1", + "services": { + "BudgetService": { + "clients": { + "grpc": { + "libraryClient": "BudgetClient", + "rpcs": { + "CreateBudget": { + "methods": [ "CreateBudget" ] }, - "DeleteBudget": { - "methods": [ + "DeleteBudget": { + "methods": [ "DeleteBudget" ] }, - "GetBudget": { - "methods": [ + "GetBudget": { + "methods": [ "GetBudget" ] }, - "ListBudgets": { - "methods": [ + "ListBudgets": { + "methods": [ "ListBudgets" ] }, - "UpdateBudget": { - "methods": [ + "UpdateBudget": { + "methods": [ "UpdateBudget" ] } diff --git a/billing/budgets/apiv1beta1/doc.go b/billing/budgets/apiv1beta1/doc.go index fbe74d4920c..db1fb0a076d 100644 --- a/billing/budgets/apiv1beta1/doc.go +++ b/billing/budgets/apiv1beta1/doc.go @@ -52,7 +52,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210630" +const versionClient = "20210701" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/billing/budgets/apiv1beta1/gapic_metadata.json b/billing/budgets/apiv1beta1/gapic_metadata.json index 986d7e62544..912efba0ed8 100644 --- a/billing/budgets/apiv1beta1/gapic_metadata.json +++ b/billing/budgets/apiv1beta1/gapic_metadata.json @@ -1,37 +1,37 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.billing.budgets.v1beta1", - "libraryPackage": "cloud.google.com/go/billing/budgets/apiv1beta1", - "services": { - "BudgetService": { - "clients": { - "grpc": { - "libraryClient": "BudgetClient", - "rpcs": { - "CreateBudget": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.billing.budgets.v1beta1", + "libraryPackage": "cloud.google.com/go/billing/budgets/apiv1beta1", + "services": { + "BudgetService": { + "clients": { + "grpc": { + "libraryClient": "BudgetClient", + "rpcs": { + "CreateBudget": { + "methods": [ "CreateBudget" ] }, - "DeleteBudget": { - "methods": [ + "DeleteBudget": { + "methods": [ "DeleteBudget" ] }, - "GetBudget": { - "methods": [ + "GetBudget": { + "methods": [ "GetBudget" ] }, - "ListBudgets": { - "methods": [ + "ListBudgets": { + "methods": [ "ListBudgets" ] }, - "UpdateBudget": { - "methods": [ + "UpdateBudget": { + "methods": [ "UpdateBudget" ] } diff --git a/binaryauthorization/apiv1beta1/doc.go b/binaryauthorization/apiv1beta1/doc.go index 7dc21d77ace..bae4dabd1d0 100644 --- a/binaryauthorization/apiv1beta1/doc.go +++ b/binaryauthorization/apiv1beta1/doc.go @@ -51,7 +51,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210630" +const versionClient = "20210701" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/binaryauthorization/apiv1beta1/gapic_metadata.json b/binaryauthorization/apiv1beta1/gapic_metadata.json index 0e6b17f4296..fb591a2cbb1 100644 --- a/binaryauthorization/apiv1beta1/gapic_metadata.json +++ b/binaryauthorization/apiv1beta1/gapic_metadata.json @@ -1,47 +1,47 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.binaryauthorization.v1beta1", - "libraryPackage": "cloud.google.com/go/binaryauthorization/apiv1beta1", - "services": { - "BinauthzManagementServiceV1Beta1": { - "clients": { - "grpc": { - "libraryClient": "BinauthzManagementServiceV1Beta1Client", - "rpcs": { - "CreateAttestor": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.binaryauthorization.v1beta1", + "libraryPackage": "cloud.google.com/go/binaryauthorization/apiv1beta1", + "services": { + "BinauthzManagementServiceV1Beta1": { + "clients": { + "grpc": { + "libraryClient": "BinauthzManagementServiceV1Beta1Client", + "rpcs": { + "CreateAttestor": { + "methods": [ "CreateAttestor" ] }, - "DeleteAttestor": { - "methods": [ + "DeleteAttestor": { + "methods": [ "DeleteAttestor" ] }, - "GetAttestor": { - "methods": [ + "GetAttestor": { + "methods": [ "GetAttestor" ] }, - "GetPolicy": { - "methods": [ + "GetPolicy": { + "methods": [ "GetPolicy" ] }, - "ListAttestors": { - "methods": [ + "ListAttestors": { + "methods": [ "ListAttestors" ] }, - "UpdateAttestor": { - "methods": [ + "UpdateAttestor": { + "methods": [ "UpdateAttestor" ] }, - "UpdatePolicy": { - "methods": [ + "UpdatePolicy": { + "methods": [ "UpdatePolicy" ] } diff --git a/channel/apiv1/doc.go b/channel/apiv1/doc.go index 2ea403dc0fa..61e96c5bf75 100644 --- a/channel/apiv1/doc.go +++ b/channel/apiv1/doc.go @@ -46,7 +46,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210630" +const versionClient = "20210701" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/channel/apiv1/gapic_metadata.json b/channel/apiv1/gapic_metadata.json index 879d86e7189..70fd450e2eb 100644 --- a/channel/apiv1/gapic_metadata.json +++ b/channel/apiv1/gapic_metadata.json @@ -1,182 +1,182 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.channel.v1", - "libraryPackage": "cloud.google.com/go/channel/apiv1", - "services": { - "CloudChannelService": { - "clients": { - "grpc": { - "libraryClient": "CloudChannelClient", - "rpcs": { - "ActivateEntitlement": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.channel.v1", + "libraryPackage": "cloud.google.com/go/channel/apiv1", + "services": { + "CloudChannelService": { + "clients": { + "grpc": { + "libraryClient": "CloudChannelClient", + "rpcs": { + "ActivateEntitlement": { + "methods": [ "ActivateEntitlement" ] }, - "CancelEntitlement": { - "methods": [ + "CancelEntitlement": { + "methods": [ "CancelEntitlement" ] }, - "ChangeOffer": { - "methods": [ + "ChangeOffer": { + "methods": [ "ChangeOffer" ] }, - "ChangeParameters": { - "methods": [ + "ChangeParameters": { + "methods": [ "ChangeParameters" ] }, - "ChangeRenewalSettings": { - "methods": [ + "ChangeRenewalSettings": { + "methods": [ "ChangeRenewalSettings" ] }, - "CheckCloudIdentityAccountsExist": { - "methods": [ + "CheckCloudIdentityAccountsExist": { + "methods": [ "CheckCloudIdentityAccountsExist" ] }, - "CreateChannelPartnerLink": { - "methods": [ + "CreateChannelPartnerLink": { + "methods": [ "CreateChannelPartnerLink" ] }, - "CreateCustomer": { - "methods": [ + "CreateCustomer": { + "methods": [ "CreateCustomer" ] }, - "CreateEntitlement": { - "methods": [ + "CreateEntitlement": { + "methods": [ "CreateEntitlement" ] }, - "DeleteCustomer": { - "methods": [ + "DeleteCustomer": { + "methods": [ "DeleteCustomer" ] }, - "GetChannelPartnerLink": { - "methods": [ + "GetChannelPartnerLink": { + "methods": [ "GetChannelPartnerLink" ] }, - "GetCustomer": { - "methods": [ + "GetCustomer": { + "methods": [ "GetCustomer" ] }, - "GetEntitlement": { - "methods": [ + "GetEntitlement": { + "methods": [ "GetEntitlement" ] }, - "ListChannelPartnerLinks": { - "methods": [ + "ListChannelPartnerLinks": { + "methods": [ "ListChannelPartnerLinks" ] }, - "ListCustomers": { - "methods": [ + "ListCustomers": { + "methods": [ "ListCustomers" ] }, - "ListEntitlements": { - "methods": [ + "ListEntitlements": { + "methods": [ "ListEntitlements" ] }, - "ListOffers": { - "methods": [ + "ListOffers": { + "methods": [ "ListOffers" ] }, - "ListProducts": { - "methods": [ + "ListProducts": { + "methods": [ "ListProducts" ] }, - "ListPurchasableOffers": { - "methods": [ + "ListPurchasableOffers": { + "methods": [ "ListPurchasableOffers" ] }, - "ListPurchasableSkus": { - "methods": [ + "ListPurchasableSkus": { + "methods": [ "ListPurchasableSkus" ] }, - "ListSkus": { - "methods": [ + "ListSkus": { + "methods": [ "ListSkus" ] }, - "ListSubscribers": { - "methods": [ + "ListSubscribers": { + "methods": [ "ListSubscribers" ] }, - "ListTransferableOffers": { - "methods": [ + "ListTransferableOffers": { + "methods": [ "ListTransferableOffers" ] }, - "ListTransferableSkus": { - "methods": [ + "ListTransferableSkus": { + "methods": [ "ListTransferableSkus" ] }, - "LookupOffer": { - "methods": [ + "LookupOffer": { + "methods": [ "LookupOffer" ] }, - "ProvisionCloudIdentity": { - "methods": [ + "ProvisionCloudIdentity": { + "methods": [ "ProvisionCloudIdentity" ] }, - "RegisterSubscriber": { - "methods": [ + "RegisterSubscriber": { + "methods": [ "RegisterSubscriber" ] }, - "StartPaidService": { - "methods": [ + "StartPaidService": { + "methods": [ "StartPaidService" ] }, - "SuspendEntitlement": { - "methods": [ + "SuspendEntitlement": { + "methods": [ "SuspendEntitlement" ] }, - "TransferEntitlements": { - "methods": [ + "TransferEntitlements": { + "methods": [ "TransferEntitlements" ] }, - "TransferEntitlementsToGoogle": { - "methods": [ + "TransferEntitlementsToGoogle": { + "methods": [ "TransferEntitlementsToGoogle" ] }, - "UnregisterSubscriber": { - "methods": [ + "UnregisterSubscriber": { + "methods": [ "UnregisterSubscriber" ] }, - "UpdateChannelPartnerLink": { - "methods": [ + "UpdateChannelPartnerLink": { + "methods": [ "UpdateChannelPartnerLink" ] }, - "UpdateCustomer": { - "methods": [ + "UpdateCustomer": { + "methods": [ "UpdateCustomer" ] } diff --git a/cloudbuild/apiv1/v2/doc.go b/cloudbuild/apiv1/v2/doc.go index 80e595707a5..6f01792adde 100644 --- a/cloudbuild/apiv1/v2/doc.go +++ b/cloudbuild/apiv1/v2/doc.go @@ -48,7 +48,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210630" +const versionClient = "20210701" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/cloudbuild/apiv1/v2/gapic_metadata.json b/cloudbuild/apiv1/v2/gapic_metadata.json index 6468ea5b2c6..a5ee7a289ed 100644 --- a/cloudbuild/apiv1/v2/gapic_metadata.json +++ b/cloudbuild/apiv1/v2/gapic_metadata.json @@ -1,97 +1,97 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.devtools.cloudbuild.v1", - "libraryPackage": "cloud.google.com/go/cloudbuild/apiv1/v2", - "services": { - "CloudBuild": { - "clients": { - "grpc": { - "libraryClient": "Client", - "rpcs": { - "CancelBuild": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.devtools.cloudbuild.v1", + "libraryPackage": "cloud.google.com/go/cloudbuild/apiv1/v2", + "services": { + "CloudBuild": { + "clients": { + "grpc": { + "libraryClient": "Client", + "rpcs": { + "CancelBuild": { + "methods": [ "CancelBuild" ] }, - "CreateBuild": { - "methods": [ + "CreateBuild": { + "methods": [ "CreateBuild" ] }, - "CreateBuildTrigger": { - "methods": [ + "CreateBuildTrigger": { + "methods": [ "CreateBuildTrigger" ] }, - "CreateWorkerPool": { - "methods": [ + "CreateWorkerPool": { + "methods": [ "CreateWorkerPool" ] }, - "DeleteBuildTrigger": { - "methods": [ + "DeleteBuildTrigger": { + "methods": [ "DeleteBuildTrigger" ] }, - "DeleteWorkerPool": { - "methods": [ + "DeleteWorkerPool": { + "methods": [ "DeleteWorkerPool" ] }, - "GetBuild": { - "methods": [ + "GetBuild": { + "methods": [ "GetBuild" ] }, - "GetBuildTrigger": { - "methods": [ + "GetBuildTrigger": { + "methods": [ "GetBuildTrigger" ] }, - "GetWorkerPool": { - "methods": [ + "GetWorkerPool": { + "methods": [ "GetWorkerPool" ] }, - "ListBuildTriggers": { - "methods": [ + "ListBuildTriggers": { + "methods": [ "ListBuildTriggers" ] }, - "ListBuilds": { - "methods": [ + "ListBuilds": { + "methods": [ "ListBuilds" ] }, - "ListWorkerPools": { - "methods": [ + "ListWorkerPools": { + "methods": [ "ListWorkerPools" ] }, - "ReceiveTriggerWebhook": { - "methods": [ + "ReceiveTriggerWebhook": { + "methods": [ "ReceiveTriggerWebhook" ] }, - "RetryBuild": { - "methods": [ + "RetryBuild": { + "methods": [ "RetryBuild" ] }, - "RunBuildTrigger": { - "methods": [ + "RunBuildTrigger": { + "methods": [ "RunBuildTrigger" ] }, - "UpdateBuildTrigger": { - "methods": [ + "UpdateBuildTrigger": { + "methods": [ "UpdateBuildTrigger" ] }, - "UpdateWorkerPool": { - "methods": [ + "UpdateWorkerPool": { + "methods": [ "UpdateWorkerPool" ] } diff --git a/clouddms/apiv1/doc.go b/clouddms/apiv1/doc.go index 49978276c81..ade8234dd7b 100644 --- a/clouddms/apiv1/doc.go +++ b/clouddms/apiv1/doc.go @@ -49,7 +49,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210630" +const versionClient = "20210701" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/clouddms/apiv1/gapic_metadata.json b/clouddms/apiv1/gapic_metadata.json index ad5aefcbeba..b6b1c33804f 100644 --- a/clouddms/apiv1/gapic_metadata.json +++ b/clouddms/apiv1/gapic_metadata.json @@ -1,97 +1,97 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.clouddms.v1", - "libraryPackage": "cloud.google.com/go/clouddms/apiv1", - "services": { - "DataMigrationService": { - "clients": { - "grpc": { - "libraryClient": "DataMigrationClient", - "rpcs": { - "CreateConnectionProfile": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.clouddms.v1", + "libraryPackage": "cloud.google.com/go/clouddms/apiv1", + "services": { + "DataMigrationService": { + "clients": { + "grpc": { + "libraryClient": "DataMigrationClient", + "rpcs": { + "CreateConnectionProfile": { + "methods": [ "CreateConnectionProfile" ] }, - "CreateMigrationJob": { - "methods": [ + "CreateMigrationJob": { + "methods": [ "CreateMigrationJob" ] }, - "DeleteConnectionProfile": { - "methods": [ + "DeleteConnectionProfile": { + "methods": [ "DeleteConnectionProfile" ] }, - "DeleteMigrationJob": { - "methods": [ + "DeleteMigrationJob": { + "methods": [ "DeleteMigrationJob" ] }, - "GenerateSshScript": { - "methods": [ + "GenerateSshScript": { + "methods": [ "GenerateSshScript" ] }, - "GetConnectionProfile": { - "methods": [ + "GetConnectionProfile": { + "methods": [ "GetConnectionProfile" ] }, - "GetMigrationJob": { - "methods": [ + "GetMigrationJob": { + "methods": [ "GetMigrationJob" ] }, - "ListConnectionProfiles": { - "methods": [ + "ListConnectionProfiles": { + "methods": [ "ListConnectionProfiles" ] }, - "ListMigrationJobs": { - "methods": [ + "ListMigrationJobs": { + "methods": [ "ListMigrationJobs" ] }, - "PromoteMigrationJob": { - "methods": [ + "PromoteMigrationJob": { + "methods": [ "PromoteMigrationJob" ] }, - "RestartMigrationJob": { - "methods": [ + "RestartMigrationJob": { + "methods": [ "RestartMigrationJob" ] }, - "ResumeMigrationJob": { - "methods": [ + "ResumeMigrationJob": { + "methods": [ "ResumeMigrationJob" ] }, - "StartMigrationJob": { - "methods": [ + "StartMigrationJob": { + "methods": [ "StartMigrationJob" ] }, - "StopMigrationJob": { - "methods": [ + "StopMigrationJob": { + "methods": [ "StopMigrationJob" ] }, - "UpdateConnectionProfile": { - "methods": [ + "UpdateConnectionProfile": { + "methods": [ "UpdateConnectionProfile" ] }, - "UpdateMigrationJob": { - "methods": [ + "UpdateMigrationJob": { + "methods": [ "UpdateMigrationJob" ] }, - "VerifyMigrationJob": { - "methods": [ + "VerifyMigrationJob": { + "methods": [ "VerifyMigrationJob" ] } diff --git a/cloudtasks/apiv2/doc.go b/cloudtasks/apiv2/doc.go index 79dbb36ceb5..6c085c3411f 100644 --- a/cloudtasks/apiv2/doc.go +++ b/cloudtasks/apiv2/doc.go @@ -48,7 +48,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210630" +const versionClient = "20210701" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/cloudtasks/apiv2/gapic_metadata.json b/cloudtasks/apiv2/gapic_metadata.json index 8a4b72b2777..ade36c0dc6f 100644 --- a/cloudtasks/apiv2/gapic_metadata.json +++ b/cloudtasks/apiv2/gapic_metadata.json @@ -1,92 +1,92 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.tasks.v2", - "libraryPackage": "cloud.google.com/go/cloudtasks/apiv2", - "services": { - "CloudTasks": { - "clients": { - "grpc": { - "libraryClient": "Client", - "rpcs": { - "CreateQueue": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.tasks.v2", + "libraryPackage": "cloud.google.com/go/cloudtasks/apiv2", + "services": { + "CloudTasks": { + "clients": { + "grpc": { + "libraryClient": "Client", + "rpcs": { + "CreateQueue": { + "methods": [ "CreateQueue" ] }, - "CreateTask": { - "methods": [ + "CreateTask": { + "methods": [ "CreateTask" ] }, - "DeleteQueue": { - "methods": [ + "DeleteQueue": { + "methods": [ "DeleteQueue" ] }, - "DeleteTask": { - "methods": [ + "DeleteTask": { + "methods": [ "DeleteTask" ] }, - "GetIamPolicy": { - "methods": [ + "GetIamPolicy": { + "methods": [ "GetIamPolicy" ] }, - "GetQueue": { - "methods": [ + "GetQueue": { + "methods": [ "GetQueue" ] }, - "GetTask": { - "methods": [ + "GetTask": { + "methods": [ "GetTask" ] }, - "ListQueues": { - "methods": [ + "ListQueues": { + "methods": [ "ListQueues" ] }, - "ListTasks": { - "methods": [ + "ListTasks": { + "methods": [ "ListTasks" ] }, - "PauseQueue": { - "methods": [ + "PauseQueue": { + "methods": [ "PauseQueue" ] }, - "PurgeQueue": { - "methods": [ + "PurgeQueue": { + "methods": [ "PurgeQueue" ] }, - "ResumeQueue": { - "methods": [ + "ResumeQueue": { + "methods": [ "ResumeQueue" ] }, - "RunTask": { - "methods": [ + "RunTask": { + "methods": [ "RunTask" ] }, - "SetIamPolicy": { - "methods": [ + "SetIamPolicy": { + "methods": [ "SetIamPolicy" ] }, - "TestIamPermissions": { - "methods": [ + "TestIamPermissions": { + "methods": [ "TestIamPermissions" ] }, - "UpdateQueue": { - "methods": [ + "UpdateQueue": { + "methods": [ "UpdateQueue" ] } diff --git a/cloudtasks/apiv2beta2/doc.go b/cloudtasks/apiv2beta2/doc.go index 1271a8e3ba4..dc193f5d535 100644 --- a/cloudtasks/apiv2beta2/doc.go +++ b/cloudtasks/apiv2beta2/doc.go @@ -50,7 +50,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210630" +const versionClient = "20210701" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/cloudtasks/apiv2beta2/gapic_metadata.json b/cloudtasks/apiv2beta2/gapic_metadata.json index 7ff48b0895b..c88b99835e2 100644 --- a/cloudtasks/apiv2beta2/gapic_metadata.json +++ b/cloudtasks/apiv2beta2/gapic_metadata.json @@ -1,112 +1,112 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.tasks.v2beta2", - "libraryPackage": "cloud.google.com/go/cloudtasks/apiv2beta2", - "services": { - "CloudTasks": { - "clients": { - "grpc": { - "libraryClient": "Client", - "rpcs": { - "AcknowledgeTask": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.tasks.v2beta2", + "libraryPackage": "cloud.google.com/go/cloudtasks/apiv2beta2", + "services": { + "CloudTasks": { + "clients": { + "grpc": { + "libraryClient": "Client", + "rpcs": { + "AcknowledgeTask": { + "methods": [ "AcknowledgeTask" ] }, - "CancelLease": { - "methods": [ + "CancelLease": { + "methods": [ "CancelLease" ] }, - "CreateQueue": { - "methods": [ + "CreateQueue": { + "methods": [ "CreateQueue" ] }, - "CreateTask": { - "methods": [ + "CreateTask": { + "methods": [ "CreateTask" ] }, - "DeleteQueue": { - "methods": [ + "DeleteQueue": { + "methods": [ "DeleteQueue" ] }, - "DeleteTask": { - "methods": [ + "DeleteTask": { + "methods": [ "DeleteTask" ] }, - "GetIamPolicy": { - "methods": [ + "GetIamPolicy": { + "methods": [ "GetIamPolicy" ] }, - "GetQueue": { - "methods": [ + "GetQueue": { + "methods": [ "GetQueue" ] }, - "GetTask": { - "methods": [ + "GetTask": { + "methods": [ "GetTask" ] }, - "LeaseTasks": { - "methods": [ + "LeaseTasks": { + "methods": [ "LeaseTasks" ] }, - "ListQueues": { - "methods": [ + "ListQueues": { + "methods": [ "ListQueues" ] }, - "ListTasks": { - "methods": [ + "ListTasks": { + "methods": [ "ListTasks" ] }, - "PauseQueue": { - "methods": [ + "PauseQueue": { + "methods": [ "PauseQueue" ] }, - "PurgeQueue": { - "methods": [ + "PurgeQueue": { + "methods": [ "PurgeQueue" ] }, - "RenewLease": { - "methods": [ + "RenewLease": { + "methods": [ "RenewLease" ] }, - "ResumeQueue": { - "methods": [ + "ResumeQueue": { + "methods": [ "ResumeQueue" ] }, - "RunTask": { - "methods": [ + "RunTask": { + "methods": [ "RunTask" ] }, - "SetIamPolicy": { - "methods": [ + "SetIamPolicy": { + "methods": [ "SetIamPolicy" ] }, - "TestIamPermissions": { - "methods": [ + "TestIamPermissions": { + "methods": [ "TestIamPermissions" ] }, - "UpdateQueue": { - "methods": [ + "UpdateQueue": { + "methods": [ "UpdateQueue" ] } diff --git a/cloudtasks/apiv2beta3/doc.go b/cloudtasks/apiv2beta3/doc.go index 2b44d88b1ae..9c040fa674b 100644 --- a/cloudtasks/apiv2beta3/doc.go +++ b/cloudtasks/apiv2beta3/doc.go @@ -50,7 +50,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210630" +const versionClient = "20210701" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/cloudtasks/apiv2beta3/gapic_metadata.json b/cloudtasks/apiv2beta3/gapic_metadata.json index 358e340ee54..1a5f03a6d03 100644 --- a/cloudtasks/apiv2beta3/gapic_metadata.json +++ b/cloudtasks/apiv2beta3/gapic_metadata.json @@ -1,92 +1,92 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.tasks.v2beta3", - "libraryPackage": "cloud.google.com/go/cloudtasks/apiv2beta3", - "services": { - "CloudTasks": { - "clients": { - "grpc": { - "libraryClient": "Client", - "rpcs": { - "CreateQueue": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.tasks.v2beta3", + "libraryPackage": "cloud.google.com/go/cloudtasks/apiv2beta3", + "services": { + "CloudTasks": { + "clients": { + "grpc": { + "libraryClient": "Client", + "rpcs": { + "CreateQueue": { + "methods": [ "CreateQueue" ] }, - "CreateTask": { - "methods": [ + "CreateTask": { + "methods": [ "CreateTask" ] }, - "DeleteQueue": { - "methods": [ + "DeleteQueue": { + "methods": [ "DeleteQueue" ] }, - "DeleteTask": { - "methods": [ + "DeleteTask": { + "methods": [ "DeleteTask" ] }, - "GetIamPolicy": { - "methods": [ + "GetIamPolicy": { + "methods": [ "GetIamPolicy" ] }, - "GetQueue": { - "methods": [ + "GetQueue": { + "methods": [ "GetQueue" ] }, - "GetTask": { - "methods": [ + "GetTask": { + "methods": [ "GetTask" ] }, - "ListQueues": { - "methods": [ + "ListQueues": { + "methods": [ "ListQueues" ] }, - "ListTasks": { - "methods": [ + "ListTasks": { + "methods": [ "ListTasks" ] }, - "PauseQueue": { - "methods": [ + "PauseQueue": { + "methods": [ "PauseQueue" ] }, - "PurgeQueue": { - "methods": [ + "PurgeQueue": { + "methods": [ "PurgeQueue" ] }, - "ResumeQueue": { - "methods": [ + "ResumeQueue": { + "methods": [ "ResumeQueue" ] }, - "RunTask": { - "methods": [ + "RunTask": { + "methods": [ "RunTask" ] }, - "SetIamPolicy": { - "methods": [ + "SetIamPolicy": { + "methods": [ "SetIamPolicy" ] }, - "TestIamPermissions": { - "methods": [ + "TestIamPermissions": { + "methods": [ "TestIamPermissions" ] }, - "UpdateQueue": { - "methods": [ + "UpdateQueue": { + "methods": [ "UpdateQueue" ] } diff --git a/container/apiv1/doc.go b/container/apiv1/doc.go index f7566c5e524..787945ededa 100644 --- a/container/apiv1/doc.go +++ b/container/apiv1/doc.go @@ -49,7 +49,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210630" +const versionClient = "20210701" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/container/apiv1/gapic_metadata.json b/container/apiv1/gapic_metadata.json index 832be126473..7cdf466eea3 100644 --- a/container/apiv1/gapic_metadata.json +++ b/container/apiv1/gapic_metadata.json @@ -1,172 +1,172 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.container.v1", - "libraryPackage": "cloud.google.com/go/container/apiv1", - "services": { - "ClusterManager": { - "clients": { - "grpc": { - "libraryClient": "ClusterManagerClient", - "rpcs": { - "CancelOperation": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.container.v1", + "libraryPackage": "cloud.google.com/go/container/apiv1", + "services": { + "ClusterManager": { + "clients": { + "grpc": { + "libraryClient": "ClusterManagerClient", + "rpcs": { + "CancelOperation": { + "methods": [ "CancelOperation" ] }, - "CompleteIPRotation": { - "methods": [ + "CompleteIPRotation": { + "methods": [ "CompleteIPRotation" ] }, - "CreateCluster": { - "methods": [ + "CreateCluster": { + "methods": [ "CreateCluster" ] }, - "CreateNodePool": { - "methods": [ + "CreateNodePool": { + "methods": [ "CreateNodePool" ] }, - "DeleteCluster": { - "methods": [ + "DeleteCluster": { + "methods": [ "DeleteCluster" ] }, - "DeleteNodePool": { - "methods": [ + "DeleteNodePool": { + "methods": [ "DeleteNodePool" ] }, - "GetCluster": { - "methods": [ + "GetCluster": { + "methods": [ "GetCluster" ] }, - "GetJSONWebKeys": { - "methods": [ + "GetJSONWebKeys": { + "methods": [ "GetJSONWebKeys" ] }, - "GetNodePool": { - "methods": [ + "GetNodePool": { + "methods": [ "GetNodePool" ] }, - "GetOperation": { - "methods": [ + "GetOperation": { + "methods": [ "GetOperation" ] }, - "GetServerConfig": { - "methods": [ + "GetServerConfig": { + "methods": [ "GetServerConfig" ] }, - "ListClusters": { - "methods": [ + "ListClusters": { + "methods": [ "ListClusters" ] }, - "ListNodePools": { - "methods": [ + "ListNodePools": { + "methods": [ "ListNodePools" ] }, - "ListOperations": { - "methods": [ + "ListOperations": { + "methods": [ "ListOperations" ] }, - "ListUsableSubnetworks": { - "methods": [ + "ListUsableSubnetworks": { + "methods": [ "ListUsableSubnetworks" ] }, - "RollbackNodePoolUpgrade": { - "methods": [ + "RollbackNodePoolUpgrade": { + "methods": [ "RollbackNodePoolUpgrade" ] }, - "SetAddonsConfig": { - "methods": [ + "SetAddonsConfig": { + "methods": [ "SetAddonsConfig" ] }, - "SetLabels": { - "methods": [ + "SetLabels": { + "methods": [ "SetLabels" ] }, - "SetLegacyAbac": { - "methods": [ + "SetLegacyAbac": { + "methods": [ "SetLegacyAbac" ] }, - "SetLocations": { - "methods": [ + "SetLocations": { + "methods": [ "SetLocations" ] }, - "SetLoggingService": { - "methods": [ + "SetLoggingService": { + "methods": [ "SetLoggingService" ] }, - "SetMaintenancePolicy": { - "methods": [ + "SetMaintenancePolicy": { + "methods": [ "SetMaintenancePolicy" ] }, - "SetMasterAuth": { - "methods": [ + "SetMasterAuth": { + "methods": [ "SetMasterAuth" ] }, - "SetMonitoringService": { - "methods": [ + "SetMonitoringService": { + "methods": [ "SetMonitoringService" ] }, - "SetNetworkPolicy": { - "methods": [ + "SetNetworkPolicy": { + "methods": [ "SetNetworkPolicy" ] }, - "SetNodePoolAutoscaling": { - "methods": [ + "SetNodePoolAutoscaling": { + "methods": [ "SetNodePoolAutoscaling" ] }, - "SetNodePoolManagement": { - "methods": [ + "SetNodePoolManagement": { + "methods": [ "SetNodePoolManagement" ] }, - "SetNodePoolSize": { - "methods": [ + "SetNodePoolSize": { + "methods": [ "SetNodePoolSize" ] }, - "StartIPRotation": { - "methods": [ + "StartIPRotation": { + "methods": [ "StartIPRotation" ] }, - "UpdateCluster": { - "methods": [ + "UpdateCluster": { + "methods": [ "UpdateCluster" ] }, - "UpdateMaster": { - "methods": [ + "UpdateMaster": { + "methods": [ "UpdateMaster" ] }, - "UpdateNodePool": { - "methods": [ + "UpdateNodePool": { + "methods": [ "UpdateNodePool" ] } diff --git a/containeranalysis/apiv1beta1/doc.go b/containeranalysis/apiv1beta1/doc.go index 05c5104f245..0f7c7c8a773 100644 --- a/containeranalysis/apiv1beta1/doc.go +++ b/containeranalysis/apiv1beta1/doc.go @@ -51,7 +51,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210630" +const versionClient = "20210701" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/containeranalysis/apiv1beta1/gapic_metadata.json b/containeranalysis/apiv1beta1/gapic_metadata.json index d00dcf37233..a6ea786a1c5 100644 --- a/containeranalysis/apiv1beta1/gapic_metadata.json +++ b/containeranalysis/apiv1beta1/gapic_metadata.json @@ -1,87 +1,87 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "grafeas.v1beta1", - "libraryPackage": "cloud.google.com/go/containeranalysis/apiv1beta1", - "services": { - "GrafeasV1Beta1": { - "clients": { - "grpc": { - "libraryClient": "GrafeasV1Beta1Client", - "rpcs": { - "BatchCreateNotes": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "grafeas.v1beta1", + "libraryPackage": "cloud.google.com/go/containeranalysis/apiv1beta1", + "services": { + "GrafeasV1Beta1": { + "clients": { + "grpc": { + "libraryClient": "GrafeasV1Beta1Client", + "rpcs": { + "BatchCreateNotes": { + "methods": [ "BatchCreateNotes" ] }, - "BatchCreateOccurrences": { - "methods": [ + "BatchCreateOccurrences": { + "methods": [ "BatchCreateOccurrences" ] }, - "CreateNote": { - "methods": [ + "CreateNote": { + "methods": [ "CreateNote" ] }, - "CreateOccurrence": { - "methods": [ + "CreateOccurrence": { + "methods": [ "CreateOccurrence" ] }, - "DeleteNote": { - "methods": [ + "DeleteNote": { + "methods": [ "DeleteNote" ] }, - "DeleteOccurrence": { - "methods": [ + "DeleteOccurrence": { + "methods": [ "DeleteOccurrence" ] }, - "GetNote": { - "methods": [ + "GetNote": { + "methods": [ "GetNote" ] }, - "GetOccurrence": { - "methods": [ + "GetOccurrence": { + "methods": [ "GetOccurrence" ] }, - "GetOccurrenceNote": { - "methods": [ + "GetOccurrenceNote": { + "methods": [ "GetOccurrenceNote" ] }, - "GetVulnerabilityOccurrencesSummary": { - "methods": [ + "GetVulnerabilityOccurrencesSummary": { + "methods": [ "GetVulnerabilityOccurrencesSummary" ] }, - "ListNoteOccurrences": { - "methods": [ + "ListNoteOccurrences": { + "methods": [ "ListNoteOccurrences" ] }, - "ListNotes": { - "methods": [ + "ListNotes": { + "methods": [ "ListNotes" ] }, - "ListOccurrences": { - "methods": [ + "ListOccurrences": { + "methods": [ "ListOccurrences" ] }, - "UpdateNote": { - "methods": [ + "UpdateNote": { + "methods": [ "UpdateNote" ] }, - "UpdateOccurrence": { - "methods": [ + "UpdateOccurrence": { + "methods": [ "UpdateOccurrence" ] } diff --git a/datacatalog/apiv1/doc.go b/datacatalog/apiv1/doc.go index d0c0e0ed78e..2168e44843d 100644 --- a/datacatalog/apiv1/doc.go +++ b/datacatalog/apiv1/doc.go @@ -49,7 +49,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210630" +const versionClient = "20210701" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/datacatalog/apiv1/gapic_metadata.json b/datacatalog/apiv1/gapic_metadata.json index a219e339924..0af97677409 100644 --- a/datacatalog/apiv1/gapic_metadata.json +++ b/datacatalog/apiv1/gapic_metadata.json @@ -1,152 +1,152 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.datacatalog.v1", - "libraryPackage": "cloud.google.com/go/datacatalog/apiv1", - "services": { - "DataCatalog": { - "clients": { - "grpc": { - "libraryClient": "Client", - "rpcs": { - "CreateEntry": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.datacatalog.v1", + "libraryPackage": "cloud.google.com/go/datacatalog/apiv1", + "services": { + "DataCatalog": { + "clients": { + "grpc": { + "libraryClient": "Client", + "rpcs": { + "CreateEntry": { + "methods": [ "CreateEntry" ] }, - "CreateEntryGroup": { - "methods": [ + "CreateEntryGroup": { + "methods": [ "CreateEntryGroup" ] }, - "CreateTag": { - "methods": [ + "CreateTag": { + "methods": [ "CreateTag" ] }, - "CreateTagTemplate": { - "methods": [ + "CreateTagTemplate": { + "methods": [ "CreateTagTemplate" ] }, - "CreateTagTemplateField": { - "methods": [ + "CreateTagTemplateField": { + "methods": [ "CreateTagTemplateField" ] }, - "DeleteEntry": { - "methods": [ + "DeleteEntry": { + "methods": [ "DeleteEntry" ] }, - "DeleteEntryGroup": { - "methods": [ + "DeleteEntryGroup": { + "methods": [ "DeleteEntryGroup" ] }, - "DeleteTag": { - "methods": [ + "DeleteTag": { + "methods": [ "DeleteTag" ] }, - "DeleteTagTemplate": { - "methods": [ + "DeleteTagTemplate": { + "methods": [ "DeleteTagTemplate" ] }, - "DeleteTagTemplateField": { - "methods": [ + "DeleteTagTemplateField": { + "methods": [ "DeleteTagTemplateField" ] }, - "GetEntry": { - "methods": [ + "GetEntry": { + "methods": [ "GetEntry" ] }, - "GetEntryGroup": { - "methods": [ + "GetEntryGroup": { + "methods": [ "GetEntryGroup" ] }, - "GetIamPolicy": { - "methods": [ + "GetIamPolicy": { + "methods": [ "GetIamPolicy" ] }, - "GetTagTemplate": { - "methods": [ + "GetTagTemplate": { + "methods": [ "GetTagTemplate" ] }, - "ListEntries": { - "methods": [ + "ListEntries": { + "methods": [ "ListEntries" ] }, - "ListEntryGroups": { - "methods": [ + "ListEntryGroups": { + "methods": [ "ListEntryGroups" ] }, - "ListTags": { - "methods": [ + "ListTags": { + "methods": [ "ListTags" ] }, - "LookupEntry": { - "methods": [ + "LookupEntry": { + "methods": [ "LookupEntry" ] }, - "RenameTagTemplateField": { - "methods": [ + "RenameTagTemplateField": { + "methods": [ "RenameTagTemplateField" ] }, - "RenameTagTemplateFieldEnumValue": { - "methods": [ + "RenameTagTemplateFieldEnumValue": { + "methods": [ "RenameTagTemplateFieldEnumValue" ] }, - "SearchCatalog": { - "methods": [ + "SearchCatalog": { + "methods": [ "SearchCatalog" ] }, - "SetIamPolicy": { - "methods": [ + "SetIamPolicy": { + "methods": [ "SetIamPolicy" ] }, - "TestIamPermissions": { - "methods": [ + "TestIamPermissions": { + "methods": [ "TestIamPermissions" ] }, - "UpdateEntry": { - "methods": [ + "UpdateEntry": { + "methods": [ "UpdateEntry" ] }, - "UpdateEntryGroup": { - "methods": [ + "UpdateEntryGroup": { + "methods": [ "UpdateEntryGroup" ] }, - "UpdateTag": { - "methods": [ + "UpdateTag": { + "methods": [ "UpdateTag" ] }, - "UpdateTagTemplate": { - "methods": [ + "UpdateTagTemplate": { + "methods": [ "UpdateTagTemplate" ] }, - "UpdateTagTemplateField": { - "methods": [ + "UpdateTagTemplateField": { + "methods": [ "UpdateTagTemplateField" ] } @@ -154,73 +154,73 @@ } } }, - "PolicyTagManager": { - "clients": { - "grpc": { - "libraryClient": "PolicyTagManagerClient", - "rpcs": { - "CreatePolicyTag": { - "methods": [ + "PolicyTagManager": { + "clients": { + "grpc": { + "libraryClient": "PolicyTagManagerClient", + "rpcs": { + "CreatePolicyTag": { + "methods": [ "CreatePolicyTag" ] }, - "CreateTaxonomy": { - "methods": [ + "CreateTaxonomy": { + "methods": [ "CreateTaxonomy" ] }, - "DeletePolicyTag": { - "methods": [ + "DeletePolicyTag": { + "methods": [ "DeletePolicyTag" ] }, - "DeleteTaxonomy": { - "methods": [ + "DeleteTaxonomy": { + "methods": [ "DeleteTaxonomy" ] }, - "GetIamPolicy": { - "methods": [ + "GetIamPolicy": { + "methods": [ "GetIamPolicy" ] }, - "GetPolicyTag": { - "methods": [ + "GetPolicyTag": { + "methods": [ "GetPolicyTag" ] }, - "GetTaxonomy": { - "methods": [ + "GetTaxonomy": { + "methods": [ "GetTaxonomy" ] }, - "ListPolicyTags": { - "methods": [ + "ListPolicyTags": { + "methods": [ "ListPolicyTags" ] }, - "ListTaxonomies": { - "methods": [ + "ListTaxonomies": { + "methods": [ "ListTaxonomies" ] }, - "SetIamPolicy": { - "methods": [ + "SetIamPolicy": { + "methods": [ "SetIamPolicy" ] }, - "TestIamPermissions": { - "methods": [ + "TestIamPermissions": { + "methods": [ "TestIamPermissions" ] }, - "UpdatePolicyTag": { - "methods": [ + "UpdatePolicyTag": { + "methods": [ "UpdatePolicyTag" ] }, - "UpdateTaxonomy": { - "methods": [ + "UpdateTaxonomy": { + "methods": [ "UpdateTaxonomy" ] } @@ -228,18 +228,18 @@ } } }, - "PolicyTagManagerSerialization": { - "clients": { - "grpc": { - "libraryClient": "PolicyTagManagerSerializationClient", - "rpcs": { - "ExportTaxonomies": { - "methods": [ + "PolicyTagManagerSerialization": { + "clients": { + "grpc": { + "libraryClient": "PolicyTagManagerSerializationClient", + "rpcs": { + "ExportTaxonomies": { + "methods": [ "ExportTaxonomies" ] }, - "ImportTaxonomies": { - "methods": [ + "ImportTaxonomies": { + "methods": [ "ImportTaxonomies" ] } diff --git a/datacatalog/apiv1beta1/doc.go b/datacatalog/apiv1beta1/doc.go index 8bfccbc4b5d..fd5ad470493 100644 --- a/datacatalog/apiv1beta1/doc.go +++ b/datacatalog/apiv1beta1/doc.go @@ -51,7 +51,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210630" +const versionClient = "20210701" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/datacatalog/apiv1beta1/gapic_metadata.json b/datacatalog/apiv1beta1/gapic_metadata.json index 0d47ee7d3c6..7d06dd470a0 100644 --- a/datacatalog/apiv1beta1/gapic_metadata.json +++ b/datacatalog/apiv1beta1/gapic_metadata.json @@ -1,147 +1,147 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.datacatalog.v1beta1", - "libraryPackage": "cloud.google.com/go/datacatalog/apiv1beta1", - "services": { - "DataCatalog": { - "clients": { - "grpc": { - "libraryClient": "Client", - "rpcs": { - "CreateEntry": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.datacatalog.v1beta1", + "libraryPackage": "cloud.google.com/go/datacatalog/apiv1beta1", + "services": { + "DataCatalog": { + "clients": { + "grpc": { + "libraryClient": "Client", + "rpcs": { + "CreateEntry": { + "methods": [ "CreateEntry" ] }, - "CreateEntryGroup": { - "methods": [ + "CreateEntryGroup": { + "methods": [ "CreateEntryGroup" ] }, - "CreateTag": { - "methods": [ + "CreateTag": { + "methods": [ "CreateTag" ] }, - "CreateTagTemplate": { - "methods": [ + "CreateTagTemplate": { + "methods": [ "CreateTagTemplate" ] }, - "CreateTagTemplateField": { - "methods": [ + "CreateTagTemplateField": { + "methods": [ "CreateTagTemplateField" ] }, - "DeleteEntry": { - "methods": [ + "DeleteEntry": { + "methods": [ "DeleteEntry" ] }, - "DeleteEntryGroup": { - "methods": [ + "DeleteEntryGroup": { + "methods": [ "DeleteEntryGroup" ] }, - "DeleteTag": { - "methods": [ + "DeleteTag": { + "methods": [ "DeleteTag" ] }, - "DeleteTagTemplate": { - "methods": [ + "DeleteTagTemplate": { + "methods": [ "DeleteTagTemplate" ] }, - "DeleteTagTemplateField": { - "methods": [ + "DeleteTagTemplateField": { + "methods": [ "DeleteTagTemplateField" ] }, - "GetEntry": { - "methods": [ + "GetEntry": { + "methods": [ "GetEntry" ] }, - "GetEntryGroup": { - "methods": [ + "GetEntryGroup": { + "methods": [ "GetEntryGroup" ] }, - "GetIamPolicy": { - "methods": [ + "GetIamPolicy": { + "methods": [ "GetIamPolicy" ] }, - "GetTagTemplate": { - "methods": [ + "GetTagTemplate": { + "methods": [ "GetTagTemplate" ] }, - "ListEntries": { - "methods": [ + "ListEntries": { + "methods": [ "ListEntries" ] }, - "ListEntryGroups": { - "methods": [ + "ListEntryGroups": { + "methods": [ "ListEntryGroups" ] }, - "ListTags": { - "methods": [ + "ListTags": { + "methods": [ "ListTags" ] }, - "LookupEntry": { - "methods": [ + "LookupEntry": { + "methods": [ "LookupEntry" ] }, - "RenameTagTemplateField": { - "methods": [ + "RenameTagTemplateField": { + "methods": [ "RenameTagTemplateField" ] }, - "SearchCatalog": { - "methods": [ + "SearchCatalog": { + "methods": [ "SearchCatalog" ] }, - "SetIamPolicy": { - "methods": [ + "SetIamPolicy": { + "methods": [ "SetIamPolicy" ] }, - "TestIamPermissions": { - "methods": [ + "TestIamPermissions": { + "methods": [ "TestIamPermissions" ] }, - "UpdateEntry": { - "methods": [ + "UpdateEntry": { + "methods": [ "UpdateEntry" ] }, - "UpdateEntryGroup": { - "methods": [ + "UpdateEntryGroup": { + "methods": [ "UpdateEntryGroup" ] }, - "UpdateTag": { - "methods": [ + "UpdateTag": { + "methods": [ "UpdateTag" ] }, - "UpdateTagTemplate": { - "methods": [ + "UpdateTagTemplate": { + "methods": [ "UpdateTagTemplate" ] }, - "UpdateTagTemplateField": { - "methods": [ + "UpdateTagTemplateField": { + "methods": [ "UpdateTagTemplateField" ] } @@ -149,73 +149,73 @@ } } }, - "PolicyTagManager": { - "clients": { - "grpc": { - "libraryClient": "PolicyTagManagerClient", - "rpcs": { - "CreatePolicyTag": { - "methods": [ + "PolicyTagManager": { + "clients": { + "grpc": { + "libraryClient": "PolicyTagManagerClient", + "rpcs": { + "CreatePolicyTag": { + "methods": [ "CreatePolicyTag" ] }, - "CreateTaxonomy": { - "methods": [ + "CreateTaxonomy": { + "methods": [ "CreateTaxonomy" ] }, - "DeletePolicyTag": { - "methods": [ + "DeletePolicyTag": { + "methods": [ "DeletePolicyTag" ] }, - "DeleteTaxonomy": { - "methods": [ + "DeleteTaxonomy": { + "methods": [ "DeleteTaxonomy" ] }, - "GetIamPolicy": { - "methods": [ + "GetIamPolicy": { + "methods": [ "GetIamPolicy" ] }, - "GetPolicyTag": { - "methods": [ + "GetPolicyTag": { + "methods": [ "GetPolicyTag" ] }, - "GetTaxonomy": { - "methods": [ + "GetTaxonomy": { + "methods": [ "GetTaxonomy" ] }, - "ListPolicyTags": { - "methods": [ + "ListPolicyTags": { + "methods": [ "ListPolicyTags" ] }, - "ListTaxonomies": { - "methods": [ + "ListTaxonomies": { + "methods": [ "ListTaxonomies" ] }, - "SetIamPolicy": { - "methods": [ + "SetIamPolicy": { + "methods": [ "SetIamPolicy" ] }, - "TestIamPermissions": { - "methods": [ + "TestIamPermissions": { + "methods": [ "TestIamPermissions" ] }, - "UpdatePolicyTag": { - "methods": [ + "UpdatePolicyTag": { + "methods": [ "UpdatePolicyTag" ] }, - "UpdateTaxonomy": { - "methods": [ + "UpdateTaxonomy": { + "methods": [ "UpdateTaxonomy" ] } @@ -223,18 +223,18 @@ } } }, - "PolicyTagManagerSerialization": { - "clients": { - "grpc": { - "libraryClient": "PolicyTagManagerSerializationClient", - "rpcs": { - "ExportTaxonomies": { - "methods": [ + "PolicyTagManagerSerialization": { + "clients": { + "grpc": { + "libraryClient": "PolicyTagManagerSerializationClient", + "rpcs": { + "ExportTaxonomies": { + "methods": [ "ExportTaxonomies" ] }, - "ImportTaxonomies": { - "methods": [ + "ImportTaxonomies": { + "methods": [ "ImportTaxonomies" ] } diff --git a/dataflow/apiv1beta3/doc.go b/dataflow/apiv1beta3/doc.go index 850564f3c3a..4b8ebff9155 100644 --- a/dataflow/apiv1beta3/doc.go +++ b/dataflow/apiv1beta3/doc.go @@ -50,7 +50,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "UNKNOWN" +const versionClient = "20210701" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/dataflow/apiv1beta3/gapic_metadata.json b/dataflow/apiv1beta3/gapic_metadata.json index b918aaea24e..9dcbc9db670 100644 --- a/dataflow/apiv1beta3/gapic_metadata.json +++ b/dataflow/apiv1beta3/gapic_metadata.json @@ -1,17 +1,17 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.dataflow.v1beta3", - "libraryPackage": "cloud.google.com/go/dataflow/apiv1beta3", - "services": { - "FlexTemplatesService": { - "clients": { - "grpc": { - "libraryClient": "FlexTemplatesClient", - "rpcs": { - "LaunchFlexTemplate": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.dataflow.v1beta3", + "libraryPackage": "cloud.google.com/go/dataflow/apiv1beta3", + "services": { + "FlexTemplatesService": { + "clients": { + "grpc": { + "libraryClient": "FlexTemplatesClient", + "rpcs": { + "LaunchFlexTemplate": { + "methods": [ "LaunchFlexTemplate" ] } @@ -19,43 +19,43 @@ } } }, - "JobsV1Beta3": { - "clients": { - "grpc": { - "libraryClient": "JobsV1Beta3Client", - "rpcs": { - "AggregatedListJobs": { - "methods": [ + "JobsV1Beta3": { + "clients": { + "grpc": { + "libraryClient": "JobsV1Beta3Client", + "rpcs": { + "AggregatedListJobs": { + "methods": [ "AggregatedListJobs" ] }, - "CheckActiveJobs": { - "methods": [ + "CheckActiveJobs": { + "methods": [ "CheckActiveJobs" ] }, - "CreateJob": { - "methods": [ + "CreateJob": { + "methods": [ "CreateJob" ] }, - "GetJob": { - "methods": [ + "GetJob": { + "methods": [ "GetJob" ] }, - "ListJobs": { - "methods": [ + "ListJobs": { + "methods": [ "ListJobs" ] }, - "SnapshotJob": { - "methods": [ + "SnapshotJob": { + "methods": [ "SnapshotJob" ] }, - "UpdateJob": { - "methods": [ + "UpdateJob": { + "methods": [ "UpdateJob" ] } @@ -63,13 +63,13 @@ } } }, - "MessagesV1Beta3": { - "clients": { - "grpc": { - "libraryClient": "MessagesV1Beta3Client", - "rpcs": { - "ListJobMessages": { - "methods": [ + "MessagesV1Beta3": { + "clients": { + "grpc": { + "libraryClient": "MessagesV1Beta3Client", + "rpcs": { + "ListJobMessages": { + "methods": [ "ListJobMessages" ] } @@ -77,23 +77,23 @@ } } }, - "MetricsV1Beta3": { - "clients": { - "grpc": { - "libraryClient": "MetricsV1Beta3Client", - "rpcs": { - "GetJobExecutionDetails": { - "methods": [ + "MetricsV1Beta3": { + "clients": { + "grpc": { + "libraryClient": "MetricsV1Beta3Client", + "rpcs": { + "GetJobExecutionDetails": { + "methods": [ "GetJobExecutionDetails" ] }, - "GetJobMetrics": { - "methods": [ + "GetJobMetrics": { + "methods": [ "GetJobMetrics" ] }, - "GetStageExecutionDetails": { - "methods": [ + "GetStageExecutionDetails": { + "methods": [ "GetStageExecutionDetails" ] } @@ -101,23 +101,23 @@ } } }, - "SnapshotsV1Beta3": { - "clients": { - "grpc": { - "libraryClient": "SnapshotsV1Beta3Client", - "rpcs": { - "DeleteSnapshot": { - "methods": [ + "SnapshotsV1Beta3": { + "clients": { + "grpc": { + "libraryClient": "SnapshotsV1Beta3Client", + "rpcs": { + "DeleteSnapshot": { + "methods": [ "DeleteSnapshot" ] }, - "GetSnapshot": { - "methods": [ + "GetSnapshot": { + "methods": [ "GetSnapshot" ] }, - "ListSnapshots": { - "methods": [ + "ListSnapshots": { + "methods": [ "ListSnapshots" ] } @@ -125,23 +125,23 @@ } } }, - "TemplatesService": { - "clients": { - "grpc": { - "libraryClient": "TemplatesClient", - "rpcs": { - "CreateJobFromTemplate": { - "methods": [ + "TemplatesService": { + "clients": { + "grpc": { + "libraryClient": "TemplatesClient", + "rpcs": { + "CreateJobFromTemplate": { + "methods": [ "CreateJobFromTemplate" ] }, - "GetTemplate": { - "methods": [ + "GetTemplate": { + "methods": [ "GetTemplate" ] }, - "LaunchTemplate": { - "methods": [ + "LaunchTemplate": { + "methods": [ "LaunchTemplate" ] } diff --git a/datalabeling/apiv1beta1/doc.go b/datalabeling/apiv1beta1/doc.go index 7712dc3e77a..8058caf4596 100644 --- a/datalabeling/apiv1beta1/doc.go +++ b/datalabeling/apiv1beta1/doc.go @@ -50,7 +50,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210630" +const versionClient = "20210701" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/datalabeling/apiv1beta1/gapic_metadata.json b/datalabeling/apiv1beta1/gapic_metadata.json index 69afd996bb3..bc3f8733da3 100644 --- a/datalabeling/apiv1beta1/gapic_metadata.json +++ b/datalabeling/apiv1beta1/gapic_metadata.json @@ -1,182 +1,182 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.datalabeling.v1beta1", - "libraryPackage": "cloud.google.com/go/datalabeling/apiv1beta1", - "services": { - "DataLabelingService": { - "clients": { - "grpc": { - "libraryClient": "Client", - "rpcs": { - "CreateAnnotationSpecSet": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.datalabeling.v1beta1", + "libraryPackage": "cloud.google.com/go/datalabeling/apiv1beta1", + "services": { + "DataLabelingService": { + "clients": { + "grpc": { + "libraryClient": "Client", + "rpcs": { + "CreateAnnotationSpecSet": { + "methods": [ "CreateAnnotationSpecSet" ] }, - "CreateDataset": { - "methods": [ + "CreateDataset": { + "methods": [ "CreateDataset" ] }, - "CreateEvaluationJob": { - "methods": [ + "CreateEvaluationJob": { + "methods": [ "CreateEvaluationJob" ] }, - "CreateInstruction": { - "methods": [ + "CreateInstruction": { + "methods": [ "CreateInstruction" ] }, - "DeleteAnnotatedDataset": { - "methods": [ + "DeleteAnnotatedDataset": { + "methods": [ "DeleteAnnotatedDataset" ] }, - "DeleteAnnotationSpecSet": { - "methods": [ + "DeleteAnnotationSpecSet": { + "methods": [ "DeleteAnnotationSpecSet" ] }, - "DeleteDataset": { - "methods": [ + "DeleteDataset": { + "methods": [ "DeleteDataset" ] }, - "DeleteEvaluationJob": { - "methods": [ + "DeleteEvaluationJob": { + "methods": [ "DeleteEvaluationJob" ] }, - "DeleteInstruction": { - "methods": [ + "DeleteInstruction": { + "methods": [ "DeleteInstruction" ] }, - "ExportData": { - "methods": [ + "ExportData": { + "methods": [ "ExportData" ] }, - "GetAnnotatedDataset": { - "methods": [ + "GetAnnotatedDataset": { + "methods": [ "GetAnnotatedDataset" ] }, - "GetAnnotationSpecSet": { - "methods": [ + "GetAnnotationSpecSet": { + "methods": [ "GetAnnotationSpecSet" ] }, - "GetDataItem": { - "methods": [ + "GetDataItem": { + "methods": [ "GetDataItem" ] }, - "GetDataset": { - "methods": [ + "GetDataset": { + "methods": [ "GetDataset" ] }, - "GetEvaluation": { - "methods": [ + "GetEvaluation": { + "methods": [ "GetEvaluation" ] }, - "GetEvaluationJob": { - "methods": [ + "GetEvaluationJob": { + "methods": [ "GetEvaluationJob" ] }, - "GetExample": { - "methods": [ + "GetExample": { + "methods": [ "GetExample" ] }, - "GetInstruction": { - "methods": [ + "GetInstruction": { + "methods": [ "GetInstruction" ] }, - "ImportData": { - "methods": [ + "ImportData": { + "methods": [ "ImportData" ] }, - "LabelImage": { - "methods": [ + "LabelImage": { + "methods": [ "LabelImage" ] }, - "LabelText": { - "methods": [ + "LabelText": { + "methods": [ "LabelText" ] }, - "LabelVideo": { - "methods": [ + "LabelVideo": { + "methods": [ "LabelVideo" ] }, - "ListAnnotatedDatasets": { - "methods": [ + "ListAnnotatedDatasets": { + "methods": [ "ListAnnotatedDatasets" ] }, - "ListAnnotationSpecSets": { - "methods": [ + "ListAnnotationSpecSets": { + "methods": [ "ListAnnotationSpecSets" ] }, - "ListDataItems": { - "methods": [ + "ListDataItems": { + "methods": [ "ListDataItems" ] }, - "ListDatasets": { - "methods": [ + "ListDatasets": { + "methods": [ "ListDatasets" ] }, - "ListEvaluationJobs": { - "methods": [ + "ListEvaluationJobs": { + "methods": [ "ListEvaluationJobs" ] }, - "ListExamples": { - "methods": [ + "ListExamples": { + "methods": [ "ListExamples" ] }, - "ListInstructions": { - "methods": [ + "ListInstructions": { + "methods": [ "ListInstructions" ] }, - "PauseEvaluationJob": { - "methods": [ + "PauseEvaluationJob": { + "methods": [ "PauseEvaluationJob" ] }, - "ResumeEvaluationJob": { - "methods": [ + "ResumeEvaluationJob": { + "methods": [ "ResumeEvaluationJob" ] }, - "SearchEvaluations": { - "methods": [ + "SearchEvaluations": { + "methods": [ "SearchEvaluations" ] }, - "SearchExampleComparisons": { - "methods": [ + "SearchExampleComparisons": { + "methods": [ "SearchExampleComparisons" ] }, - "UpdateEvaluationJob": { - "methods": [ + "UpdateEvaluationJob": { + "methods": [ "UpdateEvaluationJob" ] } diff --git a/dataproc/apiv1/doc.go b/dataproc/apiv1/doc.go index 22f8479d6d1..69c90b1e10b 100644 --- a/dataproc/apiv1/doc.go +++ b/dataproc/apiv1/doc.go @@ -48,7 +48,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210630" +const versionClient = "20210701" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/dataproc/apiv1/gapic_metadata.json b/dataproc/apiv1/gapic_metadata.json index 533ee76f5c6..0d02cbf337d 100644 --- a/dataproc/apiv1/gapic_metadata.json +++ b/dataproc/apiv1/gapic_metadata.json @@ -1,37 +1,37 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.dataproc.v1", - "libraryPackage": "cloud.google.com/go/dataproc/apiv1", - "services": { - "AutoscalingPolicyService": { - "clients": { - "grpc": { - "libraryClient": "AutoscalingPolicyClient", - "rpcs": { - "CreateAutoscalingPolicy": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.dataproc.v1", + "libraryPackage": "cloud.google.com/go/dataproc/apiv1", + "services": { + "AutoscalingPolicyService": { + "clients": { + "grpc": { + "libraryClient": "AutoscalingPolicyClient", + "rpcs": { + "CreateAutoscalingPolicy": { + "methods": [ "CreateAutoscalingPolicy" ] }, - "DeleteAutoscalingPolicy": { - "methods": [ + "DeleteAutoscalingPolicy": { + "methods": [ "DeleteAutoscalingPolicy" ] }, - "GetAutoscalingPolicy": { - "methods": [ + "GetAutoscalingPolicy": { + "methods": [ "GetAutoscalingPolicy" ] }, - "ListAutoscalingPolicies": { - "methods": [ + "ListAutoscalingPolicies": { + "methods": [ "ListAutoscalingPolicies" ] }, - "UpdateAutoscalingPolicy": { - "methods": [ + "UpdateAutoscalingPolicy": { + "methods": [ "UpdateAutoscalingPolicy" ] } @@ -39,48 +39,48 @@ } } }, - "ClusterController": { - "clients": { - "grpc": { - "libraryClient": "ClusterControllerClient", - "rpcs": { - "CreateCluster": { - "methods": [ + "ClusterController": { + "clients": { + "grpc": { + "libraryClient": "ClusterControllerClient", + "rpcs": { + "CreateCluster": { + "methods": [ "CreateCluster" ] }, - "DeleteCluster": { - "methods": [ + "DeleteCluster": { + "methods": [ "DeleteCluster" ] }, - "DiagnoseCluster": { - "methods": [ + "DiagnoseCluster": { + "methods": [ "DiagnoseCluster" ] }, - "GetCluster": { - "methods": [ + "GetCluster": { + "methods": [ "GetCluster" ] }, - "ListClusters": { - "methods": [ + "ListClusters": { + "methods": [ "ListClusters" ] }, - "StartCluster": { - "methods": [ + "StartCluster": { + "methods": [ "StartCluster" ] }, - "StopCluster": { - "methods": [ + "StopCluster": { + "methods": [ "StopCluster" ] }, - "UpdateCluster": { - "methods": [ + "UpdateCluster": { + "methods": [ "UpdateCluster" ] } @@ -88,43 +88,43 @@ } } }, - "JobController": { - "clients": { - "grpc": { - "libraryClient": "JobControllerClient", - "rpcs": { - "CancelJob": { - "methods": [ + "JobController": { + "clients": { + "grpc": { + "libraryClient": "JobControllerClient", + "rpcs": { + "CancelJob": { + "methods": [ "CancelJob" ] }, - "DeleteJob": { - "methods": [ + "DeleteJob": { + "methods": [ "DeleteJob" ] }, - "GetJob": { - "methods": [ + "GetJob": { + "methods": [ "GetJob" ] }, - "ListJobs": { - "methods": [ + "ListJobs": { + "methods": [ "ListJobs" ] }, - "SubmitJob": { - "methods": [ + "SubmitJob": { + "methods": [ "SubmitJob" ] }, - "SubmitJobAsOperation": { - "methods": [ + "SubmitJobAsOperation": { + "methods": [ "SubmitJobAsOperation" ] }, - "UpdateJob": { - "methods": [ + "UpdateJob": { + "methods": [ "UpdateJob" ] } @@ -132,43 +132,43 @@ } } }, - "WorkflowTemplateService": { - "clients": { - "grpc": { - "libraryClient": "WorkflowTemplateClient", - "rpcs": { - "CreateWorkflowTemplate": { - "methods": [ + "WorkflowTemplateService": { + "clients": { + "grpc": { + "libraryClient": "WorkflowTemplateClient", + "rpcs": { + "CreateWorkflowTemplate": { + "methods": [ "CreateWorkflowTemplate" ] }, - "DeleteWorkflowTemplate": { - "methods": [ + "DeleteWorkflowTemplate": { + "methods": [ "DeleteWorkflowTemplate" ] }, - "GetWorkflowTemplate": { - "methods": [ + "GetWorkflowTemplate": { + "methods": [ "GetWorkflowTemplate" ] }, - "InstantiateInlineWorkflowTemplate": { - "methods": [ + "InstantiateInlineWorkflowTemplate": { + "methods": [ "InstantiateInlineWorkflowTemplate" ] }, - "InstantiateWorkflowTemplate": { - "methods": [ + "InstantiateWorkflowTemplate": { + "methods": [ "InstantiateWorkflowTemplate" ] }, - "ListWorkflowTemplates": { - "methods": [ + "ListWorkflowTemplates": { + "methods": [ "ListWorkflowTemplates" ] }, - "UpdateWorkflowTemplate": { - "methods": [ + "UpdateWorkflowTemplate": { + "methods": [ "UpdateWorkflowTemplate" ] } diff --git a/dataproc/apiv1beta2/doc.go b/dataproc/apiv1beta2/doc.go index 659062ed7be..667e018c5f0 100644 --- a/dataproc/apiv1beta2/doc.go +++ b/dataproc/apiv1beta2/doc.go @@ -50,7 +50,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210630" +const versionClient = "20210701" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/dataproc/apiv1beta2/gapic_metadata.json b/dataproc/apiv1beta2/gapic_metadata.json index ca6dee8c5e7..2669636f437 100644 --- a/dataproc/apiv1beta2/gapic_metadata.json +++ b/dataproc/apiv1beta2/gapic_metadata.json @@ -1,37 +1,37 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.dataproc.v1beta2", - "libraryPackage": "cloud.google.com/go/dataproc/apiv1beta2", - "services": { - "AutoscalingPolicyService": { - "clients": { - "grpc": { - "libraryClient": "AutoscalingPolicyClient", - "rpcs": { - "CreateAutoscalingPolicy": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.dataproc.v1beta2", + "libraryPackage": "cloud.google.com/go/dataproc/apiv1beta2", + "services": { + "AutoscalingPolicyService": { + "clients": { + "grpc": { + "libraryClient": "AutoscalingPolicyClient", + "rpcs": { + "CreateAutoscalingPolicy": { + "methods": [ "CreateAutoscalingPolicy" ] }, - "DeleteAutoscalingPolicy": { - "methods": [ + "DeleteAutoscalingPolicy": { + "methods": [ "DeleteAutoscalingPolicy" ] }, - "GetAutoscalingPolicy": { - "methods": [ + "GetAutoscalingPolicy": { + "methods": [ "GetAutoscalingPolicy" ] }, - "ListAutoscalingPolicies": { - "methods": [ + "ListAutoscalingPolicies": { + "methods": [ "ListAutoscalingPolicies" ] }, - "UpdateAutoscalingPolicy": { - "methods": [ + "UpdateAutoscalingPolicy": { + "methods": [ "UpdateAutoscalingPolicy" ] } @@ -39,38 +39,38 @@ } } }, - "ClusterController": { - "clients": { - "grpc": { - "libraryClient": "ClusterControllerClient", - "rpcs": { - "CreateCluster": { - "methods": [ + "ClusterController": { + "clients": { + "grpc": { + "libraryClient": "ClusterControllerClient", + "rpcs": { + "CreateCluster": { + "methods": [ "CreateCluster" ] }, - "DeleteCluster": { - "methods": [ + "DeleteCluster": { + "methods": [ "DeleteCluster" ] }, - "DiagnoseCluster": { - "methods": [ + "DiagnoseCluster": { + "methods": [ "DiagnoseCluster" ] }, - "GetCluster": { - "methods": [ + "GetCluster": { + "methods": [ "GetCluster" ] }, - "ListClusters": { - "methods": [ + "ListClusters": { + "methods": [ "ListClusters" ] }, - "UpdateCluster": { - "methods": [ + "UpdateCluster": { + "methods": [ "UpdateCluster" ] } @@ -78,43 +78,43 @@ } } }, - "JobController": { - "clients": { - "grpc": { - "libraryClient": "JobControllerClient", - "rpcs": { - "CancelJob": { - "methods": [ + "JobController": { + "clients": { + "grpc": { + "libraryClient": "JobControllerClient", + "rpcs": { + "CancelJob": { + "methods": [ "CancelJob" ] }, - "DeleteJob": { - "methods": [ + "DeleteJob": { + "methods": [ "DeleteJob" ] }, - "GetJob": { - "methods": [ + "GetJob": { + "methods": [ "GetJob" ] }, - "ListJobs": { - "methods": [ + "ListJobs": { + "methods": [ "ListJobs" ] }, - "SubmitJob": { - "methods": [ + "SubmitJob": { + "methods": [ "SubmitJob" ] }, - "SubmitJobAsOperation": { - "methods": [ + "SubmitJobAsOperation": { + "methods": [ "SubmitJobAsOperation" ] }, - "UpdateJob": { - "methods": [ + "UpdateJob": { + "methods": [ "UpdateJob" ] } @@ -122,43 +122,43 @@ } } }, - "WorkflowTemplateService": { - "clients": { - "grpc": { - "libraryClient": "WorkflowTemplateClient", - "rpcs": { - "CreateWorkflowTemplate": { - "methods": [ + "WorkflowTemplateService": { + "clients": { + "grpc": { + "libraryClient": "WorkflowTemplateClient", + "rpcs": { + "CreateWorkflowTemplate": { + "methods": [ "CreateWorkflowTemplate" ] }, - "DeleteWorkflowTemplate": { - "methods": [ + "DeleteWorkflowTemplate": { + "methods": [ "DeleteWorkflowTemplate" ] }, - "GetWorkflowTemplate": { - "methods": [ + "GetWorkflowTemplate": { + "methods": [ "GetWorkflowTemplate" ] }, - "InstantiateInlineWorkflowTemplate": { - "methods": [ + "InstantiateInlineWorkflowTemplate": { + "methods": [ "InstantiateInlineWorkflowTemplate" ] }, - "InstantiateWorkflowTemplate": { - "methods": [ + "InstantiateWorkflowTemplate": { + "methods": [ "InstantiateWorkflowTemplate" ] }, - "ListWorkflowTemplates": { - "methods": [ + "ListWorkflowTemplates": { + "methods": [ "ListWorkflowTemplates" ] }, - "UpdateWorkflowTemplate": { - "methods": [ + "UpdateWorkflowTemplate": { + "methods": [ "UpdateWorkflowTemplate" ] } diff --git a/dataqna/apiv1alpha/doc.go b/dataqna/apiv1alpha/doc.go index c9bbb72d570..5d3e59576c6 100644 --- a/dataqna/apiv1alpha/doc.go +++ b/dataqna/apiv1alpha/doc.go @@ -51,7 +51,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210630" +const versionClient = "20210701" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/dataqna/apiv1alpha/gapic_metadata.json b/dataqna/apiv1alpha/gapic_metadata.json index b5acffa08f0..5ed6988e3fa 100644 --- a/dataqna/apiv1alpha/gapic_metadata.json +++ b/dataqna/apiv1alpha/gapic_metadata.json @@ -1,17 +1,17 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.dataqna.v1alpha", - "libraryPackage": "cloud.google.com/go/dataqna/apiv1alpha", - "services": { - "AutoSuggestionService": { - "clients": { - "grpc": { - "libraryClient": "AutoSuggestionClient", - "rpcs": { - "SuggestQueries": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.dataqna.v1alpha", + "libraryPackage": "cloud.google.com/go/dataqna/apiv1alpha", + "services": { + "AutoSuggestionService": { + "clients": { + "grpc": { + "libraryClient": "AutoSuggestionClient", + "rpcs": { + "SuggestQueries": { + "methods": [ "SuggestQueries" ] } @@ -19,33 +19,33 @@ } } }, - "QuestionService": { - "clients": { - "grpc": { - "libraryClient": "QuestionClient", - "rpcs": { - "CreateQuestion": { - "methods": [ + "QuestionService": { + "clients": { + "grpc": { + "libraryClient": "QuestionClient", + "rpcs": { + "CreateQuestion": { + "methods": [ "CreateQuestion" ] }, - "ExecuteQuestion": { - "methods": [ + "ExecuteQuestion": { + "methods": [ "ExecuteQuestion" ] }, - "GetQuestion": { - "methods": [ + "GetQuestion": { + "methods": [ "GetQuestion" ] }, - "GetUserFeedback": { - "methods": [ + "GetUserFeedback": { + "methods": [ "GetUserFeedback" ] }, - "UpdateUserFeedback": { - "methods": [ + "UpdateUserFeedback": { + "methods": [ "UpdateUserFeedback" ] } diff --git a/datastore/admin/apiv1/doc.go b/datastore/admin/apiv1/doc.go index 6e5c06d8371..fad25e838c2 100644 --- a/datastore/admin/apiv1/doc.go +++ b/datastore/admin/apiv1/doc.go @@ -51,7 +51,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210630" +const versionClient = "20210701" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/datastore/admin/apiv1/gapic_metadata.json b/datastore/admin/apiv1/gapic_metadata.json index 07d60ee93be..12ca2f15ef3 100644 --- a/datastore/admin/apiv1/gapic_metadata.json +++ b/datastore/admin/apiv1/gapic_metadata.json @@ -1,42 +1,42 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.datastore.admin.v1", - "libraryPackage": "cloud.google.com/go/datastore/admin/apiv1", - "services": { - "DatastoreAdmin": { - "clients": { - "grpc": { - "libraryClient": "DatastoreAdminClient", - "rpcs": { - "CreateIndex": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.datastore.admin.v1", + "libraryPackage": "cloud.google.com/go/datastore/admin/apiv1", + "services": { + "DatastoreAdmin": { + "clients": { + "grpc": { + "libraryClient": "DatastoreAdminClient", + "rpcs": { + "CreateIndex": { + "methods": [ "CreateIndex" ] }, - "DeleteIndex": { - "methods": [ + "DeleteIndex": { + "methods": [ "DeleteIndex" ] }, - "ExportEntities": { - "methods": [ + "ExportEntities": { + "methods": [ "ExportEntities" ] }, - "GetIndex": { - "methods": [ + "GetIndex": { + "methods": [ "GetIndex" ] }, - "ImportEntities": { - "methods": [ + "ImportEntities": { + "methods": [ "ImportEntities" ] }, - "ListIndexes": { - "methods": [ + "ListIndexes": { + "methods": [ "ListIndexes" ] } diff --git a/datastore/go.mod b/datastore/go.mod index 74bd1b78895..d9b084df589 100644 --- a/datastore/go.mod +++ b/datastore/go.mod @@ -8,7 +8,7 @@ require ( github.com/google/go-cmp v0.5.6 github.com/googleapis/gax-go/v2 v2.0.5 google.golang.org/api v0.50.0 - google.golang.org/genproto v0.0.0-20210630183607-d20f26d13c79 + google.golang.org/genproto v0.0.0-20210701133433-6b8dcf568a95 google.golang.org/grpc v1.38.0 google.golang.org/protobuf v1.27.1 ) diff --git a/datastore/go.sum b/datastore/go.sum index 9e44f7fc0b6..aa8fd5de0a2 100644 --- a/datastore/go.sum +++ b/datastore/go.sum @@ -450,8 +450,8 @@ google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxH google.golang.org/genproto v0.0.0-20210604141403-392c879c8b08/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= google.golang.org/genproto v0.0.0-20210608205507-b6d2f5bf0d7d/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= google.golang.org/genproto v0.0.0-20210624195500-8bfb893ecb84/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24= -google.golang.org/genproto v0.0.0-20210630183607-d20f26d13c79 h1:s1jFTXJryg4a1mew7xv03VZD8N9XjxFhk1o4Js4WvPQ= -google.golang.org/genproto v0.0.0-20210630183607-d20f26d13c79/go.mod h1:yiaVoXHpRzHGyxV3o4DktVWY4mSUErTKaeEOq6C3t3U= +google.golang.org/genproto v0.0.0-20210701133433-6b8dcf568a95 h1:xyRjacsGcaSoZ2fTcaLCSzh2JEceLLOT4X8k32Q0xAQ= +google.golang.org/genproto v0.0.0-20210701133433-6b8dcf568a95/go.mod h1:yiaVoXHpRzHGyxV3o4DktVWY4mSUErTKaeEOq6C3t3U= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= diff --git a/datastream/apiv1alpha1/doc.go b/datastream/apiv1alpha1/doc.go index 29837f62a93..b110d9efea7 100644 --- a/datastream/apiv1alpha1/doc.go +++ b/datastream/apiv1alpha1/doc.go @@ -48,7 +48,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210630" +const versionClient = "20210701" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/datastream/apiv1alpha1/gapic_metadata.json b/datastream/apiv1alpha1/gapic_metadata.json index 86d55bde221..417ecf9c439 100644 --- a/datastream/apiv1alpha1/gapic_metadata.json +++ b/datastream/apiv1alpha1/gapic_metadata.json @@ -1,117 +1,117 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.datastream.v1alpha1", - "libraryPackage": "cloud.google.com/go/datastream/apiv1alpha1", - "services": { - "Datastream": { - "clients": { - "grpc": { - "libraryClient": "Client", - "rpcs": { - "CreateConnectionProfile": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.datastream.v1alpha1", + "libraryPackage": "cloud.google.com/go/datastream/apiv1alpha1", + "services": { + "Datastream": { + "clients": { + "grpc": { + "libraryClient": "Client", + "rpcs": { + "CreateConnectionProfile": { + "methods": [ "CreateConnectionProfile" ] }, - "CreatePrivateConnection": { - "methods": [ + "CreatePrivateConnection": { + "methods": [ "CreatePrivateConnection" ] }, - "CreateRoute": { - "methods": [ + "CreateRoute": { + "methods": [ "CreateRoute" ] }, - "CreateStream": { - "methods": [ + "CreateStream": { + "methods": [ "CreateStream" ] }, - "DeleteConnectionProfile": { - "methods": [ + "DeleteConnectionProfile": { + "methods": [ "DeleteConnectionProfile" ] }, - "DeletePrivateConnection": { - "methods": [ + "DeletePrivateConnection": { + "methods": [ "DeletePrivateConnection" ] }, - "DeleteRoute": { - "methods": [ + "DeleteRoute": { + "methods": [ "DeleteRoute" ] }, - "DeleteStream": { - "methods": [ + "DeleteStream": { + "methods": [ "DeleteStream" ] }, - "DiscoverConnectionProfile": { - "methods": [ + "DiscoverConnectionProfile": { + "methods": [ "DiscoverConnectionProfile" ] }, - "FetchErrors": { - "methods": [ + "FetchErrors": { + "methods": [ "FetchErrors" ] }, - "FetchStaticIps": { - "methods": [ + "FetchStaticIps": { + "methods": [ "FetchStaticIps" ] }, - "GetConnectionProfile": { - "methods": [ + "GetConnectionProfile": { + "methods": [ "GetConnectionProfile" ] }, - "GetPrivateConnection": { - "methods": [ + "GetPrivateConnection": { + "methods": [ "GetPrivateConnection" ] }, - "GetRoute": { - "methods": [ + "GetRoute": { + "methods": [ "GetRoute" ] }, - "GetStream": { - "methods": [ + "GetStream": { + "methods": [ "GetStream" ] }, - "ListConnectionProfiles": { - "methods": [ + "ListConnectionProfiles": { + "methods": [ "ListConnectionProfiles" ] }, - "ListPrivateConnections": { - "methods": [ + "ListPrivateConnections": { + "methods": [ "ListPrivateConnections" ] }, - "ListRoutes": { - "methods": [ + "ListRoutes": { + "methods": [ "ListRoutes" ] }, - "ListStreams": { - "methods": [ + "ListStreams": { + "methods": [ "ListStreams" ] }, - "UpdateConnectionProfile": { - "methods": [ + "UpdateConnectionProfile": { + "methods": [ "UpdateConnectionProfile" ] }, - "UpdateStream": { - "methods": [ + "UpdateStream": { + "methods": [ "UpdateStream" ] } diff --git a/debugger/apiv2/doc.go b/debugger/apiv2/doc.go index 46c1001d446..43dbfffd1ad 100644 --- a/debugger/apiv2/doc.go +++ b/debugger/apiv2/doc.go @@ -49,7 +49,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210630" +const versionClient = "20210701" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/debugger/apiv2/gapic_metadata.json b/debugger/apiv2/gapic_metadata.json index 1727a125a34..e0790b9e7f7 100644 --- a/debugger/apiv2/gapic_metadata.json +++ b/debugger/apiv2/gapic_metadata.json @@ -1,27 +1,27 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.devtools.clouddebugger.v2", - "libraryPackage": "cloud.google.com/go/debugger/apiv2", - "services": { - "Controller2": { - "clients": { - "grpc": { - "libraryClient": "Controller2Client", - "rpcs": { - "ListActiveBreakpoints": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.devtools.clouddebugger.v2", + "libraryPackage": "cloud.google.com/go/debugger/apiv2", + "services": { + "Controller2": { + "clients": { + "grpc": { + "libraryClient": "Controller2Client", + "rpcs": { + "ListActiveBreakpoints": { + "methods": [ "ListActiveBreakpoints" ] }, - "RegisterDebuggee": { - "methods": [ + "RegisterDebuggee": { + "methods": [ "RegisterDebuggee" ] }, - "UpdateActiveBreakpoint": { - "methods": [ + "UpdateActiveBreakpoint": { + "methods": [ "UpdateActiveBreakpoint" ] } @@ -29,33 +29,33 @@ } } }, - "Debugger2": { - "clients": { - "grpc": { - "libraryClient": "Debugger2Client", - "rpcs": { - "DeleteBreakpoint": { - "methods": [ + "Debugger2": { + "clients": { + "grpc": { + "libraryClient": "Debugger2Client", + "rpcs": { + "DeleteBreakpoint": { + "methods": [ "DeleteBreakpoint" ] }, - "GetBreakpoint": { - "methods": [ + "GetBreakpoint": { + "methods": [ "GetBreakpoint" ] }, - "ListBreakpoints": { - "methods": [ + "ListBreakpoints": { + "methods": [ "ListBreakpoints" ] }, - "ListDebuggees": { - "methods": [ + "ListDebuggees": { + "methods": [ "ListDebuggees" ] }, - "SetBreakpoint": { - "methods": [ + "SetBreakpoint": { + "methods": [ "SetBreakpoint" ] } diff --git a/dialogflow/apiv2/doc.go b/dialogflow/apiv2/doc.go index 9bcf37c93e1..32d95a11eb1 100644 --- a/dialogflow/apiv2/doc.go +++ b/dialogflow/apiv2/doc.go @@ -49,7 +49,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210630" +const versionClient = "20210701" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/dialogflow/apiv2/gapic_metadata.json b/dialogflow/apiv2/gapic_metadata.json index 0671534239a..d7b1922072c 100644 --- a/dialogflow/apiv2/gapic_metadata.json +++ b/dialogflow/apiv2/gapic_metadata.json @@ -1,57 +1,57 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.dialogflow.v2", - "libraryPackage": "cloud.google.com/go/dialogflow/apiv2", - "services": { - "Agents": { - "clients": { - "grpc": { - "libraryClient": "AgentsClient", - "rpcs": { - "DeleteAgent": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.dialogflow.v2", + "libraryPackage": "cloud.google.com/go/dialogflow/apiv2", + "services": { + "Agents": { + "clients": { + "grpc": { + "libraryClient": "AgentsClient", + "rpcs": { + "DeleteAgent": { + "methods": [ "DeleteAgent" ] }, - "ExportAgent": { - "methods": [ + "ExportAgent": { + "methods": [ "ExportAgent" ] }, - "GetAgent": { - "methods": [ + "GetAgent": { + "methods": [ "GetAgent" ] }, - "GetValidationResult": { - "methods": [ + "GetValidationResult": { + "methods": [ "GetValidationResult" ] }, - "ImportAgent": { - "methods": [ + "ImportAgent": { + "methods": [ "ImportAgent" ] }, - "RestoreAgent": { - "methods": [ + "RestoreAgent": { + "methods": [ "RestoreAgent" ] }, - "SearchAgents": { - "methods": [ + "SearchAgents": { + "methods": [ "SearchAgents" ] }, - "SetAgent": { - "methods": [ + "SetAgent": { + "methods": [ "SetAgent" ] }, - "TrainAgent": { - "methods": [ + "TrainAgent": { + "methods": [ "TrainAgent" ] } @@ -59,18 +59,18 @@ } } }, - "AnswerRecords": { - "clients": { - "grpc": { - "libraryClient": "AnswerRecordsClient", - "rpcs": { - "ListAnswerRecords": { - "methods": [ + "AnswerRecords": { + "clients": { + "grpc": { + "libraryClient": "AnswerRecordsClient", + "rpcs": { + "ListAnswerRecords": { + "methods": [ "ListAnswerRecords" ] }, - "UpdateAnswerRecord": { - "methods": [ + "UpdateAnswerRecord": { + "methods": [ "UpdateAnswerRecord" ] } @@ -78,38 +78,38 @@ } } }, - "Contexts": { - "clients": { - "grpc": { - "libraryClient": "ContextsClient", - "rpcs": { - "CreateContext": { - "methods": [ + "Contexts": { + "clients": { + "grpc": { + "libraryClient": "ContextsClient", + "rpcs": { + "CreateContext": { + "methods": [ "CreateContext" ] }, - "DeleteAllContexts": { - "methods": [ + "DeleteAllContexts": { + "methods": [ "DeleteAllContexts" ] }, - "DeleteContext": { - "methods": [ + "DeleteContext": { + "methods": [ "DeleteContext" ] }, - "GetContext": { - "methods": [ + "GetContext": { + "methods": [ "GetContext" ] }, - "ListContexts": { - "methods": [ + "ListContexts": { + "methods": [ "ListContexts" ] }, - "UpdateContext": { - "methods": [ + "UpdateContext": { + "methods": [ "UpdateContext" ] } @@ -117,33 +117,33 @@ } } }, - "ConversationProfiles": { - "clients": { - "grpc": { - "libraryClient": "ConversationProfilesClient", - "rpcs": { - "CreateConversationProfile": { - "methods": [ + "ConversationProfiles": { + "clients": { + "grpc": { + "libraryClient": "ConversationProfilesClient", + "rpcs": { + "CreateConversationProfile": { + "methods": [ "CreateConversationProfile" ] }, - "DeleteConversationProfile": { - "methods": [ + "DeleteConversationProfile": { + "methods": [ "DeleteConversationProfile" ] }, - "GetConversationProfile": { - "methods": [ + "GetConversationProfile": { + "methods": [ "GetConversationProfile" ] }, - "ListConversationProfiles": { - "methods": [ + "ListConversationProfiles": { + "methods": [ "ListConversationProfiles" ] }, - "UpdateConversationProfile": { - "methods": [ + "UpdateConversationProfile": { + "methods": [ "UpdateConversationProfile" ] } @@ -151,33 +151,33 @@ } } }, - "Conversations": { - "clients": { - "grpc": { - "libraryClient": "ConversationsClient", - "rpcs": { - "CompleteConversation": { - "methods": [ + "Conversations": { + "clients": { + "grpc": { + "libraryClient": "ConversationsClient", + "rpcs": { + "CompleteConversation": { + "methods": [ "CompleteConversation" ] }, - "CreateConversation": { - "methods": [ + "CreateConversation": { + "methods": [ "CreateConversation" ] }, - "GetConversation": { - "methods": [ + "GetConversation": { + "methods": [ "GetConversation" ] }, - "ListConversations": { - "methods": [ + "ListConversations": { + "methods": [ "ListConversations" ] }, - "ListMessages": { - "methods": [ + "ListMessages": { + "methods": [ "ListMessages" ] } @@ -185,38 +185,38 @@ } } }, - "Documents": { - "clients": { - "grpc": { - "libraryClient": "DocumentsClient", - "rpcs": { - "CreateDocument": { - "methods": [ + "Documents": { + "clients": { + "grpc": { + "libraryClient": "DocumentsClient", + "rpcs": { + "CreateDocument": { + "methods": [ "CreateDocument" ] }, - "DeleteDocument": { - "methods": [ + "DeleteDocument": { + "methods": [ "DeleteDocument" ] }, - "GetDocument": { - "methods": [ + "GetDocument": { + "methods": [ "GetDocument" ] }, - "ListDocuments": { - "methods": [ + "ListDocuments": { + "methods": [ "ListDocuments" ] }, - "ReloadDocument": { - "methods": [ + "ReloadDocument": { + "methods": [ "ReloadDocument" ] }, - "UpdateDocument": { - "methods": [ + "UpdateDocument": { + "methods": [ "UpdateDocument" ] } @@ -224,58 +224,58 @@ } } }, - "EntityTypes": { - "clients": { - "grpc": { - "libraryClient": "EntityTypesClient", - "rpcs": { - "BatchCreateEntities": { - "methods": [ + "EntityTypes": { + "clients": { + "grpc": { + "libraryClient": "EntityTypesClient", + "rpcs": { + "BatchCreateEntities": { + "methods": [ "BatchCreateEntities" ] }, - "BatchDeleteEntities": { - "methods": [ + "BatchDeleteEntities": { + "methods": [ "BatchDeleteEntities" ] }, - "BatchDeleteEntityTypes": { - "methods": [ + "BatchDeleteEntityTypes": { + "methods": [ "BatchDeleteEntityTypes" ] }, - "BatchUpdateEntities": { - "methods": [ + "BatchUpdateEntities": { + "methods": [ "BatchUpdateEntities" ] }, - "BatchUpdateEntityTypes": { - "methods": [ + "BatchUpdateEntityTypes": { + "methods": [ "BatchUpdateEntityTypes" ] }, - "CreateEntityType": { - "methods": [ + "CreateEntityType": { + "methods": [ "CreateEntityType" ] }, - "DeleteEntityType": { - "methods": [ + "DeleteEntityType": { + "methods": [ "DeleteEntityType" ] }, - "GetEntityType": { - "methods": [ + "GetEntityType": { + "methods": [ "GetEntityType" ] }, - "ListEntityTypes": { - "methods": [ + "ListEntityTypes": { + "methods": [ "ListEntityTypes" ] }, - "UpdateEntityType": { - "methods": [ + "UpdateEntityType": { + "methods": [ "UpdateEntityType" ] } @@ -283,38 +283,38 @@ } } }, - "Environments": { - "clients": { - "grpc": { - "libraryClient": "EnvironmentsClient", - "rpcs": { - "CreateEnvironment": { - "methods": [ + "Environments": { + "clients": { + "grpc": { + "libraryClient": "EnvironmentsClient", + "rpcs": { + "CreateEnvironment": { + "methods": [ "CreateEnvironment" ] }, - "DeleteEnvironment": { - "methods": [ + "DeleteEnvironment": { + "methods": [ "DeleteEnvironment" ] }, - "GetEnvironment": { - "methods": [ + "GetEnvironment": { + "methods": [ "GetEnvironment" ] }, - "GetEnvironmentHistory": { - "methods": [ + "GetEnvironmentHistory": { + "methods": [ "GetEnvironmentHistory" ] }, - "ListEnvironments": { - "methods": [ + "ListEnvironments": { + "methods": [ "ListEnvironments" ] }, - "UpdateEnvironment": { - "methods": [ + "UpdateEnvironment": { + "methods": [ "UpdateEnvironment" ] } @@ -322,18 +322,18 @@ } } }, - "Fulfillments": { - "clients": { - "grpc": { - "libraryClient": "FulfillmentsClient", - "rpcs": { - "GetFulfillment": { - "methods": [ + "Fulfillments": { + "clients": { + "grpc": { + "libraryClient": "FulfillmentsClient", + "rpcs": { + "GetFulfillment": { + "methods": [ "GetFulfillment" ] }, - "UpdateFulfillment": { - "methods": [ + "UpdateFulfillment": { + "methods": [ "UpdateFulfillment" ] } @@ -341,43 +341,43 @@ } } }, - "Intents": { - "clients": { - "grpc": { - "libraryClient": "IntentsClient", - "rpcs": { - "BatchDeleteIntents": { - "methods": [ + "Intents": { + "clients": { + "grpc": { + "libraryClient": "IntentsClient", + "rpcs": { + "BatchDeleteIntents": { + "methods": [ "BatchDeleteIntents" ] }, - "BatchUpdateIntents": { - "methods": [ + "BatchUpdateIntents": { + "methods": [ "BatchUpdateIntents" ] }, - "CreateIntent": { - "methods": [ + "CreateIntent": { + "methods": [ "CreateIntent" ] }, - "DeleteIntent": { - "methods": [ + "DeleteIntent": { + "methods": [ "DeleteIntent" ] }, - "GetIntent": { - "methods": [ + "GetIntent": { + "methods": [ "GetIntent" ] }, - "ListIntents": { - "methods": [ + "ListIntents": { + "methods": [ "ListIntents" ] }, - "UpdateIntent": { - "methods": [ + "UpdateIntent": { + "methods": [ "UpdateIntent" ] } @@ -385,33 +385,33 @@ } } }, - "KnowledgeBases": { - "clients": { - "grpc": { - "libraryClient": "KnowledgeBasesClient", - "rpcs": { - "CreateKnowledgeBase": { - "methods": [ + "KnowledgeBases": { + "clients": { + "grpc": { + "libraryClient": "KnowledgeBasesClient", + "rpcs": { + "CreateKnowledgeBase": { + "methods": [ "CreateKnowledgeBase" ] }, - "DeleteKnowledgeBase": { - "methods": [ + "DeleteKnowledgeBase": { + "methods": [ "DeleteKnowledgeBase" ] }, - "GetKnowledgeBase": { - "methods": [ + "GetKnowledgeBase": { + "methods": [ "GetKnowledgeBase" ] }, - "ListKnowledgeBases": { - "methods": [ + "ListKnowledgeBases": { + "methods": [ "ListKnowledgeBases" ] }, - "UpdateKnowledgeBase": { - "methods": [ + "UpdateKnowledgeBase": { + "methods": [ "UpdateKnowledgeBase" ] } @@ -419,43 +419,43 @@ } } }, - "Participants": { - "clients": { - "grpc": { - "libraryClient": "ParticipantsClient", - "rpcs": { - "AnalyzeContent": { - "methods": [ + "Participants": { + "clients": { + "grpc": { + "libraryClient": "ParticipantsClient", + "rpcs": { + "AnalyzeContent": { + "methods": [ "AnalyzeContent" ] }, - "CreateParticipant": { - "methods": [ + "CreateParticipant": { + "methods": [ "CreateParticipant" ] }, - "GetParticipant": { - "methods": [ + "GetParticipant": { + "methods": [ "GetParticipant" ] }, - "ListParticipants": { - "methods": [ + "ListParticipants": { + "methods": [ "ListParticipants" ] }, - "SuggestArticles": { - "methods": [ + "SuggestArticles": { + "methods": [ "SuggestArticles" ] }, - "SuggestFaqAnswers": { - "methods": [ + "SuggestFaqAnswers": { + "methods": [ "SuggestFaqAnswers" ] }, - "UpdateParticipant": { - "methods": [ + "UpdateParticipant": { + "methods": [ "UpdateParticipant" ] } @@ -463,33 +463,33 @@ } } }, - "SessionEntityTypes": { - "clients": { - "grpc": { - "libraryClient": "SessionEntityTypesClient", - "rpcs": { - "CreateSessionEntityType": { - "methods": [ + "SessionEntityTypes": { + "clients": { + "grpc": { + "libraryClient": "SessionEntityTypesClient", + "rpcs": { + "CreateSessionEntityType": { + "methods": [ "CreateSessionEntityType" ] }, - "DeleteSessionEntityType": { - "methods": [ + "DeleteSessionEntityType": { + "methods": [ "DeleteSessionEntityType" ] }, - "GetSessionEntityType": { - "methods": [ + "GetSessionEntityType": { + "methods": [ "GetSessionEntityType" ] }, - "ListSessionEntityTypes": { - "methods": [ + "ListSessionEntityTypes": { + "methods": [ "ListSessionEntityTypes" ] }, - "UpdateSessionEntityType": { - "methods": [ + "UpdateSessionEntityType": { + "methods": [ "UpdateSessionEntityType" ] } @@ -497,18 +497,18 @@ } } }, - "Sessions": { - "clients": { - "grpc": { - "libraryClient": "SessionsClient", - "rpcs": { - "DetectIntent": { - "methods": [ + "Sessions": { + "clients": { + "grpc": { + "libraryClient": "SessionsClient", + "rpcs": { + "DetectIntent": { + "methods": [ "DetectIntent" ] }, - "StreamingDetectIntent": { - "methods": [ + "StreamingDetectIntent": { + "methods": [ "StreamingDetectIntent" ] } @@ -516,33 +516,33 @@ } } }, - "Versions": { - "clients": { - "grpc": { - "libraryClient": "VersionsClient", - "rpcs": { - "CreateVersion": { - "methods": [ + "Versions": { + "clients": { + "grpc": { + "libraryClient": "VersionsClient", + "rpcs": { + "CreateVersion": { + "methods": [ "CreateVersion" ] }, - "DeleteVersion": { - "methods": [ + "DeleteVersion": { + "methods": [ "DeleteVersion" ] }, - "GetVersion": { - "methods": [ + "GetVersion": { + "methods": [ "GetVersion" ] }, - "ListVersions": { - "methods": [ + "ListVersions": { + "methods": [ "ListVersions" ] }, - "UpdateVersion": { - "methods": [ + "UpdateVersion": { + "methods": [ "UpdateVersion" ] } diff --git a/dialogflow/cx/apiv3/doc.go b/dialogflow/cx/apiv3/doc.go index 731cf46746e..9b11084fd7f 100644 --- a/dialogflow/cx/apiv3/doc.go +++ b/dialogflow/cx/apiv3/doc.go @@ -49,7 +49,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210630" +const versionClient = "20210701" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/dialogflow/cx/apiv3/gapic_metadata.json b/dialogflow/cx/apiv3/gapic_metadata.json index c90368d52f5..409bc550939 100644 --- a/dialogflow/cx/apiv3/gapic_metadata.json +++ b/dialogflow/cx/apiv3/gapic_metadata.json @@ -1,57 +1,57 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.dialogflow.cx.v3", - "libraryPackage": "cloud.google.com/go/dialogflow/cx/apiv3", - "services": { - "Agents": { - "clients": { - "grpc": { - "libraryClient": "AgentsClient", - "rpcs": { - "CreateAgent": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.dialogflow.cx.v3", + "libraryPackage": "cloud.google.com/go/dialogflow/cx/apiv3", + "services": { + "Agents": { + "clients": { + "grpc": { + "libraryClient": "AgentsClient", + "rpcs": { + "CreateAgent": { + "methods": [ "CreateAgent" ] }, - "DeleteAgent": { - "methods": [ + "DeleteAgent": { + "methods": [ "DeleteAgent" ] }, - "ExportAgent": { - "methods": [ + "ExportAgent": { + "methods": [ "ExportAgent" ] }, - "GetAgent": { - "methods": [ + "GetAgent": { + "methods": [ "GetAgent" ] }, - "GetAgentValidationResult": { - "methods": [ + "GetAgentValidationResult": { + "methods": [ "GetAgentValidationResult" ] }, - "ListAgents": { - "methods": [ + "ListAgents": { + "methods": [ "ListAgents" ] }, - "RestoreAgent": { - "methods": [ + "RestoreAgent": { + "methods": [ "RestoreAgent" ] }, - "UpdateAgent": { - "methods": [ + "UpdateAgent": { + "methods": [ "UpdateAgent" ] }, - "ValidateAgent": { - "methods": [ + "ValidateAgent": { + "methods": [ "ValidateAgent" ] } @@ -59,33 +59,33 @@ } } }, - "EntityTypes": { - "clients": { - "grpc": { - "libraryClient": "EntityTypesClient", - "rpcs": { - "CreateEntityType": { - "methods": [ + "EntityTypes": { + "clients": { + "grpc": { + "libraryClient": "EntityTypesClient", + "rpcs": { + "CreateEntityType": { + "methods": [ "CreateEntityType" ] }, - "DeleteEntityType": { - "methods": [ + "DeleteEntityType": { + "methods": [ "DeleteEntityType" ] }, - "GetEntityType": { - "methods": [ + "GetEntityType": { + "methods": [ "GetEntityType" ] }, - "ListEntityTypes": { - "methods": [ + "ListEntityTypes": { + "methods": [ "ListEntityTypes" ] }, - "UpdateEntityType": { - "methods": [ + "UpdateEntityType": { + "methods": [ "UpdateEntityType" ] } @@ -93,48 +93,48 @@ } } }, - "Environments": { - "clients": { - "grpc": { - "libraryClient": "EnvironmentsClient", - "rpcs": { - "CreateEnvironment": { - "methods": [ + "Environments": { + "clients": { + "grpc": { + "libraryClient": "EnvironmentsClient", + "rpcs": { + "CreateEnvironment": { + "methods": [ "CreateEnvironment" ] }, - "DeleteEnvironment": { - "methods": [ + "DeleteEnvironment": { + "methods": [ "DeleteEnvironment" ] }, - "GetEnvironment": { - "methods": [ + "GetEnvironment": { + "methods": [ "GetEnvironment" ] }, - "ListContinuousTestResults": { - "methods": [ + "ListContinuousTestResults": { + "methods": [ "ListContinuousTestResults" ] }, - "ListEnvironments": { - "methods": [ + "ListEnvironments": { + "methods": [ "ListEnvironments" ] }, - "LookupEnvironmentHistory": { - "methods": [ + "LookupEnvironmentHistory": { + "methods": [ "LookupEnvironmentHistory" ] }, - "RunContinuousTest": { - "methods": [ + "RunContinuousTest": { + "methods": [ "RunContinuousTest" ] }, - "UpdateEnvironment": { - "methods": [ + "UpdateEnvironment": { + "methods": [ "UpdateEnvironment" ] } @@ -142,43 +142,43 @@ } } }, - "Experiments": { - "clients": { - "grpc": { - "libraryClient": "ExperimentsClient", - "rpcs": { - "CreateExperiment": { - "methods": [ + "Experiments": { + "clients": { + "grpc": { + "libraryClient": "ExperimentsClient", + "rpcs": { + "CreateExperiment": { + "methods": [ "CreateExperiment" ] }, - "DeleteExperiment": { - "methods": [ + "DeleteExperiment": { + "methods": [ "DeleteExperiment" ] }, - "GetExperiment": { - "methods": [ + "GetExperiment": { + "methods": [ "GetExperiment" ] }, - "ListExperiments": { - "methods": [ + "ListExperiments": { + "methods": [ "ListExperiments" ] }, - "StartExperiment": { - "methods": [ + "StartExperiment": { + "methods": [ "StartExperiment" ] }, - "StopExperiment": { - "methods": [ + "StopExperiment": { + "methods": [ "StopExperiment" ] }, - "UpdateExperiment": { - "methods": [ + "UpdateExperiment": { + "methods": [ "UpdateExperiment" ] } @@ -186,58 +186,58 @@ } } }, - "Flows": { - "clients": { - "grpc": { - "libraryClient": "FlowsClient", - "rpcs": { - "CreateFlow": { - "methods": [ + "Flows": { + "clients": { + "grpc": { + "libraryClient": "FlowsClient", + "rpcs": { + "CreateFlow": { + "methods": [ "CreateFlow" ] }, - "DeleteFlow": { - "methods": [ + "DeleteFlow": { + "methods": [ "DeleteFlow" ] }, - "ExportFlow": { - "methods": [ + "ExportFlow": { + "methods": [ "ExportFlow" ] }, - "GetFlow": { - "methods": [ + "GetFlow": { + "methods": [ "GetFlow" ] }, - "GetFlowValidationResult": { - "methods": [ + "GetFlowValidationResult": { + "methods": [ "GetFlowValidationResult" ] }, - "ImportFlow": { - "methods": [ + "ImportFlow": { + "methods": [ "ImportFlow" ] }, - "ListFlows": { - "methods": [ + "ListFlows": { + "methods": [ "ListFlows" ] }, - "TrainFlow": { - "methods": [ + "TrainFlow": { + "methods": [ "TrainFlow" ] }, - "UpdateFlow": { - "methods": [ + "UpdateFlow": { + "methods": [ "UpdateFlow" ] }, - "ValidateFlow": { - "methods": [ + "ValidateFlow": { + "methods": [ "ValidateFlow" ] } @@ -245,33 +245,33 @@ } } }, - "Intents": { - "clients": { - "grpc": { - "libraryClient": "IntentsClient", - "rpcs": { - "CreateIntent": { - "methods": [ + "Intents": { + "clients": { + "grpc": { + "libraryClient": "IntentsClient", + "rpcs": { + "CreateIntent": { + "methods": [ "CreateIntent" ] }, - "DeleteIntent": { - "methods": [ + "DeleteIntent": { + "methods": [ "DeleteIntent" ] }, - "GetIntent": { - "methods": [ + "GetIntent": { + "methods": [ "GetIntent" ] }, - "ListIntents": { - "methods": [ + "ListIntents": { + "methods": [ "ListIntents" ] }, - "UpdateIntent": { - "methods": [ + "UpdateIntent": { + "methods": [ "UpdateIntent" ] } @@ -279,33 +279,33 @@ } } }, - "Pages": { - "clients": { - "grpc": { - "libraryClient": "PagesClient", - "rpcs": { - "CreatePage": { - "methods": [ + "Pages": { + "clients": { + "grpc": { + "libraryClient": "PagesClient", + "rpcs": { + "CreatePage": { + "methods": [ "CreatePage" ] }, - "DeletePage": { - "methods": [ + "DeletePage": { + "methods": [ "DeletePage" ] }, - "GetPage": { - "methods": [ + "GetPage": { + "methods": [ "GetPage" ] }, - "ListPages": { - "methods": [ + "ListPages": { + "methods": [ "ListPages" ] }, - "UpdatePage": { - "methods": [ + "UpdatePage": { + "methods": [ "UpdatePage" ] } @@ -313,33 +313,33 @@ } } }, - "SecuritySettingsService": { - "clients": { - "grpc": { - "libraryClient": "SecuritySettingsClient", - "rpcs": { - "CreateSecuritySettings": { - "methods": [ + "SecuritySettingsService": { + "clients": { + "grpc": { + "libraryClient": "SecuritySettingsClient", + "rpcs": { + "CreateSecuritySettings": { + "methods": [ "CreateSecuritySettings" ] }, - "DeleteSecuritySettings": { - "methods": [ + "DeleteSecuritySettings": { + "methods": [ "DeleteSecuritySettings" ] }, - "GetSecuritySettings": { - "methods": [ + "GetSecuritySettings": { + "methods": [ "GetSecuritySettings" ] }, - "ListSecuritySettings": { - "methods": [ + "ListSecuritySettings": { + "methods": [ "ListSecuritySettings" ] }, - "UpdateSecuritySettings": { - "methods": [ + "UpdateSecuritySettings": { + "methods": [ "UpdateSecuritySettings" ] } @@ -347,33 +347,33 @@ } } }, - "SessionEntityTypes": { - "clients": { - "grpc": { - "libraryClient": "SessionEntityTypesClient", - "rpcs": { - "CreateSessionEntityType": { - "methods": [ + "SessionEntityTypes": { + "clients": { + "grpc": { + "libraryClient": "SessionEntityTypesClient", + "rpcs": { + "CreateSessionEntityType": { + "methods": [ "CreateSessionEntityType" ] }, - "DeleteSessionEntityType": { - "methods": [ + "DeleteSessionEntityType": { + "methods": [ "DeleteSessionEntityType" ] }, - "GetSessionEntityType": { - "methods": [ + "GetSessionEntityType": { + "methods": [ "GetSessionEntityType" ] }, - "ListSessionEntityTypes": { - "methods": [ + "ListSessionEntityTypes": { + "methods": [ "ListSessionEntityTypes" ] }, - "UpdateSessionEntityType": { - "methods": [ + "UpdateSessionEntityType": { + "methods": [ "UpdateSessionEntityType" ] } @@ -381,28 +381,28 @@ } } }, - "Sessions": { - "clients": { - "grpc": { - "libraryClient": "SessionsClient", - "rpcs": { - "DetectIntent": { - "methods": [ + "Sessions": { + "clients": { + "grpc": { + "libraryClient": "SessionsClient", + "rpcs": { + "DetectIntent": { + "methods": [ "DetectIntent" ] }, - "FulfillIntent": { - "methods": [ + "FulfillIntent": { + "methods": [ "FulfillIntent" ] }, - "MatchIntent": { - "methods": [ + "MatchIntent": { + "methods": [ "MatchIntent" ] }, - "StreamingDetectIntent": { - "methods": [ + "StreamingDetectIntent": { + "methods": [ "StreamingDetectIntent" ] } @@ -410,68 +410,68 @@ } } }, - "TestCases": { - "clients": { - "grpc": { - "libraryClient": "TestCasesClient", - "rpcs": { - "BatchDeleteTestCases": { - "methods": [ + "TestCases": { + "clients": { + "grpc": { + "libraryClient": "TestCasesClient", + "rpcs": { + "BatchDeleteTestCases": { + "methods": [ "BatchDeleteTestCases" ] }, - "BatchRunTestCases": { - "methods": [ + "BatchRunTestCases": { + "methods": [ "BatchRunTestCases" ] }, - "CalculateCoverage": { - "methods": [ + "CalculateCoverage": { + "methods": [ "CalculateCoverage" ] }, - "CreateTestCase": { - "methods": [ + "CreateTestCase": { + "methods": [ "CreateTestCase" ] }, - "ExportTestCases": { - "methods": [ + "ExportTestCases": { + "methods": [ "ExportTestCases" ] }, - "GetTestCase": { - "methods": [ + "GetTestCase": { + "methods": [ "GetTestCase" ] }, - "GetTestCaseResult": { - "methods": [ + "GetTestCaseResult": { + "methods": [ "GetTestCaseResult" ] }, - "ImportTestCases": { - "methods": [ + "ImportTestCases": { + "methods": [ "ImportTestCases" ] }, - "ListTestCaseResults": { - "methods": [ + "ListTestCaseResults": { + "methods": [ "ListTestCaseResults" ] }, - "ListTestCases": { - "methods": [ + "ListTestCases": { + "methods": [ "ListTestCases" ] }, - "RunTestCase": { - "methods": [ + "RunTestCase": { + "methods": [ "RunTestCase" ] }, - "UpdateTestCase": { - "methods": [ + "UpdateTestCase": { + "methods": [ "UpdateTestCase" ] } @@ -479,33 +479,33 @@ } } }, - "TransitionRouteGroups": { - "clients": { - "grpc": { - "libraryClient": "TransitionRouteGroupsClient", - "rpcs": { - "CreateTransitionRouteGroup": { - "methods": [ + "TransitionRouteGroups": { + "clients": { + "grpc": { + "libraryClient": "TransitionRouteGroupsClient", + "rpcs": { + "CreateTransitionRouteGroup": { + "methods": [ "CreateTransitionRouteGroup" ] }, - "DeleteTransitionRouteGroup": { - "methods": [ + "DeleteTransitionRouteGroup": { + "methods": [ "DeleteTransitionRouteGroup" ] }, - "GetTransitionRouteGroup": { - "methods": [ + "GetTransitionRouteGroup": { + "methods": [ "GetTransitionRouteGroup" ] }, - "ListTransitionRouteGroups": { - "methods": [ + "ListTransitionRouteGroups": { + "methods": [ "ListTransitionRouteGroups" ] }, - "UpdateTransitionRouteGroup": { - "methods": [ + "UpdateTransitionRouteGroup": { + "methods": [ "UpdateTransitionRouteGroup" ] } @@ -513,38 +513,38 @@ } } }, - "Versions": { - "clients": { - "grpc": { - "libraryClient": "VersionsClient", - "rpcs": { - "CreateVersion": { - "methods": [ + "Versions": { + "clients": { + "grpc": { + "libraryClient": "VersionsClient", + "rpcs": { + "CreateVersion": { + "methods": [ "CreateVersion" ] }, - "DeleteVersion": { - "methods": [ + "DeleteVersion": { + "methods": [ "DeleteVersion" ] }, - "GetVersion": { - "methods": [ + "GetVersion": { + "methods": [ "GetVersion" ] }, - "ListVersions": { - "methods": [ + "ListVersions": { + "methods": [ "ListVersions" ] }, - "LoadVersion": { - "methods": [ + "LoadVersion": { + "methods": [ "LoadVersion" ] }, - "UpdateVersion": { - "methods": [ + "UpdateVersion": { + "methods": [ "UpdateVersion" ] } @@ -552,33 +552,33 @@ } } }, - "Webhooks": { - "clients": { - "grpc": { - "libraryClient": "WebhooksClient", - "rpcs": { - "CreateWebhook": { - "methods": [ + "Webhooks": { + "clients": { + "grpc": { + "libraryClient": "WebhooksClient", + "rpcs": { + "CreateWebhook": { + "methods": [ "CreateWebhook" ] }, - "DeleteWebhook": { - "methods": [ + "DeleteWebhook": { + "methods": [ "DeleteWebhook" ] }, - "GetWebhook": { - "methods": [ + "GetWebhook": { + "methods": [ "GetWebhook" ] }, - "ListWebhooks": { - "methods": [ + "ListWebhooks": { + "methods": [ "ListWebhooks" ] }, - "UpdateWebhook": { - "methods": [ + "UpdateWebhook": { + "methods": [ "UpdateWebhook" ] } diff --git a/dialogflow/cx/apiv3beta1/doc.go b/dialogflow/cx/apiv3beta1/doc.go index 4f5d8532759..1c2c2e8e25f 100644 --- a/dialogflow/cx/apiv3beta1/doc.go +++ b/dialogflow/cx/apiv3beta1/doc.go @@ -51,7 +51,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210630" +const versionClient = "20210701" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/dialogflow/cx/apiv3beta1/gapic_metadata.json b/dialogflow/cx/apiv3beta1/gapic_metadata.json index bf463ce0246..3f3dd0e6516 100644 --- a/dialogflow/cx/apiv3beta1/gapic_metadata.json +++ b/dialogflow/cx/apiv3beta1/gapic_metadata.json @@ -1,57 +1,57 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.dialogflow.cx.v3beta1", - "libraryPackage": "cloud.google.com/go/dialogflow/cx/apiv3beta1", - "services": { - "Agents": { - "clients": { - "grpc": { - "libraryClient": "AgentsClient", - "rpcs": { - "CreateAgent": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.dialogflow.cx.v3beta1", + "libraryPackage": "cloud.google.com/go/dialogflow/cx/apiv3beta1", + "services": { + "Agents": { + "clients": { + "grpc": { + "libraryClient": "AgentsClient", + "rpcs": { + "CreateAgent": { + "methods": [ "CreateAgent" ] }, - "DeleteAgent": { - "methods": [ + "DeleteAgent": { + "methods": [ "DeleteAgent" ] }, - "ExportAgent": { - "methods": [ + "ExportAgent": { + "methods": [ "ExportAgent" ] }, - "GetAgent": { - "methods": [ + "GetAgent": { + "methods": [ "GetAgent" ] }, - "GetAgentValidationResult": { - "methods": [ + "GetAgentValidationResult": { + "methods": [ "GetAgentValidationResult" ] }, - "ListAgents": { - "methods": [ + "ListAgents": { + "methods": [ "ListAgents" ] }, - "RestoreAgent": { - "methods": [ + "RestoreAgent": { + "methods": [ "RestoreAgent" ] }, - "UpdateAgent": { - "methods": [ + "UpdateAgent": { + "methods": [ "UpdateAgent" ] }, - "ValidateAgent": { - "methods": [ + "ValidateAgent": { + "methods": [ "ValidateAgent" ] } @@ -59,33 +59,33 @@ } } }, - "EntityTypes": { - "clients": { - "grpc": { - "libraryClient": "EntityTypesClient", - "rpcs": { - "CreateEntityType": { - "methods": [ + "EntityTypes": { + "clients": { + "grpc": { + "libraryClient": "EntityTypesClient", + "rpcs": { + "CreateEntityType": { + "methods": [ "CreateEntityType" ] }, - "DeleteEntityType": { - "methods": [ + "DeleteEntityType": { + "methods": [ "DeleteEntityType" ] }, - "GetEntityType": { - "methods": [ + "GetEntityType": { + "methods": [ "GetEntityType" ] }, - "ListEntityTypes": { - "methods": [ + "ListEntityTypes": { + "methods": [ "ListEntityTypes" ] }, - "UpdateEntityType": { - "methods": [ + "UpdateEntityType": { + "methods": [ "UpdateEntityType" ] } @@ -93,48 +93,48 @@ } } }, - "Environments": { - "clients": { - "grpc": { - "libraryClient": "EnvironmentsClient", - "rpcs": { - "CreateEnvironment": { - "methods": [ + "Environments": { + "clients": { + "grpc": { + "libraryClient": "EnvironmentsClient", + "rpcs": { + "CreateEnvironment": { + "methods": [ "CreateEnvironment" ] }, - "DeleteEnvironment": { - "methods": [ + "DeleteEnvironment": { + "methods": [ "DeleteEnvironment" ] }, - "GetEnvironment": { - "methods": [ + "GetEnvironment": { + "methods": [ "GetEnvironment" ] }, - "ListContinuousTestResults": { - "methods": [ + "ListContinuousTestResults": { + "methods": [ "ListContinuousTestResults" ] }, - "ListEnvironments": { - "methods": [ + "ListEnvironments": { + "methods": [ "ListEnvironments" ] }, - "LookupEnvironmentHistory": { - "methods": [ + "LookupEnvironmentHistory": { + "methods": [ "LookupEnvironmentHistory" ] }, - "RunContinuousTest": { - "methods": [ + "RunContinuousTest": { + "methods": [ "RunContinuousTest" ] }, - "UpdateEnvironment": { - "methods": [ + "UpdateEnvironment": { + "methods": [ "UpdateEnvironment" ] } @@ -142,43 +142,43 @@ } } }, - "Experiments": { - "clients": { - "grpc": { - "libraryClient": "ExperimentsClient", - "rpcs": { - "CreateExperiment": { - "methods": [ + "Experiments": { + "clients": { + "grpc": { + "libraryClient": "ExperimentsClient", + "rpcs": { + "CreateExperiment": { + "methods": [ "CreateExperiment" ] }, - "DeleteExperiment": { - "methods": [ + "DeleteExperiment": { + "methods": [ "DeleteExperiment" ] }, - "GetExperiment": { - "methods": [ + "GetExperiment": { + "methods": [ "GetExperiment" ] }, - "ListExperiments": { - "methods": [ + "ListExperiments": { + "methods": [ "ListExperiments" ] }, - "StartExperiment": { - "methods": [ + "StartExperiment": { + "methods": [ "StartExperiment" ] }, - "StopExperiment": { - "methods": [ + "StopExperiment": { + "methods": [ "StopExperiment" ] }, - "UpdateExperiment": { - "methods": [ + "UpdateExperiment": { + "methods": [ "UpdateExperiment" ] } @@ -186,58 +186,58 @@ } } }, - "Flows": { - "clients": { - "grpc": { - "libraryClient": "FlowsClient", - "rpcs": { - "CreateFlow": { - "methods": [ + "Flows": { + "clients": { + "grpc": { + "libraryClient": "FlowsClient", + "rpcs": { + "CreateFlow": { + "methods": [ "CreateFlow" ] }, - "DeleteFlow": { - "methods": [ + "DeleteFlow": { + "methods": [ "DeleteFlow" ] }, - "ExportFlow": { - "methods": [ + "ExportFlow": { + "methods": [ "ExportFlow" ] }, - "GetFlow": { - "methods": [ + "GetFlow": { + "methods": [ "GetFlow" ] }, - "GetFlowValidationResult": { - "methods": [ + "GetFlowValidationResult": { + "methods": [ "GetFlowValidationResult" ] }, - "ImportFlow": { - "methods": [ + "ImportFlow": { + "methods": [ "ImportFlow" ] }, - "ListFlows": { - "methods": [ + "ListFlows": { + "methods": [ "ListFlows" ] }, - "TrainFlow": { - "methods": [ + "TrainFlow": { + "methods": [ "TrainFlow" ] }, - "UpdateFlow": { - "methods": [ + "UpdateFlow": { + "methods": [ "UpdateFlow" ] }, - "ValidateFlow": { - "methods": [ + "ValidateFlow": { + "methods": [ "ValidateFlow" ] } @@ -245,33 +245,33 @@ } } }, - "Intents": { - "clients": { - "grpc": { - "libraryClient": "IntentsClient", - "rpcs": { - "CreateIntent": { - "methods": [ + "Intents": { + "clients": { + "grpc": { + "libraryClient": "IntentsClient", + "rpcs": { + "CreateIntent": { + "methods": [ "CreateIntent" ] }, - "DeleteIntent": { - "methods": [ + "DeleteIntent": { + "methods": [ "DeleteIntent" ] }, - "GetIntent": { - "methods": [ + "GetIntent": { + "methods": [ "GetIntent" ] }, - "ListIntents": { - "methods": [ + "ListIntents": { + "methods": [ "ListIntents" ] }, - "UpdateIntent": { - "methods": [ + "UpdateIntent": { + "methods": [ "UpdateIntent" ] } @@ -279,33 +279,33 @@ } } }, - "Pages": { - "clients": { - "grpc": { - "libraryClient": "PagesClient", - "rpcs": { - "CreatePage": { - "methods": [ + "Pages": { + "clients": { + "grpc": { + "libraryClient": "PagesClient", + "rpcs": { + "CreatePage": { + "methods": [ "CreatePage" ] }, - "DeletePage": { - "methods": [ + "DeletePage": { + "methods": [ "DeletePage" ] }, - "GetPage": { - "methods": [ + "GetPage": { + "methods": [ "GetPage" ] }, - "ListPages": { - "methods": [ + "ListPages": { + "methods": [ "ListPages" ] }, - "UpdatePage": { - "methods": [ + "UpdatePage": { + "methods": [ "UpdatePage" ] } @@ -313,33 +313,33 @@ } } }, - "SecuritySettingsService": { - "clients": { - "grpc": { - "libraryClient": "SecuritySettingsClient", - "rpcs": { - "CreateSecuritySettings": { - "methods": [ + "SecuritySettingsService": { + "clients": { + "grpc": { + "libraryClient": "SecuritySettingsClient", + "rpcs": { + "CreateSecuritySettings": { + "methods": [ "CreateSecuritySettings" ] }, - "DeleteSecuritySettings": { - "methods": [ + "DeleteSecuritySettings": { + "methods": [ "DeleteSecuritySettings" ] }, - "GetSecuritySettings": { - "methods": [ + "GetSecuritySettings": { + "methods": [ "GetSecuritySettings" ] }, - "ListSecuritySettings": { - "methods": [ + "ListSecuritySettings": { + "methods": [ "ListSecuritySettings" ] }, - "UpdateSecuritySettings": { - "methods": [ + "UpdateSecuritySettings": { + "methods": [ "UpdateSecuritySettings" ] } @@ -347,33 +347,33 @@ } } }, - "SessionEntityTypes": { - "clients": { - "grpc": { - "libraryClient": "SessionEntityTypesClient", - "rpcs": { - "CreateSessionEntityType": { - "methods": [ + "SessionEntityTypes": { + "clients": { + "grpc": { + "libraryClient": "SessionEntityTypesClient", + "rpcs": { + "CreateSessionEntityType": { + "methods": [ "CreateSessionEntityType" ] }, - "DeleteSessionEntityType": { - "methods": [ + "DeleteSessionEntityType": { + "methods": [ "DeleteSessionEntityType" ] }, - "GetSessionEntityType": { - "methods": [ + "GetSessionEntityType": { + "methods": [ "GetSessionEntityType" ] }, - "ListSessionEntityTypes": { - "methods": [ + "ListSessionEntityTypes": { + "methods": [ "ListSessionEntityTypes" ] }, - "UpdateSessionEntityType": { - "methods": [ + "UpdateSessionEntityType": { + "methods": [ "UpdateSessionEntityType" ] } @@ -381,28 +381,28 @@ } } }, - "Sessions": { - "clients": { - "grpc": { - "libraryClient": "SessionsClient", - "rpcs": { - "DetectIntent": { - "methods": [ + "Sessions": { + "clients": { + "grpc": { + "libraryClient": "SessionsClient", + "rpcs": { + "DetectIntent": { + "methods": [ "DetectIntent" ] }, - "FulfillIntent": { - "methods": [ + "FulfillIntent": { + "methods": [ "FulfillIntent" ] }, - "MatchIntent": { - "methods": [ + "MatchIntent": { + "methods": [ "MatchIntent" ] }, - "StreamingDetectIntent": { - "methods": [ + "StreamingDetectIntent": { + "methods": [ "StreamingDetectIntent" ] } @@ -410,68 +410,68 @@ } } }, - "TestCases": { - "clients": { - "grpc": { - "libraryClient": "TestCasesClient", - "rpcs": { - "BatchDeleteTestCases": { - "methods": [ + "TestCases": { + "clients": { + "grpc": { + "libraryClient": "TestCasesClient", + "rpcs": { + "BatchDeleteTestCases": { + "methods": [ "BatchDeleteTestCases" ] }, - "BatchRunTestCases": { - "methods": [ + "BatchRunTestCases": { + "methods": [ "BatchRunTestCases" ] }, - "CalculateCoverage": { - "methods": [ + "CalculateCoverage": { + "methods": [ "CalculateCoverage" ] }, - "CreateTestCase": { - "methods": [ + "CreateTestCase": { + "methods": [ "CreateTestCase" ] }, - "ExportTestCases": { - "methods": [ + "ExportTestCases": { + "methods": [ "ExportTestCases" ] }, - "GetTestCase": { - "methods": [ + "GetTestCase": { + "methods": [ "GetTestCase" ] }, - "GetTestCaseResult": { - "methods": [ + "GetTestCaseResult": { + "methods": [ "GetTestCaseResult" ] }, - "ImportTestCases": { - "methods": [ + "ImportTestCases": { + "methods": [ "ImportTestCases" ] }, - "ListTestCaseResults": { - "methods": [ + "ListTestCaseResults": { + "methods": [ "ListTestCaseResults" ] }, - "ListTestCases": { - "methods": [ + "ListTestCases": { + "methods": [ "ListTestCases" ] }, - "RunTestCase": { - "methods": [ + "RunTestCase": { + "methods": [ "RunTestCase" ] }, - "UpdateTestCase": { - "methods": [ + "UpdateTestCase": { + "methods": [ "UpdateTestCase" ] } @@ -479,33 +479,33 @@ } } }, - "TransitionRouteGroups": { - "clients": { - "grpc": { - "libraryClient": "TransitionRouteGroupsClient", - "rpcs": { - "CreateTransitionRouteGroup": { - "methods": [ + "TransitionRouteGroups": { + "clients": { + "grpc": { + "libraryClient": "TransitionRouteGroupsClient", + "rpcs": { + "CreateTransitionRouteGroup": { + "methods": [ "CreateTransitionRouteGroup" ] }, - "DeleteTransitionRouteGroup": { - "methods": [ + "DeleteTransitionRouteGroup": { + "methods": [ "DeleteTransitionRouteGroup" ] }, - "GetTransitionRouteGroup": { - "methods": [ + "GetTransitionRouteGroup": { + "methods": [ "GetTransitionRouteGroup" ] }, - "ListTransitionRouteGroups": { - "methods": [ + "ListTransitionRouteGroups": { + "methods": [ "ListTransitionRouteGroups" ] }, - "UpdateTransitionRouteGroup": { - "methods": [ + "UpdateTransitionRouteGroup": { + "methods": [ "UpdateTransitionRouteGroup" ] } @@ -513,38 +513,38 @@ } } }, - "Versions": { - "clients": { - "grpc": { - "libraryClient": "VersionsClient", - "rpcs": { - "CreateVersion": { - "methods": [ + "Versions": { + "clients": { + "grpc": { + "libraryClient": "VersionsClient", + "rpcs": { + "CreateVersion": { + "methods": [ "CreateVersion" ] }, - "DeleteVersion": { - "methods": [ + "DeleteVersion": { + "methods": [ "DeleteVersion" ] }, - "GetVersion": { - "methods": [ + "GetVersion": { + "methods": [ "GetVersion" ] }, - "ListVersions": { - "methods": [ + "ListVersions": { + "methods": [ "ListVersions" ] }, - "LoadVersion": { - "methods": [ + "LoadVersion": { + "methods": [ "LoadVersion" ] }, - "UpdateVersion": { - "methods": [ + "UpdateVersion": { + "methods": [ "UpdateVersion" ] } @@ -552,33 +552,33 @@ } } }, - "Webhooks": { - "clients": { - "grpc": { - "libraryClient": "WebhooksClient", - "rpcs": { - "CreateWebhook": { - "methods": [ + "Webhooks": { + "clients": { + "grpc": { + "libraryClient": "WebhooksClient", + "rpcs": { + "CreateWebhook": { + "methods": [ "CreateWebhook" ] }, - "DeleteWebhook": { - "methods": [ + "DeleteWebhook": { + "methods": [ "DeleteWebhook" ] }, - "GetWebhook": { - "methods": [ + "GetWebhook": { + "methods": [ "GetWebhook" ] }, - "ListWebhooks": { - "methods": [ + "ListWebhooks": { + "methods": [ "ListWebhooks" ] }, - "UpdateWebhook": { - "methods": [ + "UpdateWebhook": { + "methods": [ "UpdateWebhook" ] } diff --git a/dlp/apiv2/doc.go b/dlp/apiv2/doc.go index ccd03828adf..78df191ef06 100644 --- a/dlp/apiv2/doc.go +++ b/dlp/apiv2/doc.go @@ -50,7 +50,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210630" +const versionClient = "20210701" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/dlp/apiv2/gapic_metadata.json b/dlp/apiv2/gapic_metadata.json index 9fac0297b7d..fa53d4da4be 100644 --- a/dlp/apiv2/gapic_metadata.json +++ b/dlp/apiv2/gapic_metadata.json @@ -1,182 +1,182 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.privacy.dlp.v2", - "libraryPackage": "cloud.google.com/go/dlp/apiv2", - "services": { - "DlpService": { - "clients": { - "grpc": { - "libraryClient": "Client", - "rpcs": { - "ActivateJobTrigger": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.privacy.dlp.v2", + "libraryPackage": "cloud.google.com/go/dlp/apiv2", + "services": { + "DlpService": { + "clients": { + "grpc": { + "libraryClient": "Client", + "rpcs": { + "ActivateJobTrigger": { + "methods": [ "ActivateJobTrigger" ] }, - "CancelDlpJob": { - "methods": [ + "CancelDlpJob": { + "methods": [ "CancelDlpJob" ] }, - "CreateDeidentifyTemplate": { - "methods": [ + "CreateDeidentifyTemplate": { + "methods": [ "CreateDeidentifyTemplate" ] }, - "CreateDlpJob": { - "methods": [ + "CreateDlpJob": { + "methods": [ "CreateDlpJob" ] }, - "CreateInspectTemplate": { - "methods": [ + "CreateInspectTemplate": { + "methods": [ "CreateInspectTemplate" ] }, - "CreateJobTrigger": { - "methods": [ + "CreateJobTrigger": { + "methods": [ "CreateJobTrigger" ] }, - "CreateStoredInfoType": { - "methods": [ + "CreateStoredInfoType": { + "methods": [ "CreateStoredInfoType" ] }, - "DeidentifyContent": { - "methods": [ + "DeidentifyContent": { + "methods": [ "DeidentifyContent" ] }, - "DeleteDeidentifyTemplate": { - "methods": [ + "DeleteDeidentifyTemplate": { + "methods": [ "DeleteDeidentifyTemplate" ] }, - "DeleteDlpJob": { - "methods": [ + "DeleteDlpJob": { + "methods": [ "DeleteDlpJob" ] }, - "DeleteInspectTemplate": { - "methods": [ + "DeleteInspectTemplate": { + "methods": [ "DeleteInspectTemplate" ] }, - "DeleteJobTrigger": { - "methods": [ + "DeleteJobTrigger": { + "methods": [ "DeleteJobTrigger" ] }, - "DeleteStoredInfoType": { - "methods": [ + "DeleteStoredInfoType": { + "methods": [ "DeleteStoredInfoType" ] }, - "FinishDlpJob": { - "methods": [ + "FinishDlpJob": { + "methods": [ "FinishDlpJob" ] }, - "GetDeidentifyTemplate": { - "methods": [ + "GetDeidentifyTemplate": { + "methods": [ "GetDeidentifyTemplate" ] }, - "GetDlpJob": { - "methods": [ + "GetDlpJob": { + "methods": [ "GetDlpJob" ] }, - "GetInspectTemplate": { - "methods": [ + "GetInspectTemplate": { + "methods": [ "GetInspectTemplate" ] }, - "GetJobTrigger": { - "methods": [ + "GetJobTrigger": { + "methods": [ "GetJobTrigger" ] }, - "GetStoredInfoType": { - "methods": [ + "GetStoredInfoType": { + "methods": [ "GetStoredInfoType" ] }, - "HybridInspectDlpJob": { - "methods": [ + "HybridInspectDlpJob": { + "methods": [ "HybridInspectDlpJob" ] }, - "HybridInspectJobTrigger": { - "methods": [ + "HybridInspectJobTrigger": { + "methods": [ "HybridInspectJobTrigger" ] }, - "InspectContent": { - "methods": [ + "InspectContent": { + "methods": [ "InspectContent" ] }, - "ListDeidentifyTemplates": { - "methods": [ + "ListDeidentifyTemplates": { + "methods": [ "ListDeidentifyTemplates" ] }, - "ListDlpJobs": { - "methods": [ + "ListDlpJobs": { + "methods": [ "ListDlpJobs" ] }, - "ListInfoTypes": { - "methods": [ + "ListInfoTypes": { + "methods": [ "ListInfoTypes" ] }, - "ListInspectTemplates": { - "methods": [ + "ListInspectTemplates": { + "methods": [ "ListInspectTemplates" ] }, - "ListJobTriggers": { - "methods": [ + "ListJobTriggers": { + "methods": [ "ListJobTriggers" ] }, - "ListStoredInfoTypes": { - "methods": [ + "ListStoredInfoTypes": { + "methods": [ "ListStoredInfoTypes" ] }, - "RedactImage": { - "methods": [ + "RedactImage": { + "methods": [ "RedactImage" ] }, - "ReidentifyContent": { - "methods": [ + "ReidentifyContent": { + "methods": [ "ReidentifyContent" ] }, - "UpdateDeidentifyTemplate": { - "methods": [ + "UpdateDeidentifyTemplate": { + "methods": [ "UpdateDeidentifyTemplate" ] }, - "UpdateInspectTemplate": { - "methods": [ + "UpdateInspectTemplate": { + "methods": [ "UpdateInspectTemplate" ] }, - "UpdateJobTrigger": { - "methods": [ + "UpdateJobTrigger": { + "methods": [ "UpdateJobTrigger" ] }, - "UpdateStoredInfoType": { - "methods": [ + "UpdateStoredInfoType": { + "methods": [ "UpdateStoredInfoType" ] } diff --git a/documentai/apiv1/doc.go b/documentai/apiv1/doc.go index 8e9c17eb985..1eee9f2a7d3 100644 --- a/documentai/apiv1/doc.go +++ b/documentai/apiv1/doc.go @@ -50,7 +50,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210630" +const versionClient = "20210701" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/documentai/apiv1/gapic_metadata.json b/documentai/apiv1/gapic_metadata.json index 766c5629f92..0e0f7bb5065 100644 --- a/documentai/apiv1/gapic_metadata.json +++ b/documentai/apiv1/gapic_metadata.json @@ -1,27 +1,27 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.documentai.v1", - "libraryPackage": "cloud.google.com/go/documentai/apiv1", - "services": { - "DocumentProcessorService": { - "clients": { - "grpc": { - "libraryClient": "DocumentProcessorClient", - "rpcs": { - "BatchProcessDocuments": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.documentai.v1", + "libraryPackage": "cloud.google.com/go/documentai/apiv1", + "services": { + "DocumentProcessorService": { + "clients": { + "grpc": { + "libraryClient": "DocumentProcessorClient", + "rpcs": { + "BatchProcessDocuments": { + "methods": [ "BatchProcessDocuments" ] }, - "ProcessDocument": { - "methods": [ + "ProcessDocument": { + "methods": [ "ProcessDocument" ] }, - "ReviewDocument": { - "methods": [ + "ReviewDocument": { + "methods": [ "ReviewDocument" ] } diff --git a/documentai/apiv1beta3/doc.go b/documentai/apiv1beta3/doc.go index 511ee4e9758..6db4adc466c 100644 --- a/documentai/apiv1beta3/doc.go +++ b/documentai/apiv1beta3/doc.go @@ -52,7 +52,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210630" +const versionClient = "20210701" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/documentai/apiv1beta3/gapic_metadata.json b/documentai/apiv1beta3/gapic_metadata.json index 9621d9c6b2d..d63304cab99 100644 --- a/documentai/apiv1beta3/gapic_metadata.json +++ b/documentai/apiv1beta3/gapic_metadata.json @@ -1,57 +1,57 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.documentai.v1beta3", - "libraryPackage": "cloud.google.com/go/documentai/apiv1beta3", - "services": { - "DocumentProcessorService": { - "clients": { - "grpc": { - "libraryClient": "DocumentProcessorClient", - "rpcs": { - "BatchProcessDocuments": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.documentai.v1beta3", + "libraryPackage": "cloud.google.com/go/documentai/apiv1beta3", + "services": { + "DocumentProcessorService": { + "clients": { + "grpc": { + "libraryClient": "DocumentProcessorClient", + "rpcs": { + "BatchProcessDocuments": { + "methods": [ "BatchProcessDocuments" ] }, - "CreateProcessor": { - "methods": [ + "CreateProcessor": { + "methods": [ "CreateProcessor" ] }, - "DeleteProcessor": { - "methods": [ + "DeleteProcessor": { + "methods": [ "DeleteProcessor" ] }, - "DisableProcessor": { - "methods": [ + "DisableProcessor": { + "methods": [ "DisableProcessor" ] }, - "EnableProcessor": { - "methods": [ + "EnableProcessor": { + "methods": [ "EnableProcessor" ] }, - "FetchProcessorTypes": { - "methods": [ + "FetchProcessorTypes": { + "methods": [ "FetchProcessorTypes" ] }, - "ListProcessors": { - "methods": [ + "ListProcessors": { + "methods": [ "ListProcessors" ] }, - "ProcessDocument": { - "methods": [ + "ProcessDocument": { + "methods": [ "ProcessDocument" ] }, - "ReviewDocument": { - "methods": [ + "ReviewDocument": { + "methods": [ "ReviewDocument" ] } diff --git a/domains/apiv1beta1/doc.go b/domains/apiv1beta1/doc.go index 1a4eaf1ce67..52c7b825a9e 100644 --- a/domains/apiv1beta1/doc.go +++ b/domains/apiv1beta1/doc.go @@ -50,7 +50,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210630" +const versionClient = "20210701" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/domains/apiv1beta1/gapic_metadata.json b/domains/apiv1beta1/gapic_metadata.json index 4bb45dc1a51..3055d077988 100644 --- a/domains/apiv1beta1/gapic_metadata.json +++ b/domains/apiv1beta1/gapic_metadata.json @@ -1,77 +1,77 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.domains.v1beta1", - "libraryPackage": "cloud.google.com/go/domains/apiv1beta1", - "services": { - "Domains": { - "clients": { - "grpc": { - "libraryClient": "Client", - "rpcs": { - "ConfigureContactSettings": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.domains.v1beta1", + "libraryPackage": "cloud.google.com/go/domains/apiv1beta1", + "services": { + "Domains": { + "clients": { + "grpc": { + "libraryClient": "Client", + "rpcs": { + "ConfigureContactSettings": { + "methods": [ "ConfigureContactSettings" ] }, - "ConfigureDnsSettings": { - "methods": [ + "ConfigureDnsSettings": { + "methods": [ "ConfigureDnsSettings" ] }, - "ConfigureManagementSettings": { - "methods": [ + "ConfigureManagementSettings": { + "methods": [ "ConfigureManagementSettings" ] }, - "DeleteRegistration": { - "methods": [ + "DeleteRegistration": { + "methods": [ "DeleteRegistration" ] }, - "ExportRegistration": { - "methods": [ + "ExportRegistration": { + "methods": [ "ExportRegistration" ] }, - "GetRegistration": { - "methods": [ + "GetRegistration": { + "methods": [ "GetRegistration" ] }, - "ListRegistrations": { - "methods": [ + "ListRegistrations": { + "methods": [ "ListRegistrations" ] }, - "RegisterDomain": { - "methods": [ + "RegisterDomain": { + "methods": [ "RegisterDomain" ] }, - "ResetAuthorizationCode": { - "methods": [ + "ResetAuthorizationCode": { + "methods": [ "ResetAuthorizationCode" ] }, - "RetrieveAuthorizationCode": { - "methods": [ + "RetrieveAuthorizationCode": { + "methods": [ "RetrieveAuthorizationCode" ] }, - "RetrieveRegisterParameters": { - "methods": [ + "RetrieveRegisterParameters": { + "methods": [ "RetrieveRegisterParameters" ] }, - "SearchDomains": { - "methods": [ + "SearchDomains": { + "methods": [ "SearchDomains" ] }, - "UpdateRegistration": { - "methods": [ + "UpdateRegistration": { + "methods": [ "UpdateRegistration" ] } diff --git a/errorreporting/apiv1beta1/doc.go b/errorreporting/apiv1beta1/doc.go index d305ddc76c5..732bdb35079 100644 --- a/errorreporting/apiv1beta1/doc.go +++ b/errorreporting/apiv1beta1/doc.go @@ -52,7 +52,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210630" +const versionClient = "20210701" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/errorreporting/apiv1beta1/gapic_metadata.json b/errorreporting/apiv1beta1/gapic_metadata.json index 2c82cbeb583..8e6727a953a 100644 --- a/errorreporting/apiv1beta1/gapic_metadata.json +++ b/errorreporting/apiv1beta1/gapic_metadata.json @@ -1,22 +1,22 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.devtools.clouderrorreporting.v1beta1", - "libraryPackage": "cloud.google.com/go/errorreporting/apiv1beta1", - "services": { - "ErrorGroupService": { - "clients": { - "grpc": { - "libraryClient": "ErrorGroupClient", - "rpcs": { - "GetGroup": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.devtools.clouderrorreporting.v1beta1", + "libraryPackage": "cloud.google.com/go/errorreporting/apiv1beta1", + "services": { + "ErrorGroupService": { + "clients": { + "grpc": { + "libraryClient": "ErrorGroupClient", + "rpcs": { + "GetGroup": { + "methods": [ "GetGroup" ] }, - "UpdateGroup": { - "methods": [ + "UpdateGroup": { + "methods": [ "UpdateGroup" ] } @@ -24,23 +24,23 @@ } } }, - "ErrorStatsService": { - "clients": { - "grpc": { - "libraryClient": "ErrorStatsClient", - "rpcs": { - "DeleteEvents": { - "methods": [ + "ErrorStatsService": { + "clients": { + "grpc": { + "libraryClient": "ErrorStatsClient", + "rpcs": { + "DeleteEvents": { + "methods": [ "DeleteEvents" ] }, - "ListEvents": { - "methods": [ + "ListEvents": { + "methods": [ "ListEvents" ] }, - "ListGroupStats": { - "methods": [ + "ListGroupStats": { + "methods": [ "ListGroupStats" ] } @@ -48,13 +48,13 @@ } } }, - "ReportErrorsService": { - "clients": { - "grpc": { - "libraryClient": "ReportErrorsClient", - "rpcs": { - "ReportErrorEvent": { - "methods": [ + "ReportErrorsService": { + "clients": { + "grpc": { + "libraryClient": "ReportErrorsClient", + "rpcs": { + "ReportErrorEvent": { + "methods": [ "ReportErrorEvent" ] } diff --git a/essentialcontacts/apiv1/doc.go b/essentialcontacts/apiv1/doc.go index 436f0358d87..824133d10c3 100644 --- a/essentialcontacts/apiv1/doc.go +++ b/essentialcontacts/apiv1/doc.go @@ -46,7 +46,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210630" +const versionClient = "20210701" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/essentialcontacts/apiv1/gapic_metadata.json b/essentialcontacts/apiv1/gapic_metadata.json index b4d22d04984..cfebdf9707d 100644 --- a/essentialcontacts/apiv1/gapic_metadata.json +++ b/essentialcontacts/apiv1/gapic_metadata.json @@ -1,47 +1,47 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.essentialcontacts.v1", - "libraryPackage": "cloud.google.com/go/essentialcontacts/apiv1", - "services": { - "EssentialContactsService": { - "clients": { - "grpc": { - "libraryClient": "Client", - "rpcs": { - "ComputeContacts": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.essentialcontacts.v1", + "libraryPackage": "cloud.google.com/go/essentialcontacts/apiv1", + "services": { + "EssentialContactsService": { + "clients": { + "grpc": { + "libraryClient": "Client", + "rpcs": { + "ComputeContacts": { + "methods": [ "ComputeContacts" ] }, - "CreateContact": { - "methods": [ + "CreateContact": { + "methods": [ "CreateContact" ] }, - "DeleteContact": { - "methods": [ + "DeleteContact": { + "methods": [ "DeleteContact" ] }, - "GetContact": { - "methods": [ + "GetContact": { + "methods": [ "GetContact" ] }, - "ListContacts": { - "methods": [ + "ListContacts": { + "methods": [ "ListContacts" ] }, - "SendTestMessage": { - "methods": [ + "SendTestMessage": { + "methods": [ "SendTestMessage" ] }, - "UpdateContact": { - "methods": [ + "UpdateContact": { + "methods": [ "UpdateContact" ] } diff --git a/eventarc/apiv1/doc.go b/eventarc/apiv1/doc.go index 917c37ef02e..2100ac370f4 100644 --- a/eventarc/apiv1/doc.go +++ b/eventarc/apiv1/doc.go @@ -48,7 +48,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "UNKNOWN" +const versionClient = "20210701" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/eventarc/apiv1/gapic_metadata.json b/eventarc/apiv1/gapic_metadata.json index cc93d105421..a71dacd0a3c 100644 --- a/eventarc/apiv1/gapic_metadata.json +++ b/eventarc/apiv1/gapic_metadata.json @@ -1,37 +1,37 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.eventarc.v1", - "libraryPackage": "cloud.google.com/go/eventarc/apiv1", - "services": { - "Eventarc": { - "clients": { - "grpc": { - "libraryClient": "Client", - "rpcs": { - "CreateTrigger": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.eventarc.v1", + "libraryPackage": "cloud.google.com/go/eventarc/apiv1", + "services": { + "Eventarc": { + "clients": { + "grpc": { + "libraryClient": "Client", + "rpcs": { + "CreateTrigger": { + "methods": [ "CreateTrigger" ] }, - "DeleteTrigger": { - "methods": [ + "DeleteTrigger": { + "methods": [ "DeleteTrigger" ] }, - "GetTrigger": { - "methods": [ + "GetTrigger": { + "methods": [ "GetTrigger" ] }, - "ListTriggers": { - "methods": [ + "ListTriggers": { + "methods": [ "ListTriggers" ] }, - "UpdateTrigger": { - "methods": [ + "UpdateTrigger": { + "methods": [ "UpdateTrigger" ] } diff --git a/firestore/apiv1/admin/doc.go b/firestore/apiv1/admin/doc.go index 85034acb541..78ecef1f7cc 100644 --- a/firestore/apiv1/admin/doc.go +++ b/firestore/apiv1/admin/doc.go @@ -49,7 +49,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210630" +const versionClient = "20210701" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/firestore/apiv1/admin/gapic_metadata.json b/firestore/apiv1/admin/gapic_metadata.json index 715aec1a348..9cb25c1be64 100644 --- a/firestore/apiv1/admin/gapic_metadata.json +++ b/firestore/apiv1/admin/gapic_metadata.json @@ -1,57 +1,57 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.firestore.admin.v1", - "libraryPackage": "cloud.google.com/go/firestore/apiv1/admin", - "services": { - "FirestoreAdmin": { - "clients": { - "grpc": { - "libraryClient": "FirestoreAdminClient", - "rpcs": { - "CreateIndex": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.firestore.admin.v1", + "libraryPackage": "cloud.google.com/go/firestore/apiv1/admin", + "services": { + "FirestoreAdmin": { + "clients": { + "grpc": { + "libraryClient": "FirestoreAdminClient", + "rpcs": { + "CreateIndex": { + "methods": [ "CreateIndex" ] }, - "DeleteIndex": { - "methods": [ + "DeleteIndex": { + "methods": [ "DeleteIndex" ] }, - "ExportDocuments": { - "methods": [ + "ExportDocuments": { + "methods": [ "ExportDocuments" ] }, - "GetField": { - "methods": [ + "GetField": { + "methods": [ "GetField" ] }, - "GetIndex": { - "methods": [ + "GetIndex": { + "methods": [ "GetIndex" ] }, - "ImportDocuments": { - "methods": [ + "ImportDocuments": { + "methods": [ "ImportDocuments" ] }, - "ListFields": { - "methods": [ + "ListFields": { + "methods": [ "ListFields" ] }, - "ListIndexes": { - "methods": [ + "ListIndexes": { + "methods": [ "ListIndexes" ] }, - "UpdateField": { - "methods": [ + "UpdateField": { + "methods": [ "UpdateField" ] } diff --git a/firestore/apiv1/doc.go b/firestore/apiv1/doc.go index fbb012af1f5..c1e56d75b51 100644 --- a/firestore/apiv1/doc.go +++ b/firestore/apiv1/doc.go @@ -49,7 +49,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210630" +const versionClient = "20210701" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/firestore/apiv1/gapic_metadata.json b/firestore/apiv1/gapic_metadata.json index 60baab5f463..f5503bc5d27 100644 --- a/firestore/apiv1/gapic_metadata.json +++ b/firestore/apiv1/gapic_metadata.json @@ -1,87 +1,87 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.firestore.v1", - "libraryPackage": "cloud.google.com/go/firestore/apiv1", - "services": { - "Firestore": { - "clients": { - "grpc": { - "libraryClient": "Client", - "rpcs": { - "BatchGetDocuments": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.firestore.v1", + "libraryPackage": "cloud.google.com/go/firestore/apiv1", + "services": { + "Firestore": { + "clients": { + "grpc": { + "libraryClient": "Client", + "rpcs": { + "BatchGetDocuments": { + "methods": [ "BatchGetDocuments" ] }, - "BatchWrite": { - "methods": [ + "BatchWrite": { + "methods": [ "BatchWrite" ] }, - "BeginTransaction": { - "methods": [ + "BeginTransaction": { + "methods": [ "BeginTransaction" ] }, - "Commit": { - "methods": [ + "Commit": { + "methods": [ "Commit" ] }, - "CreateDocument": { - "methods": [ + "CreateDocument": { + "methods": [ "CreateDocument" ] }, - "DeleteDocument": { - "methods": [ + "DeleteDocument": { + "methods": [ "DeleteDocument" ] }, - "GetDocument": { - "methods": [ + "GetDocument": { + "methods": [ "GetDocument" ] }, - "ListCollectionIds": { - "methods": [ + "ListCollectionIds": { + "methods": [ "ListCollectionIds" ] }, - "ListDocuments": { - "methods": [ + "ListDocuments": { + "methods": [ "ListDocuments" ] }, - "Listen": { - "methods": [ + "Listen": { + "methods": [ "Listen" ] }, - "PartitionQuery": { - "methods": [ + "PartitionQuery": { + "methods": [ "PartitionQuery" ] }, - "Rollback": { - "methods": [ + "Rollback": { + "methods": [ "Rollback" ] }, - "RunQuery": { - "methods": [ + "RunQuery": { + "methods": [ "RunQuery" ] }, - "UpdateDocument": { - "methods": [ + "UpdateDocument": { + "methods": [ "UpdateDocument" ] }, - "Write": { - "methods": [ + "Write": { + "methods": [ "Write" ] } diff --git a/firestore/go.mod b/firestore/go.mod index 1c2b1f03488..42888a32e23 100644 --- a/firestore/go.mod +++ b/firestore/go.mod @@ -8,7 +8,7 @@ require ( github.com/google/go-cmp v0.5.6 github.com/googleapis/gax-go/v2 v2.0.5 google.golang.org/api v0.50.0 - google.golang.org/genproto v0.0.0-20210630183607-d20f26d13c79 + google.golang.org/genproto v0.0.0-20210701133433-6b8dcf568a95 google.golang.org/grpc v1.38.0 google.golang.org/protobuf v1.27.1 ) diff --git a/firestore/go.sum b/firestore/go.sum index 9e44f7fc0b6..aa8fd5de0a2 100644 --- a/firestore/go.sum +++ b/firestore/go.sum @@ -450,8 +450,8 @@ google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxH google.golang.org/genproto v0.0.0-20210604141403-392c879c8b08/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= google.golang.org/genproto v0.0.0-20210608205507-b6d2f5bf0d7d/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= google.golang.org/genproto v0.0.0-20210624195500-8bfb893ecb84/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24= -google.golang.org/genproto v0.0.0-20210630183607-d20f26d13c79 h1:s1jFTXJryg4a1mew7xv03VZD8N9XjxFhk1o4Js4WvPQ= -google.golang.org/genproto v0.0.0-20210630183607-d20f26d13c79/go.mod h1:yiaVoXHpRzHGyxV3o4DktVWY4mSUErTKaeEOq6C3t3U= +google.golang.org/genproto v0.0.0-20210701133433-6b8dcf568a95 h1:xyRjacsGcaSoZ2fTcaLCSzh2JEceLLOT4X8k32Q0xAQ= +google.golang.org/genproto v0.0.0-20210701133433-6b8dcf568a95/go.mod h1:yiaVoXHpRzHGyxV3o4DktVWY4mSUErTKaeEOq6C3t3U= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= diff --git a/functions/apiv1/doc.go b/functions/apiv1/doc.go index 9651891f975..a4585accc01 100644 --- a/functions/apiv1/doc.go +++ b/functions/apiv1/doc.go @@ -49,7 +49,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210630" +const versionClient = "20210701" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/functions/apiv1/gapic_metadata.json b/functions/apiv1/gapic_metadata.json index 311de14e0f4..176b9f45521 100644 --- a/functions/apiv1/gapic_metadata.json +++ b/functions/apiv1/gapic_metadata.json @@ -1,67 +1,67 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.functions.v1", - "libraryPackage": "cloud.google.com/go/functions/apiv1", - "services": { - "CloudFunctionsService": { - "clients": { - "grpc": { - "libraryClient": "CloudFunctionsClient", - "rpcs": { - "CallFunction": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.functions.v1", + "libraryPackage": "cloud.google.com/go/functions/apiv1", + "services": { + "CloudFunctionsService": { + "clients": { + "grpc": { + "libraryClient": "CloudFunctionsClient", + "rpcs": { + "CallFunction": { + "methods": [ "CallFunction" ] }, - "CreateFunction": { - "methods": [ + "CreateFunction": { + "methods": [ "CreateFunction" ] }, - "DeleteFunction": { - "methods": [ + "DeleteFunction": { + "methods": [ "DeleteFunction" ] }, - "GenerateDownloadUrl": { - "methods": [ + "GenerateDownloadUrl": { + "methods": [ "GenerateDownloadUrl" ] }, - "GenerateUploadUrl": { - "methods": [ + "GenerateUploadUrl": { + "methods": [ "GenerateUploadUrl" ] }, - "GetFunction": { - "methods": [ + "GetFunction": { + "methods": [ "GetFunction" ] }, - "GetIamPolicy": { - "methods": [ + "GetIamPolicy": { + "methods": [ "GetIamPolicy" ] }, - "ListFunctions": { - "methods": [ + "ListFunctions": { + "methods": [ "ListFunctions" ] }, - "SetIamPolicy": { - "methods": [ + "SetIamPolicy": { + "methods": [ "SetIamPolicy" ] }, - "TestIamPermissions": { - "methods": [ + "TestIamPermissions": { + "methods": [ "TestIamPermissions" ] }, - "UpdateFunction": { - "methods": [ + "UpdateFunction": { + "methods": [ "UpdateFunction" ] } diff --git a/gaming/apiv1/doc.go b/gaming/apiv1/doc.go index aebd85c3fb0..a76ed2f294d 100644 --- a/gaming/apiv1/doc.go +++ b/gaming/apiv1/doc.go @@ -49,7 +49,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210630" +const versionClient = "20210701" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/gaming/apiv1/gapic_metadata.json b/gaming/apiv1/gapic_metadata.json index d72302d3de5..a7aa70f78b6 100644 --- a/gaming/apiv1/gapic_metadata.json +++ b/gaming/apiv1/gapic_metadata.json @@ -1,52 +1,52 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.gaming.v1", - "libraryPackage": "cloud.google.com/go/gaming/apiv1", - "services": { - "GameServerClustersService": { - "clients": { - "grpc": { - "libraryClient": "GameServerClustersClient", - "rpcs": { - "CreateGameServerCluster": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.gaming.v1", + "libraryPackage": "cloud.google.com/go/gaming/apiv1", + "services": { + "GameServerClustersService": { + "clients": { + "grpc": { + "libraryClient": "GameServerClustersClient", + "rpcs": { + "CreateGameServerCluster": { + "methods": [ "CreateGameServerCluster" ] }, - "DeleteGameServerCluster": { - "methods": [ + "DeleteGameServerCluster": { + "methods": [ "DeleteGameServerCluster" ] }, - "GetGameServerCluster": { - "methods": [ + "GetGameServerCluster": { + "methods": [ "GetGameServerCluster" ] }, - "ListGameServerClusters": { - "methods": [ + "ListGameServerClusters": { + "methods": [ "ListGameServerClusters" ] }, - "PreviewCreateGameServerCluster": { - "methods": [ + "PreviewCreateGameServerCluster": { + "methods": [ "PreviewCreateGameServerCluster" ] }, - "PreviewDeleteGameServerCluster": { - "methods": [ + "PreviewDeleteGameServerCluster": { + "methods": [ "PreviewDeleteGameServerCluster" ] }, - "PreviewUpdateGameServerCluster": { - "methods": [ + "PreviewUpdateGameServerCluster": { + "methods": [ "PreviewUpdateGameServerCluster" ] }, - "UpdateGameServerCluster": { - "methods": [ + "UpdateGameServerCluster": { + "methods": [ "UpdateGameServerCluster" ] } @@ -54,28 +54,28 @@ } } }, - "GameServerConfigsService": { - "clients": { - "grpc": { - "libraryClient": "GameServerConfigsClient", - "rpcs": { - "CreateGameServerConfig": { - "methods": [ + "GameServerConfigsService": { + "clients": { + "grpc": { + "libraryClient": "GameServerConfigsClient", + "rpcs": { + "CreateGameServerConfig": { + "methods": [ "CreateGameServerConfig" ] }, - "DeleteGameServerConfig": { - "methods": [ + "DeleteGameServerConfig": { + "methods": [ "DeleteGameServerConfig" ] }, - "GetGameServerConfig": { - "methods": [ + "GetGameServerConfig": { + "methods": [ "GetGameServerConfig" ] }, - "ListGameServerConfigs": { - "methods": [ + "ListGameServerConfigs": { + "methods": [ "ListGameServerConfigs" ] } @@ -83,53 +83,53 @@ } } }, - "GameServerDeploymentsService": { - "clients": { - "grpc": { - "libraryClient": "GameServerDeploymentsClient", - "rpcs": { - "CreateGameServerDeployment": { - "methods": [ + "GameServerDeploymentsService": { + "clients": { + "grpc": { + "libraryClient": "GameServerDeploymentsClient", + "rpcs": { + "CreateGameServerDeployment": { + "methods": [ "CreateGameServerDeployment" ] }, - "DeleteGameServerDeployment": { - "methods": [ + "DeleteGameServerDeployment": { + "methods": [ "DeleteGameServerDeployment" ] }, - "FetchDeploymentState": { - "methods": [ + "FetchDeploymentState": { + "methods": [ "FetchDeploymentState" ] }, - "GetGameServerDeployment": { - "methods": [ + "GetGameServerDeployment": { + "methods": [ "GetGameServerDeployment" ] }, - "GetGameServerDeploymentRollout": { - "methods": [ + "GetGameServerDeploymentRollout": { + "methods": [ "GetGameServerDeploymentRollout" ] }, - "ListGameServerDeployments": { - "methods": [ + "ListGameServerDeployments": { + "methods": [ "ListGameServerDeployments" ] }, - "PreviewGameServerDeploymentRollout": { - "methods": [ + "PreviewGameServerDeploymentRollout": { + "methods": [ "PreviewGameServerDeploymentRollout" ] }, - "UpdateGameServerDeployment": { - "methods": [ + "UpdateGameServerDeployment": { + "methods": [ "UpdateGameServerDeployment" ] }, - "UpdateGameServerDeploymentRollout": { - "methods": [ + "UpdateGameServerDeploymentRollout": { + "methods": [ "UpdateGameServerDeploymentRollout" ] } @@ -137,38 +137,38 @@ } } }, - "RealmsService": { - "clients": { - "grpc": { - "libraryClient": "RealmsClient", - "rpcs": { - "CreateRealm": { - "methods": [ + "RealmsService": { + "clients": { + "grpc": { + "libraryClient": "RealmsClient", + "rpcs": { + "CreateRealm": { + "methods": [ "CreateRealm" ] }, - "DeleteRealm": { - "methods": [ + "DeleteRealm": { + "methods": [ "DeleteRealm" ] }, - "GetRealm": { - "methods": [ + "GetRealm": { + "methods": [ "GetRealm" ] }, - "ListRealms": { - "methods": [ + "ListRealms": { + "methods": [ "ListRealms" ] }, - "PreviewRealmUpdate": { - "methods": [ + "PreviewRealmUpdate": { + "methods": [ "PreviewRealmUpdate" ] }, - "UpdateRealm": { - "methods": [ + "UpdateRealm": { + "methods": [ "UpdateRealm" ] } diff --git a/gaming/apiv1beta/doc.go b/gaming/apiv1beta/doc.go index fee932c7861..c98ad69fa04 100644 --- a/gaming/apiv1beta/doc.go +++ b/gaming/apiv1beta/doc.go @@ -51,7 +51,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210630" +const versionClient = "20210701" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/gaming/apiv1beta/gapic_metadata.json b/gaming/apiv1beta/gapic_metadata.json index 14b4cbb680c..110a8289a84 100644 --- a/gaming/apiv1beta/gapic_metadata.json +++ b/gaming/apiv1beta/gapic_metadata.json @@ -1,52 +1,52 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.gaming.v1beta", - "libraryPackage": "cloud.google.com/go/gaming/apiv1beta", - "services": { - "GameServerClustersService": { - "clients": { - "grpc": { - "libraryClient": "GameServerClustersClient", - "rpcs": { - "CreateGameServerCluster": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.gaming.v1beta", + "libraryPackage": "cloud.google.com/go/gaming/apiv1beta", + "services": { + "GameServerClustersService": { + "clients": { + "grpc": { + "libraryClient": "GameServerClustersClient", + "rpcs": { + "CreateGameServerCluster": { + "methods": [ "CreateGameServerCluster" ] }, - "DeleteGameServerCluster": { - "methods": [ + "DeleteGameServerCluster": { + "methods": [ "DeleteGameServerCluster" ] }, - "GetGameServerCluster": { - "methods": [ + "GetGameServerCluster": { + "methods": [ "GetGameServerCluster" ] }, - "ListGameServerClusters": { - "methods": [ + "ListGameServerClusters": { + "methods": [ "ListGameServerClusters" ] }, - "PreviewCreateGameServerCluster": { - "methods": [ + "PreviewCreateGameServerCluster": { + "methods": [ "PreviewCreateGameServerCluster" ] }, - "PreviewDeleteGameServerCluster": { - "methods": [ + "PreviewDeleteGameServerCluster": { + "methods": [ "PreviewDeleteGameServerCluster" ] }, - "PreviewUpdateGameServerCluster": { - "methods": [ + "PreviewUpdateGameServerCluster": { + "methods": [ "PreviewUpdateGameServerCluster" ] }, - "UpdateGameServerCluster": { - "methods": [ + "UpdateGameServerCluster": { + "methods": [ "UpdateGameServerCluster" ] } @@ -54,28 +54,28 @@ } } }, - "GameServerConfigsService": { - "clients": { - "grpc": { - "libraryClient": "GameServerConfigsClient", - "rpcs": { - "CreateGameServerConfig": { - "methods": [ + "GameServerConfigsService": { + "clients": { + "grpc": { + "libraryClient": "GameServerConfigsClient", + "rpcs": { + "CreateGameServerConfig": { + "methods": [ "CreateGameServerConfig" ] }, - "DeleteGameServerConfig": { - "methods": [ + "DeleteGameServerConfig": { + "methods": [ "DeleteGameServerConfig" ] }, - "GetGameServerConfig": { - "methods": [ + "GetGameServerConfig": { + "methods": [ "GetGameServerConfig" ] }, - "ListGameServerConfigs": { - "methods": [ + "ListGameServerConfigs": { + "methods": [ "ListGameServerConfigs" ] } @@ -83,53 +83,53 @@ } } }, - "GameServerDeploymentsService": { - "clients": { - "grpc": { - "libraryClient": "GameServerDeploymentsClient", - "rpcs": { - "CreateGameServerDeployment": { - "methods": [ + "GameServerDeploymentsService": { + "clients": { + "grpc": { + "libraryClient": "GameServerDeploymentsClient", + "rpcs": { + "CreateGameServerDeployment": { + "methods": [ "CreateGameServerDeployment" ] }, - "DeleteGameServerDeployment": { - "methods": [ + "DeleteGameServerDeployment": { + "methods": [ "DeleteGameServerDeployment" ] }, - "FetchDeploymentState": { - "methods": [ + "FetchDeploymentState": { + "methods": [ "FetchDeploymentState" ] }, - "GetGameServerDeployment": { - "methods": [ + "GetGameServerDeployment": { + "methods": [ "GetGameServerDeployment" ] }, - "GetGameServerDeploymentRollout": { - "methods": [ + "GetGameServerDeploymentRollout": { + "methods": [ "GetGameServerDeploymentRollout" ] }, - "ListGameServerDeployments": { - "methods": [ + "ListGameServerDeployments": { + "methods": [ "ListGameServerDeployments" ] }, - "PreviewGameServerDeploymentRollout": { - "methods": [ + "PreviewGameServerDeploymentRollout": { + "methods": [ "PreviewGameServerDeploymentRollout" ] }, - "UpdateGameServerDeployment": { - "methods": [ + "UpdateGameServerDeployment": { + "methods": [ "UpdateGameServerDeployment" ] }, - "UpdateGameServerDeploymentRollout": { - "methods": [ + "UpdateGameServerDeploymentRollout": { + "methods": [ "UpdateGameServerDeploymentRollout" ] } @@ -137,38 +137,38 @@ } } }, - "RealmsService": { - "clients": { - "grpc": { - "libraryClient": "RealmsClient", - "rpcs": { - "CreateRealm": { - "methods": [ + "RealmsService": { + "clients": { + "grpc": { + "libraryClient": "RealmsClient", + "rpcs": { + "CreateRealm": { + "methods": [ "CreateRealm" ] }, - "DeleteRealm": { - "methods": [ + "DeleteRealm": { + "methods": [ "DeleteRealm" ] }, - "GetRealm": { - "methods": [ + "GetRealm": { + "methods": [ "GetRealm" ] }, - "ListRealms": { - "methods": [ + "ListRealms": { + "methods": [ "ListRealms" ] }, - "PreviewRealmUpdate": { - "methods": [ + "PreviewRealmUpdate": { + "methods": [ "PreviewRealmUpdate" ] }, - "UpdateRealm": { - "methods": [ + "UpdateRealm": { + "methods": [ "UpdateRealm" ] } diff --git a/gkeconnect/gateway/apiv1beta1/doc.go b/gkeconnect/gateway/apiv1beta1/doc.go index 9a8af36e3ea..c2078ca33f0 100644 --- a/gkeconnect/gateway/apiv1beta1/doc.go +++ b/gkeconnect/gateway/apiv1beta1/doc.go @@ -51,7 +51,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210630" +const versionClient = "20210701" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/gkeconnect/gateway/apiv1beta1/gapic_metadata.json b/gkeconnect/gateway/apiv1beta1/gapic_metadata.json index c7a368a972c..40cfe97e1d9 100644 --- a/gkeconnect/gateway/apiv1beta1/gapic_metadata.json +++ b/gkeconnect/gateway/apiv1beta1/gapic_metadata.json @@ -1,37 +1,37 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.gkeconnect.gateway.v1beta1", - "libraryPackage": "cloud.google.com/go/gkeconnect/gateway/apiv1beta1", - "services": { - "GatewayService": { - "clients": { - "grpc": { - "libraryClient": "Client", - "rpcs": { - "DeleteResource": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.gkeconnect.gateway.v1beta1", + "libraryPackage": "cloud.google.com/go/gkeconnect/gateway/apiv1beta1", + "services": { + "GatewayService": { + "clients": { + "grpc": { + "libraryClient": "Client", + "rpcs": { + "DeleteResource": { + "methods": [ "DeleteResource" ] }, - "GetResource": { - "methods": [ + "GetResource": { + "methods": [ "GetResource" ] }, - "PatchResource": { - "methods": [ + "PatchResource": { + "methods": [ "PatchResource" ] }, - "PostResource": { - "methods": [ + "PostResource": { + "methods": [ "PostResource" ] }, - "PutResource": { - "methods": [ + "PutResource": { + "methods": [ "PutResource" ] } diff --git a/gkehub/apiv1beta1/doc.go b/gkehub/apiv1beta1/doc.go index b840f51faa0..4e52a500a58 100644 --- a/gkehub/apiv1beta1/doc.go +++ b/gkehub/apiv1beta1/doc.go @@ -48,7 +48,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210630" +const versionClient = "20210701" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/gkehub/apiv1beta1/gapic_metadata.json b/gkehub/apiv1beta1/gapic_metadata.json index 7d081742c3a..21ff5f263f9 100644 --- a/gkehub/apiv1beta1/gapic_metadata.json +++ b/gkehub/apiv1beta1/gapic_metadata.json @@ -1,52 +1,52 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.gkehub.v1beta1", - "libraryPackage": "cloud.google.com/go/gkehub/apiv1beta1", - "services": { - "GkeHubMembershipService": { - "clients": { - "grpc": { - "libraryClient": "GkeHubMembershipClient", - "rpcs": { - "CreateMembership": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.gkehub.v1beta1", + "libraryPackage": "cloud.google.com/go/gkehub/apiv1beta1", + "services": { + "GkeHubMembershipService": { + "clients": { + "grpc": { + "libraryClient": "GkeHubMembershipClient", + "rpcs": { + "CreateMembership": { + "methods": [ "CreateMembership" ] }, - "DeleteMembership": { - "methods": [ + "DeleteMembership": { + "methods": [ "DeleteMembership" ] }, - "GenerateConnectManifest": { - "methods": [ + "GenerateConnectManifest": { + "methods": [ "GenerateConnectManifest" ] }, - "GenerateExclusivityManifest": { - "methods": [ + "GenerateExclusivityManifest": { + "methods": [ "GenerateExclusivityManifest" ] }, - "GetMembership": { - "methods": [ + "GetMembership": { + "methods": [ "GetMembership" ] }, - "ListMemberships": { - "methods": [ + "ListMemberships": { + "methods": [ "ListMemberships" ] }, - "UpdateMembership": { - "methods": [ + "UpdateMembership": { + "methods": [ "UpdateMembership" ] }, - "ValidateExclusivity": { - "methods": [ + "ValidateExclusivity": { + "methods": [ "ValidateExclusivity" ] } diff --git a/go.mod b/go.mod index e3f528d3490..ebfba10f281 100644 --- a/go.mod +++ b/go.mod @@ -17,7 +17,7 @@ require ( golang.org/x/text v0.3.6 golang.org/x/tools v0.1.4 google.golang.org/api v0.50.0 - google.golang.org/genproto v0.0.0-20210630183607-d20f26d13c79 + google.golang.org/genproto v0.0.0-20210701133433-6b8dcf568a95 google.golang.org/grpc v1.38.0 google.golang.org/protobuf v1.27.1 ) diff --git a/go.sum b/go.sum index e72672ec7de..cdf29627f57 100644 --- a/go.sum +++ b/go.sum @@ -458,8 +458,8 @@ google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxH google.golang.org/genproto v0.0.0-20210604141403-392c879c8b08/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= google.golang.org/genproto v0.0.0-20210608205507-b6d2f5bf0d7d/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= google.golang.org/genproto v0.0.0-20210624195500-8bfb893ecb84/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24= -google.golang.org/genproto v0.0.0-20210630183607-d20f26d13c79 h1:s1jFTXJryg4a1mew7xv03VZD8N9XjxFhk1o4Js4WvPQ= -google.golang.org/genproto v0.0.0-20210630183607-d20f26d13c79/go.mod h1:yiaVoXHpRzHGyxV3o4DktVWY4mSUErTKaeEOq6C3t3U= +google.golang.org/genproto v0.0.0-20210701133433-6b8dcf568a95 h1:xyRjacsGcaSoZ2fTcaLCSzh2JEceLLOT4X8k32Q0xAQ= +google.golang.org/genproto v0.0.0-20210701133433-6b8dcf568a95/go.mod h1:yiaVoXHpRzHGyxV3o4DktVWY4mSUErTKaeEOq6C3t3U= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= diff --git a/gsuiteaddons/apiv1/doc.go b/gsuiteaddons/apiv1/doc.go index 90625432e32..2487b0bc497 100644 --- a/gsuiteaddons/apiv1/doc.go +++ b/gsuiteaddons/apiv1/doc.go @@ -48,7 +48,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210630" +const versionClient = "20210701" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/gsuiteaddons/apiv1/gapic_metadata.json b/gsuiteaddons/apiv1/gapic_metadata.json index d4725fdf979..178d0b85085 100644 --- a/gsuiteaddons/apiv1/gapic_metadata.json +++ b/gsuiteaddons/apiv1/gapic_metadata.json @@ -1,57 +1,57 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.gsuiteaddons.v1", - "libraryPackage": "cloud.google.com/go/gsuiteaddons/apiv1", - "services": { - "GSuiteAddOns": { - "clients": { - "grpc": { - "libraryClient": "Client", - "rpcs": { - "CreateDeployment": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.gsuiteaddons.v1", + "libraryPackage": "cloud.google.com/go/gsuiteaddons/apiv1", + "services": { + "GSuiteAddOns": { + "clients": { + "grpc": { + "libraryClient": "Client", + "rpcs": { + "CreateDeployment": { + "methods": [ "CreateDeployment" ] }, - "DeleteDeployment": { - "methods": [ + "DeleteDeployment": { + "methods": [ "DeleteDeployment" ] }, - "GetAuthorization": { - "methods": [ + "GetAuthorization": { + "methods": [ "GetAuthorization" ] }, - "GetDeployment": { - "methods": [ + "GetDeployment": { + "methods": [ "GetDeployment" ] }, - "GetInstallStatus": { - "methods": [ + "GetInstallStatus": { + "methods": [ "GetInstallStatus" ] }, - "InstallDeployment": { - "methods": [ + "InstallDeployment": { + "methods": [ "InstallDeployment" ] }, - "ListDeployments": { - "methods": [ + "ListDeployments": { + "methods": [ "ListDeployments" ] }, - "ReplaceDeployment": { - "methods": [ + "ReplaceDeployment": { + "methods": [ "ReplaceDeployment" ] }, - "UninstallDeployment": { - "methods": [ + "UninstallDeployment": { + "methods": [ "UninstallDeployment" ] } diff --git a/iam/credentials/apiv1/doc.go b/iam/credentials/apiv1/doc.go index 6053de60b6b..d2b85b8f7dc 100644 --- a/iam/credentials/apiv1/doc.go +++ b/iam/credentials/apiv1/doc.go @@ -49,7 +49,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210630" +const versionClient = "20210701" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/iam/credentials/apiv1/gapic_metadata.json b/iam/credentials/apiv1/gapic_metadata.json index 735b6169ffe..7e1edb5bfd2 100644 --- a/iam/credentials/apiv1/gapic_metadata.json +++ b/iam/credentials/apiv1/gapic_metadata.json @@ -1,32 +1,32 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.iam.credentials.v1", - "libraryPackage": "cloud.google.com/go/iam/credentials/apiv1", - "services": { - "IAMCredentials": { - "clients": { - "grpc": { - "libraryClient": "IamCredentialsClient", - "rpcs": { - "GenerateAccessToken": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.iam.credentials.v1", + "libraryPackage": "cloud.google.com/go/iam/credentials/apiv1", + "services": { + "IAMCredentials": { + "clients": { + "grpc": { + "libraryClient": "IamCredentialsClient", + "rpcs": { + "GenerateAccessToken": { + "methods": [ "GenerateAccessToken" ] }, - "GenerateIdToken": { - "methods": [ + "GenerateIdToken": { + "methods": [ "GenerateIdToken" ] }, - "SignBlob": { - "methods": [ + "SignBlob": { + "methods": [ "SignBlob" ] }, - "SignJwt": { - "methods": [ + "SignJwt": { + "methods": [ "SignJwt" ] } diff --git a/internal/generated/snippets/analytics/admin/apiv1alpha/AnalyticsAdminClient/CreateIosAppDataStream/main.go b/internal/generated/snippets/analytics/admin/apiv1alpha/AnalyticsAdminClient/CreateIosAppDataStream/main.go deleted file mode 100644 index efd03615068..00000000000 --- a/internal/generated/snippets/analytics/admin/apiv1alpha/AnalyticsAdminClient/CreateIosAppDataStream/main.go +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright 2021 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 -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// [START analyticsadmin_v1alpha_generated_AnalyticsAdminService_CreateIosAppDataStream_sync] - -package main - -import ( - "context" - - admin "cloud.google.com/go/analytics/admin/apiv1alpha" - adminpb "google.golang.org/genproto/googleapis/analytics/admin/v1alpha" -) - -func main() { - // import adminpb "google.golang.org/genproto/googleapis/analytics/admin/v1alpha" - - ctx := context.Background() - c, err := admin.NewAnalyticsAdminClient(ctx) - if err != nil { - // TODO: Handle error. - } - - req := &adminpb.CreateIosAppDataStreamRequest{ - // TODO: Fill request struct fields. - } - resp, err := c.CreateIosAppDataStream(ctx, req) - if err != nil { - // TODO: Handle error. - } - // TODO: Use resp. - _ = resp -} - -// [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_CreateIosAppDataStream_sync] diff --git a/internal/generated/snippets/go.mod b/internal/generated/snippets/go.mod index 23d7f936c8e..b4d069b007d 100644 --- a/internal/generated/snippets/go.mod +++ b/internal/generated/snippets/go.mod @@ -31,6 +31,6 @@ require ( cloud.google.com/go/pubsub v1.9.1 cloud.google.com/go/pubsublite v0.84.0 cloud.google.com/go/spanner v0.84.0 - google.golang.org/api v0.49.0 + google.golang.org/api v0.50.0 google.golang.org/genproto v0.0.0-20210630183607-d20f26d13c79 ) diff --git a/internal/generated/snippets/go.sum b/internal/generated/snippets/go.sum index 4d8866856df..344e7341ff1 100644 --- a/internal/generated/snippets/go.sum +++ b/internal/generated/snippets/go.sum @@ -81,7 +81,6 @@ golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96b golang.org/x/net v0.0.0-20210503060351-7fd8e65b6420 h1:a8jGStKg0XqKDlKqjLrXn0ioF5MH36pT7Z0BRTqLhbk= golang.org/x/net v0.0.0-20210503060351-7fd8e65b6420/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= -golang.org/x/oauth2 v0.0.0-20210615190721-d04028783cf1/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210628180205-a41e5a781914 h1:3B43BWw0xEBsLZ/NO1VALz6fppU3481pik+2Ksv45z8= golang.org/x/oauth2 v0.0.0-20210628180205-a41e5a781914/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -123,8 +122,8 @@ golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -google.golang.org/api v0.49.0 h1:gjIBDxlTG7vnzMmEnYwTnvLTF8Rjzo+ETCgEX1YZ/fY= -google.golang.org/api v0.49.0/go.mod h1:BECiH72wsfwUvOVn3+btPD5WHi0LzavZReBndi42L18= +google.golang.org/api v0.50.0 h1:LX7NFCFYOHzr7WHaYiRUpeipZe9o5L8T+2F4Z798VDw= +google.golang.org/api v0.50.0/go.mod h1:4bNT5pAuq5ji4SRZm+5QIkjny9JAyVD/3gaSihNefaw= 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.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= @@ -133,8 +132,7 @@ google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCID 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-20210617175327-b9e0b3197ced/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24= -google.golang.org/genproto v0.0.0-20210629200056-84d6f6074151/go.mod h1:yiaVoXHpRzHGyxV3o4DktVWY4mSUErTKaeEOq6C3t3U= +google.golang.org/genproto v0.0.0-20210624195500-8bfb893ecb84/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24= google.golang.org/genproto v0.0.0-20210630183607-d20f26d13c79 h1:s1jFTXJryg4a1mew7xv03VZD8N9XjxFhk1o4Js4WvPQ= google.golang.org/genproto v0.0.0-20210630183607-d20f26d13c79/go.mod h1:yiaVoXHpRzHGyxV3o4DktVWY4mSUErTKaeEOq6C3t3U= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= diff --git a/iot/apiv1/doc.go b/iot/apiv1/doc.go index 3c0d3ab6fad..bc1f04dd90b 100644 --- a/iot/apiv1/doc.go +++ b/iot/apiv1/doc.go @@ -49,7 +49,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210630" +const versionClient = "20210701" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/iot/apiv1/gapic_metadata.json b/iot/apiv1/gapic_metadata.json index d8c779156b3..75dfb965b17 100644 --- a/iot/apiv1/gapic_metadata.json +++ b/iot/apiv1/gapic_metadata.json @@ -1,107 +1,107 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.iot.v1", - "libraryPackage": "cloud.google.com/go/iot/apiv1", - "services": { - "DeviceManager": { - "clients": { - "grpc": { - "libraryClient": "DeviceManagerClient", - "rpcs": { - "BindDeviceToGateway": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.iot.v1", + "libraryPackage": "cloud.google.com/go/iot/apiv1", + "services": { + "DeviceManager": { + "clients": { + "grpc": { + "libraryClient": "DeviceManagerClient", + "rpcs": { + "BindDeviceToGateway": { + "methods": [ "BindDeviceToGateway" ] }, - "CreateDevice": { - "methods": [ + "CreateDevice": { + "methods": [ "CreateDevice" ] }, - "CreateDeviceRegistry": { - "methods": [ + "CreateDeviceRegistry": { + "methods": [ "CreateDeviceRegistry" ] }, - "DeleteDevice": { - "methods": [ + "DeleteDevice": { + "methods": [ "DeleteDevice" ] }, - "DeleteDeviceRegistry": { - "methods": [ + "DeleteDeviceRegistry": { + "methods": [ "DeleteDeviceRegistry" ] }, - "GetDevice": { - "methods": [ + "GetDevice": { + "methods": [ "GetDevice" ] }, - "GetDeviceRegistry": { - "methods": [ + "GetDeviceRegistry": { + "methods": [ "GetDeviceRegistry" ] }, - "GetIamPolicy": { - "methods": [ + "GetIamPolicy": { + "methods": [ "GetIamPolicy" ] }, - "ListDeviceConfigVersions": { - "methods": [ + "ListDeviceConfigVersions": { + "methods": [ "ListDeviceConfigVersions" ] }, - "ListDeviceRegistries": { - "methods": [ + "ListDeviceRegistries": { + "methods": [ "ListDeviceRegistries" ] }, - "ListDeviceStates": { - "methods": [ + "ListDeviceStates": { + "methods": [ "ListDeviceStates" ] }, - "ListDevices": { - "methods": [ + "ListDevices": { + "methods": [ "ListDevices" ] }, - "ModifyCloudToDeviceConfig": { - "methods": [ + "ModifyCloudToDeviceConfig": { + "methods": [ "ModifyCloudToDeviceConfig" ] }, - "SendCommandToDevice": { - "methods": [ + "SendCommandToDevice": { + "methods": [ "SendCommandToDevice" ] }, - "SetIamPolicy": { - "methods": [ + "SetIamPolicy": { + "methods": [ "SetIamPolicy" ] }, - "TestIamPermissions": { - "methods": [ + "TestIamPermissions": { + "methods": [ "TestIamPermissions" ] }, - "UnbindDeviceFromGateway": { - "methods": [ + "UnbindDeviceFromGateway": { + "methods": [ "UnbindDeviceFromGateway" ] }, - "UpdateDevice": { - "methods": [ + "UpdateDevice": { + "methods": [ "UpdateDevice" ] }, - "UpdateDeviceRegistry": { - "methods": [ + "UpdateDeviceRegistry": { + "methods": [ "UpdateDeviceRegistry" ] } diff --git a/kms/apiv1/doc.go b/kms/apiv1/doc.go index 43162dae432..a8d4ec31c4b 100644 --- a/kms/apiv1/doc.go +++ b/kms/apiv1/doc.go @@ -49,7 +49,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210630" +const versionClient = "20210701" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/kms/apiv1/gapic_metadata.json b/kms/apiv1/gapic_metadata.json index fdc6f4e7582..37d3fd6d549 100644 --- a/kms/apiv1/gapic_metadata.json +++ b/kms/apiv1/gapic_metadata.json @@ -1,142 +1,142 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.kms.v1", - "libraryPackage": "cloud.google.com/go/kms/apiv1", - "services": { - "KeyManagementService": { - "clients": { - "grpc": { - "libraryClient": "KeyManagementClient", - "rpcs": { - "AsymmetricDecrypt": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.kms.v1", + "libraryPackage": "cloud.google.com/go/kms/apiv1", + "services": { + "KeyManagementService": { + "clients": { + "grpc": { + "libraryClient": "KeyManagementClient", + "rpcs": { + "AsymmetricDecrypt": { + "methods": [ "AsymmetricDecrypt" ] }, - "AsymmetricSign": { - "methods": [ + "AsymmetricSign": { + "methods": [ "AsymmetricSign" ] }, - "CreateCryptoKey": { - "methods": [ + "CreateCryptoKey": { + "methods": [ "CreateCryptoKey" ] }, - "CreateCryptoKeyVersion": { - "methods": [ + "CreateCryptoKeyVersion": { + "methods": [ "CreateCryptoKeyVersion" ] }, - "CreateImportJob": { - "methods": [ + "CreateImportJob": { + "methods": [ "CreateImportJob" ] }, - "CreateKeyRing": { - "methods": [ + "CreateKeyRing": { + "methods": [ "CreateKeyRing" ] }, - "Decrypt": { - "methods": [ + "Decrypt": { + "methods": [ "Decrypt" ] }, - "DestroyCryptoKeyVersion": { - "methods": [ + "DestroyCryptoKeyVersion": { + "methods": [ "DestroyCryptoKeyVersion" ] }, - "Encrypt": { - "methods": [ + "Encrypt": { + "methods": [ "Encrypt" ] }, - "GetCryptoKey": { - "methods": [ + "GetCryptoKey": { + "methods": [ "GetCryptoKey" ] }, - "GetCryptoKeyVersion": { - "methods": [ + "GetCryptoKeyVersion": { + "methods": [ "GetCryptoKeyVersion" ] }, - "GetIamPolicy": { - "methods": [ + "GetIamPolicy": { + "methods": [ "GetIamPolicy" ] }, - "GetImportJob": { - "methods": [ + "GetImportJob": { + "methods": [ "GetImportJob" ] }, - "GetKeyRing": { - "methods": [ + "GetKeyRing": { + "methods": [ "GetKeyRing" ] }, - "GetPublicKey": { - "methods": [ + "GetPublicKey": { + "methods": [ "GetPublicKey" ] }, - "ImportCryptoKeyVersion": { - "methods": [ + "ImportCryptoKeyVersion": { + "methods": [ "ImportCryptoKeyVersion" ] }, - "ListCryptoKeyVersions": { - "methods": [ + "ListCryptoKeyVersions": { + "methods": [ "ListCryptoKeyVersions" ] }, - "ListCryptoKeys": { - "methods": [ + "ListCryptoKeys": { + "methods": [ "ListCryptoKeys" ] }, - "ListImportJobs": { - "methods": [ + "ListImportJobs": { + "methods": [ "ListImportJobs" ] }, - "ListKeyRings": { - "methods": [ + "ListKeyRings": { + "methods": [ "ListKeyRings" ] }, - "RestoreCryptoKeyVersion": { - "methods": [ + "RestoreCryptoKeyVersion": { + "methods": [ "RestoreCryptoKeyVersion" ] }, - "SetIamPolicy": { - "methods": [ + "SetIamPolicy": { + "methods": [ "SetIamPolicy" ] }, - "TestIamPermissions": { - "methods": [ + "TestIamPermissions": { + "methods": [ "TestIamPermissions" ] }, - "UpdateCryptoKey": { - "methods": [ + "UpdateCryptoKey": { + "methods": [ "UpdateCryptoKey" ] }, - "UpdateCryptoKeyPrimaryVersion": { - "methods": [ + "UpdateCryptoKeyPrimaryVersion": { + "methods": [ "UpdateCryptoKeyPrimaryVersion" ] }, - "UpdateCryptoKeyVersion": { - "methods": [ + "UpdateCryptoKeyVersion": { + "methods": [ "UpdateCryptoKeyVersion" ] } diff --git a/language/apiv1/doc.go b/language/apiv1/doc.go index 67e00822880..5dc45017abd 100644 --- a/language/apiv1/doc.go +++ b/language/apiv1/doc.go @@ -50,7 +50,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210630" +const versionClient = "20210701" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/language/apiv1/gapic_metadata.json b/language/apiv1/gapic_metadata.json index 18ce7e22ac8..f49ef2f8a6a 100644 --- a/language/apiv1/gapic_metadata.json +++ b/language/apiv1/gapic_metadata.json @@ -1,42 +1,42 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.language.v1", - "libraryPackage": "cloud.google.com/go/language/apiv1", - "services": { - "LanguageService": { - "clients": { - "grpc": { - "libraryClient": "Client", - "rpcs": { - "AnalyzeEntities": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.language.v1", + "libraryPackage": "cloud.google.com/go/language/apiv1", + "services": { + "LanguageService": { + "clients": { + "grpc": { + "libraryClient": "Client", + "rpcs": { + "AnalyzeEntities": { + "methods": [ "AnalyzeEntities" ] }, - "AnalyzeEntitySentiment": { - "methods": [ + "AnalyzeEntitySentiment": { + "methods": [ "AnalyzeEntitySentiment" ] }, - "AnalyzeSentiment": { - "methods": [ + "AnalyzeSentiment": { + "methods": [ "AnalyzeSentiment" ] }, - "AnalyzeSyntax": { - "methods": [ + "AnalyzeSyntax": { + "methods": [ "AnalyzeSyntax" ] }, - "AnnotateText": { - "methods": [ + "AnnotateText": { + "methods": [ "AnnotateText" ] }, - "ClassifyText": { - "methods": [ + "ClassifyText": { + "methods": [ "ClassifyText" ] } diff --git a/language/apiv1beta2/doc.go b/language/apiv1beta2/doc.go index b2c16b145ee..c5464428fee 100644 --- a/language/apiv1beta2/doc.go +++ b/language/apiv1beta2/doc.go @@ -52,7 +52,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210630" +const versionClient = "20210701" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/language/apiv1beta2/gapic_metadata.json b/language/apiv1beta2/gapic_metadata.json index bf3be50c7f0..8e23997306c 100644 --- a/language/apiv1beta2/gapic_metadata.json +++ b/language/apiv1beta2/gapic_metadata.json @@ -1,42 +1,42 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.language.v1beta2", - "libraryPackage": "cloud.google.com/go/language/apiv1beta2", - "services": { - "LanguageService": { - "clients": { - "grpc": { - "libraryClient": "Client", - "rpcs": { - "AnalyzeEntities": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.language.v1beta2", + "libraryPackage": "cloud.google.com/go/language/apiv1beta2", + "services": { + "LanguageService": { + "clients": { + "grpc": { + "libraryClient": "Client", + "rpcs": { + "AnalyzeEntities": { + "methods": [ "AnalyzeEntities" ] }, - "AnalyzeEntitySentiment": { - "methods": [ + "AnalyzeEntitySentiment": { + "methods": [ "AnalyzeEntitySentiment" ] }, - "AnalyzeSentiment": { - "methods": [ + "AnalyzeSentiment": { + "methods": [ "AnalyzeSentiment" ] }, - "AnalyzeSyntax": { - "methods": [ + "AnalyzeSyntax": { + "methods": [ "AnalyzeSyntax" ] }, - "AnnotateText": { - "methods": [ + "AnnotateText": { + "methods": [ "AnnotateText" ] }, - "ClassifyText": { - "methods": [ + "ClassifyText": { + "methods": [ "ClassifyText" ] } diff --git a/lifesciences/apiv2beta/doc.go b/lifesciences/apiv2beta/doc.go index ffd83191ee9..ef3dbf75a8b 100644 --- a/lifesciences/apiv2beta/doc.go +++ b/lifesciences/apiv2beta/doc.go @@ -51,7 +51,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210630" +const versionClient = "20210701" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/lifesciences/apiv2beta/gapic_metadata.json b/lifesciences/apiv2beta/gapic_metadata.json index c125f28e080..d809365ae65 100644 --- a/lifesciences/apiv2beta/gapic_metadata.json +++ b/lifesciences/apiv2beta/gapic_metadata.json @@ -1,17 +1,17 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.lifesciences.v2beta", - "libraryPackage": "cloud.google.com/go/lifesciences/apiv2beta", - "services": { - "WorkflowsServiceV2Beta": { - "clients": { - "grpc": { - "libraryClient": "WorkflowsServiceV2BetaClient", - "rpcs": { - "RunPipeline": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.lifesciences.v2beta", + "libraryPackage": "cloud.google.com/go/lifesciences/apiv2beta", + "services": { + "WorkflowsServiceV2Beta": { + "clients": { + "grpc": { + "libraryClient": "WorkflowsServiceV2BetaClient", + "rpcs": { + "RunPipeline": { + "methods": [ "RunPipeline" ] } diff --git a/logging/apiv2/doc.go b/logging/apiv2/doc.go index 157799f9ebb..4958f8c808f 100644 --- a/logging/apiv2/doc.go +++ b/logging/apiv2/doc.go @@ -52,7 +52,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210630" +const versionClient = "20210701" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/logging/apiv2/gapic_metadata.json b/logging/apiv2/gapic_metadata.json index 63cb6a90b3d..9636e5a0ced 100644 --- a/logging/apiv2/gapic_metadata.json +++ b/logging/apiv2/gapic_metadata.json @@ -1,127 +1,127 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.logging.v2", - "libraryPackage": "cloud.google.com/go/logging/apiv2", - "services": { - "ConfigServiceV2": { - "clients": { - "grpc": { - "libraryClient": "ConfigClient", - "rpcs": { - "CreateBucket": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.logging.v2", + "libraryPackage": "cloud.google.com/go/logging/apiv2", + "services": { + "ConfigServiceV2": { + "clients": { + "grpc": { + "libraryClient": "ConfigClient", + "rpcs": { + "CreateBucket": { + "methods": [ "CreateBucket" ] }, - "CreateExclusion": { - "methods": [ + "CreateExclusion": { + "methods": [ "CreateExclusion" ] }, - "CreateSink": { - "methods": [ + "CreateSink": { + "methods": [ "CreateSink" ] }, - "CreateView": { - "methods": [ + "CreateView": { + "methods": [ "CreateView" ] }, - "DeleteBucket": { - "methods": [ + "DeleteBucket": { + "methods": [ "DeleteBucket" ] }, - "DeleteExclusion": { - "methods": [ + "DeleteExclusion": { + "methods": [ "DeleteExclusion" ] }, - "DeleteSink": { - "methods": [ + "DeleteSink": { + "methods": [ "DeleteSink" ] }, - "DeleteView": { - "methods": [ + "DeleteView": { + "methods": [ "DeleteView" ] }, - "GetBucket": { - "methods": [ + "GetBucket": { + "methods": [ "GetBucket" ] }, - "GetCmekSettings": { - "methods": [ + "GetCmekSettings": { + "methods": [ "GetCmekSettings" ] }, - "GetExclusion": { - "methods": [ + "GetExclusion": { + "methods": [ "GetExclusion" ] }, - "GetSink": { - "methods": [ + "GetSink": { + "methods": [ "GetSink" ] }, - "GetView": { - "methods": [ + "GetView": { + "methods": [ "GetView" ] }, - "ListBuckets": { - "methods": [ + "ListBuckets": { + "methods": [ "ListBuckets" ] }, - "ListExclusions": { - "methods": [ + "ListExclusions": { + "methods": [ "ListExclusions" ] }, - "ListSinks": { - "methods": [ + "ListSinks": { + "methods": [ "ListSinks" ] }, - "ListViews": { - "methods": [ + "ListViews": { + "methods": [ "ListViews" ] }, - "UndeleteBucket": { - "methods": [ + "UndeleteBucket": { + "methods": [ "UndeleteBucket" ] }, - "UpdateBucket": { - "methods": [ + "UpdateBucket": { + "methods": [ "UpdateBucket" ] }, - "UpdateCmekSettings": { - "methods": [ + "UpdateCmekSettings": { + "methods": [ "UpdateCmekSettings" ] }, - "UpdateExclusion": { - "methods": [ + "UpdateExclusion": { + "methods": [ "UpdateExclusion" ] }, - "UpdateSink": { - "methods": [ + "UpdateSink": { + "methods": [ "UpdateSink" ] }, - "UpdateView": { - "methods": [ + "UpdateView": { + "methods": [ "UpdateView" ] } @@ -129,38 +129,38 @@ } } }, - "LoggingServiceV2": { - "clients": { - "grpc": { - "libraryClient": "Client", - "rpcs": { - "DeleteLog": { - "methods": [ + "LoggingServiceV2": { + "clients": { + "grpc": { + "libraryClient": "Client", + "rpcs": { + "DeleteLog": { + "methods": [ "DeleteLog" ] }, - "ListLogEntries": { - "methods": [ + "ListLogEntries": { + "methods": [ "ListLogEntries" ] }, - "ListLogs": { - "methods": [ + "ListLogs": { + "methods": [ "ListLogs" ] }, - "ListMonitoredResourceDescriptors": { - "methods": [ + "ListMonitoredResourceDescriptors": { + "methods": [ "ListMonitoredResourceDescriptors" ] }, - "TailLogEntries": { - "methods": [ + "TailLogEntries": { + "methods": [ "TailLogEntries" ] }, - "WriteLogEntries": { - "methods": [ + "WriteLogEntries": { + "methods": [ "WriteLogEntries" ] } @@ -168,33 +168,33 @@ } } }, - "MetricsServiceV2": { - "clients": { - "grpc": { - "libraryClient": "MetricsClient", - "rpcs": { - "CreateLogMetric": { - "methods": [ + "MetricsServiceV2": { + "clients": { + "grpc": { + "libraryClient": "MetricsClient", + "rpcs": { + "CreateLogMetric": { + "methods": [ "CreateLogMetric" ] }, - "DeleteLogMetric": { - "methods": [ + "DeleteLogMetric": { + "methods": [ "DeleteLogMetric" ] }, - "GetLogMetric": { - "methods": [ + "GetLogMetric": { + "methods": [ "GetLogMetric" ] }, - "ListLogMetrics": { - "methods": [ + "ListLogMetrics": { + "methods": [ "ListLogMetrics" ] }, - "UpdateLogMetric": { - "methods": [ + "UpdateLogMetric": { + "methods": [ "UpdateLogMetric" ] } diff --git a/logging/go.mod b/logging/go.mod index 5842c20700e..b0f7fe80ff6 100644 --- a/logging/go.mod +++ b/logging/go.mod @@ -11,7 +11,7 @@ require ( go.opencensus.io v0.23.0 golang.org/x/oauth2 v0.0.0-20210628180205-a41e5a781914 google.golang.org/api v0.50.0 - google.golang.org/genproto v0.0.0-20210630183607-d20f26d13c79 + google.golang.org/genproto v0.0.0-20210701133433-6b8dcf568a95 google.golang.org/grpc v1.38.0 google.golang.org/protobuf v1.27.1 ) diff --git a/logging/go.sum b/logging/go.sum index ccd16df4d1b..41ab982999f 100644 --- a/logging/go.sum +++ b/logging/go.sum @@ -455,8 +455,8 @@ google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxH google.golang.org/genproto v0.0.0-20210604141403-392c879c8b08/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= google.golang.org/genproto v0.0.0-20210608205507-b6d2f5bf0d7d/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= google.golang.org/genproto v0.0.0-20210624195500-8bfb893ecb84/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24= -google.golang.org/genproto v0.0.0-20210630183607-d20f26d13c79 h1:s1jFTXJryg4a1mew7xv03VZD8N9XjxFhk1o4Js4WvPQ= -google.golang.org/genproto v0.0.0-20210630183607-d20f26d13c79/go.mod h1:yiaVoXHpRzHGyxV3o4DktVWY4mSUErTKaeEOq6C3t3U= +google.golang.org/genproto v0.0.0-20210701133433-6b8dcf568a95 h1:xyRjacsGcaSoZ2fTcaLCSzh2JEceLLOT4X8k32Q0xAQ= +google.golang.org/genproto v0.0.0-20210701133433-6b8dcf568a95/go.mod h1:yiaVoXHpRzHGyxV3o4DktVWY4mSUErTKaeEOq6C3t3U= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= diff --git a/longrunning/autogen/doc.go b/longrunning/autogen/doc.go index 7aee7d39003..33bf0f3db74 100644 --- a/longrunning/autogen/doc.go +++ b/longrunning/autogen/doc.go @@ -48,7 +48,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210630" +const versionClient = "20210701" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/longrunning/autogen/gapic_metadata.json b/longrunning/autogen/gapic_metadata.json index 8489336a675..eff1271b207 100644 --- a/longrunning/autogen/gapic_metadata.json +++ b/longrunning/autogen/gapic_metadata.json @@ -1,37 +1,37 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.longrunning", - "libraryPackage": "cloud.google.com/go/longrunning/autogen", - "services": { - "Operations": { - "clients": { - "grpc": { - "libraryClient": "OperationsClient", - "rpcs": { - "CancelOperation": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.longrunning", + "libraryPackage": "cloud.google.com/go/longrunning/autogen", + "services": { + "Operations": { + "clients": { + "grpc": { + "libraryClient": "OperationsClient", + "rpcs": { + "CancelOperation": { + "methods": [ "CancelOperation" ] }, - "DeleteOperation": { - "methods": [ + "DeleteOperation": { + "methods": [ "DeleteOperation" ] }, - "GetOperation": { - "methods": [ + "GetOperation": { + "methods": [ "GetOperation" ] }, - "ListOperations": { - "methods": [ + "ListOperations": { + "methods": [ "ListOperations" ] }, - "WaitOperation": { - "methods": [ + "WaitOperation": { + "methods": [ "WaitOperation" ] } diff --git a/managedidentities/apiv1/doc.go b/managedidentities/apiv1/doc.go index 6225a551cdd..e9b40495836 100644 --- a/managedidentities/apiv1/doc.go +++ b/managedidentities/apiv1/doc.go @@ -50,7 +50,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210630" +const versionClient = "20210701" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/managedidentities/apiv1/gapic_metadata.json b/managedidentities/apiv1/gapic_metadata.json index d1c3eaa8899..4277b2fe80f 100644 --- a/managedidentities/apiv1/gapic_metadata.json +++ b/managedidentities/apiv1/gapic_metadata.json @@ -1,62 +1,62 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.managedidentities.v1", - "libraryPackage": "cloud.google.com/go/managedidentities/apiv1", - "services": { - "ManagedIdentitiesService": { - "clients": { - "grpc": { - "libraryClient": "Client", - "rpcs": { - "AttachTrust": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.managedidentities.v1", + "libraryPackage": "cloud.google.com/go/managedidentities/apiv1", + "services": { + "ManagedIdentitiesService": { + "clients": { + "grpc": { + "libraryClient": "Client", + "rpcs": { + "AttachTrust": { + "methods": [ "AttachTrust" ] }, - "CreateMicrosoftAdDomain": { - "methods": [ + "CreateMicrosoftAdDomain": { + "methods": [ "CreateMicrosoftAdDomain" ] }, - "DeleteDomain": { - "methods": [ + "DeleteDomain": { + "methods": [ "DeleteDomain" ] }, - "DetachTrust": { - "methods": [ + "DetachTrust": { + "methods": [ "DetachTrust" ] }, - "GetDomain": { - "methods": [ + "GetDomain": { + "methods": [ "GetDomain" ] }, - "ListDomains": { - "methods": [ + "ListDomains": { + "methods": [ "ListDomains" ] }, - "ReconfigureTrust": { - "methods": [ + "ReconfigureTrust": { + "methods": [ "ReconfigureTrust" ] }, - "ResetAdminPassword": { - "methods": [ + "ResetAdminPassword": { + "methods": [ "ResetAdminPassword" ] }, - "UpdateDomain": { - "methods": [ + "UpdateDomain": { + "methods": [ "UpdateDomain" ] }, - "ValidateTrust": { - "methods": [ + "ValidateTrust": { + "methods": [ "ValidateTrust" ] } diff --git a/mediatranslation/apiv1beta1/doc.go b/mediatranslation/apiv1beta1/doc.go index 8b6811bef26..80c2dfc4ec5 100644 --- a/mediatranslation/apiv1beta1/doc.go +++ b/mediatranslation/apiv1beta1/doc.go @@ -48,7 +48,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210630" +const versionClient = "20210701" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/mediatranslation/apiv1beta1/gapic_metadata.json b/mediatranslation/apiv1beta1/gapic_metadata.json index 720f4cab379..8ce9729bf44 100644 --- a/mediatranslation/apiv1beta1/gapic_metadata.json +++ b/mediatranslation/apiv1beta1/gapic_metadata.json @@ -1,17 +1,17 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.mediatranslation.v1beta1", - "libraryPackage": "cloud.google.com/go/mediatranslation/apiv1beta1", - "services": { - "SpeechTranslationService": { - "clients": { - "grpc": { - "libraryClient": "SpeechTranslationClient", - "rpcs": { - "StreamingTranslateSpeech": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.mediatranslation.v1beta1", + "libraryPackage": "cloud.google.com/go/mediatranslation/apiv1beta1", + "services": { + "SpeechTranslationService": { + "clients": { + "grpc": { + "libraryClient": "SpeechTranslationClient", + "rpcs": { + "StreamingTranslateSpeech": { + "methods": [ "StreamingTranslateSpeech" ] } diff --git a/memcache/apiv1/doc.go b/memcache/apiv1/doc.go index 53c4fa8bf59..f891f3f3dd0 100644 --- a/memcache/apiv1/doc.go +++ b/memcache/apiv1/doc.go @@ -49,7 +49,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210630" +const versionClient = "20210701" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/memcache/apiv1/gapic_metadata.json b/memcache/apiv1/gapic_metadata.json index 3d1d457865d..5ceb74dbd7f 100644 --- a/memcache/apiv1/gapic_metadata.json +++ b/memcache/apiv1/gapic_metadata.json @@ -1,47 +1,47 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.memcache.v1", - "libraryPackage": "cloud.google.com/go/memcache/apiv1", - "services": { - "CloudMemcache": { - "clients": { - "grpc": { - "libraryClient": "CloudMemcacheClient", - "rpcs": { - "ApplyParameters": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.memcache.v1", + "libraryPackage": "cloud.google.com/go/memcache/apiv1", + "services": { + "CloudMemcache": { + "clients": { + "grpc": { + "libraryClient": "CloudMemcacheClient", + "rpcs": { + "ApplyParameters": { + "methods": [ "ApplyParameters" ] }, - "CreateInstance": { - "methods": [ + "CreateInstance": { + "methods": [ "CreateInstance" ] }, - "DeleteInstance": { - "methods": [ + "DeleteInstance": { + "methods": [ "DeleteInstance" ] }, - "GetInstance": { - "methods": [ + "GetInstance": { + "methods": [ "GetInstance" ] }, - "ListInstances": { - "methods": [ + "ListInstances": { + "methods": [ "ListInstances" ] }, - "UpdateInstance": { - "methods": [ + "UpdateInstance": { + "methods": [ "UpdateInstance" ] }, - "UpdateParameters": { - "methods": [ + "UpdateParameters": { + "methods": [ "UpdateParameters" ] } diff --git a/memcache/apiv1beta2/doc.go b/memcache/apiv1beta2/doc.go index f4fcbf8e7af..da5a4241192 100644 --- a/memcache/apiv1beta2/doc.go +++ b/memcache/apiv1beta2/doc.go @@ -51,7 +51,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210630" +const versionClient = "20210701" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/memcache/apiv1beta2/gapic_metadata.json b/memcache/apiv1beta2/gapic_metadata.json index 5e76a018271..6efa801fe86 100644 --- a/memcache/apiv1beta2/gapic_metadata.json +++ b/memcache/apiv1beta2/gapic_metadata.json @@ -1,52 +1,52 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.memcache.v1beta2", - "libraryPackage": "cloud.google.com/go/memcache/apiv1beta2", - "services": { - "CloudMemcache": { - "clients": { - "grpc": { - "libraryClient": "CloudMemcacheClient", - "rpcs": { - "ApplyParameters": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.memcache.v1beta2", + "libraryPackage": "cloud.google.com/go/memcache/apiv1beta2", + "services": { + "CloudMemcache": { + "clients": { + "grpc": { + "libraryClient": "CloudMemcacheClient", + "rpcs": { + "ApplyParameters": { + "methods": [ "ApplyParameters" ] }, - "ApplySoftwareUpdate": { - "methods": [ + "ApplySoftwareUpdate": { + "methods": [ "ApplySoftwareUpdate" ] }, - "CreateInstance": { - "methods": [ + "CreateInstance": { + "methods": [ "CreateInstance" ] }, - "DeleteInstance": { - "methods": [ + "DeleteInstance": { + "methods": [ "DeleteInstance" ] }, - "GetInstance": { - "methods": [ + "GetInstance": { + "methods": [ "GetInstance" ] }, - "ListInstances": { - "methods": [ + "ListInstances": { + "methods": [ "ListInstances" ] }, - "UpdateInstance": { - "methods": [ + "UpdateInstance": { + "methods": [ "UpdateInstance" ] }, - "UpdateParameters": { - "methods": [ + "UpdateParameters": { + "methods": [ "UpdateParameters" ] } diff --git a/metastore/apiv1/doc.go b/metastore/apiv1/doc.go index 30a894666f8..cc4984a4ec6 100644 --- a/metastore/apiv1/doc.go +++ b/metastore/apiv1/doc.go @@ -49,7 +49,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210630" +const versionClient = "20210701" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/metastore/apiv1/gapic_metadata.json b/metastore/apiv1/gapic_metadata.json index e5ec3bd4e15..373a5e1dcb4 100644 --- a/metastore/apiv1/gapic_metadata.json +++ b/metastore/apiv1/gapic_metadata.json @@ -1,62 +1,62 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.metastore.v1", - "libraryPackage": "cloud.google.com/go/metastore/apiv1", - "services": { - "DataprocMetastore": { - "clients": { - "grpc": { - "libraryClient": "DataprocMetastoreClient", - "rpcs": { - "CreateMetadataImport": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.metastore.v1", + "libraryPackage": "cloud.google.com/go/metastore/apiv1", + "services": { + "DataprocMetastore": { + "clients": { + "grpc": { + "libraryClient": "DataprocMetastoreClient", + "rpcs": { + "CreateMetadataImport": { + "methods": [ "CreateMetadataImport" ] }, - "CreateService": { - "methods": [ + "CreateService": { + "methods": [ "CreateService" ] }, - "DeleteService": { - "methods": [ + "DeleteService": { + "methods": [ "DeleteService" ] }, - "ExportMetadata": { - "methods": [ + "ExportMetadata": { + "methods": [ "ExportMetadata" ] }, - "GetMetadataImport": { - "methods": [ + "GetMetadataImport": { + "methods": [ "GetMetadataImport" ] }, - "GetService": { - "methods": [ + "GetService": { + "methods": [ "GetService" ] }, - "ListMetadataImports": { - "methods": [ + "ListMetadataImports": { + "methods": [ "ListMetadataImports" ] }, - "ListServices": { - "methods": [ + "ListServices": { + "methods": [ "ListServices" ] }, - "UpdateMetadataImport": { - "methods": [ + "UpdateMetadataImport": { + "methods": [ "UpdateMetadataImport" ] }, - "UpdateService": { - "methods": [ + "UpdateService": { + "methods": [ "UpdateService" ] } diff --git a/metastore/apiv1alpha/doc.go b/metastore/apiv1alpha/doc.go index 157b3d77723..c7abcb3c484 100644 --- a/metastore/apiv1alpha/doc.go +++ b/metastore/apiv1alpha/doc.go @@ -51,7 +51,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210630" +const versionClient = "20210701" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/metastore/apiv1alpha/gapic_metadata.json b/metastore/apiv1alpha/gapic_metadata.json index 682ed11bb1d..868989b8406 100644 --- a/metastore/apiv1alpha/gapic_metadata.json +++ b/metastore/apiv1alpha/gapic_metadata.json @@ -1,87 +1,87 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.metastore.v1alpha", - "libraryPackage": "cloud.google.com/go/metastore/apiv1alpha", - "services": { - "DataprocMetastore": { - "clients": { - "grpc": { - "libraryClient": "DataprocMetastoreClient", - "rpcs": { - "CreateBackup": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.metastore.v1alpha", + "libraryPackage": "cloud.google.com/go/metastore/apiv1alpha", + "services": { + "DataprocMetastore": { + "clients": { + "grpc": { + "libraryClient": "DataprocMetastoreClient", + "rpcs": { + "CreateBackup": { + "methods": [ "CreateBackup" ] }, - "CreateMetadataImport": { - "methods": [ + "CreateMetadataImport": { + "methods": [ "CreateMetadataImport" ] }, - "CreateService": { - "methods": [ + "CreateService": { + "methods": [ "CreateService" ] }, - "DeleteBackup": { - "methods": [ + "DeleteBackup": { + "methods": [ "DeleteBackup" ] }, - "DeleteService": { - "methods": [ + "DeleteService": { + "methods": [ "DeleteService" ] }, - "ExportMetadata": { - "methods": [ + "ExportMetadata": { + "methods": [ "ExportMetadata" ] }, - "GetBackup": { - "methods": [ + "GetBackup": { + "methods": [ "GetBackup" ] }, - "GetMetadataImport": { - "methods": [ + "GetMetadataImport": { + "methods": [ "GetMetadataImport" ] }, - "GetService": { - "methods": [ + "GetService": { + "methods": [ "GetService" ] }, - "ListBackups": { - "methods": [ + "ListBackups": { + "methods": [ "ListBackups" ] }, - "ListMetadataImports": { - "methods": [ + "ListMetadataImports": { + "methods": [ "ListMetadataImports" ] }, - "ListServices": { - "methods": [ + "ListServices": { + "methods": [ "ListServices" ] }, - "RestoreService": { - "methods": [ + "RestoreService": { + "methods": [ "RestoreService" ] }, - "UpdateMetadataImport": { - "methods": [ + "UpdateMetadataImport": { + "methods": [ "UpdateMetadataImport" ] }, - "UpdateService": { - "methods": [ + "UpdateService": { + "methods": [ "UpdateService" ] } diff --git a/metastore/apiv1beta/doc.go b/metastore/apiv1beta/doc.go index 22c07e96de8..2f95d1c0f45 100644 --- a/metastore/apiv1beta/doc.go +++ b/metastore/apiv1beta/doc.go @@ -51,7 +51,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210630" +const versionClient = "20210701" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/metastore/apiv1beta/gapic_metadata.json b/metastore/apiv1beta/gapic_metadata.json index fb3f0a82e73..187c5316678 100644 --- a/metastore/apiv1beta/gapic_metadata.json +++ b/metastore/apiv1beta/gapic_metadata.json @@ -1,87 +1,87 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.metastore.v1beta", - "libraryPackage": "cloud.google.com/go/metastore/apiv1beta", - "services": { - "DataprocMetastore": { - "clients": { - "grpc": { - "libraryClient": "DataprocMetastoreClient", - "rpcs": { - "CreateBackup": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.metastore.v1beta", + "libraryPackage": "cloud.google.com/go/metastore/apiv1beta", + "services": { + "DataprocMetastore": { + "clients": { + "grpc": { + "libraryClient": "DataprocMetastoreClient", + "rpcs": { + "CreateBackup": { + "methods": [ "CreateBackup" ] }, - "CreateMetadataImport": { - "methods": [ + "CreateMetadataImport": { + "methods": [ "CreateMetadataImport" ] }, - "CreateService": { - "methods": [ + "CreateService": { + "methods": [ "CreateService" ] }, - "DeleteBackup": { - "methods": [ + "DeleteBackup": { + "methods": [ "DeleteBackup" ] }, - "DeleteService": { - "methods": [ + "DeleteService": { + "methods": [ "DeleteService" ] }, - "ExportMetadata": { - "methods": [ + "ExportMetadata": { + "methods": [ "ExportMetadata" ] }, - "GetBackup": { - "methods": [ + "GetBackup": { + "methods": [ "GetBackup" ] }, - "GetMetadataImport": { - "methods": [ + "GetMetadataImport": { + "methods": [ "GetMetadataImport" ] }, - "GetService": { - "methods": [ + "GetService": { + "methods": [ "GetService" ] }, - "ListBackups": { - "methods": [ + "ListBackups": { + "methods": [ "ListBackups" ] }, - "ListMetadataImports": { - "methods": [ + "ListMetadataImports": { + "methods": [ "ListMetadataImports" ] }, - "ListServices": { - "methods": [ + "ListServices": { + "methods": [ "ListServices" ] }, - "RestoreService": { - "methods": [ + "RestoreService": { + "methods": [ "RestoreService" ] }, - "UpdateMetadataImport": { - "methods": [ + "UpdateMetadataImport": { + "methods": [ "UpdateMetadataImport" ] }, - "UpdateService": { - "methods": [ + "UpdateService": { + "methods": [ "UpdateService" ] } diff --git a/monitoring/apiv3/v2/doc.go b/monitoring/apiv3/v2/doc.go index 27fe565031f..e8f1d363d8d 100644 --- a/monitoring/apiv3/v2/doc.go +++ b/monitoring/apiv3/v2/doc.go @@ -53,7 +53,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210630" +const versionClient = "20210701" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/monitoring/apiv3/v2/gapic_metadata.json b/monitoring/apiv3/v2/gapic_metadata.json index 8b42e15d29b..c522dbe1359 100644 --- a/monitoring/apiv3/v2/gapic_metadata.json +++ b/monitoring/apiv3/v2/gapic_metadata.json @@ -1,37 +1,37 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.monitoring.v3", - "libraryPackage": "cloud.google.com/go/monitoring/apiv3/v2", - "services": { - "AlertPolicyService": { - "clients": { - "grpc": { - "libraryClient": "AlertPolicyClient", - "rpcs": { - "CreateAlertPolicy": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.monitoring.v3", + "libraryPackage": "cloud.google.com/go/monitoring/apiv3/v2", + "services": { + "AlertPolicyService": { + "clients": { + "grpc": { + "libraryClient": "AlertPolicyClient", + "rpcs": { + "CreateAlertPolicy": { + "methods": [ "CreateAlertPolicy" ] }, - "DeleteAlertPolicy": { - "methods": [ + "DeleteAlertPolicy": { + "methods": [ "DeleteAlertPolicy" ] }, - "GetAlertPolicy": { - "methods": [ + "GetAlertPolicy": { + "methods": [ "GetAlertPolicy" ] }, - "ListAlertPolicies": { - "methods": [ + "ListAlertPolicies": { + "methods": [ "ListAlertPolicies" ] }, - "UpdateAlertPolicy": { - "methods": [ + "UpdateAlertPolicy": { + "methods": [ "UpdateAlertPolicy" ] } @@ -39,38 +39,38 @@ } } }, - "GroupService": { - "clients": { - "grpc": { - "libraryClient": "GroupClient", - "rpcs": { - "CreateGroup": { - "methods": [ + "GroupService": { + "clients": { + "grpc": { + "libraryClient": "GroupClient", + "rpcs": { + "CreateGroup": { + "methods": [ "CreateGroup" ] }, - "DeleteGroup": { - "methods": [ + "DeleteGroup": { + "methods": [ "DeleteGroup" ] }, - "GetGroup": { - "methods": [ + "GetGroup": { + "methods": [ "GetGroup" ] }, - "ListGroupMembers": { - "methods": [ + "ListGroupMembers": { + "methods": [ "ListGroupMembers" ] }, - "ListGroups": { - "methods": [ + "ListGroups": { + "methods": [ "ListGroups" ] }, - "UpdateGroup": { - "methods": [ + "UpdateGroup": { + "methods": [ "UpdateGroup" ] } @@ -78,48 +78,48 @@ } } }, - "MetricService": { - "clients": { - "grpc": { - "libraryClient": "MetricClient", - "rpcs": { - "CreateMetricDescriptor": { - "methods": [ + "MetricService": { + "clients": { + "grpc": { + "libraryClient": "MetricClient", + "rpcs": { + "CreateMetricDescriptor": { + "methods": [ "CreateMetricDescriptor" ] }, - "CreateTimeSeries": { - "methods": [ + "CreateTimeSeries": { + "methods": [ "CreateTimeSeries" ] }, - "DeleteMetricDescriptor": { - "methods": [ + "DeleteMetricDescriptor": { + "methods": [ "DeleteMetricDescriptor" ] }, - "GetMetricDescriptor": { - "methods": [ + "GetMetricDescriptor": { + "methods": [ "GetMetricDescriptor" ] }, - "GetMonitoredResourceDescriptor": { - "methods": [ + "GetMonitoredResourceDescriptor": { + "methods": [ "GetMonitoredResourceDescriptor" ] }, - "ListMetricDescriptors": { - "methods": [ + "ListMetricDescriptors": { + "methods": [ "ListMetricDescriptors" ] }, - "ListMonitoredResourceDescriptors": { - "methods": [ + "ListMonitoredResourceDescriptors": { + "methods": [ "ListMonitoredResourceDescriptors" ] }, - "ListTimeSeries": { - "methods": [ + "ListTimeSeries": { + "methods": [ "ListTimeSeries" ] } @@ -127,58 +127,58 @@ } } }, - "NotificationChannelService": { - "clients": { - "grpc": { - "libraryClient": "NotificationChannelClient", - "rpcs": { - "CreateNotificationChannel": { - "methods": [ + "NotificationChannelService": { + "clients": { + "grpc": { + "libraryClient": "NotificationChannelClient", + "rpcs": { + "CreateNotificationChannel": { + "methods": [ "CreateNotificationChannel" ] }, - "DeleteNotificationChannel": { - "methods": [ + "DeleteNotificationChannel": { + "methods": [ "DeleteNotificationChannel" ] }, - "GetNotificationChannel": { - "methods": [ + "GetNotificationChannel": { + "methods": [ "GetNotificationChannel" ] }, - "GetNotificationChannelDescriptor": { - "methods": [ + "GetNotificationChannelDescriptor": { + "methods": [ "GetNotificationChannelDescriptor" ] }, - "GetNotificationChannelVerificationCode": { - "methods": [ + "GetNotificationChannelVerificationCode": { + "methods": [ "GetNotificationChannelVerificationCode" ] }, - "ListNotificationChannelDescriptors": { - "methods": [ + "ListNotificationChannelDescriptors": { + "methods": [ "ListNotificationChannelDescriptors" ] }, - "ListNotificationChannels": { - "methods": [ + "ListNotificationChannels": { + "methods": [ "ListNotificationChannels" ] }, - "SendNotificationChannelVerificationCode": { - "methods": [ + "SendNotificationChannelVerificationCode": { + "methods": [ "SendNotificationChannelVerificationCode" ] }, - "UpdateNotificationChannel": { - "methods": [ + "UpdateNotificationChannel": { + "methods": [ "UpdateNotificationChannel" ] }, - "VerifyNotificationChannel": { - "methods": [ + "VerifyNotificationChannel": { + "methods": [ "VerifyNotificationChannel" ] } @@ -186,13 +186,13 @@ } } }, - "QueryService": { - "clients": { - "grpc": { - "libraryClient": "QueryClient", - "rpcs": { - "QueryTimeSeries": { - "methods": [ + "QueryService": { + "clients": { + "grpc": { + "libraryClient": "QueryClient", + "rpcs": { + "QueryTimeSeries": { + "methods": [ "QueryTimeSeries" ] } @@ -200,58 +200,58 @@ } } }, - "ServiceMonitoringService": { - "clients": { - "grpc": { - "libraryClient": "ServiceMonitoringClient", - "rpcs": { - "CreateService": { - "methods": [ + "ServiceMonitoringService": { + "clients": { + "grpc": { + "libraryClient": "ServiceMonitoringClient", + "rpcs": { + "CreateService": { + "methods": [ "CreateService" ] }, - "CreateServiceLevelObjective": { - "methods": [ + "CreateServiceLevelObjective": { + "methods": [ "CreateServiceLevelObjective" ] }, - "DeleteService": { - "methods": [ + "DeleteService": { + "methods": [ "DeleteService" ] }, - "DeleteServiceLevelObjective": { - "methods": [ + "DeleteServiceLevelObjective": { + "methods": [ "DeleteServiceLevelObjective" ] }, - "GetService": { - "methods": [ + "GetService": { + "methods": [ "GetService" ] }, - "GetServiceLevelObjective": { - "methods": [ + "GetServiceLevelObjective": { + "methods": [ "GetServiceLevelObjective" ] }, - "ListServiceLevelObjectives": { - "methods": [ + "ListServiceLevelObjectives": { + "methods": [ "ListServiceLevelObjectives" ] }, - "ListServices": { - "methods": [ + "ListServices": { + "methods": [ "ListServices" ] }, - "UpdateService": { - "methods": [ + "UpdateService": { + "methods": [ "UpdateService" ] }, - "UpdateServiceLevelObjective": { - "methods": [ + "UpdateServiceLevelObjective": { + "methods": [ "UpdateServiceLevelObjective" ] } @@ -259,38 +259,38 @@ } } }, - "UptimeCheckService": { - "clients": { - "grpc": { - "libraryClient": "UptimeCheckClient", - "rpcs": { - "CreateUptimeCheckConfig": { - "methods": [ + "UptimeCheckService": { + "clients": { + "grpc": { + "libraryClient": "UptimeCheckClient", + "rpcs": { + "CreateUptimeCheckConfig": { + "methods": [ "CreateUptimeCheckConfig" ] }, - "DeleteUptimeCheckConfig": { - "methods": [ + "DeleteUptimeCheckConfig": { + "methods": [ "DeleteUptimeCheckConfig" ] }, - "GetUptimeCheckConfig": { - "methods": [ + "GetUptimeCheckConfig": { + "methods": [ "GetUptimeCheckConfig" ] }, - "ListUptimeCheckConfigs": { - "methods": [ + "ListUptimeCheckConfigs": { + "methods": [ "ListUptimeCheckConfigs" ] }, - "ListUptimeCheckIps": { - "methods": [ + "ListUptimeCheckIps": { + "methods": [ "ListUptimeCheckIps" ] }, - "UpdateUptimeCheckConfig": { - "methods": [ + "UpdateUptimeCheckConfig": { + "methods": [ "UpdateUptimeCheckConfig" ] } diff --git a/monitoring/dashboard/apiv1/doc.go b/monitoring/dashboard/apiv1/doc.go index 729b4640d95..271cc826068 100644 --- a/monitoring/dashboard/apiv1/doc.go +++ b/monitoring/dashboard/apiv1/doc.go @@ -53,7 +53,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210630" +const versionClient = "20210701" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/monitoring/dashboard/apiv1/gapic_metadata.json b/monitoring/dashboard/apiv1/gapic_metadata.json index 09b473804ce..28ca5eb4c1c 100644 --- a/monitoring/dashboard/apiv1/gapic_metadata.json +++ b/monitoring/dashboard/apiv1/gapic_metadata.json @@ -1,37 +1,37 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.monitoring.dashboard.v1", - "libraryPackage": "cloud.google.com/go/monitoring/dashboard/apiv1", - "services": { - "DashboardsService": { - "clients": { - "grpc": { - "libraryClient": "DashboardsClient", - "rpcs": { - "CreateDashboard": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.monitoring.dashboard.v1", + "libraryPackage": "cloud.google.com/go/monitoring/dashboard/apiv1", + "services": { + "DashboardsService": { + "clients": { + "grpc": { + "libraryClient": "DashboardsClient", + "rpcs": { + "CreateDashboard": { + "methods": [ "CreateDashboard" ] }, - "DeleteDashboard": { - "methods": [ + "DeleteDashboard": { + "methods": [ "DeleteDashboard" ] }, - "GetDashboard": { - "methods": [ + "GetDashboard": { + "methods": [ "GetDashboard" ] }, - "ListDashboards": { - "methods": [ + "ListDashboards": { + "methods": [ "ListDashboards" ] }, - "UpdateDashboard": { - "methods": [ + "UpdateDashboard": { + "methods": [ "UpdateDashboard" ] } diff --git a/networkconnectivity/apiv1alpha1/doc.go b/networkconnectivity/apiv1alpha1/doc.go index e6011482360..f93d846129a 100644 --- a/networkconnectivity/apiv1alpha1/doc.go +++ b/networkconnectivity/apiv1alpha1/doc.go @@ -51,7 +51,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210630" +const versionClient = "20210701" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/networkconnectivity/apiv1alpha1/gapic_metadata.json b/networkconnectivity/apiv1alpha1/gapic_metadata.json index 350849dea78..500541cde0f 100644 --- a/networkconnectivity/apiv1alpha1/gapic_metadata.json +++ b/networkconnectivity/apiv1alpha1/gapic_metadata.json @@ -1,62 +1,62 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.networkconnectivity.v1alpha1", - "libraryPackage": "cloud.google.com/go/networkconnectivity/apiv1alpha1", - "services": { - "HubService": { - "clients": { - "grpc": { - "libraryClient": "HubClient", - "rpcs": { - "CreateHub": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.networkconnectivity.v1alpha1", + "libraryPackage": "cloud.google.com/go/networkconnectivity/apiv1alpha1", + "services": { + "HubService": { + "clients": { + "grpc": { + "libraryClient": "HubClient", + "rpcs": { + "CreateHub": { + "methods": [ "CreateHub" ] }, - "CreateSpoke": { - "methods": [ + "CreateSpoke": { + "methods": [ "CreateSpoke" ] }, - "DeleteHub": { - "methods": [ + "DeleteHub": { + "methods": [ "DeleteHub" ] }, - "DeleteSpoke": { - "methods": [ + "DeleteSpoke": { + "methods": [ "DeleteSpoke" ] }, - "GetHub": { - "methods": [ + "GetHub": { + "methods": [ "GetHub" ] }, - "GetSpoke": { - "methods": [ + "GetSpoke": { + "methods": [ "GetSpoke" ] }, - "ListHubs": { - "methods": [ + "ListHubs": { + "methods": [ "ListHubs" ] }, - "ListSpokes": { - "methods": [ + "ListSpokes": { + "methods": [ "ListSpokes" ] }, - "UpdateHub": { - "methods": [ + "UpdateHub": { + "methods": [ "UpdateHub" ] }, - "UpdateSpoke": { - "methods": [ + "UpdateSpoke": { + "methods": [ "UpdateSpoke" ] } diff --git a/notebooks/apiv1beta1/doc.go b/notebooks/apiv1beta1/doc.go index 0c93c0dcf6c..2402a2cc469 100644 --- a/notebooks/apiv1beta1/doc.go +++ b/notebooks/apiv1beta1/doc.go @@ -51,7 +51,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210630" +const versionClient = "20210701" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/notebooks/apiv1beta1/gapic_metadata.json b/notebooks/apiv1beta1/gapic_metadata.json index e3e3dce499b..a344cd6d96b 100644 --- a/notebooks/apiv1beta1/gapic_metadata.json +++ b/notebooks/apiv1beta1/gapic_metadata.json @@ -1,107 +1,107 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.notebooks.v1beta1", - "libraryPackage": "cloud.google.com/go/notebooks/apiv1beta1", - "services": { - "NotebookService": { - "clients": { - "grpc": { - "libraryClient": "NotebookClient", - "rpcs": { - "CreateEnvironment": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.notebooks.v1beta1", + "libraryPackage": "cloud.google.com/go/notebooks/apiv1beta1", + "services": { + "NotebookService": { + "clients": { + "grpc": { + "libraryClient": "NotebookClient", + "rpcs": { + "CreateEnvironment": { + "methods": [ "CreateEnvironment" ] }, - "CreateInstance": { - "methods": [ + "CreateInstance": { + "methods": [ "CreateInstance" ] }, - "DeleteEnvironment": { - "methods": [ + "DeleteEnvironment": { + "methods": [ "DeleteEnvironment" ] }, - "DeleteInstance": { - "methods": [ + "DeleteInstance": { + "methods": [ "DeleteInstance" ] }, - "GetEnvironment": { - "methods": [ + "GetEnvironment": { + "methods": [ "GetEnvironment" ] }, - "GetInstance": { - "methods": [ + "GetInstance": { + "methods": [ "GetInstance" ] }, - "IsInstanceUpgradeable": { - "methods": [ + "IsInstanceUpgradeable": { + "methods": [ "IsInstanceUpgradeable" ] }, - "ListEnvironments": { - "methods": [ + "ListEnvironments": { + "methods": [ "ListEnvironments" ] }, - "ListInstances": { - "methods": [ + "ListInstances": { + "methods": [ "ListInstances" ] }, - "RegisterInstance": { - "methods": [ + "RegisterInstance": { + "methods": [ "RegisterInstance" ] }, - "ReportInstanceInfo": { - "methods": [ + "ReportInstanceInfo": { + "methods": [ "ReportInstanceInfo" ] }, - "ResetInstance": { - "methods": [ + "ResetInstance": { + "methods": [ "ResetInstance" ] }, - "SetInstanceAccelerator": { - "methods": [ + "SetInstanceAccelerator": { + "methods": [ "SetInstanceAccelerator" ] }, - "SetInstanceLabels": { - "methods": [ + "SetInstanceLabels": { + "methods": [ "SetInstanceLabels" ] }, - "SetInstanceMachineType": { - "methods": [ + "SetInstanceMachineType": { + "methods": [ "SetInstanceMachineType" ] }, - "StartInstance": { - "methods": [ + "StartInstance": { + "methods": [ "StartInstance" ] }, - "StopInstance": { - "methods": [ + "StopInstance": { + "methods": [ "StopInstance" ] }, - "UpgradeInstance": { - "methods": [ + "UpgradeInstance": { + "methods": [ "UpgradeInstance" ] }, - "UpgradeInstanceInternal": { - "methods": [ + "UpgradeInstanceInternal": { + "methods": [ "UpgradeInstanceInternal" ] } diff --git a/orgpolicy/apiv2/doc.go b/orgpolicy/apiv2/doc.go index d55489e4dec..1bfd1d41b86 100644 --- a/orgpolicy/apiv2/doc.go +++ b/orgpolicy/apiv2/doc.go @@ -49,7 +49,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210630" +const versionClient = "20210701" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/orgpolicy/apiv2/gapic_metadata.json b/orgpolicy/apiv2/gapic_metadata.json index c9c26e4e516..c07306a370e 100644 --- a/orgpolicy/apiv2/gapic_metadata.json +++ b/orgpolicy/apiv2/gapic_metadata.json @@ -1,47 +1,47 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.orgpolicy.v2", - "libraryPackage": "cloud.google.com/go/orgpolicy/apiv2", - "services": { - "OrgPolicy": { - "clients": { - "grpc": { - "libraryClient": "Client", - "rpcs": { - "CreatePolicy": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.orgpolicy.v2", + "libraryPackage": "cloud.google.com/go/orgpolicy/apiv2", + "services": { + "OrgPolicy": { + "clients": { + "grpc": { + "libraryClient": "Client", + "rpcs": { + "CreatePolicy": { + "methods": [ "CreatePolicy" ] }, - "DeletePolicy": { - "methods": [ + "DeletePolicy": { + "methods": [ "DeletePolicy" ] }, - "GetEffectivePolicy": { - "methods": [ + "GetEffectivePolicy": { + "methods": [ "GetEffectivePolicy" ] }, - "GetPolicy": { - "methods": [ + "GetPolicy": { + "methods": [ "GetPolicy" ] }, - "ListConstraints": { - "methods": [ + "ListConstraints": { + "methods": [ "ListConstraints" ] }, - "ListPolicies": { - "methods": [ + "ListPolicies": { + "methods": [ "ListPolicies" ] }, - "UpdatePolicy": { - "methods": [ + "UpdatePolicy": { + "methods": [ "UpdatePolicy" ] } diff --git a/osconfig/agentendpoint/apiv1/doc.go b/osconfig/agentendpoint/apiv1/doc.go index 89b757f3fa2..685cb443fdc 100644 --- a/osconfig/agentendpoint/apiv1/doc.go +++ b/osconfig/agentendpoint/apiv1/doc.go @@ -49,7 +49,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210630" +const versionClient = "20210701" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/osconfig/agentendpoint/apiv1/gapic_metadata.json b/osconfig/agentendpoint/apiv1/gapic_metadata.json index 10311f0ebc9..a1becd79620 100644 --- a/osconfig/agentendpoint/apiv1/gapic_metadata.json +++ b/osconfig/agentendpoint/apiv1/gapic_metadata.json @@ -1,42 +1,42 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.osconfig.agentendpoint.v1", - "libraryPackage": "cloud.google.com/go/osconfig/agentendpoint/apiv1", - "services": { - "AgentEndpointService": { - "clients": { - "grpc": { - "libraryClient": "Client", - "rpcs": { - "ReceiveTaskNotification": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.osconfig.agentendpoint.v1", + "libraryPackage": "cloud.google.com/go/osconfig/agentendpoint/apiv1", + "services": { + "AgentEndpointService": { + "clients": { + "grpc": { + "libraryClient": "Client", + "rpcs": { + "ReceiveTaskNotification": { + "methods": [ "ReceiveTaskNotification" ] }, - "RegisterAgent": { - "methods": [ + "RegisterAgent": { + "methods": [ "RegisterAgent" ] }, - "ReportInventory": { - "methods": [ + "ReportInventory": { + "methods": [ "ReportInventory" ] }, - "ReportTaskComplete": { - "methods": [ + "ReportTaskComplete": { + "methods": [ "ReportTaskComplete" ] }, - "ReportTaskProgress": { - "methods": [ + "ReportTaskProgress": { + "methods": [ "ReportTaskProgress" ] }, - "StartNextTask": { - "methods": [ + "StartNextTask": { + "methods": [ "StartNextTask" ] } diff --git a/osconfig/agentendpoint/apiv1beta/doc.go b/osconfig/agentendpoint/apiv1beta/doc.go index 10b866c4d9e..1a76b52d9ad 100644 --- a/osconfig/agentendpoint/apiv1beta/doc.go +++ b/osconfig/agentendpoint/apiv1beta/doc.go @@ -51,7 +51,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210630" +const versionClient = "20210701" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/osconfig/agentendpoint/apiv1beta/gapic_metadata.json b/osconfig/agentendpoint/apiv1beta/gapic_metadata.json index 31ec346d10d..3d302165c76 100644 --- a/osconfig/agentendpoint/apiv1beta/gapic_metadata.json +++ b/osconfig/agentendpoint/apiv1beta/gapic_metadata.json @@ -1,42 +1,42 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.osconfig.agentendpoint.v1beta", - "libraryPackage": "cloud.google.com/go/osconfig/agentendpoint/apiv1beta", - "services": { - "AgentEndpointService": { - "clients": { - "grpc": { - "libraryClient": "Client", - "rpcs": { - "LookupEffectiveGuestPolicy": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.osconfig.agentendpoint.v1beta", + "libraryPackage": "cloud.google.com/go/osconfig/agentendpoint/apiv1beta", + "services": { + "AgentEndpointService": { + "clients": { + "grpc": { + "libraryClient": "Client", + "rpcs": { + "LookupEffectiveGuestPolicy": { + "methods": [ "LookupEffectiveGuestPolicy" ] }, - "ReceiveTaskNotification": { - "methods": [ + "ReceiveTaskNotification": { + "methods": [ "ReceiveTaskNotification" ] }, - "RegisterAgent": { - "methods": [ + "RegisterAgent": { + "methods": [ "RegisterAgent" ] }, - "ReportTaskComplete": { - "methods": [ + "ReportTaskComplete": { + "methods": [ "ReportTaskComplete" ] }, - "ReportTaskProgress": { - "methods": [ + "ReportTaskProgress": { + "methods": [ "ReportTaskProgress" ] }, - "StartNextTask": { - "methods": [ + "StartNextTask": { + "methods": [ "StartNextTask" ] } diff --git a/osconfig/apiv1/doc.go b/osconfig/apiv1/doc.go index 7f30e0d4f36..11d02031618 100644 --- a/osconfig/apiv1/doc.go +++ b/osconfig/apiv1/doc.go @@ -49,7 +49,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210630" +const versionClient = "20210701" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/osconfig/apiv1/gapic_metadata.json b/osconfig/apiv1/gapic_metadata.json index eb5c0df8398..1b0d0f460a2 100644 --- a/osconfig/apiv1/gapic_metadata.json +++ b/osconfig/apiv1/gapic_metadata.json @@ -1,57 +1,57 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.osconfig.v1", - "libraryPackage": "cloud.google.com/go/osconfig/apiv1", - "services": { - "OsConfigService": { - "clients": { - "grpc": { - "libraryClient": "Client", - "rpcs": { - "CancelPatchJob": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.osconfig.v1", + "libraryPackage": "cloud.google.com/go/osconfig/apiv1", + "services": { + "OsConfigService": { + "clients": { + "grpc": { + "libraryClient": "Client", + "rpcs": { + "CancelPatchJob": { + "methods": [ "CancelPatchJob" ] }, - "CreatePatchDeployment": { - "methods": [ + "CreatePatchDeployment": { + "methods": [ "CreatePatchDeployment" ] }, - "DeletePatchDeployment": { - "methods": [ + "DeletePatchDeployment": { + "methods": [ "DeletePatchDeployment" ] }, - "ExecutePatchJob": { - "methods": [ + "ExecutePatchJob": { + "methods": [ "ExecutePatchJob" ] }, - "GetPatchDeployment": { - "methods": [ + "GetPatchDeployment": { + "methods": [ "GetPatchDeployment" ] }, - "GetPatchJob": { - "methods": [ + "GetPatchJob": { + "methods": [ "GetPatchJob" ] }, - "ListPatchDeployments": { - "methods": [ + "ListPatchDeployments": { + "methods": [ "ListPatchDeployments" ] }, - "ListPatchJobInstanceDetails": { - "methods": [ + "ListPatchJobInstanceDetails": { + "methods": [ "ListPatchJobInstanceDetails" ] }, - "ListPatchJobs": { - "methods": [ + "ListPatchJobs": { + "methods": [ "ListPatchJobs" ] } diff --git a/osconfig/apiv1alpha/doc.go b/osconfig/apiv1alpha/doc.go index f536fe15e1b..4712c64c232 100644 --- a/osconfig/apiv1alpha/doc.go +++ b/osconfig/apiv1alpha/doc.go @@ -51,7 +51,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210630" +const versionClient = "20210701" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/osconfig/apiv1alpha/gapic_metadata.json b/osconfig/apiv1alpha/gapic_metadata.json index 7a423634f9b..68645256d0c 100644 --- a/osconfig/apiv1alpha/gapic_metadata.json +++ b/osconfig/apiv1alpha/gapic_metadata.json @@ -1,72 +1,72 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.osconfig.v1alpha", - "libraryPackage": "cloud.google.com/go/osconfig/apiv1alpha", - "services": { - "OsConfigZonalService": { - "clients": { - "grpc": { - "libraryClient": "OsConfigZonalClient", - "rpcs": { - "CreateOSPolicyAssignment": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.osconfig.v1alpha", + "libraryPackage": "cloud.google.com/go/osconfig/apiv1alpha", + "services": { + "OsConfigZonalService": { + "clients": { + "grpc": { + "libraryClient": "OsConfigZonalClient", + "rpcs": { + "CreateOSPolicyAssignment": { + "methods": [ "CreateOSPolicyAssignment" ] }, - "DeleteOSPolicyAssignment": { - "methods": [ + "DeleteOSPolicyAssignment": { + "methods": [ "DeleteOSPolicyAssignment" ] }, - "GetInstanceOSPoliciesCompliance": { - "methods": [ + "GetInstanceOSPoliciesCompliance": { + "methods": [ "GetInstanceOSPoliciesCompliance" ] }, - "GetInventory": { - "methods": [ + "GetInventory": { + "methods": [ "GetInventory" ] }, - "GetOSPolicyAssignment": { - "methods": [ + "GetOSPolicyAssignment": { + "methods": [ "GetOSPolicyAssignment" ] }, - "GetVulnerabilityReport": { - "methods": [ + "GetVulnerabilityReport": { + "methods": [ "GetVulnerabilityReport" ] }, - "ListInstanceOSPoliciesCompliances": { - "methods": [ + "ListInstanceOSPoliciesCompliances": { + "methods": [ "ListInstanceOSPoliciesCompliances" ] }, - "ListInventories": { - "methods": [ + "ListInventories": { + "methods": [ "ListInventories" ] }, - "ListOSPolicyAssignmentRevisions": { - "methods": [ + "ListOSPolicyAssignmentRevisions": { + "methods": [ "ListOSPolicyAssignmentRevisions" ] }, - "ListOSPolicyAssignments": { - "methods": [ + "ListOSPolicyAssignments": { + "methods": [ "ListOSPolicyAssignments" ] }, - "ListVulnerabilityReports": { - "methods": [ + "ListVulnerabilityReports": { + "methods": [ "ListVulnerabilityReports" ] }, - "UpdateOSPolicyAssignment": { - "methods": [ + "UpdateOSPolicyAssignment": { + "methods": [ "UpdateOSPolicyAssignment" ] } diff --git a/osconfig/apiv1beta/doc.go b/osconfig/apiv1beta/doc.go index 28a1bacd5f9..2d0e46f1003 100644 --- a/osconfig/apiv1beta/doc.go +++ b/osconfig/apiv1beta/doc.go @@ -51,7 +51,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210630" +const versionClient = "20210701" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/osconfig/apiv1beta/gapic_metadata.json b/osconfig/apiv1beta/gapic_metadata.json index 74a643af24a..08c5c3128d3 100644 --- a/osconfig/apiv1beta/gapic_metadata.json +++ b/osconfig/apiv1beta/gapic_metadata.json @@ -1,87 +1,87 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.osconfig.v1beta", - "libraryPackage": "cloud.google.com/go/osconfig/apiv1beta", - "services": { - "OsConfigService": { - "clients": { - "grpc": { - "libraryClient": "Client", - "rpcs": { - "CancelPatchJob": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.osconfig.v1beta", + "libraryPackage": "cloud.google.com/go/osconfig/apiv1beta", + "services": { + "OsConfigService": { + "clients": { + "grpc": { + "libraryClient": "Client", + "rpcs": { + "CancelPatchJob": { + "methods": [ "CancelPatchJob" ] }, - "CreateGuestPolicy": { - "methods": [ + "CreateGuestPolicy": { + "methods": [ "CreateGuestPolicy" ] }, - "CreatePatchDeployment": { - "methods": [ + "CreatePatchDeployment": { + "methods": [ "CreatePatchDeployment" ] }, - "DeleteGuestPolicy": { - "methods": [ + "DeleteGuestPolicy": { + "methods": [ "DeleteGuestPolicy" ] }, - "DeletePatchDeployment": { - "methods": [ + "DeletePatchDeployment": { + "methods": [ "DeletePatchDeployment" ] }, - "ExecutePatchJob": { - "methods": [ + "ExecutePatchJob": { + "methods": [ "ExecutePatchJob" ] }, - "GetGuestPolicy": { - "methods": [ + "GetGuestPolicy": { + "methods": [ "GetGuestPolicy" ] }, - "GetPatchDeployment": { - "methods": [ + "GetPatchDeployment": { + "methods": [ "GetPatchDeployment" ] }, - "GetPatchJob": { - "methods": [ + "GetPatchJob": { + "methods": [ "GetPatchJob" ] }, - "ListGuestPolicies": { - "methods": [ + "ListGuestPolicies": { + "methods": [ "ListGuestPolicies" ] }, - "ListPatchDeployments": { - "methods": [ + "ListPatchDeployments": { + "methods": [ "ListPatchDeployments" ] }, - "ListPatchJobInstanceDetails": { - "methods": [ + "ListPatchJobInstanceDetails": { + "methods": [ "ListPatchJobInstanceDetails" ] }, - "ListPatchJobs": { - "methods": [ + "ListPatchJobs": { + "methods": [ "ListPatchJobs" ] }, - "LookupEffectiveGuestPolicy": { - "methods": [ + "LookupEffectiveGuestPolicy": { + "methods": [ "LookupEffectiveGuestPolicy" ] }, - "UpdateGuestPolicy": { - "methods": [ + "UpdateGuestPolicy": { + "methods": [ "UpdateGuestPolicy" ] } diff --git a/oslogin/apiv1/doc.go b/oslogin/apiv1/doc.go index 29cd8bc06dd..b238bbcfc96 100644 --- a/oslogin/apiv1/doc.go +++ b/oslogin/apiv1/doc.go @@ -49,7 +49,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210630" +const versionClient = "20210701" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/oslogin/apiv1/gapic_metadata.json b/oslogin/apiv1/gapic_metadata.json index 20947412631..36ddc426625 100644 --- a/oslogin/apiv1/gapic_metadata.json +++ b/oslogin/apiv1/gapic_metadata.json @@ -1,42 +1,42 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.oslogin.v1", - "libraryPackage": "cloud.google.com/go/oslogin/apiv1", - "services": { - "OsLoginService": { - "clients": { - "grpc": { - "libraryClient": "Client", - "rpcs": { - "DeletePosixAccount": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.oslogin.v1", + "libraryPackage": "cloud.google.com/go/oslogin/apiv1", + "services": { + "OsLoginService": { + "clients": { + "grpc": { + "libraryClient": "Client", + "rpcs": { + "DeletePosixAccount": { + "methods": [ "DeletePosixAccount" ] }, - "DeleteSshPublicKey": { - "methods": [ + "DeleteSshPublicKey": { + "methods": [ "DeleteSshPublicKey" ] }, - "GetLoginProfile": { - "methods": [ + "GetLoginProfile": { + "methods": [ "GetLoginProfile" ] }, - "GetSshPublicKey": { - "methods": [ + "GetSshPublicKey": { + "methods": [ "GetSshPublicKey" ] }, - "ImportSshPublicKey": { - "methods": [ + "ImportSshPublicKey": { + "methods": [ "ImportSshPublicKey" ] }, - "UpdateSshPublicKey": { - "methods": [ + "UpdateSshPublicKey": { + "methods": [ "UpdateSshPublicKey" ] } diff --git a/oslogin/apiv1beta/doc.go b/oslogin/apiv1beta/doc.go index 513a6d8f831..8d1df6e5073 100644 --- a/oslogin/apiv1beta/doc.go +++ b/oslogin/apiv1beta/doc.go @@ -51,7 +51,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210630" +const versionClient = "20210701" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/oslogin/apiv1beta/gapic_metadata.json b/oslogin/apiv1beta/gapic_metadata.json index d517bb07a29..ddd46bd0590 100644 --- a/oslogin/apiv1beta/gapic_metadata.json +++ b/oslogin/apiv1beta/gapic_metadata.json @@ -1,42 +1,42 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.oslogin.v1beta", - "libraryPackage": "cloud.google.com/go/oslogin/apiv1beta", - "services": { - "OsLoginService": { - "clients": { - "grpc": { - "libraryClient": "Client", - "rpcs": { - "DeletePosixAccount": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.oslogin.v1beta", + "libraryPackage": "cloud.google.com/go/oslogin/apiv1beta", + "services": { + "OsLoginService": { + "clients": { + "grpc": { + "libraryClient": "Client", + "rpcs": { + "DeletePosixAccount": { + "methods": [ "DeletePosixAccount" ] }, - "DeleteSshPublicKey": { - "methods": [ + "DeleteSshPublicKey": { + "methods": [ "DeleteSshPublicKey" ] }, - "GetLoginProfile": { - "methods": [ + "GetLoginProfile": { + "methods": [ "GetLoginProfile" ] }, - "GetSshPublicKey": { - "methods": [ + "GetSshPublicKey": { + "methods": [ "GetSshPublicKey" ] }, - "ImportSshPublicKey": { - "methods": [ + "ImportSshPublicKey": { + "methods": [ "ImportSshPublicKey" ] }, - "UpdateSshPublicKey": { - "methods": [ + "UpdateSshPublicKey": { + "methods": [ "UpdateSshPublicKey" ] } diff --git a/phishingprotection/apiv1beta1/doc.go b/phishingprotection/apiv1beta1/doc.go index f8d1981beb4..9de824a3ff4 100644 --- a/phishingprotection/apiv1beta1/doc.go +++ b/phishingprotection/apiv1beta1/doc.go @@ -48,7 +48,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210630" +const versionClient = "20210701" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/phishingprotection/apiv1beta1/gapic_metadata.json b/phishingprotection/apiv1beta1/gapic_metadata.json index aa808a1c319..fafe97d9d87 100644 --- a/phishingprotection/apiv1beta1/gapic_metadata.json +++ b/phishingprotection/apiv1beta1/gapic_metadata.json @@ -1,17 +1,17 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.phishingprotection.v1beta1", - "libraryPackage": "cloud.google.com/go/phishingprotection/apiv1beta1", - "services": { - "PhishingProtectionServiceV1Beta1": { - "clients": { - "grpc": { - "libraryClient": "PhishingProtectionServiceV1Beta1Client", - "rpcs": { - "ReportPhishing": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.phishingprotection.v1beta1", + "libraryPackage": "cloud.google.com/go/phishingprotection/apiv1beta1", + "services": { + "PhishingProtectionServiceV1Beta1": { + "clients": { + "grpc": { + "libraryClient": "PhishingProtectionServiceV1Beta1Client", + "rpcs": { + "ReportPhishing": { + "methods": [ "ReportPhishing" ] } diff --git a/policytroubleshooter/apiv1/doc.go b/policytroubleshooter/apiv1/doc.go index 98329ea8d12..41b2bbaf26f 100644 --- a/policytroubleshooter/apiv1/doc.go +++ b/policytroubleshooter/apiv1/doc.go @@ -46,7 +46,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210630" +const versionClient = "20210701" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/policytroubleshooter/apiv1/gapic_metadata.json b/policytroubleshooter/apiv1/gapic_metadata.json index 225f08d3e54..d2e85d11364 100644 --- a/policytroubleshooter/apiv1/gapic_metadata.json +++ b/policytroubleshooter/apiv1/gapic_metadata.json @@ -1,17 +1,17 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.policytroubleshooter.v1", - "libraryPackage": "cloud.google.com/go/policytroubleshooter/apiv1", - "services": { - "IamChecker": { - "clients": { - "grpc": { - "libraryClient": "IamCheckerClient", - "rpcs": { - "TroubleshootIamPolicy": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.policytroubleshooter.v1", + "libraryPackage": "cloud.google.com/go/policytroubleshooter/apiv1", + "services": { + "IamChecker": { + "clients": { + "grpc": { + "libraryClient": "IamCheckerClient", + "rpcs": { + "TroubleshootIamPolicy": { + "methods": [ "TroubleshootIamPolicy" ] } diff --git a/privatecatalog/apiv1beta1/doc.go b/privatecatalog/apiv1beta1/doc.go index fc9e625eebb..59b32641b76 100644 --- a/privatecatalog/apiv1beta1/doc.go +++ b/privatecatalog/apiv1beta1/doc.go @@ -51,7 +51,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210630" +const versionClient = "20210701" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/privatecatalog/apiv1beta1/gapic_metadata.json b/privatecatalog/apiv1beta1/gapic_metadata.json index 768bec96390..a549a3afcb2 100644 --- a/privatecatalog/apiv1beta1/gapic_metadata.json +++ b/privatecatalog/apiv1beta1/gapic_metadata.json @@ -1,27 +1,27 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.privatecatalog.v1beta1", - "libraryPackage": "cloud.google.com/go/privatecatalog/apiv1beta1", - "services": { - "PrivateCatalog": { - "clients": { - "grpc": { - "libraryClient": "Client", - "rpcs": { - "SearchCatalogs": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.privatecatalog.v1beta1", + "libraryPackage": "cloud.google.com/go/privatecatalog/apiv1beta1", + "services": { + "PrivateCatalog": { + "clients": { + "grpc": { + "libraryClient": "Client", + "rpcs": { + "SearchCatalogs": { + "methods": [ "SearchCatalogs" ] }, - "SearchProducts": { - "methods": [ + "SearchProducts": { + "methods": [ "SearchProducts" ] }, - "SearchVersions": { - "methods": [ + "SearchVersions": { + "methods": [ "SearchVersions" ] } diff --git a/pubsub/apiv1/doc.go b/pubsub/apiv1/doc.go index 4f7c31c86b3..d415a1724df 100644 --- a/pubsub/apiv1/doc.go +++ b/pubsub/apiv1/doc.go @@ -49,7 +49,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210630" +const versionClient = "20210701" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/pubsub/apiv1/gapic_metadata.json b/pubsub/apiv1/gapic_metadata.json index 0923be3c70d..64b2999668a 100644 --- a/pubsub/apiv1/gapic_metadata.json +++ b/pubsub/apiv1/gapic_metadata.json @@ -1,72 +1,72 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.pubsub.v1", - "libraryPackage": "cloud.google.com/go/pubsub/apiv1", - "services": { - "Publisher": { - "clients": { - "grpc": { - "libraryClient": "PublisherClient", - "rpcs": { - "CreateTopic": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.pubsub.v1", + "libraryPackage": "cloud.google.com/go/pubsub/apiv1", + "services": { + "Publisher": { + "clients": { + "grpc": { + "libraryClient": "PublisherClient", + "rpcs": { + "CreateTopic": { + "methods": [ "CreateTopic" ] }, - "DeleteTopic": { - "methods": [ + "DeleteTopic": { + "methods": [ "DeleteTopic" ] }, - "DetachSubscription": { - "methods": [ + "DetachSubscription": { + "methods": [ "DetachSubscription" ] }, - "GetIamPolicy": { - "methods": [ + "GetIamPolicy": { + "methods": [ "GetIamPolicy" ] }, - "GetTopic": { - "methods": [ + "GetTopic": { + "methods": [ "GetTopic" ] }, - "ListTopicSnapshots": { - "methods": [ + "ListTopicSnapshots": { + "methods": [ "ListTopicSnapshots" ] }, - "ListTopicSubscriptions": { - "methods": [ + "ListTopicSubscriptions": { + "methods": [ "ListTopicSubscriptions" ] }, - "ListTopics": { - "methods": [ + "ListTopics": { + "methods": [ "ListTopics" ] }, - "Publish": { - "methods": [ + "Publish": { + "methods": [ "Publish" ] }, - "SetIamPolicy": { - "methods": [ + "SetIamPolicy": { + "methods": [ "SetIamPolicy" ] }, - "TestIamPermissions": { - "methods": [ + "TestIamPermissions": { + "methods": [ "TestIamPermissions" ] }, - "UpdateTopic": { - "methods": [ + "UpdateTopic": { + "methods": [ "UpdateTopic" ] } @@ -74,53 +74,53 @@ } } }, - "SchemaService": { - "clients": { - "grpc": { - "libraryClient": "SchemaClient", - "rpcs": { - "CreateSchema": { - "methods": [ + "SchemaService": { + "clients": { + "grpc": { + "libraryClient": "SchemaClient", + "rpcs": { + "CreateSchema": { + "methods": [ "CreateSchema" ] }, - "DeleteSchema": { - "methods": [ + "DeleteSchema": { + "methods": [ "DeleteSchema" ] }, - "GetIamPolicy": { - "methods": [ + "GetIamPolicy": { + "methods": [ "GetIamPolicy" ] }, - "GetSchema": { - "methods": [ + "GetSchema": { + "methods": [ "GetSchema" ] }, - "ListSchemas": { - "methods": [ + "ListSchemas": { + "methods": [ "ListSchemas" ] }, - "SetIamPolicy": { - "methods": [ + "SetIamPolicy": { + "methods": [ "SetIamPolicy" ] }, - "TestIamPermissions": { - "methods": [ + "TestIamPermissions": { + "methods": [ "TestIamPermissions" ] }, - "ValidateMessage": { - "methods": [ + "ValidateMessage": { + "methods": [ "ValidateMessage" ] }, - "ValidateSchema": { - "methods": [ + "ValidateSchema": { + "methods": [ "ValidateSchema" ] } @@ -128,103 +128,103 @@ } } }, - "Subscriber": { - "clients": { - "grpc": { - "libraryClient": "SubscriberClient", - "rpcs": { - "Acknowledge": { - "methods": [ + "Subscriber": { + "clients": { + "grpc": { + "libraryClient": "SubscriberClient", + "rpcs": { + "Acknowledge": { + "methods": [ "Acknowledge" ] }, - "CreateSnapshot": { - "methods": [ + "CreateSnapshot": { + "methods": [ "CreateSnapshot" ] }, - "CreateSubscription": { - "methods": [ + "CreateSubscription": { + "methods": [ "CreateSubscription" ] }, - "DeleteSnapshot": { - "methods": [ + "DeleteSnapshot": { + "methods": [ "DeleteSnapshot" ] }, - "DeleteSubscription": { - "methods": [ + "DeleteSubscription": { + "methods": [ "DeleteSubscription" ] }, - "GetIamPolicy": { - "methods": [ + "GetIamPolicy": { + "methods": [ "GetIamPolicy" ] }, - "GetSnapshot": { - "methods": [ + "GetSnapshot": { + "methods": [ "GetSnapshot" ] }, - "GetSubscription": { - "methods": [ + "GetSubscription": { + "methods": [ "GetSubscription" ] }, - "ListSnapshots": { - "methods": [ + "ListSnapshots": { + "methods": [ "ListSnapshots" ] }, - "ListSubscriptions": { - "methods": [ + "ListSubscriptions": { + "methods": [ "ListSubscriptions" ] }, - "ModifyAckDeadline": { - "methods": [ + "ModifyAckDeadline": { + "methods": [ "ModifyAckDeadline" ] }, - "ModifyPushConfig": { - "methods": [ + "ModifyPushConfig": { + "methods": [ "ModifyPushConfig" ] }, - "Pull": { - "methods": [ + "Pull": { + "methods": [ "Pull" ] }, - "Seek": { - "methods": [ + "Seek": { + "methods": [ "Seek" ] }, - "SetIamPolicy": { - "methods": [ + "SetIamPolicy": { + "methods": [ "SetIamPolicy" ] }, - "StreamingPull": { - "methods": [ + "StreamingPull": { + "methods": [ "StreamingPull" ] }, - "TestIamPermissions": { - "methods": [ + "TestIamPermissions": { + "methods": [ "TestIamPermissions" ] }, - "UpdateSnapshot": { - "methods": [ + "UpdateSnapshot": { + "methods": [ "UpdateSnapshot" ] }, - "UpdateSubscription": { - "methods": [ + "UpdateSubscription": { + "methods": [ "UpdateSubscription" ] } diff --git a/pubsub/go.mod b/pubsub/go.mod index 3b84c79b4a7..c9853a19eae 100644 --- a/pubsub/go.mod +++ b/pubsub/go.mod @@ -12,7 +12,7 @@ require ( golang.org/x/sync v0.0.0-20210220032951-036812b2e83c golang.org/x/time v0.0.0-20210611083556-38a9dc6acbc6 google.golang.org/api v0.50.0 - google.golang.org/genproto v0.0.0-20210630183607-d20f26d13c79 + google.golang.org/genproto v0.0.0-20210701133433-6b8dcf568a95 google.golang.org/grpc v1.38.0 google.golang.org/protobuf v1.27.1 ) diff --git a/pubsub/go.sum b/pubsub/go.sum index abf3e80d543..424a7ba5550 100644 --- a/pubsub/go.sum +++ b/pubsub/go.sum @@ -453,8 +453,8 @@ google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxH google.golang.org/genproto v0.0.0-20210604141403-392c879c8b08/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= google.golang.org/genproto v0.0.0-20210608205507-b6d2f5bf0d7d/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= google.golang.org/genproto v0.0.0-20210624195500-8bfb893ecb84/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24= -google.golang.org/genproto v0.0.0-20210630183607-d20f26d13c79 h1:s1jFTXJryg4a1mew7xv03VZD8N9XjxFhk1o4Js4WvPQ= -google.golang.org/genproto v0.0.0-20210630183607-d20f26d13c79/go.mod h1:yiaVoXHpRzHGyxV3o4DktVWY4mSUErTKaeEOq6C3t3U= +google.golang.org/genproto v0.0.0-20210701133433-6b8dcf568a95 h1:xyRjacsGcaSoZ2fTcaLCSzh2JEceLLOT4X8k32Q0xAQ= +google.golang.org/genproto v0.0.0-20210701133433-6b8dcf568a95/go.mod h1:yiaVoXHpRzHGyxV3o4DktVWY4mSUErTKaeEOq6C3t3U= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= diff --git a/pubsublite/apiv1/doc.go b/pubsublite/apiv1/doc.go index facfd16cabc..24882873059 100644 --- a/pubsublite/apiv1/doc.go +++ b/pubsublite/apiv1/doc.go @@ -48,7 +48,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210630" +const versionClient = "20210701" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/pubsublite/apiv1/gapic_metadata.json b/pubsublite/apiv1/gapic_metadata.json index 1714ec611fa..4d82bdaf696 100644 --- a/pubsublite/apiv1/gapic_metadata.json +++ b/pubsublite/apiv1/gapic_metadata.json @@ -1,107 +1,107 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.pubsublite.v1", - "libraryPackage": "cloud.google.com/go/pubsublite/apiv1", - "services": { - "AdminService": { - "clients": { - "grpc": { - "libraryClient": "AdminClient", - "rpcs": { - "CreateReservation": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.pubsublite.v1", + "libraryPackage": "cloud.google.com/go/pubsublite/apiv1", + "services": { + "AdminService": { + "clients": { + "grpc": { + "libraryClient": "AdminClient", + "rpcs": { + "CreateReservation": { + "methods": [ "CreateReservation" ] }, - "CreateSubscription": { - "methods": [ + "CreateSubscription": { + "methods": [ "CreateSubscription" ] }, - "CreateTopic": { - "methods": [ + "CreateTopic": { + "methods": [ "CreateTopic" ] }, - "DeleteReservation": { - "methods": [ + "DeleteReservation": { + "methods": [ "DeleteReservation" ] }, - "DeleteSubscription": { - "methods": [ + "DeleteSubscription": { + "methods": [ "DeleteSubscription" ] }, - "DeleteTopic": { - "methods": [ + "DeleteTopic": { + "methods": [ "DeleteTopic" ] }, - "GetReservation": { - "methods": [ + "GetReservation": { + "methods": [ "GetReservation" ] }, - "GetSubscription": { - "methods": [ + "GetSubscription": { + "methods": [ "GetSubscription" ] }, - "GetTopic": { - "methods": [ + "GetTopic": { + "methods": [ "GetTopic" ] }, - "GetTopicPartitions": { - "methods": [ + "GetTopicPartitions": { + "methods": [ "GetTopicPartitions" ] }, - "ListReservationTopics": { - "methods": [ + "ListReservationTopics": { + "methods": [ "ListReservationTopics" ] }, - "ListReservations": { - "methods": [ + "ListReservations": { + "methods": [ "ListReservations" ] }, - "ListSubscriptions": { - "methods": [ + "ListSubscriptions": { + "methods": [ "ListSubscriptions" ] }, - "ListTopicSubscriptions": { - "methods": [ + "ListTopicSubscriptions": { + "methods": [ "ListTopicSubscriptions" ] }, - "ListTopics": { - "methods": [ + "ListTopics": { + "methods": [ "ListTopics" ] }, - "SeekSubscription": { - "methods": [ + "SeekSubscription": { + "methods": [ "SeekSubscription" ] }, - "UpdateReservation": { - "methods": [ + "UpdateReservation": { + "methods": [ "UpdateReservation" ] }, - "UpdateSubscription": { - "methods": [ + "UpdateSubscription": { + "methods": [ "UpdateSubscription" ] }, - "UpdateTopic": { - "methods": [ + "UpdateTopic": { + "methods": [ "UpdateTopic" ] } @@ -109,23 +109,23 @@ } } }, - "CursorService": { - "clients": { - "grpc": { - "libraryClient": "CursorClient", - "rpcs": { - "CommitCursor": { - "methods": [ + "CursorService": { + "clients": { + "grpc": { + "libraryClient": "CursorClient", + "rpcs": { + "CommitCursor": { + "methods": [ "CommitCursor" ] }, - "ListPartitionCursors": { - "methods": [ + "ListPartitionCursors": { + "methods": [ "ListPartitionCursors" ] }, - "StreamingCommitCursor": { - "methods": [ + "StreamingCommitCursor": { + "methods": [ "StreamingCommitCursor" ] } @@ -133,13 +133,13 @@ } } }, - "PartitionAssignmentService": { - "clients": { - "grpc": { - "libraryClient": "PartitionAssignmentClient", - "rpcs": { - "AssignPartitions": { - "methods": [ + "PartitionAssignmentService": { + "clients": { + "grpc": { + "libraryClient": "PartitionAssignmentClient", + "rpcs": { + "AssignPartitions": { + "methods": [ "AssignPartitions" ] } @@ -147,13 +147,13 @@ } } }, - "PublisherService": { - "clients": { - "grpc": { - "libraryClient": "PublisherClient", - "rpcs": { - "Publish": { - "methods": [ + "PublisherService": { + "clients": { + "grpc": { + "libraryClient": "PublisherClient", + "rpcs": { + "Publish": { + "methods": [ "Publish" ] } @@ -161,13 +161,13 @@ } } }, - "SubscriberService": { - "clients": { - "grpc": { - "libraryClient": "SubscriberClient", - "rpcs": { - "Subscribe": { - "methods": [ + "SubscriberService": { + "clients": { + "grpc": { + "libraryClient": "SubscriberClient", + "rpcs": { + "Subscribe": { + "methods": [ "Subscribe" ] } @@ -175,23 +175,23 @@ } } }, - "TopicStatsService": { - "clients": { - "grpc": { - "libraryClient": "TopicStatsClient", - "rpcs": { - "ComputeHeadCursor": { - "methods": [ + "TopicStatsService": { + "clients": { + "grpc": { + "libraryClient": "TopicStatsClient", + "rpcs": { + "ComputeHeadCursor": { + "methods": [ "ComputeHeadCursor" ] }, - "ComputeMessageStats": { - "methods": [ + "ComputeMessageStats": { + "methods": [ "ComputeMessageStats" ] }, - "ComputeTimeCursor": { - "methods": [ + "ComputeTimeCursor": { + "methods": [ "ComputeTimeCursor" ] } diff --git a/pubsublite/go.mod b/pubsublite/go.mod index 16fc15756cf..6329bc5686a 100644 --- a/pubsublite/go.mod +++ b/pubsublite/go.mod @@ -12,7 +12,7 @@ require ( golang.org/x/sync v0.0.0-20210220032951-036812b2e83c golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 google.golang.org/api v0.50.0 - google.golang.org/genproto v0.0.0-20210630183607-d20f26d13c79 + google.golang.org/genproto v0.0.0-20210701133433-6b8dcf568a95 google.golang.org/grpc v1.38.0 google.golang.org/protobuf v1.27.1 ) diff --git a/pubsublite/go.sum b/pubsublite/go.sum index 9c7faf2ef99..0e3eacfcd53 100644 --- a/pubsublite/go.sum +++ b/pubsublite/go.sum @@ -461,8 +461,8 @@ google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxH google.golang.org/genproto v0.0.0-20210604141403-392c879c8b08/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= google.golang.org/genproto v0.0.0-20210608205507-b6d2f5bf0d7d/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= google.golang.org/genproto v0.0.0-20210624195500-8bfb893ecb84/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24= -google.golang.org/genproto v0.0.0-20210630183607-d20f26d13c79 h1:s1jFTXJryg4a1mew7xv03VZD8N9XjxFhk1o4Js4WvPQ= -google.golang.org/genproto v0.0.0-20210630183607-d20f26d13c79/go.mod h1:yiaVoXHpRzHGyxV3o4DktVWY4mSUErTKaeEOq6C3t3U= +google.golang.org/genproto v0.0.0-20210701133433-6b8dcf568a95 h1:xyRjacsGcaSoZ2fTcaLCSzh2JEceLLOT4X8k32Q0xAQ= +google.golang.org/genproto v0.0.0-20210701133433-6b8dcf568a95/go.mod h1:yiaVoXHpRzHGyxV3o4DktVWY4mSUErTKaeEOq6C3t3U= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= diff --git a/recaptchaenterprise/apiv1/doc.go b/recaptchaenterprise/apiv1/doc.go index f71d43aa545..25f7abce78e 100644 --- a/recaptchaenterprise/apiv1/doc.go +++ b/recaptchaenterprise/apiv1/doc.go @@ -46,7 +46,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210630" +const versionClient = "20210701" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/recaptchaenterprise/apiv1/gapic_metadata.json b/recaptchaenterprise/apiv1/gapic_metadata.json index 0db6a363aa7..3b6837f105d 100644 --- a/recaptchaenterprise/apiv1/gapic_metadata.json +++ b/recaptchaenterprise/apiv1/gapic_metadata.json @@ -1,47 +1,47 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.recaptchaenterprise.v1", - "libraryPackage": "cloud.google.com/go/recaptchaenterprise/apiv1", - "services": { - "RecaptchaEnterpriseService": { - "clients": { - "grpc": { - "libraryClient": "Client", - "rpcs": { - "AnnotateAssessment": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.recaptchaenterprise.v1", + "libraryPackage": "cloud.google.com/go/recaptchaenterprise/apiv1", + "services": { + "RecaptchaEnterpriseService": { + "clients": { + "grpc": { + "libraryClient": "Client", + "rpcs": { + "AnnotateAssessment": { + "methods": [ "AnnotateAssessment" ] }, - "CreateAssessment": { - "methods": [ + "CreateAssessment": { + "methods": [ "CreateAssessment" ] }, - "CreateKey": { - "methods": [ + "CreateKey": { + "methods": [ "CreateKey" ] }, - "DeleteKey": { - "methods": [ + "DeleteKey": { + "methods": [ "DeleteKey" ] }, - "GetKey": { - "methods": [ + "GetKey": { + "methods": [ "GetKey" ] }, - "ListKeys": { - "methods": [ + "ListKeys": { + "methods": [ "ListKeys" ] }, - "UpdateKey": { - "methods": [ + "UpdateKey": { + "methods": [ "UpdateKey" ] } diff --git a/recaptchaenterprise/apiv1beta1/doc.go b/recaptchaenterprise/apiv1beta1/doc.go index f4a33838174..d0a1985401a 100644 --- a/recaptchaenterprise/apiv1beta1/doc.go +++ b/recaptchaenterprise/apiv1beta1/doc.go @@ -48,7 +48,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210630" +const versionClient = "20210701" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/recaptchaenterprise/apiv1beta1/gapic_metadata.json b/recaptchaenterprise/apiv1beta1/gapic_metadata.json index 65354db9612..18538c3a3a1 100644 --- a/recaptchaenterprise/apiv1beta1/gapic_metadata.json +++ b/recaptchaenterprise/apiv1beta1/gapic_metadata.json @@ -1,47 +1,47 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.recaptchaenterprise.v1beta1", - "libraryPackage": "cloud.google.com/go/recaptchaenterprise/apiv1beta1", - "services": { - "RecaptchaEnterpriseServiceV1Beta1": { - "clients": { - "grpc": { - "libraryClient": "RecaptchaEnterpriseServiceV1Beta1Client", - "rpcs": { - "AnnotateAssessment": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.recaptchaenterprise.v1beta1", + "libraryPackage": "cloud.google.com/go/recaptchaenterprise/apiv1beta1", + "services": { + "RecaptchaEnterpriseServiceV1Beta1": { + "clients": { + "grpc": { + "libraryClient": "RecaptchaEnterpriseServiceV1Beta1Client", + "rpcs": { + "AnnotateAssessment": { + "methods": [ "AnnotateAssessment" ] }, - "CreateAssessment": { - "methods": [ + "CreateAssessment": { + "methods": [ "CreateAssessment" ] }, - "CreateKey": { - "methods": [ + "CreateKey": { + "methods": [ "CreateKey" ] }, - "DeleteKey": { - "methods": [ + "DeleteKey": { + "methods": [ "DeleteKey" ] }, - "GetKey": { - "methods": [ + "GetKey": { + "methods": [ "GetKey" ] }, - "ListKeys": { - "methods": [ + "ListKeys": { + "methods": [ "ListKeys" ] }, - "UpdateKey": { - "methods": [ + "UpdateKey": { + "methods": [ "UpdateKey" ] } diff --git a/recommender/apiv1/doc.go b/recommender/apiv1/doc.go index f487bf7ac7c..34e45a5412d 100644 --- a/recommender/apiv1/doc.go +++ b/recommender/apiv1/doc.go @@ -46,7 +46,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210630" +const versionClient = "20210701" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/recommender/apiv1/gapic_metadata.json b/recommender/apiv1/gapic_metadata.json index 3f5463513fa..2a268577a48 100644 --- a/recommender/apiv1/gapic_metadata.json +++ b/recommender/apiv1/gapic_metadata.json @@ -1,52 +1,52 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.recommender.v1", - "libraryPackage": "cloud.google.com/go/recommender/apiv1", - "services": { - "Recommender": { - "clients": { - "grpc": { - "libraryClient": "Client", - "rpcs": { - "GetInsight": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.recommender.v1", + "libraryPackage": "cloud.google.com/go/recommender/apiv1", + "services": { + "Recommender": { + "clients": { + "grpc": { + "libraryClient": "Client", + "rpcs": { + "GetInsight": { + "methods": [ "GetInsight" ] }, - "GetRecommendation": { - "methods": [ + "GetRecommendation": { + "methods": [ "GetRecommendation" ] }, - "ListInsights": { - "methods": [ + "ListInsights": { + "methods": [ "ListInsights" ] }, - "ListRecommendations": { - "methods": [ + "ListRecommendations": { + "methods": [ "ListRecommendations" ] }, - "MarkInsightAccepted": { - "methods": [ + "MarkInsightAccepted": { + "methods": [ "MarkInsightAccepted" ] }, - "MarkRecommendationClaimed": { - "methods": [ + "MarkRecommendationClaimed": { + "methods": [ "MarkRecommendationClaimed" ] }, - "MarkRecommendationFailed": { - "methods": [ + "MarkRecommendationFailed": { + "methods": [ "MarkRecommendationFailed" ] }, - "MarkRecommendationSucceeded": { - "methods": [ + "MarkRecommendationSucceeded": { + "methods": [ "MarkRecommendationSucceeded" ] } diff --git a/recommender/apiv1beta1/doc.go b/recommender/apiv1beta1/doc.go index 439ea9ae942..e688e486a37 100644 --- a/recommender/apiv1beta1/doc.go +++ b/recommender/apiv1beta1/doc.go @@ -48,7 +48,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210630" +const versionClient = "20210701" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/recommender/apiv1beta1/gapic_metadata.json b/recommender/apiv1beta1/gapic_metadata.json index b5feebfdba3..23bf63068e4 100644 --- a/recommender/apiv1beta1/gapic_metadata.json +++ b/recommender/apiv1beta1/gapic_metadata.json @@ -1,52 +1,52 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.recommender.v1beta1", - "libraryPackage": "cloud.google.com/go/recommender/apiv1beta1", - "services": { - "Recommender": { - "clients": { - "grpc": { - "libraryClient": "Client", - "rpcs": { - "GetInsight": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.recommender.v1beta1", + "libraryPackage": "cloud.google.com/go/recommender/apiv1beta1", + "services": { + "Recommender": { + "clients": { + "grpc": { + "libraryClient": "Client", + "rpcs": { + "GetInsight": { + "methods": [ "GetInsight" ] }, - "GetRecommendation": { - "methods": [ + "GetRecommendation": { + "methods": [ "GetRecommendation" ] }, - "ListInsights": { - "methods": [ + "ListInsights": { + "methods": [ "ListInsights" ] }, - "ListRecommendations": { - "methods": [ + "ListRecommendations": { + "methods": [ "ListRecommendations" ] }, - "MarkInsightAccepted": { - "methods": [ + "MarkInsightAccepted": { + "methods": [ "MarkInsightAccepted" ] }, - "MarkRecommendationClaimed": { - "methods": [ + "MarkRecommendationClaimed": { + "methods": [ "MarkRecommendationClaimed" ] }, - "MarkRecommendationFailed": { - "methods": [ + "MarkRecommendationFailed": { + "methods": [ "MarkRecommendationFailed" ] }, - "MarkRecommendationSucceeded": { - "methods": [ + "MarkRecommendationSucceeded": { + "methods": [ "MarkRecommendationSucceeded" ] } diff --git a/redis/apiv1/doc.go b/redis/apiv1/doc.go index 309eb9c97e9..88c276f4a1c 100644 --- a/redis/apiv1/doc.go +++ b/redis/apiv1/doc.go @@ -48,7 +48,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210630" +const versionClient = "20210701" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/redis/apiv1/gapic_metadata.json b/redis/apiv1/gapic_metadata.json index b50e74d5d19..3898343a3c4 100644 --- a/redis/apiv1/gapic_metadata.json +++ b/redis/apiv1/gapic_metadata.json @@ -1,57 +1,57 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.redis.v1", - "libraryPackage": "cloud.google.com/go/redis/apiv1", - "services": { - "CloudRedis": { - "clients": { - "grpc": { - "libraryClient": "CloudRedisClient", - "rpcs": { - "CreateInstance": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.redis.v1", + "libraryPackage": "cloud.google.com/go/redis/apiv1", + "services": { + "CloudRedis": { + "clients": { + "grpc": { + "libraryClient": "CloudRedisClient", + "rpcs": { + "CreateInstance": { + "methods": [ "CreateInstance" ] }, - "DeleteInstance": { - "methods": [ + "DeleteInstance": { + "methods": [ "DeleteInstance" ] }, - "ExportInstance": { - "methods": [ + "ExportInstance": { + "methods": [ "ExportInstance" ] }, - "FailoverInstance": { - "methods": [ + "FailoverInstance": { + "methods": [ "FailoverInstance" ] }, - "GetInstance": { - "methods": [ + "GetInstance": { + "methods": [ "GetInstance" ] }, - "ImportInstance": { - "methods": [ + "ImportInstance": { + "methods": [ "ImportInstance" ] }, - "ListInstances": { - "methods": [ + "ListInstances": { + "methods": [ "ListInstances" ] }, - "UpdateInstance": { - "methods": [ + "UpdateInstance": { + "methods": [ "UpdateInstance" ] }, - "UpgradeInstance": { - "methods": [ + "UpgradeInstance": { + "methods": [ "UpgradeInstance" ] } diff --git a/redis/apiv1beta1/doc.go b/redis/apiv1beta1/doc.go index c11875d34c1..2db6db9eb5e 100644 --- a/redis/apiv1beta1/doc.go +++ b/redis/apiv1beta1/doc.go @@ -50,7 +50,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210630" +const versionClient = "20210701" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/redis/apiv1beta1/gapic_metadata.json b/redis/apiv1beta1/gapic_metadata.json index 928126e482a..a7d95307cec 100644 --- a/redis/apiv1beta1/gapic_metadata.json +++ b/redis/apiv1beta1/gapic_metadata.json @@ -1,57 +1,57 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.redis.v1beta1", - "libraryPackage": "cloud.google.com/go/redis/apiv1beta1", - "services": { - "CloudRedis": { - "clients": { - "grpc": { - "libraryClient": "CloudRedisClient", - "rpcs": { - "CreateInstance": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.redis.v1beta1", + "libraryPackage": "cloud.google.com/go/redis/apiv1beta1", + "services": { + "CloudRedis": { + "clients": { + "grpc": { + "libraryClient": "CloudRedisClient", + "rpcs": { + "CreateInstance": { + "methods": [ "CreateInstance" ] }, - "DeleteInstance": { - "methods": [ + "DeleteInstance": { + "methods": [ "DeleteInstance" ] }, - "ExportInstance": { - "methods": [ + "ExportInstance": { + "methods": [ "ExportInstance" ] }, - "FailoverInstance": { - "methods": [ + "FailoverInstance": { + "methods": [ "FailoverInstance" ] }, - "GetInstance": { - "methods": [ + "GetInstance": { + "methods": [ "GetInstance" ] }, - "ImportInstance": { - "methods": [ + "ImportInstance": { + "methods": [ "ImportInstance" ] }, - "ListInstances": { - "methods": [ + "ListInstances": { + "methods": [ "ListInstances" ] }, - "UpdateInstance": { - "methods": [ + "UpdateInstance": { + "methods": [ "UpdateInstance" ] }, - "UpgradeInstance": { - "methods": [ + "UpgradeInstance": { + "methods": [ "UpgradeInstance" ] } diff --git a/resourcemanager/apiv2/doc.go b/resourcemanager/apiv2/doc.go index 323ca943a43..64f94499fea 100644 --- a/resourcemanager/apiv2/doc.go +++ b/resourcemanager/apiv2/doc.go @@ -49,7 +49,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210630" +const versionClient = "20210701" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/resourcemanager/apiv2/gapic_metadata.json b/resourcemanager/apiv2/gapic_metadata.json index f34cfab5b5a..6f709286f1f 100644 --- a/resourcemanager/apiv2/gapic_metadata.json +++ b/resourcemanager/apiv2/gapic_metadata.json @@ -1,67 +1,67 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.resourcemanager.v2", - "libraryPackage": "cloud.google.com/go/resourcemanager/apiv2", - "services": { - "Folders": { - "clients": { - "grpc": { - "libraryClient": "FoldersClient", - "rpcs": { - "CreateFolder": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.resourcemanager.v2", + "libraryPackage": "cloud.google.com/go/resourcemanager/apiv2", + "services": { + "Folders": { + "clients": { + "grpc": { + "libraryClient": "FoldersClient", + "rpcs": { + "CreateFolder": { + "methods": [ "CreateFolder" ] }, - "DeleteFolder": { - "methods": [ + "DeleteFolder": { + "methods": [ "DeleteFolder" ] }, - "GetFolder": { - "methods": [ + "GetFolder": { + "methods": [ "GetFolder" ] }, - "GetIamPolicy": { - "methods": [ + "GetIamPolicy": { + "methods": [ "GetIamPolicy" ] }, - "ListFolders": { - "methods": [ + "ListFolders": { + "methods": [ "ListFolders" ] }, - "MoveFolder": { - "methods": [ + "MoveFolder": { + "methods": [ "MoveFolder" ] }, - "SearchFolders": { - "methods": [ + "SearchFolders": { + "methods": [ "SearchFolders" ] }, - "SetIamPolicy": { - "methods": [ + "SetIamPolicy": { + "methods": [ "SetIamPolicy" ] }, - "TestIamPermissions": { - "methods": [ + "TestIamPermissions": { + "methods": [ "TestIamPermissions" ] }, - "UndeleteFolder": { - "methods": [ + "UndeleteFolder": { + "methods": [ "UndeleteFolder" ] }, - "UpdateFolder": { - "methods": [ + "UpdateFolder": { + "methods": [ "UpdateFolder" ] } diff --git a/resourcesettings/apiv1/doc.go b/resourcesettings/apiv1/doc.go index 74794a8b9a5..0a8ab6112d9 100644 --- a/resourcesettings/apiv1/doc.go +++ b/resourcesettings/apiv1/doc.go @@ -50,7 +50,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210630" +const versionClient = "20210701" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/resourcesettings/apiv1/gapic_metadata.json b/resourcesettings/apiv1/gapic_metadata.json index d31e8b223ff..a07edb31e64 100644 --- a/resourcesettings/apiv1/gapic_metadata.json +++ b/resourcesettings/apiv1/gapic_metadata.json @@ -1,27 +1,27 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.resourcesettings.v1", - "libraryPackage": "cloud.google.com/go/resourcesettings/apiv1", - "services": { - "ResourceSettingsService": { - "clients": { - "grpc": { - "libraryClient": "Client", - "rpcs": { - "GetSetting": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.resourcesettings.v1", + "libraryPackage": "cloud.google.com/go/resourcesettings/apiv1", + "services": { + "ResourceSettingsService": { + "clients": { + "grpc": { + "libraryClient": "Client", + "rpcs": { + "GetSetting": { + "methods": [ "GetSetting" ] }, - "ListSettings": { - "methods": [ + "ListSettings": { + "methods": [ "ListSettings" ] }, - "UpdateSetting": { - "methods": [ + "UpdateSetting": { + "methods": [ "UpdateSetting" ] } diff --git a/retail/apiv2/doc.go b/retail/apiv2/doc.go index 06b272ce5b1..e11dd65c9d1 100644 --- a/retail/apiv2/doc.go +++ b/retail/apiv2/doc.go @@ -50,7 +50,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210630" +const versionClient = "20210701" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/retail/apiv2/gapic_metadata.json b/retail/apiv2/gapic_metadata.json index 7318b6367c2..946693b2fc6 100644 --- a/retail/apiv2/gapic_metadata.json +++ b/retail/apiv2/gapic_metadata.json @@ -1,22 +1,22 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.retail.v2", - "libraryPackage": "cloud.google.com/go/retail/apiv2", - "services": { - "CatalogService": { - "clients": { - "grpc": { - "libraryClient": "CatalogClient", - "rpcs": { - "ListCatalogs": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.retail.v2", + "libraryPackage": "cloud.google.com/go/retail/apiv2", + "services": { + "CatalogService": { + "clients": { + "grpc": { + "libraryClient": "CatalogClient", + "rpcs": { + "ListCatalogs": { + "methods": [ "ListCatalogs" ] }, - "UpdateCatalog": { - "methods": [ + "UpdateCatalog": { + "methods": [ "UpdateCatalog" ] } @@ -24,13 +24,13 @@ } } }, - "PredictionService": { - "clients": { - "grpc": { - "libraryClient": "PredictionClient", - "rpcs": { - "Predict": { - "methods": [ + "PredictionService": { + "clients": { + "grpc": { + "libraryClient": "PredictionClient", + "rpcs": { + "Predict": { + "methods": [ "Predict" ] } @@ -38,33 +38,33 @@ } } }, - "ProductService": { - "clients": { - "grpc": { - "libraryClient": "ProductClient", - "rpcs": { - "CreateProduct": { - "methods": [ + "ProductService": { + "clients": { + "grpc": { + "libraryClient": "ProductClient", + "rpcs": { + "CreateProduct": { + "methods": [ "CreateProduct" ] }, - "DeleteProduct": { - "methods": [ + "DeleteProduct": { + "methods": [ "DeleteProduct" ] }, - "GetProduct": { - "methods": [ + "GetProduct": { + "methods": [ "GetProduct" ] }, - "ImportProducts": { - "methods": [ + "ImportProducts": { + "methods": [ "ImportProducts" ] }, - "UpdateProduct": { - "methods": [ + "UpdateProduct": { + "methods": [ "UpdateProduct" ] } @@ -72,33 +72,33 @@ } } }, - "UserEventService": { - "clients": { - "grpc": { - "libraryClient": "UserEventClient", - "rpcs": { - "CollectUserEvent": { - "methods": [ + "UserEventService": { + "clients": { + "grpc": { + "libraryClient": "UserEventClient", + "rpcs": { + "CollectUserEvent": { + "methods": [ "CollectUserEvent" ] }, - "ImportUserEvents": { - "methods": [ + "ImportUserEvents": { + "methods": [ "ImportUserEvents" ] }, - "PurgeUserEvents": { - "methods": [ + "PurgeUserEvents": { + "methods": [ "PurgeUserEvents" ] }, - "RejoinUserEvents": { - "methods": [ + "RejoinUserEvents": { + "methods": [ "RejoinUserEvents" ] }, - "WriteUserEvent": { - "methods": [ + "WriteUserEvent": { + "methods": [ "WriteUserEvent" ] } diff --git a/scheduler/apiv1/doc.go b/scheduler/apiv1/doc.go index b4576410e7a..2ee425905fe 100644 --- a/scheduler/apiv1/doc.go +++ b/scheduler/apiv1/doc.go @@ -48,7 +48,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210630" +const versionClient = "20210701" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/scheduler/apiv1/gapic_metadata.json b/scheduler/apiv1/gapic_metadata.json index 40668090202..d0dd864d7ee 100644 --- a/scheduler/apiv1/gapic_metadata.json +++ b/scheduler/apiv1/gapic_metadata.json @@ -1,52 +1,52 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.scheduler.v1", - "libraryPackage": "cloud.google.com/go/scheduler/apiv1", - "services": { - "CloudScheduler": { - "clients": { - "grpc": { - "libraryClient": "CloudSchedulerClient", - "rpcs": { - "CreateJob": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.scheduler.v1", + "libraryPackage": "cloud.google.com/go/scheduler/apiv1", + "services": { + "CloudScheduler": { + "clients": { + "grpc": { + "libraryClient": "CloudSchedulerClient", + "rpcs": { + "CreateJob": { + "methods": [ "CreateJob" ] }, - "DeleteJob": { - "methods": [ + "DeleteJob": { + "methods": [ "DeleteJob" ] }, - "GetJob": { - "methods": [ + "GetJob": { + "methods": [ "GetJob" ] }, - "ListJobs": { - "methods": [ + "ListJobs": { + "methods": [ "ListJobs" ] }, - "PauseJob": { - "methods": [ + "PauseJob": { + "methods": [ "PauseJob" ] }, - "ResumeJob": { - "methods": [ + "ResumeJob": { + "methods": [ "ResumeJob" ] }, - "RunJob": { - "methods": [ + "RunJob": { + "methods": [ "RunJob" ] }, - "UpdateJob": { - "methods": [ + "UpdateJob": { + "methods": [ "UpdateJob" ] } diff --git a/scheduler/apiv1beta1/doc.go b/scheduler/apiv1beta1/doc.go index 6751ab7c053..4814fa38d3a 100644 --- a/scheduler/apiv1beta1/doc.go +++ b/scheduler/apiv1beta1/doc.go @@ -50,7 +50,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210630" +const versionClient = "20210701" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/scheduler/apiv1beta1/gapic_metadata.json b/scheduler/apiv1beta1/gapic_metadata.json index 7d4c4f943be..0af02b964f9 100644 --- a/scheduler/apiv1beta1/gapic_metadata.json +++ b/scheduler/apiv1beta1/gapic_metadata.json @@ -1,52 +1,52 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.scheduler.v1beta1", - "libraryPackage": "cloud.google.com/go/scheduler/apiv1beta1", - "services": { - "CloudScheduler": { - "clients": { - "grpc": { - "libraryClient": "CloudSchedulerClient", - "rpcs": { - "CreateJob": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.scheduler.v1beta1", + "libraryPackage": "cloud.google.com/go/scheduler/apiv1beta1", + "services": { + "CloudScheduler": { + "clients": { + "grpc": { + "libraryClient": "CloudSchedulerClient", + "rpcs": { + "CreateJob": { + "methods": [ "CreateJob" ] }, - "DeleteJob": { - "methods": [ + "DeleteJob": { + "methods": [ "DeleteJob" ] }, - "GetJob": { - "methods": [ + "GetJob": { + "methods": [ "GetJob" ] }, - "ListJobs": { - "methods": [ + "ListJobs": { + "methods": [ "ListJobs" ] }, - "PauseJob": { - "methods": [ + "PauseJob": { + "methods": [ "PauseJob" ] }, - "ResumeJob": { - "methods": [ + "ResumeJob": { + "methods": [ "ResumeJob" ] }, - "RunJob": { - "methods": [ + "RunJob": { + "methods": [ "RunJob" ] }, - "UpdateJob": { - "methods": [ + "UpdateJob": { + "methods": [ "UpdateJob" ] } diff --git a/secretmanager/apiv1/doc.go b/secretmanager/apiv1/doc.go index 1c0eb0450b7..80bb5b816a7 100644 --- a/secretmanager/apiv1/doc.go +++ b/secretmanager/apiv1/doc.go @@ -49,7 +49,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210630" +const versionClient = "20210701" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/secretmanager/apiv1/gapic_metadata.json b/secretmanager/apiv1/gapic_metadata.json index 0b7c538e1fe..a5049c72dad 100644 --- a/secretmanager/apiv1/gapic_metadata.json +++ b/secretmanager/apiv1/gapic_metadata.json @@ -1,87 +1,87 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.secretmanager.v1", - "libraryPackage": "cloud.google.com/go/secretmanager/apiv1", - "services": { - "SecretManagerService": { - "clients": { - "grpc": { - "libraryClient": "Client", - "rpcs": { - "AccessSecretVersion": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.secretmanager.v1", + "libraryPackage": "cloud.google.com/go/secretmanager/apiv1", + "services": { + "SecretManagerService": { + "clients": { + "grpc": { + "libraryClient": "Client", + "rpcs": { + "AccessSecretVersion": { + "methods": [ "AccessSecretVersion" ] }, - "AddSecretVersion": { - "methods": [ + "AddSecretVersion": { + "methods": [ "AddSecretVersion" ] }, - "CreateSecret": { - "methods": [ + "CreateSecret": { + "methods": [ "CreateSecret" ] }, - "DeleteSecret": { - "methods": [ + "DeleteSecret": { + "methods": [ "DeleteSecret" ] }, - "DestroySecretVersion": { - "methods": [ + "DestroySecretVersion": { + "methods": [ "DestroySecretVersion" ] }, - "DisableSecretVersion": { - "methods": [ + "DisableSecretVersion": { + "methods": [ "DisableSecretVersion" ] }, - "EnableSecretVersion": { - "methods": [ + "EnableSecretVersion": { + "methods": [ "EnableSecretVersion" ] }, - "GetIamPolicy": { - "methods": [ + "GetIamPolicy": { + "methods": [ "GetIamPolicy" ] }, - "GetSecret": { - "methods": [ + "GetSecret": { + "methods": [ "GetSecret" ] }, - "GetSecretVersion": { - "methods": [ + "GetSecretVersion": { + "methods": [ "GetSecretVersion" ] }, - "ListSecretVersions": { - "methods": [ + "ListSecretVersions": { + "methods": [ "ListSecretVersions" ] }, - "ListSecrets": { - "methods": [ + "ListSecrets": { + "methods": [ "ListSecrets" ] }, - "SetIamPolicy": { - "methods": [ + "SetIamPolicy": { + "methods": [ "SetIamPolicy" ] }, - "TestIamPermissions": { - "methods": [ + "TestIamPermissions": { + "methods": [ "TestIamPermissions" ] }, - "UpdateSecret": { - "methods": [ + "UpdateSecret": { + "methods": [ "UpdateSecret" ] } diff --git a/secretmanager/apiv1beta1/doc.go b/secretmanager/apiv1beta1/doc.go index 14e5b7cefdf..b0a58a1ed99 100644 --- a/secretmanager/apiv1beta1/doc.go +++ b/secretmanager/apiv1beta1/doc.go @@ -51,7 +51,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210630" +const versionClient = "20210701" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/secretmanager/apiv1beta1/gapic_metadata.json b/secretmanager/apiv1beta1/gapic_metadata.json index 0b85afa83a4..31f38b730d9 100644 --- a/secretmanager/apiv1beta1/gapic_metadata.json +++ b/secretmanager/apiv1beta1/gapic_metadata.json @@ -1,87 +1,87 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.secrets.v1beta1", - "libraryPackage": "cloud.google.com/go/secretmanager/apiv1beta1", - "services": { - "SecretManagerService": { - "clients": { - "grpc": { - "libraryClient": "Client", - "rpcs": { - "AccessSecretVersion": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.secrets.v1beta1", + "libraryPackage": "cloud.google.com/go/secretmanager/apiv1beta1", + "services": { + "SecretManagerService": { + "clients": { + "grpc": { + "libraryClient": "Client", + "rpcs": { + "AccessSecretVersion": { + "methods": [ "AccessSecretVersion" ] }, - "AddSecretVersion": { - "methods": [ + "AddSecretVersion": { + "methods": [ "AddSecretVersion" ] }, - "CreateSecret": { - "methods": [ + "CreateSecret": { + "methods": [ "CreateSecret" ] }, - "DeleteSecret": { - "methods": [ + "DeleteSecret": { + "methods": [ "DeleteSecret" ] }, - "DestroySecretVersion": { - "methods": [ + "DestroySecretVersion": { + "methods": [ "DestroySecretVersion" ] }, - "DisableSecretVersion": { - "methods": [ + "DisableSecretVersion": { + "methods": [ "DisableSecretVersion" ] }, - "EnableSecretVersion": { - "methods": [ + "EnableSecretVersion": { + "methods": [ "EnableSecretVersion" ] }, - "GetIamPolicy": { - "methods": [ + "GetIamPolicy": { + "methods": [ "GetIamPolicy" ] }, - "GetSecret": { - "methods": [ + "GetSecret": { + "methods": [ "GetSecret" ] }, - "GetSecretVersion": { - "methods": [ + "GetSecretVersion": { + "methods": [ "GetSecretVersion" ] }, - "ListSecretVersions": { - "methods": [ + "ListSecretVersions": { + "methods": [ "ListSecretVersions" ] }, - "ListSecrets": { - "methods": [ + "ListSecrets": { + "methods": [ "ListSecrets" ] }, - "SetIamPolicy": { - "methods": [ + "SetIamPolicy": { + "methods": [ "SetIamPolicy" ] }, - "TestIamPermissions": { - "methods": [ + "TestIamPermissions": { + "methods": [ "TestIamPermissions" ] }, - "UpdateSecret": { - "methods": [ + "UpdateSecret": { + "methods": [ "UpdateSecret" ] } diff --git a/security/privateca/apiv1/doc.go b/security/privateca/apiv1/doc.go index b905a6daf0f..4b0d63a0d11 100644 --- a/security/privateca/apiv1/doc.go +++ b/security/privateca/apiv1/doc.go @@ -51,7 +51,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210630" +const versionClient = "20210701" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/security/privateca/apiv1/gapic_metadata.json b/security/privateca/apiv1/gapic_metadata.json index 8f5e39723a8..c979b6d151b 100644 --- a/security/privateca/apiv1/gapic_metadata.json +++ b/security/privateca/apiv1/gapic_metadata.json @@ -1,157 +1,157 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.security.privateca.v1", - "libraryPackage": "cloud.google.com/go/security/privateca/apiv1", - "services": { - "CertificateAuthorityService": { - "clients": { - "grpc": { - "libraryClient": "CertificateAuthorityClient", - "rpcs": { - "ActivateCertificateAuthority": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.security.privateca.v1", + "libraryPackage": "cloud.google.com/go/security/privateca/apiv1", + "services": { + "CertificateAuthorityService": { + "clients": { + "grpc": { + "libraryClient": "CertificateAuthorityClient", + "rpcs": { + "ActivateCertificateAuthority": { + "methods": [ "ActivateCertificateAuthority" ] }, - "CreateCaPool": { - "methods": [ + "CreateCaPool": { + "methods": [ "CreateCaPool" ] }, - "CreateCertificate": { - "methods": [ + "CreateCertificate": { + "methods": [ "CreateCertificate" ] }, - "CreateCertificateAuthority": { - "methods": [ + "CreateCertificateAuthority": { + "methods": [ "CreateCertificateAuthority" ] }, - "CreateCertificateTemplate": { - "methods": [ + "CreateCertificateTemplate": { + "methods": [ "CreateCertificateTemplate" ] }, - "DeleteCaPool": { - "methods": [ + "DeleteCaPool": { + "methods": [ "DeleteCaPool" ] }, - "DeleteCertificateAuthority": { - "methods": [ + "DeleteCertificateAuthority": { + "methods": [ "DeleteCertificateAuthority" ] }, - "DeleteCertificateTemplate": { - "methods": [ + "DeleteCertificateTemplate": { + "methods": [ "DeleteCertificateTemplate" ] }, - "DisableCertificateAuthority": { - "methods": [ + "DisableCertificateAuthority": { + "methods": [ "DisableCertificateAuthority" ] }, - "EnableCertificateAuthority": { - "methods": [ + "EnableCertificateAuthority": { + "methods": [ "EnableCertificateAuthority" ] }, - "FetchCaCerts": { - "methods": [ + "FetchCaCerts": { + "methods": [ "FetchCaCerts" ] }, - "FetchCertificateAuthorityCsr": { - "methods": [ + "FetchCertificateAuthorityCsr": { + "methods": [ "FetchCertificateAuthorityCsr" ] }, - "GetCaPool": { - "methods": [ + "GetCaPool": { + "methods": [ "GetCaPool" ] }, - "GetCertificate": { - "methods": [ + "GetCertificate": { + "methods": [ "GetCertificate" ] }, - "GetCertificateAuthority": { - "methods": [ + "GetCertificateAuthority": { + "methods": [ "GetCertificateAuthority" ] }, - "GetCertificateRevocationList": { - "methods": [ + "GetCertificateRevocationList": { + "methods": [ "GetCertificateRevocationList" ] }, - "GetCertificateTemplate": { - "methods": [ + "GetCertificateTemplate": { + "methods": [ "GetCertificateTemplate" ] }, - "ListCaPools": { - "methods": [ + "ListCaPools": { + "methods": [ "ListCaPools" ] }, - "ListCertificateAuthorities": { - "methods": [ + "ListCertificateAuthorities": { + "methods": [ "ListCertificateAuthorities" ] }, - "ListCertificateRevocationLists": { - "methods": [ + "ListCertificateRevocationLists": { + "methods": [ "ListCertificateRevocationLists" ] }, - "ListCertificateTemplates": { - "methods": [ + "ListCertificateTemplates": { + "methods": [ "ListCertificateTemplates" ] }, - "ListCertificates": { - "methods": [ + "ListCertificates": { + "methods": [ "ListCertificates" ] }, - "RevokeCertificate": { - "methods": [ + "RevokeCertificate": { + "methods": [ "RevokeCertificate" ] }, - "UndeleteCertificateAuthority": { - "methods": [ + "UndeleteCertificateAuthority": { + "methods": [ "UndeleteCertificateAuthority" ] }, - "UpdateCaPool": { - "methods": [ + "UpdateCaPool": { + "methods": [ "UpdateCaPool" ] }, - "UpdateCertificate": { - "methods": [ + "UpdateCertificate": { + "methods": [ "UpdateCertificate" ] }, - "UpdateCertificateAuthority": { - "methods": [ + "UpdateCertificateAuthority": { + "methods": [ "UpdateCertificateAuthority" ] }, - "UpdateCertificateRevocationList": { - "methods": [ + "UpdateCertificateRevocationList": { + "methods": [ "UpdateCertificateRevocationList" ] }, - "UpdateCertificateTemplate": { - "methods": [ + "UpdateCertificateTemplate": { + "methods": [ "UpdateCertificateTemplate" ] } diff --git a/security/privateca/apiv1beta1/doc.go b/security/privateca/apiv1beta1/doc.go index 008aaa9c967..469b3288171 100644 --- a/security/privateca/apiv1beta1/doc.go +++ b/security/privateca/apiv1beta1/doc.go @@ -48,7 +48,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210630" +const versionClient = "20210701" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/security/privateca/apiv1beta1/gapic_metadata.json b/security/privateca/apiv1beta1/gapic_metadata.json index 3ea3f6113ae..d6c24e8707a 100644 --- a/security/privateca/apiv1beta1/gapic_metadata.json +++ b/security/privateca/apiv1beta1/gapic_metadata.json @@ -1,112 +1,112 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.security.privateca.v1beta1", - "libraryPackage": "cloud.google.com/go/security/privateca/apiv1beta1", - "services": { - "CertificateAuthorityService": { - "clients": { - "grpc": { - "libraryClient": "CertificateAuthorityClient", - "rpcs": { - "ActivateCertificateAuthority": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.security.privateca.v1beta1", + "libraryPackage": "cloud.google.com/go/security/privateca/apiv1beta1", + "services": { + "CertificateAuthorityService": { + "clients": { + "grpc": { + "libraryClient": "CertificateAuthorityClient", + "rpcs": { + "ActivateCertificateAuthority": { + "methods": [ "ActivateCertificateAuthority" ] }, - "CreateCertificate": { - "methods": [ + "CreateCertificate": { + "methods": [ "CreateCertificate" ] }, - "CreateCertificateAuthority": { - "methods": [ + "CreateCertificateAuthority": { + "methods": [ "CreateCertificateAuthority" ] }, - "DisableCertificateAuthority": { - "methods": [ + "DisableCertificateAuthority": { + "methods": [ "DisableCertificateAuthority" ] }, - "EnableCertificateAuthority": { - "methods": [ + "EnableCertificateAuthority": { + "methods": [ "EnableCertificateAuthority" ] }, - "FetchCertificateAuthorityCsr": { - "methods": [ + "FetchCertificateAuthorityCsr": { + "methods": [ "FetchCertificateAuthorityCsr" ] }, - "GetCertificate": { - "methods": [ + "GetCertificate": { + "methods": [ "GetCertificate" ] }, - "GetCertificateAuthority": { - "methods": [ + "GetCertificateAuthority": { + "methods": [ "GetCertificateAuthority" ] }, - "GetCertificateRevocationList": { - "methods": [ + "GetCertificateRevocationList": { + "methods": [ "GetCertificateRevocationList" ] }, - "GetReusableConfig": { - "methods": [ + "GetReusableConfig": { + "methods": [ "GetReusableConfig" ] }, - "ListCertificateAuthorities": { - "methods": [ + "ListCertificateAuthorities": { + "methods": [ "ListCertificateAuthorities" ] }, - "ListCertificateRevocationLists": { - "methods": [ + "ListCertificateRevocationLists": { + "methods": [ "ListCertificateRevocationLists" ] }, - "ListCertificates": { - "methods": [ + "ListCertificates": { + "methods": [ "ListCertificates" ] }, - "ListReusableConfigs": { - "methods": [ + "ListReusableConfigs": { + "methods": [ "ListReusableConfigs" ] }, - "RestoreCertificateAuthority": { - "methods": [ + "RestoreCertificateAuthority": { + "methods": [ "RestoreCertificateAuthority" ] }, - "RevokeCertificate": { - "methods": [ + "RevokeCertificate": { + "methods": [ "RevokeCertificate" ] }, - "ScheduleDeleteCertificateAuthority": { - "methods": [ + "ScheduleDeleteCertificateAuthority": { + "methods": [ "ScheduleDeleteCertificateAuthority" ] }, - "UpdateCertificate": { - "methods": [ + "UpdateCertificate": { + "methods": [ "UpdateCertificate" ] }, - "UpdateCertificateAuthority": { - "methods": [ + "UpdateCertificateAuthority": { + "methods": [ "UpdateCertificateAuthority" ] }, - "UpdateCertificateRevocationList": { - "methods": [ + "UpdateCertificateRevocationList": { + "methods": [ "UpdateCertificateRevocationList" ] } diff --git a/securitycenter/apiv1/doc.go b/securitycenter/apiv1/doc.go index bcd3fc0248b..5a1c5e3d4bf 100644 --- a/securitycenter/apiv1/doc.go +++ b/securitycenter/apiv1/doc.go @@ -49,7 +49,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210630" +const versionClient = "20210701" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/securitycenter/apiv1/gapic_metadata.json b/securitycenter/apiv1/gapic_metadata.json index ce8878f4e07..9c8c2592c22 100644 --- a/securitycenter/apiv1/gapic_metadata.json +++ b/securitycenter/apiv1/gapic_metadata.json @@ -1,127 +1,127 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.securitycenter.v1", - "libraryPackage": "cloud.google.com/go/securitycenter/apiv1", - "services": { - "SecurityCenter": { - "clients": { - "grpc": { - "libraryClient": "Client", - "rpcs": { - "CreateFinding": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.securitycenter.v1", + "libraryPackage": "cloud.google.com/go/securitycenter/apiv1", + "services": { + "SecurityCenter": { + "clients": { + "grpc": { + "libraryClient": "Client", + "rpcs": { + "CreateFinding": { + "methods": [ "CreateFinding" ] }, - "CreateNotificationConfig": { - "methods": [ + "CreateNotificationConfig": { + "methods": [ "CreateNotificationConfig" ] }, - "CreateSource": { - "methods": [ + "CreateSource": { + "methods": [ "CreateSource" ] }, - "DeleteNotificationConfig": { - "methods": [ + "DeleteNotificationConfig": { + "methods": [ "DeleteNotificationConfig" ] }, - "GetIamPolicy": { - "methods": [ + "GetIamPolicy": { + "methods": [ "GetIamPolicy" ] }, - "GetNotificationConfig": { - "methods": [ + "GetNotificationConfig": { + "methods": [ "GetNotificationConfig" ] }, - "GetOrganizationSettings": { - "methods": [ + "GetOrganizationSettings": { + "methods": [ "GetOrganizationSettings" ] }, - "GetSource": { - "methods": [ + "GetSource": { + "methods": [ "GetSource" ] }, - "GroupAssets": { - "methods": [ + "GroupAssets": { + "methods": [ "GroupAssets" ] }, - "GroupFindings": { - "methods": [ + "GroupFindings": { + "methods": [ "GroupFindings" ] }, - "ListAssets": { - "methods": [ + "ListAssets": { + "methods": [ "ListAssets" ] }, - "ListFindings": { - "methods": [ + "ListFindings": { + "methods": [ "ListFindings" ] }, - "ListNotificationConfigs": { - "methods": [ + "ListNotificationConfigs": { + "methods": [ "ListNotificationConfigs" ] }, - "ListSources": { - "methods": [ + "ListSources": { + "methods": [ "ListSources" ] }, - "RunAssetDiscovery": { - "methods": [ + "RunAssetDiscovery": { + "methods": [ "RunAssetDiscovery" ] }, - "SetFindingState": { - "methods": [ + "SetFindingState": { + "methods": [ "SetFindingState" ] }, - "SetIamPolicy": { - "methods": [ + "SetIamPolicy": { + "methods": [ "SetIamPolicy" ] }, - "TestIamPermissions": { - "methods": [ + "TestIamPermissions": { + "methods": [ "TestIamPermissions" ] }, - "UpdateFinding": { - "methods": [ + "UpdateFinding": { + "methods": [ "UpdateFinding" ] }, - "UpdateNotificationConfig": { - "methods": [ + "UpdateNotificationConfig": { + "methods": [ "UpdateNotificationConfig" ] }, - "UpdateOrganizationSettings": { - "methods": [ + "UpdateOrganizationSettings": { + "methods": [ "UpdateOrganizationSettings" ] }, - "UpdateSecurityMarks": { - "methods": [ + "UpdateSecurityMarks": { + "methods": [ "UpdateSecurityMarks" ] }, - "UpdateSource": { - "methods": [ + "UpdateSource": { + "methods": [ "UpdateSource" ] } diff --git a/securitycenter/apiv1beta1/doc.go b/securitycenter/apiv1beta1/doc.go index 63d23ba9a0a..2d9d312d199 100644 --- a/securitycenter/apiv1beta1/doc.go +++ b/securitycenter/apiv1beta1/doc.go @@ -51,7 +51,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210630" +const versionClient = "20210701" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/securitycenter/apiv1beta1/gapic_metadata.json b/securitycenter/apiv1beta1/gapic_metadata.json index c5c1ac80636..0bafa06cf3c 100644 --- a/securitycenter/apiv1beta1/gapic_metadata.json +++ b/securitycenter/apiv1beta1/gapic_metadata.json @@ -1,102 +1,102 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.securitycenter.v1beta1", - "libraryPackage": "cloud.google.com/go/securitycenter/apiv1beta1", - "services": { - "SecurityCenter": { - "clients": { - "grpc": { - "libraryClient": "Client", - "rpcs": { - "CreateFinding": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.securitycenter.v1beta1", + "libraryPackage": "cloud.google.com/go/securitycenter/apiv1beta1", + "services": { + "SecurityCenter": { + "clients": { + "grpc": { + "libraryClient": "Client", + "rpcs": { + "CreateFinding": { + "methods": [ "CreateFinding" ] }, - "CreateSource": { - "methods": [ + "CreateSource": { + "methods": [ "CreateSource" ] }, - "GetIamPolicy": { - "methods": [ + "GetIamPolicy": { + "methods": [ "GetIamPolicy" ] }, - "GetOrganizationSettings": { - "methods": [ + "GetOrganizationSettings": { + "methods": [ "GetOrganizationSettings" ] }, - "GetSource": { - "methods": [ + "GetSource": { + "methods": [ "GetSource" ] }, - "GroupAssets": { - "methods": [ + "GroupAssets": { + "methods": [ "GroupAssets" ] }, - "GroupFindings": { - "methods": [ + "GroupFindings": { + "methods": [ "GroupFindings" ] }, - "ListAssets": { - "methods": [ + "ListAssets": { + "methods": [ "ListAssets" ] }, - "ListFindings": { - "methods": [ + "ListFindings": { + "methods": [ "ListFindings" ] }, - "ListSources": { - "methods": [ + "ListSources": { + "methods": [ "ListSources" ] }, - "RunAssetDiscovery": { - "methods": [ + "RunAssetDiscovery": { + "methods": [ "RunAssetDiscovery" ] }, - "SetFindingState": { - "methods": [ + "SetFindingState": { + "methods": [ "SetFindingState" ] }, - "SetIamPolicy": { - "methods": [ + "SetIamPolicy": { + "methods": [ "SetIamPolicy" ] }, - "TestIamPermissions": { - "methods": [ + "TestIamPermissions": { + "methods": [ "TestIamPermissions" ] }, - "UpdateFinding": { - "methods": [ + "UpdateFinding": { + "methods": [ "UpdateFinding" ] }, - "UpdateOrganizationSettings": { - "methods": [ + "UpdateOrganizationSettings": { + "methods": [ "UpdateOrganizationSettings" ] }, - "UpdateSecurityMarks": { - "methods": [ + "UpdateSecurityMarks": { + "methods": [ "UpdateSecurityMarks" ] }, - "UpdateSource": { - "methods": [ + "UpdateSource": { + "methods": [ "UpdateSource" ] } diff --git a/securitycenter/apiv1p1beta1/doc.go b/securitycenter/apiv1p1beta1/doc.go index f49364ff423..e84de24b574 100644 --- a/securitycenter/apiv1p1beta1/doc.go +++ b/securitycenter/apiv1p1beta1/doc.go @@ -51,7 +51,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210630" +const versionClient = "20210701" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/securitycenter/apiv1p1beta1/gapic_metadata.json b/securitycenter/apiv1p1beta1/gapic_metadata.json index bf1f551d0ae..57386d58d3e 100644 --- a/securitycenter/apiv1p1beta1/gapic_metadata.json +++ b/securitycenter/apiv1p1beta1/gapic_metadata.json @@ -1,127 +1,127 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.securitycenter.v1p1beta1", - "libraryPackage": "cloud.google.com/go/securitycenter/apiv1p1beta1", - "services": { - "SecurityCenter": { - "clients": { - "grpc": { - "libraryClient": "Client", - "rpcs": { - "CreateFinding": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.securitycenter.v1p1beta1", + "libraryPackage": "cloud.google.com/go/securitycenter/apiv1p1beta1", + "services": { + "SecurityCenter": { + "clients": { + "grpc": { + "libraryClient": "Client", + "rpcs": { + "CreateFinding": { + "methods": [ "CreateFinding" ] }, - "CreateNotificationConfig": { - "methods": [ + "CreateNotificationConfig": { + "methods": [ "CreateNotificationConfig" ] }, - "CreateSource": { - "methods": [ + "CreateSource": { + "methods": [ "CreateSource" ] }, - "DeleteNotificationConfig": { - "methods": [ + "DeleteNotificationConfig": { + "methods": [ "DeleteNotificationConfig" ] }, - "GetIamPolicy": { - "methods": [ + "GetIamPolicy": { + "methods": [ "GetIamPolicy" ] }, - "GetNotificationConfig": { - "methods": [ + "GetNotificationConfig": { + "methods": [ "GetNotificationConfig" ] }, - "GetOrganizationSettings": { - "methods": [ + "GetOrganizationSettings": { + "methods": [ "GetOrganizationSettings" ] }, - "GetSource": { - "methods": [ + "GetSource": { + "methods": [ "GetSource" ] }, - "GroupAssets": { - "methods": [ + "GroupAssets": { + "methods": [ "GroupAssets" ] }, - "GroupFindings": { - "methods": [ + "GroupFindings": { + "methods": [ "GroupFindings" ] }, - "ListAssets": { - "methods": [ + "ListAssets": { + "methods": [ "ListAssets" ] }, - "ListFindings": { - "methods": [ + "ListFindings": { + "methods": [ "ListFindings" ] }, - "ListNotificationConfigs": { - "methods": [ + "ListNotificationConfigs": { + "methods": [ "ListNotificationConfigs" ] }, - "ListSources": { - "methods": [ + "ListSources": { + "methods": [ "ListSources" ] }, - "RunAssetDiscovery": { - "methods": [ + "RunAssetDiscovery": { + "methods": [ "RunAssetDiscovery" ] }, - "SetFindingState": { - "methods": [ + "SetFindingState": { + "methods": [ "SetFindingState" ] }, - "SetIamPolicy": { - "methods": [ + "SetIamPolicy": { + "methods": [ "SetIamPolicy" ] }, - "TestIamPermissions": { - "methods": [ + "TestIamPermissions": { + "methods": [ "TestIamPermissions" ] }, - "UpdateFinding": { - "methods": [ + "UpdateFinding": { + "methods": [ "UpdateFinding" ] }, - "UpdateNotificationConfig": { - "methods": [ + "UpdateNotificationConfig": { + "methods": [ "UpdateNotificationConfig" ] }, - "UpdateOrganizationSettings": { - "methods": [ + "UpdateOrganizationSettings": { + "methods": [ "UpdateOrganizationSettings" ] }, - "UpdateSecurityMarks": { - "methods": [ + "UpdateSecurityMarks": { + "methods": [ "UpdateSecurityMarks" ] }, - "UpdateSource": { - "methods": [ + "UpdateSource": { + "methods": [ "UpdateSource" ] } diff --git a/securitycenter/settings/apiv1beta1/doc.go b/securitycenter/settings/apiv1beta1/doc.go index 9043c6fdb9d..dc35f507e48 100644 --- a/securitycenter/settings/apiv1beta1/doc.go +++ b/securitycenter/settings/apiv1beta1/doc.go @@ -51,7 +51,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210630" +const versionClient = "20210701" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/securitycenter/settings/apiv1beta1/gapic_metadata.json b/securitycenter/settings/apiv1beta1/gapic_metadata.json index 8cc28a604b1..ef3a6db6dc7 100644 --- a/securitycenter/settings/apiv1beta1/gapic_metadata.json +++ b/securitycenter/settings/apiv1beta1/gapic_metadata.json @@ -1,77 +1,77 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.securitycenter.settings.v1beta1", - "libraryPackage": "cloud.google.com/go/securitycenter/settings/apiv1beta1", - "services": { - "SecurityCenterSettingsService": { - "clients": { - "grpc": { - "libraryClient": "SecurityCenterSettingsClient", - "rpcs": { - "BatchCalculateEffectiveSettings": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.securitycenter.settings.v1beta1", + "libraryPackage": "cloud.google.com/go/securitycenter/settings/apiv1beta1", + "services": { + "SecurityCenterSettingsService": { + "clients": { + "grpc": { + "libraryClient": "SecurityCenterSettingsClient", + "rpcs": { + "BatchCalculateEffectiveSettings": { + "methods": [ "BatchCalculateEffectiveSettings" ] }, - "BatchGetSettings": { - "methods": [ + "BatchGetSettings": { + "methods": [ "BatchGetSettings" ] }, - "CalculateEffectiveComponentSettings": { - "methods": [ + "CalculateEffectiveComponentSettings": { + "methods": [ "CalculateEffectiveComponentSettings" ] }, - "CalculateEffectiveSettings": { - "methods": [ + "CalculateEffectiveSettings": { + "methods": [ "CalculateEffectiveSettings" ] }, - "GetComponentSettings": { - "methods": [ + "GetComponentSettings": { + "methods": [ "GetComponentSettings" ] }, - "GetServiceAccount": { - "methods": [ + "GetServiceAccount": { + "methods": [ "GetServiceAccount" ] }, - "GetSettings": { - "methods": [ + "GetSettings": { + "methods": [ "GetSettings" ] }, - "ListComponents": { - "methods": [ + "ListComponents": { + "methods": [ "ListComponents" ] }, - "ListDetectors": { - "methods": [ + "ListDetectors": { + "methods": [ "ListDetectors" ] }, - "ResetComponentSettings": { - "methods": [ + "ResetComponentSettings": { + "methods": [ "ResetComponentSettings" ] }, - "ResetSettings": { - "methods": [ + "ResetSettings": { + "methods": [ "ResetSettings" ] }, - "UpdateComponentSettings": { - "methods": [ + "UpdateComponentSettings": { + "methods": [ "UpdateComponentSettings" ] }, - "UpdateSettings": { - "methods": [ + "UpdateSettings": { + "methods": [ "UpdateSettings" ] } diff --git a/servicecontrol/apiv1/doc.go b/servicecontrol/apiv1/doc.go index 790142cb65a..5995fa3623c 100644 --- a/servicecontrol/apiv1/doc.go +++ b/servicecontrol/apiv1/doc.go @@ -49,7 +49,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210630" +const versionClient = "20210701" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/servicecontrol/apiv1/gapic_metadata.json b/servicecontrol/apiv1/gapic_metadata.json index 6e2938974f1..6ae77225005 100644 --- a/servicecontrol/apiv1/gapic_metadata.json +++ b/servicecontrol/apiv1/gapic_metadata.json @@ -1,17 +1,17 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.api.servicecontrol.v1", - "libraryPackage": "cloud.google.com/go/servicecontrol/apiv1", - "services": { - "QuotaController": { - "clients": { - "grpc": { - "libraryClient": "QuotaControllerClient", - "rpcs": { - "AllocateQuota": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.api.servicecontrol.v1", + "libraryPackage": "cloud.google.com/go/servicecontrol/apiv1", + "services": { + "QuotaController": { + "clients": { + "grpc": { + "libraryClient": "QuotaControllerClient", + "rpcs": { + "AllocateQuota": { + "methods": [ "AllocateQuota" ] } @@ -19,18 +19,18 @@ } } }, - "ServiceController": { - "clients": { - "grpc": { - "libraryClient": "ServiceControllerClient", - "rpcs": { - "Check": { - "methods": [ + "ServiceController": { + "clients": { + "grpc": { + "libraryClient": "ServiceControllerClient", + "rpcs": { + "Check": { + "methods": [ "Check" ] }, - "Report": { - "methods": [ + "Report": { + "methods": [ "Report" ] } diff --git a/servicedirectory/apiv1/doc.go b/servicedirectory/apiv1/doc.go index 991a0be48e2..2f164c581b0 100644 --- a/servicedirectory/apiv1/doc.go +++ b/servicedirectory/apiv1/doc.go @@ -49,7 +49,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210630" +const versionClient = "20210701" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/servicedirectory/apiv1/gapic_metadata.json b/servicedirectory/apiv1/gapic_metadata.json index a3b82c3fc73..0cfd6fd3345 100644 --- a/servicedirectory/apiv1/gapic_metadata.json +++ b/servicedirectory/apiv1/gapic_metadata.json @@ -1,17 +1,17 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.servicedirectory.v1", - "libraryPackage": "cloud.google.com/go/servicedirectory/apiv1", - "services": { - "LookupService": { - "clients": { - "grpc": { - "libraryClient": "LookupClient", - "rpcs": { - "ResolveService": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.servicedirectory.v1", + "libraryPackage": "cloud.google.com/go/servicedirectory/apiv1", + "services": { + "LookupService": { + "clients": { + "grpc": { + "libraryClient": "LookupClient", + "rpcs": { + "ResolveService": { + "methods": [ "ResolveService" ] } @@ -19,98 +19,98 @@ } } }, - "RegistrationService": { - "clients": { - "grpc": { - "libraryClient": "RegistrationClient", - "rpcs": { - "CreateEndpoint": { - "methods": [ + "RegistrationService": { + "clients": { + "grpc": { + "libraryClient": "RegistrationClient", + "rpcs": { + "CreateEndpoint": { + "methods": [ "CreateEndpoint" ] }, - "CreateNamespace": { - "methods": [ + "CreateNamespace": { + "methods": [ "CreateNamespace" ] }, - "CreateService": { - "methods": [ + "CreateService": { + "methods": [ "CreateService" ] }, - "DeleteEndpoint": { - "methods": [ + "DeleteEndpoint": { + "methods": [ "DeleteEndpoint" ] }, - "DeleteNamespace": { - "methods": [ + "DeleteNamespace": { + "methods": [ "DeleteNamespace" ] }, - "DeleteService": { - "methods": [ + "DeleteService": { + "methods": [ "DeleteService" ] }, - "GetEndpoint": { - "methods": [ + "GetEndpoint": { + "methods": [ "GetEndpoint" ] }, - "GetIamPolicy": { - "methods": [ + "GetIamPolicy": { + "methods": [ "GetIamPolicy" ] }, - "GetNamespace": { - "methods": [ + "GetNamespace": { + "methods": [ "GetNamespace" ] }, - "GetService": { - "methods": [ + "GetService": { + "methods": [ "GetService" ] }, - "ListEndpoints": { - "methods": [ + "ListEndpoints": { + "methods": [ "ListEndpoints" ] }, - "ListNamespaces": { - "methods": [ + "ListNamespaces": { + "methods": [ "ListNamespaces" ] }, - "ListServices": { - "methods": [ + "ListServices": { + "methods": [ "ListServices" ] }, - "SetIamPolicy": { - "methods": [ + "SetIamPolicy": { + "methods": [ "SetIamPolicy" ] }, - "TestIamPermissions": { - "methods": [ + "TestIamPermissions": { + "methods": [ "TestIamPermissions" ] }, - "UpdateEndpoint": { - "methods": [ + "UpdateEndpoint": { + "methods": [ "UpdateEndpoint" ] }, - "UpdateNamespace": { - "methods": [ + "UpdateNamespace": { + "methods": [ "UpdateNamespace" ] }, - "UpdateService": { - "methods": [ + "UpdateService": { + "methods": [ "UpdateService" ] } diff --git a/servicedirectory/apiv1beta1/doc.go b/servicedirectory/apiv1beta1/doc.go index b63b25ff36d..fa7b8e51b9f 100644 --- a/servicedirectory/apiv1beta1/doc.go +++ b/servicedirectory/apiv1beta1/doc.go @@ -51,7 +51,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210630" +const versionClient = "20210701" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/servicedirectory/apiv1beta1/gapic_metadata.json b/servicedirectory/apiv1beta1/gapic_metadata.json index da14be6c39b..13f4d2fec39 100644 --- a/servicedirectory/apiv1beta1/gapic_metadata.json +++ b/servicedirectory/apiv1beta1/gapic_metadata.json @@ -1,17 +1,17 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.servicedirectory.v1beta1", - "libraryPackage": "cloud.google.com/go/servicedirectory/apiv1beta1", - "services": { - "LookupService": { - "clients": { - "grpc": { - "libraryClient": "LookupClient", - "rpcs": { - "ResolveService": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.servicedirectory.v1beta1", + "libraryPackage": "cloud.google.com/go/servicedirectory/apiv1beta1", + "services": { + "LookupService": { + "clients": { + "grpc": { + "libraryClient": "LookupClient", + "rpcs": { + "ResolveService": { + "methods": [ "ResolveService" ] } @@ -19,98 +19,98 @@ } } }, - "RegistrationService": { - "clients": { - "grpc": { - "libraryClient": "RegistrationClient", - "rpcs": { - "CreateEndpoint": { - "methods": [ + "RegistrationService": { + "clients": { + "grpc": { + "libraryClient": "RegistrationClient", + "rpcs": { + "CreateEndpoint": { + "methods": [ "CreateEndpoint" ] }, - "CreateNamespace": { - "methods": [ + "CreateNamespace": { + "methods": [ "CreateNamespace" ] }, - "CreateService": { - "methods": [ + "CreateService": { + "methods": [ "CreateService" ] }, - "DeleteEndpoint": { - "methods": [ + "DeleteEndpoint": { + "methods": [ "DeleteEndpoint" ] }, - "DeleteNamespace": { - "methods": [ + "DeleteNamespace": { + "methods": [ "DeleteNamespace" ] }, - "DeleteService": { - "methods": [ + "DeleteService": { + "methods": [ "DeleteService" ] }, - "GetEndpoint": { - "methods": [ + "GetEndpoint": { + "methods": [ "GetEndpoint" ] }, - "GetIamPolicy": { - "methods": [ + "GetIamPolicy": { + "methods": [ "GetIamPolicy" ] }, - "GetNamespace": { - "methods": [ + "GetNamespace": { + "methods": [ "GetNamespace" ] }, - "GetService": { - "methods": [ + "GetService": { + "methods": [ "GetService" ] }, - "ListEndpoints": { - "methods": [ + "ListEndpoints": { + "methods": [ "ListEndpoints" ] }, - "ListNamespaces": { - "methods": [ + "ListNamespaces": { + "methods": [ "ListNamespaces" ] }, - "ListServices": { - "methods": [ + "ListServices": { + "methods": [ "ListServices" ] }, - "SetIamPolicy": { - "methods": [ + "SetIamPolicy": { + "methods": [ "SetIamPolicy" ] }, - "TestIamPermissions": { - "methods": [ + "TestIamPermissions": { + "methods": [ "TestIamPermissions" ] }, - "UpdateEndpoint": { - "methods": [ + "UpdateEndpoint": { + "methods": [ "UpdateEndpoint" ] }, - "UpdateNamespace": { - "methods": [ + "UpdateNamespace": { + "methods": [ "UpdateNamespace" ] }, - "UpdateService": { - "methods": [ + "UpdateService": { + "methods": [ "UpdateService" ] } diff --git a/servicemanagement/apiv1/doc.go b/servicemanagement/apiv1/doc.go index a9a150052eb..7b126a8d0d4 100644 --- a/servicemanagement/apiv1/doc.go +++ b/servicemanagement/apiv1/doc.go @@ -50,7 +50,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210630" +const versionClient = "20210701" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/servicemanagement/apiv1/gapic_metadata.json b/servicemanagement/apiv1/gapic_metadata.json index d494f0192d0..76ab2fcdbc3 100644 --- a/servicemanagement/apiv1/gapic_metadata.json +++ b/servicemanagement/apiv1/gapic_metadata.json @@ -1,87 +1,87 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.api.servicemanagement.v1", - "libraryPackage": "cloud.google.com/go/servicemanagement/apiv1", - "services": { - "ServiceManager": { - "clients": { - "grpc": { - "libraryClient": "ServiceManagerClient", - "rpcs": { - "CreateService": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.api.servicemanagement.v1", + "libraryPackage": "cloud.google.com/go/servicemanagement/apiv1", + "services": { + "ServiceManager": { + "clients": { + "grpc": { + "libraryClient": "ServiceManagerClient", + "rpcs": { + "CreateService": { + "methods": [ "CreateService" ] }, - "CreateServiceConfig": { - "methods": [ + "CreateServiceConfig": { + "methods": [ "CreateServiceConfig" ] }, - "CreateServiceRollout": { - "methods": [ + "CreateServiceRollout": { + "methods": [ "CreateServiceRollout" ] }, - "DeleteService": { - "methods": [ + "DeleteService": { + "methods": [ "DeleteService" ] }, - "DisableService": { - "methods": [ + "DisableService": { + "methods": [ "DisableService" ] }, - "EnableService": { - "methods": [ + "EnableService": { + "methods": [ "EnableService" ] }, - "GenerateConfigReport": { - "methods": [ + "GenerateConfigReport": { + "methods": [ "GenerateConfigReport" ] }, - "GetService": { - "methods": [ + "GetService": { + "methods": [ "GetService" ] }, - "GetServiceConfig": { - "methods": [ + "GetServiceConfig": { + "methods": [ "GetServiceConfig" ] }, - "GetServiceRollout": { - "methods": [ + "GetServiceRollout": { + "methods": [ "GetServiceRollout" ] }, - "ListServiceConfigs": { - "methods": [ + "ListServiceConfigs": { + "methods": [ "ListServiceConfigs" ] }, - "ListServiceRollouts": { - "methods": [ + "ListServiceRollouts": { + "methods": [ "ListServiceRollouts" ] }, - "ListServices": { - "methods": [ + "ListServices": { + "methods": [ "ListServices" ] }, - "SubmitConfigSource": { - "methods": [ + "SubmitConfigSource": { + "methods": [ "SubmitConfigSource" ] }, - "UndeleteService": { - "methods": [ + "UndeleteService": { + "methods": [ "UndeleteService" ] } diff --git a/serviceusage/apiv1/doc.go b/serviceusage/apiv1/doc.go index e3e2054b1f7..85c71b37b55 100644 --- a/serviceusage/apiv1/doc.go +++ b/serviceusage/apiv1/doc.go @@ -50,7 +50,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210630" +const versionClient = "20210701" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/serviceusage/apiv1/gapic_metadata.json b/serviceusage/apiv1/gapic_metadata.json index 5df488bbece..9c9213fb2f5 100644 --- a/serviceusage/apiv1/gapic_metadata.json +++ b/serviceusage/apiv1/gapic_metadata.json @@ -1,42 +1,42 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.api.serviceusage.v1", - "libraryPackage": "cloud.google.com/go/serviceusage/apiv1", - "services": { - "ServiceUsage": { - "clients": { - "grpc": { - "libraryClient": "Client", - "rpcs": { - "BatchEnableServices": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.api.serviceusage.v1", + "libraryPackage": "cloud.google.com/go/serviceusage/apiv1", + "services": { + "ServiceUsage": { + "clients": { + "grpc": { + "libraryClient": "Client", + "rpcs": { + "BatchEnableServices": { + "methods": [ "BatchEnableServices" ] }, - "BatchGetServices": { - "methods": [ + "BatchGetServices": { + "methods": [ "BatchGetServices" ] }, - "DisableService": { - "methods": [ + "DisableService": { + "methods": [ "DisableService" ] }, - "EnableService": { - "methods": [ + "EnableService": { + "methods": [ "EnableService" ] }, - "GetService": { - "methods": [ + "GetService": { + "methods": [ "GetService" ] }, - "ListServices": { - "methods": [ + "ListServices": { + "methods": [ "ListServices" ] } diff --git a/shell/apiv1/doc.go b/shell/apiv1/doc.go index 1f964173959..519481b1aaf 100644 --- a/shell/apiv1/doc.go +++ b/shell/apiv1/doc.go @@ -51,7 +51,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210630" +const versionClient = "20210701" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/shell/apiv1/gapic_metadata.json b/shell/apiv1/gapic_metadata.json index 9ed4b9782fe..9f2bef8962e 100644 --- a/shell/apiv1/gapic_metadata.json +++ b/shell/apiv1/gapic_metadata.json @@ -1,37 +1,37 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.shell.v1", - "libraryPackage": "cloud.google.com/go/shell/apiv1", - "services": { - "CloudShellService": { - "clients": { - "grpc": { - "libraryClient": "CloudShellClient", - "rpcs": { - "AddPublicKey": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.shell.v1", + "libraryPackage": "cloud.google.com/go/shell/apiv1", + "services": { + "CloudShellService": { + "clients": { + "grpc": { + "libraryClient": "CloudShellClient", + "rpcs": { + "AddPublicKey": { + "methods": [ "AddPublicKey" ] }, - "AuthorizeEnvironment": { - "methods": [ + "AuthorizeEnvironment": { + "methods": [ "AuthorizeEnvironment" ] }, - "GetEnvironment": { - "methods": [ + "GetEnvironment": { + "methods": [ "GetEnvironment" ] }, - "RemovePublicKey": { - "methods": [ + "RemovePublicKey": { + "methods": [ "RemovePublicKey" ] }, - "StartEnvironment": { - "methods": [ + "StartEnvironment": { + "methods": [ "StartEnvironment" ] } diff --git a/spanner/admin/database/apiv1/doc.go b/spanner/admin/database/apiv1/doc.go index c31d02ef04e..9830571ea07 100644 --- a/spanner/admin/database/apiv1/doc.go +++ b/spanner/admin/database/apiv1/doc.go @@ -46,7 +46,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210630" +const versionClient = "20210701" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/spanner/admin/database/apiv1/gapic_metadata.json b/spanner/admin/database/apiv1/gapic_metadata.json index 7d6e483909f..e99be310982 100644 --- a/spanner/admin/database/apiv1/gapic_metadata.json +++ b/spanner/admin/database/apiv1/gapic_metadata.json @@ -1,97 +1,97 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.spanner.admin.database.v1", - "libraryPackage": "cloud.google.com/go/spanner/admin/database/apiv1", - "services": { - "DatabaseAdmin": { - "clients": { - "grpc": { - "libraryClient": "DatabaseAdminClient", - "rpcs": { - "CreateBackup": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.spanner.admin.database.v1", + "libraryPackage": "cloud.google.com/go/spanner/admin/database/apiv1", + "services": { + "DatabaseAdmin": { + "clients": { + "grpc": { + "libraryClient": "DatabaseAdminClient", + "rpcs": { + "CreateBackup": { + "methods": [ "CreateBackup" ] }, - "CreateDatabase": { - "methods": [ + "CreateDatabase": { + "methods": [ "CreateDatabase" ] }, - "DeleteBackup": { - "methods": [ + "DeleteBackup": { + "methods": [ "DeleteBackup" ] }, - "DropDatabase": { - "methods": [ + "DropDatabase": { + "methods": [ "DropDatabase" ] }, - "GetBackup": { - "methods": [ + "GetBackup": { + "methods": [ "GetBackup" ] }, - "GetDatabase": { - "methods": [ + "GetDatabase": { + "methods": [ "GetDatabase" ] }, - "GetDatabaseDdl": { - "methods": [ + "GetDatabaseDdl": { + "methods": [ "GetDatabaseDdl" ] }, - "GetIamPolicy": { - "methods": [ + "GetIamPolicy": { + "methods": [ "GetIamPolicy" ] }, - "ListBackupOperations": { - "methods": [ + "ListBackupOperations": { + "methods": [ "ListBackupOperations" ] }, - "ListBackups": { - "methods": [ + "ListBackups": { + "methods": [ "ListBackups" ] }, - "ListDatabaseOperations": { - "methods": [ + "ListDatabaseOperations": { + "methods": [ "ListDatabaseOperations" ] }, - "ListDatabases": { - "methods": [ + "ListDatabases": { + "methods": [ "ListDatabases" ] }, - "RestoreDatabase": { - "methods": [ + "RestoreDatabase": { + "methods": [ "RestoreDatabase" ] }, - "SetIamPolicy": { - "methods": [ + "SetIamPolicy": { + "methods": [ "SetIamPolicy" ] }, - "TestIamPermissions": { - "methods": [ + "TestIamPermissions": { + "methods": [ "TestIamPermissions" ] }, - "UpdateBackup": { - "methods": [ + "UpdateBackup": { + "methods": [ "UpdateBackup" ] }, - "UpdateDatabaseDdl": { - "methods": [ + "UpdateDatabaseDdl": { + "methods": [ "UpdateDatabaseDdl" ] } diff --git a/spanner/admin/instance/apiv1/doc.go b/spanner/admin/instance/apiv1/doc.go index 9aa40e6eab9..eb313b2c3c1 100644 --- a/spanner/admin/instance/apiv1/doc.go +++ b/spanner/admin/instance/apiv1/doc.go @@ -46,7 +46,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210630" +const versionClient = "20210701" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/spanner/admin/instance/apiv1/gapic_metadata.json b/spanner/admin/instance/apiv1/gapic_metadata.json index c3ff88742f9..641de7334ae 100644 --- a/spanner/admin/instance/apiv1/gapic_metadata.json +++ b/spanner/admin/instance/apiv1/gapic_metadata.json @@ -1,62 +1,62 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.spanner.admin.instance.v1", - "libraryPackage": "cloud.google.com/go/spanner/admin/instance/apiv1", - "services": { - "InstanceAdmin": { - "clients": { - "grpc": { - "libraryClient": "InstanceAdminClient", - "rpcs": { - "CreateInstance": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.spanner.admin.instance.v1", + "libraryPackage": "cloud.google.com/go/spanner/admin/instance/apiv1", + "services": { + "InstanceAdmin": { + "clients": { + "grpc": { + "libraryClient": "InstanceAdminClient", + "rpcs": { + "CreateInstance": { + "methods": [ "CreateInstance" ] }, - "DeleteInstance": { - "methods": [ + "DeleteInstance": { + "methods": [ "DeleteInstance" ] }, - "GetIamPolicy": { - "methods": [ + "GetIamPolicy": { + "methods": [ "GetIamPolicy" ] }, - "GetInstance": { - "methods": [ + "GetInstance": { + "methods": [ "GetInstance" ] }, - "GetInstanceConfig": { - "methods": [ + "GetInstanceConfig": { + "methods": [ "GetInstanceConfig" ] }, - "ListInstanceConfigs": { - "methods": [ + "ListInstanceConfigs": { + "methods": [ "ListInstanceConfigs" ] }, - "ListInstances": { - "methods": [ + "ListInstances": { + "methods": [ "ListInstances" ] }, - "SetIamPolicy": { - "methods": [ + "SetIamPolicy": { + "methods": [ "SetIamPolicy" ] }, - "TestIamPermissions": { - "methods": [ + "TestIamPermissions": { + "methods": [ "TestIamPermissions" ] }, - "UpdateInstance": { - "methods": [ + "UpdateInstance": { + "methods": [ "UpdateInstance" ] } diff --git a/spanner/apiv1/doc.go b/spanner/apiv1/doc.go index 91c6e30ead7..512f60f25f6 100644 --- a/spanner/apiv1/doc.go +++ b/spanner/apiv1/doc.go @@ -49,7 +49,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210630" +const versionClient = "20210701" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/spanner/apiv1/gapic_metadata.json b/spanner/apiv1/gapic_metadata.json index 1a3d6364729..7a47d346784 100644 --- a/spanner/apiv1/gapic_metadata.json +++ b/spanner/apiv1/gapic_metadata.json @@ -1,87 +1,87 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.spanner.v1", - "libraryPackage": "cloud.google.com/go/spanner/apiv1", - "services": { - "Spanner": { - "clients": { - "grpc": { - "libraryClient": "Client", - "rpcs": { - "BatchCreateSessions": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.spanner.v1", + "libraryPackage": "cloud.google.com/go/spanner/apiv1", + "services": { + "Spanner": { + "clients": { + "grpc": { + "libraryClient": "Client", + "rpcs": { + "BatchCreateSessions": { + "methods": [ "BatchCreateSessions" ] }, - "BeginTransaction": { - "methods": [ + "BeginTransaction": { + "methods": [ "BeginTransaction" ] }, - "Commit": { - "methods": [ + "Commit": { + "methods": [ "Commit" ] }, - "CreateSession": { - "methods": [ + "CreateSession": { + "methods": [ "CreateSession" ] }, - "DeleteSession": { - "methods": [ + "DeleteSession": { + "methods": [ "DeleteSession" ] }, - "ExecuteBatchDml": { - "methods": [ + "ExecuteBatchDml": { + "methods": [ "ExecuteBatchDml" ] }, - "ExecuteSql": { - "methods": [ + "ExecuteSql": { + "methods": [ "ExecuteSql" ] }, - "ExecuteStreamingSql": { - "methods": [ + "ExecuteStreamingSql": { + "methods": [ "ExecuteStreamingSql" ] }, - "GetSession": { - "methods": [ + "GetSession": { + "methods": [ "GetSession" ] }, - "ListSessions": { - "methods": [ + "ListSessions": { + "methods": [ "ListSessions" ] }, - "PartitionQuery": { - "methods": [ + "PartitionQuery": { + "methods": [ "PartitionQuery" ] }, - "PartitionRead": { - "methods": [ + "PartitionRead": { + "methods": [ "PartitionRead" ] }, - "Read": { - "methods": [ + "Read": { + "methods": [ "Read" ] }, - "Rollback": { - "methods": [ + "Rollback": { + "methods": [ "Rollback" ] }, - "StreamingRead": { - "methods": [ + "StreamingRead": { + "methods": [ "StreamingRead" ] } diff --git a/spanner/go.mod b/spanner/go.mod index 36160c00fc5..457a68aea49 100644 --- a/spanner/go.mod +++ b/spanner/go.mod @@ -10,7 +10,7 @@ require ( go.opencensus.io v0.23.0 golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 google.golang.org/api v0.50.0 - google.golang.org/genproto v0.0.0-20210630183607-d20f26d13c79 + google.golang.org/genproto v0.0.0-20210701133433-6b8dcf568a95 google.golang.org/grpc v1.38.0 google.golang.org/protobuf v1.27.1 ) diff --git a/spanner/go.sum b/spanner/go.sum index 9e44f7fc0b6..aa8fd5de0a2 100644 --- a/spanner/go.sum +++ b/spanner/go.sum @@ -450,8 +450,8 @@ google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxH google.golang.org/genproto v0.0.0-20210604141403-392c879c8b08/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= google.golang.org/genproto v0.0.0-20210608205507-b6d2f5bf0d7d/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= google.golang.org/genproto v0.0.0-20210624195500-8bfb893ecb84/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24= -google.golang.org/genproto v0.0.0-20210630183607-d20f26d13c79 h1:s1jFTXJryg4a1mew7xv03VZD8N9XjxFhk1o4Js4WvPQ= -google.golang.org/genproto v0.0.0-20210630183607-d20f26d13c79/go.mod h1:yiaVoXHpRzHGyxV3o4DktVWY4mSUErTKaeEOq6C3t3U= +google.golang.org/genproto v0.0.0-20210701133433-6b8dcf568a95 h1:xyRjacsGcaSoZ2fTcaLCSzh2JEceLLOT4X8k32Q0xAQ= +google.golang.org/genproto v0.0.0-20210701133433-6b8dcf568a95/go.mod h1:yiaVoXHpRzHGyxV3o4DktVWY4mSUErTKaeEOq6C3t3U= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= diff --git a/speech/apiv1/doc.go b/speech/apiv1/doc.go index 9457d7d7a5a..37405d8bb7b 100644 --- a/speech/apiv1/doc.go +++ b/speech/apiv1/doc.go @@ -48,7 +48,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210630" +const versionClient = "20210701" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/speech/apiv1/gapic_metadata.json b/speech/apiv1/gapic_metadata.json index cdc96357a36..299da42f5ed 100644 --- a/speech/apiv1/gapic_metadata.json +++ b/speech/apiv1/gapic_metadata.json @@ -1,27 +1,27 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.speech.v1", - "libraryPackage": "cloud.google.com/go/speech/apiv1", - "services": { - "Speech": { - "clients": { - "grpc": { - "libraryClient": "Client", - "rpcs": { - "LongRunningRecognize": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.speech.v1", + "libraryPackage": "cloud.google.com/go/speech/apiv1", + "services": { + "Speech": { + "clients": { + "grpc": { + "libraryClient": "Client", + "rpcs": { + "LongRunningRecognize": { + "methods": [ "LongRunningRecognize" ] }, - "Recognize": { - "methods": [ + "Recognize": { + "methods": [ "Recognize" ] }, - "StreamingRecognize": { - "methods": [ + "StreamingRecognize": { + "methods": [ "StreamingRecognize" ] } diff --git a/speech/apiv1p1beta1/doc.go b/speech/apiv1p1beta1/doc.go index 3da928467c2..3b2a00d5ec1 100644 --- a/speech/apiv1p1beta1/doc.go +++ b/speech/apiv1p1beta1/doc.go @@ -50,7 +50,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210630" +const versionClient = "20210701" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/speech/apiv1p1beta1/gapic_metadata.json b/speech/apiv1p1beta1/gapic_metadata.json index 99d872caa8f..37520a28aee 100644 --- a/speech/apiv1p1beta1/gapic_metadata.json +++ b/speech/apiv1p1beta1/gapic_metadata.json @@ -1,62 +1,62 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.speech.v1p1beta1", - "libraryPackage": "cloud.google.com/go/speech/apiv1p1beta1", - "services": { - "Adaptation": { - "clients": { - "grpc": { - "libraryClient": "AdaptationClient", - "rpcs": { - "CreateCustomClass": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.speech.v1p1beta1", + "libraryPackage": "cloud.google.com/go/speech/apiv1p1beta1", + "services": { + "Adaptation": { + "clients": { + "grpc": { + "libraryClient": "AdaptationClient", + "rpcs": { + "CreateCustomClass": { + "methods": [ "CreateCustomClass" ] }, - "CreatePhraseSet": { - "methods": [ + "CreatePhraseSet": { + "methods": [ "CreatePhraseSet" ] }, - "DeleteCustomClass": { - "methods": [ + "DeleteCustomClass": { + "methods": [ "DeleteCustomClass" ] }, - "DeletePhraseSet": { - "methods": [ + "DeletePhraseSet": { + "methods": [ "DeletePhraseSet" ] }, - "GetCustomClass": { - "methods": [ + "GetCustomClass": { + "methods": [ "GetCustomClass" ] }, - "GetPhraseSet": { - "methods": [ + "GetPhraseSet": { + "methods": [ "GetPhraseSet" ] }, - "ListCustomClasses": { - "methods": [ + "ListCustomClasses": { + "methods": [ "ListCustomClasses" ] }, - "ListPhraseSet": { - "methods": [ + "ListPhraseSet": { + "methods": [ "ListPhraseSet" ] }, - "UpdateCustomClass": { - "methods": [ + "UpdateCustomClass": { + "methods": [ "UpdateCustomClass" ] }, - "UpdatePhraseSet": { - "methods": [ + "UpdatePhraseSet": { + "methods": [ "UpdatePhraseSet" ] } @@ -64,23 +64,23 @@ } } }, - "Speech": { - "clients": { - "grpc": { - "libraryClient": "Client", - "rpcs": { - "LongRunningRecognize": { - "methods": [ + "Speech": { + "clients": { + "grpc": { + "libraryClient": "Client", + "rpcs": { + "LongRunningRecognize": { + "methods": [ "LongRunningRecognize" ] }, - "Recognize": { - "methods": [ + "Recognize": { + "methods": [ "Recognize" ] }, - "StreamingRecognize": { - "methods": [ + "StreamingRecognize": { + "methods": [ "StreamingRecognize" ] } diff --git a/storage/go.mod b/storage/go.mod index 9bc83147503..5651bf0eee3 100644 --- a/storage/go.mod +++ b/storage/go.mod @@ -10,6 +10,6 @@ require ( golang.org/x/oauth2 v0.0.0-20210628180205-a41e5a781914 golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 google.golang.org/api v0.50.0 - google.golang.org/genproto v0.0.0-20210630183607-d20f26d13c79 + google.golang.org/genproto v0.0.0-20210701133433-6b8dcf568a95 google.golang.org/grpc v1.38.0 ) diff --git a/storage/go.sum b/storage/go.sum index 936f162bac7..0d994fb54e3 100644 --- a/storage/go.sum +++ b/storage/go.sum @@ -453,8 +453,8 @@ google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxH google.golang.org/genproto v0.0.0-20210604141403-392c879c8b08/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= google.golang.org/genproto v0.0.0-20210608205507-b6d2f5bf0d7d/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= google.golang.org/genproto v0.0.0-20210624195500-8bfb893ecb84/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24= -google.golang.org/genproto v0.0.0-20210630183607-d20f26d13c79 h1:s1jFTXJryg4a1mew7xv03VZD8N9XjxFhk1o4Js4WvPQ= -google.golang.org/genproto v0.0.0-20210630183607-d20f26d13c79/go.mod h1:yiaVoXHpRzHGyxV3o4DktVWY4mSUErTKaeEOq6C3t3U= +google.golang.org/genproto v0.0.0-20210701133433-6b8dcf568a95 h1:xyRjacsGcaSoZ2fTcaLCSzh2JEceLLOT4X8k32Q0xAQ= +google.golang.org/genproto v0.0.0-20210701133433-6b8dcf568a95/go.mod h1:yiaVoXHpRzHGyxV3o4DktVWY4mSUErTKaeEOq6C3t3U= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= diff --git a/storage/internal/apiv1/doc.go b/storage/internal/apiv1/doc.go index 3a6b9595fde..f99c1727c55 100644 --- a/storage/internal/apiv1/doc.go +++ b/storage/internal/apiv1/doc.go @@ -50,7 +50,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210630" +const versionClient = "20210701" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/storage/internal/apiv1/gapic_metadata.json b/storage/internal/apiv1/gapic_metadata.json index b3a8f901993..d7b93b754de 100644 --- a/storage/internal/apiv1/gapic_metadata.json +++ b/storage/internal/apiv1/gapic_metadata.json @@ -1,292 +1,292 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.storage.v1", - "libraryPackage": "cloud.google.com/go/storage/internal/apiv1", - "services": { - "Storage": { - "clients": { - "grpc": { - "libraryClient": "Client", - "rpcs": { - "ComposeObject": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.storage.v1", + "libraryPackage": "cloud.google.com/go/storage/internal/apiv1", + "services": { + "Storage": { + "clients": { + "grpc": { + "libraryClient": "Client", + "rpcs": { + "ComposeObject": { + "methods": [ "ComposeObject" ] }, - "CopyObject": { - "methods": [ + "CopyObject": { + "methods": [ "CopyObject" ] }, - "CreateHmacKey": { - "methods": [ + "CreateHmacKey": { + "methods": [ "CreateHmacKey" ] }, - "DeleteBucket": { - "methods": [ + "DeleteBucket": { + "methods": [ "DeleteBucket" ] }, - "DeleteBucketAccessControl": { - "methods": [ + "DeleteBucketAccessControl": { + "methods": [ "DeleteBucketAccessControl" ] }, - "DeleteDefaultObjectAccessControl": { - "methods": [ + "DeleteDefaultObjectAccessControl": { + "methods": [ "DeleteDefaultObjectAccessControl" ] }, - "DeleteHmacKey": { - "methods": [ + "DeleteHmacKey": { + "methods": [ "DeleteHmacKey" ] }, - "DeleteNotification": { - "methods": [ + "DeleteNotification": { + "methods": [ "DeleteNotification" ] }, - "DeleteObject": { - "methods": [ + "DeleteObject": { + "methods": [ "DeleteObject" ] }, - "DeleteObjectAccessControl": { - "methods": [ + "DeleteObjectAccessControl": { + "methods": [ "DeleteObjectAccessControl" ] }, - "GetBucket": { - "methods": [ + "GetBucket": { + "methods": [ "GetBucket" ] }, - "GetBucketAccessControl": { - "methods": [ + "GetBucketAccessControl": { + "methods": [ "GetBucketAccessControl" ] }, - "GetBucketIamPolicy": { - "methods": [ + "GetBucketIamPolicy": { + "methods": [ "GetBucketIamPolicy" ] }, - "GetDefaultObjectAccessControl": { - "methods": [ + "GetDefaultObjectAccessControl": { + "methods": [ "GetDefaultObjectAccessControl" ] }, - "GetHmacKey": { - "methods": [ + "GetHmacKey": { + "methods": [ "GetHmacKey" ] }, - "GetNotification": { - "methods": [ + "GetNotification": { + "methods": [ "GetNotification" ] }, - "GetObject": { - "methods": [ + "GetObject": { + "methods": [ "GetObject" ] }, - "GetObjectAccessControl": { - "methods": [ + "GetObjectAccessControl": { + "methods": [ "GetObjectAccessControl" ] }, - "GetObjectIamPolicy": { - "methods": [ + "GetObjectIamPolicy": { + "methods": [ "GetObjectIamPolicy" ] }, - "GetObjectMedia": { - "methods": [ + "GetObjectMedia": { + "methods": [ "GetObjectMedia" ] }, - "GetServiceAccount": { - "methods": [ + "GetServiceAccount": { + "methods": [ "GetServiceAccount" ] }, - "InsertBucket": { - "methods": [ + "InsertBucket": { + "methods": [ "InsertBucket" ] }, - "InsertBucketAccessControl": { - "methods": [ + "InsertBucketAccessControl": { + "methods": [ "InsertBucketAccessControl" ] }, - "InsertDefaultObjectAccessControl": { - "methods": [ + "InsertDefaultObjectAccessControl": { + "methods": [ "InsertDefaultObjectAccessControl" ] }, - "InsertNotification": { - "methods": [ + "InsertNotification": { + "methods": [ "InsertNotification" ] }, - "InsertObject": { - "methods": [ + "InsertObject": { + "methods": [ "InsertObject" ] }, - "InsertObjectAccessControl": { - "methods": [ + "InsertObjectAccessControl": { + "methods": [ "InsertObjectAccessControl" ] }, - "ListBucketAccessControls": { - "methods": [ + "ListBucketAccessControls": { + "methods": [ "ListBucketAccessControls" ] }, - "ListBuckets": { - "methods": [ + "ListBuckets": { + "methods": [ "ListBuckets" ] }, - "ListChannels": { - "methods": [ + "ListChannels": { + "methods": [ "ListChannels" ] }, - "ListDefaultObjectAccessControls": { - "methods": [ + "ListDefaultObjectAccessControls": { + "methods": [ "ListDefaultObjectAccessControls" ] }, - "ListHmacKeys": { - "methods": [ + "ListHmacKeys": { + "methods": [ "ListHmacKeys" ] }, - "ListNotifications": { - "methods": [ + "ListNotifications": { + "methods": [ "ListNotifications" ] }, - "ListObjectAccessControls": { - "methods": [ + "ListObjectAccessControls": { + "methods": [ "ListObjectAccessControls" ] }, - "ListObjects": { - "methods": [ + "ListObjects": { + "methods": [ "ListObjects" ] }, - "LockBucketRetentionPolicy": { - "methods": [ + "LockBucketRetentionPolicy": { + "methods": [ "LockBucketRetentionPolicy" ] }, - "PatchBucket": { - "methods": [ + "PatchBucket": { + "methods": [ "PatchBucket" ] }, - "PatchBucketAccessControl": { - "methods": [ + "PatchBucketAccessControl": { + "methods": [ "PatchBucketAccessControl" ] }, - "PatchDefaultObjectAccessControl": { - "methods": [ + "PatchDefaultObjectAccessControl": { + "methods": [ "PatchDefaultObjectAccessControl" ] }, - "PatchObject": { - "methods": [ + "PatchObject": { + "methods": [ "PatchObject" ] }, - "PatchObjectAccessControl": { - "methods": [ + "PatchObjectAccessControl": { + "methods": [ "PatchObjectAccessControl" ] }, - "QueryWriteStatus": { - "methods": [ + "QueryWriteStatus": { + "methods": [ "QueryWriteStatus" ] }, - "RewriteObject": { - "methods": [ + "RewriteObject": { + "methods": [ "RewriteObject" ] }, - "SetBucketIamPolicy": { - "methods": [ + "SetBucketIamPolicy": { + "methods": [ "SetBucketIamPolicy" ] }, - "SetObjectIamPolicy": { - "methods": [ + "SetObjectIamPolicy": { + "methods": [ "SetObjectIamPolicy" ] }, - "StartResumableWrite": { - "methods": [ + "StartResumableWrite": { + "methods": [ "StartResumableWrite" ] }, - "StopChannel": { - "methods": [ + "StopChannel": { + "methods": [ "StopChannel" ] }, - "TestBucketIamPermissions": { - "methods": [ + "TestBucketIamPermissions": { + "methods": [ "TestBucketIamPermissions" ] }, - "TestObjectIamPermissions": { - "methods": [ + "TestObjectIamPermissions": { + "methods": [ "TestObjectIamPermissions" ] }, - "UpdateBucket": { - "methods": [ + "UpdateBucket": { + "methods": [ "UpdateBucket" ] }, - "UpdateBucketAccessControl": { - "methods": [ + "UpdateBucketAccessControl": { + "methods": [ "UpdateBucketAccessControl" ] }, - "UpdateDefaultObjectAccessControl": { - "methods": [ + "UpdateDefaultObjectAccessControl": { + "methods": [ "UpdateDefaultObjectAccessControl" ] }, - "UpdateHmacKey": { - "methods": [ + "UpdateHmacKey": { + "methods": [ "UpdateHmacKey" ] }, - "UpdateObject": { - "methods": [ + "UpdateObject": { + "methods": [ "UpdateObject" ] }, - "UpdateObjectAccessControl": { - "methods": [ + "UpdateObjectAccessControl": { + "methods": [ "UpdateObjectAccessControl" ] }, - "WatchAllObjects": { - "methods": [ + "WatchAllObjects": { + "methods": [ "WatchAllObjects" ] } diff --git a/talent/apiv4/doc.go b/talent/apiv4/doc.go index 80d229064f9..d516d2ccb0f 100644 --- a/talent/apiv4/doc.go +++ b/talent/apiv4/doc.go @@ -51,7 +51,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210630" +const versionClient = "20210701" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/talent/apiv4/gapic_metadata.json b/talent/apiv4/gapic_metadata.json index d61c4881dc0..864dcdd90bd 100644 --- a/talent/apiv4/gapic_metadata.json +++ b/talent/apiv4/gapic_metadata.json @@ -1,37 +1,37 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.talent.v4", - "libraryPackage": "cloud.google.com/go/talent/apiv4", - "services": { - "CompanyService": { - "clients": { - "grpc": { - "libraryClient": "CompanyClient", - "rpcs": { - "CreateCompany": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.talent.v4", + "libraryPackage": "cloud.google.com/go/talent/apiv4", + "services": { + "CompanyService": { + "clients": { + "grpc": { + "libraryClient": "CompanyClient", + "rpcs": { + "CreateCompany": { + "methods": [ "CreateCompany" ] }, - "DeleteCompany": { - "methods": [ + "DeleteCompany": { + "methods": [ "DeleteCompany" ] }, - "GetCompany": { - "methods": [ + "GetCompany": { + "methods": [ "GetCompany" ] }, - "ListCompanies": { - "methods": [ + "ListCompanies": { + "methods": [ "ListCompanies" ] }, - "UpdateCompany": { - "methods": [ + "UpdateCompany": { + "methods": [ "UpdateCompany" ] } @@ -39,13 +39,13 @@ } } }, - "Completion": { - "clients": { - "grpc": { - "libraryClient": "CompletionClient", - "rpcs": { - "CompleteQuery": { - "methods": [ + "Completion": { + "clients": { + "grpc": { + "libraryClient": "CompletionClient", + "rpcs": { + "CompleteQuery": { + "methods": [ "CompleteQuery" ] } @@ -53,13 +53,13 @@ } } }, - "EventService": { - "clients": { - "grpc": { - "libraryClient": "EventClient", - "rpcs": { - "CreateClientEvent": { - "methods": [ + "EventService": { + "clients": { + "grpc": { + "libraryClient": "EventClient", + "rpcs": { + "CreateClientEvent": { + "methods": [ "CreateClientEvent" ] } @@ -67,58 +67,58 @@ } } }, - "JobService": { - "clients": { - "grpc": { - "libraryClient": "JobClient", - "rpcs": { - "BatchCreateJobs": { - "methods": [ + "JobService": { + "clients": { + "grpc": { + "libraryClient": "JobClient", + "rpcs": { + "BatchCreateJobs": { + "methods": [ "BatchCreateJobs" ] }, - "BatchDeleteJobs": { - "methods": [ + "BatchDeleteJobs": { + "methods": [ "BatchDeleteJobs" ] }, - "BatchUpdateJobs": { - "methods": [ + "BatchUpdateJobs": { + "methods": [ "BatchUpdateJobs" ] }, - "CreateJob": { - "methods": [ + "CreateJob": { + "methods": [ "CreateJob" ] }, - "DeleteJob": { - "methods": [ + "DeleteJob": { + "methods": [ "DeleteJob" ] }, - "GetJob": { - "methods": [ + "GetJob": { + "methods": [ "GetJob" ] }, - "ListJobs": { - "methods": [ + "ListJobs": { + "methods": [ "ListJobs" ] }, - "SearchJobs": { - "methods": [ + "SearchJobs": { + "methods": [ "SearchJobs" ] }, - "SearchJobsForAlert": { - "methods": [ + "SearchJobsForAlert": { + "methods": [ "SearchJobsForAlert" ] }, - "UpdateJob": { - "methods": [ + "UpdateJob": { + "methods": [ "UpdateJob" ] } @@ -126,33 +126,33 @@ } } }, - "TenantService": { - "clients": { - "grpc": { - "libraryClient": "TenantClient", - "rpcs": { - "CreateTenant": { - "methods": [ + "TenantService": { + "clients": { + "grpc": { + "libraryClient": "TenantClient", + "rpcs": { + "CreateTenant": { + "methods": [ "CreateTenant" ] }, - "DeleteTenant": { - "methods": [ + "DeleteTenant": { + "methods": [ "DeleteTenant" ] }, - "GetTenant": { - "methods": [ + "GetTenant": { + "methods": [ "GetTenant" ] }, - "ListTenants": { - "methods": [ + "ListTenants": { + "methods": [ "ListTenants" ] }, - "UpdateTenant": { - "methods": [ + "UpdateTenant": { + "methods": [ "UpdateTenant" ] } diff --git a/talent/apiv4beta1/doc.go b/talent/apiv4beta1/doc.go index 1d595b4bfa4..42177b8b532 100644 --- a/talent/apiv4beta1/doc.go +++ b/talent/apiv4beta1/doc.go @@ -51,7 +51,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210630" +const versionClient = "20210701" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/talent/apiv4beta1/gapic_metadata.json b/talent/apiv4beta1/gapic_metadata.json index f51c8de5b4d..5bfc350233b 100644 --- a/talent/apiv4beta1/gapic_metadata.json +++ b/talent/apiv4beta1/gapic_metadata.json @@ -1,37 +1,37 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.talent.v4beta1", - "libraryPackage": "cloud.google.com/go/talent/apiv4beta1", - "services": { - "ApplicationService": { - "clients": { - "grpc": { - "libraryClient": "ApplicationClient", - "rpcs": { - "CreateApplication": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.talent.v4beta1", + "libraryPackage": "cloud.google.com/go/talent/apiv4beta1", + "services": { + "ApplicationService": { + "clients": { + "grpc": { + "libraryClient": "ApplicationClient", + "rpcs": { + "CreateApplication": { + "methods": [ "CreateApplication" ] }, - "DeleteApplication": { - "methods": [ + "DeleteApplication": { + "methods": [ "DeleteApplication" ] }, - "GetApplication": { - "methods": [ + "GetApplication": { + "methods": [ "GetApplication" ] }, - "ListApplications": { - "methods": [ + "ListApplications": { + "methods": [ "ListApplications" ] }, - "UpdateApplication": { - "methods": [ + "UpdateApplication": { + "methods": [ "UpdateApplication" ] } @@ -39,33 +39,33 @@ } } }, - "CompanyService": { - "clients": { - "grpc": { - "libraryClient": "CompanyClient", - "rpcs": { - "CreateCompany": { - "methods": [ + "CompanyService": { + "clients": { + "grpc": { + "libraryClient": "CompanyClient", + "rpcs": { + "CreateCompany": { + "methods": [ "CreateCompany" ] }, - "DeleteCompany": { - "methods": [ + "DeleteCompany": { + "methods": [ "DeleteCompany" ] }, - "GetCompany": { - "methods": [ + "GetCompany": { + "methods": [ "GetCompany" ] }, - "ListCompanies": { - "methods": [ + "ListCompanies": { + "methods": [ "ListCompanies" ] }, - "UpdateCompany": { - "methods": [ + "UpdateCompany": { + "methods": [ "UpdateCompany" ] } @@ -73,13 +73,13 @@ } } }, - "Completion": { - "clients": { - "grpc": { - "libraryClient": "CompletionClient", - "rpcs": { - "CompleteQuery": { - "methods": [ + "Completion": { + "clients": { + "grpc": { + "libraryClient": "CompletionClient", + "rpcs": { + "CompleteQuery": { + "methods": [ "CompleteQuery" ] } @@ -87,13 +87,13 @@ } } }, - "EventService": { - "clients": { - "grpc": { - "libraryClient": "EventClient", - "rpcs": { - "CreateClientEvent": { - "methods": [ + "EventService": { + "clients": { + "grpc": { + "libraryClient": "EventClient", + "rpcs": { + "CreateClientEvent": { + "methods": [ "CreateClientEvent" ] } @@ -101,58 +101,58 @@ } } }, - "JobService": { - "clients": { - "grpc": { - "libraryClient": "JobClient", - "rpcs": { - "BatchCreateJobs": { - "methods": [ + "JobService": { + "clients": { + "grpc": { + "libraryClient": "JobClient", + "rpcs": { + "BatchCreateJobs": { + "methods": [ "BatchCreateJobs" ] }, - "BatchDeleteJobs": { - "methods": [ + "BatchDeleteJobs": { + "methods": [ "BatchDeleteJobs" ] }, - "BatchUpdateJobs": { - "methods": [ + "BatchUpdateJobs": { + "methods": [ "BatchUpdateJobs" ] }, - "CreateJob": { - "methods": [ + "CreateJob": { + "methods": [ "CreateJob" ] }, - "DeleteJob": { - "methods": [ + "DeleteJob": { + "methods": [ "DeleteJob" ] }, - "GetJob": { - "methods": [ + "GetJob": { + "methods": [ "GetJob" ] }, - "ListJobs": { - "methods": [ + "ListJobs": { + "methods": [ "ListJobs" ] }, - "SearchJobs": { - "methods": [ + "SearchJobs": { + "methods": [ "SearchJobs" ] }, - "SearchJobsForAlert": { - "methods": [ + "SearchJobsForAlert": { + "methods": [ "SearchJobsForAlert" ] }, - "UpdateJob": { - "methods": [ + "UpdateJob": { + "methods": [ "UpdateJob" ] } @@ -160,38 +160,38 @@ } } }, - "ProfileService": { - "clients": { - "grpc": { - "libraryClient": "ProfileClient", - "rpcs": { - "CreateProfile": { - "methods": [ + "ProfileService": { + "clients": { + "grpc": { + "libraryClient": "ProfileClient", + "rpcs": { + "CreateProfile": { + "methods": [ "CreateProfile" ] }, - "DeleteProfile": { - "methods": [ + "DeleteProfile": { + "methods": [ "DeleteProfile" ] }, - "GetProfile": { - "methods": [ + "GetProfile": { + "methods": [ "GetProfile" ] }, - "ListProfiles": { - "methods": [ + "ListProfiles": { + "methods": [ "ListProfiles" ] }, - "SearchProfiles": { - "methods": [ + "SearchProfiles": { + "methods": [ "SearchProfiles" ] }, - "UpdateProfile": { - "methods": [ + "UpdateProfile": { + "methods": [ "UpdateProfile" ] } @@ -199,33 +199,33 @@ } } }, - "TenantService": { - "clients": { - "grpc": { - "libraryClient": "TenantClient", - "rpcs": { - "CreateTenant": { - "methods": [ + "TenantService": { + "clients": { + "grpc": { + "libraryClient": "TenantClient", + "rpcs": { + "CreateTenant": { + "methods": [ "CreateTenant" ] }, - "DeleteTenant": { - "methods": [ + "DeleteTenant": { + "methods": [ "DeleteTenant" ] }, - "GetTenant": { - "methods": [ + "GetTenant": { + "methods": [ "GetTenant" ] }, - "ListTenants": { - "methods": [ + "ListTenants": { + "methods": [ "ListTenants" ] }, - "UpdateTenant": { - "methods": [ + "UpdateTenant": { + "methods": [ "UpdateTenant" ] } diff --git a/texttospeech/apiv1/doc.go b/texttospeech/apiv1/doc.go index 97ce4c977a5..24ba20cf8ea 100644 --- a/texttospeech/apiv1/doc.go +++ b/texttospeech/apiv1/doc.go @@ -49,7 +49,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210630" +const versionClient = "20210701" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/texttospeech/apiv1/gapic_metadata.json b/texttospeech/apiv1/gapic_metadata.json index db921930a9e..111b0361dca 100644 --- a/texttospeech/apiv1/gapic_metadata.json +++ b/texttospeech/apiv1/gapic_metadata.json @@ -1,22 +1,22 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.texttospeech.v1", - "libraryPackage": "cloud.google.com/go/texttospeech/apiv1", - "services": { - "TextToSpeech": { - "clients": { - "grpc": { - "libraryClient": "Client", - "rpcs": { - "ListVoices": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.texttospeech.v1", + "libraryPackage": "cloud.google.com/go/texttospeech/apiv1", + "services": { + "TextToSpeech": { + "clients": { + "grpc": { + "libraryClient": "Client", + "rpcs": { + "ListVoices": { + "methods": [ "ListVoices" ] }, - "SynthesizeSpeech": { - "methods": [ + "SynthesizeSpeech": { + "methods": [ "SynthesizeSpeech" ] } diff --git a/tpu/apiv1/doc.go b/tpu/apiv1/doc.go index 5b6b6483715..dad0e41b400 100644 --- a/tpu/apiv1/doc.go +++ b/tpu/apiv1/doc.go @@ -50,7 +50,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210630" +const versionClient = "20210701" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/tpu/apiv1/gapic_metadata.json b/tpu/apiv1/gapic_metadata.json index 78db6c59e59..3144ece1f5d 100644 --- a/tpu/apiv1/gapic_metadata.json +++ b/tpu/apiv1/gapic_metadata.json @@ -1,67 +1,67 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.tpu.v1", - "libraryPackage": "cloud.google.com/go/tpu/apiv1", - "services": { - "Tpu": { - "clients": { - "grpc": { - "libraryClient": "Client", - "rpcs": { - "CreateNode": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.tpu.v1", + "libraryPackage": "cloud.google.com/go/tpu/apiv1", + "services": { + "Tpu": { + "clients": { + "grpc": { + "libraryClient": "Client", + "rpcs": { + "CreateNode": { + "methods": [ "CreateNode" ] }, - "DeleteNode": { - "methods": [ + "DeleteNode": { + "methods": [ "DeleteNode" ] }, - "GetAcceleratorType": { - "methods": [ + "GetAcceleratorType": { + "methods": [ "GetAcceleratorType" ] }, - "GetNode": { - "methods": [ + "GetNode": { + "methods": [ "GetNode" ] }, - "GetTensorFlowVersion": { - "methods": [ + "GetTensorFlowVersion": { + "methods": [ "GetTensorFlowVersion" ] }, - "ListAcceleratorTypes": { - "methods": [ + "ListAcceleratorTypes": { + "methods": [ "ListAcceleratorTypes" ] }, - "ListNodes": { - "methods": [ + "ListNodes": { + "methods": [ "ListNodes" ] }, - "ListTensorFlowVersions": { - "methods": [ + "ListTensorFlowVersions": { + "methods": [ "ListTensorFlowVersions" ] }, - "ReimageNode": { - "methods": [ + "ReimageNode": { + "methods": [ "ReimageNode" ] }, - "StartNode": { - "methods": [ + "StartNode": { + "methods": [ "StartNode" ] }, - "StopNode": { - "methods": [ + "StopNode": { + "methods": [ "StopNode" ] } diff --git a/trace/apiv1/doc.go b/trace/apiv1/doc.go index 90f7779e41d..e0a78f4aa7f 100644 --- a/trace/apiv1/doc.go +++ b/trace/apiv1/doc.go @@ -52,7 +52,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210630" +const versionClient = "20210701" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/trace/apiv1/gapic_metadata.json b/trace/apiv1/gapic_metadata.json index 8e90e970426..173594929e9 100644 --- a/trace/apiv1/gapic_metadata.json +++ b/trace/apiv1/gapic_metadata.json @@ -1,27 +1,27 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.devtools.cloudtrace.v1", - "libraryPackage": "cloud.google.com/go/trace/apiv1", - "services": { - "TraceService": { - "clients": { - "grpc": { - "libraryClient": "Client", - "rpcs": { - "GetTrace": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.devtools.cloudtrace.v1", + "libraryPackage": "cloud.google.com/go/trace/apiv1", + "services": { + "TraceService": { + "clients": { + "grpc": { + "libraryClient": "Client", + "rpcs": { + "GetTrace": { + "methods": [ "GetTrace" ] }, - "ListTraces": { - "methods": [ + "ListTraces": { + "methods": [ "ListTraces" ] }, - "PatchTraces": { - "methods": [ + "PatchTraces": { + "methods": [ "PatchTraces" ] } diff --git a/trace/apiv2/doc.go b/trace/apiv2/doc.go index c24cb4af159..d0c58d96532 100644 --- a/trace/apiv2/doc.go +++ b/trace/apiv2/doc.go @@ -52,7 +52,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210630" +const versionClient = "20210701" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/trace/apiv2/gapic_metadata.json b/trace/apiv2/gapic_metadata.json index 30874dcba3d..ef3c8d6d045 100644 --- a/trace/apiv2/gapic_metadata.json +++ b/trace/apiv2/gapic_metadata.json @@ -1,22 +1,22 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.devtools.cloudtrace.v2", - "libraryPackage": "cloud.google.com/go/trace/apiv2", - "services": { - "TraceService": { - "clients": { - "grpc": { - "libraryClient": "Client", - "rpcs": { - "BatchWriteSpans": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.devtools.cloudtrace.v2", + "libraryPackage": "cloud.google.com/go/trace/apiv2", + "services": { + "TraceService": { + "clients": { + "grpc": { + "libraryClient": "Client", + "rpcs": { + "BatchWriteSpans": { + "methods": [ "BatchWriteSpans" ] }, - "CreateSpan": { - "methods": [ + "CreateSpan": { + "methods": [ "CreateSpan" ] } diff --git a/translate/apiv3/doc.go b/translate/apiv3/doc.go index 04cb0f9e719..8fec30345a2 100644 --- a/translate/apiv3/doc.go +++ b/translate/apiv3/doc.go @@ -48,7 +48,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210630" +const versionClient = "20210701" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/translate/apiv3/gapic_metadata.json b/translate/apiv3/gapic_metadata.json index 674769576bf..cc792ac4728 100644 --- a/translate/apiv3/gapic_metadata.json +++ b/translate/apiv3/gapic_metadata.json @@ -1,52 +1,52 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.translation.v3", - "libraryPackage": "cloud.google.com/go/translate/apiv3", - "services": { - "TranslationService": { - "clients": { - "grpc": { - "libraryClient": "TranslationClient", - "rpcs": { - "BatchTranslateText": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.translation.v3", + "libraryPackage": "cloud.google.com/go/translate/apiv3", + "services": { + "TranslationService": { + "clients": { + "grpc": { + "libraryClient": "TranslationClient", + "rpcs": { + "BatchTranslateText": { + "methods": [ "BatchTranslateText" ] }, - "CreateGlossary": { - "methods": [ + "CreateGlossary": { + "methods": [ "CreateGlossary" ] }, - "DeleteGlossary": { - "methods": [ + "DeleteGlossary": { + "methods": [ "DeleteGlossary" ] }, - "DetectLanguage": { - "methods": [ + "DetectLanguage": { + "methods": [ "DetectLanguage" ] }, - "GetGlossary": { - "methods": [ + "GetGlossary": { + "methods": [ "GetGlossary" ] }, - "GetSupportedLanguages": { - "methods": [ + "GetSupportedLanguages": { + "methods": [ "GetSupportedLanguages" ] }, - "ListGlossaries": { - "methods": [ + "ListGlossaries": { + "methods": [ "ListGlossaries" ] }, - "TranslateText": { - "methods": [ + "TranslateText": { + "methods": [ "TranslateText" ] } diff --git a/video/transcoder/apiv1beta1/doc.go b/video/transcoder/apiv1beta1/doc.go index 0bd836c8609..f6b78a3a542 100644 --- a/video/transcoder/apiv1beta1/doc.go +++ b/video/transcoder/apiv1beta1/doc.go @@ -51,7 +51,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210630" +const versionClient = "20210701" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/video/transcoder/apiv1beta1/gapic_metadata.json b/video/transcoder/apiv1beta1/gapic_metadata.json index 84e3d7d1ab5..4a92159ad67 100644 --- a/video/transcoder/apiv1beta1/gapic_metadata.json +++ b/video/transcoder/apiv1beta1/gapic_metadata.json @@ -1,52 +1,52 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.video.transcoder.v1beta1", - "libraryPackage": "cloud.google.com/go/video/transcoder/apiv1beta1", - "services": { - "TranscoderService": { - "clients": { - "grpc": { - "libraryClient": "Client", - "rpcs": { - "CreateJob": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.video.transcoder.v1beta1", + "libraryPackage": "cloud.google.com/go/video/transcoder/apiv1beta1", + "services": { + "TranscoderService": { + "clients": { + "grpc": { + "libraryClient": "Client", + "rpcs": { + "CreateJob": { + "methods": [ "CreateJob" ] }, - "CreateJobTemplate": { - "methods": [ + "CreateJobTemplate": { + "methods": [ "CreateJobTemplate" ] }, - "DeleteJob": { - "methods": [ + "DeleteJob": { + "methods": [ "DeleteJob" ] }, - "DeleteJobTemplate": { - "methods": [ + "DeleteJobTemplate": { + "methods": [ "DeleteJobTemplate" ] }, - "GetJob": { - "methods": [ + "GetJob": { + "methods": [ "GetJob" ] }, - "GetJobTemplate": { - "methods": [ + "GetJobTemplate": { + "methods": [ "GetJobTemplate" ] }, - "ListJobTemplates": { - "methods": [ + "ListJobTemplates": { + "methods": [ "ListJobTemplates" ] }, - "ListJobs": { - "methods": [ + "ListJobs": { + "methods": [ "ListJobs" ] } diff --git a/videointelligence/apiv1/doc.go b/videointelligence/apiv1/doc.go index 830d968e4a2..54494b31bf2 100644 --- a/videointelligence/apiv1/doc.go +++ b/videointelligence/apiv1/doc.go @@ -50,7 +50,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210630" +const versionClient = "20210701" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/videointelligence/apiv1/gapic_metadata.json b/videointelligence/apiv1/gapic_metadata.json index a2525d44302..ff747ce5951 100644 --- a/videointelligence/apiv1/gapic_metadata.json +++ b/videointelligence/apiv1/gapic_metadata.json @@ -1,17 +1,17 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.videointelligence.v1", - "libraryPackage": "cloud.google.com/go/videointelligence/apiv1", - "services": { - "VideoIntelligenceService": { - "clients": { - "grpc": { - "libraryClient": "Client", - "rpcs": { - "AnnotateVideo": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.videointelligence.v1", + "libraryPackage": "cloud.google.com/go/videointelligence/apiv1", + "services": { + "VideoIntelligenceService": { + "clients": { + "grpc": { + "libraryClient": "Client", + "rpcs": { + "AnnotateVideo": { + "methods": [ "AnnotateVideo" ] } diff --git a/videointelligence/apiv1beta2/doc.go b/videointelligence/apiv1beta2/doc.go index 65d81c70734..3ca9b3f113b 100644 --- a/videointelligence/apiv1beta2/doc.go +++ b/videointelligence/apiv1beta2/doc.go @@ -52,7 +52,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210630" +const versionClient = "20210701" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/videointelligence/apiv1beta2/gapic_metadata.json b/videointelligence/apiv1beta2/gapic_metadata.json index 922cd9bc58d..48b64ef04a3 100644 --- a/videointelligence/apiv1beta2/gapic_metadata.json +++ b/videointelligence/apiv1beta2/gapic_metadata.json @@ -1,17 +1,17 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.videointelligence.v1beta2", - "libraryPackage": "cloud.google.com/go/videointelligence/apiv1beta2", - "services": { - "VideoIntelligenceService": { - "clients": { - "grpc": { - "libraryClient": "Client", - "rpcs": { - "AnnotateVideo": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.videointelligence.v1beta2", + "libraryPackage": "cloud.google.com/go/videointelligence/apiv1beta2", + "services": { + "VideoIntelligenceService": { + "clients": { + "grpc": { + "libraryClient": "Client", + "rpcs": { + "AnnotateVideo": { + "methods": [ "AnnotateVideo" ] } diff --git a/vision/apiv1/doc.go b/vision/apiv1/doc.go index 74aa0a134b6..d8eb6e74870 100644 --- a/vision/apiv1/doc.go +++ b/vision/apiv1/doc.go @@ -50,7 +50,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210630" +const versionClient = "20210701" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/vision/apiv1/gapic_metadata.json b/vision/apiv1/gapic_metadata.json index 52725dbf9d2..98867fffb09 100644 --- a/vision/apiv1/gapic_metadata.json +++ b/vision/apiv1/gapic_metadata.json @@ -1,32 +1,32 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.vision.v1", - "libraryPackage": "cloud.google.com/go/vision/apiv1", - "services": { - "ImageAnnotator": { - "clients": { - "grpc": { - "libraryClient": "ImageAnnotatorClient", - "rpcs": { - "AsyncBatchAnnotateFiles": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.vision.v1", + "libraryPackage": "cloud.google.com/go/vision/apiv1", + "services": { + "ImageAnnotator": { + "clients": { + "grpc": { + "libraryClient": "ImageAnnotatorClient", + "rpcs": { + "AsyncBatchAnnotateFiles": { + "methods": [ "AsyncBatchAnnotateFiles" ] }, - "AsyncBatchAnnotateImages": { - "methods": [ + "AsyncBatchAnnotateImages": { + "methods": [ "AsyncBatchAnnotateImages" ] }, - "BatchAnnotateFiles": { - "methods": [ + "BatchAnnotateFiles": { + "methods": [ "BatchAnnotateFiles" ] }, - "BatchAnnotateImages": { - "methods": [ + "BatchAnnotateImages": { + "methods": [ "BatchAnnotateImages" ] } @@ -34,103 +34,103 @@ } } }, - "ProductSearch": { - "clients": { - "grpc": { - "libraryClient": "ProductSearchClient", - "rpcs": { - "AddProductToProductSet": { - "methods": [ + "ProductSearch": { + "clients": { + "grpc": { + "libraryClient": "ProductSearchClient", + "rpcs": { + "AddProductToProductSet": { + "methods": [ "AddProductToProductSet" ] }, - "CreateProduct": { - "methods": [ + "CreateProduct": { + "methods": [ "CreateProduct" ] }, - "CreateProductSet": { - "methods": [ + "CreateProductSet": { + "methods": [ "CreateProductSet" ] }, - "CreateReferenceImage": { - "methods": [ + "CreateReferenceImage": { + "methods": [ "CreateReferenceImage" ] }, - "DeleteProduct": { - "methods": [ + "DeleteProduct": { + "methods": [ "DeleteProduct" ] }, - "DeleteProductSet": { - "methods": [ + "DeleteProductSet": { + "methods": [ "DeleteProductSet" ] }, - "DeleteReferenceImage": { - "methods": [ + "DeleteReferenceImage": { + "methods": [ "DeleteReferenceImage" ] }, - "GetProduct": { - "methods": [ + "GetProduct": { + "methods": [ "GetProduct" ] }, - "GetProductSet": { - "methods": [ + "GetProductSet": { + "methods": [ "GetProductSet" ] }, - "GetReferenceImage": { - "methods": [ + "GetReferenceImage": { + "methods": [ "GetReferenceImage" ] }, - "ImportProductSets": { - "methods": [ + "ImportProductSets": { + "methods": [ "ImportProductSets" ] }, - "ListProductSets": { - "methods": [ + "ListProductSets": { + "methods": [ "ListProductSets" ] }, - "ListProducts": { - "methods": [ + "ListProducts": { + "methods": [ "ListProducts" ] }, - "ListProductsInProductSet": { - "methods": [ + "ListProductsInProductSet": { + "methods": [ "ListProductsInProductSet" ] }, - "ListReferenceImages": { - "methods": [ + "ListReferenceImages": { + "methods": [ "ListReferenceImages" ] }, - "PurgeProducts": { - "methods": [ + "PurgeProducts": { + "methods": [ "PurgeProducts" ] }, - "RemoveProductFromProductSet": { - "methods": [ + "RemoveProductFromProductSet": { + "methods": [ "RemoveProductFromProductSet" ] }, - "UpdateProduct": { - "methods": [ + "UpdateProduct": { + "methods": [ "UpdateProduct" ] }, - "UpdateProductSet": { - "methods": [ + "UpdateProductSet": { + "methods": [ "UpdateProductSet" ] } diff --git a/vision/apiv1p1beta1/doc.go b/vision/apiv1p1beta1/doc.go index 806c795fda5..780ad088ca6 100644 --- a/vision/apiv1p1beta1/doc.go +++ b/vision/apiv1p1beta1/doc.go @@ -52,7 +52,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210630" +const versionClient = "20210701" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/vision/apiv1p1beta1/gapic_metadata.json b/vision/apiv1p1beta1/gapic_metadata.json index 1d1f4da4420..04778b0b3e3 100644 --- a/vision/apiv1p1beta1/gapic_metadata.json +++ b/vision/apiv1p1beta1/gapic_metadata.json @@ -1,17 +1,17 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.vision.v1p1beta1", - "libraryPackage": "cloud.google.com/go/vision/apiv1p1beta1", - "services": { - "ImageAnnotator": { - "clients": { - "grpc": { - "libraryClient": "ImageAnnotatorClient", - "rpcs": { - "BatchAnnotateImages": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.vision.v1p1beta1", + "libraryPackage": "cloud.google.com/go/vision/apiv1p1beta1", + "services": { + "ImageAnnotator": { + "clients": { + "grpc": { + "libraryClient": "ImageAnnotatorClient", + "rpcs": { + "BatchAnnotateImages": { + "methods": [ "BatchAnnotateImages" ] } diff --git a/vpcaccess/apiv1/doc.go b/vpcaccess/apiv1/doc.go index 3cc5efa3233..cc9820231b8 100644 --- a/vpcaccess/apiv1/doc.go +++ b/vpcaccess/apiv1/doc.go @@ -50,7 +50,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210630" +const versionClient = "20210701" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/vpcaccess/apiv1/gapic_metadata.json b/vpcaccess/apiv1/gapic_metadata.json index 619b6dce04d..bc096e30bbd 100644 --- a/vpcaccess/apiv1/gapic_metadata.json +++ b/vpcaccess/apiv1/gapic_metadata.json @@ -1,32 +1,32 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.vpcaccess.v1", - "libraryPackage": "cloud.google.com/go/vpcaccess/apiv1", - "services": { - "VpcAccessService": { - "clients": { - "grpc": { - "libraryClient": "Client", - "rpcs": { - "CreateConnector": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.vpcaccess.v1", + "libraryPackage": "cloud.google.com/go/vpcaccess/apiv1", + "services": { + "VpcAccessService": { + "clients": { + "grpc": { + "libraryClient": "Client", + "rpcs": { + "CreateConnector": { + "methods": [ "CreateConnector" ] }, - "DeleteConnector": { - "methods": [ + "DeleteConnector": { + "methods": [ "DeleteConnector" ] }, - "GetConnector": { - "methods": [ + "GetConnector": { + "methods": [ "GetConnector" ] }, - "ListConnectors": { - "methods": [ + "ListConnectors": { + "methods": [ "ListConnectors" ] } diff --git a/webrisk/apiv1/doc.go b/webrisk/apiv1/doc.go index 05153fe9590..cf39af86ed7 100644 --- a/webrisk/apiv1/doc.go +++ b/webrisk/apiv1/doc.go @@ -46,7 +46,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210630" +const versionClient = "20210701" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/webrisk/apiv1/gapic_metadata.json b/webrisk/apiv1/gapic_metadata.json index fed41bc485d..f8d27fd7028 100644 --- a/webrisk/apiv1/gapic_metadata.json +++ b/webrisk/apiv1/gapic_metadata.json @@ -1,32 +1,32 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.webrisk.v1", - "libraryPackage": "cloud.google.com/go/webrisk/apiv1", - "services": { - "WebRiskService": { - "clients": { - "grpc": { - "libraryClient": "Client", - "rpcs": { - "ComputeThreatListDiff": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.webrisk.v1", + "libraryPackage": "cloud.google.com/go/webrisk/apiv1", + "services": { + "WebRiskService": { + "clients": { + "grpc": { + "libraryClient": "Client", + "rpcs": { + "ComputeThreatListDiff": { + "methods": [ "ComputeThreatListDiff" ] }, - "CreateSubmission": { - "methods": [ + "CreateSubmission": { + "methods": [ "CreateSubmission" ] }, - "SearchHashes": { - "methods": [ + "SearchHashes": { + "methods": [ "SearchHashes" ] }, - "SearchUris": { - "methods": [ + "SearchUris": { + "methods": [ "SearchUris" ] } diff --git a/webrisk/apiv1beta1/doc.go b/webrisk/apiv1beta1/doc.go index 9eead0d77c4..d6278cbfffe 100644 --- a/webrisk/apiv1beta1/doc.go +++ b/webrisk/apiv1beta1/doc.go @@ -48,7 +48,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210630" +const versionClient = "20210701" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/webrisk/apiv1beta1/gapic_metadata.json b/webrisk/apiv1beta1/gapic_metadata.json index 7da7ea74a1c..75941f478c8 100644 --- a/webrisk/apiv1beta1/gapic_metadata.json +++ b/webrisk/apiv1beta1/gapic_metadata.json @@ -1,27 +1,27 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.webrisk.v1beta1", - "libraryPackage": "cloud.google.com/go/webrisk/apiv1beta1", - "services": { - "WebRiskServiceV1Beta1": { - "clients": { - "grpc": { - "libraryClient": "WebRiskServiceV1Beta1Client", - "rpcs": { - "ComputeThreatListDiff": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.webrisk.v1beta1", + "libraryPackage": "cloud.google.com/go/webrisk/apiv1beta1", + "services": { + "WebRiskServiceV1Beta1": { + "clients": { + "grpc": { + "libraryClient": "WebRiskServiceV1Beta1Client", + "rpcs": { + "ComputeThreatListDiff": { + "methods": [ "ComputeThreatListDiff" ] }, - "SearchHashes": { - "methods": [ + "SearchHashes": { + "methods": [ "SearchHashes" ] }, - "SearchUris": { - "methods": [ + "SearchUris": { + "methods": [ "SearchUris" ] } diff --git a/websecurityscanner/apiv1/doc.go b/websecurityscanner/apiv1/doc.go index ce6539a3d19..7065fdfd358 100644 --- a/websecurityscanner/apiv1/doc.go +++ b/websecurityscanner/apiv1/doc.go @@ -48,7 +48,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210630" +const versionClient = "20210701" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/websecurityscanner/apiv1/gapic_metadata.json b/websecurityscanner/apiv1/gapic_metadata.json index 26bb0feab78..9fc5f875602 100644 --- a/websecurityscanner/apiv1/gapic_metadata.json +++ b/websecurityscanner/apiv1/gapic_metadata.json @@ -1,77 +1,77 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.websecurityscanner.v1", - "libraryPackage": "cloud.google.com/go/websecurityscanner/apiv1", - "services": { - "WebSecurityScanner": { - "clients": { - "grpc": { - "libraryClient": "Client", - "rpcs": { - "CreateScanConfig": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.websecurityscanner.v1", + "libraryPackage": "cloud.google.com/go/websecurityscanner/apiv1", + "services": { + "WebSecurityScanner": { + "clients": { + "grpc": { + "libraryClient": "Client", + "rpcs": { + "CreateScanConfig": { + "methods": [ "CreateScanConfig" ] }, - "DeleteScanConfig": { - "methods": [ + "DeleteScanConfig": { + "methods": [ "DeleteScanConfig" ] }, - "GetFinding": { - "methods": [ + "GetFinding": { + "methods": [ "GetFinding" ] }, - "GetScanConfig": { - "methods": [ + "GetScanConfig": { + "methods": [ "GetScanConfig" ] }, - "GetScanRun": { - "methods": [ + "GetScanRun": { + "methods": [ "GetScanRun" ] }, - "ListCrawledUrls": { - "methods": [ + "ListCrawledUrls": { + "methods": [ "ListCrawledUrls" ] }, - "ListFindingTypeStats": { - "methods": [ + "ListFindingTypeStats": { + "methods": [ "ListFindingTypeStats" ] }, - "ListFindings": { - "methods": [ + "ListFindings": { + "methods": [ "ListFindings" ] }, - "ListScanConfigs": { - "methods": [ + "ListScanConfigs": { + "methods": [ "ListScanConfigs" ] }, - "ListScanRuns": { - "methods": [ + "ListScanRuns": { + "methods": [ "ListScanRuns" ] }, - "StartScanRun": { - "methods": [ + "StartScanRun": { + "methods": [ "StartScanRun" ] }, - "StopScanRun": { - "methods": [ + "StopScanRun": { + "methods": [ "StopScanRun" ] }, - "UpdateScanConfig": { - "methods": [ + "UpdateScanConfig": { + "methods": [ "UpdateScanConfig" ] } diff --git a/workflows/apiv1beta/doc.go b/workflows/apiv1beta/doc.go index 54b8d332017..d2eaf175289 100644 --- a/workflows/apiv1beta/doc.go +++ b/workflows/apiv1beta/doc.go @@ -48,7 +48,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210630" +const versionClient = "20210701" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/workflows/apiv1beta/gapic_metadata.json b/workflows/apiv1beta/gapic_metadata.json index 4b57d1c9199..78b97d5169f 100644 --- a/workflows/apiv1beta/gapic_metadata.json +++ b/workflows/apiv1beta/gapic_metadata.json @@ -1,37 +1,37 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.workflows.v1beta", - "libraryPackage": "cloud.google.com/go/workflows/apiv1beta", - "services": { - "Workflows": { - "clients": { - "grpc": { - "libraryClient": "Client", - "rpcs": { - "CreateWorkflow": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.workflows.v1beta", + "libraryPackage": "cloud.google.com/go/workflows/apiv1beta", + "services": { + "Workflows": { + "clients": { + "grpc": { + "libraryClient": "Client", + "rpcs": { + "CreateWorkflow": { + "methods": [ "CreateWorkflow" ] }, - "DeleteWorkflow": { - "methods": [ + "DeleteWorkflow": { + "methods": [ "DeleteWorkflow" ] }, - "GetWorkflow": { - "methods": [ + "GetWorkflow": { + "methods": [ "GetWorkflow" ] }, - "ListWorkflows": { - "methods": [ + "ListWorkflows": { + "methods": [ "ListWorkflows" ] }, - "UpdateWorkflow": { - "methods": [ + "UpdateWorkflow": { + "methods": [ "UpdateWorkflow" ] } diff --git a/workflows/executions/apiv1/doc.go b/workflows/executions/apiv1/doc.go index ace2c66faf2..302fe9c08fc 100644 --- a/workflows/executions/apiv1/doc.go +++ b/workflows/executions/apiv1/doc.go @@ -50,7 +50,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "UNKNOWN" +const versionClient = "20210701" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/workflows/executions/apiv1/gapic_metadata.json b/workflows/executions/apiv1/gapic_metadata.json index bd49590ca4b..cade633f7da 100644 --- a/workflows/executions/apiv1/gapic_metadata.json +++ b/workflows/executions/apiv1/gapic_metadata.json @@ -1,32 +1,32 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.workflows.executions.v1", - "libraryPackage": "cloud.google.com/go/workflows/executions/apiv1", - "services": { - "Executions": { - "clients": { - "grpc": { - "libraryClient": "Client", - "rpcs": { - "CancelExecution": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.workflows.executions.v1", + "libraryPackage": "cloud.google.com/go/workflows/executions/apiv1", + "services": { + "Executions": { + "clients": { + "grpc": { + "libraryClient": "Client", + "rpcs": { + "CancelExecution": { + "methods": [ "CancelExecution" ] }, - "CreateExecution": { - "methods": [ + "CreateExecution": { + "methods": [ "CreateExecution" ] }, - "GetExecution": { - "methods": [ + "GetExecution": { + "methods": [ "GetExecution" ] }, - "ListExecutions": { - "methods": [ + "ListExecutions": { + "methods": [ "ListExecutions" ] } diff --git a/workflows/executions/apiv1beta/doc.go b/workflows/executions/apiv1beta/doc.go index c358413800a..25969c4bed2 100644 --- a/workflows/executions/apiv1beta/doc.go +++ b/workflows/executions/apiv1beta/doc.go @@ -50,7 +50,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210630" +const versionClient = "20210701" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/workflows/executions/apiv1beta/gapic_metadata.json b/workflows/executions/apiv1beta/gapic_metadata.json index f9d5dca3cbf..df3144a708a 100644 --- a/workflows/executions/apiv1beta/gapic_metadata.json +++ b/workflows/executions/apiv1beta/gapic_metadata.json @@ -1,32 +1,32 @@ { - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.workflows.executions.v1beta", - "libraryPackage": "cloud.google.com/go/workflows/executions/apiv1beta", - "services": { - "Executions": { - "clients": { - "grpc": { - "libraryClient": "Client", - "rpcs": { - "CancelExecution": { - "methods": [ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.workflows.executions.v1beta", + "libraryPackage": "cloud.google.com/go/workflows/executions/apiv1beta", + "services": { + "Executions": { + "clients": { + "grpc": { + "libraryClient": "Client", + "rpcs": { + "CancelExecution": { + "methods": [ "CancelExecution" ] }, - "CreateExecution": { - "methods": [ + "CreateExecution": { + "methods": [ "CreateExecution" ] }, - "GetExecution": { - "methods": [ + "GetExecution": { + "methods": [ "GetExecution" ] }, - "ListExecutions": { - "methods": [ + "ListExecutions": { + "methods": [ "ListExecutions" ] } From 58d4055eae44ced04177be6b78eb74b13353a16e Mon Sep 17 00:00:00 2001 From: Chris Cotter Date: Thu, 1 Jul 2021 12:42:23 -0400 Subject: [PATCH 41/50] test(storage): unflake PublicAccessPrevention test (#4352) This needs a retry to account for propagation time for bucket ACLs. Fixes #4351 --- storage/integration_test.go | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/storage/integration_test.go b/storage/integration_test.go index 043cc5a8bd5..7ea61e3c47e 100644 --- a/storage/integration_test.go +++ b/storage/integration_test.go @@ -627,9 +627,14 @@ func TestIntegration_PublicAccessPrevention(t *testing.T) { t.Error("updating PublicAccessPrevention changed UBLA setting") } - // Now, making object public or making bucket public should succeed. - a = o.ACL() - if err := a.Set(ctx, AllUsers, RoleReader); err != nil { + // Now, making object public or making bucket public should succeed. Run with + // retry because ACL settings may take time to propagate. + if err := retry(ctx, + func() error { + a = o.ACL() + return a.Set(ctx, AllUsers, RoleReader) + }, + nil); err != nil { t.Errorf("ACL.Set: making object public failed: %v", err) } policy, err = bkt.IAM().V3().Policy(ctx) From f2b20f493e2ed5a883ce42fa65695c03c574feb5 Mon Sep 17 00:00:00 2001 From: shollyman Date: Thu, 1 Jul 2021 10:14:23 -0700 Subject: [PATCH 42/50] feat(bigquery managedwriter): schema conversion support (#4357) This is the first of multiple PRs to build up the functionality of a new thick client over the new BigQuery Storage API's write mechanism. This PR exposes schema conversion between the main bigquery package and the bigquery storage API. Towards: https://github.com/googleapis/google-cloud-go/issues/4366 --- bigquery/storage/managedwriter/adapt/doc.go | 19 ++ .../managedwriter/adapt/schemaconversion.go | 140 ++++++++++++ .../adapt/schemaconversion_test.go | 203 ++++++++++++++++++ bigquery/storage/managedwriter/doc.go | 22 ++ 4 files changed, 384 insertions(+) create mode 100644 bigquery/storage/managedwriter/adapt/doc.go create mode 100644 bigquery/storage/managedwriter/adapt/schemaconversion.go create mode 100644 bigquery/storage/managedwriter/adapt/schemaconversion_test.go create mode 100644 bigquery/storage/managedwriter/doc.go diff --git a/bigquery/storage/managedwriter/adapt/doc.go b/bigquery/storage/managedwriter/adapt/doc.go new file mode 100644 index 00000000000..c06d3039200 --- /dev/null +++ b/bigquery/storage/managedwriter/adapt/doc.go @@ -0,0 +1,19 @@ +// Copyright 2021 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. + +// Package adapt adds functionality related to converting bigquery representations +// like schema and data type representations. +// +// It is EXPERIMENTAL and subject to change or removal without notice. +package adapt diff --git a/bigquery/storage/managedwriter/adapt/schemaconversion.go b/bigquery/storage/managedwriter/adapt/schemaconversion.go new file mode 100644 index 00000000000..8de22575db6 --- /dev/null +++ b/bigquery/storage/managedwriter/adapt/schemaconversion.go @@ -0,0 +1,140 @@ +// Copyright 2021 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. + +package adapt + +import ( + "fmt" + + "cloud.google.com/go/bigquery" + storagepb "google.golang.org/genproto/googleapis/cloud/bigquery/storage/v1beta2" +) + +var fieldTypeMap = map[bigquery.FieldType]storagepb.TableFieldSchema_Type{ + bigquery.StringFieldType: storagepb.TableFieldSchema_STRING, + bigquery.BytesFieldType: storagepb.TableFieldSchema_BYTES, + bigquery.IntegerFieldType: storagepb.TableFieldSchema_INT64, + bigquery.FloatFieldType: storagepb.TableFieldSchema_DOUBLE, + bigquery.BooleanFieldType: storagepb.TableFieldSchema_BOOL, + bigquery.TimestampFieldType: storagepb.TableFieldSchema_TIMESTAMP, + bigquery.RecordFieldType: storagepb.TableFieldSchema_STRUCT, + bigquery.DateFieldType: storagepb.TableFieldSchema_DATE, + bigquery.TimeFieldType: storagepb.TableFieldSchema_TIME, + bigquery.DateTimeFieldType: storagepb.TableFieldSchema_DATETIME, + bigquery.NumericFieldType: storagepb.TableFieldSchema_NUMERIC, + bigquery.BigNumericFieldType: storagepb.TableFieldSchema_BIGNUMERIC, + bigquery.GeographyFieldType: storagepb.TableFieldSchema_GEOGRAPHY, +} + +func bqFieldToProto(in *bigquery.FieldSchema) (*storagepb.TableFieldSchema, error) { + if in == nil { + return nil, nil + } + out := &storagepb.TableFieldSchema{ + Name: in.Name, + Description: in.Description, + } + + // Type conversion. + typ, ok := fieldTypeMap[in.Type] + if !ok { + return nil, fmt.Errorf("could not convert field (%s) due to unknown type value: %s", in.Name, in.Type) + } + out.Type = typ + + // Mode conversion. Repeated trumps required. + out.Mode = storagepb.TableFieldSchema_NULLABLE + if in.Repeated { + out.Mode = storagepb.TableFieldSchema_REPEATED + } + if !in.Repeated && in.Required { + out.Mode = storagepb.TableFieldSchema_REQUIRED + } + + for _, s := range in.Schema { + subField, err := bqFieldToProto(s) + if err != nil { + return nil, err + } + out.Fields = append(out.Fields, subField) + } + return out, nil +} + +func protoToBQField(in *storagepb.TableFieldSchema) (*bigquery.FieldSchema, error) { + if in == nil { + return nil, nil + } + out := &bigquery.FieldSchema{ + Name: in.GetName(), + Description: in.GetDescription(), + Repeated: in.GetMode() == storagepb.TableFieldSchema_REPEATED, + Required: in.GetMode() == storagepb.TableFieldSchema_REQUIRED, + } + + typeResolved := false + for k, v := range fieldTypeMap { + if v == in.GetType() { + out.Type = k + typeResolved = true + break + } + } + if !typeResolved { + return nil, fmt.Errorf("could not convert proto type to bigquery type: %v", in.GetType().String()) + } + + for _, s := range in.Fields { + subField, err := protoToBQField(s) + if err != nil { + return nil, err + } + out.Schema = append(out.Schema, subField) + } + return out, nil +} + +// BQSchemaToStorageTableSchema converts a bigquery Schema into the protobuf-based TableSchema used +// by the BigQuery Storage WriteClient. +func BQSchemaToStorageTableSchema(in bigquery.Schema) (*storagepb.TableSchema, error) { + if in == nil { + return nil, nil + } + out := &storagepb.TableSchema{} + for _, s := range in { + converted, err := bqFieldToProto(s) + if err != nil { + return nil, err + } + out.Fields = append(out.Fields, converted) + } + return out, nil +} + +// StorageTableSchemaToBQSchema converts a TableSchema from the BigQuery Storage WriteClient +// into the equivalent BigQuery Schema. +func StorageTableSchemaToBQSchema(in *storagepb.TableSchema) (bigquery.Schema, error) { + if in == nil { + return nil, nil + } + var out bigquery.Schema + for _, s := range in.Fields { + converted, err := protoToBQField(s) + if err != nil { + return nil, err + } + out = append(out, converted) + } + return out, nil +} diff --git a/bigquery/storage/managedwriter/adapt/schemaconversion_test.go b/bigquery/storage/managedwriter/adapt/schemaconversion_test.go new file mode 100644 index 00000000000..aab85fa9072 --- /dev/null +++ b/bigquery/storage/managedwriter/adapt/schemaconversion_test.go @@ -0,0 +1,203 @@ +// Copyright 2021 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. + +package adapt + +import ( + "testing" + + "cloud.google.com/go/bigquery" + "cloud.google.com/go/internal/testutil" + "github.com/google/go-cmp/cmp" + storagepb "google.golang.org/genproto/googleapis/cloud/bigquery/storage/v1beta2" + "google.golang.org/protobuf/testing/protocmp" +) + +func TestFieldConversions(t *testing.T) { + testCases := []struct { + desc string + bq *bigquery.FieldSchema + proto *storagepb.TableFieldSchema + }{ + { + desc: "nil", + bq: nil, + proto: nil, + }, + { + desc: "string field", + bq: &bigquery.FieldSchema{ + Name: "name", + Type: bigquery.StringFieldType, + Description: "description", + }, + proto: &storagepb.TableFieldSchema{ + Name: "name", + Type: storagepb.TableFieldSchema_STRING, + Description: "description", + Mode: storagepb.TableFieldSchema_NULLABLE, + }, + }, + { + desc: "required integer field", + bq: &bigquery.FieldSchema{ + Name: "name", + Type: bigquery.IntegerFieldType, + Description: "description", + Required: true, + }, + proto: &storagepb.TableFieldSchema{ + Name: "name", + Type: storagepb.TableFieldSchema_INT64, + Description: "description", + Mode: storagepb.TableFieldSchema_REQUIRED, + }, + }, + { + desc: "struct with repeated bytes subfield", + bq: &bigquery.FieldSchema{ + Name: "name", + Type: bigquery.RecordFieldType, + Description: "description", + Required: true, + Schema: bigquery.Schema{ + &bigquery.FieldSchema{ + Name: "inner1", + Repeated: true, + Description: "repeat", + Type: bigquery.BytesFieldType, + }, + }, + }, + proto: &storagepb.TableFieldSchema{ + Name: "name", + Type: storagepb.TableFieldSchema_STRUCT, + Description: "description", + Mode: storagepb.TableFieldSchema_REQUIRED, + Fields: []*storagepb.TableFieldSchema{ + { + Name: "inner1", + Mode: storagepb.TableFieldSchema_REPEATED, + Description: "repeat", + Type: storagepb.TableFieldSchema_BYTES, + }, + }, + }, + }, + } + + for _, tc := range testCases { + // first, bq to proto + converted, err := bqFieldToProto(tc.bq) + if err != nil { + t.Errorf("case (%s) failed conversion from bq: %v", tc.desc, err) + } + if diff := cmp.Diff(converted, tc.proto, protocmp.Transform()); diff != "" { + t.Errorf("conversion to proto diff (%s):\n%v", tc.desc, diff) + } + // reverse conversion, proto to bq + reverse, err := protoToBQField(tc.proto) + if err != nil { + t.Errorf("case (%s) failed conversion from proto: %v", tc.desc, err) + } + if diff := cmp.Diff(reverse, tc.bq); diff != "" { + t.Errorf("conversion to BQ diff (%s):\n%v", tc.desc, diff) + } + } +} + +func TestSchemaConversion(t *testing.T) { + + testCases := []struct { + description string + bqSchema bigquery.Schema + storageSchema *storagepb.TableSchema + }{ + { + description: "nil", + bqSchema: nil, + storageSchema: nil, + }, + { + description: "scalars", + bqSchema: bigquery.Schema{ + {Name: "f1", Type: bigquery.StringFieldType}, + {Name: "f2", Type: bigquery.IntegerFieldType}, + {Name: "f3", Type: bigquery.BooleanFieldType}, + }, + storageSchema: &storagepb.TableSchema{ + Fields: []*storagepb.TableFieldSchema{ + {Name: "f1", Type: storagepb.TableFieldSchema_STRING, Mode: storagepb.TableFieldSchema_NULLABLE}, + {Name: "f2", Type: storagepb.TableFieldSchema_INT64, Mode: storagepb.TableFieldSchema_NULLABLE}, + {Name: "f3", Type: storagepb.TableFieldSchema_BOOL, Mode: storagepb.TableFieldSchema_NULLABLE}, + }, + }, + }, + { + description: "array", + bqSchema: bigquery.Schema{ + {Name: "arr", Type: bigquery.NumericFieldType, Repeated: true}, + {Name: "big", Type: bigquery.BigNumericFieldType, Required: true}, + }, + storageSchema: &storagepb.TableSchema{ + Fields: []*storagepb.TableFieldSchema{ + {Name: "arr", Type: storagepb.TableFieldSchema_NUMERIC, Mode: storagepb.TableFieldSchema_REPEATED}, + {Name: "big", Type: storagepb.TableFieldSchema_BIGNUMERIC, Mode: storagepb.TableFieldSchema_REQUIRED}, + }, + }, + }, + { + description: "nested", + bqSchema: bigquery.Schema{ + {Name: "struct1", Type: bigquery.RecordFieldType, Schema: []*bigquery.FieldSchema{ + {Name: "leaf1", Type: bigquery.DateFieldType}, + {Name: "leaf2", Type: bigquery.DateTimeFieldType}, + }}, + {Name: "field2", Type: bigquery.StringFieldType}, + }, + storageSchema: &storagepb.TableSchema{ + Fields: []*storagepb.TableFieldSchema{ + {Name: "struct1", + Type: storagepb.TableFieldSchema_STRUCT, + Mode: storagepb.TableFieldSchema_NULLABLE, + Fields: []*storagepb.TableFieldSchema{ + {Name: "leaf1", Type: storagepb.TableFieldSchema_DATE, Mode: storagepb.TableFieldSchema_NULLABLE}, + {Name: "leaf2", Type: storagepb.TableFieldSchema_DATETIME, Mode: storagepb.TableFieldSchema_NULLABLE}, + }}, + {Name: "field2", Type: storagepb.TableFieldSchema_STRING, Mode: storagepb.TableFieldSchema_NULLABLE}, + }, + }, + }, + } + for _, tc := range testCases { + + // BQ -> Storage + storageS, err := BQSchemaToStorageTableSchema(tc.bqSchema) + if err != nil { + t.Errorf("BQSchemaToStorageTableSchema(%s): %v", tc.description, err) + } + if diff := testutil.Diff(storageS, tc.storageSchema); diff != "" { + t.Fatalf("BQSchemaToStorageTableSchema(%s): -got, +want:\n%s", tc.description, diff) + } + + // Storage -> BQ + bqS, err := StorageTableSchemaToBQSchema(tc.storageSchema) + if err != nil { + t.Errorf("StorageTableSchemaToBQSchema(%s): %v", tc.description, err) + } + if diff := testutil.Diff(bqS, tc.bqSchema); diff != "" { + t.Fatalf("StorageTableSchemaToBQSchema(%s): -got, +want:\n%s", tc.description, diff) + } + } +} diff --git a/bigquery/storage/managedwriter/doc.go b/bigquery/storage/managedwriter/doc.go new file mode 100644 index 00000000000..a8e580bd90c --- /dev/null +++ b/bigquery/storage/managedwriter/doc.go @@ -0,0 +1,22 @@ +// Copyright 2021 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. + +// Package managedwriter will be a thick client around the storage API's BigQueryWriteClient. +// +// It is EXPERIMENTAL and subject to change or removal without notice. +// +// Currently, the BigQueryWriteClient this library targets is exposed in the storage v1beta2 endpoint, and is +// a successor to the streaming interface. API method tabledata.insertAll is the primary backend method, and +// the Inserter abstraction is the equivalent to this in the cloud.google.com/go/bigquery package. +package managedwriter From 729a517b16d93584b56ca0864de60f25f2a6a35a Mon Sep 17 00:00:00 2001 From: Noah Dietz Date: Thu, 1 Jul 2021 10:42:58 -0700 Subject: [PATCH 43/50] chore(internal): update microgen to v0.21.5 (#4368) --- internal/gapicgen/cmd/genbot/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/gapicgen/cmd/genbot/Dockerfile b/internal/gapicgen/cmd/genbot/Dockerfile index a63fd58728f..faeffdd1d4a 100644 --- a/internal/gapicgen/cmd/genbot/Dockerfile +++ b/internal/gapicgen/cmd/genbot/Dockerfile @@ -28,7 +28,7 @@ RUN GO111MODULE=on go get \ golang.org/x/lint/golint@latest \ golang.org/x/tools/cmd/goimports@latest \ honnef.co/go/tools/cmd/staticcheck@latest \ - github.com/googleapis/gapic-generator-go/cmd/protoc-gen-go_gapic@v0.21.3 + github.com/googleapis/gapic-generator-go/cmd/protoc-gen-go_gapic@v0.21.5 ENV PATH="${PATH}:/root/go/bin" # Source: http://debuggable.com/posts/disable-strict-host-checking-for-git-clone:49896ff3-0ac0-4263-9703-1eae4834cda3 From 75e3d64018f31b85f31658e2be7fcbac01c63495 Mon Sep 17 00:00:00 2001 From: Cody Oss <6331106+codyoss@users.noreply.github.com> Date: Thu, 1 Jul 2021 14:46:06 -0500 Subject: [PATCH 44/50] chore(all): auto-regenerate gapics (#4369) This is an auto-generated regeneration of the gapic clients by cloud.google.com/go/internal/gapicgen. Once the corresponding genproto PR is submitted, genbot will update this PR with a newer dependency to the newer version of genproto and assign reviewers to this PR. If you have been assigned to review this PR, please: - Ensure that the version of genproto in go.mod has been updated. - Ensure that CI is passing. If it's failing, it requires your manual attention. - Approve and submit this PR if you believe it's ready to ship. Corresponding genproto PR: https://github.com/googleapis/go-genproto/pull/630 Changes: chore(datastream): Add package/namespace options for C#, Ruby and PHP. This is a breaking change *only* for those languages, and packages for those languages have not been published yet. PiperOrigin-RevId: 382509175 Source-Link: https://github.com/googleapis/googleapis/commit/0c62f63ad7ca987f1c22f524d6378cff29da8a33 --- compute/apiv1/accelerator_types_client.go | 341 ++ .../accelerator_types_client_example_test.go | 93 + compute/apiv1/addresses_client.go | 452 +++ .../apiv1/addresses_client_example_test.go | 131 + compute/apiv1/autoscalers_client.go | 580 +++ .../apiv1/autoscalers_client_example_test.go | 169 + compute/apiv1/backend_buckets_client.go | 620 +++ .../backend_buckets_client_example_test.go | 188 + compute/apiv1/backend_services_client.go | 809 ++++ .../backend_services_client_example_test.go | 245 ++ compute/apiv1/disk_types_client.go | 337 ++ .../apiv1/disk_types_client_example_test.go | 93 + compute/apiv1/disks_client.go | 907 +++++ compute/apiv1/disks_client_example_test.go | 283 ++ compute/apiv1/doc.go | 118 + compute/apiv1/external_vpn_gateways_client.go | 482 +++ ...ternal_vpn_gateways_client_example_test.go | 150 + compute/apiv1/firewall_policies_client.go | 1194 ++++++ .../firewall_policies_client_example_test.go | 378 ++ compute/apiv1/firewalls_client.go | 502 +++ .../apiv1/firewalls_client_example_test.go | 150 + compute/apiv1/forwarding_rules_client.go | 626 +++ .../forwarding_rules_client_example_test.go | 188 + compute/apiv1/gapic_metadata.json | 3581 +++++++++++++++++ compute/apiv1/global_addresses_client.go | 380 ++ .../global_addresses_client_example_test.go | 112 + .../apiv1/global_forwarding_rules_client.go | 547 +++ ...al_forwarding_rules_client_example_test.go | 169 + .../global_network_endpoint_groups_client.go | 565 +++ ...ork_endpoint_groups_client_example_test.go | 169 + compute/apiv1/global_operations_client.go | 449 +++ .../global_operations_client_example_test.go | 131 + .../global_organization_operations_client.go | 332 ++ ...nization_operations_client_example_test.go | 93 + ...global_public_delegated_prefixes_client.go | 438 ++ ..._delegated_prefixes_client_example_test.go | 131 + compute/apiv1/health_checks_client.go | 574 +++ .../health_checks_client_example_test.go | 169 + compute/apiv1/images_client.go | 763 ++++ compute/apiv1/images_client_example_test.go | 245 ++ .../apiv1/instance_group_managers_client.go | 1387 +++++++ ...ance_group_managers_client_example_test.go | 416 ++ compute/apiv1/instance_groups_client.go | 708 ++++ .../instance_groups_client_example_test.go | 207 + compute/apiv1/instance_templates_client.go | 539 +++ .../instance_templates_client_example_test.go | 169 + compute/apiv1/instances_client.go | 2614 ++++++++++++ .../apiv1/instances_client_example_test.go | 834 ++++ .../apiv1/interconnect_attachments_client.go | 513 +++ ...connect_attachments_client_example_test.go | 150 + .../apiv1/interconnect_locations_client.go | 265 ++ ...erconnect_locations_client_example_test.go | 74 + compute/apiv1/interconnects_client.go | 488 +++ .../interconnects_client_example_test.go | 150 + compute/apiv1/license_codes_client.go | 247 ++ .../license_codes_client_example_test.go | 74 + compute/apiv1/licenses_client.go | 539 +++ compute/apiv1/licenses_client_example_test.go | 169 + compute/apiv1/machine_types_client.go | 337 ++ .../machine_types_client_example_test.go | 93 + .../apiv1/network_endpoint_groups_client.go | 689 ++++ ...ork_endpoint_groups_client_example_test.go | 207 + compute/apiv1/networks_client.go | 797 ++++ compute/apiv1/networks_client_example_test.go | 245 ++ compute/apiv1/node_groups_client.go | 915 +++++ .../apiv1/node_groups_client_example_test.go | 283 ++ compute/apiv1/node_templates_client.go | 611 +++ .../node_templates_client_example_test.go | 188 + compute/apiv1/node_types_client.go | 337 ++ .../apiv1/node_types_client_example_test.go | 93 + compute/apiv1/packet_mirrorings_client.go | 561 +++ .../packet_mirrorings_client_example_test.go | 169 + compute/apiv1/projects_client.go | 905 +++++ compute/apiv1/projects_client_example_test.go | 283 ++ .../public_advertised_prefixes_client.go | 438 ++ ...advertised_prefixes_client_example_test.go | 131 + .../apiv1/public_delegated_prefixes_client.go | 510 +++ ..._delegated_prefixes_client_example_test.go | 150 + compute/apiv1/region_autoscalers_client.go | 508 +++ .../region_autoscalers_client_example_test.go | 150 + .../apiv1/region_backend_services_client.go | 556 +++ ...on_backend_services_client_example_test.go | 169 + compute/apiv1/region_commitments_client.go | 395 ++ .../region_commitments_client_example_test.go | 112 + compute/apiv1/region_disk_types_client.go | 265 ++ .../region_disk_types_client_example_test.go | 74 + compute/apiv1/region_disks_client.go | 832 ++++ .../apiv1/region_disks_client_example_test.go | 264 ++ .../region_health_check_services_client.go | 438 ++ ...alth_check_services_client_example_test.go | 131 + compute/apiv1/region_health_checks_client.go | 505 +++ ...egion_health_checks_client_example_test.go | 150 + .../region_instance_group_managers_client.go | 1307 ++++++ ...ance_group_managers_client_example_test.go | 397 ++ .../apiv1/region_instance_groups_client.go | 393 ++ ...ion_instance_groups_client_example_test.go | 112 + compute/apiv1/region_instances_client.go | 204 + .../region_instances_client_example_test.go | 55 + .../region_network_endpoint_groups_client.go | 380 ++ ...ork_endpoint_groups_client_example_test.go | 112 + .../region_notification_endpoints_client.go | 380 ++ ...ification_endpoints_client_example_test.go | 112 + compute/apiv1/region_operations_client.go | 377 ++ .../region_operations_client_example_test.go | 112 + .../apiv1/region_ssl_certificates_client.go | 380 ++ ...on_ssl_certificates_client_example_test.go | 112 + .../region_target_http_proxies_client.go | 438 ++ ...target_http_proxies_client_example_test.go | 131 + .../region_target_https_proxies_client.go | 496 +++ ...arget_https_proxies_client_example_test.go | 150 + compute/apiv1/region_url_maps_client.go | 556 +++ .../region_url_maps_client_example_test.go | 169 + compute/apiv1/regions_client.go | 265 ++ compute/apiv1/regions_client_example_test.go | 74 + compute/apiv1/reservations_client.go | 669 +++ .../apiv1/reservations_client_example_test.go | 207 + compute/apiv1/resource_policies_client.go | 611 +++ .../resource_policies_client_example_test.go | 188 + compute/apiv1/routers_client.go | 747 ++++ compute/apiv1/routers_client_example_test.go | 226 ++ compute/apiv1/routes_client.go | 380 ++ compute/apiv1/routes_client_example_test.go | 112 + compute/apiv1/security_policies_client.go | 730 ++++ .../security_policies_client_example_test.go | 226 ++ compute/apiv1/snapshots_client.go | 536 +++ .../apiv1/snapshots_client_example_test.go | 169 + compute/apiv1/ssl_certificates_client.go | 452 +++ .../ssl_certificates_client_example_test.go | 131 + compute/apiv1/ssl_policies_client.go | 507 +++ .../apiv1/ssl_policies_client_example_test.go | 150 + compute/apiv1/subnetworks_client.go | 857 ++++ .../apiv1/subnetworks_client_example_test.go | 264 ++ compute/apiv1/target_grpc_proxies_client.go | 438 ++ ...target_grpc_proxies_client_example_test.go | 131 + compute/apiv1/target_http_proxies_client.go | 568 +++ ...target_http_proxies_client_example_test.go | 169 + compute/apiv1/target_https_proxies_client.go | 742 ++++ ...arget_https_proxies_client_example_test.go | 226 ++ compute/apiv1/target_instances_client.go | 452 +++ .../target_instances_client_example_test.go | 131 + compute/apiv1/target_pools_client.go | 796 ++++ .../apiv1/target_pools_client_example_test.go | 245 ++ compute/apiv1/target_ssl_proxies_client.go | 612 +++ .../target_ssl_proxies_client_example_test.go | 188 + compute/apiv1/target_tcp_proxies_client.go | 496 +++ .../target_tcp_proxies_client_example_test.go | 150 + compute/apiv1/target_vpn_gateways_client.go | 452 +++ ...target_vpn_gateways_client_example_test.go | 131 + compute/apiv1/url_maps_client.go | 687 ++++ compute/apiv1/url_maps_client_example_test.go | 207 + compute/apiv1/vpn_gateways_client.go | 611 +++ .../apiv1/vpn_gateways_client_example_test.go | 188 + compute/apiv1/vpn_tunnels_client.go | 452 +++ .../apiv1/vpn_tunnels_client_example_test.go | 131 + compute/apiv1/zone_operations_client.go | 377 ++ .../zone_operations_client_example_test.go | 112 + compute/apiv1/zones_client.go | 265 ++ compute/apiv1/zones_client_example_test.go | 74 + internal/.repo-metadata-full.json | 9 + 159 files changed, 62832 insertions(+) create mode 100644 compute/apiv1/accelerator_types_client.go create mode 100644 compute/apiv1/accelerator_types_client_example_test.go create mode 100644 compute/apiv1/addresses_client.go create mode 100644 compute/apiv1/addresses_client_example_test.go create mode 100644 compute/apiv1/autoscalers_client.go create mode 100644 compute/apiv1/autoscalers_client_example_test.go create mode 100644 compute/apiv1/backend_buckets_client.go create mode 100644 compute/apiv1/backend_buckets_client_example_test.go create mode 100644 compute/apiv1/backend_services_client.go create mode 100644 compute/apiv1/backend_services_client_example_test.go create mode 100644 compute/apiv1/disk_types_client.go create mode 100644 compute/apiv1/disk_types_client_example_test.go create mode 100644 compute/apiv1/disks_client.go create mode 100644 compute/apiv1/disks_client_example_test.go create mode 100644 compute/apiv1/doc.go create mode 100644 compute/apiv1/external_vpn_gateways_client.go create mode 100644 compute/apiv1/external_vpn_gateways_client_example_test.go create mode 100644 compute/apiv1/firewall_policies_client.go create mode 100644 compute/apiv1/firewall_policies_client_example_test.go create mode 100644 compute/apiv1/firewalls_client.go create mode 100644 compute/apiv1/firewalls_client_example_test.go create mode 100644 compute/apiv1/forwarding_rules_client.go create mode 100644 compute/apiv1/forwarding_rules_client_example_test.go create mode 100644 compute/apiv1/gapic_metadata.json create mode 100644 compute/apiv1/global_addresses_client.go create mode 100644 compute/apiv1/global_addresses_client_example_test.go create mode 100644 compute/apiv1/global_forwarding_rules_client.go create mode 100644 compute/apiv1/global_forwarding_rules_client_example_test.go create mode 100644 compute/apiv1/global_network_endpoint_groups_client.go create mode 100644 compute/apiv1/global_network_endpoint_groups_client_example_test.go create mode 100644 compute/apiv1/global_operations_client.go create mode 100644 compute/apiv1/global_operations_client_example_test.go create mode 100644 compute/apiv1/global_organization_operations_client.go create mode 100644 compute/apiv1/global_organization_operations_client_example_test.go create mode 100644 compute/apiv1/global_public_delegated_prefixes_client.go create mode 100644 compute/apiv1/global_public_delegated_prefixes_client_example_test.go create mode 100644 compute/apiv1/health_checks_client.go create mode 100644 compute/apiv1/health_checks_client_example_test.go create mode 100644 compute/apiv1/images_client.go create mode 100644 compute/apiv1/images_client_example_test.go create mode 100644 compute/apiv1/instance_group_managers_client.go create mode 100644 compute/apiv1/instance_group_managers_client_example_test.go create mode 100644 compute/apiv1/instance_groups_client.go create mode 100644 compute/apiv1/instance_groups_client_example_test.go create mode 100644 compute/apiv1/instance_templates_client.go create mode 100644 compute/apiv1/instance_templates_client_example_test.go create mode 100644 compute/apiv1/instances_client.go create mode 100644 compute/apiv1/instances_client_example_test.go create mode 100644 compute/apiv1/interconnect_attachments_client.go create mode 100644 compute/apiv1/interconnect_attachments_client_example_test.go create mode 100644 compute/apiv1/interconnect_locations_client.go create mode 100644 compute/apiv1/interconnect_locations_client_example_test.go create mode 100644 compute/apiv1/interconnects_client.go create mode 100644 compute/apiv1/interconnects_client_example_test.go create mode 100644 compute/apiv1/license_codes_client.go create mode 100644 compute/apiv1/license_codes_client_example_test.go create mode 100644 compute/apiv1/licenses_client.go create mode 100644 compute/apiv1/licenses_client_example_test.go create mode 100644 compute/apiv1/machine_types_client.go create mode 100644 compute/apiv1/machine_types_client_example_test.go create mode 100644 compute/apiv1/network_endpoint_groups_client.go create mode 100644 compute/apiv1/network_endpoint_groups_client_example_test.go create mode 100644 compute/apiv1/networks_client.go create mode 100644 compute/apiv1/networks_client_example_test.go create mode 100644 compute/apiv1/node_groups_client.go create mode 100644 compute/apiv1/node_groups_client_example_test.go create mode 100644 compute/apiv1/node_templates_client.go create mode 100644 compute/apiv1/node_templates_client_example_test.go create mode 100644 compute/apiv1/node_types_client.go create mode 100644 compute/apiv1/node_types_client_example_test.go create mode 100644 compute/apiv1/packet_mirrorings_client.go create mode 100644 compute/apiv1/packet_mirrorings_client_example_test.go create mode 100644 compute/apiv1/projects_client.go create mode 100644 compute/apiv1/projects_client_example_test.go create mode 100644 compute/apiv1/public_advertised_prefixes_client.go create mode 100644 compute/apiv1/public_advertised_prefixes_client_example_test.go create mode 100644 compute/apiv1/public_delegated_prefixes_client.go create mode 100644 compute/apiv1/public_delegated_prefixes_client_example_test.go create mode 100644 compute/apiv1/region_autoscalers_client.go create mode 100644 compute/apiv1/region_autoscalers_client_example_test.go create mode 100644 compute/apiv1/region_backend_services_client.go create mode 100644 compute/apiv1/region_backend_services_client_example_test.go create mode 100644 compute/apiv1/region_commitments_client.go create mode 100644 compute/apiv1/region_commitments_client_example_test.go create mode 100644 compute/apiv1/region_disk_types_client.go create mode 100644 compute/apiv1/region_disk_types_client_example_test.go create mode 100644 compute/apiv1/region_disks_client.go create mode 100644 compute/apiv1/region_disks_client_example_test.go create mode 100644 compute/apiv1/region_health_check_services_client.go create mode 100644 compute/apiv1/region_health_check_services_client_example_test.go create mode 100644 compute/apiv1/region_health_checks_client.go create mode 100644 compute/apiv1/region_health_checks_client_example_test.go create mode 100644 compute/apiv1/region_instance_group_managers_client.go create mode 100644 compute/apiv1/region_instance_group_managers_client_example_test.go create mode 100644 compute/apiv1/region_instance_groups_client.go create mode 100644 compute/apiv1/region_instance_groups_client_example_test.go create mode 100644 compute/apiv1/region_instances_client.go create mode 100644 compute/apiv1/region_instances_client_example_test.go create mode 100644 compute/apiv1/region_network_endpoint_groups_client.go create mode 100644 compute/apiv1/region_network_endpoint_groups_client_example_test.go create mode 100644 compute/apiv1/region_notification_endpoints_client.go create mode 100644 compute/apiv1/region_notification_endpoints_client_example_test.go create mode 100644 compute/apiv1/region_operations_client.go create mode 100644 compute/apiv1/region_operations_client_example_test.go create mode 100644 compute/apiv1/region_ssl_certificates_client.go create mode 100644 compute/apiv1/region_ssl_certificates_client_example_test.go create mode 100644 compute/apiv1/region_target_http_proxies_client.go create mode 100644 compute/apiv1/region_target_http_proxies_client_example_test.go create mode 100644 compute/apiv1/region_target_https_proxies_client.go create mode 100644 compute/apiv1/region_target_https_proxies_client_example_test.go create mode 100644 compute/apiv1/region_url_maps_client.go create mode 100644 compute/apiv1/region_url_maps_client_example_test.go create mode 100644 compute/apiv1/regions_client.go create mode 100644 compute/apiv1/regions_client_example_test.go create mode 100644 compute/apiv1/reservations_client.go create mode 100644 compute/apiv1/reservations_client_example_test.go create mode 100644 compute/apiv1/resource_policies_client.go create mode 100644 compute/apiv1/resource_policies_client_example_test.go create mode 100644 compute/apiv1/routers_client.go create mode 100644 compute/apiv1/routers_client_example_test.go create mode 100644 compute/apiv1/routes_client.go create mode 100644 compute/apiv1/routes_client_example_test.go create mode 100644 compute/apiv1/security_policies_client.go create mode 100644 compute/apiv1/security_policies_client_example_test.go create mode 100644 compute/apiv1/snapshots_client.go create mode 100644 compute/apiv1/snapshots_client_example_test.go create mode 100644 compute/apiv1/ssl_certificates_client.go create mode 100644 compute/apiv1/ssl_certificates_client_example_test.go create mode 100644 compute/apiv1/ssl_policies_client.go create mode 100644 compute/apiv1/ssl_policies_client_example_test.go create mode 100644 compute/apiv1/subnetworks_client.go create mode 100644 compute/apiv1/subnetworks_client_example_test.go create mode 100644 compute/apiv1/target_grpc_proxies_client.go create mode 100644 compute/apiv1/target_grpc_proxies_client_example_test.go create mode 100644 compute/apiv1/target_http_proxies_client.go create mode 100644 compute/apiv1/target_http_proxies_client_example_test.go create mode 100644 compute/apiv1/target_https_proxies_client.go create mode 100644 compute/apiv1/target_https_proxies_client_example_test.go create mode 100644 compute/apiv1/target_instances_client.go create mode 100644 compute/apiv1/target_instances_client_example_test.go create mode 100644 compute/apiv1/target_pools_client.go create mode 100644 compute/apiv1/target_pools_client_example_test.go create mode 100644 compute/apiv1/target_ssl_proxies_client.go create mode 100644 compute/apiv1/target_ssl_proxies_client_example_test.go create mode 100644 compute/apiv1/target_tcp_proxies_client.go create mode 100644 compute/apiv1/target_tcp_proxies_client_example_test.go create mode 100644 compute/apiv1/target_vpn_gateways_client.go create mode 100644 compute/apiv1/target_vpn_gateways_client_example_test.go create mode 100644 compute/apiv1/url_maps_client.go create mode 100644 compute/apiv1/url_maps_client_example_test.go create mode 100644 compute/apiv1/vpn_gateways_client.go create mode 100644 compute/apiv1/vpn_gateways_client_example_test.go create mode 100644 compute/apiv1/vpn_tunnels_client.go create mode 100644 compute/apiv1/vpn_tunnels_client_example_test.go create mode 100644 compute/apiv1/zone_operations_client.go create mode 100644 compute/apiv1/zone_operations_client_example_test.go create mode 100644 compute/apiv1/zones_client.go create mode 100644 compute/apiv1/zones_client_example_test.go diff --git a/compute/apiv1/accelerator_types_client.go b/compute/apiv1/accelerator_types_client.go new file mode 100644 index 00000000000..ebb96df0ed2 --- /dev/null +++ b/compute/apiv1/accelerator_types_client.go @@ -0,0 +1,341 @@ +// Copyright 2021 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/ioutil" + "net/http" + "net/url" + + gax "github.com/googleapis/gax-go/v2" + "google.golang.org/api/option" + "google.golang.org/api/option/internaloption" + httptransport "google.golang.org/api/transport/http" + computepb "google.golang.org/genproto/googleapis/cloud/compute/v1" + "google.golang.org/grpc" + "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/encoding/protojson" +) + +var newAcceleratorTypesClientHook clientHook + +// AcceleratorTypesCallOptions contains the retry settings for each method of AcceleratorTypesClient. +type AcceleratorTypesCallOptions struct { + AggregatedList []gax.CallOption + Get []gax.CallOption + List []gax.CallOption +} + +// internalAcceleratorTypesClient is an interface that defines the methods availaible from Google Compute Engine API. +type internalAcceleratorTypesClient interface { + Close() error + setGoogleClientInfo(...string) + Connection() *grpc.ClientConn + AggregatedList(context.Context, *computepb.AggregatedListAcceleratorTypesRequest, ...gax.CallOption) (*computepb.AcceleratorTypeAggregatedList, error) + Get(context.Context, *computepb.GetAcceleratorTypeRequest, ...gax.CallOption) (*computepb.AcceleratorType, error) + List(context.Context, *computepb.ListAcceleratorTypesRequest, ...gax.CallOption) (*computepb.AcceleratorTypeList, error) +} + +// AcceleratorTypesClient 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. +// +// Services +// +// The AcceleratorTypes API. +type AcceleratorTypesClient struct { + // The internal transport-dependent client. + internalClient internalAcceleratorTypesClient + + // The call options for this service. + CallOptions *AcceleratorTypesCallOptions +} + +// 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 *AcceleratorTypesClient) 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 *AcceleratorTypesClient) setGoogleClientInfo(keyval ...string) { + c.internalClient.setGoogleClientInfo(keyval...) +} + +// Connection returns a connection to the API service. +// +// Deprecated. +func (c *AcceleratorTypesClient) Connection() *grpc.ClientConn { + return c.internalClient.Connection() +} + +// AggregatedList retrieves an aggregated list of accelerator types. +func (c *AcceleratorTypesClient) AggregatedList(ctx context.Context, req *computepb.AggregatedListAcceleratorTypesRequest, opts ...gax.CallOption) (*computepb.AcceleratorTypeAggregatedList, error) { + return c.internalClient.AggregatedList(ctx, req, opts...) +} + +// Get returns the specified accelerator type. +func (c *AcceleratorTypesClient) Get(ctx context.Context, req *computepb.GetAcceleratorTypeRequest, opts ...gax.CallOption) (*computepb.AcceleratorType, error) { + return c.internalClient.Get(ctx, req, opts...) +} + +// List retrieves a list of accelerator types that are available to the specified project. +func (c *AcceleratorTypesClient) List(ctx context.Context, req *computepb.ListAcceleratorTypesRequest, opts ...gax.CallOption) (*computepb.AcceleratorTypeList, error) { + return c.internalClient.List(ctx, req, opts...) +} + +// Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls. +type acceleratorTypesRESTClient struct { + // The http endpoint to connect to. + endpoint string + + // The http client. + httpClient *http.Client + + // The x-goog-* metadata to be sent with each request. + xGoogMetadata metadata.MD +} + +// NewAcceleratorTypesRESTClient creates a new accelerator types rest client. +// +// Services +// +// The AcceleratorTypes API. +func NewAcceleratorTypesRESTClient(ctx context.Context, opts ...option.ClientOption) (*AcceleratorTypesClient, error) { + clientOpts := append(defaultAcceleratorTypesRESTClientOptions(), opts...) + httpClient, endpoint, err := httptransport.NewClient(ctx, clientOpts...) + if err != nil { + return nil, err + } + + c := &acceleratorTypesRESTClient{ + endpoint: endpoint, + httpClient: httpClient, + } + c.setGoogleClientInfo() + + return &AcceleratorTypesClient{internalClient: c, CallOptions: &AcceleratorTypesCallOptions{}}, nil +} + +func defaultAcceleratorTypesRESTClientOptions() []option.ClientOption { + return []option.ClientOption{ + internaloption.WithDefaultEndpoint("compute.googleapis.com"), + internaloption.WithDefaultMTLSEndpoint("compute.mtls.googleapis.com"), + internaloption.WithDefaultAudience("https://compute.googleapis.com/"), + internaloption.WithDefaultScopes(DefaultAuthScopes()...), + } +} + +// setGoogleClientInfo sets the name and version of the application in +// the `x-goog-api-client` header passed on each request. Intended for +// use by Google-written clients. +func (c *acceleratorTypesRESTClient) setGoogleClientInfo(keyval ...string) { + kv := append([]string{"gl-go", versionGo()}, keyval...) + kv = append(kv, "gapic", versionClient, "gax", gax.Version, "rest", "UNKNOWN") + c.xGoogMetadata = metadata.Pairs("x-goog-api-client", gax.XGoogHeader(kv...)) +} + +// Close closes the connection to the API service. The user should invoke this when +// the client is no longer required. +func (c *acceleratorTypesRESTClient) Close() error { + // Replace httpClient with nil to force cleanup. + c.httpClient = nil + return nil +} + +// Connection returns a connection to the API service. +// +// Deprecated. +func (c *acceleratorTypesRESTClient) Connection() *grpc.ClientConn { + return nil +} + +// AggregatedList retrieves an aggregated list of accelerator types. +func (c *acceleratorTypesRESTClient) AggregatedList(ctx context.Context, req *computepb.AggregatedListAcceleratorTypesRequest, opts ...gax.CallOption) (*computepb.AcceleratorTypeAggregatedList, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/aggregated/acceleratorTypes", req.GetProject()) + + params := url.Values{} + if req != nil && req.Filter != nil { + params.Add("filter", fmt.Sprintf("%v", req.GetFilter())) + } + if req != nil && req.IncludeAllScopes != nil { + params.Add("includeAllScopes", fmt.Sprintf("%v", req.GetIncludeAllScopes())) + } + 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() + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.AcceleratorTypeAggregatedList{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Get returns the specified accelerator type. +func (c *acceleratorTypesRESTClient) Get(ctx context.Context, req *computepb.GetAcceleratorTypeRequest, opts ...gax.CallOption) (*computepb.AcceleratorType, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/zones/%v/acceleratorTypes/%v", req.GetProject(), req.GetZone(), req.GetAcceleratorType()) + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.AcceleratorType{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// List retrieves a list of accelerator types that are available to the specified project. +func (c *acceleratorTypesRESTClient) List(ctx context.Context, req *computepb.ListAcceleratorTypesRequest, opts ...gax.CallOption) (*computepb.AcceleratorTypeList, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/zones/%v/acceleratorTypes", req.GetProject(), req.GetZone()) + + 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() + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.AcceleratorTypeList{} + + return rsp, unm.Unmarshal(buf, rsp) +} diff --git a/compute/apiv1/accelerator_types_client_example_test.go b/compute/apiv1/accelerator_types_client_example_test.go new file mode 100644 index 00000000000..ddb62c81c7c --- /dev/null +++ b/compute/apiv1/accelerator_types_client_example_test.go @@ -0,0 +1,93 @@ +// Copyright 2021 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_test + +import ( + "context" + + compute "cloud.google.com/go/compute/apiv1" + computepb "google.golang.org/genproto/googleapis/cloud/compute/v1" +) + +func ExampleNewAcceleratorTypesRESTClient() { + ctx := context.Background() + c, err := compute.NewAcceleratorTypesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + // TODO: Use client. + _ = c +} + +func ExampleAcceleratorTypesClient_AggregatedList() { + ctx := context.Background() + c, err := compute.NewAcceleratorTypesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.AggregatedListAcceleratorTypesRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.AggregatedList(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleAcceleratorTypesClient_Get() { + ctx := context.Background() + c, err := compute.NewAcceleratorTypesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.GetAcceleratorTypeRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Get(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleAcceleratorTypesClient_List() { + ctx := context.Background() + c, err := compute.NewAcceleratorTypesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.ListAcceleratorTypesRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.List(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} diff --git a/compute/apiv1/addresses_client.go b/compute/apiv1/addresses_client.go new file mode 100644 index 00000000000..023436436bd --- /dev/null +++ b/compute/apiv1/addresses_client.go @@ -0,0 +1,452 @@ +// Copyright 2021 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/ioutil" + "net/http" + "net/url" + + gax "github.com/googleapis/gax-go/v2" + "google.golang.org/api/option" + "google.golang.org/api/option/internaloption" + httptransport "google.golang.org/api/transport/http" + computepb "google.golang.org/genproto/googleapis/cloud/compute/v1" + "google.golang.org/grpc" + "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/encoding/protojson" +) + +var newAddressesClientHook clientHook + +// AddressesCallOptions contains the retry settings for each method of AddressesClient. +type AddressesCallOptions struct { + AggregatedList []gax.CallOption + Delete []gax.CallOption + Get []gax.CallOption + Insert []gax.CallOption + List []gax.CallOption +} + +// internalAddressesClient is an interface that defines the methods availaible from Google Compute Engine API. +type internalAddressesClient interface { + Close() error + setGoogleClientInfo(...string) + Connection() *grpc.ClientConn + AggregatedList(context.Context, *computepb.AggregatedListAddressesRequest, ...gax.CallOption) (*computepb.AddressAggregatedList, error) + Delete(context.Context, *computepb.DeleteAddressRequest, ...gax.CallOption) (*computepb.Operation, error) + Get(context.Context, *computepb.GetAddressRequest, ...gax.CallOption) (*computepb.Address, error) + Insert(context.Context, *computepb.InsertAddressRequest, ...gax.CallOption) (*computepb.Operation, error) + List(context.Context, *computepb.ListAddressesRequest, ...gax.CallOption) (*computepb.AddressList, error) +} + +// AddressesClient 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 Addresses API. +type AddressesClient struct { + // The internal transport-dependent client. + internalClient internalAddressesClient + + // The call options for this service. + CallOptions *AddressesCallOptions +} + +// 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 *AddressesClient) 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 *AddressesClient) setGoogleClientInfo(keyval ...string) { + c.internalClient.setGoogleClientInfo(keyval...) +} + +// Connection returns a connection to the API service. +// +// Deprecated. +func (c *AddressesClient) Connection() *grpc.ClientConn { + return c.internalClient.Connection() +} + +// AggregatedList retrieves an aggregated list of addresses. +func (c *AddressesClient) AggregatedList(ctx context.Context, req *computepb.AggregatedListAddressesRequest, opts ...gax.CallOption) (*computepb.AddressAggregatedList, error) { + return c.internalClient.AggregatedList(ctx, req, opts...) +} + +// Delete deletes the specified address resource. +func (c *AddressesClient) Delete(ctx context.Context, req *computepb.DeleteAddressRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.Delete(ctx, req, opts...) +} + +// Get returns the specified address resource. +func (c *AddressesClient) Get(ctx context.Context, req *computepb.GetAddressRequest, opts ...gax.CallOption) (*computepb.Address, error) { + return c.internalClient.Get(ctx, req, opts...) +} + +// Insert creates an address resource in the specified project by using the data included in the request. +func (c *AddressesClient) Insert(ctx context.Context, req *computepb.InsertAddressRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.Insert(ctx, req, opts...) +} + +// List retrieves a list of addresses contained within the specified region. +func (c *AddressesClient) List(ctx context.Context, req *computepb.ListAddressesRequest, opts ...gax.CallOption) (*computepb.AddressList, error) { + return c.internalClient.List(ctx, req, opts...) +} + +// Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls. +type addressesRESTClient struct { + // The http endpoint to connect to. + endpoint string + + // The http client. + httpClient *http.Client + + // The x-goog-* metadata to be sent with each request. + xGoogMetadata metadata.MD +} + +// NewAddressesRESTClient creates a new addresses rest client. +// +// The Addresses API. +func NewAddressesRESTClient(ctx context.Context, opts ...option.ClientOption) (*AddressesClient, error) { + clientOpts := append(defaultAddressesRESTClientOptions(), opts...) + httpClient, endpoint, err := httptransport.NewClient(ctx, clientOpts...) + if err != nil { + return nil, err + } + + c := &addressesRESTClient{ + endpoint: endpoint, + httpClient: httpClient, + } + c.setGoogleClientInfo() + + return &AddressesClient{internalClient: c, CallOptions: &AddressesCallOptions{}}, nil +} + +func defaultAddressesRESTClientOptions() []option.ClientOption { + return []option.ClientOption{ + internaloption.WithDefaultEndpoint("compute.googleapis.com"), + internaloption.WithDefaultMTLSEndpoint("compute.mtls.googleapis.com"), + internaloption.WithDefaultAudience("https://compute.googleapis.com/"), + internaloption.WithDefaultScopes(DefaultAuthScopes()...), + } +} + +// setGoogleClientInfo sets the name and version of the application in +// the `x-goog-api-client` header passed on each request. Intended for +// use by Google-written clients. +func (c *addressesRESTClient) setGoogleClientInfo(keyval ...string) { + kv := append([]string{"gl-go", versionGo()}, keyval...) + kv = append(kv, "gapic", versionClient, "gax", gax.Version, "rest", "UNKNOWN") + c.xGoogMetadata = metadata.Pairs("x-goog-api-client", gax.XGoogHeader(kv...)) +} + +// Close closes the connection to the API service. The user should invoke this when +// the client is no longer required. +func (c *addressesRESTClient) Close() error { + // Replace httpClient with nil to force cleanup. + c.httpClient = nil + return nil +} + +// Connection returns a connection to the API service. +// +// Deprecated. +func (c *addressesRESTClient) Connection() *grpc.ClientConn { + return nil +} + +// AggregatedList retrieves an aggregated list of addresses. +func (c *addressesRESTClient) AggregatedList(ctx context.Context, req *computepb.AggregatedListAddressesRequest, opts ...gax.CallOption) (*computepb.AddressAggregatedList, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/aggregated/addresses", req.GetProject()) + + params := url.Values{} + if req != nil && req.Filter != nil { + params.Add("filter", fmt.Sprintf("%v", req.GetFilter())) + } + if req != nil && req.IncludeAllScopes != nil { + params.Add("includeAllScopes", fmt.Sprintf("%v", req.GetIncludeAllScopes())) + } + 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() + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.AddressAggregatedList{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Delete deletes the specified address resource. +func (c *addressesRESTClient) Delete(ctx context.Context, req *computepb.DeleteAddressRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/addresses/%v", req.GetProject(), req.GetRegion(), req.GetAddress()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("DELETE", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Get returns the specified address resource. +func (c *addressesRESTClient) Get(ctx context.Context, req *computepb.GetAddressRequest, opts ...gax.CallOption) (*computepb.Address, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/addresses/%v", req.GetProject(), req.GetRegion(), req.GetAddress()) + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Address{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Insert creates an address resource in the specified project by using the data included in the request. +func (c *addressesRESTClient) Insert(ctx context.Context, req *computepb.InsertAddressRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetAddressResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/addresses", req.GetProject(), req.GetRegion()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// List retrieves a list of addresses contained within the specified region. +func (c *addressesRESTClient) List(ctx context.Context, req *computepb.ListAddressesRequest, opts ...gax.CallOption) (*computepb.AddressList, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/addresses", 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() + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.AddressList{} + + return rsp, unm.Unmarshal(buf, rsp) +} diff --git a/compute/apiv1/addresses_client_example_test.go b/compute/apiv1/addresses_client_example_test.go new file mode 100644 index 00000000000..8349df07d7b --- /dev/null +++ b/compute/apiv1/addresses_client_example_test.go @@ -0,0 +1,131 @@ +// Copyright 2021 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_test + +import ( + "context" + + compute "cloud.google.com/go/compute/apiv1" + computepb "google.golang.org/genproto/googleapis/cloud/compute/v1" +) + +func ExampleNewAddressesRESTClient() { + ctx := context.Background() + c, err := compute.NewAddressesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + // TODO: Use client. + _ = c +} + +func ExampleAddressesClient_AggregatedList() { + ctx := context.Background() + c, err := compute.NewAddressesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.AggregatedListAddressesRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.AggregatedList(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleAddressesClient_Delete() { + ctx := context.Background() + c, err := compute.NewAddressesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.DeleteAddressRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Delete(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleAddressesClient_Get() { + ctx := context.Background() + c, err := compute.NewAddressesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.GetAddressRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Get(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleAddressesClient_Insert() { + ctx := context.Background() + c, err := compute.NewAddressesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.InsertAddressRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Insert(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleAddressesClient_List() { + ctx := context.Background() + c, err := compute.NewAddressesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.ListAddressesRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.List(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} diff --git a/compute/apiv1/autoscalers_client.go b/compute/apiv1/autoscalers_client.go new file mode 100644 index 00000000000..771438a9284 --- /dev/null +++ b/compute/apiv1/autoscalers_client.go @@ -0,0 +1,580 @@ +// Copyright 2021 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/ioutil" + "net/http" + "net/url" + + gax "github.com/googleapis/gax-go/v2" + "google.golang.org/api/option" + "google.golang.org/api/option/internaloption" + httptransport "google.golang.org/api/transport/http" + computepb "google.golang.org/genproto/googleapis/cloud/compute/v1" + "google.golang.org/grpc" + "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/encoding/protojson" +) + +var newAutoscalersClientHook clientHook + +// AutoscalersCallOptions contains the retry settings for each method of AutoscalersClient. +type AutoscalersCallOptions struct { + AggregatedList []gax.CallOption + Delete []gax.CallOption + Get []gax.CallOption + Insert []gax.CallOption + List []gax.CallOption + Patch []gax.CallOption + Update []gax.CallOption +} + +// internalAutoscalersClient is an interface that defines the methods availaible from Google Compute Engine API. +type internalAutoscalersClient interface { + Close() error + setGoogleClientInfo(...string) + Connection() *grpc.ClientConn + AggregatedList(context.Context, *computepb.AggregatedListAutoscalersRequest, ...gax.CallOption) (*computepb.AutoscalerAggregatedList, error) + Delete(context.Context, *computepb.DeleteAutoscalerRequest, ...gax.CallOption) (*computepb.Operation, error) + Get(context.Context, *computepb.GetAutoscalerRequest, ...gax.CallOption) (*computepb.Autoscaler, error) + Insert(context.Context, *computepb.InsertAutoscalerRequest, ...gax.CallOption) (*computepb.Operation, error) + List(context.Context, *computepb.ListAutoscalersRequest, ...gax.CallOption) (*computepb.AutoscalerList, error) + Patch(context.Context, *computepb.PatchAutoscalerRequest, ...gax.CallOption) (*computepb.Operation, error) + Update(context.Context, *computepb.UpdateAutoscalerRequest, ...gax.CallOption) (*computepb.Operation, error) +} + +// AutoscalersClient 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 Autoscalers API. +type AutoscalersClient struct { + // The internal transport-dependent client. + internalClient internalAutoscalersClient + + // The call options for this service. + CallOptions *AutoscalersCallOptions +} + +// 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 *AutoscalersClient) 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 *AutoscalersClient) setGoogleClientInfo(keyval ...string) { + c.internalClient.setGoogleClientInfo(keyval...) +} + +// Connection returns a connection to the API service. +// +// Deprecated. +func (c *AutoscalersClient) Connection() *grpc.ClientConn { + return c.internalClient.Connection() +} + +// AggregatedList retrieves an aggregated list of autoscalers. +func (c *AutoscalersClient) AggregatedList(ctx context.Context, req *computepb.AggregatedListAutoscalersRequest, opts ...gax.CallOption) (*computepb.AutoscalerAggregatedList, error) { + return c.internalClient.AggregatedList(ctx, req, opts...) +} + +// Delete deletes the specified autoscaler. +func (c *AutoscalersClient) Delete(ctx context.Context, req *computepb.DeleteAutoscalerRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.Delete(ctx, req, opts...) +} + +// Get returns the specified autoscaler resource. Gets a list of available autoscalers by making a list() request. +func (c *AutoscalersClient) Get(ctx context.Context, req *computepb.GetAutoscalerRequest, opts ...gax.CallOption) (*computepb.Autoscaler, error) { + return c.internalClient.Get(ctx, req, opts...) +} + +// Insert creates an autoscaler in the specified project using the data included in the request. +func (c *AutoscalersClient) Insert(ctx context.Context, req *computepb.InsertAutoscalerRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.Insert(ctx, req, opts...) +} + +// List retrieves a list of autoscalers contained within the specified zone. +func (c *AutoscalersClient) List(ctx context.Context, req *computepb.ListAutoscalersRequest, opts ...gax.CallOption) (*computepb.AutoscalerList, error) { + return c.internalClient.List(ctx, req, opts...) +} + +// Patch updates an autoscaler in the specified project using the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. +func (c *AutoscalersClient) Patch(ctx context.Context, req *computepb.PatchAutoscalerRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.Patch(ctx, req, opts...) +} + +// Update updates an autoscaler in the specified project using the data included in the request. +func (c *AutoscalersClient) Update(ctx context.Context, req *computepb.UpdateAutoscalerRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.Update(ctx, req, opts...) +} + +// Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls. +type autoscalersRESTClient struct { + // The http endpoint to connect to. + endpoint string + + // The http client. + httpClient *http.Client + + // The x-goog-* metadata to be sent with each request. + xGoogMetadata metadata.MD +} + +// NewAutoscalersRESTClient creates a new autoscalers rest client. +// +// The Autoscalers API. +func NewAutoscalersRESTClient(ctx context.Context, opts ...option.ClientOption) (*AutoscalersClient, error) { + clientOpts := append(defaultAutoscalersRESTClientOptions(), opts...) + httpClient, endpoint, err := httptransport.NewClient(ctx, clientOpts...) + if err != nil { + return nil, err + } + + c := &autoscalersRESTClient{ + endpoint: endpoint, + httpClient: httpClient, + } + c.setGoogleClientInfo() + + return &AutoscalersClient{internalClient: c, CallOptions: &AutoscalersCallOptions{}}, nil +} + +func defaultAutoscalersRESTClientOptions() []option.ClientOption { + return []option.ClientOption{ + internaloption.WithDefaultEndpoint("compute.googleapis.com"), + internaloption.WithDefaultMTLSEndpoint("compute.mtls.googleapis.com"), + internaloption.WithDefaultAudience("https://compute.googleapis.com/"), + internaloption.WithDefaultScopes(DefaultAuthScopes()...), + } +} + +// setGoogleClientInfo sets the name and version of the application in +// the `x-goog-api-client` header passed on each request. Intended for +// use by Google-written clients. +func (c *autoscalersRESTClient) setGoogleClientInfo(keyval ...string) { + kv := append([]string{"gl-go", versionGo()}, keyval...) + kv = append(kv, "gapic", versionClient, "gax", gax.Version, "rest", "UNKNOWN") + c.xGoogMetadata = metadata.Pairs("x-goog-api-client", gax.XGoogHeader(kv...)) +} + +// Close closes the connection to the API service. The user should invoke this when +// the client is no longer required. +func (c *autoscalersRESTClient) Close() error { + // Replace httpClient with nil to force cleanup. + c.httpClient = nil + return nil +} + +// Connection returns a connection to the API service. +// +// Deprecated. +func (c *autoscalersRESTClient) Connection() *grpc.ClientConn { + return nil +} + +// AggregatedList retrieves an aggregated list of autoscalers. +func (c *autoscalersRESTClient) AggregatedList(ctx context.Context, req *computepb.AggregatedListAutoscalersRequest, opts ...gax.CallOption) (*computepb.AutoscalerAggregatedList, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/aggregated/autoscalers", req.GetProject()) + + params := url.Values{} + if req != nil && req.Filter != nil { + params.Add("filter", fmt.Sprintf("%v", req.GetFilter())) + } + if req != nil && req.IncludeAllScopes != nil { + params.Add("includeAllScopes", fmt.Sprintf("%v", req.GetIncludeAllScopes())) + } + 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() + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.AutoscalerAggregatedList{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Delete deletes the specified autoscaler. +func (c *autoscalersRESTClient) Delete(ctx context.Context, req *computepb.DeleteAutoscalerRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/zones/%v/autoscalers/%v", req.GetProject(), req.GetZone(), req.GetAutoscaler()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("DELETE", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Get returns the specified autoscaler resource. Gets a list of available autoscalers by making a list() request. +func (c *autoscalersRESTClient) Get(ctx context.Context, req *computepb.GetAutoscalerRequest, opts ...gax.CallOption) (*computepb.Autoscaler, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/zones/%v/autoscalers/%v", req.GetProject(), req.GetZone(), req.GetAutoscaler()) + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Autoscaler{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Insert creates an autoscaler in the specified project using the data included in the request. +func (c *autoscalersRESTClient) Insert(ctx context.Context, req *computepb.InsertAutoscalerRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetAutoscalerResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/zones/%v/autoscalers", req.GetProject(), req.GetZone()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// List retrieves a list of autoscalers contained within the specified zone. +func (c *autoscalersRESTClient) List(ctx context.Context, req *computepb.ListAutoscalersRequest, opts ...gax.CallOption) (*computepb.AutoscalerList, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/zones/%v/autoscalers", req.GetProject(), req.GetZone()) + + 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() + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.AutoscalerList{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Patch updates an autoscaler in the specified project using the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. +func (c *autoscalersRESTClient) Patch(ctx context.Context, req *computepb.PatchAutoscalerRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetAutoscalerResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/zones/%v/autoscalers", req.GetProject(), req.GetZone()) + + params := url.Values{} + if req != nil && req.Autoscaler != nil { + params.Add("autoscaler", fmt.Sprintf("%v", req.GetAutoscaler())) + } + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("PATCH", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Update updates an autoscaler in the specified project using the data included in the request. +func (c *autoscalersRESTClient) Update(ctx context.Context, req *computepb.UpdateAutoscalerRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetAutoscalerResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("") + + params := url.Values{} + if req != nil && req.Autoscaler != nil { + params.Add("autoscaler", fmt.Sprintf("%v", req.GetAutoscaler())) + } + if req.GetProject() != "" { + params.Add("project", fmt.Sprintf("%v", req.GetProject())) + } + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + if req.GetZone() != "" { + params.Add("zone", fmt.Sprintf("%v", req.GetZone())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("PUT", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} diff --git a/compute/apiv1/autoscalers_client_example_test.go b/compute/apiv1/autoscalers_client_example_test.go new file mode 100644 index 00000000000..48fa08ea659 --- /dev/null +++ b/compute/apiv1/autoscalers_client_example_test.go @@ -0,0 +1,169 @@ +// Copyright 2021 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_test + +import ( + "context" + + compute "cloud.google.com/go/compute/apiv1" + computepb "google.golang.org/genproto/googleapis/cloud/compute/v1" +) + +func ExampleNewAutoscalersRESTClient() { + ctx := context.Background() + c, err := compute.NewAutoscalersRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + // TODO: Use client. + _ = c +} + +func ExampleAutoscalersClient_AggregatedList() { + ctx := context.Background() + c, err := compute.NewAutoscalersRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.AggregatedListAutoscalersRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.AggregatedList(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleAutoscalersClient_Delete() { + ctx := context.Background() + c, err := compute.NewAutoscalersRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.DeleteAutoscalerRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Delete(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleAutoscalersClient_Get() { + ctx := context.Background() + c, err := compute.NewAutoscalersRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.GetAutoscalerRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Get(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleAutoscalersClient_Insert() { + ctx := context.Background() + c, err := compute.NewAutoscalersRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.InsertAutoscalerRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Insert(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleAutoscalersClient_List() { + ctx := context.Background() + c, err := compute.NewAutoscalersRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.ListAutoscalersRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.List(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleAutoscalersClient_Patch() { + ctx := context.Background() + c, err := compute.NewAutoscalersRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.PatchAutoscalerRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Patch(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleAutoscalersClient_Update() { + ctx := context.Background() + c, err := compute.NewAutoscalersRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.UpdateAutoscalerRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Update(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} diff --git a/compute/apiv1/backend_buckets_client.go b/compute/apiv1/backend_buckets_client.go new file mode 100644 index 00000000000..89286c9d461 --- /dev/null +++ b/compute/apiv1/backend_buckets_client.go @@ -0,0 +1,620 @@ +// Copyright 2021 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/ioutil" + "net/http" + "net/url" + + gax "github.com/googleapis/gax-go/v2" + "google.golang.org/api/option" + "google.golang.org/api/option/internaloption" + httptransport "google.golang.org/api/transport/http" + computepb "google.golang.org/genproto/googleapis/cloud/compute/v1" + "google.golang.org/grpc" + "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/encoding/protojson" +) + +var newBackendBucketsClientHook clientHook + +// BackendBucketsCallOptions contains the retry settings for each method of BackendBucketsClient. +type BackendBucketsCallOptions struct { + AddSignedUrlKey []gax.CallOption + Delete []gax.CallOption + DeleteSignedUrlKey []gax.CallOption + Get []gax.CallOption + Insert []gax.CallOption + List []gax.CallOption + Patch []gax.CallOption + Update []gax.CallOption +} + +// internalBackendBucketsClient is an interface that defines the methods availaible from Google Compute Engine API. +type internalBackendBucketsClient interface { + Close() error + setGoogleClientInfo(...string) + Connection() *grpc.ClientConn + AddSignedUrlKey(context.Context, *computepb.AddSignedUrlKeyBackendBucketRequest, ...gax.CallOption) (*computepb.Operation, error) + Delete(context.Context, *computepb.DeleteBackendBucketRequest, ...gax.CallOption) (*computepb.Operation, error) + DeleteSignedUrlKey(context.Context, *computepb.DeleteSignedUrlKeyBackendBucketRequest, ...gax.CallOption) (*computepb.Operation, error) + Get(context.Context, *computepb.GetBackendBucketRequest, ...gax.CallOption) (*computepb.BackendBucket, error) + Insert(context.Context, *computepb.InsertBackendBucketRequest, ...gax.CallOption) (*computepb.Operation, error) + List(context.Context, *computepb.ListBackendBucketsRequest, ...gax.CallOption) (*computepb.BackendBucketList, error) + Patch(context.Context, *computepb.PatchBackendBucketRequest, ...gax.CallOption) (*computepb.Operation, error) + Update(context.Context, *computepb.UpdateBackendBucketRequest, ...gax.CallOption) (*computepb.Operation, error) +} + +// BackendBucketsClient 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 BackendBuckets API. +type BackendBucketsClient struct { + // The internal transport-dependent client. + internalClient internalBackendBucketsClient + + // The call options for this service. + CallOptions *BackendBucketsCallOptions +} + +// 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 *BackendBucketsClient) 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 *BackendBucketsClient) setGoogleClientInfo(keyval ...string) { + c.internalClient.setGoogleClientInfo(keyval...) +} + +// Connection returns a connection to the API service. +// +// Deprecated. +func (c *BackendBucketsClient) Connection() *grpc.ClientConn { + return c.internalClient.Connection() +} + +// AddSignedUrlKey adds a key for validating requests with signed URLs for this backend bucket. +func (c *BackendBucketsClient) AddSignedUrlKey(ctx context.Context, req *computepb.AddSignedUrlKeyBackendBucketRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.AddSignedUrlKey(ctx, req, opts...) +} + +// Delete deletes the specified BackendBucket resource. +func (c *BackendBucketsClient) Delete(ctx context.Context, req *computepb.DeleteBackendBucketRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.Delete(ctx, req, opts...) +} + +// DeleteSignedUrlKey deletes a key for validating requests with signed URLs for this backend bucket. +func (c *BackendBucketsClient) DeleteSignedUrlKey(ctx context.Context, req *computepb.DeleteSignedUrlKeyBackendBucketRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.DeleteSignedUrlKey(ctx, req, opts...) +} + +// Get returns the specified BackendBucket resource. Gets a list of available backend buckets by making a list() request. +func (c *BackendBucketsClient) Get(ctx context.Context, req *computepb.GetBackendBucketRequest, opts ...gax.CallOption) (*computepb.BackendBucket, error) { + return c.internalClient.Get(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) (*computepb.Operation, error) { + return c.internalClient.Insert(ctx, req, opts...) +} + +// List retrieves the list of BackendBucket resources available to the specified project. +func (c *BackendBucketsClient) List(ctx context.Context, req *computepb.ListBackendBucketsRequest, opts ...gax.CallOption) (*computepb.BackendBucketList, error) { + return c.internalClient.List(ctx, req, opts...) +} + +// Patch updates the specified BackendBucket resource with the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. +func (c *BackendBucketsClient) Patch(ctx context.Context, req *computepb.PatchBackendBucketRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.Patch(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) (*computepb.Operation, error) { + return c.internalClient.Update(ctx, req, opts...) +} + +// Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls. +type backendBucketsRESTClient struct { + // The http endpoint to connect to. + endpoint string + + // The http client. + httpClient *http.Client + + // The x-goog-* metadata to be sent with each request. + xGoogMetadata metadata.MD +} + +// NewBackendBucketsRESTClient creates a new backend buckets rest client. +// +// The BackendBuckets API. +func NewBackendBucketsRESTClient(ctx context.Context, opts ...option.ClientOption) (*BackendBucketsClient, error) { + clientOpts := append(defaultBackendBucketsRESTClientOptions(), opts...) + httpClient, endpoint, err := httptransport.NewClient(ctx, clientOpts...) + if err != nil { + return nil, err + } + + c := &backendBucketsRESTClient{ + endpoint: endpoint, + httpClient: httpClient, + } + c.setGoogleClientInfo() + + return &BackendBucketsClient{internalClient: c, CallOptions: &BackendBucketsCallOptions{}}, nil +} + +func defaultBackendBucketsRESTClientOptions() []option.ClientOption { + return []option.ClientOption{ + internaloption.WithDefaultEndpoint("compute.googleapis.com"), + internaloption.WithDefaultMTLSEndpoint("compute.mtls.googleapis.com"), + internaloption.WithDefaultAudience("https://compute.googleapis.com/"), + internaloption.WithDefaultScopes(DefaultAuthScopes()...), + } +} + +// setGoogleClientInfo sets the name and version of the application in +// the `x-goog-api-client` header passed on each request. Intended for +// use by Google-written clients. +func (c *backendBucketsRESTClient) setGoogleClientInfo(keyval ...string) { + kv := append([]string{"gl-go", versionGo()}, keyval...) + kv = append(kv, "gapic", versionClient, "gax", gax.Version, "rest", "UNKNOWN") + c.xGoogMetadata = metadata.Pairs("x-goog-api-client", gax.XGoogHeader(kv...)) +} + +// Close closes the connection to the API service. The user should invoke this when +// the client is no longer required. +func (c *backendBucketsRESTClient) Close() error { + // Replace httpClient with nil to force cleanup. + c.httpClient = nil + return nil +} + +// Connection returns a connection to the API service. +// +// Deprecated. +func (c *backendBucketsRESTClient) Connection() *grpc.ClientConn { + return nil +} + +// AddSignedUrlKey adds a key for validating requests with signed URLs for this backend bucket. +func (c *backendBucketsRESTClient) AddSignedUrlKey(ctx context.Context, req *computepb.AddSignedUrlKeyBackendBucketRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetSignedUrlKeyResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/global/backendBuckets/%v/addSignedUrlKey", req.GetProject(), req.GetBackendBucket()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Delete deletes the specified BackendBucket resource. +func (c *backendBucketsRESTClient) Delete(ctx context.Context, req *computepb.DeleteBackendBucketRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/global/backendBuckets/%v", req.GetProject(), req.GetBackendBucket()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("DELETE", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// DeleteSignedUrlKey deletes a key for validating requests with signed URLs for this backend bucket. +func (c *backendBucketsRESTClient) DeleteSignedUrlKey(ctx context.Context, req *computepb.DeleteSignedUrlKeyBackendBucketRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/global/backendBuckets/%v/deleteSignedUrlKey", req.GetProject(), req.GetBackendBucket()) + + params := url.Values{} + if req.GetKeyName() != "" { + params.Add("keyName", fmt.Sprintf("%v", req.GetKeyName())) + } + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Get returns the specified BackendBucket resource. Gets a list of available backend buckets by making a list() request. +func (c *backendBucketsRESTClient) Get(ctx context.Context, req *computepb.GetBackendBucketRequest, opts ...gax.CallOption) (*computepb.BackendBucket, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/global/backendBuckets/%v", req.GetProject(), req.GetBackendBucket()) + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.BackendBucket{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// 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) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetBackendBucketResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/global/backendBuckets", req.GetProject()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// List retrieves the list of BackendBucket resources available to the specified project. +func (c *backendBucketsRESTClient) List(ctx context.Context, req *computepb.ListBackendBucketsRequest, opts ...gax.CallOption) (*computepb.BackendBucketList, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/global/backendBuckets", 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() + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.BackendBucketList{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Patch updates the specified BackendBucket resource with the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. +func (c *backendBucketsRESTClient) Patch(ctx context.Context, req *computepb.PatchBackendBucketRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetBackendBucketResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/global/backendBuckets/%v", req.GetProject(), req.GetBackendBucket()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("PATCH", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// 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) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetBackendBucketResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("") + + params := url.Values{} + if req.GetBackendBucket() != "" { + params.Add("backendBucket", fmt.Sprintf("%v", req.GetBackendBucket())) + } + if req.GetProject() != "" { + params.Add("project", fmt.Sprintf("%v", req.GetProject())) + } + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("PUT", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} diff --git a/compute/apiv1/backend_buckets_client_example_test.go b/compute/apiv1/backend_buckets_client_example_test.go new file mode 100644 index 00000000000..1a7f3526506 --- /dev/null +++ b/compute/apiv1/backend_buckets_client_example_test.go @@ -0,0 +1,188 @@ +// Copyright 2021 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_test + +import ( + "context" + + compute "cloud.google.com/go/compute/apiv1" + computepb "google.golang.org/genproto/googleapis/cloud/compute/v1" +) + +func ExampleNewBackendBucketsRESTClient() { + ctx := context.Background() + c, err := compute.NewBackendBucketsRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + // TODO: Use client. + _ = c +} + +func ExampleBackendBucketsClient_AddSignedUrlKey() { + ctx := context.Background() + c, err := compute.NewBackendBucketsRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.AddSignedUrlKeyBackendBucketRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.AddSignedUrlKey(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleBackendBucketsClient_Delete() { + ctx := context.Background() + c, err := compute.NewBackendBucketsRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.DeleteBackendBucketRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Delete(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleBackendBucketsClient_DeleteSignedUrlKey() { + ctx := context.Background() + c, err := compute.NewBackendBucketsRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.DeleteSignedUrlKeyBackendBucketRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.DeleteSignedUrlKey(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleBackendBucketsClient_Get() { + ctx := context.Background() + c, err := compute.NewBackendBucketsRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.GetBackendBucketRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Get(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleBackendBucketsClient_Insert() { + ctx := context.Background() + c, err := compute.NewBackendBucketsRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.InsertBackendBucketRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Insert(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleBackendBucketsClient_List() { + ctx := context.Background() + c, err := compute.NewBackendBucketsRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.ListBackendBucketsRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.List(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleBackendBucketsClient_Patch() { + ctx := context.Background() + c, err := compute.NewBackendBucketsRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.PatchBackendBucketRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Patch(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleBackendBucketsClient_Update() { + ctx := context.Background() + c, err := compute.NewBackendBucketsRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.UpdateBackendBucketRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Update(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} diff --git a/compute/apiv1/backend_services_client.go b/compute/apiv1/backend_services_client.go new file mode 100644 index 00000000000..b6dc5e585b4 --- /dev/null +++ b/compute/apiv1/backend_services_client.go @@ -0,0 +1,809 @@ +// Copyright 2021 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/ioutil" + "net/http" + "net/url" + + gax "github.com/googleapis/gax-go/v2" + "google.golang.org/api/option" + "google.golang.org/api/option/internaloption" + httptransport "google.golang.org/api/transport/http" + computepb "google.golang.org/genproto/googleapis/cloud/compute/v1" + "google.golang.org/grpc" + "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/encoding/protojson" +) + +var newBackendServicesClientHook clientHook + +// BackendServicesCallOptions contains the retry settings for each method of BackendServicesClient. +type BackendServicesCallOptions struct { + AddSignedUrlKey []gax.CallOption + AggregatedList []gax.CallOption + Delete []gax.CallOption + DeleteSignedUrlKey []gax.CallOption + Get []gax.CallOption + GetHealth []gax.CallOption + Insert []gax.CallOption + List []gax.CallOption + Patch []gax.CallOption + SetSecurityPolicy []gax.CallOption + Update []gax.CallOption +} + +// internalBackendServicesClient is an interface that defines the methods availaible from Google Compute Engine API. +type internalBackendServicesClient interface { + Close() error + setGoogleClientInfo(...string) + Connection() *grpc.ClientConn + AddSignedUrlKey(context.Context, *computepb.AddSignedUrlKeyBackendServiceRequest, ...gax.CallOption) (*computepb.Operation, error) + AggregatedList(context.Context, *computepb.AggregatedListBackendServicesRequest, ...gax.CallOption) (*computepb.BackendServiceAggregatedList, error) + Delete(context.Context, *computepb.DeleteBackendServiceRequest, ...gax.CallOption) (*computepb.Operation, error) + DeleteSignedUrlKey(context.Context, *computepb.DeleteSignedUrlKeyBackendServiceRequest, ...gax.CallOption) (*computepb.Operation, error) + Get(context.Context, *computepb.GetBackendServiceRequest, ...gax.CallOption) (*computepb.BackendService, error) + GetHealth(context.Context, *computepb.GetHealthBackendServiceRequest, ...gax.CallOption) (*computepb.BackendServiceGroupHealth, error) + Insert(context.Context, *computepb.InsertBackendServiceRequest, ...gax.CallOption) (*computepb.Operation, error) + List(context.Context, *computepb.ListBackendServicesRequest, ...gax.CallOption) (*computepb.BackendServiceList, error) + Patch(context.Context, *computepb.PatchBackendServiceRequest, ...gax.CallOption) (*computepb.Operation, error) + SetSecurityPolicy(context.Context, *computepb.SetSecurityPolicyBackendServiceRequest, ...gax.CallOption) (*computepb.Operation, error) + Update(context.Context, *computepb.UpdateBackendServiceRequest, ...gax.CallOption) (*computepb.Operation, error) +} + +// BackendServicesClient 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 BackendServices API. +type BackendServicesClient struct { + // The internal transport-dependent client. + internalClient internalBackendServicesClient + + // The call options for this service. + CallOptions *BackendServicesCallOptions +} + +// 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 *BackendServicesClient) 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 *BackendServicesClient) setGoogleClientInfo(keyval ...string) { + c.internalClient.setGoogleClientInfo(keyval...) +} + +// Connection returns a connection to the API service. +// +// Deprecated. +func (c *BackendServicesClient) Connection() *grpc.ClientConn { + return c.internalClient.Connection() +} + +// AddSignedUrlKey adds a key for validating requests with signed URLs for this backend service. +func (c *BackendServicesClient) AddSignedUrlKey(ctx context.Context, req *computepb.AddSignedUrlKeyBackendServiceRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.AddSignedUrlKey(ctx, req, opts...) +} + +// AggregatedList retrieves the list of all BackendService resources, regional and global, available to the specified project. +func (c *BackendServicesClient) AggregatedList(ctx context.Context, req *computepb.AggregatedListBackendServicesRequest, opts ...gax.CallOption) (*computepb.BackendServiceAggregatedList, error) { + return c.internalClient.AggregatedList(ctx, req, opts...) +} + +// Delete deletes the specified BackendService resource. +func (c *BackendServicesClient) Delete(ctx context.Context, req *computepb.DeleteBackendServiceRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.Delete(ctx, req, opts...) +} + +// DeleteSignedUrlKey deletes a key for validating requests with signed URLs for this backend service. +func (c *BackendServicesClient) DeleteSignedUrlKey(ctx context.Context, req *computepb.DeleteSignedUrlKeyBackendServiceRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.DeleteSignedUrlKey(ctx, req, opts...) +} + +// Get returns the specified BackendService resource. Gets a list of available backend services. +func (c *BackendServicesClient) Get(ctx context.Context, req *computepb.GetBackendServiceRequest, opts ...gax.CallOption) (*computepb.BackendService, error) { + return c.internalClient.Get(ctx, req, opts...) +} + +// GetHealth gets the most recent health check results for this BackendService. +// +// Example request body: +// +// { “group”: “/zones/us-east1-b/instanceGroups/lb-backend-example” } +func (c *BackendServicesClient) GetHealth(ctx context.Context, req *computepb.GetHealthBackendServiceRequest, opts ...gax.CallOption) (*computepb.BackendServiceGroupHealth, error) { + return c.internalClient.GetHealth(ctx, req, opts...) +} + +// Insert creates a BackendService resource in the specified project using the data included in the request. For more information, see Backend services overview. +func (c *BackendServicesClient) Insert(ctx context.Context, req *computepb.InsertBackendServiceRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.Insert(ctx, req, opts...) +} + +// List retrieves the list of BackendService resources available to the specified project. +func (c *BackendServicesClient) List(ctx context.Context, req *computepb.ListBackendServicesRequest, opts ...gax.CallOption) (*computepb.BackendServiceList, error) { + return c.internalClient.List(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) (*computepb.Operation, error) { + return c.internalClient.Patch(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 *BackendServicesClient) SetSecurityPolicy(ctx context.Context, req *computepb.SetSecurityPolicyBackendServiceRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.SetSecurityPolicy(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) (*computepb.Operation, error) { + return c.internalClient.Update(ctx, req, opts...) +} + +// Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls. +type backendServicesRESTClient struct { + // The http endpoint to connect to. + endpoint string + + // The http client. + httpClient *http.Client + + // The x-goog-* metadata to be sent with each request. + xGoogMetadata metadata.MD +} + +// NewBackendServicesRESTClient creates a new backend services rest client. +// +// The BackendServices API. +func NewBackendServicesRESTClient(ctx context.Context, opts ...option.ClientOption) (*BackendServicesClient, error) { + clientOpts := append(defaultBackendServicesRESTClientOptions(), opts...) + httpClient, endpoint, err := httptransport.NewClient(ctx, clientOpts...) + if err != nil { + return nil, err + } + + c := &backendServicesRESTClient{ + endpoint: endpoint, + httpClient: httpClient, + } + c.setGoogleClientInfo() + + return &BackendServicesClient{internalClient: c, CallOptions: &BackendServicesCallOptions{}}, nil +} + +func defaultBackendServicesRESTClientOptions() []option.ClientOption { + return []option.ClientOption{ + internaloption.WithDefaultEndpoint("compute.googleapis.com"), + internaloption.WithDefaultMTLSEndpoint("compute.mtls.googleapis.com"), + internaloption.WithDefaultAudience("https://compute.googleapis.com/"), + internaloption.WithDefaultScopes(DefaultAuthScopes()...), + } +} + +// setGoogleClientInfo sets the name and version of the application in +// the `x-goog-api-client` header passed on each request. Intended for +// use by Google-written clients. +func (c *backendServicesRESTClient) setGoogleClientInfo(keyval ...string) { + kv := append([]string{"gl-go", versionGo()}, keyval...) + kv = append(kv, "gapic", versionClient, "gax", gax.Version, "rest", "UNKNOWN") + c.xGoogMetadata = metadata.Pairs("x-goog-api-client", gax.XGoogHeader(kv...)) +} + +// Close closes the connection to the API service. The user should invoke this when +// the client is no longer required. +func (c *backendServicesRESTClient) Close() error { + // Replace httpClient with nil to force cleanup. + c.httpClient = nil + return nil +} + +// Connection returns a connection to the API service. +// +// Deprecated. +func (c *backendServicesRESTClient) Connection() *grpc.ClientConn { + return nil +} + +// AddSignedUrlKey adds a key for validating requests with signed URLs for this backend service. +func (c *backendServicesRESTClient) AddSignedUrlKey(ctx context.Context, req *computepb.AddSignedUrlKeyBackendServiceRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetSignedUrlKeyResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/global/backendServices/%v/addSignedUrlKey", req.GetProject(), req.GetBackendService()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// AggregatedList retrieves the list of all BackendService resources, regional and global, available to the specified project. +func (c *backendServicesRESTClient) AggregatedList(ctx context.Context, req *computepb.AggregatedListBackendServicesRequest, opts ...gax.CallOption) (*computepb.BackendServiceAggregatedList, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/aggregated/backendServices", req.GetProject()) + + params := url.Values{} + if req != nil && req.Filter != nil { + params.Add("filter", fmt.Sprintf("%v", req.GetFilter())) + } + if req != nil && req.IncludeAllScopes != nil { + params.Add("includeAllScopes", fmt.Sprintf("%v", req.GetIncludeAllScopes())) + } + 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() + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.BackendServiceAggregatedList{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Delete deletes the specified BackendService resource. +func (c *backendServicesRESTClient) Delete(ctx context.Context, req *computepb.DeleteBackendServiceRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/global/backendServices/%v", req.GetProject(), req.GetBackendService()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("DELETE", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// DeleteSignedUrlKey deletes a key for validating requests with signed URLs for this backend service. +func (c *backendServicesRESTClient) DeleteSignedUrlKey(ctx context.Context, req *computepb.DeleteSignedUrlKeyBackendServiceRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/global/backendServices/%v/deleteSignedUrlKey", req.GetProject(), req.GetBackendService()) + + params := url.Values{} + if req.GetKeyName() != "" { + params.Add("keyName", fmt.Sprintf("%v", req.GetKeyName())) + } + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Get returns the specified BackendService resource. Gets a list of available backend services. +func (c *backendServicesRESTClient) Get(ctx context.Context, req *computepb.GetBackendServiceRequest, opts ...gax.CallOption) (*computepb.BackendService, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/global/backendServices/%v", req.GetProject(), req.GetBackendService()) + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.BackendService{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// GetHealth gets the most recent health check results for this BackendService. +// +// Example request body: +// +// { “group”: “/zones/us-east1-b/instanceGroups/lb-backend-example” } +func (c *backendServicesRESTClient) GetHealth(ctx context.Context, req *computepb.GetHealthBackendServiceRequest, opts ...gax.CallOption) (*computepb.BackendServiceGroupHealth, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetResourceGroupReferenceResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/global/backendServices/%v/getHealth", req.GetProject(), req.GetBackendService()) + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.BackendServiceGroupHealth{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Insert creates a BackendService resource in the specified project using the data included in the request. For more information, see Backend services overview. +func (c *backendServicesRESTClient) Insert(ctx context.Context, req *computepb.InsertBackendServiceRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetBackendServiceResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/global/backendServices", req.GetProject()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// List retrieves the list of BackendService resources available to the specified project. +func (c *backendServicesRESTClient) List(ctx context.Context, req *computepb.ListBackendServicesRequest, opts ...gax.CallOption) (*computepb.BackendServiceList, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/global/backendServices", 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() + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.BackendServiceList{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// 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) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetBackendServiceResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/global/backendServices/%v", req.GetProject(), req.GetBackendService()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("PATCH", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// SetSecurityPolicy sets the Google Cloud Armor security policy for the specified backend service. For more information, see Google Cloud Armor Overview +func (c *backendServicesRESTClient) SetSecurityPolicy(ctx context.Context, req *computepb.SetSecurityPolicyBackendServiceRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetSecurityPolicyReferenceResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/global/backendServices/%v/setSecurityPolicy", req.GetProject(), req.GetBackendService()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// 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) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetBackendServiceResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("") + + params := url.Values{} + if req.GetBackendService() != "" { + params.Add("backendService", fmt.Sprintf("%v", req.GetBackendService())) + } + if req.GetProject() != "" { + params.Add("project", fmt.Sprintf("%v", req.GetProject())) + } + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("PUT", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} diff --git a/compute/apiv1/backend_services_client_example_test.go b/compute/apiv1/backend_services_client_example_test.go new file mode 100644 index 00000000000..6bdbd1e68e1 --- /dev/null +++ b/compute/apiv1/backend_services_client_example_test.go @@ -0,0 +1,245 @@ +// Copyright 2021 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_test + +import ( + "context" + + compute "cloud.google.com/go/compute/apiv1" + computepb "google.golang.org/genproto/googleapis/cloud/compute/v1" +) + +func ExampleNewBackendServicesRESTClient() { + ctx := context.Background() + c, err := compute.NewBackendServicesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + // TODO: Use client. + _ = c +} + +func ExampleBackendServicesClient_AddSignedUrlKey() { + ctx := context.Background() + c, err := compute.NewBackendServicesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.AddSignedUrlKeyBackendServiceRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.AddSignedUrlKey(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleBackendServicesClient_AggregatedList() { + ctx := context.Background() + c, err := compute.NewBackendServicesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.AggregatedListBackendServicesRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.AggregatedList(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleBackendServicesClient_Delete() { + ctx := context.Background() + c, err := compute.NewBackendServicesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.DeleteBackendServiceRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Delete(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleBackendServicesClient_DeleteSignedUrlKey() { + ctx := context.Background() + c, err := compute.NewBackendServicesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.DeleteSignedUrlKeyBackendServiceRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.DeleteSignedUrlKey(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleBackendServicesClient_Get() { + ctx := context.Background() + c, err := compute.NewBackendServicesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.GetBackendServiceRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Get(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleBackendServicesClient_GetHealth() { + ctx := context.Background() + c, err := compute.NewBackendServicesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.GetHealthBackendServiceRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.GetHealth(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleBackendServicesClient_Insert() { + ctx := context.Background() + c, err := compute.NewBackendServicesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.InsertBackendServiceRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Insert(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleBackendServicesClient_List() { + ctx := context.Background() + c, err := compute.NewBackendServicesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.ListBackendServicesRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.List(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleBackendServicesClient_Patch() { + ctx := context.Background() + c, err := compute.NewBackendServicesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.PatchBackendServiceRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Patch(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleBackendServicesClient_SetSecurityPolicy() { + ctx := context.Background() + c, err := compute.NewBackendServicesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.SetSecurityPolicyBackendServiceRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.SetSecurityPolicy(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleBackendServicesClient_Update() { + ctx := context.Background() + c, err := compute.NewBackendServicesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.UpdateBackendServiceRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Update(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} diff --git a/compute/apiv1/disk_types_client.go b/compute/apiv1/disk_types_client.go new file mode 100644 index 00000000000..aeb5487e614 --- /dev/null +++ b/compute/apiv1/disk_types_client.go @@ -0,0 +1,337 @@ +// Copyright 2021 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/ioutil" + "net/http" + "net/url" + + gax "github.com/googleapis/gax-go/v2" + "google.golang.org/api/option" + "google.golang.org/api/option/internaloption" + httptransport "google.golang.org/api/transport/http" + computepb "google.golang.org/genproto/googleapis/cloud/compute/v1" + "google.golang.org/grpc" + "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/encoding/protojson" +) + +var newDiskTypesClientHook clientHook + +// DiskTypesCallOptions contains the retry settings for each method of DiskTypesClient. +type DiskTypesCallOptions struct { + AggregatedList []gax.CallOption + Get []gax.CallOption + List []gax.CallOption +} + +// internalDiskTypesClient is an interface that defines the methods availaible from Google Compute Engine API. +type internalDiskTypesClient interface { + Close() error + setGoogleClientInfo(...string) + Connection() *grpc.ClientConn + AggregatedList(context.Context, *computepb.AggregatedListDiskTypesRequest, ...gax.CallOption) (*computepb.DiskTypeAggregatedList, error) + Get(context.Context, *computepb.GetDiskTypeRequest, ...gax.CallOption) (*computepb.DiskType, error) + List(context.Context, *computepb.ListDiskTypesRequest, ...gax.CallOption) (*computepb.DiskTypeList, error) +} + +// DiskTypesClient 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 DiskTypes API. +type DiskTypesClient struct { + // The internal transport-dependent client. + internalClient internalDiskTypesClient + + // The call options for this service. + CallOptions *DiskTypesCallOptions +} + +// 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 *DiskTypesClient) 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 *DiskTypesClient) setGoogleClientInfo(keyval ...string) { + c.internalClient.setGoogleClientInfo(keyval...) +} + +// Connection returns a connection to the API service. +// +// Deprecated. +func (c *DiskTypesClient) Connection() *grpc.ClientConn { + return c.internalClient.Connection() +} + +// AggregatedList retrieves an aggregated list of disk types. +func (c *DiskTypesClient) AggregatedList(ctx context.Context, req *computepb.AggregatedListDiskTypesRequest, opts ...gax.CallOption) (*computepb.DiskTypeAggregatedList, error) { + return c.internalClient.AggregatedList(ctx, req, opts...) +} + +// Get returns the specified disk type. Gets a list of available disk types by making a list() request. +func (c *DiskTypesClient) Get(ctx context.Context, req *computepb.GetDiskTypeRequest, opts ...gax.CallOption) (*computepb.DiskType, error) { + return c.internalClient.Get(ctx, req, opts...) +} + +// List retrieves a list of disk types available to the specified project. +func (c *DiskTypesClient) List(ctx context.Context, req *computepb.ListDiskTypesRequest, opts ...gax.CallOption) (*computepb.DiskTypeList, error) { + return c.internalClient.List(ctx, req, opts...) +} + +// Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls. +type diskTypesRESTClient struct { + // The http endpoint to connect to. + endpoint string + + // The http client. + httpClient *http.Client + + // The x-goog-* metadata to be sent with each request. + xGoogMetadata metadata.MD +} + +// NewDiskTypesRESTClient creates a new disk types rest client. +// +// The DiskTypes API. +func NewDiskTypesRESTClient(ctx context.Context, opts ...option.ClientOption) (*DiskTypesClient, error) { + clientOpts := append(defaultDiskTypesRESTClientOptions(), opts...) + httpClient, endpoint, err := httptransport.NewClient(ctx, clientOpts...) + if err != nil { + return nil, err + } + + c := &diskTypesRESTClient{ + endpoint: endpoint, + httpClient: httpClient, + } + c.setGoogleClientInfo() + + return &DiskTypesClient{internalClient: c, CallOptions: &DiskTypesCallOptions{}}, nil +} + +func defaultDiskTypesRESTClientOptions() []option.ClientOption { + return []option.ClientOption{ + internaloption.WithDefaultEndpoint("compute.googleapis.com"), + internaloption.WithDefaultMTLSEndpoint("compute.mtls.googleapis.com"), + internaloption.WithDefaultAudience("https://compute.googleapis.com/"), + internaloption.WithDefaultScopes(DefaultAuthScopes()...), + } +} + +// setGoogleClientInfo sets the name and version of the application in +// the `x-goog-api-client` header passed on each request. Intended for +// use by Google-written clients. +func (c *diskTypesRESTClient) setGoogleClientInfo(keyval ...string) { + kv := append([]string{"gl-go", versionGo()}, keyval...) + kv = append(kv, "gapic", versionClient, "gax", gax.Version, "rest", "UNKNOWN") + c.xGoogMetadata = metadata.Pairs("x-goog-api-client", gax.XGoogHeader(kv...)) +} + +// Close closes the connection to the API service. The user should invoke this when +// the client is no longer required. +func (c *diskTypesRESTClient) Close() error { + // Replace httpClient with nil to force cleanup. + c.httpClient = nil + return nil +} + +// Connection returns a connection to the API service. +// +// Deprecated. +func (c *diskTypesRESTClient) Connection() *grpc.ClientConn { + return nil +} + +// AggregatedList retrieves an aggregated list of disk types. +func (c *diskTypesRESTClient) AggregatedList(ctx context.Context, req *computepb.AggregatedListDiskTypesRequest, opts ...gax.CallOption) (*computepb.DiskTypeAggregatedList, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/aggregated/diskTypes", req.GetProject()) + + params := url.Values{} + if req != nil && req.Filter != nil { + params.Add("filter", fmt.Sprintf("%v", req.GetFilter())) + } + if req != nil && req.IncludeAllScopes != nil { + params.Add("includeAllScopes", fmt.Sprintf("%v", req.GetIncludeAllScopes())) + } + 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() + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.DiskTypeAggregatedList{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Get returns the specified disk type. Gets a list of available disk types by making a list() request. +func (c *diskTypesRESTClient) Get(ctx context.Context, req *computepb.GetDiskTypeRequest, opts ...gax.CallOption) (*computepb.DiskType, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/zones/%v/diskTypes/%v", req.GetProject(), req.GetZone(), req.GetDiskType()) + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.DiskType{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// List retrieves a list of disk types available to the specified project. +func (c *diskTypesRESTClient) List(ctx context.Context, req *computepb.ListDiskTypesRequest, opts ...gax.CallOption) (*computepb.DiskTypeList, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/zones/%v/diskTypes", req.GetProject(), req.GetZone()) + + 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() + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.DiskTypeList{} + + return rsp, unm.Unmarshal(buf, rsp) +} diff --git a/compute/apiv1/disk_types_client_example_test.go b/compute/apiv1/disk_types_client_example_test.go new file mode 100644 index 00000000000..db2c18bb93e --- /dev/null +++ b/compute/apiv1/disk_types_client_example_test.go @@ -0,0 +1,93 @@ +// Copyright 2021 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_test + +import ( + "context" + + compute "cloud.google.com/go/compute/apiv1" + computepb "google.golang.org/genproto/googleapis/cloud/compute/v1" +) + +func ExampleNewDiskTypesRESTClient() { + ctx := context.Background() + c, err := compute.NewDiskTypesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + // TODO: Use client. + _ = c +} + +func ExampleDiskTypesClient_AggregatedList() { + ctx := context.Background() + c, err := compute.NewDiskTypesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.AggregatedListDiskTypesRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.AggregatedList(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleDiskTypesClient_Get() { + ctx := context.Background() + c, err := compute.NewDiskTypesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.GetDiskTypeRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Get(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleDiskTypesClient_List() { + ctx := context.Background() + c, err := compute.NewDiskTypesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.ListDiskTypesRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.List(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} diff --git a/compute/apiv1/disks_client.go b/compute/apiv1/disks_client.go new file mode 100644 index 00000000000..60e3f5e44dc --- /dev/null +++ b/compute/apiv1/disks_client.go @@ -0,0 +1,907 @@ +// Copyright 2021 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/ioutil" + "net/http" + "net/url" + + gax "github.com/googleapis/gax-go/v2" + "google.golang.org/api/option" + "google.golang.org/api/option/internaloption" + httptransport "google.golang.org/api/transport/http" + computepb "google.golang.org/genproto/googleapis/cloud/compute/v1" + "google.golang.org/grpc" + "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/encoding/protojson" +) + +var newDisksClientHook clientHook + +// DisksCallOptions contains the retry settings for each method of DisksClient. +type DisksCallOptions struct { + AddResourcePolicies []gax.CallOption + AggregatedList []gax.CallOption + CreateSnapshot []gax.CallOption + Delete []gax.CallOption + Get []gax.CallOption + GetIamPolicy []gax.CallOption + Insert []gax.CallOption + List []gax.CallOption + RemoveResourcePolicies []gax.CallOption + Resize []gax.CallOption + SetIamPolicy []gax.CallOption + SetLabels []gax.CallOption + TestIamPermissions []gax.CallOption +} + +// internalDisksClient is an interface that defines the methods availaible from Google Compute Engine API. +type internalDisksClient interface { + Close() error + setGoogleClientInfo(...string) + Connection() *grpc.ClientConn + AddResourcePolicies(context.Context, *computepb.AddResourcePoliciesDiskRequest, ...gax.CallOption) (*computepb.Operation, error) + AggregatedList(context.Context, *computepb.AggregatedListDisksRequest, ...gax.CallOption) (*computepb.DiskAggregatedList, error) + CreateSnapshot(context.Context, *computepb.CreateSnapshotDiskRequest, ...gax.CallOption) (*computepb.Operation, error) + Delete(context.Context, *computepb.DeleteDiskRequest, ...gax.CallOption) (*computepb.Operation, error) + Get(context.Context, *computepb.GetDiskRequest, ...gax.CallOption) (*computepb.Disk, error) + GetIamPolicy(context.Context, *computepb.GetIamPolicyDiskRequest, ...gax.CallOption) (*computepb.Policy, error) + Insert(context.Context, *computepb.InsertDiskRequest, ...gax.CallOption) (*computepb.Operation, error) + List(context.Context, *computepb.ListDisksRequest, ...gax.CallOption) (*computepb.DiskList, error) + RemoveResourcePolicies(context.Context, *computepb.RemoveResourcePoliciesDiskRequest, ...gax.CallOption) (*computepb.Operation, error) + Resize(context.Context, *computepb.ResizeDiskRequest, ...gax.CallOption) (*computepb.Operation, error) + SetIamPolicy(context.Context, *computepb.SetIamPolicyDiskRequest, ...gax.CallOption) (*computepb.Policy, error) + SetLabels(context.Context, *computepb.SetLabelsDiskRequest, ...gax.CallOption) (*computepb.Operation, error) + TestIamPermissions(context.Context, *computepb.TestIamPermissionsDiskRequest, ...gax.CallOption) (*computepb.TestPermissionsResponse, error) +} + +// DisksClient 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 Disks API. +type DisksClient struct { + // The internal transport-dependent client. + internalClient internalDisksClient + + // The call options for this service. + CallOptions *DisksCallOptions +} + +// 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 *DisksClient) 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 *DisksClient) setGoogleClientInfo(keyval ...string) { + c.internalClient.setGoogleClientInfo(keyval...) +} + +// Connection returns a connection to the API service. +// +// Deprecated. +func (c *DisksClient) Connection() *grpc.ClientConn { + return c.internalClient.Connection() +} + +// AddResourcePolicies adds existing resource policies to a disk. You can only add one policy which will be applied to this disk for scheduling snapshot creation. +func (c *DisksClient) AddResourcePolicies(ctx context.Context, req *computepb.AddResourcePoliciesDiskRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.AddResourcePolicies(ctx, req, opts...) +} + +// AggregatedList retrieves an aggregated list of persistent disks. +func (c *DisksClient) AggregatedList(ctx context.Context, req *computepb.AggregatedListDisksRequest, opts ...gax.CallOption) (*computepb.DiskAggregatedList, error) { + return c.internalClient.AggregatedList(ctx, req, opts...) +} + +// CreateSnapshot creates a snapshot of a specified persistent disk. +func (c *DisksClient) CreateSnapshot(ctx context.Context, req *computepb.CreateSnapshotDiskRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.CreateSnapshot(ctx, req, opts...) +} + +// Delete deletes the specified persistent disk. Deleting a disk removes its data permanently and is irreversible. However, deleting a disk does not delete any snapshots previously made from the disk. You must separately delete snapshots. +func (c *DisksClient) Delete(ctx context.Context, req *computepb.DeleteDiskRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.Delete(ctx, req, opts...) +} + +// Get returns a specified persistent disk. Gets a list of available persistent disks by making a list() request. +func (c *DisksClient) Get(ctx context.Context, req *computepb.GetDiskRequest, opts ...gax.CallOption) (*computepb.Disk, error) { + 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 *DisksClient) GetIamPolicy(ctx context.Context, req *computepb.GetIamPolicyDiskRequest, opts ...gax.CallOption) (*computepb.Policy, error) { + return c.internalClient.GetIamPolicy(ctx, req, opts...) +} + +// Insert creates a persistent disk in the specified project using the data in the request. You can create a disk from a source (sourceImage, sourceSnapshot, or sourceDisk) or create an empty 500 GB data disk by omitting all properties. You can also create a disk that is larger than the default size by specifying the sizeGb property. +func (c *DisksClient) Insert(ctx context.Context, req *computepb.InsertDiskRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.Insert(ctx, req, opts...) +} + +// List retrieves a list of persistent disks contained within the specified zone. +func (c *DisksClient) List(ctx context.Context, req *computepb.ListDisksRequest, opts ...gax.CallOption) (*computepb.DiskList, error) { + return c.internalClient.List(ctx, req, opts...) +} + +// RemoveResourcePolicies removes resource policies from a disk. +func (c *DisksClient) RemoveResourcePolicies(ctx context.Context, req *computepb.RemoveResourcePoliciesDiskRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.RemoveResourcePolicies(ctx, req, opts...) +} + +// Resize resizes the specified persistent disk. You can only increase the size of the disk. +func (c *DisksClient) Resize(ctx context.Context, req *computepb.ResizeDiskRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.Resize(ctx, req, opts...) +} + +// SetIamPolicy sets the access control policy on the specified resource. Replaces any existing policy. +func (c *DisksClient) SetIamPolicy(ctx context.Context, req *computepb.SetIamPolicyDiskRequest, opts ...gax.CallOption) (*computepb.Policy, error) { + return c.internalClient.SetIamPolicy(ctx, req, opts...) +} + +// SetLabels sets the labels on a disk. To learn more about labels, read the Labeling Resources documentation. +func (c *DisksClient) SetLabels(ctx context.Context, req *computepb.SetLabelsDiskRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.SetLabels(ctx, req, opts...) +} + +// TestIamPermissions returns permissions that a caller has on the specified resource. +func (c *DisksClient) TestIamPermissions(ctx context.Context, req *computepb.TestIamPermissionsDiskRequest, opts ...gax.CallOption) (*computepb.TestPermissionsResponse, error) { + return c.internalClient.TestIamPermissions(ctx, req, opts...) +} + +// Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls. +type disksRESTClient struct { + // The http endpoint to connect to. + endpoint string + + // The http client. + httpClient *http.Client + + // The x-goog-* metadata to be sent with each request. + xGoogMetadata metadata.MD +} + +// NewDisksRESTClient creates a new disks rest client. +// +// The Disks API. +func NewDisksRESTClient(ctx context.Context, opts ...option.ClientOption) (*DisksClient, error) { + clientOpts := append(defaultDisksRESTClientOptions(), opts...) + httpClient, endpoint, err := httptransport.NewClient(ctx, clientOpts...) + if err != nil { + return nil, err + } + + c := &disksRESTClient{ + endpoint: endpoint, + httpClient: httpClient, + } + c.setGoogleClientInfo() + + return &DisksClient{internalClient: c, CallOptions: &DisksCallOptions{}}, nil +} + +func defaultDisksRESTClientOptions() []option.ClientOption { + return []option.ClientOption{ + internaloption.WithDefaultEndpoint("compute.googleapis.com"), + internaloption.WithDefaultMTLSEndpoint("compute.mtls.googleapis.com"), + internaloption.WithDefaultAudience("https://compute.googleapis.com/"), + internaloption.WithDefaultScopes(DefaultAuthScopes()...), + } +} + +// setGoogleClientInfo sets the name and version of the application in +// the `x-goog-api-client` header passed on each request. Intended for +// use by Google-written clients. +func (c *disksRESTClient) setGoogleClientInfo(keyval ...string) { + kv := append([]string{"gl-go", versionGo()}, keyval...) + kv = append(kv, "gapic", versionClient, "gax", gax.Version, "rest", "UNKNOWN") + c.xGoogMetadata = metadata.Pairs("x-goog-api-client", gax.XGoogHeader(kv...)) +} + +// Close closes the connection to the API service. The user should invoke this when +// the client is no longer required. +func (c *disksRESTClient) Close() error { + // Replace httpClient with nil to force cleanup. + c.httpClient = nil + return nil +} + +// Connection returns a connection to the API service. +// +// Deprecated. +func (c *disksRESTClient) Connection() *grpc.ClientConn { + return nil +} + +// AddResourcePolicies adds existing resource policies to a disk. You can only add one policy which will be applied to this disk for scheduling snapshot creation. +func (c *disksRESTClient) AddResourcePolicies(ctx context.Context, req *computepb.AddResourcePoliciesDiskRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetDisksAddResourcePoliciesRequestResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/zones/%v/disks/%v/addResourcePolicies", req.GetProject(), req.GetZone(), req.GetDisk()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// AggregatedList retrieves an aggregated list of persistent disks. +func (c *disksRESTClient) AggregatedList(ctx context.Context, req *computepb.AggregatedListDisksRequest, opts ...gax.CallOption) (*computepb.DiskAggregatedList, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/aggregated/disks", req.GetProject()) + + params := url.Values{} + if req != nil && req.Filter != nil { + params.Add("filter", fmt.Sprintf("%v", req.GetFilter())) + } + if req != nil && req.IncludeAllScopes != nil { + params.Add("includeAllScopes", fmt.Sprintf("%v", req.GetIncludeAllScopes())) + } + 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() + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.DiskAggregatedList{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// CreateSnapshot creates a snapshot of a specified persistent disk. +func (c *disksRESTClient) CreateSnapshot(ctx context.Context, req *computepb.CreateSnapshotDiskRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetSnapshotResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/zones/%v/disks/%v/createSnapshot", req.GetProject(), req.GetZone(), req.GetDisk()) + + params := url.Values{} + if req != nil && req.GuestFlush != nil { + params.Add("guestFlush", fmt.Sprintf("%v", req.GetGuestFlush())) + } + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Delete deletes the specified persistent disk. Deleting a disk removes its data permanently and is irreversible. However, deleting a disk does not delete any snapshots previously made from the disk. You must separately delete snapshots. +func (c *disksRESTClient) Delete(ctx context.Context, req *computepb.DeleteDiskRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/zones/%v/disks/%v", req.GetProject(), req.GetZone(), req.GetDisk()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("DELETE", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Get returns a specified persistent disk. Gets a list of available persistent disks by making a list() request. +func (c *disksRESTClient) Get(ctx context.Context, req *computepb.GetDiskRequest, opts ...gax.CallOption) (*computepb.Disk, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/zones/%v/disks/%v", req.GetProject(), req.GetZone(), req.GetDisk()) + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Disk{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// GetIamPolicy gets the access control policy for a resource. May be empty if no such policy or resource exists. +func (c *disksRESTClient) GetIamPolicy(ctx context.Context, req *computepb.GetIamPolicyDiskRequest, opts ...gax.CallOption) (*computepb.Policy, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/zones/%v/disks/%v/getIamPolicy", req.GetProject(), req.GetZone(), req.GetResource()) + + params := url.Values{} + if req != nil && req.OptionsRequestedPolicyVersion != nil { + params.Add("optionsRequestedPolicyVersion", fmt.Sprintf("%v", req.GetOptionsRequestedPolicyVersion())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Policy{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Insert creates a persistent disk in the specified project using the data in the request. You can create a disk from a source (sourceImage, sourceSnapshot, or sourceDisk) or create an empty 500 GB data disk by omitting all properties. You can also create a disk that is larger than the default size by specifying the sizeGb property. +func (c *disksRESTClient) Insert(ctx context.Context, req *computepb.InsertDiskRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetDiskResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/zones/%v/disks", req.GetProject(), req.GetZone()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + if req != nil && req.SourceImage != nil { + params.Add("sourceImage", fmt.Sprintf("%v", req.GetSourceImage())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// List retrieves a list of persistent disks contained within the specified zone. +func (c *disksRESTClient) List(ctx context.Context, req *computepb.ListDisksRequest, opts ...gax.CallOption) (*computepb.DiskList, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/zones/%v/disks", req.GetProject(), req.GetZone()) + + 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() + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.DiskList{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// RemoveResourcePolicies removes resource policies from a disk. +func (c *disksRESTClient) RemoveResourcePolicies(ctx context.Context, req *computepb.RemoveResourcePoliciesDiskRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetDisksRemoveResourcePoliciesRequestResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/zones/%v/disks/%v/removeResourcePolicies", req.GetProject(), req.GetZone(), req.GetDisk()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Resize resizes the specified persistent disk. You can only increase the size of the disk. +func (c *disksRESTClient) Resize(ctx context.Context, req *computepb.ResizeDiskRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetDisksResizeRequestResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/zones/%v/disks/%v/resize", req.GetProject(), req.GetZone(), req.GetDisk()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// SetIamPolicy sets the access control policy on the specified resource. Replaces any existing policy. +func (c *disksRESTClient) SetIamPolicy(ctx context.Context, req *computepb.SetIamPolicyDiskRequest, opts ...gax.CallOption) (*computepb.Policy, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetZoneSetPolicyRequestResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/zones/%v/disks/%v/setIamPolicy", req.GetProject(), req.GetZone(), req.GetResource()) + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Policy{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// SetLabels sets the labels on a disk. To learn more about labels, read the Labeling Resources documentation. +func (c *disksRESTClient) SetLabels(ctx context.Context, req *computepb.SetLabelsDiskRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetZoneSetLabelsRequestResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/zones/%v/disks/%v/setLabels", req.GetProject(), req.GetZone(), req.GetResource()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// TestIamPermissions returns permissions that a caller has on the specified resource. +func (c *disksRESTClient) TestIamPermissions(ctx context.Context, req *computepb.TestIamPermissionsDiskRequest, opts ...gax.CallOption) (*computepb.TestPermissionsResponse, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetTestPermissionsRequestResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/zones/%v/disks/%v/testIamPermissions", req.GetProject(), req.GetZone(), req.GetResource()) + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.TestPermissionsResponse{} + + return rsp, unm.Unmarshal(buf, rsp) +} diff --git a/compute/apiv1/disks_client_example_test.go b/compute/apiv1/disks_client_example_test.go new file mode 100644 index 00000000000..cbdcd918b75 --- /dev/null +++ b/compute/apiv1/disks_client_example_test.go @@ -0,0 +1,283 @@ +// Copyright 2021 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_test + +import ( + "context" + + compute "cloud.google.com/go/compute/apiv1" + computepb "google.golang.org/genproto/googleapis/cloud/compute/v1" +) + +func ExampleNewDisksRESTClient() { + ctx := context.Background() + c, err := compute.NewDisksRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + // TODO: Use client. + _ = c +} + +func ExampleDisksClient_AddResourcePolicies() { + ctx := context.Background() + c, err := compute.NewDisksRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.AddResourcePoliciesDiskRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.AddResourcePolicies(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleDisksClient_AggregatedList() { + ctx := context.Background() + c, err := compute.NewDisksRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.AggregatedListDisksRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.AggregatedList(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleDisksClient_CreateSnapshot() { + ctx := context.Background() + c, err := compute.NewDisksRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.CreateSnapshotDiskRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.CreateSnapshot(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleDisksClient_Delete() { + ctx := context.Background() + c, err := compute.NewDisksRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.DeleteDiskRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Delete(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleDisksClient_Get() { + ctx := context.Background() + c, err := compute.NewDisksRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.GetDiskRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Get(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleDisksClient_GetIamPolicy() { + ctx := context.Background() + c, err := compute.NewDisksRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.GetIamPolicyDiskRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.GetIamPolicy(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleDisksClient_Insert() { + ctx := context.Background() + c, err := compute.NewDisksRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.InsertDiskRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Insert(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleDisksClient_List() { + ctx := context.Background() + c, err := compute.NewDisksRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.ListDisksRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.List(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleDisksClient_RemoveResourcePolicies() { + ctx := context.Background() + c, err := compute.NewDisksRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.RemoveResourcePoliciesDiskRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.RemoveResourcePolicies(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleDisksClient_Resize() { + ctx := context.Background() + c, err := compute.NewDisksRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.ResizeDiskRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Resize(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleDisksClient_SetIamPolicy() { + ctx := context.Background() + c, err := compute.NewDisksRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.SetIamPolicyDiskRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.SetIamPolicy(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleDisksClient_SetLabels() { + ctx := context.Background() + c, err := compute.NewDisksRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.SetLabelsDiskRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.SetLabels(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleDisksClient_TestIamPermissions() { + ctx := context.Background() + c, err := compute.NewDisksRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.TestIamPermissionsDiskRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.TestIamPermissions(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} diff --git a/compute/apiv1/doc.go b/compute/apiv1/doc.go new file mode 100644 index 00000000000..4b6efeb2d7e --- /dev/null +++ b/compute/apiv1/doc.go @@ -0,0 +1,118 @@ +// Copyright 2021 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 is an auto-generated package for the +// Google Compute Engine API. +// +// NOTE: This package is in alpha. It is not stable, and is likely to change. +// +// Use of Context +// +// The ctx passed to NewClient is used for authentication requests and +// for creating the underlying connection, but is not used for subsequent calls. +// Individual methods on the client use the ctx given to them. +// +// To close the open connection, use the Close() method. +// +// For information about setting deadlines, reusing contexts, and more +// please visit https://pkg.go.dev/cloud.google.com/go. +package compute // import "cloud.google.com/go/compute/apiv1" + +import ( + "context" + "os" + "runtime" + "strconv" + "strings" + "unicode" + + "google.golang.org/api/option" + "google.golang.org/grpc/metadata" +) + +// For more information on implementing a client constructor hook, see +// https://github.com/googleapis/google-cloud-go/wiki/Customizing-constructors. +type clientHookParams struct{} +type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) + +const versionClient = "20210701" + +func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { + out, _ := metadata.FromOutgoingContext(ctx) + out = out.Copy() + for _, md := range mds { + for k, v := range md { + out[k] = append(out[k], v...) + } + } + return metadata.NewOutgoingContext(ctx, out) +} + +func checkDisableDeadlines() (bool, error) { + raw, ok := os.LookupEnv("GOOGLE_API_GO_EXPERIMENTAL_DISABLE_DEFAULT_DEADLINE") + if !ok { + return false, nil + } + + b, err := strconv.ParseBool(raw) + return b, err +} + +// DefaultAuthScopes reports the default set of authentication scopes to use with this package. +func DefaultAuthScopes() []string { + return []string{ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly", + } +} + +// versionGo returns the Go runtime version. The returned string +// has no whitespace, suitable for reporting in header. +func versionGo() string { + const develPrefix = "devel +" + + s := runtime.Version() + if strings.HasPrefix(s, develPrefix) { + s = s[len(develPrefix):] + if p := strings.IndexFunc(s, unicode.IsSpace); p >= 0 { + s = s[:p] + } + return s + } + + notSemverRune := func(r rune) bool { + return !strings.ContainsRune("0123456789.", r) + } + + if strings.HasPrefix(s, "go1") { + s = s[2:] + var prerelease string + if p := strings.IndexFunc(s, notSemverRune); p >= 0 { + s, prerelease = s[:p], s[p:] + } + if strings.HasSuffix(s, ".") { + s += "0" + } else if strings.Count(s, ".") < 2 { + s += ".0" + } + if prerelease != "" { + s += "-" + prerelease + } + return s + } + return "UNKNOWN" +} diff --git a/compute/apiv1/external_vpn_gateways_client.go b/compute/apiv1/external_vpn_gateways_client.go new file mode 100644 index 00000000000..00311af9054 --- /dev/null +++ b/compute/apiv1/external_vpn_gateways_client.go @@ -0,0 +1,482 @@ +// Copyright 2021 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/ioutil" + "net/http" + "net/url" + + gax "github.com/googleapis/gax-go/v2" + "google.golang.org/api/option" + "google.golang.org/api/option/internaloption" + httptransport "google.golang.org/api/transport/http" + computepb "google.golang.org/genproto/googleapis/cloud/compute/v1" + "google.golang.org/grpc" + "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/encoding/protojson" +) + +var newExternalVpnGatewaysClientHook clientHook + +// ExternalVpnGatewaysCallOptions contains the retry settings for each method of ExternalVpnGatewaysClient. +type ExternalVpnGatewaysCallOptions struct { + Delete []gax.CallOption + Get []gax.CallOption + Insert []gax.CallOption + List []gax.CallOption + SetLabels []gax.CallOption + TestIamPermissions []gax.CallOption +} + +// internalExternalVpnGatewaysClient is an interface that defines the methods availaible from Google Compute Engine API. +type internalExternalVpnGatewaysClient interface { + Close() error + setGoogleClientInfo(...string) + Connection() *grpc.ClientConn + Delete(context.Context, *computepb.DeleteExternalVpnGatewayRequest, ...gax.CallOption) (*computepb.Operation, error) + Get(context.Context, *computepb.GetExternalVpnGatewayRequest, ...gax.CallOption) (*computepb.ExternalVpnGateway, error) + Insert(context.Context, *computepb.InsertExternalVpnGatewayRequest, ...gax.CallOption) (*computepb.Operation, error) + List(context.Context, *computepb.ListExternalVpnGatewaysRequest, ...gax.CallOption) (*computepb.ExternalVpnGatewayList, error) + SetLabels(context.Context, *computepb.SetLabelsExternalVpnGatewayRequest, ...gax.CallOption) (*computepb.Operation, error) + TestIamPermissions(context.Context, *computepb.TestIamPermissionsExternalVpnGatewayRequest, ...gax.CallOption) (*computepb.TestPermissionsResponse, error) +} + +// ExternalVpnGatewaysClient 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 ExternalVpnGateways API. +type ExternalVpnGatewaysClient struct { + // The internal transport-dependent client. + internalClient internalExternalVpnGatewaysClient + + // The call options for this service. + CallOptions *ExternalVpnGatewaysCallOptions +} + +// 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 *ExternalVpnGatewaysClient) 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 *ExternalVpnGatewaysClient) setGoogleClientInfo(keyval ...string) { + c.internalClient.setGoogleClientInfo(keyval...) +} + +// Connection returns a connection to the API service. +// +// Deprecated. +func (c *ExternalVpnGatewaysClient) Connection() *grpc.ClientConn { + return c.internalClient.Connection() +} + +// Delete deletes the specified externalVpnGateway. +func (c *ExternalVpnGatewaysClient) Delete(ctx context.Context, req *computepb.DeleteExternalVpnGatewayRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.Delete(ctx, req, opts...) +} + +// Get returns the specified externalVpnGateway. Get a list of available externalVpnGateways by making a list() request. +func (c *ExternalVpnGatewaysClient) Get(ctx context.Context, req *computepb.GetExternalVpnGatewayRequest, opts ...gax.CallOption) (*computepb.ExternalVpnGateway, error) { + return c.internalClient.Get(ctx, req, opts...) +} + +// Insert creates a ExternalVpnGateway in the specified project using the data included in the request. +func (c *ExternalVpnGatewaysClient) Insert(ctx context.Context, req *computepb.InsertExternalVpnGatewayRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.Insert(ctx, req, opts...) +} + +// List retrieves the list of ExternalVpnGateway available to the specified project. +func (c *ExternalVpnGatewaysClient) List(ctx context.Context, req *computepb.ListExternalVpnGatewaysRequest, opts ...gax.CallOption) (*computepb.ExternalVpnGatewayList, error) { + return c.internalClient.List(ctx, req, opts...) +} + +// SetLabels sets the labels on an ExternalVpnGateway. To learn more about labels, read the Labeling Resources documentation. +func (c *ExternalVpnGatewaysClient) SetLabels(ctx context.Context, req *computepb.SetLabelsExternalVpnGatewayRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.SetLabels(ctx, req, opts...) +} + +// TestIamPermissions returns permissions that a caller has on the specified resource. +func (c *ExternalVpnGatewaysClient) TestIamPermissions(ctx context.Context, req *computepb.TestIamPermissionsExternalVpnGatewayRequest, opts ...gax.CallOption) (*computepb.TestPermissionsResponse, error) { + return c.internalClient.TestIamPermissions(ctx, req, opts...) +} + +// Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls. +type externalVpnGatewaysRESTClient struct { + // The http endpoint to connect to. + endpoint string + + // The http client. + httpClient *http.Client + + // The x-goog-* metadata to be sent with each request. + xGoogMetadata metadata.MD +} + +// NewExternalVpnGatewaysRESTClient creates a new external vpn gateways rest client. +// +// The ExternalVpnGateways API. +func NewExternalVpnGatewaysRESTClient(ctx context.Context, opts ...option.ClientOption) (*ExternalVpnGatewaysClient, error) { + clientOpts := append(defaultExternalVpnGatewaysRESTClientOptions(), opts...) + httpClient, endpoint, err := httptransport.NewClient(ctx, clientOpts...) + if err != nil { + return nil, err + } + + c := &externalVpnGatewaysRESTClient{ + endpoint: endpoint, + httpClient: httpClient, + } + c.setGoogleClientInfo() + + return &ExternalVpnGatewaysClient{internalClient: c, CallOptions: &ExternalVpnGatewaysCallOptions{}}, nil +} + +func defaultExternalVpnGatewaysRESTClientOptions() []option.ClientOption { + return []option.ClientOption{ + internaloption.WithDefaultEndpoint("compute.googleapis.com"), + internaloption.WithDefaultMTLSEndpoint("compute.mtls.googleapis.com"), + internaloption.WithDefaultAudience("https://compute.googleapis.com/"), + internaloption.WithDefaultScopes(DefaultAuthScopes()...), + } +} + +// setGoogleClientInfo sets the name and version of the application in +// the `x-goog-api-client` header passed on each request. Intended for +// use by Google-written clients. +func (c *externalVpnGatewaysRESTClient) setGoogleClientInfo(keyval ...string) { + kv := append([]string{"gl-go", versionGo()}, keyval...) + kv = append(kv, "gapic", versionClient, "gax", gax.Version, "rest", "UNKNOWN") + c.xGoogMetadata = metadata.Pairs("x-goog-api-client", gax.XGoogHeader(kv...)) +} + +// Close closes the connection to the API service. The user should invoke this when +// the client is no longer required. +func (c *externalVpnGatewaysRESTClient) Close() error { + // Replace httpClient with nil to force cleanup. + c.httpClient = nil + return nil +} + +// Connection returns a connection to the API service. +// +// Deprecated. +func (c *externalVpnGatewaysRESTClient) Connection() *grpc.ClientConn { + return nil +} + +// Delete deletes the specified externalVpnGateway. +func (c *externalVpnGatewaysRESTClient) Delete(ctx context.Context, req *computepb.DeleteExternalVpnGatewayRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/global/externalVpnGateways/%v", req.GetProject(), req.GetExternalVpnGateway()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("DELETE", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Get returns the specified externalVpnGateway. Get a list of available externalVpnGateways by making a list() request. +func (c *externalVpnGatewaysRESTClient) Get(ctx context.Context, req *computepb.GetExternalVpnGatewayRequest, opts ...gax.CallOption) (*computepb.ExternalVpnGateway, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/global/externalVpnGateways/%v", req.GetProject(), req.GetExternalVpnGateway()) + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.ExternalVpnGateway{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Insert creates a ExternalVpnGateway in the specified project using the data included in the request. +func (c *externalVpnGatewaysRESTClient) Insert(ctx context.Context, req *computepb.InsertExternalVpnGatewayRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetExternalVpnGatewayResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/global/externalVpnGateways", req.GetProject()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// List retrieves the list of ExternalVpnGateway available to the specified project. +func (c *externalVpnGatewaysRESTClient) List(ctx context.Context, req *computepb.ListExternalVpnGatewaysRequest, opts ...gax.CallOption) (*computepb.ExternalVpnGatewayList, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/global/externalVpnGateways", 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() + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.ExternalVpnGatewayList{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// SetLabels sets the labels on an ExternalVpnGateway. To learn more about labels, read the Labeling Resources documentation. +func (c *externalVpnGatewaysRESTClient) SetLabels(ctx context.Context, req *computepb.SetLabelsExternalVpnGatewayRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetGlobalSetLabelsRequestResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/global/externalVpnGateways/%v/setLabels", req.GetProject(), req.GetResource()) + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// TestIamPermissions returns permissions that a caller has on the specified resource. +func (c *externalVpnGatewaysRESTClient) TestIamPermissions(ctx context.Context, req *computepb.TestIamPermissionsExternalVpnGatewayRequest, opts ...gax.CallOption) (*computepb.TestPermissionsResponse, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetTestPermissionsRequestResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/global/externalVpnGateways/%v/testIamPermissions", req.GetProject(), req.GetResource()) + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.TestPermissionsResponse{} + + return rsp, unm.Unmarshal(buf, rsp) +} diff --git a/compute/apiv1/external_vpn_gateways_client_example_test.go b/compute/apiv1/external_vpn_gateways_client_example_test.go new file mode 100644 index 00000000000..820c2c0a3fb --- /dev/null +++ b/compute/apiv1/external_vpn_gateways_client_example_test.go @@ -0,0 +1,150 @@ +// Copyright 2021 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_test + +import ( + "context" + + compute "cloud.google.com/go/compute/apiv1" + computepb "google.golang.org/genproto/googleapis/cloud/compute/v1" +) + +func ExampleNewExternalVpnGatewaysRESTClient() { + ctx := context.Background() + c, err := compute.NewExternalVpnGatewaysRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + // TODO: Use client. + _ = c +} + +func ExampleExternalVpnGatewaysClient_Delete() { + ctx := context.Background() + c, err := compute.NewExternalVpnGatewaysRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.DeleteExternalVpnGatewayRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Delete(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleExternalVpnGatewaysClient_Get() { + ctx := context.Background() + c, err := compute.NewExternalVpnGatewaysRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.GetExternalVpnGatewayRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Get(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleExternalVpnGatewaysClient_Insert() { + ctx := context.Background() + c, err := compute.NewExternalVpnGatewaysRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.InsertExternalVpnGatewayRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Insert(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleExternalVpnGatewaysClient_List() { + ctx := context.Background() + c, err := compute.NewExternalVpnGatewaysRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.ListExternalVpnGatewaysRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.List(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleExternalVpnGatewaysClient_SetLabels() { + ctx := context.Background() + c, err := compute.NewExternalVpnGatewaysRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.SetLabelsExternalVpnGatewayRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.SetLabels(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleExternalVpnGatewaysClient_TestIamPermissions() { + ctx := context.Background() + c, err := compute.NewExternalVpnGatewaysRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.TestIamPermissionsExternalVpnGatewayRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.TestIamPermissions(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} diff --git a/compute/apiv1/firewall_policies_client.go b/compute/apiv1/firewall_policies_client.go new file mode 100644 index 00000000000..4b224a975c3 --- /dev/null +++ b/compute/apiv1/firewall_policies_client.go @@ -0,0 +1,1194 @@ +// Copyright 2021 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/ioutil" + "net/http" + "net/url" + + gax "github.com/googleapis/gax-go/v2" + "google.golang.org/api/option" + "google.golang.org/api/option/internaloption" + httptransport "google.golang.org/api/transport/http" + computepb "google.golang.org/genproto/googleapis/cloud/compute/v1" + "google.golang.org/grpc" + "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/encoding/protojson" +) + +var newFirewallPoliciesClientHook clientHook + +// FirewallPoliciesCallOptions contains the retry settings for each method of FirewallPoliciesClient. +type FirewallPoliciesCallOptions struct { + AddAssociation []gax.CallOption + AddRule []gax.CallOption + CloneRules []gax.CallOption + Delete []gax.CallOption + Get []gax.CallOption + GetAssociation []gax.CallOption + GetIamPolicy []gax.CallOption + GetRule []gax.CallOption + Insert []gax.CallOption + List []gax.CallOption + ListAssociations []gax.CallOption + Move []gax.CallOption + Patch []gax.CallOption + PatchRule []gax.CallOption + RemoveAssociation []gax.CallOption + RemoveRule []gax.CallOption + SetIamPolicy []gax.CallOption + TestIamPermissions []gax.CallOption +} + +// internalFirewallPoliciesClient is an interface that defines the methods availaible from Google Compute Engine API. +type internalFirewallPoliciesClient interface { + Close() error + setGoogleClientInfo(...string) + Connection() *grpc.ClientConn + AddAssociation(context.Context, *computepb.AddAssociationFirewallPolicyRequest, ...gax.CallOption) (*computepb.Operation, error) + AddRule(context.Context, *computepb.AddRuleFirewallPolicyRequest, ...gax.CallOption) (*computepb.Operation, error) + CloneRules(context.Context, *computepb.CloneRulesFirewallPolicyRequest, ...gax.CallOption) (*computepb.Operation, error) + Delete(context.Context, *computepb.DeleteFirewallPolicyRequest, ...gax.CallOption) (*computepb.Operation, error) + Get(context.Context, *computepb.GetFirewallPolicyRequest, ...gax.CallOption) (*computepb.FirewallPolicy, error) + GetAssociation(context.Context, *computepb.GetAssociationFirewallPolicyRequest, ...gax.CallOption) (*computepb.FirewallPolicyAssociation, error) + GetIamPolicy(context.Context, *computepb.GetIamPolicyFirewallPolicyRequest, ...gax.CallOption) (*computepb.Policy, error) + GetRule(context.Context, *computepb.GetRuleFirewallPolicyRequest, ...gax.CallOption) (*computepb.FirewallPolicyRule, error) + Insert(context.Context, *computepb.InsertFirewallPolicyRequest, ...gax.CallOption) (*computepb.Operation, error) + List(context.Context, *computepb.ListFirewallPoliciesRequest, ...gax.CallOption) (*computepb.FirewallPolicyList, error) + ListAssociations(context.Context, *computepb.ListAssociationsFirewallPolicyRequest, ...gax.CallOption) (*computepb.FirewallPoliciesListAssociationsResponse, error) + Move(context.Context, *computepb.MoveFirewallPolicyRequest, ...gax.CallOption) (*computepb.Operation, error) + Patch(context.Context, *computepb.PatchFirewallPolicyRequest, ...gax.CallOption) (*computepb.Operation, error) + PatchRule(context.Context, *computepb.PatchRuleFirewallPolicyRequest, ...gax.CallOption) (*computepb.Operation, error) + RemoveAssociation(context.Context, *computepb.RemoveAssociationFirewallPolicyRequest, ...gax.CallOption) (*computepb.Operation, error) + RemoveRule(context.Context, *computepb.RemoveRuleFirewallPolicyRequest, ...gax.CallOption) (*computepb.Operation, error) + SetIamPolicy(context.Context, *computepb.SetIamPolicyFirewallPolicyRequest, ...gax.CallOption) (*computepb.Policy, error) + TestIamPermissions(context.Context, *computepb.TestIamPermissionsFirewallPolicyRequest, ...gax.CallOption) (*computepb.TestPermissionsResponse, error) +} + +// FirewallPoliciesClient 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 FirewallPolicies API. +type FirewallPoliciesClient struct { + // The internal transport-dependent client. + internalClient internalFirewallPoliciesClient + + // The call options for this service. + CallOptions *FirewallPoliciesCallOptions +} + +// 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 *FirewallPoliciesClient) 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 *FirewallPoliciesClient) setGoogleClientInfo(keyval ...string) { + c.internalClient.setGoogleClientInfo(keyval...) +} + +// Connection returns a connection to the API service. +// +// Deprecated. +func (c *FirewallPoliciesClient) Connection() *grpc.ClientConn { + return c.internalClient.Connection() +} + +// AddAssociation inserts an association for the specified firewall policy. +func (c *FirewallPoliciesClient) AddAssociation(ctx context.Context, req *computepb.AddAssociationFirewallPolicyRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.AddAssociation(ctx, req, opts...) +} + +// AddRule inserts a rule into a firewall policy. +func (c *FirewallPoliciesClient) AddRule(ctx context.Context, req *computepb.AddRuleFirewallPolicyRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.AddRule(ctx, req, opts...) +} + +// CloneRules copies rules to the specified firewall policy. +func (c *FirewallPoliciesClient) CloneRules(ctx context.Context, req *computepb.CloneRulesFirewallPolicyRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.CloneRules(ctx, req, opts...) +} + +// Delete deletes the specified policy. +func (c *FirewallPoliciesClient) Delete(ctx context.Context, req *computepb.DeleteFirewallPolicyRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.Delete(ctx, req, opts...) +} + +// Get returns the specified firewall policy. +func (c *FirewallPoliciesClient) Get(ctx context.Context, req *computepb.GetFirewallPolicyRequest, opts ...gax.CallOption) (*computepb.FirewallPolicy, error) { + return c.internalClient.Get(ctx, req, opts...) +} + +// GetAssociation gets an association with the specified name. +func (c *FirewallPoliciesClient) GetAssociation(ctx context.Context, req *computepb.GetAssociationFirewallPolicyRequest, opts ...gax.CallOption) (*computepb.FirewallPolicyAssociation, error) { + return c.internalClient.GetAssociation(ctx, req, opts...) +} + +// GetIamPolicy gets the access control policy for a resource. May be empty if no such policy or resource exists. +func (c *FirewallPoliciesClient) GetIamPolicy(ctx context.Context, req *computepb.GetIamPolicyFirewallPolicyRequest, opts ...gax.CallOption) (*computepb.Policy, error) { + return c.internalClient.GetIamPolicy(ctx, req, opts...) +} + +// GetRule gets a rule of the specified priority. +func (c *FirewallPoliciesClient) GetRule(ctx context.Context, req *computepb.GetRuleFirewallPolicyRequest, opts ...gax.CallOption) (*computepb.FirewallPolicyRule, 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 *FirewallPoliciesClient) Insert(ctx context.Context, req *computepb.InsertFirewallPolicyRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.Insert(ctx, req, opts...) +} + +// List lists all the policies that have been configured for the specified project. +func (c *FirewallPoliciesClient) List(ctx context.Context, req *computepb.ListFirewallPoliciesRequest, opts ...gax.CallOption) (*computepb.FirewallPolicyList, error) { + return c.internalClient.List(ctx, req, opts...) +} + +// ListAssociations lists associations of a specified target, i.e., organization or folder. +func (c *FirewallPoliciesClient) ListAssociations(ctx context.Context, req *computepb.ListAssociationsFirewallPolicyRequest, opts ...gax.CallOption) (*computepb.FirewallPoliciesListAssociationsResponse, error) { + return c.internalClient.ListAssociations(ctx, req, opts...) +} + +// Move moves the specified firewall policy. +func (c *FirewallPoliciesClient) Move(ctx context.Context, req *computepb.MoveFirewallPolicyRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.Move(ctx, req, opts...) +} + +// Patch patches the specified policy with the data included in the request. +func (c *FirewallPoliciesClient) Patch(ctx context.Context, req *computepb.PatchFirewallPolicyRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.Patch(ctx, req, opts...) +} + +// PatchRule patches a rule of the specified priority. +func (c *FirewallPoliciesClient) PatchRule(ctx context.Context, req *computepb.PatchRuleFirewallPolicyRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.PatchRule(ctx, req, opts...) +} + +// RemoveAssociation removes an association for the specified firewall policy. +func (c *FirewallPoliciesClient) RemoveAssociation(ctx context.Context, req *computepb.RemoveAssociationFirewallPolicyRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.RemoveAssociation(ctx, req, opts...) +} + +// RemoveRule deletes a rule of the specified priority. +func (c *FirewallPoliciesClient) RemoveRule(ctx context.Context, req *computepb.RemoveRuleFirewallPolicyRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.RemoveRule(ctx, req, opts...) +} + +// SetIamPolicy sets the access control policy on the specified resource. Replaces any existing policy. +func (c *FirewallPoliciesClient) SetIamPolicy(ctx context.Context, req *computepb.SetIamPolicyFirewallPolicyRequest, 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 *FirewallPoliciesClient) TestIamPermissions(ctx context.Context, req *computepb.TestIamPermissionsFirewallPolicyRequest, opts ...gax.CallOption) (*computepb.TestPermissionsResponse, error) { + return c.internalClient.TestIamPermissions(ctx, req, opts...) +} + +// Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls. +type firewallPoliciesRESTClient struct { + // The http endpoint to connect to. + endpoint string + + // The http client. + httpClient *http.Client + + // The x-goog-* metadata to be sent with each request. + xGoogMetadata metadata.MD +} + +// NewFirewallPoliciesRESTClient creates a new firewall policies rest client. +// +// The FirewallPolicies API. +func NewFirewallPoliciesRESTClient(ctx context.Context, opts ...option.ClientOption) (*FirewallPoliciesClient, error) { + clientOpts := append(defaultFirewallPoliciesRESTClientOptions(), opts...) + httpClient, endpoint, err := httptransport.NewClient(ctx, clientOpts...) + if err != nil { + return nil, err + } + + c := &firewallPoliciesRESTClient{ + endpoint: endpoint, + httpClient: httpClient, + } + c.setGoogleClientInfo() + + return &FirewallPoliciesClient{internalClient: c, CallOptions: &FirewallPoliciesCallOptions{}}, nil +} + +func defaultFirewallPoliciesRESTClientOptions() []option.ClientOption { + return []option.ClientOption{ + internaloption.WithDefaultEndpoint("compute.googleapis.com"), + internaloption.WithDefaultMTLSEndpoint("compute.mtls.googleapis.com"), + internaloption.WithDefaultAudience("https://compute.googleapis.com/"), + internaloption.WithDefaultScopes(DefaultAuthScopes()...), + } +} + +// setGoogleClientInfo sets the name and version of the application in +// the `x-goog-api-client` header passed on each request. Intended for +// use by Google-written clients. +func (c *firewallPoliciesRESTClient) setGoogleClientInfo(keyval ...string) { + kv := append([]string{"gl-go", versionGo()}, keyval...) + kv = append(kv, "gapic", versionClient, "gax", gax.Version, "rest", "UNKNOWN") + c.xGoogMetadata = metadata.Pairs("x-goog-api-client", gax.XGoogHeader(kv...)) +} + +// Close closes the connection to the API service. The user should invoke this when +// the client is no longer required. +func (c *firewallPoliciesRESTClient) Close() error { + // Replace httpClient with nil to force cleanup. + c.httpClient = nil + return nil +} + +// Connection returns a connection to the API service. +// +// Deprecated. +func (c *firewallPoliciesRESTClient) Connection() *grpc.ClientConn { + return nil +} + +// AddAssociation inserts an association for the specified firewall policy. +func (c *firewallPoliciesRESTClient) AddAssociation(ctx context.Context, req *computepb.AddAssociationFirewallPolicyRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetFirewallPolicyAssociationResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/locations/global/firewallPolicies/%v/addAssociation", req.GetFirewallPolicy()) + + params := url.Values{} + if req != nil && req.ReplaceExistingAssociation != nil { + params.Add("replaceExistingAssociation", fmt.Sprintf("%v", req.GetReplaceExistingAssociation())) + } + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// AddRule inserts a rule into a firewall policy. +func (c *firewallPoliciesRESTClient) AddRule(ctx context.Context, req *computepb.AddRuleFirewallPolicyRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetFirewallPolicyRuleResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/locations/global/firewallPolicies/%v/addRule", req.GetFirewallPolicy()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// CloneRules copies rules to the specified firewall policy. +func (c *firewallPoliciesRESTClient) CloneRules(ctx context.Context, req *computepb.CloneRulesFirewallPolicyRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/locations/global/firewallPolicies/%v/cloneRules", req.GetFirewallPolicy()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + if req != nil && req.SourceFirewallPolicy != nil { + params.Add("sourceFirewallPolicy", fmt.Sprintf("%v", req.GetSourceFirewallPolicy())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Delete deletes the specified policy. +func (c *firewallPoliciesRESTClient) Delete(ctx context.Context, req *computepb.DeleteFirewallPolicyRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/locations/global/firewallPolicies/%v", req.GetFirewallPolicy()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("DELETE", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Get returns the specified firewall policy. +func (c *firewallPoliciesRESTClient) Get(ctx context.Context, req *computepb.GetFirewallPolicyRequest, opts ...gax.CallOption) (*computepb.FirewallPolicy, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/locations/global/firewallPolicies/%v", req.GetFirewallPolicy()) + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.FirewallPolicy{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// GetAssociation gets an association with the specified name. +func (c *firewallPoliciesRESTClient) GetAssociation(ctx context.Context, req *computepb.GetAssociationFirewallPolicyRequest, opts ...gax.CallOption) (*computepb.FirewallPolicyAssociation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/locations/global/firewallPolicies/%v/getAssociation", req.GetFirewallPolicy()) + + params := url.Values{} + if req != nil && req.Name != nil { + params.Add("name", fmt.Sprintf("%v", req.GetName())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.FirewallPolicyAssociation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// GetIamPolicy gets the access control policy for a resource. May be empty if no such policy or resource exists. +func (c *firewallPoliciesRESTClient) GetIamPolicy(ctx context.Context, req *computepb.GetIamPolicyFirewallPolicyRequest, opts ...gax.CallOption) (*computepb.Policy, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/locations/global/firewallPolicies/%v/getIamPolicy", req.GetResource()) + + params := url.Values{} + if req != nil && req.OptionsRequestedPolicyVersion != nil { + params.Add("optionsRequestedPolicyVersion", fmt.Sprintf("%v", req.GetOptionsRequestedPolicyVersion())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Policy{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// GetRule gets a rule of the specified priority. +func (c *firewallPoliciesRESTClient) GetRule(ctx context.Context, req *computepb.GetRuleFirewallPolicyRequest, opts ...gax.CallOption) (*computepb.FirewallPolicyRule, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/locations/global/firewallPolicies/%v/getRule", req.GetFirewallPolicy()) + + params := url.Values{} + if req != nil && req.Priority != nil { + params.Add("priority", fmt.Sprintf("%v", req.GetPriority())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.FirewallPolicyRule{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Insert creates a new policy in the specified project using the data included in the request. +func (c *firewallPoliciesRESTClient) Insert(ctx context.Context, req *computepb.InsertFirewallPolicyRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetFirewallPolicyResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/locations/global/firewallPolicies") + + params := url.Values{} + if req != nil && req.ParentId != nil { + params.Add("parentId", fmt.Sprintf("%v", req.GetParentId())) + } + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// List lists all the policies that have been configured for the specified project. +func (c *firewallPoliciesRESTClient) List(ctx context.Context, req *computepb.ListFirewallPoliciesRequest, opts ...gax.CallOption) (*computepb.FirewallPolicyList, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/locations/global/firewallPolicies") + + 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.ParentId != nil { + params.Add("parentId", fmt.Sprintf("%v", req.GetParentId())) + } + if req != nil && req.ReturnPartialSuccess != nil { + params.Add("returnPartialSuccess", fmt.Sprintf("%v", req.GetReturnPartialSuccess())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.FirewallPolicyList{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// ListAssociations lists associations of a specified target, i.e., organization or folder. +func (c *firewallPoliciesRESTClient) ListAssociations(ctx context.Context, req *computepb.ListAssociationsFirewallPolicyRequest, opts ...gax.CallOption) (*computepb.FirewallPoliciesListAssociationsResponse, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/locations/global/firewallPolicies/listAssociations") + + params := url.Values{} + if req != nil && req.TargetResource != nil { + params.Add("targetResource", fmt.Sprintf("%v", req.GetTargetResource())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.FirewallPoliciesListAssociationsResponse{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Move moves the specified firewall policy. +func (c *firewallPoliciesRESTClient) Move(ctx context.Context, req *computepb.MoveFirewallPolicyRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/locations/global/firewallPolicies/%v/move", req.GetFirewallPolicy()) + + params := url.Values{} + if req != nil && req.ParentId != nil { + params.Add("parentId", fmt.Sprintf("%v", req.GetParentId())) + } + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Patch patches the specified policy with the data included in the request. +func (c *firewallPoliciesRESTClient) Patch(ctx context.Context, req *computepb.PatchFirewallPolicyRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetFirewallPolicyResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/locations/global/firewallPolicies/%v", req.GetFirewallPolicy()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("PATCH", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// PatchRule patches a rule of the specified priority. +func (c *firewallPoliciesRESTClient) PatchRule(ctx context.Context, req *computepb.PatchRuleFirewallPolicyRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetFirewallPolicyRuleResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/locations/global/firewallPolicies/%v/patchRule", req.GetFirewallPolicy()) + + params := url.Values{} + if req != nil && req.Priority != nil { + params.Add("priority", fmt.Sprintf("%v", req.GetPriority())) + } + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// RemoveAssociation removes an association for the specified firewall policy. +func (c *firewallPoliciesRESTClient) RemoveAssociation(ctx context.Context, req *computepb.RemoveAssociationFirewallPolicyRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/locations/global/firewallPolicies/%v/removeAssociation", req.GetFirewallPolicy()) + + params := url.Values{} + if req != nil && req.Name != nil { + params.Add("name", fmt.Sprintf("%v", req.GetName())) + } + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// RemoveRule deletes a rule of the specified priority. +func (c *firewallPoliciesRESTClient) RemoveRule(ctx context.Context, req *computepb.RemoveRuleFirewallPolicyRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/locations/global/firewallPolicies/%v/removeRule", req.GetFirewallPolicy()) + + params := url.Values{} + if req != nil && req.Priority != nil { + params.Add("priority", fmt.Sprintf("%v", req.GetPriority())) + } + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// SetIamPolicy sets the access control policy on the specified resource. Replaces any existing policy. +func (c *firewallPoliciesRESTClient) SetIamPolicy(ctx context.Context, req *computepb.SetIamPolicyFirewallPolicyRequest, opts ...gax.CallOption) (*computepb.Policy, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetGlobalOrganizationSetPolicyRequestResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/locations/global/firewallPolicies/%v/setIamPolicy", req.GetResource()) + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Policy{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// TestIamPermissions returns permissions that a caller has on the specified resource. +func (c *firewallPoliciesRESTClient) TestIamPermissions(ctx context.Context, req *computepb.TestIamPermissionsFirewallPolicyRequest, opts ...gax.CallOption) (*computepb.TestPermissionsResponse, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetTestPermissionsRequestResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/locations/global/firewallPolicies/%v/testIamPermissions", req.GetResource()) + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.TestPermissionsResponse{} + + return rsp, unm.Unmarshal(buf, rsp) +} diff --git a/compute/apiv1/firewall_policies_client_example_test.go b/compute/apiv1/firewall_policies_client_example_test.go new file mode 100644 index 00000000000..787e486ebd1 --- /dev/null +++ b/compute/apiv1/firewall_policies_client_example_test.go @@ -0,0 +1,378 @@ +// Copyright 2021 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_test + +import ( + "context" + + compute "cloud.google.com/go/compute/apiv1" + computepb "google.golang.org/genproto/googleapis/cloud/compute/v1" +) + +func ExampleNewFirewallPoliciesRESTClient() { + ctx := context.Background() + c, err := compute.NewFirewallPoliciesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + // TODO: Use client. + _ = c +} + +func ExampleFirewallPoliciesClient_AddAssociation() { + ctx := context.Background() + c, err := compute.NewFirewallPoliciesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.AddAssociationFirewallPolicyRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.AddAssociation(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleFirewallPoliciesClient_AddRule() { + ctx := context.Background() + c, err := compute.NewFirewallPoliciesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.AddRuleFirewallPolicyRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.AddRule(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleFirewallPoliciesClient_CloneRules() { + ctx := context.Background() + c, err := compute.NewFirewallPoliciesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.CloneRulesFirewallPolicyRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.CloneRules(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleFirewallPoliciesClient_Delete() { + ctx := context.Background() + c, err := compute.NewFirewallPoliciesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.DeleteFirewallPolicyRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Delete(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleFirewallPoliciesClient_Get() { + ctx := context.Background() + c, err := compute.NewFirewallPoliciesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.GetFirewallPolicyRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Get(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleFirewallPoliciesClient_GetAssociation() { + ctx := context.Background() + c, err := compute.NewFirewallPoliciesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.GetAssociationFirewallPolicyRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.GetAssociation(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleFirewallPoliciesClient_GetIamPolicy() { + ctx := context.Background() + c, err := compute.NewFirewallPoliciesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.GetIamPolicyFirewallPolicyRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.GetIamPolicy(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleFirewallPoliciesClient_GetRule() { + ctx := context.Background() + c, err := compute.NewFirewallPoliciesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.GetRuleFirewallPolicyRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.GetRule(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleFirewallPoliciesClient_Insert() { + ctx := context.Background() + c, err := compute.NewFirewallPoliciesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.InsertFirewallPolicyRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Insert(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleFirewallPoliciesClient_List() { + ctx := context.Background() + c, err := compute.NewFirewallPoliciesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.ListFirewallPoliciesRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.List(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleFirewallPoliciesClient_ListAssociations() { + ctx := context.Background() + c, err := compute.NewFirewallPoliciesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.ListAssociationsFirewallPolicyRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.ListAssociations(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleFirewallPoliciesClient_Move() { + ctx := context.Background() + c, err := compute.NewFirewallPoliciesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.MoveFirewallPolicyRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Move(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleFirewallPoliciesClient_Patch() { + ctx := context.Background() + c, err := compute.NewFirewallPoliciesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.PatchFirewallPolicyRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Patch(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleFirewallPoliciesClient_PatchRule() { + ctx := context.Background() + c, err := compute.NewFirewallPoliciesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.PatchRuleFirewallPolicyRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.PatchRule(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleFirewallPoliciesClient_RemoveAssociation() { + ctx := context.Background() + c, err := compute.NewFirewallPoliciesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.RemoveAssociationFirewallPolicyRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.RemoveAssociation(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleFirewallPoliciesClient_RemoveRule() { + ctx := context.Background() + c, err := compute.NewFirewallPoliciesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.RemoveRuleFirewallPolicyRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.RemoveRule(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleFirewallPoliciesClient_SetIamPolicy() { + ctx := context.Background() + c, err := compute.NewFirewallPoliciesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.SetIamPolicyFirewallPolicyRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.SetIamPolicy(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleFirewallPoliciesClient_TestIamPermissions() { + ctx := context.Background() + c, err := compute.NewFirewallPoliciesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.TestIamPermissionsFirewallPolicyRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.TestIamPermissions(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} diff --git a/compute/apiv1/firewalls_client.go b/compute/apiv1/firewalls_client.go new file mode 100644 index 00000000000..2d764796b19 --- /dev/null +++ b/compute/apiv1/firewalls_client.go @@ -0,0 +1,502 @@ +// Copyright 2021 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/ioutil" + "net/http" + "net/url" + + gax "github.com/googleapis/gax-go/v2" + "google.golang.org/api/option" + "google.golang.org/api/option/internaloption" + httptransport "google.golang.org/api/transport/http" + computepb "google.golang.org/genproto/googleapis/cloud/compute/v1" + "google.golang.org/grpc" + "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/encoding/protojson" +) + +var newFirewallsClientHook clientHook + +// FirewallsCallOptions contains the retry settings for each method of FirewallsClient. +type FirewallsCallOptions struct { + Delete []gax.CallOption + Get []gax.CallOption + Insert []gax.CallOption + List []gax.CallOption + Patch []gax.CallOption + Update []gax.CallOption +} + +// internalFirewallsClient is an interface that defines the methods availaible from Google Compute Engine API. +type internalFirewallsClient interface { + Close() error + setGoogleClientInfo(...string) + Connection() *grpc.ClientConn + Delete(context.Context, *computepb.DeleteFirewallRequest, ...gax.CallOption) (*computepb.Operation, error) + Get(context.Context, *computepb.GetFirewallRequest, ...gax.CallOption) (*computepb.Firewall, error) + Insert(context.Context, *computepb.InsertFirewallRequest, ...gax.CallOption) (*computepb.Operation, error) + List(context.Context, *computepb.ListFirewallsRequest, ...gax.CallOption) (*computepb.FirewallList, error) + Patch(context.Context, *computepb.PatchFirewallRequest, ...gax.CallOption) (*computepb.Operation, error) + Update(context.Context, *computepb.UpdateFirewallRequest, ...gax.CallOption) (*computepb.Operation, error) +} + +// FirewallsClient 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 Firewalls API. +type FirewallsClient struct { + // The internal transport-dependent client. + internalClient internalFirewallsClient + + // The call options for this service. + CallOptions *FirewallsCallOptions +} + +// 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 *FirewallsClient) 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 *FirewallsClient) setGoogleClientInfo(keyval ...string) { + c.internalClient.setGoogleClientInfo(keyval...) +} + +// Connection returns a connection to the API service. +// +// Deprecated. +func (c *FirewallsClient) Connection() *grpc.ClientConn { + return c.internalClient.Connection() +} + +// Delete deletes the specified firewall. +func (c *FirewallsClient) Delete(ctx context.Context, req *computepb.DeleteFirewallRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.Delete(ctx, req, opts...) +} + +// Get returns the specified firewall. +func (c *FirewallsClient) Get(ctx context.Context, req *computepb.GetFirewallRequest, opts ...gax.CallOption) (*computepb.Firewall, error) { + return c.internalClient.Get(ctx, req, opts...) +} + +// Insert creates a firewall rule in the specified project using the data included in the request. +func (c *FirewallsClient) Insert(ctx context.Context, req *computepb.InsertFirewallRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.Insert(ctx, req, opts...) +} + +// List retrieves the list of firewall rules available to the specified project. +func (c *FirewallsClient) List(ctx context.Context, req *computepb.ListFirewallsRequest, opts ...gax.CallOption) (*computepb.FirewallList, error) { + return c.internalClient.List(ctx, req, opts...) +} + +// Patch updates the specified firewall rule with the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. +func (c *FirewallsClient) Patch(ctx context.Context, req *computepb.PatchFirewallRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.Patch(ctx, req, opts...) +} + +// Update updates the specified firewall rule with the data included in the request. Note that all fields will be updated if using PUT, even fields that are not specified. To update individual fields, please use PATCH instead. +func (c *FirewallsClient) Update(ctx context.Context, req *computepb.UpdateFirewallRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.Update(ctx, req, opts...) +} + +// Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls. +type firewallsRESTClient struct { + // The http endpoint to connect to. + endpoint string + + // The http client. + httpClient *http.Client + + // The x-goog-* metadata to be sent with each request. + xGoogMetadata metadata.MD +} + +// NewFirewallsRESTClient creates a new firewalls rest client. +// +// The Firewalls API. +func NewFirewallsRESTClient(ctx context.Context, opts ...option.ClientOption) (*FirewallsClient, error) { + clientOpts := append(defaultFirewallsRESTClientOptions(), opts...) + httpClient, endpoint, err := httptransport.NewClient(ctx, clientOpts...) + if err != nil { + return nil, err + } + + c := &firewallsRESTClient{ + endpoint: endpoint, + httpClient: httpClient, + } + c.setGoogleClientInfo() + + return &FirewallsClient{internalClient: c, CallOptions: &FirewallsCallOptions{}}, nil +} + +func defaultFirewallsRESTClientOptions() []option.ClientOption { + return []option.ClientOption{ + internaloption.WithDefaultEndpoint("compute.googleapis.com"), + internaloption.WithDefaultMTLSEndpoint("compute.mtls.googleapis.com"), + internaloption.WithDefaultAudience("https://compute.googleapis.com/"), + internaloption.WithDefaultScopes(DefaultAuthScopes()...), + } +} + +// setGoogleClientInfo sets the name and version of the application in +// the `x-goog-api-client` header passed on each request. Intended for +// use by Google-written clients. +func (c *firewallsRESTClient) setGoogleClientInfo(keyval ...string) { + kv := append([]string{"gl-go", versionGo()}, keyval...) + kv = append(kv, "gapic", versionClient, "gax", gax.Version, "rest", "UNKNOWN") + c.xGoogMetadata = metadata.Pairs("x-goog-api-client", gax.XGoogHeader(kv...)) +} + +// Close closes the connection to the API service. The user should invoke this when +// the client is no longer required. +func (c *firewallsRESTClient) Close() error { + // Replace httpClient with nil to force cleanup. + c.httpClient = nil + return nil +} + +// Connection returns a connection to the API service. +// +// Deprecated. +func (c *firewallsRESTClient) Connection() *grpc.ClientConn { + return nil +} + +// Delete deletes the specified firewall. +func (c *firewallsRESTClient) Delete(ctx context.Context, req *computepb.DeleteFirewallRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/global/firewalls/%v", req.GetProject(), req.GetFirewall()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("DELETE", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Get returns the specified firewall. +func (c *firewallsRESTClient) Get(ctx context.Context, req *computepb.GetFirewallRequest, opts ...gax.CallOption) (*computepb.Firewall, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/global/firewalls/%v", req.GetProject(), req.GetFirewall()) + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Firewall{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Insert creates a firewall rule in the specified project using the data included in the request. +func (c *firewallsRESTClient) Insert(ctx context.Context, req *computepb.InsertFirewallRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetFirewallResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/global/firewalls", req.GetProject()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// List retrieves the list of firewall rules available to the specified project. +func (c *firewallsRESTClient) List(ctx context.Context, req *computepb.ListFirewallsRequest, opts ...gax.CallOption) (*computepb.FirewallList, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/global/firewalls", 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() + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.FirewallList{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Patch updates the specified firewall rule with the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. +func (c *firewallsRESTClient) Patch(ctx context.Context, req *computepb.PatchFirewallRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetFirewallResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/global/firewalls/%v", req.GetProject(), req.GetFirewall()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("PATCH", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Update updates the specified firewall rule with the data included in the request. Note that all fields will be updated if using PUT, even fields that are not specified. To update individual fields, please use PATCH instead. +func (c *firewallsRESTClient) Update(ctx context.Context, req *computepb.UpdateFirewallRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetFirewallResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("") + + params := url.Values{} + if req.GetFirewall() != "" { + params.Add("firewall", fmt.Sprintf("%v", req.GetFirewall())) + } + if req.GetProject() != "" { + params.Add("project", fmt.Sprintf("%v", req.GetProject())) + } + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("PUT", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} diff --git a/compute/apiv1/firewalls_client_example_test.go b/compute/apiv1/firewalls_client_example_test.go new file mode 100644 index 00000000000..e1db038fb2e --- /dev/null +++ b/compute/apiv1/firewalls_client_example_test.go @@ -0,0 +1,150 @@ +// Copyright 2021 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_test + +import ( + "context" + + compute "cloud.google.com/go/compute/apiv1" + computepb "google.golang.org/genproto/googleapis/cloud/compute/v1" +) + +func ExampleNewFirewallsRESTClient() { + ctx := context.Background() + c, err := compute.NewFirewallsRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + // TODO: Use client. + _ = c +} + +func ExampleFirewallsClient_Delete() { + ctx := context.Background() + c, err := compute.NewFirewallsRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.DeleteFirewallRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Delete(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleFirewallsClient_Get() { + ctx := context.Background() + c, err := compute.NewFirewallsRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.GetFirewallRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Get(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleFirewallsClient_Insert() { + ctx := context.Background() + c, err := compute.NewFirewallsRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.InsertFirewallRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Insert(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleFirewallsClient_List() { + ctx := context.Background() + c, err := compute.NewFirewallsRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.ListFirewallsRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.List(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleFirewallsClient_Patch() { + ctx := context.Background() + c, err := compute.NewFirewallsRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.PatchFirewallRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Patch(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleFirewallsClient_Update() { + ctx := context.Background() + c, err := compute.NewFirewallsRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.UpdateFirewallRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Update(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} diff --git a/compute/apiv1/forwarding_rules_client.go b/compute/apiv1/forwarding_rules_client.go new file mode 100644 index 00000000000..de0011546a5 --- /dev/null +++ b/compute/apiv1/forwarding_rules_client.go @@ -0,0 +1,626 @@ +// Copyright 2021 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/ioutil" + "net/http" + "net/url" + + gax "github.com/googleapis/gax-go/v2" + "google.golang.org/api/option" + "google.golang.org/api/option/internaloption" + httptransport "google.golang.org/api/transport/http" + computepb "google.golang.org/genproto/googleapis/cloud/compute/v1" + "google.golang.org/grpc" + "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/encoding/protojson" +) + +var newForwardingRulesClientHook clientHook + +// ForwardingRulesCallOptions contains the retry settings for each method of ForwardingRulesClient. +type ForwardingRulesCallOptions struct { + AggregatedList []gax.CallOption + Delete []gax.CallOption + Get []gax.CallOption + Insert []gax.CallOption + List []gax.CallOption + Patch []gax.CallOption + SetLabels []gax.CallOption + SetTarget []gax.CallOption +} + +// internalForwardingRulesClient is an interface that defines the methods availaible from Google Compute Engine API. +type internalForwardingRulesClient interface { + Close() error + setGoogleClientInfo(...string) + Connection() *grpc.ClientConn + AggregatedList(context.Context, *computepb.AggregatedListForwardingRulesRequest, ...gax.CallOption) (*computepb.ForwardingRuleAggregatedList, error) + Delete(context.Context, *computepb.DeleteForwardingRuleRequest, ...gax.CallOption) (*computepb.Operation, error) + Get(context.Context, *computepb.GetForwardingRuleRequest, ...gax.CallOption) (*computepb.ForwardingRule, error) + Insert(context.Context, *computepb.InsertForwardingRuleRequest, ...gax.CallOption) (*computepb.Operation, error) + List(context.Context, *computepb.ListForwardingRulesRequest, ...gax.CallOption) (*computepb.ForwardingRuleList, error) + Patch(context.Context, *computepb.PatchForwardingRuleRequest, ...gax.CallOption) (*computepb.Operation, error) + SetLabels(context.Context, *computepb.SetLabelsForwardingRuleRequest, ...gax.CallOption) (*computepb.Operation, error) + SetTarget(context.Context, *computepb.SetTargetForwardingRuleRequest, ...gax.CallOption) (*computepb.Operation, error) +} + +// ForwardingRulesClient 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 ForwardingRules API. +type ForwardingRulesClient struct { + // The internal transport-dependent client. + internalClient internalForwardingRulesClient + + // The call options for this service. + CallOptions *ForwardingRulesCallOptions +} + +// 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 *ForwardingRulesClient) 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 *ForwardingRulesClient) setGoogleClientInfo(keyval ...string) { + c.internalClient.setGoogleClientInfo(keyval...) +} + +// Connection returns a connection to the API service. +// +// Deprecated. +func (c *ForwardingRulesClient) Connection() *grpc.ClientConn { + return c.internalClient.Connection() +} + +// AggregatedList retrieves an aggregated list of forwarding rules. +func (c *ForwardingRulesClient) AggregatedList(ctx context.Context, req *computepb.AggregatedListForwardingRulesRequest, opts ...gax.CallOption) (*computepb.ForwardingRuleAggregatedList, error) { + return c.internalClient.AggregatedList(ctx, req, opts...) +} + +// Delete deletes the specified ForwardingRule resource. +func (c *ForwardingRulesClient) Delete(ctx context.Context, req *computepb.DeleteForwardingRuleRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.Delete(ctx, req, opts...) +} + +// Get returns the specified ForwardingRule resource. +func (c *ForwardingRulesClient) Get(ctx context.Context, req *computepb.GetForwardingRuleRequest, opts ...gax.CallOption) (*computepb.ForwardingRule, error) { + return c.internalClient.Get(ctx, req, opts...) +} + +// Insert creates a ForwardingRule resource in the specified project and region using the data included in the request. +func (c *ForwardingRulesClient) Insert(ctx context.Context, req *computepb.InsertForwardingRuleRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.Insert(ctx, req, opts...) +} + +// List retrieves a list of ForwardingRule resources available to the specified project and region. +func (c *ForwardingRulesClient) List(ctx context.Context, req *computepb.ListForwardingRulesRequest, opts ...gax.CallOption) (*computepb.ForwardingRuleList, error) { + return c.internalClient.List(ctx, req, opts...) +} + +// Patch updates the specified forwarding rule with the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. Currently, you can only patch the network_tier field. +func (c *ForwardingRulesClient) Patch(ctx context.Context, req *computepb.PatchForwardingRuleRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.Patch(ctx, req, opts...) +} + +// SetLabels sets the labels on the specified resource. To learn more about labels, read the Labeling Resources documentation. +func (c *ForwardingRulesClient) SetLabels(ctx context.Context, req *computepb.SetLabelsForwardingRuleRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.SetLabels(ctx, req, opts...) +} + +// SetTarget changes target URL for forwarding rule. The new target should be of the same type as the old target. +func (c *ForwardingRulesClient) SetTarget(ctx context.Context, req *computepb.SetTargetForwardingRuleRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.SetTarget(ctx, req, opts...) +} + +// Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls. +type forwardingRulesRESTClient struct { + // The http endpoint to connect to. + endpoint string + + // The http client. + httpClient *http.Client + + // The x-goog-* metadata to be sent with each request. + xGoogMetadata metadata.MD +} + +// NewForwardingRulesRESTClient creates a new forwarding rules rest client. +// +// The ForwardingRules API. +func NewForwardingRulesRESTClient(ctx context.Context, opts ...option.ClientOption) (*ForwardingRulesClient, error) { + clientOpts := append(defaultForwardingRulesRESTClientOptions(), opts...) + httpClient, endpoint, err := httptransport.NewClient(ctx, clientOpts...) + if err != nil { + return nil, err + } + + c := &forwardingRulesRESTClient{ + endpoint: endpoint, + httpClient: httpClient, + } + c.setGoogleClientInfo() + + return &ForwardingRulesClient{internalClient: c, CallOptions: &ForwardingRulesCallOptions{}}, nil +} + +func defaultForwardingRulesRESTClientOptions() []option.ClientOption { + return []option.ClientOption{ + internaloption.WithDefaultEndpoint("compute.googleapis.com"), + internaloption.WithDefaultMTLSEndpoint("compute.mtls.googleapis.com"), + internaloption.WithDefaultAudience("https://compute.googleapis.com/"), + internaloption.WithDefaultScopes(DefaultAuthScopes()...), + } +} + +// setGoogleClientInfo sets the name and version of the application in +// the `x-goog-api-client` header passed on each request. Intended for +// use by Google-written clients. +func (c *forwardingRulesRESTClient) setGoogleClientInfo(keyval ...string) { + kv := append([]string{"gl-go", versionGo()}, keyval...) + kv = append(kv, "gapic", versionClient, "gax", gax.Version, "rest", "UNKNOWN") + c.xGoogMetadata = metadata.Pairs("x-goog-api-client", gax.XGoogHeader(kv...)) +} + +// Close closes the connection to the API service. The user should invoke this when +// the client is no longer required. +func (c *forwardingRulesRESTClient) Close() error { + // Replace httpClient with nil to force cleanup. + c.httpClient = nil + return nil +} + +// Connection returns a connection to the API service. +// +// Deprecated. +func (c *forwardingRulesRESTClient) Connection() *grpc.ClientConn { + return nil +} + +// AggregatedList retrieves an aggregated list of forwarding rules. +func (c *forwardingRulesRESTClient) AggregatedList(ctx context.Context, req *computepb.AggregatedListForwardingRulesRequest, opts ...gax.CallOption) (*computepb.ForwardingRuleAggregatedList, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/aggregated/forwardingRules", req.GetProject()) + + params := url.Values{} + if req != nil && req.Filter != nil { + params.Add("filter", fmt.Sprintf("%v", req.GetFilter())) + } + if req != nil && req.IncludeAllScopes != nil { + params.Add("includeAllScopes", fmt.Sprintf("%v", req.GetIncludeAllScopes())) + } + 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() + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.ForwardingRuleAggregatedList{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Delete deletes the specified ForwardingRule resource. +func (c *forwardingRulesRESTClient) Delete(ctx context.Context, req *computepb.DeleteForwardingRuleRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/forwardingRules/%v", req.GetProject(), req.GetRegion(), req.GetForwardingRule()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("DELETE", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Get returns the specified ForwardingRule resource. +func (c *forwardingRulesRESTClient) Get(ctx context.Context, req *computepb.GetForwardingRuleRequest, opts ...gax.CallOption) (*computepb.ForwardingRule, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/forwardingRules/%v", req.GetProject(), req.GetRegion(), req.GetForwardingRule()) + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.ForwardingRule{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Insert creates a ForwardingRule resource in the specified project and region using the data included in the request. +func (c *forwardingRulesRESTClient) Insert(ctx context.Context, req *computepb.InsertForwardingRuleRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetForwardingRuleResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/forwardingRules", req.GetProject(), req.GetRegion()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// List retrieves a list of ForwardingRule resources available to the specified project and region. +func (c *forwardingRulesRESTClient) List(ctx context.Context, req *computepb.ListForwardingRulesRequest, opts ...gax.CallOption) (*computepb.ForwardingRuleList, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/forwardingRules", 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() + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.ForwardingRuleList{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Patch updates the specified forwarding rule with the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. Currently, you can only patch the network_tier field. +func (c *forwardingRulesRESTClient) Patch(ctx context.Context, req *computepb.PatchForwardingRuleRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetForwardingRuleResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/forwardingRules/%v", req.GetProject(), req.GetRegion(), req.GetForwardingRule()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("PATCH", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// SetLabels sets the labels on the specified resource. To learn more about labels, read the Labeling Resources documentation. +func (c *forwardingRulesRESTClient) SetLabels(ctx context.Context, req *computepb.SetLabelsForwardingRuleRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetRegionSetLabelsRequestResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/forwardingRules/%v/setLabels", req.GetProject(), req.GetRegion(), req.GetResource()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// SetTarget changes target URL for forwarding rule. The new target should be of the same type as the old target. +func (c *forwardingRulesRESTClient) SetTarget(ctx context.Context, req *computepb.SetTargetForwardingRuleRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetTargetReferenceResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/forwardingRules/%v/setTarget", req.GetProject(), req.GetRegion(), req.GetForwardingRule()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} diff --git a/compute/apiv1/forwarding_rules_client_example_test.go b/compute/apiv1/forwarding_rules_client_example_test.go new file mode 100644 index 00000000000..1a2a9a5495f --- /dev/null +++ b/compute/apiv1/forwarding_rules_client_example_test.go @@ -0,0 +1,188 @@ +// Copyright 2021 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_test + +import ( + "context" + + compute "cloud.google.com/go/compute/apiv1" + computepb "google.golang.org/genproto/googleapis/cloud/compute/v1" +) + +func ExampleNewForwardingRulesRESTClient() { + ctx := context.Background() + c, err := compute.NewForwardingRulesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + // TODO: Use client. + _ = c +} + +func ExampleForwardingRulesClient_AggregatedList() { + ctx := context.Background() + c, err := compute.NewForwardingRulesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.AggregatedListForwardingRulesRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.AggregatedList(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleForwardingRulesClient_Delete() { + ctx := context.Background() + c, err := compute.NewForwardingRulesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.DeleteForwardingRuleRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Delete(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleForwardingRulesClient_Get() { + ctx := context.Background() + c, err := compute.NewForwardingRulesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.GetForwardingRuleRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Get(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleForwardingRulesClient_Insert() { + ctx := context.Background() + c, err := compute.NewForwardingRulesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.InsertForwardingRuleRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Insert(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleForwardingRulesClient_List() { + ctx := context.Background() + c, err := compute.NewForwardingRulesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.ListForwardingRulesRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.List(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleForwardingRulesClient_Patch() { + ctx := context.Background() + c, err := compute.NewForwardingRulesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.PatchForwardingRuleRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Patch(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleForwardingRulesClient_SetLabels() { + ctx := context.Background() + c, err := compute.NewForwardingRulesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.SetLabelsForwardingRuleRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.SetLabels(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleForwardingRulesClient_SetTarget() { + ctx := context.Background() + c, err := compute.NewForwardingRulesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.SetTargetForwardingRuleRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.SetTarget(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} diff --git a/compute/apiv1/gapic_metadata.json b/compute/apiv1/gapic_metadata.json new file mode 100644 index 00000000000..6474e15ecd9 --- /dev/null +++ b/compute/apiv1/gapic_metadata.json @@ -0,0 +1,3581 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.cloud.compute.v1", + "libraryPackage": "cloud.google.com/go/compute/apiv1", + "services": { + "AcceleratorTypes": { + "clients": { + "rest": { + "libraryClient": "AcceleratorTypesClient", + "rpcs": { + "AggregatedList": { + "methods": [ + "AggregatedList" + ] + }, + "Get": { + "methods": [ + "Get" + ] + }, + "List": { + "methods": [ + "List" + ] + } + } + } + } + }, + "Addresses": { + "clients": { + "rest": { + "libraryClient": "AddressesClient", + "rpcs": { + "AggregatedList": { + "methods": [ + "AggregatedList" + ] + }, + "Delete": { + "methods": [ + "Delete" + ] + }, + "Get": { + "methods": [ + "Get" + ] + }, + "Insert": { + "methods": [ + "Insert" + ] + }, + "List": { + "methods": [ + "List" + ] + } + } + } + } + }, + "Autoscalers": { + "clients": { + "rest": { + "libraryClient": "AutoscalersClient", + "rpcs": { + "AggregatedList": { + "methods": [ + "AggregatedList" + ] + }, + "Delete": { + "methods": [ + "Delete" + ] + }, + "Get": { + "methods": [ + "Get" + ] + }, + "Insert": { + "methods": [ + "Insert" + ] + }, + "List": { + "methods": [ + "List" + ] + }, + "Patch": { + "methods": [ + "Patch" + ] + }, + "Update": { + "methods": [ + "Update" + ] + } + } + } + } + }, + "BackendBuckets": { + "clients": { + "rest": { + "libraryClient": "BackendBucketsClient", + "rpcs": { + "AddSignedUrlKey": { + "methods": [ + "AddSignedUrlKey" + ] + }, + "Delete": { + "methods": [ + "Delete" + ] + }, + "DeleteSignedUrlKey": { + "methods": [ + "DeleteSignedUrlKey" + ] + }, + "Get": { + "methods": [ + "Get" + ] + }, + "Insert": { + "methods": [ + "Insert" + ] + }, + "List": { + "methods": [ + "List" + ] + }, + "Patch": { + "methods": [ + "Patch" + ] + }, + "Update": { + "methods": [ + "Update" + ] + } + } + } + } + }, + "BackendServices": { + "clients": { + "rest": { + "libraryClient": "BackendServicesClient", + "rpcs": { + "AddSignedUrlKey": { + "methods": [ + "AddSignedUrlKey" + ] + }, + "AggregatedList": { + "methods": [ + "AggregatedList" + ] + }, + "Delete": { + "methods": [ + "Delete" + ] + }, + "DeleteSignedUrlKey": { + "methods": [ + "DeleteSignedUrlKey" + ] + }, + "Get": { + "methods": [ + "Get" + ] + }, + "GetHealth": { + "methods": [ + "GetHealth" + ] + }, + "Insert": { + "methods": [ + "Insert" + ] + }, + "List": { + "methods": [ + "List" + ] + }, + "Patch": { + "methods": [ + "Patch" + ] + }, + "SetSecurityPolicy": { + "methods": [ + "SetSecurityPolicy" + ] + }, + "Update": { + "methods": [ + "Update" + ] + } + } + } + } + }, + "DiskTypes": { + "clients": { + "rest": { + "libraryClient": "DiskTypesClient", + "rpcs": { + "AggregatedList": { + "methods": [ + "AggregatedList" + ] + }, + "Get": { + "methods": [ + "Get" + ] + }, + "List": { + "methods": [ + "List" + ] + } + } + } + } + }, + "Disks": { + "clients": { + "rest": { + "libraryClient": "DisksClient", + "rpcs": { + "AddResourcePolicies": { + "methods": [ + "AddResourcePolicies" + ] + }, + "AggregatedList": { + "methods": [ + "AggregatedList" + ] + }, + "CreateSnapshot": { + "methods": [ + "CreateSnapshot" + ] + }, + "Delete": { + "methods": [ + "Delete" + ] + }, + "Get": { + "methods": [ + "Get" + ] + }, + "GetIamPolicy": { + "methods": [ + "GetIamPolicy" + ] + }, + "Insert": { + "methods": [ + "Insert" + ] + }, + "List": { + "methods": [ + "List" + ] + }, + "RemoveResourcePolicies": { + "methods": [ + "RemoveResourcePolicies" + ] + }, + "Resize": { + "methods": [ + "Resize" + ] + }, + "SetIamPolicy": { + "methods": [ + "SetIamPolicy" + ] + }, + "SetLabels": { + "methods": [ + "SetLabels" + ] + }, + "TestIamPermissions": { + "methods": [ + "TestIamPermissions" + ] + } + } + } + } + }, + "ExternalVpnGateways": { + "clients": { + "rest": { + "libraryClient": "ExternalVpnGatewaysClient", + "rpcs": { + "Delete": { + "methods": [ + "Delete" + ] + }, + "Get": { + "methods": [ + "Get" + ] + }, + "Insert": { + "methods": [ + "Insert" + ] + }, + "List": { + "methods": [ + "List" + ] + }, + "SetLabels": { + "methods": [ + "SetLabels" + ] + }, + "TestIamPermissions": { + "methods": [ + "TestIamPermissions" + ] + } + } + } + } + }, + "FirewallPolicies": { + "clients": { + "rest": { + "libraryClient": "FirewallPoliciesClient", + "rpcs": { + "AddAssociation": { + "methods": [ + "AddAssociation" + ] + }, + "AddRule": { + "methods": [ + "AddRule" + ] + }, + "CloneRules": { + "methods": [ + "CloneRules" + ] + }, + "Delete": { + "methods": [ + "Delete" + ] + }, + "Get": { + "methods": [ + "Get" + ] + }, + "GetAssociation": { + "methods": [ + "GetAssociation" + ] + }, + "GetIamPolicy": { + "methods": [ + "GetIamPolicy" + ] + }, + "GetRule": { + "methods": [ + "GetRule" + ] + }, + "Insert": { + "methods": [ + "Insert" + ] + }, + "List": { + "methods": [ + "List" + ] + }, + "ListAssociations": { + "methods": [ + "ListAssociations" + ] + }, + "Move": { + "methods": [ + "Move" + ] + }, + "Patch": { + "methods": [ + "Patch" + ] + }, + "PatchRule": { + "methods": [ + "PatchRule" + ] + }, + "RemoveAssociation": { + "methods": [ + "RemoveAssociation" + ] + }, + "RemoveRule": { + "methods": [ + "RemoveRule" + ] + }, + "SetIamPolicy": { + "methods": [ + "SetIamPolicy" + ] + }, + "TestIamPermissions": { + "methods": [ + "TestIamPermissions" + ] + } + } + } + } + }, + "Firewalls": { + "clients": { + "rest": { + "libraryClient": "FirewallsClient", + "rpcs": { + "Delete": { + "methods": [ + "Delete" + ] + }, + "Get": { + "methods": [ + "Get" + ] + }, + "Insert": { + "methods": [ + "Insert" + ] + }, + "List": { + "methods": [ + "List" + ] + }, + "Patch": { + "methods": [ + "Patch" + ] + }, + "Update": { + "methods": [ + "Update" + ] + } + } + } + } + }, + "ForwardingRules": { + "clients": { + "rest": { + "libraryClient": "ForwardingRulesClient", + "rpcs": { + "AggregatedList": { + "methods": [ + "AggregatedList" + ] + }, + "Delete": { + "methods": [ + "Delete" + ] + }, + "Get": { + "methods": [ + "Get" + ] + }, + "Insert": { + "methods": [ + "Insert" + ] + }, + "List": { + "methods": [ + "List" + ] + }, + "Patch": { + "methods": [ + "Patch" + ] + }, + "SetLabels": { + "methods": [ + "SetLabels" + ] + }, + "SetTarget": { + "methods": [ + "SetTarget" + ] + } + } + } + } + }, + "GlobalAddresses": { + "clients": { + "rest": { + "libraryClient": "GlobalAddressesClient", + "rpcs": { + "Delete": { + "methods": [ + "Delete" + ] + }, + "Get": { + "methods": [ + "Get" + ] + }, + "Insert": { + "methods": [ + "Insert" + ] + }, + "List": { + "methods": [ + "List" + ] + } + } + } + } + }, + "GlobalForwardingRules": { + "clients": { + "rest": { + "libraryClient": "GlobalForwardingRulesClient", + "rpcs": { + "Delete": { + "methods": [ + "Delete" + ] + }, + "Get": { + "methods": [ + "Get" + ] + }, + "Insert": { + "methods": [ + "Insert" + ] + }, + "List": { + "methods": [ + "List" + ] + }, + "Patch": { + "methods": [ + "Patch" + ] + }, + "SetLabels": { + "methods": [ + "SetLabels" + ] + }, + "SetTarget": { + "methods": [ + "SetTarget" + ] + } + } + } + } + }, + "GlobalNetworkEndpointGroups": { + "clients": { + "rest": { + "libraryClient": "GlobalNetworkEndpointGroupsClient", + "rpcs": { + "AttachNetworkEndpoints": { + "methods": [ + "AttachNetworkEndpoints" + ] + }, + "Delete": { + "methods": [ + "Delete" + ] + }, + "DetachNetworkEndpoints": { + "methods": [ + "DetachNetworkEndpoints" + ] + }, + "Get": { + "methods": [ + "Get" + ] + }, + "Insert": { + "methods": [ + "Insert" + ] + }, + "List": { + "methods": [ + "List" + ] + }, + "ListNetworkEndpoints": { + "methods": [ + "ListNetworkEndpoints" + ] + } + } + } + } + }, + "GlobalOperations": { + "clients": { + "rest": { + "libraryClient": "GlobalOperationsClient", + "rpcs": { + "AggregatedList": { + "methods": [ + "AggregatedList" + ] + }, + "Delete": { + "methods": [ + "Delete" + ] + }, + "Get": { + "methods": [ + "Get" + ] + }, + "List": { + "methods": [ + "List" + ] + }, + "Wait": { + "methods": [ + "Wait" + ] + } + } + } + } + }, + "GlobalOrganizationOperations": { + "clients": { + "rest": { + "libraryClient": "GlobalOrganizationOperationsClient", + "rpcs": { + "Delete": { + "methods": [ + "Delete" + ] + }, + "Get": { + "methods": [ + "Get" + ] + }, + "List": { + "methods": [ + "List" + ] + } + } + } + } + }, + "GlobalPublicDelegatedPrefixes": { + "clients": { + "rest": { + "libraryClient": "GlobalPublicDelegatedPrefixesClient", + "rpcs": { + "Delete": { + "methods": [ + "Delete" + ] + }, + "Get": { + "methods": [ + "Get" + ] + }, + "Insert": { + "methods": [ + "Insert" + ] + }, + "List": { + "methods": [ + "List" + ] + }, + "Patch": { + "methods": [ + "Patch" + ] + } + } + } + } + }, + "HealthChecks": { + "clients": { + "rest": { + "libraryClient": "HealthChecksClient", + "rpcs": { + "AggregatedList": { + "methods": [ + "AggregatedList" + ] + }, + "Delete": { + "methods": [ + "Delete" + ] + }, + "Get": { + "methods": [ + "Get" + ] + }, + "Insert": { + "methods": [ + "Insert" + ] + }, + "List": { + "methods": [ + "List" + ] + }, + "Patch": { + "methods": [ + "Patch" + ] + }, + "Update": { + "methods": [ + "Update" + ] + } + } + } + } + }, + "Images": { + "clients": { + "rest": { + "libraryClient": "ImagesClient", + "rpcs": { + "Delete": { + "methods": [ + "Delete" + ] + }, + "Deprecate": { + "methods": [ + "Deprecate" + ] + }, + "Get": { + "methods": [ + "Get" + ] + }, + "GetFromFamily": { + "methods": [ + "GetFromFamily" + ] + }, + "GetIamPolicy": { + "methods": [ + "GetIamPolicy" + ] + }, + "Insert": { + "methods": [ + "Insert" + ] + }, + "List": { + "methods": [ + "List" + ] + }, + "Patch": { + "methods": [ + "Patch" + ] + }, + "SetIamPolicy": { + "methods": [ + "SetIamPolicy" + ] + }, + "SetLabels": { + "methods": [ + "SetLabels" + ] + }, + "TestIamPermissions": { + "methods": [ + "TestIamPermissions" + ] + } + } + } + } + }, + "InstanceGroupManagers": { + "clients": { + "rest": { + "libraryClient": "InstanceGroupManagersClient", + "rpcs": { + "AbandonInstances": { + "methods": [ + "AbandonInstances" + ] + }, + "AggregatedList": { + "methods": [ + "AggregatedList" + ] + }, + "ApplyUpdatesToInstances": { + "methods": [ + "ApplyUpdatesToInstances" + ] + }, + "CreateInstances": { + "methods": [ + "CreateInstances" + ] + }, + "Delete": { + "methods": [ + "Delete" + ] + }, + "DeleteInstances": { + "methods": [ + "DeleteInstances" + ] + }, + "DeletePerInstanceConfigs": { + "methods": [ + "DeletePerInstanceConfigs" + ] + }, + "Get": { + "methods": [ + "Get" + ] + }, + "Insert": { + "methods": [ + "Insert" + ] + }, + "List": { + "methods": [ + "List" + ] + }, + "ListErrors": { + "methods": [ + "ListErrors" + ] + }, + "ListManagedInstances": { + "methods": [ + "ListManagedInstances" + ] + }, + "ListPerInstanceConfigs": { + "methods": [ + "ListPerInstanceConfigs" + ] + }, + "Patch": { + "methods": [ + "Patch" + ] + }, + "PatchPerInstanceConfigs": { + "methods": [ + "PatchPerInstanceConfigs" + ] + }, + "RecreateInstances": { + "methods": [ + "RecreateInstances" + ] + }, + "Resize": { + "methods": [ + "Resize" + ] + }, + "SetInstanceTemplate": { + "methods": [ + "SetInstanceTemplate" + ] + }, + "SetTargetPools": { + "methods": [ + "SetTargetPools" + ] + }, + "UpdatePerInstanceConfigs": { + "methods": [ + "UpdatePerInstanceConfigs" + ] + } + } + } + } + }, + "InstanceGroups": { + "clients": { + "rest": { + "libraryClient": "InstanceGroupsClient", + "rpcs": { + "AddInstances": { + "methods": [ + "AddInstances" + ] + }, + "AggregatedList": { + "methods": [ + "AggregatedList" + ] + }, + "Delete": { + "methods": [ + "Delete" + ] + }, + "Get": { + "methods": [ + "Get" + ] + }, + "Insert": { + "methods": [ + "Insert" + ] + }, + "List": { + "methods": [ + "List" + ] + }, + "ListInstances": { + "methods": [ + "ListInstances" + ] + }, + "RemoveInstances": { + "methods": [ + "RemoveInstances" + ] + }, + "SetNamedPorts": { + "methods": [ + "SetNamedPorts" + ] + } + } + } + } + }, + "InstanceTemplates": { + "clients": { + "rest": { + "libraryClient": "InstanceTemplatesClient", + "rpcs": { + "Delete": { + "methods": [ + "Delete" + ] + }, + "Get": { + "methods": [ + "Get" + ] + }, + "GetIamPolicy": { + "methods": [ + "GetIamPolicy" + ] + }, + "Insert": { + "methods": [ + "Insert" + ] + }, + "List": { + "methods": [ + "List" + ] + }, + "SetIamPolicy": { + "methods": [ + "SetIamPolicy" + ] + }, + "TestIamPermissions": { + "methods": [ + "TestIamPermissions" + ] + } + } + } + } + }, + "Instances": { + "clients": { + "rest": { + "libraryClient": "InstancesClient", + "rpcs": { + "AddAccessConfig": { + "methods": [ + "AddAccessConfig" + ] + }, + "AddResourcePolicies": { + "methods": [ + "AddResourcePolicies" + ] + }, + "AggregatedList": { + "methods": [ + "AggregatedList" + ] + }, + "AttachDisk": { + "methods": [ + "AttachDisk" + ] + }, + "BulkInsert": { + "methods": [ + "BulkInsert" + ] + }, + "Delete": { + "methods": [ + "Delete" + ] + }, + "DeleteAccessConfig": { + "methods": [ + "DeleteAccessConfig" + ] + }, + "DetachDisk": { + "methods": [ + "DetachDisk" + ] + }, + "Get": { + "methods": [ + "Get" + ] + }, + "GetEffectiveFirewalls": { + "methods": [ + "GetEffectiveFirewalls" + ] + }, + "GetGuestAttributes": { + "methods": [ + "GetGuestAttributes" + ] + }, + "GetIamPolicy": { + "methods": [ + "GetIamPolicy" + ] + }, + "GetScreenshot": { + "methods": [ + "GetScreenshot" + ] + }, + "GetSerialPortOutput": { + "methods": [ + "GetSerialPortOutput" + ] + }, + "GetShieldedInstanceIdentity": { + "methods": [ + "GetShieldedInstanceIdentity" + ] + }, + "Insert": { + "methods": [ + "Insert" + ] + }, + "List": { + "methods": [ + "List" + ] + }, + "ListReferrers": { + "methods": [ + "ListReferrers" + ] + }, + "RemoveResourcePolicies": { + "methods": [ + "RemoveResourcePolicies" + ] + }, + "Reset": { + "methods": [ + "Reset" + ] + }, + "SetDeletionProtection": { + "methods": [ + "SetDeletionProtection" + ] + }, + "SetDiskAutoDelete": { + "methods": [ + "SetDiskAutoDelete" + ] + }, + "SetIamPolicy": { + "methods": [ + "SetIamPolicy" + ] + }, + "SetLabels": { + "methods": [ + "SetLabels" + ] + }, + "SetMachineResources": { + "methods": [ + "SetMachineResources" + ] + }, + "SetMachineType": { + "methods": [ + "SetMachineType" + ] + }, + "SetMetadata": { + "methods": [ + "SetMetadata" + ] + }, + "SetMinCpuPlatform": { + "methods": [ + "SetMinCpuPlatform" + ] + }, + "SetScheduling": { + "methods": [ + "SetScheduling" + ] + }, + "SetServiceAccount": { + "methods": [ + "SetServiceAccount" + ] + }, + "SetShieldedInstanceIntegrityPolicy": { + "methods": [ + "SetShieldedInstanceIntegrityPolicy" + ] + }, + "SetTags": { + "methods": [ + "SetTags" + ] + }, + "SimulateMaintenanceEvent": { + "methods": [ + "SimulateMaintenanceEvent" + ] + }, + "Start": { + "methods": [ + "Start" + ] + }, + "StartWithEncryptionKey": { + "methods": [ + "StartWithEncryptionKey" + ] + }, + "Stop": { + "methods": [ + "Stop" + ] + }, + "TestIamPermissions": { + "methods": [ + "TestIamPermissions" + ] + }, + "Update": { + "methods": [ + "Update" + ] + }, + "UpdateAccessConfig": { + "methods": [ + "UpdateAccessConfig" + ] + }, + "UpdateDisplayDevice": { + "methods": [ + "UpdateDisplayDevice" + ] + }, + "UpdateNetworkInterface": { + "methods": [ + "UpdateNetworkInterface" + ] + }, + "UpdateShieldedInstanceConfig": { + "methods": [ + "UpdateShieldedInstanceConfig" + ] + } + } + } + } + }, + "InterconnectAttachments": { + "clients": { + "rest": { + "libraryClient": "InterconnectAttachmentsClient", + "rpcs": { + "AggregatedList": { + "methods": [ + "AggregatedList" + ] + }, + "Delete": { + "methods": [ + "Delete" + ] + }, + "Get": { + "methods": [ + "Get" + ] + }, + "Insert": { + "methods": [ + "Insert" + ] + }, + "List": { + "methods": [ + "List" + ] + }, + "Patch": { + "methods": [ + "Patch" + ] + } + } + } + } + }, + "InterconnectLocations": { + "clients": { + "rest": { + "libraryClient": "InterconnectLocationsClient", + "rpcs": { + "Get": { + "methods": [ + "Get" + ] + }, + "List": { + "methods": [ + "List" + ] + } + } + } + } + }, + "Interconnects": { + "clients": { + "rest": { + "libraryClient": "InterconnectsClient", + "rpcs": { + "Delete": { + "methods": [ + "Delete" + ] + }, + "Get": { + "methods": [ + "Get" + ] + }, + "GetDiagnostics": { + "methods": [ + "GetDiagnostics" + ] + }, + "Insert": { + "methods": [ + "Insert" + ] + }, + "List": { + "methods": [ + "List" + ] + }, + "Patch": { + "methods": [ + "Patch" + ] + } + } + } + } + }, + "LicenseCodes": { + "clients": { + "rest": { + "libraryClient": "LicenseCodesClient", + "rpcs": { + "Get": { + "methods": [ + "Get" + ] + }, + "TestIamPermissions": { + "methods": [ + "TestIamPermissions" + ] + } + } + } + } + }, + "Licenses": { + "clients": { + "rest": { + "libraryClient": "LicensesClient", + "rpcs": { + "Delete": { + "methods": [ + "Delete" + ] + }, + "Get": { + "methods": [ + "Get" + ] + }, + "GetIamPolicy": { + "methods": [ + "GetIamPolicy" + ] + }, + "Insert": { + "methods": [ + "Insert" + ] + }, + "List": { + "methods": [ + "List" + ] + }, + "SetIamPolicy": { + "methods": [ + "SetIamPolicy" + ] + }, + "TestIamPermissions": { + "methods": [ + "TestIamPermissions" + ] + } + } + } + } + }, + "MachineTypes": { + "clients": { + "rest": { + "libraryClient": "MachineTypesClient", + "rpcs": { + "AggregatedList": { + "methods": [ + "AggregatedList" + ] + }, + "Get": { + "methods": [ + "Get" + ] + }, + "List": { + "methods": [ + "List" + ] + } + } + } + } + }, + "NetworkEndpointGroups": { + "clients": { + "rest": { + "libraryClient": "NetworkEndpointGroupsClient", + "rpcs": { + "AggregatedList": { + "methods": [ + "AggregatedList" + ] + }, + "AttachNetworkEndpoints": { + "methods": [ + "AttachNetworkEndpoints" + ] + }, + "Delete": { + "methods": [ + "Delete" + ] + }, + "DetachNetworkEndpoints": { + "methods": [ + "DetachNetworkEndpoints" + ] + }, + "Get": { + "methods": [ + "Get" + ] + }, + "Insert": { + "methods": [ + "Insert" + ] + }, + "List": { + "methods": [ + "List" + ] + }, + "ListNetworkEndpoints": { + "methods": [ + "ListNetworkEndpoints" + ] + }, + "TestIamPermissions": { + "methods": [ + "TestIamPermissions" + ] + } + } + } + } + }, + "Networks": { + "clients": { + "rest": { + "libraryClient": "NetworksClient", + "rpcs": { + "AddPeering": { + "methods": [ + "AddPeering" + ] + }, + "Delete": { + "methods": [ + "Delete" + ] + }, + "Get": { + "methods": [ + "Get" + ] + }, + "GetEffectiveFirewalls": { + "methods": [ + "GetEffectiveFirewalls" + ] + }, + "Insert": { + "methods": [ + "Insert" + ] + }, + "List": { + "methods": [ + "List" + ] + }, + "ListPeeringRoutes": { + "methods": [ + "ListPeeringRoutes" + ] + }, + "Patch": { + "methods": [ + "Patch" + ] + }, + "RemovePeering": { + "methods": [ + "RemovePeering" + ] + }, + "SwitchToCustomMode": { + "methods": [ + "SwitchToCustomMode" + ] + }, + "UpdatePeering": { + "methods": [ + "UpdatePeering" + ] + } + } + } + } + }, + "NodeGroups": { + "clients": { + "rest": { + "libraryClient": "NodeGroupsClient", + "rpcs": { + "AddNodes": { + "methods": [ + "AddNodes" + ] + }, + "AggregatedList": { + "methods": [ + "AggregatedList" + ] + }, + "Delete": { + "methods": [ + "Delete" + ] + }, + "DeleteNodes": { + "methods": [ + "DeleteNodes" + ] + }, + "Get": { + "methods": [ + "Get" + ] + }, + "GetIamPolicy": { + "methods": [ + "GetIamPolicy" + ] + }, + "Insert": { + "methods": [ + "Insert" + ] + }, + "List": { + "methods": [ + "List" + ] + }, + "ListNodes": { + "methods": [ + "ListNodes" + ] + }, + "Patch": { + "methods": [ + "Patch" + ] + }, + "SetIamPolicy": { + "methods": [ + "SetIamPolicy" + ] + }, + "SetNodeTemplate": { + "methods": [ + "SetNodeTemplate" + ] + }, + "TestIamPermissions": { + "methods": [ + "TestIamPermissions" + ] + } + } + } + } + }, + "NodeTemplates": { + "clients": { + "rest": { + "libraryClient": "NodeTemplatesClient", + "rpcs": { + "AggregatedList": { + "methods": [ + "AggregatedList" + ] + }, + "Delete": { + "methods": [ + "Delete" + ] + }, + "Get": { + "methods": [ + "Get" + ] + }, + "GetIamPolicy": { + "methods": [ + "GetIamPolicy" + ] + }, + "Insert": { + "methods": [ + "Insert" + ] + }, + "List": { + "methods": [ + "List" + ] + }, + "SetIamPolicy": { + "methods": [ + "SetIamPolicy" + ] + }, + "TestIamPermissions": { + "methods": [ + "TestIamPermissions" + ] + } + } + } + } + }, + "NodeTypes": { + "clients": { + "rest": { + "libraryClient": "NodeTypesClient", + "rpcs": { + "AggregatedList": { + "methods": [ + "AggregatedList" + ] + }, + "Get": { + "methods": [ + "Get" + ] + }, + "List": { + "methods": [ + "List" + ] + } + } + } + } + }, + "PacketMirrorings": { + "clients": { + "rest": { + "libraryClient": "PacketMirroringsClient", + "rpcs": { + "AggregatedList": { + "methods": [ + "AggregatedList" + ] + }, + "Delete": { + "methods": [ + "Delete" + ] + }, + "Get": { + "methods": [ + "Get" + ] + }, + "Insert": { + "methods": [ + "Insert" + ] + }, + "List": { + "methods": [ + "List" + ] + }, + "Patch": { + "methods": [ + "Patch" + ] + }, + "TestIamPermissions": { + "methods": [ + "TestIamPermissions" + ] + } + } + } + } + }, + "Projects": { + "clients": { + "rest": { + "libraryClient": "ProjectsClient", + "rpcs": { + "DisableXpnHost": { + "methods": [ + "DisableXpnHost" + ] + }, + "DisableXpnResource": { + "methods": [ + "DisableXpnResource" + ] + }, + "EnableXpnHost": { + "methods": [ + "EnableXpnHost" + ] + }, + "EnableXpnResource": { + "methods": [ + "EnableXpnResource" + ] + }, + "Get": { + "methods": [ + "Get" + ] + }, + "GetXpnHost": { + "methods": [ + "GetXpnHost" + ] + }, + "GetXpnResources": { + "methods": [ + "GetXpnResources" + ] + }, + "ListXpnHosts": { + "methods": [ + "ListXpnHosts" + ] + }, + "MoveDisk": { + "methods": [ + "MoveDisk" + ] + }, + "MoveInstance": { + "methods": [ + "MoveInstance" + ] + }, + "SetCommonInstanceMetadata": { + "methods": [ + "SetCommonInstanceMetadata" + ] + }, + "SetDefaultNetworkTier": { + "methods": [ + "SetDefaultNetworkTier" + ] + }, + "SetUsageExportBucket": { + "methods": [ + "SetUsageExportBucket" + ] + } + } + } + } + }, + "PublicAdvertisedPrefixes": { + "clients": { + "rest": { + "libraryClient": "PublicAdvertisedPrefixesClient", + "rpcs": { + "Delete": { + "methods": [ + "Delete" + ] + }, + "Get": { + "methods": [ + "Get" + ] + }, + "Insert": { + "methods": [ + "Insert" + ] + }, + "List": { + "methods": [ + "List" + ] + }, + "Patch": { + "methods": [ + "Patch" + ] + } + } + } + } + }, + "PublicDelegatedPrefixes": { + "clients": { + "rest": { + "libraryClient": "PublicDelegatedPrefixesClient", + "rpcs": { + "AggregatedList": { + "methods": [ + "AggregatedList" + ] + }, + "Delete": { + "methods": [ + "Delete" + ] + }, + "Get": { + "methods": [ + "Get" + ] + }, + "Insert": { + "methods": [ + "Insert" + ] + }, + "List": { + "methods": [ + "List" + ] + }, + "Patch": { + "methods": [ + "Patch" + ] + } + } + } + } + }, + "RegionAutoscalers": { + "clients": { + "rest": { + "libraryClient": "RegionAutoscalersClient", + "rpcs": { + "Delete": { + "methods": [ + "Delete" + ] + }, + "Get": { + "methods": [ + "Get" + ] + }, + "Insert": { + "methods": [ + "Insert" + ] + }, + "List": { + "methods": [ + "List" + ] + }, + "Patch": { + "methods": [ + "Patch" + ] + }, + "Update": { + "methods": [ + "Update" + ] + } + } + } + } + }, + "RegionBackendServices": { + "clients": { + "rest": { + "libraryClient": "RegionBackendServicesClient", + "rpcs": { + "Delete": { + "methods": [ + "Delete" + ] + }, + "Get": { + "methods": [ + "Get" + ] + }, + "GetHealth": { + "methods": [ + "GetHealth" + ] + }, + "Insert": { + "methods": [ + "Insert" + ] + }, + "List": { + "methods": [ + "List" + ] + }, + "Patch": { + "methods": [ + "Patch" + ] + }, + "Update": { + "methods": [ + "Update" + ] + } + } + } + } + }, + "RegionCommitments": { + "clients": { + "rest": { + "libraryClient": "RegionCommitmentsClient", + "rpcs": { + "AggregatedList": { + "methods": [ + "AggregatedList" + ] + }, + "Get": { + "methods": [ + "Get" + ] + }, + "Insert": { + "methods": [ + "Insert" + ] + }, + "List": { + "methods": [ + "List" + ] + } + } + } + } + }, + "RegionDiskTypes": { + "clients": { + "rest": { + "libraryClient": "RegionDiskTypesClient", + "rpcs": { + "Get": { + "methods": [ + "Get" + ] + }, + "List": { + "methods": [ + "List" + ] + } + } + } + } + }, + "RegionDisks": { + "clients": { + "rest": { + "libraryClient": "RegionDisksClient", + "rpcs": { + "AddResourcePolicies": { + "methods": [ + "AddResourcePolicies" + ] + }, + "CreateSnapshot": { + "methods": [ + "CreateSnapshot" + ] + }, + "Delete": { + "methods": [ + "Delete" + ] + }, + "Get": { + "methods": [ + "Get" + ] + }, + "GetIamPolicy": { + "methods": [ + "GetIamPolicy" + ] + }, + "Insert": { + "methods": [ + "Insert" + ] + }, + "List": { + "methods": [ + "List" + ] + }, + "RemoveResourcePolicies": { + "methods": [ + "RemoveResourcePolicies" + ] + }, + "Resize": { + "methods": [ + "Resize" + ] + }, + "SetIamPolicy": { + "methods": [ + "SetIamPolicy" + ] + }, + "SetLabels": { + "methods": [ + "SetLabels" + ] + }, + "TestIamPermissions": { + "methods": [ + "TestIamPermissions" + ] + } + } + } + } + }, + "RegionHealthCheckServices": { + "clients": { + "rest": { + "libraryClient": "RegionHealthCheckServicesClient", + "rpcs": { + "Delete": { + "methods": [ + "Delete" + ] + }, + "Get": { + "methods": [ + "Get" + ] + }, + "Insert": { + "methods": [ + "Insert" + ] + }, + "List": { + "methods": [ + "List" + ] + }, + "Patch": { + "methods": [ + "Patch" + ] + } + } + } + } + }, + "RegionHealthChecks": { + "clients": { + "rest": { + "libraryClient": "RegionHealthChecksClient", + "rpcs": { + "Delete": { + "methods": [ + "Delete" + ] + }, + "Get": { + "methods": [ + "Get" + ] + }, + "Insert": { + "methods": [ + "Insert" + ] + }, + "List": { + "methods": [ + "List" + ] + }, + "Patch": { + "methods": [ + "Patch" + ] + }, + "Update": { + "methods": [ + "Update" + ] + } + } + } + } + }, + "RegionInstanceGroupManagers": { + "clients": { + "rest": { + "libraryClient": "RegionInstanceGroupManagersClient", + "rpcs": { + "AbandonInstances": { + "methods": [ + "AbandonInstances" + ] + }, + "ApplyUpdatesToInstances": { + "methods": [ + "ApplyUpdatesToInstances" + ] + }, + "CreateInstances": { + "methods": [ + "CreateInstances" + ] + }, + "Delete": { + "methods": [ + "Delete" + ] + }, + "DeleteInstances": { + "methods": [ + "DeleteInstances" + ] + }, + "DeletePerInstanceConfigs": { + "methods": [ + "DeletePerInstanceConfigs" + ] + }, + "Get": { + "methods": [ + "Get" + ] + }, + "Insert": { + "methods": [ + "Insert" + ] + }, + "List": { + "methods": [ + "List" + ] + }, + "ListErrors": { + "methods": [ + "ListErrors" + ] + }, + "ListManagedInstances": { + "methods": [ + "ListManagedInstances" + ] + }, + "ListPerInstanceConfigs": { + "methods": [ + "ListPerInstanceConfigs" + ] + }, + "Patch": { + "methods": [ + "Patch" + ] + }, + "PatchPerInstanceConfigs": { + "methods": [ + "PatchPerInstanceConfigs" + ] + }, + "RecreateInstances": { + "methods": [ + "RecreateInstances" + ] + }, + "Resize": { + "methods": [ + "Resize" + ] + }, + "SetInstanceTemplate": { + "methods": [ + "SetInstanceTemplate" + ] + }, + "SetTargetPools": { + "methods": [ + "SetTargetPools" + ] + }, + "UpdatePerInstanceConfigs": { + "methods": [ + "UpdatePerInstanceConfigs" + ] + } + } + } + } + }, + "RegionInstanceGroups": { + "clients": { + "rest": { + "libraryClient": "RegionInstanceGroupsClient", + "rpcs": { + "Get": { + "methods": [ + "Get" + ] + }, + "List": { + "methods": [ + "List" + ] + }, + "ListInstances": { + "methods": [ + "ListInstances" + ] + }, + "SetNamedPorts": { + "methods": [ + "SetNamedPorts" + ] + } + } + } + } + }, + "RegionInstances": { + "clients": { + "rest": { + "libraryClient": "RegionInstancesClient", + "rpcs": { + "BulkInsert": { + "methods": [ + "BulkInsert" + ] + } + } + } + } + }, + "RegionNetworkEndpointGroups": { + "clients": { + "rest": { + "libraryClient": "RegionNetworkEndpointGroupsClient", + "rpcs": { + "Delete": { + "methods": [ + "Delete" + ] + }, + "Get": { + "methods": [ + "Get" + ] + }, + "Insert": { + "methods": [ + "Insert" + ] + }, + "List": { + "methods": [ + "List" + ] + } + } + } + } + }, + "RegionNotificationEndpoints": { + "clients": { + "rest": { + "libraryClient": "RegionNotificationEndpointsClient", + "rpcs": { + "Delete": { + "methods": [ + "Delete" + ] + }, + "Get": { + "methods": [ + "Get" + ] + }, + "Insert": { + "methods": [ + "Insert" + ] + }, + "List": { + "methods": [ + "List" + ] + } + } + } + } + }, + "RegionOperations": { + "clients": { + "rest": { + "libraryClient": "RegionOperationsClient", + "rpcs": { + "Delete": { + "methods": [ + "Delete" + ] + }, + "Get": { + "methods": [ + "Get" + ] + }, + "List": { + "methods": [ + "List" + ] + }, + "Wait": { + "methods": [ + "Wait" + ] + } + } + } + } + }, + "RegionSslCertificates": { + "clients": { + "rest": { + "libraryClient": "RegionSslCertificatesClient", + "rpcs": { + "Delete": { + "methods": [ + "Delete" + ] + }, + "Get": { + "methods": [ + "Get" + ] + }, + "Insert": { + "methods": [ + "Insert" + ] + }, + "List": { + "methods": [ + "List" + ] + } + } + } + } + }, + "RegionTargetHttpProxies": { + "clients": { + "rest": { + "libraryClient": "RegionTargetHttpProxiesClient", + "rpcs": { + "Delete": { + "methods": [ + "Delete" + ] + }, + "Get": { + "methods": [ + "Get" + ] + }, + "Insert": { + "methods": [ + "Insert" + ] + }, + "List": { + "methods": [ + "List" + ] + }, + "SetUrlMap": { + "methods": [ + "SetUrlMap" + ] + } + } + } + } + }, + "RegionTargetHttpsProxies": { + "clients": { + "rest": { + "libraryClient": "RegionTargetHttpsProxiesClient", + "rpcs": { + "Delete": { + "methods": [ + "Delete" + ] + }, + "Get": { + "methods": [ + "Get" + ] + }, + "Insert": { + "methods": [ + "Insert" + ] + }, + "List": { + "methods": [ + "List" + ] + }, + "SetSslCertificates": { + "methods": [ + "SetSslCertificates" + ] + }, + "SetUrlMap": { + "methods": [ + "SetUrlMap" + ] + } + } + } + } + }, + "RegionUrlMaps": { + "clients": { + "rest": { + "libraryClient": "RegionUrlMapsClient", + "rpcs": { + "Delete": { + "methods": [ + "Delete" + ] + }, + "Get": { + "methods": [ + "Get" + ] + }, + "Insert": { + "methods": [ + "Insert" + ] + }, + "List": { + "methods": [ + "List" + ] + }, + "Patch": { + "methods": [ + "Patch" + ] + }, + "Update": { + "methods": [ + "Update" + ] + }, + "Validate": { + "methods": [ + "Validate" + ] + } + } + } + } + }, + "Regions": { + "clients": { + "rest": { + "libraryClient": "RegionsClient", + "rpcs": { + "Get": { + "methods": [ + "Get" + ] + }, + "List": { + "methods": [ + "List" + ] + } + } + } + } + }, + "Reservations": { + "clients": { + "rest": { + "libraryClient": "ReservationsClient", + "rpcs": { + "AggregatedList": { + "methods": [ + "AggregatedList" + ] + }, + "Delete": { + "methods": [ + "Delete" + ] + }, + "Get": { + "methods": [ + "Get" + ] + }, + "GetIamPolicy": { + "methods": [ + "GetIamPolicy" + ] + }, + "Insert": { + "methods": [ + "Insert" + ] + }, + "List": { + "methods": [ + "List" + ] + }, + "Resize": { + "methods": [ + "Resize" + ] + }, + "SetIamPolicy": { + "methods": [ + "SetIamPolicy" + ] + }, + "TestIamPermissions": { + "methods": [ + "TestIamPermissions" + ] + } + } + } + } + }, + "ResourcePolicies": { + "clients": { + "rest": { + "libraryClient": "ResourcePoliciesClient", + "rpcs": { + "AggregatedList": { + "methods": [ + "AggregatedList" + ] + }, + "Delete": { + "methods": [ + "Delete" + ] + }, + "Get": { + "methods": [ + "Get" + ] + }, + "GetIamPolicy": { + "methods": [ + "GetIamPolicy" + ] + }, + "Insert": { + "methods": [ + "Insert" + ] + }, + "List": { + "methods": [ + "List" + ] + }, + "SetIamPolicy": { + "methods": [ + "SetIamPolicy" + ] + }, + "TestIamPermissions": { + "methods": [ + "TestIamPermissions" + ] + } + } + } + } + }, + "Routers": { + "clients": { + "rest": { + "libraryClient": "RoutersClient", + "rpcs": { + "AggregatedList": { + "methods": [ + "AggregatedList" + ] + }, + "Delete": { + "methods": [ + "Delete" + ] + }, + "Get": { + "methods": [ + "Get" + ] + }, + "GetNatMappingInfo": { + "methods": [ + "GetNatMappingInfo" + ] + }, + "GetRouterStatus": { + "methods": [ + "GetRouterStatus" + ] + }, + "Insert": { + "methods": [ + "Insert" + ] + }, + "List": { + "methods": [ + "List" + ] + }, + "Patch": { + "methods": [ + "Patch" + ] + }, + "Preview": { + "methods": [ + "Preview" + ] + }, + "Update": { + "methods": [ + "Update" + ] + } + } + } + } + }, + "Routes": { + "clients": { + "rest": { + "libraryClient": "RoutesClient", + "rpcs": { + "Delete": { + "methods": [ + "Delete" + ] + }, + "Get": { + "methods": [ + "Get" + ] + }, + "Insert": { + "methods": [ + "Insert" + ] + }, + "List": { + "methods": [ + "List" + ] + } + } + } + } + }, + "SecurityPolicies": { + "clients": { + "rest": { + "libraryClient": "SecurityPoliciesClient", + "rpcs": { + "AddRule": { + "methods": [ + "AddRule" + ] + }, + "Delete": { + "methods": [ + "Delete" + ] + }, + "Get": { + "methods": [ + "Get" + ] + }, + "GetRule": { + "methods": [ + "GetRule" + ] + }, + "Insert": { + "methods": [ + "Insert" + ] + }, + "List": { + "methods": [ + "List" + ] + }, + "ListPreconfiguredExpressionSets": { + "methods": [ + "ListPreconfiguredExpressionSets" + ] + }, + "Patch": { + "methods": [ + "Patch" + ] + }, + "PatchRule": { + "methods": [ + "PatchRule" + ] + }, + "RemoveRule": { + "methods": [ + "RemoveRule" + ] + } + } + } + } + }, + "Snapshots": { + "clients": { + "rest": { + "libraryClient": "SnapshotsClient", + "rpcs": { + "Delete": { + "methods": [ + "Delete" + ] + }, + "Get": { + "methods": [ + "Get" + ] + }, + "GetIamPolicy": { + "methods": [ + "GetIamPolicy" + ] + }, + "List": { + "methods": [ + "List" + ] + }, + "SetIamPolicy": { + "methods": [ + "SetIamPolicy" + ] + }, + "SetLabels": { + "methods": [ + "SetLabels" + ] + }, + "TestIamPermissions": { + "methods": [ + "TestIamPermissions" + ] + } + } + } + } + }, + "SslCertificates": { + "clients": { + "rest": { + "libraryClient": "SslCertificatesClient", + "rpcs": { + "AggregatedList": { + "methods": [ + "AggregatedList" + ] + }, + "Delete": { + "methods": [ + "Delete" + ] + }, + "Get": { + "methods": [ + "Get" + ] + }, + "Insert": { + "methods": [ + "Insert" + ] + }, + "List": { + "methods": [ + "List" + ] + } + } + } + } + }, + "SslPolicies": { + "clients": { + "rest": { + "libraryClient": "SslPoliciesClient", + "rpcs": { + "Delete": { + "methods": [ + "Delete" + ] + }, + "Get": { + "methods": [ + "Get" + ] + }, + "Insert": { + "methods": [ + "Insert" + ] + }, + "List": { + "methods": [ + "List" + ] + }, + "ListAvailableFeatures": { + "methods": [ + "ListAvailableFeatures" + ] + }, + "Patch": { + "methods": [ + "Patch" + ] + } + } + } + } + }, + "Subnetworks": { + "clients": { + "rest": { + "libraryClient": "SubnetworksClient", + "rpcs": { + "AggregatedList": { + "methods": [ + "AggregatedList" + ] + }, + "Delete": { + "methods": [ + "Delete" + ] + }, + "ExpandIpCidrRange": { + "methods": [ + "ExpandIpCidrRange" + ] + }, + "Get": { + "methods": [ + "Get" + ] + }, + "GetIamPolicy": { + "methods": [ + "GetIamPolicy" + ] + }, + "Insert": { + "methods": [ + "Insert" + ] + }, + "List": { + "methods": [ + "List" + ] + }, + "ListUsable": { + "methods": [ + "ListUsable" + ] + }, + "Patch": { + "methods": [ + "Patch" + ] + }, + "SetIamPolicy": { + "methods": [ + "SetIamPolicy" + ] + }, + "SetPrivateIpGoogleAccess": { + "methods": [ + "SetPrivateIpGoogleAccess" + ] + }, + "TestIamPermissions": { + "methods": [ + "TestIamPermissions" + ] + } + } + } + } + }, + "TargetGrpcProxies": { + "clients": { + "rest": { + "libraryClient": "TargetGrpcProxiesClient", + "rpcs": { + "Delete": { + "methods": [ + "Delete" + ] + }, + "Get": { + "methods": [ + "Get" + ] + }, + "Insert": { + "methods": [ + "Insert" + ] + }, + "List": { + "methods": [ + "List" + ] + }, + "Patch": { + "methods": [ + "Patch" + ] + } + } + } + } + }, + "TargetHttpProxies": { + "clients": { + "rest": { + "libraryClient": "TargetHttpProxiesClient", + "rpcs": { + "AggregatedList": { + "methods": [ + "AggregatedList" + ] + }, + "Delete": { + "methods": [ + "Delete" + ] + }, + "Get": { + "methods": [ + "Get" + ] + }, + "Insert": { + "methods": [ + "Insert" + ] + }, + "List": { + "methods": [ + "List" + ] + }, + "Patch": { + "methods": [ + "Patch" + ] + }, + "SetUrlMap": { + "methods": [ + "SetUrlMap" + ] + } + } + } + } + }, + "TargetHttpsProxies": { + "clients": { + "rest": { + "libraryClient": "TargetHttpsProxiesClient", + "rpcs": { + "AggregatedList": { + "methods": [ + "AggregatedList" + ] + }, + "Delete": { + "methods": [ + "Delete" + ] + }, + "Get": { + "methods": [ + "Get" + ] + }, + "Insert": { + "methods": [ + "Insert" + ] + }, + "List": { + "methods": [ + "List" + ] + }, + "Patch": { + "methods": [ + "Patch" + ] + }, + "SetQuicOverride": { + "methods": [ + "SetQuicOverride" + ] + }, + "SetSslCertificates": { + "methods": [ + "SetSslCertificates" + ] + }, + "SetSslPolicy": { + "methods": [ + "SetSslPolicy" + ] + }, + "SetUrlMap": { + "methods": [ + "SetUrlMap" + ] + } + } + } + } + }, + "TargetInstances": { + "clients": { + "rest": { + "libraryClient": "TargetInstancesClient", + "rpcs": { + "AggregatedList": { + "methods": [ + "AggregatedList" + ] + }, + "Delete": { + "methods": [ + "Delete" + ] + }, + "Get": { + "methods": [ + "Get" + ] + }, + "Insert": { + "methods": [ + "Insert" + ] + }, + "List": { + "methods": [ + "List" + ] + } + } + } + } + }, + "TargetPools": { + "clients": { + "rest": { + "libraryClient": "TargetPoolsClient", + "rpcs": { + "AddHealthCheck": { + "methods": [ + "AddHealthCheck" + ] + }, + "AddInstance": { + "methods": [ + "AddInstance" + ] + }, + "AggregatedList": { + "methods": [ + "AggregatedList" + ] + }, + "Delete": { + "methods": [ + "Delete" + ] + }, + "Get": { + "methods": [ + "Get" + ] + }, + "GetHealth": { + "methods": [ + "GetHealth" + ] + }, + "Insert": { + "methods": [ + "Insert" + ] + }, + "List": { + "methods": [ + "List" + ] + }, + "RemoveHealthCheck": { + "methods": [ + "RemoveHealthCheck" + ] + }, + "RemoveInstance": { + "methods": [ + "RemoveInstance" + ] + }, + "SetBackup": { + "methods": [ + "SetBackup" + ] + } + } + } + } + }, + "TargetSslProxies": { + "clients": { + "rest": { + "libraryClient": "TargetSslProxiesClient", + "rpcs": { + "Delete": { + "methods": [ + "Delete" + ] + }, + "Get": { + "methods": [ + "Get" + ] + }, + "Insert": { + "methods": [ + "Insert" + ] + }, + "List": { + "methods": [ + "List" + ] + }, + "SetBackendService": { + "methods": [ + "SetBackendService" + ] + }, + "SetProxyHeader": { + "methods": [ + "SetProxyHeader" + ] + }, + "SetSslCertificates": { + "methods": [ + "SetSslCertificates" + ] + }, + "SetSslPolicy": { + "methods": [ + "SetSslPolicy" + ] + } + } + } + } + }, + "TargetTcpProxies": { + "clients": { + "rest": { + "libraryClient": "TargetTcpProxiesClient", + "rpcs": { + "Delete": { + "methods": [ + "Delete" + ] + }, + "Get": { + "methods": [ + "Get" + ] + }, + "Insert": { + "methods": [ + "Insert" + ] + }, + "List": { + "methods": [ + "List" + ] + }, + "SetBackendService": { + "methods": [ + "SetBackendService" + ] + }, + "SetProxyHeader": { + "methods": [ + "SetProxyHeader" + ] + } + } + } + } + }, + "TargetVpnGateways": { + "clients": { + "rest": { + "libraryClient": "TargetVpnGatewaysClient", + "rpcs": { + "AggregatedList": { + "methods": [ + "AggregatedList" + ] + }, + "Delete": { + "methods": [ + "Delete" + ] + }, + "Get": { + "methods": [ + "Get" + ] + }, + "Insert": { + "methods": [ + "Insert" + ] + }, + "List": { + "methods": [ + "List" + ] + } + } + } + } + }, + "UrlMaps": { + "clients": { + "rest": { + "libraryClient": "UrlMapsClient", + "rpcs": { + "AggregatedList": { + "methods": [ + "AggregatedList" + ] + }, + "Delete": { + "methods": [ + "Delete" + ] + }, + "Get": { + "methods": [ + "Get" + ] + }, + "Insert": { + "methods": [ + "Insert" + ] + }, + "InvalidateCache": { + "methods": [ + "InvalidateCache" + ] + }, + "List": { + "methods": [ + "List" + ] + }, + "Patch": { + "methods": [ + "Patch" + ] + }, + "Update": { + "methods": [ + "Update" + ] + }, + "Validate": { + "methods": [ + "Validate" + ] + } + } + } + } + }, + "VpnGateways": { + "clients": { + "rest": { + "libraryClient": "VpnGatewaysClient", + "rpcs": { + "AggregatedList": { + "methods": [ + "AggregatedList" + ] + }, + "Delete": { + "methods": [ + "Delete" + ] + }, + "Get": { + "methods": [ + "Get" + ] + }, + "GetStatus": { + "methods": [ + "GetStatus" + ] + }, + "Insert": { + "methods": [ + "Insert" + ] + }, + "List": { + "methods": [ + "List" + ] + }, + "SetLabels": { + "methods": [ + "SetLabels" + ] + }, + "TestIamPermissions": { + "methods": [ + "TestIamPermissions" + ] + } + } + } + } + }, + "VpnTunnels": { + "clients": { + "rest": { + "libraryClient": "VpnTunnelsClient", + "rpcs": { + "AggregatedList": { + "methods": [ + "AggregatedList" + ] + }, + "Delete": { + "methods": [ + "Delete" + ] + }, + "Get": { + "methods": [ + "Get" + ] + }, + "Insert": { + "methods": [ + "Insert" + ] + }, + "List": { + "methods": [ + "List" + ] + } + } + } + } + }, + "ZoneOperations": { + "clients": { + "rest": { + "libraryClient": "ZoneOperationsClient", + "rpcs": { + "Delete": { + "methods": [ + "Delete" + ] + }, + "Get": { + "methods": [ + "Get" + ] + }, + "List": { + "methods": [ + "List" + ] + }, + "Wait": { + "methods": [ + "Wait" + ] + } + } + } + } + }, + "Zones": { + "clients": { + "rest": { + "libraryClient": "ZonesClient", + "rpcs": { + "Get": { + "methods": [ + "Get" + ] + }, + "List": { + "methods": [ + "List" + ] + } + } + } + } + } + } +} diff --git a/compute/apiv1/global_addresses_client.go b/compute/apiv1/global_addresses_client.go new file mode 100644 index 00000000000..cc877465301 --- /dev/null +++ b/compute/apiv1/global_addresses_client.go @@ -0,0 +1,380 @@ +// Copyright 2021 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/ioutil" + "net/http" + "net/url" + + gax "github.com/googleapis/gax-go/v2" + "google.golang.org/api/option" + "google.golang.org/api/option/internaloption" + httptransport "google.golang.org/api/transport/http" + computepb "google.golang.org/genproto/googleapis/cloud/compute/v1" + "google.golang.org/grpc" + "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/encoding/protojson" +) + +var newGlobalAddressesClientHook clientHook + +// GlobalAddressesCallOptions contains the retry settings for each method of GlobalAddressesClient. +type GlobalAddressesCallOptions struct { + Delete []gax.CallOption + Get []gax.CallOption + Insert []gax.CallOption + List []gax.CallOption +} + +// internalGlobalAddressesClient is an interface that defines the methods availaible from Google Compute Engine API. +type internalGlobalAddressesClient interface { + Close() error + setGoogleClientInfo(...string) + Connection() *grpc.ClientConn + Delete(context.Context, *computepb.DeleteGlobalAddressRequest, ...gax.CallOption) (*computepb.Operation, error) + Get(context.Context, *computepb.GetGlobalAddressRequest, ...gax.CallOption) (*computepb.Address, error) + Insert(context.Context, *computepb.InsertGlobalAddressRequest, ...gax.CallOption) (*computepb.Operation, error) + List(context.Context, *computepb.ListGlobalAddressesRequest, ...gax.CallOption) (*computepb.AddressList, error) +} + +// GlobalAddressesClient 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 GlobalAddresses API. +type GlobalAddressesClient struct { + // The internal transport-dependent client. + internalClient internalGlobalAddressesClient + + // The call options for this service. + CallOptions *GlobalAddressesCallOptions +} + +// 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 *GlobalAddressesClient) 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 *GlobalAddressesClient) setGoogleClientInfo(keyval ...string) { + c.internalClient.setGoogleClientInfo(keyval...) +} + +// Connection returns a connection to the API service. +// +// Deprecated. +func (c *GlobalAddressesClient) Connection() *grpc.ClientConn { + return c.internalClient.Connection() +} + +// Delete deletes the specified address resource. +func (c *GlobalAddressesClient) Delete(ctx context.Context, req *computepb.DeleteGlobalAddressRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.Delete(ctx, req, opts...) +} + +// Get returns the specified address resource. Gets a list of available addresses by making a list() request. +func (c *GlobalAddressesClient) Get(ctx context.Context, req *computepb.GetGlobalAddressRequest, opts ...gax.CallOption) (*computepb.Address, error) { + return c.internalClient.Get(ctx, req, opts...) +} + +// Insert creates an address resource in the specified project by using the data included in the request. +func (c *GlobalAddressesClient) Insert(ctx context.Context, req *computepb.InsertGlobalAddressRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.Insert(ctx, req, opts...) +} + +// List retrieves a list of global addresses. +func (c *GlobalAddressesClient) List(ctx context.Context, req *computepb.ListGlobalAddressesRequest, opts ...gax.CallOption) (*computepb.AddressList, error) { + return c.internalClient.List(ctx, req, opts...) +} + +// Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls. +type globalAddressesRESTClient struct { + // The http endpoint to connect to. + endpoint string + + // The http client. + httpClient *http.Client + + // The x-goog-* metadata to be sent with each request. + xGoogMetadata metadata.MD +} + +// NewGlobalAddressesRESTClient creates a new global addresses rest client. +// +// The GlobalAddresses API. +func NewGlobalAddressesRESTClient(ctx context.Context, opts ...option.ClientOption) (*GlobalAddressesClient, error) { + clientOpts := append(defaultGlobalAddressesRESTClientOptions(), opts...) + httpClient, endpoint, err := httptransport.NewClient(ctx, clientOpts...) + if err != nil { + return nil, err + } + + c := &globalAddressesRESTClient{ + endpoint: endpoint, + httpClient: httpClient, + } + c.setGoogleClientInfo() + + return &GlobalAddressesClient{internalClient: c, CallOptions: &GlobalAddressesCallOptions{}}, nil +} + +func defaultGlobalAddressesRESTClientOptions() []option.ClientOption { + return []option.ClientOption{ + internaloption.WithDefaultEndpoint("compute.googleapis.com"), + internaloption.WithDefaultMTLSEndpoint("compute.mtls.googleapis.com"), + internaloption.WithDefaultAudience("https://compute.googleapis.com/"), + internaloption.WithDefaultScopes(DefaultAuthScopes()...), + } +} + +// setGoogleClientInfo sets the name and version of the application in +// the `x-goog-api-client` header passed on each request. Intended for +// use by Google-written clients. +func (c *globalAddressesRESTClient) setGoogleClientInfo(keyval ...string) { + kv := append([]string{"gl-go", versionGo()}, keyval...) + kv = append(kv, "gapic", versionClient, "gax", gax.Version, "rest", "UNKNOWN") + c.xGoogMetadata = metadata.Pairs("x-goog-api-client", gax.XGoogHeader(kv...)) +} + +// Close closes the connection to the API service. The user should invoke this when +// the client is no longer required. +func (c *globalAddressesRESTClient) Close() error { + // Replace httpClient with nil to force cleanup. + c.httpClient = nil + return nil +} + +// Connection returns a connection to the API service. +// +// Deprecated. +func (c *globalAddressesRESTClient) Connection() *grpc.ClientConn { + return nil +} + +// Delete deletes the specified address resource. +func (c *globalAddressesRESTClient) Delete(ctx context.Context, req *computepb.DeleteGlobalAddressRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/global/addresses/%v", req.GetProject(), req.GetAddress()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("DELETE", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Get returns the specified address resource. Gets a list of available addresses by making a list() request. +func (c *globalAddressesRESTClient) Get(ctx context.Context, req *computepb.GetGlobalAddressRequest, opts ...gax.CallOption) (*computepb.Address, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/global/addresses/%v", req.GetProject(), req.GetAddress()) + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Address{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Insert creates an address resource in the specified project by using the data included in the request. +func (c *globalAddressesRESTClient) Insert(ctx context.Context, req *computepb.InsertGlobalAddressRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetAddressResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/global/addresses", req.GetProject()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// List retrieves a list of global addresses. +func (c *globalAddressesRESTClient) List(ctx context.Context, req *computepb.ListGlobalAddressesRequest, opts ...gax.CallOption) (*computepb.AddressList, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/global/addresses", 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() + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.AddressList{} + + return rsp, unm.Unmarshal(buf, rsp) +} diff --git a/compute/apiv1/global_addresses_client_example_test.go b/compute/apiv1/global_addresses_client_example_test.go new file mode 100644 index 00000000000..a226879e957 --- /dev/null +++ b/compute/apiv1/global_addresses_client_example_test.go @@ -0,0 +1,112 @@ +// Copyright 2021 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_test + +import ( + "context" + + compute "cloud.google.com/go/compute/apiv1" + computepb "google.golang.org/genproto/googleapis/cloud/compute/v1" +) + +func ExampleNewGlobalAddressesRESTClient() { + ctx := context.Background() + c, err := compute.NewGlobalAddressesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + // TODO: Use client. + _ = c +} + +func ExampleGlobalAddressesClient_Delete() { + ctx := context.Background() + c, err := compute.NewGlobalAddressesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.DeleteGlobalAddressRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Delete(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleGlobalAddressesClient_Get() { + ctx := context.Background() + c, err := compute.NewGlobalAddressesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.GetGlobalAddressRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Get(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleGlobalAddressesClient_Insert() { + ctx := context.Background() + c, err := compute.NewGlobalAddressesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.InsertGlobalAddressRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Insert(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleGlobalAddressesClient_List() { + ctx := context.Background() + c, err := compute.NewGlobalAddressesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.ListGlobalAddressesRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.List(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} diff --git a/compute/apiv1/global_forwarding_rules_client.go b/compute/apiv1/global_forwarding_rules_client.go new file mode 100644 index 00000000000..31126501041 --- /dev/null +++ b/compute/apiv1/global_forwarding_rules_client.go @@ -0,0 +1,547 @@ +// Copyright 2021 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/ioutil" + "net/http" + "net/url" + + gax "github.com/googleapis/gax-go/v2" + "google.golang.org/api/option" + "google.golang.org/api/option/internaloption" + httptransport "google.golang.org/api/transport/http" + computepb "google.golang.org/genproto/googleapis/cloud/compute/v1" + "google.golang.org/grpc" + "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/encoding/protojson" +) + +var newGlobalForwardingRulesClientHook clientHook + +// GlobalForwardingRulesCallOptions contains the retry settings for each method of GlobalForwardingRulesClient. +type GlobalForwardingRulesCallOptions struct { + Delete []gax.CallOption + Get []gax.CallOption + Insert []gax.CallOption + List []gax.CallOption + Patch []gax.CallOption + SetLabels []gax.CallOption + SetTarget []gax.CallOption +} + +// internalGlobalForwardingRulesClient is an interface that defines the methods availaible from Google Compute Engine API. +type internalGlobalForwardingRulesClient interface { + Close() error + setGoogleClientInfo(...string) + Connection() *grpc.ClientConn + Delete(context.Context, *computepb.DeleteGlobalForwardingRuleRequest, ...gax.CallOption) (*computepb.Operation, error) + Get(context.Context, *computepb.GetGlobalForwardingRuleRequest, ...gax.CallOption) (*computepb.ForwardingRule, error) + Insert(context.Context, *computepb.InsertGlobalForwardingRuleRequest, ...gax.CallOption) (*computepb.Operation, error) + List(context.Context, *computepb.ListGlobalForwardingRulesRequest, ...gax.CallOption) (*computepb.ForwardingRuleList, error) + Patch(context.Context, *computepb.PatchGlobalForwardingRuleRequest, ...gax.CallOption) (*computepb.Operation, error) + SetLabels(context.Context, *computepb.SetLabelsGlobalForwardingRuleRequest, ...gax.CallOption) (*computepb.Operation, error) + SetTarget(context.Context, *computepb.SetTargetGlobalForwardingRuleRequest, ...gax.CallOption) (*computepb.Operation, error) +} + +// GlobalForwardingRulesClient 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 GlobalForwardingRules API. +type GlobalForwardingRulesClient struct { + // The internal transport-dependent client. + internalClient internalGlobalForwardingRulesClient + + // The call options for this service. + CallOptions *GlobalForwardingRulesCallOptions +} + +// 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 *GlobalForwardingRulesClient) 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 *GlobalForwardingRulesClient) setGoogleClientInfo(keyval ...string) { + c.internalClient.setGoogleClientInfo(keyval...) +} + +// Connection returns a connection to the API service. +// +// Deprecated. +func (c *GlobalForwardingRulesClient) Connection() *grpc.ClientConn { + return c.internalClient.Connection() +} + +// Delete deletes the specified GlobalForwardingRule resource. +func (c *GlobalForwardingRulesClient) Delete(ctx context.Context, req *computepb.DeleteGlobalForwardingRuleRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.Delete(ctx, req, opts...) +} + +// Get returns the specified GlobalForwardingRule resource. Gets a list of available forwarding rules by making a list() request. +func (c *GlobalForwardingRulesClient) Get(ctx context.Context, req *computepb.GetGlobalForwardingRuleRequest, opts ...gax.CallOption) (*computepb.ForwardingRule, error) { + return c.internalClient.Get(ctx, req, opts...) +} + +// Insert creates a GlobalForwardingRule resource in the specified project using the data included in the request. +func (c *GlobalForwardingRulesClient) Insert(ctx context.Context, req *computepb.InsertGlobalForwardingRuleRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.Insert(ctx, req, opts...) +} + +// List retrieves a list of GlobalForwardingRule resources available to the specified project. +func (c *GlobalForwardingRulesClient) List(ctx context.Context, req *computepb.ListGlobalForwardingRulesRequest, opts ...gax.CallOption) (*computepb.ForwardingRuleList, error) { + return c.internalClient.List(ctx, req, opts...) +} + +// Patch updates the specified forwarding rule with the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. Currently, you can only patch the network_tier field. +func (c *GlobalForwardingRulesClient) Patch(ctx context.Context, req *computepb.PatchGlobalForwardingRuleRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.Patch(ctx, req, opts...) +} + +// SetLabels sets the labels on the specified resource. To learn more about labels, read the Labeling Resources documentation. +func (c *GlobalForwardingRulesClient) SetLabels(ctx context.Context, req *computepb.SetLabelsGlobalForwardingRuleRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.SetLabels(ctx, req, opts...) +} + +// SetTarget changes target URL for the GlobalForwardingRule resource. The new target should be of the same type as the old target. +func (c *GlobalForwardingRulesClient) SetTarget(ctx context.Context, req *computepb.SetTargetGlobalForwardingRuleRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.SetTarget(ctx, req, opts...) +} + +// Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls. +type globalForwardingRulesRESTClient struct { + // The http endpoint to connect to. + endpoint string + + // The http client. + httpClient *http.Client + + // The x-goog-* metadata to be sent with each request. + xGoogMetadata metadata.MD +} + +// NewGlobalForwardingRulesRESTClient creates a new global forwarding rules rest client. +// +// The GlobalForwardingRules API. +func NewGlobalForwardingRulesRESTClient(ctx context.Context, opts ...option.ClientOption) (*GlobalForwardingRulesClient, error) { + clientOpts := append(defaultGlobalForwardingRulesRESTClientOptions(), opts...) + httpClient, endpoint, err := httptransport.NewClient(ctx, clientOpts...) + if err != nil { + return nil, err + } + + c := &globalForwardingRulesRESTClient{ + endpoint: endpoint, + httpClient: httpClient, + } + c.setGoogleClientInfo() + + return &GlobalForwardingRulesClient{internalClient: c, CallOptions: &GlobalForwardingRulesCallOptions{}}, nil +} + +func defaultGlobalForwardingRulesRESTClientOptions() []option.ClientOption { + return []option.ClientOption{ + internaloption.WithDefaultEndpoint("compute.googleapis.com"), + internaloption.WithDefaultMTLSEndpoint("compute.mtls.googleapis.com"), + internaloption.WithDefaultAudience("https://compute.googleapis.com/"), + internaloption.WithDefaultScopes(DefaultAuthScopes()...), + } +} + +// setGoogleClientInfo sets the name and version of the application in +// the `x-goog-api-client` header passed on each request. Intended for +// use by Google-written clients. +func (c *globalForwardingRulesRESTClient) setGoogleClientInfo(keyval ...string) { + kv := append([]string{"gl-go", versionGo()}, keyval...) + kv = append(kv, "gapic", versionClient, "gax", gax.Version, "rest", "UNKNOWN") + c.xGoogMetadata = metadata.Pairs("x-goog-api-client", gax.XGoogHeader(kv...)) +} + +// Close closes the connection to the API service. The user should invoke this when +// the client is no longer required. +func (c *globalForwardingRulesRESTClient) Close() error { + // Replace httpClient with nil to force cleanup. + c.httpClient = nil + return nil +} + +// Connection returns a connection to the API service. +// +// Deprecated. +func (c *globalForwardingRulesRESTClient) Connection() *grpc.ClientConn { + return nil +} + +// Delete deletes the specified GlobalForwardingRule resource. +func (c *globalForwardingRulesRESTClient) Delete(ctx context.Context, req *computepb.DeleteGlobalForwardingRuleRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/global/forwardingRules/%v", req.GetProject(), req.GetForwardingRule()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("DELETE", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Get returns the specified GlobalForwardingRule resource. Gets a list of available forwarding rules by making a list() request. +func (c *globalForwardingRulesRESTClient) Get(ctx context.Context, req *computepb.GetGlobalForwardingRuleRequest, opts ...gax.CallOption) (*computepb.ForwardingRule, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/global/forwardingRules/%v", req.GetProject(), req.GetForwardingRule()) + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.ForwardingRule{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Insert creates a GlobalForwardingRule resource in the specified project using the data included in the request. +func (c *globalForwardingRulesRESTClient) Insert(ctx context.Context, req *computepb.InsertGlobalForwardingRuleRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetForwardingRuleResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/global/forwardingRules", req.GetProject()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// List retrieves a list of GlobalForwardingRule resources available to the specified project. +func (c *globalForwardingRulesRESTClient) List(ctx context.Context, req *computepb.ListGlobalForwardingRulesRequest, opts ...gax.CallOption) (*computepb.ForwardingRuleList, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/global/forwardingRules", 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() + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.ForwardingRuleList{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Patch updates the specified forwarding rule with the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. Currently, you can only patch the network_tier field. +func (c *globalForwardingRulesRESTClient) Patch(ctx context.Context, req *computepb.PatchGlobalForwardingRuleRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetForwardingRuleResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/global/forwardingRules/%v", req.GetProject(), req.GetForwardingRule()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("PATCH", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// SetLabels sets the labels on the specified resource. To learn more about labels, read the Labeling Resources documentation. +func (c *globalForwardingRulesRESTClient) SetLabels(ctx context.Context, req *computepb.SetLabelsGlobalForwardingRuleRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetGlobalSetLabelsRequestResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/global/forwardingRules/%v/setLabels", req.GetProject(), req.GetResource()) + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// SetTarget changes target URL for the GlobalForwardingRule resource. The new target should be of the same type as the old target. +func (c *globalForwardingRulesRESTClient) SetTarget(ctx context.Context, req *computepb.SetTargetGlobalForwardingRuleRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetTargetReferenceResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/global/forwardingRules/%v/setTarget", req.GetProject(), req.GetForwardingRule()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} diff --git a/compute/apiv1/global_forwarding_rules_client_example_test.go b/compute/apiv1/global_forwarding_rules_client_example_test.go new file mode 100644 index 00000000000..13f8bce3d6b --- /dev/null +++ b/compute/apiv1/global_forwarding_rules_client_example_test.go @@ -0,0 +1,169 @@ +// Copyright 2021 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_test + +import ( + "context" + + compute "cloud.google.com/go/compute/apiv1" + computepb "google.golang.org/genproto/googleapis/cloud/compute/v1" +) + +func ExampleNewGlobalForwardingRulesRESTClient() { + ctx := context.Background() + c, err := compute.NewGlobalForwardingRulesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + // TODO: Use client. + _ = c +} + +func ExampleGlobalForwardingRulesClient_Delete() { + ctx := context.Background() + c, err := compute.NewGlobalForwardingRulesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.DeleteGlobalForwardingRuleRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Delete(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleGlobalForwardingRulesClient_Get() { + ctx := context.Background() + c, err := compute.NewGlobalForwardingRulesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.GetGlobalForwardingRuleRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Get(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleGlobalForwardingRulesClient_Insert() { + ctx := context.Background() + c, err := compute.NewGlobalForwardingRulesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.InsertGlobalForwardingRuleRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Insert(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleGlobalForwardingRulesClient_List() { + ctx := context.Background() + c, err := compute.NewGlobalForwardingRulesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.ListGlobalForwardingRulesRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.List(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleGlobalForwardingRulesClient_Patch() { + ctx := context.Background() + c, err := compute.NewGlobalForwardingRulesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.PatchGlobalForwardingRuleRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Patch(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleGlobalForwardingRulesClient_SetLabels() { + ctx := context.Background() + c, err := compute.NewGlobalForwardingRulesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.SetLabelsGlobalForwardingRuleRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.SetLabels(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleGlobalForwardingRulesClient_SetTarget() { + ctx := context.Background() + c, err := compute.NewGlobalForwardingRulesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.SetTargetGlobalForwardingRuleRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.SetTarget(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} diff --git a/compute/apiv1/global_network_endpoint_groups_client.go b/compute/apiv1/global_network_endpoint_groups_client.go new file mode 100644 index 00000000000..54f22cccf5d --- /dev/null +++ b/compute/apiv1/global_network_endpoint_groups_client.go @@ -0,0 +1,565 @@ +// Copyright 2021 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/ioutil" + "net/http" + "net/url" + + gax "github.com/googleapis/gax-go/v2" + "google.golang.org/api/option" + "google.golang.org/api/option/internaloption" + httptransport "google.golang.org/api/transport/http" + computepb "google.golang.org/genproto/googleapis/cloud/compute/v1" + "google.golang.org/grpc" + "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/encoding/protojson" +) + +var newGlobalNetworkEndpointGroupsClientHook clientHook + +// GlobalNetworkEndpointGroupsCallOptions contains the retry settings for each method of GlobalNetworkEndpointGroupsClient. +type GlobalNetworkEndpointGroupsCallOptions struct { + AttachNetworkEndpoints []gax.CallOption + Delete []gax.CallOption + DetachNetworkEndpoints []gax.CallOption + Get []gax.CallOption + Insert []gax.CallOption + List []gax.CallOption + ListNetworkEndpoints []gax.CallOption +} + +// internalGlobalNetworkEndpointGroupsClient is an interface that defines the methods availaible from Google Compute Engine API. +type internalGlobalNetworkEndpointGroupsClient interface { + Close() error + setGoogleClientInfo(...string) + Connection() *grpc.ClientConn + AttachNetworkEndpoints(context.Context, *computepb.AttachNetworkEndpointsGlobalNetworkEndpointGroupRequest, ...gax.CallOption) (*computepb.Operation, error) + Delete(context.Context, *computepb.DeleteGlobalNetworkEndpointGroupRequest, ...gax.CallOption) (*computepb.Operation, error) + DetachNetworkEndpoints(context.Context, *computepb.DetachNetworkEndpointsGlobalNetworkEndpointGroupRequest, ...gax.CallOption) (*computepb.Operation, error) + Get(context.Context, *computepb.GetGlobalNetworkEndpointGroupRequest, ...gax.CallOption) (*computepb.NetworkEndpointGroup, error) + Insert(context.Context, *computepb.InsertGlobalNetworkEndpointGroupRequest, ...gax.CallOption) (*computepb.Operation, error) + List(context.Context, *computepb.ListGlobalNetworkEndpointGroupsRequest, ...gax.CallOption) (*computepb.NetworkEndpointGroupList, error) + ListNetworkEndpoints(context.Context, *computepb.ListNetworkEndpointsGlobalNetworkEndpointGroupsRequest, ...gax.CallOption) (*computepb.NetworkEndpointGroupsListNetworkEndpoints, error) +} + +// GlobalNetworkEndpointGroupsClient 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 GlobalNetworkEndpointGroups API. +type GlobalNetworkEndpointGroupsClient struct { + // The internal transport-dependent client. + internalClient internalGlobalNetworkEndpointGroupsClient + + // The call options for this service. + CallOptions *GlobalNetworkEndpointGroupsCallOptions +} + +// 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 *GlobalNetworkEndpointGroupsClient) 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 *GlobalNetworkEndpointGroupsClient) setGoogleClientInfo(keyval ...string) { + c.internalClient.setGoogleClientInfo(keyval...) +} + +// Connection returns a connection to the API service. +// +// Deprecated. +func (c *GlobalNetworkEndpointGroupsClient) Connection() *grpc.ClientConn { + return c.internalClient.Connection() +} + +// AttachNetworkEndpoints attach a network endpoint to the specified network endpoint group. +func (c *GlobalNetworkEndpointGroupsClient) AttachNetworkEndpoints(ctx context.Context, req *computepb.AttachNetworkEndpointsGlobalNetworkEndpointGroupRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.AttachNetworkEndpoints(ctx, req, opts...) +} + +// Delete deletes the specified network endpoint group.Note that the NEG cannot be deleted if there are backend services referencing it. +func (c *GlobalNetworkEndpointGroupsClient) Delete(ctx context.Context, req *computepb.DeleteGlobalNetworkEndpointGroupRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.Delete(ctx, req, opts...) +} + +// DetachNetworkEndpoints detach the network endpoint from the specified network endpoint group. +func (c *GlobalNetworkEndpointGroupsClient) DetachNetworkEndpoints(ctx context.Context, req *computepb.DetachNetworkEndpointsGlobalNetworkEndpointGroupRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.DetachNetworkEndpoints(ctx, req, opts...) +} + +// Get returns the specified network endpoint group. Gets a list of available network endpoint groups by making a list() request. +func (c *GlobalNetworkEndpointGroupsClient) Get(ctx context.Context, req *computepb.GetGlobalNetworkEndpointGroupRequest, opts ...gax.CallOption) (*computepb.NetworkEndpointGroup, error) { + return c.internalClient.Get(ctx, req, opts...) +} + +// Insert creates a network endpoint group in the specified project using the parameters that are included in the request. +func (c *GlobalNetworkEndpointGroupsClient) Insert(ctx context.Context, req *computepb.InsertGlobalNetworkEndpointGroupRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.Insert(ctx, req, opts...) +} + +// List retrieves the list of network endpoint groups that are located in the specified project. +func (c *GlobalNetworkEndpointGroupsClient) List(ctx context.Context, req *computepb.ListGlobalNetworkEndpointGroupsRequest, opts ...gax.CallOption) (*computepb.NetworkEndpointGroupList, error) { + return c.internalClient.List(ctx, req, opts...) +} + +// ListNetworkEndpoints lists the network endpoints in the specified network endpoint group. +func (c *GlobalNetworkEndpointGroupsClient) ListNetworkEndpoints(ctx context.Context, req *computepb.ListNetworkEndpointsGlobalNetworkEndpointGroupsRequest, opts ...gax.CallOption) (*computepb.NetworkEndpointGroupsListNetworkEndpoints, error) { + 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 globalNetworkEndpointGroupsRESTClient struct { + // The http endpoint to connect to. + endpoint string + + // The http client. + httpClient *http.Client + + // The x-goog-* metadata to be sent with each request. + xGoogMetadata metadata.MD +} + +// NewGlobalNetworkEndpointGroupsRESTClient creates a new global network endpoint groups rest client. +// +// The GlobalNetworkEndpointGroups API. +func NewGlobalNetworkEndpointGroupsRESTClient(ctx context.Context, opts ...option.ClientOption) (*GlobalNetworkEndpointGroupsClient, error) { + clientOpts := append(defaultGlobalNetworkEndpointGroupsRESTClientOptions(), opts...) + httpClient, endpoint, err := httptransport.NewClient(ctx, clientOpts...) + if err != nil { + return nil, err + } + + c := &globalNetworkEndpointGroupsRESTClient{ + endpoint: endpoint, + httpClient: httpClient, + } + c.setGoogleClientInfo() + + return &GlobalNetworkEndpointGroupsClient{internalClient: c, CallOptions: &GlobalNetworkEndpointGroupsCallOptions{}}, nil +} + +func defaultGlobalNetworkEndpointGroupsRESTClientOptions() []option.ClientOption { + return []option.ClientOption{ + internaloption.WithDefaultEndpoint("compute.googleapis.com"), + internaloption.WithDefaultMTLSEndpoint("compute.mtls.googleapis.com"), + internaloption.WithDefaultAudience("https://compute.googleapis.com/"), + internaloption.WithDefaultScopes(DefaultAuthScopes()...), + } +} + +// setGoogleClientInfo sets the name and version of the application in +// the `x-goog-api-client` header passed on each request. Intended for +// use by Google-written clients. +func (c *globalNetworkEndpointGroupsRESTClient) setGoogleClientInfo(keyval ...string) { + kv := append([]string{"gl-go", versionGo()}, keyval...) + kv = append(kv, "gapic", versionClient, "gax", gax.Version, "rest", "UNKNOWN") + c.xGoogMetadata = metadata.Pairs("x-goog-api-client", gax.XGoogHeader(kv...)) +} + +// Close closes the connection to the API service. The user should invoke this when +// the client is no longer required. +func (c *globalNetworkEndpointGroupsRESTClient) Close() error { + // Replace httpClient with nil to force cleanup. + c.httpClient = nil + return nil +} + +// Connection returns a connection to the API service. +// +// Deprecated. +func (c *globalNetworkEndpointGroupsRESTClient) Connection() *grpc.ClientConn { + return nil +} + +// AttachNetworkEndpoints attach a network endpoint to the specified network endpoint group. +func (c *globalNetworkEndpointGroupsRESTClient) AttachNetworkEndpoints(ctx context.Context, req *computepb.AttachNetworkEndpointsGlobalNetworkEndpointGroupRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetGlobalNetworkEndpointGroupsAttachEndpointsRequestResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/global/networkEndpointGroups/%v/attachNetworkEndpoints", req.GetProject(), req.GetNetworkEndpointGroup()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Delete deletes the specified network endpoint group.Note that the NEG cannot be deleted if there are backend services referencing it. +func (c *globalNetworkEndpointGroupsRESTClient) Delete(ctx context.Context, req *computepb.DeleteGlobalNetworkEndpointGroupRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/global/networkEndpointGroups/%v", req.GetProject(), req.GetNetworkEndpointGroup()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("DELETE", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// DetachNetworkEndpoints detach the network endpoint from the specified network endpoint group. +func (c *globalNetworkEndpointGroupsRESTClient) DetachNetworkEndpoints(ctx context.Context, req *computepb.DetachNetworkEndpointsGlobalNetworkEndpointGroupRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetGlobalNetworkEndpointGroupsDetachEndpointsRequestResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/global/networkEndpointGroups/%v/detachNetworkEndpoints", req.GetProject(), req.GetNetworkEndpointGroup()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Get returns the specified network endpoint group. Gets a list of available network endpoint groups by making a list() request. +func (c *globalNetworkEndpointGroupsRESTClient) Get(ctx context.Context, req *computepb.GetGlobalNetworkEndpointGroupRequest, opts ...gax.CallOption) (*computepb.NetworkEndpointGroup, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/global/networkEndpointGroups/%v", req.GetProject(), req.GetNetworkEndpointGroup()) + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.NetworkEndpointGroup{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Insert creates a network endpoint group in the specified project using the parameters that are included in the request. +func (c *globalNetworkEndpointGroupsRESTClient) Insert(ctx context.Context, req *computepb.InsertGlobalNetworkEndpointGroupRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetNetworkEndpointGroupResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/global/networkEndpointGroups", req.GetProject()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// List retrieves the list of network endpoint groups that are located in the specified project. +func (c *globalNetworkEndpointGroupsRESTClient) List(ctx context.Context, req *computepb.ListGlobalNetworkEndpointGroupsRequest, opts ...gax.CallOption) (*computepb.NetworkEndpointGroupList, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/global/networkEndpointGroups", 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() + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.NetworkEndpointGroupList{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// ListNetworkEndpoints lists the network endpoints in the specified network endpoint group. +func (c *globalNetworkEndpointGroupsRESTClient) ListNetworkEndpoints(ctx context.Context, req *computepb.ListNetworkEndpointsGlobalNetworkEndpointGroupsRequest, opts ...gax.CallOption) (*computepb.NetworkEndpointGroupsListNetworkEndpoints, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/global/networkEndpointGroups/%v/listNetworkEndpoints", req.GetProject(), 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() + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.NetworkEndpointGroupsListNetworkEndpoints{} + + return rsp, unm.Unmarshal(buf, rsp) +} diff --git a/compute/apiv1/global_network_endpoint_groups_client_example_test.go b/compute/apiv1/global_network_endpoint_groups_client_example_test.go new file mode 100644 index 00000000000..80361d6d06e --- /dev/null +++ b/compute/apiv1/global_network_endpoint_groups_client_example_test.go @@ -0,0 +1,169 @@ +// Copyright 2021 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_test + +import ( + "context" + + compute "cloud.google.com/go/compute/apiv1" + computepb "google.golang.org/genproto/googleapis/cloud/compute/v1" +) + +func ExampleNewGlobalNetworkEndpointGroupsRESTClient() { + ctx := context.Background() + c, err := compute.NewGlobalNetworkEndpointGroupsRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + // TODO: Use client. + _ = c +} + +func ExampleGlobalNetworkEndpointGroupsClient_AttachNetworkEndpoints() { + ctx := context.Background() + c, err := compute.NewGlobalNetworkEndpointGroupsRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.AttachNetworkEndpointsGlobalNetworkEndpointGroupRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.AttachNetworkEndpoints(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleGlobalNetworkEndpointGroupsClient_Delete() { + ctx := context.Background() + c, err := compute.NewGlobalNetworkEndpointGroupsRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.DeleteGlobalNetworkEndpointGroupRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Delete(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleGlobalNetworkEndpointGroupsClient_DetachNetworkEndpoints() { + ctx := context.Background() + c, err := compute.NewGlobalNetworkEndpointGroupsRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.DetachNetworkEndpointsGlobalNetworkEndpointGroupRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.DetachNetworkEndpoints(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleGlobalNetworkEndpointGroupsClient_Get() { + ctx := context.Background() + c, err := compute.NewGlobalNetworkEndpointGroupsRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.GetGlobalNetworkEndpointGroupRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Get(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleGlobalNetworkEndpointGroupsClient_Insert() { + ctx := context.Background() + c, err := compute.NewGlobalNetworkEndpointGroupsRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.InsertGlobalNetworkEndpointGroupRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Insert(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleGlobalNetworkEndpointGroupsClient_List() { + ctx := context.Background() + c, err := compute.NewGlobalNetworkEndpointGroupsRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.ListGlobalNetworkEndpointGroupsRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.List(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleGlobalNetworkEndpointGroupsClient_ListNetworkEndpoints() { + ctx := context.Background() + c, err := compute.NewGlobalNetworkEndpointGroupsRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.ListNetworkEndpointsGlobalNetworkEndpointGroupsRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.ListNetworkEndpoints(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} diff --git a/compute/apiv1/global_operations_client.go b/compute/apiv1/global_operations_client.go new file mode 100644 index 00000000000..928eedface2 --- /dev/null +++ b/compute/apiv1/global_operations_client.go @@ -0,0 +1,449 @@ +// Copyright 2021 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/ioutil" + "net/http" + "net/url" + + gax "github.com/googleapis/gax-go/v2" + "google.golang.org/api/option" + "google.golang.org/api/option/internaloption" + httptransport "google.golang.org/api/transport/http" + computepb "google.golang.org/genproto/googleapis/cloud/compute/v1" + "google.golang.org/grpc" + "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/encoding/protojson" +) + +var newGlobalOperationsClientHook clientHook + +// GlobalOperationsCallOptions contains the retry settings for each method of GlobalOperationsClient. +type GlobalOperationsCallOptions struct { + AggregatedList []gax.CallOption + Delete []gax.CallOption + Get []gax.CallOption + List []gax.CallOption + Wait []gax.CallOption +} + +// internalGlobalOperationsClient is an interface that defines the methods availaible from Google Compute Engine API. +type internalGlobalOperationsClient interface { + Close() error + setGoogleClientInfo(...string) + Connection() *grpc.ClientConn + AggregatedList(context.Context, *computepb.AggregatedListGlobalOperationsRequest, ...gax.CallOption) (*computepb.OperationAggregatedList, error) + Delete(context.Context, *computepb.DeleteGlobalOperationRequest, ...gax.CallOption) (*computepb.DeleteGlobalOperationResponse, error) + Get(context.Context, *computepb.GetGlobalOperationRequest, ...gax.CallOption) (*computepb.Operation, error) + List(context.Context, *computepb.ListGlobalOperationsRequest, ...gax.CallOption) (*computepb.OperationList, error) + Wait(context.Context, *computepb.WaitGlobalOperationRequest, ...gax.CallOption) (*computepb.Operation, error) +} + +// GlobalOperationsClient 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 GlobalOperations API. +type GlobalOperationsClient struct { + // The internal transport-dependent client. + internalClient internalGlobalOperationsClient + + // The call options for this service. + CallOptions *GlobalOperationsCallOptions +} + +// 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 *GlobalOperationsClient) 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 *GlobalOperationsClient) setGoogleClientInfo(keyval ...string) { + c.internalClient.setGoogleClientInfo(keyval...) +} + +// Connection returns a connection to the API service. +// +// Deprecated. +func (c *GlobalOperationsClient) Connection() *grpc.ClientConn { + return c.internalClient.Connection() +} + +// AggregatedList retrieves an aggregated list of all operations. +func (c *GlobalOperationsClient) AggregatedList(ctx context.Context, req *computepb.AggregatedListGlobalOperationsRequest, opts ...gax.CallOption) (*computepb.OperationAggregatedList, error) { + return c.internalClient.AggregatedList(ctx, req, opts...) +} + +// Delete deletes the specified Operations resource. +func (c *GlobalOperationsClient) Delete(ctx context.Context, req *computepb.DeleteGlobalOperationRequest, opts ...gax.CallOption) (*computepb.DeleteGlobalOperationResponse, error) { + return c.internalClient.Delete(ctx, req, opts...) +} + +// Get retrieves the specified Operations resource. Gets a list of operations by making a list() request. +func (c *GlobalOperationsClient) Get(ctx context.Context, req *computepb.GetGlobalOperationRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.Get(ctx, req, opts...) +} + +// List retrieves a list of Operation resources contained within the specified project. +func (c *GlobalOperationsClient) List(ctx context.Context, req *computepb.ListGlobalOperationsRequest, opts ...gax.CallOption) (*computepb.OperationList, error) { + return c.internalClient.List(ctx, req, opts...) +} + +// Wait waits for the specified Operation resource to return as DONE or for the request to approach the 2 minute deadline, and retrieves the specified Operation resource. This method differs from the GET method in that it waits for no more than the default deadline (2 minutes) and then returns the current state of the operation, which might be DONE or still in progress. +// +// This method is called on a best-effort basis. Specifically: +// +// In uncommon cases, when the server is overloaded, the request might return before the default deadline is reached, or might return after zero seconds. +// +// If the default deadline is reached, there is no guarantee that the operation is actually done when the method returns. Be prepared to retry if the operation is not DONE. +func (c *GlobalOperationsClient) Wait(ctx context.Context, req *computepb.WaitGlobalOperationRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.Wait(ctx, req, opts...) +} + +// Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls. +type globalOperationsRESTClient struct { + // The http endpoint to connect to. + endpoint string + + // The http client. + httpClient *http.Client + + // The x-goog-* metadata to be sent with each request. + xGoogMetadata metadata.MD +} + +// NewGlobalOperationsRESTClient creates a new global operations rest client. +// +// The GlobalOperations API. +func NewGlobalOperationsRESTClient(ctx context.Context, opts ...option.ClientOption) (*GlobalOperationsClient, error) { + clientOpts := append(defaultGlobalOperationsRESTClientOptions(), opts...) + httpClient, endpoint, err := httptransport.NewClient(ctx, clientOpts...) + if err != nil { + return nil, err + } + + c := &globalOperationsRESTClient{ + endpoint: endpoint, + httpClient: httpClient, + } + c.setGoogleClientInfo() + + return &GlobalOperationsClient{internalClient: c, CallOptions: &GlobalOperationsCallOptions{}}, nil +} + +func defaultGlobalOperationsRESTClientOptions() []option.ClientOption { + return []option.ClientOption{ + internaloption.WithDefaultEndpoint("compute.googleapis.com"), + internaloption.WithDefaultMTLSEndpoint("compute.mtls.googleapis.com"), + internaloption.WithDefaultAudience("https://compute.googleapis.com/"), + internaloption.WithDefaultScopes(DefaultAuthScopes()...), + } +} + +// setGoogleClientInfo sets the name and version of the application in +// the `x-goog-api-client` header passed on each request. Intended for +// use by Google-written clients. +func (c *globalOperationsRESTClient) setGoogleClientInfo(keyval ...string) { + kv := append([]string{"gl-go", versionGo()}, keyval...) + kv = append(kv, "gapic", versionClient, "gax", gax.Version, "rest", "UNKNOWN") + c.xGoogMetadata = metadata.Pairs("x-goog-api-client", gax.XGoogHeader(kv...)) +} + +// Close closes the connection to the API service. The user should invoke this when +// the client is no longer required. +func (c *globalOperationsRESTClient) Close() error { + // Replace httpClient with nil to force cleanup. + c.httpClient = nil + return nil +} + +// Connection returns a connection to the API service. +// +// Deprecated. +func (c *globalOperationsRESTClient) Connection() *grpc.ClientConn { + return nil +} + +// AggregatedList retrieves an aggregated list of all operations. +func (c *globalOperationsRESTClient) AggregatedList(ctx context.Context, req *computepb.AggregatedListGlobalOperationsRequest, opts ...gax.CallOption) (*computepb.OperationAggregatedList, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/aggregated/operations", req.GetProject()) + + params := url.Values{} + if req != nil && req.Filter != nil { + params.Add("filter", fmt.Sprintf("%v", req.GetFilter())) + } + if req != nil && req.IncludeAllScopes != nil { + params.Add("includeAllScopes", fmt.Sprintf("%v", req.GetIncludeAllScopes())) + } + 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() + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.OperationAggregatedList{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Delete deletes the specified Operations resource. +func (c *globalOperationsRESTClient) Delete(ctx context.Context, req *computepb.DeleteGlobalOperationRequest, opts ...gax.CallOption) (*computepb.DeleteGlobalOperationResponse, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/global/operations/%v", req.GetProject(), req.GetOperation()) + + httpReq, err := http.NewRequest("DELETE", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.DeleteGlobalOperationResponse{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Get retrieves the specified Operations resource. Gets a list of operations by making a list() request. +func (c *globalOperationsRESTClient) Get(ctx context.Context, req *computepb.GetGlobalOperationRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/global/operations/%v", req.GetProject(), req.GetOperation()) + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// List retrieves a list of Operation resources contained within the specified project. +func (c *globalOperationsRESTClient) List(ctx context.Context, req *computepb.ListGlobalOperationsRequest, opts ...gax.CallOption) (*computepb.OperationList, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/global/operations", 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() + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.OperationList{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Wait waits for the specified Operation resource to return as DONE or for the request to approach the 2 minute deadline, and retrieves the specified Operation resource. This method differs from the GET method in that it waits for no more than the default deadline (2 minutes) and then returns the current state of the operation, which might be DONE or still in progress. +// +// This method is called on a best-effort basis. Specifically: +// +// In uncommon cases, when the server is overloaded, the request might return before the default deadline is reached, or might return after zero seconds. +// +// If the default deadline is reached, there is no guarantee that the operation is actually done when the method returns. Be prepared to retry if the operation is not DONE. +func (c *globalOperationsRESTClient) Wait(ctx context.Context, req *computepb.WaitGlobalOperationRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/global/operations/%v/wait", req.GetProject(), req.GetOperation()) + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} diff --git a/compute/apiv1/global_operations_client_example_test.go b/compute/apiv1/global_operations_client_example_test.go new file mode 100644 index 00000000000..4cb6a7867b3 --- /dev/null +++ b/compute/apiv1/global_operations_client_example_test.go @@ -0,0 +1,131 @@ +// Copyright 2021 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_test + +import ( + "context" + + compute "cloud.google.com/go/compute/apiv1" + computepb "google.golang.org/genproto/googleapis/cloud/compute/v1" +) + +func ExampleNewGlobalOperationsRESTClient() { + ctx := context.Background() + c, err := compute.NewGlobalOperationsRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + // TODO: Use client. + _ = c +} + +func ExampleGlobalOperationsClient_AggregatedList() { + ctx := context.Background() + c, err := compute.NewGlobalOperationsRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.AggregatedListGlobalOperationsRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.AggregatedList(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleGlobalOperationsClient_Delete() { + ctx := context.Background() + c, err := compute.NewGlobalOperationsRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.DeleteGlobalOperationRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Delete(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleGlobalOperationsClient_Get() { + ctx := context.Background() + c, err := compute.NewGlobalOperationsRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.GetGlobalOperationRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Get(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleGlobalOperationsClient_List() { + ctx := context.Background() + c, err := compute.NewGlobalOperationsRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.ListGlobalOperationsRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.List(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleGlobalOperationsClient_Wait() { + ctx := context.Background() + c, err := compute.NewGlobalOperationsRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.WaitGlobalOperationRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Wait(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} diff --git a/compute/apiv1/global_organization_operations_client.go b/compute/apiv1/global_organization_operations_client.go new file mode 100644 index 00000000000..94cec22cbfc --- /dev/null +++ b/compute/apiv1/global_organization_operations_client.go @@ -0,0 +1,332 @@ +// Copyright 2021 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/ioutil" + "net/http" + "net/url" + + gax "github.com/googleapis/gax-go/v2" + "google.golang.org/api/option" + "google.golang.org/api/option/internaloption" + httptransport "google.golang.org/api/transport/http" + computepb "google.golang.org/genproto/googleapis/cloud/compute/v1" + "google.golang.org/grpc" + "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/encoding/protojson" +) + +var newGlobalOrganizationOperationsClientHook clientHook + +// GlobalOrganizationOperationsCallOptions contains the retry settings for each method of GlobalOrganizationOperationsClient. +type GlobalOrganizationOperationsCallOptions struct { + Delete []gax.CallOption + Get []gax.CallOption + List []gax.CallOption +} + +// internalGlobalOrganizationOperationsClient is an interface that defines the methods availaible from Google Compute Engine API. +type internalGlobalOrganizationOperationsClient interface { + Close() error + setGoogleClientInfo(...string) + Connection() *grpc.ClientConn + Delete(context.Context, *computepb.DeleteGlobalOrganizationOperationRequest, ...gax.CallOption) (*computepb.DeleteGlobalOrganizationOperationResponse, error) + Get(context.Context, *computepb.GetGlobalOrganizationOperationRequest, ...gax.CallOption) (*computepb.Operation, error) + List(context.Context, *computepb.ListGlobalOrganizationOperationsRequest, ...gax.CallOption) (*computepb.OperationList, error) +} + +// GlobalOrganizationOperationsClient 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 GlobalOrganizationOperations API. +type GlobalOrganizationOperationsClient struct { + // The internal transport-dependent client. + internalClient internalGlobalOrganizationOperationsClient + + // The call options for this service. + CallOptions *GlobalOrganizationOperationsCallOptions +} + +// 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 *GlobalOrganizationOperationsClient) 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 *GlobalOrganizationOperationsClient) setGoogleClientInfo(keyval ...string) { + c.internalClient.setGoogleClientInfo(keyval...) +} + +// Connection returns a connection to the API service. +// +// Deprecated. +func (c *GlobalOrganizationOperationsClient) Connection() *grpc.ClientConn { + return c.internalClient.Connection() +} + +// Delete deletes the specified Operations resource. +func (c *GlobalOrganizationOperationsClient) Delete(ctx context.Context, req *computepb.DeleteGlobalOrganizationOperationRequest, opts ...gax.CallOption) (*computepb.DeleteGlobalOrganizationOperationResponse, error) { + return c.internalClient.Delete(ctx, req, opts...) +} + +// Get retrieves the specified Operations resource. Gets a list of operations by making a list() request. +func (c *GlobalOrganizationOperationsClient) Get(ctx context.Context, req *computepb.GetGlobalOrganizationOperationRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.Get(ctx, req, opts...) +} + +// List retrieves a list of Operation resources contained within the specified organization. +func (c *GlobalOrganizationOperationsClient) List(ctx context.Context, req *computepb.ListGlobalOrganizationOperationsRequest, opts ...gax.CallOption) (*computepb.OperationList, error) { + return c.internalClient.List(ctx, req, opts...) +} + +// Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls. +type globalOrganizationOperationsRESTClient struct { + // The http endpoint to connect to. + endpoint string + + // The http client. + httpClient *http.Client + + // The x-goog-* metadata to be sent with each request. + xGoogMetadata metadata.MD +} + +// NewGlobalOrganizationOperationsRESTClient creates a new global organization operations rest client. +// +// The GlobalOrganizationOperations API. +func NewGlobalOrganizationOperationsRESTClient(ctx context.Context, opts ...option.ClientOption) (*GlobalOrganizationOperationsClient, error) { + clientOpts := append(defaultGlobalOrganizationOperationsRESTClientOptions(), opts...) + httpClient, endpoint, err := httptransport.NewClient(ctx, clientOpts...) + if err != nil { + return nil, err + } + + c := &globalOrganizationOperationsRESTClient{ + endpoint: endpoint, + httpClient: httpClient, + } + c.setGoogleClientInfo() + + return &GlobalOrganizationOperationsClient{internalClient: c, CallOptions: &GlobalOrganizationOperationsCallOptions{}}, nil +} + +func defaultGlobalOrganizationOperationsRESTClientOptions() []option.ClientOption { + return []option.ClientOption{ + internaloption.WithDefaultEndpoint("compute.googleapis.com"), + internaloption.WithDefaultMTLSEndpoint("compute.mtls.googleapis.com"), + internaloption.WithDefaultAudience("https://compute.googleapis.com/"), + internaloption.WithDefaultScopes(DefaultAuthScopes()...), + } +} + +// setGoogleClientInfo sets the name and version of the application in +// the `x-goog-api-client` header passed on each request. Intended for +// use by Google-written clients. +func (c *globalOrganizationOperationsRESTClient) setGoogleClientInfo(keyval ...string) { + kv := append([]string{"gl-go", versionGo()}, keyval...) + kv = append(kv, "gapic", versionClient, "gax", gax.Version, "rest", "UNKNOWN") + c.xGoogMetadata = metadata.Pairs("x-goog-api-client", gax.XGoogHeader(kv...)) +} + +// Close closes the connection to the API service. The user should invoke this when +// the client is no longer required. +func (c *globalOrganizationOperationsRESTClient) Close() error { + // Replace httpClient with nil to force cleanup. + c.httpClient = nil + return nil +} + +// Connection returns a connection to the API service. +// +// Deprecated. +func (c *globalOrganizationOperationsRESTClient) Connection() *grpc.ClientConn { + return nil +} + +// Delete deletes the specified Operations resource. +func (c *globalOrganizationOperationsRESTClient) Delete(ctx context.Context, req *computepb.DeleteGlobalOrganizationOperationRequest, opts ...gax.CallOption) (*computepb.DeleteGlobalOrganizationOperationResponse, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/locations/global/operations/%v", req.GetOperation()) + + params := url.Values{} + if req != nil && req.ParentId != nil { + params.Add("parentId", fmt.Sprintf("%v", req.GetParentId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("DELETE", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.DeleteGlobalOrganizationOperationResponse{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Get retrieves the specified Operations resource. Gets a list of operations by making a list() request. +func (c *globalOrganizationOperationsRESTClient) Get(ctx context.Context, req *computepb.GetGlobalOrganizationOperationRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/locations/global/operations/%v", req.GetOperation()) + + params := url.Values{} + if req != nil && req.ParentId != nil { + params.Add("parentId", fmt.Sprintf("%v", req.GetParentId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// List retrieves a list of Operation resources contained within the specified organization. +func (c *globalOrganizationOperationsRESTClient) List(ctx context.Context, req *computepb.ListGlobalOrganizationOperationsRequest, opts ...gax.CallOption) (*computepb.OperationList, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/locations/global/operations") + + 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.ParentId != nil { + params.Add("parentId", fmt.Sprintf("%v", req.GetParentId())) + } + if req != nil && req.ReturnPartialSuccess != nil { + params.Add("returnPartialSuccess", fmt.Sprintf("%v", req.GetReturnPartialSuccess())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.OperationList{} + + return rsp, unm.Unmarshal(buf, rsp) +} diff --git a/compute/apiv1/global_organization_operations_client_example_test.go b/compute/apiv1/global_organization_operations_client_example_test.go new file mode 100644 index 00000000000..1018ba67433 --- /dev/null +++ b/compute/apiv1/global_organization_operations_client_example_test.go @@ -0,0 +1,93 @@ +// Copyright 2021 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_test + +import ( + "context" + + compute "cloud.google.com/go/compute/apiv1" + computepb "google.golang.org/genproto/googleapis/cloud/compute/v1" +) + +func ExampleNewGlobalOrganizationOperationsRESTClient() { + ctx := context.Background() + c, err := compute.NewGlobalOrganizationOperationsRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + // TODO: Use client. + _ = c +} + +func ExampleGlobalOrganizationOperationsClient_Delete() { + ctx := context.Background() + c, err := compute.NewGlobalOrganizationOperationsRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.DeleteGlobalOrganizationOperationRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Delete(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleGlobalOrganizationOperationsClient_Get() { + ctx := context.Background() + c, err := compute.NewGlobalOrganizationOperationsRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.GetGlobalOrganizationOperationRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Get(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleGlobalOrganizationOperationsClient_List() { + ctx := context.Background() + c, err := compute.NewGlobalOrganizationOperationsRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.ListGlobalOrganizationOperationsRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.List(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} diff --git a/compute/apiv1/global_public_delegated_prefixes_client.go b/compute/apiv1/global_public_delegated_prefixes_client.go new file mode 100644 index 00000000000..b0e0fc7cc99 --- /dev/null +++ b/compute/apiv1/global_public_delegated_prefixes_client.go @@ -0,0 +1,438 @@ +// Copyright 2021 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/ioutil" + "net/http" + "net/url" + + gax "github.com/googleapis/gax-go/v2" + "google.golang.org/api/option" + "google.golang.org/api/option/internaloption" + httptransport "google.golang.org/api/transport/http" + computepb "google.golang.org/genproto/googleapis/cloud/compute/v1" + "google.golang.org/grpc" + "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/encoding/protojson" +) + +var newGlobalPublicDelegatedPrefixesClientHook clientHook + +// GlobalPublicDelegatedPrefixesCallOptions contains the retry settings for each method of GlobalPublicDelegatedPrefixesClient. +type GlobalPublicDelegatedPrefixesCallOptions struct { + Delete []gax.CallOption + Get []gax.CallOption + Insert []gax.CallOption + List []gax.CallOption + Patch []gax.CallOption +} + +// internalGlobalPublicDelegatedPrefixesClient is an interface that defines the methods availaible from Google Compute Engine API. +type internalGlobalPublicDelegatedPrefixesClient interface { + Close() error + setGoogleClientInfo(...string) + Connection() *grpc.ClientConn + Delete(context.Context, *computepb.DeleteGlobalPublicDelegatedPrefixeRequest, ...gax.CallOption) (*computepb.Operation, error) + Get(context.Context, *computepb.GetGlobalPublicDelegatedPrefixeRequest, ...gax.CallOption) (*computepb.PublicDelegatedPrefix, error) + Insert(context.Context, *computepb.InsertGlobalPublicDelegatedPrefixeRequest, ...gax.CallOption) (*computepb.Operation, error) + List(context.Context, *computepb.ListGlobalPublicDelegatedPrefixesRequest, ...gax.CallOption) (*computepb.PublicDelegatedPrefixList, error) + Patch(context.Context, *computepb.PatchGlobalPublicDelegatedPrefixeRequest, ...gax.CallOption) (*computepb.Operation, error) +} + +// GlobalPublicDelegatedPrefixesClient 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 GlobalPublicDelegatedPrefixes API. +type GlobalPublicDelegatedPrefixesClient struct { + // The internal transport-dependent client. + internalClient internalGlobalPublicDelegatedPrefixesClient + + // The call options for this service. + CallOptions *GlobalPublicDelegatedPrefixesCallOptions +} + +// 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 *GlobalPublicDelegatedPrefixesClient) 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 *GlobalPublicDelegatedPrefixesClient) setGoogleClientInfo(keyval ...string) { + c.internalClient.setGoogleClientInfo(keyval...) +} + +// Connection returns a connection to the API service. +// +// Deprecated. +func (c *GlobalPublicDelegatedPrefixesClient) Connection() *grpc.ClientConn { + return c.internalClient.Connection() +} + +// Delete deletes the specified global PublicDelegatedPrefix. +func (c *GlobalPublicDelegatedPrefixesClient) Delete(ctx context.Context, req *computepb.DeleteGlobalPublicDelegatedPrefixeRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.Delete(ctx, req, opts...) +} + +// Get returns the specified global PublicDelegatedPrefix resource. +func (c *GlobalPublicDelegatedPrefixesClient) Get(ctx context.Context, req *computepb.GetGlobalPublicDelegatedPrefixeRequest, opts ...gax.CallOption) (*computepb.PublicDelegatedPrefix, error) { + return c.internalClient.Get(ctx, req, opts...) +} + +// Insert creates a global PublicDelegatedPrefix in the specified project using the parameters that are included in the request. +func (c *GlobalPublicDelegatedPrefixesClient) Insert(ctx context.Context, req *computepb.InsertGlobalPublicDelegatedPrefixeRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.Insert(ctx, req, opts...) +} + +// List lists the global PublicDelegatedPrefixes for a project. +func (c *GlobalPublicDelegatedPrefixesClient) List(ctx context.Context, req *computepb.ListGlobalPublicDelegatedPrefixesRequest, opts ...gax.CallOption) (*computepb.PublicDelegatedPrefixList, error) { + return c.internalClient.List(ctx, req, opts...) +} + +// Patch patches the specified global PublicDelegatedPrefix resource with the data included in the request. This method supports PATCH semantics and uses JSON merge patch format and processing rules. +func (c *GlobalPublicDelegatedPrefixesClient) Patch(ctx context.Context, req *computepb.PatchGlobalPublicDelegatedPrefixeRequest, opts ...gax.CallOption) (*computepb.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 globalPublicDelegatedPrefixesRESTClient struct { + // The http endpoint to connect to. + endpoint string + + // The http client. + httpClient *http.Client + + // The x-goog-* metadata to be sent with each request. + xGoogMetadata metadata.MD +} + +// NewGlobalPublicDelegatedPrefixesRESTClient creates a new global public delegated prefixes rest client. +// +// The GlobalPublicDelegatedPrefixes API. +func NewGlobalPublicDelegatedPrefixesRESTClient(ctx context.Context, opts ...option.ClientOption) (*GlobalPublicDelegatedPrefixesClient, error) { + clientOpts := append(defaultGlobalPublicDelegatedPrefixesRESTClientOptions(), opts...) + httpClient, endpoint, err := httptransport.NewClient(ctx, clientOpts...) + if err != nil { + return nil, err + } + + c := &globalPublicDelegatedPrefixesRESTClient{ + endpoint: endpoint, + httpClient: httpClient, + } + c.setGoogleClientInfo() + + return &GlobalPublicDelegatedPrefixesClient{internalClient: c, CallOptions: &GlobalPublicDelegatedPrefixesCallOptions{}}, nil +} + +func defaultGlobalPublicDelegatedPrefixesRESTClientOptions() []option.ClientOption { + return []option.ClientOption{ + internaloption.WithDefaultEndpoint("compute.googleapis.com"), + internaloption.WithDefaultMTLSEndpoint("compute.mtls.googleapis.com"), + internaloption.WithDefaultAudience("https://compute.googleapis.com/"), + internaloption.WithDefaultScopes(DefaultAuthScopes()...), + } +} + +// setGoogleClientInfo sets the name and version of the application in +// the `x-goog-api-client` header passed on each request. Intended for +// use by Google-written clients. +func (c *globalPublicDelegatedPrefixesRESTClient) setGoogleClientInfo(keyval ...string) { + kv := append([]string{"gl-go", versionGo()}, keyval...) + kv = append(kv, "gapic", versionClient, "gax", gax.Version, "rest", "UNKNOWN") + c.xGoogMetadata = metadata.Pairs("x-goog-api-client", gax.XGoogHeader(kv...)) +} + +// Close closes the connection to the API service. The user should invoke this when +// the client is no longer required. +func (c *globalPublicDelegatedPrefixesRESTClient) Close() error { + // Replace httpClient with nil to force cleanup. + c.httpClient = nil + return nil +} + +// Connection returns a connection to the API service. +// +// Deprecated. +func (c *globalPublicDelegatedPrefixesRESTClient) Connection() *grpc.ClientConn { + return nil +} + +// Delete deletes the specified global PublicDelegatedPrefix. +func (c *globalPublicDelegatedPrefixesRESTClient) Delete(ctx context.Context, req *computepb.DeleteGlobalPublicDelegatedPrefixeRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/global/publicDelegatedPrefixes/%v", req.GetProject(), req.GetPublicDelegatedPrefix()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("DELETE", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Get returns the specified global PublicDelegatedPrefix resource. +func (c *globalPublicDelegatedPrefixesRESTClient) Get(ctx context.Context, req *computepb.GetGlobalPublicDelegatedPrefixeRequest, opts ...gax.CallOption) (*computepb.PublicDelegatedPrefix, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/global/publicDelegatedPrefixes/%v", req.GetProject(), req.GetPublicDelegatedPrefix()) + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.PublicDelegatedPrefix{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Insert creates a global PublicDelegatedPrefix in the specified project using the parameters that are included in the request. +func (c *globalPublicDelegatedPrefixesRESTClient) Insert(ctx context.Context, req *computepb.InsertGlobalPublicDelegatedPrefixeRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetPublicDelegatedPrefixResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/global/publicDelegatedPrefixes", req.GetProject()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// List lists the global PublicDelegatedPrefixes for a project. +func (c *globalPublicDelegatedPrefixesRESTClient) List(ctx context.Context, req *computepb.ListGlobalPublicDelegatedPrefixesRequest, opts ...gax.CallOption) (*computepb.PublicDelegatedPrefixList, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/global/publicDelegatedPrefixes", 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() + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.PublicDelegatedPrefixList{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Patch patches the specified global PublicDelegatedPrefix resource with the data included in the request. This method supports PATCH semantics and uses JSON merge patch format and processing rules. +func (c *globalPublicDelegatedPrefixesRESTClient) Patch(ctx context.Context, req *computepb.PatchGlobalPublicDelegatedPrefixeRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetPublicDelegatedPrefixResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/global/publicDelegatedPrefixes/%v", req.GetProject(), req.GetPublicDelegatedPrefix()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("PATCH", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} diff --git a/compute/apiv1/global_public_delegated_prefixes_client_example_test.go b/compute/apiv1/global_public_delegated_prefixes_client_example_test.go new file mode 100644 index 00000000000..dc9f1da0034 --- /dev/null +++ b/compute/apiv1/global_public_delegated_prefixes_client_example_test.go @@ -0,0 +1,131 @@ +// Copyright 2021 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_test + +import ( + "context" + + compute "cloud.google.com/go/compute/apiv1" + computepb "google.golang.org/genproto/googleapis/cloud/compute/v1" +) + +func ExampleNewGlobalPublicDelegatedPrefixesRESTClient() { + ctx := context.Background() + c, err := compute.NewGlobalPublicDelegatedPrefixesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + // TODO: Use client. + _ = c +} + +func ExampleGlobalPublicDelegatedPrefixesClient_Delete() { + ctx := context.Background() + c, err := compute.NewGlobalPublicDelegatedPrefixesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.DeleteGlobalPublicDelegatedPrefixeRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Delete(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleGlobalPublicDelegatedPrefixesClient_Get() { + ctx := context.Background() + c, err := compute.NewGlobalPublicDelegatedPrefixesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.GetGlobalPublicDelegatedPrefixeRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Get(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleGlobalPublicDelegatedPrefixesClient_Insert() { + ctx := context.Background() + c, err := compute.NewGlobalPublicDelegatedPrefixesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.InsertGlobalPublicDelegatedPrefixeRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Insert(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleGlobalPublicDelegatedPrefixesClient_List() { + ctx := context.Background() + c, err := compute.NewGlobalPublicDelegatedPrefixesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.ListGlobalPublicDelegatedPrefixesRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.List(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleGlobalPublicDelegatedPrefixesClient_Patch() { + ctx := context.Background() + c, err := compute.NewGlobalPublicDelegatedPrefixesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.PatchGlobalPublicDelegatedPrefixeRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Patch(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} diff --git a/compute/apiv1/health_checks_client.go b/compute/apiv1/health_checks_client.go new file mode 100644 index 00000000000..887b7c4a853 --- /dev/null +++ b/compute/apiv1/health_checks_client.go @@ -0,0 +1,574 @@ +// Copyright 2021 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/ioutil" + "net/http" + "net/url" + + gax "github.com/googleapis/gax-go/v2" + "google.golang.org/api/option" + "google.golang.org/api/option/internaloption" + httptransport "google.golang.org/api/transport/http" + computepb "google.golang.org/genproto/googleapis/cloud/compute/v1" + "google.golang.org/grpc" + "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/encoding/protojson" +) + +var newHealthChecksClientHook clientHook + +// HealthChecksCallOptions contains the retry settings for each method of HealthChecksClient. +type HealthChecksCallOptions struct { + AggregatedList []gax.CallOption + Delete []gax.CallOption + Get []gax.CallOption + Insert []gax.CallOption + List []gax.CallOption + Patch []gax.CallOption + Update []gax.CallOption +} + +// internalHealthChecksClient is an interface that defines the methods availaible from Google Compute Engine API. +type internalHealthChecksClient interface { + Close() error + setGoogleClientInfo(...string) + Connection() *grpc.ClientConn + AggregatedList(context.Context, *computepb.AggregatedListHealthChecksRequest, ...gax.CallOption) (*computepb.HealthChecksAggregatedList, error) + Delete(context.Context, *computepb.DeleteHealthCheckRequest, ...gax.CallOption) (*computepb.Operation, error) + Get(context.Context, *computepb.GetHealthCheckRequest, ...gax.CallOption) (*computepb.HealthCheck, error) + Insert(context.Context, *computepb.InsertHealthCheckRequest, ...gax.CallOption) (*computepb.Operation, error) + List(context.Context, *computepb.ListHealthChecksRequest, ...gax.CallOption) (*computepb.HealthCheckList, error) + Patch(context.Context, *computepb.PatchHealthCheckRequest, ...gax.CallOption) (*computepb.Operation, error) + Update(context.Context, *computepb.UpdateHealthCheckRequest, ...gax.CallOption) (*computepb.Operation, error) +} + +// HealthChecksClient 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 HealthChecks API. +type HealthChecksClient struct { + // The internal transport-dependent client. + internalClient internalHealthChecksClient + + // The call options for this service. + CallOptions *HealthChecksCallOptions +} + +// 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 *HealthChecksClient) 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 *HealthChecksClient) setGoogleClientInfo(keyval ...string) { + c.internalClient.setGoogleClientInfo(keyval...) +} + +// Connection returns a connection to the API service. +// +// Deprecated. +func (c *HealthChecksClient) Connection() *grpc.ClientConn { + return c.internalClient.Connection() +} + +// AggregatedList retrieves the list of all HealthCheck resources, regional and global, available to the specified project. +func (c *HealthChecksClient) AggregatedList(ctx context.Context, req *computepb.AggregatedListHealthChecksRequest, opts ...gax.CallOption) (*computepb.HealthChecksAggregatedList, error) { + return c.internalClient.AggregatedList(ctx, req, opts...) +} + +// Delete deletes the specified HealthCheck resource. +func (c *HealthChecksClient) Delete(ctx context.Context, req *computepb.DeleteHealthCheckRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.Delete(ctx, req, opts...) +} + +// Get returns the specified HealthCheck resource. Gets a list of available health checks by making a list() request. +func (c *HealthChecksClient) Get(ctx context.Context, req *computepb.GetHealthCheckRequest, opts ...gax.CallOption) (*computepb.HealthCheck, error) { + return c.internalClient.Get(ctx, req, opts...) +} + +// Insert creates a HealthCheck resource in the specified project using the data included in the request. +func (c *HealthChecksClient) Insert(ctx context.Context, req *computepb.InsertHealthCheckRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.Insert(ctx, req, opts...) +} + +// List retrieves the list of HealthCheck resources available to the specified project. +func (c *HealthChecksClient) List(ctx context.Context, req *computepb.ListHealthChecksRequest, opts ...gax.CallOption) (*computepb.HealthCheckList, error) { + return c.internalClient.List(ctx, req, opts...) +} + +// Patch updates a HealthCheck resource in the specified project using the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. +func (c *HealthChecksClient) Patch(ctx context.Context, req *computepb.PatchHealthCheckRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.Patch(ctx, req, opts...) +} + +// Update updates a HealthCheck resource in the specified project using the data included in the request. +func (c *HealthChecksClient) Update(ctx context.Context, req *computepb.UpdateHealthCheckRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.Update(ctx, req, opts...) +} + +// Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls. +type healthChecksRESTClient struct { + // The http endpoint to connect to. + endpoint string + + // The http client. + httpClient *http.Client + + // The x-goog-* metadata to be sent with each request. + xGoogMetadata metadata.MD +} + +// NewHealthChecksRESTClient creates a new health checks rest client. +// +// The HealthChecks API. +func NewHealthChecksRESTClient(ctx context.Context, opts ...option.ClientOption) (*HealthChecksClient, error) { + clientOpts := append(defaultHealthChecksRESTClientOptions(), opts...) + httpClient, endpoint, err := httptransport.NewClient(ctx, clientOpts...) + if err != nil { + return nil, err + } + + c := &healthChecksRESTClient{ + endpoint: endpoint, + httpClient: httpClient, + } + c.setGoogleClientInfo() + + return &HealthChecksClient{internalClient: c, CallOptions: &HealthChecksCallOptions{}}, nil +} + +func defaultHealthChecksRESTClientOptions() []option.ClientOption { + return []option.ClientOption{ + internaloption.WithDefaultEndpoint("compute.googleapis.com"), + internaloption.WithDefaultMTLSEndpoint("compute.mtls.googleapis.com"), + internaloption.WithDefaultAudience("https://compute.googleapis.com/"), + internaloption.WithDefaultScopes(DefaultAuthScopes()...), + } +} + +// setGoogleClientInfo sets the name and version of the application in +// the `x-goog-api-client` header passed on each request. Intended for +// use by Google-written clients. +func (c *healthChecksRESTClient) setGoogleClientInfo(keyval ...string) { + kv := append([]string{"gl-go", versionGo()}, keyval...) + kv = append(kv, "gapic", versionClient, "gax", gax.Version, "rest", "UNKNOWN") + c.xGoogMetadata = metadata.Pairs("x-goog-api-client", gax.XGoogHeader(kv...)) +} + +// Close closes the connection to the API service. The user should invoke this when +// the client is no longer required. +func (c *healthChecksRESTClient) Close() error { + // Replace httpClient with nil to force cleanup. + c.httpClient = nil + return nil +} + +// Connection returns a connection to the API service. +// +// Deprecated. +func (c *healthChecksRESTClient) Connection() *grpc.ClientConn { + return nil +} + +// AggregatedList retrieves the list of all HealthCheck resources, regional and global, available to the specified project. +func (c *healthChecksRESTClient) AggregatedList(ctx context.Context, req *computepb.AggregatedListHealthChecksRequest, opts ...gax.CallOption) (*computepb.HealthChecksAggregatedList, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/aggregated/healthChecks", req.GetProject()) + + params := url.Values{} + if req != nil && req.Filter != nil { + params.Add("filter", fmt.Sprintf("%v", req.GetFilter())) + } + if req != nil && req.IncludeAllScopes != nil { + params.Add("includeAllScopes", fmt.Sprintf("%v", req.GetIncludeAllScopes())) + } + 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() + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.HealthChecksAggregatedList{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Delete deletes the specified HealthCheck resource. +func (c *healthChecksRESTClient) Delete(ctx context.Context, req *computepb.DeleteHealthCheckRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/global/healthChecks/%v", req.GetProject(), req.GetHealthCheck()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("DELETE", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Get returns the specified HealthCheck resource. Gets a list of available health checks by making a list() request. +func (c *healthChecksRESTClient) Get(ctx context.Context, req *computepb.GetHealthCheckRequest, opts ...gax.CallOption) (*computepb.HealthCheck, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/global/healthChecks/%v", req.GetProject(), req.GetHealthCheck()) + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.HealthCheck{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Insert creates a HealthCheck resource in the specified project using the data included in the request. +func (c *healthChecksRESTClient) Insert(ctx context.Context, req *computepb.InsertHealthCheckRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetHealthCheckResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/global/healthChecks", req.GetProject()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// List retrieves the list of HealthCheck resources available to the specified project. +func (c *healthChecksRESTClient) List(ctx context.Context, req *computepb.ListHealthChecksRequest, opts ...gax.CallOption) (*computepb.HealthCheckList, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/global/healthChecks", 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() + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.HealthCheckList{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Patch updates a HealthCheck resource in the specified project using the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. +func (c *healthChecksRESTClient) Patch(ctx context.Context, req *computepb.PatchHealthCheckRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetHealthCheckResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/global/healthChecks/%v", req.GetProject(), req.GetHealthCheck()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("PATCH", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Update updates a HealthCheck resource in the specified project using the data included in the request. +func (c *healthChecksRESTClient) Update(ctx context.Context, req *computepb.UpdateHealthCheckRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetHealthCheckResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("") + + params := url.Values{} + if req.GetHealthCheck() != "" { + params.Add("healthCheck", fmt.Sprintf("%v", req.GetHealthCheck())) + } + if req.GetProject() != "" { + params.Add("project", fmt.Sprintf("%v", req.GetProject())) + } + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("PUT", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} diff --git a/compute/apiv1/health_checks_client_example_test.go b/compute/apiv1/health_checks_client_example_test.go new file mode 100644 index 00000000000..fe6aeb7fe68 --- /dev/null +++ b/compute/apiv1/health_checks_client_example_test.go @@ -0,0 +1,169 @@ +// Copyright 2021 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_test + +import ( + "context" + + compute "cloud.google.com/go/compute/apiv1" + computepb "google.golang.org/genproto/googleapis/cloud/compute/v1" +) + +func ExampleNewHealthChecksRESTClient() { + ctx := context.Background() + c, err := compute.NewHealthChecksRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + // TODO: Use client. + _ = c +} + +func ExampleHealthChecksClient_AggregatedList() { + ctx := context.Background() + c, err := compute.NewHealthChecksRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.AggregatedListHealthChecksRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.AggregatedList(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleHealthChecksClient_Delete() { + ctx := context.Background() + c, err := compute.NewHealthChecksRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.DeleteHealthCheckRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Delete(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleHealthChecksClient_Get() { + ctx := context.Background() + c, err := compute.NewHealthChecksRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.GetHealthCheckRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Get(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleHealthChecksClient_Insert() { + ctx := context.Background() + c, err := compute.NewHealthChecksRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.InsertHealthCheckRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Insert(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleHealthChecksClient_List() { + ctx := context.Background() + c, err := compute.NewHealthChecksRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.ListHealthChecksRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.List(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleHealthChecksClient_Patch() { + ctx := context.Background() + c, err := compute.NewHealthChecksRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.PatchHealthCheckRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Patch(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleHealthChecksClient_Update() { + ctx := context.Background() + c, err := compute.NewHealthChecksRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.UpdateHealthCheckRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Update(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} diff --git a/compute/apiv1/images_client.go b/compute/apiv1/images_client.go new file mode 100644 index 00000000000..8fbfa02a672 --- /dev/null +++ b/compute/apiv1/images_client.go @@ -0,0 +1,763 @@ +// Copyright 2021 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/ioutil" + "net/http" + "net/url" + + gax "github.com/googleapis/gax-go/v2" + "google.golang.org/api/option" + "google.golang.org/api/option/internaloption" + httptransport "google.golang.org/api/transport/http" + computepb "google.golang.org/genproto/googleapis/cloud/compute/v1" + "google.golang.org/grpc" + "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/encoding/protojson" +) + +var newImagesClientHook clientHook + +// ImagesCallOptions contains the retry settings for each method of ImagesClient. +type ImagesCallOptions struct { + Delete []gax.CallOption + Deprecate []gax.CallOption + Get []gax.CallOption + GetFromFamily []gax.CallOption + GetIamPolicy []gax.CallOption + Insert []gax.CallOption + List []gax.CallOption + Patch []gax.CallOption + SetIamPolicy []gax.CallOption + SetLabels []gax.CallOption + TestIamPermissions []gax.CallOption +} + +// internalImagesClient is an interface that defines the methods availaible from Google Compute Engine API. +type internalImagesClient interface { + Close() error + setGoogleClientInfo(...string) + Connection() *grpc.ClientConn + Delete(context.Context, *computepb.DeleteImageRequest, ...gax.CallOption) (*computepb.Operation, error) + Deprecate(context.Context, *computepb.DeprecateImageRequest, ...gax.CallOption) (*computepb.Operation, error) + Get(context.Context, *computepb.GetImageRequest, ...gax.CallOption) (*computepb.Image, error) + GetFromFamily(context.Context, *computepb.GetFromFamilyImageRequest, ...gax.CallOption) (*computepb.Image, error) + GetIamPolicy(context.Context, *computepb.GetIamPolicyImageRequest, ...gax.CallOption) (*computepb.Policy, error) + Insert(context.Context, *computepb.InsertImageRequest, ...gax.CallOption) (*computepb.Operation, error) + List(context.Context, *computepb.ListImagesRequest, ...gax.CallOption) (*computepb.ImageList, error) + Patch(context.Context, *computepb.PatchImageRequest, ...gax.CallOption) (*computepb.Operation, error) + SetIamPolicy(context.Context, *computepb.SetIamPolicyImageRequest, ...gax.CallOption) (*computepb.Policy, error) + SetLabels(context.Context, *computepb.SetLabelsImageRequest, ...gax.CallOption) (*computepb.Operation, error) + TestIamPermissions(context.Context, *computepb.TestIamPermissionsImageRequest, ...gax.CallOption) (*computepb.TestPermissionsResponse, error) +} + +// ImagesClient 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 Images API. +type ImagesClient struct { + // The internal transport-dependent client. + internalClient internalImagesClient + + // The call options for this service. + CallOptions *ImagesCallOptions +} + +// 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 *ImagesClient) 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 *ImagesClient) setGoogleClientInfo(keyval ...string) { + c.internalClient.setGoogleClientInfo(keyval...) +} + +// Connection returns a connection to the API service. +// +// Deprecated. +func (c *ImagesClient) Connection() *grpc.ClientConn { + return c.internalClient.Connection() +} + +// Delete deletes the specified image. +func (c *ImagesClient) Delete(ctx context.Context, req *computepb.DeleteImageRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.Delete(ctx, req, opts...) +} + +// Deprecate sets the deprecation status of an image. +// +// If an empty request body is given, clears the deprecation status instead. +func (c *ImagesClient) Deprecate(ctx context.Context, req *computepb.DeprecateImageRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.Deprecate(ctx, req, opts...) +} + +// Get returns the specified image. Gets a list of available images by making a list() request. +func (c *ImagesClient) Get(ctx context.Context, req *computepb.GetImageRequest, opts ...gax.CallOption) (*computepb.Image, error) { + return c.internalClient.Get(ctx, req, opts...) +} + +// GetFromFamily returns the latest image that is part of an image family and is not deprecated. +func (c *ImagesClient) GetFromFamily(ctx context.Context, req *computepb.GetFromFamilyImageRequest, opts ...gax.CallOption) (*computepb.Image, error) { + return c.internalClient.GetFromFamily(ctx, req, opts...) +} + +// GetIamPolicy gets the access control policy for a resource. May be empty if no such policy or resource exists. +func (c *ImagesClient) GetIamPolicy(ctx context.Context, req *computepb.GetIamPolicyImageRequest, opts ...gax.CallOption) (*computepb.Policy, error) { + return c.internalClient.GetIamPolicy(ctx, req, opts...) +} + +// Insert creates an image in the specified project using the data included in the request. +func (c *ImagesClient) Insert(ctx context.Context, req *computepb.InsertImageRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.Insert(ctx, req, opts...) +} + +// List retrieves the list of custom images available to the specified project. Custom images are images you create that belong to your project. This method does not get any images that belong to other projects, including publicly-available images, like Debian 8. If you want to get a list of publicly-available images, use this method to make a request to the respective image project, such as debian-cloud or windows-cloud. +func (c *ImagesClient) List(ctx context.Context, req *computepb.ListImagesRequest, opts ...gax.CallOption) (*computepb.ImageList, error) { + return c.internalClient.List(ctx, req, opts...) +} + +// Patch patches the specified image with the data included in the request. Only the following fields can be modified: family, description, deprecation status. +func (c *ImagesClient) Patch(ctx context.Context, req *computepb.PatchImageRequest, opts ...gax.CallOption) (*computepb.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 *ImagesClient) SetIamPolicy(ctx context.Context, req *computepb.SetIamPolicyImageRequest, opts ...gax.CallOption) (*computepb.Policy, error) { + return c.internalClient.SetIamPolicy(ctx, req, opts...) +} + +// SetLabels sets the labels on an image. To learn more about labels, read the Labeling Resources documentation. +func (c *ImagesClient) SetLabels(ctx context.Context, req *computepb.SetLabelsImageRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.SetLabels(ctx, req, opts...) +} + +// TestIamPermissions returns permissions that a caller has on the specified resource. +func (c *ImagesClient) TestIamPermissions(ctx context.Context, req *computepb.TestIamPermissionsImageRequest, opts ...gax.CallOption) (*computepb.TestPermissionsResponse, error) { + return c.internalClient.TestIamPermissions(ctx, req, opts...) +} + +// Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls. +type imagesRESTClient struct { + // The http endpoint to connect to. + endpoint string + + // The http client. + httpClient *http.Client + + // The x-goog-* metadata to be sent with each request. + xGoogMetadata metadata.MD +} + +// NewImagesRESTClient creates a new images rest client. +// +// The Images API. +func NewImagesRESTClient(ctx context.Context, opts ...option.ClientOption) (*ImagesClient, error) { + clientOpts := append(defaultImagesRESTClientOptions(), opts...) + httpClient, endpoint, err := httptransport.NewClient(ctx, clientOpts...) + if err != nil { + return nil, err + } + + c := &imagesRESTClient{ + endpoint: endpoint, + httpClient: httpClient, + } + c.setGoogleClientInfo() + + return &ImagesClient{internalClient: c, CallOptions: &ImagesCallOptions{}}, nil +} + +func defaultImagesRESTClientOptions() []option.ClientOption { + return []option.ClientOption{ + internaloption.WithDefaultEndpoint("compute.googleapis.com"), + internaloption.WithDefaultMTLSEndpoint("compute.mtls.googleapis.com"), + internaloption.WithDefaultAudience("https://compute.googleapis.com/"), + internaloption.WithDefaultScopes(DefaultAuthScopes()...), + } +} + +// setGoogleClientInfo sets the name and version of the application in +// the `x-goog-api-client` header passed on each request. Intended for +// use by Google-written clients. +func (c *imagesRESTClient) setGoogleClientInfo(keyval ...string) { + kv := append([]string{"gl-go", versionGo()}, keyval...) + kv = append(kv, "gapic", versionClient, "gax", gax.Version, "rest", "UNKNOWN") + c.xGoogMetadata = metadata.Pairs("x-goog-api-client", gax.XGoogHeader(kv...)) +} + +// Close closes the connection to the API service. The user should invoke this when +// the client is no longer required. +func (c *imagesRESTClient) Close() error { + // Replace httpClient with nil to force cleanup. + c.httpClient = nil + return nil +} + +// Connection returns a connection to the API service. +// +// Deprecated. +func (c *imagesRESTClient) Connection() *grpc.ClientConn { + return nil +} + +// Delete deletes the specified image. +func (c *imagesRESTClient) Delete(ctx context.Context, req *computepb.DeleteImageRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/global/images/%v", req.GetProject(), req.GetImage()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("DELETE", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Deprecate sets the deprecation status of an image. +// +// If an empty request body is given, clears the deprecation status instead. +func (c *imagesRESTClient) Deprecate(ctx context.Context, req *computepb.DeprecateImageRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetDeprecationStatusResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/global/images/%v/deprecate", req.GetProject(), req.GetImage()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Get returns the specified image. Gets a list of available images by making a list() request. +func (c *imagesRESTClient) Get(ctx context.Context, req *computepb.GetImageRequest, opts ...gax.CallOption) (*computepb.Image, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/global/images/%v", req.GetProject(), req.GetImage()) + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Image{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// GetFromFamily returns the latest image that is part of an image family and is not deprecated. +func (c *imagesRESTClient) GetFromFamily(ctx context.Context, req *computepb.GetFromFamilyImageRequest, opts ...gax.CallOption) (*computepb.Image, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/global/images/family/%v", req.GetProject(), req.GetFamily()) + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Image{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// GetIamPolicy gets the access control policy for a resource. May be empty if no such policy or resource exists. +func (c *imagesRESTClient) GetIamPolicy(ctx context.Context, req *computepb.GetIamPolicyImageRequest, opts ...gax.CallOption) (*computepb.Policy, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/global/images/%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() + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Policy{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Insert creates an image in the specified project using the data included in the request. +func (c *imagesRESTClient) Insert(ctx context.Context, req *computepb.InsertImageRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetImageResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/global/images", req.GetProject()) + + params := url.Values{} + if req != nil && req.ForceCreate != nil { + params.Add("forceCreate", fmt.Sprintf("%v", req.GetForceCreate())) + } + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// List retrieves the list of custom images available to the specified project. Custom images are images you create that belong to your project. This method does not get any images that belong to other projects, including publicly-available images, like Debian 8. If you want to get a list of publicly-available images, use this method to make a request to the respective image project, such as debian-cloud or windows-cloud. +func (c *imagesRESTClient) List(ctx context.Context, req *computepb.ListImagesRequest, opts ...gax.CallOption) (*computepb.ImageList, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/global/images", 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() + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.ImageList{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Patch patches the specified image with the data included in the request. Only the following fields can be modified: family, description, deprecation status. +func (c *imagesRESTClient) Patch(ctx context.Context, req *computepb.PatchImageRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetImageResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/global/images/%v", req.GetProject(), req.GetImage()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("PATCH", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// SetIamPolicy sets the access control policy on the specified resource. Replaces any existing policy. +func (c *imagesRESTClient) SetIamPolicy(ctx context.Context, req *computepb.SetIamPolicyImageRequest, opts ...gax.CallOption) (*computepb.Policy, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetGlobalSetPolicyRequestResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/global/images/%v/setIamPolicy", req.GetProject(), req.GetResource()) + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Policy{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// SetLabels sets the labels on an image. To learn more about labels, read the Labeling Resources documentation. +func (c *imagesRESTClient) SetLabels(ctx context.Context, req *computepb.SetLabelsImageRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetGlobalSetLabelsRequestResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/global/images/%v/setLabels", req.GetProject(), req.GetResource()) + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// TestIamPermissions returns permissions that a caller has on the specified resource. +func (c *imagesRESTClient) TestIamPermissions(ctx context.Context, req *computepb.TestIamPermissionsImageRequest, opts ...gax.CallOption) (*computepb.TestPermissionsResponse, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetTestPermissionsRequestResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/global/images/%v/testIamPermissions", req.GetProject(), req.GetResource()) + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.TestPermissionsResponse{} + + return rsp, unm.Unmarshal(buf, rsp) +} diff --git a/compute/apiv1/images_client_example_test.go b/compute/apiv1/images_client_example_test.go new file mode 100644 index 00000000000..30c38152544 --- /dev/null +++ b/compute/apiv1/images_client_example_test.go @@ -0,0 +1,245 @@ +// Copyright 2021 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_test + +import ( + "context" + + compute "cloud.google.com/go/compute/apiv1" + computepb "google.golang.org/genproto/googleapis/cloud/compute/v1" +) + +func ExampleNewImagesRESTClient() { + ctx := context.Background() + c, err := compute.NewImagesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + // TODO: Use client. + _ = c +} + +func ExampleImagesClient_Delete() { + ctx := context.Background() + c, err := compute.NewImagesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.DeleteImageRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Delete(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleImagesClient_Deprecate() { + ctx := context.Background() + c, err := compute.NewImagesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.DeprecateImageRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Deprecate(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleImagesClient_Get() { + ctx := context.Background() + c, err := compute.NewImagesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.GetImageRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Get(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleImagesClient_GetFromFamily() { + ctx := context.Background() + c, err := compute.NewImagesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.GetFromFamilyImageRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.GetFromFamily(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleImagesClient_GetIamPolicy() { + ctx := context.Background() + c, err := compute.NewImagesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.GetIamPolicyImageRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.GetIamPolicy(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleImagesClient_Insert() { + ctx := context.Background() + c, err := compute.NewImagesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.InsertImageRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Insert(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleImagesClient_List() { + ctx := context.Background() + c, err := compute.NewImagesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.ListImagesRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.List(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleImagesClient_Patch() { + ctx := context.Background() + c, err := compute.NewImagesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.PatchImageRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Patch(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleImagesClient_SetIamPolicy() { + ctx := context.Background() + c, err := compute.NewImagesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.SetIamPolicyImageRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.SetIamPolicy(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleImagesClient_SetLabels() { + ctx := context.Background() + c, err := compute.NewImagesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.SetLabelsImageRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.SetLabels(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleImagesClient_TestIamPermissions() { + ctx := context.Background() + c, err := compute.NewImagesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.TestIamPermissionsImageRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.TestIamPermissions(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} diff --git a/compute/apiv1/instance_group_managers_client.go b/compute/apiv1/instance_group_managers_client.go new file mode 100644 index 00000000000..63039526088 --- /dev/null +++ b/compute/apiv1/instance_group_managers_client.go @@ -0,0 +1,1387 @@ +// Copyright 2021 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/ioutil" + "net/http" + "net/url" + + gax "github.com/googleapis/gax-go/v2" + "google.golang.org/api/option" + "google.golang.org/api/option/internaloption" + httptransport "google.golang.org/api/transport/http" + computepb "google.golang.org/genproto/googleapis/cloud/compute/v1" + "google.golang.org/grpc" + "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/encoding/protojson" +) + +var newInstanceGroupManagersClientHook clientHook + +// InstanceGroupManagersCallOptions contains the retry settings for each method of InstanceGroupManagersClient. +type InstanceGroupManagersCallOptions struct { + AbandonInstances []gax.CallOption + AggregatedList []gax.CallOption + ApplyUpdatesToInstances []gax.CallOption + CreateInstances []gax.CallOption + Delete []gax.CallOption + DeleteInstances []gax.CallOption + DeletePerInstanceConfigs []gax.CallOption + Get []gax.CallOption + Insert []gax.CallOption + List []gax.CallOption + ListErrors []gax.CallOption + ListManagedInstances []gax.CallOption + ListPerInstanceConfigs []gax.CallOption + Patch []gax.CallOption + PatchPerInstanceConfigs []gax.CallOption + RecreateInstances []gax.CallOption + Resize []gax.CallOption + SetInstanceTemplate []gax.CallOption + SetTargetPools []gax.CallOption + UpdatePerInstanceConfigs []gax.CallOption +} + +// internalInstanceGroupManagersClient is an interface that defines the methods availaible from Google Compute Engine API. +type internalInstanceGroupManagersClient interface { + Close() error + setGoogleClientInfo(...string) + Connection() *grpc.ClientConn + AbandonInstances(context.Context, *computepb.AbandonInstancesInstanceGroupManagerRequest, ...gax.CallOption) (*computepb.Operation, error) + AggregatedList(context.Context, *computepb.AggregatedListInstanceGroupManagersRequest, ...gax.CallOption) (*computepb.InstanceGroupManagerAggregatedList, error) + ApplyUpdatesToInstances(context.Context, *computepb.ApplyUpdatesToInstancesInstanceGroupManagerRequest, ...gax.CallOption) (*computepb.Operation, error) + CreateInstances(context.Context, *computepb.CreateInstancesInstanceGroupManagerRequest, ...gax.CallOption) (*computepb.Operation, error) + Delete(context.Context, *computepb.DeleteInstanceGroupManagerRequest, ...gax.CallOption) (*computepb.Operation, error) + DeleteInstances(context.Context, *computepb.DeleteInstancesInstanceGroupManagerRequest, ...gax.CallOption) (*computepb.Operation, error) + DeletePerInstanceConfigs(context.Context, *computepb.DeletePerInstanceConfigsInstanceGroupManagerRequest, ...gax.CallOption) (*computepb.Operation, error) + Get(context.Context, *computepb.GetInstanceGroupManagerRequest, ...gax.CallOption) (*computepb.InstanceGroupManager, error) + Insert(context.Context, *computepb.InsertInstanceGroupManagerRequest, ...gax.CallOption) (*computepb.Operation, error) + List(context.Context, *computepb.ListInstanceGroupManagersRequest, ...gax.CallOption) (*computepb.InstanceGroupManagerList, error) + ListErrors(context.Context, *computepb.ListErrorsInstanceGroupManagersRequest, ...gax.CallOption) (*computepb.InstanceGroupManagersListErrorsResponse, error) + ListManagedInstances(context.Context, *computepb.ListManagedInstancesInstanceGroupManagersRequest, ...gax.CallOption) (*computepb.InstanceGroupManagersListManagedInstancesResponse, error) + ListPerInstanceConfigs(context.Context, *computepb.ListPerInstanceConfigsInstanceGroupManagersRequest, ...gax.CallOption) (*computepb.InstanceGroupManagersListPerInstanceConfigsResp, error) + Patch(context.Context, *computepb.PatchInstanceGroupManagerRequest, ...gax.CallOption) (*computepb.Operation, error) + PatchPerInstanceConfigs(context.Context, *computepb.PatchPerInstanceConfigsInstanceGroupManagerRequest, ...gax.CallOption) (*computepb.Operation, error) + RecreateInstances(context.Context, *computepb.RecreateInstancesInstanceGroupManagerRequest, ...gax.CallOption) (*computepb.Operation, error) + Resize(context.Context, *computepb.ResizeInstanceGroupManagerRequest, ...gax.CallOption) (*computepb.Operation, error) + SetInstanceTemplate(context.Context, *computepb.SetInstanceTemplateInstanceGroupManagerRequest, ...gax.CallOption) (*computepb.Operation, error) + SetTargetPools(context.Context, *computepb.SetTargetPoolsInstanceGroupManagerRequest, ...gax.CallOption) (*computepb.Operation, error) + UpdatePerInstanceConfigs(context.Context, *computepb.UpdatePerInstanceConfigsInstanceGroupManagerRequest, ...gax.CallOption) (*computepb.Operation, error) +} + +// InstanceGroupManagersClient 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 InstanceGroupManagers API. +type InstanceGroupManagersClient struct { + // The internal transport-dependent client. + internalClient internalInstanceGroupManagersClient + + // The call options for this service. + CallOptions *InstanceGroupManagersCallOptions +} + +// 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 *InstanceGroupManagersClient) 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 *InstanceGroupManagersClient) setGoogleClientInfo(keyval ...string) { + c.internalClient.setGoogleClientInfo(keyval...) +} + +// Connection returns a connection to the API service. +// +// Deprecated. +func (c *InstanceGroupManagersClient) Connection() *grpc.ClientConn { + return c.internalClient.Connection() +} + +// AbandonInstances flags the specified instances to be removed from the managed instance group. Abandoning an instance does not delete the instance, but it does remove the instance from any target pools that are applied by the managed instance group. This method reduces the targetSize of the managed instance group by the number of instances that you abandon. This operation is marked as DONE when the action is scheduled even if the instances have not yet been removed from the group. You must separately verify the status of the abandoning action with the listmanagedinstances method. +// +// If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted. +// +// You can specify a maximum of 1000 instances with this method per request. +func (c *InstanceGroupManagersClient) AbandonInstances(ctx context.Context, req *computepb.AbandonInstancesInstanceGroupManagerRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.AbandonInstances(ctx, req, opts...) +} + +// AggregatedList retrieves the list of managed instance groups and groups them by zone. +func (c *InstanceGroupManagersClient) AggregatedList(ctx context.Context, req *computepb.AggregatedListInstanceGroupManagersRequest, opts ...gax.CallOption) (*computepb.InstanceGroupManagerAggregatedList, error) { + return c.internalClient.AggregatedList(ctx, req, opts...) +} + +// ApplyUpdatesToInstances applies changes to selected instances on the managed instance group. This method can be used to apply new overrides and/or new versions. +func (c *InstanceGroupManagersClient) ApplyUpdatesToInstances(ctx context.Context, req *computepb.ApplyUpdatesToInstancesInstanceGroupManagerRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.ApplyUpdatesToInstances(ctx, req, opts...) +} + +// CreateInstances creates instances with per-instance configs in this managed instance group. Instances are created using the current instance template. The create instances operation is marked DONE if the createInstances request is successful. The underlying actions take additional time. You must separately verify the status of the creating or actions with the listmanagedinstances method. +func (c *InstanceGroupManagersClient) CreateInstances(ctx context.Context, req *computepb.CreateInstancesInstanceGroupManagerRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.CreateInstances(ctx, req, opts...) +} + +// Delete deletes the specified managed instance group and all of the instances in that group. Note that the instance group must not belong to a backend service. Read Deleting an instance group for more information. +func (c *InstanceGroupManagersClient) Delete(ctx context.Context, req *computepb.DeleteInstanceGroupManagerRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.Delete(ctx, req, opts...) +} + +// DeleteInstances flags the specified instances in the managed instance group for immediate deletion. The instances are also removed from any target pools of which they were a member. This method reduces the targetSize of the managed instance group by the number of instances that you delete. This operation is marked as DONE when the action is scheduled even if the instances are still being deleted. You must separately verify the status of the deleting action with the listmanagedinstances method. +// +// If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted. +// +// You can specify a maximum of 1000 instances with this method per request. +func (c *InstanceGroupManagersClient) DeleteInstances(ctx context.Context, req *computepb.DeleteInstancesInstanceGroupManagerRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.DeleteInstances(ctx, req, opts...) +} + +// DeletePerInstanceConfigs deletes selected per-instance configs for the managed instance group. +func (c *InstanceGroupManagersClient) DeletePerInstanceConfigs(ctx context.Context, req *computepb.DeletePerInstanceConfigsInstanceGroupManagerRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.DeletePerInstanceConfigs(ctx, req, opts...) +} + +// Get returns all of the details about the specified managed instance group. Gets a list of available managed instance groups by making a list() request. +func (c *InstanceGroupManagersClient) Get(ctx context.Context, req *computepb.GetInstanceGroupManagerRequest, opts ...gax.CallOption) (*computepb.InstanceGroupManager, error) { + return c.internalClient.Get(ctx, req, opts...) +} + +// Insert creates a managed instance group using the information that you specify in the request. After the group is created, instances in the group are created using the specified instance template. This operation is marked as DONE when the group is created even if the instances in the group have not yet been created. You must separately verify the status of the individual instances with the listmanagedinstances method. +// +// A managed instance group can have up to 1000 VM instances per group. Please contact Cloud Support if you need an increase in this limit. +func (c *InstanceGroupManagersClient) Insert(ctx context.Context, req *computepb.InsertInstanceGroupManagerRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.Insert(ctx, req, opts...) +} + +// List retrieves a list of managed instance groups that are contained within the specified project and zone. +func (c *InstanceGroupManagersClient) List(ctx context.Context, req *computepb.ListInstanceGroupManagersRequest, opts ...gax.CallOption) (*computepb.InstanceGroupManagerList, error) { + return c.internalClient.List(ctx, req, opts...) +} + +// ListErrors lists all errors thrown by actions on instances for a given managed instance group. The filter and orderBy query parameters are not supported. +func (c *InstanceGroupManagersClient) ListErrors(ctx context.Context, req *computepb.ListErrorsInstanceGroupManagersRequest, opts ...gax.CallOption) (*computepb.InstanceGroupManagersListErrorsResponse, error) { + return c.internalClient.ListErrors(ctx, req, opts...) +} + +// ListManagedInstances lists all of the instances in the managed instance group. Each instance in the list has a currentAction, which indicates the action that the managed instance group is performing on the instance. For example, if the group is still creating an instance, the currentAction is CREATING. If a previous action failed, the list displays the errors for that failed action. The orderBy query parameter is not supported. +func (c *InstanceGroupManagersClient) ListManagedInstances(ctx context.Context, req *computepb.ListManagedInstancesInstanceGroupManagersRequest, opts ...gax.CallOption) (*computepb.InstanceGroupManagersListManagedInstancesResponse, error) { + return c.internalClient.ListManagedInstances(ctx, req, opts...) +} + +// ListPerInstanceConfigs lists all of the per-instance configs defined for the managed instance group. The orderBy query parameter is not supported. +func (c *InstanceGroupManagersClient) ListPerInstanceConfigs(ctx context.Context, req *computepb.ListPerInstanceConfigsInstanceGroupManagersRequest, opts ...gax.CallOption) (*computepb.InstanceGroupManagersListPerInstanceConfigsResp, error) { + return c.internalClient.ListPerInstanceConfigs(ctx, req, opts...) +} + +// Patch updates a managed instance group using the information that you specify in the request. This operation is marked as DONE when the group is patched even if the instances in the group are still in the process of being patched. You must separately verify the status of the individual instances with the listManagedInstances method. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. +func (c *InstanceGroupManagersClient) Patch(ctx context.Context, req *computepb.PatchInstanceGroupManagerRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.Patch(ctx, req, opts...) +} + +// PatchPerInstanceConfigs inserts or patches per-instance configs for the managed instance group. perInstanceConfig.name (at http://perInstanceConfig.name) serves as a key used to distinguish whether to perform insert or patch. +func (c *InstanceGroupManagersClient) PatchPerInstanceConfigs(ctx context.Context, req *computepb.PatchPerInstanceConfigsInstanceGroupManagerRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.PatchPerInstanceConfigs(ctx, req, opts...) +} + +// RecreateInstances flags the specified VM instances in the managed instance group to be immediately recreated. Each instance is recreated using the group’s current configuration. This operation is marked as DONE when the flag is set even if the instances have not yet been recreated. You must separately verify the status of each instance by checking its currentAction field; for more information, see Checking the status of managed instances. +// +// If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted. +// +// You can specify a maximum of 1000 instances with this method per request. +func (c *InstanceGroupManagersClient) RecreateInstances(ctx context.Context, req *computepb.RecreateInstancesInstanceGroupManagerRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.RecreateInstances(ctx, req, opts...) +} + +// Resize resizes the managed instance group. If you increase the size, the group creates new instances using the current instance template. If you decrease the size, the group deletes instances. The resize operation is marked DONE when the resize actions are scheduled even if the group has not yet added or deleted any instances. You must separately verify the status of the creating or deleting actions with the listmanagedinstances method. +// +// When resizing down, the instance group arbitrarily chooses the order in which VMs are deleted. The group takes into account some VM attributes when making the selection including: +// +// The status of the VM instance. + The health of the VM instance. + The instance template version the VM is based on. + For regional managed instance groups, the location of the VM instance. +// +// This list is subject to change. +// +// If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted. +func (c *InstanceGroupManagersClient) Resize(ctx context.Context, req *computepb.ResizeInstanceGroupManagerRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.Resize(ctx, req, opts...) +} + +// SetInstanceTemplate specifies the instance template to use when creating new instances in this group. The templates for existing instances in the group do not change unless you run recreateInstances, run applyUpdatesToInstances, or set the group’s updatePolicy.type to PROACTIVE. +func (c *InstanceGroupManagersClient) SetInstanceTemplate(ctx context.Context, req *computepb.SetInstanceTemplateInstanceGroupManagerRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.SetInstanceTemplate(ctx, req, opts...) +} + +// SetTargetPools modifies the target pools to which all instances in this managed instance group are assigned. The target pools automatically apply to all of the instances in the managed instance group. This operation is marked DONE when you make the request even if the instances have not yet been added to their target pools. The change might take some time to apply to all of the instances in the group depending on the size of the group. +func (c *InstanceGroupManagersClient) SetTargetPools(ctx context.Context, req *computepb.SetTargetPoolsInstanceGroupManagerRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.SetTargetPools(ctx, req, opts...) +} + +// UpdatePerInstanceConfigs inserts or updates per-instance configs for the managed instance group. perInstanceConfig.name (at http://perInstanceConfig.name) serves as a key used to distinguish whether to perform insert or patch. +func (c *InstanceGroupManagersClient) UpdatePerInstanceConfigs(ctx context.Context, req *computepb.UpdatePerInstanceConfigsInstanceGroupManagerRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.UpdatePerInstanceConfigs(ctx, req, opts...) +} + +// Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls. +type instanceGroupManagersRESTClient struct { + // The http endpoint to connect to. + endpoint string + + // The http client. + httpClient *http.Client + + // The x-goog-* metadata to be sent with each request. + xGoogMetadata metadata.MD +} + +// NewInstanceGroupManagersRESTClient creates a new instance group managers rest client. +// +// The InstanceGroupManagers API. +func NewInstanceGroupManagersRESTClient(ctx context.Context, opts ...option.ClientOption) (*InstanceGroupManagersClient, error) { + clientOpts := append(defaultInstanceGroupManagersRESTClientOptions(), opts...) + httpClient, endpoint, err := httptransport.NewClient(ctx, clientOpts...) + if err != nil { + return nil, err + } + + c := &instanceGroupManagersRESTClient{ + endpoint: endpoint, + httpClient: httpClient, + } + c.setGoogleClientInfo() + + return &InstanceGroupManagersClient{internalClient: c, CallOptions: &InstanceGroupManagersCallOptions{}}, nil +} + +func defaultInstanceGroupManagersRESTClientOptions() []option.ClientOption { + return []option.ClientOption{ + internaloption.WithDefaultEndpoint("compute.googleapis.com"), + internaloption.WithDefaultMTLSEndpoint("compute.mtls.googleapis.com"), + internaloption.WithDefaultAudience("https://compute.googleapis.com/"), + internaloption.WithDefaultScopes(DefaultAuthScopes()...), + } +} + +// setGoogleClientInfo sets the name and version of the application in +// the `x-goog-api-client` header passed on each request. Intended for +// use by Google-written clients. +func (c *instanceGroupManagersRESTClient) setGoogleClientInfo(keyval ...string) { + kv := append([]string{"gl-go", versionGo()}, keyval...) + kv = append(kv, "gapic", versionClient, "gax", gax.Version, "rest", "UNKNOWN") + c.xGoogMetadata = metadata.Pairs("x-goog-api-client", gax.XGoogHeader(kv...)) +} + +// Close closes the connection to the API service. The user should invoke this when +// the client is no longer required. +func (c *instanceGroupManagersRESTClient) Close() error { + // Replace httpClient with nil to force cleanup. + c.httpClient = nil + return nil +} + +// Connection returns a connection to the API service. +// +// Deprecated. +func (c *instanceGroupManagersRESTClient) Connection() *grpc.ClientConn { + return nil +} + +// AbandonInstances flags the specified instances to be removed from the managed instance group. Abandoning an instance does not delete the instance, but it does remove the instance from any target pools that are applied by the managed instance group. This method reduces the targetSize of the managed instance group by the number of instances that you abandon. This operation is marked as DONE when the action is scheduled even if the instances have not yet been removed from the group. You must separately verify the status of the abandoning action with the listmanagedinstances method. +// +// If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted. +// +// You can specify a maximum of 1000 instances with this method per request. +func (c *instanceGroupManagersRESTClient) AbandonInstances(ctx context.Context, req *computepb.AbandonInstancesInstanceGroupManagerRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetInstanceGroupManagersAbandonInstancesRequestResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/zones/%v/instanceGroupManagers/%v/abandonInstances", req.GetProject(), req.GetZone(), req.GetInstanceGroupManager()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// AggregatedList retrieves the list of managed instance groups and groups them by zone. +func (c *instanceGroupManagersRESTClient) AggregatedList(ctx context.Context, req *computepb.AggregatedListInstanceGroupManagersRequest, opts ...gax.CallOption) (*computepb.InstanceGroupManagerAggregatedList, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/aggregated/instanceGroupManagers", req.GetProject()) + + params := url.Values{} + if req != nil && req.Filter != nil { + params.Add("filter", fmt.Sprintf("%v", req.GetFilter())) + } + if req != nil && req.IncludeAllScopes != nil { + params.Add("includeAllScopes", fmt.Sprintf("%v", req.GetIncludeAllScopes())) + } + 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() + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.InstanceGroupManagerAggregatedList{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// ApplyUpdatesToInstances applies changes to selected instances on the managed instance group. This method can be used to apply new overrides and/or new versions. +func (c *instanceGroupManagersRESTClient) ApplyUpdatesToInstances(ctx context.Context, req *computepb.ApplyUpdatesToInstancesInstanceGroupManagerRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetInstanceGroupManagersApplyUpdatesRequestResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/zones/%v/instanceGroupManagers/%v/applyUpdatesToInstances", req.GetProject(), req.GetZone(), req.GetInstanceGroupManager()) + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// CreateInstances creates instances with per-instance configs in this managed instance group. Instances are created using the current instance template. The create instances operation is marked DONE if the createInstances request is successful. The underlying actions take additional time. You must separately verify the status of the creating or actions with the listmanagedinstances method. +func (c *instanceGroupManagersRESTClient) CreateInstances(ctx context.Context, req *computepb.CreateInstancesInstanceGroupManagerRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetInstanceGroupManagersCreateInstancesRequestResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/zones/%v/instanceGroupManagers/%v/createInstances", req.GetProject(), req.GetZone(), req.GetInstanceGroupManager()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Delete deletes the specified managed instance group and all of the instances in that group. Note that the instance group must not belong to a backend service. Read Deleting an instance group for more information. +func (c *instanceGroupManagersRESTClient) Delete(ctx context.Context, req *computepb.DeleteInstanceGroupManagerRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/zones/%v/instanceGroupManagers/%v", req.GetProject(), req.GetZone(), req.GetInstanceGroupManager()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("DELETE", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// DeleteInstances flags the specified instances in the managed instance group for immediate deletion. The instances are also removed from any target pools of which they were a member. This method reduces the targetSize of the managed instance group by the number of instances that you delete. This operation is marked as DONE when the action is scheduled even if the instances are still being deleted. You must separately verify the status of the deleting action with the listmanagedinstances method. +// +// If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted. +// +// You can specify a maximum of 1000 instances with this method per request. +func (c *instanceGroupManagersRESTClient) DeleteInstances(ctx context.Context, req *computepb.DeleteInstancesInstanceGroupManagerRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetInstanceGroupManagersDeleteInstancesRequestResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/zones/%v/instanceGroupManagers/%v/deleteInstances", req.GetProject(), req.GetZone(), req.GetInstanceGroupManager()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// DeletePerInstanceConfigs deletes selected per-instance configs for the managed instance group. +func (c *instanceGroupManagersRESTClient) DeletePerInstanceConfigs(ctx context.Context, req *computepb.DeletePerInstanceConfigsInstanceGroupManagerRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetInstanceGroupManagersDeletePerInstanceConfigsReqResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/zones/%v/instanceGroupManagers/%v/deletePerInstanceConfigs", req.GetProject(), req.GetZone(), req.GetInstanceGroupManager()) + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Get returns all of the details about the specified managed instance group. Gets a list of available managed instance groups by making a list() request. +func (c *instanceGroupManagersRESTClient) Get(ctx context.Context, req *computepb.GetInstanceGroupManagerRequest, opts ...gax.CallOption) (*computepb.InstanceGroupManager, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/zones/%v/instanceGroupManagers/%v", req.GetProject(), req.GetZone(), req.GetInstanceGroupManager()) + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.InstanceGroupManager{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Insert creates a managed instance group using the information that you specify in the request. After the group is created, instances in the group are created using the specified instance template. This operation is marked as DONE when the group is created even if the instances in the group have not yet been created. You must separately verify the status of the individual instances with the listmanagedinstances method. +// +// A managed instance group can have up to 1000 VM instances per group. Please contact Cloud Support if you need an increase in this limit. +func (c *instanceGroupManagersRESTClient) Insert(ctx context.Context, req *computepb.InsertInstanceGroupManagerRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetInstanceGroupManagerResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/zones/%v/instanceGroupManagers", req.GetProject(), req.GetZone()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// List retrieves a list of managed instance groups that are contained within the specified project and zone. +func (c *instanceGroupManagersRESTClient) List(ctx context.Context, req *computepb.ListInstanceGroupManagersRequest, opts ...gax.CallOption) (*computepb.InstanceGroupManagerList, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/zones/%v/instanceGroupManagers", req.GetProject(), req.GetZone()) + + 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() + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.InstanceGroupManagerList{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// ListErrors lists all errors thrown by actions on instances for a given managed instance group. The filter and orderBy query parameters are not supported. +func (c *instanceGroupManagersRESTClient) ListErrors(ctx context.Context, req *computepb.ListErrorsInstanceGroupManagersRequest, opts ...gax.CallOption) (*computepb.InstanceGroupManagersListErrorsResponse, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/zones/%v/instanceGroupManagers/%v/listErrors", req.GetProject(), req.GetZone(), req.GetInstanceGroupManager()) + + 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() + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.InstanceGroupManagersListErrorsResponse{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// ListManagedInstances lists all of the instances in the managed instance group. Each instance in the list has a currentAction, which indicates the action that the managed instance group is performing on the instance. For example, if the group is still creating an instance, the currentAction is CREATING. If a previous action failed, the list displays the errors for that failed action. The orderBy query parameter is not supported. +func (c *instanceGroupManagersRESTClient) ListManagedInstances(ctx context.Context, req *computepb.ListManagedInstancesInstanceGroupManagersRequest, opts ...gax.CallOption) (*computepb.InstanceGroupManagersListManagedInstancesResponse, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/zones/%v/instanceGroupManagers/%v/listManagedInstances", req.GetProject(), req.GetZone(), req.GetInstanceGroupManager()) + + 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() + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.InstanceGroupManagersListManagedInstancesResponse{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// ListPerInstanceConfigs lists all of the per-instance configs defined for the managed instance group. The orderBy query parameter is not supported. +func (c *instanceGroupManagersRESTClient) ListPerInstanceConfigs(ctx context.Context, req *computepb.ListPerInstanceConfigsInstanceGroupManagersRequest, opts ...gax.CallOption) (*computepb.InstanceGroupManagersListPerInstanceConfigsResp, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/zones/%v/instanceGroupManagers/%v/listPerInstanceConfigs", req.GetProject(), req.GetZone(), req.GetInstanceGroupManager()) + + 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() + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.InstanceGroupManagersListPerInstanceConfigsResp{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Patch updates a managed instance group using the information that you specify in the request. This operation is marked as DONE when the group is patched even if the instances in the group are still in the process of being patched. You must separately verify the status of the individual instances with the listManagedInstances method. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. +func (c *instanceGroupManagersRESTClient) Patch(ctx context.Context, req *computepb.PatchInstanceGroupManagerRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetInstanceGroupManagerResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/zones/%v/instanceGroupManagers/%v", req.GetProject(), req.GetZone(), req.GetInstanceGroupManager()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("PATCH", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// PatchPerInstanceConfigs inserts or patches per-instance configs for the managed instance group. perInstanceConfig.name (at http://perInstanceConfig.name) serves as a key used to distinguish whether to perform insert or patch. +func (c *instanceGroupManagersRESTClient) PatchPerInstanceConfigs(ctx context.Context, req *computepb.PatchPerInstanceConfigsInstanceGroupManagerRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetInstanceGroupManagersPatchPerInstanceConfigsReqResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/zones/%v/instanceGroupManagers/%v/patchPerInstanceConfigs", req.GetProject(), req.GetZone(), req.GetInstanceGroupManager()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// RecreateInstances flags the specified VM instances in the managed instance group to be immediately recreated. Each instance is recreated using the group’s current configuration. This operation is marked as DONE when the flag is set even if the instances have not yet been recreated. You must separately verify the status of each instance by checking its currentAction field; for more information, see Checking the status of managed instances. +// +// If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted. +// +// You can specify a maximum of 1000 instances with this method per request. +func (c *instanceGroupManagersRESTClient) RecreateInstances(ctx context.Context, req *computepb.RecreateInstancesInstanceGroupManagerRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetInstanceGroupManagersRecreateInstancesRequestResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/zones/%v/instanceGroupManagers/%v/recreateInstances", req.GetProject(), req.GetZone(), req.GetInstanceGroupManager()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Resize resizes the managed instance group. If you increase the size, the group creates new instances using the current instance template. If you decrease the size, the group deletes instances. The resize operation is marked DONE when the resize actions are scheduled even if the group has not yet added or deleted any instances. You must separately verify the status of the creating or deleting actions with the listmanagedinstances method. +// +// When resizing down, the instance group arbitrarily chooses the order in which VMs are deleted. The group takes into account some VM attributes when making the selection including: +// +// The status of the VM instance. + The health of the VM instance. + The instance template version the VM is based on. + For regional managed instance groups, the location of the VM instance. +// +// This list is subject to change. +// +// If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted. +func (c *instanceGroupManagersRESTClient) Resize(ctx context.Context, req *computepb.ResizeInstanceGroupManagerRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/zones/%v/instanceGroupManagers/%v/resize", req.GetProject(), req.GetZone(), req.GetInstanceGroupManager()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + if req.GetSize() != 0 { + params.Add("size", fmt.Sprintf("%v", req.GetSize())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// SetInstanceTemplate specifies the instance template to use when creating new instances in this group. The templates for existing instances in the group do not change unless you run recreateInstances, run applyUpdatesToInstances, or set the group’s updatePolicy.type to PROACTIVE. +func (c *instanceGroupManagersRESTClient) SetInstanceTemplate(ctx context.Context, req *computepb.SetInstanceTemplateInstanceGroupManagerRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetInstanceGroupManagersSetInstanceTemplateRequestResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/zones/%v/instanceGroupManagers/%v/setInstanceTemplate", req.GetProject(), req.GetZone(), req.GetInstanceGroupManager()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// SetTargetPools modifies the target pools to which all instances in this managed instance group are assigned. The target pools automatically apply to all of the instances in the managed instance group. This operation is marked DONE when you make the request even if the instances have not yet been added to their target pools. The change might take some time to apply to all of the instances in the group depending on the size of the group. +func (c *instanceGroupManagersRESTClient) SetTargetPools(ctx context.Context, req *computepb.SetTargetPoolsInstanceGroupManagerRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetInstanceGroupManagersSetTargetPoolsRequestResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/zones/%v/instanceGroupManagers/%v/setTargetPools", req.GetProject(), req.GetZone(), req.GetInstanceGroupManager()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// UpdatePerInstanceConfigs inserts or updates per-instance configs for the managed instance group. perInstanceConfig.name (at http://perInstanceConfig.name) serves as a key used to distinguish whether to perform insert or patch. +func (c *instanceGroupManagersRESTClient) UpdatePerInstanceConfigs(ctx context.Context, req *computepb.UpdatePerInstanceConfigsInstanceGroupManagerRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetInstanceGroupManagersUpdatePerInstanceConfigsReqResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/zones/%v/instanceGroupManagers/%v/updatePerInstanceConfigs", req.GetProject(), req.GetZone(), req.GetInstanceGroupManager()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} diff --git a/compute/apiv1/instance_group_managers_client_example_test.go b/compute/apiv1/instance_group_managers_client_example_test.go new file mode 100644 index 00000000000..d5602e70117 --- /dev/null +++ b/compute/apiv1/instance_group_managers_client_example_test.go @@ -0,0 +1,416 @@ +// Copyright 2021 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_test + +import ( + "context" + + compute "cloud.google.com/go/compute/apiv1" + computepb "google.golang.org/genproto/googleapis/cloud/compute/v1" +) + +func ExampleNewInstanceGroupManagersRESTClient() { + ctx := context.Background() + c, err := compute.NewInstanceGroupManagersRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + // TODO: Use client. + _ = c +} + +func ExampleInstanceGroupManagersClient_AbandonInstances() { + ctx := context.Background() + c, err := compute.NewInstanceGroupManagersRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.AbandonInstancesInstanceGroupManagerRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.AbandonInstances(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleInstanceGroupManagersClient_AggregatedList() { + ctx := context.Background() + c, err := compute.NewInstanceGroupManagersRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.AggregatedListInstanceGroupManagersRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.AggregatedList(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleInstanceGroupManagersClient_ApplyUpdatesToInstances() { + ctx := context.Background() + c, err := compute.NewInstanceGroupManagersRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.ApplyUpdatesToInstancesInstanceGroupManagerRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.ApplyUpdatesToInstances(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleInstanceGroupManagersClient_CreateInstances() { + ctx := context.Background() + c, err := compute.NewInstanceGroupManagersRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.CreateInstancesInstanceGroupManagerRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.CreateInstances(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleInstanceGroupManagersClient_Delete() { + ctx := context.Background() + c, err := compute.NewInstanceGroupManagersRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.DeleteInstanceGroupManagerRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Delete(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleInstanceGroupManagersClient_DeleteInstances() { + ctx := context.Background() + c, err := compute.NewInstanceGroupManagersRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.DeleteInstancesInstanceGroupManagerRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.DeleteInstances(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleInstanceGroupManagersClient_DeletePerInstanceConfigs() { + ctx := context.Background() + c, err := compute.NewInstanceGroupManagersRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.DeletePerInstanceConfigsInstanceGroupManagerRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.DeletePerInstanceConfigs(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleInstanceGroupManagersClient_Get() { + ctx := context.Background() + c, err := compute.NewInstanceGroupManagersRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.GetInstanceGroupManagerRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Get(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleInstanceGroupManagersClient_Insert() { + ctx := context.Background() + c, err := compute.NewInstanceGroupManagersRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.InsertInstanceGroupManagerRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Insert(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleInstanceGroupManagersClient_List() { + ctx := context.Background() + c, err := compute.NewInstanceGroupManagersRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.ListInstanceGroupManagersRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.List(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleInstanceGroupManagersClient_ListErrors() { + ctx := context.Background() + c, err := compute.NewInstanceGroupManagersRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.ListErrorsInstanceGroupManagersRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.ListErrors(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleInstanceGroupManagersClient_ListManagedInstances() { + ctx := context.Background() + c, err := compute.NewInstanceGroupManagersRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.ListManagedInstancesInstanceGroupManagersRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.ListManagedInstances(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleInstanceGroupManagersClient_ListPerInstanceConfigs() { + ctx := context.Background() + c, err := compute.NewInstanceGroupManagersRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.ListPerInstanceConfigsInstanceGroupManagersRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.ListPerInstanceConfigs(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleInstanceGroupManagersClient_Patch() { + ctx := context.Background() + c, err := compute.NewInstanceGroupManagersRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.PatchInstanceGroupManagerRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Patch(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleInstanceGroupManagersClient_PatchPerInstanceConfigs() { + ctx := context.Background() + c, err := compute.NewInstanceGroupManagersRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.PatchPerInstanceConfigsInstanceGroupManagerRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.PatchPerInstanceConfigs(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleInstanceGroupManagersClient_RecreateInstances() { + ctx := context.Background() + c, err := compute.NewInstanceGroupManagersRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.RecreateInstancesInstanceGroupManagerRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.RecreateInstances(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleInstanceGroupManagersClient_Resize() { + ctx := context.Background() + c, err := compute.NewInstanceGroupManagersRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.ResizeInstanceGroupManagerRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Resize(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleInstanceGroupManagersClient_SetInstanceTemplate() { + ctx := context.Background() + c, err := compute.NewInstanceGroupManagersRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.SetInstanceTemplateInstanceGroupManagerRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.SetInstanceTemplate(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleInstanceGroupManagersClient_SetTargetPools() { + ctx := context.Background() + c, err := compute.NewInstanceGroupManagersRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.SetTargetPoolsInstanceGroupManagerRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.SetTargetPools(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleInstanceGroupManagersClient_UpdatePerInstanceConfigs() { + ctx := context.Background() + c, err := compute.NewInstanceGroupManagersRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.UpdatePerInstanceConfigsInstanceGroupManagerRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.UpdatePerInstanceConfigs(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} diff --git a/compute/apiv1/instance_groups_client.go b/compute/apiv1/instance_groups_client.go new file mode 100644 index 00000000000..0d57cd32151 --- /dev/null +++ b/compute/apiv1/instance_groups_client.go @@ -0,0 +1,708 @@ +// Copyright 2021 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/ioutil" + "net/http" + "net/url" + + gax "github.com/googleapis/gax-go/v2" + "google.golang.org/api/option" + "google.golang.org/api/option/internaloption" + httptransport "google.golang.org/api/transport/http" + computepb "google.golang.org/genproto/googleapis/cloud/compute/v1" + "google.golang.org/grpc" + "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/encoding/protojson" +) + +var newInstanceGroupsClientHook clientHook + +// InstanceGroupsCallOptions contains the retry settings for each method of InstanceGroupsClient. +type InstanceGroupsCallOptions struct { + AddInstances []gax.CallOption + AggregatedList []gax.CallOption + Delete []gax.CallOption + Get []gax.CallOption + Insert []gax.CallOption + List []gax.CallOption + ListInstances []gax.CallOption + RemoveInstances []gax.CallOption + SetNamedPorts []gax.CallOption +} + +// internalInstanceGroupsClient is an interface that defines the methods availaible from Google Compute Engine API. +type internalInstanceGroupsClient interface { + Close() error + setGoogleClientInfo(...string) + Connection() *grpc.ClientConn + AddInstances(context.Context, *computepb.AddInstancesInstanceGroupRequest, ...gax.CallOption) (*computepb.Operation, error) + AggregatedList(context.Context, *computepb.AggregatedListInstanceGroupsRequest, ...gax.CallOption) (*computepb.InstanceGroupAggregatedList, error) + Delete(context.Context, *computepb.DeleteInstanceGroupRequest, ...gax.CallOption) (*computepb.Operation, error) + Get(context.Context, *computepb.GetInstanceGroupRequest, ...gax.CallOption) (*computepb.InstanceGroup, error) + Insert(context.Context, *computepb.InsertInstanceGroupRequest, ...gax.CallOption) (*computepb.Operation, error) + List(context.Context, *computepb.ListInstanceGroupsRequest, ...gax.CallOption) (*computepb.InstanceGroupList, error) + ListInstances(context.Context, *computepb.ListInstancesInstanceGroupsRequest, ...gax.CallOption) (*computepb.InstanceGroupsListInstances, error) + RemoveInstances(context.Context, *computepb.RemoveInstancesInstanceGroupRequest, ...gax.CallOption) (*computepb.Operation, error) + SetNamedPorts(context.Context, *computepb.SetNamedPortsInstanceGroupRequest, ...gax.CallOption) (*computepb.Operation, error) +} + +// InstanceGroupsClient 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 InstanceGroups API. +type InstanceGroupsClient struct { + // The internal transport-dependent client. + internalClient internalInstanceGroupsClient + + // The call options for this service. + CallOptions *InstanceGroupsCallOptions +} + +// 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 *InstanceGroupsClient) 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 *InstanceGroupsClient) setGoogleClientInfo(keyval ...string) { + c.internalClient.setGoogleClientInfo(keyval...) +} + +// Connection returns a connection to the API service. +// +// Deprecated. +func (c *InstanceGroupsClient) Connection() *grpc.ClientConn { + return c.internalClient.Connection() +} + +// AddInstances adds a list of instances to the specified instance group. All of the instances in the instance group must be in the same network/subnetwork. Read Adding instances for more information. +func (c *InstanceGroupsClient) AddInstances(ctx context.Context, req *computepb.AddInstancesInstanceGroupRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.AddInstances(ctx, req, opts...) +} + +// AggregatedList retrieves the list of instance groups and sorts them by zone. +func (c *InstanceGroupsClient) AggregatedList(ctx context.Context, req *computepb.AggregatedListInstanceGroupsRequest, opts ...gax.CallOption) (*computepb.InstanceGroupAggregatedList, error) { + return c.internalClient.AggregatedList(ctx, req, opts...) +} + +// Delete deletes the specified instance group. The instances in the group are not deleted. Note that instance group must not belong to a backend service. Read Deleting an instance group for more information. +func (c *InstanceGroupsClient) Delete(ctx context.Context, req *computepb.DeleteInstanceGroupRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.Delete(ctx, req, opts...) +} + +// Get returns the specified zonal instance group. Get a list of available zonal instance groups by making a list() request. +// +// For managed instance groups, use the instanceGroupManagers or regionInstanceGroupManagers methods instead. +func (c *InstanceGroupsClient) Get(ctx context.Context, req *computepb.GetInstanceGroupRequest, opts ...gax.CallOption) (*computepb.InstanceGroup, error) { + return c.internalClient.Get(ctx, req, opts...) +} + +// Insert creates an instance group in the specified project using the parameters that are included in the request. +func (c *InstanceGroupsClient) Insert(ctx context.Context, req *computepb.InsertInstanceGroupRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.Insert(ctx, req, opts...) +} + +// List retrieves the list of zonal instance group resources contained within the specified zone. +// +// For managed instance groups, use the instanceGroupManagers or regionInstanceGroupManagers methods instead. +func (c *InstanceGroupsClient) List(ctx context.Context, req *computepb.ListInstanceGroupsRequest, opts ...gax.CallOption) (*computepb.InstanceGroupList, error) { + return c.internalClient.List(ctx, req, opts...) +} + +// ListInstances lists the instances in the specified instance group. The orderBy query parameter is not supported. +func (c *InstanceGroupsClient) ListInstances(ctx context.Context, req *computepb.ListInstancesInstanceGroupsRequest, opts ...gax.CallOption) (*computepb.InstanceGroupsListInstances, error) { + return c.internalClient.ListInstances(ctx, req, opts...) +} + +// RemoveInstances removes one or more instances from the specified instance group, but does not delete those instances. +// +// If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration before the VM instance is removed or deleted. +func (c *InstanceGroupsClient) RemoveInstances(ctx context.Context, req *computepb.RemoveInstancesInstanceGroupRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.RemoveInstances(ctx, req, opts...) +} + +// SetNamedPorts sets the named ports for the specified instance group. +func (c *InstanceGroupsClient) SetNamedPorts(ctx context.Context, req *computepb.SetNamedPortsInstanceGroupRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.SetNamedPorts(ctx, req, opts...) +} + +// Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls. +type instanceGroupsRESTClient struct { + // The http endpoint to connect to. + endpoint string + + // The http client. + httpClient *http.Client + + // The x-goog-* metadata to be sent with each request. + xGoogMetadata metadata.MD +} + +// NewInstanceGroupsRESTClient creates a new instance groups rest client. +// +// The InstanceGroups API. +func NewInstanceGroupsRESTClient(ctx context.Context, opts ...option.ClientOption) (*InstanceGroupsClient, error) { + clientOpts := append(defaultInstanceGroupsRESTClientOptions(), opts...) + httpClient, endpoint, err := httptransport.NewClient(ctx, clientOpts...) + if err != nil { + return nil, err + } + + c := &instanceGroupsRESTClient{ + endpoint: endpoint, + httpClient: httpClient, + } + c.setGoogleClientInfo() + + return &InstanceGroupsClient{internalClient: c, CallOptions: &InstanceGroupsCallOptions{}}, nil +} + +func defaultInstanceGroupsRESTClientOptions() []option.ClientOption { + return []option.ClientOption{ + internaloption.WithDefaultEndpoint("compute.googleapis.com"), + internaloption.WithDefaultMTLSEndpoint("compute.mtls.googleapis.com"), + internaloption.WithDefaultAudience("https://compute.googleapis.com/"), + internaloption.WithDefaultScopes(DefaultAuthScopes()...), + } +} + +// setGoogleClientInfo sets the name and version of the application in +// the `x-goog-api-client` header passed on each request. Intended for +// use by Google-written clients. +func (c *instanceGroupsRESTClient) setGoogleClientInfo(keyval ...string) { + kv := append([]string{"gl-go", versionGo()}, keyval...) + kv = append(kv, "gapic", versionClient, "gax", gax.Version, "rest", "UNKNOWN") + c.xGoogMetadata = metadata.Pairs("x-goog-api-client", gax.XGoogHeader(kv...)) +} + +// Close closes the connection to the API service. The user should invoke this when +// the client is no longer required. +func (c *instanceGroupsRESTClient) Close() error { + // Replace httpClient with nil to force cleanup. + c.httpClient = nil + return nil +} + +// Connection returns a connection to the API service. +// +// Deprecated. +func (c *instanceGroupsRESTClient) Connection() *grpc.ClientConn { + return nil +} + +// AddInstances adds a list of instances to the specified instance group. All of the instances in the instance group must be in the same network/subnetwork. Read Adding instances for more information. +func (c *instanceGroupsRESTClient) AddInstances(ctx context.Context, req *computepb.AddInstancesInstanceGroupRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetInstanceGroupsAddInstancesRequestResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/zones/%v/instanceGroups/%v/addInstances", req.GetProject(), req.GetZone(), req.GetInstanceGroup()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// AggregatedList retrieves the list of instance groups and sorts them by zone. +func (c *instanceGroupsRESTClient) AggregatedList(ctx context.Context, req *computepb.AggregatedListInstanceGroupsRequest, opts ...gax.CallOption) (*computepb.InstanceGroupAggregatedList, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/aggregated/instanceGroups", req.GetProject()) + + params := url.Values{} + if req != nil && req.Filter != nil { + params.Add("filter", fmt.Sprintf("%v", req.GetFilter())) + } + if req != nil && req.IncludeAllScopes != nil { + params.Add("includeAllScopes", fmt.Sprintf("%v", req.GetIncludeAllScopes())) + } + 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() + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.InstanceGroupAggregatedList{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Delete deletes the specified instance group. The instances in the group are not deleted. Note that instance group must not belong to a backend service. Read Deleting an instance group for more information. +func (c *instanceGroupsRESTClient) Delete(ctx context.Context, req *computepb.DeleteInstanceGroupRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/zones/%v/instanceGroups/%v", req.GetProject(), req.GetZone(), req.GetInstanceGroup()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("DELETE", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Get returns the specified zonal instance group. Get a list of available zonal instance groups by making a list() request. +// +// For managed instance groups, use the instanceGroupManagers or regionInstanceGroupManagers methods instead. +func (c *instanceGroupsRESTClient) Get(ctx context.Context, req *computepb.GetInstanceGroupRequest, opts ...gax.CallOption) (*computepb.InstanceGroup, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/zones/%v/instanceGroups/%v", req.GetProject(), req.GetZone(), req.GetInstanceGroup()) + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.InstanceGroup{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Insert creates an instance group in the specified project using the parameters that are included in the request. +func (c *instanceGroupsRESTClient) Insert(ctx context.Context, req *computepb.InsertInstanceGroupRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetInstanceGroupResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/zones/%v/instanceGroups", req.GetProject(), req.GetZone()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// List retrieves the list of zonal instance group resources contained within the specified zone. +// +// For managed instance groups, use the instanceGroupManagers or regionInstanceGroupManagers methods instead. +func (c *instanceGroupsRESTClient) List(ctx context.Context, req *computepb.ListInstanceGroupsRequest, opts ...gax.CallOption) (*computepb.InstanceGroupList, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/zones/%v/instanceGroups", req.GetProject(), req.GetZone()) + + 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() + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.InstanceGroupList{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// ListInstances lists the instances in the specified instance group. The orderBy query parameter is not supported. +func (c *instanceGroupsRESTClient) ListInstances(ctx context.Context, req *computepb.ListInstancesInstanceGroupsRequest, opts ...gax.CallOption) (*computepb.InstanceGroupsListInstances, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetInstanceGroupsListInstancesRequestResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/zones/%v/instanceGroups/%v/listInstances", req.GetProject(), req.GetZone(), req.GetInstanceGroup()) + + 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() + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.InstanceGroupsListInstances{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// RemoveInstances removes one or more instances from the specified instance group, but does not delete those instances. +// +// If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration before the VM instance is removed or deleted. +func (c *instanceGroupsRESTClient) RemoveInstances(ctx context.Context, req *computepb.RemoveInstancesInstanceGroupRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetInstanceGroupsRemoveInstancesRequestResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/zones/%v/instanceGroups/%v/removeInstances", req.GetProject(), req.GetZone(), req.GetInstanceGroup()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// SetNamedPorts sets the named ports for the specified instance group. +func (c *instanceGroupsRESTClient) SetNamedPorts(ctx context.Context, req *computepb.SetNamedPortsInstanceGroupRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetInstanceGroupsSetNamedPortsRequestResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/zones/%v/instanceGroups/%v/setNamedPorts", req.GetProject(), req.GetZone(), req.GetInstanceGroup()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} diff --git a/compute/apiv1/instance_groups_client_example_test.go b/compute/apiv1/instance_groups_client_example_test.go new file mode 100644 index 00000000000..8e646affefb --- /dev/null +++ b/compute/apiv1/instance_groups_client_example_test.go @@ -0,0 +1,207 @@ +// Copyright 2021 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_test + +import ( + "context" + + compute "cloud.google.com/go/compute/apiv1" + computepb "google.golang.org/genproto/googleapis/cloud/compute/v1" +) + +func ExampleNewInstanceGroupsRESTClient() { + ctx := context.Background() + c, err := compute.NewInstanceGroupsRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + // TODO: Use client. + _ = c +} + +func ExampleInstanceGroupsClient_AddInstances() { + ctx := context.Background() + c, err := compute.NewInstanceGroupsRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.AddInstancesInstanceGroupRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.AddInstances(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleInstanceGroupsClient_AggregatedList() { + ctx := context.Background() + c, err := compute.NewInstanceGroupsRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.AggregatedListInstanceGroupsRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.AggregatedList(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleInstanceGroupsClient_Delete() { + ctx := context.Background() + c, err := compute.NewInstanceGroupsRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.DeleteInstanceGroupRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Delete(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleInstanceGroupsClient_Get() { + ctx := context.Background() + c, err := compute.NewInstanceGroupsRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.GetInstanceGroupRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Get(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleInstanceGroupsClient_Insert() { + ctx := context.Background() + c, err := compute.NewInstanceGroupsRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.InsertInstanceGroupRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Insert(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleInstanceGroupsClient_List() { + ctx := context.Background() + c, err := compute.NewInstanceGroupsRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.ListInstanceGroupsRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.List(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleInstanceGroupsClient_ListInstances() { + ctx := context.Background() + c, err := compute.NewInstanceGroupsRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.ListInstancesInstanceGroupsRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.ListInstances(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleInstanceGroupsClient_RemoveInstances() { + ctx := context.Background() + c, err := compute.NewInstanceGroupsRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.RemoveInstancesInstanceGroupRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.RemoveInstances(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleInstanceGroupsClient_SetNamedPorts() { + ctx := context.Background() + c, err := compute.NewInstanceGroupsRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.SetNamedPortsInstanceGroupRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.SetNamedPorts(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} diff --git a/compute/apiv1/instance_templates_client.go b/compute/apiv1/instance_templates_client.go new file mode 100644 index 00000000000..2003c355cf0 --- /dev/null +++ b/compute/apiv1/instance_templates_client.go @@ -0,0 +1,539 @@ +// Copyright 2021 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/ioutil" + "net/http" + "net/url" + + gax "github.com/googleapis/gax-go/v2" + "google.golang.org/api/option" + "google.golang.org/api/option/internaloption" + httptransport "google.golang.org/api/transport/http" + computepb "google.golang.org/genproto/googleapis/cloud/compute/v1" + "google.golang.org/grpc" + "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/encoding/protojson" +) + +var newInstanceTemplatesClientHook clientHook + +// InstanceTemplatesCallOptions contains the retry settings for each method of InstanceTemplatesClient. +type InstanceTemplatesCallOptions struct { + Delete []gax.CallOption + Get []gax.CallOption + GetIamPolicy []gax.CallOption + Insert []gax.CallOption + List []gax.CallOption + SetIamPolicy []gax.CallOption + TestIamPermissions []gax.CallOption +} + +// internalInstanceTemplatesClient is an interface that defines the methods availaible from Google Compute Engine API. +type internalInstanceTemplatesClient interface { + Close() error + setGoogleClientInfo(...string) + Connection() *grpc.ClientConn + Delete(context.Context, *computepb.DeleteInstanceTemplateRequest, ...gax.CallOption) (*computepb.Operation, error) + Get(context.Context, *computepb.GetInstanceTemplateRequest, ...gax.CallOption) (*computepb.InstanceTemplate, error) + GetIamPolicy(context.Context, *computepb.GetIamPolicyInstanceTemplateRequest, ...gax.CallOption) (*computepb.Policy, error) + Insert(context.Context, *computepb.InsertInstanceTemplateRequest, ...gax.CallOption) (*computepb.Operation, error) + List(context.Context, *computepb.ListInstanceTemplatesRequest, ...gax.CallOption) (*computepb.InstanceTemplateList, error) + SetIamPolicy(context.Context, *computepb.SetIamPolicyInstanceTemplateRequest, ...gax.CallOption) (*computepb.Policy, error) + TestIamPermissions(context.Context, *computepb.TestIamPermissionsInstanceTemplateRequest, ...gax.CallOption) (*computepb.TestPermissionsResponse, error) +} + +// InstanceTemplatesClient 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 InstanceTemplates API. +type InstanceTemplatesClient struct { + // The internal transport-dependent client. + internalClient internalInstanceTemplatesClient + + // The call options for this service. + CallOptions *InstanceTemplatesCallOptions +} + +// 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 *InstanceTemplatesClient) 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 *InstanceTemplatesClient) setGoogleClientInfo(keyval ...string) { + c.internalClient.setGoogleClientInfo(keyval...) +} + +// Connection returns a connection to the API service. +// +// Deprecated. +func (c *InstanceTemplatesClient) Connection() *grpc.ClientConn { + return c.internalClient.Connection() +} + +// Delete deletes the specified instance template. Deleting an instance template is permanent and cannot be undone. It is not possible to delete templates that are already in use by a managed instance group. +func (c *InstanceTemplatesClient) Delete(ctx context.Context, req *computepb.DeleteInstanceTemplateRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.Delete(ctx, req, opts...) +} + +// Get returns the specified instance template. Gets a list of available instance templates by making a list() request. +func (c *InstanceTemplatesClient) Get(ctx context.Context, req *computepb.GetInstanceTemplateRequest, opts ...gax.CallOption) (*computepb.InstanceTemplate, error) { + 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 *InstanceTemplatesClient) GetIamPolicy(ctx context.Context, req *computepb.GetIamPolicyInstanceTemplateRequest, opts ...gax.CallOption) (*computepb.Policy, error) { + return c.internalClient.GetIamPolicy(ctx, req, opts...) +} + +// Insert creates an instance template in the specified project using the data that is included in the request. If you are creating a new template to update an existing instance group, your new instance template must use the same network or, if applicable, the same subnetwork as the original template. +func (c *InstanceTemplatesClient) Insert(ctx context.Context, req *computepb.InsertInstanceTemplateRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.Insert(ctx, req, opts...) +} + +// List retrieves a list of instance templates that are contained within the specified project. +func (c *InstanceTemplatesClient) List(ctx context.Context, req *computepb.ListInstanceTemplatesRequest, opts ...gax.CallOption) (*computepb.InstanceTemplateList, error) { + return c.internalClient.List(ctx, req, opts...) +} + +// SetIamPolicy sets the access control policy on the specified resource. Replaces any existing policy. +func (c *InstanceTemplatesClient) SetIamPolicy(ctx context.Context, req *computepb.SetIamPolicyInstanceTemplateRequest, 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 *InstanceTemplatesClient) TestIamPermissions(ctx context.Context, req *computepb.TestIamPermissionsInstanceTemplateRequest, opts ...gax.CallOption) (*computepb.TestPermissionsResponse, error) { + return c.internalClient.TestIamPermissions(ctx, req, opts...) +} + +// Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls. +type instanceTemplatesRESTClient struct { + // The http endpoint to connect to. + endpoint string + + // The http client. + httpClient *http.Client + + // The x-goog-* metadata to be sent with each request. + xGoogMetadata metadata.MD +} + +// NewInstanceTemplatesRESTClient creates a new instance templates rest client. +// +// The InstanceTemplates API. +func NewInstanceTemplatesRESTClient(ctx context.Context, opts ...option.ClientOption) (*InstanceTemplatesClient, error) { + clientOpts := append(defaultInstanceTemplatesRESTClientOptions(), opts...) + httpClient, endpoint, err := httptransport.NewClient(ctx, clientOpts...) + if err != nil { + return nil, err + } + + c := &instanceTemplatesRESTClient{ + endpoint: endpoint, + httpClient: httpClient, + } + c.setGoogleClientInfo() + + return &InstanceTemplatesClient{internalClient: c, CallOptions: &InstanceTemplatesCallOptions{}}, nil +} + +func defaultInstanceTemplatesRESTClientOptions() []option.ClientOption { + return []option.ClientOption{ + internaloption.WithDefaultEndpoint("compute.googleapis.com"), + internaloption.WithDefaultMTLSEndpoint("compute.mtls.googleapis.com"), + internaloption.WithDefaultAudience("https://compute.googleapis.com/"), + internaloption.WithDefaultScopes(DefaultAuthScopes()...), + } +} + +// setGoogleClientInfo sets the name and version of the application in +// the `x-goog-api-client` header passed on each request. Intended for +// use by Google-written clients. +func (c *instanceTemplatesRESTClient) setGoogleClientInfo(keyval ...string) { + kv := append([]string{"gl-go", versionGo()}, keyval...) + kv = append(kv, "gapic", versionClient, "gax", gax.Version, "rest", "UNKNOWN") + c.xGoogMetadata = metadata.Pairs("x-goog-api-client", gax.XGoogHeader(kv...)) +} + +// Close closes the connection to the API service. The user should invoke this when +// the client is no longer required. +func (c *instanceTemplatesRESTClient) Close() error { + // Replace httpClient with nil to force cleanup. + c.httpClient = nil + return nil +} + +// Connection returns a connection to the API service. +// +// Deprecated. +func (c *instanceTemplatesRESTClient) Connection() *grpc.ClientConn { + return nil +} + +// Delete deletes the specified instance template. Deleting an instance template is permanent and cannot be undone. It is not possible to delete templates that are already in use by a managed instance group. +func (c *instanceTemplatesRESTClient) Delete(ctx context.Context, req *computepb.DeleteInstanceTemplateRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/global/instanceTemplates/%v", req.GetProject(), req.GetInstanceTemplate()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("DELETE", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Get returns the specified instance template. Gets a list of available instance templates by making a list() request. +func (c *instanceTemplatesRESTClient) Get(ctx context.Context, req *computepb.GetInstanceTemplateRequest, opts ...gax.CallOption) (*computepb.InstanceTemplate, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/global/instanceTemplates/%v", req.GetProject(), req.GetInstanceTemplate()) + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.InstanceTemplate{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// GetIamPolicy gets the access control policy for a resource. May be empty if no such policy or resource exists. +func (c *instanceTemplatesRESTClient) GetIamPolicy(ctx context.Context, req *computepb.GetIamPolicyInstanceTemplateRequest, opts ...gax.CallOption) (*computepb.Policy, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/global/instanceTemplates/%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() + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Policy{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Insert creates an instance template in the specified project using the data that is included in the request. If you are creating a new template to update an existing instance group, your new instance template must use the same network or, if applicable, the same subnetwork as the original template. +func (c *instanceTemplatesRESTClient) Insert(ctx context.Context, req *computepb.InsertInstanceTemplateRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetInstanceTemplateResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/global/instanceTemplates", req.GetProject()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// List retrieves a list of instance templates that are contained within the specified project. +func (c *instanceTemplatesRESTClient) List(ctx context.Context, req *computepb.ListInstanceTemplatesRequest, opts ...gax.CallOption) (*computepb.InstanceTemplateList, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/global/instanceTemplates", 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() + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.InstanceTemplateList{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// SetIamPolicy sets the access control policy on the specified resource. Replaces any existing policy. +func (c *instanceTemplatesRESTClient) SetIamPolicy(ctx context.Context, req *computepb.SetIamPolicyInstanceTemplateRequest, opts ...gax.CallOption) (*computepb.Policy, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetGlobalSetPolicyRequestResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/global/instanceTemplates/%v/setIamPolicy", req.GetProject(), req.GetResource()) + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Policy{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// TestIamPermissions returns permissions that a caller has on the specified resource. +func (c *instanceTemplatesRESTClient) TestIamPermissions(ctx context.Context, req *computepb.TestIamPermissionsInstanceTemplateRequest, opts ...gax.CallOption) (*computepb.TestPermissionsResponse, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetTestPermissionsRequestResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/global/instanceTemplates/%v/testIamPermissions", req.GetProject(), req.GetResource()) + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.TestPermissionsResponse{} + + return rsp, unm.Unmarshal(buf, rsp) +} diff --git a/compute/apiv1/instance_templates_client_example_test.go b/compute/apiv1/instance_templates_client_example_test.go new file mode 100644 index 00000000000..3cdbbabf56d --- /dev/null +++ b/compute/apiv1/instance_templates_client_example_test.go @@ -0,0 +1,169 @@ +// Copyright 2021 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_test + +import ( + "context" + + compute "cloud.google.com/go/compute/apiv1" + computepb "google.golang.org/genproto/googleapis/cloud/compute/v1" +) + +func ExampleNewInstanceTemplatesRESTClient() { + ctx := context.Background() + c, err := compute.NewInstanceTemplatesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + // TODO: Use client. + _ = c +} + +func ExampleInstanceTemplatesClient_Delete() { + ctx := context.Background() + c, err := compute.NewInstanceTemplatesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.DeleteInstanceTemplateRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Delete(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleInstanceTemplatesClient_Get() { + ctx := context.Background() + c, err := compute.NewInstanceTemplatesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.GetInstanceTemplateRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Get(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleInstanceTemplatesClient_GetIamPolicy() { + ctx := context.Background() + c, err := compute.NewInstanceTemplatesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.GetIamPolicyInstanceTemplateRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.GetIamPolicy(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleInstanceTemplatesClient_Insert() { + ctx := context.Background() + c, err := compute.NewInstanceTemplatesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.InsertInstanceTemplateRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Insert(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleInstanceTemplatesClient_List() { + ctx := context.Background() + c, err := compute.NewInstanceTemplatesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.ListInstanceTemplatesRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.List(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleInstanceTemplatesClient_SetIamPolicy() { + ctx := context.Background() + c, err := compute.NewInstanceTemplatesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.SetIamPolicyInstanceTemplateRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.SetIamPolicy(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleInstanceTemplatesClient_TestIamPermissions() { + ctx := context.Background() + c, err := compute.NewInstanceTemplatesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.TestIamPermissionsInstanceTemplateRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.TestIamPermissions(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} diff --git a/compute/apiv1/instances_client.go b/compute/apiv1/instances_client.go new file mode 100644 index 00000000000..365b3efe4fc --- /dev/null +++ b/compute/apiv1/instances_client.go @@ -0,0 +1,2614 @@ +// Copyright 2021 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/ioutil" + "net/http" + "net/url" + + gax "github.com/googleapis/gax-go/v2" + "google.golang.org/api/option" + "google.golang.org/api/option/internaloption" + httptransport "google.golang.org/api/transport/http" + computepb "google.golang.org/genproto/googleapis/cloud/compute/v1" + "google.golang.org/grpc" + "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/encoding/protojson" +) + +var newInstancesClientHook clientHook + +// InstancesCallOptions contains the retry settings for each method of InstancesClient. +type InstancesCallOptions struct { + AddAccessConfig []gax.CallOption + AddResourcePolicies []gax.CallOption + AggregatedList []gax.CallOption + AttachDisk []gax.CallOption + BulkInsert []gax.CallOption + Delete []gax.CallOption + DeleteAccessConfig []gax.CallOption + DetachDisk []gax.CallOption + Get []gax.CallOption + GetEffectiveFirewalls []gax.CallOption + GetGuestAttributes []gax.CallOption + GetIamPolicy []gax.CallOption + GetScreenshot []gax.CallOption + GetSerialPortOutput []gax.CallOption + GetShieldedInstanceIdentity []gax.CallOption + Insert []gax.CallOption + List []gax.CallOption + ListReferrers []gax.CallOption + RemoveResourcePolicies []gax.CallOption + Reset []gax.CallOption + SetDeletionProtection []gax.CallOption + SetDiskAutoDelete []gax.CallOption + SetIamPolicy []gax.CallOption + SetLabels []gax.CallOption + SetMachineResources []gax.CallOption + SetMachineType []gax.CallOption + SetMetadata []gax.CallOption + SetMinCpuPlatform []gax.CallOption + SetScheduling []gax.CallOption + SetServiceAccount []gax.CallOption + SetShieldedInstanceIntegrityPolicy []gax.CallOption + SetTags []gax.CallOption + SimulateMaintenanceEvent []gax.CallOption + Start []gax.CallOption + StartWithEncryptionKey []gax.CallOption + Stop []gax.CallOption + TestIamPermissions []gax.CallOption + Update []gax.CallOption + UpdateAccessConfig []gax.CallOption + UpdateDisplayDevice []gax.CallOption + UpdateNetworkInterface []gax.CallOption + UpdateShieldedInstanceConfig []gax.CallOption +} + +// internalInstancesClient is an interface that defines the methods availaible from Google Compute Engine API. +type internalInstancesClient interface { + Close() error + setGoogleClientInfo(...string) + Connection() *grpc.ClientConn + AddAccessConfig(context.Context, *computepb.AddAccessConfigInstanceRequest, ...gax.CallOption) (*computepb.Operation, error) + AddResourcePolicies(context.Context, *computepb.AddResourcePoliciesInstanceRequest, ...gax.CallOption) (*computepb.Operation, error) + AggregatedList(context.Context, *computepb.AggregatedListInstancesRequest, ...gax.CallOption) (*computepb.InstanceAggregatedList, error) + AttachDisk(context.Context, *computepb.AttachDiskInstanceRequest, ...gax.CallOption) (*computepb.Operation, error) + BulkInsert(context.Context, *computepb.BulkInsertInstanceRequest, ...gax.CallOption) (*computepb.Operation, error) + Delete(context.Context, *computepb.DeleteInstanceRequest, ...gax.CallOption) (*computepb.Operation, error) + DeleteAccessConfig(context.Context, *computepb.DeleteAccessConfigInstanceRequest, ...gax.CallOption) (*computepb.Operation, error) + DetachDisk(context.Context, *computepb.DetachDiskInstanceRequest, ...gax.CallOption) (*computepb.Operation, error) + Get(context.Context, *computepb.GetInstanceRequest, ...gax.CallOption) (*computepb.Instance, error) + GetEffectiveFirewalls(context.Context, *computepb.GetEffectiveFirewallsInstanceRequest, ...gax.CallOption) (*computepb.InstancesGetEffectiveFirewallsResponse, error) + GetGuestAttributes(context.Context, *computepb.GetGuestAttributesInstanceRequest, ...gax.CallOption) (*computepb.GuestAttributes, error) + GetIamPolicy(context.Context, *computepb.GetIamPolicyInstanceRequest, ...gax.CallOption) (*computepb.Policy, error) + GetScreenshot(context.Context, *computepb.GetScreenshotInstanceRequest, ...gax.CallOption) (*computepb.Screenshot, error) + GetSerialPortOutput(context.Context, *computepb.GetSerialPortOutputInstanceRequest, ...gax.CallOption) (*computepb.SerialPortOutput, error) + GetShieldedInstanceIdentity(context.Context, *computepb.GetShieldedInstanceIdentityInstanceRequest, ...gax.CallOption) (*computepb.ShieldedInstanceIdentity, error) + Insert(context.Context, *computepb.InsertInstanceRequest, ...gax.CallOption) (*computepb.Operation, error) + List(context.Context, *computepb.ListInstancesRequest, ...gax.CallOption) (*computepb.InstanceList, error) + ListReferrers(context.Context, *computepb.ListReferrersInstancesRequest, ...gax.CallOption) (*computepb.InstanceListReferrers, error) + RemoveResourcePolicies(context.Context, *computepb.RemoveResourcePoliciesInstanceRequest, ...gax.CallOption) (*computepb.Operation, error) + Reset(context.Context, *computepb.ResetInstanceRequest, ...gax.CallOption) (*computepb.Operation, error) + SetDeletionProtection(context.Context, *computepb.SetDeletionProtectionInstanceRequest, ...gax.CallOption) (*computepb.Operation, error) + SetDiskAutoDelete(context.Context, *computepb.SetDiskAutoDeleteInstanceRequest, ...gax.CallOption) (*computepb.Operation, error) + SetIamPolicy(context.Context, *computepb.SetIamPolicyInstanceRequest, ...gax.CallOption) (*computepb.Policy, error) + SetLabels(context.Context, *computepb.SetLabelsInstanceRequest, ...gax.CallOption) (*computepb.Operation, error) + SetMachineResources(context.Context, *computepb.SetMachineResourcesInstanceRequest, ...gax.CallOption) (*computepb.Operation, error) + SetMachineType(context.Context, *computepb.SetMachineTypeInstanceRequest, ...gax.CallOption) (*computepb.Operation, error) + SetMetadata(context.Context, *computepb.SetMetadataInstanceRequest, ...gax.CallOption) (*computepb.Operation, error) + SetMinCpuPlatform(context.Context, *computepb.SetMinCpuPlatformInstanceRequest, ...gax.CallOption) (*computepb.Operation, error) + SetScheduling(context.Context, *computepb.SetSchedulingInstanceRequest, ...gax.CallOption) (*computepb.Operation, error) + SetServiceAccount(context.Context, *computepb.SetServiceAccountInstanceRequest, ...gax.CallOption) (*computepb.Operation, error) + SetShieldedInstanceIntegrityPolicy(context.Context, *computepb.SetShieldedInstanceIntegrityPolicyInstanceRequest, ...gax.CallOption) (*computepb.Operation, error) + SetTags(context.Context, *computepb.SetTagsInstanceRequest, ...gax.CallOption) (*computepb.Operation, error) + SimulateMaintenanceEvent(context.Context, *computepb.SimulateMaintenanceEventInstanceRequest, ...gax.CallOption) (*computepb.Operation, error) + Start(context.Context, *computepb.StartInstanceRequest, ...gax.CallOption) (*computepb.Operation, error) + StartWithEncryptionKey(context.Context, *computepb.StartWithEncryptionKeyInstanceRequest, ...gax.CallOption) (*computepb.Operation, error) + Stop(context.Context, *computepb.StopInstanceRequest, ...gax.CallOption) (*computepb.Operation, error) + TestIamPermissions(context.Context, *computepb.TestIamPermissionsInstanceRequest, ...gax.CallOption) (*computepb.TestPermissionsResponse, error) + Update(context.Context, *computepb.UpdateInstanceRequest, ...gax.CallOption) (*computepb.Operation, error) + UpdateAccessConfig(context.Context, *computepb.UpdateAccessConfigInstanceRequest, ...gax.CallOption) (*computepb.Operation, error) + UpdateDisplayDevice(context.Context, *computepb.UpdateDisplayDeviceInstanceRequest, ...gax.CallOption) (*computepb.Operation, error) + UpdateNetworkInterface(context.Context, *computepb.UpdateNetworkInterfaceInstanceRequest, ...gax.CallOption) (*computepb.Operation, error) + UpdateShieldedInstanceConfig(context.Context, *computepb.UpdateShieldedInstanceConfigInstanceRequest, ...gax.CallOption) (*computepb.Operation, error) +} + +// InstancesClient 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 Instances API. +type InstancesClient struct { + // The internal transport-dependent client. + internalClient internalInstancesClient + + // The call options for this service. + CallOptions *InstancesCallOptions +} + +// 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 *InstancesClient) 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 *InstancesClient) setGoogleClientInfo(keyval ...string) { + c.internalClient.setGoogleClientInfo(keyval...) +} + +// Connection returns a connection to the API service. +// +// Deprecated. +func (c *InstancesClient) Connection() *grpc.ClientConn { + return c.internalClient.Connection() +} + +// AddAccessConfig adds an access config to an instance’s network interface. +func (c *InstancesClient) AddAccessConfig(ctx context.Context, req *computepb.AddAccessConfigInstanceRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.AddAccessConfig(ctx, req, opts...) +} + +// AddResourcePolicies adds existing resource policies to an instance. You can only add one policy right now which will be applied to this instance for scheduling live migrations. +func (c *InstancesClient) AddResourcePolicies(ctx context.Context, req *computepb.AddResourcePoliciesInstanceRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.AddResourcePolicies(ctx, req, opts...) +} + +// AggregatedList retrieves aggregated list of all of the instances in your project across all regions and zones. +func (c *InstancesClient) AggregatedList(ctx context.Context, req *computepb.AggregatedListInstancesRequest, opts ...gax.CallOption) (*computepb.InstanceAggregatedList, error) { + return c.internalClient.AggregatedList(ctx, req, opts...) +} + +// AttachDisk attaches an existing Disk resource to an instance. You must first create the disk before you can attach it. It is not possible to create and attach a disk at the same time. For more information, read Adding a persistent disk to your instance. +func (c *InstancesClient) AttachDisk(ctx context.Context, req *computepb.AttachDiskInstanceRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.AttachDisk(ctx, req, opts...) +} + +// BulkInsert creates multiple instances. Count specifies the number of instances to create. +func (c *InstancesClient) BulkInsert(ctx context.Context, req *computepb.BulkInsertInstanceRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.BulkInsert(ctx, req, opts...) +} + +// Delete deletes the specified Instance resource. For more information, see Deleting an instance. +func (c *InstancesClient) Delete(ctx context.Context, req *computepb.DeleteInstanceRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.Delete(ctx, req, opts...) +} + +// DeleteAccessConfig deletes an access config from an instance’s network interface. +func (c *InstancesClient) DeleteAccessConfig(ctx context.Context, req *computepb.DeleteAccessConfigInstanceRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.DeleteAccessConfig(ctx, req, opts...) +} + +// DetachDisk detaches a disk from an instance. +func (c *InstancesClient) DetachDisk(ctx context.Context, req *computepb.DetachDiskInstanceRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.DetachDisk(ctx, req, opts...) +} + +// Get returns the specified Instance resource. Gets a list of available instances by making a list() request. +func (c *InstancesClient) Get(ctx context.Context, req *computepb.GetInstanceRequest, opts ...gax.CallOption) (*computepb.Instance, error) { + return c.internalClient.Get(ctx, req, opts...) +} + +// GetEffectiveFirewalls returns effective firewalls applied to an interface of the instance. +func (c *InstancesClient) GetEffectiveFirewalls(ctx context.Context, req *computepb.GetEffectiveFirewallsInstanceRequest, opts ...gax.CallOption) (*computepb.InstancesGetEffectiveFirewallsResponse, error) { + return c.internalClient.GetEffectiveFirewalls(ctx, req, opts...) +} + +// GetGuestAttributes returns the specified guest attributes entry. +func (c *InstancesClient) GetGuestAttributes(ctx context.Context, req *computepb.GetGuestAttributesInstanceRequest, opts ...gax.CallOption) (*computepb.GuestAttributes, error) { + return c.internalClient.GetGuestAttributes(ctx, req, opts...) +} + +// GetIamPolicy gets the access control policy for a resource. May be empty if no such policy or resource exists. +func (c *InstancesClient) GetIamPolicy(ctx context.Context, req *computepb.GetIamPolicyInstanceRequest, opts ...gax.CallOption) (*computepb.Policy, error) { + return c.internalClient.GetIamPolicy(ctx, req, opts...) +} + +// GetScreenshot returns the screenshot from the specified instance. +func (c *InstancesClient) GetScreenshot(ctx context.Context, req *computepb.GetScreenshotInstanceRequest, opts ...gax.CallOption) (*computepb.Screenshot, error) { + return c.internalClient.GetScreenshot(ctx, req, opts...) +} + +// GetSerialPortOutput returns the last 1 MB of serial port output from the specified instance. +func (c *InstancesClient) GetSerialPortOutput(ctx context.Context, req *computepb.GetSerialPortOutputInstanceRequest, opts ...gax.CallOption) (*computepb.SerialPortOutput, error) { + return c.internalClient.GetSerialPortOutput(ctx, req, opts...) +} + +// GetShieldedInstanceIdentity returns the Shielded Instance Identity of an instance +func (c *InstancesClient) GetShieldedInstanceIdentity(ctx context.Context, req *computepb.GetShieldedInstanceIdentityInstanceRequest, opts ...gax.CallOption) (*computepb.ShieldedInstanceIdentity, error) { + return c.internalClient.GetShieldedInstanceIdentity(ctx, req, opts...) +} + +// Insert creates an instance resource in the specified project using the data included in the request. +func (c *InstancesClient) Insert(ctx context.Context, req *computepb.InsertInstanceRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.Insert(ctx, req, opts...) +} + +// List retrieves the list of instances contained within the specified zone. +func (c *InstancesClient) List(ctx context.Context, req *computepb.ListInstancesRequest, opts ...gax.CallOption) (*computepb.InstanceList, error) { + return c.internalClient.List(ctx, req, opts...) +} + +// ListReferrers retrieves a list of resources that refer to the VM instance specified in the request. For example, if the VM instance is part of a managed or unmanaged instance group, the referrers list includes the instance group. For more information, read Viewing referrers to VM instances. +func (c *InstancesClient) ListReferrers(ctx context.Context, req *computepb.ListReferrersInstancesRequest, opts ...gax.CallOption) (*computepb.InstanceListReferrers, error) { + return c.internalClient.ListReferrers(ctx, req, opts...) +} + +// RemoveResourcePolicies removes resource policies from an instance. +func (c *InstancesClient) RemoveResourcePolicies(ctx context.Context, req *computepb.RemoveResourcePoliciesInstanceRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.RemoveResourcePolicies(ctx, req, opts...) +} + +// Reset performs a reset on the instance. This is a hard reset the VM does not do a graceful shutdown. For more information, see Resetting an instance. +func (c *InstancesClient) Reset(ctx context.Context, req *computepb.ResetInstanceRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.Reset(ctx, req, opts...) +} + +// SetDeletionProtection sets deletion protection on the instance. +func (c *InstancesClient) SetDeletionProtection(ctx context.Context, req *computepb.SetDeletionProtectionInstanceRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.SetDeletionProtection(ctx, req, opts...) +} + +// SetDiskAutoDelete sets the auto-delete flag for a disk attached to an instance. +func (c *InstancesClient) SetDiskAutoDelete(ctx context.Context, req *computepb.SetDiskAutoDeleteInstanceRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.SetDiskAutoDelete(ctx, req, opts...) +} + +// SetIamPolicy sets the access control policy on the specified resource. Replaces any existing policy. +func (c *InstancesClient) SetIamPolicy(ctx context.Context, req *computepb.SetIamPolicyInstanceRequest, opts ...gax.CallOption) (*computepb.Policy, error) { + return c.internalClient.SetIamPolicy(ctx, req, opts...) +} + +// SetLabels sets labels on an instance. To learn more about labels, read the Labeling Resources documentation. +func (c *InstancesClient) SetLabels(ctx context.Context, req *computepb.SetLabelsInstanceRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.SetLabels(ctx, req, opts...) +} + +// SetMachineResources changes the number and/or type of accelerator for a stopped instance to the values specified in the request. +func (c *InstancesClient) SetMachineResources(ctx context.Context, req *computepb.SetMachineResourcesInstanceRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.SetMachineResources(ctx, req, opts...) +} + +// SetMachineType changes the machine type for a stopped instance to the machine type specified in the request. +func (c *InstancesClient) SetMachineType(ctx context.Context, req *computepb.SetMachineTypeInstanceRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.SetMachineType(ctx, req, opts...) +} + +// SetMetadata sets metadata for the specified instance to the data included in the request. +func (c *InstancesClient) SetMetadata(ctx context.Context, req *computepb.SetMetadataInstanceRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.SetMetadata(ctx, req, opts...) +} + +// SetMinCpuPlatform changes the minimum CPU platform that this instance should use. This method can only be called on a stopped instance. For more information, read Specifying a Minimum CPU Platform. +func (c *InstancesClient) SetMinCpuPlatform(ctx context.Context, req *computepb.SetMinCpuPlatformInstanceRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.SetMinCpuPlatform(ctx, req, opts...) +} + +// SetScheduling sets an instance’s scheduling options. You can only call this method on a stopped instance, that is, a VM instance that is in a TERMINATED state. See Instance Life Cycle for more information on the possible instance states. +func (c *InstancesClient) SetScheduling(ctx context.Context, req *computepb.SetSchedulingInstanceRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.SetScheduling(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) (*computepb.Operation, error) { + return c.internalClient.SetServiceAccount(ctx, req, opts...) +} + +// SetShieldedInstanceIntegrityPolicy sets the Shielded Instance integrity policy for an instance. You can only use this method on a running instance. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. +func (c *InstancesClient) SetShieldedInstanceIntegrityPolicy(ctx context.Context, req *computepb.SetShieldedInstanceIntegrityPolicyInstanceRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.SetShieldedInstanceIntegrityPolicy(ctx, req, opts...) +} + +// SetTags sets network tags for the specified instance to the data included in the request. +func (c *InstancesClient) SetTags(ctx context.Context, req *computepb.SetTagsInstanceRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.SetTags(ctx, req, opts...) +} + +// SimulateMaintenanceEvent simulates a maintenance event on the instance. +func (c *InstancesClient) SimulateMaintenanceEvent(ctx context.Context, req *computepb.SimulateMaintenanceEventInstanceRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.SimulateMaintenanceEvent(ctx, req, opts...) +} + +// Start starts an instance that was stopped using the instances().stop method. For more information, see Restart an instance. +func (c *InstancesClient) Start(ctx context.Context, req *computepb.StartInstanceRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.Start(ctx, req, opts...) +} + +// StartWithEncryptionKey starts an instance that was stopped using the instances().stop method. For more information, see Restart an instance. +func (c *InstancesClient) StartWithEncryptionKey(ctx context.Context, req *computepb.StartWithEncryptionKeyInstanceRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.StartWithEncryptionKey(ctx, req, opts...) +} + +// Stop stops a running instance, shutting it down cleanly, and allows you to restart the instance at a later time. Stopped instances do not incur VM usage charges while they are stopped. However, resources that the VM is using, such as persistent disks and static IP addresses, will continue to be charged until they are deleted. For more information, see Stopping an instance. +func (c *InstancesClient) Stop(ctx context.Context, req *computepb.StopInstanceRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.Stop(ctx, req, opts...) +} + +// TestIamPermissions returns permissions that a caller has on the specified resource. +func (c *InstancesClient) TestIamPermissions(ctx context.Context, req *computepb.TestIamPermissionsInstanceRequest, opts ...gax.CallOption) (*computepb.TestPermissionsResponse, error) { + return c.internalClient.TestIamPermissions(ctx, req, opts...) +} + +// Update updates an instance only if the necessary resources are available. This method can update only a specific set of instance properties. See Updating a running instance for a list of updatable instance properties. +func (c *InstancesClient) Update(ctx context.Context, req *computepb.UpdateInstanceRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.Update(ctx, req, opts...) +} + +// UpdateAccessConfig updates the specified access config from an instance’s network interface with the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. +func (c *InstancesClient) UpdateAccessConfig(ctx context.Context, req *computepb.UpdateAccessConfigInstanceRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.UpdateAccessConfig(ctx, req, opts...) +} + +// UpdateDisplayDevice updates the Display config for a VM instance. You can only use this method on a stopped VM instance. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. +func (c *InstancesClient) UpdateDisplayDevice(ctx context.Context, req *computepb.UpdateDisplayDeviceInstanceRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.UpdateDisplayDevice(ctx, req, opts...) +} + +// UpdateNetworkInterface updates an instance’s network interface. This method can only update an interface’s alias IP range and attached network. See Modifying alias IP ranges for an existing instance for instructions on changing alias IP ranges. See Migrating a VM between networks for instructions on migrating an interface. This method follows PATCH semantics. +func (c *InstancesClient) UpdateNetworkInterface(ctx context.Context, req *computepb.UpdateNetworkInterfaceInstanceRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.UpdateNetworkInterface(ctx, req, opts...) +} + +// UpdateShieldedInstanceConfig updates the Shielded Instance config for an instance. You can only use this method on a stopped instance. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. +func (c *InstancesClient) UpdateShieldedInstanceConfig(ctx context.Context, req *computepb.UpdateShieldedInstanceConfigInstanceRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.UpdateShieldedInstanceConfig(ctx, req, opts...) +} + +// Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls. +type instancesRESTClient struct { + // The http endpoint to connect to. + endpoint string + + // The http client. + httpClient *http.Client + + // The x-goog-* metadata to be sent with each request. + xGoogMetadata metadata.MD +} + +// NewInstancesRESTClient creates a new instances rest client. +// +// The Instances API. +func NewInstancesRESTClient(ctx context.Context, opts ...option.ClientOption) (*InstancesClient, error) { + clientOpts := append(defaultInstancesRESTClientOptions(), opts...) + httpClient, endpoint, err := httptransport.NewClient(ctx, clientOpts...) + if err != nil { + return nil, err + } + + c := &instancesRESTClient{ + endpoint: endpoint, + httpClient: httpClient, + } + c.setGoogleClientInfo() + + return &InstancesClient{internalClient: c, CallOptions: &InstancesCallOptions{}}, nil +} + +func defaultInstancesRESTClientOptions() []option.ClientOption { + return []option.ClientOption{ + internaloption.WithDefaultEndpoint("compute.googleapis.com"), + internaloption.WithDefaultMTLSEndpoint("compute.mtls.googleapis.com"), + internaloption.WithDefaultAudience("https://compute.googleapis.com/"), + internaloption.WithDefaultScopes(DefaultAuthScopes()...), + } +} + +// setGoogleClientInfo sets the name and version of the application in +// the `x-goog-api-client` header passed on each request. Intended for +// use by Google-written clients. +func (c *instancesRESTClient) setGoogleClientInfo(keyval ...string) { + kv := append([]string{"gl-go", versionGo()}, keyval...) + kv = append(kv, "gapic", versionClient, "gax", gax.Version, "rest", "UNKNOWN") + c.xGoogMetadata = metadata.Pairs("x-goog-api-client", gax.XGoogHeader(kv...)) +} + +// Close closes the connection to the API service. The user should invoke this when +// the client is no longer required. +func (c *instancesRESTClient) Close() error { + // Replace httpClient with nil to force cleanup. + c.httpClient = nil + return nil +} + +// Connection returns a connection to the API service. +// +// Deprecated. +func (c *instancesRESTClient) Connection() *grpc.ClientConn { + return nil +} + +// AddAccessConfig adds an access config to an instance’s network interface. +func (c *instancesRESTClient) AddAccessConfig(ctx context.Context, req *computepb.AddAccessConfigInstanceRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetAccessConfigResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/zones/%v/instances/%v/addAccessConfig", req.GetProject(), req.GetZone(), req.GetInstance()) + + params := url.Values{} + if req.GetNetworkInterface() != "" { + params.Add("networkInterface", fmt.Sprintf("%v", req.GetNetworkInterface())) + } + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// AddResourcePolicies adds existing resource policies to an instance. You can only add one policy right now which will be applied to this instance for scheduling live migrations. +func (c *instancesRESTClient) AddResourcePolicies(ctx context.Context, req *computepb.AddResourcePoliciesInstanceRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetInstancesAddResourcePoliciesRequestResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/zones/%v/instances/%v/addResourcePolicies", 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() + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// AggregatedList retrieves aggregated list of all of the instances in your project across all regions and zones. +func (c *instancesRESTClient) AggregatedList(ctx context.Context, req *computepb.AggregatedListInstancesRequest, opts ...gax.CallOption) (*computepb.InstanceAggregatedList, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/aggregated/instances", req.GetProject()) + + params := url.Values{} + if req != nil && req.Filter != nil { + params.Add("filter", fmt.Sprintf("%v", req.GetFilter())) + } + if req != nil && req.IncludeAllScopes != nil { + params.Add("includeAllScopes", fmt.Sprintf("%v", req.GetIncludeAllScopes())) + } + 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() + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.InstanceAggregatedList{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// AttachDisk attaches an existing Disk resource to an instance. You must first create the disk before you can attach it. It is not possible to create and attach a disk at the same time. For more information, read Adding a persistent disk to your instance. +func (c *instancesRESTClient) AttachDisk(ctx context.Context, req *computepb.AttachDiskInstanceRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetAttachedDiskResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/zones/%v/instances/%v/attachDisk", req.GetProject(), req.GetZone(), req.GetInstance()) + + params := url.Values{} + if req != nil && req.ForceAttach != nil { + params.Add("forceAttach", fmt.Sprintf("%v", req.GetForceAttach())) + } + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// BulkInsert creates multiple instances. Count specifies the number of instances to create. +func (c *instancesRESTClient) BulkInsert(ctx context.Context, req *computepb.BulkInsertInstanceRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetBulkInsertInstanceResourceResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/zones/%v/instances/bulkInsert", req.GetProject(), req.GetZone()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Delete deletes the specified Instance resource. For more information, see Deleting an instance. +func (c *instancesRESTClient) Delete(ctx context.Context, req *computepb.DeleteInstanceRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/zones/%v/instances/%v", 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() + + httpReq, err := http.NewRequest("DELETE", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// DeleteAccessConfig deletes an access config from an instance’s network interface. +func (c *instancesRESTClient) DeleteAccessConfig(ctx context.Context, req *computepb.DeleteAccessConfigInstanceRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/zones/%v/instances/%v/deleteAccessConfig", req.GetProject(), req.GetZone(), req.GetInstance()) + + params := url.Values{} + if req.GetAccessConfig() != "" { + params.Add("accessConfig", fmt.Sprintf("%v", req.GetAccessConfig())) + } + if req.GetNetworkInterface() != "" { + params.Add("networkInterface", fmt.Sprintf("%v", req.GetNetworkInterface())) + } + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// DetachDisk detaches a disk from an instance. +func (c *instancesRESTClient) DetachDisk(ctx context.Context, req *computepb.DetachDiskInstanceRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/zones/%v/instances/%v/detachDisk", req.GetProject(), req.GetZone(), req.GetInstance()) + + params := url.Values{} + if req.GetDeviceName() != "" { + params.Add("deviceName", fmt.Sprintf("%v", req.GetDeviceName())) + } + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Get returns the specified Instance resource. Gets a list of available instances by making a list() request. +func (c *instancesRESTClient) Get(ctx context.Context, req *computepb.GetInstanceRequest, opts ...gax.CallOption) (*computepb.Instance, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/zones/%v/instances/%v", req.GetProject(), req.GetZone(), req.GetInstance()) + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Instance{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// GetEffectiveFirewalls returns effective firewalls applied to an interface of the instance. +func (c *instancesRESTClient) GetEffectiveFirewalls(ctx context.Context, req *computepb.GetEffectiveFirewallsInstanceRequest, opts ...gax.CallOption) (*computepb.InstancesGetEffectiveFirewallsResponse, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/zones/%v/instances/%v/getEffectiveFirewalls", req.GetProject(), req.GetZone(), req.GetInstance()) + + params := url.Values{} + if req.GetNetworkInterface() != "" { + params.Add("networkInterface", fmt.Sprintf("%v", req.GetNetworkInterface())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.InstancesGetEffectiveFirewallsResponse{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// GetGuestAttributes returns the specified guest attributes entry. +func (c *instancesRESTClient) GetGuestAttributes(ctx context.Context, req *computepb.GetGuestAttributesInstanceRequest, opts ...gax.CallOption) (*computepb.GuestAttributes, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/zones/%v/instances/%v/getGuestAttributes", req.GetProject(), req.GetZone(), req.GetInstance()) + + params := url.Values{} + if req != nil && req.QueryPath != nil { + params.Add("queryPath", fmt.Sprintf("%v", req.GetQueryPath())) + } + if req != nil && req.VariableKey != nil { + params.Add("variableKey", fmt.Sprintf("%v", req.GetVariableKey())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.GuestAttributes{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// GetIamPolicy gets the access control policy for a resource. May be empty if no such policy or resource exists. +func (c *instancesRESTClient) GetIamPolicy(ctx context.Context, req *computepb.GetIamPolicyInstanceRequest, opts ...gax.CallOption) (*computepb.Policy, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/zones/%v/instances/%v/getIamPolicy", req.GetProject(), req.GetZone(), req.GetResource()) + + params := url.Values{} + if req != nil && req.OptionsRequestedPolicyVersion != nil { + params.Add("optionsRequestedPolicyVersion", fmt.Sprintf("%v", req.GetOptionsRequestedPolicyVersion())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Policy{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// GetScreenshot returns the screenshot from the specified instance. +func (c *instancesRESTClient) GetScreenshot(ctx context.Context, req *computepb.GetScreenshotInstanceRequest, opts ...gax.CallOption) (*computepb.Screenshot, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/zones/%v/instances/%v/screenshot", req.GetProject(), req.GetZone(), req.GetInstance()) + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Screenshot{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// GetSerialPortOutput returns the last 1 MB of serial port output from the specified instance. +func (c *instancesRESTClient) GetSerialPortOutput(ctx context.Context, req *computepb.GetSerialPortOutputInstanceRequest, opts ...gax.CallOption) (*computepb.SerialPortOutput, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/zones/%v/instances/%v/serialPort", req.GetProject(), req.GetZone(), req.GetInstance()) + + params := url.Values{} + if req != nil && req.Port != nil { + params.Add("port", fmt.Sprintf("%v", req.GetPort())) + } + if req != nil && req.Start != nil { + params.Add("start", fmt.Sprintf("%v", req.GetStart())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.SerialPortOutput{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// GetShieldedInstanceIdentity returns the Shielded Instance Identity of an instance +func (c *instancesRESTClient) GetShieldedInstanceIdentity(ctx context.Context, req *computepb.GetShieldedInstanceIdentityInstanceRequest, opts ...gax.CallOption) (*computepb.ShieldedInstanceIdentity, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/zones/%v/instances/%v/getShieldedInstanceIdentity", req.GetProject(), req.GetZone(), req.GetInstance()) + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.ShieldedInstanceIdentity{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Insert creates an instance resource in the specified project using the data included in the request. +func (c *instancesRESTClient) Insert(ctx context.Context, req *computepb.InsertInstanceRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetInstanceResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/zones/%v/instances", req.GetProject(), req.GetZone()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + if req != nil && req.SourceInstanceTemplate != nil { + params.Add("sourceInstanceTemplate", fmt.Sprintf("%v", req.GetSourceInstanceTemplate())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// List retrieves the list of instances contained within the specified zone. +func (c *instancesRESTClient) List(ctx context.Context, req *computepb.ListInstancesRequest, opts ...gax.CallOption) (*computepb.InstanceList, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/zones/%v/instances", req.GetProject(), req.GetZone()) + + 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() + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.InstanceList{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// ListReferrers retrieves a list of resources that refer to the VM instance specified in the request. For example, if the VM instance is part of a managed or unmanaged instance group, the referrers list includes the instance group. For more information, read Viewing referrers to VM instances. +func (c *instancesRESTClient) ListReferrers(ctx context.Context, req *computepb.ListReferrersInstancesRequest, opts ...gax.CallOption) (*computepb.InstanceListReferrers, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/zones/%v/instances/%v/referrers", req.GetProject(), req.GetZone(), req.GetInstance()) + + 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() + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.InstanceListReferrers{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// RemoveResourcePolicies removes resource policies from an instance. +func (c *instancesRESTClient) RemoveResourcePolicies(ctx context.Context, req *computepb.RemoveResourcePoliciesInstanceRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetInstancesRemoveResourcePoliciesRequestResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/zones/%v/instances/%v/removeResourcePolicies", 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() + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Reset performs a reset on the instance. This is a hard reset the VM does not do a graceful shutdown. For more information, see Resetting an instance. +func (c *instancesRESTClient) Reset(ctx context.Context, req *computepb.ResetInstanceRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/zones/%v/instances/%v/reset", 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() + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// SetDeletionProtection sets deletion protection on the instance. +func (c *instancesRESTClient) SetDeletionProtection(ctx context.Context, req *computepb.SetDeletionProtectionInstanceRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/zones/%v/instances/%v/setDeletionProtection", req.GetProject(), req.GetZone(), req.GetResource()) + + params := url.Values{} + if req != nil && req.DeletionProtection != nil { + params.Add("deletionProtection", fmt.Sprintf("%v", req.GetDeletionProtection())) + } + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// SetDiskAutoDelete sets the auto-delete flag for a disk attached to an instance. +func (c *instancesRESTClient) SetDiskAutoDelete(ctx context.Context, req *computepb.SetDiskAutoDeleteInstanceRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/zones/%v/instances/%v/setDiskAutoDelete", req.GetProject(), req.GetZone(), req.GetInstance()) + + params := url.Values{} + if req.GetAutoDelete() { + params.Add("autoDelete", fmt.Sprintf("%v", req.GetAutoDelete())) + } + if req.GetDeviceName() != "" { + params.Add("deviceName", fmt.Sprintf("%v", req.GetDeviceName())) + } + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// SetIamPolicy sets the access control policy on the specified resource. Replaces any existing policy. +func (c *instancesRESTClient) SetIamPolicy(ctx context.Context, req *computepb.SetIamPolicyInstanceRequest, opts ...gax.CallOption) (*computepb.Policy, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetZoneSetPolicyRequestResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/zones/%v/instances/%v/setIamPolicy", req.GetProject(), req.GetZone(), req.GetResource()) + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Policy{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// SetLabels sets labels on an instance. To learn more about labels, read the Labeling Resources documentation. +func (c *instancesRESTClient) SetLabels(ctx context.Context, req *computepb.SetLabelsInstanceRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetInstancesSetLabelsRequestResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/zones/%v/instances/%v/setLabels", 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() + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// SetMachineResources changes the number and/or type of accelerator for a stopped instance to the values specified in the request. +func (c *instancesRESTClient) SetMachineResources(ctx context.Context, req *computepb.SetMachineResourcesInstanceRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetInstancesSetMachineResourcesRequestResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/zones/%v/instances/%v/setMachineResources", 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() + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// SetMachineType changes the machine type for a stopped instance to the machine type specified in the request. +func (c *instancesRESTClient) SetMachineType(ctx context.Context, req *computepb.SetMachineTypeInstanceRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetInstancesSetMachineTypeRequestResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/zones/%v/instances/%v/setMachineType", 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() + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// SetMetadata sets metadata for the specified instance to the data included in the request. +func (c *instancesRESTClient) SetMetadata(ctx context.Context, req *computepb.SetMetadataInstanceRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetMetadataResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/zones/%v/instances/%v/setMetadata", 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() + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// SetMinCpuPlatform changes the minimum CPU platform that this instance should use. This method can only be called on a stopped instance. For more information, read Specifying a Minimum CPU Platform. +func (c *instancesRESTClient) SetMinCpuPlatform(ctx context.Context, req *computepb.SetMinCpuPlatformInstanceRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetInstancesSetMinCpuPlatformRequestResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/zones/%v/instances/%v/setMinCpuPlatform", 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() + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// SetScheduling sets an instance’s scheduling options. You can only call this method on a stopped instance, that is, a VM instance that is in a TERMINATED state. See Instance Life Cycle for more information on the possible instance states. +func (c *instancesRESTClient) SetScheduling(ctx context.Context, req *computepb.SetSchedulingInstanceRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetSchedulingResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/zones/%v/instances/%v/setScheduling", 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() + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// 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) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetInstancesSetServiceAccountRequestResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/zones/%v/instances/%v/setServiceAccount", 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() + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// SetShieldedInstanceIntegrityPolicy sets the Shielded Instance integrity policy for an instance. You can only use this method on a running instance. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. +func (c *instancesRESTClient) SetShieldedInstanceIntegrityPolicy(ctx context.Context, req *computepb.SetShieldedInstanceIntegrityPolicyInstanceRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetShieldedInstanceIntegrityPolicyResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/zones/%v/instances/%v/setShieldedInstanceIntegrityPolicy", 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() + + httpReq, err := http.NewRequest("PATCH", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// SetTags sets network tags for the specified instance to the data included in the request. +func (c *instancesRESTClient) SetTags(ctx context.Context, req *computepb.SetTagsInstanceRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetTagsResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/zones/%v/instances/%v/setTags", 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() + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// SimulateMaintenanceEvent simulates a maintenance event on the instance. +func (c *instancesRESTClient) SimulateMaintenanceEvent(ctx context.Context, req *computepb.SimulateMaintenanceEventInstanceRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/zones/%v/instances/%v/simulateMaintenanceEvent", req.GetProject(), req.GetZone(), req.GetInstance()) + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Start starts an instance that was stopped using the instances().stop method. For more information, see Restart an instance. +func (c *instancesRESTClient) Start(ctx context.Context, req *computepb.StartInstanceRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/zones/%v/instances/%v/start", 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() + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// StartWithEncryptionKey starts an instance that was stopped using the instances().stop method. For more information, see Restart an instance. +func (c *instancesRESTClient) StartWithEncryptionKey(ctx context.Context, req *computepb.StartWithEncryptionKeyInstanceRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetInstancesStartWithEncryptionKeyRequestResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/zones/%v/instances/%v/startWithEncryptionKey", 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() + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Stop stops a running instance, shutting it down cleanly, and allows you to restart the instance at a later time. Stopped instances do not incur VM usage charges while they are stopped. However, resources that the VM is using, such as persistent disks and static IP addresses, will continue to be charged until they are deleted. For more information, see Stopping an instance. +func (c *instancesRESTClient) Stop(ctx context.Context, req *computepb.StopInstanceRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/zones/%v/instances/%v/stop", 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() + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// TestIamPermissions returns permissions that a caller has on the specified resource. +func (c *instancesRESTClient) TestIamPermissions(ctx context.Context, req *computepb.TestIamPermissionsInstanceRequest, opts ...gax.CallOption) (*computepb.TestPermissionsResponse, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetTestPermissionsRequestResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/zones/%v/instances/%v/testIamPermissions", req.GetProject(), req.GetZone(), req.GetResource()) + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.TestPermissionsResponse{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Update updates an instance only if the necessary resources are available. This method can update only a specific set of instance properties. See Updating a running instance for a list of updatable instance properties. +func (c *instancesRESTClient) Update(ctx context.Context, req *computepb.UpdateInstanceRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetInstanceResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("") + + params := url.Values{} + if req.GetInstance() != "" { + params.Add("instance", fmt.Sprintf("%v", req.GetInstance())) + } + if req != nil && req.MinimalAction != nil { + params.Add("minimalAction", fmt.Sprintf("%v", req.GetMinimalAction())) + } + if req != nil && req.MostDisruptiveAllowedAction != nil { + params.Add("mostDisruptiveAllowedAction", fmt.Sprintf("%v", req.GetMostDisruptiveAllowedAction())) + } + if req.GetProject() != "" { + params.Add("project", fmt.Sprintf("%v", req.GetProject())) + } + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + if req.GetZone() != "" { + params.Add("zone", fmt.Sprintf("%v", req.GetZone())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("PUT", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// UpdateAccessConfig updates the specified access config from an instance’s network interface with the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. +func (c *instancesRESTClient) UpdateAccessConfig(ctx context.Context, req *computepb.UpdateAccessConfigInstanceRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetAccessConfigResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/zones/%v/instances/%v/updateAccessConfig", req.GetProject(), req.GetZone(), req.GetInstance()) + + params := url.Values{} + if req.GetNetworkInterface() != "" { + params.Add("networkInterface", fmt.Sprintf("%v", req.GetNetworkInterface())) + } + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// UpdateDisplayDevice updates the Display config for a VM instance. You can only use this method on a stopped VM instance. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. +func (c *instancesRESTClient) UpdateDisplayDevice(ctx context.Context, req *computepb.UpdateDisplayDeviceInstanceRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetDisplayDeviceResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/zones/%v/instances/%v/updateDisplayDevice", 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() + + httpReq, err := http.NewRequest("PATCH", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// UpdateNetworkInterface updates an instance’s network interface. This method can only update an interface’s alias IP range and attached network. See Modifying alias IP ranges for an existing instance for instructions on changing alias IP ranges. See Migrating a VM between networks for instructions on migrating an interface. This method follows PATCH semantics. +func (c *instancesRESTClient) UpdateNetworkInterface(ctx context.Context, req *computepb.UpdateNetworkInterfaceInstanceRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetNetworkInterfaceResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/zones/%v/instances/%v/updateNetworkInterface", req.GetProject(), req.GetZone(), req.GetInstance()) + + params := url.Values{} + if req.GetNetworkInterface() != "" { + params.Add("networkInterface", fmt.Sprintf("%v", req.GetNetworkInterface())) + } + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("PATCH", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// UpdateShieldedInstanceConfig updates the Shielded Instance config for an instance. You can only use this method on a stopped instance. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. +func (c *instancesRESTClient) UpdateShieldedInstanceConfig(ctx context.Context, req *computepb.UpdateShieldedInstanceConfigInstanceRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetShieldedInstanceConfigResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/zones/%v/instances/%v/updateShieldedInstanceConfig", 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() + + httpReq, err := http.NewRequest("PATCH", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} diff --git a/compute/apiv1/instances_client_example_test.go b/compute/apiv1/instances_client_example_test.go new file mode 100644 index 00000000000..3728bb87319 --- /dev/null +++ b/compute/apiv1/instances_client_example_test.go @@ -0,0 +1,834 @@ +// Copyright 2021 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_test + +import ( + "context" + + compute "cloud.google.com/go/compute/apiv1" + computepb "google.golang.org/genproto/googleapis/cloud/compute/v1" +) + +func ExampleNewInstancesRESTClient() { + ctx := context.Background() + c, err := compute.NewInstancesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + // TODO: Use client. + _ = c +} + +func ExampleInstancesClient_AddAccessConfig() { + ctx := context.Background() + c, err := compute.NewInstancesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.AddAccessConfigInstanceRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.AddAccessConfig(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleInstancesClient_AddResourcePolicies() { + ctx := context.Background() + c, err := compute.NewInstancesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.AddResourcePoliciesInstanceRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.AddResourcePolicies(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleInstancesClient_AggregatedList() { + ctx := context.Background() + c, err := compute.NewInstancesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.AggregatedListInstancesRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.AggregatedList(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleInstancesClient_AttachDisk() { + ctx := context.Background() + c, err := compute.NewInstancesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.AttachDiskInstanceRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.AttachDisk(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleInstancesClient_BulkInsert() { + ctx := context.Background() + c, err := compute.NewInstancesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.BulkInsertInstanceRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.BulkInsert(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleInstancesClient_Delete() { + ctx := context.Background() + c, err := compute.NewInstancesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.DeleteInstanceRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Delete(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleInstancesClient_DeleteAccessConfig() { + ctx := context.Background() + c, err := compute.NewInstancesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.DeleteAccessConfigInstanceRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.DeleteAccessConfig(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleInstancesClient_DetachDisk() { + ctx := context.Background() + c, err := compute.NewInstancesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.DetachDiskInstanceRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.DetachDisk(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleInstancesClient_Get() { + ctx := context.Background() + c, err := compute.NewInstancesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.GetInstanceRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Get(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleInstancesClient_GetEffectiveFirewalls() { + ctx := context.Background() + c, err := compute.NewInstancesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.GetEffectiveFirewallsInstanceRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.GetEffectiveFirewalls(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleInstancesClient_GetGuestAttributes() { + ctx := context.Background() + c, err := compute.NewInstancesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.GetGuestAttributesInstanceRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.GetGuestAttributes(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleInstancesClient_GetIamPolicy() { + ctx := context.Background() + c, err := compute.NewInstancesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.GetIamPolicyInstanceRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.GetIamPolicy(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleInstancesClient_GetScreenshot() { + ctx := context.Background() + c, err := compute.NewInstancesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.GetScreenshotInstanceRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.GetScreenshot(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleInstancesClient_GetSerialPortOutput() { + ctx := context.Background() + c, err := compute.NewInstancesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.GetSerialPortOutputInstanceRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.GetSerialPortOutput(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleInstancesClient_GetShieldedInstanceIdentity() { + ctx := context.Background() + c, err := compute.NewInstancesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.GetShieldedInstanceIdentityInstanceRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.GetShieldedInstanceIdentity(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleInstancesClient_Insert() { + ctx := context.Background() + c, err := compute.NewInstancesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.InsertInstanceRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Insert(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleInstancesClient_List() { + ctx := context.Background() + c, err := compute.NewInstancesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.ListInstancesRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.List(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleInstancesClient_ListReferrers() { + ctx := context.Background() + c, err := compute.NewInstancesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.ListReferrersInstancesRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.ListReferrers(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleInstancesClient_RemoveResourcePolicies() { + ctx := context.Background() + c, err := compute.NewInstancesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.RemoveResourcePoliciesInstanceRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.RemoveResourcePolicies(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleInstancesClient_Reset() { + ctx := context.Background() + c, err := compute.NewInstancesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.ResetInstanceRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Reset(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleInstancesClient_SetDeletionProtection() { + ctx := context.Background() + c, err := compute.NewInstancesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.SetDeletionProtectionInstanceRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.SetDeletionProtection(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleInstancesClient_SetDiskAutoDelete() { + ctx := context.Background() + c, err := compute.NewInstancesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.SetDiskAutoDeleteInstanceRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.SetDiskAutoDelete(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleInstancesClient_SetIamPolicy() { + ctx := context.Background() + c, err := compute.NewInstancesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.SetIamPolicyInstanceRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.SetIamPolicy(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleInstancesClient_SetLabels() { + ctx := context.Background() + c, err := compute.NewInstancesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.SetLabelsInstanceRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.SetLabels(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleInstancesClient_SetMachineResources() { + ctx := context.Background() + c, err := compute.NewInstancesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.SetMachineResourcesInstanceRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.SetMachineResources(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleInstancesClient_SetMachineType() { + ctx := context.Background() + c, err := compute.NewInstancesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.SetMachineTypeInstanceRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.SetMachineType(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleInstancesClient_SetMetadata() { + ctx := context.Background() + c, err := compute.NewInstancesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.SetMetadataInstanceRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.SetMetadata(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleInstancesClient_SetMinCpuPlatform() { + ctx := context.Background() + c, err := compute.NewInstancesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.SetMinCpuPlatformInstanceRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.SetMinCpuPlatform(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleInstancesClient_SetScheduling() { + ctx := context.Background() + c, err := compute.NewInstancesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.SetSchedulingInstanceRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.SetScheduling(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleInstancesClient_SetServiceAccount() { + ctx := context.Background() + c, err := compute.NewInstancesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.SetServiceAccountInstanceRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.SetServiceAccount(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleInstancesClient_SetShieldedInstanceIntegrityPolicy() { + ctx := context.Background() + c, err := compute.NewInstancesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.SetShieldedInstanceIntegrityPolicyInstanceRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.SetShieldedInstanceIntegrityPolicy(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleInstancesClient_SetTags() { + ctx := context.Background() + c, err := compute.NewInstancesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.SetTagsInstanceRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.SetTags(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleInstancesClient_SimulateMaintenanceEvent() { + ctx := context.Background() + c, err := compute.NewInstancesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.SimulateMaintenanceEventInstanceRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.SimulateMaintenanceEvent(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleInstancesClient_Start() { + ctx := context.Background() + c, err := compute.NewInstancesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.StartInstanceRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Start(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleInstancesClient_StartWithEncryptionKey() { + ctx := context.Background() + c, err := compute.NewInstancesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.StartWithEncryptionKeyInstanceRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.StartWithEncryptionKey(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleInstancesClient_Stop() { + ctx := context.Background() + c, err := compute.NewInstancesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.StopInstanceRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Stop(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleInstancesClient_TestIamPermissions() { + ctx := context.Background() + c, err := compute.NewInstancesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.TestIamPermissionsInstanceRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.TestIamPermissions(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleInstancesClient_Update() { + ctx := context.Background() + c, err := compute.NewInstancesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.UpdateInstanceRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Update(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleInstancesClient_UpdateAccessConfig() { + ctx := context.Background() + c, err := compute.NewInstancesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.UpdateAccessConfigInstanceRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.UpdateAccessConfig(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleInstancesClient_UpdateDisplayDevice() { + ctx := context.Background() + c, err := compute.NewInstancesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.UpdateDisplayDeviceInstanceRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.UpdateDisplayDevice(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleInstancesClient_UpdateNetworkInterface() { + ctx := context.Background() + c, err := compute.NewInstancesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.UpdateNetworkInterfaceInstanceRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.UpdateNetworkInterface(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleInstancesClient_UpdateShieldedInstanceConfig() { + ctx := context.Background() + c, err := compute.NewInstancesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.UpdateShieldedInstanceConfigInstanceRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.UpdateShieldedInstanceConfig(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} diff --git a/compute/apiv1/interconnect_attachments_client.go b/compute/apiv1/interconnect_attachments_client.go new file mode 100644 index 00000000000..017f933fde0 --- /dev/null +++ b/compute/apiv1/interconnect_attachments_client.go @@ -0,0 +1,513 @@ +// Copyright 2021 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/ioutil" + "net/http" + "net/url" + + gax "github.com/googleapis/gax-go/v2" + "google.golang.org/api/option" + "google.golang.org/api/option/internaloption" + httptransport "google.golang.org/api/transport/http" + computepb "google.golang.org/genproto/googleapis/cloud/compute/v1" + "google.golang.org/grpc" + "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/encoding/protojson" +) + +var newInterconnectAttachmentsClientHook clientHook + +// InterconnectAttachmentsCallOptions contains the retry settings for each method of InterconnectAttachmentsClient. +type InterconnectAttachmentsCallOptions struct { + AggregatedList []gax.CallOption + Delete []gax.CallOption + Get []gax.CallOption + Insert []gax.CallOption + List []gax.CallOption + Patch []gax.CallOption +} + +// internalInterconnectAttachmentsClient is an interface that defines the methods availaible from Google Compute Engine API. +type internalInterconnectAttachmentsClient interface { + Close() error + setGoogleClientInfo(...string) + Connection() *grpc.ClientConn + AggregatedList(context.Context, *computepb.AggregatedListInterconnectAttachmentsRequest, ...gax.CallOption) (*computepb.InterconnectAttachmentAggregatedList, error) + Delete(context.Context, *computepb.DeleteInterconnectAttachmentRequest, ...gax.CallOption) (*computepb.Operation, error) + Get(context.Context, *computepb.GetInterconnectAttachmentRequest, ...gax.CallOption) (*computepb.InterconnectAttachment, error) + Insert(context.Context, *computepb.InsertInterconnectAttachmentRequest, ...gax.CallOption) (*computepb.Operation, error) + List(context.Context, *computepb.ListInterconnectAttachmentsRequest, ...gax.CallOption) (*computepb.InterconnectAttachmentList, error) + Patch(context.Context, *computepb.PatchInterconnectAttachmentRequest, ...gax.CallOption) (*computepb.Operation, error) +} + +// InterconnectAttachmentsClient 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 InterconnectAttachments API. +type InterconnectAttachmentsClient struct { + // The internal transport-dependent client. + internalClient internalInterconnectAttachmentsClient + + // The call options for this service. + CallOptions *InterconnectAttachmentsCallOptions +} + +// 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 *InterconnectAttachmentsClient) 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 *InterconnectAttachmentsClient) setGoogleClientInfo(keyval ...string) { + c.internalClient.setGoogleClientInfo(keyval...) +} + +// Connection returns a connection to the API service. +// +// Deprecated. +func (c *InterconnectAttachmentsClient) Connection() *grpc.ClientConn { + return c.internalClient.Connection() +} + +// AggregatedList retrieves an aggregated list of interconnect attachments. +func (c *InterconnectAttachmentsClient) AggregatedList(ctx context.Context, req *computepb.AggregatedListInterconnectAttachmentsRequest, opts ...gax.CallOption) (*computepb.InterconnectAttachmentAggregatedList, error) { + return c.internalClient.AggregatedList(ctx, req, opts...) +} + +// Delete deletes the specified interconnect attachment. +func (c *InterconnectAttachmentsClient) Delete(ctx context.Context, req *computepb.DeleteInterconnectAttachmentRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.Delete(ctx, req, opts...) +} + +// Get returns the specified interconnect attachment. +func (c *InterconnectAttachmentsClient) Get(ctx context.Context, req *computepb.GetInterconnectAttachmentRequest, opts ...gax.CallOption) (*computepb.InterconnectAttachment, error) { + return c.internalClient.Get(ctx, req, opts...) +} + +// Insert creates an InterconnectAttachment in the specified project using the data included in the request. +func (c *InterconnectAttachmentsClient) Insert(ctx context.Context, req *computepb.InsertInterconnectAttachmentRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.Insert(ctx, req, opts...) +} + +// List retrieves the list of interconnect attachments contained within the specified region. +func (c *InterconnectAttachmentsClient) List(ctx context.Context, req *computepb.ListInterconnectAttachmentsRequest, opts ...gax.CallOption) (*computepb.InterconnectAttachmentList, error) { + return c.internalClient.List(ctx, req, opts...) +} + +// Patch updates the specified interconnect attachment with the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. +func (c *InterconnectAttachmentsClient) Patch(ctx context.Context, req *computepb.PatchInterconnectAttachmentRequest, opts ...gax.CallOption) (*computepb.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 interconnectAttachmentsRESTClient struct { + // The http endpoint to connect to. + endpoint string + + // The http client. + httpClient *http.Client + + // The x-goog-* metadata to be sent with each request. + xGoogMetadata metadata.MD +} + +// NewInterconnectAttachmentsRESTClient creates a new interconnect attachments rest client. +// +// The InterconnectAttachments API. +func NewInterconnectAttachmentsRESTClient(ctx context.Context, opts ...option.ClientOption) (*InterconnectAttachmentsClient, error) { + clientOpts := append(defaultInterconnectAttachmentsRESTClientOptions(), opts...) + httpClient, endpoint, err := httptransport.NewClient(ctx, clientOpts...) + if err != nil { + return nil, err + } + + c := &interconnectAttachmentsRESTClient{ + endpoint: endpoint, + httpClient: httpClient, + } + c.setGoogleClientInfo() + + return &InterconnectAttachmentsClient{internalClient: c, CallOptions: &InterconnectAttachmentsCallOptions{}}, nil +} + +func defaultInterconnectAttachmentsRESTClientOptions() []option.ClientOption { + return []option.ClientOption{ + internaloption.WithDefaultEndpoint("compute.googleapis.com"), + internaloption.WithDefaultMTLSEndpoint("compute.mtls.googleapis.com"), + internaloption.WithDefaultAudience("https://compute.googleapis.com/"), + internaloption.WithDefaultScopes(DefaultAuthScopes()...), + } +} + +// setGoogleClientInfo sets the name and version of the application in +// the `x-goog-api-client` header passed on each request. Intended for +// use by Google-written clients. +func (c *interconnectAttachmentsRESTClient) setGoogleClientInfo(keyval ...string) { + kv := append([]string{"gl-go", versionGo()}, keyval...) + kv = append(kv, "gapic", versionClient, "gax", gax.Version, "rest", "UNKNOWN") + c.xGoogMetadata = metadata.Pairs("x-goog-api-client", gax.XGoogHeader(kv...)) +} + +// Close closes the connection to the API service. The user should invoke this when +// the client is no longer required. +func (c *interconnectAttachmentsRESTClient) Close() error { + // Replace httpClient with nil to force cleanup. + c.httpClient = nil + return nil +} + +// Connection returns a connection to the API service. +// +// Deprecated. +func (c *interconnectAttachmentsRESTClient) Connection() *grpc.ClientConn { + return nil +} + +// AggregatedList retrieves an aggregated list of interconnect attachments. +func (c *interconnectAttachmentsRESTClient) AggregatedList(ctx context.Context, req *computepb.AggregatedListInterconnectAttachmentsRequest, opts ...gax.CallOption) (*computepb.InterconnectAttachmentAggregatedList, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/aggregated/interconnectAttachments", req.GetProject()) + + params := url.Values{} + if req != nil && req.Filter != nil { + params.Add("filter", fmt.Sprintf("%v", req.GetFilter())) + } + if req != nil && req.IncludeAllScopes != nil { + params.Add("includeAllScopes", fmt.Sprintf("%v", req.GetIncludeAllScopes())) + } + 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() + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.InterconnectAttachmentAggregatedList{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Delete deletes the specified interconnect attachment. +func (c *interconnectAttachmentsRESTClient) Delete(ctx context.Context, req *computepb.DeleteInterconnectAttachmentRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/interconnectAttachments/%v", req.GetProject(), req.GetRegion(), req.GetInterconnectAttachment()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("DELETE", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Get returns the specified interconnect attachment. +func (c *interconnectAttachmentsRESTClient) Get(ctx context.Context, req *computepb.GetInterconnectAttachmentRequest, opts ...gax.CallOption) (*computepb.InterconnectAttachment, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/interconnectAttachments/%v", req.GetProject(), req.GetRegion(), req.GetInterconnectAttachment()) + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.InterconnectAttachment{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Insert creates an InterconnectAttachment in the specified project using the data included in the request. +func (c *interconnectAttachmentsRESTClient) Insert(ctx context.Context, req *computepb.InsertInterconnectAttachmentRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetInterconnectAttachmentResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/interconnectAttachments", req.GetProject(), req.GetRegion()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + if req != nil && req.ValidateOnly != nil { + params.Add("validateOnly", fmt.Sprintf("%v", req.GetValidateOnly())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// List retrieves the list of interconnect attachments contained within the specified region. +func (c *interconnectAttachmentsRESTClient) List(ctx context.Context, req *computepb.ListInterconnectAttachmentsRequest, opts ...gax.CallOption) (*computepb.InterconnectAttachmentList, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/interconnectAttachments", 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() + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.InterconnectAttachmentList{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Patch updates the specified interconnect attachment with the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. +func (c *interconnectAttachmentsRESTClient) Patch(ctx context.Context, req *computepb.PatchInterconnectAttachmentRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetInterconnectAttachmentResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/interconnectAttachments/%v", req.GetProject(), req.GetRegion(), req.GetInterconnectAttachment()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("PATCH", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} diff --git a/compute/apiv1/interconnect_attachments_client_example_test.go b/compute/apiv1/interconnect_attachments_client_example_test.go new file mode 100644 index 00000000000..0f480c1a58a --- /dev/null +++ b/compute/apiv1/interconnect_attachments_client_example_test.go @@ -0,0 +1,150 @@ +// Copyright 2021 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_test + +import ( + "context" + + compute "cloud.google.com/go/compute/apiv1" + computepb "google.golang.org/genproto/googleapis/cloud/compute/v1" +) + +func ExampleNewInterconnectAttachmentsRESTClient() { + ctx := context.Background() + c, err := compute.NewInterconnectAttachmentsRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + // TODO: Use client. + _ = c +} + +func ExampleInterconnectAttachmentsClient_AggregatedList() { + ctx := context.Background() + c, err := compute.NewInterconnectAttachmentsRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.AggregatedListInterconnectAttachmentsRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.AggregatedList(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleInterconnectAttachmentsClient_Delete() { + ctx := context.Background() + c, err := compute.NewInterconnectAttachmentsRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.DeleteInterconnectAttachmentRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Delete(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleInterconnectAttachmentsClient_Get() { + ctx := context.Background() + c, err := compute.NewInterconnectAttachmentsRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.GetInterconnectAttachmentRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Get(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleInterconnectAttachmentsClient_Insert() { + ctx := context.Background() + c, err := compute.NewInterconnectAttachmentsRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.InsertInterconnectAttachmentRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Insert(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleInterconnectAttachmentsClient_List() { + ctx := context.Background() + c, err := compute.NewInterconnectAttachmentsRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.ListInterconnectAttachmentsRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.List(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleInterconnectAttachmentsClient_Patch() { + ctx := context.Background() + c, err := compute.NewInterconnectAttachmentsRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.PatchInterconnectAttachmentRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Patch(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} diff --git a/compute/apiv1/interconnect_locations_client.go b/compute/apiv1/interconnect_locations_client.go new file mode 100644 index 00000000000..cf535f106e4 --- /dev/null +++ b/compute/apiv1/interconnect_locations_client.go @@ -0,0 +1,265 @@ +// Copyright 2021 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/ioutil" + "net/http" + "net/url" + + gax "github.com/googleapis/gax-go/v2" + "google.golang.org/api/option" + "google.golang.org/api/option/internaloption" + httptransport "google.golang.org/api/transport/http" + computepb "google.golang.org/genproto/googleapis/cloud/compute/v1" + "google.golang.org/grpc" + "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/encoding/protojson" +) + +var newInterconnectLocationsClientHook clientHook + +// InterconnectLocationsCallOptions contains the retry settings for each method of InterconnectLocationsClient. +type InterconnectLocationsCallOptions struct { + Get []gax.CallOption + List []gax.CallOption +} + +// internalInterconnectLocationsClient is an interface that defines the methods availaible from Google Compute Engine API. +type internalInterconnectLocationsClient interface { + Close() error + setGoogleClientInfo(...string) + Connection() *grpc.ClientConn + Get(context.Context, *computepb.GetInterconnectLocationRequest, ...gax.CallOption) (*computepb.InterconnectLocation, error) + List(context.Context, *computepb.ListInterconnectLocationsRequest, ...gax.CallOption) (*computepb.InterconnectLocationList, error) +} + +// InterconnectLocationsClient 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 InterconnectLocations API. +type InterconnectLocationsClient struct { + // The internal transport-dependent client. + internalClient internalInterconnectLocationsClient + + // The call options for this service. + CallOptions *InterconnectLocationsCallOptions +} + +// 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 *InterconnectLocationsClient) 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 *InterconnectLocationsClient) setGoogleClientInfo(keyval ...string) { + c.internalClient.setGoogleClientInfo(keyval...) +} + +// Connection returns a connection to the API service. +// +// Deprecated. +func (c *InterconnectLocationsClient) Connection() *grpc.ClientConn { + return c.internalClient.Connection() +} + +// Get returns the details for the specified interconnect location. Gets a list of available interconnect locations by making a list() request. +func (c *InterconnectLocationsClient) Get(ctx context.Context, req *computepb.GetInterconnectLocationRequest, opts ...gax.CallOption) (*computepb.InterconnectLocation, error) { + return c.internalClient.Get(ctx, req, opts...) +} + +// List retrieves the list of interconnect locations available to the specified project. +func (c *InterconnectLocationsClient) List(ctx context.Context, req *computepb.ListInterconnectLocationsRequest, opts ...gax.CallOption) (*computepb.InterconnectLocationList, error) { + return c.internalClient.List(ctx, req, opts...) +} + +// Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls. +type interconnectLocationsRESTClient struct { + // The http endpoint to connect to. + endpoint string + + // The http client. + httpClient *http.Client + + // The x-goog-* metadata to be sent with each request. + xGoogMetadata metadata.MD +} + +// NewInterconnectLocationsRESTClient creates a new interconnect locations rest client. +// +// The InterconnectLocations API. +func NewInterconnectLocationsRESTClient(ctx context.Context, opts ...option.ClientOption) (*InterconnectLocationsClient, error) { + clientOpts := append(defaultInterconnectLocationsRESTClientOptions(), opts...) + httpClient, endpoint, err := httptransport.NewClient(ctx, clientOpts...) + if err != nil { + return nil, err + } + + c := &interconnectLocationsRESTClient{ + endpoint: endpoint, + httpClient: httpClient, + } + c.setGoogleClientInfo() + + return &InterconnectLocationsClient{internalClient: c, CallOptions: &InterconnectLocationsCallOptions{}}, nil +} + +func defaultInterconnectLocationsRESTClientOptions() []option.ClientOption { + return []option.ClientOption{ + internaloption.WithDefaultEndpoint("compute.googleapis.com"), + internaloption.WithDefaultMTLSEndpoint("compute.mtls.googleapis.com"), + internaloption.WithDefaultAudience("https://compute.googleapis.com/"), + internaloption.WithDefaultScopes(DefaultAuthScopes()...), + } +} + +// setGoogleClientInfo sets the name and version of the application in +// the `x-goog-api-client` header passed on each request. Intended for +// use by Google-written clients. +func (c *interconnectLocationsRESTClient) setGoogleClientInfo(keyval ...string) { + kv := append([]string{"gl-go", versionGo()}, keyval...) + kv = append(kv, "gapic", versionClient, "gax", gax.Version, "rest", "UNKNOWN") + c.xGoogMetadata = metadata.Pairs("x-goog-api-client", gax.XGoogHeader(kv...)) +} + +// Close closes the connection to the API service. The user should invoke this when +// the client is no longer required. +func (c *interconnectLocationsRESTClient) Close() error { + // Replace httpClient with nil to force cleanup. + c.httpClient = nil + return nil +} + +// Connection returns a connection to the API service. +// +// Deprecated. +func (c *interconnectLocationsRESTClient) Connection() *grpc.ClientConn { + return nil +} + +// Get returns the details for the specified interconnect location. Gets a list of available interconnect locations by making a list() request. +func (c *interconnectLocationsRESTClient) Get(ctx context.Context, req *computepb.GetInterconnectLocationRequest, opts ...gax.CallOption) (*computepb.InterconnectLocation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/global/interconnectLocations/%v", req.GetProject(), req.GetInterconnectLocation()) + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.InterconnectLocation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// List retrieves the list of interconnect locations available to the specified project. +func (c *interconnectLocationsRESTClient) List(ctx context.Context, req *computepb.ListInterconnectLocationsRequest, opts ...gax.CallOption) (*computepb.InterconnectLocationList, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/global/interconnectLocations", 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() + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.InterconnectLocationList{} + + return rsp, unm.Unmarshal(buf, rsp) +} diff --git a/compute/apiv1/interconnect_locations_client_example_test.go b/compute/apiv1/interconnect_locations_client_example_test.go new file mode 100644 index 00000000000..2c48d43fbb8 --- /dev/null +++ b/compute/apiv1/interconnect_locations_client_example_test.go @@ -0,0 +1,74 @@ +// Copyright 2021 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_test + +import ( + "context" + + compute "cloud.google.com/go/compute/apiv1" + computepb "google.golang.org/genproto/googleapis/cloud/compute/v1" +) + +func ExampleNewInterconnectLocationsRESTClient() { + ctx := context.Background() + c, err := compute.NewInterconnectLocationsRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + // TODO: Use client. + _ = c +} + +func ExampleInterconnectLocationsClient_Get() { + ctx := context.Background() + c, err := compute.NewInterconnectLocationsRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.GetInterconnectLocationRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Get(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleInterconnectLocationsClient_List() { + ctx := context.Background() + c, err := compute.NewInterconnectLocationsRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.ListInterconnectLocationsRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.List(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} diff --git a/compute/apiv1/interconnects_client.go b/compute/apiv1/interconnects_client.go new file mode 100644 index 00000000000..26fa2f16ccb --- /dev/null +++ b/compute/apiv1/interconnects_client.go @@ -0,0 +1,488 @@ +// Copyright 2021 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/ioutil" + "net/http" + "net/url" + + gax "github.com/googleapis/gax-go/v2" + "google.golang.org/api/option" + "google.golang.org/api/option/internaloption" + httptransport "google.golang.org/api/transport/http" + computepb "google.golang.org/genproto/googleapis/cloud/compute/v1" + "google.golang.org/grpc" + "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/encoding/protojson" +) + +var newInterconnectsClientHook clientHook + +// InterconnectsCallOptions contains the retry settings for each method of InterconnectsClient. +type InterconnectsCallOptions struct { + Delete []gax.CallOption + Get []gax.CallOption + GetDiagnostics []gax.CallOption + Insert []gax.CallOption + List []gax.CallOption + Patch []gax.CallOption +} + +// internalInterconnectsClient is an interface that defines the methods availaible from Google Compute Engine API. +type internalInterconnectsClient interface { + Close() error + setGoogleClientInfo(...string) + Connection() *grpc.ClientConn + Delete(context.Context, *computepb.DeleteInterconnectRequest, ...gax.CallOption) (*computepb.Operation, error) + Get(context.Context, *computepb.GetInterconnectRequest, ...gax.CallOption) (*computepb.Interconnect, error) + GetDiagnostics(context.Context, *computepb.GetDiagnosticsInterconnectRequest, ...gax.CallOption) (*computepb.InterconnectsGetDiagnosticsResponse, error) + Insert(context.Context, *computepb.InsertInterconnectRequest, ...gax.CallOption) (*computepb.Operation, error) + List(context.Context, *computepb.ListInterconnectsRequest, ...gax.CallOption) (*computepb.InterconnectList, error) + Patch(context.Context, *computepb.PatchInterconnectRequest, ...gax.CallOption) (*computepb.Operation, error) +} + +// InterconnectsClient 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 Interconnects API. +type InterconnectsClient struct { + // The internal transport-dependent client. + internalClient internalInterconnectsClient + + // The call options for this service. + CallOptions *InterconnectsCallOptions +} + +// 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 *InterconnectsClient) 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 *InterconnectsClient) setGoogleClientInfo(keyval ...string) { + c.internalClient.setGoogleClientInfo(keyval...) +} + +// Connection returns a connection to the API service. +// +// Deprecated. +func (c *InterconnectsClient) Connection() *grpc.ClientConn { + return c.internalClient.Connection() +} + +// Delete deletes the specified interconnect. +func (c *InterconnectsClient) Delete(ctx context.Context, req *computepb.DeleteInterconnectRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.Delete(ctx, req, opts...) +} + +// Get returns the specified interconnect. Get a list of available interconnects by making a list() request. +func (c *InterconnectsClient) Get(ctx context.Context, req *computepb.GetInterconnectRequest, opts ...gax.CallOption) (*computepb.Interconnect, error) { + return c.internalClient.Get(ctx, req, opts...) +} + +// GetDiagnostics returns the interconnectDiagnostics for the specified interconnect. +func (c *InterconnectsClient) GetDiagnostics(ctx context.Context, req *computepb.GetDiagnosticsInterconnectRequest, opts ...gax.CallOption) (*computepb.InterconnectsGetDiagnosticsResponse, error) { + return c.internalClient.GetDiagnostics(ctx, req, opts...) +} + +// Insert creates a 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) (*computepb.Operation, error) { + return c.internalClient.Insert(ctx, req, opts...) +} + +// List retrieves the list of interconnect available to the specified project. +func (c *InterconnectsClient) List(ctx context.Context, req *computepb.ListInterconnectsRequest, opts ...gax.CallOption) (*computepb.InterconnectList, error) { + return c.internalClient.List(ctx, req, opts...) +} + +// Patch updates the specified interconnect with the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. +func (c *InterconnectsClient) Patch(ctx context.Context, req *computepb.PatchInterconnectRequest, opts ...gax.CallOption) (*computepb.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 interconnectsRESTClient struct { + // The http endpoint to connect to. + endpoint string + + // The http client. + httpClient *http.Client + + // The x-goog-* metadata to be sent with each request. + xGoogMetadata metadata.MD +} + +// NewInterconnectsRESTClient creates a new interconnects rest client. +// +// The Interconnects API. +func NewInterconnectsRESTClient(ctx context.Context, opts ...option.ClientOption) (*InterconnectsClient, error) { + clientOpts := append(defaultInterconnectsRESTClientOptions(), opts...) + httpClient, endpoint, err := httptransport.NewClient(ctx, clientOpts...) + if err != nil { + return nil, err + } + + c := &interconnectsRESTClient{ + endpoint: endpoint, + httpClient: httpClient, + } + c.setGoogleClientInfo() + + return &InterconnectsClient{internalClient: c, CallOptions: &InterconnectsCallOptions{}}, nil +} + +func defaultInterconnectsRESTClientOptions() []option.ClientOption { + return []option.ClientOption{ + internaloption.WithDefaultEndpoint("compute.googleapis.com"), + internaloption.WithDefaultMTLSEndpoint("compute.mtls.googleapis.com"), + internaloption.WithDefaultAudience("https://compute.googleapis.com/"), + internaloption.WithDefaultScopes(DefaultAuthScopes()...), + } +} + +// setGoogleClientInfo sets the name and version of the application in +// the `x-goog-api-client` header passed on each request. Intended for +// use by Google-written clients. +func (c *interconnectsRESTClient) setGoogleClientInfo(keyval ...string) { + kv := append([]string{"gl-go", versionGo()}, keyval...) + kv = append(kv, "gapic", versionClient, "gax", gax.Version, "rest", "UNKNOWN") + c.xGoogMetadata = metadata.Pairs("x-goog-api-client", gax.XGoogHeader(kv...)) +} + +// Close closes the connection to the API service. The user should invoke this when +// the client is no longer required. +func (c *interconnectsRESTClient) Close() error { + // Replace httpClient with nil to force cleanup. + c.httpClient = nil + return nil +} + +// Connection returns a connection to the API service. +// +// Deprecated. +func (c *interconnectsRESTClient) Connection() *grpc.ClientConn { + return nil +} + +// Delete deletes the specified interconnect. +func (c *interconnectsRESTClient) Delete(ctx context.Context, req *computepb.DeleteInterconnectRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/global/interconnects/%v", req.GetProject(), req.GetInterconnect()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("DELETE", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Get returns the specified interconnect. Get a list of available interconnects by making a list() request. +func (c *interconnectsRESTClient) Get(ctx context.Context, req *computepb.GetInterconnectRequest, opts ...gax.CallOption) (*computepb.Interconnect, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/global/interconnects/%v", req.GetProject(), req.GetInterconnect()) + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Interconnect{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// GetDiagnostics returns the interconnectDiagnostics for the specified interconnect. +func (c *interconnectsRESTClient) GetDiagnostics(ctx context.Context, req *computepb.GetDiagnosticsInterconnectRequest, opts ...gax.CallOption) (*computepb.InterconnectsGetDiagnosticsResponse, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/global/interconnects/%v/getDiagnostics", req.GetProject(), req.GetInterconnect()) + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.InterconnectsGetDiagnosticsResponse{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Insert creates a 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) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetInterconnectResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/global/interconnects", req.GetProject()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// List retrieves the list of interconnect available to the specified project. +func (c *interconnectsRESTClient) List(ctx context.Context, req *computepb.ListInterconnectsRequest, opts ...gax.CallOption) (*computepb.InterconnectList, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/global/interconnects", 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() + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.InterconnectList{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Patch updates the specified interconnect with the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. +func (c *interconnectsRESTClient) Patch(ctx context.Context, req *computepb.PatchInterconnectRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetInterconnectResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/global/interconnects/%v", req.GetProject(), req.GetInterconnect()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("PATCH", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} diff --git a/compute/apiv1/interconnects_client_example_test.go b/compute/apiv1/interconnects_client_example_test.go new file mode 100644 index 00000000000..dca1482656b --- /dev/null +++ b/compute/apiv1/interconnects_client_example_test.go @@ -0,0 +1,150 @@ +// Copyright 2021 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_test + +import ( + "context" + + compute "cloud.google.com/go/compute/apiv1" + computepb "google.golang.org/genproto/googleapis/cloud/compute/v1" +) + +func ExampleNewInterconnectsRESTClient() { + ctx := context.Background() + c, err := compute.NewInterconnectsRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + // TODO: Use client. + _ = c +} + +func ExampleInterconnectsClient_Delete() { + ctx := context.Background() + c, err := compute.NewInterconnectsRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.DeleteInterconnectRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Delete(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleInterconnectsClient_Get() { + ctx := context.Background() + c, err := compute.NewInterconnectsRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.GetInterconnectRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Get(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleInterconnectsClient_GetDiagnostics() { + ctx := context.Background() + c, err := compute.NewInterconnectsRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.GetDiagnosticsInterconnectRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.GetDiagnostics(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleInterconnectsClient_Insert() { + ctx := context.Background() + c, err := compute.NewInterconnectsRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.InsertInterconnectRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Insert(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleInterconnectsClient_List() { + ctx := context.Background() + c, err := compute.NewInterconnectsRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.ListInterconnectsRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.List(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleInterconnectsClient_Patch() { + ctx := context.Background() + c, err := compute.NewInterconnectsRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.PatchInterconnectRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Patch(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} diff --git a/compute/apiv1/license_codes_client.go b/compute/apiv1/license_codes_client.go new file mode 100644 index 00000000000..b87bb61e79e --- /dev/null +++ b/compute/apiv1/license_codes_client.go @@ -0,0 +1,247 @@ +// Copyright 2021 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/ioutil" + "net/http" + "net/url" + + gax "github.com/googleapis/gax-go/v2" + "google.golang.org/api/option" + "google.golang.org/api/option/internaloption" + httptransport "google.golang.org/api/transport/http" + computepb "google.golang.org/genproto/googleapis/cloud/compute/v1" + "google.golang.org/grpc" + "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/encoding/protojson" +) + +var newLicenseCodesClientHook clientHook + +// LicenseCodesCallOptions contains the retry settings for each method of LicenseCodesClient. +type LicenseCodesCallOptions struct { + Get []gax.CallOption + TestIamPermissions []gax.CallOption +} + +// internalLicenseCodesClient is an interface that defines the methods availaible from Google Compute Engine API. +type internalLicenseCodesClient interface { + Close() error + setGoogleClientInfo(...string) + Connection() *grpc.ClientConn + Get(context.Context, *computepb.GetLicenseCodeRequest, ...gax.CallOption) (*computepb.LicenseCode, error) + TestIamPermissions(context.Context, *computepb.TestIamPermissionsLicenseCodeRequest, ...gax.CallOption) (*computepb.TestPermissionsResponse, error) +} + +// LicenseCodesClient 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 LicenseCodes API. +type LicenseCodesClient struct { + // The internal transport-dependent client. + internalClient internalLicenseCodesClient + + // The call options for this service. + CallOptions *LicenseCodesCallOptions +} + +// 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 *LicenseCodesClient) 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 *LicenseCodesClient) setGoogleClientInfo(keyval ...string) { + c.internalClient.setGoogleClientInfo(keyval...) +} + +// Connection returns a connection to the API service. +// +// Deprecated. +func (c *LicenseCodesClient) Connection() *grpc.ClientConn { + return c.internalClient.Connection() +} + +// Get return a specified license code. License codes are mirrored across all projects that have permissions to read the License Code. Caution This resource is intended for use only by third-party partners who are creating Cloud Marketplace images. +func (c *LicenseCodesClient) Get(ctx context.Context, req *computepb.GetLicenseCodeRequest, opts ...gax.CallOption) (*computepb.LicenseCode, error) { + return c.internalClient.Get(ctx, req, opts...) +} + +// TestIamPermissions returns permissions that a caller has on the specified resource. Caution This resource is intended for use only by third-party partners who are creating Cloud Marketplace images. +func (c *LicenseCodesClient) TestIamPermissions(ctx context.Context, req *computepb.TestIamPermissionsLicenseCodeRequest, opts ...gax.CallOption) (*computepb.TestPermissionsResponse, error) { + return c.internalClient.TestIamPermissions(ctx, req, opts...) +} + +// Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls. +type licenseCodesRESTClient struct { + // The http endpoint to connect to. + endpoint string + + // The http client. + httpClient *http.Client + + // The x-goog-* metadata to be sent with each request. + xGoogMetadata metadata.MD +} + +// NewLicenseCodesRESTClient creates a new license codes rest client. +// +// The LicenseCodes API. +func NewLicenseCodesRESTClient(ctx context.Context, opts ...option.ClientOption) (*LicenseCodesClient, error) { + clientOpts := append(defaultLicenseCodesRESTClientOptions(), opts...) + httpClient, endpoint, err := httptransport.NewClient(ctx, clientOpts...) + if err != nil { + return nil, err + } + + c := &licenseCodesRESTClient{ + endpoint: endpoint, + httpClient: httpClient, + } + c.setGoogleClientInfo() + + return &LicenseCodesClient{internalClient: c, CallOptions: &LicenseCodesCallOptions{}}, nil +} + +func defaultLicenseCodesRESTClientOptions() []option.ClientOption { + return []option.ClientOption{ + internaloption.WithDefaultEndpoint("compute.googleapis.com"), + internaloption.WithDefaultMTLSEndpoint("compute.mtls.googleapis.com"), + internaloption.WithDefaultAudience("https://compute.googleapis.com/"), + internaloption.WithDefaultScopes(DefaultAuthScopes()...), + } +} + +// setGoogleClientInfo sets the name and version of the application in +// the `x-goog-api-client` header passed on each request. Intended for +// use by Google-written clients. +func (c *licenseCodesRESTClient) setGoogleClientInfo(keyval ...string) { + kv := append([]string{"gl-go", versionGo()}, keyval...) + kv = append(kv, "gapic", versionClient, "gax", gax.Version, "rest", "UNKNOWN") + c.xGoogMetadata = metadata.Pairs("x-goog-api-client", gax.XGoogHeader(kv...)) +} + +// Close closes the connection to the API service. The user should invoke this when +// the client is no longer required. +func (c *licenseCodesRESTClient) Close() error { + // Replace httpClient with nil to force cleanup. + c.httpClient = nil + return nil +} + +// Connection returns a connection to the API service. +// +// Deprecated. +func (c *licenseCodesRESTClient) Connection() *grpc.ClientConn { + return nil +} + +// Get return a specified license code. License codes are mirrored across all projects that have permissions to read the License Code. Caution This resource is intended for use only by third-party partners who are creating Cloud Marketplace images. +func (c *licenseCodesRESTClient) Get(ctx context.Context, req *computepb.GetLicenseCodeRequest, opts ...gax.CallOption) (*computepb.LicenseCode, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/global/licenseCodes/%v", req.GetProject(), req.GetLicenseCode()) + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.LicenseCode{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// TestIamPermissions returns permissions that a caller has on the specified resource. Caution This resource is intended for use only by third-party partners who are creating Cloud Marketplace images. +func (c *licenseCodesRESTClient) TestIamPermissions(ctx context.Context, req *computepb.TestIamPermissionsLicenseCodeRequest, opts ...gax.CallOption) (*computepb.TestPermissionsResponse, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetTestPermissionsRequestResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/global/licenseCodes/%v/testIamPermissions", req.GetProject(), req.GetResource()) + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.TestPermissionsResponse{} + + return rsp, unm.Unmarshal(buf, rsp) +} diff --git a/compute/apiv1/license_codes_client_example_test.go b/compute/apiv1/license_codes_client_example_test.go new file mode 100644 index 00000000000..a0b54d391df --- /dev/null +++ b/compute/apiv1/license_codes_client_example_test.go @@ -0,0 +1,74 @@ +// Copyright 2021 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_test + +import ( + "context" + + compute "cloud.google.com/go/compute/apiv1" + computepb "google.golang.org/genproto/googleapis/cloud/compute/v1" +) + +func ExampleNewLicenseCodesRESTClient() { + ctx := context.Background() + c, err := compute.NewLicenseCodesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + // TODO: Use client. + _ = c +} + +func ExampleLicenseCodesClient_Get() { + ctx := context.Background() + c, err := compute.NewLicenseCodesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.GetLicenseCodeRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Get(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleLicenseCodesClient_TestIamPermissions() { + ctx := context.Background() + c, err := compute.NewLicenseCodesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.TestIamPermissionsLicenseCodeRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.TestIamPermissions(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} diff --git a/compute/apiv1/licenses_client.go b/compute/apiv1/licenses_client.go new file mode 100644 index 00000000000..f2f2ed9c292 --- /dev/null +++ b/compute/apiv1/licenses_client.go @@ -0,0 +1,539 @@ +// Copyright 2021 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/ioutil" + "net/http" + "net/url" + + gax "github.com/googleapis/gax-go/v2" + "google.golang.org/api/option" + "google.golang.org/api/option/internaloption" + httptransport "google.golang.org/api/transport/http" + computepb "google.golang.org/genproto/googleapis/cloud/compute/v1" + "google.golang.org/grpc" + "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/encoding/protojson" +) + +var newLicensesClientHook clientHook + +// LicensesCallOptions contains the retry settings for each method of LicensesClient. +type LicensesCallOptions struct { + Delete []gax.CallOption + Get []gax.CallOption + GetIamPolicy []gax.CallOption + Insert []gax.CallOption + List []gax.CallOption + SetIamPolicy []gax.CallOption + TestIamPermissions []gax.CallOption +} + +// internalLicensesClient is an interface that defines the methods availaible from Google Compute Engine API. +type internalLicensesClient interface { + Close() error + setGoogleClientInfo(...string) + Connection() *grpc.ClientConn + Delete(context.Context, *computepb.DeleteLicenseRequest, ...gax.CallOption) (*computepb.Operation, error) + Get(context.Context, *computepb.GetLicenseRequest, ...gax.CallOption) (*computepb.License, error) + GetIamPolicy(context.Context, *computepb.GetIamPolicyLicenseRequest, ...gax.CallOption) (*computepb.Policy, error) + Insert(context.Context, *computepb.InsertLicenseRequest, ...gax.CallOption) (*computepb.Operation, error) + List(context.Context, *computepb.ListLicensesRequest, ...gax.CallOption) (*computepb.LicensesListResponse, error) + SetIamPolicy(context.Context, *computepb.SetIamPolicyLicenseRequest, ...gax.CallOption) (*computepb.Policy, error) + TestIamPermissions(context.Context, *computepb.TestIamPermissionsLicenseRequest, ...gax.CallOption) (*computepb.TestPermissionsResponse, error) +} + +// LicensesClient 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 Licenses API. +type LicensesClient struct { + // The internal transport-dependent client. + internalClient internalLicensesClient + + // The call options for this service. + CallOptions *LicensesCallOptions +} + +// 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 *LicensesClient) 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 *LicensesClient) setGoogleClientInfo(keyval ...string) { + c.internalClient.setGoogleClientInfo(keyval...) +} + +// Connection returns a connection to the API service. +// +// Deprecated. +func (c *LicensesClient) Connection() *grpc.ClientConn { + return c.internalClient.Connection() +} + +// Delete deletes the specified license. Caution This resource is intended for use only by third-party partners who are creating Cloud Marketplace images. +func (c *LicensesClient) Delete(ctx context.Context, req *computepb.DeleteLicenseRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.Delete(ctx, req, opts...) +} + +// Get returns the specified License resource. Caution This resource is intended for use only by third-party partners who are creating Cloud Marketplace images. +func (c *LicensesClient) Get(ctx context.Context, req *computepb.GetLicenseRequest, opts ...gax.CallOption) (*computepb.License, error) { + 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. Caution This resource is intended for use only by third-party partners who are creating Cloud Marketplace images. +func (c *LicensesClient) GetIamPolicy(ctx context.Context, req *computepb.GetIamPolicyLicenseRequest, opts ...gax.CallOption) (*computepb.Policy, error) { + return c.internalClient.GetIamPolicy(ctx, req, opts...) +} + +// Insert create a License resource in the specified project. Caution This resource is intended for use only by third-party partners who are creating Cloud Marketplace images. +func (c *LicensesClient) Insert(ctx context.Context, req *computepb.InsertLicenseRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.Insert(ctx, req, opts...) +} + +// List retrieves the list of licenses available in the specified project. This method does not get any licenses that belong to other projects, including licenses attached to publicly-available images, like Debian 9. If you want to get a list of publicly-available licenses, use this method to make a request to the respective image project, such as debian-cloud or windows-cloud. Caution This resource is intended for use only by third-party partners who are creating Cloud Marketplace images. +func (c *LicensesClient) List(ctx context.Context, req *computepb.ListLicensesRequest, opts ...gax.CallOption) (*computepb.LicensesListResponse, error) { + return c.internalClient.List(ctx, req, opts...) +} + +// SetIamPolicy sets the access control policy on the specified resource. Replaces any existing policy. Caution This resource is intended for use only by third-party partners who are creating Cloud Marketplace images. +func (c *LicensesClient) SetIamPolicy(ctx context.Context, req *computepb.SetIamPolicyLicenseRequest, opts ...gax.CallOption) (*computepb.Policy, error) { + return c.internalClient.SetIamPolicy(ctx, req, opts...) +} + +// TestIamPermissions returns permissions that a caller has on the specified resource. Caution This resource is intended for use only by third-party partners who are creating Cloud Marketplace images. +func (c *LicensesClient) TestIamPermissions(ctx context.Context, req *computepb.TestIamPermissionsLicenseRequest, opts ...gax.CallOption) (*computepb.TestPermissionsResponse, error) { + return c.internalClient.TestIamPermissions(ctx, req, opts...) +} + +// Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls. +type licensesRESTClient struct { + // The http endpoint to connect to. + endpoint string + + // The http client. + httpClient *http.Client + + // The x-goog-* metadata to be sent with each request. + xGoogMetadata metadata.MD +} + +// NewLicensesRESTClient creates a new licenses rest client. +// +// The Licenses API. +func NewLicensesRESTClient(ctx context.Context, opts ...option.ClientOption) (*LicensesClient, error) { + clientOpts := append(defaultLicensesRESTClientOptions(), opts...) + httpClient, endpoint, err := httptransport.NewClient(ctx, clientOpts...) + if err != nil { + return nil, err + } + + c := &licensesRESTClient{ + endpoint: endpoint, + httpClient: httpClient, + } + c.setGoogleClientInfo() + + return &LicensesClient{internalClient: c, CallOptions: &LicensesCallOptions{}}, nil +} + +func defaultLicensesRESTClientOptions() []option.ClientOption { + return []option.ClientOption{ + internaloption.WithDefaultEndpoint("compute.googleapis.com"), + internaloption.WithDefaultMTLSEndpoint("compute.mtls.googleapis.com"), + internaloption.WithDefaultAudience("https://compute.googleapis.com/"), + internaloption.WithDefaultScopes(DefaultAuthScopes()...), + } +} + +// setGoogleClientInfo sets the name and version of the application in +// the `x-goog-api-client` header passed on each request. Intended for +// use by Google-written clients. +func (c *licensesRESTClient) setGoogleClientInfo(keyval ...string) { + kv := append([]string{"gl-go", versionGo()}, keyval...) + kv = append(kv, "gapic", versionClient, "gax", gax.Version, "rest", "UNKNOWN") + c.xGoogMetadata = metadata.Pairs("x-goog-api-client", gax.XGoogHeader(kv...)) +} + +// Close closes the connection to the API service. The user should invoke this when +// the client is no longer required. +func (c *licensesRESTClient) Close() error { + // Replace httpClient with nil to force cleanup. + c.httpClient = nil + return nil +} + +// Connection returns a connection to the API service. +// +// Deprecated. +func (c *licensesRESTClient) Connection() *grpc.ClientConn { + return nil +} + +// Delete deletes the specified license. Caution This resource is intended for use only by third-party partners who are creating Cloud Marketplace images. +func (c *licensesRESTClient) Delete(ctx context.Context, req *computepb.DeleteLicenseRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/global/licenses/%v", req.GetProject(), req.GetLicense()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("DELETE", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Get returns the specified License resource. Caution This resource is intended for use only by third-party partners who are creating Cloud Marketplace images. +func (c *licensesRESTClient) Get(ctx context.Context, req *computepb.GetLicenseRequest, opts ...gax.CallOption) (*computepb.License, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/global/licenses/%v", req.GetProject(), req.GetLicense()) + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.License{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// GetIamPolicy gets the access control policy for a resource. May be empty if no such policy or resource exists. Caution This resource is intended for use only by third-party partners who are creating Cloud Marketplace images. +func (c *licensesRESTClient) GetIamPolicy(ctx context.Context, req *computepb.GetIamPolicyLicenseRequest, opts ...gax.CallOption) (*computepb.Policy, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/global/licenses/%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() + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Policy{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Insert create a License resource in the specified project. Caution This resource is intended for use only by third-party partners who are creating Cloud Marketplace images. +func (c *licensesRESTClient) Insert(ctx context.Context, req *computepb.InsertLicenseRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetLicenseResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/global/licenses", req.GetProject()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// List retrieves the list of licenses available in the specified project. This method does not get any licenses that belong to other projects, including licenses attached to publicly-available images, like Debian 9. If you want to get a list of publicly-available licenses, use this method to make a request to the respective image project, such as debian-cloud or windows-cloud. Caution This resource is intended for use only by third-party partners who are creating Cloud Marketplace images. +func (c *licensesRESTClient) List(ctx context.Context, req *computepb.ListLicensesRequest, opts ...gax.CallOption) (*computepb.LicensesListResponse, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/global/licenses", 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() + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.LicensesListResponse{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// SetIamPolicy sets the access control policy on the specified resource. Replaces any existing policy. Caution This resource is intended for use only by third-party partners who are creating Cloud Marketplace images. +func (c *licensesRESTClient) SetIamPolicy(ctx context.Context, req *computepb.SetIamPolicyLicenseRequest, opts ...gax.CallOption) (*computepb.Policy, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetGlobalSetPolicyRequestResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/global/licenses/%v/setIamPolicy", req.GetProject(), req.GetResource()) + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Policy{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// TestIamPermissions returns permissions that a caller has on the specified resource. Caution This resource is intended for use only by third-party partners who are creating Cloud Marketplace images. +func (c *licensesRESTClient) TestIamPermissions(ctx context.Context, req *computepb.TestIamPermissionsLicenseRequest, opts ...gax.CallOption) (*computepb.TestPermissionsResponse, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetTestPermissionsRequestResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/global/licenses/%v/testIamPermissions", req.GetProject(), req.GetResource()) + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.TestPermissionsResponse{} + + return rsp, unm.Unmarshal(buf, rsp) +} diff --git a/compute/apiv1/licenses_client_example_test.go b/compute/apiv1/licenses_client_example_test.go new file mode 100644 index 00000000000..82f80b1944f --- /dev/null +++ b/compute/apiv1/licenses_client_example_test.go @@ -0,0 +1,169 @@ +// Copyright 2021 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_test + +import ( + "context" + + compute "cloud.google.com/go/compute/apiv1" + computepb "google.golang.org/genproto/googleapis/cloud/compute/v1" +) + +func ExampleNewLicensesRESTClient() { + ctx := context.Background() + c, err := compute.NewLicensesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + // TODO: Use client. + _ = c +} + +func ExampleLicensesClient_Delete() { + ctx := context.Background() + c, err := compute.NewLicensesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.DeleteLicenseRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Delete(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleLicensesClient_Get() { + ctx := context.Background() + c, err := compute.NewLicensesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.GetLicenseRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Get(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleLicensesClient_GetIamPolicy() { + ctx := context.Background() + c, err := compute.NewLicensesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.GetIamPolicyLicenseRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.GetIamPolicy(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleLicensesClient_Insert() { + ctx := context.Background() + c, err := compute.NewLicensesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.InsertLicenseRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Insert(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleLicensesClient_List() { + ctx := context.Background() + c, err := compute.NewLicensesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.ListLicensesRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.List(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleLicensesClient_SetIamPolicy() { + ctx := context.Background() + c, err := compute.NewLicensesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.SetIamPolicyLicenseRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.SetIamPolicy(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleLicensesClient_TestIamPermissions() { + ctx := context.Background() + c, err := compute.NewLicensesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.TestIamPermissionsLicenseRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.TestIamPermissions(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} diff --git a/compute/apiv1/machine_types_client.go b/compute/apiv1/machine_types_client.go new file mode 100644 index 00000000000..b888cabec5b --- /dev/null +++ b/compute/apiv1/machine_types_client.go @@ -0,0 +1,337 @@ +// Copyright 2021 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/ioutil" + "net/http" + "net/url" + + gax "github.com/googleapis/gax-go/v2" + "google.golang.org/api/option" + "google.golang.org/api/option/internaloption" + httptransport "google.golang.org/api/transport/http" + computepb "google.golang.org/genproto/googleapis/cloud/compute/v1" + "google.golang.org/grpc" + "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/encoding/protojson" +) + +var newMachineTypesClientHook clientHook + +// MachineTypesCallOptions contains the retry settings for each method of MachineTypesClient. +type MachineTypesCallOptions struct { + AggregatedList []gax.CallOption + Get []gax.CallOption + List []gax.CallOption +} + +// internalMachineTypesClient is an interface that defines the methods availaible from Google Compute Engine API. +type internalMachineTypesClient interface { + Close() error + setGoogleClientInfo(...string) + Connection() *grpc.ClientConn + AggregatedList(context.Context, *computepb.AggregatedListMachineTypesRequest, ...gax.CallOption) (*computepb.MachineTypeAggregatedList, error) + Get(context.Context, *computepb.GetMachineTypeRequest, ...gax.CallOption) (*computepb.MachineType, error) + List(context.Context, *computepb.ListMachineTypesRequest, ...gax.CallOption) (*computepb.MachineTypeList, error) +} + +// MachineTypesClient 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 MachineTypes API. +type MachineTypesClient struct { + // The internal transport-dependent client. + internalClient internalMachineTypesClient + + // The call options for this service. + CallOptions *MachineTypesCallOptions +} + +// 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 *MachineTypesClient) 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 *MachineTypesClient) setGoogleClientInfo(keyval ...string) { + c.internalClient.setGoogleClientInfo(keyval...) +} + +// Connection returns a connection to the API service. +// +// Deprecated. +func (c *MachineTypesClient) Connection() *grpc.ClientConn { + return c.internalClient.Connection() +} + +// AggregatedList retrieves an aggregated list of machine types. +func (c *MachineTypesClient) AggregatedList(ctx context.Context, req *computepb.AggregatedListMachineTypesRequest, opts ...gax.CallOption) (*computepb.MachineTypeAggregatedList, error) { + return c.internalClient.AggregatedList(ctx, req, opts...) +} + +// Get returns the specified machine type. Gets a list of available machine types by making a list() request. +func (c *MachineTypesClient) Get(ctx context.Context, req *computepb.GetMachineTypeRequest, opts ...gax.CallOption) (*computepb.MachineType, error) { + return c.internalClient.Get(ctx, req, opts...) +} + +// List retrieves a list of machine types available to the specified project. +func (c *MachineTypesClient) List(ctx context.Context, req *computepb.ListMachineTypesRequest, opts ...gax.CallOption) (*computepb.MachineTypeList, error) { + return c.internalClient.List(ctx, req, opts...) +} + +// Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls. +type machineTypesRESTClient struct { + // The http endpoint to connect to. + endpoint string + + // The http client. + httpClient *http.Client + + // The x-goog-* metadata to be sent with each request. + xGoogMetadata metadata.MD +} + +// NewMachineTypesRESTClient creates a new machine types rest client. +// +// The MachineTypes API. +func NewMachineTypesRESTClient(ctx context.Context, opts ...option.ClientOption) (*MachineTypesClient, error) { + clientOpts := append(defaultMachineTypesRESTClientOptions(), opts...) + httpClient, endpoint, err := httptransport.NewClient(ctx, clientOpts...) + if err != nil { + return nil, err + } + + c := &machineTypesRESTClient{ + endpoint: endpoint, + httpClient: httpClient, + } + c.setGoogleClientInfo() + + return &MachineTypesClient{internalClient: c, CallOptions: &MachineTypesCallOptions{}}, nil +} + +func defaultMachineTypesRESTClientOptions() []option.ClientOption { + return []option.ClientOption{ + internaloption.WithDefaultEndpoint("compute.googleapis.com"), + internaloption.WithDefaultMTLSEndpoint("compute.mtls.googleapis.com"), + internaloption.WithDefaultAudience("https://compute.googleapis.com/"), + internaloption.WithDefaultScopes(DefaultAuthScopes()...), + } +} + +// setGoogleClientInfo sets the name and version of the application in +// the `x-goog-api-client` header passed on each request. Intended for +// use by Google-written clients. +func (c *machineTypesRESTClient) setGoogleClientInfo(keyval ...string) { + kv := append([]string{"gl-go", versionGo()}, keyval...) + kv = append(kv, "gapic", versionClient, "gax", gax.Version, "rest", "UNKNOWN") + c.xGoogMetadata = metadata.Pairs("x-goog-api-client", gax.XGoogHeader(kv...)) +} + +// Close closes the connection to the API service. The user should invoke this when +// the client is no longer required. +func (c *machineTypesRESTClient) Close() error { + // Replace httpClient with nil to force cleanup. + c.httpClient = nil + return nil +} + +// Connection returns a connection to the API service. +// +// Deprecated. +func (c *machineTypesRESTClient) Connection() *grpc.ClientConn { + return nil +} + +// AggregatedList retrieves an aggregated list of machine types. +func (c *machineTypesRESTClient) AggregatedList(ctx context.Context, req *computepb.AggregatedListMachineTypesRequest, opts ...gax.CallOption) (*computepb.MachineTypeAggregatedList, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/aggregated/machineTypes", req.GetProject()) + + params := url.Values{} + if req != nil && req.Filter != nil { + params.Add("filter", fmt.Sprintf("%v", req.GetFilter())) + } + if req != nil && req.IncludeAllScopes != nil { + params.Add("includeAllScopes", fmt.Sprintf("%v", req.GetIncludeAllScopes())) + } + 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() + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.MachineTypeAggregatedList{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Get returns the specified machine type. Gets a list of available machine types by making a list() request. +func (c *machineTypesRESTClient) Get(ctx context.Context, req *computepb.GetMachineTypeRequest, opts ...gax.CallOption) (*computepb.MachineType, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/zones/%v/machineTypes/%v", req.GetProject(), req.GetZone(), req.GetMachineType()) + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.MachineType{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// List retrieves a list of machine types available to the specified project. +func (c *machineTypesRESTClient) List(ctx context.Context, req *computepb.ListMachineTypesRequest, opts ...gax.CallOption) (*computepb.MachineTypeList, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/zones/%v/machineTypes", req.GetProject(), req.GetZone()) + + 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() + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.MachineTypeList{} + + return rsp, unm.Unmarshal(buf, rsp) +} diff --git a/compute/apiv1/machine_types_client_example_test.go b/compute/apiv1/machine_types_client_example_test.go new file mode 100644 index 00000000000..858b4032b5c --- /dev/null +++ b/compute/apiv1/machine_types_client_example_test.go @@ -0,0 +1,93 @@ +// Copyright 2021 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_test + +import ( + "context" + + compute "cloud.google.com/go/compute/apiv1" + computepb "google.golang.org/genproto/googleapis/cloud/compute/v1" +) + +func ExampleNewMachineTypesRESTClient() { + ctx := context.Background() + c, err := compute.NewMachineTypesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + // TODO: Use client. + _ = c +} + +func ExampleMachineTypesClient_AggregatedList() { + ctx := context.Background() + c, err := compute.NewMachineTypesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.AggregatedListMachineTypesRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.AggregatedList(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleMachineTypesClient_Get() { + ctx := context.Background() + c, err := compute.NewMachineTypesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.GetMachineTypeRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Get(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleMachineTypesClient_List() { + ctx := context.Background() + c, err := compute.NewMachineTypesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.ListMachineTypesRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.List(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} diff --git a/compute/apiv1/network_endpoint_groups_client.go b/compute/apiv1/network_endpoint_groups_client.go new file mode 100644 index 00000000000..f9da210d93a --- /dev/null +++ b/compute/apiv1/network_endpoint_groups_client.go @@ -0,0 +1,689 @@ +// Copyright 2021 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/ioutil" + "net/http" + "net/url" + + gax "github.com/googleapis/gax-go/v2" + "google.golang.org/api/option" + "google.golang.org/api/option/internaloption" + httptransport "google.golang.org/api/transport/http" + computepb "google.golang.org/genproto/googleapis/cloud/compute/v1" + "google.golang.org/grpc" + "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/encoding/protojson" +) + +var newNetworkEndpointGroupsClientHook clientHook + +// NetworkEndpointGroupsCallOptions contains the retry settings for each method of NetworkEndpointGroupsClient. +type NetworkEndpointGroupsCallOptions struct { + AggregatedList []gax.CallOption + AttachNetworkEndpoints []gax.CallOption + Delete []gax.CallOption + DetachNetworkEndpoints []gax.CallOption + Get []gax.CallOption + Insert []gax.CallOption + List []gax.CallOption + ListNetworkEndpoints []gax.CallOption + TestIamPermissions []gax.CallOption +} + +// internalNetworkEndpointGroupsClient is an interface that defines the methods availaible from Google Compute Engine API. +type internalNetworkEndpointGroupsClient interface { + Close() error + setGoogleClientInfo(...string) + Connection() *grpc.ClientConn + AggregatedList(context.Context, *computepb.AggregatedListNetworkEndpointGroupsRequest, ...gax.CallOption) (*computepb.NetworkEndpointGroupAggregatedList, error) + AttachNetworkEndpoints(context.Context, *computepb.AttachNetworkEndpointsNetworkEndpointGroupRequest, ...gax.CallOption) (*computepb.Operation, error) + Delete(context.Context, *computepb.DeleteNetworkEndpointGroupRequest, ...gax.CallOption) (*computepb.Operation, error) + DetachNetworkEndpoints(context.Context, *computepb.DetachNetworkEndpointsNetworkEndpointGroupRequest, ...gax.CallOption) (*computepb.Operation, error) + Get(context.Context, *computepb.GetNetworkEndpointGroupRequest, ...gax.CallOption) (*computepb.NetworkEndpointGroup, error) + Insert(context.Context, *computepb.InsertNetworkEndpointGroupRequest, ...gax.CallOption) (*computepb.Operation, error) + List(context.Context, *computepb.ListNetworkEndpointGroupsRequest, ...gax.CallOption) (*computepb.NetworkEndpointGroupList, error) + ListNetworkEndpoints(context.Context, *computepb.ListNetworkEndpointsNetworkEndpointGroupsRequest, ...gax.CallOption) (*computepb.NetworkEndpointGroupsListNetworkEndpoints, error) + TestIamPermissions(context.Context, *computepb.TestIamPermissionsNetworkEndpointGroupRequest, ...gax.CallOption) (*computepb.TestPermissionsResponse, error) +} + +// NetworkEndpointGroupsClient 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 NetworkEndpointGroups API. +type NetworkEndpointGroupsClient struct { + // The internal transport-dependent client. + internalClient internalNetworkEndpointGroupsClient + + // The call options for this service. + CallOptions *NetworkEndpointGroupsCallOptions +} + +// 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 *NetworkEndpointGroupsClient) 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 *NetworkEndpointGroupsClient) setGoogleClientInfo(keyval ...string) { + c.internalClient.setGoogleClientInfo(keyval...) +} + +// Connection returns a connection to the API service. +// +// Deprecated. +func (c *NetworkEndpointGroupsClient) Connection() *grpc.ClientConn { + return c.internalClient.Connection() +} + +// AggregatedList retrieves the list of network endpoint groups and sorts them by zone. +func (c *NetworkEndpointGroupsClient) AggregatedList(ctx context.Context, req *computepb.AggregatedListNetworkEndpointGroupsRequest, opts ...gax.CallOption) (*computepb.NetworkEndpointGroupAggregatedList, error) { + return c.internalClient.AggregatedList(ctx, req, opts...) +} + +// AttachNetworkEndpoints attach a list of network endpoints to the specified network endpoint group. +func (c *NetworkEndpointGroupsClient) AttachNetworkEndpoints(ctx context.Context, req *computepb.AttachNetworkEndpointsNetworkEndpointGroupRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.AttachNetworkEndpoints(ctx, req, opts...) +} + +// Delete deletes the specified network endpoint group. The network endpoints in the NEG and the VM instances they belong to are not terminated when the NEG is deleted. Note that the NEG cannot be deleted if there are backend services referencing it. +func (c *NetworkEndpointGroupsClient) Delete(ctx context.Context, req *computepb.DeleteNetworkEndpointGroupRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.Delete(ctx, req, opts...) +} + +// DetachNetworkEndpoints detach a list of network endpoints from the specified network endpoint group. +func (c *NetworkEndpointGroupsClient) DetachNetworkEndpoints(ctx context.Context, req *computepb.DetachNetworkEndpointsNetworkEndpointGroupRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.DetachNetworkEndpoints(ctx, req, opts...) +} + +// Get returns the specified network endpoint group. Gets a list of available network endpoint groups by making a list() request. +func (c *NetworkEndpointGroupsClient) Get(ctx context.Context, req *computepb.GetNetworkEndpointGroupRequest, opts ...gax.CallOption) (*computepb.NetworkEndpointGroup, error) { + return c.internalClient.Get(ctx, req, opts...) +} + +// Insert creates a network endpoint group in the specified project using the parameters that are included in the request. +func (c *NetworkEndpointGroupsClient) Insert(ctx context.Context, req *computepb.InsertNetworkEndpointGroupRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.Insert(ctx, req, opts...) +} + +// List retrieves the list of network endpoint groups that are located in the specified project and zone. +func (c *NetworkEndpointGroupsClient) List(ctx context.Context, req *computepb.ListNetworkEndpointGroupsRequest, opts ...gax.CallOption) (*computepb.NetworkEndpointGroupList, error) { + return c.internalClient.List(ctx, req, opts...) +} + +// ListNetworkEndpoints lists the network endpoints in the specified network endpoint group. +func (c *NetworkEndpointGroupsClient) ListNetworkEndpoints(ctx context.Context, req *computepb.ListNetworkEndpointsNetworkEndpointGroupsRequest, opts ...gax.CallOption) (*computepb.NetworkEndpointGroupsListNetworkEndpoints, error) { + return c.internalClient.ListNetworkEndpoints(ctx, req, opts...) +} + +// TestIamPermissions returns permissions that a caller has on the specified resource. +func (c *NetworkEndpointGroupsClient) TestIamPermissions(ctx context.Context, req *computepb.TestIamPermissionsNetworkEndpointGroupRequest, opts ...gax.CallOption) (*computepb.TestPermissionsResponse, error) { + return c.internalClient.TestIamPermissions(ctx, req, opts...) +} + +// Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls. +type networkEndpointGroupsRESTClient struct { + // The http endpoint to connect to. + endpoint string + + // The http client. + httpClient *http.Client + + // The x-goog-* metadata to be sent with each request. + xGoogMetadata metadata.MD +} + +// NewNetworkEndpointGroupsRESTClient creates a new network endpoint groups rest client. +// +// The NetworkEndpointGroups API. +func NewNetworkEndpointGroupsRESTClient(ctx context.Context, opts ...option.ClientOption) (*NetworkEndpointGroupsClient, error) { + clientOpts := append(defaultNetworkEndpointGroupsRESTClientOptions(), opts...) + httpClient, endpoint, err := httptransport.NewClient(ctx, clientOpts...) + if err != nil { + return nil, err + } + + c := &networkEndpointGroupsRESTClient{ + endpoint: endpoint, + httpClient: httpClient, + } + c.setGoogleClientInfo() + + return &NetworkEndpointGroupsClient{internalClient: c, CallOptions: &NetworkEndpointGroupsCallOptions{}}, nil +} + +func defaultNetworkEndpointGroupsRESTClientOptions() []option.ClientOption { + return []option.ClientOption{ + internaloption.WithDefaultEndpoint("compute.googleapis.com"), + internaloption.WithDefaultMTLSEndpoint("compute.mtls.googleapis.com"), + internaloption.WithDefaultAudience("https://compute.googleapis.com/"), + internaloption.WithDefaultScopes(DefaultAuthScopes()...), + } +} + +// setGoogleClientInfo sets the name and version of the application in +// the `x-goog-api-client` header passed on each request. Intended for +// use by Google-written clients. +func (c *networkEndpointGroupsRESTClient) setGoogleClientInfo(keyval ...string) { + kv := append([]string{"gl-go", versionGo()}, keyval...) + kv = append(kv, "gapic", versionClient, "gax", gax.Version, "rest", "UNKNOWN") + c.xGoogMetadata = metadata.Pairs("x-goog-api-client", gax.XGoogHeader(kv...)) +} + +// Close closes the connection to the API service. The user should invoke this when +// the client is no longer required. +func (c *networkEndpointGroupsRESTClient) Close() error { + // Replace httpClient with nil to force cleanup. + c.httpClient = nil + return nil +} + +// Connection returns a connection to the API service. +// +// Deprecated. +func (c *networkEndpointGroupsRESTClient) Connection() *grpc.ClientConn { + return nil +} + +// AggregatedList retrieves the list of network endpoint groups and sorts them by zone. +func (c *networkEndpointGroupsRESTClient) AggregatedList(ctx context.Context, req *computepb.AggregatedListNetworkEndpointGroupsRequest, opts ...gax.CallOption) (*computepb.NetworkEndpointGroupAggregatedList, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/aggregated/networkEndpointGroups", req.GetProject()) + + params := url.Values{} + if req != nil && req.Filter != nil { + params.Add("filter", fmt.Sprintf("%v", req.GetFilter())) + } + if req != nil && req.IncludeAllScopes != nil { + params.Add("includeAllScopes", fmt.Sprintf("%v", req.GetIncludeAllScopes())) + } + 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() + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.NetworkEndpointGroupAggregatedList{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// AttachNetworkEndpoints attach a list of network endpoints to the specified network endpoint group. +func (c *networkEndpointGroupsRESTClient) AttachNetworkEndpoints(ctx context.Context, req *computepb.AttachNetworkEndpointsNetworkEndpointGroupRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetNetworkEndpointGroupsAttachEndpointsRequestResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/zones/%v/networkEndpointGroups/%v/attachNetworkEndpoints", req.GetProject(), req.GetZone(), req.GetNetworkEndpointGroup()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Delete deletes the specified network endpoint group. The network endpoints in the NEG and the VM instances they belong to are not terminated when the NEG is deleted. Note that the NEG cannot be deleted if there are backend services referencing it. +func (c *networkEndpointGroupsRESTClient) Delete(ctx context.Context, req *computepb.DeleteNetworkEndpointGroupRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/zones/%v/networkEndpointGroups/%v", req.GetProject(), req.GetZone(), req.GetNetworkEndpointGroup()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("DELETE", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// DetachNetworkEndpoints detach a list of network endpoints from the specified network endpoint group. +func (c *networkEndpointGroupsRESTClient) DetachNetworkEndpoints(ctx context.Context, req *computepb.DetachNetworkEndpointsNetworkEndpointGroupRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetNetworkEndpointGroupsDetachEndpointsRequestResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/zones/%v/networkEndpointGroups/%v/detachNetworkEndpoints", req.GetProject(), req.GetZone(), req.GetNetworkEndpointGroup()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Get returns the specified network endpoint group. Gets a list of available network endpoint groups by making a list() request. +func (c *networkEndpointGroupsRESTClient) Get(ctx context.Context, req *computepb.GetNetworkEndpointGroupRequest, opts ...gax.CallOption) (*computepb.NetworkEndpointGroup, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/zones/%v/networkEndpointGroups/%v", req.GetProject(), req.GetZone(), req.GetNetworkEndpointGroup()) + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.NetworkEndpointGroup{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Insert creates a network endpoint group in the specified project using the parameters that are included in the request. +func (c *networkEndpointGroupsRESTClient) Insert(ctx context.Context, req *computepb.InsertNetworkEndpointGroupRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetNetworkEndpointGroupResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/zones/%v/networkEndpointGroups", req.GetProject(), req.GetZone()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// List retrieves the list of network endpoint groups that are located in the specified project and zone. +func (c *networkEndpointGroupsRESTClient) List(ctx context.Context, req *computepb.ListNetworkEndpointGroupsRequest, opts ...gax.CallOption) (*computepb.NetworkEndpointGroupList, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/zones/%v/networkEndpointGroups", req.GetProject(), req.GetZone()) + + 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() + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.NetworkEndpointGroupList{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// ListNetworkEndpoints lists the network endpoints in the specified network endpoint group. +func (c *networkEndpointGroupsRESTClient) ListNetworkEndpoints(ctx context.Context, req *computepb.ListNetworkEndpointsNetworkEndpointGroupsRequest, opts ...gax.CallOption) (*computepb.NetworkEndpointGroupsListNetworkEndpoints, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetNetworkEndpointGroupsListEndpointsRequestResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/zones/%v/networkEndpointGroups/%v/listNetworkEndpoints", req.GetProject(), req.GetZone(), 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() + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.NetworkEndpointGroupsListNetworkEndpoints{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// TestIamPermissions returns permissions that a caller has on the specified resource. +func (c *networkEndpointGroupsRESTClient) TestIamPermissions(ctx context.Context, req *computepb.TestIamPermissionsNetworkEndpointGroupRequest, opts ...gax.CallOption) (*computepb.TestPermissionsResponse, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetTestPermissionsRequestResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/zones/%v/networkEndpointGroups/%v/testIamPermissions", req.GetProject(), req.GetZone(), req.GetResource()) + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.TestPermissionsResponse{} + + return rsp, unm.Unmarshal(buf, rsp) +} diff --git a/compute/apiv1/network_endpoint_groups_client_example_test.go b/compute/apiv1/network_endpoint_groups_client_example_test.go new file mode 100644 index 00000000000..5c370298c7a --- /dev/null +++ b/compute/apiv1/network_endpoint_groups_client_example_test.go @@ -0,0 +1,207 @@ +// Copyright 2021 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_test + +import ( + "context" + + compute "cloud.google.com/go/compute/apiv1" + computepb "google.golang.org/genproto/googleapis/cloud/compute/v1" +) + +func ExampleNewNetworkEndpointGroupsRESTClient() { + ctx := context.Background() + c, err := compute.NewNetworkEndpointGroupsRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + // TODO: Use client. + _ = c +} + +func ExampleNetworkEndpointGroupsClient_AggregatedList() { + ctx := context.Background() + c, err := compute.NewNetworkEndpointGroupsRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.AggregatedListNetworkEndpointGroupsRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.AggregatedList(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleNetworkEndpointGroupsClient_AttachNetworkEndpoints() { + ctx := context.Background() + c, err := compute.NewNetworkEndpointGroupsRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.AttachNetworkEndpointsNetworkEndpointGroupRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.AttachNetworkEndpoints(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleNetworkEndpointGroupsClient_Delete() { + ctx := context.Background() + c, err := compute.NewNetworkEndpointGroupsRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.DeleteNetworkEndpointGroupRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Delete(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleNetworkEndpointGroupsClient_DetachNetworkEndpoints() { + ctx := context.Background() + c, err := compute.NewNetworkEndpointGroupsRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.DetachNetworkEndpointsNetworkEndpointGroupRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.DetachNetworkEndpoints(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleNetworkEndpointGroupsClient_Get() { + ctx := context.Background() + c, err := compute.NewNetworkEndpointGroupsRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.GetNetworkEndpointGroupRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Get(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleNetworkEndpointGroupsClient_Insert() { + ctx := context.Background() + c, err := compute.NewNetworkEndpointGroupsRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.InsertNetworkEndpointGroupRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Insert(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleNetworkEndpointGroupsClient_List() { + ctx := context.Background() + c, err := compute.NewNetworkEndpointGroupsRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.ListNetworkEndpointGroupsRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.List(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleNetworkEndpointGroupsClient_ListNetworkEndpoints() { + ctx := context.Background() + c, err := compute.NewNetworkEndpointGroupsRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.ListNetworkEndpointsNetworkEndpointGroupsRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.ListNetworkEndpoints(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleNetworkEndpointGroupsClient_TestIamPermissions() { + ctx := context.Background() + c, err := compute.NewNetworkEndpointGroupsRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.TestIamPermissionsNetworkEndpointGroupRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.TestIamPermissions(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} diff --git a/compute/apiv1/networks_client.go b/compute/apiv1/networks_client.go new file mode 100644 index 00000000000..432e0e8047f --- /dev/null +++ b/compute/apiv1/networks_client.go @@ -0,0 +1,797 @@ +// Copyright 2021 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/ioutil" + "net/http" + "net/url" + + gax "github.com/googleapis/gax-go/v2" + "google.golang.org/api/option" + "google.golang.org/api/option/internaloption" + httptransport "google.golang.org/api/transport/http" + computepb "google.golang.org/genproto/googleapis/cloud/compute/v1" + "google.golang.org/grpc" + "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/encoding/protojson" +) + +var newNetworksClientHook clientHook + +// NetworksCallOptions contains the retry settings for each method of NetworksClient. +type NetworksCallOptions struct { + AddPeering []gax.CallOption + Delete []gax.CallOption + Get []gax.CallOption + GetEffectiveFirewalls []gax.CallOption + Insert []gax.CallOption + List []gax.CallOption + ListPeeringRoutes []gax.CallOption + Patch []gax.CallOption + RemovePeering []gax.CallOption + SwitchToCustomMode []gax.CallOption + UpdatePeering []gax.CallOption +} + +// internalNetworksClient is an interface that defines the methods availaible from Google Compute Engine API. +type internalNetworksClient interface { + Close() error + setGoogleClientInfo(...string) + Connection() *grpc.ClientConn + AddPeering(context.Context, *computepb.AddPeeringNetworkRequest, ...gax.CallOption) (*computepb.Operation, error) + Delete(context.Context, *computepb.DeleteNetworkRequest, ...gax.CallOption) (*computepb.Operation, error) + Get(context.Context, *computepb.GetNetworkRequest, ...gax.CallOption) (*computepb.Network, error) + GetEffectiveFirewalls(context.Context, *computepb.GetEffectiveFirewallsNetworkRequest, ...gax.CallOption) (*computepb.NetworksGetEffectiveFirewallsResponse, error) + Insert(context.Context, *computepb.InsertNetworkRequest, ...gax.CallOption) (*computepb.Operation, error) + List(context.Context, *computepb.ListNetworksRequest, ...gax.CallOption) (*computepb.NetworkList, error) + ListPeeringRoutes(context.Context, *computepb.ListPeeringRoutesNetworksRequest, ...gax.CallOption) (*computepb.ExchangedPeeringRoutesList, error) + Patch(context.Context, *computepb.PatchNetworkRequest, ...gax.CallOption) (*computepb.Operation, error) + RemovePeering(context.Context, *computepb.RemovePeeringNetworkRequest, ...gax.CallOption) (*computepb.Operation, error) + SwitchToCustomMode(context.Context, *computepb.SwitchToCustomModeNetworkRequest, ...gax.CallOption) (*computepb.Operation, error) + UpdatePeering(context.Context, *computepb.UpdatePeeringNetworkRequest, ...gax.CallOption) (*computepb.Operation, error) +} + +// NetworksClient 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 Networks API. +type NetworksClient struct { + // The internal transport-dependent client. + internalClient internalNetworksClient + + // The call options for this service. + CallOptions *NetworksCallOptions +} + +// 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 *NetworksClient) 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 *NetworksClient) setGoogleClientInfo(keyval ...string) { + c.internalClient.setGoogleClientInfo(keyval...) +} + +// Connection returns a connection to the API service. +// +// Deprecated. +func (c *NetworksClient) Connection() *grpc.ClientConn { + return c.internalClient.Connection() +} + +// AddPeering adds a peering to the specified network. +func (c *NetworksClient) AddPeering(ctx context.Context, req *computepb.AddPeeringNetworkRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.AddPeering(ctx, req, opts...) +} + +// Delete deletes the specified network. +func (c *NetworksClient) Delete(ctx context.Context, req *computepb.DeleteNetworkRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.Delete(ctx, req, opts...) +} + +// Get returns the specified network. Gets a list of available networks by making a list() request. +func (c *NetworksClient) Get(ctx context.Context, req *computepb.GetNetworkRequest, opts ...gax.CallOption) (*computepb.Network, error) { + return c.internalClient.Get(ctx, req, opts...) +} + +// GetEffectiveFirewalls returns the effective firewalls on a given network. +func (c *NetworksClient) GetEffectiveFirewalls(ctx context.Context, req *computepb.GetEffectiveFirewallsNetworkRequest, opts ...gax.CallOption) (*computepb.NetworksGetEffectiveFirewallsResponse, error) { + return c.internalClient.GetEffectiveFirewalls(ctx, req, opts...) +} + +// Insert creates a network in the specified project using the data included in the request. +func (c *NetworksClient) Insert(ctx context.Context, req *computepb.InsertNetworkRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.Insert(ctx, req, opts...) +} + +// List retrieves the list of networks available to the specified project. +func (c *NetworksClient) List(ctx context.Context, req *computepb.ListNetworksRequest, opts ...gax.CallOption) (*computepb.NetworkList, error) { + return c.internalClient.List(ctx, req, opts...) +} + +// ListPeeringRoutes lists the peering routes exchanged over peering connection. +func (c *NetworksClient) ListPeeringRoutes(ctx context.Context, req *computepb.ListPeeringRoutesNetworksRequest, opts ...gax.CallOption) (*computepb.ExchangedPeeringRoutesList, error) { + return c.internalClient.ListPeeringRoutes(ctx, req, opts...) +} + +// Patch patches the specified network with the data included in the request. Only the following fields can be modified: routingConfig.routingMode. +func (c *NetworksClient) Patch(ctx context.Context, req *computepb.PatchNetworkRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.Patch(ctx, req, opts...) +} + +// RemovePeering removes a peering from the specified network. +func (c *NetworksClient) RemovePeering(ctx context.Context, req *computepb.RemovePeeringNetworkRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.RemovePeering(ctx, req, opts...) +} + +// SwitchToCustomMode switches the network mode from auto subnet mode to custom subnet mode. +func (c *NetworksClient) SwitchToCustomMode(ctx context.Context, req *computepb.SwitchToCustomModeNetworkRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.SwitchToCustomMode(ctx, req, opts...) +} + +// UpdatePeering updates the specified network peering with the data included in the request Only the following fields can be modified: NetworkPeering.export_custom_routes, and NetworkPeering.import_custom_routes +func (c *NetworksClient) UpdatePeering(ctx context.Context, req *computepb.UpdatePeeringNetworkRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.UpdatePeering(ctx, req, opts...) +} + +// Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls. +type networksRESTClient struct { + // The http endpoint to connect to. + endpoint string + + // The http client. + httpClient *http.Client + + // The x-goog-* metadata to be sent with each request. + xGoogMetadata metadata.MD +} + +// NewNetworksRESTClient creates a new networks rest client. +// +// The Networks API. +func NewNetworksRESTClient(ctx context.Context, opts ...option.ClientOption) (*NetworksClient, error) { + clientOpts := append(defaultNetworksRESTClientOptions(), opts...) + httpClient, endpoint, err := httptransport.NewClient(ctx, clientOpts...) + if err != nil { + return nil, err + } + + c := &networksRESTClient{ + endpoint: endpoint, + httpClient: httpClient, + } + c.setGoogleClientInfo() + + return &NetworksClient{internalClient: c, CallOptions: &NetworksCallOptions{}}, nil +} + +func defaultNetworksRESTClientOptions() []option.ClientOption { + return []option.ClientOption{ + internaloption.WithDefaultEndpoint("compute.googleapis.com"), + internaloption.WithDefaultMTLSEndpoint("compute.mtls.googleapis.com"), + internaloption.WithDefaultAudience("https://compute.googleapis.com/"), + internaloption.WithDefaultScopes(DefaultAuthScopes()...), + } +} + +// setGoogleClientInfo sets the name and version of the application in +// the `x-goog-api-client` header passed on each request. Intended for +// use by Google-written clients. +func (c *networksRESTClient) setGoogleClientInfo(keyval ...string) { + kv := append([]string{"gl-go", versionGo()}, keyval...) + kv = append(kv, "gapic", versionClient, "gax", gax.Version, "rest", "UNKNOWN") + c.xGoogMetadata = metadata.Pairs("x-goog-api-client", gax.XGoogHeader(kv...)) +} + +// Close closes the connection to the API service. The user should invoke this when +// the client is no longer required. +func (c *networksRESTClient) Close() error { + // Replace httpClient with nil to force cleanup. + c.httpClient = nil + return nil +} + +// Connection returns a connection to the API service. +// +// Deprecated. +func (c *networksRESTClient) Connection() *grpc.ClientConn { + return nil +} + +// AddPeering adds a peering to the specified network. +func (c *networksRESTClient) AddPeering(ctx context.Context, req *computepb.AddPeeringNetworkRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetNetworksAddPeeringRequestResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/global/networks/%v/addPeering", req.GetProject(), req.GetNetwork()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Delete deletes the specified network. +func (c *networksRESTClient) Delete(ctx context.Context, req *computepb.DeleteNetworkRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/global/networks/%v", req.GetProject(), req.GetNetwork()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("DELETE", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Get returns the specified network. Gets a list of available networks by making a list() request. +func (c *networksRESTClient) Get(ctx context.Context, req *computepb.GetNetworkRequest, opts ...gax.CallOption) (*computepb.Network, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/global/networks/%v", req.GetProject(), req.GetNetwork()) + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Network{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// GetEffectiveFirewalls returns the effective firewalls on a given network. +func (c *networksRESTClient) GetEffectiveFirewalls(ctx context.Context, req *computepb.GetEffectiveFirewallsNetworkRequest, opts ...gax.CallOption) (*computepb.NetworksGetEffectiveFirewallsResponse, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/global/networks/%v/getEffectiveFirewalls", req.GetProject(), req.GetNetwork()) + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.NetworksGetEffectiveFirewallsResponse{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Insert creates a network in the specified project using the data included in the request. +func (c *networksRESTClient) Insert(ctx context.Context, req *computepb.InsertNetworkRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetNetworkResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/global/networks", req.GetProject()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// List retrieves the list of networks available to the specified project. +func (c *networksRESTClient) List(ctx context.Context, req *computepb.ListNetworksRequest, opts ...gax.CallOption) (*computepb.NetworkList, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/global/networks", 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() + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.NetworkList{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// ListPeeringRoutes lists the peering routes exchanged over peering connection. +func (c *networksRESTClient) ListPeeringRoutes(ctx context.Context, req *computepb.ListPeeringRoutesNetworksRequest, opts ...gax.CallOption) (*computepb.ExchangedPeeringRoutesList, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/global/networks/%v/listPeeringRoutes", req.GetProject(), req.GetNetwork()) + + params := url.Values{} + if req != nil && req.Direction != nil { + params.Add("direction", fmt.Sprintf("%v", req.GetDirection())) + } + 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.PeeringName != nil { + params.Add("peeringName", fmt.Sprintf("%v", req.GetPeeringName())) + } + if req != nil && req.Region != nil { + params.Add("region", fmt.Sprintf("%v", req.GetRegion())) + } + if req != nil && req.ReturnPartialSuccess != nil { + params.Add("returnPartialSuccess", fmt.Sprintf("%v", req.GetReturnPartialSuccess())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.ExchangedPeeringRoutesList{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Patch patches the specified network with the data included in the request. Only the following fields can be modified: routingConfig.routingMode. +func (c *networksRESTClient) Patch(ctx context.Context, req *computepb.PatchNetworkRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetNetworkResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/global/networks/%v", req.GetProject(), req.GetNetwork()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("PATCH", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// RemovePeering removes a peering from the specified network. +func (c *networksRESTClient) RemovePeering(ctx context.Context, req *computepb.RemovePeeringNetworkRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetNetworksRemovePeeringRequestResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/global/networks/%v/removePeering", req.GetProject(), req.GetNetwork()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// SwitchToCustomMode switches the network mode from auto subnet mode to custom subnet mode. +func (c *networksRESTClient) SwitchToCustomMode(ctx context.Context, req *computepb.SwitchToCustomModeNetworkRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/global/networks/%v/switchToCustomMode", req.GetProject(), req.GetNetwork()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// UpdatePeering updates the specified network peering with the data included in the request Only the following fields can be modified: NetworkPeering.export_custom_routes, and NetworkPeering.import_custom_routes +func (c *networksRESTClient) UpdatePeering(ctx context.Context, req *computepb.UpdatePeeringNetworkRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetNetworksUpdatePeeringRequestResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/global/networks/%v/updatePeering", req.GetProject(), req.GetNetwork()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("PATCH", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} diff --git a/compute/apiv1/networks_client_example_test.go b/compute/apiv1/networks_client_example_test.go new file mode 100644 index 00000000000..74578fdc389 --- /dev/null +++ b/compute/apiv1/networks_client_example_test.go @@ -0,0 +1,245 @@ +// Copyright 2021 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_test + +import ( + "context" + + compute "cloud.google.com/go/compute/apiv1" + computepb "google.golang.org/genproto/googleapis/cloud/compute/v1" +) + +func ExampleNewNetworksRESTClient() { + ctx := context.Background() + c, err := compute.NewNetworksRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + // TODO: Use client. + _ = c +} + +func ExampleNetworksClient_AddPeering() { + ctx := context.Background() + c, err := compute.NewNetworksRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.AddPeeringNetworkRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.AddPeering(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleNetworksClient_Delete() { + ctx := context.Background() + c, err := compute.NewNetworksRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.DeleteNetworkRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Delete(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleNetworksClient_Get() { + ctx := context.Background() + c, err := compute.NewNetworksRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.GetNetworkRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Get(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleNetworksClient_GetEffectiveFirewalls() { + ctx := context.Background() + c, err := compute.NewNetworksRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.GetEffectiveFirewallsNetworkRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.GetEffectiveFirewalls(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleNetworksClient_Insert() { + ctx := context.Background() + c, err := compute.NewNetworksRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.InsertNetworkRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Insert(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleNetworksClient_List() { + ctx := context.Background() + c, err := compute.NewNetworksRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.ListNetworksRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.List(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleNetworksClient_ListPeeringRoutes() { + ctx := context.Background() + c, err := compute.NewNetworksRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.ListPeeringRoutesNetworksRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.ListPeeringRoutes(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleNetworksClient_Patch() { + ctx := context.Background() + c, err := compute.NewNetworksRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.PatchNetworkRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Patch(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleNetworksClient_RemovePeering() { + ctx := context.Background() + c, err := compute.NewNetworksRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.RemovePeeringNetworkRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.RemovePeering(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleNetworksClient_SwitchToCustomMode() { + ctx := context.Background() + c, err := compute.NewNetworksRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.SwitchToCustomModeNetworkRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.SwitchToCustomMode(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleNetworksClient_UpdatePeering() { + ctx := context.Background() + c, err := compute.NewNetworksRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.UpdatePeeringNetworkRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.UpdatePeering(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} diff --git a/compute/apiv1/node_groups_client.go b/compute/apiv1/node_groups_client.go new file mode 100644 index 00000000000..64563885daa --- /dev/null +++ b/compute/apiv1/node_groups_client.go @@ -0,0 +1,915 @@ +// Copyright 2021 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/ioutil" + "net/http" + "net/url" + + gax "github.com/googleapis/gax-go/v2" + "google.golang.org/api/option" + "google.golang.org/api/option/internaloption" + httptransport "google.golang.org/api/transport/http" + computepb "google.golang.org/genproto/googleapis/cloud/compute/v1" + "google.golang.org/grpc" + "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/encoding/protojson" +) + +var newNodeGroupsClientHook clientHook + +// NodeGroupsCallOptions contains the retry settings for each method of NodeGroupsClient. +type NodeGroupsCallOptions struct { + AddNodes []gax.CallOption + AggregatedList []gax.CallOption + Delete []gax.CallOption + DeleteNodes []gax.CallOption + Get []gax.CallOption + GetIamPolicy []gax.CallOption + Insert []gax.CallOption + List []gax.CallOption + ListNodes []gax.CallOption + Patch []gax.CallOption + SetIamPolicy []gax.CallOption + SetNodeTemplate []gax.CallOption + TestIamPermissions []gax.CallOption +} + +// internalNodeGroupsClient is an interface that defines the methods availaible from Google Compute Engine API. +type internalNodeGroupsClient interface { + Close() error + setGoogleClientInfo(...string) + Connection() *grpc.ClientConn + AddNodes(context.Context, *computepb.AddNodesNodeGroupRequest, ...gax.CallOption) (*computepb.Operation, error) + AggregatedList(context.Context, *computepb.AggregatedListNodeGroupsRequest, ...gax.CallOption) (*computepb.NodeGroupAggregatedList, error) + Delete(context.Context, *computepb.DeleteNodeGroupRequest, ...gax.CallOption) (*computepb.Operation, error) + DeleteNodes(context.Context, *computepb.DeleteNodesNodeGroupRequest, ...gax.CallOption) (*computepb.Operation, error) + Get(context.Context, *computepb.GetNodeGroupRequest, ...gax.CallOption) (*computepb.NodeGroup, error) + GetIamPolicy(context.Context, *computepb.GetIamPolicyNodeGroupRequest, ...gax.CallOption) (*computepb.Policy, error) + Insert(context.Context, *computepb.InsertNodeGroupRequest, ...gax.CallOption) (*computepb.Operation, error) + List(context.Context, *computepb.ListNodeGroupsRequest, ...gax.CallOption) (*computepb.NodeGroupList, error) + ListNodes(context.Context, *computepb.ListNodesNodeGroupsRequest, ...gax.CallOption) (*computepb.NodeGroupsListNodes, error) + Patch(context.Context, *computepb.PatchNodeGroupRequest, ...gax.CallOption) (*computepb.Operation, error) + SetIamPolicy(context.Context, *computepb.SetIamPolicyNodeGroupRequest, ...gax.CallOption) (*computepb.Policy, error) + SetNodeTemplate(context.Context, *computepb.SetNodeTemplateNodeGroupRequest, ...gax.CallOption) (*computepb.Operation, error) + TestIamPermissions(context.Context, *computepb.TestIamPermissionsNodeGroupRequest, ...gax.CallOption) (*computepb.TestPermissionsResponse, error) +} + +// NodeGroupsClient 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 NodeGroups API. +type NodeGroupsClient struct { + // The internal transport-dependent client. + internalClient internalNodeGroupsClient + + // The call options for this service. + CallOptions *NodeGroupsCallOptions +} + +// 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 *NodeGroupsClient) 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 *NodeGroupsClient) setGoogleClientInfo(keyval ...string) { + c.internalClient.setGoogleClientInfo(keyval...) +} + +// Connection returns a connection to the API service. +// +// Deprecated. +func (c *NodeGroupsClient) Connection() *grpc.ClientConn { + return c.internalClient.Connection() +} + +// AddNodes adds specified number of nodes to the node group. +func (c *NodeGroupsClient) AddNodes(ctx context.Context, req *computepb.AddNodesNodeGroupRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.AddNodes(ctx, req, opts...) +} + +// AggregatedList retrieves an aggregated list of node groups. Note: use nodeGroups.listNodes for more details about each group. +func (c *NodeGroupsClient) AggregatedList(ctx context.Context, req *computepb.AggregatedListNodeGroupsRequest, opts ...gax.CallOption) (*computepb.NodeGroupAggregatedList, error) { + return c.internalClient.AggregatedList(ctx, req, opts...) +} + +// Delete deletes the specified NodeGroup resource. +func (c *NodeGroupsClient) Delete(ctx context.Context, req *computepb.DeleteNodeGroupRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.Delete(ctx, req, opts...) +} + +// DeleteNodes deletes specified nodes from the node group. +func (c *NodeGroupsClient) DeleteNodes(ctx context.Context, req *computepb.DeleteNodesNodeGroupRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.DeleteNodes(ctx, req, opts...) +} + +// Get returns the specified NodeGroup. Get a list of available NodeGroups by making a list() request. Note: the “nodes” field should not be used. Use nodeGroups.listNodes instead. +func (c *NodeGroupsClient) Get(ctx context.Context, req *computepb.GetNodeGroupRequest, opts ...gax.CallOption) (*computepb.NodeGroup, error) { + 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 *NodeGroupsClient) GetIamPolicy(ctx context.Context, req *computepb.GetIamPolicyNodeGroupRequest, opts ...gax.CallOption) (*computepb.Policy, error) { + return c.internalClient.GetIamPolicy(ctx, req, opts...) +} + +// Insert creates a NodeGroup resource in the specified project using the data included in the request. +func (c *NodeGroupsClient) Insert(ctx context.Context, req *computepb.InsertNodeGroupRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.Insert(ctx, req, opts...) +} + +// List retrieves a list of node groups available to the specified project. Note: use nodeGroups.listNodes for more details about each group. +func (c *NodeGroupsClient) List(ctx context.Context, req *computepb.ListNodeGroupsRequest, opts ...gax.CallOption) (*computepb.NodeGroupList, error) { + return c.internalClient.List(ctx, req, opts...) +} + +// ListNodes lists nodes in the node group. +func (c *NodeGroupsClient) ListNodes(ctx context.Context, req *computepb.ListNodesNodeGroupsRequest, opts ...gax.CallOption) (*computepb.NodeGroupsListNodes, error) { + return c.internalClient.ListNodes(ctx, req, opts...) +} + +// Patch updates the specified node group. +func (c *NodeGroupsClient) Patch(ctx context.Context, req *computepb.PatchNodeGroupRequest, opts ...gax.CallOption) (*computepb.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 *NodeGroupsClient) SetIamPolicy(ctx context.Context, req *computepb.SetIamPolicyNodeGroupRequest, opts ...gax.CallOption) (*computepb.Policy, error) { + return c.internalClient.SetIamPolicy(ctx, req, opts...) +} + +// SetNodeTemplate updates the node template of the node group. +func (c *NodeGroupsClient) SetNodeTemplate(ctx context.Context, req *computepb.SetNodeTemplateNodeGroupRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.SetNodeTemplate(ctx, req, opts...) +} + +// TestIamPermissions returns permissions that a caller has on the specified resource. +func (c *NodeGroupsClient) TestIamPermissions(ctx context.Context, req *computepb.TestIamPermissionsNodeGroupRequest, opts ...gax.CallOption) (*computepb.TestPermissionsResponse, error) { + return c.internalClient.TestIamPermissions(ctx, req, opts...) +} + +// Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls. +type nodeGroupsRESTClient struct { + // The http endpoint to connect to. + endpoint string + + // The http client. + httpClient *http.Client + + // The x-goog-* metadata to be sent with each request. + xGoogMetadata metadata.MD +} + +// NewNodeGroupsRESTClient creates a new node groups rest client. +// +// The NodeGroups API. +func NewNodeGroupsRESTClient(ctx context.Context, opts ...option.ClientOption) (*NodeGroupsClient, error) { + clientOpts := append(defaultNodeGroupsRESTClientOptions(), opts...) + httpClient, endpoint, err := httptransport.NewClient(ctx, clientOpts...) + if err != nil { + return nil, err + } + + c := &nodeGroupsRESTClient{ + endpoint: endpoint, + httpClient: httpClient, + } + c.setGoogleClientInfo() + + return &NodeGroupsClient{internalClient: c, CallOptions: &NodeGroupsCallOptions{}}, nil +} + +func defaultNodeGroupsRESTClientOptions() []option.ClientOption { + return []option.ClientOption{ + internaloption.WithDefaultEndpoint("compute.googleapis.com"), + internaloption.WithDefaultMTLSEndpoint("compute.mtls.googleapis.com"), + internaloption.WithDefaultAudience("https://compute.googleapis.com/"), + internaloption.WithDefaultScopes(DefaultAuthScopes()...), + } +} + +// setGoogleClientInfo sets the name and version of the application in +// the `x-goog-api-client` header passed on each request. Intended for +// use by Google-written clients. +func (c *nodeGroupsRESTClient) setGoogleClientInfo(keyval ...string) { + kv := append([]string{"gl-go", versionGo()}, keyval...) + kv = append(kv, "gapic", versionClient, "gax", gax.Version, "rest", "UNKNOWN") + c.xGoogMetadata = metadata.Pairs("x-goog-api-client", gax.XGoogHeader(kv...)) +} + +// Close closes the connection to the API service. The user should invoke this when +// the client is no longer required. +func (c *nodeGroupsRESTClient) Close() error { + // Replace httpClient with nil to force cleanup. + c.httpClient = nil + return nil +} + +// Connection returns a connection to the API service. +// +// Deprecated. +func (c *nodeGroupsRESTClient) Connection() *grpc.ClientConn { + return nil +} + +// AddNodes adds specified number of nodes to the node group. +func (c *nodeGroupsRESTClient) AddNodes(ctx context.Context, req *computepb.AddNodesNodeGroupRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetNodeGroupsAddNodesRequestResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/zones/%v/nodeGroups/%v/addNodes", req.GetProject(), req.GetZone(), req.GetNodeGroup()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// AggregatedList retrieves an aggregated list of node groups. Note: use nodeGroups.listNodes for more details about each group. +func (c *nodeGroupsRESTClient) AggregatedList(ctx context.Context, req *computepb.AggregatedListNodeGroupsRequest, opts ...gax.CallOption) (*computepb.NodeGroupAggregatedList, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/aggregated/nodeGroups", req.GetProject()) + + params := url.Values{} + if req != nil && req.Filter != nil { + params.Add("filter", fmt.Sprintf("%v", req.GetFilter())) + } + if req != nil && req.IncludeAllScopes != nil { + params.Add("includeAllScopes", fmt.Sprintf("%v", req.GetIncludeAllScopes())) + } + 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() + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.NodeGroupAggregatedList{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Delete deletes the specified NodeGroup resource. +func (c *nodeGroupsRESTClient) Delete(ctx context.Context, req *computepb.DeleteNodeGroupRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/zones/%v/nodeGroups/%v", req.GetProject(), req.GetZone(), req.GetNodeGroup()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("DELETE", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// DeleteNodes deletes specified nodes from the node group. +func (c *nodeGroupsRESTClient) DeleteNodes(ctx context.Context, req *computepb.DeleteNodesNodeGroupRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetNodeGroupsDeleteNodesRequestResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/zones/%v/nodeGroups/%v/deleteNodes", req.GetProject(), req.GetZone(), req.GetNodeGroup()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Get returns the specified NodeGroup. Get a list of available NodeGroups by making a list() request. Note: the “nodes” field should not be used. Use nodeGroups.listNodes instead. +func (c *nodeGroupsRESTClient) Get(ctx context.Context, req *computepb.GetNodeGroupRequest, opts ...gax.CallOption) (*computepb.NodeGroup, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/zones/%v/nodeGroups/%v", req.GetProject(), req.GetZone(), req.GetNodeGroup()) + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.NodeGroup{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// GetIamPolicy gets the access control policy for a resource. May be empty if no such policy or resource exists. +func (c *nodeGroupsRESTClient) GetIamPolicy(ctx context.Context, req *computepb.GetIamPolicyNodeGroupRequest, opts ...gax.CallOption) (*computepb.Policy, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/zones/%v/nodeGroups/%v/getIamPolicy", req.GetProject(), req.GetZone(), req.GetResource()) + + params := url.Values{} + if req != nil && req.OptionsRequestedPolicyVersion != nil { + params.Add("optionsRequestedPolicyVersion", fmt.Sprintf("%v", req.GetOptionsRequestedPolicyVersion())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Policy{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Insert creates a NodeGroup resource in the specified project using the data included in the request. +func (c *nodeGroupsRESTClient) Insert(ctx context.Context, req *computepb.InsertNodeGroupRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetNodeGroupResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/zones/%v/nodeGroups", req.GetProject(), req.GetZone()) + + params := url.Values{} + if req.GetInitialNodeCount() != 0 { + params.Add("initialNodeCount", fmt.Sprintf("%v", req.GetInitialNodeCount())) + } + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// List retrieves a list of node groups available to the specified project. Note: use nodeGroups.listNodes for more details about each group. +func (c *nodeGroupsRESTClient) List(ctx context.Context, req *computepb.ListNodeGroupsRequest, opts ...gax.CallOption) (*computepb.NodeGroupList, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/zones/%v/nodeGroups", req.GetProject(), req.GetZone()) + + 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() + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.NodeGroupList{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// ListNodes lists nodes in the node group. +func (c *nodeGroupsRESTClient) ListNodes(ctx context.Context, req *computepb.ListNodesNodeGroupsRequest, opts ...gax.CallOption) (*computepb.NodeGroupsListNodes, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/zones/%v/nodeGroups/%v/listNodes", req.GetProject(), req.GetZone(), req.GetNodeGroup()) + + 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() + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.NodeGroupsListNodes{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Patch updates the specified node group. +func (c *nodeGroupsRESTClient) Patch(ctx context.Context, req *computepb.PatchNodeGroupRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetNodeGroupResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/zones/%v/nodeGroups/%v", req.GetProject(), req.GetZone(), req.GetNodeGroup()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("PATCH", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// SetIamPolicy sets the access control policy on the specified resource. Replaces any existing policy. +func (c *nodeGroupsRESTClient) SetIamPolicy(ctx context.Context, req *computepb.SetIamPolicyNodeGroupRequest, opts ...gax.CallOption) (*computepb.Policy, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetZoneSetPolicyRequestResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/zones/%v/nodeGroups/%v/setIamPolicy", req.GetProject(), req.GetZone(), req.GetResource()) + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Policy{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// SetNodeTemplate updates the node template of the node group. +func (c *nodeGroupsRESTClient) SetNodeTemplate(ctx context.Context, req *computepb.SetNodeTemplateNodeGroupRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetNodeGroupsSetNodeTemplateRequestResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/zones/%v/nodeGroups/%v/setNodeTemplate", req.GetProject(), req.GetZone(), req.GetNodeGroup()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// TestIamPermissions returns permissions that a caller has on the specified resource. +func (c *nodeGroupsRESTClient) TestIamPermissions(ctx context.Context, req *computepb.TestIamPermissionsNodeGroupRequest, opts ...gax.CallOption) (*computepb.TestPermissionsResponse, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetTestPermissionsRequestResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/zones/%v/nodeGroups/%v/testIamPermissions", req.GetProject(), req.GetZone(), req.GetResource()) + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.TestPermissionsResponse{} + + return rsp, unm.Unmarshal(buf, rsp) +} diff --git a/compute/apiv1/node_groups_client_example_test.go b/compute/apiv1/node_groups_client_example_test.go new file mode 100644 index 00000000000..8cb69f98e69 --- /dev/null +++ b/compute/apiv1/node_groups_client_example_test.go @@ -0,0 +1,283 @@ +// Copyright 2021 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_test + +import ( + "context" + + compute "cloud.google.com/go/compute/apiv1" + computepb "google.golang.org/genproto/googleapis/cloud/compute/v1" +) + +func ExampleNewNodeGroupsRESTClient() { + ctx := context.Background() + c, err := compute.NewNodeGroupsRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + // TODO: Use client. + _ = c +} + +func ExampleNodeGroupsClient_AddNodes() { + ctx := context.Background() + c, err := compute.NewNodeGroupsRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.AddNodesNodeGroupRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.AddNodes(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleNodeGroupsClient_AggregatedList() { + ctx := context.Background() + c, err := compute.NewNodeGroupsRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.AggregatedListNodeGroupsRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.AggregatedList(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleNodeGroupsClient_Delete() { + ctx := context.Background() + c, err := compute.NewNodeGroupsRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.DeleteNodeGroupRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Delete(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleNodeGroupsClient_DeleteNodes() { + ctx := context.Background() + c, err := compute.NewNodeGroupsRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.DeleteNodesNodeGroupRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.DeleteNodes(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleNodeGroupsClient_Get() { + ctx := context.Background() + c, err := compute.NewNodeGroupsRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.GetNodeGroupRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Get(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleNodeGroupsClient_GetIamPolicy() { + ctx := context.Background() + c, err := compute.NewNodeGroupsRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.GetIamPolicyNodeGroupRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.GetIamPolicy(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleNodeGroupsClient_Insert() { + ctx := context.Background() + c, err := compute.NewNodeGroupsRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.InsertNodeGroupRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Insert(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleNodeGroupsClient_List() { + ctx := context.Background() + c, err := compute.NewNodeGroupsRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.ListNodeGroupsRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.List(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleNodeGroupsClient_ListNodes() { + ctx := context.Background() + c, err := compute.NewNodeGroupsRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.ListNodesNodeGroupsRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.ListNodes(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleNodeGroupsClient_Patch() { + ctx := context.Background() + c, err := compute.NewNodeGroupsRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.PatchNodeGroupRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Patch(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleNodeGroupsClient_SetIamPolicy() { + ctx := context.Background() + c, err := compute.NewNodeGroupsRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.SetIamPolicyNodeGroupRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.SetIamPolicy(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleNodeGroupsClient_SetNodeTemplate() { + ctx := context.Background() + c, err := compute.NewNodeGroupsRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.SetNodeTemplateNodeGroupRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.SetNodeTemplate(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleNodeGroupsClient_TestIamPermissions() { + ctx := context.Background() + c, err := compute.NewNodeGroupsRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.TestIamPermissionsNodeGroupRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.TestIamPermissions(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} diff --git a/compute/apiv1/node_templates_client.go b/compute/apiv1/node_templates_client.go new file mode 100644 index 00000000000..eebf6d2a0a0 --- /dev/null +++ b/compute/apiv1/node_templates_client.go @@ -0,0 +1,611 @@ +// Copyright 2021 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/ioutil" + "net/http" + "net/url" + + gax "github.com/googleapis/gax-go/v2" + "google.golang.org/api/option" + "google.golang.org/api/option/internaloption" + httptransport "google.golang.org/api/transport/http" + computepb "google.golang.org/genproto/googleapis/cloud/compute/v1" + "google.golang.org/grpc" + "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/encoding/protojson" +) + +var newNodeTemplatesClientHook clientHook + +// NodeTemplatesCallOptions contains the retry settings for each method of NodeTemplatesClient. +type NodeTemplatesCallOptions struct { + AggregatedList []gax.CallOption + Delete []gax.CallOption + Get []gax.CallOption + GetIamPolicy []gax.CallOption + Insert []gax.CallOption + List []gax.CallOption + SetIamPolicy []gax.CallOption + TestIamPermissions []gax.CallOption +} + +// internalNodeTemplatesClient is an interface that defines the methods availaible from Google Compute Engine API. +type internalNodeTemplatesClient interface { + Close() error + setGoogleClientInfo(...string) + Connection() *grpc.ClientConn + AggregatedList(context.Context, *computepb.AggregatedListNodeTemplatesRequest, ...gax.CallOption) (*computepb.NodeTemplateAggregatedList, error) + Delete(context.Context, *computepb.DeleteNodeTemplateRequest, ...gax.CallOption) (*computepb.Operation, error) + Get(context.Context, *computepb.GetNodeTemplateRequest, ...gax.CallOption) (*computepb.NodeTemplate, error) + GetIamPolicy(context.Context, *computepb.GetIamPolicyNodeTemplateRequest, ...gax.CallOption) (*computepb.Policy, error) + Insert(context.Context, *computepb.InsertNodeTemplateRequest, ...gax.CallOption) (*computepb.Operation, error) + List(context.Context, *computepb.ListNodeTemplatesRequest, ...gax.CallOption) (*computepb.NodeTemplateList, error) + SetIamPolicy(context.Context, *computepb.SetIamPolicyNodeTemplateRequest, ...gax.CallOption) (*computepb.Policy, error) + TestIamPermissions(context.Context, *computepb.TestIamPermissionsNodeTemplateRequest, ...gax.CallOption) (*computepb.TestPermissionsResponse, error) +} + +// NodeTemplatesClient 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 NodeTemplates API. +type NodeTemplatesClient struct { + // The internal transport-dependent client. + internalClient internalNodeTemplatesClient + + // The call options for this service. + CallOptions *NodeTemplatesCallOptions +} + +// 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 *NodeTemplatesClient) 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 *NodeTemplatesClient) setGoogleClientInfo(keyval ...string) { + c.internalClient.setGoogleClientInfo(keyval...) +} + +// Connection returns a connection to the API service. +// +// Deprecated. +func (c *NodeTemplatesClient) Connection() *grpc.ClientConn { + return c.internalClient.Connection() +} + +// AggregatedList retrieves an aggregated list of node templates. +func (c *NodeTemplatesClient) AggregatedList(ctx context.Context, req *computepb.AggregatedListNodeTemplatesRequest, opts ...gax.CallOption) (*computepb.NodeTemplateAggregatedList, error) { + return c.internalClient.AggregatedList(ctx, req, opts...) +} + +// Delete deletes the specified NodeTemplate resource. +func (c *NodeTemplatesClient) Delete(ctx context.Context, req *computepb.DeleteNodeTemplateRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.Delete(ctx, req, opts...) +} + +// Get returns the specified node template. Gets a list of available node templates by making a list() request. +func (c *NodeTemplatesClient) Get(ctx context.Context, req *computepb.GetNodeTemplateRequest, opts ...gax.CallOption) (*computepb.NodeTemplate, error) { + 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 *NodeTemplatesClient) GetIamPolicy(ctx context.Context, req *computepb.GetIamPolicyNodeTemplateRequest, opts ...gax.CallOption) (*computepb.Policy, error) { + return c.internalClient.GetIamPolicy(ctx, req, opts...) +} + +// Insert creates a NodeTemplate resource in the specified project using the data included in the request. +func (c *NodeTemplatesClient) Insert(ctx context.Context, req *computepb.InsertNodeTemplateRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.Insert(ctx, req, opts...) +} + +// List retrieves a list of node templates available to the specified project. +func (c *NodeTemplatesClient) List(ctx context.Context, req *computepb.ListNodeTemplatesRequest, opts ...gax.CallOption) (*computepb.NodeTemplateList, error) { + return c.internalClient.List(ctx, req, opts...) +} + +// SetIamPolicy sets the access control policy on the specified resource. Replaces any existing policy. +func (c *NodeTemplatesClient) SetIamPolicy(ctx context.Context, req *computepb.SetIamPolicyNodeTemplateRequest, 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 *NodeTemplatesClient) TestIamPermissions(ctx context.Context, req *computepb.TestIamPermissionsNodeTemplateRequest, opts ...gax.CallOption) (*computepb.TestPermissionsResponse, error) { + return c.internalClient.TestIamPermissions(ctx, req, opts...) +} + +// Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls. +type nodeTemplatesRESTClient struct { + // The http endpoint to connect to. + endpoint string + + // The http client. + httpClient *http.Client + + // The x-goog-* metadata to be sent with each request. + xGoogMetadata metadata.MD +} + +// NewNodeTemplatesRESTClient creates a new node templates rest client. +// +// The NodeTemplates API. +func NewNodeTemplatesRESTClient(ctx context.Context, opts ...option.ClientOption) (*NodeTemplatesClient, error) { + clientOpts := append(defaultNodeTemplatesRESTClientOptions(), opts...) + httpClient, endpoint, err := httptransport.NewClient(ctx, clientOpts...) + if err != nil { + return nil, err + } + + c := &nodeTemplatesRESTClient{ + endpoint: endpoint, + httpClient: httpClient, + } + c.setGoogleClientInfo() + + return &NodeTemplatesClient{internalClient: c, CallOptions: &NodeTemplatesCallOptions{}}, nil +} + +func defaultNodeTemplatesRESTClientOptions() []option.ClientOption { + return []option.ClientOption{ + internaloption.WithDefaultEndpoint("compute.googleapis.com"), + internaloption.WithDefaultMTLSEndpoint("compute.mtls.googleapis.com"), + internaloption.WithDefaultAudience("https://compute.googleapis.com/"), + internaloption.WithDefaultScopes(DefaultAuthScopes()...), + } +} + +// setGoogleClientInfo sets the name and version of the application in +// the `x-goog-api-client` header passed on each request. Intended for +// use by Google-written clients. +func (c *nodeTemplatesRESTClient) setGoogleClientInfo(keyval ...string) { + kv := append([]string{"gl-go", versionGo()}, keyval...) + kv = append(kv, "gapic", versionClient, "gax", gax.Version, "rest", "UNKNOWN") + c.xGoogMetadata = metadata.Pairs("x-goog-api-client", gax.XGoogHeader(kv...)) +} + +// Close closes the connection to the API service. The user should invoke this when +// the client is no longer required. +func (c *nodeTemplatesRESTClient) Close() error { + // Replace httpClient with nil to force cleanup. + c.httpClient = nil + return nil +} + +// Connection returns a connection to the API service. +// +// Deprecated. +func (c *nodeTemplatesRESTClient) Connection() *grpc.ClientConn { + return nil +} + +// AggregatedList retrieves an aggregated list of node templates. +func (c *nodeTemplatesRESTClient) AggregatedList(ctx context.Context, req *computepb.AggregatedListNodeTemplatesRequest, opts ...gax.CallOption) (*computepb.NodeTemplateAggregatedList, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/aggregated/nodeTemplates", req.GetProject()) + + params := url.Values{} + if req != nil && req.Filter != nil { + params.Add("filter", fmt.Sprintf("%v", req.GetFilter())) + } + if req != nil && req.IncludeAllScopes != nil { + params.Add("includeAllScopes", fmt.Sprintf("%v", req.GetIncludeAllScopes())) + } + 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() + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.NodeTemplateAggregatedList{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Delete deletes the specified NodeTemplate resource. +func (c *nodeTemplatesRESTClient) Delete(ctx context.Context, req *computepb.DeleteNodeTemplateRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/nodeTemplates/%v", req.GetProject(), req.GetRegion(), req.GetNodeTemplate()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("DELETE", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Get returns the specified node template. Gets a list of available node templates by making a list() request. +func (c *nodeTemplatesRESTClient) Get(ctx context.Context, req *computepb.GetNodeTemplateRequest, opts ...gax.CallOption) (*computepb.NodeTemplate, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/nodeTemplates/%v", req.GetProject(), req.GetRegion(), req.GetNodeTemplate()) + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.NodeTemplate{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// GetIamPolicy gets the access control policy for a resource. May be empty if no such policy or resource exists. +func (c *nodeTemplatesRESTClient) GetIamPolicy(ctx context.Context, req *computepb.GetIamPolicyNodeTemplateRequest, opts ...gax.CallOption) (*computepb.Policy, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/nodeTemplates/%v/getIamPolicy", req.GetProject(), req.GetRegion(), req.GetResource()) + + params := url.Values{} + if req != nil && req.OptionsRequestedPolicyVersion != nil { + params.Add("optionsRequestedPolicyVersion", fmt.Sprintf("%v", req.GetOptionsRequestedPolicyVersion())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Policy{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Insert creates a NodeTemplate resource in the specified project using the data included in the request. +func (c *nodeTemplatesRESTClient) Insert(ctx context.Context, req *computepb.InsertNodeTemplateRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetNodeTemplateResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/nodeTemplates", req.GetProject(), req.GetRegion()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// List retrieves a list of node templates available to the specified project. +func (c *nodeTemplatesRESTClient) List(ctx context.Context, req *computepb.ListNodeTemplatesRequest, opts ...gax.CallOption) (*computepb.NodeTemplateList, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/nodeTemplates", 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() + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.NodeTemplateList{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// SetIamPolicy sets the access control policy on the specified resource. Replaces any existing policy. +func (c *nodeTemplatesRESTClient) SetIamPolicy(ctx context.Context, req *computepb.SetIamPolicyNodeTemplateRequest, opts ...gax.CallOption) (*computepb.Policy, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetRegionSetPolicyRequestResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/nodeTemplates/%v/setIamPolicy", req.GetProject(), req.GetRegion(), req.GetResource()) + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Policy{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// TestIamPermissions returns permissions that a caller has on the specified resource. +func (c *nodeTemplatesRESTClient) TestIamPermissions(ctx context.Context, req *computepb.TestIamPermissionsNodeTemplateRequest, opts ...gax.CallOption) (*computepb.TestPermissionsResponse, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetTestPermissionsRequestResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/nodeTemplates/%v/testIamPermissions", req.GetProject(), req.GetRegion(), req.GetResource()) + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.TestPermissionsResponse{} + + return rsp, unm.Unmarshal(buf, rsp) +} diff --git a/compute/apiv1/node_templates_client_example_test.go b/compute/apiv1/node_templates_client_example_test.go new file mode 100644 index 00000000000..e589d2ededd --- /dev/null +++ b/compute/apiv1/node_templates_client_example_test.go @@ -0,0 +1,188 @@ +// Copyright 2021 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_test + +import ( + "context" + + compute "cloud.google.com/go/compute/apiv1" + computepb "google.golang.org/genproto/googleapis/cloud/compute/v1" +) + +func ExampleNewNodeTemplatesRESTClient() { + ctx := context.Background() + c, err := compute.NewNodeTemplatesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + // TODO: Use client. + _ = c +} + +func ExampleNodeTemplatesClient_AggregatedList() { + ctx := context.Background() + c, err := compute.NewNodeTemplatesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.AggregatedListNodeTemplatesRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.AggregatedList(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleNodeTemplatesClient_Delete() { + ctx := context.Background() + c, err := compute.NewNodeTemplatesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.DeleteNodeTemplateRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Delete(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleNodeTemplatesClient_Get() { + ctx := context.Background() + c, err := compute.NewNodeTemplatesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.GetNodeTemplateRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Get(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleNodeTemplatesClient_GetIamPolicy() { + ctx := context.Background() + c, err := compute.NewNodeTemplatesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.GetIamPolicyNodeTemplateRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.GetIamPolicy(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleNodeTemplatesClient_Insert() { + ctx := context.Background() + c, err := compute.NewNodeTemplatesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.InsertNodeTemplateRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Insert(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleNodeTemplatesClient_List() { + ctx := context.Background() + c, err := compute.NewNodeTemplatesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.ListNodeTemplatesRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.List(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleNodeTemplatesClient_SetIamPolicy() { + ctx := context.Background() + c, err := compute.NewNodeTemplatesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.SetIamPolicyNodeTemplateRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.SetIamPolicy(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleNodeTemplatesClient_TestIamPermissions() { + ctx := context.Background() + c, err := compute.NewNodeTemplatesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.TestIamPermissionsNodeTemplateRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.TestIamPermissions(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} diff --git a/compute/apiv1/node_types_client.go b/compute/apiv1/node_types_client.go new file mode 100644 index 00000000000..5c72753393b --- /dev/null +++ b/compute/apiv1/node_types_client.go @@ -0,0 +1,337 @@ +// Copyright 2021 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/ioutil" + "net/http" + "net/url" + + gax "github.com/googleapis/gax-go/v2" + "google.golang.org/api/option" + "google.golang.org/api/option/internaloption" + httptransport "google.golang.org/api/transport/http" + computepb "google.golang.org/genproto/googleapis/cloud/compute/v1" + "google.golang.org/grpc" + "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/encoding/protojson" +) + +var newNodeTypesClientHook clientHook + +// NodeTypesCallOptions contains the retry settings for each method of NodeTypesClient. +type NodeTypesCallOptions struct { + AggregatedList []gax.CallOption + Get []gax.CallOption + List []gax.CallOption +} + +// internalNodeTypesClient is an interface that defines the methods availaible from Google Compute Engine API. +type internalNodeTypesClient interface { + Close() error + setGoogleClientInfo(...string) + Connection() *grpc.ClientConn + AggregatedList(context.Context, *computepb.AggregatedListNodeTypesRequest, ...gax.CallOption) (*computepb.NodeTypeAggregatedList, error) + Get(context.Context, *computepb.GetNodeTypeRequest, ...gax.CallOption) (*computepb.NodeType, error) + List(context.Context, *computepb.ListNodeTypesRequest, ...gax.CallOption) (*computepb.NodeTypeList, error) +} + +// NodeTypesClient 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 NodeTypes API. +type NodeTypesClient struct { + // The internal transport-dependent client. + internalClient internalNodeTypesClient + + // The call options for this service. + CallOptions *NodeTypesCallOptions +} + +// 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 *NodeTypesClient) 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 *NodeTypesClient) setGoogleClientInfo(keyval ...string) { + c.internalClient.setGoogleClientInfo(keyval...) +} + +// Connection returns a connection to the API service. +// +// Deprecated. +func (c *NodeTypesClient) Connection() *grpc.ClientConn { + return c.internalClient.Connection() +} + +// AggregatedList retrieves an aggregated list of node types. +func (c *NodeTypesClient) AggregatedList(ctx context.Context, req *computepb.AggregatedListNodeTypesRequest, opts ...gax.CallOption) (*computepb.NodeTypeAggregatedList, error) { + return c.internalClient.AggregatedList(ctx, req, opts...) +} + +// Get returns the specified node type. Gets a list of available node types by making a list() request. +func (c *NodeTypesClient) Get(ctx context.Context, req *computepb.GetNodeTypeRequest, opts ...gax.CallOption) (*computepb.NodeType, error) { + return c.internalClient.Get(ctx, req, opts...) +} + +// List retrieves a list of node types available to the specified project. +func (c *NodeTypesClient) List(ctx context.Context, req *computepb.ListNodeTypesRequest, opts ...gax.CallOption) (*computepb.NodeTypeList, error) { + return c.internalClient.List(ctx, req, opts...) +} + +// Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls. +type nodeTypesRESTClient struct { + // The http endpoint to connect to. + endpoint string + + // The http client. + httpClient *http.Client + + // The x-goog-* metadata to be sent with each request. + xGoogMetadata metadata.MD +} + +// NewNodeTypesRESTClient creates a new node types rest client. +// +// The NodeTypes API. +func NewNodeTypesRESTClient(ctx context.Context, opts ...option.ClientOption) (*NodeTypesClient, error) { + clientOpts := append(defaultNodeTypesRESTClientOptions(), opts...) + httpClient, endpoint, err := httptransport.NewClient(ctx, clientOpts...) + if err != nil { + return nil, err + } + + c := &nodeTypesRESTClient{ + endpoint: endpoint, + httpClient: httpClient, + } + c.setGoogleClientInfo() + + return &NodeTypesClient{internalClient: c, CallOptions: &NodeTypesCallOptions{}}, nil +} + +func defaultNodeTypesRESTClientOptions() []option.ClientOption { + return []option.ClientOption{ + internaloption.WithDefaultEndpoint("compute.googleapis.com"), + internaloption.WithDefaultMTLSEndpoint("compute.mtls.googleapis.com"), + internaloption.WithDefaultAudience("https://compute.googleapis.com/"), + internaloption.WithDefaultScopes(DefaultAuthScopes()...), + } +} + +// setGoogleClientInfo sets the name and version of the application in +// the `x-goog-api-client` header passed on each request. Intended for +// use by Google-written clients. +func (c *nodeTypesRESTClient) setGoogleClientInfo(keyval ...string) { + kv := append([]string{"gl-go", versionGo()}, keyval...) + kv = append(kv, "gapic", versionClient, "gax", gax.Version, "rest", "UNKNOWN") + c.xGoogMetadata = metadata.Pairs("x-goog-api-client", gax.XGoogHeader(kv...)) +} + +// Close closes the connection to the API service. The user should invoke this when +// the client is no longer required. +func (c *nodeTypesRESTClient) Close() error { + // Replace httpClient with nil to force cleanup. + c.httpClient = nil + return nil +} + +// Connection returns a connection to the API service. +// +// Deprecated. +func (c *nodeTypesRESTClient) Connection() *grpc.ClientConn { + return nil +} + +// AggregatedList retrieves an aggregated list of node types. +func (c *nodeTypesRESTClient) AggregatedList(ctx context.Context, req *computepb.AggregatedListNodeTypesRequest, opts ...gax.CallOption) (*computepb.NodeTypeAggregatedList, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/aggregated/nodeTypes", req.GetProject()) + + params := url.Values{} + if req != nil && req.Filter != nil { + params.Add("filter", fmt.Sprintf("%v", req.GetFilter())) + } + if req != nil && req.IncludeAllScopes != nil { + params.Add("includeAllScopes", fmt.Sprintf("%v", req.GetIncludeAllScopes())) + } + 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() + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.NodeTypeAggregatedList{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Get returns the specified node type. Gets a list of available node types by making a list() request. +func (c *nodeTypesRESTClient) Get(ctx context.Context, req *computepb.GetNodeTypeRequest, opts ...gax.CallOption) (*computepb.NodeType, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/zones/%v/nodeTypes/%v", req.GetProject(), req.GetZone(), req.GetNodeType()) + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.NodeType{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// List retrieves a list of node types available to the specified project. +func (c *nodeTypesRESTClient) List(ctx context.Context, req *computepb.ListNodeTypesRequest, opts ...gax.CallOption) (*computepb.NodeTypeList, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/zones/%v/nodeTypes", req.GetProject(), req.GetZone()) + + 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() + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.NodeTypeList{} + + return rsp, unm.Unmarshal(buf, rsp) +} diff --git a/compute/apiv1/node_types_client_example_test.go b/compute/apiv1/node_types_client_example_test.go new file mode 100644 index 00000000000..9f184468eac --- /dev/null +++ b/compute/apiv1/node_types_client_example_test.go @@ -0,0 +1,93 @@ +// Copyright 2021 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_test + +import ( + "context" + + compute "cloud.google.com/go/compute/apiv1" + computepb "google.golang.org/genproto/googleapis/cloud/compute/v1" +) + +func ExampleNewNodeTypesRESTClient() { + ctx := context.Background() + c, err := compute.NewNodeTypesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + // TODO: Use client. + _ = c +} + +func ExampleNodeTypesClient_AggregatedList() { + ctx := context.Background() + c, err := compute.NewNodeTypesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.AggregatedListNodeTypesRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.AggregatedList(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleNodeTypesClient_Get() { + ctx := context.Background() + c, err := compute.NewNodeTypesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.GetNodeTypeRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Get(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleNodeTypesClient_List() { + ctx := context.Background() + c, err := compute.NewNodeTypesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.ListNodeTypesRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.List(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} diff --git a/compute/apiv1/packet_mirrorings_client.go b/compute/apiv1/packet_mirrorings_client.go new file mode 100644 index 00000000000..2ddda96fccb --- /dev/null +++ b/compute/apiv1/packet_mirrorings_client.go @@ -0,0 +1,561 @@ +// Copyright 2021 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/ioutil" + "net/http" + "net/url" + + gax "github.com/googleapis/gax-go/v2" + "google.golang.org/api/option" + "google.golang.org/api/option/internaloption" + httptransport "google.golang.org/api/transport/http" + computepb "google.golang.org/genproto/googleapis/cloud/compute/v1" + "google.golang.org/grpc" + "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/encoding/protojson" +) + +var newPacketMirroringsClientHook clientHook + +// PacketMirroringsCallOptions contains the retry settings for each method of PacketMirroringsClient. +type PacketMirroringsCallOptions struct { + AggregatedList []gax.CallOption + Delete []gax.CallOption + Get []gax.CallOption + Insert []gax.CallOption + List []gax.CallOption + Patch []gax.CallOption + TestIamPermissions []gax.CallOption +} + +// internalPacketMirroringsClient is an interface that defines the methods availaible from Google Compute Engine API. +type internalPacketMirroringsClient interface { + Close() error + setGoogleClientInfo(...string) + Connection() *grpc.ClientConn + AggregatedList(context.Context, *computepb.AggregatedListPacketMirroringsRequest, ...gax.CallOption) (*computepb.PacketMirroringAggregatedList, error) + Delete(context.Context, *computepb.DeletePacketMirroringRequest, ...gax.CallOption) (*computepb.Operation, error) + Get(context.Context, *computepb.GetPacketMirroringRequest, ...gax.CallOption) (*computepb.PacketMirroring, error) + Insert(context.Context, *computepb.InsertPacketMirroringRequest, ...gax.CallOption) (*computepb.Operation, error) + List(context.Context, *computepb.ListPacketMirroringsRequest, ...gax.CallOption) (*computepb.PacketMirroringList, error) + Patch(context.Context, *computepb.PatchPacketMirroringRequest, ...gax.CallOption) (*computepb.Operation, error) + TestIamPermissions(context.Context, *computepb.TestIamPermissionsPacketMirroringRequest, ...gax.CallOption) (*computepb.TestPermissionsResponse, error) +} + +// PacketMirroringsClient 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 PacketMirrorings API. +type PacketMirroringsClient struct { + // The internal transport-dependent client. + internalClient internalPacketMirroringsClient + + // The call options for this service. + CallOptions *PacketMirroringsCallOptions +} + +// 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 *PacketMirroringsClient) 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 *PacketMirroringsClient) setGoogleClientInfo(keyval ...string) { + c.internalClient.setGoogleClientInfo(keyval...) +} + +// Connection returns a connection to the API service. +// +// Deprecated. +func (c *PacketMirroringsClient) Connection() *grpc.ClientConn { + return c.internalClient.Connection() +} + +// AggregatedList retrieves an aggregated list of packetMirrorings. +func (c *PacketMirroringsClient) AggregatedList(ctx context.Context, req *computepb.AggregatedListPacketMirroringsRequest, opts ...gax.CallOption) (*computepb.PacketMirroringAggregatedList, error) { + return c.internalClient.AggregatedList(ctx, req, opts...) +} + +// Delete deletes the specified PacketMirroring resource. +func (c *PacketMirroringsClient) Delete(ctx context.Context, req *computepb.DeletePacketMirroringRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.Delete(ctx, req, opts...) +} + +// Get returns the specified PacketMirroring resource. +func (c *PacketMirroringsClient) Get(ctx context.Context, req *computepb.GetPacketMirroringRequest, opts ...gax.CallOption) (*computepb.PacketMirroring, error) { + return c.internalClient.Get(ctx, req, opts...) +} + +// Insert creates a PacketMirroring resource in the specified project and region using the data included in the request. +func (c *PacketMirroringsClient) Insert(ctx context.Context, req *computepb.InsertPacketMirroringRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.Insert(ctx, req, opts...) +} + +// List retrieves a list of PacketMirroring resources available to the specified project and region. +func (c *PacketMirroringsClient) List(ctx context.Context, req *computepb.ListPacketMirroringsRequest, opts ...gax.CallOption) (*computepb.PacketMirroringList, error) { + return c.internalClient.List(ctx, req, opts...) +} + +// Patch patches the specified PacketMirroring resource with the data included in the request. This method supports PATCH semantics and uses JSON merge patch format and processing rules. +func (c *PacketMirroringsClient) Patch(ctx context.Context, req *computepb.PatchPacketMirroringRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.Patch(ctx, req, opts...) +} + +// TestIamPermissions returns permissions that a caller has on the specified resource. +func (c *PacketMirroringsClient) TestIamPermissions(ctx context.Context, req *computepb.TestIamPermissionsPacketMirroringRequest, opts ...gax.CallOption) (*computepb.TestPermissionsResponse, error) { + return c.internalClient.TestIamPermissions(ctx, req, opts...) +} + +// Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls. +type packetMirroringsRESTClient struct { + // The http endpoint to connect to. + endpoint string + + // The http client. + httpClient *http.Client + + // The x-goog-* metadata to be sent with each request. + xGoogMetadata metadata.MD +} + +// NewPacketMirroringsRESTClient creates a new packet mirrorings rest client. +// +// The PacketMirrorings API. +func NewPacketMirroringsRESTClient(ctx context.Context, opts ...option.ClientOption) (*PacketMirroringsClient, error) { + clientOpts := append(defaultPacketMirroringsRESTClientOptions(), opts...) + httpClient, endpoint, err := httptransport.NewClient(ctx, clientOpts...) + if err != nil { + return nil, err + } + + c := &packetMirroringsRESTClient{ + endpoint: endpoint, + httpClient: httpClient, + } + c.setGoogleClientInfo() + + return &PacketMirroringsClient{internalClient: c, CallOptions: &PacketMirroringsCallOptions{}}, nil +} + +func defaultPacketMirroringsRESTClientOptions() []option.ClientOption { + return []option.ClientOption{ + internaloption.WithDefaultEndpoint("compute.googleapis.com"), + internaloption.WithDefaultMTLSEndpoint("compute.mtls.googleapis.com"), + internaloption.WithDefaultAudience("https://compute.googleapis.com/"), + internaloption.WithDefaultScopes(DefaultAuthScopes()...), + } +} + +// setGoogleClientInfo sets the name and version of the application in +// the `x-goog-api-client` header passed on each request. Intended for +// use by Google-written clients. +func (c *packetMirroringsRESTClient) setGoogleClientInfo(keyval ...string) { + kv := append([]string{"gl-go", versionGo()}, keyval...) + kv = append(kv, "gapic", versionClient, "gax", gax.Version, "rest", "UNKNOWN") + c.xGoogMetadata = metadata.Pairs("x-goog-api-client", gax.XGoogHeader(kv...)) +} + +// Close closes the connection to the API service. The user should invoke this when +// the client is no longer required. +func (c *packetMirroringsRESTClient) Close() error { + // Replace httpClient with nil to force cleanup. + c.httpClient = nil + return nil +} + +// Connection returns a connection to the API service. +// +// Deprecated. +func (c *packetMirroringsRESTClient) Connection() *grpc.ClientConn { + return nil +} + +// AggregatedList retrieves an aggregated list of packetMirrorings. +func (c *packetMirroringsRESTClient) AggregatedList(ctx context.Context, req *computepb.AggregatedListPacketMirroringsRequest, opts ...gax.CallOption) (*computepb.PacketMirroringAggregatedList, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/aggregated/packetMirrorings", req.GetProject()) + + params := url.Values{} + if req != nil && req.Filter != nil { + params.Add("filter", fmt.Sprintf("%v", req.GetFilter())) + } + if req != nil && req.IncludeAllScopes != nil { + params.Add("includeAllScopes", fmt.Sprintf("%v", req.GetIncludeAllScopes())) + } + 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() + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.PacketMirroringAggregatedList{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Delete deletes the specified PacketMirroring resource. +func (c *packetMirroringsRESTClient) Delete(ctx context.Context, req *computepb.DeletePacketMirroringRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/packetMirrorings/%v", req.GetProject(), req.GetRegion(), req.GetPacketMirroring()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("DELETE", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Get returns the specified PacketMirroring resource. +func (c *packetMirroringsRESTClient) Get(ctx context.Context, req *computepb.GetPacketMirroringRequest, opts ...gax.CallOption) (*computepb.PacketMirroring, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/packetMirrorings/%v", req.GetProject(), req.GetRegion(), req.GetPacketMirroring()) + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.PacketMirroring{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Insert creates a PacketMirroring resource in the specified project and region using the data included in the request. +func (c *packetMirroringsRESTClient) Insert(ctx context.Context, req *computepb.InsertPacketMirroringRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetPacketMirroringResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/packetMirrorings", req.GetProject(), req.GetRegion()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// List retrieves a list of PacketMirroring resources available to the specified project and region. +func (c *packetMirroringsRESTClient) List(ctx context.Context, req *computepb.ListPacketMirroringsRequest, opts ...gax.CallOption) (*computepb.PacketMirroringList, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/packetMirrorings", 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() + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.PacketMirroringList{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Patch patches the specified PacketMirroring resource with the data included in the request. This method supports PATCH semantics and uses JSON merge patch format and processing rules. +func (c *packetMirroringsRESTClient) Patch(ctx context.Context, req *computepb.PatchPacketMirroringRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetPacketMirroringResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/packetMirrorings/%v", req.GetProject(), req.GetRegion(), req.GetPacketMirroring()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("PATCH", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// TestIamPermissions returns permissions that a caller has on the specified resource. +func (c *packetMirroringsRESTClient) TestIamPermissions(ctx context.Context, req *computepb.TestIamPermissionsPacketMirroringRequest, opts ...gax.CallOption) (*computepb.TestPermissionsResponse, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetTestPermissionsRequestResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/packetMirrorings/%v/testIamPermissions", req.GetProject(), req.GetRegion(), req.GetResource()) + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.TestPermissionsResponse{} + + return rsp, unm.Unmarshal(buf, rsp) +} diff --git a/compute/apiv1/packet_mirrorings_client_example_test.go b/compute/apiv1/packet_mirrorings_client_example_test.go new file mode 100644 index 00000000000..6ce5c37025e --- /dev/null +++ b/compute/apiv1/packet_mirrorings_client_example_test.go @@ -0,0 +1,169 @@ +// Copyright 2021 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_test + +import ( + "context" + + compute "cloud.google.com/go/compute/apiv1" + computepb "google.golang.org/genproto/googleapis/cloud/compute/v1" +) + +func ExampleNewPacketMirroringsRESTClient() { + ctx := context.Background() + c, err := compute.NewPacketMirroringsRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + // TODO: Use client. + _ = c +} + +func ExamplePacketMirroringsClient_AggregatedList() { + ctx := context.Background() + c, err := compute.NewPacketMirroringsRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.AggregatedListPacketMirroringsRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.AggregatedList(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExamplePacketMirroringsClient_Delete() { + ctx := context.Background() + c, err := compute.NewPacketMirroringsRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.DeletePacketMirroringRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Delete(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExamplePacketMirroringsClient_Get() { + ctx := context.Background() + c, err := compute.NewPacketMirroringsRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.GetPacketMirroringRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Get(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExamplePacketMirroringsClient_Insert() { + ctx := context.Background() + c, err := compute.NewPacketMirroringsRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.InsertPacketMirroringRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Insert(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExamplePacketMirroringsClient_List() { + ctx := context.Background() + c, err := compute.NewPacketMirroringsRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.ListPacketMirroringsRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.List(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExamplePacketMirroringsClient_Patch() { + ctx := context.Background() + c, err := compute.NewPacketMirroringsRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.PatchPacketMirroringRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Patch(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExamplePacketMirroringsClient_TestIamPermissions() { + ctx := context.Background() + c, err := compute.NewPacketMirroringsRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.TestIamPermissionsPacketMirroringRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.TestIamPermissions(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} diff --git a/compute/apiv1/projects_client.go b/compute/apiv1/projects_client.go new file mode 100644 index 00000000000..03d1aa434da --- /dev/null +++ b/compute/apiv1/projects_client.go @@ -0,0 +1,905 @@ +// Copyright 2021 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/ioutil" + "net/http" + "net/url" + + gax "github.com/googleapis/gax-go/v2" + "google.golang.org/api/option" + "google.golang.org/api/option/internaloption" + httptransport "google.golang.org/api/transport/http" + computepb "google.golang.org/genproto/googleapis/cloud/compute/v1" + "google.golang.org/grpc" + "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/encoding/protojson" +) + +var newProjectsClientHook clientHook + +// ProjectsCallOptions contains the retry settings for each method of ProjectsClient. +type ProjectsCallOptions struct { + DisableXpnHost []gax.CallOption + DisableXpnResource []gax.CallOption + EnableXpnHost []gax.CallOption + EnableXpnResource []gax.CallOption + Get []gax.CallOption + GetXpnHost []gax.CallOption + GetXpnResources []gax.CallOption + ListXpnHosts []gax.CallOption + MoveDisk []gax.CallOption + MoveInstance []gax.CallOption + SetCommonInstanceMetadata []gax.CallOption + SetDefaultNetworkTier []gax.CallOption + SetUsageExportBucket []gax.CallOption +} + +// internalProjectsClient is an interface that defines the methods availaible from Google Compute Engine API. +type internalProjectsClient interface { + Close() error + setGoogleClientInfo(...string) + Connection() *grpc.ClientConn + DisableXpnHost(context.Context, *computepb.DisableXpnHostProjectRequest, ...gax.CallOption) (*computepb.Operation, error) + DisableXpnResource(context.Context, *computepb.DisableXpnResourceProjectRequest, ...gax.CallOption) (*computepb.Operation, error) + EnableXpnHost(context.Context, *computepb.EnableXpnHostProjectRequest, ...gax.CallOption) (*computepb.Operation, error) + EnableXpnResource(context.Context, *computepb.EnableXpnResourceProjectRequest, ...gax.CallOption) (*computepb.Operation, error) + Get(context.Context, *computepb.GetProjectRequest, ...gax.CallOption) (*computepb.Project, error) + GetXpnHost(context.Context, *computepb.GetXpnHostProjectRequest, ...gax.CallOption) (*computepb.Project, error) + GetXpnResources(context.Context, *computepb.GetXpnResourcesProjectsRequest, ...gax.CallOption) (*computepb.ProjectsGetXpnResources, error) + ListXpnHosts(context.Context, *computepb.ListXpnHostsProjectsRequest, ...gax.CallOption) (*computepb.XpnHostList, error) + MoveDisk(context.Context, *computepb.MoveDiskProjectRequest, ...gax.CallOption) (*computepb.Operation, error) + MoveInstance(context.Context, *computepb.MoveInstanceProjectRequest, ...gax.CallOption) (*computepb.Operation, error) + SetCommonInstanceMetadata(context.Context, *computepb.SetCommonInstanceMetadataProjectRequest, ...gax.CallOption) (*computepb.Operation, error) + SetDefaultNetworkTier(context.Context, *computepb.SetDefaultNetworkTierProjectRequest, ...gax.CallOption) (*computepb.Operation, error) + SetUsageExportBucket(context.Context, *computepb.SetUsageExportBucketProjectRequest, ...gax.CallOption) (*computepb.Operation, error) +} + +// ProjectsClient 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 Projects API. +type ProjectsClient struct { + // The internal transport-dependent client. + internalClient internalProjectsClient + + // The call options for this service. + CallOptions *ProjectsCallOptions +} + +// 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 *ProjectsClient) 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 *ProjectsClient) setGoogleClientInfo(keyval ...string) { + c.internalClient.setGoogleClientInfo(keyval...) +} + +// Connection returns a connection to the API service. +// +// Deprecated. +func (c *ProjectsClient) Connection() *grpc.ClientConn { + return c.internalClient.Connection() +} + +// DisableXpnHost disable this project as a shared VPC host project. +func (c *ProjectsClient) DisableXpnHost(ctx context.Context, req *computepb.DisableXpnHostProjectRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.DisableXpnHost(ctx, req, opts...) +} + +// DisableXpnResource disable a service resource (also known as service project) associated with this host project. +func (c *ProjectsClient) DisableXpnResource(ctx context.Context, req *computepb.DisableXpnResourceProjectRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.DisableXpnResource(ctx, req, opts...) +} + +// EnableXpnHost enable this project as a shared VPC host project. +func (c *ProjectsClient) EnableXpnHost(ctx context.Context, req *computepb.EnableXpnHostProjectRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.EnableXpnHost(ctx, req, opts...) +} + +// EnableXpnResource enable service resource (a.k.a service project) for a host project, so that subnets in the host project can be used by instances in the service project. +func (c *ProjectsClient) EnableXpnResource(ctx context.Context, req *computepb.EnableXpnResourceProjectRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.EnableXpnResource(ctx, req, opts...) +} + +// Get returns the specified Project resource. +func (c *ProjectsClient) Get(ctx context.Context, req *computepb.GetProjectRequest, opts ...gax.CallOption) (*computepb.Project, error) { + return c.internalClient.Get(ctx, req, opts...) +} + +// GetXpnHost gets the shared VPC host project that this project links to. May be empty if no link exists. +func (c *ProjectsClient) GetXpnHost(ctx context.Context, req *computepb.GetXpnHostProjectRequest, opts ...gax.CallOption) (*computepb.Project, error) { + return c.internalClient.GetXpnHost(ctx, req, opts...) +} + +// GetXpnResources gets service resources (a.k.a service project) associated with this host project. +func (c *ProjectsClient) GetXpnResources(ctx context.Context, req *computepb.GetXpnResourcesProjectsRequest, opts ...gax.CallOption) (*computepb.ProjectsGetXpnResources, error) { + return c.internalClient.GetXpnResources(ctx, req, opts...) +} + +// ListXpnHosts lists all shared VPC host projects visible to the user in an organization. +func (c *ProjectsClient) ListXpnHosts(ctx context.Context, req *computepb.ListXpnHostsProjectsRequest, opts ...gax.CallOption) (*computepb.XpnHostList, error) { + return c.internalClient.ListXpnHosts(ctx, req, opts...) +} + +// MoveDisk moves a persistent disk from one zone to another. +func (c *ProjectsClient) MoveDisk(ctx context.Context, req *computepb.MoveDiskProjectRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.MoveDisk(ctx, req, opts...) +} + +// MoveInstance moves an instance and its attached persistent disks from one zone to another. +func (c *ProjectsClient) MoveInstance(ctx context.Context, req *computepb.MoveInstanceProjectRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.MoveInstance(ctx, req, opts...) +} + +// SetCommonInstanceMetadata sets metadata common to all instances within the specified project using the data included in the request. +func (c *ProjectsClient) SetCommonInstanceMetadata(ctx context.Context, req *computepb.SetCommonInstanceMetadataProjectRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.SetCommonInstanceMetadata(ctx, req, opts...) +} + +// SetDefaultNetworkTier sets the default network tier of the project. The default network tier is used when an address/forwardingRule/instance is created without specifying the network tier field. +func (c *ProjectsClient) SetDefaultNetworkTier(ctx context.Context, req *computepb.SetDefaultNetworkTierProjectRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.SetDefaultNetworkTier(ctx, req, opts...) +} + +// SetUsageExportBucket enables the usage export feature and sets the usage export bucket where reports are stored. If you provide an empty request body using this method, the usage export feature will be disabled. +func (c *ProjectsClient) SetUsageExportBucket(ctx context.Context, req *computepb.SetUsageExportBucketProjectRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.SetUsageExportBucket(ctx, req, opts...) +} + +// Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls. +type projectsRESTClient struct { + // The http endpoint to connect to. + endpoint string + + // The http client. + httpClient *http.Client + + // The x-goog-* metadata to be sent with each request. + xGoogMetadata metadata.MD +} + +// NewProjectsRESTClient creates a new projects rest client. +// +// The Projects API. +func NewProjectsRESTClient(ctx context.Context, opts ...option.ClientOption) (*ProjectsClient, error) { + clientOpts := append(defaultProjectsRESTClientOptions(), opts...) + httpClient, endpoint, err := httptransport.NewClient(ctx, clientOpts...) + if err != nil { + return nil, err + } + + c := &projectsRESTClient{ + endpoint: endpoint, + httpClient: httpClient, + } + c.setGoogleClientInfo() + + return &ProjectsClient{internalClient: c, CallOptions: &ProjectsCallOptions{}}, nil +} + +func defaultProjectsRESTClientOptions() []option.ClientOption { + return []option.ClientOption{ + internaloption.WithDefaultEndpoint("compute.googleapis.com"), + internaloption.WithDefaultMTLSEndpoint("compute.mtls.googleapis.com"), + internaloption.WithDefaultAudience("https://compute.googleapis.com/"), + internaloption.WithDefaultScopes(DefaultAuthScopes()...), + } +} + +// setGoogleClientInfo sets the name and version of the application in +// the `x-goog-api-client` header passed on each request. Intended for +// use by Google-written clients. +func (c *projectsRESTClient) setGoogleClientInfo(keyval ...string) { + kv := append([]string{"gl-go", versionGo()}, keyval...) + kv = append(kv, "gapic", versionClient, "gax", gax.Version, "rest", "UNKNOWN") + c.xGoogMetadata = metadata.Pairs("x-goog-api-client", gax.XGoogHeader(kv...)) +} + +// Close closes the connection to the API service. The user should invoke this when +// the client is no longer required. +func (c *projectsRESTClient) Close() error { + // Replace httpClient with nil to force cleanup. + c.httpClient = nil + return nil +} + +// Connection returns a connection to the API service. +// +// Deprecated. +func (c *projectsRESTClient) Connection() *grpc.ClientConn { + return nil +} + +// DisableXpnHost disable this project as a shared VPC host project. +func (c *projectsRESTClient) DisableXpnHost(ctx context.Context, req *computepb.DisableXpnHostProjectRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/disableXpnHost", req.GetProject()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// DisableXpnResource disable a service resource (also known as service project) associated with this host project. +func (c *projectsRESTClient) DisableXpnResource(ctx context.Context, req *computepb.DisableXpnResourceProjectRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetProjectsDisableXpnResourceRequestResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/disableXpnResource", req.GetProject()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// EnableXpnHost enable this project as a shared VPC host project. +func (c *projectsRESTClient) EnableXpnHost(ctx context.Context, req *computepb.EnableXpnHostProjectRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/enableXpnHost", req.GetProject()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// EnableXpnResource enable service resource (a.k.a service project) for a host project, so that subnets in the host project can be used by instances in the service project. +func (c *projectsRESTClient) EnableXpnResource(ctx context.Context, req *computepb.EnableXpnResourceProjectRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetProjectsEnableXpnResourceRequestResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/enableXpnResource", req.GetProject()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Get returns the specified Project resource. +func (c *projectsRESTClient) Get(ctx context.Context, req *computepb.GetProjectRequest, opts ...gax.CallOption) (*computepb.Project, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v", req.GetProject()) + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Project{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// GetXpnHost gets the shared VPC host project that this project links to. May be empty if no link exists. +func (c *projectsRESTClient) GetXpnHost(ctx context.Context, req *computepb.GetXpnHostProjectRequest, opts ...gax.CallOption) (*computepb.Project, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/getXpnHost", req.GetProject()) + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Project{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// GetXpnResources gets service resources (a.k.a service project) associated with this host project. +func (c *projectsRESTClient) GetXpnResources(ctx context.Context, req *computepb.GetXpnResourcesProjectsRequest, opts ...gax.CallOption) (*computepb.ProjectsGetXpnResources, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/getXpnResources", 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() + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.ProjectsGetXpnResources{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// ListXpnHosts lists all shared VPC host projects visible to the user in an organization. +func (c *projectsRESTClient) ListXpnHosts(ctx context.Context, req *computepb.ListXpnHostsProjectsRequest, opts ...gax.CallOption) (*computepb.XpnHostList, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetProjectsListXpnHostsRequestResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/listXpnHosts", 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() + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.XpnHostList{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// MoveDisk moves a persistent disk from one zone to another. +func (c *projectsRESTClient) MoveDisk(ctx context.Context, req *computepb.MoveDiskProjectRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetDiskMoveRequestResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/moveDisk", req.GetProject()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// MoveInstance moves an instance and its attached persistent disks from one zone to another. +func (c *projectsRESTClient) MoveInstance(ctx context.Context, req *computepb.MoveInstanceProjectRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetInstanceMoveRequestResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/moveInstance", req.GetProject()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// SetCommonInstanceMetadata sets metadata common to all instances within the specified project using the data included in the request. +func (c *projectsRESTClient) SetCommonInstanceMetadata(ctx context.Context, req *computepb.SetCommonInstanceMetadataProjectRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetMetadataResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/setCommonInstanceMetadata", req.GetProject()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// SetDefaultNetworkTier sets the default network tier of the project. The default network tier is used when an address/forwardingRule/instance is created without specifying the network tier field. +func (c *projectsRESTClient) SetDefaultNetworkTier(ctx context.Context, req *computepb.SetDefaultNetworkTierProjectRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetProjectsSetDefaultNetworkTierRequestResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/setDefaultNetworkTier", req.GetProject()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// SetUsageExportBucket enables the usage export feature and sets the usage export bucket where reports are stored. If you provide an empty request body using this method, the usage export feature will be disabled. +func (c *projectsRESTClient) SetUsageExportBucket(ctx context.Context, req *computepb.SetUsageExportBucketProjectRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetUsageExportLocationResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/setUsageExportBucket", req.GetProject()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} diff --git a/compute/apiv1/projects_client_example_test.go b/compute/apiv1/projects_client_example_test.go new file mode 100644 index 00000000000..7ef81b62889 --- /dev/null +++ b/compute/apiv1/projects_client_example_test.go @@ -0,0 +1,283 @@ +// Copyright 2021 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_test + +import ( + "context" + + compute "cloud.google.com/go/compute/apiv1" + computepb "google.golang.org/genproto/googleapis/cloud/compute/v1" +) + +func ExampleNewProjectsRESTClient() { + ctx := context.Background() + c, err := compute.NewProjectsRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + // TODO: Use client. + _ = c +} + +func ExampleProjectsClient_DisableXpnHost() { + ctx := context.Background() + c, err := compute.NewProjectsRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.DisableXpnHostProjectRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.DisableXpnHost(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleProjectsClient_DisableXpnResource() { + ctx := context.Background() + c, err := compute.NewProjectsRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.DisableXpnResourceProjectRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.DisableXpnResource(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleProjectsClient_EnableXpnHost() { + ctx := context.Background() + c, err := compute.NewProjectsRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.EnableXpnHostProjectRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.EnableXpnHost(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleProjectsClient_EnableXpnResource() { + ctx := context.Background() + c, err := compute.NewProjectsRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.EnableXpnResourceProjectRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.EnableXpnResource(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleProjectsClient_Get() { + ctx := context.Background() + c, err := compute.NewProjectsRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.GetProjectRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Get(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleProjectsClient_GetXpnHost() { + ctx := context.Background() + c, err := compute.NewProjectsRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.GetXpnHostProjectRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.GetXpnHost(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleProjectsClient_GetXpnResources() { + ctx := context.Background() + c, err := compute.NewProjectsRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.GetXpnResourcesProjectsRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.GetXpnResources(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleProjectsClient_ListXpnHosts() { + ctx := context.Background() + c, err := compute.NewProjectsRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.ListXpnHostsProjectsRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.ListXpnHosts(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleProjectsClient_MoveDisk() { + ctx := context.Background() + c, err := compute.NewProjectsRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.MoveDiskProjectRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.MoveDisk(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleProjectsClient_MoveInstance() { + ctx := context.Background() + c, err := compute.NewProjectsRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.MoveInstanceProjectRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.MoveInstance(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleProjectsClient_SetCommonInstanceMetadata() { + ctx := context.Background() + c, err := compute.NewProjectsRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.SetCommonInstanceMetadataProjectRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.SetCommonInstanceMetadata(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleProjectsClient_SetDefaultNetworkTier() { + ctx := context.Background() + c, err := compute.NewProjectsRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.SetDefaultNetworkTierProjectRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.SetDefaultNetworkTier(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleProjectsClient_SetUsageExportBucket() { + ctx := context.Background() + c, err := compute.NewProjectsRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.SetUsageExportBucketProjectRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.SetUsageExportBucket(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} diff --git a/compute/apiv1/public_advertised_prefixes_client.go b/compute/apiv1/public_advertised_prefixes_client.go new file mode 100644 index 00000000000..01f9fa03d1e --- /dev/null +++ b/compute/apiv1/public_advertised_prefixes_client.go @@ -0,0 +1,438 @@ +// Copyright 2021 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/ioutil" + "net/http" + "net/url" + + gax "github.com/googleapis/gax-go/v2" + "google.golang.org/api/option" + "google.golang.org/api/option/internaloption" + httptransport "google.golang.org/api/transport/http" + computepb "google.golang.org/genproto/googleapis/cloud/compute/v1" + "google.golang.org/grpc" + "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/encoding/protojson" +) + +var newPublicAdvertisedPrefixesClientHook clientHook + +// PublicAdvertisedPrefixesCallOptions contains the retry settings for each method of PublicAdvertisedPrefixesClient. +type PublicAdvertisedPrefixesCallOptions struct { + Delete []gax.CallOption + Get []gax.CallOption + Insert []gax.CallOption + List []gax.CallOption + Patch []gax.CallOption +} + +// internalPublicAdvertisedPrefixesClient is an interface that defines the methods availaible from Google Compute Engine API. +type internalPublicAdvertisedPrefixesClient interface { + Close() error + setGoogleClientInfo(...string) + Connection() *grpc.ClientConn + Delete(context.Context, *computepb.DeletePublicAdvertisedPrefixeRequest, ...gax.CallOption) (*computepb.Operation, error) + Get(context.Context, *computepb.GetPublicAdvertisedPrefixeRequest, ...gax.CallOption) (*computepb.PublicAdvertisedPrefix, error) + Insert(context.Context, *computepb.InsertPublicAdvertisedPrefixeRequest, ...gax.CallOption) (*computepb.Operation, error) + List(context.Context, *computepb.ListPublicAdvertisedPrefixesRequest, ...gax.CallOption) (*computepb.PublicAdvertisedPrefixList, error) + Patch(context.Context, *computepb.PatchPublicAdvertisedPrefixeRequest, ...gax.CallOption) (*computepb.Operation, error) +} + +// PublicAdvertisedPrefixesClient 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 PublicAdvertisedPrefixes API. +type PublicAdvertisedPrefixesClient struct { + // The internal transport-dependent client. + internalClient internalPublicAdvertisedPrefixesClient + + // The call options for this service. + CallOptions *PublicAdvertisedPrefixesCallOptions +} + +// 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 *PublicAdvertisedPrefixesClient) 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 *PublicAdvertisedPrefixesClient) setGoogleClientInfo(keyval ...string) { + c.internalClient.setGoogleClientInfo(keyval...) +} + +// Connection returns a connection to the API service. +// +// Deprecated. +func (c *PublicAdvertisedPrefixesClient) Connection() *grpc.ClientConn { + return c.internalClient.Connection() +} + +// Delete deletes the specified PublicAdvertisedPrefix +func (c *PublicAdvertisedPrefixesClient) Delete(ctx context.Context, req *computepb.DeletePublicAdvertisedPrefixeRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.Delete(ctx, req, opts...) +} + +// Get returns the specified PublicAdvertisedPrefix resource. +func (c *PublicAdvertisedPrefixesClient) Get(ctx context.Context, req *computepb.GetPublicAdvertisedPrefixeRequest, opts ...gax.CallOption) (*computepb.PublicAdvertisedPrefix, error) { + return c.internalClient.Get(ctx, req, opts...) +} + +// Insert creates a PublicAdvertisedPrefix in the specified project using the parameters that are included in the request. +func (c *PublicAdvertisedPrefixesClient) Insert(ctx context.Context, req *computepb.InsertPublicAdvertisedPrefixeRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.Insert(ctx, req, opts...) +} + +// List lists the PublicAdvertisedPrefixes for a project. +func (c *PublicAdvertisedPrefixesClient) List(ctx context.Context, req *computepb.ListPublicAdvertisedPrefixesRequest, opts ...gax.CallOption) (*computepb.PublicAdvertisedPrefixList, error) { + return c.internalClient.List(ctx, req, opts...) +} + +// Patch patches the specified Router resource with the data included in the request. This method supports PATCH semantics and uses JSON merge patch format and processing rules. +func (c *PublicAdvertisedPrefixesClient) Patch(ctx context.Context, req *computepb.PatchPublicAdvertisedPrefixeRequest, opts ...gax.CallOption) (*computepb.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 publicAdvertisedPrefixesRESTClient struct { + // The http endpoint to connect to. + endpoint string + + // The http client. + httpClient *http.Client + + // The x-goog-* metadata to be sent with each request. + xGoogMetadata metadata.MD +} + +// NewPublicAdvertisedPrefixesRESTClient creates a new public advertised prefixes rest client. +// +// The PublicAdvertisedPrefixes API. +func NewPublicAdvertisedPrefixesRESTClient(ctx context.Context, opts ...option.ClientOption) (*PublicAdvertisedPrefixesClient, error) { + clientOpts := append(defaultPublicAdvertisedPrefixesRESTClientOptions(), opts...) + httpClient, endpoint, err := httptransport.NewClient(ctx, clientOpts...) + if err != nil { + return nil, err + } + + c := &publicAdvertisedPrefixesRESTClient{ + endpoint: endpoint, + httpClient: httpClient, + } + c.setGoogleClientInfo() + + return &PublicAdvertisedPrefixesClient{internalClient: c, CallOptions: &PublicAdvertisedPrefixesCallOptions{}}, nil +} + +func defaultPublicAdvertisedPrefixesRESTClientOptions() []option.ClientOption { + return []option.ClientOption{ + internaloption.WithDefaultEndpoint("compute.googleapis.com"), + internaloption.WithDefaultMTLSEndpoint("compute.mtls.googleapis.com"), + internaloption.WithDefaultAudience("https://compute.googleapis.com/"), + internaloption.WithDefaultScopes(DefaultAuthScopes()...), + } +} + +// setGoogleClientInfo sets the name and version of the application in +// the `x-goog-api-client` header passed on each request. Intended for +// use by Google-written clients. +func (c *publicAdvertisedPrefixesRESTClient) setGoogleClientInfo(keyval ...string) { + kv := append([]string{"gl-go", versionGo()}, keyval...) + kv = append(kv, "gapic", versionClient, "gax", gax.Version, "rest", "UNKNOWN") + c.xGoogMetadata = metadata.Pairs("x-goog-api-client", gax.XGoogHeader(kv...)) +} + +// Close closes the connection to the API service. The user should invoke this when +// the client is no longer required. +func (c *publicAdvertisedPrefixesRESTClient) Close() error { + // Replace httpClient with nil to force cleanup. + c.httpClient = nil + return nil +} + +// Connection returns a connection to the API service. +// +// Deprecated. +func (c *publicAdvertisedPrefixesRESTClient) Connection() *grpc.ClientConn { + return nil +} + +// Delete deletes the specified PublicAdvertisedPrefix +func (c *publicAdvertisedPrefixesRESTClient) Delete(ctx context.Context, req *computepb.DeletePublicAdvertisedPrefixeRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/global/publicAdvertisedPrefixes/%v", 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() + + httpReq, err := http.NewRequest("DELETE", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Get returns the specified PublicAdvertisedPrefix resource. +func (c *publicAdvertisedPrefixesRESTClient) Get(ctx context.Context, req *computepb.GetPublicAdvertisedPrefixeRequest, opts ...gax.CallOption) (*computepb.PublicAdvertisedPrefix, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/global/publicAdvertisedPrefixes/%v", req.GetProject(), req.GetPublicAdvertisedPrefix()) + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.PublicAdvertisedPrefix{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Insert creates a PublicAdvertisedPrefix in the specified project using the parameters that are included in the request. +func (c *publicAdvertisedPrefixesRESTClient) Insert(ctx context.Context, req *computepb.InsertPublicAdvertisedPrefixeRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetPublicAdvertisedPrefixResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/global/publicAdvertisedPrefixes", req.GetProject()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// List lists the PublicAdvertisedPrefixes for a project. +func (c *publicAdvertisedPrefixesRESTClient) List(ctx context.Context, req *computepb.ListPublicAdvertisedPrefixesRequest, opts ...gax.CallOption) (*computepb.PublicAdvertisedPrefixList, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/global/publicAdvertisedPrefixes", 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() + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.PublicAdvertisedPrefixList{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Patch patches the specified Router resource with the data included in the request. This method supports PATCH semantics and uses JSON merge patch format and processing rules. +func (c *publicAdvertisedPrefixesRESTClient) Patch(ctx context.Context, req *computepb.PatchPublicAdvertisedPrefixeRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetPublicAdvertisedPrefixResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/global/publicAdvertisedPrefixes/%v", 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() + + httpReq, err := http.NewRequest("PATCH", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} diff --git a/compute/apiv1/public_advertised_prefixes_client_example_test.go b/compute/apiv1/public_advertised_prefixes_client_example_test.go new file mode 100644 index 00000000000..157318c0c4d --- /dev/null +++ b/compute/apiv1/public_advertised_prefixes_client_example_test.go @@ -0,0 +1,131 @@ +// Copyright 2021 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_test + +import ( + "context" + + compute "cloud.google.com/go/compute/apiv1" + computepb "google.golang.org/genproto/googleapis/cloud/compute/v1" +) + +func ExampleNewPublicAdvertisedPrefixesRESTClient() { + ctx := context.Background() + c, err := compute.NewPublicAdvertisedPrefixesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + // TODO: Use client. + _ = c +} + +func ExamplePublicAdvertisedPrefixesClient_Delete() { + ctx := context.Background() + c, err := compute.NewPublicAdvertisedPrefixesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.DeletePublicAdvertisedPrefixeRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Delete(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExamplePublicAdvertisedPrefixesClient_Get() { + ctx := context.Background() + c, err := compute.NewPublicAdvertisedPrefixesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.GetPublicAdvertisedPrefixeRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Get(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExamplePublicAdvertisedPrefixesClient_Insert() { + ctx := context.Background() + c, err := compute.NewPublicAdvertisedPrefixesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.InsertPublicAdvertisedPrefixeRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Insert(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExamplePublicAdvertisedPrefixesClient_List() { + ctx := context.Background() + c, err := compute.NewPublicAdvertisedPrefixesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.ListPublicAdvertisedPrefixesRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.List(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExamplePublicAdvertisedPrefixesClient_Patch() { + ctx := context.Background() + c, err := compute.NewPublicAdvertisedPrefixesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.PatchPublicAdvertisedPrefixeRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Patch(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} diff --git a/compute/apiv1/public_delegated_prefixes_client.go b/compute/apiv1/public_delegated_prefixes_client.go new file mode 100644 index 00000000000..5a186c8800e --- /dev/null +++ b/compute/apiv1/public_delegated_prefixes_client.go @@ -0,0 +1,510 @@ +// Copyright 2021 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/ioutil" + "net/http" + "net/url" + + gax "github.com/googleapis/gax-go/v2" + "google.golang.org/api/option" + "google.golang.org/api/option/internaloption" + httptransport "google.golang.org/api/transport/http" + computepb "google.golang.org/genproto/googleapis/cloud/compute/v1" + "google.golang.org/grpc" + "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/encoding/protojson" +) + +var newPublicDelegatedPrefixesClientHook clientHook + +// PublicDelegatedPrefixesCallOptions contains the retry settings for each method of PublicDelegatedPrefixesClient. +type PublicDelegatedPrefixesCallOptions struct { + AggregatedList []gax.CallOption + Delete []gax.CallOption + Get []gax.CallOption + Insert []gax.CallOption + List []gax.CallOption + Patch []gax.CallOption +} + +// internalPublicDelegatedPrefixesClient is an interface that defines the methods availaible from Google Compute Engine API. +type internalPublicDelegatedPrefixesClient interface { + Close() error + setGoogleClientInfo(...string) + Connection() *grpc.ClientConn + AggregatedList(context.Context, *computepb.AggregatedListPublicDelegatedPrefixesRequest, ...gax.CallOption) (*computepb.PublicDelegatedPrefixAggregatedList, error) + Delete(context.Context, *computepb.DeletePublicDelegatedPrefixeRequest, ...gax.CallOption) (*computepb.Operation, error) + Get(context.Context, *computepb.GetPublicDelegatedPrefixeRequest, ...gax.CallOption) (*computepb.PublicDelegatedPrefix, error) + Insert(context.Context, *computepb.InsertPublicDelegatedPrefixeRequest, ...gax.CallOption) (*computepb.Operation, error) + List(context.Context, *computepb.ListPublicDelegatedPrefixesRequest, ...gax.CallOption) (*computepb.PublicDelegatedPrefixList, error) + Patch(context.Context, *computepb.PatchPublicDelegatedPrefixeRequest, ...gax.CallOption) (*computepb.Operation, error) +} + +// PublicDelegatedPrefixesClient 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 PublicDelegatedPrefixes API. +type PublicDelegatedPrefixesClient struct { + // The internal transport-dependent client. + internalClient internalPublicDelegatedPrefixesClient + + // The call options for this service. + CallOptions *PublicDelegatedPrefixesCallOptions +} + +// 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 *PublicDelegatedPrefixesClient) 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 *PublicDelegatedPrefixesClient) setGoogleClientInfo(keyval ...string) { + c.internalClient.setGoogleClientInfo(keyval...) +} + +// Connection returns a connection to the API service. +// +// Deprecated. +func (c *PublicDelegatedPrefixesClient) Connection() *grpc.ClientConn { + return c.internalClient.Connection() +} + +// AggregatedList lists all PublicDelegatedPrefix resources owned by the specific project across all scopes. +func (c *PublicDelegatedPrefixesClient) AggregatedList(ctx context.Context, req *computepb.AggregatedListPublicDelegatedPrefixesRequest, opts ...gax.CallOption) (*computepb.PublicDelegatedPrefixAggregatedList, error) { + return c.internalClient.AggregatedList(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) (*computepb.Operation, error) { + return c.internalClient.Delete(ctx, req, opts...) +} + +// Get returns the specified PublicDelegatedPrefix resource in the given region. +func (c *PublicDelegatedPrefixesClient) Get(ctx context.Context, req *computepb.GetPublicDelegatedPrefixeRequest, opts ...gax.CallOption) (*computepb.PublicDelegatedPrefix, error) { + return c.internalClient.Get(ctx, req, opts...) +} + +// Insert creates a PublicDelegatedPrefix in the specified project in the given region using the parameters that are included in the request. +func (c *PublicDelegatedPrefixesClient) Insert(ctx context.Context, req *computepb.InsertPublicDelegatedPrefixeRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.Insert(ctx, req, opts...) +} + +// List lists the PublicDelegatedPrefixes for a project in the given region. +func (c *PublicDelegatedPrefixesClient) List(ctx context.Context, req *computepb.ListPublicDelegatedPrefixesRequest, opts ...gax.CallOption) (*computepb.PublicDelegatedPrefixList, error) { + return c.internalClient.List(ctx, req, opts...) +} + +// Patch patches the specified PublicDelegatedPrefix resource with the data included in the request. This method supports PATCH semantics and uses JSON merge patch format and processing rules. +func (c *PublicDelegatedPrefixesClient) Patch(ctx context.Context, req *computepb.PatchPublicDelegatedPrefixeRequest, opts ...gax.CallOption) (*computepb.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 publicDelegatedPrefixesRESTClient struct { + // The http endpoint to connect to. + endpoint string + + // The http client. + httpClient *http.Client + + // The x-goog-* metadata to be sent with each request. + xGoogMetadata metadata.MD +} + +// NewPublicDelegatedPrefixesRESTClient creates a new public delegated prefixes rest client. +// +// The PublicDelegatedPrefixes API. +func NewPublicDelegatedPrefixesRESTClient(ctx context.Context, opts ...option.ClientOption) (*PublicDelegatedPrefixesClient, error) { + clientOpts := append(defaultPublicDelegatedPrefixesRESTClientOptions(), opts...) + httpClient, endpoint, err := httptransport.NewClient(ctx, clientOpts...) + if err != nil { + return nil, err + } + + c := &publicDelegatedPrefixesRESTClient{ + endpoint: endpoint, + httpClient: httpClient, + } + c.setGoogleClientInfo() + + return &PublicDelegatedPrefixesClient{internalClient: c, CallOptions: &PublicDelegatedPrefixesCallOptions{}}, nil +} + +func defaultPublicDelegatedPrefixesRESTClientOptions() []option.ClientOption { + return []option.ClientOption{ + internaloption.WithDefaultEndpoint("compute.googleapis.com"), + internaloption.WithDefaultMTLSEndpoint("compute.mtls.googleapis.com"), + internaloption.WithDefaultAudience("https://compute.googleapis.com/"), + internaloption.WithDefaultScopes(DefaultAuthScopes()...), + } +} + +// setGoogleClientInfo sets the name and version of the application in +// the `x-goog-api-client` header passed on each request. Intended for +// use by Google-written clients. +func (c *publicDelegatedPrefixesRESTClient) setGoogleClientInfo(keyval ...string) { + kv := append([]string{"gl-go", versionGo()}, keyval...) + kv = append(kv, "gapic", versionClient, "gax", gax.Version, "rest", "UNKNOWN") + c.xGoogMetadata = metadata.Pairs("x-goog-api-client", gax.XGoogHeader(kv...)) +} + +// Close closes the connection to the API service. The user should invoke this when +// the client is no longer required. +func (c *publicDelegatedPrefixesRESTClient) Close() error { + // Replace httpClient with nil to force cleanup. + c.httpClient = nil + return nil +} + +// Connection returns a connection to the API service. +// +// Deprecated. +func (c *publicDelegatedPrefixesRESTClient) Connection() *grpc.ClientConn { + return nil +} + +// AggregatedList lists all PublicDelegatedPrefix resources owned by the specific project across all scopes. +func (c *publicDelegatedPrefixesRESTClient) AggregatedList(ctx context.Context, req *computepb.AggregatedListPublicDelegatedPrefixesRequest, opts ...gax.CallOption) (*computepb.PublicDelegatedPrefixAggregatedList, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/aggregated/publicDelegatedPrefixes", req.GetProject()) + + params := url.Values{} + if req != nil && req.Filter != nil { + params.Add("filter", fmt.Sprintf("%v", req.GetFilter())) + } + if req != nil && req.IncludeAllScopes != nil { + params.Add("includeAllScopes", fmt.Sprintf("%v", req.GetIncludeAllScopes())) + } + 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() + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.PublicDelegatedPrefixAggregatedList{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Delete deletes the specified PublicDelegatedPrefix in the given region. +func (c *publicDelegatedPrefixesRESTClient) Delete(ctx context.Context, req *computepb.DeletePublicDelegatedPrefixeRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/publicDelegatedPrefixes/%v", 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() + + httpReq, err := http.NewRequest("DELETE", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Get returns the specified PublicDelegatedPrefix resource in the given region. +func (c *publicDelegatedPrefixesRESTClient) Get(ctx context.Context, req *computepb.GetPublicDelegatedPrefixeRequest, opts ...gax.CallOption) (*computepb.PublicDelegatedPrefix, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/publicDelegatedPrefixes/%v", req.GetProject(), req.GetRegion(), req.GetPublicDelegatedPrefix()) + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.PublicDelegatedPrefix{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Insert creates a PublicDelegatedPrefix in the specified project in the given region using the parameters that are included in the request. +func (c *publicDelegatedPrefixesRESTClient) Insert(ctx context.Context, req *computepb.InsertPublicDelegatedPrefixeRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetPublicDelegatedPrefixResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/publicDelegatedPrefixes", req.GetProject(), req.GetRegion()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// List lists the PublicDelegatedPrefixes for a project in the given region. +func (c *publicDelegatedPrefixesRESTClient) List(ctx context.Context, req *computepb.ListPublicDelegatedPrefixesRequest, opts ...gax.CallOption) (*computepb.PublicDelegatedPrefixList, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/publicDelegatedPrefixes", 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() + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.PublicDelegatedPrefixList{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Patch patches the specified PublicDelegatedPrefix resource with the data included in the request. This method supports PATCH semantics and uses JSON merge patch format and processing rules. +func (c *publicDelegatedPrefixesRESTClient) Patch(ctx context.Context, req *computepb.PatchPublicDelegatedPrefixeRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetPublicDelegatedPrefixResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/publicDelegatedPrefixes/%v", 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() + + httpReq, err := http.NewRequest("PATCH", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} diff --git a/compute/apiv1/public_delegated_prefixes_client_example_test.go b/compute/apiv1/public_delegated_prefixes_client_example_test.go new file mode 100644 index 00000000000..c17586ce868 --- /dev/null +++ b/compute/apiv1/public_delegated_prefixes_client_example_test.go @@ -0,0 +1,150 @@ +// Copyright 2021 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_test + +import ( + "context" + + compute "cloud.google.com/go/compute/apiv1" + computepb "google.golang.org/genproto/googleapis/cloud/compute/v1" +) + +func ExampleNewPublicDelegatedPrefixesRESTClient() { + ctx := context.Background() + c, err := compute.NewPublicDelegatedPrefixesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + // TODO: Use client. + _ = c +} + +func ExamplePublicDelegatedPrefixesClient_AggregatedList() { + ctx := context.Background() + c, err := compute.NewPublicDelegatedPrefixesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.AggregatedListPublicDelegatedPrefixesRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.AggregatedList(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExamplePublicDelegatedPrefixesClient_Delete() { + ctx := context.Background() + c, err := compute.NewPublicDelegatedPrefixesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.DeletePublicDelegatedPrefixeRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Delete(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExamplePublicDelegatedPrefixesClient_Get() { + ctx := context.Background() + c, err := compute.NewPublicDelegatedPrefixesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.GetPublicDelegatedPrefixeRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Get(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExamplePublicDelegatedPrefixesClient_Insert() { + ctx := context.Background() + c, err := compute.NewPublicDelegatedPrefixesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.InsertPublicDelegatedPrefixeRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Insert(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExamplePublicDelegatedPrefixesClient_List() { + ctx := context.Background() + c, err := compute.NewPublicDelegatedPrefixesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.ListPublicDelegatedPrefixesRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.List(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExamplePublicDelegatedPrefixesClient_Patch() { + ctx := context.Background() + c, err := compute.NewPublicDelegatedPrefixesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.PatchPublicDelegatedPrefixeRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Patch(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} diff --git a/compute/apiv1/region_autoscalers_client.go b/compute/apiv1/region_autoscalers_client.go new file mode 100644 index 00000000000..32c026f5dcc --- /dev/null +++ b/compute/apiv1/region_autoscalers_client.go @@ -0,0 +1,508 @@ +// Copyright 2021 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/ioutil" + "net/http" + "net/url" + + gax "github.com/googleapis/gax-go/v2" + "google.golang.org/api/option" + "google.golang.org/api/option/internaloption" + httptransport "google.golang.org/api/transport/http" + computepb "google.golang.org/genproto/googleapis/cloud/compute/v1" + "google.golang.org/grpc" + "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/encoding/protojson" +) + +var newRegionAutoscalersClientHook clientHook + +// RegionAutoscalersCallOptions contains the retry settings for each method of RegionAutoscalersClient. +type RegionAutoscalersCallOptions struct { + Delete []gax.CallOption + Get []gax.CallOption + Insert []gax.CallOption + List []gax.CallOption + Patch []gax.CallOption + Update []gax.CallOption +} + +// internalRegionAutoscalersClient is an interface that defines the methods availaible from Google Compute Engine API. +type internalRegionAutoscalersClient interface { + Close() error + setGoogleClientInfo(...string) + Connection() *grpc.ClientConn + Delete(context.Context, *computepb.DeleteRegionAutoscalerRequest, ...gax.CallOption) (*computepb.Operation, error) + Get(context.Context, *computepb.GetRegionAutoscalerRequest, ...gax.CallOption) (*computepb.Autoscaler, error) + Insert(context.Context, *computepb.InsertRegionAutoscalerRequest, ...gax.CallOption) (*computepb.Operation, error) + List(context.Context, *computepb.ListRegionAutoscalersRequest, ...gax.CallOption) (*computepb.RegionAutoscalerList, error) + Patch(context.Context, *computepb.PatchRegionAutoscalerRequest, ...gax.CallOption) (*computepb.Operation, error) + Update(context.Context, *computepb.UpdateRegionAutoscalerRequest, ...gax.CallOption) (*computepb.Operation, error) +} + +// RegionAutoscalersClient 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 RegionAutoscalers API. +type RegionAutoscalersClient struct { + // The internal transport-dependent client. + internalClient internalRegionAutoscalersClient + + // The call options for this service. + CallOptions *RegionAutoscalersCallOptions +} + +// 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 *RegionAutoscalersClient) 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 *RegionAutoscalersClient) setGoogleClientInfo(keyval ...string) { + c.internalClient.setGoogleClientInfo(keyval...) +} + +// Connection returns a connection to the API service. +// +// Deprecated. +func (c *RegionAutoscalersClient) Connection() *grpc.ClientConn { + return c.internalClient.Connection() +} + +// Delete deletes the specified autoscaler. +func (c *RegionAutoscalersClient) Delete(ctx context.Context, req *computepb.DeleteRegionAutoscalerRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.Delete(ctx, req, opts...) +} + +// Get returns the specified autoscaler. +func (c *RegionAutoscalersClient) Get(ctx context.Context, req *computepb.GetRegionAutoscalerRequest, opts ...gax.CallOption) (*computepb.Autoscaler, error) { + return c.internalClient.Get(ctx, req, opts...) +} + +// Insert creates an autoscaler in the specified project using the data included in the request. +func (c *RegionAutoscalersClient) Insert(ctx context.Context, req *computepb.InsertRegionAutoscalerRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.Insert(ctx, req, opts...) +} + +// List retrieves a list of autoscalers contained within the specified region. +func (c *RegionAutoscalersClient) List(ctx context.Context, req *computepb.ListRegionAutoscalersRequest, opts ...gax.CallOption) (*computepb.RegionAutoscalerList, error) { + return c.internalClient.List(ctx, req, opts...) +} + +// Patch updates an autoscaler in the specified project using the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. +func (c *RegionAutoscalersClient) Patch(ctx context.Context, req *computepb.PatchRegionAutoscalerRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.Patch(ctx, req, opts...) +} + +// Update updates an autoscaler in the specified project using the data included in the request. +func (c *RegionAutoscalersClient) Update(ctx context.Context, req *computepb.UpdateRegionAutoscalerRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.Update(ctx, req, opts...) +} + +// Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls. +type regionAutoscalersRESTClient struct { + // The http endpoint to connect to. + endpoint string + + // The http client. + httpClient *http.Client + + // The x-goog-* metadata to be sent with each request. + xGoogMetadata metadata.MD +} + +// NewRegionAutoscalersRESTClient creates a new region autoscalers rest client. +// +// The RegionAutoscalers API. +func NewRegionAutoscalersRESTClient(ctx context.Context, opts ...option.ClientOption) (*RegionAutoscalersClient, error) { + clientOpts := append(defaultRegionAutoscalersRESTClientOptions(), opts...) + httpClient, endpoint, err := httptransport.NewClient(ctx, clientOpts...) + if err != nil { + return nil, err + } + + c := ®ionAutoscalersRESTClient{ + endpoint: endpoint, + httpClient: httpClient, + } + c.setGoogleClientInfo() + + return &RegionAutoscalersClient{internalClient: c, CallOptions: &RegionAutoscalersCallOptions{}}, nil +} + +func defaultRegionAutoscalersRESTClientOptions() []option.ClientOption { + return []option.ClientOption{ + internaloption.WithDefaultEndpoint("compute.googleapis.com"), + internaloption.WithDefaultMTLSEndpoint("compute.mtls.googleapis.com"), + internaloption.WithDefaultAudience("https://compute.googleapis.com/"), + internaloption.WithDefaultScopes(DefaultAuthScopes()...), + } +} + +// setGoogleClientInfo sets the name and version of the application in +// the `x-goog-api-client` header passed on each request. Intended for +// use by Google-written clients. +func (c *regionAutoscalersRESTClient) setGoogleClientInfo(keyval ...string) { + kv := append([]string{"gl-go", versionGo()}, keyval...) + kv = append(kv, "gapic", versionClient, "gax", gax.Version, "rest", "UNKNOWN") + c.xGoogMetadata = metadata.Pairs("x-goog-api-client", gax.XGoogHeader(kv...)) +} + +// Close closes the connection to the API service. The user should invoke this when +// the client is no longer required. +func (c *regionAutoscalersRESTClient) Close() error { + // Replace httpClient with nil to force cleanup. + c.httpClient = nil + return nil +} + +// Connection returns a connection to the API service. +// +// Deprecated. +func (c *regionAutoscalersRESTClient) Connection() *grpc.ClientConn { + return nil +} + +// Delete deletes the specified autoscaler. +func (c *regionAutoscalersRESTClient) Delete(ctx context.Context, req *computepb.DeleteRegionAutoscalerRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/autoscalers/%v", req.GetProject(), req.GetRegion(), req.GetAutoscaler()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("DELETE", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Get returns the specified autoscaler. +func (c *regionAutoscalersRESTClient) Get(ctx context.Context, req *computepb.GetRegionAutoscalerRequest, opts ...gax.CallOption) (*computepb.Autoscaler, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/autoscalers/%v", req.GetProject(), req.GetRegion(), req.GetAutoscaler()) + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Autoscaler{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Insert creates an autoscaler in the specified project using the data included in the request. +func (c *regionAutoscalersRESTClient) Insert(ctx context.Context, req *computepb.InsertRegionAutoscalerRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetAutoscalerResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/autoscalers", req.GetProject(), req.GetRegion()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// List retrieves a list of autoscalers contained within the specified region. +func (c *regionAutoscalersRESTClient) List(ctx context.Context, req *computepb.ListRegionAutoscalersRequest, opts ...gax.CallOption) (*computepb.RegionAutoscalerList, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/autoscalers", 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() + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.RegionAutoscalerList{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Patch updates an autoscaler in the specified project using the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. +func (c *regionAutoscalersRESTClient) Patch(ctx context.Context, req *computepb.PatchRegionAutoscalerRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetAutoscalerResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/autoscalers", req.GetProject(), req.GetRegion()) + + params := url.Values{} + if req != nil && req.Autoscaler != nil { + params.Add("autoscaler", fmt.Sprintf("%v", req.GetAutoscaler())) + } + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("PATCH", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Update updates an autoscaler in the specified project using the data included in the request. +func (c *regionAutoscalersRESTClient) Update(ctx context.Context, req *computepb.UpdateRegionAutoscalerRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetAutoscalerResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("") + + params := url.Values{} + if req != nil && req.Autoscaler != nil { + params.Add("autoscaler", fmt.Sprintf("%v", req.GetAutoscaler())) + } + if req.GetProject() != "" { + params.Add("project", fmt.Sprintf("%v", req.GetProject())) + } + if req.GetRegion() != "" { + params.Add("region", fmt.Sprintf("%v", req.GetRegion())) + } + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("PUT", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} diff --git a/compute/apiv1/region_autoscalers_client_example_test.go b/compute/apiv1/region_autoscalers_client_example_test.go new file mode 100644 index 00000000000..b3cf73327a8 --- /dev/null +++ b/compute/apiv1/region_autoscalers_client_example_test.go @@ -0,0 +1,150 @@ +// Copyright 2021 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_test + +import ( + "context" + + compute "cloud.google.com/go/compute/apiv1" + computepb "google.golang.org/genproto/googleapis/cloud/compute/v1" +) + +func ExampleNewRegionAutoscalersRESTClient() { + ctx := context.Background() + c, err := compute.NewRegionAutoscalersRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + // TODO: Use client. + _ = c +} + +func ExampleRegionAutoscalersClient_Delete() { + ctx := context.Background() + c, err := compute.NewRegionAutoscalersRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.DeleteRegionAutoscalerRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Delete(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleRegionAutoscalersClient_Get() { + ctx := context.Background() + c, err := compute.NewRegionAutoscalersRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.GetRegionAutoscalerRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Get(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleRegionAutoscalersClient_Insert() { + ctx := context.Background() + c, err := compute.NewRegionAutoscalersRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.InsertRegionAutoscalerRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Insert(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleRegionAutoscalersClient_List() { + ctx := context.Background() + c, err := compute.NewRegionAutoscalersRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.ListRegionAutoscalersRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.List(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleRegionAutoscalersClient_Patch() { + ctx := context.Background() + c, err := compute.NewRegionAutoscalersRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.PatchRegionAutoscalerRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Patch(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleRegionAutoscalersClient_Update() { + ctx := context.Background() + c, err := compute.NewRegionAutoscalersRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.UpdateRegionAutoscalerRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Update(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} diff --git a/compute/apiv1/region_backend_services_client.go b/compute/apiv1/region_backend_services_client.go new file mode 100644 index 00000000000..eae95808d2e --- /dev/null +++ b/compute/apiv1/region_backend_services_client.go @@ -0,0 +1,556 @@ +// Copyright 2021 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/ioutil" + "net/http" + "net/url" + + gax "github.com/googleapis/gax-go/v2" + "google.golang.org/api/option" + "google.golang.org/api/option/internaloption" + httptransport "google.golang.org/api/transport/http" + computepb "google.golang.org/genproto/googleapis/cloud/compute/v1" + "google.golang.org/grpc" + "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/encoding/protojson" +) + +var newRegionBackendServicesClientHook clientHook + +// RegionBackendServicesCallOptions contains the retry settings for each method of RegionBackendServicesClient. +type RegionBackendServicesCallOptions struct { + Delete []gax.CallOption + Get []gax.CallOption + GetHealth []gax.CallOption + Insert []gax.CallOption + List []gax.CallOption + Patch []gax.CallOption + Update []gax.CallOption +} + +// internalRegionBackendServicesClient is an interface that defines the methods availaible from Google Compute Engine API. +type internalRegionBackendServicesClient interface { + Close() error + setGoogleClientInfo(...string) + Connection() *grpc.ClientConn + Delete(context.Context, *computepb.DeleteRegionBackendServiceRequest, ...gax.CallOption) (*computepb.Operation, error) + Get(context.Context, *computepb.GetRegionBackendServiceRequest, ...gax.CallOption) (*computepb.BackendService, error) + GetHealth(context.Context, *computepb.GetHealthRegionBackendServiceRequest, ...gax.CallOption) (*computepb.BackendServiceGroupHealth, error) + Insert(context.Context, *computepb.InsertRegionBackendServiceRequest, ...gax.CallOption) (*computepb.Operation, error) + List(context.Context, *computepb.ListRegionBackendServicesRequest, ...gax.CallOption) (*computepb.BackendServiceList, error) + Patch(context.Context, *computepb.PatchRegionBackendServiceRequest, ...gax.CallOption) (*computepb.Operation, error) + Update(context.Context, *computepb.UpdateRegionBackendServiceRequest, ...gax.CallOption) (*computepb.Operation, error) +} + +// RegionBackendServicesClient 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 RegionBackendServices API. +type RegionBackendServicesClient struct { + // The internal transport-dependent client. + internalClient internalRegionBackendServicesClient + + // The call options for this service. + CallOptions *RegionBackendServicesCallOptions +} + +// 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 *RegionBackendServicesClient) 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 *RegionBackendServicesClient) setGoogleClientInfo(keyval ...string) { + c.internalClient.setGoogleClientInfo(keyval...) +} + +// Connection returns a connection to the API service. +// +// Deprecated. +func (c *RegionBackendServicesClient) Connection() *grpc.ClientConn { + return c.internalClient.Connection() +} + +// Delete deletes the specified regional BackendService resource. +func (c *RegionBackendServicesClient) Delete(ctx context.Context, req *computepb.DeleteRegionBackendServiceRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.Delete(ctx, req, opts...) +} + +// Get returns the specified regional BackendService resource. +func (c *RegionBackendServicesClient) Get(ctx context.Context, req *computepb.GetRegionBackendServiceRequest, opts ...gax.CallOption) (*computepb.BackendService, error) { + return c.internalClient.Get(ctx, req, opts...) +} + +// GetHealth gets the most recent health check results for this regional BackendService. +func (c *RegionBackendServicesClient) GetHealth(ctx context.Context, req *computepb.GetHealthRegionBackendServiceRequest, opts ...gax.CallOption) (*computepb.BackendServiceGroupHealth, error) { + return c.internalClient.GetHealth(ctx, req, opts...) +} + +// Insert creates a regional BackendService resource in the specified project using the data included in the request. For more information, see Backend services overview. +func (c *RegionBackendServicesClient) Insert(ctx context.Context, req *computepb.InsertRegionBackendServiceRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.Insert(ctx, req, opts...) +} + +// List retrieves the list of regional BackendService resources available to the specified project in the given region. +func (c *RegionBackendServicesClient) List(ctx context.Context, req *computepb.ListRegionBackendServicesRequest, opts ...gax.CallOption) (*computepb.BackendServiceList, error) { + return c.internalClient.List(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) (*computepb.Operation, error) { + return c.internalClient.Patch(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) (*computepb.Operation, error) { + return c.internalClient.Update(ctx, req, opts...) +} + +// Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls. +type regionBackendServicesRESTClient struct { + // The http endpoint to connect to. + endpoint string + + // The http client. + httpClient *http.Client + + // The x-goog-* metadata to be sent with each request. + xGoogMetadata metadata.MD +} + +// NewRegionBackendServicesRESTClient creates a new region backend services rest client. +// +// The RegionBackendServices API. +func NewRegionBackendServicesRESTClient(ctx context.Context, opts ...option.ClientOption) (*RegionBackendServicesClient, error) { + clientOpts := append(defaultRegionBackendServicesRESTClientOptions(), opts...) + httpClient, endpoint, err := httptransport.NewClient(ctx, clientOpts...) + if err != nil { + return nil, err + } + + c := ®ionBackendServicesRESTClient{ + endpoint: endpoint, + httpClient: httpClient, + } + c.setGoogleClientInfo() + + return &RegionBackendServicesClient{internalClient: c, CallOptions: &RegionBackendServicesCallOptions{}}, nil +} + +func defaultRegionBackendServicesRESTClientOptions() []option.ClientOption { + return []option.ClientOption{ + internaloption.WithDefaultEndpoint("compute.googleapis.com"), + internaloption.WithDefaultMTLSEndpoint("compute.mtls.googleapis.com"), + internaloption.WithDefaultAudience("https://compute.googleapis.com/"), + internaloption.WithDefaultScopes(DefaultAuthScopes()...), + } +} + +// setGoogleClientInfo sets the name and version of the application in +// the `x-goog-api-client` header passed on each request. Intended for +// use by Google-written clients. +func (c *regionBackendServicesRESTClient) setGoogleClientInfo(keyval ...string) { + kv := append([]string{"gl-go", versionGo()}, keyval...) + kv = append(kv, "gapic", versionClient, "gax", gax.Version, "rest", "UNKNOWN") + c.xGoogMetadata = metadata.Pairs("x-goog-api-client", gax.XGoogHeader(kv...)) +} + +// Close closes the connection to the API service. The user should invoke this when +// the client is no longer required. +func (c *regionBackendServicesRESTClient) Close() error { + // Replace httpClient with nil to force cleanup. + c.httpClient = nil + return nil +} + +// Connection returns a connection to the API service. +// +// Deprecated. +func (c *regionBackendServicesRESTClient) Connection() *grpc.ClientConn { + return nil +} + +// Delete deletes the specified regional BackendService resource. +func (c *regionBackendServicesRESTClient) Delete(ctx context.Context, req *computepb.DeleteRegionBackendServiceRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/backendServices/%v", 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() + + httpReq, err := http.NewRequest("DELETE", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Get returns the specified regional BackendService resource. +func (c *regionBackendServicesRESTClient) Get(ctx context.Context, req *computepb.GetRegionBackendServiceRequest, opts ...gax.CallOption) (*computepb.BackendService, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/backendServices/%v", req.GetProject(), req.GetRegion(), req.GetBackendService()) + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.BackendService{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// GetHealth gets the most recent health check results for this regional BackendService. +func (c *regionBackendServicesRESTClient) GetHealth(ctx context.Context, req *computepb.GetHealthRegionBackendServiceRequest, opts ...gax.CallOption) (*computepb.BackendServiceGroupHealth, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetResourceGroupReferenceResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/backendServices/%v/getHealth", req.GetProject(), req.GetRegion(), req.GetBackendService()) + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.BackendServiceGroupHealth{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Insert creates a regional BackendService resource in the specified project using the data included in the request. For more information, see Backend services overview. +func (c *regionBackendServicesRESTClient) Insert(ctx context.Context, req *computepb.InsertRegionBackendServiceRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetBackendServiceResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/backendServices", req.GetProject(), req.GetRegion()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// List retrieves the list of regional BackendService resources available to the specified project in the given region. +func (c *regionBackendServicesRESTClient) List(ctx context.Context, req *computepb.ListRegionBackendServicesRequest, opts ...gax.CallOption) (*computepb.BackendServiceList, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/backendServices", 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() + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.BackendServiceList{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// 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) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetBackendServiceResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/backendServices/%v", 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() + + httpReq, err := http.NewRequest("PATCH", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// 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) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetBackendServiceResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("") + + params := url.Values{} + if req.GetBackendService() != "" { + params.Add("backendService", fmt.Sprintf("%v", req.GetBackendService())) + } + if req.GetProject() != "" { + params.Add("project", fmt.Sprintf("%v", req.GetProject())) + } + if req.GetRegion() != "" { + params.Add("region", fmt.Sprintf("%v", req.GetRegion())) + } + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("PUT", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} diff --git a/compute/apiv1/region_backend_services_client_example_test.go b/compute/apiv1/region_backend_services_client_example_test.go new file mode 100644 index 00000000000..389fa3210c5 --- /dev/null +++ b/compute/apiv1/region_backend_services_client_example_test.go @@ -0,0 +1,169 @@ +// Copyright 2021 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_test + +import ( + "context" + + compute "cloud.google.com/go/compute/apiv1" + computepb "google.golang.org/genproto/googleapis/cloud/compute/v1" +) + +func ExampleNewRegionBackendServicesRESTClient() { + ctx := context.Background() + c, err := compute.NewRegionBackendServicesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + // TODO: Use client. + _ = c +} + +func ExampleRegionBackendServicesClient_Delete() { + ctx := context.Background() + c, err := compute.NewRegionBackendServicesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.DeleteRegionBackendServiceRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Delete(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleRegionBackendServicesClient_Get() { + ctx := context.Background() + c, err := compute.NewRegionBackendServicesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.GetRegionBackendServiceRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Get(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleRegionBackendServicesClient_GetHealth() { + ctx := context.Background() + c, err := compute.NewRegionBackendServicesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.GetHealthRegionBackendServiceRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.GetHealth(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleRegionBackendServicesClient_Insert() { + ctx := context.Background() + c, err := compute.NewRegionBackendServicesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.InsertRegionBackendServiceRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Insert(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleRegionBackendServicesClient_List() { + ctx := context.Background() + c, err := compute.NewRegionBackendServicesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.ListRegionBackendServicesRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.List(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleRegionBackendServicesClient_Patch() { + ctx := context.Background() + c, err := compute.NewRegionBackendServicesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.PatchRegionBackendServiceRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Patch(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleRegionBackendServicesClient_Update() { + ctx := context.Background() + c, err := compute.NewRegionBackendServicesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.UpdateRegionBackendServiceRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Update(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} diff --git a/compute/apiv1/region_commitments_client.go b/compute/apiv1/region_commitments_client.go new file mode 100644 index 00000000000..c0990697de2 --- /dev/null +++ b/compute/apiv1/region_commitments_client.go @@ -0,0 +1,395 @@ +// Copyright 2021 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/ioutil" + "net/http" + "net/url" + + gax "github.com/googleapis/gax-go/v2" + "google.golang.org/api/option" + "google.golang.org/api/option/internaloption" + httptransport "google.golang.org/api/transport/http" + computepb "google.golang.org/genproto/googleapis/cloud/compute/v1" + "google.golang.org/grpc" + "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/encoding/protojson" +) + +var newRegionCommitmentsClientHook clientHook + +// RegionCommitmentsCallOptions contains the retry settings for each method of RegionCommitmentsClient. +type RegionCommitmentsCallOptions struct { + AggregatedList []gax.CallOption + Get []gax.CallOption + Insert []gax.CallOption + List []gax.CallOption +} + +// internalRegionCommitmentsClient is an interface that defines the methods availaible from Google Compute Engine API. +type internalRegionCommitmentsClient interface { + Close() error + setGoogleClientInfo(...string) + Connection() *grpc.ClientConn + AggregatedList(context.Context, *computepb.AggregatedListRegionCommitmentsRequest, ...gax.CallOption) (*computepb.CommitmentAggregatedList, error) + Get(context.Context, *computepb.GetRegionCommitmentRequest, ...gax.CallOption) (*computepb.Commitment, error) + Insert(context.Context, *computepb.InsertRegionCommitmentRequest, ...gax.CallOption) (*computepb.Operation, error) + List(context.Context, *computepb.ListRegionCommitmentsRequest, ...gax.CallOption) (*computepb.CommitmentList, error) +} + +// RegionCommitmentsClient 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 RegionCommitments API. +type RegionCommitmentsClient struct { + // The internal transport-dependent client. + internalClient internalRegionCommitmentsClient + + // The call options for this service. + CallOptions *RegionCommitmentsCallOptions +} + +// 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 *RegionCommitmentsClient) 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 *RegionCommitmentsClient) setGoogleClientInfo(keyval ...string) { + c.internalClient.setGoogleClientInfo(keyval...) +} + +// Connection returns a connection to the API service. +// +// Deprecated. +func (c *RegionCommitmentsClient) Connection() *grpc.ClientConn { + return c.internalClient.Connection() +} + +// AggregatedList retrieves an aggregated list of commitments. +func (c *RegionCommitmentsClient) AggregatedList(ctx context.Context, req *computepb.AggregatedListRegionCommitmentsRequest, opts ...gax.CallOption) (*computepb.CommitmentAggregatedList, error) { + return c.internalClient.AggregatedList(ctx, req, opts...) +} + +// Get returns the specified commitment resource. Gets a list of available commitments by making a list() request. +func (c *RegionCommitmentsClient) Get(ctx context.Context, req *computepb.GetRegionCommitmentRequest, opts ...gax.CallOption) (*computepb.Commitment, error) { + return c.internalClient.Get(ctx, req, opts...) +} + +// Insert creates a commitment in the specified project using the data included in the request. +func (c *RegionCommitmentsClient) Insert(ctx context.Context, req *computepb.InsertRegionCommitmentRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.Insert(ctx, req, opts...) +} + +// List retrieves a list of commitments contained within the specified region. +func (c *RegionCommitmentsClient) List(ctx context.Context, req *computepb.ListRegionCommitmentsRequest, opts ...gax.CallOption) (*computepb.CommitmentList, error) { + return c.internalClient.List(ctx, req, opts...) +} + +// Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls. +type regionCommitmentsRESTClient struct { + // The http endpoint to connect to. + endpoint string + + // The http client. + httpClient *http.Client + + // The x-goog-* metadata to be sent with each request. + xGoogMetadata metadata.MD +} + +// NewRegionCommitmentsRESTClient creates a new region commitments rest client. +// +// The RegionCommitments API. +func NewRegionCommitmentsRESTClient(ctx context.Context, opts ...option.ClientOption) (*RegionCommitmentsClient, error) { + clientOpts := append(defaultRegionCommitmentsRESTClientOptions(), opts...) + httpClient, endpoint, err := httptransport.NewClient(ctx, clientOpts...) + if err != nil { + return nil, err + } + + c := ®ionCommitmentsRESTClient{ + endpoint: endpoint, + httpClient: httpClient, + } + c.setGoogleClientInfo() + + return &RegionCommitmentsClient{internalClient: c, CallOptions: &RegionCommitmentsCallOptions{}}, nil +} + +func defaultRegionCommitmentsRESTClientOptions() []option.ClientOption { + return []option.ClientOption{ + internaloption.WithDefaultEndpoint("compute.googleapis.com"), + internaloption.WithDefaultMTLSEndpoint("compute.mtls.googleapis.com"), + internaloption.WithDefaultAudience("https://compute.googleapis.com/"), + internaloption.WithDefaultScopes(DefaultAuthScopes()...), + } +} + +// setGoogleClientInfo sets the name and version of the application in +// the `x-goog-api-client` header passed on each request. Intended for +// use by Google-written clients. +func (c *regionCommitmentsRESTClient) setGoogleClientInfo(keyval ...string) { + kv := append([]string{"gl-go", versionGo()}, keyval...) + kv = append(kv, "gapic", versionClient, "gax", gax.Version, "rest", "UNKNOWN") + c.xGoogMetadata = metadata.Pairs("x-goog-api-client", gax.XGoogHeader(kv...)) +} + +// Close closes the connection to the API service. The user should invoke this when +// the client is no longer required. +func (c *regionCommitmentsRESTClient) Close() error { + // Replace httpClient with nil to force cleanup. + c.httpClient = nil + return nil +} + +// Connection returns a connection to the API service. +// +// Deprecated. +func (c *regionCommitmentsRESTClient) Connection() *grpc.ClientConn { + return nil +} + +// AggregatedList retrieves an aggregated list of commitments. +func (c *regionCommitmentsRESTClient) AggregatedList(ctx context.Context, req *computepb.AggregatedListRegionCommitmentsRequest, opts ...gax.CallOption) (*computepb.CommitmentAggregatedList, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/aggregated/commitments", req.GetProject()) + + params := url.Values{} + if req != nil && req.Filter != nil { + params.Add("filter", fmt.Sprintf("%v", req.GetFilter())) + } + if req != nil && req.IncludeAllScopes != nil { + params.Add("includeAllScopes", fmt.Sprintf("%v", req.GetIncludeAllScopes())) + } + 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() + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.CommitmentAggregatedList{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Get returns the specified commitment resource. Gets a list of available commitments by making a list() request. +func (c *regionCommitmentsRESTClient) Get(ctx context.Context, req *computepb.GetRegionCommitmentRequest, opts ...gax.CallOption) (*computepb.Commitment, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/commitments/%v", req.GetProject(), req.GetRegion(), req.GetCommitment()) + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Commitment{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Insert creates a commitment in the specified project using the data included in the request. +func (c *regionCommitmentsRESTClient) Insert(ctx context.Context, req *computepb.InsertRegionCommitmentRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetCommitmentResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/commitments", req.GetProject(), req.GetRegion()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// List retrieves a list of commitments contained within the specified region. +func (c *regionCommitmentsRESTClient) List(ctx context.Context, req *computepb.ListRegionCommitmentsRequest, opts ...gax.CallOption) (*computepb.CommitmentList, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/commitments", 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() + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.CommitmentList{} + + return rsp, unm.Unmarshal(buf, rsp) +} diff --git a/compute/apiv1/region_commitments_client_example_test.go b/compute/apiv1/region_commitments_client_example_test.go new file mode 100644 index 00000000000..5cc685667d4 --- /dev/null +++ b/compute/apiv1/region_commitments_client_example_test.go @@ -0,0 +1,112 @@ +// Copyright 2021 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_test + +import ( + "context" + + compute "cloud.google.com/go/compute/apiv1" + computepb "google.golang.org/genproto/googleapis/cloud/compute/v1" +) + +func ExampleNewRegionCommitmentsRESTClient() { + ctx := context.Background() + c, err := compute.NewRegionCommitmentsRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + // TODO: Use client. + _ = c +} + +func ExampleRegionCommitmentsClient_AggregatedList() { + ctx := context.Background() + c, err := compute.NewRegionCommitmentsRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.AggregatedListRegionCommitmentsRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.AggregatedList(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleRegionCommitmentsClient_Get() { + ctx := context.Background() + c, err := compute.NewRegionCommitmentsRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.GetRegionCommitmentRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Get(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleRegionCommitmentsClient_Insert() { + ctx := context.Background() + c, err := compute.NewRegionCommitmentsRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.InsertRegionCommitmentRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Insert(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleRegionCommitmentsClient_List() { + ctx := context.Background() + c, err := compute.NewRegionCommitmentsRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.ListRegionCommitmentsRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.List(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} diff --git a/compute/apiv1/region_disk_types_client.go b/compute/apiv1/region_disk_types_client.go new file mode 100644 index 00000000000..cc443bbbbfd --- /dev/null +++ b/compute/apiv1/region_disk_types_client.go @@ -0,0 +1,265 @@ +// Copyright 2021 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/ioutil" + "net/http" + "net/url" + + gax "github.com/googleapis/gax-go/v2" + "google.golang.org/api/option" + "google.golang.org/api/option/internaloption" + httptransport "google.golang.org/api/transport/http" + computepb "google.golang.org/genproto/googleapis/cloud/compute/v1" + "google.golang.org/grpc" + "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/encoding/protojson" +) + +var newRegionDiskTypesClientHook clientHook + +// RegionDiskTypesCallOptions contains the retry settings for each method of RegionDiskTypesClient. +type RegionDiskTypesCallOptions struct { + Get []gax.CallOption + List []gax.CallOption +} + +// internalRegionDiskTypesClient is an interface that defines the methods availaible from Google Compute Engine API. +type internalRegionDiskTypesClient interface { + Close() error + setGoogleClientInfo(...string) + Connection() *grpc.ClientConn + Get(context.Context, *computepb.GetRegionDiskTypeRequest, ...gax.CallOption) (*computepb.DiskType, error) + List(context.Context, *computepb.ListRegionDiskTypesRequest, ...gax.CallOption) (*computepb.RegionDiskTypeList, error) +} + +// RegionDiskTypesClient 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 RegionDiskTypes API. +type RegionDiskTypesClient struct { + // The internal transport-dependent client. + internalClient internalRegionDiskTypesClient + + // The call options for this service. + CallOptions *RegionDiskTypesCallOptions +} + +// 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 *RegionDiskTypesClient) 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 *RegionDiskTypesClient) setGoogleClientInfo(keyval ...string) { + c.internalClient.setGoogleClientInfo(keyval...) +} + +// Connection returns a connection to the API service. +// +// Deprecated. +func (c *RegionDiskTypesClient) Connection() *grpc.ClientConn { + return c.internalClient.Connection() +} + +// Get returns the specified regional disk type. Gets a list of available disk types by making a list() request. +func (c *RegionDiskTypesClient) Get(ctx context.Context, req *computepb.GetRegionDiskTypeRequest, opts ...gax.CallOption) (*computepb.DiskType, error) { + return c.internalClient.Get(ctx, req, opts...) +} + +// List retrieves a list of regional disk types available to the specified project. +func (c *RegionDiskTypesClient) List(ctx context.Context, req *computepb.ListRegionDiskTypesRequest, opts ...gax.CallOption) (*computepb.RegionDiskTypeList, error) { + return c.internalClient.List(ctx, req, opts...) +} + +// Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls. +type regionDiskTypesRESTClient struct { + // The http endpoint to connect to. + endpoint string + + // The http client. + httpClient *http.Client + + // The x-goog-* metadata to be sent with each request. + xGoogMetadata metadata.MD +} + +// NewRegionDiskTypesRESTClient creates a new region disk types rest client. +// +// The RegionDiskTypes API. +func NewRegionDiskTypesRESTClient(ctx context.Context, opts ...option.ClientOption) (*RegionDiskTypesClient, error) { + clientOpts := append(defaultRegionDiskTypesRESTClientOptions(), opts...) + httpClient, endpoint, err := httptransport.NewClient(ctx, clientOpts...) + if err != nil { + return nil, err + } + + c := ®ionDiskTypesRESTClient{ + endpoint: endpoint, + httpClient: httpClient, + } + c.setGoogleClientInfo() + + return &RegionDiskTypesClient{internalClient: c, CallOptions: &RegionDiskTypesCallOptions{}}, nil +} + +func defaultRegionDiskTypesRESTClientOptions() []option.ClientOption { + return []option.ClientOption{ + internaloption.WithDefaultEndpoint("compute.googleapis.com"), + internaloption.WithDefaultMTLSEndpoint("compute.mtls.googleapis.com"), + internaloption.WithDefaultAudience("https://compute.googleapis.com/"), + internaloption.WithDefaultScopes(DefaultAuthScopes()...), + } +} + +// setGoogleClientInfo sets the name and version of the application in +// the `x-goog-api-client` header passed on each request. Intended for +// use by Google-written clients. +func (c *regionDiskTypesRESTClient) setGoogleClientInfo(keyval ...string) { + kv := append([]string{"gl-go", versionGo()}, keyval...) + kv = append(kv, "gapic", versionClient, "gax", gax.Version, "rest", "UNKNOWN") + c.xGoogMetadata = metadata.Pairs("x-goog-api-client", gax.XGoogHeader(kv...)) +} + +// Close closes the connection to the API service. The user should invoke this when +// the client is no longer required. +func (c *regionDiskTypesRESTClient) Close() error { + // Replace httpClient with nil to force cleanup. + c.httpClient = nil + return nil +} + +// Connection returns a connection to the API service. +// +// Deprecated. +func (c *regionDiskTypesRESTClient) Connection() *grpc.ClientConn { + return nil +} + +// Get returns the specified regional disk type. Gets a list of available disk types by making a list() request. +func (c *regionDiskTypesRESTClient) Get(ctx context.Context, req *computepb.GetRegionDiskTypeRequest, opts ...gax.CallOption) (*computepb.DiskType, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/diskTypes/%v", req.GetProject(), req.GetRegion(), req.GetDiskType()) + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.DiskType{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// List retrieves a list of regional disk types available to the specified project. +func (c *regionDiskTypesRESTClient) List(ctx context.Context, req *computepb.ListRegionDiskTypesRequest, opts ...gax.CallOption) (*computepb.RegionDiskTypeList, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/diskTypes", 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() + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.RegionDiskTypeList{} + + return rsp, unm.Unmarshal(buf, rsp) +} diff --git a/compute/apiv1/region_disk_types_client_example_test.go b/compute/apiv1/region_disk_types_client_example_test.go new file mode 100644 index 00000000000..a7d34452891 --- /dev/null +++ b/compute/apiv1/region_disk_types_client_example_test.go @@ -0,0 +1,74 @@ +// Copyright 2021 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_test + +import ( + "context" + + compute "cloud.google.com/go/compute/apiv1" + computepb "google.golang.org/genproto/googleapis/cloud/compute/v1" +) + +func ExampleNewRegionDiskTypesRESTClient() { + ctx := context.Background() + c, err := compute.NewRegionDiskTypesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + // TODO: Use client. + _ = c +} + +func ExampleRegionDiskTypesClient_Get() { + ctx := context.Background() + c, err := compute.NewRegionDiskTypesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.GetRegionDiskTypeRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Get(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleRegionDiskTypesClient_List() { + ctx := context.Background() + c, err := compute.NewRegionDiskTypesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.ListRegionDiskTypesRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.List(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} diff --git a/compute/apiv1/region_disks_client.go b/compute/apiv1/region_disks_client.go new file mode 100644 index 00000000000..5707403df02 --- /dev/null +++ b/compute/apiv1/region_disks_client.go @@ -0,0 +1,832 @@ +// Copyright 2021 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/ioutil" + "net/http" + "net/url" + + gax "github.com/googleapis/gax-go/v2" + "google.golang.org/api/option" + "google.golang.org/api/option/internaloption" + httptransport "google.golang.org/api/transport/http" + computepb "google.golang.org/genproto/googleapis/cloud/compute/v1" + "google.golang.org/grpc" + "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/encoding/protojson" +) + +var newRegionDisksClientHook clientHook + +// RegionDisksCallOptions contains the retry settings for each method of RegionDisksClient. +type RegionDisksCallOptions struct { + AddResourcePolicies []gax.CallOption + CreateSnapshot []gax.CallOption + Delete []gax.CallOption + Get []gax.CallOption + GetIamPolicy []gax.CallOption + Insert []gax.CallOption + List []gax.CallOption + RemoveResourcePolicies []gax.CallOption + Resize []gax.CallOption + SetIamPolicy []gax.CallOption + SetLabels []gax.CallOption + TestIamPermissions []gax.CallOption +} + +// internalRegionDisksClient is an interface that defines the methods availaible from Google Compute Engine API. +type internalRegionDisksClient interface { + Close() error + setGoogleClientInfo(...string) + Connection() *grpc.ClientConn + AddResourcePolicies(context.Context, *computepb.AddResourcePoliciesRegionDiskRequest, ...gax.CallOption) (*computepb.Operation, error) + CreateSnapshot(context.Context, *computepb.CreateSnapshotRegionDiskRequest, ...gax.CallOption) (*computepb.Operation, error) + Delete(context.Context, *computepb.DeleteRegionDiskRequest, ...gax.CallOption) (*computepb.Operation, error) + Get(context.Context, *computepb.GetRegionDiskRequest, ...gax.CallOption) (*computepb.Disk, error) + GetIamPolicy(context.Context, *computepb.GetIamPolicyRegionDiskRequest, ...gax.CallOption) (*computepb.Policy, error) + Insert(context.Context, *computepb.InsertRegionDiskRequest, ...gax.CallOption) (*computepb.Operation, error) + List(context.Context, *computepb.ListRegionDisksRequest, ...gax.CallOption) (*computepb.DiskList, error) + RemoveResourcePolicies(context.Context, *computepb.RemoveResourcePoliciesRegionDiskRequest, ...gax.CallOption) (*computepb.Operation, error) + Resize(context.Context, *computepb.ResizeRegionDiskRequest, ...gax.CallOption) (*computepb.Operation, error) + SetIamPolicy(context.Context, *computepb.SetIamPolicyRegionDiskRequest, ...gax.CallOption) (*computepb.Policy, error) + SetLabels(context.Context, *computepb.SetLabelsRegionDiskRequest, ...gax.CallOption) (*computepb.Operation, error) + TestIamPermissions(context.Context, *computepb.TestIamPermissionsRegionDiskRequest, ...gax.CallOption) (*computepb.TestPermissionsResponse, error) +} + +// RegionDisksClient 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 RegionDisks API. +type RegionDisksClient struct { + // The internal transport-dependent client. + internalClient internalRegionDisksClient + + // The call options for this service. + CallOptions *RegionDisksCallOptions +} + +// 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 *RegionDisksClient) 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 *RegionDisksClient) setGoogleClientInfo(keyval ...string) { + c.internalClient.setGoogleClientInfo(keyval...) +} + +// Connection returns a connection to the API service. +// +// Deprecated. +func (c *RegionDisksClient) Connection() *grpc.ClientConn { + return c.internalClient.Connection() +} + +// AddResourcePolicies adds existing resource policies to a regional disk. You can only add one policy which will be applied to this disk for scheduling snapshot creation. +func (c *RegionDisksClient) AddResourcePolicies(ctx context.Context, req *computepb.AddResourcePoliciesRegionDiskRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.AddResourcePolicies(ctx, req, opts...) +} + +// CreateSnapshot creates a snapshot of this regional disk. +func (c *RegionDisksClient) CreateSnapshot(ctx context.Context, req *computepb.CreateSnapshotRegionDiskRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.CreateSnapshot(ctx, req, opts...) +} + +// Delete deletes the specified regional persistent disk. Deleting a regional disk removes all the replicas of its data permanently and is irreversible. However, deleting a disk does not delete any snapshots previously made from the disk. You must separately delete snapshots. +func (c *RegionDisksClient) Delete(ctx context.Context, req *computepb.DeleteRegionDiskRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.Delete(ctx, req, opts...) +} + +// Get returns a specified regional persistent disk. +func (c *RegionDisksClient) Get(ctx context.Context, req *computepb.GetRegionDiskRequest, opts ...gax.CallOption) (*computepb.Disk, error) { + 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 *RegionDisksClient) GetIamPolicy(ctx context.Context, req *computepb.GetIamPolicyRegionDiskRequest, opts ...gax.CallOption) (*computepb.Policy, error) { + return c.internalClient.GetIamPolicy(ctx, req, opts...) +} + +// Insert creates a persistent regional disk in the specified project using the data included in the request. +func (c *RegionDisksClient) Insert(ctx context.Context, req *computepb.InsertRegionDiskRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.Insert(ctx, req, opts...) +} + +// List retrieves the list of persistent disks contained within the specified region. +func (c *RegionDisksClient) List(ctx context.Context, req *computepb.ListRegionDisksRequest, opts ...gax.CallOption) (*computepb.DiskList, error) { + return c.internalClient.List(ctx, req, opts...) +} + +// RemoveResourcePolicies removes resource policies from a regional disk. +func (c *RegionDisksClient) RemoveResourcePolicies(ctx context.Context, req *computepb.RemoveResourcePoliciesRegionDiskRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.RemoveResourcePolicies(ctx, req, opts...) +} + +// Resize resizes the specified regional persistent disk. +func (c *RegionDisksClient) Resize(ctx context.Context, req *computepb.ResizeRegionDiskRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.Resize(ctx, req, opts...) +} + +// SetIamPolicy sets the access control policy on the specified resource. Replaces any existing policy. +func (c *RegionDisksClient) SetIamPolicy(ctx context.Context, req *computepb.SetIamPolicyRegionDiskRequest, opts ...gax.CallOption) (*computepb.Policy, error) { + return c.internalClient.SetIamPolicy(ctx, req, opts...) +} + +// SetLabels sets the labels on the target regional disk. +func (c *RegionDisksClient) SetLabels(ctx context.Context, req *computepb.SetLabelsRegionDiskRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.SetLabels(ctx, req, opts...) +} + +// TestIamPermissions returns permissions that a caller has on the specified resource. +func (c *RegionDisksClient) TestIamPermissions(ctx context.Context, req *computepb.TestIamPermissionsRegionDiskRequest, opts ...gax.CallOption) (*computepb.TestPermissionsResponse, error) { + return c.internalClient.TestIamPermissions(ctx, req, opts...) +} + +// Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls. +type regionDisksRESTClient struct { + // The http endpoint to connect to. + endpoint string + + // The http client. + httpClient *http.Client + + // The x-goog-* metadata to be sent with each request. + xGoogMetadata metadata.MD +} + +// NewRegionDisksRESTClient creates a new region disks rest client. +// +// The RegionDisks API. +func NewRegionDisksRESTClient(ctx context.Context, opts ...option.ClientOption) (*RegionDisksClient, error) { + clientOpts := append(defaultRegionDisksRESTClientOptions(), opts...) + httpClient, endpoint, err := httptransport.NewClient(ctx, clientOpts...) + if err != nil { + return nil, err + } + + c := ®ionDisksRESTClient{ + endpoint: endpoint, + httpClient: httpClient, + } + c.setGoogleClientInfo() + + return &RegionDisksClient{internalClient: c, CallOptions: &RegionDisksCallOptions{}}, nil +} + +func defaultRegionDisksRESTClientOptions() []option.ClientOption { + return []option.ClientOption{ + internaloption.WithDefaultEndpoint("compute.googleapis.com"), + internaloption.WithDefaultMTLSEndpoint("compute.mtls.googleapis.com"), + internaloption.WithDefaultAudience("https://compute.googleapis.com/"), + internaloption.WithDefaultScopes(DefaultAuthScopes()...), + } +} + +// setGoogleClientInfo sets the name and version of the application in +// the `x-goog-api-client` header passed on each request. Intended for +// use by Google-written clients. +func (c *regionDisksRESTClient) setGoogleClientInfo(keyval ...string) { + kv := append([]string{"gl-go", versionGo()}, keyval...) + kv = append(kv, "gapic", versionClient, "gax", gax.Version, "rest", "UNKNOWN") + c.xGoogMetadata = metadata.Pairs("x-goog-api-client", gax.XGoogHeader(kv...)) +} + +// Close closes the connection to the API service. The user should invoke this when +// the client is no longer required. +func (c *regionDisksRESTClient) Close() error { + // Replace httpClient with nil to force cleanup. + c.httpClient = nil + return nil +} + +// Connection returns a connection to the API service. +// +// Deprecated. +func (c *regionDisksRESTClient) Connection() *grpc.ClientConn { + return nil +} + +// AddResourcePolicies adds existing resource policies to a regional disk. You can only add one policy which will be applied to this disk for scheduling snapshot creation. +func (c *regionDisksRESTClient) AddResourcePolicies(ctx context.Context, req *computepb.AddResourcePoliciesRegionDiskRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetRegionDisksAddResourcePoliciesRequestResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/disks/%v/addResourcePolicies", req.GetProject(), req.GetRegion(), req.GetDisk()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// CreateSnapshot creates a snapshot of this regional disk. +func (c *regionDisksRESTClient) CreateSnapshot(ctx context.Context, req *computepb.CreateSnapshotRegionDiskRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetSnapshotResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/disks/%v/createSnapshot", req.GetProject(), req.GetRegion(), req.GetDisk()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Delete deletes the specified regional persistent disk. Deleting a regional disk removes all the replicas of its data permanently and is irreversible. However, deleting a disk does not delete any snapshots previously made from the disk. You must separately delete snapshots. +func (c *regionDisksRESTClient) Delete(ctx context.Context, req *computepb.DeleteRegionDiskRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/disks/%v", req.GetProject(), req.GetRegion(), req.GetDisk()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("DELETE", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Get returns a specified regional persistent disk. +func (c *regionDisksRESTClient) Get(ctx context.Context, req *computepb.GetRegionDiskRequest, opts ...gax.CallOption) (*computepb.Disk, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/disks/%v", req.GetProject(), req.GetRegion(), req.GetDisk()) + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Disk{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// GetIamPolicy gets the access control policy for a resource. May be empty if no such policy or resource exists. +func (c *regionDisksRESTClient) GetIamPolicy(ctx context.Context, req *computepb.GetIamPolicyRegionDiskRequest, opts ...gax.CallOption) (*computepb.Policy, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/disks/%v/getIamPolicy", req.GetProject(), req.GetRegion(), req.GetResource()) + + params := url.Values{} + if req != nil && req.OptionsRequestedPolicyVersion != nil { + params.Add("optionsRequestedPolicyVersion", fmt.Sprintf("%v", req.GetOptionsRequestedPolicyVersion())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Policy{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Insert creates a persistent regional disk in the specified project using the data included in the request. +func (c *regionDisksRESTClient) Insert(ctx context.Context, req *computepb.InsertRegionDiskRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetDiskResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/disks", req.GetProject(), req.GetRegion()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + if req != nil && req.SourceImage != nil { + params.Add("sourceImage", fmt.Sprintf("%v", req.GetSourceImage())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// List retrieves the list of persistent disks contained within the specified region. +func (c *regionDisksRESTClient) List(ctx context.Context, req *computepb.ListRegionDisksRequest, opts ...gax.CallOption) (*computepb.DiskList, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/disks", 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() + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.DiskList{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// RemoveResourcePolicies removes resource policies from a regional disk. +func (c *regionDisksRESTClient) RemoveResourcePolicies(ctx context.Context, req *computepb.RemoveResourcePoliciesRegionDiskRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetRegionDisksRemoveResourcePoliciesRequestResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/disks/%v/removeResourcePolicies", req.GetProject(), req.GetRegion(), req.GetDisk()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Resize resizes the specified regional persistent disk. +func (c *regionDisksRESTClient) Resize(ctx context.Context, req *computepb.ResizeRegionDiskRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetRegionDisksResizeRequestResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/disks/%v/resize", req.GetProject(), req.GetRegion(), req.GetDisk()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// SetIamPolicy sets the access control policy on the specified resource. Replaces any existing policy. +func (c *regionDisksRESTClient) SetIamPolicy(ctx context.Context, req *computepb.SetIamPolicyRegionDiskRequest, opts ...gax.CallOption) (*computepb.Policy, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetRegionSetPolicyRequestResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/disks/%v/setIamPolicy", req.GetProject(), req.GetRegion(), req.GetResource()) + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Policy{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// SetLabels sets the labels on the target regional disk. +func (c *regionDisksRESTClient) SetLabels(ctx context.Context, req *computepb.SetLabelsRegionDiskRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetRegionSetLabelsRequestResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/disks/%v/setLabels", req.GetProject(), req.GetRegion(), req.GetResource()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// TestIamPermissions returns permissions that a caller has on the specified resource. +func (c *regionDisksRESTClient) TestIamPermissions(ctx context.Context, req *computepb.TestIamPermissionsRegionDiskRequest, opts ...gax.CallOption) (*computepb.TestPermissionsResponse, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetTestPermissionsRequestResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/disks/%v/testIamPermissions", req.GetProject(), req.GetRegion(), req.GetResource()) + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.TestPermissionsResponse{} + + return rsp, unm.Unmarshal(buf, rsp) +} diff --git a/compute/apiv1/region_disks_client_example_test.go b/compute/apiv1/region_disks_client_example_test.go new file mode 100644 index 00000000000..fbef3946358 --- /dev/null +++ b/compute/apiv1/region_disks_client_example_test.go @@ -0,0 +1,264 @@ +// Copyright 2021 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_test + +import ( + "context" + + compute "cloud.google.com/go/compute/apiv1" + computepb "google.golang.org/genproto/googleapis/cloud/compute/v1" +) + +func ExampleNewRegionDisksRESTClient() { + ctx := context.Background() + c, err := compute.NewRegionDisksRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + // TODO: Use client. + _ = c +} + +func ExampleRegionDisksClient_AddResourcePolicies() { + ctx := context.Background() + c, err := compute.NewRegionDisksRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.AddResourcePoliciesRegionDiskRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.AddResourcePolicies(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleRegionDisksClient_CreateSnapshot() { + ctx := context.Background() + c, err := compute.NewRegionDisksRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.CreateSnapshotRegionDiskRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.CreateSnapshot(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleRegionDisksClient_Delete() { + ctx := context.Background() + c, err := compute.NewRegionDisksRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.DeleteRegionDiskRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Delete(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleRegionDisksClient_Get() { + ctx := context.Background() + c, err := compute.NewRegionDisksRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.GetRegionDiskRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Get(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleRegionDisksClient_GetIamPolicy() { + ctx := context.Background() + c, err := compute.NewRegionDisksRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.GetIamPolicyRegionDiskRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.GetIamPolicy(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleRegionDisksClient_Insert() { + ctx := context.Background() + c, err := compute.NewRegionDisksRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.InsertRegionDiskRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Insert(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleRegionDisksClient_List() { + ctx := context.Background() + c, err := compute.NewRegionDisksRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.ListRegionDisksRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.List(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleRegionDisksClient_RemoveResourcePolicies() { + ctx := context.Background() + c, err := compute.NewRegionDisksRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.RemoveResourcePoliciesRegionDiskRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.RemoveResourcePolicies(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleRegionDisksClient_Resize() { + ctx := context.Background() + c, err := compute.NewRegionDisksRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.ResizeRegionDiskRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Resize(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleRegionDisksClient_SetIamPolicy() { + ctx := context.Background() + c, err := compute.NewRegionDisksRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.SetIamPolicyRegionDiskRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.SetIamPolicy(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleRegionDisksClient_SetLabels() { + ctx := context.Background() + c, err := compute.NewRegionDisksRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.SetLabelsRegionDiskRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.SetLabels(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleRegionDisksClient_TestIamPermissions() { + ctx := context.Background() + c, err := compute.NewRegionDisksRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.TestIamPermissionsRegionDiskRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.TestIamPermissions(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} diff --git a/compute/apiv1/region_health_check_services_client.go b/compute/apiv1/region_health_check_services_client.go new file mode 100644 index 00000000000..7e7ece75de3 --- /dev/null +++ b/compute/apiv1/region_health_check_services_client.go @@ -0,0 +1,438 @@ +// Copyright 2021 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/ioutil" + "net/http" + "net/url" + + gax "github.com/googleapis/gax-go/v2" + "google.golang.org/api/option" + "google.golang.org/api/option/internaloption" + httptransport "google.golang.org/api/transport/http" + computepb "google.golang.org/genproto/googleapis/cloud/compute/v1" + "google.golang.org/grpc" + "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/encoding/protojson" +) + +var newRegionHealthCheckServicesClientHook clientHook + +// RegionHealthCheckServicesCallOptions contains the retry settings for each method of RegionHealthCheckServicesClient. +type RegionHealthCheckServicesCallOptions struct { + Delete []gax.CallOption + Get []gax.CallOption + Insert []gax.CallOption + List []gax.CallOption + Patch []gax.CallOption +} + +// internalRegionHealthCheckServicesClient is an interface that defines the methods availaible from Google Compute Engine API. +type internalRegionHealthCheckServicesClient interface { + Close() error + setGoogleClientInfo(...string) + Connection() *grpc.ClientConn + Delete(context.Context, *computepb.DeleteRegionHealthCheckServiceRequest, ...gax.CallOption) (*computepb.Operation, error) + Get(context.Context, *computepb.GetRegionHealthCheckServiceRequest, ...gax.CallOption) (*computepb.HealthCheckService, error) + Insert(context.Context, *computepb.InsertRegionHealthCheckServiceRequest, ...gax.CallOption) (*computepb.Operation, error) + List(context.Context, *computepb.ListRegionHealthCheckServicesRequest, ...gax.CallOption) (*computepb.HealthCheckServicesList, error) + Patch(context.Context, *computepb.PatchRegionHealthCheckServiceRequest, ...gax.CallOption) (*computepb.Operation, error) +} + +// RegionHealthCheckServicesClient 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 RegionHealthCheckServices API. +type RegionHealthCheckServicesClient struct { + // The internal transport-dependent client. + internalClient internalRegionHealthCheckServicesClient + + // The call options for this service. + CallOptions *RegionHealthCheckServicesCallOptions +} + +// 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 *RegionHealthCheckServicesClient) 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 *RegionHealthCheckServicesClient) setGoogleClientInfo(keyval ...string) { + c.internalClient.setGoogleClientInfo(keyval...) +} + +// Connection returns a connection to the API service. +// +// Deprecated. +func (c *RegionHealthCheckServicesClient) Connection() *grpc.ClientConn { + return c.internalClient.Connection() +} + +// Delete deletes the specified regional HealthCheckService. +func (c *RegionHealthCheckServicesClient) Delete(ctx context.Context, req *computepb.DeleteRegionHealthCheckServiceRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.Delete(ctx, req, opts...) +} + +// Get returns the specified regional HealthCheckService resource. +func (c *RegionHealthCheckServicesClient) Get(ctx context.Context, req *computepb.GetRegionHealthCheckServiceRequest, opts ...gax.CallOption) (*computepb.HealthCheckService, error) { + return c.internalClient.Get(ctx, req, opts...) +} + +// Insert creates a regional HealthCheckService resource in the specified project and region using the data included in the request. +func (c *RegionHealthCheckServicesClient) Insert(ctx context.Context, req *computepb.InsertRegionHealthCheckServiceRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.Insert(ctx, req, opts...) +} + +// List lists all the HealthCheckService resources that have been configured for the specified project in the given region. +func (c *RegionHealthCheckServicesClient) List(ctx context.Context, req *computepb.ListRegionHealthCheckServicesRequest, opts ...gax.CallOption) (*computepb.HealthCheckServicesList, error) { + return c.internalClient.List(ctx, req, opts...) +} + +// Patch updates the specified regional HealthCheckService resource with the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. +func (c *RegionHealthCheckServicesClient) Patch(ctx context.Context, req *computepb.PatchRegionHealthCheckServiceRequest, opts ...gax.CallOption) (*computepb.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 regionHealthCheckServicesRESTClient struct { + // The http endpoint to connect to. + endpoint string + + // The http client. + httpClient *http.Client + + // The x-goog-* metadata to be sent with each request. + xGoogMetadata metadata.MD +} + +// NewRegionHealthCheckServicesRESTClient creates a new region health check services rest client. +// +// The RegionHealthCheckServices API. +func NewRegionHealthCheckServicesRESTClient(ctx context.Context, opts ...option.ClientOption) (*RegionHealthCheckServicesClient, error) { + clientOpts := append(defaultRegionHealthCheckServicesRESTClientOptions(), opts...) + httpClient, endpoint, err := httptransport.NewClient(ctx, clientOpts...) + if err != nil { + return nil, err + } + + c := ®ionHealthCheckServicesRESTClient{ + endpoint: endpoint, + httpClient: httpClient, + } + c.setGoogleClientInfo() + + return &RegionHealthCheckServicesClient{internalClient: c, CallOptions: &RegionHealthCheckServicesCallOptions{}}, nil +} + +func defaultRegionHealthCheckServicesRESTClientOptions() []option.ClientOption { + return []option.ClientOption{ + internaloption.WithDefaultEndpoint("compute.googleapis.com"), + internaloption.WithDefaultMTLSEndpoint("compute.mtls.googleapis.com"), + internaloption.WithDefaultAudience("https://compute.googleapis.com/"), + internaloption.WithDefaultScopes(DefaultAuthScopes()...), + } +} + +// setGoogleClientInfo sets the name and version of the application in +// the `x-goog-api-client` header passed on each request. Intended for +// use by Google-written clients. +func (c *regionHealthCheckServicesRESTClient) setGoogleClientInfo(keyval ...string) { + kv := append([]string{"gl-go", versionGo()}, keyval...) + kv = append(kv, "gapic", versionClient, "gax", gax.Version, "rest", "UNKNOWN") + c.xGoogMetadata = metadata.Pairs("x-goog-api-client", gax.XGoogHeader(kv...)) +} + +// Close closes the connection to the API service. The user should invoke this when +// the client is no longer required. +func (c *regionHealthCheckServicesRESTClient) Close() error { + // Replace httpClient with nil to force cleanup. + c.httpClient = nil + return nil +} + +// Connection returns a connection to the API service. +// +// Deprecated. +func (c *regionHealthCheckServicesRESTClient) Connection() *grpc.ClientConn { + return nil +} + +// Delete deletes the specified regional HealthCheckService. +func (c *regionHealthCheckServicesRESTClient) Delete(ctx context.Context, req *computepb.DeleteRegionHealthCheckServiceRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/healthCheckServices/%v", req.GetProject(), req.GetRegion(), req.GetHealthCheckService()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("DELETE", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Get returns the specified regional HealthCheckService resource. +func (c *regionHealthCheckServicesRESTClient) Get(ctx context.Context, req *computepb.GetRegionHealthCheckServiceRequest, opts ...gax.CallOption) (*computepb.HealthCheckService, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/healthCheckServices/%v", req.GetProject(), req.GetRegion(), req.GetHealthCheckService()) + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.HealthCheckService{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Insert creates a regional HealthCheckService resource in the specified project and region using the data included in the request. +func (c *regionHealthCheckServicesRESTClient) Insert(ctx context.Context, req *computepb.InsertRegionHealthCheckServiceRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetHealthCheckServiceResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/healthCheckServices", req.GetProject(), req.GetRegion()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// List lists all the HealthCheckService resources that have been configured for the specified project in the given region. +func (c *regionHealthCheckServicesRESTClient) List(ctx context.Context, req *computepb.ListRegionHealthCheckServicesRequest, opts ...gax.CallOption) (*computepb.HealthCheckServicesList, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/healthCheckServices", 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() + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.HealthCheckServicesList{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Patch updates the specified regional HealthCheckService resource with the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. +func (c *regionHealthCheckServicesRESTClient) Patch(ctx context.Context, req *computepb.PatchRegionHealthCheckServiceRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetHealthCheckServiceResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/healthCheckServices/%v", req.GetProject(), req.GetRegion(), req.GetHealthCheckService()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("PATCH", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} diff --git a/compute/apiv1/region_health_check_services_client_example_test.go b/compute/apiv1/region_health_check_services_client_example_test.go new file mode 100644 index 00000000000..bbaf17d8152 --- /dev/null +++ b/compute/apiv1/region_health_check_services_client_example_test.go @@ -0,0 +1,131 @@ +// Copyright 2021 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_test + +import ( + "context" + + compute "cloud.google.com/go/compute/apiv1" + computepb "google.golang.org/genproto/googleapis/cloud/compute/v1" +) + +func ExampleNewRegionHealthCheckServicesRESTClient() { + ctx := context.Background() + c, err := compute.NewRegionHealthCheckServicesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + // TODO: Use client. + _ = c +} + +func ExampleRegionHealthCheckServicesClient_Delete() { + ctx := context.Background() + c, err := compute.NewRegionHealthCheckServicesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.DeleteRegionHealthCheckServiceRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Delete(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleRegionHealthCheckServicesClient_Get() { + ctx := context.Background() + c, err := compute.NewRegionHealthCheckServicesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.GetRegionHealthCheckServiceRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Get(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleRegionHealthCheckServicesClient_Insert() { + ctx := context.Background() + c, err := compute.NewRegionHealthCheckServicesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.InsertRegionHealthCheckServiceRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Insert(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleRegionHealthCheckServicesClient_List() { + ctx := context.Background() + c, err := compute.NewRegionHealthCheckServicesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.ListRegionHealthCheckServicesRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.List(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleRegionHealthCheckServicesClient_Patch() { + ctx := context.Background() + c, err := compute.NewRegionHealthCheckServicesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.PatchRegionHealthCheckServiceRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Patch(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} diff --git a/compute/apiv1/region_health_checks_client.go b/compute/apiv1/region_health_checks_client.go new file mode 100644 index 00000000000..18afaa3dbb3 --- /dev/null +++ b/compute/apiv1/region_health_checks_client.go @@ -0,0 +1,505 @@ +// Copyright 2021 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/ioutil" + "net/http" + "net/url" + + gax "github.com/googleapis/gax-go/v2" + "google.golang.org/api/option" + "google.golang.org/api/option/internaloption" + httptransport "google.golang.org/api/transport/http" + computepb "google.golang.org/genproto/googleapis/cloud/compute/v1" + "google.golang.org/grpc" + "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/encoding/protojson" +) + +var newRegionHealthChecksClientHook clientHook + +// RegionHealthChecksCallOptions contains the retry settings for each method of RegionHealthChecksClient. +type RegionHealthChecksCallOptions struct { + Delete []gax.CallOption + Get []gax.CallOption + Insert []gax.CallOption + List []gax.CallOption + Patch []gax.CallOption + Update []gax.CallOption +} + +// internalRegionHealthChecksClient is an interface that defines the methods availaible from Google Compute Engine API. +type internalRegionHealthChecksClient interface { + Close() error + setGoogleClientInfo(...string) + Connection() *grpc.ClientConn + Delete(context.Context, *computepb.DeleteRegionHealthCheckRequest, ...gax.CallOption) (*computepb.Operation, error) + Get(context.Context, *computepb.GetRegionHealthCheckRequest, ...gax.CallOption) (*computepb.HealthCheck, error) + Insert(context.Context, *computepb.InsertRegionHealthCheckRequest, ...gax.CallOption) (*computepb.Operation, error) + List(context.Context, *computepb.ListRegionHealthChecksRequest, ...gax.CallOption) (*computepb.HealthCheckList, error) + Patch(context.Context, *computepb.PatchRegionHealthCheckRequest, ...gax.CallOption) (*computepb.Operation, error) + Update(context.Context, *computepb.UpdateRegionHealthCheckRequest, ...gax.CallOption) (*computepb.Operation, error) +} + +// RegionHealthChecksClient 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 RegionHealthChecks API. +type RegionHealthChecksClient struct { + // The internal transport-dependent client. + internalClient internalRegionHealthChecksClient + + // The call options for this service. + CallOptions *RegionHealthChecksCallOptions +} + +// 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 *RegionHealthChecksClient) 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 *RegionHealthChecksClient) setGoogleClientInfo(keyval ...string) { + c.internalClient.setGoogleClientInfo(keyval...) +} + +// Connection returns a connection to the API service. +// +// Deprecated. +func (c *RegionHealthChecksClient) Connection() *grpc.ClientConn { + return c.internalClient.Connection() +} + +// Delete deletes the specified HealthCheck resource. +func (c *RegionHealthChecksClient) Delete(ctx context.Context, req *computepb.DeleteRegionHealthCheckRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.Delete(ctx, req, opts...) +} + +// Get returns the specified HealthCheck resource. Gets a list of available health checks by making a list() request. +func (c *RegionHealthChecksClient) Get(ctx context.Context, req *computepb.GetRegionHealthCheckRequest, opts ...gax.CallOption) (*computepb.HealthCheck, error) { + return c.internalClient.Get(ctx, req, opts...) +} + +// Insert creates a HealthCheck resource in the specified project using the data included in the request. +func (c *RegionHealthChecksClient) Insert(ctx context.Context, req *computepb.InsertRegionHealthCheckRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.Insert(ctx, req, opts...) +} + +// List retrieves the list of HealthCheck resources available to the specified project. +func (c *RegionHealthChecksClient) List(ctx context.Context, req *computepb.ListRegionHealthChecksRequest, opts ...gax.CallOption) (*computepb.HealthCheckList, error) { + return c.internalClient.List(ctx, req, opts...) +} + +// Patch updates a HealthCheck resource in the specified project using the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. +func (c *RegionHealthChecksClient) Patch(ctx context.Context, req *computepb.PatchRegionHealthCheckRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.Patch(ctx, req, opts...) +} + +// Update updates a HealthCheck resource in the specified project using the data included in the request. +func (c *RegionHealthChecksClient) Update(ctx context.Context, req *computepb.UpdateRegionHealthCheckRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.Update(ctx, req, opts...) +} + +// Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls. +type regionHealthChecksRESTClient struct { + // The http endpoint to connect to. + endpoint string + + // The http client. + httpClient *http.Client + + // The x-goog-* metadata to be sent with each request. + xGoogMetadata metadata.MD +} + +// NewRegionHealthChecksRESTClient creates a new region health checks rest client. +// +// The RegionHealthChecks API. +func NewRegionHealthChecksRESTClient(ctx context.Context, opts ...option.ClientOption) (*RegionHealthChecksClient, error) { + clientOpts := append(defaultRegionHealthChecksRESTClientOptions(), opts...) + httpClient, endpoint, err := httptransport.NewClient(ctx, clientOpts...) + if err != nil { + return nil, err + } + + c := ®ionHealthChecksRESTClient{ + endpoint: endpoint, + httpClient: httpClient, + } + c.setGoogleClientInfo() + + return &RegionHealthChecksClient{internalClient: c, CallOptions: &RegionHealthChecksCallOptions{}}, nil +} + +func defaultRegionHealthChecksRESTClientOptions() []option.ClientOption { + return []option.ClientOption{ + internaloption.WithDefaultEndpoint("compute.googleapis.com"), + internaloption.WithDefaultMTLSEndpoint("compute.mtls.googleapis.com"), + internaloption.WithDefaultAudience("https://compute.googleapis.com/"), + internaloption.WithDefaultScopes(DefaultAuthScopes()...), + } +} + +// setGoogleClientInfo sets the name and version of the application in +// the `x-goog-api-client` header passed on each request. Intended for +// use by Google-written clients. +func (c *regionHealthChecksRESTClient) setGoogleClientInfo(keyval ...string) { + kv := append([]string{"gl-go", versionGo()}, keyval...) + kv = append(kv, "gapic", versionClient, "gax", gax.Version, "rest", "UNKNOWN") + c.xGoogMetadata = metadata.Pairs("x-goog-api-client", gax.XGoogHeader(kv...)) +} + +// Close closes the connection to the API service. The user should invoke this when +// the client is no longer required. +func (c *regionHealthChecksRESTClient) Close() error { + // Replace httpClient with nil to force cleanup. + c.httpClient = nil + return nil +} + +// Connection returns a connection to the API service. +// +// Deprecated. +func (c *regionHealthChecksRESTClient) Connection() *grpc.ClientConn { + return nil +} + +// Delete deletes the specified HealthCheck resource. +func (c *regionHealthChecksRESTClient) Delete(ctx context.Context, req *computepb.DeleteRegionHealthCheckRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/healthChecks/%v", req.GetProject(), req.GetRegion(), req.GetHealthCheck()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("DELETE", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Get returns the specified HealthCheck resource. Gets a list of available health checks by making a list() request. +func (c *regionHealthChecksRESTClient) Get(ctx context.Context, req *computepb.GetRegionHealthCheckRequest, opts ...gax.CallOption) (*computepb.HealthCheck, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/healthChecks/%v", req.GetProject(), req.GetRegion(), req.GetHealthCheck()) + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.HealthCheck{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Insert creates a HealthCheck resource in the specified project using the data included in the request. +func (c *regionHealthChecksRESTClient) Insert(ctx context.Context, req *computepb.InsertRegionHealthCheckRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetHealthCheckResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/healthChecks", req.GetProject(), req.GetRegion()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// List retrieves the list of HealthCheck resources available to the specified project. +func (c *regionHealthChecksRESTClient) List(ctx context.Context, req *computepb.ListRegionHealthChecksRequest, opts ...gax.CallOption) (*computepb.HealthCheckList, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/healthChecks", 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() + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.HealthCheckList{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Patch updates a HealthCheck resource in the specified project using the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. +func (c *regionHealthChecksRESTClient) Patch(ctx context.Context, req *computepb.PatchRegionHealthCheckRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetHealthCheckResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/healthChecks/%v", req.GetProject(), req.GetRegion(), req.GetHealthCheck()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("PATCH", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Update updates a HealthCheck resource in the specified project using the data included in the request. +func (c *regionHealthChecksRESTClient) Update(ctx context.Context, req *computepb.UpdateRegionHealthCheckRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetHealthCheckResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("") + + params := url.Values{} + if req.GetHealthCheck() != "" { + params.Add("healthCheck", fmt.Sprintf("%v", req.GetHealthCheck())) + } + if req.GetProject() != "" { + params.Add("project", fmt.Sprintf("%v", req.GetProject())) + } + if req.GetRegion() != "" { + params.Add("region", fmt.Sprintf("%v", req.GetRegion())) + } + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("PUT", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} diff --git a/compute/apiv1/region_health_checks_client_example_test.go b/compute/apiv1/region_health_checks_client_example_test.go new file mode 100644 index 00000000000..2264ab8e671 --- /dev/null +++ b/compute/apiv1/region_health_checks_client_example_test.go @@ -0,0 +1,150 @@ +// Copyright 2021 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_test + +import ( + "context" + + compute "cloud.google.com/go/compute/apiv1" + computepb "google.golang.org/genproto/googleapis/cloud/compute/v1" +) + +func ExampleNewRegionHealthChecksRESTClient() { + ctx := context.Background() + c, err := compute.NewRegionHealthChecksRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + // TODO: Use client. + _ = c +} + +func ExampleRegionHealthChecksClient_Delete() { + ctx := context.Background() + c, err := compute.NewRegionHealthChecksRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.DeleteRegionHealthCheckRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Delete(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleRegionHealthChecksClient_Get() { + ctx := context.Background() + c, err := compute.NewRegionHealthChecksRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.GetRegionHealthCheckRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Get(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleRegionHealthChecksClient_Insert() { + ctx := context.Background() + c, err := compute.NewRegionHealthChecksRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.InsertRegionHealthCheckRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Insert(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleRegionHealthChecksClient_List() { + ctx := context.Background() + c, err := compute.NewRegionHealthChecksRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.ListRegionHealthChecksRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.List(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleRegionHealthChecksClient_Patch() { + ctx := context.Background() + c, err := compute.NewRegionHealthChecksRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.PatchRegionHealthCheckRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Patch(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleRegionHealthChecksClient_Update() { + ctx := context.Background() + c, err := compute.NewRegionHealthChecksRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.UpdateRegionHealthCheckRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Update(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} diff --git a/compute/apiv1/region_instance_group_managers_client.go b/compute/apiv1/region_instance_group_managers_client.go new file mode 100644 index 00000000000..4e108c40cd9 --- /dev/null +++ b/compute/apiv1/region_instance_group_managers_client.go @@ -0,0 +1,1307 @@ +// Copyright 2021 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/ioutil" + "net/http" + "net/url" + + gax "github.com/googleapis/gax-go/v2" + "google.golang.org/api/option" + "google.golang.org/api/option/internaloption" + httptransport "google.golang.org/api/transport/http" + computepb "google.golang.org/genproto/googleapis/cloud/compute/v1" + "google.golang.org/grpc" + "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/encoding/protojson" +) + +var newRegionInstanceGroupManagersClientHook clientHook + +// RegionInstanceGroupManagersCallOptions contains the retry settings for each method of RegionInstanceGroupManagersClient. +type RegionInstanceGroupManagersCallOptions struct { + AbandonInstances []gax.CallOption + ApplyUpdatesToInstances []gax.CallOption + CreateInstances []gax.CallOption + Delete []gax.CallOption + DeleteInstances []gax.CallOption + DeletePerInstanceConfigs []gax.CallOption + Get []gax.CallOption + Insert []gax.CallOption + List []gax.CallOption + ListErrors []gax.CallOption + ListManagedInstances []gax.CallOption + ListPerInstanceConfigs []gax.CallOption + Patch []gax.CallOption + PatchPerInstanceConfigs []gax.CallOption + RecreateInstances []gax.CallOption + Resize []gax.CallOption + SetInstanceTemplate []gax.CallOption + SetTargetPools []gax.CallOption + UpdatePerInstanceConfigs []gax.CallOption +} + +// internalRegionInstanceGroupManagersClient is an interface that defines the methods availaible from Google Compute Engine API. +type internalRegionInstanceGroupManagersClient interface { + Close() error + setGoogleClientInfo(...string) + Connection() *grpc.ClientConn + AbandonInstances(context.Context, *computepb.AbandonInstancesRegionInstanceGroupManagerRequest, ...gax.CallOption) (*computepb.Operation, error) + ApplyUpdatesToInstances(context.Context, *computepb.ApplyUpdatesToInstancesRegionInstanceGroupManagerRequest, ...gax.CallOption) (*computepb.Operation, error) + CreateInstances(context.Context, *computepb.CreateInstancesRegionInstanceGroupManagerRequest, ...gax.CallOption) (*computepb.Operation, error) + Delete(context.Context, *computepb.DeleteRegionInstanceGroupManagerRequest, ...gax.CallOption) (*computepb.Operation, error) + DeleteInstances(context.Context, *computepb.DeleteInstancesRegionInstanceGroupManagerRequest, ...gax.CallOption) (*computepb.Operation, error) + DeletePerInstanceConfigs(context.Context, *computepb.DeletePerInstanceConfigsRegionInstanceGroupManagerRequest, ...gax.CallOption) (*computepb.Operation, error) + Get(context.Context, *computepb.GetRegionInstanceGroupManagerRequest, ...gax.CallOption) (*computepb.InstanceGroupManager, error) + Insert(context.Context, *computepb.InsertRegionInstanceGroupManagerRequest, ...gax.CallOption) (*computepb.Operation, error) + List(context.Context, *computepb.ListRegionInstanceGroupManagersRequest, ...gax.CallOption) (*computepb.RegionInstanceGroupManagerList, error) + ListErrors(context.Context, *computepb.ListErrorsRegionInstanceGroupManagersRequest, ...gax.CallOption) (*computepb.RegionInstanceGroupManagersListErrorsResponse, error) + ListManagedInstances(context.Context, *computepb.ListManagedInstancesRegionInstanceGroupManagersRequest, ...gax.CallOption) (*computepb.RegionInstanceGroupManagersListInstancesResponse, error) + ListPerInstanceConfigs(context.Context, *computepb.ListPerInstanceConfigsRegionInstanceGroupManagersRequest, ...gax.CallOption) (*computepb.RegionInstanceGroupManagersListInstanceConfigsResp, error) + Patch(context.Context, *computepb.PatchRegionInstanceGroupManagerRequest, ...gax.CallOption) (*computepb.Operation, error) + PatchPerInstanceConfigs(context.Context, *computepb.PatchPerInstanceConfigsRegionInstanceGroupManagerRequest, ...gax.CallOption) (*computepb.Operation, error) + RecreateInstances(context.Context, *computepb.RecreateInstancesRegionInstanceGroupManagerRequest, ...gax.CallOption) (*computepb.Operation, error) + Resize(context.Context, *computepb.ResizeRegionInstanceGroupManagerRequest, ...gax.CallOption) (*computepb.Operation, error) + SetInstanceTemplate(context.Context, *computepb.SetInstanceTemplateRegionInstanceGroupManagerRequest, ...gax.CallOption) (*computepb.Operation, error) + SetTargetPools(context.Context, *computepb.SetTargetPoolsRegionInstanceGroupManagerRequest, ...gax.CallOption) (*computepb.Operation, error) + UpdatePerInstanceConfigs(context.Context, *computepb.UpdatePerInstanceConfigsRegionInstanceGroupManagerRequest, ...gax.CallOption) (*computepb.Operation, error) +} + +// RegionInstanceGroupManagersClient 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 RegionInstanceGroupManagers API. +type RegionInstanceGroupManagersClient struct { + // The internal transport-dependent client. + internalClient internalRegionInstanceGroupManagersClient + + // The call options for this service. + CallOptions *RegionInstanceGroupManagersCallOptions +} + +// 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 *RegionInstanceGroupManagersClient) 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 *RegionInstanceGroupManagersClient) setGoogleClientInfo(keyval ...string) { + c.internalClient.setGoogleClientInfo(keyval...) +} + +// Connection returns a connection to the API service. +// +// Deprecated. +func (c *RegionInstanceGroupManagersClient) Connection() *grpc.ClientConn { + return c.internalClient.Connection() +} + +// AbandonInstances flags the specified instances to be immediately removed from the managed instance group. Abandoning an instance does not delete the instance, but it does remove the instance from any target pools that are applied by the managed instance group. This method reduces the targetSize of the managed instance group by the number of instances that you abandon. This operation is marked as DONE when the action is scheduled even if the instances have not yet been removed from the group. You must separately verify the status of the abandoning action with the listmanagedinstances method. +// +// If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted. +// +// You can specify a maximum of 1000 instances with this method per request. +func (c *RegionInstanceGroupManagersClient) AbandonInstances(ctx context.Context, req *computepb.AbandonInstancesRegionInstanceGroupManagerRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.AbandonInstances(ctx, req, opts...) +} + +// ApplyUpdatesToInstances apply updates to selected instances the managed instance group. +func (c *RegionInstanceGroupManagersClient) ApplyUpdatesToInstances(ctx context.Context, req *computepb.ApplyUpdatesToInstancesRegionInstanceGroupManagerRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.ApplyUpdatesToInstances(ctx, req, opts...) +} + +// CreateInstances creates instances with per-instance configs in this regional managed instance group. Instances are created using the current instance template. The create instances operation is marked DONE if the createInstances request is successful. The underlying actions take additional time. You must separately verify the status of the creating or actions with the listmanagedinstances method. +func (c *RegionInstanceGroupManagersClient) CreateInstances(ctx context.Context, req *computepb.CreateInstancesRegionInstanceGroupManagerRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.CreateInstances(ctx, req, opts...) +} + +// Delete deletes the specified managed instance group and all of the instances in that group. +func (c *RegionInstanceGroupManagersClient) Delete(ctx context.Context, req *computepb.DeleteRegionInstanceGroupManagerRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.Delete(ctx, req, opts...) +} + +// DeleteInstances flags the specified instances in the managed instance group to be immediately deleted. The instances are also removed from any target pools of which they were a member. This method reduces the targetSize of the managed instance group by the number of instances that you delete. The deleteInstances operation is marked DONE if the deleteInstances request is successful. The underlying actions take additional time. You must separately verify the status of the deleting action with the listmanagedinstances method. +// +// If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted. +// +// You can specify a maximum of 1000 instances with this method per request. +func (c *RegionInstanceGroupManagersClient) DeleteInstances(ctx context.Context, req *computepb.DeleteInstancesRegionInstanceGroupManagerRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.DeleteInstances(ctx, req, opts...) +} + +// DeletePerInstanceConfigs deletes selected per-instance configs for the managed instance group. +func (c *RegionInstanceGroupManagersClient) DeletePerInstanceConfigs(ctx context.Context, req *computepb.DeletePerInstanceConfigsRegionInstanceGroupManagerRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.DeletePerInstanceConfigs(ctx, req, opts...) +} + +// Get returns all of the details about the specified managed instance group. +func (c *RegionInstanceGroupManagersClient) Get(ctx context.Context, req *computepb.GetRegionInstanceGroupManagerRequest, opts ...gax.CallOption) (*computepb.InstanceGroupManager, error) { + return c.internalClient.Get(ctx, req, opts...) +} + +// Insert creates a managed instance group using the information that you specify in the request. After the group is created, instances in the group are created using the specified instance template. This operation is marked as DONE when the group is created even if the instances in the group have not yet been created. You must separately verify the status of the individual instances with the listmanagedinstances method. +// +// A regional managed instance group can contain up to 2000 instances. +func (c *RegionInstanceGroupManagersClient) Insert(ctx context.Context, req *computepb.InsertRegionInstanceGroupManagerRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.Insert(ctx, req, opts...) +} + +// List retrieves the list of managed instance groups that are contained within the specified region. +func (c *RegionInstanceGroupManagersClient) List(ctx context.Context, req *computepb.ListRegionInstanceGroupManagersRequest, opts ...gax.CallOption) (*computepb.RegionInstanceGroupManagerList, error) { + return c.internalClient.List(ctx, req, opts...) +} + +// ListErrors lists all errors thrown by actions on instances for a given regional managed instance group. The filter and orderBy query parameters are not supported. +func (c *RegionInstanceGroupManagersClient) ListErrors(ctx context.Context, req *computepb.ListErrorsRegionInstanceGroupManagersRequest, opts ...gax.CallOption) (*computepb.RegionInstanceGroupManagersListErrorsResponse, error) { + return c.internalClient.ListErrors(ctx, req, opts...) +} + +// ListManagedInstances lists the instances in the managed instance group and instances that are scheduled to be created. The list includes any current actions that the group has scheduled for its instances. The orderBy query parameter is not supported. +func (c *RegionInstanceGroupManagersClient) ListManagedInstances(ctx context.Context, req *computepb.ListManagedInstancesRegionInstanceGroupManagersRequest, opts ...gax.CallOption) (*computepb.RegionInstanceGroupManagersListInstancesResponse, error) { + return c.internalClient.ListManagedInstances(ctx, req, opts...) +} + +// ListPerInstanceConfigs lists all of the per-instance configs defined for the managed instance group. The orderBy query parameter is not supported. +func (c *RegionInstanceGroupManagersClient) ListPerInstanceConfigs(ctx context.Context, req *computepb.ListPerInstanceConfigsRegionInstanceGroupManagersRequest, opts ...gax.CallOption) (*computepb.RegionInstanceGroupManagersListInstanceConfigsResp, error) { + return c.internalClient.ListPerInstanceConfigs(ctx, req, opts...) +} + +// Patch updates a managed instance group using the information that you specify in the request. This operation is marked as DONE when the group is patched even if the instances in the group are still in the process of being patched. You must separately verify the status of the individual instances with the listmanagedinstances method. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. +func (c *RegionInstanceGroupManagersClient) Patch(ctx context.Context, req *computepb.PatchRegionInstanceGroupManagerRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.Patch(ctx, req, opts...) +} + +// PatchPerInstanceConfigs inserts or patches per-instance configs for the managed instance group. perInstanceConfig.name (at http://perInstanceConfig.name) serves as a key used to distinguish whether to perform insert or patch. +func (c *RegionInstanceGroupManagersClient) PatchPerInstanceConfigs(ctx context.Context, req *computepb.PatchPerInstanceConfigsRegionInstanceGroupManagerRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.PatchPerInstanceConfigs(ctx, req, opts...) +} + +// RecreateInstances flags the specified VM instances in the managed instance group to be immediately recreated. Each instance is recreated using the group’s current configuration. This operation is marked as DONE when the flag is set even if the instances have not yet been recreated. You must separately verify the status of each instance by checking its currentAction field; for more information, see Checking the status of managed instances. +// +// If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted. +// +// You can specify a maximum of 1000 instances with this method per request. +func (c *RegionInstanceGroupManagersClient) RecreateInstances(ctx context.Context, req *computepb.RecreateInstancesRegionInstanceGroupManagerRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.RecreateInstances(ctx, req, opts...) +} + +// Resize changes the intended size of the managed instance group. If you increase the size, the group creates new instances using the current instance template. If you decrease the size, the group deletes one or more instances. +// +// The resize operation is marked DONE if the resize request is successful. The underlying actions take additional time. You must separately verify the status of the creating or deleting actions with the listmanagedinstances method. +// +// If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted. +func (c *RegionInstanceGroupManagersClient) Resize(ctx context.Context, req *computepb.ResizeRegionInstanceGroupManagerRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.Resize(ctx, req, opts...) +} + +// SetInstanceTemplate sets the instance template to use when creating new instances or recreating instances in this group. Existing instances are not affected. +func (c *RegionInstanceGroupManagersClient) SetInstanceTemplate(ctx context.Context, req *computepb.SetInstanceTemplateRegionInstanceGroupManagerRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.SetInstanceTemplate(ctx, req, opts...) +} + +// SetTargetPools modifies the target pools to which all new instances in this group are assigned. Existing instances in the group are not affected. +func (c *RegionInstanceGroupManagersClient) SetTargetPools(ctx context.Context, req *computepb.SetTargetPoolsRegionInstanceGroupManagerRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.SetTargetPools(ctx, req, opts...) +} + +// UpdatePerInstanceConfigs inserts or updates per-instance configs for the managed instance group. perInstanceConfig.name (at http://perInstanceConfig.name) serves as a key used to distinguish whether to perform insert or patch. +func (c *RegionInstanceGroupManagersClient) UpdatePerInstanceConfigs(ctx context.Context, req *computepb.UpdatePerInstanceConfigsRegionInstanceGroupManagerRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.UpdatePerInstanceConfigs(ctx, req, opts...) +} + +// Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls. +type regionInstanceGroupManagersRESTClient struct { + // The http endpoint to connect to. + endpoint string + + // The http client. + httpClient *http.Client + + // The x-goog-* metadata to be sent with each request. + xGoogMetadata metadata.MD +} + +// NewRegionInstanceGroupManagersRESTClient creates a new region instance group managers rest client. +// +// The RegionInstanceGroupManagers API. +func NewRegionInstanceGroupManagersRESTClient(ctx context.Context, opts ...option.ClientOption) (*RegionInstanceGroupManagersClient, error) { + clientOpts := append(defaultRegionInstanceGroupManagersRESTClientOptions(), opts...) + httpClient, endpoint, err := httptransport.NewClient(ctx, clientOpts...) + if err != nil { + return nil, err + } + + c := ®ionInstanceGroupManagersRESTClient{ + endpoint: endpoint, + httpClient: httpClient, + } + c.setGoogleClientInfo() + + return &RegionInstanceGroupManagersClient{internalClient: c, CallOptions: &RegionInstanceGroupManagersCallOptions{}}, nil +} + +func defaultRegionInstanceGroupManagersRESTClientOptions() []option.ClientOption { + return []option.ClientOption{ + internaloption.WithDefaultEndpoint("compute.googleapis.com"), + internaloption.WithDefaultMTLSEndpoint("compute.mtls.googleapis.com"), + internaloption.WithDefaultAudience("https://compute.googleapis.com/"), + internaloption.WithDefaultScopes(DefaultAuthScopes()...), + } +} + +// setGoogleClientInfo sets the name and version of the application in +// the `x-goog-api-client` header passed on each request. Intended for +// use by Google-written clients. +func (c *regionInstanceGroupManagersRESTClient) setGoogleClientInfo(keyval ...string) { + kv := append([]string{"gl-go", versionGo()}, keyval...) + kv = append(kv, "gapic", versionClient, "gax", gax.Version, "rest", "UNKNOWN") + c.xGoogMetadata = metadata.Pairs("x-goog-api-client", gax.XGoogHeader(kv...)) +} + +// Close closes the connection to the API service. The user should invoke this when +// the client is no longer required. +func (c *regionInstanceGroupManagersRESTClient) Close() error { + // Replace httpClient with nil to force cleanup. + c.httpClient = nil + return nil +} + +// Connection returns a connection to the API service. +// +// Deprecated. +func (c *regionInstanceGroupManagersRESTClient) Connection() *grpc.ClientConn { + return nil +} + +// AbandonInstances flags the specified instances to be immediately removed from the managed instance group. Abandoning an instance does not delete the instance, but it does remove the instance from any target pools that are applied by the managed instance group. This method reduces the targetSize of the managed instance group by the number of instances that you abandon. This operation is marked as DONE when the action is scheduled even if the instances have not yet been removed from the group. You must separately verify the status of the abandoning action with the listmanagedinstances method. +// +// If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted. +// +// You can specify a maximum of 1000 instances with this method per request. +func (c *regionInstanceGroupManagersRESTClient) AbandonInstances(ctx context.Context, req *computepb.AbandonInstancesRegionInstanceGroupManagerRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetRegionInstanceGroupManagersAbandonInstancesRequestResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/instanceGroupManagers/%v/abandonInstances", req.GetProject(), req.GetRegion(), req.GetInstanceGroupManager()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// ApplyUpdatesToInstances apply updates to selected instances the managed instance group. +func (c *regionInstanceGroupManagersRESTClient) ApplyUpdatesToInstances(ctx context.Context, req *computepb.ApplyUpdatesToInstancesRegionInstanceGroupManagerRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetRegionInstanceGroupManagersApplyUpdatesRequestResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/instanceGroupManagers/%v/applyUpdatesToInstances", req.GetProject(), req.GetRegion(), req.GetInstanceGroupManager()) + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// CreateInstances creates instances with per-instance configs in this regional managed instance group. Instances are created using the current instance template. The create instances operation is marked DONE if the createInstances request is successful. The underlying actions take additional time. You must separately verify the status of the creating or actions with the listmanagedinstances method. +func (c *regionInstanceGroupManagersRESTClient) CreateInstances(ctx context.Context, req *computepb.CreateInstancesRegionInstanceGroupManagerRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetRegionInstanceGroupManagersCreateInstancesRequestResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/instanceGroupManagers/%v/createInstances", req.GetProject(), req.GetRegion(), req.GetInstanceGroupManager()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Delete deletes the specified managed instance group and all of the instances in that group. +func (c *regionInstanceGroupManagersRESTClient) Delete(ctx context.Context, req *computepb.DeleteRegionInstanceGroupManagerRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/instanceGroupManagers/%v", req.GetProject(), req.GetRegion(), req.GetInstanceGroupManager()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("DELETE", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// DeleteInstances flags the specified instances in the managed instance group to be immediately deleted. The instances are also removed from any target pools of which they were a member. This method reduces the targetSize of the managed instance group by the number of instances that you delete. The deleteInstances operation is marked DONE if the deleteInstances request is successful. The underlying actions take additional time. You must separately verify the status of the deleting action with the listmanagedinstances method. +// +// If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted. +// +// You can specify a maximum of 1000 instances with this method per request. +func (c *regionInstanceGroupManagersRESTClient) DeleteInstances(ctx context.Context, req *computepb.DeleteInstancesRegionInstanceGroupManagerRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetRegionInstanceGroupManagersDeleteInstancesRequestResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/instanceGroupManagers/%v/deleteInstances", req.GetProject(), req.GetRegion(), req.GetInstanceGroupManager()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// DeletePerInstanceConfigs deletes selected per-instance configs for the managed instance group. +func (c *regionInstanceGroupManagersRESTClient) DeletePerInstanceConfigs(ctx context.Context, req *computepb.DeletePerInstanceConfigsRegionInstanceGroupManagerRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetRegionInstanceGroupManagerDeleteInstanceConfigReqResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/instanceGroupManagers/%v/deletePerInstanceConfigs", req.GetProject(), req.GetRegion(), req.GetInstanceGroupManager()) + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Get returns all of the details about the specified managed instance group. +func (c *regionInstanceGroupManagersRESTClient) Get(ctx context.Context, req *computepb.GetRegionInstanceGroupManagerRequest, opts ...gax.CallOption) (*computepb.InstanceGroupManager, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/instanceGroupManagers/%v", req.GetProject(), req.GetRegion(), req.GetInstanceGroupManager()) + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.InstanceGroupManager{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Insert creates a managed instance group using the information that you specify in the request. After the group is created, instances in the group are created using the specified instance template. This operation is marked as DONE when the group is created even if the instances in the group have not yet been created. You must separately verify the status of the individual instances with the listmanagedinstances method. +// +// A regional managed instance group can contain up to 2000 instances. +func (c *regionInstanceGroupManagersRESTClient) Insert(ctx context.Context, req *computepb.InsertRegionInstanceGroupManagerRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetInstanceGroupManagerResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/instanceGroupManagers", req.GetProject(), req.GetRegion()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// List retrieves the list of managed instance groups that are contained within the specified region. +func (c *regionInstanceGroupManagersRESTClient) List(ctx context.Context, req *computepb.ListRegionInstanceGroupManagersRequest, opts ...gax.CallOption) (*computepb.RegionInstanceGroupManagerList, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/instanceGroupManagers", 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() + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.RegionInstanceGroupManagerList{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// ListErrors lists all errors thrown by actions on instances for a given regional managed instance group. The filter and orderBy query parameters are not supported. +func (c *regionInstanceGroupManagersRESTClient) ListErrors(ctx context.Context, req *computepb.ListErrorsRegionInstanceGroupManagersRequest, opts ...gax.CallOption) (*computepb.RegionInstanceGroupManagersListErrorsResponse, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/instanceGroupManagers/%v/listErrors", req.GetProject(), req.GetRegion(), req.GetInstanceGroupManager()) + + 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() + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.RegionInstanceGroupManagersListErrorsResponse{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// ListManagedInstances lists the instances in the managed instance group and instances that are scheduled to be created. The list includes any current actions that the group has scheduled for its instances. The orderBy query parameter is not supported. +func (c *regionInstanceGroupManagersRESTClient) ListManagedInstances(ctx context.Context, req *computepb.ListManagedInstancesRegionInstanceGroupManagersRequest, opts ...gax.CallOption) (*computepb.RegionInstanceGroupManagersListInstancesResponse, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/instanceGroupManagers/%v/listManagedInstances", req.GetProject(), req.GetRegion(), req.GetInstanceGroupManager()) + + 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() + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.RegionInstanceGroupManagersListInstancesResponse{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// ListPerInstanceConfigs lists all of the per-instance configs defined for the managed instance group. The orderBy query parameter is not supported. +func (c *regionInstanceGroupManagersRESTClient) ListPerInstanceConfigs(ctx context.Context, req *computepb.ListPerInstanceConfigsRegionInstanceGroupManagersRequest, opts ...gax.CallOption) (*computepb.RegionInstanceGroupManagersListInstanceConfigsResp, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/instanceGroupManagers/%v/listPerInstanceConfigs", req.GetProject(), req.GetRegion(), req.GetInstanceGroupManager()) + + 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() + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.RegionInstanceGroupManagersListInstanceConfigsResp{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Patch updates a managed instance group using the information that you specify in the request. This operation is marked as DONE when the group is patched even if the instances in the group are still in the process of being patched. You must separately verify the status of the individual instances with the listmanagedinstances method. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. +func (c *regionInstanceGroupManagersRESTClient) Patch(ctx context.Context, req *computepb.PatchRegionInstanceGroupManagerRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetInstanceGroupManagerResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/instanceGroupManagers/%v", req.GetProject(), req.GetRegion(), req.GetInstanceGroupManager()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("PATCH", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// PatchPerInstanceConfigs inserts or patches per-instance configs for the managed instance group. perInstanceConfig.name (at http://perInstanceConfig.name) serves as a key used to distinguish whether to perform insert or patch. +func (c *regionInstanceGroupManagersRESTClient) PatchPerInstanceConfigs(ctx context.Context, req *computepb.PatchPerInstanceConfigsRegionInstanceGroupManagerRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetRegionInstanceGroupManagerPatchInstanceConfigReqResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/instanceGroupManagers/%v/patchPerInstanceConfigs", req.GetProject(), req.GetRegion(), req.GetInstanceGroupManager()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// RecreateInstances flags the specified VM instances in the managed instance group to be immediately recreated. Each instance is recreated using the group’s current configuration. This operation is marked as DONE when the flag is set even if the instances have not yet been recreated. You must separately verify the status of each instance by checking its currentAction field; for more information, see Checking the status of managed instances. +// +// If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted. +// +// You can specify a maximum of 1000 instances with this method per request. +func (c *regionInstanceGroupManagersRESTClient) RecreateInstances(ctx context.Context, req *computepb.RecreateInstancesRegionInstanceGroupManagerRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetRegionInstanceGroupManagersRecreateRequestResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/instanceGroupManagers/%v/recreateInstances", req.GetProject(), req.GetRegion(), req.GetInstanceGroupManager()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Resize changes the intended size of the managed instance group. If you increase the size, the group creates new instances using the current instance template. If you decrease the size, the group deletes one or more instances. +// +// The resize operation is marked DONE if the resize request is successful. The underlying actions take additional time. You must separately verify the status of the creating or deleting actions with the listmanagedinstances method. +// +// If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted. +func (c *regionInstanceGroupManagersRESTClient) Resize(ctx context.Context, req *computepb.ResizeRegionInstanceGroupManagerRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/instanceGroupManagers/%v/resize", req.GetProject(), req.GetRegion(), req.GetInstanceGroupManager()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + if req.GetSize() != 0 { + params.Add("size", fmt.Sprintf("%v", req.GetSize())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// SetInstanceTemplate sets the instance template to use when creating new instances or recreating instances in this group. Existing instances are not affected. +func (c *regionInstanceGroupManagersRESTClient) SetInstanceTemplate(ctx context.Context, req *computepb.SetInstanceTemplateRegionInstanceGroupManagerRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetRegionInstanceGroupManagersSetTemplateRequestResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/instanceGroupManagers/%v/setInstanceTemplate", req.GetProject(), req.GetRegion(), req.GetInstanceGroupManager()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// SetTargetPools modifies the target pools to which all new instances in this group are assigned. Existing instances in the group are not affected. +func (c *regionInstanceGroupManagersRESTClient) SetTargetPools(ctx context.Context, req *computepb.SetTargetPoolsRegionInstanceGroupManagerRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetRegionInstanceGroupManagersSetTargetPoolsRequestResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/instanceGroupManagers/%v/setTargetPools", req.GetProject(), req.GetRegion(), req.GetInstanceGroupManager()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// UpdatePerInstanceConfigs inserts or updates per-instance configs for the managed instance group. perInstanceConfig.name (at http://perInstanceConfig.name) serves as a key used to distinguish whether to perform insert or patch. +func (c *regionInstanceGroupManagersRESTClient) UpdatePerInstanceConfigs(ctx context.Context, req *computepb.UpdatePerInstanceConfigsRegionInstanceGroupManagerRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetRegionInstanceGroupManagerUpdateInstanceConfigReqResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/instanceGroupManagers/%v/updatePerInstanceConfigs", req.GetProject(), req.GetRegion(), req.GetInstanceGroupManager()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} diff --git a/compute/apiv1/region_instance_group_managers_client_example_test.go b/compute/apiv1/region_instance_group_managers_client_example_test.go new file mode 100644 index 00000000000..cf0c18b6003 --- /dev/null +++ b/compute/apiv1/region_instance_group_managers_client_example_test.go @@ -0,0 +1,397 @@ +// Copyright 2021 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_test + +import ( + "context" + + compute "cloud.google.com/go/compute/apiv1" + computepb "google.golang.org/genproto/googleapis/cloud/compute/v1" +) + +func ExampleNewRegionInstanceGroupManagersRESTClient() { + ctx := context.Background() + c, err := compute.NewRegionInstanceGroupManagersRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + // TODO: Use client. + _ = c +} + +func ExampleRegionInstanceGroupManagersClient_AbandonInstances() { + ctx := context.Background() + c, err := compute.NewRegionInstanceGroupManagersRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.AbandonInstancesRegionInstanceGroupManagerRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.AbandonInstances(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleRegionInstanceGroupManagersClient_ApplyUpdatesToInstances() { + ctx := context.Background() + c, err := compute.NewRegionInstanceGroupManagersRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.ApplyUpdatesToInstancesRegionInstanceGroupManagerRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.ApplyUpdatesToInstances(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleRegionInstanceGroupManagersClient_CreateInstances() { + ctx := context.Background() + c, err := compute.NewRegionInstanceGroupManagersRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.CreateInstancesRegionInstanceGroupManagerRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.CreateInstances(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleRegionInstanceGroupManagersClient_Delete() { + ctx := context.Background() + c, err := compute.NewRegionInstanceGroupManagersRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.DeleteRegionInstanceGroupManagerRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Delete(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleRegionInstanceGroupManagersClient_DeleteInstances() { + ctx := context.Background() + c, err := compute.NewRegionInstanceGroupManagersRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.DeleteInstancesRegionInstanceGroupManagerRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.DeleteInstances(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleRegionInstanceGroupManagersClient_DeletePerInstanceConfigs() { + ctx := context.Background() + c, err := compute.NewRegionInstanceGroupManagersRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.DeletePerInstanceConfigsRegionInstanceGroupManagerRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.DeletePerInstanceConfigs(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleRegionInstanceGroupManagersClient_Get() { + ctx := context.Background() + c, err := compute.NewRegionInstanceGroupManagersRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.GetRegionInstanceGroupManagerRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Get(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleRegionInstanceGroupManagersClient_Insert() { + ctx := context.Background() + c, err := compute.NewRegionInstanceGroupManagersRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.InsertRegionInstanceGroupManagerRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Insert(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleRegionInstanceGroupManagersClient_List() { + ctx := context.Background() + c, err := compute.NewRegionInstanceGroupManagersRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.ListRegionInstanceGroupManagersRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.List(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleRegionInstanceGroupManagersClient_ListErrors() { + ctx := context.Background() + c, err := compute.NewRegionInstanceGroupManagersRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.ListErrorsRegionInstanceGroupManagersRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.ListErrors(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleRegionInstanceGroupManagersClient_ListManagedInstances() { + ctx := context.Background() + c, err := compute.NewRegionInstanceGroupManagersRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.ListManagedInstancesRegionInstanceGroupManagersRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.ListManagedInstances(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleRegionInstanceGroupManagersClient_ListPerInstanceConfigs() { + ctx := context.Background() + c, err := compute.NewRegionInstanceGroupManagersRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.ListPerInstanceConfigsRegionInstanceGroupManagersRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.ListPerInstanceConfigs(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleRegionInstanceGroupManagersClient_Patch() { + ctx := context.Background() + c, err := compute.NewRegionInstanceGroupManagersRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.PatchRegionInstanceGroupManagerRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Patch(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleRegionInstanceGroupManagersClient_PatchPerInstanceConfigs() { + ctx := context.Background() + c, err := compute.NewRegionInstanceGroupManagersRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.PatchPerInstanceConfigsRegionInstanceGroupManagerRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.PatchPerInstanceConfigs(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleRegionInstanceGroupManagersClient_RecreateInstances() { + ctx := context.Background() + c, err := compute.NewRegionInstanceGroupManagersRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.RecreateInstancesRegionInstanceGroupManagerRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.RecreateInstances(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleRegionInstanceGroupManagersClient_Resize() { + ctx := context.Background() + c, err := compute.NewRegionInstanceGroupManagersRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.ResizeRegionInstanceGroupManagerRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Resize(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleRegionInstanceGroupManagersClient_SetInstanceTemplate() { + ctx := context.Background() + c, err := compute.NewRegionInstanceGroupManagersRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.SetInstanceTemplateRegionInstanceGroupManagerRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.SetInstanceTemplate(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleRegionInstanceGroupManagersClient_SetTargetPools() { + ctx := context.Background() + c, err := compute.NewRegionInstanceGroupManagersRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.SetTargetPoolsRegionInstanceGroupManagerRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.SetTargetPools(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleRegionInstanceGroupManagersClient_UpdatePerInstanceConfigs() { + ctx := context.Background() + c, err := compute.NewRegionInstanceGroupManagersRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.UpdatePerInstanceConfigsRegionInstanceGroupManagerRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.UpdatePerInstanceConfigs(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} diff --git a/compute/apiv1/region_instance_groups_client.go b/compute/apiv1/region_instance_groups_client.go new file mode 100644 index 00000000000..d2698ffb112 --- /dev/null +++ b/compute/apiv1/region_instance_groups_client.go @@ -0,0 +1,393 @@ +// Copyright 2021 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/ioutil" + "net/http" + "net/url" + + gax "github.com/googleapis/gax-go/v2" + "google.golang.org/api/option" + "google.golang.org/api/option/internaloption" + httptransport "google.golang.org/api/transport/http" + computepb "google.golang.org/genproto/googleapis/cloud/compute/v1" + "google.golang.org/grpc" + "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/encoding/protojson" +) + +var newRegionInstanceGroupsClientHook clientHook + +// RegionInstanceGroupsCallOptions contains the retry settings for each method of RegionInstanceGroupsClient. +type RegionInstanceGroupsCallOptions struct { + Get []gax.CallOption + List []gax.CallOption + ListInstances []gax.CallOption + SetNamedPorts []gax.CallOption +} + +// internalRegionInstanceGroupsClient is an interface that defines the methods availaible from Google Compute Engine API. +type internalRegionInstanceGroupsClient interface { + Close() error + setGoogleClientInfo(...string) + Connection() *grpc.ClientConn + Get(context.Context, *computepb.GetRegionInstanceGroupRequest, ...gax.CallOption) (*computepb.InstanceGroup, error) + List(context.Context, *computepb.ListRegionInstanceGroupsRequest, ...gax.CallOption) (*computepb.RegionInstanceGroupList, error) + ListInstances(context.Context, *computepb.ListInstancesRegionInstanceGroupsRequest, ...gax.CallOption) (*computepb.RegionInstanceGroupsListInstances, error) + SetNamedPorts(context.Context, *computepb.SetNamedPortsRegionInstanceGroupRequest, ...gax.CallOption) (*computepb.Operation, error) +} + +// RegionInstanceGroupsClient 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 RegionInstanceGroups API. +type RegionInstanceGroupsClient struct { + // The internal transport-dependent client. + internalClient internalRegionInstanceGroupsClient + + // The call options for this service. + CallOptions *RegionInstanceGroupsCallOptions +} + +// 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 *RegionInstanceGroupsClient) 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 *RegionInstanceGroupsClient) setGoogleClientInfo(keyval ...string) { + c.internalClient.setGoogleClientInfo(keyval...) +} + +// Connection returns a connection to the API service. +// +// Deprecated. +func (c *RegionInstanceGroupsClient) Connection() *grpc.ClientConn { + return c.internalClient.Connection() +} + +// Get returns the specified instance group resource. +func (c *RegionInstanceGroupsClient) Get(ctx context.Context, req *computepb.GetRegionInstanceGroupRequest, opts ...gax.CallOption) (*computepb.InstanceGroup, error) { + return c.internalClient.Get(ctx, req, opts...) +} + +// List retrieves the list of instance group resources contained within the specified region. +func (c *RegionInstanceGroupsClient) List(ctx context.Context, req *computepb.ListRegionInstanceGroupsRequest, opts ...gax.CallOption) (*computepb.RegionInstanceGroupList, error) { + return c.internalClient.List(ctx, req, opts...) +} + +// ListInstances lists the instances in the specified instance group and displays information about the named ports. Depending on the specified options, this method can list all instances or only the instances that are running. The orderBy query parameter is not supported. +func (c *RegionInstanceGroupsClient) ListInstances(ctx context.Context, req *computepb.ListInstancesRegionInstanceGroupsRequest, opts ...gax.CallOption) (*computepb.RegionInstanceGroupsListInstances, error) { + return c.internalClient.ListInstances(ctx, req, opts...) +} + +// SetNamedPorts sets the named ports for the specified regional instance group. +func (c *RegionInstanceGroupsClient) SetNamedPorts(ctx context.Context, req *computepb.SetNamedPortsRegionInstanceGroupRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.SetNamedPorts(ctx, req, opts...) +} + +// Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls. +type regionInstanceGroupsRESTClient struct { + // The http endpoint to connect to. + endpoint string + + // The http client. + httpClient *http.Client + + // The x-goog-* metadata to be sent with each request. + xGoogMetadata metadata.MD +} + +// NewRegionInstanceGroupsRESTClient creates a new region instance groups rest client. +// +// The RegionInstanceGroups API. +func NewRegionInstanceGroupsRESTClient(ctx context.Context, opts ...option.ClientOption) (*RegionInstanceGroupsClient, error) { + clientOpts := append(defaultRegionInstanceGroupsRESTClientOptions(), opts...) + httpClient, endpoint, err := httptransport.NewClient(ctx, clientOpts...) + if err != nil { + return nil, err + } + + c := ®ionInstanceGroupsRESTClient{ + endpoint: endpoint, + httpClient: httpClient, + } + c.setGoogleClientInfo() + + return &RegionInstanceGroupsClient{internalClient: c, CallOptions: &RegionInstanceGroupsCallOptions{}}, nil +} + +func defaultRegionInstanceGroupsRESTClientOptions() []option.ClientOption { + return []option.ClientOption{ + internaloption.WithDefaultEndpoint("compute.googleapis.com"), + internaloption.WithDefaultMTLSEndpoint("compute.mtls.googleapis.com"), + internaloption.WithDefaultAudience("https://compute.googleapis.com/"), + internaloption.WithDefaultScopes(DefaultAuthScopes()...), + } +} + +// setGoogleClientInfo sets the name and version of the application in +// the `x-goog-api-client` header passed on each request. Intended for +// use by Google-written clients. +func (c *regionInstanceGroupsRESTClient) setGoogleClientInfo(keyval ...string) { + kv := append([]string{"gl-go", versionGo()}, keyval...) + kv = append(kv, "gapic", versionClient, "gax", gax.Version, "rest", "UNKNOWN") + c.xGoogMetadata = metadata.Pairs("x-goog-api-client", gax.XGoogHeader(kv...)) +} + +// Close closes the connection to the API service. The user should invoke this when +// the client is no longer required. +func (c *regionInstanceGroupsRESTClient) Close() error { + // Replace httpClient with nil to force cleanup. + c.httpClient = nil + return nil +} + +// Connection returns a connection to the API service. +// +// Deprecated. +func (c *regionInstanceGroupsRESTClient) Connection() *grpc.ClientConn { + return nil +} + +// Get returns the specified instance group resource. +func (c *regionInstanceGroupsRESTClient) Get(ctx context.Context, req *computepb.GetRegionInstanceGroupRequest, opts ...gax.CallOption) (*computepb.InstanceGroup, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/instanceGroups/%v", req.GetProject(), req.GetRegion(), req.GetInstanceGroup()) + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.InstanceGroup{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// List retrieves the list of instance group resources contained within the specified region. +func (c *regionInstanceGroupsRESTClient) List(ctx context.Context, req *computepb.ListRegionInstanceGroupsRequest, opts ...gax.CallOption) (*computepb.RegionInstanceGroupList, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/instanceGroups", 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() + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.RegionInstanceGroupList{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// ListInstances lists the instances in the specified instance group and displays information about the named ports. Depending on the specified options, this method can list all instances or only the instances that are running. The orderBy query parameter is not supported. +func (c *regionInstanceGroupsRESTClient) ListInstances(ctx context.Context, req *computepb.ListInstancesRegionInstanceGroupsRequest, opts ...gax.CallOption) (*computepb.RegionInstanceGroupsListInstances, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetRegionInstanceGroupsListInstancesRequestResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/instanceGroups/%v/listInstances", req.GetProject(), req.GetRegion(), req.GetInstanceGroup()) + + 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() + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.RegionInstanceGroupsListInstances{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// SetNamedPorts sets the named ports for the specified regional instance group. +func (c *regionInstanceGroupsRESTClient) SetNamedPorts(ctx context.Context, req *computepb.SetNamedPortsRegionInstanceGroupRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetRegionInstanceGroupsSetNamedPortsRequestResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/instanceGroups/%v/setNamedPorts", req.GetProject(), req.GetRegion(), req.GetInstanceGroup()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} diff --git a/compute/apiv1/region_instance_groups_client_example_test.go b/compute/apiv1/region_instance_groups_client_example_test.go new file mode 100644 index 00000000000..646c6f1843d --- /dev/null +++ b/compute/apiv1/region_instance_groups_client_example_test.go @@ -0,0 +1,112 @@ +// Copyright 2021 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_test + +import ( + "context" + + compute "cloud.google.com/go/compute/apiv1" + computepb "google.golang.org/genproto/googleapis/cloud/compute/v1" +) + +func ExampleNewRegionInstanceGroupsRESTClient() { + ctx := context.Background() + c, err := compute.NewRegionInstanceGroupsRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + // TODO: Use client. + _ = c +} + +func ExampleRegionInstanceGroupsClient_Get() { + ctx := context.Background() + c, err := compute.NewRegionInstanceGroupsRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.GetRegionInstanceGroupRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Get(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleRegionInstanceGroupsClient_List() { + ctx := context.Background() + c, err := compute.NewRegionInstanceGroupsRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.ListRegionInstanceGroupsRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.List(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleRegionInstanceGroupsClient_ListInstances() { + ctx := context.Background() + c, err := compute.NewRegionInstanceGroupsRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.ListInstancesRegionInstanceGroupsRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.ListInstances(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleRegionInstanceGroupsClient_SetNamedPorts() { + ctx := context.Background() + c, err := compute.NewRegionInstanceGroupsRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.SetNamedPortsRegionInstanceGroupRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.SetNamedPorts(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} diff --git a/compute/apiv1/region_instances_client.go b/compute/apiv1/region_instances_client.go new file mode 100644 index 00000000000..e9a7f88fdf8 --- /dev/null +++ b/compute/apiv1/region_instances_client.go @@ -0,0 +1,204 @@ +// Copyright 2021 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/ioutil" + "net/http" + "net/url" + + gax "github.com/googleapis/gax-go/v2" + "google.golang.org/api/option" + "google.golang.org/api/option/internaloption" + httptransport "google.golang.org/api/transport/http" + computepb "google.golang.org/genproto/googleapis/cloud/compute/v1" + "google.golang.org/grpc" + "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/encoding/protojson" +) + +var newRegionInstancesClientHook clientHook + +// RegionInstancesCallOptions contains the retry settings for each method of RegionInstancesClient. +type RegionInstancesCallOptions struct { + BulkInsert []gax.CallOption +} + +// internalRegionInstancesClient is an interface that defines the methods availaible from Google Compute Engine API. +type internalRegionInstancesClient interface { + Close() error + setGoogleClientInfo(...string) + Connection() *grpc.ClientConn + BulkInsert(context.Context, *computepb.BulkInsertRegionInstanceRequest, ...gax.CallOption) (*computepb.Operation, error) +} + +// RegionInstancesClient 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 RegionInstances API. +type RegionInstancesClient struct { + // The internal transport-dependent client. + internalClient internalRegionInstancesClient + + // The call options for this service. + CallOptions *RegionInstancesCallOptions +} + +// 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 *RegionInstancesClient) 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 *RegionInstancesClient) setGoogleClientInfo(keyval ...string) { + c.internalClient.setGoogleClientInfo(keyval...) +} + +// Connection returns a connection to the API service. +// +// Deprecated. +func (c *RegionInstancesClient) Connection() *grpc.ClientConn { + return c.internalClient.Connection() +} + +// BulkInsert creates multiple instances in a given region. Count specifies the number of instances to create. +func (c *RegionInstancesClient) BulkInsert(ctx context.Context, req *computepb.BulkInsertRegionInstanceRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.BulkInsert(ctx, req, opts...) +} + +// Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls. +type regionInstancesRESTClient struct { + // The http endpoint to connect to. + endpoint string + + // The http client. + httpClient *http.Client + + // The x-goog-* metadata to be sent with each request. + xGoogMetadata metadata.MD +} + +// NewRegionInstancesRESTClient creates a new region instances rest client. +// +// The RegionInstances API. +func NewRegionInstancesRESTClient(ctx context.Context, opts ...option.ClientOption) (*RegionInstancesClient, error) { + clientOpts := append(defaultRegionInstancesRESTClientOptions(), opts...) + httpClient, endpoint, err := httptransport.NewClient(ctx, clientOpts...) + if err != nil { + return nil, err + } + + c := ®ionInstancesRESTClient{ + endpoint: endpoint, + httpClient: httpClient, + } + c.setGoogleClientInfo() + + return &RegionInstancesClient{internalClient: c, CallOptions: &RegionInstancesCallOptions{}}, nil +} + +func defaultRegionInstancesRESTClientOptions() []option.ClientOption { + return []option.ClientOption{ + internaloption.WithDefaultEndpoint("compute.googleapis.com"), + internaloption.WithDefaultMTLSEndpoint("compute.mtls.googleapis.com"), + internaloption.WithDefaultAudience("https://compute.googleapis.com/"), + internaloption.WithDefaultScopes(DefaultAuthScopes()...), + } +} + +// setGoogleClientInfo sets the name and version of the application in +// the `x-goog-api-client` header passed on each request. Intended for +// use by Google-written clients. +func (c *regionInstancesRESTClient) setGoogleClientInfo(keyval ...string) { + kv := append([]string{"gl-go", versionGo()}, keyval...) + kv = append(kv, "gapic", versionClient, "gax", gax.Version, "rest", "UNKNOWN") + c.xGoogMetadata = metadata.Pairs("x-goog-api-client", gax.XGoogHeader(kv...)) +} + +// Close closes the connection to the API service. The user should invoke this when +// the client is no longer required. +func (c *regionInstancesRESTClient) Close() error { + // Replace httpClient with nil to force cleanup. + c.httpClient = nil + return nil +} + +// Connection returns a connection to the API service. +// +// Deprecated. +func (c *regionInstancesRESTClient) Connection() *grpc.ClientConn { + return nil +} + +// BulkInsert creates multiple instances in a given region. Count specifies the number of instances to create. +func (c *regionInstancesRESTClient) BulkInsert(ctx context.Context, req *computepb.BulkInsertRegionInstanceRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetBulkInsertInstanceResourceResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/instances/bulkInsert", req.GetProject(), req.GetRegion()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} diff --git a/compute/apiv1/region_instances_client_example_test.go b/compute/apiv1/region_instances_client_example_test.go new file mode 100644 index 00000000000..9856d6f60c7 --- /dev/null +++ b/compute/apiv1/region_instances_client_example_test.go @@ -0,0 +1,55 @@ +// Copyright 2021 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_test + +import ( + "context" + + compute "cloud.google.com/go/compute/apiv1" + computepb "google.golang.org/genproto/googleapis/cloud/compute/v1" +) + +func ExampleNewRegionInstancesRESTClient() { + ctx := context.Background() + c, err := compute.NewRegionInstancesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + // TODO: Use client. + _ = c +} + +func ExampleRegionInstancesClient_BulkInsert() { + ctx := context.Background() + c, err := compute.NewRegionInstancesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.BulkInsertRegionInstanceRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.BulkInsert(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} diff --git a/compute/apiv1/region_network_endpoint_groups_client.go b/compute/apiv1/region_network_endpoint_groups_client.go new file mode 100644 index 00000000000..ace6be51de1 --- /dev/null +++ b/compute/apiv1/region_network_endpoint_groups_client.go @@ -0,0 +1,380 @@ +// Copyright 2021 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/ioutil" + "net/http" + "net/url" + + gax "github.com/googleapis/gax-go/v2" + "google.golang.org/api/option" + "google.golang.org/api/option/internaloption" + httptransport "google.golang.org/api/transport/http" + computepb "google.golang.org/genproto/googleapis/cloud/compute/v1" + "google.golang.org/grpc" + "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/encoding/protojson" +) + +var newRegionNetworkEndpointGroupsClientHook clientHook + +// RegionNetworkEndpointGroupsCallOptions contains the retry settings for each method of RegionNetworkEndpointGroupsClient. +type RegionNetworkEndpointGroupsCallOptions struct { + Delete []gax.CallOption + Get []gax.CallOption + Insert []gax.CallOption + List []gax.CallOption +} + +// internalRegionNetworkEndpointGroupsClient is an interface that defines the methods availaible from Google Compute Engine API. +type internalRegionNetworkEndpointGroupsClient interface { + Close() error + setGoogleClientInfo(...string) + Connection() *grpc.ClientConn + Delete(context.Context, *computepb.DeleteRegionNetworkEndpointGroupRequest, ...gax.CallOption) (*computepb.Operation, error) + Get(context.Context, *computepb.GetRegionNetworkEndpointGroupRequest, ...gax.CallOption) (*computepb.NetworkEndpointGroup, error) + Insert(context.Context, *computepb.InsertRegionNetworkEndpointGroupRequest, ...gax.CallOption) (*computepb.Operation, error) + List(context.Context, *computepb.ListRegionNetworkEndpointGroupsRequest, ...gax.CallOption) (*computepb.NetworkEndpointGroupList, error) +} + +// RegionNetworkEndpointGroupsClient 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 RegionNetworkEndpointGroups API. +type RegionNetworkEndpointGroupsClient struct { + // The internal transport-dependent client. + internalClient internalRegionNetworkEndpointGroupsClient + + // The call options for this service. + CallOptions *RegionNetworkEndpointGroupsCallOptions +} + +// 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 *RegionNetworkEndpointGroupsClient) 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 *RegionNetworkEndpointGroupsClient) setGoogleClientInfo(keyval ...string) { + c.internalClient.setGoogleClientInfo(keyval...) +} + +// Connection returns a connection to the API service. +// +// Deprecated. +func (c *RegionNetworkEndpointGroupsClient) Connection() *grpc.ClientConn { + return c.internalClient.Connection() +} + +// 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) (*computepb.Operation, error) { + return c.internalClient.Delete(ctx, req, opts...) +} + +// Get returns the specified network endpoint group. Gets a list of available network endpoint groups by making a list() request. +func (c *RegionNetworkEndpointGroupsClient) Get(ctx context.Context, req *computepb.GetRegionNetworkEndpointGroupRequest, opts ...gax.CallOption) (*computepb.NetworkEndpointGroup, error) { + return c.internalClient.Get(ctx, req, opts...) +} + +// Insert creates a network endpoint group in the specified project using the parameters that are included in the request. +func (c *RegionNetworkEndpointGroupsClient) Insert(ctx context.Context, req *computepb.InsertRegionNetworkEndpointGroupRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.Insert(ctx, req, opts...) +} + +// List retrieves the list of regional network endpoint groups available to the specified project in the given region. +func (c *RegionNetworkEndpointGroupsClient) List(ctx context.Context, req *computepb.ListRegionNetworkEndpointGroupsRequest, opts ...gax.CallOption) (*computepb.NetworkEndpointGroupList, error) { + return c.internalClient.List(ctx, req, opts...) +} + +// Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls. +type regionNetworkEndpointGroupsRESTClient struct { + // The http endpoint to connect to. + endpoint string + + // The http client. + httpClient *http.Client + + // The x-goog-* metadata to be sent with each request. + xGoogMetadata metadata.MD +} + +// NewRegionNetworkEndpointGroupsRESTClient creates a new region network endpoint groups rest client. +// +// The RegionNetworkEndpointGroups API. +func NewRegionNetworkEndpointGroupsRESTClient(ctx context.Context, opts ...option.ClientOption) (*RegionNetworkEndpointGroupsClient, error) { + clientOpts := append(defaultRegionNetworkEndpointGroupsRESTClientOptions(), opts...) + httpClient, endpoint, err := httptransport.NewClient(ctx, clientOpts...) + if err != nil { + return nil, err + } + + c := ®ionNetworkEndpointGroupsRESTClient{ + endpoint: endpoint, + httpClient: httpClient, + } + c.setGoogleClientInfo() + + return &RegionNetworkEndpointGroupsClient{internalClient: c, CallOptions: &RegionNetworkEndpointGroupsCallOptions{}}, nil +} + +func defaultRegionNetworkEndpointGroupsRESTClientOptions() []option.ClientOption { + return []option.ClientOption{ + internaloption.WithDefaultEndpoint("compute.googleapis.com"), + internaloption.WithDefaultMTLSEndpoint("compute.mtls.googleapis.com"), + internaloption.WithDefaultAudience("https://compute.googleapis.com/"), + internaloption.WithDefaultScopes(DefaultAuthScopes()...), + } +} + +// setGoogleClientInfo sets the name and version of the application in +// the `x-goog-api-client` header passed on each request. Intended for +// use by Google-written clients. +func (c *regionNetworkEndpointGroupsRESTClient) setGoogleClientInfo(keyval ...string) { + kv := append([]string{"gl-go", versionGo()}, keyval...) + kv = append(kv, "gapic", versionClient, "gax", gax.Version, "rest", "UNKNOWN") + c.xGoogMetadata = metadata.Pairs("x-goog-api-client", gax.XGoogHeader(kv...)) +} + +// Close closes the connection to the API service. The user should invoke this when +// the client is no longer required. +func (c *regionNetworkEndpointGroupsRESTClient) Close() error { + // Replace httpClient with nil to force cleanup. + c.httpClient = nil + return nil +} + +// Connection returns a connection to the API service. +// +// Deprecated. +func (c *regionNetworkEndpointGroupsRESTClient) Connection() *grpc.ClientConn { + return 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) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/networkEndpointGroups/%v", 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() + + httpReq, err := http.NewRequest("DELETE", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Get returns the specified network endpoint group. Gets a list of available network endpoint groups by making a list() request. +func (c *regionNetworkEndpointGroupsRESTClient) Get(ctx context.Context, req *computepb.GetRegionNetworkEndpointGroupRequest, opts ...gax.CallOption) (*computepb.NetworkEndpointGroup, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/networkEndpointGroups/%v", req.GetProject(), req.GetRegion(), req.GetNetworkEndpointGroup()) + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.NetworkEndpointGroup{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Insert creates a network endpoint group in the specified project using the parameters that are included in the request. +func (c *regionNetworkEndpointGroupsRESTClient) Insert(ctx context.Context, req *computepb.InsertRegionNetworkEndpointGroupRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetNetworkEndpointGroupResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/networkEndpointGroups", req.GetProject(), req.GetRegion()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// List retrieves the list of regional network endpoint groups available to the specified project in the given region. +func (c *regionNetworkEndpointGroupsRESTClient) List(ctx context.Context, req *computepb.ListRegionNetworkEndpointGroupsRequest, opts ...gax.CallOption) (*computepb.NetworkEndpointGroupList, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/networkEndpointGroups", 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() + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.NetworkEndpointGroupList{} + + return rsp, unm.Unmarshal(buf, rsp) +} diff --git a/compute/apiv1/region_network_endpoint_groups_client_example_test.go b/compute/apiv1/region_network_endpoint_groups_client_example_test.go new file mode 100644 index 00000000000..507dceea933 --- /dev/null +++ b/compute/apiv1/region_network_endpoint_groups_client_example_test.go @@ -0,0 +1,112 @@ +// Copyright 2021 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_test + +import ( + "context" + + compute "cloud.google.com/go/compute/apiv1" + computepb "google.golang.org/genproto/googleapis/cloud/compute/v1" +) + +func ExampleNewRegionNetworkEndpointGroupsRESTClient() { + ctx := context.Background() + c, err := compute.NewRegionNetworkEndpointGroupsRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + // TODO: Use client. + _ = c +} + +func ExampleRegionNetworkEndpointGroupsClient_Delete() { + ctx := context.Background() + c, err := compute.NewRegionNetworkEndpointGroupsRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.DeleteRegionNetworkEndpointGroupRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Delete(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleRegionNetworkEndpointGroupsClient_Get() { + ctx := context.Background() + c, err := compute.NewRegionNetworkEndpointGroupsRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.GetRegionNetworkEndpointGroupRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Get(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleRegionNetworkEndpointGroupsClient_Insert() { + ctx := context.Background() + c, err := compute.NewRegionNetworkEndpointGroupsRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.InsertRegionNetworkEndpointGroupRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Insert(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleRegionNetworkEndpointGroupsClient_List() { + ctx := context.Background() + c, err := compute.NewRegionNetworkEndpointGroupsRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.ListRegionNetworkEndpointGroupsRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.List(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} diff --git a/compute/apiv1/region_notification_endpoints_client.go b/compute/apiv1/region_notification_endpoints_client.go new file mode 100644 index 00000000000..1ab16484260 --- /dev/null +++ b/compute/apiv1/region_notification_endpoints_client.go @@ -0,0 +1,380 @@ +// Copyright 2021 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/ioutil" + "net/http" + "net/url" + + gax "github.com/googleapis/gax-go/v2" + "google.golang.org/api/option" + "google.golang.org/api/option/internaloption" + httptransport "google.golang.org/api/transport/http" + computepb "google.golang.org/genproto/googleapis/cloud/compute/v1" + "google.golang.org/grpc" + "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/encoding/protojson" +) + +var newRegionNotificationEndpointsClientHook clientHook + +// RegionNotificationEndpointsCallOptions contains the retry settings for each method of RegionNotificationEndpointsClient. +type RegionNotificationEndpointsCallOptions struct { + Delete []gax.CallOption + Get []gax.CallOption + Insert []gax.CallOption + List []gax.CallOption +} + +// internalRegionNotificationEndpointsClient is an interface that defines the methods availaible from Google Compute Engine API. +type internalRegionNotificationEndpointsClient interface { + Close() error + setGoogleClientInfo(...string) + Connection() *grpc.ClientConn + Delete(context.Context, *computepb.DeleteRegionNotificationEndpointRequest, ...gax.CallOption) (*computepb.Operation, error) + Get(context.Context, *computepb.GetRegionNotificationEndpointRequest, ...gax.CallOption) (*computepb.NotificationEndpoint, error) + Insert(context.Context, *computepb.InsertRegionNotificationEndpointRequest, ...gax.CallOption) (*computepb.Operation, error) + List(context.Context, *computepb.ListRegionNotificationEndpointsRequest, ...gax.CallOption) (*computepb.NotificationEndpointList, error) +} + +// RegionNotificationEndpointsClient 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 RegionNotificationEndpoints API. +type RegionNotificationEndpointsClient struct { + // The internal transport-dependent client. + internalClient internalRegionNotificationEndpointsClient + + // The call options for this service. + CallOptions *RegionNotificationEndpointsCallOptions +} + +// 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 *RegionNotificationEndpointsClient) 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 *RegionNotificationEndpointsClient) setGoogleClientInfo(keyval ...string) { + c.internalClient.setGoogleClientInfo(keyval...) +} + +// Connection returns a connection to the API service. +// +// Deprecated. +func (c *RegionNotificationEndpointsClient) Connection() *grpc.ClientConn { + return c.internalClient.Connection() +} + +// Delete deletes the specified NotificationEndpoint in the given region +func (c *RegionNotificationEndpointsClient) Delete(ctx context.Context, req *computepb.DeleteRegionNotificationEndpointRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.Delete(ctx, req, opts...) +} + +// Get returns the specified NotificationEndpoint resource in the given region. +func (c *RegionNotificationEndpointsClient) Get(ctx context.Context, req *computepb.GetRegionNotificationEndpointRequest, opts ...gax.CallOption) (*computepb.NotificationEndpoint, error) { + return c.internalClient.Get(ctx, req, opts...) +} + +// Insert create a NotificationEndpoint in the specified project in the given region using the parameters that are included in the request. +func (c *RegionNotificationEndpointsClient) Insert(ctx context.Context, req *computepb.InsertRegionNotificationEndpointRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.Insert(ctx, req, opts...) +} + +// List lists the NotificationEndpoints for a project in the given region. +func (c *RegionNotificationEndpointsClient) List(ctx context.Context, req *computepb.ListRegionNotificationEndpointsRequest, opts ...gax.CallOption) (*computepb.NotificationEndpointList, error) { + return c.internalClient.List(ctx, req, opts...) +} + +// Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls. +type regionNotificationEndpointsRESTClient struct { + // The http endpoint to connect to. + endpoint string + + // The http client. + httpClient *http.Client + + // The x-goog-* metadata to be sent with each request. + xGoogMetadata metadata.MD +} + +// NewRegionNotificationEndpointsRESTClient creates a new region notification endpoints rest client. +// +// The RegionNotificationEndpoints API. +func NewRegionNotificationEndpointsRESTClient(ctx context.Context, opts ...option.ClientOption) (*RegionNotificationEndpointsClient, error) { + clientOpts := append(defaultRegionNotificationEndpointsRESTClientOptions(), opts...) + httpClient, endpoint, err := httptransport.NewClient(ctx, clientOpts...) + if err != nil { + return nil, err + } + + c := ®ionNotificationEndpointsRESTClient{ + endpoint: endpoint, + httpClient: httpClient, + } + c.setGoogleClientInfo() + + return &RegionNotificationEndpointsClient{internalClient: c, CallOptions: &RegionNotificationEndpointsCallOptions{}}, nil +} + +func defaultRegionNotificationEndpointsRESTClientOptions() []option.ClientOption { + return []option.ClientOption{ + internaloption.WithDefaultEndpoint("compute.googleapis.com"), + internaloption.WithDefaultMTLSEndpoint("compute.mtls.googleapis.com"), + internaloption.WithDefaultAudience("https://compute.googleapis.com/"), + internaloption.WithDefaultScopes(DefaultAuthScopes()...), + } +} + +// setGoogleClientInfo sets the name and version of the application in +// the `x-goog-api-client` header passed on each request. Intended for +// use by Google-written clients. +func (c *regionNotificationEndpointsRESTClient) setGoogleClientInfo(keyval ...string) { + kv := append([]string{"gl-go", versionGo()}, keyval...) + kv = append(kv, "gapic", versionClient, "gax", gax.Version, "rest", "UNKNOWN") + c.xGoogMetadata = metadata.Pairs("x-goog-api-client", gax.XGoogHeader(kv...)) +} + +// Close closes the connection to the API service. The user should invoke this when +// the client is no longer required. +func (c *regionNotificationEndpointsRESTClient) Close() error { + // Replace httpClient with nil to force cleanup. + c.httpClient = nil + return nil +} + +// Connection returns a connection to the API service. +// +// Deprecated. +func (c *regionNotificationEndpointsRESTClient) Connection() *grpc.ClientConn { + return nil +} + +// Delete deletes the specified NotificationEndpoint in the given region +func (c *regionNotificationEndpointsRESTClient) Delete(ctx context.Context, req *computepb.DeleteRegionNotificationEndpointRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/notificationEndpoints/%v", req.GetProject(), req.GetRegion(), req.GetNotificationEndpoint()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("DELETE", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Get returns the specified NotificationEndpoint resource in the given region. +func (c *regionNotificationEndpointsRESTClient) Get(ctx context.Context, req *computepb.GetRegionNotificationEndpointRequest, opts ...gax.CallOption) (*computepb.NotificationEndpoint, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/notificationEndpoints/%v", req.GetProject(), req.GetRegion(), req.GetNotificationEndpoint()) + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.NotificationEndpoint{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Insert create a NotificationEndpoint in the specified project in the given region using the parameters that are included in the request. +func (c *regionNotificationEndpointsRESTClient) Insert(ctx context.Context, req *computepb.InsertRegionNotificationEndpointRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetNotificationEndpointResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/notificationEndpoints", req.GetProject(), req.GetRegion()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// List lists the NotificationEndpoints for a project in the given region. +func (c *regionNotificationEndpointsRESTClient) List(ctx context.Context, req *computepb.ListRegionNotificationEndpointsRequest, opts ...gax.CallOption) (*computepb.NotificationEndpointList, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/notificationEndpoints", 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() + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.NotificationEndpointList{} + + return rsp, unm.Unmarshal(buf, rsp) +} diff --git a/compute/apiv1/region_notification_endpoints_client_example_test.go b/compute/apiv1/region_notification_endpoints_client_example_test.go new file mode 100644 index 00000000000..708851924c5 --- /dev/null +++ b/compute/apiv1/region_notification_endpoints_client_example_test.go @@ -0,0 +1,112 @@ +// Copyright 2021 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_test + +import ( + "context" + + compute "cloud.google.com/go/compute/apiv1" + computepb "google.golang.org/genproto/googleapis/cloud/compute/v1" +) + +func ExampleNewRegionNotificationEndpointsRESTClient() { + ctx := context.Background() + c, err := compute.NewRegionNotificationEndpointsRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + // TODO: Use client. + _ = c +} + +func ExampleRegionNotificationEndpointsClient_Delete() { + ctx := context.Background() + c, err := compute.NewRegionNotificationEndpointsRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.DeleteRegionNotificationEndpointRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Delete(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleRegionNotificationEndpointsClient_Get() { + ctx := context.Background() + c, err := compute.NewRegionNotificationEndpointsRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.GetRegionNotificationEndpointRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Get(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleRegionNotificationEndpointsClient_Insert() { + ctx := context.Background() + c, err := compute.NewRegionNotificationEndpointsRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.InsertRegionNotificationEndpointRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Insert(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleRegionNotificationEndpointsClient_List() { + ctx := context.Background() + c, err := compute.NewRegionNotificationEndpointsRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.ListRegionNotificationEndpointsRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.List(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} diff --git a/compute/apiv1/region_operations_client.go b/compute/apiv1/region_operations_client.go new file mode 100644 index 00000000000..cccff7a0508 --- /dev/null +++ b/compute/apiv1/region_operations_client.go @@ -0,0 +1,377 @@ +// Copyright 2021 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/ioutil" + "net/http" + "net/url" + + gax "github.com/googleapis/gax-go/v2" + "google.golang.org/api/option" + "google.golang.org/api/option/internaloption" + httptransport "google.golang.org/api/transport/http" + computepb "google.golang.org/genproto/googleapis/cloud/compute/v1" + "google.golang.org/grpc" + "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/encoding/protojson" +) + +var newRegionOperationsClientHook clientHook + +// RegionOperationsCallOptions contains the retry settings for each method of RegionOperationsClient. +type RegionOperationsCallOptions struct { + Delete []gax.CallOption + Get []gax.CallOption + List []gax.CallOption + Wait []gax.CallOption +} + +// internalRegionOperationsClient is an interface that defines the methods availaible from Google Compute Engine API. +type internalRegionOperationsClient interface { + Close() error + setGoogleClientInfo(...string) + Connection() *grpc.ClientConn + Delete(context.Context, *computepb.DeleteRegionOperationRequest, ...gax.CallOption) (*computepb.DeleteRegionOperationResponse, error) + Get(context.Context, *computepb.GetRegionOperationRequest, ...gax.CallOption) (*computepb.Operation, error) + List(context.Context, *computepb.ListRegionOperationsRequest, ...gax.CallOption) (*computepb.OperationList, error) + Wait(context.Context, *computepb.WaitRegionOperationRequest, ...gax.CallOption) (*computepb.Operation, error) +} + +// RegionOperationsClient 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 RegionOperations API. +type RegionOperationsClient struct { + // The internal transport-dependent client. + internalClient internalRegionOperationsClient + + // The call options for this service. + CallOptions *RegionOperationsCallOptions +} + +// 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 *RegionOperationsClient) 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 *RegionOperationsClient) setGoogleClientInfo(keyval ...string) { + c.internalClient.setGoogleClientInfo(keyval...) +} + +// Connection returns a connection to the API service. +// +// Deprecated. +func (c *RegionOperationsClient) Connection() *grpc.ClientConn { + return c.internalClient.Connection() +} + +// Delete deletes the specified region-specific Operations resource. +func (c *RegionOperationsClient) Delete(ctx context.Context, req *computepb.DeleteRegionOperationRequest, opts ...gax.CallOption) (*computepb.DeleteRegionOperationResponse, error) { + return c.internalClient.Delete(ctx, req, opts...) +} + +// Get retrieves the specified region-specific Operations resource. +func (c *RegionOperationsClient) Get(ctx context.Context, req *computepb.GetRegionOperationRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.Get(ctx, req, opts...) +} + +// List retrieves a list of Operation resources contained within the specified region. +func (c *RegionOperationsClient) List(ctx context.Context, req *computepb.ListRegionOperationsRequest, opts ...gax.CallOption) (*computepb.OperationList, error) { + return c.internalClient.List(ctx, req, opts...) +} + +// Wait waits for the specified Operation resource to return as DONE or for the request to approach the 2 minute deadline, and retrieves the specified Operation resource. This method differs from the GET method in that it waits for no more than the default deadline (2 minutes) and then returns the current state of the operation, which might be DONE or still in progress. +// +// This method is called on a best-effort basis. Specifically: +// +// In uncommon cases, when the server is overloaded, the request might return before the default deadline is reached, or might return after zero seconds. +// +// If the default deadline is reached, there is no guarantee that the operation is actually done when the method returns. Be prepared to retry if the operation is not DONE. +func (c *RegionOperationsClient) Wait(ctx context.Context, req *computepb.WaitRegionOperationRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.Wait(ctx, req, opts...) +} + +// Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls. +type regionOperationsRESTClient struct { + // The http endpoint to connect to. + endpoint string + + // The http client. + httpClient *http.Client + + // The x-goog-* metadata to be sent with each request. + xGoogMetadata metadata.MD +} + +// NewRegionOperationsRESTClient creates a new region operations rest client. +// +// The RegionOperations API. +func NewRegionOperationsRESTClient(ctx context.Context, opts ...option.ClientOption) (*RegionOperationsClient, error) { + clientOpts := append(defaultRegionOperationsRESTClientOptions(), opts...) + httpClient, endpoint, err := httptransport.NewClient(ctx, clientOpts...) + if err != nil { + return nil, err + } + + c := ®ionOperationsRESTClient{ + endpoint: endpoint, + httpClient: httpClient, + } + c.setGoogleClientInfo() + + return &RegionOperationsClient{internalClient: c, CallOptions: &RegionOperationsCallOptions{}}, nil +} + +func defaultRegionOperationsRESTClientOptions() []option.ClientOption { + return []option.ClientOption{ + internaloption.WithDefaultEndpoint("compute.googleapis.com"), + internaloption.WithDefaultMTLSEndpoint("compute.mtls.googleapis.com"), + internaloption.WithDefaultAudience("https://compute.googleapis.com/"), + internaloption.WithDefaultScopes(DefaultAuthScopes()...), + } +} + +// setGoogleClientInfo sets the name and version of the application in +// the `x-goog-api-client` header passed on each request. Intended for +// use by Google-written clients. +func (c *regionOperationsRESTClient) setGoogleClientInfo(keyval ...string) { + kv := append([]string{"gl-go", versionGo()}, keyval...) + kv = append(kv, "gapic", versionClient, "gax", gax.Version, "rest", "UNKNOWN") + c.xGoogMetadata = metadata.Pairs("x-goog-api-client", gax.XGoogHeader(kv...)) +} + +// Close closes the connection to the API service. The user should invoke this when +// the client is no longer required. +func (c *regionOperationsRESTClient) Close() error { + // Replace httpClient with nil to force cleanup. + c.httpClient = nil + return nil +} + +// Connection returns a connection to the API service. +// +// Deprecated. +func (c *regionOperationsRESTClient) Connection() *grpc.ClientConn { + return nil +} + +// Delete deletes the specified region-specific Operations resource. +func (c *regionOperationsRESTClient) Delete(ctx context.Context, req *computepb.DeleteRegionOperationRequest, opts ...gax.CallOption) (*computepb.DeleteRegionOperationResponse, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/operations/%v", req.GetProject(), req.GetRegion(), req.GetOperation()) + + httpReq, err := http.NewRequest("DELETE", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.DeleteRegionOperationResponse{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Get retrieves the specified region-specific Operations resource. +func (c *regionOperationsRESTClient) Get(ctx context.Context, req *computepb.GetRegionOperationRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/operations/%v", req.GetProject(), req.GetRegion(), req.GetOperation()) + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// List retrieves a list of Operation resources contained within the specified region. +func (c *regionOperationsRESTClient) List(ctx context.Context, req *computepb.ListRegionOperationsRequest, opts ...gax.CallOption) (*computepb.OperationList, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/operations", 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() + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.OperationList{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Wait waits for the specified Operation resource to return as DONE or for the request to approach the 2 minute deadline, and retrieves the specified Operation resource. This method differs from the GET method in that it waits for no more than the default deadline (2 minutes) and then returns the current state of the operation, which might be DONE or still in progress. +// +// This method is called on a best-effort basis. Specifically: +// +// In uncommon cases, when the server is overloaded, the request might return before the default deadline is reached, or might return after zero seconds. +// +// If the default deadline is reached, there is no guarantee that the operation is actually done when the method returns. Be prepared to retry if the operation is not DONE. +func (c *regionOperationsRESTClient) Wait(ctx context.Context, req *computepb.WaitRegionOperationRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/operations/%v/wait", req.GetProject(), req.GetRegion(), req.GetOperation()) + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} diff --git a/compute/apiv1/region_operations_client_example_test.go b/compute/apiv1/region_operations_client_example_test.go new file mode 100644 index 00000000000..75736e6becc --- /dev/null +++ b/compute/apiv1/region_operations_client_example_test.go @@ -0,0 +1,112 @@ +// Copyright 2021 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_test + +import ( + "context" + + compute "cloud.google.com/go/compute/apiv1" + computepb "google.golang.org/genproto/googleapis/cloud/compute/v1" +) + +func ExampleNewRegionOperationsRESTClient() { + ctx := context.Background() + c, err := compute.NewRegionOperationsRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + // TODO: Use client. + _ = c +} + +func ExampleRegionOperationsClient_Delete() { + ctx := context.Background() + c, err := compute.NewRegionOperationsRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.DeleteRegionOperationRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Delete(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleRegionOperationsClient_Get() { + ctx := context.Background() + c, err := compute.NewRegionOperationsRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.GetRegionOperationRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Get(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleRegionOperationsClient_List() { + ctx := context.Background() + c, err := compute.NewRegionOperationsRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.ListRegionOperationsRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.List(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleRegionOperationsClient_Wait() { + ctx := context.Background() + c, err := compute.NewRegionOperationsRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.WaitRegionOperationRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Wait(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} diff --git a/compute/apiv1/region_ssl_certificates_client.go b/compute/apiv1/region_ssl_certificates_client.go new file mode 100644 index 00000000000..bcf069420d6 --- /dev/null +++ b/compute/apiv1/region_ssl_certificates_client.go @@ -0,0 +1,380 @@ +// Copyright 2021 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/ioutil" + "net/http" + "net/url" + + gax "github.com/googleapis/gax-go/v2" + "google.golang.org/api/option" + "google.golang.org/api/option/internaloption" + httptransport "google.golang.org/api/transport/http" + computepb "google.golang.org/genproto/googleapis/cloud/compute/v1" + "google.golang.org/grpc" + "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/encoding/protojson" +) + +var newRegionSslCertificatesClientHook clientHook + +// RegionSslCertificatesCallOptions contains the retry settings for each method of RegionSslCertificatesClient. +type RegionSslCertificatesCallOptions struct { + Delete []gax.CallOption + Get []gax.CallOption + Insert []gax.CallOption + List []gax.CallOption +} + +// internalRegionSslCertificatesClient is an interface that defines the methods availaible from Google Compute Engine API. +type internalRegionSslCertificatesClient interface { + Close() error + setGoogleClientInfo(...string) + Connection() *grpc.ClientConn + Delete(context.Context, *computepb.DeleteRegionSslCertificateRequest, ...gax.CallOption) (*computepb.Operation, error) + Get(context.Context, *computepb.GetRegionSslCertificateRequest, ...gax.CallOption) (*computepb.SslCertificate, error) + Insert(context.Context, *computepb.InsertRegionSslCertificateRequest, ...gax.CallOption) (*computepb.Operation, error) + List(context.Context, *computepb.ListRegionSslCertificatesRequest, ...gax.CallOption) (*computepb.SslCertificateList, error) +} + +// RegionSslCertificatesClient 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 RegionSslCertificates API. +type RegionSslCertificatesClient struct { + // The internal transport-dependent client. + internalClient internalRegionSslCertificatesClient + + // The call options for this service. + CallOptions *RegionSslCertificatesCallOptions +} + +// 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 *RegionSslCertificatesClient) 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 *RegionSslCertificatesClient) setGoogleClientInfo(keyval ...string) { + c.internalClient.setGoogleClientInfo(keyval...) +} + +// Connection returns a connection to the API service. +// +// Deprecated. +func (c *RegionSslCertificatesClient) Connection() *grpc.ClientConn { + return c.internalClient.Connection() +} + +// Delete deletes the specified SslCertificate resource in the region. +func (c *RegionSslCertificatesClient) Delete(ctx context.Context, req *computepb.DeleteRegionSslCertificateRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.Delete(ctx, req, opts...) +} + +// Get returns the specified SslCertificate resource in the specified region. Get a list of available SSL certificates by making a list() request. +func (c *RegionSslCertificatesClient) Get(ctx context.Context, req *computepb.GetRegionSslCertificateRequest, opts ...gax.CallOption) (*computepb.SslCertificate, error) { + return c.internalClient.Get(ctx, req, opts...) +} + +// Insert creates a SslCertificate resource in the specified project and region using the data included in the request +func (c *RegionSslCertificatesClient) Insert(ctx context.Context, req *computepb.InsertRegionSslCertificateRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.Insert(ctx, req, opts...) +} + +// List retrieves the list of SslCertificate resources available to the specified project in the specified region. +func (c *RegionSslCertificatesClient) List(ctx context.Context, req *computepb.ListRegionSslCertificatesRequest, opts ...gax.CallOption) (*computepb.SslCertificateList, error) { + return c.internalClient.List(ctx, req, opts...) +} + +// Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls. +type regionSslCertificatesRESTClient struct { + // The http endpoint to connect to. + endpoint string + + // The http client. + httpClient *http.Client + + // The x-goog-* metadata to be sent with each request. + xGoogMetadata metadata.MD +} + +// NewRegionSslCertificatesRESTClient creates a new region ssl certificates rest client. +// +// The RegionSslCertificates API. +func NewRegionSslCertificatesRESTClient(ctx context.Context, opts ...option.ClientOption) (*RegionSslCertificatesClient, error) { + clientOpts := append(defaultRegionSslCertificatesRESTClientOptions(), opts...) + httpClient, endpoint, err := httptransport.NewClient(ctx, clientOpts...) + if err != nil { + return nil, err + } + + c := ®ionSslCertificatesRESTClient{ + endpoint: endpoint, + httpClient: httpClient, + } + c.setGoogleClientInfo() + + return &RegionSslCertificatesClient{internalClient: c, CallOptions: &RegionSslCertificatesCallOptions{}}, nil +} + +func defaultRegionSslCertificatesRESTClientOptions() []option.ClientOption { + return []option.ClientOption{ + internaloption.WithDefaultEndpoint("compute.googleapis.com"), + internaloption.WithDefaultMTLSEndpoint("compute.mtls.googleapis.com"), + internaloption.WithDefaultAudience("https://compute.googleapis.com/"), + internaloption.WithDefaultScopes(DefaultAuthScopes()...), + } +} + +// setGoogleClientInfo sets the name and version of the application in +// the `x-goog-api-client` header passed on each request. Intended for +// use by Google-written clients. +func (c *regionSslCertificatesRESTClient) setGoogleClientInfo(keyval ...string) { + kv := append([]string{"gl-go", versionGo()}, keyval...) + kv = append(kv, "gapic", versionClient, "gax", gax.Version, "rest", "UNKNOWN") + c.xGoogMetadata = metadata.Pairs("x-goog-api-client", gax.XGoogHeader(kv...)) +} + +// Close closes the connection to the API service. The user should invoke this when +// the client is no longer required. +func (c *regionSslCertificatesRESTClient) Close() error { + // Replace httpClient with nil to force cleanup. + c.httpClient = nil + return nil +} + +// Connection returns a connection to the API service. +// +// Deprecated. +func (c *regionSslCertificatesRESTClient) Connection() *grpc.ClientConn { + return nil +} + +// Delete deletes the specified SslCertificate resource in the region. +func (c *regionSslCertificatesRESTClient) Delete(ctx context.Context, req *computepb.DeleteRegionSslCertificateRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/sslCertificates/%v", req.GetProject(), req.GetRegion(), req.GetSslCertificate()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("DELETE", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Get returns the specified SslCertificate resource in the specified region. Get a list of available SSL certificates by making a list() request. +func (c *regionSslCertificatesRESTClient) Get(ctx context.Context, req *computepb.GetRegionSslCertificateRequest, opts ...gax.CallOption) (*computepb.SslCertificate, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/sslCertificates/%v", req.GetProject(), req.GetRegion(), req.GetSslCertificate()) + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.SslCertificate{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Insert creates a SslCertificate resource in the specified project and region using the data included in the request +func (c *regionSslCertificatesRESTClient) Insert(ctx context.Context, req *computepb.InsertRegionSslCertificateRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetSslCertificateResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/sslCertificates", req.GetProject(), req.GetRegion()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// List retrieves the list of SslCertificate resources available to the specified project in the specified region. +func (c *regionSslCertificatesRESTClient) List(ctx context.Context, req *computepb.ListRegionSslCertificatesRequest, opts ...gax.CallOption) (*computepb.SslCertificateList, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/sslCertificates", 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() + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.SslCertificateList{} + + return rsp, unm.Unmarshal(buf, rsp) +} diff --git a/compute/apiv1/region_ssl_certificates_client_example_test.go b/compute/apiv1/region_ssl_certificates_client_example_test.go new file mode 100644 index 00000000000..016dcb96a14 --- /dev/null +++ b/compute/apiv1/region_ssl_certificates_client_example_test.go @@ -0,0 +1,112 @@ +// Copyright 2021 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_test + +import ( + "context" + + compute "cloud.google.com/go/compute/apiv1" + computepb "google.golang.org/genproto/googleapis/cloud/compute/v1" +) + +func ExampleNewRegionSslCertificatesRESTClient() { + ctx := context.Background() + c, err := compute.NewRegionSslCertificatesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + // TODO: Use client. + _ = c +} + +func ExampleRegionSslCertificatesClient_Delete() { + ctx := context.Background() + c, err := compute.NewRegionSslCertificatesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.DeleteRegionSslCertificateRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Delete(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleRegionSslCertificatesClient_Get() { + ctx := context.Background() + c, err := compute.NewRegionSslCertificatesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.GetRegionSslCertificateRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Get(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleRegionSslCertificatesClient_Insert() { + ctx := context.Background() + c, err := compute.NewRegionSslCertificatesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.InsertRegionSslCertificateRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Insert(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleRegionSslCertificatesClient_List() { + ctx := context.Background() + c, err := compute.NewRegionSslCertificatesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.ListRegionSslCertificatesRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.List(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} diff --git a/compute/apiv1/region_target_http_proxies_client.go b/compute/apiv1/region_target_http_proxies_client.go new file mode 100644 index 00000000000..f2a338841e2 --- /dev/null +++ b/compute/apiv1/region_target_http_proxies_client.go @@ -0,0 +1,438 @@ +// Copyright 2021 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/ioutil" + "net/http" + "net/url" + + gax "github.com/googleapis/gax-go/v2" + "google.golang.org/api/option" + "google.golang.org/api/option/internaloption" + httptransport "google.golang.org/api/transport/http" + computepb "google.golang.org/genproto/googleapis/cloud/compute/v1" + "google.golang.org/grpc" + "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/encoding/protojson" +) + +var newRegionTargetHttpProxiesClientHook clientHook + +// RegionTargetHttpProxiesCallOptions contains the retry settings for each method of RegionTargetHttpProxiesClient. +type RegionTargetHttpProxiesCallOptions struct { + Delete []gax.CallOption + Get []gax.CallOption + Insert []gax.CallOption + List []gax.CallOption + SetUrlMap []gax.CallOption +} + +// internalRegionTargetHttpProxiesClient is an interface that defines the methods availaible from Google Compute Engine API. +type internalRegionTargetHttpProxiesClient interface { + Close() error + setGoogleClientInfo(...string) + Connection() *grpc.ClientConn + Delete(context.Context, *computepb.DeleteRegionTargetHttpProxyRequest, ...gax.CallOption) (*computepb.Operation, error) + Get(context.Context, *computepb.GetRegionTargetHttpProxyRequest, ...gax.CallOption) (*computepb.TargetHttpProxy, error) + Insert(context.Context, *computepb.InsertRegionTargetHttpProxyRequest, ...gax.CallOption) (*computepb.Operation, error) + List(context.Context, *computepb.ListRegionTargetHttpProxiesRequest, ...gax.CallOption) (*computepb.TargetHttpProxyList, error) + SetUrlMap(context.Context, *computepb.SetUrlMapRegionTargetHttpProxyRequest, ...gax.CallOption) (*computepb.Operation, error) +} + +// RegionTargetHttpProxiesClient 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 RegionTargetHttpProxies API. +type RegionTargetHttpProxiesClient struct { + // The internal transport-dependent client. + internalClient internalRegionTargetHttpProxiesClient + + // The call options for this service. + CallOptions *RegionTargetHttpProxiesCallOptions +} + +// 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 *RegionTargetHttpProxiesClient) 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 *RegionTargetHttpProxiesClient) setGoogleClientInfo(keyval ...string) { + c.internalClient.setGoogleClientInfo(keyval...) +} + +// Connection returns a connection to the API service. +// +// Deprecated. +func (c *RegionTargetHttpProxiesClient) Connection() *grpc.ClientConn { + return c.internalClient.Connection() +} + +// Delete deletes the specified TargetHttpProxy resource. +func (c *RegionTargetHttpProxiesClient) Delete(ctx context.Context, req *computepb.DeleteRegionTargetHttpProxyRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.Delete(ctx, req, opts...) +} + +// Get returns the specified TargetHttpProxy resource in the specified region. Gets a list of available target HTTP proxies by making a list() request. +func (c *RegionTargetHttpProxiesClient) Get(ctx context.Context, req *computepb.GetRegionTargetHttpProxyRequest, opts ...gax.CallOption) (*computepb.TargetHttpProxy, error) { + return c.internalClient.Get(ctx, req, opts...) +} + +// Insert creates a TargetHttpProxy resource in the specified project and region using the data included in the request. +func (c *RegionTargetHttpProxiesClient) Insert(ctx context.Context, req *computepb.InsertRegionTargetHttpProxyRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.Insert(ctx, req, opts...) +} + +// List retrieves the list of TargetHttpProxy resources available to the specified project in the specified region. +func (c *RegionTargetHttpProxiesClient) List(ctx context.Context, req *computepb.ListRegionTargetHttpProxiesRequest, opts ...gax.CallOption) (*computepb.TargetHttpProxyList, error) { + return c.internalClient.List(ctx, req, opts...) +} + +// SetUrlMap changes the URL map for TargetHttpProxy. +func (c *RegionTargetHttpProxiesClient) SetUrlMap(ctx context.Context, req *computepb.SetUrlMapRegionTargetHttpProxyRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.SetUrlMap(ctx, req, opts...) +} + +// Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls. +type regionTargetHttpProxiesRESTClient struct { + // The http endpoint to connect to. + endpoint string + + // The http client. + httpClient *http.Client + + // The x-goog-* metadata to be sent with each request. + xGoogMetadata metadata.MD +} + +// NewRegionTargetHttpProxiesRESTClient creates a new region target http proxies rest client. +// +// The RegionTargetHttpProxies API. +func NewRegionTargetHttpProxiesRESTClient(ctx context.Context, opts ...option.ClientOption) (*RegionTargetHttpProxiesClient, error) { + clientOpts := append(defaultRegionTargetHttpProxiesRESTClientOptions(), opts...) + httpClient, endpoint, err := httptransport.NewClient(ctx, clientOpts...) + if err != nil { + return nil, err + } + + c := ®ionTargetHttpProxiesRESTClient{ + endpoint: endpoint, + httpClient: httpClient, + } + c.setGoogleClientInfo() + + return &RegionTargetHttpProxiesClient{internalClient: c, CallOptions: &RegionTargetHttpProxiesCallOptions{}}, nil +} + +func defaultRegionTargetHttpProxiesRESTClientOptions() []option.ClientOption { + return []option.ClientOption{ + internaloption.WithDefaultEndpoint("compute.googleapis.com"), + internaloption.WithDefaultMTLSEndpoint("compute.mtls.googleapis.com"), + internaloption.WithDefaultAudience("https://compute.googleapis.com/"), + internaloption.WithDefaultScopes(DefaultAuthScopes()...), + } +} + +// setGoogleClientInfo sets the name and version of the application in +// the `x-goog-api-client` header passed on each request. Intended for +// use by Google-written clients. +func (c *regionTargetHttpProxiesRESTClient) setGoogleClientInfo(keyval ...string) { + kv := append([]string{"gl-go", versionGo()}, keyval...) + kv = append(kv, "gapic", versionClient, "gax", gax.Version, "rest", "UNKNOWN") + c.xGoogMetadata = metadata.Pairs("x-goog-api-client", gax.XGoogHeader(kv...)) +} + +// Close closes the connection to the API service. The user should invoke this when +// the client is no longer required. +func (c *regionTargetHttpProxiesRESTClient) Close() error { + // Replace httpClient with nil to force cleanup. + c.httpClient = nil + return nil +} + +// Connection returns a connection to the API service. +// +// Deprecated. +func (c *regionTargetHttpProxiesRESTClient) Connection() *grpc.ClientConn { + return nil +} + +// Delete deletes the specified TargetHttpProxy resource. +func (c *regionTargetHttpProxiesRESTClient) Delete(ctx context.Context, req *computepb.DeleteRegionTargetHttpProxyRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/targetHttpProxies/%v", req.GetProject(), req.GetRegion(), req.GetTargetHttpProxy()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("DELETE", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Get returns the specified TargetHttpProxy resource in the specified region. Gets a list of available target HTTP proxies by making a list() request. +func (c *regionTargetHttpProxiesRESTClient) Get(ctx context.Context, req *computepb.GetRegionTargetHttpProxyRequest, opts ...gax.CallOption) (*computepb.TargetHttpProxy, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/targetHttpProxies/%v", req.GetProject(), req.GetRegion(), req.GetTargetHttpProxy()) + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.TargetHttpProxy{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Insert creates a TargetHttpProxy resource in the specified project and region using the data included in the request. +func (c *regionTargetHttpProxiesRESTClient) Insert(ctx context.Context, req *computepb.InsertRegionTargetHttpProxyRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetTargetHttpProxyResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/targetHttpProxies", req.GetProject(), req.GetRegion()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// List retrieves the list of TargetHttpProxy resources available to the specified project in the specified region. +func (c *regionTargetHttpProxiesRESTClient) List(ctx context.Context, req *computepb.ListRegionTargetHttpProxiesRequest, opts ...gax.CallOption) (*computepb.TargetHttpProxyList, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/targetHttpProxies", 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() + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.TargetHttpProxyList{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// SetUrlMap changes the URL map for TargetHttpProxy. +func (c *regionTargetHttpProxiesRESTClient) SetUrlMap(ctx context.Context, req *computepb.SetUrlMapRegionTargetHttpProxyRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetUrlMapReferenceResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/targetHttpProxies/%v/setUrlMap", req.GetProject(), req.GetRegion(), req.GetTargetHttpProxy()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} diff --git a/compute/apiv1/region_target_http_proxies_client_example_test.go b/compute/apiv1/region_target_http_proxies_client_example_test.go new file mode 100644 index 00000000000..0ccd58f88ce --- /dev/null +++ b/compute/apiv1/region_target_http_proxies_client_example_test.go @@ -0,0 +1,131 @@ +// Copyright 2021 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_test + +import ( + "context" + + compute "cloud.google.com/go/compute/apiv1" + computepb "google.golang.org/genproto/googleapis/cloud/compute/v1" +) + +func ExampleNewRegionTargetHttpProxiesRESTClient() { + ctx := context.Background() + c, err := compute.NewRegionTargetHttpProxiesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + // TODO: Use client. + _ = c +} + +func ExampleRegionTargetHttpProxiesClient_Delete() { + ctx := context.Background() + c, err := compute.NewRegionTargetHttpProxiesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.DeleteRegionTargetHttpProxyRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Delete(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleRegionTargetHttpProxiesClient_Get() { + ctx := context.Background() + c, err := compute.NewRegionTargetHttpProxiesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.GetRegionTargetHttpProxyRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Get(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleRegionTargetHttpProxiesClient_Insert() { + ctx := context.Background() + c, err := compute.NewRegionTargetHttpProxiesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.InsertRegionTargetHttpProxyRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Insert(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleRegionTargetHttpProxiesClient_List() { + ctx := context.Background() + c, err := compute.NewRegionTargetHttpProxiesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.ListRegionTargetHttpProxiesRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.List(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleRegionTargetHttpProxiesClient_SetUrlMap() { + ctx := context.Background() + c, err := compute.NewRegionTargetHttpProxiesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.SetUrlMapRegionTargetHttpProxyRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.SetUrlMap(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} diff --git a/compute/apiv1/region_target_https_proxies_client.go b/compute/apiv1/region_target_https_proxies_client.go new file mode 100644 index 00000000000..af6c5481aa6 --- /dev/null +++ b/compute/apiv1/region_target_https_proxies_client.go @@ -0,0 +1,496 @@ +// Copyright 2021 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/ioutil" + "net/http" + "net/url" + + gax "github.com/googleapis/gax-go/v2" + "google.golang.org/api/option" + "google.golang.org/api/option/internaloption" + httptransport "google.golang.org/api/transport/http" + computepb "google.golang.org/genproto/googleapis/cloud/compute/v1" + "google.golang.org/grpc" + "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/encoding/protojson" +) + +var newRegionTargetHttpsProxiesClientHook clientHook + +// RegionTargetHttpsProxiesCallOptions contains the retry settings for each method of RegionTargetHttpsProxiesClient. +type RegionTargetHttpsProxiesCallOptions struct { + Delete []gax.CallOption + Get []gax.CallOption + Insert []gax.CallOption + List []gax.CallOption + SetSslCertificates []gax.CallOption + SetUrlMap []gax.CallOption +} + +// internalRegionTargetHttpsProxiesClient is an interface that defines the methods availaible from Google Compute Engine API. +type internalRegionTargetHttpsProxiesClient interface { + Close() error + setGoogleClientInfo(...string) + Connection() *grpc.ClientConn + Delete(context.Context, *computepb.DeleteRegionTargetHttpsProxyRequest, ...gax.CallOption) (*computepb.Operation, error) + Get(context.Context, *computepb.GetRegionTargetHttpsProxyRequest, ...gax.CallOption) (*computepb.TargetHttpsProxy, error) + Insert(context.Context, *computepb.InsertRegionTargetHttpsProxyRequest, ...gax.CallOption) (*computepb.Operation, error) + List(context.Context, *computepb.ListRegionTargetHttpsProxiesRequest, ...gax.CallOption) (*computepb.TargetHttpsProxyList, error) + SetSslCertificates(context.Context, *computepb.SetSslCertificatesRegionTargetHttpsProxyRequest, ...gax.CallOption) (*computepb.Operation, error) + SetUrlMap(context.Context, *computepb.SetUrlMapRegionTargetHttpsProxyRequest, ...gax.CallOption) (*computepb.Operation, error) +} + +// RegionTargetHttpsProxiesClient 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 RegionTargetHttpsProxies API. +type RegionTargetHttpsProxiesClient struct { + // The internal transport-dependent client. + internalClient internalRegionTargetHttpsProxiesClient + + // The call options for this service. + CallOptions *RegionTargetHttpsProxiesCallOptions +} + +// 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 *RegionTargetHttpsProxiesClient) 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 *RegionTargetHttpsProxiesClient) setGoogleClientInfo(keyval ...string) { + c.internalClient.setGoogleClientInfo(keyval...) +} + +// Connection returns a connection to the API service. +// +// Deprecated. +func (c *RegionTargetHttpsProxiesClient) Connection() *grpc.ClientConn { + return c.internalClient.Connection() +} + +// Delete deletes the specified TargetHttpsProxy resource. +func (c *RegionTargetHttpsProxiesClient) Delete(ctx context.Context, req *computepb.DeleteRegionTargetHttpsProxyRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.Delete(ctx, req, opts...) +} + +// Get returns the specified TargetHttpsProxy resource in the specified region. Gets a list of available target HTTP proxies by making a list() request. +func (c *RegionTargetHttpsProxiesClient) Get(ctx context.Context, req *computepb.GetRegionTargetHttpsProxyRequest, opts ...gax.CallOption) (*computepb.TargetHttpsProxy, error) { + return c.internalClient.Get(ctx, req, opts...) +} + +// Insert creates a TargetHttpsProxy resource in the specified project and region using the data included in the request. +func (c *RegionTargetHttpsProxiesClient) Insert(ctx context.Context, req *computepb.InsertRegionTargetHttpsProxyRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.Insert(ctx, req, opts...) +} + +// List retrieves the list of TargetHttpsProxy resources available to the specified project in the specified region. +func (c *RegionTargetHttpsProxiesClient) List(ctx context.Context, req *computepb.ListRegionTargetHttpsProxiesRequest, opts ...gax.CallOption) (*computepb.TargetHttpsProxyList, error) { + return c.internalClient.List(ctx, req, opts...) +} + +// SetSslCertificates replaces SslCertificates for TargetHttpsProxy. +func (c *RegionTargetHttpsProxiesClient) SetSslCertificates(ctx context.Context, req *computepb.SetSslCertificatesRegionTargetHttpsProxyRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.SetSslCertificates(ctx, req, opts...) +} + +// SetUrlMap changes the URL map for TargetHttpsProxy. +func (c *RegionTargetHttpsProxiesClient) SetUrlMap(ctx context.Context, req *computepb.SetUrlMapRegionTargetHttpsProxyRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.SetUrlMap(ctx, req, opts...) +} + +// Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls. +type regionTargetHttpsProxiesRESTClient struct { + // The http endpoint to connect to. + endpoint string + + // The http client. + httpClient *http.Client + + // The x-goog-* metadata to be sent with each request. + xGoogMetadata metadata.MD +} + +// NewRegionTargetHttpsProxiesRESTClient creates a new region target https proxies rest client. +// +// The RegionTargetHttpsProxies API. +func NewRegionTargetHttpsProxiesRESTClient(ctx context.Context, opts ...option.ClientOption) (*RegionTargetHttpsProxiesClient, error) { + clientOpts := append(defaultRegionTargetHttpsProxiesRESTClientOptions(), opts...) + httpClient, endpoint, err := httptransport.NewClient(ctx, clientOpts...) + if err != nil { + return nil, err + } + + c := ®ionTargetHttpsProxiesRESTClient{ + endpoint: endpoint, + httpClient: httpClient, + } + c.setGoogleClientInfo() + + return &RegionTargetHttpsProxiesClient{internalClient: c, CallOptions: &RegionTargetHttpsProxiesCallOptions{}}, nil +} + +func defaultRegionTargetHttpsProxiesRESTClientOptions() []option.ClientOption { + return []option.ClientOption{ + internaloption.WithDefaultEndpoint("compute.googleapis.com"), + internaloption.WithDefaultMTLSEndpoint("compute.mtls.googleapis.com"), + internaloption.WithDefaultAudience("https://compute.googleapis.com/"), + internaloption.WithDefaultScopes(DefaultAuthScopes()...), + } +} + +// setGoogleClientInfo sets the name and version of the application in +// the `x-goog-api-client` header passed on each request. Intended for +// use by Google-written clients. +func (c *regionTargetHttpsProxiesRESTClient) setGoogleClientInfo(keyval ...string) { + kv := append([]string{"gl-go", versionGo()}, keyval...) + kv = append(kv, "gapic", versionClient, "gax", gax.Version, "rest", "UNKNOWN") + c.xGoogMetadata = metadata.Pairs("x-goog-api-client", gax.XGoogHeader(kv...)) +} + +// Close closes the connection to the API service. The user should invoke this when +// the client is no longer required. +func (c *regionTargetHttpsProxiesRESTClient) Close() error { + // Replace httpClient with nil to force cleanup. + c.httpClient = nil + return nil +} + +// Connection returns a connection to the API service. +// +// Deprecated. +func (c *regionTargetHttpsProxiesRESTClient) Connection() *grpc.ClientConn { + return nil +} + +// Delete deletes the specified TargetHttpsProxy resource. +func (c *regionTargetHttpsProxiesRESTClient) Delete(ctx context.Context, req *computepb.DeleteRegionTargetHttpsProxyRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/targetHttpsProxies/%v", req.GetProject(), req.GetRegion(), req.GetTargetHttpsProxy()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("DELETE", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Get returns the specified TargetHttpsProxy resource in the specified region. Gets a list of available target HTTP proxies by making a list() request. +func (c *regionTargetHttpsProxiesRESTClient) Get(ctx context.Context, req *computepb.GetRegionTargetHttpsProxyRequest, opts ...gax.CallOption) (*computepb.TargetHttpsProxy, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/targetHttpsProxies/%v", req.GetProject(), req.GetRegion(), req.GetTargetHttpsProxy()) + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.TargetHttpsProxy{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Insert creates a TargetHttpsProxy resource in the specified project and region using the data included in the request. +func (c *regionTargetHttpsProxiesRESTClient) Insert(ctx context.Context, req *computepb.InsertRegionTargetHttpsProxyRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetTargetHttpsProxyResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/targetHttpsProxies", req.GetProject(), req.GetRegion()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// List retrieves the list of TargetHttpsProxy resources available to the specified project in the specified region. +func (c *regionTargetHttpsProxiesRESTClient) List(ctx context.Context, req *computepb.ListRegionTargetHttpsProxiesRequest, opts ...gax.CallOption) (*computepb.TargetHttpsProxyList, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/targetHttpsProxies", 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() + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.TargetHttpsProxyList{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// SetSslCertificates replaces SslCertificates for TargetHttpsProxy. +func (c *regionTargetHttpsProxiesRESTClient) SetSslCertificates(ctx context.Context, req *computepb.SetSslCertificatesRegionTargetHttpsProxyRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetRegionTargetHttpsProxiesSetSslCertificatesRequestResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/targetHttpsProxies/%v/setSslCertificates", req.GetProject(), req.GetRegion(), req.GetTargetHttpsProxy()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// SetUrlMap changes the URL map for TargetHttpsProxy. +func (c *regionTargetHttpsProxiesRESTClient) SetUrlMap(ctx context.Context, req *computepb.SetUrlMapRegionTargetHttpsProxyRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetUrlMapReferenceResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/targetHttpsProxies/%v/setUrlMap", req.GetProject(), req.GetRegion(), req.GetTargetHttpsProxy()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} diff --git a/compute/apiv1/region_target_https_proxies_client_example_test.go b/compute/apiv1/region_target_https_proxies_client_example_test.go new file mode 100644 index 00000000000..2e5ecb82af5 --- /dev/null +++ b/compute/apiv1/region_target_https_proxies_client_example_test.go @@ -0,0 +1,150 @@ +// Copyright 2021 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_test + +import ( + "context" + + compute "cloud.google.com/go/compute/apiv1" + computepb "google.golang.org/genproto/googleapis/cloud/compute/v1" +) + +func ExampleNewRegionTargetHttpsProxiesRESTClient() { + ctx := context.Background() + c, err := compute.NewRegionTargetHttpsProxiesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + // TODO: Use client. + _ = c +} + +func ExampleRegionTargetHttpsProxiesClient_Delete() { + ctx := context.Background() + c, err := compute.NewRegionTargetHttpsProxiesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.DeleteRegionTargetHttpsProxyRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Delete(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleRegionTargetHttpsProxiesClient_Get() { + ctx := context.Background() + c, err := compute.NewRegionTargetHttpsProxiesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.GetRegionTargetHttpsProxyRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Get(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleRegionTargetHttpsProxiesClient_Insert() { + ctx := context.Background() + c, err := compute.NewRegionTargetHttpsProxiesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.InsertRegionTargetHttpsProxyRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Insert(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleRegionTargetHttpsProxiesClient_List() { + ctx := context.Background() + c, err := compute.NewRegionTargetHttpsProxiesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.ListRegionTargetHttpsProxiesRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.List(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleRegionTargetHttpsProxiesClient_SetSslCertificates() { + ctx := context.Background() + c, err := compute.NewRegionTargetHttpsProxiesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.SetSslCertificatesRegionTargetHttpsProxyRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.SetSslCertificates(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleRegionTargetHttpsProxiesClient_SetUrlMap() { + ctx := context.Background() + c, err := compute.NewRegionTargetHttpsProxiesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.SetUrlMapRegionTargetHttpsProxyRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.SetUrlMap(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} diff --git a/compute/apiv1/region_url_maps_client.go b/compute/apiv1/region_url_maps_client.go new file mode 100644 index 00000000000..732c9c082d2 --- /dev/null +++ b/compute/apiv1/region_url_maps_client.go @@ -0,0 +1,556 @@ +// Copyright 2021 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/ioutil" + "net/http" + "net/url" + + gax "github.com/googleapis/gax-go/v2" + "google.golang.org/api/option" + "google.golang.org/api/option/internaloption" + httptransport "google.golang.org/api/transport/http" + computepb "google.golang.org/genproto/googleapis/cloud/compute/v1" + "google.golang.org/grpc" + "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/encoding/protojson" +) + +var newRegionUrlMapsClientHook clientHook + +// RegionUrlMapsCallOptions contains the retry settings for each method of RegionUrlMapsClient. +type RegionUrlMapsCallOptions struct { + Delete []gax.CallOption + Get []gax.CallOption + Insert []gax.CallOption + List []gax.CallOption + Patch []gax.CallOption + Update []gax.CallOption + Validate []gax.CallOption +} + +// internalRegionUrlMapsClient is an interface that defines the methods availaible from Google Compute Engine API. +type internalRegionUrlMapsClient interface { + Close() error + setGoogleClientInfo(...string) + Connection() *grpc.ClientConn + Delete(context.Context, *computepb.DeleteRegionUrlMapRequest, ...gax.CallOption) (*computepb.Operation, error) + Get(context.Context, *computepb.GetRegionUrlMapRequest, ...gax.CallOption) (*computepb.UrlMap, error) + Insert(context.Context, *computepb.InsertRegionUrlMapRequest, ...gax.CallOption) (*computepb.Operation, error) + List(context.Context, *computepb.ListRegionUrlMapsRequest, ...gax.CallOption) (*computepb.UrlMapList, error) + Patch(context.Context, *computepb.PatchRegionUrlMapRequest, ...gax.CallOption) (*computepb.Operation, error) + Update(context.Context, *computepb.UpdateRegionUrlMapRequest, ...gax.CallOption) (*computepb.Operation, error) + Validate(context.Context, *computepb.ValidateRegionUrlMapRequest, ...gax.CallOption) (*computepb.UrlMapsValidateResponse, error) +} + +// RegionUrlMapsClient 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 RegionUrlMaps API. +type RegionUrlMapsClient struct { + // The internal transport-dependent client. + internalClient internalRegionUrlMapsClient + + // The call options for this service. + CallOptions *RegionUrlMapsCallOptions +} + +// 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 *RegionUrlMapsClient) 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 *RegionUrlMapsClient) setGoogleClientInfo(keyval ...string) { + c.internalClient.setGoogleClientInfo(keyval...) +} + +// Connection returns a connection to the API service. +// +// Deprecated. +func (c *RegionUrlMapsClient) Connection() *grpc.ClientConn { + return c.internalClient.Connection() +} + +// Delete deletes the specified UrlMap resource. +func (c *RegionUrlMapsClient) Delete(ctx context.Context, req *computepb.DeleteRegionUrlMapRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.Delete(ctx, req, opts...) +} + +// Get returns the specified UrlMap resource. Gets a list of available URL maps by making a list() request. +func (c *RegionUrlMapsClient) Get(ctx context.Context, req *computepb.GetRegionUrlMapRequest, opts ...gax.CallOption) (*computepb.UrlMap, error) { + return c.internalClient.Get(ctx, req, opts...) +} + +// Insert creates a UrlMap resource in the specified project using the data included in the request. +func (c *RegionUrlMapsClient) Insert(ctx context.Context, req *computepb.InsertRegionUrlMapRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.Insert(ctx, req, opts...) +} + +// List retrieves the list of UrlMap resources available to the specified project in the specified region. +func (c *RegionUrlMapsClient) List(ctx context.Context, req *computepb.ListRegionUrlMapsRequest, opts ...gax.CallOption) (*computepb.UrlMapList, error) { + return c.internalClient.List(ctx, req, opts...) +} + +// Patch patches the specified UrlMap resource with the data included in the request. This method supports PATCH semantics and uses JSON merge patch format and processing rules. +func (c *RegionUrlMapsClient) Patch(ctx context.Context, req *computepb.PatchRegionUrlMapRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.Patch(ctx, req, opts...) +} + +// Update updates the specified UrlMap resource with the data included in the request. +func (c *RegionUrlMapsClient) Update(ctx context.Context, req *computepb.UpdateRegionUrlMapRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.Update(ctx, req, opts...) +} + +// Validate runs static validation for the UrlMap. In particular, the tests of the provided UrlMap will be run. Calling this method does NOT create the UrlMap. +func (c *RegionUrlMapsClient) Validate(ctx context.Context, req *computepb.ValidateRegionUrlMapRequest, opts ...gax.CallOption) (*computepb.UrlMapsValidateResponse, error) { + return c.internalClient.Validate(ctx, req, opts...) +} + +// Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls. +type regionUrlMapsRESTClient struct { + // The http endpoint to connect to. + endpoint string + + // The http client. + httpClient *http.Client + + // The x-goog-* metadata to be sent with each request. + xGoogMetadata metadata.MD +} + +// NewRegionUrlMapsRESTClient creates a new region url maps rest client. +// +// The RegionUrlMaps API. +func NewRegionUrlMapsRESTClient(ctx context.Context, opts ...option.ClientOption) (*RegionUrlMapsClient, error) { + clientOpts := append(defaultRegionUrlMapsRESTClientOptions(), opts...) + httpClient, endpoint, err := httptransport.NewClient(ctx, clientOpts...) + if err != nil { + return nil, err + } + + c := ®ionUrlMapsRESTClient{ + endpoint: endpoint, + httpClient: httpClient, + } + c.setGoogleClientInfo() + + return &RegionUrlMapsClient{internalClient: c, CallOptions: &RegionUrlMapsCallOptions{}}, nil +} + +func defaultRegionUrlMapsRESTClientOptions() []option.ClientOption { + return []option.ClientOption{ + internaloption.WithDefaultEndpoint("compute.googleapis.com"), + internaloption.WithDefaultMTLSEndpoint("compute.mtls.googleapis.com"), + internaloption.WithDefaultAudience("https://compute.googleapis.com/"), + internaloption.WithDefaultScopes(DefaultAuthScopes()...), + } +} + +// setGoogleClientInfo sets the name and version of the application in +// the `x-goog-api-client` header passed on each request. Intended for +// use by Google-written clients. +func (c *regionUrlMapsRESTClient) setGoogleClientInfo(keyval ...string) { + kv := append([]string{"gl-go", versionGo()}, keyval...) + kv = append(kv, "gapic", versionClient, "gax", gax.Version, "rest", "UNKNOWN") + c.xGoogMetadata = metadata.Pairs("x-goog-api-client", gax.XGoogHeader(kv...)) +} + +// Close closes the connection to the API service. The user should invoke this when +// the client is no longer required. +func (c *regionUrlMapsRESTClient) Close() error { + // Replace httpClient with nil to force cleanup. + c.httpClient = nil + return nil +} + +// Connection returns a connection to the API service. +// +// Deprecated. +func (c *regionUrlMapsRESTClient) Connection() *grpc.ClientConn { + return nil +} + +// Delete deletes the specified UrlMap resource. +func (c *regionUrlMapsRESTClient) Delete(ctx context.Context, req *computepb.DeleteRegionUrlMapRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/urlMaps/%v", req.GetProject(), req.GetRegion(), req.GetUrlMap()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("DELETE", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Get returns the specified UrlMap resource. Gets a list of available URL maps by making a list() request. +func (c *regionUrlMapsRESTClient) Get(ctx context.Context, req *computepb.GetRegionUrlMapRequest, opts ...gax.CallOption) (*computepb.UrlMap, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/urlMaps/%v", req.GetProject(), req.GetRegion(), req.GetUrlMap()) + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.UrlMap{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Insert creates a UrlMap resource in the specified project using the data included in the request. +func (c *regionUrlMapsRESTClient) Insert(ctx context.Context, req *computepb.InsertRegionUrlMapRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetUrlMapResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/urlMaps", req.GetProject(), req.GetRegion()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// List retrieves the list of UrlMap resources available to the specified project in the specified region. +func (c *regionUrlMapsRESTClient) List(ctx context.Context, req *computepb.ListRegionUrlMapsRequest, opts ...gax.CallOption) (*computepb.UrlMapList, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/urlMaps", 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() + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.UrlMapList{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Patch patches the specified UrlMap resource with the data included in the request. This method supports PATCH semantics and uses JSON merge patch format and processing rules. +func (c *regionUrlMapsRESTClient) Patch(ctx context.Context, req *computepb.PatchRegionUrlMapRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetUrlMapResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/urlMaps/%v", req.GetProject(), req.GetRegion(), req.GetUrlMap()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("PATCH", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Update updates the specified UrlMap resource with the data included in the request. +func (c *regionUrlMapsRESTClient) Update(ctx context.Context, req *computepb.UpdateRegionUrlMapRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetUrlMapResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("") + + params := url.Values{} + if req.GetProject() != "" { + params.Add("project", fmt.Sprintf("%v", req.GetProject())) + } + if req.GetRegion() != "" { + params.Add("region", fmt.Sprintf("%v", req.GetRegion())) + } + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + if req.GetUrlMap() != "" { + params.Add("urlMap", fmt.Sprintf("%v", req.GetUrlMap())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("PUT", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Validate runs static validation for the UrlMap. In particular, the tests of the provided UrlMap will be run. Calling this method does NOT create the UrlMap. +func (c *regionUrlMapsRESTClient) Validate(ctx context.Context, req *computepb.ValidateRegionUrlMapRequest, opts ...gax.CallOption) (*computepb.UrlMapsValidateResponse, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetRegionUrlMapsValidateRequestResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/urlMaps/%v/validate", req.GetProject(), req.GetRegion(), req.GetUrlMap()) + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.UrlMapsValidateResponse{} + + return rsp, unm.Unmarshal(buf, rsp) +} diff --git a/compute/apiv1/region_url_maps_client_example_test.go b/compute/apiv1/region_url_maps_client_example_test.go new file mode 100644 index 00000000000..8a20f726251 --- /dev/null +++ b/compute/apiv1/region_url_maps_client_example_test.go @@ -0,0 +1,169 @@ +// Copyright 2021 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_test + +import ( + "context" + + compute "cloud.google.com/go/compute/apiv1" + computepb "google.golang.org/genproto/googleapis/cloud/compute/v1" +) + +func ExampleNewRegionUrlMapsRESTClient() { + ctx := context.Background() + c, err := compute.NewRegionUrlMapsRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + // TODO: Use client. + _ = c +} + +func ExampleRegionUrlMapsClient_Delete() { + ctx := context.Background() + c, err := compute.NewRegionUrlMapsRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.DeleteRegionUrlMapRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Delete(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleRegionUrlMapsClient_Get() { + ctx := context.Background() + c, err := compute.NewRegionUrlMapsRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.GetRegionUrlMapRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Get(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleRegionUrlMapsClient_Insert() { + ctx := context.Background() + c, err := compute.NewRegionUrlMapsRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.InsertRegionUrlMapRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Insert(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleRegionUrlMapsClient_List() { + ctx := context.Background() + c, err := compute.NewRegionUrlMapsRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.ListRegionUrlMapsRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.List(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleRegionUrlMapsClient_Patch() { + ctx := context.Background() + c, err := compute.NewRegionUrlMapsRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.PatchRegionUrlMapRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Patch(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleRegionUrlMapsClient_Update() { + ctx := context.Background() + c, err := compute.NewRegionUrlMapsRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.UpdateRegionUrlMapRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Update(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleRegionUrlMapsClient_Validate() { + ctx := context.Background() + c, err := compute.NewRegionUrlMapsRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.ValidateRegionUrlMapRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Validate(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} diff --git a/compute/apiv1/regions_client.go b/compute/apiv1/regions_client.go new file mode 100644 index 00000000000..9d26c40564b --- /dev/null +++ b/compute/apiv1/regions_client.go @@ -0,0 +1,265 @@ +// Copyright 2021 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/ioutil" + "net/http" + "net/url" + + gax "github.com/googleapis/gax-go/v2" + "google.golang.org/api/option" + "google.golang.org/api/option/internaloption" + httptransport "google.golang.org/api/transport/http" + computepb "google.golang.org/genproto/googleapis/cloud/compute/v1" + "google.golang.org/grpc" + "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/encoding/protojson" +) + +var newRegionsClientHook clientHook + +// RegionsCallOptions contains the retry settings for each method of RegionsClient. +type RegionsCallOptions struct { + Get []gax.CallOption + List []gax.CallOption +} + +// internalRegionsClient is an interface that defines the methods availaible from Google Compute Engine API. +type internalRegionsClient interface { + Close() error + setGoogleClientInfo(...string) + Connection() *grpc.ClientConn + Get(context.Context, *computepb.GetRegionRequest, ...gax.CallOption) (*computepb.Region, error) + List(context.Context, *computepb.ListRegionsRequest, ...gax.CallOption) (*computepb.RegionList, error) +} + +// RegionsClient 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 Regions API. +type RegionsClient struct { + // The internal transport-dependent client. + internalClient internalRegionsClient + + // The call options for this service. + CallOptions *RegionsCallOptions +} + +// 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 *RegionsClient) 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 *RegionsClient) setGoogleClientInfo(keyval ...string) { + c.internalClient.setGoogleClientInfo(keyval...) +} + +// Connection returns a connection to the API service. +// +// Deprecated. +func (c *RegionsClient) Connection() *grpc.ClientConn { + return c.internalClient.Connection() +} + +// Get returns the specified Region resource. Gets a list of available regions by making a list() request. +func (c *RegionsClient) Get(ctx context.Context, req *computepb.GetRegionRequest, opts ...gax.CallOption) (*computepb.Region, error) { + return c.internalClient.Get(ctx, req, opts...) +} + +// List retrieves the list of region resources available to the specified project. +func (c *RegionsClient) List(ctx context.Context, req *computepb.ListRegionsRequest, opts ...gax.CallOption) (*computepb.RegionList, error) { + return c.internalClient.List(ctx, req, opts...) +} + +// Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls. +type regionsRESTClient struct { + // The http endpoint to connect to. + endpoint string + + // The http client. + httpClient *http.Client + + // The x-goog-* metadata to be sent with each request. + xGoogMetadata metadata.MD +} + +// NewRegionsRESTClient creates a new regions rest client. +// +// The Regions API. +func NewRegionsRESTClient(ctx context.Context, opts ...option.ClientOption) (*RegionsClient, error) { + clientOpts := append(defaultRegionsRESTClientOptions(), opts...) + httpClient, endpoint, err := httptransport.NewClient(ctx, clientOpts...) + if err != nil { + return nil, err + } + + c := ®ionsRESTClient{ + endpoint: endpoint, + httpClient: httpClient, + } + c.setGoogleClientInfo() + + return &RegionsClient{internalClient: c, CallOptions: &RegionsCallOptions{}}, nil +} + +func defaultRegionsRESTClientOptions() []option.ClientOption { + return []option.ClientOption{ + internaloption.WithDefaultEndpoint("compute.googleapis.com"), + internaloption.WithDefaultMTLSEndpoint("compute.mtls.googleapis.com"), + internaloption.WithDefaultAudience("https://compute.googleapis.com/"), + internaloption.WithDefaultScopes(DefaultAuthScopes()...), + } +} + +// setGoogleClientInfo sets the name and version of the application in +// the `x-goog-api-client` header passed on each request. Intended for +// use by Google-written clients. +func (c *regionsRESTClient) setGoogleClientInfo(keyval ...string) { + kv := append([]string{"gl-go", versionGo()}, keyval...) + kv = append(kv, "gapic", versionClient, "gax", gax.Version, "rest", "UNKNOWN") + c.xGoogMetadata = metadata.Pairs("x-goog-api-client", gax.XGoogHeader(kv...)) +} + +// Close closes the connection to the API service. The user should invoke this when +// the client is no longer required. +func (c *regionsRESTClient) Close() error { + // Replace httpClient with nil to force cleanup. + c.httpClient = nil + return nil +} + +// Connection returns a connection to the API service. +// +// Deprecated. +func (c *regionsRESTClient) Connection() *grpc.ClientConn { + return nil +} + +// Get returns the specified Region resource. Gets a list of available regions by making a list() request. +func (c *regionsRESTClient) Get(ctx context.Context, req *computepb.GetRegionRequest, opts ...gax.CallOption) (*computepb.Region, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v", req.GetProject(), req.GetRegion()) + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Region{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// List retrieves the list of region resources available to the specified project. +func (c *regionsRESTClient) List(ctx context.Context, req *computepb.ListRegionsRequest, opts ...gax.CallOption) (*computepb.RegionList, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions", 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() + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.RegionList{} + + return rsp, unm.Unmarshal(buf, rsp) +} diff --git a/compute/apiv1/regions_client_example_test.go b/compute/apiv1/regions_client_example_test.go new file mode 100644 index 00000000000..80af1fd0722 --- /dev/null +++ b/compute/apiv1/regions_client_example_test.go @@ -0,0 +1,74 @@ +// Copyright 2021 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_test + +import ( + "context" + + compute "cloud.google.com/go/compute/apiv1" + computepb "google.golang.org/genproto/googleapis/cloud/compute/v1" +) + +func ExampleNewRegionsRESTClient() { + ctx := context.Background() + c, err := compute.NewRegionsRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + // TODO: Use client. + _ = c +} + +func ExampleRegionsClient_Get() { + ctx := context.Background() + c, err := compute.NewRegionsRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.GetRegionRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Get(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleRegionsClient_List() { + ctx := context.Background() + c, err := compute.NewRegionsRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.ListRegionsRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.List(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} diff --git a/compute/apiv1/reservations_client.go b/compute/apiv1/reservations_client.go new file mode 100644 index 00000000000..9c3cd718cce --- /dev/null +++ b/compute/apiv1/reservations_client.go @@ -0,0 +1,669 @@ +// Copyright 2021 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/ioutil" + "net/http" + "net/url" + + gax "github.com/googleapis/gax-go/v2" + "google.golang.org/api/option" + "google.golang.org/api/option/internaloption" + httptransport "google.golang.org/api/transport/http" + computepb "google.golang.org/genproto/googleapis/cloud/compute/v1" + "google.golang.org/grpc" + "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/encoding/protojson" +) + +var newReservationsClientHook clientHook + +// ReservationsCallOptions contains the retry settings for each method of ReservationsClient. +type ReservationsCallOptions struct { + AggregatedList []gax.CallOption + Delete []gax.CallOption + Get []gax.CallOption + GetIamPolicy []gax.CallOption + Insert []gax.CallOption + List []gax.CallOption + Resize []gax.CallOption + SetIamPolicy []gax.CallOption + TestIamPermissions []gax.CallOption +} + +// internalReservationsClient is an interface that defines the methods availaible from Google Compute Engine API. +type internalReservationsClient interface { + Close() error + setGoogleClientInfo(...string) + Connection() *grpc.ClientConn + AggregatedList(context.Context, *computepb.AggregatedListReservationsRequest, ...gax.CallOption) (*computepb.ReservationAggregatedList, error) + Delete(context.Context, *computepb.DeleteReservationRequest, ...gax.CallOption) (*computepb.Operation, error) + Get(context.Context, *computepb.GetReservationRequest, ...gax.CallOption) (*computepb.Reservation, error) + GetIamPolicy(context.Context, *computepb.GetIamPolicyReservationRequest, ...gax.CallOption) (*computepb.Policy, error) + Insert(context.Context, *computepb.InsertReservationRequest, ...gax.CallOption) (*computepb.Operation, error) + List(context.Context, *computepb.ListReservationsRequest, ...gax.CallOption) (*computepb.ReservationList, error) + Resize(context.Context, *computepb.ResizeReservationRequest, ...gax.CallOption) (*computepb.Operation, error) + SetIamPolicy(context.Context, *computepb.SetIamPolicyReservationRequest, ...gax.CallOption) (*computepb.Policy, error) + TestIamPermissions(context.Context, *computepb.TestIamPermissionsReservationRequest, ...gax.CallOption) (*computepb.TestPermissionsResponse, error) +} + +// ReservationsClient 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 Reservations API. +type ReservationsClient struct { + // The internal transport-dependent client. + internalClient internalReservationsClient + + // The call options for this service. + CallOptions *ReservationsCallOptions +} + +// 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 *ReservationsClient) 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 *ReservationsClient) setGoogleClientInfo(keyval ...string) { + c.internalClient.setGoogleClientInfo(keyval...) +} + +// Connection returns a connection to the API service. +// +// Deprecated. +func (c *ReservationsClient) Connection() *grpc.ClientConn { + return c.internalClient.Connection() +} + +// AggregatedList retrieves an aggregated list of reservations. +func (c *ReservationsClient) AggregatedList(ctx context.Context, req *computepb.AggregatedListReservationsRequest, opts ...gax.CallOption) (*computepb.ReservationAggregatedList, error) { + return c.internalClient.AggregatedList(ctx, req, opts...) +} + +// Delete deletes the specified reservation. +func (c *ReservationsClient) Delete(ctx context.Context, req *computepb.DeleteReservationRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.Delete(ctx, req, opts...) +} + +// Get retrieves information about the specified reservation. +func (c *ReservationsClient) Get(ctx context.Context, req *computepb.GetReservationRequest, opts ...gax.CallOption) (*computepb.Reservation, error) { + 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 *ReservationsClient) GetIamPolicy(ctx context.Context, req *computepb.GetIamPolicyReservationRequest, opts ...gax.CallOption) (*computepb.Policy, error) { + return c.internalClient.GetIamPolicy(ctx, req, opts...) +} + +// Insert creates a new reservation. For more information, read Reserving zonal resources. +func (c *ReservationsClient) Insert(ctx context.Context, req *computepb.InsertReservationRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.Insert(ctx, req, opts...) +} + +// List a list of all the reservations that have been configured for the specified project in specified zone. +func (c *ReservationsClient) List(ctx context.Context, req *computepb.ListReservationsRequest, opts ...gax.CallOption) (*computepb.ReservationList, error) { + return c.internalClient.List(ctx, req, opts...) +} + +// Resize resizes the reservation (applicable to standalone reservations only). For more information, read Modifying reservations. +func (c *ReservationsClient) Resize(ctx context.Context, req *computepb.ResizeReservationRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.Resize(ctx, req, opts...) +} + +// SetIamPolicy sets the access control policy on the specified resource. Replaces any existing policy. +func (c *ReservationsClient) SetIamPolicy(ctx context.Context, req *computepb.SetIamPolicyReservationRequest, 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 *ReservationsClient) TestIamPermissions(ctx context.Context, req *computepb.TestIamPermissionsReservationRequest, opts ...gax.CallOption) (*computepb.TestPermissionsResponse, error) { + return c.internalClient.TestIamPermissions(ctx, req, opts...) +} + +// Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls. +type reservationsRESTClient struct { + // The http endpoint to connect to. + endpoint string + + // The http client. + httpClient *http.Client + + // The x-goog-* metadata to be sent with each request. + xGoogMetadata metadata.MD +} + +// NewReservationsRESTClient creates a new reservations rest client. +// +// The Reservations API. +func NewReservationsRESTClient(ctx context.Context, opts ...option.ClientOption) (*ReservationsClient, error) { + clientOpts := append(defaultReservationsRESTClientOptions(), opts...) + httpClient, endpoint, err := httptransport.NewClient(ctx, clientOpts...) + if err != nil { + return nil, err + } + + c := &reservationsRESTClient{ + endpoint: endpoint, + httpClient: httpClient, + } + c.setGoogleClientInfo() + + return &ReservationsClient{internalClient: c, CallOptions: &ReservationsCallOptions{}}, nil +} + +func defaultReservationsRESTClientOptions() []option.ClientOption { + return []option.ClientOption{ + internaloption.WithDefaultEndpoint("compute.googleapis.com"), + internaloption.WithDefaultMTLSEndpoint("compute.mtls.googleapis.com"), + internaloption.WithDefaultAudience("https://compute.googleapis.com/"), + internaloption.WithDefaultScopes(DefaultAuthScopes()...), + } +} + +// setGoogleClientInfo sets the name and version of the application in +// the `x-goog-api-client` header passed on each request. Intended for +// use by Google-written clients. +func (c *reservationsRESTClient) setGoogleClientInfo(keyval ...string) { + kv := append([]string{"gl-go", versionGo()}, keyval...) + kv = append(kv, "gapic", versionClient, "gax", gax.Version, "rest", "UNKNOWN") + c.xGoogMetadata = metadata.Pairs("x-goog-api-client", gax.XGoogHeader(kv...)) +} + +// Close closes the connection to the API service. The user should invoke this when +// the client is no longer required. +func (c *reservationsRESTClient) Close() error { + // Replace httpClient with nil to force cleanup. + c.httpClient = nil + return nil +} + +// Connection returns a connection to the API service. +// +// Deprecated. +func (c *reservationsRESTClient) Connection() *grpc.ClientConn { + return nil +} + +// AggregatedList retrieves an aggregated list of reservations. +func (c *reservationsRESTClient) AggregatedList(ctx context.Context, req *computepb.AggregatedListReservationsRequest, opts ...gax.CallOption) (*computepb.ReservationAggregatedList, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/aggregated/reservations", req.GetProject()) + + params := url.Values{} + if req != nil && req.Filter != nil { + params.Add("filter", fmt.Sprintf("%v", req.GetFilter())) + } + if req != nil && req.IncludeAllScopes != nil { + params.Add("includeAllScopes", fmt.Sprintf("%v", req.GetIncludeAllScopes())) + } + 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() + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.ReservationAggregatedList{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Delete deletes the specified reservation. +func (c *reservationsRESTClient) Delete(ctx context.Context, req *computepb.DeleteReservationRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/zones/%v/reservations/%v", req.GetProject(), req.GetZone(), req.GetReservation()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("DELETE", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Get retrieves information about the specified reservation. +func (c *reservationsRESTClient) Get(ctx context.Context, req *computepb.GetReservationRequest, opts ...gax.CallOption) (*computepb.Reservation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/zones/%v/reservations/%v", req.GetProject(), req.GetZone(), req.GetReservation()) + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Reservation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// GetIamPolicy gets the access control policy for a resource. May be empty if no such policy or resource exists. +func (c *reservationsRESTClient) GetIamPolicy(ctx context.Context, req *computepb.GetIamPolicyReservationRequest, opts ...gax.CallOption) (*computepb.Policy, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/zones/%v/reservations/%v/getIamPolicy", req.GetProject(), req.GetZone(), req.GetResource()) + + params := url.Values{} + if req != nil && req.OptionsRequestedPolicyVersion != nil { + params.Add("optionsRequestedPolicyVersion", fmt.Sprintf("%v", req.GetOptionsRequestedPolicyVersion())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Policy{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Insert creates a new reservation. For more information, read Reserving zonal resources. +func (c *reservationsRESTClient) Insert(ctx context.Context, req *computepb.InsertReservationRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetReservationResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/zones/%v/reservations", req.GetProject(), req.GetZone()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// List a list of all the reservations that have been configured for the specified project in specified zone. +func (c *reservationsRESTClient) List(ctx context.Context, req *computepb.ListReservationsRequest, opts ...gax.CallOption) (*computepb.ReservationList, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/zones/%v/reservations", req.GetProject(), req.GetZone()) + + 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() + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.ReservationList{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Resize resizes the reservation (applicable to standalone reservations only). For more information, read Modifying reservations. +func (c *reservationsRESTClient) Resize(ctx context.Context, req *computepb.ResizeReservationRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetReservationsResizeRequestResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/zones/%v/reservations/%v/resize", req.GetProject(), req.GetZone(), req.GetReservation()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// SetIamPolicy sets the access control policy on the specified resource. Replaces any existing policy. +func (c *reservationsRESTClient) SetIamPolicy(ctx context.Context, req *computepb.SetIamPolicyReservationRequest, opts ...gax.CallOption) (*computepb.Policy, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetZoneSetPolicyRequestResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/zones/%v/reservations/%v/setIamPolicy", req.GetProject(), req.GetZone(), req.GetResource()) + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Policy{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// TestIamPermissions returns permissions that a caller has on the specified resource. +func (c *reservationsRESTClient) TestIamPermissions(ctx context.Context, req *computepb.TestIamPermissionsReservationRequest, opts ...gax.CallOption) (*computepb.TestPermissionsResponse, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetTestPermissionsRequestResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/zones/%v/reservations/%v/testIamPermissions", req.GetProject(), req.GetZone(), req.GetResource()) + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.TestPermissionsResponse{} + + return rsp, unm.Unmarshal(buf, rsp) +} diff --git a/compute/apiv1/reservations_client_example_test.go b/compute/apiv1/reservations_client_example_test.go new file mode 100644 index 00000000000..dda54366096 --- /dev/null +++ b/compute/apiv1/reservations_client_example_test.go @@ -0,0 +1,207 @@ +// Copyright 2021 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_test + +import ( + "context" + + compute "cloud.google.com/go/compute/apiv1" + computepb "google.golang.org/genproto/googleapis/cloud/compute/v1" +) + +func ExampleNewReservationsRESTClient() { + ctx := context.Background() + c, err := compute.NewReservationsRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + // TODO: Use client. + _ = c +} + +func ExampleReservationsClient_AggregatedList() { + ctx := context.Background() + c, err := compute.NewReservationsRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.AggregatedListReservationsRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.AggregatedList(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleReservationsClient_Delete() { + ctx := context.Background() + c, err := compute.NewReservationsRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.DeleteReservationRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Delete(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleReservationsClient_Get() { + ctx := context.Background() + c, err := compute.NewReservationsRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.GetReservationRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Get(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleReservationsClient_GetIamPolicy() { + ctx := context.Background() + c, err := compute.NewReservationsRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.GetIamPolicyReservationRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.GetIamPolicy(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleReservationsClient_Insert() { + ctx := context.Background() + c, err := compute.NewReservationsRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.InsertReservationRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Insert(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleReservationsClient_List() { + ctx := context.Background() + c, err := compute.NewReservationsRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.ListReservationsRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.List(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleReservationsClient_Resize() { + ctx := context.Background() + c, err := compute.NewReservationsRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.ResizeReservationRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Resize(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleReservationsClient_SetIamPolicy() { + ctx := context.Background() + c, err := compute.NewReservationsRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.SetIamPolicyReservationRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.SetIamPolicy(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleReservationsClient_TestIamPermissions() { + ctx := context.Background() + c, err := compute.NewReservationsRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.TestIamPermissionsReservationRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.TestIamPermissions(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} diff --git a/compute/apiv1/resource_policies_client.go b/compute/apiv1/resource_policies_client.go new file mode 100644 index 00000000000..4e2b4d86273 --- /dev/null +++ b/compute/apiv1/resource_policies_client.go @@ -0,0 +1,611 @@ +// Copyright 2021 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/ioutil" + "net/http" + "net/url" + + gax "github.com/googleapis/gax-go/v2" + "google.golang.org/api/option" + "google.golang.org/api/option/internaloption" + httptransport "google.golang.org/api/transport/http" + computepb "google.golang.org/genproto/googleapis/cloud/compute/v1" + "google.golang.org/grpc" + "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/encoding/protojson" +) + +var newResourcePoliciesClientHook clientHook + +// ResourcePoliciesCallOptions contains the retry settings for each method of ResourcePoliciesClient. +type ResourcePoliciesCallOptions struct { + AggregatedList []gax.CallOption + Delete []gax.CallOption + Get []gax.CallOption + GetIamPolicy []gax.CallOption + Insert []gax.CallOption + List []gax.CallOption + SetIamPolicy []gax.CallOption + TestIamPermissions []gax.CallOption +} + +// internalResourcePoliciesClient is an interface that defines the methods availaible from Google Compute Engine API. +type internalResourcePoliciesClient interface { + Close() error + setGoogleClientInfo(...string) + Connection() *grpc.ClientConn + AggregatedList(context.Context, *computepb.AggregatedListResourcePoliciesRequest, ...gax.CallOption) (*computepb.ResourcePolicyAggregatedList, error) + Delete(context.Context, *computepb.DeleteResourcePolicyRequest, ...gax.CallOption) (*computepb.Operation, error) + Get(context.Context, *computepb.GetResourcePolicyRequest, ...gax.CallOption) (*computepb.ResourcePolicy, error) + GetIamPolicy(context.Context, *computepb.GetIamPolicyResourcePolicyRequest, ...gax.CallOption) (*computepb.Policy, error) + Insert(context.Context, *computepb.InsertResourcePolicyRequest, ...gax.CallOption) (*computepb.Operation, error) + List(context.Context, *computepb.ListResourcePoliciesRequest, ...gax.CallOption) (*computepb.ResourcePolicyList, error) + SetIamPolicy(context.Context, *computepb.SetIamPolicyResourcePolicyRequest, ...gax.CallOption) (*computepb.Policy, error) + TestIamPermissions(context.Context, *computepb.TestIamPermissionsResourcePolicyRequest, ...gax.CallOption) (*computepb.TestPermissionsResponse, error) +} + +// ResourcePoliciesClient 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 ResourcePolicies API. +type ResourcePoliciesClient struct { + // The internal transport-dependent client. + internalClient internalResourcePoliciesClient + + // The call options for this service. + CallOptions *ResourcePoliciesCallOptions +} + +// 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 *ResourcePoliciesClient) 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 *ResourcePoliciesClient) setGoogleClientInfo(keyval ...string) { + c.internalClient.setGoogleClientInfo(keyval...) +} + +// Connection returns a connection to the API service. +// +// Deprecated. +func (c *ResourcePoliciesClient) Connection() *grpc.ClientConn { + return c.internalClient.Connection() +} + +// AggregatedList retrieves an aggregated list of resource policies. +func (c *ResourcePoliciesClient) AggregatedList(ctx context.Context, req *computepb.AggregatedListResourcePoliciesRequest, opts ...gax.CallOption) (*computepb.ResourcePolicyAggregatedList, error) { + return c.internalClient.AggregatedList(ctx, req, opts...) +} + +// Delete deletes the specified resource policy. +func (c *ResourcePoliciesClient) Delete(ctx context.Context, req *computepb.DeleteResourcePolicyRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.Delete(ctx, req, opts...) +} + +// Get retrieves all information of the specified resource policy. +func (c *ResourcePoliciesClient) Get(ctx context.Context, req *computepb.GetResourcePolicyRequest, opts ...gax.CallOption) (*computepb.ResourcePolicy, error) { + 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 *ResourcePoliciesClient) GetIamPolicy(ctx context.Context, req *computepb.GetIamPolicyResourcePolicyRequest, opts ...gax.CallOption) (*computepb.Policy, error) { + return c.internalClient.GetIamPolicy(ctx, req, opts...) +} + +// Insert creates a new resource policy. +func (c *ResourcePoliciesClient) Insert(ctx context.Context, req *computepb.InsertResourcePolicyRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.Insert(ctx, req, opts...) +} + +// List a list all the resource policies that have been configured for the specified project in specified region. +func (c *ResourcePoliciesClient) List(ctx context.Context, req *computepb.ListResourcePoliciesRequest, opts ...gax.CallOption) (*computepb.ResourcePolicyList, error) { + return c.internalClient.List(ctx, req, opts...) +} + +// SetIamPolicy sets the access control policy on the specified resource. Replaces any existing policy. +func (c *ResourcePoliciesClient) SetIamPolicy(ctx context.Context, req *computepb.SetIamPolicyResourcePolicyRequest, 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 *ResourcePoliciesClient) TestIamPermissions(ctx context.Context, req *computepb.TestIamPermissionsResourcePolicyRequest, opts ...gax.CallOption) (*computepb.TestPermissionsResponse, error) { + return c.internalClient.TestIamPermissions(ctx, req, opts...) +} + +// Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls. +type resourcePoliciesRESTClient struct { + // The http endpoint to connect to. + endpoint string + + // The http client. + httpClient *http.Client + + // The x-goog-* metadata to be sent with each request. + xGoogMetadata metadata.MD +} + +// NewResourcePoliciesRESTClient creates a new resource policies rest client. +// +// The ResourcePolicies API. +func NewResourcePoliciesRESTClient(ctx context.Context, opts ...option.ClientOption) (*ResourcePoliciesClient, error) { + clientOpts := append(defaultResourcePoliciesRESTClientOptions(), opts...) + httpClient, endpoint, err := httptransport.NewClient(ctx, clientOpts...) + if err != nil { + return nil, err + } + + c := &resourcePoliciesRESTClient{ + endpoint: endpoint, + httpClient: httpClient, + } + c.setGoogleClientInfo() + + return &ResourcePoliciesClient{internalClient: c, CallOptions: &ResourcePoliciesCallOptions{}}, nil +} + +func defaultResourcePoliciesRESTClientOptions() []option.ClientOption { + return []option.ClientOption{ + internaloption.WithDefaultEndpoint("compute.googleapis.com"), + internaloption.WithDefaultMTLSEndpoint("compute.mtls.googleapis.com"), + internaloption.WithDefaultAudience("https://compute.googleapis.com/"), + internaloption.WithDefaultScopes(DefaultAuthScopes()...), + } +} + +// setGoogleClientInfo sets the name and version of the application in +// the `x-goog-api-client` header passed on each request. Intended for +// use by Google-written clients. +func (c *resourcePoliciesRESTClient) setGoogleClientInfo(keyval ...string) { + kv := append([]string{"gl-go", versionGo()}, keyval...) + kv = append(kv, "gapic", versionClient, "gax", gax.Version, "rest", "UNKNOWN") + c.xGoogMetadata = metadata.Pairs("x-goog-api-client", gax.XGoogHeader(kv...)) +} + +// Close closes the connection to the API service. The user should invoke this when +// the client is no longer required. +func (c *resourcePoliciesRESTClient) Close() error { + // Replace httpClient with nil to force cleanup. + c.httpClient = nil + return nil +} + +// Connection returns a connection to the API service. +// +// Deprecated. +func (c *resourcePoliciesRESTClient) Connection() *grpc.ClientConn { + return nil +} + +// AggregatedList retrieves an aggregated list of resource policies. +func (c *resourcePoliciesRESTClient) AggregatedList(ctx context.Context, req *computepb.AggregatedListResourcePoliciesRequest, opts ...gax.CallOption) (*computepb.ResourcePolicyAggregatedList, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/aggregated/resourcePolicies", req.GetProject()) + + params := url.Values{} + if req != nil && req.Filter != nil { + params.Add("filter", fmt.Sprintf("%v", req.GetFilter())) + } + if req != nil && req.IncludeAllScopes != nil { + params.Add("includeAllScopes", fmt.Sprintf("%v", req.GetIncludeAllScopes())) + } + 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() + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.ResourcePolicyAggregatedList{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Delete deletes the specified resource policy. +func (c *resourcePoliciesRESTClient) Delete(ctx context.Context, req *computepb.DeleteResourcePolicyRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/resourcePolicies/%v", req.GetProject(), req.GetRegion(), req.GetResourcePolicy()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("DELETE", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Get retrieves all information of the specified resource policy. +func (c *resourcePoliciesRESTClient) Get(ctx context.Context, req *computepb.GetResourcePolicyRequest, opts ...gax.CallOption) (*computepb.ResourcePolicy, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/resourcePolicies/%v", req.GetProject(), req.GetRegion(), req.GetResourcePolicy()) + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.ResourcePolicy{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// GetIamPolicy gets the access control policy for a resource. May be empty if no such policy or resource exists. +func (c *resourcePoliciesRESTClient) GetIamPolicy(ctx context.Context, req *computepb.GetIamPolicyResourcePolicyRequest, opts ...gax.CallOption) (*computepb.Policy, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/resourcePolicies/%v/getIamPolicy", req.GetProject(), req.GetRegion(), req.GetResource()) + + params := url.Values{} + if req != nil && req.OptionsRequestedPolicyVersion != nil { + params.Add("optionsRequestedPolicyVersion", fmt.Sprintf("%v", req.GetOptionsRequestedPolicyVersion())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Policy{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Insert creates a new resource policy. +func (c *resourcePoliciesRESTClient) Insert(ctx context.Context, req *computepb.InsertResourcePolicyRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetResourcePolicyResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/resourcePolicies", req.GetProject(), req.GetRegion()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// List a list all the resource policies that have been configured for the specified project in specified region. +func (c *resourcePoliciesRESTClient) List(ctx context.Context, req *computepb.ListResourcePoliciesRequest, opts ...gax.CallOption) (*computepb.ResourcePolicyList, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/resourcePolicies", 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() + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.ResourcePolicyList{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// SetIamPolicy sets the access control policy on the specified resource. Replaces any existing policy. +func (c *resourcePoliciesRESTClient) SetIamPolicy(ctx context.Context, req *computepb.SetIamPolicyResourcePolicyRequest, opts ...gax.CallOption) (*computepb.Policy, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetRegionSetPolicyRequestResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/resourcePolicies/%v/setIamPolicy", req.GetProject(), req.GetRegion(), req.GetResource()) + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Policy{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// TestIamPermissions returns permissions that a caller has on the specified resource. +func (c *resourcePoliciesRESTClient) TestIamPermissions(ctx context.Context, req *computepb.TestIamPermissionsResourcePolicyRequest, opts ...gax.CallOption) (*computepb.TestPermissionsResponse, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetTestPermissionsRequestResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/resourcePolicies/%v/testIamPermissions", req.GetProject(), req.GetRegion(), req.GetResource()) + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.TestPermissionsResponse{} + + return rsp, unm.Unmarshal(buf, rsp) +} diff --git a/compute/apiv1/resource_policies_client_example_test.go b/compute/apiv1/resource_policies_client_example_test.go new file mode 100644 index 00000000000..361e180ee6e --- /dev/null +++ b/compute/apiv1/resource_policies_client_example_test.go @@ -0,0 +1,188 @@ +// Copyright 2021 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_test + +import ( + "context" + + compute "cloud.google.com/go/compute/apiv1" + computepb "google.golang.org/genproto/googleapis/cloud/compute/v1" +) + +func ExampleNewResourcePoliciesRESTClient() { + ctx := context.Background() + c, err := compute.NewResourcePoliciesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + // TODO: Use client. + _ = c +} + +func ExampleResourcePoliciesClient_AggregatedList() { + ctx := context.Background() + c, err := compute.NewResourcePoliciesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.AggregatedListResourcePoliciesRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.AggregatedList(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleResourcePoliciesClient_Delete() { + ctx := context.Background() + c, err := compute.NewResourcePoliciesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.DeleteResourcePolicyRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Delete(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleResourcePoliciesClient_Get() { + ctx := context.Background() + c, err := compute.NewResourcePoliciesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.GetResourcePolicyRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Get(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleResourcePoliciesClient_GetIamPolicy() { + ctx := context.Background() + c, err := compute.NewResourcePoliciesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.GetIamPolicyResourcePolicyRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.GetIamPolicy(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleResourcePoliciesClient_Insert() { + ctx := context.Background() + c, err := compute.NewResourcePoliciesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.InsertResourcePolicyRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Insert(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleResourcePoliciesClient_List() { + ctx := context.Background() + c, err := compute.NewResourcePoliciesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.ListResourcePoliciesRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.List(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleResourcePoliciesClient_SetIamPolicy() { + ctx := context.Background() + c, err := compute.NewResourcePoliciesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.SetIamPolicyResourcePolicyRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.SetIamPolicy(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleResourcePoliciesClient_TestIamPermissions() { + ctx := context.Background() + c, err := compute.NewResourcePoliciesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.TestIamPermissionsResourcePolicyRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.TestIamPermissions(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} diff --git a/compute/apiv1/routers_client.go b/compute/apiv1/routers_client.go new file mode 100644 index 00000000000..b454d1707d6 --- /dev/null +++ b/compute/apiv1/routers_client.go @@ -0,0 +1,747 @@ +// Copyright 2021 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/ioutil" + "net/http" + "net/url" + + gax "github.com/googleapis/gax-go/v2" + "google.golang.org/api/option" + "google.golang.org/api/option/internaloption" + httptransport "google.golang.org/api/transport/http" + computepb "google.golang.org/genproto/googleapis/cloud/compute/v1" + "google.golang.org/grpc" + "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/encoding/protojson" +) + +var newRoutersClientHook clientHook + +// RoutersCallOptions contains the retry settings for each method of RoutersClient. +type RoutersCallOptions struct { + AggregatedList []gax.CallOption + Delete []gax.CallOption + Get []gax.CallOption + GetNatMappingInfo []gax.CallOption + GetRouterStatus []gax.CallOption + Insert []gax.CallOption + List []gax.CallOption + Patch []gax.CallOption + Preview []gax.CallOption + Update []gax.CallOption +} + +// internalRoutersClient is an interface that defines the methods availaible from Google Compute Engine API. +type internalRoutersClient interface { + Close() error + setGoogleClientInfo(...string) + Connection() *grpc.ClientConn + AggregatedList(context.Context, *computepb.AggregatedListRoutersRequest, ...gax.CallOption) (*computepb.RouterAggregatedList, error) + Delete(context.Context, *computepb.DeleteRouterRequest, ...gax.CallOption) (*computepb.Operation, error) + Get(context.Context, *computepb.GetRouterRequest, ...gax.CallOption) (*computepb.Router, error) + GetNatMappingInfo(context.Context, *computepb.GetNatMappingInfoRoutersRequest, ...gax.CallOption) (*computepb.VmEndpointNatMappingsList, error) + GetRouterStatus(context.Context, *computepb.GetRouterStatusRouterRequest, ...gax.CallOption) (*computepb.RouterStatusResponse, error) + Insert(context.Context, *computepb.InsertRouterRequest, ...gax.CallOption) (*computepb.Operation, error) + List(context.Context, *computepb.ListRoutersRequest, ...gax.CallOption) (*computepb.RouterList, error) + Patch(context.Context, *computepb.PatchRouterRequest, ...gax.CallOption) (*computepb.Operation, error) + Preview(context.Context, *computepb.PreviewRouterRequest, ...gax.CallOption) (*computepb.RoutersPreviewResponse, error) + Update(context.Context, *computepb.UpdateRouterRequest, ...gax.CallOption) (*computepb.Operation, error) +} + +// RoutersClient 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 Routers API. +type RoutersClient struct { + // The internal transport-dependent client. + internalClient internalRoutersClient + + // The call options for this service. + CallOptions *RoutersCallOptions +} + +// 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 *RoutersClient) 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 *RoutersClient) setGoogleClientInfo(keyval ...string) { + c.internalClient.setGoogleClientInfo(keyval...) +} + +// Connection returns a connection to the API service. +// +// Deprecated. +func (c *RoutersClient) Connection() *grpc.ClientConn { + return c.internalClient.Connection() +} + +// AggregatedList retrieves an aggregated list of routers. +func (c *RoutersClient) AggregatedList(ctx context.Context, req *computepb.AggregatedListRoutersRequest, opts ...gax.CallOption) (*computepb.RouterAggregatedList, error) { + return c.internalClient.AggregatedList(ctx, req, opts...) +} + +// Delete deletes the specified Router resource. +func (c *RoutersClient) Delete(ctx context.Context, req *computepb.DeleteRouterRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.Delete(ctx, req, opts...) +} + +// Get returns the specified Router resource. Gets a list of available routers by making a list() request. +func (c *RoutersClient) Get(ctx context.Context, req *computepb.GetRouterRequest, opts ...gax.CallOption) (*computepb.Router, error) { + return c.internalClient.Get(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) (*computepb.VmEndpointNatMappingsList, error) { + return c.internalClient.GetNatMappingInfo(ctx, req, opts...) +} + +// GetRouterStatus retrieves runtime information of the specified router. +func (c *RoutersClient) GetRouterStatus(ctx context.Context, req *computepb.GetRouterStatusRouterRequest, opts ...gax.CallOption) (*computepb.RouterStatusResponse, error) { + return c.internalClient.GetRouterStatus(ctx, req, opts...) +} + +// Insert creates a Router resource in the specified project and region using the data included in the request. +func (c *RoutersClient) Insert(ctx context.Context, req *computepb.InsertRouterRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.Insert(ctx, req, opts...) +} + +// List retrieves a list of Router resources available to the specified project. +func (c *RoutersClient) List(ctx context.Context, req *computepb.ListRoutersRequest, opts ...gax.CallOption) (*computepb.RouterList, error) { + return c.internalClient.List(ctx, req, opts...) +} + +// Patch patches the specified Router resource with the data included in the request. This method supports PATCH semantics and uses JSON merge patch format and processing rules. +func (c *RoutersClient) Patch(ctx context.Context, req *computepb.PatchRouterRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.Patch(ctx, req, opts...) +} + +// Preview preview fields auto-generated during router create and update operations. Calling this method does NOT create or update the router. +func (c *RoutersClient) Preview(ctx context.Context, req *computepb.PreviewRouterRequest, opts ...gax.CallOption) (*computepb.RoutersPreviewResponse, error) { + return c.internalClient.Preview(ctx, req, opts...) +} + +// Update updates the specified Router resource with the data included in the request. This method conforms to PUT semantics, which requests that the state of the target resource be created or replaced with the state defined by the representation enclosed in the request message payload. +func (c *RoutersClient) Update(ctx context.Context, req *computepb.UpdateRouterRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.Update(ctx, req, opts...) +} + +// Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls. +type routersRESTClient struct { + // The http endpoint to connect to. + endpoint string + + // The http client. + httpClient *http.Client + + // The x-goog-* metadata to be sent with each request. + xGoogMetadata metadata.MD +} + +// NewRoutersRESTClient creates a new routers rest client. +// +// The Routers API. +func NewRoutersRESTClient(ctx context.Context, opts ...option.ClientOption) (*RoutersClient, error) { + clientOpts := append(defaultRoutersRESTClientOptions(), opts...) + httpClient, endpoint, err := httptransport.NewClient(ctx, clientOpts...) + if err != nil { + return nil, err + } + + c := &routersRESTClient{ + endpoint: endpoint, + httpClient: httpClient, + } + c.setGoogleClientInfo() + + return &RoutersClient{internalClient: c, CallOptions: &RoutersCallOptions{}}, nil +} + +func defaultRoutersRESTClientOptions() []option.ClientOption { + return []option.ClientOption{ + internaloption.WithDefaultEndpoint("compute.googleapis.com"), + internaloption.WithDefaultMTLSEndpoint("compute.mtls.googleapis.com"), + internaloption.WithDefaultAudience("https://compute.googleapis.com/"), + internaloption.WithDefaultScopes(DefaultAuthScopes()...), + } +} + +// setGoogleClientInfo sets the name and version of the application in +// the `x-goog-api-client` header passed on each request. Intended for +// use by Google-written clients. +func (c *routersRESTClient) setGoogleClientInfo(keyval ...string) { + kv := append([]string{"gl-go", versionGo()}, keyval...) + kv = append(kv, "gapic", versionClient, "gax", gax.Version, "rest", "UNKNOWN") + c.xGoogMetadata = metadata.Pairs("x-goog-api-client", gax.XGoogHeader(kv...)) +} + +// Close closes the connection to the API service. The user should invoke this when +// the client is no longer required. +func (c *routersRESTClient) Close() error { + // Replace httpClient with nil to force cleanup. + c.httpClient = nil + return nil +} + +// Connection returns a connection to the API service. +// +// Deprecated. +func (c *routersRESTClient) Connection() *grpc.ClientConn { + return nil +} + +// AggregatedList retrieves an aggregated list of routers. +func (c *routersRESTClient) AggregatedList(ctx context.Context, req *computepb.AggregatedListRoutersRequest, opts ...gax.CallOption) (*computepb.RouterAggregatedList, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/aggregated/routers", req.GetProject()) + + params := url.Values{} + if req != nil && req.Filter != nil { + params.Add("filter", fmt.Sprintf("%v", req.GetFilter())) + } + if req != nil && req.IncludeAllScopes != nil { + params.Add("includeAllScopes", fmt.Sprintf("%v", req.GetIncludeAllScopes())) + } + 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() + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.RouterAggregatedList{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Delete deletes the specified Router resource. +func (c *routersRESTClient) Delete(ctx context.Context, req *computepb.DeleteRouterRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/routers/%v", req.GetProject(), req.GetRegion(), req.GetRouter()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("DELETE", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Get returns the specified Router resource. Gets a list of available routers by making a list() request. +func (c *routersRESTClient) Get(ctx context.Context, req *computepb.GetRouterRequest, opts ...gax.CallOption) (*computepb.Router, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/routers/%v", req.GetProject(), req.GetRegion(), req.GetRouter()) + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Router{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// GetNatMappingInfo retrieves runtime Nat mapping information of VM endpoints. +func (c *routersRESTClient) GetNatMappingInfo(ctx context.Context, req *computepb.GetNatMappingInfoRoutersRequest, opts ...gax.CallOption) (*computepb.VmEndpointNatMappingsList, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/routers/%v/getNatMappingInfo", req.GetProject(), req.GetRegion(), req.GetRouter()) + + 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() + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.VmEndpointNatMappingsList{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// GetRouterStatus retrieves runtime information of the specified router. +func (c *routersRESTClient) GetRouterStatus(ctx context.Context, req *computepb.GetRouterStatusRouterRequest, opts ...gax.CallOption) (*computepb.RouterStatusResponse, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/routers/%v/getRouterStatus", req.GetProject(), req.GetRegion(), req.GetRouter()) + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.RouterStatusResponse{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Insert creates a Router resource in the specified project and region using the data included in the request. +func (c *routersRESTClient) Insert(ctx context.Context, req *computepb.InsertRouterRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetRouterResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/routers", req.GetProject(), req.GetRegion()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// List retrieves a list of Router resources available to the specified project. +func (c *routersRESTClient) List(ctx context.Context, req *computepb.ListRoutersRequest, opts ...gax.CallOption) (*computepb.RouterList, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/routers", 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() + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.RouterList{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Patch patches the specified Router resource with the data included in the request. This method supports PATCH semantics and uses JSON merge patch format and processing rules. +func (c *routersRESTClient) Patch(ctx context.Context, req *computepb.PatchRouterRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetRouterResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/routers/%v", req.GetProject(), req.GetRegion(), req.GetRouter()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("PATCH", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Preview preview fields auto-generated during router create and update operations. Calling this method does NOT create or update the router. +func (c *routersRESTClient) Preview(ctx context.Context, req *computepb.PreviewRouterRequest, opts ...gax.CallOption) (*computepb.RoutersPreviewResponse, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetRouterResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/routers/%v/preview", req.GetProject(), req.GetRegion(), req.GetRouter()) + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.RoutersPreviewResponse{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Update updates the specified Router resource with the data included in the request. This method conforms to PUT semantics, which requests that the state of the target resource be created or replaced with the state defined by the representation enclosed in the request message payload. +func (c *routersRESTClient) Update(ctx context.Context, req *computepb.UpdateRouterRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetRouterResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("") + + params := url.Values{} + if req.GetProject() != "" { + params.Add("project", fmt.Sprintf("%v", req.GetProject())) + } + if req.GetRegion() != "" { + params.Add("region", fmt.Sprintf("%v", req.GetRegion())) + } + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + if req.GetRouter() != "" { + params.Add("router", fmt.Sprintf("%v", req.GetRouter())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("PUT", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} diff --git a/compute/apiv1/routers_client_example_test.go b/compute/apiv1/routers_client_example_test.go new file mode 100644 index 00000000000..96553d9bd1d --- /dev/null +++ b/compute/apiv1/routers_client_example_test.go @@ -0,0 +1,226 @@ +// Copyright 2021 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_test + +import ( + "context" + + compute "cloud.google.com/go/compute/apiv1" + computepb "google.golang.org/genproto/googleapis/cloud/compute/v1" +) + +func ExampleNewRoutersRESTClient() { + ctx := context.Background() + c, err := compute.NewRoutersRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + // TODO: Use client. + _ = c +} + +func ExampleRoutersClient_AggregatedList() { + ctx := context.Background() + c, err := compute.NewRoutersRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.AggregatedListRoutersRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.AggregatedList(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleRoutersClient_Delete() { + ctx := context.Background() + c, err := compute.NewRoutersRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.DeleteRouterRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Delete(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleRoutersClient_Get() { + ctx := context.Background() + c, err := compute.NewRoutersRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.GetRouterRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Get(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleRoutersClient_GetNatMappingInfo() { + ctx := context.Background() + c, err := compute.NewRoutersRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.GetNatMappingInfoRoutersRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.GetNatMappingInfo(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleRoutersClient_GetRouterStatus() { + ctx := context.Background() + c, err := compute.NewRoutersRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.GetRouterStatusRouterRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.GetRouterStatus(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleRoutersClient_Insert() { + ctx := context.Background() + c, err := compute.NewRoutersRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.InsertRouterRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Insert(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleRoutersClient_List() { + ctx := context.Background() + c, err := compute.NewRoutersRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.ListRoutersRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.List(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleRoutersClient_Patch() { + ctx := context.Background() + c, err := compute.NewRoutersRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.PatchRouterRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Patch(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleRoutersClient_Preview() { + ctx := context.Background() + c, err := compute.NewRoutersRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.PreviewRouterRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Preview(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleRoutersClient_Update() { + ctx := context.Background() + c, err := compute.NewRoutersRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.UpdateRouterRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Update(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} diff --git a/compute/apiv1/routes_client.go b/compute/apiv1/routes_client.go new file mode 100644 index 00000000000..cd8f909f21b --- /dev/null +++ b/compute/apiv1/routes_client.go @@ -0,0 +1,380 @@ +// Copyright 2021 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/ioutil" + "net/http" + "net/url" + + gax "github.com/googleapis/gax-go/v2" + "google.golang.org/api/option" + "google.golang.org/api/option/internaloption" + httptransport "google.golang.org/api/transport/http" + computepb "google.golang.org/genproto/googleapis/cloud/compute/v1" + "google.golang.org/grpc" + "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/encoding/protojson" +) + +var newRoutesClientHook clientHook + +// RoutesCallOptions contains the retry settings for each method of RoutesClient. +type RoutesCallOptions struct { + Delete []gax.CallOption + Get []gax.CallOption + Insert []gax.CallOption + List []gax.CallOption +} + +// internalRoutesClient is an interface that defines the methods availaible from Google Compute Engine API. +type internalRoutesClient interface { + Close() error + setGoogleClientInfo(...string) + Connection() *grpc.ClientConn + Delete(context.Context, *computepb.DeleteRouteRequest, ...gax.CallOption) (*computepb.Operation, error) + Get(context.Context, *computepb.GetRouteRequest, ...gax.CallOption) (*computepb.Route, error) + Insert(context.Context, *computepb.InsertRouteRequest, ...gax.CallOption) (*computepb.Operation, error) + List(context.Context, *computepb.ListRoutesRequest, ...gax.CallOption) (*computepb.RouteList, error) +} + +// RoutesClient 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 Routes API. +type RoutesClient struct { + // The internal transport-dependent client. + internalClient internalRoutesClient + + // The call options for this service. + CallOptions *RoutesCallOptions +} + +// 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 *RoutesClient) 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 *RoutesClient) setGoogleClientInfo(keyval ...string) { + c.internalClient.setGoogleClientInfo(keyval...) +} + +// Connection returns a connection to the API service. +// +// Deprecated. +func (c *RoutesClient) Connection() *grpc.ClientConn { + return c.internalClient.Connection() +} + +// Delete deletes the specified Route resource. +func (c *RoutesClient) Delete(ctx context.Context, req *computepb.DeleteRouteRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.Delete(ctx, req, opts...) +} + +// Get returns the specified Route resource. Gets a list of available routes by making a list() request. +func (c *RoutesClient) Get(ctx context.Context, req *computepb.GetRouteRequest, opts ...gax.CallOption) (*computepb.Route, error) { + return c.internalClient.Get(ctx, req, opts...) +} + +// Insert creates a Route resource in the specified project using the data included in the request. +func (c *RoutesClient) Insert(ctx context.Context, req *computepb.InsertRouteRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.Insert(ctx, req, opts...) +} + +// List retrieves the list of Route resources available to the specified project. +func (c *RoutesClient) List(ctx context.Context, req *computepb.ListRoutesRequest, opts ...gax.CallOption) (*computepb.RouteList, error) { + return c.internalClient.List(ctx, req, opts...) +} + +// Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls. +type routesRESTClient struct { + // The http endpoint to connect to. + endpoint string + + // The http client. + httpClient *http.Client + + // The x-goog-* metadata to be sent with each request. + xGoogMetadata metadata.MD +} + +// NewRoutesRESTClient creates a new routes rest client. +// +// The Routes API. +func NewRoutesRESTClient(ctx context.Context, opts ...option.ClientOption) (*RoutesClient, error) { + clientOpts := append(defaultRoutesRESTClientOptions(), opts...) + httpClient, endpoint, err := httptransport.NewClient(ctx, clientOpts...) + if err != nil { + return nil, err + } + + c := &routesRESTClient{ + endpoint: endpoint, + httpClient: httpClient, + } + c.setGoogleClientInfo() + + return &RoutesClient{internalClient: c, CallOptions: &RoutesCallOptions{}}, nil +} + +func defaultRoutesRESTClientOptions() []option.ClientOption { + return []option.ClientOption{ + internaloption.WithDefaultEndpoint("compute.googleapis.com"), + internaloption.WithDefaultMTLSEndpoint("compute.mtls.googleapis.com"), + internaloption.WithDefaultAudience("https://compute.googleapis.com/"), + internaloption.WithDefaultScopes(DefaultAuthScopes()...), + } +} + +// setGoogleClientInfo sets the name and version of the application in +// the `x-goog-api-client` header passed on each request. Intended for +// use by Google-written clients. +func (c *routesRESTClient) setGoogleClientInfo(keyval ...string) { + kv := append([]string{"gl-go", versionGo()}, keyval...) + kv = append(kv, "gapic", versionClient, "gax", gax.Version, "rest", "UNKNOWN") + c.xGoogMetadata = metadata.Pairs("x-goog-api-client", gax.XGoogHeader(kv...)) +} + +// Close closes the connection to the API service. The user should invoke this when +// the client is no longer required. +func (c *routesRESTClient) Close() error { + // Replace httpClient with nil to force cleanup. + c.httpClient = nil + return nil +} + +// Connection returns a connection to the API service. +// +// Deprecated. +func (c *routesRESTClient) Connection() *grpc.ClientConn { + return nil +} + +// Delete deletes the specified Route resource. +func (c *routesRESTClient) Delete(ctx context.Context, req *computepb.DeleteRouteRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/global/routes/%v", req.GetProject(), req.GetRoute()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("DELETE", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Get returns the specified Route resource. Gets a list of available routes by making a list() request. +func (c *routesRESTClient) Get(ctx context.Context, req *computepb.GetRouteRequest, opts ...gax.CallOption) (*computepb.Route, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/global/routes/%v", req.GetProject(), req.GetRoute()) + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Route{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Insert creates a Route resource in the specified project using the data included in the request. +func (c *routesRESTClient) Insert(ctx context.Context, req *computepb.InsertRouteRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetRouteResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/global/routes", req.GetProject()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// List retrieves the list of Route resources available to the specified project. +func (c *routesRESTClient) List(ctx context.Context, req *computepb.ListRoutesRequest, opts ...gax.CallOption) (*computepb.RouteList, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/global/routes", 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() + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.RouteList{} + + return rsp, unm.Unmarshal(buf, rsp) +} diff --git a/compute/apiv1/routes_client_example_test.go b/compute/apiv1/routes_client_example_test.go new file mode 100644 index 00000000000..730354784ea --- /dev/null +++ b/compute/apiv1/routes_client_example_test.go @@ -0,0 +1,112 @@ +// Copyright 2021 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_test + +import ( + "context" + + compute "cloud.google.com/go/compute/apiv1" + computepb "google.golang.org/genproto/googleapis/cloud/compute/v1" +) + +func ExampleNewRoutesRESTClient() { + ctx := context.Background() + c, err := compute.NewRoutesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + // TODO: Use client. + _ = c +} + +func ExampleRoutesClient_Delete() { + ctx := context.Background() + c, err := compute.NewRoutesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.DeleteRouteRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Delete(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleRoutesClient_Get() { + ctx := context.Background() + c, err := compute.NewRoutesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.GetRouteRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Get(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleRoutesClient_Insert() { + ctx := context.Background() + c, err := compute.NewRoutesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.InsertRouteRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Insert(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleRoutesClient_List() { + ctx := context.Background() + c, err := compute.NewRoutesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.ListRoutesRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.List(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} diff --git a/compute/apiv1/security_policies_client.go b/compute/apiv1/security_policies_client.go new file mode 100644 index 00000000000..fceb1652547 --- /dev/null +++ b/compute/apiv1/security_policies_client.go @@ -0,0 +1,730 @@ +// Copyright 2021 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/ioutil" + "net/http" + "net/url" + + gax "github.com/googleapis/gax-go/v2" + "google.golang.org/api/option" + "google.golang.org/api/option/internaloption" + httptransport "google.golang.org/api/transport/http" + computepb "google.golang.org/genproto/googleapis/cloud/compute/v1" + "google.golang.org/grpc" + "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/encoding/protojson" +) + +var newSecurityPoliciesClientHook clientHook + +// SecurityPoliciesCallOptions contains the retry settings for each method of SecurityPoliciesClient. +type SecurityPoliciesCallOptions struct { + AddRule []gax.CallOption + Delete []gax.CallOption + Get []gax.CallOption + GetRule []gax.CallOption + Insert []gax.CallOption + List []gax.CallOption + ListPreconfiguredExpressionSets []gax.CallOption + Patch []gax.CallOption + PatchRule []gax.CallOption + RemoveRule []gax.CallOption +} + +// internalSecurityPoliciesClient is an interface that defines the methods availaible from Google Compute Engine API. +type internalSecurityPoliciesClient interface { + Close() error + setGoogleClientInfo(...string) + Connection() *grpc.ClientConn + AddRule(context.Context, *computepb.AddRuleSecurityPolicyRequest, ...gax.CallOption) (*computepb.Operation, error) + Delete(context.Context, *computepb.DeleteSecurityPolicyRequest, ...gax.CallOption) (*computepb.Operation, error) + Get(context.Context, *computepb.GetSecurityPolicyRequest, ...gax.CallOption) (*computepb.SecurityPolicy, error) + GetRule(context.Context, *computepb.GetRuleSecurityPolicyRequest, ...gax.CallOption) (*computepb.SecurityPolicyRule, error) + Insert(context.Context, *computepb.InsertSecurityPolicyRequest, ...gax.CallOption) (*computepb.Operation, error) + List(context.Context, *computepb.ListSecurityPoliciesRequest, ...gax.CallOption) (*computepb.SecurityPolicyList, error) + ListPreconfiguredExpressionSets(context.Context, *computepb.ListPreconfiguredExpressionSetsSecurityPoliciesRequest, ...gax.CallOption) (*computepb.SecurityPoliciesListPreconfiguredExpressionSetsResponse, error) + Patch(context.Context, *computepb.PatchSecurityPolicyRequest, ...gax.CallOption) (*computepb.Operation, error) + PatchRule(context.Context, *computepb.PatchRuleSecurityPolicyRequest, ...gax.CallOption) (*computepb.Operation, error) + RemoveRule(context.Context, *computepb.RemoveRuleSecurityPolicyRequest, ...gax.CallOption) (*computepb.Operation, error) +} + +// SecurityPoliciesClient 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 SecurityPolicies API. +type SecurityPoliciesClient struct { + // The internal transport-dependent client. + internalClient internalSecurityPoliciesClient + + // The call options for this service. + CallOptions *SecurityPoliciesCallOptions +} + +// 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 *SecurityPoliciesClient) 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 *SecurityPoliciesClient) setGoogleClientInfo(keyval ...string) { + c.internalClient.setGoogleClientInfo(keyval...) +} + +// Connection returns a connection to the API service. +// +// Deprecated. +func (c *SecurityPoliciesClient) Connection() *grpc.ClientConn { + return c.internalClient.Connection() +} + +// AddRule inserts a rule into a security policy. +func (c *SecurityPoliciesClient) AddRule(ctx context.Context, req *computepb.AddRuleSecurityPolicyRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.AddRule(ctx, req, opts...) +} + +// Delete deletes the specified policy. +func (c *SecurityPoliciesClient) Delete(ctx context.Context, req *computepb.DeleteSecurityPolicyRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.Delete(ctx, req, opts...) +} + +// Get list all of the ordered rules present in a single specified policy. +func (c *SecurityPoliciesClient) Get(ctx context.Context, req *computepb.GetSecurityPolicyRequest, opts ...gax.CallOption) (*computepb.SecurityPolicy, error) { + return c.internalClient.Get(ctx, req, opts...) +} + +// GetRule gets a rule at the specified priority. +func (c *SecurityPoliciesClient) GetRule(ctx context.Context, req *computepb.GetRuleSecurityPolicyRequest, 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 *SecurityPoliciesClient) Insert(ctx context.Context, req *computepb.InsertSecurityPolicyRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.Insert(ctx, req, opts...) +} + +// List list all the policies that have been configured for the specified project. +func (c *SecurityPoliciesClient) List(ctx context.Context, req *computepb.ListSecurityPoliciesRequest, opts ...gax.CallOption) (*computepb.SecurityPolicyList, error) { + return c.internalClient.List(ctx, req, opts...) +} + +// ListPreconfiguredExpressionSets gets the current list of preconfigured Web Application Firewall (WAF) expressions. +func (c *SecurityPoliciesClient) ListPreconfiguredExpressionSets(ctx context.Context, req *computepb.ListPreconfiguredExpressionSetsSecurityPoliciesRequest, opts ...gax.CallOption) (*computepb.SecurityPoliciesListPreconfiguredExpressionSetsResponse, error) { + return c.internalClient.ListPreconfiguredExpressionSets(ctx, req, opts...) +} + +// Patch patches the specified policy with the data included in the request. This cannot be used to be update the rules in the policy. Please use the per rule methods like addRule, patchRule, and removeRule instead. +func (c *SecurityPoliciesClient) Patch(ctx context.Context, req *computepb.PatchSecurityPolicyRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.Patch(ctx, req, opts...) +} + +// PatchRule patches a rule at the specified priority. +func (c *SecurityPoliciesClient) PatchRule(ctx context.Context, req *computepb.PatchRuleSecurityPolicyRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.PatchRule(ctx, req, opts...) +} + +// RemoveRule deletes a rule at the specified priority. +func (c *SecurityPoliciesClient) RemoveRule(ctx context.Context, req *computepb.RemoveRuleSecurityPolicyRequest, opts ...gax.CallOption) (*computepb.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 securityPoliciesRESTClient struct { + // The http endpoint to connect to. + endpoint string + + // The http client. + httpClient *http.Client + + // The x-goog-* metadata to be sent with each request. + xGoogMetadata metadata.MD +} + +// NewSecurityPoliciesRESTClient creates a new security policies rest client. +// +// The SecurityPolicies API. +func NewSecurityPoliciesRESTClient(ctx context.Context, opts ...option.ClientOption) (*SecurityPoliciesClient, error) { + clientOpts := append(defaultSecurityPoliciesRESTClientOptions(), opts...) + httpClient, endpoint, err := httptransport.NewClient(ctx, clientOpts...) + if err != nil { + return nil, err + } + + c := &securityPoliciesRESTClient{ + endpoint: endpoint, + httpClient: httpClient, + } + c.setGoogleClientInfo() + + return &SecurityPoliciesClient{internalClient: c, CallOptions: &SecurityPoliciesCallOptions{}}, nil +} + +func defaultSecurityPoliciesRESTClientOptions() []option.ClientOption { + return []option.ClientOption{ + internaloption.WithDefaultEndpoint("compute.googleapis.com"), + internaloption.WithDefaultMTLSEndpoint("compute.mtls.googleapis.com"), + internaloption.WithDefaultAudience("https://compute.googleapis.com/"), + internaloption.WithDefaultScopes(DefaultAuthScopes()...), + } +} + +// setGoogleClientInfo sets the name and version of the application in +// the `x-goog-api-client` header passed on each request. Intended for +// use by Google-written clients. +func (c *securityPoliciesRESTClient) setGoogleClientInfo(keyval ...string) { + kv := append([]string{"gl-go", versionGo()}, keyval...) + kv = append(kv, "gapic", versionClient, "gax", gax.Version, "rest", "UNKNOWN") + c.xGoogMetadata = metadata.Pairs("x-goog-api-client", gax.XGoogHeader(kv...)) +} + +// Close closes the connection to the API service. The user should invoke this when +// the client is no longer required. +func (c *securityPoliciesRESTClient) Close() error { + // Replace httpClient with nil to force cleanup. + c.httpClient = nil + return nil +} + +// Connection returns a connection to the API service. +// +// Deprecated. +func (c *securityPoliciesRESTClient) Connection() *grpc.ClientConn { + return nil +} + +// AddRule inserts a rule into a security policy. +func (c *securityPoliciesRESTClient) AddRule(ctx context.Context, req *computepb.AddRuleSecurityPolicyRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetSecurityPolicyRuleResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/global/securityPolicies/%v/addRule", req.GetProject(), req.GetSecurityPolicy()) + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Delete deletes the specified policy. +func (c *securityPoliciesRESTClient) Delete(ctx context.Context, req *computepb.DeleteSecurityPolicyRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/global/securityPolicies/%v", req.GetProject(), req.GetSecurityPolicy()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("DELETE", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Get list all of the ordered rules present in a single specified policy. +func (c *securityPoliciesRESTClient) Get(ctx context.Context, req *computepb.GetSecurityPolicyRequest, opts ...gax.CallOption) (*computepb.SecurityPolicy, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/global/securityPolicies/%v", req.GetProject(), req.GetSecurityPolicy()) + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.SecurityPolicy{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// GetRule gets a rule at the specified priority. +func (c *securityPoliciesRESTClient) GetRule(ctx context.Context, req *computepb.GetRuleSecurityPolicyRequest, opts ...gax.CallOption) (*computepb.SecurityPolicyRule, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/global/securityPolicies/%v/getRule", req.GetProject(), req.GetSecurityPolicy()) + + params := url.Values{} + if req != nil && req.Priority != nil { + params.Add("priority", fmt.Sprintf("%v", req.GetPriority())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.SecurityPolicyRule{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Insert creates a new policy in the specified project using the data included in the request. +func (c *securityPoliciesRESTClient) Insert(ctx context.Context, req *computepb.InsertSecurityPolicyRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetSecurityPolicyResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/global/securityPolicies", req.GetProject()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// List list all the policies that have been configured for the specified project. +func (c *securityPoliciesRESTClient) List(ctx context.Context, req *computepb.ListSecurityPoliciesRequest, opts ...gax.CallOption) (*computepb.SecurityPolicyList, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/global/securityPolicies", 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() + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.SecurityPolicyList{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// ListPreconfiguredExpressionSets gets the current list of preconfigured Web Application Firewall (WAF) expressions. +func (c *securityPoliciesRESTClient) ListPreconfiguredExpressionSets(ctx context.Context, req *computepb.ListPreconfiguredExpressionSetsSecurityPoliciesRequest, opts ...gax.CallOption) (*computepb.SecurityPoliciesListPreconfiguredExpressionSetsResponse, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/global/securityPolicies/listPreconfiguredExpressionSets", 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() + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.SecurityPoliciesListPreconfiguredExpressionSetsResponse{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Patch patches the specified policy with the data included in the request. This cannot be used to be update the rules in the policy. Please use the per rule methods like addRule, patchRule, and removeRule instead. +func (c *securityPoliciesRESTClient) Patch(ctx context.Context, req *computepb.PatchSecurityPolicyRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetSecurityPolicyResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/global/securityPolicies/%v", req.GetProject(), req.GetSecurityPolicy()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("PATCH", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// PatchRule patches a rule at the specified priority. +func (c *securityPoliciesRESTClient) PatchRule(ctx context.Context, req *computepb.PatchRuleSecurityPolicyRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetSecurityPolicyRuleResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/global/securityPolicies/%v/patchRule", req.GetProject(), req.GetSecurityPolicy()) + + params := url.Values{} + if req != nil && req.Priority != nil { + params.Add("priority", fmt.Sprintf("%v", req.GetPriority())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// RemoveRule deletes a rule at the specified priority. +func (c *securityPoliciesRESTClient) RemoveRule(ctx context.Context, req *computepb.RemoveRuleSecurityPolicyRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/global/securityPolicies/%v/removeRule", req.GetProject(), req.GetSecurityPolicy()) + + params := url.Values{} + if req != nil && req.Priority != nil { + params.Add("priority", fmt.Sprintf("%v", req.GetPriority())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} diff --git a/compute/apiv1/security_policies_client_example_test.go b/compute/apiv1/security_policies_client_example_test.go new file mode 100644 index 00000000000..65dbeb4fc52 --- /dev/null +++ b/compute/apiv1/security_policies_client_example_test.go @@ -0,0 +1,226 @@ +// Copyright 2021 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_test + +import ( + "context" + + compute "cloud.google.com/go/compute/apiv1" + computepb "google.golang.org/genproto/googleapis/cloud/compute/v1" +) + +func ExampleNewSecurityPoliciesRESTClient() { + ctx := context.Background() + c, err := compute.NewSecurityPoliciesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + // TODO: Use client. + _ = c +} + +func ExampleSecurityPoliciesClient_AddRule() { + ctx := context.Background() + c, err := compute.NewSecurityPoliciesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.AddRuleSecurityPolicyRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.AddRule(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleSecurityPoliciesClient_Delete() { + ctx := context.Background() + c, err := compute.NewSecurityPoliciesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.DeleteSecurityPolicyRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Delete(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleSecurityPoliciesClient_Get() { + ctx := context.Background() + c, err := compute.NewSecurityPoliciesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.GetSecurityPolicyRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Get(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleSecurityPoliciesClient_GetRule() { + ctx := context.Background() + c, err := compute.NewSecurityPoliciesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.GetRuleSecurityPolicyRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.GetRule(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleSecurityPoliciesClient_Insert() { + ctx := context.Background() + c, err := compute.NewSecurityPoliciesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.InsertSecurityPolicyRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Insert(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleSecurityPoliciesClient_List() { + ctx := context.Background() + c, err := compute.NewSecurityPoliciesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.ListSecurityPoliciesRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.List(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleSecurityPoliciesClient_ListPreconfiguredExpressionSets() { + ctx := context.Background() + c, err := compute.NewSecurityPoliciesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.ListPreconfiguredExpressionSetsSecurityPoliciesRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.ListPreconfiguredExpressionSets(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleSecurityPoliciesClient_Patch() { + ctx := context.Background() + c, err := compute.NewSecurityPoliciesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.PatchSecurityPolicyRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Patch(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleSecurityPoliciesClient_PatchRule() { + ctx := context.Background() + c, err := compute.NewSecurityPoliciesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.PatchRuleSecurityPolicyRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.PatchRule(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleSecurityPoliciesClient_RemoveRule() { + ctx := context.Background() + c, err := compute.NewSecurityPoliciesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.RemoveRuleSecurityPolicyRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.RemoveRule(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} diff --git a/compute/apiv1/snapshots_client.go b/compute/apiv1/snapshots_client.go new file mode 100644 index 00000000000..d95bf38a6f8 --- /dev/null +++ b/compute/apiv1/snapshots_client.go @@ -0,0 +1,536 @@ +// Copyright 2021 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/ioutil" + "net/http" + "net/url" + + gax "github.com/googleapis/gax-go/v2" + "google.golang.org/api/option" + "google.golang.org/api/option/internaloption" + httptransport "google.golang.org/api/transport/http" + computepb "google.golang.org/genproto/googleapis/cloud/compute/v1" + "google.golang.org/grpc" + "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/encoding/protojson" +) + +var newSnapshotsClientHook clientHook + +// SnapshotsCallOptions contains the retry settings for each method of SnapshotsClient. +type SnapshotsCallOptions struct { + Delete []gax.CallOption + Get []gax.CallOption + GetIamPolicy []gax.CallOption + List []gax.CallOption + SetIamPolicy []gax.CallOption + SetLabels []gax.CallOption + TestIamPermissions []gax.CallOption +} + +// internalSnapshotsClient is an interface that defines the methods availaible from Google Compute Engine API. +type internalSnapshotsClient interface { + Close() error + setGoogleClientInfo(...string) + Connection() *grpc.ClientConn + Delete(context.Context, *computepb.DeleteSnapshotRequest, ...gax.CallOption) (*computepb.Operation, error) + Get(context.Context, *computepb.GetSnapshotRequest, ...gax.CallOption) (*computepb.Snapshot, error) + GetIamPolicy(context.Context, *computepb.GetIamPolicySnapshotRequest, ...gax.CallOption) (*computepb.Policy, error) + List(context.Context, *computepb.ListSnapshotsRequest, ...gax.CallOption) (*computepb.SnapshotList, error) + SetIamPolicy(context.Context, *computepb.SetIamPolicySnapshotRequest, ...gax.CallOption) (*computepb.Policy, error) + SetLabels(context.Context, *computepb.SetLabelsSnapshotRequest, ...gax.CallOption) (*computepb.Operation, error) + TestIamPermissions(context.Context, *computepb.TestIamPermissionsSnapshotRequest, ...gax.CallOption) (*computepb.TestPermissionsResponse, error) +} + +// SnapshotsClient 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 Snapshots API. +type SnapshotsClient struct { + // The internal transport-dependent client. + internalClient internalSnapshotsClient + + // The call options for this service. + CallOptions *SnapshotsCallOptions +} + +// 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 *SnapshotsClient) 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 *SnapshotsClient) setGoogleClientInfo(keyval ...string) { + c.internalClient.setGoogleClientInfo(keyval...) +} + +// Connection returns a connection to the API service. +// +// Deprecated. +func (c *SnapshotsClient) Connection() *grpc.ClientConn { + return c.internalClient.Connection() +} + +// Delete deletes the specified Snapshot resource. Keep in mind that deleting a single snapshot might not necessarily delete all the data on that snapshot. If any data on the snapshot that is marked for deletion is needed for subsequent snapshots, the data will be moved to the next corresponding snapshot. +// +// For more information, see Deleting snapshots. +func (c *SnapshotsClient) Delete(ctx context.Context, req *computepb.DeleteSnapshotRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.Delete(ctx, req, opts...) +} + +// Get returns the specified Snapshot resource. Gets a list of available snapshots by making a list() request. +func (c *SnapshotsClient) Get(ctx context.Context, req *computepb.GetSnapshotRequest, opts ...gax.CallOption) (*computepb.Snapshot, error) { + 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 *SnapshotsClient) GetIamPolicy(ctx context.Context, req *computepb.GetIamPolicySnapshotRequest, opts ...gax.CallOption) (*computepb.Policy, error) { + return c.internalClient.GetIamPolicy(ctx, req, opts...) +} + +// List retrieves the list of Snapshot resources contained within the specified project. +func (c *SnapshotsClient) List(ctx context.Context, req *computepb.ListSnapshotsRequest, opts ...gax.CallOption) (*computepb.SnapshotList, error) { + return c.internalClient.List(ctx, req, opts...) +} + +// SetIamPolicy sets the access control policy on the specified resource. Replaces any existing policy. +func (c *SnapshotsClient) SetIamPolicy(ctx context.Context, req *computepb.SetIamPolicySnapshotRequest, opts ...gax.CallOption) (*computepb.Policy, error) { + return c.internalClient.SetIamPolicy(ctx, req, opts...) +} + +// SetLabels sets the labels on a snapshot. To learn more about labels, read the Labeling Resources documentation. +func (c *SnapshotsClient) SetLabels(ctx context.Context, req *computepb.SetLabelsSnapshotRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.SetLabels(ctx, req, opts...) +} + +// TestIamPermissions returns permissions that a caller has on the specified resource. +func (c *SnapshotsClient) TestIamPermissions(ctx context.Context, req *computepb.TestIamPermissionsSnapshotRequest, opts ...gax.CallOption) (*computepb.TestPermissionsResponse, error) { + return c.internalClient.TestIamPermissions(ctx, req, opts...) +} + +// Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls. +type snapshotsRESTClient struct { + // The http endpoint to connect to. + endpoint string + + // The http client. + httpClient *http.Client + + // The x-goog-* metadata to be sent with each request. + xGoogMetadata metadata.MD +} + +// NewSnapshotsRESTClient creates a new snapshots rest client. +// +// The Snapshots API. +func NewSnapshotsRESTClient(ctx context.Context, opts ...option.ClientOption) (*SnapshotsClient, error) { + clientOpts := append(defaultSnapshotsRESTClientOptions(), opts...) + httpClient, endpoint, err := httptransport.NewClient(ctx, clientOpts...) + if err != nil { + return nil, err + } + + c := &snapshotsRESTClient{ + endpoint: endpoint, + httpClient: httpClient, + } + c.setGoogleClientInfo() + + return &SnapshotsClient{internalClient: c, CallOptions: &SnapshotsCallOptions{}}, nil +} + +func defaultSnapshotsRESTClientOptions() []option.ClientOption { + return []option.ClientOption{ + internaloption.WithDefaultEndpoint("compute.googleapis.com"), + internaloption.WithDefaultMTLSEndpoint("compute.mtls.googleapis.com"), + internaloption.WithDefaultAudience("https://compute.googleapis.com/"), + internaloption.WithDefaultScopes(DefaultAuthScopes()...), + } +} + +// setGoogleClientInfo sets the name and version of the application in +// the `x-goog-api-client` header passed on each request. Intended for +// use by Google-written clients. +func (c *snapshotsRESTClient) setGoogleClientInfo(keyval ...string) { + kv := append([]string{"gl-go", versionGo()}, keyval...) + kv = append(kv, "gapic", versionClient, "gax", gax.Version, "rest", "UNKNOWN") + c.xGoogMetadata = metadata.Pairs("x-goog-api-client", gax.XGoogHeader(kv...)) +} + +// Close closes the connection to the API service. The user should invoke this when +// the client is no longer required. +func (c *snapshotsRESTClient) Close() error { + // Replace httpClient with nil to force cleanup. + c.httpClient = nil + return nil +} + +// Connection returns a connection to the API service. +// +// Deprecated. +func (c *snapshotsRESTClient) Connection() *grpc.ClientConn { + return nil +} + +// Delete deletes the specified Snapshot resource. Keep in mind that deleting a single snapshot might not necessarily delete all the data on that snapshot. If any data on the snapshot that is marked for deletion is needed for subsequent snapshots, the data will be moved to the next corresponding snapshot. +// +// For more information, see Deleting snapshots. +func (c *snapshotsRESTClient) Delete(ctx context.Context, req *computepb.DeleteSnapshotRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/global/snapshots/%v", req.GetProject(), req.GetSnapshot()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("DELETE", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Get returns the specified Snapshot resource. Gets a list of available snapshots by making a list() request. +func (c *snapshotsRESTClient) Get(ctx context.Context, req *computepb.GetSnapshotRequest, opts ...gax.CallOption) (*computepb.Snapshot, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/global/snapshots/%v", req.GetProject(), req.GetSnapshot()) + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Snapshot{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// GetIamPolicy gets the access control policy for a resource. May be empty if no such policy or resource exists. +func (c *snapshotsRESTClient) GetIamPolicy(ctx context.Context, req *computepb.GetIamPolicySnapshotRequest, opts ...gax.CallOption) (*computepb.Policy, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/global/snapshots/%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() + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Policy{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// List retrieves the list of Snapshot resources contained within the specified project. +func (c *snapshotsRESTClient) List(ctx context.Context, req *computepb.ListSnapshotsRequest, opts ...gax.CallOption) (*computepb.SnapshotList, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/global/snapshots", 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() + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.SnapshotList{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// SetIamPolicy sets the access control policy on the specified resource. Replaces any existing policy. +func (c *snapshotsRESTClient) SetIamPolicy(ctx context.Context, req *computepb.SetIamPolicySnapshotRequest, opts ...gax.CallOption) (*computepb.Policy, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetGlobalSetPolicyRequestResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/global/snapshots/%v/setIamPolicy", req.GetProject(), req.GetResource()) + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Policy{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// SetLabels sets the labels on a snapshot. To learn more about labels, read the Labeling Resources documentation. +func (c *snapshotsRESTClient) SetLabels(ctx context.Context, req *computepb.SetLabelsSnapshotRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetGlobalSetLabelsRequestResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/global/snapshots/%v/setLabels", req.GetProject(), req.GetResource()) + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// TestIamPermissions returns permissions that a caller has on the specified resource. +func (c *snapshotsRESTClient) TestIamPermissions(ctx context.Context, req *computepb.TestIamPermissionsSnapshotRequest, opts ...gax.CallOption) (*computepb.TestPermissionsResponse, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetTestPermissionsRequestResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/global/snapshots/%v/testIamPermissions", req.GetProject(), req.GetResource()) + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.TestPermissionsResponse{} + + return rsp, unm.Unmarshal(buf, rsp) +} diff --git a/compute/apiv1/snapshots_client_example_test.go b/compute/apiv1/snapshots_client_example_test.go new file mode 100644 index 00000000000..ebdb2d2c377 --- /dev/null +++ b/compute/apiv1/snapshots_client_example_test.go @@ -0,0 +1,169 @@ +// Copyright 2021 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_test + +import ( + "context" + + compute "cloud.google.com/go/compute/apiv1" + computepb "google.golang.org/genproto/googleapis/cloud/compute/v1" +) + +func ExampleNewSnapshotsRESTClient() { + ctx := context.Background() + c, err := compute.NewSnapshotsRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + // TODO: Use client. + _ = c +} + +func ExampleSnapshotsClient_Delete() { + ctx := context.Background() + c, err := compute.NewSnapshotsRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.DeleteSnapshotRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Delete(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleSnapshotsClient_Get() { + ctx := context.Background() + c, err := compute.NewSnapshotsRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.GetSnapshotRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Get(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleSnapshotsClient_GetIamPolicy() { + ctx := context.Background() + c, err := compute.NewSnapshotsRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.GetIamPolicySnapshotRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.GetIamPolicy(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleSnapshotsClient_List() { + ctx := context.Background() + c, err := compute.NewSnapshotsRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.ListSnapshotsRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.List(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleSnapshotsClient_SetIamPolicy() { + ctx := context.Background() + c, err := compute.NewSnapshotsRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.SetIamPolicySnapshotRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.SetIamPolicy(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleSnapshotsClient_SetLabels() { + ctx := context.Background() + c, err := compute.NewSnapshotsRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.SetLabelsSnapshotRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.SetLabels(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleSnapshotsClient_TestIamPermissions() { + ctx := context.Background() + c, err := compute.NewSnapshotsRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.TestIamPermissionsSnapshotRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.TestIamPermissions(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} diff --git a/compute/apiv1/ssl_certificates_client.go b/compute/apiv1/ssl_certificates_client.go new file mode 100644 index 00000000000..509741ea1e8 --- /dev/null +++ b/compute/apiv1/ssl_certificates_client.go @@ -0,0 +1,452 @@ +// Copyright 2021 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/ioutil" + "net/http" + "net/url" + + gax "github.com/googleapis/gax-go/v2" + "google.golang.org/api/option" + "google.golang.org/api/option/internaloption" + httptransport "google.golang.org/api/transport/http" + computepb "google.golang.org/genproto/googleapis/cloud/compute/v1" + "google.golang.org/grpc" + "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/encoding/protojson" +) + +var newSslCertificatesClientHook clientHook + +// SslCertificatesCallOptions contains the retry settings for each method of SslCertificatesClient. +type SslCertificatesCallOptions struct { + AggregatedList []gax.CallOption + Delete []gax.CallOption + Get []gax.CallOption + Insert []gax.CallOption + List []gax.CallOption +} + +// internalSslCertificatesClient is an interface that defines the methods availaible from Google Compute Engine API. +type internalSslCertificatesClient interface { + Close() error + setGoogleClientInfo(...string) + Connection() *grpc.ClientConn + AggregatedList(context.Context, *computepb.AggregatedListSslCertificatesRequest, ...gax.CallOption) (*computepb.SslCertificateAggregatedList, error) + Delete(context.Context, *computepb.DeleteSslCertificateRequest, ...gax.CallOption) (*computepb.Operation, error) + Get(context.Context, *computepb.GetSslCertificateRequest, ...gax.CallOption) (*computepb.SslCertificate, error) + Insert(context.Context, *computepb.InsertSslCertificateRequest, ...gax.CallOption) (*computepb.Operation, error) + List(context.Context, *computepb.ListSslCertificatesRequest, ...gax.CallOption) (*computepb.SslCertificateList, error) +} + +// SslCertificatesClient 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 SslCertificates API. +type SslCertificatesClient struct { + // The internal transport-dependent client. + internalClient internalSslCertificatesClient + + // The call options for this service. + CallOptions *SslCertificatesCallOptions +} + +// 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 *SslCertificatesClient) 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 *SslCertificatesClient) setGoogleClientInfo(keyval ...string) { + c.internalClient.setGoogleClientInfo(keyval...) +} + +// Connection returns a connection to the API service. +// +// Deprecated. +func (c *SslCertificatesClient) Connection() *grpc.ClientConn { + return c.internalClient.Connection() +} + +// AggregatedList retrieves the list of all SslCertificate resources, regional and global, available to the specified project. +func (c *SslCertificatesClient) AggregatedList(ctx context.Context, req *computepb.AggregatedListSslCertificatesRequest, opts ...gax.CallOption) (*computepb.SslCertificateAggregatedList, error) { + return c.internalClient.AggregatedList(ctx, req, opts...) +} + +// Delete deletes the specified SslCertificate resource. +func (c *SslCertificatesClient) Delete(ctx context.Context, req *computepb.DeleteSslCertificateRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.Delete(ctx, req, opts...) +} + +// Get returns the specified SslCertificate resource. Gets a list of available SSL certificates by making a list() request. +func (c *SslCertificatesClient) Get(ctx context.Context, req *computepb.GetSslCertificateRequest, opts ...gax.CallOption) (*computepb.SslCertificate, error) { + return c.internalClient.Get(ctx, req, opts...) +} + +// Insert creates a SslCertificate resource in the specified project using the data included in the request. +func (c *SslCertificatesClient) Insert(ctx context.Context, req *computepb.InsertSslCertificateRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.Insert(ctx, req, opts...) +} + +// List retrieves the list of SslCertificate resources available to the specified project. +func (c *SslCertificatesClient) List(ctx context.Context, req *computepb.ListSslCertificatesRequest, opts ...gax.CallOption) (*computepb.SslCertificateList, error) { + return c.internalClient.List(ctx, req, opts...) +} + +// Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls. +type sslCertificatesRESTClient struct { + // The http endpoint to connect to. + endpoint string + + // The http client. + httpClient *http.Client + + // The x-goog-* metadata to be sent with each request. + xGoogMetadata metadata.MD +} + +// NewSslCertificatesRESTClient creates a new ssl certificates rest client. +// +// The SslCertificates API. +func NewSslCertificatesRESTClient(ctx context.Context, opts ...option.ClientOption) (*SslCertificatesClient, error) { + clientOpts := append(defaultSslCertificatesRESTClientOptions(), opts...) + httpClient, endpoint, err := httptransport.NewClient(ctx, clientOpts...) + if err != nil { + return nil, err + } + + c := &sslCertificatesRESTClient{ + endpoint: endpoint, + httpClient: httpClient, + } + c.setGoogleClientInfo() + + return &SslCertificatesClient{internalClient: c, CallOptions: &SslCertificatesCallOptions{}}, nil +} + +func defaultSslCertificatesRESTClientOptions() []option.ClientOption { + return []option.ClientOption{ + internaloption.WithDefaultEndpoint("compute.googleapis.com"), + internaloption.WithDefaultMTLSEndpoint("compute.mtls.googleapis.com"), + internaloption.WithDefaultAudience("https://compute.googleapis.com/"), + internaloption.WithDefaultScopes(DefaultAuthScopes()...), + } +} + +// setGoogleClientInfo sets the name and version of the application in +// the `x-goog-api-client` header passed on each request. Intended for +// use by Google-written clients. +func (c *sslCertificatesRESTClient) setGoogleClientInfo(keyval ...string) { + kv := append([]string{"gl-go", versionGo()}, keyval...) + kv = append(kv, "gapic", versionClient, "gax", gax.Version, "rest", "UNKNOWN") + c.xGoogMetadata = metadata.Pairs("x-goog-api-client", gax.XGoogHeader(kv...)) +} + +// Close closes the connection to the API service. The user should invoke this when +// the client is no longer required. +func (c *sslCertificatesRESTClient) Close() error { + // Replace httpClient with nil to force cleanup. + c.httpClient = nil + return nil +} + +// Connection returns a connection to the API service. +// +// Deprecated. +func (c *sslCertificatesRESTClient) Connection() *grpc.ClientConn { + return nil +} + +// AggregatedList retrieves the list of all SslCertificate resources, regional and global, available to the specified project. +func (c *sslCertificatesRESTClient) AggregatedList(ctx context.Context, req *computepb.AggregatedListSslCertificatesRequest, opts ...gax.CallOption) (*computepb.SslCertificateAggregatedList, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/aggregated/sslCertificates", req.GetProject()) + + params := url.Values{} + if req != nil && req.Filter != nil { + params.Add("filter", fmt.Sprintf("%v", req.GetFilter())) + } + if req != nil && req.IncludeAllScopes != nil { + params.Add("includeAllScopes", fmt.Sprintf("%v", req.GetIncludeAllScopes())) + } + 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() + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.SslCertificateAggregatedList{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Delete deletes the specified SslCertificate resource. +func (c *sslCertificatesRESTClient) Delete(ctx context.Context, req *computepb.DeleteSslCertificateRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/global/sslCertificates/%v", req.GetProject(), req.GetSslCertificate()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("DELETE", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Get returns the specified SslCertificate resource. Gets a list of available SSL certificates by making a list() request. +func (c *sslCertificatesRESTClient) Get(ctx context.Context, req *computepb.GetSslCertificateRequest, opts ...gax.CallOption) (*computepb.SslCertificate, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/global/sslCertificates/%v", req.GetProject(), req.GetSslCertificate()) + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.SslCertificate{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Insert creates a SslCertificate resource in the specified project using the data included in the request. +func (c *sslCertificatesRESTClient) Insert(ctx context.Context, req *computepb.InsertSslCertificateRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetSslCertificateResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/global/sslCertificates", req.GetProject()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// List retrieves the list of SslCertificate resources available to the specified project. +func (c *sslCertificatesRESTClient) List(ctx context.Context, req *computepb.ListSslCertificatesRequest, opts ...gax.CallOption) (*computepb.SslCertificateList, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/global/sslCertificates", 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() + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.SslCertificateList{} + + return rsp, unm.Unmarshal(buf, rsp) +} diff --git a/compute/apiv1/ssl_certificates_client_example_test.go b/compute/apiv1/ssl_certificates_client_example_test.go new file mode 100644 index 00000000000..2859305e6cf --- /dev/null +++ b/compute/apiv1/ssl_certificates_client_example_test.go @@ -0,0 +1,131 @@ +// Copyright 2021 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_test + +import ( + "context" + + compute "cloud.google.com/go/compute/apiv1" + computepb "google.golang.org/genproto/googleapis/cloud/compute/v1" +) + +func ExampleNewSslCertificatesRESTClient() { + ctx := context.Background() + c, err := compute.NewSslCertificatesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + // TODO: Use client. + _ = c +} + +func ExampleSslCertificatesClient_AggregatedList() { + ctx := context.Background() + c, err := compute.NewSslCertificatesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.AggregatedListSslCertificatesRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.AggregatedList(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleSslCertificatesClient_Delete() { + ctx := context.Background() + c, err := compute.NewSslCertificatesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.DeleteSslCertificateRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Delete(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleSslCertificatesClient_Get() { + ctx := context.Background() + c, err := compute.NewSslCertificatesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.GetSslCertificateRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Get(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleSslCertificatesClient_Insert() { + ctx := context.Background() + c, err := compute.NewSslCertificatesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.InsertSslCertificateRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Insert(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleSslCertificatesClient_List() { + ctx := context.Background() + c, err := compute.NewSslCertificatesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.ListSslCertificatesRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.List(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} diff --git a/compute/apiv1/ssl_policies_client.go b/compute/apiv1/ssl_policies_client.go new file mode 100644 index 00000000000..b3ead7c8b80 --- /dev/null +++ b/compute/apiv1/ssl_policies_client.go @@ -0,0 +1,507 @@ +// Copyright 2021 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/ioutil" + "net/http" + "net/url" + + gax "github.com/googleapis/gax-go/v2" + "google.golang.org/api/option" + "google.golang.org/api/option/internaloption" + httptransport "google.golang.org/api/transport/http" + computepb "google.golang.org/genproto/googleapis/cloud/compute/v1" + "google.golang.org/grpc" + "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/encoding/protojson" +) + +var newSslPoliciesClientHook clientHook + +// SslPoliciesCallOptions contains the retry settings for each method of SslPoliciesClient. +type SslPoliciesCallOptions struct { + Delete []gax.CallOption + Get []gax.CallOption + Insert []gax.CallOption + List []gax.CallOption + ListAvailableFeatures []gax.CallOption + Patch []gax.CallOption +} + +// internalSslPoliciesClient is an interface that defines the methods availaible from Google Compute Engine API. +type internalSslPoliciesClient interface { + Close() error + setGoogleClientInfo(...string) + Connection() *grpc.ClientConn + Delete(context.Context, *computepb.DeleteSslPolicyRequest, ...gax.CallOption) (*computepb.Operation, error) + Get(context.Context, *computepb.GetSslPolicyRequest, ...gax.CallOption) (*computepb.SslPolicy, error) + Insert(context.Context, *computepb.InsertSslPolicyRequest, ...gax.CallOption) (*computepb.Operation, error) + List(context.Context, *computepb.ListSslPoliciesRequest, ...gax.CallOption) (*computepb.SslPoliciesList, error) + ListAvailableFeatures(context.Context, *computepb.ListAvailableFeaturesSslPoliciesRequest, ...gax.CallOption) (*computepb.SslPoliciesListAvailableFeaturesResponse, error) + Patch(context.Context, *computepb.PatchSslPolicyRequest, ...gax.CallOption) (*computepb.Operation, error) +} + +// SslPoliciesClient 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 SslPolicies API. +type SslPoliciesClient struct { + // The internal transport-dependent client. + internalClient internalSslPoliciesClient + + // The call options for this service. + CallOptions *SslPoliciesCallOptions +} + +// 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 *SslPoliciesClient) 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 *SslPoliciesClient) setGoogleClientInfo(keyval ...string) { + c.internalClient.setGoogleClientInfo(keyval...) +} + +// Connection returns a connection to the API service. +// +// Deprecated. +func (c *SslPoliciesClient) Connection() *grpc.ClientConn { + return c.internalClient.Connection() +} + +// Delete deletes the specified SSL policy. The SSL policy resource can be deleted only if it is not in use by any TargetHttpsProxy or TargetSslProxy resources. +func (c *SslPoliciesClient) Delete(ctx context.Context, req *computepb.DeleteSslPolicyRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.Delete(ctx, req, opts...) +} + +// Get lists all of the ordered rules present in a single specified policy. +func (c *SslPoliciesClient) Get(ctx context.Context, req *computepb.GetSslPolicyRequest, opts ...gax.CallOption) (*computepb.SslPolicy, error) { + return c.internalClient.Get(ctx, req, opts...) +} + +// Insert returns the specified SSL policy resource. Gets a list of available SSL policies by making a list() request. +func (c *SslPoliciesClient) Insert(ctx context.Context, req *computepb.InsertSslPolicyRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.Insert(ctx, req, opts...) +} + +// List lists all the SSL policies that have been configured for the specified project. +func (c *SslPoliciesClient) List(ctx context.Context, req *computepb.ListSslPoliciesRequest, opts ...gax.CallOption) (*computepb.SslPoliciesList, error) { + return c.internalClient.List(ctx, req, opts...) +} + +// ListAvailableFeatures lists all features that can be specified in the SSL policy when using custom profile. +func (c *SslPoliciesClient) ListAvailableFeatures(ctx context.Context, req *computepb.ListAvailableFeaturesSslPoliciesRequest, opts ...gax.CallOption) (*computepb.SslPoliciesListAvailableFeaturesResponse, error) { + return c.internalClient.ListAvailableFeatures(ctx, req, opts...) +} + +// Patch patches the specified SSL policy with the data included in the request. +func (c *SslPoliciesClient) Patch(ctx context.Context, req *computepb.PatchSslPolicyRequest, opts ...gax.CallOption) (*computepb.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 sslPoliciesRESTClient struct { + // The http endpoint to connect to. + endpoint string + + // The http client. + httpClient *http.Client + + // The x-goog-* metadata to be sent with each request. + xGoogMetadata metadata.MD +} + +// NewSslPoliciesRESTClient creates a new ssl policies rest client. +// +// The SslPolicies API. +func NewSslPoliciesRESTClient(ctx context.Context, opts ...option.ClientOption) (*SslPoliciesClient, error) { + clientOpts := append(defaultSslPoliciesRESTClientOptions(), opts...) + httpClient, endpoint, err := httptransport.NewClient(ctx, clientOpts...) + if err != nil { + return nil, err + } + + c := &sslPoliciesRESTClient{ + endpoint: endpoint, + httpClient: httpClient, + } + c.setGoogleClientInfo() + + return &SslPoliciesClient{internalClient: c, CallOptions: &SslPoliciesCallOptions{}}, nil +} + +func defaultSslPoliciesRESTClientOptions() []option.ClientOption { + return []option.ClientOption{ + internaloption.WithDefaultEndpoint("compute.googleapis.com"), + internaloption.WithDefaultMTLSEndpoint("compute.mtls.googleapis.com"), + internaloption.WithDefaultAudience("https://compute.googleapis.com/"), + internaloption.WithDefaultScopes(DefaultAuthScopes()...), + } +} + +// setGoogleClientInfo sets the name and version of the application in +// the `x-goog-api-client` header passed on each request. Intended for +// use by Google-written clients. +func (c *sslPoliciesRESTClient) setGoogleClientInfo(keyval ...string) { + kv := append([]string{"gl-go", versionGo()}, keyval...) + kv = append(kv, "gapic", versionClient, "gax", gax.Version, "rest", "UNKNOWN") + c.xGoogMetadata = metadata.Pairs("x-goog-api-client", gax.XGoogHeader(kv...)) +} + +// Close closes the connection to the API service. The user should invoke this when +// the client is no longer required. +func (c *sslPoliciesRESTClient) Close() error { + // Replace httpClient with nil to force cleanup. + c.httpClient = nil + return nil +} + +// Connection returns a connection to the API service. +// +// Deprecated. +func (c *sslPoliciesRESTClient) Connection() *grpc.ClientConn { + return nil +} + +// Delete deletes the specified SSL policy. The SSL policy resource can be deleted only if it is not in use by any TargetHttpsProxy or TargetSslProxy resources. +func (c *sslPoliciesRESTClient) Delete(ctx context.Context, req *computepb.DeleteSslPolicyRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/global/sslPolicies/%v", req.GetProject(), req.GetSslPolicy()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("DELETE", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Get lists all of the ordered rules present in a single specified policy. +func (c *sslPoliciesRESTClient) Get(ctx context.Context, req *computepb.GetSslPolicyRequest, opts ...gax.CallOption) (*computepb.SslPolicy, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/global/sslPolicies/%v", req.GetProject(), req.GetSslPolicy()) + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.SslPolicy{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Insert returns the specified SSL policy resource. Gets a list of available SSL policies by making a list() request. +func (c *sslPoliciesRESTClient) Insert(ctx context.Context, req *computepb.InsertSslPolicyRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetSslPolicyResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/global/sslPolicies", req.GetProject()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// List lists all the SSL policies that have been configured for the specified project. +func (c *sslPoliciesRESTClient) List(ctx context.Context, req *computepb.ListSslPoliciesRequest, opts ...gax.CallOption) (*computepb.SslPoliciesList, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/global/sslPolicies", 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() + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.SslPoliciesList{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// ListAvailableFeatures lists all features that can be specified in the SSL policy when using custom profile. +func (c *sslPoliciesRESTClient) ListAvailableFeatures(ctx context.Context, req *computepb.ListAvailableFeaturesSslPoliciesRequest, opts ...gax.CallOption) (*computepb.SslPoliciesListAvailableFeaturesResponse, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/global/sslPolicies/listAvailableFeatures", 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() + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.SslPoliciesListAvailableFeaturesResponse{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Patch patches the specified SSL policy with the data included in the request. +func (c *sslPoliciesRESTClient) Patch(ctx context.Context, req *computepb.PatchSslPolicyRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetSslPolicyResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/global/sslPolicies/%v", req.GetProject(), req.GetSslPolicy()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("PATCH", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} diff --git a/compute/apiv1/ssl_policies_client_example_test.go b/compute/apiv1/ssl_policies_client_example_test.go new file mode 100644 index 00000000000..a74e2832e04 --- /dev/null +++ b/compute/apiv1/ssl_policies_client_example_test.go @@ -0,0 +1,150 @@ +// Copyright 2021 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_test + +import ( + "context" + + compute "cloud.google.com/go/compute/apiv1" + computepb "google.golang.org/genproto/googleapis/cloud/compute/v1" +) + +func ExampleNewSslPoliciesRESTClient() { + ctx := context.Background() + c, err := compute.NewSslPoliciesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + // TODO: Use client. + _ = c +} + +func ExampleSslPoliciesClient_Delete() { + ctx := context.Background() + c, err := compute.NewSslPoliciesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.DeleteSslPolicyRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Delete(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleSslPoliciesClient_Get() { + ctx := context.Background() + c, err := compute.NewSslPoliciesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.GetSslPolicyRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Get(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleSslPoliciesClient_Insert() { + ctx := context.Background() + c, err := compute.NewSslPoliciesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.InsertSslPolicyRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Insert(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleSslPoliciesClient_List() { + ctx := context.Background() + c, err := compute.NewSslPoliciesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.ListSslPoliciesRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.List(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleSslPoliciesClient_ListAvailableFeatures() { + ctx := context.Background() + c, err := compute.NewSslPoliciesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.ListAvailableFeaturesSslPoliciesRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.ListAvailableFeatures(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleSslPoliciesClient_Patch() { + ctx := context.Background() + c, err := compute.NewSslPoliciesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.PatchSslPolicyRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Patch(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} diff --git a/compute/apiv1/subnetworks_client.go b/compute/apiv1/subnetworks_client.go new file mode 100644 index 00000000000..d0bcf696135 --- /dev/null +++ b/compute/apiv1/subnetworks_client.go @@ -0,0 +1,857 @@ +// Copyright 2021 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/ioutil" + "net/http" + "net/url" + + gax "github.com/googleapis/gax-go/v2" + "google.golang.org/api/option" + "google.golang.org/api/option/internaloption" + httptransport "google.golang.org/api/transport/http" + computepb "google.golang.org/genproto/googleapis/cloud/compute/v1" + "google.golang.org/grpc" + "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/encoding/protojson" +) + +var newSubnetworksClientHook clientHook + +// SubnetworksCallOptions contains the retry settings for each method of SubnetworksClient. +type SubnetworksCallOptions struct { + AggregatedList []gax.CallOption + Delete []gax.CallOption + ExpandIpCidrRange []gax.CallOption + Get []gax.CallOption + GetIamPolicy []gax.CallOption + Insert []gax.CallOption + List []gax.CallOption + ListUsable []gax.CallOption + Patch []gax.CallOption + SetIamPolicy []gax.CallOption + SetPrivateIpGoogleAccess []gax.CallOption + TestIamPermissions []gax.CallOption +} + +// internalSubnetworksClient is an interface that defines the methods availaible from Google Compute Engine API. +type internalSubnetworksClient interface { + Close() error + setGoogleClientInfo(...string) + Connection() *grpc.ClientConn + AggregatedList(context.Context, *computepb.AggregatedListSubnetworksRequest, ...gax.CallOption) (*computepb.SubnetworkAggregatedList, error) + Delete(context.Context, *computepb.DeleteSubnetworkRequest, ...gax.CallOption) (*computepb.Operation, error) + ExpandIpCidrRange(context.Context, *computepb.ExpandIpCidrRangeSubnetworkRequest, ...gax.CallOption) (*computepb.Operation, error) + Get(context.Context, *computepb.GetSubnetworkRequest, ...gax.CallOption) (*computepb.Subnetwork, error) + GetIamPolicy(context.Context, *computepb.GetIamPolicySubnetworkRequest, ...gax.CallOption) (*computepb.Policy, error) + Insert(context.Context, *computepb.InsertSubnetworkRequest, ...gax.CallOption) (*computepb.Operation, error) + List(context.Context, *computepb.ListSubnetworksRequest, ...gax.CallOption) (*computepb.SubnetworkList, error) + ListUsable(context.Context, *computepb.ListUsableSubnetworksRequest, ...gax.CallOption) (*computepb.UsableSubnetworksAggregatedList, error) + Patch(context.Context, *computepb.PatchSubnetworkRequest, ...gax.CallOption) (*computepb.Operation, error) + SetIamPolicy(context.Context, *computepb.SetIamPolicySubnetworkRequest, ...gax.CallOption) (*computepb.Policy, error) + SetPrivateIpGoogleAccess(context.Context, *computepb.SetPrivateIpGoogleAccessSubnetworkRequest, ...gax.CallOption) (*computepb.Operation, error) + TestIamPermissions(context.Context, *computepb.TestIamPermissionsSubnetworkRequest, ...gax.CallOption) (*computepb.TestPermissionsResponse, error) +} + +// SubnetworksClient 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 Subnetworks API. +type SubnetworksClient struct { + // The internal transport-dependent client. + internalClient internalSubnetworksClient + + // The call options for this service. + CallOptions *SubnetworksCallOptions +} + +// 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 *SubnetworksClient) 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 *SubnetworksClient) setGoogleClientInfo(keyval ...string) { + c.internalClient.setGoogleClientInfo(keyval...) +} + +// Connection returns a connection to the API service. +// +// Deprecated. +func (c *SubnetworksClient) Connection() *grpc.ClientConn { + return c.internalClient.Connection() +} + +// AggregatedList retrieves an aggregated list of subnetworks. +func (c *SubnetworksClient) AggregatedList(ctx context.Context, req *computepb.AggregatedListSubnetworksRequest, opts ...gax.CallOption) (*computepb.SubnetworkAggregatedList, error) { + return c.internalClient.AggregatedList(ctx, req, opts...) +} + +// Delete deletes the specified subnetwork. +func (c *SubnetworksClient) Delete(ctx context.Context, req *computepb.DeleteSubnetworkRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.Delete(ctx, req, opts...) +} + +// ExpandIpCidrRange expands the IP CIDR range of the subnetwork to a specified value. +func (c *SubnetworksClient) ExpandIpCidrRange(ctx context.Context, req *computepb.ExpandIpCidrRangeSubnetworkRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.ExpandIpCidrRange(ctx, req, opts...) +} + +// Get returns the specified subnetwork. Gets a list of available subnetworks list() request. +func (c *SubnetworksClient) Get(ctx context.Context, req *computepb.GetSubnetworkRequest, opts ...gax.CallOption) (*computepb.Subnetwork, error) { + 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 *SubnetworksClient) GetIamPolicy(ctx context.Context, req *computepb.GetIamPolicySubnetworkRequest, opts ...gax.CallOption) (*computepb.Policy, error) { + return c.internalClient.GetIamPolicy(ctx, req, opts...) +} + +// Insert creates a subnetwork in the specified project using the data included in the request. +func (c *SubnetworksClient) Insert(ctx context.Context, req *computepb.InsertSubnetworkRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.Insert(ctx, req, opts...) +} + +// List retrieves a list of subnetworks available to the specified project. +func (c *SubnetworksClient) List(ctx context.Context, req *computepb.ListSubnetworksRequest, opts ...gax.CallOption) (*computepb.SubnetworkList, error) { + return c.internalClient.List(ctx, req, opts...) +} + +// ListUsable retrieves an aggregated list of all usable subnetworks in the project. +func (c *SubnetworksClient) ListUsable(ctx context.Context, req *computepb.ListUsableSubnetworksRequest, opts ...gax.CallOption) (*computepb.UsableSubnetworksAggregatedList, error) { + return c.internalClient.ListUsable(ctx, req, opts...) +} + +// Patch patches the specified subnetwork with the data included in the request. Only certain fields can be updated with a patch request as indicated in the field descriptions. You must specify the current fingerprint of the subnetwork resource being patched. +func (c *SubnetworksClient) Patch(ctx context.Context, req *computepb.PatchSubnetworkRequest, opts ...gax.CallOption) (*computepb.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 *SubnetworksClient) SetIamPolicy(ctx context.Context, req *computepb.SetIamPolicySubnetworkRequest, opts ...gax.CallOption) (*computepb.Policy, error) { + return c.internalClient.SetIamPolicy(ctx, req, opts...) +} + +// SetPrivateIpGoogleAccess set whether VMs in this subnet can access Google services without assigning external IP addresses through Private Google Access. +func (c *SubnetworksClient) SetPrivateIpGoogleAccess(ctx context.Context, req *computepb.SetPrivateIpGoogleAccessSubnetworkRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.SetPrivateIpGoogleAccess(ctx, req, opts...) +} + +// TestIamPermissions returns permissions that a caller has on the specified resource. +func (c *SubnetworksClient) TestIamPermissions(ctx context.Context, req *computepb.TestIamPermissionsSubnetworkRequest, opts ...gax.CallOption) (*computepb.TestPermissionsResponse, error) { + return c.internalClient.TestIamPermissions(ctx, req, opts...) +} + +// Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls. +type subnetworksRESTClient struct { + // The http endpoint to connect to. + endpoint string + + // The http client. + httpClient *http.Client + + // The x-goog-* metadata to be sent with each request. + xGoogMetadata metadata.MD +} + +// NewSubnetworksRESTClient creates a new subnetworks rest client. +// +// The Subnetworks API. +func NewSubnetworksRESTClient(ctx context.Context, opts ...option.ClientOption) (*SubnetworksClient, error) { + clientOpts := append(defaultSubnetworksRESTClientOptions(), opts...) + httpClient, endpoint, err := httptransport.NewClient(ctx, clientOpts...) + if err != nil { + return nil, err + } + + c := &subnetworksRESTClient{ + endpoint: endpoint, + httpClient: httpClient, + } + c.setGoogleClientInfo() + + return &SubnetworksClient{internalClient: c, CallOptions: &SubnetworksCallOptions{}}, nil +} + +func defaultSubnetworksRESTClientOptions() []option.ClientOption { + return []option.ClientOption{ + internaloption.WithDefaultEndpoint("compute.googleapis.com"), + internaloption.WithDefaultMTLSEndpoint("compute.mtls.googleapis.com"), + internaloption.WithDefaultAudience("https://compute.googleapis.com/"), + internaloption.WithDefaultScopes(DefaultAuthScopes()...), + } +} + +// setGoogleClientInfo sets the name and version of the application in +// the `x-goog-api-client` header passed on each request. Intended for +// use by Google-written clients. +func (c *subnetworksRESTClient) setGoogleClientInfo(keyval ...string) { + kv := append([]string{"gl-go", versionGo()}, keyval...) + kv = append(kv, "gapic", versionClient, "gax", gax.Version, "rest", "UNKNOWN") + c.xGoogMetadata = metadata.Pairs("x-goog-api-client", gax.XGoogHeader(kv...)) +} + +// Close closes the connection to the API service. The user should invoke this when +// the client is no longer required. +func (c *subnetworksRESTClient) Close() error { + // Replace httpClient with nil to force cleanup. + c.httpClient = nil + return nil +} + +// Connection returns a connection to the API service. +// +// Deprecated. +func (c *subnetworksRESTClient) Connection() *grpc.ClientConn { + return nil +} + +// AggregatedList retrieves an aggregated list of subnetworks. +func (c *subnetworksRESTClient) AggregatedList(ctx context.Context, req *computepb.AggregatedListSubnetworksRequest, opts ...gax.CallOption) (*computepb.SubnetworkAggregatedList, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/aggregated/subnetworks", req.GetProject()) + + params := url.Values{} + if req != nil && req.Filter != nil { + params.Add("filter", fmt.Sprintf("%v", req.GetFilter())) + } + if req != nil && req.IncludeAllScopes != nil { + params.Add("includeAllScopes", fmt.Sprintf("%v", req.GetIncludeAllScopes())) + } + 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() + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.SubnetworkAggregatedList{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Delete deletes the specified subnetwork. +func (c *subnetworksRESTClient) Delete(ctx context.Context, req *computepb.DeleteSubnetworkRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/subnetworks/%v", req.GetProject(), req.GetRegion(), req.GetSubnetwork()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("DELETE", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// ExpandIpCidrRange expands the IP CIDR range of the subnetwork to a specified value. +func (c *subnetworksRESTClient) ExpandIpCidrRange(ctx context.Context, req *computepb.ExpandIpCidrRangeSubnetworkRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetSubnetworksExpandIpCidrRangeRequestResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/subnetworks/%v/expandIpCidrRange", req.GetProject(), req.GetRegion(), req.GetSubnetwork()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Get returns the specified subnetwork. Gets a list of available subnetworks list() request. +func (c *subnetworksRESTClient) Get(ctx context.Context, req *computepb.GetSubnetworkRequest, opts ...gax.CallOption) (*computepb.Subnetwork, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/subnetworks/%v", req.GetProject(), req.GetRegion(), req.GetSubnetwork()) + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Subnetwork{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// GetIamPolicy gets the access control policy for a resource. May be empty if no such policy or resource exists. +func (c *subnetworksRESTClient) GetIamPolicy(ctx context.Context, req *computepb.GetIamPolicySubnetworkRequest, opts ...gax.CallOption) (*computepb.Policy, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/subnetworks/%v/getIamPolicy", req.GetProject(), req.GetRegion(), req.GetResource()) + + params := url.Values{} + if req != nil && req.OptionsRequestedPolicyVersion != nil { + params.Add("optionsRequestedPolicyVersion", fmt.Sprintf("%v", req.GetOptionsRequestedPolicyVersion())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Policy{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Insert creates a subnetwork in the specified project using the data included in the request. +func (c *subnetworksRESTClient) Insert(ctx context.Context, req *computepb.InsertSubnetworkRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetSubnetworkResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/subnetworks", req.GetProject(), req.GetRegion()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// List retrieves a list of subnetworks available to the specified project. +func (c *subnetworksRESTClient) List(ctx context.Context, req *computepb.ListSubnetworksRequest, opts ...gax.CallOption) (*computepb.SubnetworkList, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/subnetworks", 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() + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.SubnetworkList{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// ListUsable retrieves an aggregated list of all usable subnetworks in the project. +func (c *subnetworksRESTClient) ListUsable(ctx context.Context, req *computepb.ListUsableSubnetworksRequest, opts ...gax.CallOption) (*computepb.UsableSubnetworksAggregatedList, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/aggregated/subnetworks/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() + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.UsableSubnetworksAggregatedList{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Patch patches the specified subnetwork with the data included in the request. Only certain fields can be updated with a patch request as indicated in the field descriptions. You must specify the current fingerprint of the subnetwork resource being patched. +func (c *subnetworksRESTClient) Patch(ctx context.Context, req *computepb.PatchSubnetworkRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetSubnetworkResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/subnetworks/%v", req.GetProject(), req.GetRegion(), req.GetSubnetwork()) + + params := url.Values{} + if req != nil && req.DrainTimeoutSeconds != nil { + params.Add("drainTimeoutSeconds", fmt.Sprintf("%v", req.GetDrainTimeoutSeconds())) + } + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("PATCH", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// SetIamPolicy sets the access control policy on the specified resource. Replaces any existing policy. +func (c *subnetworksRESTClient) SetIamPolicy(ctx context.Context, req *computepb.SetIamPolicySubnetworkRequest, opts ...gax.CallOption) (*computepb.Policy, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetRegionSetPolicyRequestResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/subnetworks/%v/setIamPolicy", req.GetProject(), req.GetRegion(), req.GetResource()) + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Policy{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// SetPrivateIpGoogleAccess set whether VMs in this subnet can access Google services without assigning external IP addresses through Private Google Access. +func (c *subnetworksRESTClient) SetPrivateIpGoogleAccess(ctx context.Context, req *computepb.SetPrivateIpGoogleAccessSubnetworkRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetSubnetworksSetPrivateIpGoogleAccessRequestResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/subnetworks/%v/setPrivateIpGoogleAccess", req.GetProject(), req.GetRegion(), req.GetSubnetwork()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// TestIamPermissions returns permissions that a caller has on the specified resource. +func (c *subnetworksRESTClient) TestIamPermissions(ctx context.Context, req *computepb.TestIamPermissionsSubnetworkRequest, opts ...gax.CallOption) (*computepb.TestPermissionsResponse, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetTestPermissionsRequestResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/subnetworks/%v/testIamPermissions", req.GetProject(), req.GetRegion(), req.GetResource()) + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.TestPermissionsResponse{} + + return rsp, unm.Unmarshal(buf, rsp) +} diff --git a/compute/apiv1/subnetworks_client_example_test.go b/compute/apiv1/subnetworks_client_example_test.go new file mode 100644 index 00000000000..c561c8311df --- /dev/null +++ b/compute/apiv1/subnetworks_client_example_test.go @@ -0,0 +1,264 @@ +// Copyright 2021 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_test + +import ( + "context" + + compute "cloud.google.com/go/compute/apiv1" + computepb "google.golang.org/genproto/googleapis/cloud/compute/v1" +) + +func ExampleNewSubnetworksRESTClient() { + ctx := context.Background() + c, err := compute.NewSubnetworksRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + // TODO: Use client. + _ = c +} + +func ExampleSubnetworksClient_AggregatedList() { + ctx := context.Background() + c, err := compute.NewSubnetworksRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.AggregatedListSubnetworksRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.AggregatedList(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleSubnetworksClient_Delete() { + ctx := context.Background() + c, err := compute.NewSubnetworksRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.DeleteSubnetworkRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Delete(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleSubnetworksClient_ExpandIpCidrRange() { + ctx := context.Background() + c, err := compute.NewSubnetworksRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.ExpandIpCidrRangeSubnetworkRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.ExpandIpCidrRange(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleSubnetworksClient_Get() { + ctx := context.Background() + c, err := compute.NewSubnetworksRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.GetSubnetworkRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Get(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleSubnetworksClient_GetIamPolicy() { + ctx := context.Background() + c, err := compute.NewSubnetworksRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.GetIamPolicySubnetworkRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.GetIamPolicy(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleSubnetworksClient_Insert() { + ctx := context.Background() + c, err := compute.NewSubnetworksRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.InsertSubnetworkRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Insert(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleSubnetworksClient_List() { + ctx := context.Background() + c, err := compute.NewSubnetworksRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.ListSubnetworksRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.List(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleSubnetworksClient_ListUsable() { + ctx := context.Background() + c, err := compute.NewSubnetworksRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.ListUsableSubnetworksRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.ListUsable(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleSubnetworksClient_Patch() { + ctx := context.Background() + c, err := compute.NewSubnetworksRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.PatchSubnetworkRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Patch(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleSubnetworksClient_SetIamPolicy() { + ctx := context.Background() + c, err := compute.NewSubnetworksRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.SetIamPolicySubnetworkRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.SetIamPolicy(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleSubnetworksClient_SetPrivateIpGoogleAccess() { + ctx := context.Background() + c, err := compute.NewSubnetworksRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.SetPrivateIpGoogleAccessSubnetworkRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.SetPrivateIpGoogleAccess(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleSubnetworksClient_TestIamPermissions() { + ctx := context.Background() + c, err := compute.NewSubnetworksRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.TestIamPermissionsSubnetworkRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.TestIamPermissions(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} diff --git a/compute/apiv1/target_grpc_proxies_client.go b/compute/apiv1/target_grpc_proxies_client.go new file mode 100644 index 00000000000..da17c2d17f9 --- /dev/null +++ b/compute/apiv1/target_grpc_proxies_client.go @@ -0,0 +1,438 @@ +// Copyright 2021 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/ioutil" + "net/http" + "net/url" + + gax "github.com/googleapis/gax-go/v2" + "google.golang.org/api/option" + "google.golang.org/api/option/internaloption" + httptransport "google.golang.org/api/transport/http" + computepb "google.golang.org/genproto/googleapis/cloud/compute/v1" + "google.golang.org/grpc" + "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/encoding/protojson" +) + +var newTargetGrpcProxiesClientHook clientHook + +// TargetGrpcProxiesCallOptions contains the retry settings for each method of TargetGrpcProxiesClient. +type TargetGrpcProxiesCallOptions struct { + Delete []gax.CallOption + Get []gax.CallOption + Insert []gax.CallOption + List []gax.CallOption + Patch []gax.CallOption +} + +// internalTargetGrpcProxiesClient is an interface that defines the methods availaible from Google Compute Engine API. +type internalTargetGrpcProxiesClient interface { + Close() error + setGoogleClientInfo(...string) + Connection() *grpc.ClientConn + Delete(context.Context, *computepb.DeleteTargetGrpcProxyRequest, ...gax.CallOption) (*computepb.Operation, error) + Get(context.Context, *computepb.GetTargetGrpcProxyRequest, ...gax.CallOption) (*computepb.TargetGrpcProxy, error) + Insert(context.Context, *computepb.InsertTargetGrpcProxyRequest, ...gax.CallOption) (*computepb.Operation, error) + List(context.Context, *computepb.ListTargetGrpcProxiesRequest, ...gax.CallOption) (*computepb.TargetGrpcProxyList, error) + Patch(context.Context, *computepb.PatchTargetGrpcProxyRequest, ...gax.CallOption) (*computepb.Operation, error) +} + +// TargetGrpcProxiesClient 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 TargetGrpcProxies API. +type TargetGrpcProxiesClient struct { + // The internal transport-dependent client. + internalClient internalTargetGrpcProxiesClient + + // The call options for this service. + CallOptions *TargetGrpcProxiesCallOptions +} + +// 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 *TargetGrpcProxiesClient) 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 *TargetGrpcProxiesClient) setGoogleClientInfo(keyval ...string) { + c.internalClient.setGoogleClientInfo(keyval...) +} + +// Connection returns a connection to the API service. +// +// Deprecated. +func (c *TargetGrpcProxiesClient) Connection() *grpc.ClientConn { + return c.internalClient.Connection() +} + +// Delete deletes the specified TargetGrpcProxy in the given scope +func (c *TargetGrpcProxiesClient) Delete(ctx context.Context, req *computepb.DeleteTargetGrpcProxyRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.Delete(ctx, req, opts...) +} + +// Get returns the specified TargetGrpcProxy resource in the given scope. +func (c *TargetGrpcProxiesClient) Get(ctx context.Context, req *computepb.GetTargetGrpcProxyRequest, opts ...gax.CallOption) (*computepb.TargetGrpcProxy, error) { + return c.internalClient.Get(ctx, req, opts...) +} + +// Insert creates a TargetGrpcProxy in the specified project in the given scope using the parameters that are included in the request. +func (c *TargetGrpcProxiesClient) Insert(ctx context.Context, req *computepb.InsertTargetGrpcProxyRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.Insert(ctx, req, opts...) +} + +// List lists the TargetGrpcProxies for a project in the given scope. +func (c *TargetGrpcProxiesClient) List(ctx context.Context, req *computepb.ListTargetGrpcProxiesRequest, opts ...gax.CallOption) (*computepb.TargetGrpcProxyList, error) { + return c.internalClient.List(ctx, req, opts...) +} + +// Patch patches the specified TargetGrpcProxy resource with the data included in the request. This method supports PATCH semantics and uses JSON merge patch format and processing rules. +func (c *TargetGrpcProxiesClient) Patch(ctx context.Context, req *computepb.PatchTargetGrpcProxyRequest, opts ...gax.CallOption) (*computepb.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 targetGrpcProxiesRESTClient struct { + // The http endpoint to connect to. + endpoint string + + // The http client. + httpClient *http.Client + + // The x-goog-* metadata to be sent with each request. + xGoogMetadata metadata.MD +} + +// NewTargetGrpcProxiesRESTClient creates a new target grpc proxies rest client. +// +// The TargetGrpcProxies API. +func NewTargetGrpcProxiesRESTClient(ctx context.Context, opts ...option.ClientOption) (*TargetGrpcProxiesClient, error) { + clientOpts := append(defaultTargetGrpcProxiesRESTClientOptions(), opts...) + httpClient, endpoint, err := httptransport.NewClient(ctx, clientOpts...) + if err != nil { + return nil, err + } + + c := &targetGrpcProxiesRESTClient{ + endpoint: endpoint, + httpClient: httpClient, + } + c.setGoogleClientInfo() + + return &TargetGrpcProxiesClient{internalClient: c, CallOptions: &TargetGrpcProxiesCallOptions{}}, nil +} + +func defaultTargetGrpcProxiesRESTClientOptions() []option.ClientOption { + return []option.ClientOption{ + internaloption.WithDefaultEndpoint("compute.googleapis.com"), + internaloption.WithDefaultMTLSEndpoint("compute.mtls.googleapis.com"), + internaloption.WithDefaultAudience("https://compute.googleapis.com/"), + internaloption.WithDefaultScopes(DefaultAuthScopes()...), + } +} + +// setGoogleClientInfo sets the name and version of the application in +// the `x-goog-api-client` header passed on each request. Intended for +// use by Google-written clients. +func (c *targetGrpcProxiesRESTClient) setGoogleClientInfo(keyval ...string) { + kv := append([]string{"gl-go", versionGo()}, keyval...) + kv = append(kv, "gapic", versionClient, "gax", gax.Version, "rest", "UNKNOWN") + c.xGoogMetadata = metadata.Pairs("x-goog-api-client", gax.XGoogHeader(kv...)) +} + +// Close closes the connection to the API service. The user should invoke this when +// the client is no longer required. +func (c *targetGrpcProxiesRESTClient) Close() error { + // Replace httpClient with nil to force cleanup. + c.httpClient = nil + return nil +} + +// Connection returns a connection to the API service. +// +// Deprecated. +func (c *targetGrpcProxiesRESTClient) Connection() *grpc.ClientConn { + return nil +} + +// Delete deletes the specified TargetGrpcProxy in the given scope +func (c *targetGrpcProxiesRESTClient) Delete(ctx context.Context, req *computepb.DeleteTargetGrpcProxyRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/global/targetGrpcProxies/%v", req.GetProject(), req.GetTargetGrpcProxy()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("DELETE", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Get returns the specified TargetGrpcProxy resource in the given scope. +func (c *targetGrpcProxiesRESTClient) Get(ctx context.Context, req *computepb.GetTargetGrpcProxyRequest, opts ...gax.CallOption) (*computepb.TargetGrpcProxy, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/global/targetGrpcProxies/%v", req.GetProject(), req.GetTargetGrpcProxy()) + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.TargetGrpcProxy{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Insert creates a TargetGrpcProxy in the specified project in the given scope using the parameters that are included in the request. +func (c *targetGrpcProxiesRESTClient) Insert(ctx context.Context, req *computepb.InsertTargetGrpcProxyRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetTargetGrpcProxyResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/global/targetGrpcProxies", req.GetProject()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// List lists the TargetGrpcProxies for a project in the given scope. +func (c *targetGrpcProxiesRESTClient) List(ctx context.Context, req *computepb.ListTargetGrpcProxiesRequest, opts ...gax.CallOption) (*computepb.TargetGrpcProxyList, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/global/targetGrpcProxies", 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() + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.TargetGrpcProxyList{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Patch patches the specified TargetGrpcProxy resource with the data included in the request. This method supports PATCH semantics and uses JSON merge patch format and processing rules. +func (c *targetGrpcProxiesRESTClient) Patch(ctx context.Context, req *computepb.PatchTargetGrpcProxyRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetTargetGrpcProxyResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/global/targetGrpcProxies/%v", req.GetProject(), req.GetTargetGrpcProxy()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("PATCH", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} diff --git a/compute/apiv1/target_grpc_proxies_client_example_test.go b/compute/apiv1/target_grpc_proxies_client_example_test.go new file mode 100644 index 00000000000..b1fdef19971 --- /dev/null +++ b/compute/apiv1/target_grpc_proxies_client_example_test.go @@ -0,0 +1,131 @@ +// Copyright 2021 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_test + +import ( + "context" + + compute "cloud.google.com/go/compute/apiv1" + computepb "google.golang.org/genproto/googleapis/cloud/compute/v1" +) + +func ExampleNewTargetGrpcProxiesRESTClient() { + ctx := context.Background() + c, err := compute.NewTargetGrpcProxiesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + // TODO: Use client. + _ = c +} + +func ExampleTargetGrpcProxiesClient_Delete() { + ctx := context.Background() + c, err := compute.NewTargetGrpcProxiesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.DeleteTargetGrpcProxyRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Delete(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleTargetGrpcProxiesClient_Get() { + ctx := context.Background() + c, err := compute.NewTargetGrpcProxiesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.GetTargetGrpcProxyRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Get(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleTargetGrpcProxiesClient_Insert() { + ctx := context.Background() + c, err := compute.NewTargetGrpcProxiesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.InsertTargetGrpcProxyRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Insert(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleTargetGrpcProxiesClient_List() { + ctx := context.Background() + c, err := compute.NewTargetGrpcProxiesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.ListTargetGrpcProxiesRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.List(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleTargetGrpcProxiesClient_Patch() { + ctx := context.Background() + c, err := compute.NewTargetGrpcProxiesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.PatchTargetGrpcProxyRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Patch(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} diff --git a/compute/apiv1/target_http_proxies_client.go b/compute/apiv1/target_http_proxies_client.go new file mode 100644 index 00000000000..a7dea19c74e --- /dev/null +++ b/compute/apiv1/target_http_proxies_client.go @@ -0,0 +1,568 @@ +// Copyright 2021 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/ioutil" + "net/http" + "net/url" + + gax "github.com/googleapis/gax-go/v2" + "google.golang.org/api/option" + "google.golang.org/api/option/internaloption" + httptransport "google.golang.org/api/transport/http" + computepb "google.golang.org/genproto/googleapis/cloud/compute/v1" + "google.golang.org/grpc" + "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/encoding/protojson" +) + +var newTargetHttpProxiesClientHook clientHook + +// TargetHttpProxiesCallOptions contains the retry settings for each method of TargetHttpProxiesClient. +type TargetHttpProxiesCallOptions struct { + AggregatedList []gax.CallOption + Delete []gax.CallOption + Get []gax.CallOption + Insert []gax.CallOption + List []gax.CallOption + Patch []gax.CallOption + SetUrlMap []gax.CallOption +} + +// internalTargetHttpProxiesClient is an interface that defines the methods availaible from Google Compute Engine API. +type internalTargetHttpProxiesClient interface { + Close() error + setGoogleClientInfo(...string) + Connection() *grpc.ClientConn + AggregatedList(context.Context, *computepb.AggregatedListTargetHttpProxiesRequest, ...gax.CallOption) (*computepb.TargetHttpProxyAggregatedList, error) + Delete(context.Context, *computepb.DeleteTargetHttpProxyRequest, ...gax.CallOption) (*computepb.Operation, error) + Get(context.Context, *computepb.GetTargetHttpProxyRequest, ...gax.CallOption) (*computepb.TargetHttpProxy, error) + Insert(context.Context, *computepb.InsertTargetHttpProxyRequest, ...gax.CallOption) (*computepb.Operation, error) + List(context.Context, *computepb.ListTargetHttpProxiesRequest, ...gax.CallOption) (*computepb.TargetHttpProxyList, error) + Patch(context.Context, *computepb.PatchTargetHttpProxyRequest, ...gax.CallOption) (*computepb.Operation, error) + SetUrlMap(context.Context, *computepb.SetUrlMapTargetHttpProxyRequest, ...gax.CallOption) (*computepb.Operation, error) +} + +// TargetHttpProxiesClient 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 TargetHttpProxies API. +type TargetHttpProxiesClient struct { + // The internal transport-dependent client. + internalClient internalTargetHttpProxiesClient + + // The call options for this service. + CallOptions *TargetHttpProxiesCallOptions +} + +// 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 *TargetHttpProxiesClient) 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 *TargetHttpProxiesClient) setGoogleClientInfo(keyval ...string) { + c.internalClient.setGoogleClientInfo(keyval...) +} + +// Connection returns a connection to the API service. +// +// Deprecated. +func (c *TargetHttpProxiesClient) Connection() *grpc.ClientConn { + return c.internalClient.Connection() +} + +// AggregatedList retrieves the list of all TargetHttpProxy resources, regional and global, available to the specified project. +func (c *TargetHttpProxiesClient) AggregatedList(ctx context.Context, req *computepb.AggregatedListTargetHttpProxiesRequest, opts ...gax.CallOption) (*computepb.TargetHttpProxyAggregatedList, error) { + return c.internalClient.AggregatedList(ctx, req, opts...) +} + +// Delete deletes the specified TargetHttpProxy resource. +func (c *TargetHttpProxiesClient) Delete(ctx context.Context, req *computepb.DeleteTargetHttpProxyRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.Delete(ctx, req, opts...) +} + +// Get returns the specified TargetHttpProxy resource. Gets a list of available target HTTP proxies by making a list() request. +func (c *TargetHttpProxiesClient) Get(ctx context.Context, req *computepb.GetTargetHttpProxyRequest, opts ...gax.CallOption) (*computepb.TargetHttpProxy, error) { + return c.internalClient.Get(ctx, req, opts...) +} + +// Insert creates a TargetHttpProxy resource in the specified project using the data included in the request. +func (c *TargetHttpProxiesClient) Insert(ctx context.Context, req *computepb.InsertTargetHttpProxyRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.Insert(ctx, req, opts...) +} + +// List retrieves the list of TargetHttpProxy resources available to the specified project. +func (c *TargetHttpProxiesClient) List(ctx context.Context, req *computepb.ListTargetHttpProxiesRequest, opts ...gax.CallOption) (*computepb.TargetHttpProxyList, error) { + return c.internalClient.List(ctx, req, opts...) +} + +// Patch patches the specified TargetHttpProxy resource with the data included in the request. This method supports PATCH semantics and uses JSON merge patch format and processing rules. (== suppress_warning http-rest-shadowed ==) +func (c *TargetHttpProxiesClient) Patch(ctx context.Context, req *computepb.PatchTargetHttpProxyRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.Patch(ctx, req, opts...) +} + +// SetUrlMap changes the URL map for TargetHttpProxy. +func (c *TargetHttpProxiesClient) SetUrlMap(ctx context.Context, req *computepb.SetUrlMapTargetHttpProxyRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.SetUrlMap(ctx, req, opts...) +} + +// Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls. +type targetHttpProxiesRESTClient struct { + // The http endpoint to connect to. + endpoint string + + // The http client. + httpClient *http.Client + + // The x-goog-* metadata to be sent with each request. + xGoogMetadata metadata.MD +} + +// NewTargetHttpProxiesRESTClient creates a new target http proxies rest client. +// +// The TargetHttpProxies API. +func NewTargetHttpProxiesRESTClient(ctx context.Context, opts ...option.ClientOption) (*TargetHttpProxiesClient, error) { + clientOpts := append(defaultTargetHttpProxiesRESTClientOptions(), opts...) + httpClient, endpoint, err := httptransport.NewClient(ctx, clientOpts...) + if err != nil { + return nil, err + } + + c := &targetHttpProxiesRESTClient{ + endpoint: endpoint, + httpClient: httpClient, + } + c.setGoogleClientInfo() + + return &TargetHttpProxiesClient{internalClient: c, CallOptions: &TargetHttpProxiesCallOptions{}}, nil +} + +func defaultTargetHttpProxiesRESTClientOptions() []option.ClientOption { + return []option.ClientOption{ + internaloption.WithDefaultEndpoint("compute.googleapis.com"), + internaloption.WithDefaultMTLSEndpoint("compute.mtls.googleapis.com"), + internaloption.WithDefaultAudience("https://compute.googleapis.com/"), + internaloption.WithDefaultScopes(DefaultAuthScopes()...), + } +} + +// setGoogleClientInfo sets the name and version of the application in +// the `x-goog-api-client` header passed on each request. Intended for +// use by Google-written clients. +func (c *targetHttpProxiesRESTClient) setGoogleClientInfo(keyval ...string) { + kv := append([]string{"gl-go", versionGo()}, keyval...) + kv = append(kv, "gapic", versionClient, "gax", gax.Version, "rest", "UNKNOWN") + c.xGoogMetadata = metadata.Pairs("x-goog-api-client", gax.XGoogHeader(kv...)) +} + +// Close closes the connection to the API service. The user should invoke this when +// the client is no longer required. +func (c *targetHttpProxiesRESTClient) Close() error { + // Replace httpClient with nil to force cleanup. + c.httpClient = nil + return nil +} + +// Connection returns a connection to the API service. +// +// Deprecated. +func (c *targetHttpProxiesRESTClient) Connection() *grpc.ClientConn { + return nil +} + +// AggregatedList retrieves the list of all TargetHttpProxy resources, regional and global, available to the specified project. +func (c *targetHttpProxiesRESTClient) AggregatedList(ctx context.Context, req *computepb.AggregatedListTargetHttpProxiesRequest, opts ...gax.CallOption) (*computepb.TargetHttpProxyAggregatedList, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/aggregated/targetHttpProxies", req.GetProject()) + + params := url.Values{} + if req != nil && req.Filter != nil { + params.Add("filter", fmt.Sprintf("%v", req.GetFilter())) + } + if req != nil && req.IncludeAllScopes != nil { + params.Add("includeAllScopes", fmt.Sprintf("%v", req.GetIncludeAllScopes())) + } + 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() + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.TargetHttpProxyAggregatedList{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Delete deletes the specified TargetHttpProxy resource. +func (c *targetHttpProxiesRESTClient) Delete(ctx context.Context, req *computepb.DeleteTargetHttpProxyRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/global/targetHttpProxies/%v", req.GetProject(), req.GetTargetHttpProxy()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("DELETE", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Get returns the specified TargetHttpProxy resource. Gets a list of available target HTTP proxies by making a list() request. +func (c *targetHttpProxiesRESTClient) Get(ctx context.Context, req *computepb.GetTargetHttpProxyRequest, opts ...gax.CallOption) (*computepb.TargetHttpProxy, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/global/targetHttpProxies/%v", req.GetProject(), req.GetTargetHttpProxy()) + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.TargetHttpProxy{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Insert creates a TargetHttpProxy resource in the specified project using the data included in the request. +func (c *targetHttpProxiesRESTClient) Insert(ctx context.Context, req *computepb.InsertTargetHttpProxyRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetTargetHttpProxyResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/global/targetHttpProxies", req.GetProject()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// List retrieves the list of TargetHttpProxy resources available to the specified project. +func (c *targetHttpProxiesRESTClient) List(ctx context.Context, req *computepb.ListTargetHttpProxiesRequest, opts ...gax.CallOption) (*computepb.TargetHttpProxyList, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/global/targetHttpProxies", 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() + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.TargetHttpProxyList{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Patch patches the specified TargetHttpProxy resource with the data included in the request. This method supports PATCH semantics and uses JSON merge patch format and processing rules. (== suppress_warning http-rest-shadowed ==) +func (c *targetHttpProxiesRESTClient) Patch(ctx context.Context, req *computepb.PatchTargetHttpProxyRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetTargetHttpProxyResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/global/targetHttpProxies/%v", req.GetProject(), req.GetTargetHttpProxy()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("PATCH", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// SetUrlMap changes the URL map for TargetHttpProxy. +func (c *targetHttpProxiesRESTClient) SetUrlMap(ctx context.Context, req *computepb.SetUrlMapTargetHttpProxyRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetUrlMapReferenceResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/targetHttpProxies/%v/setUrlMap", req.GetProject(), req.GetTargetHttpProxy()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} diff --git a/compute/apiv1/target_http_proxies_client_example_test.go b/compute/apiv1/target_http_proxies_client_example_test.go new file mode 100644 index 00000000000..07d31ff9562 --- /dev/null +++ b/compute/apiv1/target_http_proxies_client_example_test.go @@ -0,0 +1,169 @@ +// Copyright 2021 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_test + +import ( + "context" + + compute "cloud.google.com/go/compute/apiv1" + computepb "google.golang.org/genproto/googleapis/cloud/compute/v1" +) + +func ExampleNewTargetHttpProxiesRESTClient() { + ctx := context.Background() + c, err := compute.NewTargetHttpProxiesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + // TODO: Use client. + _ = c +} + +func ExampleTargetHttpProxiesClient_AggregatedList() { + ctx := context.Background() + c, err := compute.NewTargetHttpProxiesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.AggregatedListTargetHttpProxiesRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.AggregatedList(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleTargetHttpProxiesClient_Delete() { + ctx := context.Background() + c, err := compute.NewTargetHttpProxiesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.DeleteTargetHttpProxyRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Delete(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleTargetHttpProxiesClient_Get() { + ctx := context.Background() + c, err := compute.NewTargetHttpProxiesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.GetTargetHttpProxyRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Get(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleTargetHttpProxiesClient_Insert() { + ctx := context.Background() + c, err := compute.NewTargetHttpProxiesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.InsertTargetHttpProxyRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Insert(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleTargetHttpProxiesClient_List() { + ctx := context.Background() + c, err := compute.NewTargetHttpProxiesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.ListTargetHttpProxiesRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.List(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleTargetHttpProxiesClient_Patch() { + ctx := context.Background() + c, err := compute.NewTargetHttpProxiesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.PatchTargetHttpProxyRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Patch(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleTargetHttpProxiesClient_SetUrlMap() { + ctx := context.Background() + c, err := compute.NewTargetHttpProxiesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.SetUrlMapTargetHttpProxyRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.SetUrlMap(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} diff --git a/compute/apiv1/target_https_proxies_client.go b/compute/apiv1/target_https_proxies_client.go new file mode 100644 index 00000000000..c2af2689ab4 --- /dev/null +++ b/compute/apiv1/target_https_proxies_client.go @@ -0,0 +1,742 @@ +// Copyright 2021 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/ioutil" + "net/http" + "net/url" + + gax "github.com/googleapis/gax-go/v2" + "google.golang.org/api/option" + "google.golang.org/api/option/internaloption" + httptransport "google.golang.org/api/transport/http" + computepb "google.golang.org/genproto/googleapis/cloud/compute/v1" + "google.golang.org/grpc" + "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/encoding/protojson" +) + +var newTargetHttpsProxiesClientHook clientHook + +// TargetHttpsProxiesCallOptions contains the retry settings for each method of TargetHttpsProxiesClient. +type TargetHttpsProxiesCallOptions struct { + AggregatedList []gax.CallOption + Delete []gax.CallOption + Get []gax.CallOption + Insert []gax.CallOption + List []gax.CallOption + Patch []gax.CallOption + SetQuicOverride []gax.CallOption + SetSslCertificates []gax.CallOption + SetSslPolicy []gax.CallOption + SetUrlMap []gax.CallOption +} + +// internalTargetHttpsProxiesClient is an interface that defines the methods availaible from Google Compute Engine API. +type internalTargetHttpsProxiesClient interface { + Close() error + setGoogleClientInfo(...string) + Connection() *grpc.ClientConn + AggregatedList(context.Context, *computepb.AggregatedListTargetHttpsProxiesRequest, ...gax.CallOption) (*computepb.TargetHttpsProxyAggregatedList, error) + Delete(context.Context, *computepb.DeleteTargetHttpsProxyRequest, ...gax.CallOption) (*computepb.Operation, error) + Get(context.Context, *computepb.GetTargetHttpsProxyRequest, ...gax.CallOption) (*computepb.TargetHttpsProxy, error) + Insert(context.Context, *computepb.InsertTargetHttpsProxyRequest, ...gax.CallOption) (*computepb.Operation, error) + List(context.Context, *computepb.ListTargetHttpsProxiesRequest, ...gax.CallOption) (*computepb.TargetHttpsProxyList, error) + Patch(context.Context, *computepb.PatchTargetHttpsProxyRequest, ...gax.CallOption) (*computepb.Operation, error) + SetQuicOverride(context.Context, *computepb.SetQuicOverrideTargetHttpsProxyRequest, ...gax.CallOption) (*computepb.Operation, error) + SetSslCertificates(context.Context, *computepb.SetSslCertificatesTargetHttpsProxyRequest, ...gax.CallOption) (*computepb.Operation, error) + SetSslPolicy(context.Context, *computepb.SetSslPolicyTargetHttpsProxyRequest, ...gax.CallOption) (*computepb.Operation, error) + SetUrlMap(context.Context, *computepb.SetUrlMapTargetHttpsProxyRequest, ...gax.CallOption) (*computepb.Operation, error) +} + +// TargetHttpsProxiesClient 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 TargetHttpsProxies API. +type TargetHttpsProxiesClient struct { + // The internal transport-dependent client. + internalClient internalTargetHttpsProxiesClient + + // The call options for this service. + CallOptions *TargetHttpsProxiesCallOptions +} + +// 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 *TargetHttpsProxiesClient) 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 *TargetHttpsProxiesClient) setGoogleClientInfo(keyval ...string) { + c.internalClient.setGoogleClientInfo(keyval...) +} + +// Connection returns a connection to the API service. +// +// Deprecated. +func (c *TargetHttpsProxiesClient) Connection() *grpc.ClientConn { + return c.internalClient.Connection() +} + +// AggregatedList retrieves the list of all TargetHttpsProxy resources, regional and global, available to the specified project. +func (c *TargetHttpsProxiesClient) AggregatedList(ctx context.Context, req *computepb.AggregatedListTargetHttpsProxiesRequest, opts ...gax.CallOption) (*computepb.TargetHttpsProxyAggregatedList, error) { + return c.internalClient.AggregatedList(ctx, req, opts...) +} + +// Delete deletes the specified TargetHttpsProxy resource. +func (c *TargetHttpsProxiesClient) Delete(ctx context.Context, req *computepb.DeleteTargetHttpsProxyRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.Delete(ctx, req, opts...) +} + +// Get returns the specified TargetHttpsProxy resource. Gets a list of available target HTTPS proxies by making a list() request. +func (c *TargetHttpsProxiesClient) Get(ctx context.Context, req *computepb.GetTargetHttpsProxyRequest, opts ...gax.CallOption) (*computepb.TargetHttpsProxy, error) { + return c.internalClient.Get(ctx, req, opts...) +} + +// Insert creates a TargetHttpsProxy resource in the specified project using the data included in the request. +func (c *TargetHttpsProxiesClient) Insert(ctx context.Context, req *computepb.InsertTargetHttpsProxyRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.Insert(ctx, req, opts...) +} + +// List retrieves the list of TargetHttpsProxy resources available to the specified project. +func (c *TargetHttpsProxiesClient) List(ctx context.Context, req *computepb.ListTargetHttpsProxiesRequest, opts ...gax.CallOption) (*computepb.TargetHttpsProxyList, error) { + return c.internalClient.List(ctx, req, opts...) +} + +// Patch patches the specified TargetHttpsProxy resource with the data included in the request. This method supports PATCH semantics and uses JSON merge patch format and processing rules. (== suppress_warning http-rest-shadowed ==) +func (c *TargetHttpsProxiesClient) Patch(ctx context.Context, req *computepb.PatchTargetHttpsProxyRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.Patch(ctx, req, opts...) +} + +// SetQuicOverride sets the QUIC override policy for TargetHttpsProxy. +func (c *TargetHttpsProxiesClient) SetQuicOverride(ctx context.Context, req *computepb.SetQuicOverrideTargetHttpsProxyRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.SetQuicOverride(ctx, req, opts...) +} + +// SetSslCertificates replaces SslCertificates for TargetHttpsProxy. +func (c *TargetHttpsProxiesClient) SetSslCertificates(ctx context.Context, req *computepb.SetSslCertificatesTargetHttpsProxyRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.SetSslCertificates(ctx, req, opts...) +} + +// SetSslPolicy sets the SSL policy for TargetHttpsProxy. The SSL policy specifies the server-side support for SSL features. This affects connections between clients and the HTTPS proxy load balancer. They do not affect the connection between the load balancer and the backends. +func (c *TargetHttpsProxiesClient) SetSslPolicy(ctx context.Context, req *computepb.SetSslPolicyTargetHttpsProxyRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.SetSslPolicy(ctx, req, opts...) +} + +// SetUrlMap changes the URL map for TargetHttpsProxy. +func (c *TargetHttpsProxiesClient) SetUrlMap(ctx context.Context, req *computepb.SetUrlMapTargetHttpsProxyRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.SetUrlMap(ctx, req, opts...) +} + +// Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls. +type targetHttpsProxiesRESTClient struct { + // The http endpoint to connect to. + endpoint string + + // The http client. + httpClient *http.Client + + // The x-goog-* metadata to be sent with each request. + xGoogMetadata metadata.MD +} + +// NewTargetHttpsProxiesRESTClient creates a new target https proxies rest client. +// +// The TargetHttpsProxies API. +func NewTargetHttpsProxiesRESTClient(ctx context.Context, opts ...option.ClientOption) (*TargetHttpsProxiesClient, error) { + clientOpts := append(defaultTargetHttpsProxiesRESTClientOptions(), opts...) + httpClient, endpoint, err := httptransport.NewClient(ctx, clientOpts...) + if err != nil { + return nil, err + } + + c := &targetHttpsProxiesRESTClient{ + endpoint: endpoint, + httpClient: httpClient, + } + c.setGoogleClientInfo() + + return &TargetHttpsProxiesClient{internalClient: c, CallOptions: &TargetHttpsProxiesCallOptions{}}, nil +} + +func defaultTargetHttpsProxiesRESTClientOptions() []option.ClientOption { + return []option.ClientOption{ + internaloption.WithDefaultEndpoint("compute.googleapis.com"), + internaloption.WithDefaultMTLSEndpoint("compute.mtls.googleapis.com"), + internaloption.WithDefaultAudience("https://compute.googleapis.com/"), + internaloption.WithDefaultScopes(DefaultAuthScopes()...), + } +} + +// setGoogleClientInfo sets the name and version of the application in +// the `x-goog-api-client` header passed on each request. Intended for +// use by Google-written clients. +func (c *targetHttpsProxiesRESTClient) setGoogleClientInfo(keyval ...string) { + kv := append([]string{"gl-go", versionGo()}, keyval...) + kv = append(kv, "gapic", versionClient, "gax", gax.Version, "rest", "UNKNOWN") + c.xGoogMetadata = metadata.Pairs("x-goog-api-client", gax.XGoogHeader(kv...)) +} + +// Close closes the connection to the API service. The user should invoke this when +// the client is no longer required. +func (c *targetHttpsProxiesRESTClient) Close() error { + // Replace httpClient with nil to force cleanup. + c.httpClient = nil + return nil +} + +// Connection returns a connection to the API service. +// +// Deprecated. +func (c *targetHttpsProxiesRESTClient) Connection() *grpc.ClientConn { + return nil +} + +// AggregatedList retrieves the list of all TargetHttpsProxy resources, regional and global, available to the specified project. +func (c *targetHttpsProxiesRESTClient) AggregatedList(ctx context.Context, req *computepb.AggregatedListTargetHttpsProxiesRequest, opts ...gax.CallOption) (*computepb.TargetHttpsProxyAggregatedList, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/aggregated/targetHttpsProxies", req.GetProject()) + + params := url.Values{} + if req != nil && req.Filter != nil { + params.Add("filter", fmt.Sprintf("%v", req.GetFilter())) + } + if req != nil && req.IncludeAllScopes != nil { + params.Add("includeAllScopes", fmt.Sprintf("%v", req.GetIncludeAllScopes())) + } + 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() + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.TargetHttpsProxyAggregatedList{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Delete deletes the specified TargetHttpsProxy resource. +func (c *targetHttpsProxiesRESTClient) Delete(ctx context.Context, req *computepb.DeleteTargetHttpsProxyRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/global/targetHttpsProxies/%v", req.GetProject(), req.GetTargetHttpsProxy()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("DELETE", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Get returns the specified TargetHttpsProxy resource. Gets a list of available target HTTPS proxies by making a list() request. +func (c *targetHttpsProxiesRESTClient) Get(ctx context.Context, req *computepb.GetTargetHttpsProxyRequest, opts ...gax.CallOption) (*computepb.TargetHttpsProxy, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/global/targetHttpsProxies/%v", req.GetProject(), req.GetTargetHttpsProxy()) + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.TargetHttpsProxy{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Insert creates a TargetHttpsProxy resource in the specified project using the data included in the request. +func (c *targetHttpsProxiesRESTClient) Insert(ctx context.Context, req *computepb.InsertTargetHttpsProxyRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetTargetHttpsProxyResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/global/targetHttpsProxies", req.GetProject()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// List retrieves the list of TargetHttpsProxy resources available to the specified project. +func (c *targetHttpsProxiesRESTClient) List(ctx context.Context, req *computepb.ListTargetHttpsProxiesRequest, opts ...gax.CallOption) (*computepb.TargetHttpsProxyList, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/global/targetHttpsProxies", 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() + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.TargetHttpsProxyList{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Patch patches the specified TargetHttpsProxy resource with the data included in the request. This method supports PATCH semantics and uses JSON merge patch format and processing rules. (== suppress_warning http-rest-shadowed ==) +func (c *targetHttpsProxiesRESTClient) Patch(ctx context.Context, req *computepb.PatchTargetHttpsProxyRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetTargetHttpsProxyResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/global/targetHttpsProxies/%v", req.GetProject(), req.GetTargetHttpsProxy()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("PATCH", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// SetQuicOverride sets the QUIC override policy for TargetHttpsProxy. +func (c *targetHttpsProxiesRESTClient) SetQuicOverride(ctx context.Context, req *computepb.SetQuicOverrideTargetHttpsProxyRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetTargetHttpsProxiesSetQuicOverrideRequestResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/global/targetHttpsProxies/%v/setQuicOverride", req.GetProject(), req.GetTargetHttpsProxy()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// SetSslCertificates replaces SslCertificates for TargetHttpsProxy. +func (c *targetHttpsProxiesRESTClient) SetSslCertificates(ctx context.Context, req *computepb.SetSslCertificatesTargetHttpsProxyRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetTargetHttpsProxiesSetSslCertificatesRequestResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/targetHttpsProxies/%v/setSslCertificates", req.GetProject(), req.GetTargetHttpsProxy()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// SetSslPolicy sets the SSL policy for TargetHttpsProxy. The SSL policy specifies the server-side support for SSL features. This affects connections between clients and the HTTPS proxy load balancer. They do not affect the connection between the load balancer and the backends. +func (c *targetHttpsProxiesRESTClient) SetSslPolicy(ctx context.Context, req *computepb.SetSslPolicyTargetHttpsProxyRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetSslPolicyReferenceResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/global/targetHttpsProxies/%v/setSslPolicy", req.GetProject(), req.GetTargetHttpsProxy()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// SetUrlMap changes the URL map for TargetHttpsProxy. +func (c *targetHttpsProxiesRESTClient) SetUrlMap(ctx context.Context, req *computepb.SetUrlMapTargetHttpsProxyRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetUrlMapReferenceResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/targetHttpsProxies/%v/setUrlMap", req.GetProject(), req.GetTargetHttpsProxy()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} diff --git a/compute/apiv1/target_https_proxies_client_example_test.go b/compute/apiv1/target_https_proxies_client_example_test.go new file mode 100644 index 00000000000..3430ce2206f --- /dev/null +++ b/compute/apiv1/target_https_proxies_client_example_test.go @@ -0,0 +1,226 @@ +// Copyright 2021 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_test + +import ( + "context" + + compute "cloud.google.com/go/compute/apiv1" + computepb "google.golang.org/genproto/googleapis/cloud/compute/v1" +) + +func ExampleNewTargetHttpsProxiesRESTClient() { + ctx := context.Background() + c, err := compute.NewTargetHttpsProxiesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + // TODO: Use client. + _ = c +} + +func ExampleTargetHttpsProxiesClient_AggregatedList() { + ctx := context.Background() + c, err := compute.NewTargetHttpsProxiesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.AggregatedListTargetHttpsProxiesRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.AggregatedList(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleTargetHttpsProxiesClient_Delete() { + ctx := context.Background() + c, err := compute.NewTargetHttpsProxiesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.DeleteTargetHttpsProxyRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Delete(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleTargetHttpsProxiesClient_Get() { + ctx := context.Background() + c, err := compute.NewTargetHttpsProxiesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.GetTargetHttpsProxyRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Get(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleTargetHttpsProxiesClient_Insert() { + ctx := context.Background() + c, err := compute.NewTargetHttpsProxiesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.InsertTargetHttpsProxyRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Insert(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleTargetHttpsProxiesClient_List() { + ctx := context.Background() + c, err := compute.NewTargetHttpsProxiesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.ListTargetHttpsProxiesRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.List(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleTargetHttpsProxiesClient_Patch() { + ctx := context.Background() + c, err := compute.NewTargetHttpsProxiesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.PatchTargetHttpsProxyRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Patch(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleTargetHttpsProxiesClient_SetQuicOverride() { + ctx := context.Background() + c, err := compute.NewTargetHttpsProxiesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.SetQuicOverrideTargetHttpsProxyRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.SetQuicOverride(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleTargetHttpsProxiesClient_SetSslCertificates() { + ctx := context.Background() + c, err := compute.NewTargetHttpsProxiesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.SetSslCertificatesTargetHttpsProxyRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.SetSslCertificates(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleTargetHttpsProxiesClient_SetSslPolicy() { + ctx := context.Background() + c, err := compute.NewTargetHttpsProxiesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.SetSslPolicyTargetHttpsProxyRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.SetSslPolicy(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleTargetHttpsProxiesClient_SetUrlMap() { + ctx := context.Background() + c, err := compute.NewTargetHttpsProxiesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.SetUrlMapTargetHttpsProxyRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.SetUrlMap(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} diff --git a/compute/apiv1/target_instances_client.go b/compute/apiv1/target_instances_client.go new file mode 100644 index 00000000000..25b0514dc64 --- /dev/null +++ b/compute/apiv1/target_instances_client.go @@ -0,0 +1,452 @@ +// Copyright 2021 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/ioutil" + "net/http" + "net/url" + + gax "github.com/googleapis/gax-go/v2" + "google.golang.org/api/option" + "google.golang.org/api/option/internaloption" + httptransport "google.golang.org/api/transport/http" + computepb "google.golang.org/genproto/googleapis/cloud/compute/v1" + "google.golang.org/grpc" + "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/encoding/protojson" +) + +var newTargetInstancesClientHook clientHook + +// TargetInstancesCallOptions contains the retry settings for each method of TargetInstancesClient. +type TargetInstancesCallOptions struct { + AggregatedList []gax.CallOption + Delete []gax.CallOption + Get []gax.CallOption + Insert []gax.CallOption + List []gax.CallOption +} + +// internalTargetInstancesClient is an interface that defines the methods availaible from Google Compute Engine API. +type internalTargetInstancesClient interface { + Close() error + setGoogleClientInfo(...string) + Connection() *grpc.ClientConn + AggregatedList(context.Context, *computepb.AggregatedListTargetInstancesRequest, ...gax.CallOption) (*computepb.TargetInstanceAggregatedList, error) + Delete(context.Context, *computepb.DeleteTargetInstanceRequest, ...gax.CallOption) (*computepb.Operation, error) + Get(context.Context, *computepb.GetTargetInstanceRequest, ...gax.CallOption) (*computepb.TargetInstance, error) + Insert(context.Context, *computepb.InsertTargetInstanceRequest, ...gax.CallOption) (*computepb.Operation, error) + List(context.Context, *computepb.ListTargetInstancesRequest, ...gax.CallOption) (*computepb.TargetInstanceList, error) +} + +// TargetInstancesClient 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 TargetInstances API. +type TargetInstancesClient struct { + // The internal transport-dependent client. + internalClient internalTargetInstancesClient + + // The call options for this service. + CallOptions *TargetInstancesCallOptions +} + +// 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 *TargetInstancesClient) 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 *TargetInstancesClient) setGoogleClientInfo(keyval ...string) { + c.internalClient.setGoogleClientInfo(keyval...) +} + +// Connection returns a connection to the API service. +// +// Deprecated. +func (c *TargetInstancesClient) Connection() *grpc.ClientConn { + return c.internalClient.Connection() +} + +// AggregatedList retrieves an aggregated list of target instances. +func (c *TargetInstancesClient) AggregatedList(ctx context.Context, req *computepb.AggregatedListTargetInstancesRequest, opts ...gax.CallOption) (*computepb.TargetInstanceAggregatedList, error) { + return c.internalClient.AggregatedList(ctx, req, opts...) +} + +// Delete deletes the specified TargetInstance resource. +func (c *TargetInstancesClient) Delete(ctx context.Context, req *computepb.DeleteTargetInstanceRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.Delete(ctx, req, opts...) +} + +// Get returns the specified TargetInstance resource. Gets a list of available target instances by making a list() request. +func (c *TargetInstancesClient) Get(ctx context.Context, req *computepb.GetTargetInstanceRequest, opts ...gax.CallOption) (*computepb.TargetInstance, error) { + return c.internalClient.Get(ctx, req, opts...) +} + +// Insert creates a TargetInstance resource in the specified project and zone using the data included in the request. +func (c *TargetInstancesClient) Insert(ctx context.Context, req *computepb.InsertTargetInstanceRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.Insert(ctx, req, opts...) +} + +// List retrieves a list of TargetInstance resources available to the specified project and zone. +func (c *TargetInstancesClient) List(ctx context.Context, req *computepb.ListTargetInstancesRequest, opts ...gax.CallOption) (*computepb.TargetInstanceList, error) { + return c.internalClient.List(ctx, req, opts...) +} + +// Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls. +type targetInstancesRESTClient struct { + // The http endpoint to connect to. + endpoint string + + // The http client. + httpClient *http.Client + + // The x-goog-* metadata to be sent with each request. + xGoogMetadata metadata.MD +} + +// NewTargetInstancesRESTClient creates a new target instances rest client. +// +// The TargetInstances API. +func NewTargetInstancesRESTClient(ctx context.Context, opts ...option.ClientOption) (*TargetInstancesClient, error) { + clientOpts := append(defaultTargetInstancesRESTClientOptions(), opts...) + httpClient, endpoint, err := httptransport.NewClient(ctx, clientOpts...) + if err != nil { + return nil, err + } + + c := &targetInstancesRESTClient{ + endpoint: endpoint, + httpClient: httpClient, + } + c.setGoogleClientInfo() + + return &TargetInstancesClient{internalClient: c, CallOptions: &TargetInstancesCallOptions{}}, nil +} + +func defaultTargetInstancesRESTClientOptions() []option.ClientOption { + return []option.ClientOption{ + internaloption.WithDefaultEndpoint("compute.googleapis.com"), + internaloption.WithDefaultMTLSEndpoint("compute.mtls.googleapis.com"), + internaloption.WithDefaultAudience("https://compute.googleapis.com/"), + internaloption.WithDefaultScopes(DefaultAuthScopes()...), + } +} + +// setGoogleClientInfo sets the name and version of the application in +// the `x-goog-api-client` header passed on each request. Intended for +// use by Google-written clients. +func (c *targetInstancesRESTClient) setGoogleClientInfo(keyval ...string) { + kv := append([]string{"gl-go", versionGo()}, keyval...) + kv = append(kv, "gapic", versionClient, "gax", gax.Version, "rest", "UNKNOWN") + c.xGoogMetadata = metadata.Pairs("x-goog-api-client", gax.XGoogHeader(kv...)) +} + +// Close closes the connection to the API service. The user should invoke this when +// the client is no longer required. +func (c *targetInstancesRESTClient) Close() error { + // Replace httpClient with nil to force cleanup. + c.httpClient = nil + return nil +} + +// Connection returns a connection to the API service. +// +// Deprecated. +func (c *targetInstancesRESTClient) Connection() *grpc.ClientConn { + return nil +} + +// AggregatedList retrieves an aggregated list of target instances. +func (c *targetInstancesRESTClient) AggregatedList(ctx context.Context, req *computepb.AggregatedListTargetInstancesRequest, opts ...gax.CallOption) (*computepb.TargetInstanceAggregatedList, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/aggregated/targetInstances", req.GetProject()) + + params := url.Values{} + if req != nil && req.Filter != nil { + params.Add("filter", fmt.Sprintf("%v", req.GetFilter())) + } + if req != nil && req.IncludeAllScopes != nil { + params.Add("includeAllScopes", fmt.Sprintf("%v", req.GetIncludeAllScopes())) + } + 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() + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.TargetInstanceAggregatedList{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Delete deletes the specified TargetInstance resource. +func (c *targetInstancesRESTClient) Delete(ctx context.Context, req *computepb.DeleteTargetInstanceRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/zones/%v/targetInstances/%v", req.GetProject(), req.GetZone(), req.GetTargetInstance()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("DELETE", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Get returns the specified TargetInstance resource. Gets a list of available target instances by making a list() request. +func (c *targetInstancesRESTClient) Get(ctx context.Context, req *computepb.GetTargetInstanceRequest, opts ...gax.CallOption) (*computepb.TargetInstance, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/zones/%v/targetInstances/%v", req.GetProject(), req.GetZone(), req.GetTargetInstance()) + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.TargetInstance{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Insert creates a TargetInstance resource in the specified project and zone using the data included in the request. +func (c *targetInstancesRESTClient) Insert(ctx context.Context, req *computepb.InsertTargetInstanceRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetTargetInstanceResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/zones/%v/targetInstances", req.GetProject(), req.GetZone()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// List retrieves a list of TargetInstance resources available to the specified project and zone. +func (c *targetInstancesRESTClient) List(ctx context.Context, req *computepb.ListTargetInstancesRequest, opts ...gax.CallOption) (*computepb.TargetInstanceList, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/zones/%v/targetInstances", req.GetProject(), req.GetZone()) + + 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() + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.TargetInstanceList{} + + return rsp, unm.Unmarshal(buf, rsp) +} diff --git a/compute/apiv1/target_instances_client_example_test.go b/compute/apiv1/target_instances_client_example_test.go new file mode 100644 index 00000000000..de3679b3076 --- /dev/null +++ b/compute/apiv1/target_instances_client_example_test.go @@ -0,0 +1,131 @@ +// Copyright 2021 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_test + +import ( + "context" + + compute "cloud.google.com/go/compute/apiv1" + computepb "google.golang.org/genproto/googleapis/cloud/compute/v1" +) + +func ExampleNewTargetInstancesRESTClient() { + ctx := context.Background() + c, err := compute.NewTargetInstancesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + // TODO: Use client. + _ = c +} + +func ExampleTargetInstancesClient_AggregatedList() { + ctx := context.Background() + c, err := compute.NewTargetInstancesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.AggregatedListTargetInstancesRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.AggregatedList(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleTargetInstancesClient_Delete() { + ctx := context.Background() + c, err := compute.NewTargetInstancesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.DeleteTargetInstanceRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Delete(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleTargetInstancesClient_Get() { + ctx := context.Background() + c, err := compute.NewTargetInstancesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.GetTargetInstanceRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Get(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleTargetInstancesClient_Insert() { + ctx := context.Background() + c, err := compute.NewTargetInstancesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.InsertTargetInstanceRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Insert(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleTargetInstancesClient_List() { + ctx := context.Background() + c, err := compute.NewTargetInstancesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.ListTargetInstancesRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.List(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} diff --git a/compute/apiv1/target_pools_client.go b/compute/apiv1/target_pools_client.go new file mode 100644 index 00000000000..f05abeca64d --- /dev/null +++ b/compute/apiv1/target_pools_client.go @@ -0,0 +1,796 @@ +// Copyright 2021 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/ioutil" + "net/http" + "net/url" + + gax "github.com/googleapis/gax-go/v2" + "google.golang.org/api/option" + "google.golang.org/api/option/internaloption" + httptransport "google.golang.org/api/transport/http" + computepb "google.golang.org/genproto/googleapis/cloud/compute/v1" + "google.golang.org/grpc" + "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/encoding/protojson" +) + +var newTargetPoolsClientHook clientHook + +// TargetPoolsCallOptions contains the retry settings for each method of TargetPoolsClient. +type TargetPoolsCallOptions struct { + AddHealthCheck []gax.CallOption + AddInstance []gax.CallOption + AggregatedList []gax.CallOption + Delete []gax.CallOption + Get []gax.CallOption + GetHealth []gax.CallOption + Insert []gax.CallOption + List []gax.CallOption + RemoveHealthCheck []gax.CallOption + RemoveInstance []gax.CallOption + SetBackup []gax.CallOption +} + +// internalTargetPoolsClient is an interface that defines the methods availaible from Google Compute Engine API. +type internalTargetPoolsClient interface { + Close() error + setGoogleClientInfo(...string) + Connection() *grpc.ClientConn + AddHealthCheck(context.Context, *computepb.AddHealthCheckTargetPoolRequest, ...gax.CallOption) (*computepb.Operation, error) + AddInstance(context.Context, *computepb.AddInstanceTargetPoolRequest, ...gax.CallOption) (*computepb.Operation, error) + AggregatedList(context.Context, *computepb.AggregatedListTargetPoolsRequest, ...gax.CallOption) (*computepb.TargetPoolAggregatedList, error) + Delete(context.Context, *computepb.DeleteTargetPoolRequest, ...gax.CallOption) (*computepb.Operation, error) + Get(context.Context, *computepb.GetTargetPoolRequest, ...gax.CallOption) (*computepb.TargetPool, error) + GetHealth(context.Context, *computepb.GetHealthTargetPoolRequest, ...gax.CallOption) (*computepb.TargetPoolInstanceHealth, error) + Insert(context.Context, *computepb.InsertTargetPoolRequest, ...gax.CallOption) (*computepb.Operation, error) + List(context.Context, *computepb.ListTargetPoolsRequest, ...gax.CallOption) (*computepb.TargetPoolList, error) + RemoveHealthCheck(context.Context, *computepb.RemoveHealthCheckTargetPoolRequest, ...gax.CallOption) (*computepb.Operation, error) + RemoveInstance(context.Context, *computepb.RemoveInstanceTargetPoolRequest, ...gax.CallOption) (*computepb.Operation, error) + SetBackup(context.Context, *computepb.SetBackupTargetPoolRequest, ...gax.CallOption) (*computepb.Operation, error) +} + +// TargetPoolsClient 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 TargetPools API. +type TargetPoolsClient struct { + // The internal transport-dependent client. + internalClient internalTargetPoolsClient + + // The call options for this service. + CallOptions *TargetPoolsCallOptions +} + +// 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 *TargetPoolsClient) 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 *TargetPoolsClient) setGoogleClientInfo(keyval ...string) { + c.internalClient.setGoogleClientInfo(keyval...) +} + +// Connection returns a connection to the API service. +// +// Deprecated. +func (c *TargetPoolsClient) Connection() *grpc.ClientConn { + return c.internalClient.Connection() +} + +// AddHealthCheck adds health check URLs to a target pool. +func (c *TargetPoolsClient) AddHealthCheck(ctx context.Context, req *computepb.AddHealthCheckTargetPoolRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.AddHealthCheck(ctx, req, opts...) +} + +// AddInstance adds an instance to a target pool. +func (c *TargetPoolsClient) AddInstance(ctx context.Context, req *computepb.AddInstanceTargetPoolRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.AddInstance(ctx, req, opts...) +} + +// AggregatedList retrieves an aggregated list of target pools. +func (c *TargetPoolsClient) AggregatedList(ctx context.Context, req *computepb.AggregatedListTargetPoolsRequest, opts ...gax.CallOption) (*computepb.TargetPoolAggregatedList, error) { + return c.internalClient.AggregatedList(ctx, req, opts...) +} + +// Delete deletes the specified target pool. +func (c *TargetPoolsClient) Delete(ctx context.Context, req *computepb.DeleteTargetPoolRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.Delete(ctx, req, opts...) +} + +// Get returns the specified target pool. Gets a list of available target pools by making a list() request. +func (c *TargetPoolsClient) Get(ctx context.Context, req *computepb.GetTargetPoolRequest, opts ...gax.CallOption) (*computepb.TargetPool, error) { + return c.internalClient.Get(ctx, req, opts...) +} + +// GetHealth gets the most recent health check results for each IP for the instance that is referenced by the given target pool. +func (c *TargetPoolsClient) GetHealth(ctx context.Context, req *computepb.GetHealthTargetPoolRequest, opts ...gax.CallOption) (*computepb.TargetPoolInstanceHealth, error) { + return c.internalClient.GetHealth(ctx, req, opts...) +} + +// Insert creates a target pool in the specified project and region using the data included in the request. +func (c *TargetPoolsClient) Insert(ctx context.Context, req *computepb.InsertTargetPoolRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.Insert(ctx, req, opts...) +} + +// List retrieves a list of target pools available to the specified project and region. +func (c *TargetPoolsClient) List(ctx context.Context, req *computepb.ListTargetPoolsRequest, opts ...gax.CallOption) (*computepb.TargetPoolList, error) { + return c.internalClient.List(ctx, req, opts...) +} + +// RemoveHealthCheck removes health check URL from a target pool. +func (c *TargetPoolsClient) RemoveHealthCheck(ctx context.Context, req *computepb.RemoveHealthCheckTargetPoolRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.RemoveHealthCheck(ctx, req, opts...) +} + +// RemoveInstance removes instance URL from a target pool. +func (c *TargetPoolsClient) RemoveInstance(ctx context.Context, req *computepb.RemoveInstanceTargetPoolRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.RemoveInstance(ctx, req, opts...) +} + +// SetBackup changes a backup target pool’s configurations. +func (c *TargetPoolsClient) SetBackup(ctx context.Context, req *computepb.SetBackupTargetPoolRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.SetBackup(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. + endpoint string + + // The http client. + httpClient *http.Client + + // The x-goog-* metadata to be sent with each request. + xGoogMetadata metadata.MD +} + +// NewTargetPoolsRESTClient creates a new target pools rest client. +// +// The TargetPools API. +func NewTargetPoolsRESTClient(ctx context.Context, opts ...option.ClientOption) (*TargetPoolsClient, error) { + clientOpts := append(defaultTargetPoolsRESTClientOptions(), opts...) + httpClient, endpoint, err := httptransport.NewClient(ctx, clientOpts...) + if err != nil { + return nil, err + } + + c := &targetPoolsRESTClient{ + endpoint: endpoint, + httpClient: httpClient, + } + c.setGoogleClientInfo() + + return &TargetPoolsClient{internalClient: c, CallOptions: &TargetPoolsCallOptions{}}, nil +} + +func defaultTargetPoolsRESTClientOptions() []option.ClientOption { + return []option.ClientOption{ + internaloption.WithDefaultEndpoint("compute.googleapis.com"), + internaloption.WithDefaultMTLSEndpoint("compute.mtls.googleapis.com"), + internaloption.WithDefaultAudience("https://compute.googleapis.com/"), + internaloption.WithDefaultScopes(DefaultAuthScopes()...), + } +} + +// setGoogleClientInfo sets the name and version of the application in +// the `x-goog-api-client` header passed on each request. Intended for +// use by Google-written clients. +func (c *targetPoolsRESTClient) setGoogleClientInfo(keyval ...string) { + kv := append([]string{"gl-go", versionGo()}, keyval...) + kv = append(kv, "gapic", versionClient, "gax", gax.Version, "rest", "UNKNOWN") + c.xGoogMetadata = metadata.Pairs("x-goog-api-client", gax.XGoogHeader(kv...)) +} + +// Close closes the connection to the API service. The user should invoke this when +// the client is no longer required. +func (c *targetPoolsRESTClient) Close() error { + // Replace httpClient with nil to force cleanup. + c.httpClient = nil + return nil +} + +// Connection returns a connection to the API service. +// +// Deprecated. +func (c *targetPoolsRESTClient) Connection() *grpc.ClientConn { + return nil +} + +// AddHealthCheck adds health check URLs to a target pool. +func (c *targetPoolsRESTClient) AddHealthCheck(ctx context.Context, req *computepb.AddHealthCheckTargetPoolRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetTargetPoolsAddHealthCheckRequestResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/targetPools/%v/addHealthCheck", req.GetProject(), req.GetRegion(), req.GetTargetPool()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// AddInstance adds an instance to a target pool. +func (c *targetPoolsRESTClient) AddInstance(ctx context.Context, req *computepb.AddInstanceTargetPoolRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetTargetPoolsAddInstanceRequestResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/targetPools/%v/addInstance", req.GetProject(), req.GetRegion(), req.GetTargetPool()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// AggregatedList retrieves an aggregated list of target pools. +func (c *targetPoolsRESTClient) AggregatedList(ctx context.Context, req *computepb.AggregatedListTargetPoolsRequest, opts ...gax.CallOption) (*computepb.TargetPoolAggregatedList, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/aggregated/targetPools", req.GetProject()) + + params := url.Values{} + if req != nil && req.Filter != nil { + params.Add("filter", fmt.Sprintf("%v", req.GetFilter())) + } + if req != nil && req.IncludeAllScopes != nil { + params.Add("includeAllScopes", fmt.Sprintf("%v", req.GetIncludeAllScopes())) + } + 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() + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.TargetPoolAggregatedList{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Delete deletes the specified target pool. +func (c *targetPoolsRESTClient) Delete(ctx context.Context, req *computepb.DeleteTargetPoolRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/targetPools/%v", req.GetProject(), req.GetRegion(), req.GetTargetPool()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("DELETE", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Get returns the specified target pool. Gets a list of available target pools by making a list() request. +func (c *targetPoolsRESTClient) Get(ctx context.Context, req *computepb.GetTargetPoolRequest, opts ...gax.CallOption) (*computepb.TargetPool, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/targetPools/%v", req.GetProject(), req.GetRegion(), req.GetTargetPool()) + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.TargetPool{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// GetHealth gets the most recent health check results for each IP for the instance that is referenced by the given target pool. +func (c *targetPoolsRESTClient) GetHealth(ctx context.Context, req *computepb.GetHealthTargetPoolRequest, opts ...gax.CallOption) (*computepb.TargetPoolInstanceHealth, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetInstanceReferenceResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/targetPools/%v/getHealth", req.GetProject(), req.GetRegion(), req.GetTargetPool()) + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.TargetPoolInstanceHealth{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Insert creates a target pool in the specified project and region using the data included in the request. +func (c *targetPoolsRESTClient) Insert(ctx context.Context, req *computepb.InsertTargetPoolRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetTargetPoolResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/targetPools", req.GetProject(), req.GetRegion()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// List retrieves a list of target pools available to the specified project and region. +func (c *targetPoolsRESTClient) List(ctx context.Context, req *computepb.ListTargetPoolsRequest, opts ...gax.CallOption) (*computepb.TargetPoolList, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/targetPools", 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() + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.TargetPoolList{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// RemoveHealthCheck removes health check URL from a target pool. +func (c *targetPoolsRESTClient) RemoveHealthCheck(ctx context.Context, req *computepb.RemoveHealthCheckTargetPoolRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetTargetPoolsRemoveHealthCheckRequestResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/targetPools/%v/removeHealthCheck", req.GetProject(), req.GetRegion(), req.GetTargetPool()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// RemoveInstance removes instance URL from a target pool. +func (c *targetPoolsRESTClient) RemoveInstance(ctx context.Context, req *computepb.RemoveInstanceTargetPoolRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetTargetPoolsRemoveInstanceRequestResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/targetPools/%v/removeInstance", req.GetProject(), req.GetRegion(), req.GetTargetPool()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// SetBackup changes a backup target pool’s configurations. +func (c *targetPoolsRESTClient) SetBackup(ctx context.Context, req *computepb.SetBackupTargetPoolRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetTargetReferenceResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/targetPools/%v/setBackup", req.GetProject(), req.GetRegion(), req.GetTargetPool()) + + params := url.Values{} + if req != nil && req.FailoverRatio != nil { + params.Add("failoverRatio", fmt.Sprintf("%v", req.GetFailoverRatio())) + } + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} diff --git a/compute/apiv1/target_pools_client_example_test.go b/compute/apiv1/target_pools_client_example_test.go new file mode 100644 index 00000000000..480016f09eb --- /dev/null +++ b/compute/apiv1/target_pools_client_example_test.go @@ -0,0 +1,245 @@ +// Copyright 2021 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_test + +import ( + "context" + + compute "cloud.google.com/go/compute/apiv1" + computepb "google.golang.org/genproto/googleapis/cloud/compute/v1" +) + +func ExampleNewTargetPoolsRESTClient() { + ctx := context.Background() + c, err := compute.NewTargetPoolsRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + // TODO: Use client. + _ = c +} + +func ExampleTargetPoolsClient_AddHealthCheck() { + ctx := context.Background() + c, err := compute.NewTargetPoolsRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.AddHealthCheckTargetPoolRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.AddHealthCheck(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleTargetPoolsClient_AddInstance() { + ctx := context.Background() + c, err := compute.NewTargetPoolsRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.AddInstanceTargetPoolRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.AddInstance(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleTargetPoolsClient_AggregatedList() { + ctx := context.Background() + c, err := compute.NewTargetPoolsRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.AggregatedListTargetPoolsRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.AggregatedList(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleTargetPoolsClient_Delete() { + ctx := context.Background() + c, err := compute.NewTargetPoolsRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.DeleteTargetPoolRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Delete(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleTargetPoolsClient_Get() { + ctx := context.Background() + c, err := compute.NewTargetPoolsRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.GetTargetPoolRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Get(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleTargetPoolsClient_GetHealth() { + ctx := context.Background() + c, err := compute.NewTargetPoolsRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.GetHealthTargetPoolRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.GetHealth(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleTargetPoolsClient_Insert() { + ctx := context.Background() + c, err := compute.NewTargetPoolsRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.InsertTargetPoolRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Insert(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleTargetPoolsClient_List() { + ctx := context.Background() + c, err := compute.NewTargetPoolsRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.ListTargetPoolsRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.List(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleTargetPoolsClient_RemoveHealthCheck() { + ctx := context.Background() + c, err := compute.NewTargetPoolsRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.RemoveHealthCheckTargetPoolRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.RemoveHealthCheck(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleTargetPoolsClient_RemoveInstance() { + ctx := context.Background() + c, err := compute.NewTargetPoolsRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.RemoveInstanceTargetPoolRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.RemoveInstance(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleTargetPoolsClient_SetBackup() { + ctx := context.Background() + c, err := compute.NewTargetPoolsRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.SetBackupTargetPoolRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.SetBackup(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} diff --git a/compute/apiv1/target_ssl_proxies_client.go b/compute/apiv1/target_ssl_proxies_client.go new file mode 100644 index 00000000000..bbbd9dc7364 --- /dev/null +++ b/compute/apiv1/target_ssl_proxies_client.go @@ -0,0 +1,612 @@ +// Copyright 2021 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/ioutil" + "net/http" + "net/url" + + gax "github.com/googleapis/gax-go/v2" + "google.golang.org/api/option" + "google.golang.org/api/option/internaloption" + httptransport "google.golang.org/api/transport/http" + computepb "google.golang.org/genproto/googleapis/cloud/compute/v1" + "google.golang.org/grpc" + "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/encoding/protojson" +) + +var newTargetSslProxiesClientHook clientHook + +// TargetSslProxiesCallOptions contains the retry settings for each method of TargetSslProxiesClient. +type TargetSslProxiesCallOptions struct { + Delete []gax.CallOption + Get []gax.CallOption + Insert []gax.CallOption + List []gax.CallOption + SetBackendService []gax.CallOption + SetProxyHeader []gax.CallOption + SetSslCertificates []gax.CallOption + SetSslPolicy []gax.CallOption +} + +// internalTargetSslProxiesClient is an interface that defines the methods availaible from Google Compute Engine API. +type internalTargetSslProxiesClient interface { + Close() error + setGoogleClientInfo(...string) + Connection() *grpc.ClientConn + Delete(context.Context, *computepb.DeleteTargetSslProxyRequest, ...gax.CallOption) (*computepb.Operation, error) + Get(context.Context, *computepb.GetTargetSslProxyRequest, ...gax.CallOption) (*computepb.TargetSslProxy, error) + Insert(context.Context, *computepb.InsertTargetSslProxyRequest, ...gax.CallOption) (*computepb.Operation, error) + List(context.Context, *computepb.ListTargetSslProxiesRequest, ...gax.CallOption) (*computepb.TargetSslProxyList, error) + SetBackendService(context.Context, *computepb.SetBackendServiceTargetSslProxyRequest, ...gax.CallOption) (*computepb.Operation, error) + SetProxyHeader(context.Context, *computepb.SetProxyHeaderTargetSslProxyRequest, ...gax.CallOption) (*computepb.Operation, error) + SetSslCertificates(context.Context, *computepb.SetSslCertificatesTargetSslProxyRequest, ...gax.CallOption) (*computepb.Operation, error) + SetSslPolicy(context.Context, *computepb.SetSslPolicyTargetSslProxyRequest, ...gax.CallOption) (*computepb.Operation, error) +} + +// TargetSslProxiesClient 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 TargetSslProxies API. +type TargetSslProxiesClient struct { + // The internal transport-dependent client. + internalClient internalTargetSslProxiesClient + + // The call options for this service. + CallOptions *TargetSslProxiesCallOptions +} + +// 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 *TargetSslProxiesClient) 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 *TargetSslProxiesClient) setGoogleClientInfo(keyval ...string) { + c.internalClient.setGoogleClientInfo(keyval...) +} + +// Connection returns a connection to the API service. +// +// Deprecated. +func (c *TargetSslProxiesClient) Connection() *grpc.ClientConn { + return c.internalClient.Connection() +} + +// Delete deletes the specified TargetSslProxy resource. +func (c *TargetSslProxiesClient) Delete(ctx context.Context, req *computepb.DeleteTargetSslProxyRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.Delete(ctx, req, opts...) +} + +// Get returns the specified TargetSslProxy resource. Gets a list of available target SSL proxies by making a list() request. +func (c *TargetSslProxiesClient) Get(ctx context.Context, req *computepb.GetTargetSslProxyRequest, opts ...gax.CallOption) (*computepb.TargetSslProxy, error) { + return c.internalClient.Get(ctx, req, opts...) +} + +// Insert creates a TargetSslProxy resource in the specified project using the data included in the request. +func (c *TargetSslProxiesClient) Insert(ctx context.Context, req *computepb.InsertTargetSslProxyRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.Insert(ctx, req, opts...) +} + +// List retrieves the list of TargetSslProxy resources available to the specified project. +func (c *TargetSslProxiesClient) List(ctx context.Context, req *computepb.ListTargetSslProxiesRequest, opts ...gax.CallOption) (*computepb.TargetSslProxyList, error) { + return c.internalClient.List(ctx, req, opts...) +} + +// SetBackendService changes the BackendService for TargetSslProxy. +func (c *TargetSslProxiesClient) SetBackendService(ctx context.Context, req *computepb.SetBackendServiceTargetSslProxyRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.SetBackendService(ctx, req, opts...) +} + +// SetProxyHeader changes the ProxyHeaderType for TargetSslProxy. +func (c *TargetSslProxiesClient) SetProxyHeader(ctx context.Context, req *computepb.SetProxyHeaderTargetSslProxyRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.SetProxyHeader(ctx, req, opts...) +} + +// SetSslCertificates changes SslCertificates for TargetSslProxy. +func (c *TargetSslProxiesClient) SetSslCertificates(ctx context.Context, req *computepb.SetSslCertificatesTargetSslProxyRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.SetSslCertificates(ctx, req, opts...) +} + +// SetSslPolicy sets the SSL policy for TargetSslProxy. The SSL policy specifies the server-side support for SSL features. This affects connections between clients and the SSL proxy load balancer. They do not affect the connection between the load balancer and the backends. +func (c *TargetSslProxiesClient) SetSslPolicy(ctx context.Context, req *computepb.SetSslPolicyTargetSslProxyRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.SetSslPolicy(ctx, req, opts...) +} + +// Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls. +type targetSslProxiesRESTClient struct { + // The http endpoint to connect to. + endpoint string + + // The http client. + httpClient *http.Client + + // The x-goog-* metadata to be sent with each request. + xGoogMetadata metadata.MD +} + +// NewTargetSslProxiesRESTClient creates a new target ssl proxies rest client. +// +// The TargetSslProxies API. +func NewTargetSslProxiesRESTClient(ctx context.Context, opts ...option.ClientOption) (*TargetSslProxiesClient, error) { + clientOpts := append(defaultTargetSslProxiesRESTClientOptions(), opts...) + httpClient, endpoint, err := httptransport.NewClient(ctx, clientOpts...) + if err != nil { + return nil, err + } + + c := &targetSslProxiesRESTClient{ + endpoint: endpoint, + httpClient: httpClient, + } + c.setGoogleClientInfo() + + return &TargetSslProxiesClient{internalClient: c, CallOptions: &TargetSslProxiesCallOptions{}}, nil +} + +func defaultTargetSslProxiesRESTClientOptions() []option.ClientOption { + return []option.ClientOption{ + internaloption.WithDefaultEndpoint("compute.googleapis.com"), + internaloption.WithDefaultMTLSEndpoint("compute.mtls.googleapis.com"), + internaloption.WithDefaultAudience("https://compute.googleapis.com/"), + internaloption.WithDefaultScopes(DefaultAuthScopes()...), + } +} + +// setGoogleClientInfo sets the name and version of the application in +// the `x-goog-api-client` header passed on each request. Intended for +// use by Google-written clients. +func (c *targetSslProxiesRESTClient) setGoogleClientInfo(keyval ...string) { + kv := append([]string{"gl-go", versionGo()}, keyval...) + kv = append(kv, "gapic", versionClient, "gax", gax.Version, "rest", "UNKNOWN") + c.xGoogMetadata = metadata.Pairs("x-goog-api-client", gax.XGoogHeader(kv...)) +} + +// Close closes the connection to the API service. The user should invoke this when +// the client is no longer required. +func (c *targetSslProxiesRESTClient) Close() error { + // Replace httpClient with nil to force cleanup. + c.httpClient = nil + return nil +} + +// Connection returns a connection to the API service. +// +// Deprecated. +func (c *targetSslProxiesRESTClient) Connection() *grpc.ClientConn { + return nil +} + +// Delete deletes the specified TargetSslProxy resource. +func (c *targetSslProxiesRESTClient) Delete(ctx context.Context, req *computepb.DeleteTargetSslProxyRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/global/targetSslProxies/%v", req.GetProject(), req.GetTargetSslProxy()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("DELETE", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Get returns the specified TargetSslProxy resource. Gets a list of available target SSL proxies by making a list() request. +func (c *targetSslProxiesRESTClient) Get(ctx context.Context, req *computepb.GetTargetSslProxyRequest, opts ...gax.CallOption) (*computepb.TargetSslProxy, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/global/targetSslProxies/%v", req.GetProject(), req.GetTargetSslProxy()) + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.TargetSslProxy{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Insert creates a TargetSslProxy resource in the specified project using the data included in the request. +func (c *targetSslProxiesRESTClient) Insert(ctx context.Context, req *computepb.InsertTargetSslProxyRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetTargetSslProxyResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/global/targetSslProxies", req.GetProject()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// List retrieves the list of TargetSslProxy resources available to the specified project. +func (c *targetSslProxiesRESTClient) List(ctx context.Context, req *computepb.ListTargetSslProxiesRequest, opts ...gax.CallOption) (*computepb.TargetSslProxyList, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/global/targetSslProxies", 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() + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.TargetSslProxyList{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// SetBackendService changes the BackendService for TargetSslProxy. +func (c *targetSslProxiesRESTClient) SetBackendService(ctx context.Context, req *computepb.SetBackendServiceTargetSslProxyRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetTargetSslProxiesSetBackendServiceRequestResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/global/targetSslProxies/%v/setBackendService", req.GetProject(), req.GetTargetSslProxy()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// SetProxyHeader changes the ProxyHeaderType for TargetSslProxy. +func (c *targetSslProxiesRESTClient) SetProxyHeader(ctx context.Context, req *computepb.SetProxyHeaderTargetSslProxyRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetTargetSslProxiesSetProxyHeaderRequestResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/global/targetSslProxies/%v/setProxyHeader", req.GetProject(), req.GetTargetSslProxy()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// SetSslCertificates changes SslCertificates for TargetSslProxy. +func (c *targetSslProxiesRESTClient) SetSslCertificates(ctx context.Context, req *computepb.SetSslCertificatesTargetSslProxyRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetTargetSslProxiesSetSslCertificatesRequestResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/global/targetSslProxies/%v/setSslCertificates", req.GetProject(), req.GetTargetSslProxy()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// SetSslPolicy sets the SSL policy for TargetSslProxy. The SSL policy specifies the server-side support for SSL features. This affects connections between clients and the SSL proxy load balancer. They do not affect the connection between the load balancer and the backends. +func (c *targetSslProxiesRESTClient) SetSslPolicy(ctx context.Context, req *computepb.SetSslPolicyTargetSslProxyRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetSslPolicyReferenceResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/global/targetSslProxies/%v/setSslPolicy", req.GetProject(), req.GetTargetSslProxy()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} diff --git a/compute/apiv1/target_ssl_proxies_client_example_test.go b/compute/apiv1/target_ssl_proxies_client_example_test.go new file mode 100644 index 00000000000..09db740716c --- /dev/null +++ b/compute/apiv1/target_ssl_proxies_client_example_test.go @@ -0,0 +1,188 @@ +// Copyright 2021 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_test + +import ( + "context" + + compute "cloud.google.com/go/compute/apiv1" + computepb "google.golang.org/genproto/googleapis/cloud/compute/v1" +) + +func ExampleNewTargetSslProxiesRESTClient() { + ctx := context.Background() + c, err := compute.NewTargetSslProxiesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + // TODO: Use client. + _ = c +} + +func ExampleTargetSslProxiesClient_Delete() { + ctx := context.Background() + c, err := compute.NewTargetSslProxiesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.DeleteTargetSslProxyRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Delete(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleTargetSslProxiesClient_Get() { + ctx := context.Background() + c, err := compute.NewTargetSslProxiesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.GetTargetSslProxyRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Get(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleTargetSslProxiesClient_Insert() { + ctx := context.Background() + c, err := compute.NewTargetSslProxiesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.InsertTargetSslProxyRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Insert(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleTargetSslProxiesClient_List() { + ctx := context.Background() + c, err := compute.NewTargetSslProxiesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.ListTargetSslProxiesRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.List(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleTargetSslProxiesClient_SetBackendService() { + ctx := context.Background() + c, err := compute.NewTargetSslProxiesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.SetBackendServiceTargetSslProxyRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.SetBackendService(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleTargetSslProxiesClient_SetProxyHeader() { + ctx := context.Background() + c, err := compute.NewTargetSslProxiesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.SetProxyHeaderTargetSslProxyRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.SetProxyHeader(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleTargetSslProxiesClient_SetSslCertificates() { + ctx := context.Background() + c, err := compute.NewTargetSslProxiesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.SetSslCertificatesTargetSslProxyRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.SetSslCertificates(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleTargetSslProxiesClient_SetSslPolicy() { + ctx := context.Background() + c, err := compute.NewTargetSslProxiesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.SetSslPolicyTargetSslProxyRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.SetSslPolicy(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} diff --git a/compute/apiv1/target_tcp_proxies_client.go b/compute/apiv1/target_tcp_proxies_client.go new file mode 100644 index 00000000000..f2631211628 --- /dev/null +++ b/compute/apiv1/target_tcp_proxies_client.go @@ -0,0 +1,496 @@ +// Copyright 2021 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/ioutil" + "net/http" + "net/url" + + gax "github.com/googleapis/gax-go/v2" + "google.golang.org/api/option" + "google.golang.org/api/option/internaloption" + httptransport "google.golang.org/api/transport/http" + computepb "google.golang.org/genproto/googleapis/cloud/compute/v1" + "google.golang.org/grpc" + "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/encoding/protojson" +) + +var newTargetTcpProxiesClientHook clientHook + +// TargetTcpProxiesCallOptions contains the retry settings for each method of TargetTcpProxiesClient. +type TargetTcpProxiesCallOptions struct { + Delete []gax.CallOption + Get []gax.CallOption + Insert []gax.CallOption + List []gax.CallOption + SetBackendService []gax.CallOption + SetProxyHeader []gax.CallOption +} + +// internalTargetTcpProxiesClient is an interface that defines the methods availaible from Google Compute Engine API. +type internalTargetTcpProxiesClient interface { + Close() error + setGoogleClientInfo(...string) + Connection() *grpc.ClientConn + Delete(context.Context, *computepb.DeleteTargetTcpProxyRequest, ...gax.CallOption) (*computepb.Operation, error) + Get(context.Context, *computepb.GetTargetTcpProxyRequest, ...gax.CallOption) (*computepb.TargetTcpProxy, error) + Insert(context.Context, *computepb.InsertTargetTcpProxyRequest, ...gax.CallOption) (*computepb.Operation, error) + List(context.Context, *computepb.ListTargetTcpProxiesRequest, ...gax.CallOption) (*computepb.TargetTcpProxyList, error) + SetBackendService(context.Context, *computepb.SetBackendServiceTargetTcpProxyRequest, ...gax.CallOption) (*computepb.Operation, error) + SetProxyHeader(context.Context, *computepb.SetProxyHeaderTargetTcpProxyRequest, ...gax.CallOption) (*computepb.Operation, error) +} + +// TargetTcpProxiesClient 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 TargetTcpProxies API. +type TargetTcpProxiesClient struct { + // The internal transport-dependent client. + internalClient internalTargetTcpProxiesClient + + // The call options for this service. + CallOptions *TargetTcpProxiesCallOptions +} + +// 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 *TargetTcpProxiesClient) 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 *TargetTcpProxiesClient) setGoogleClientInfo(keyval ...string) { + c.internalClient.setGoogleClientInfo(keyval...) +} + +// Connection returns a connection to the API service. +// +// Deprecated. +func (c *TargetTcpProxiesClient) Connection() *grpc.ClientConn { + return c.internalClient.Connection() +} + +// Delete deletes the specified TargetTcpProxy resource. +func (c *TargetTcpProxiesClient) Delete(ctx context.Context, req *computepb.DeleteTargetTcpProxyRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.Delete(ctx, req, opts...) +} + +// Get returns the specified TargetTcpProxy resource. Gets a list of available target TCP proxies by making a list() request. +func (c *TargetTcpProxiesClient) Get(ctx context.Context, req *computepb.GetTargetTcpProxyRequest, opts ...gax.CallOption) (*computepb.TargetTcpProxy, error) { + return c.internalClient.Get(ctx, req, opts...) +} + +// Insert creates a TargetTcpProxy resource in the specified project using the data included in the request. +func (c *TargetTcpProxiesClient) Insert(ctx context.Context, req *computepb.InsertTargetTcpProxyRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.Insert(ctx, req, opts...) +} + +// List retrieves the list of TargetTcpProxy resources available to the specified project. +func (c *TargetTcpProxiesClient) List(ctx context.Context, req *computepb.ListTargetTcpProxiesRequest, opts ...gax.CallOption) (*computepb.TargetTcpProxyList, error) { + return c.internalClient.List(ctx, req, opts...) +} + +// SetBackendService changes the BackendService for TargetTcpProxy. +func (c *TargetTcpProxiesClient) SetBackendService(ctx context.Context, req *computepb.SetBackendServiceTargetTcpProxyRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.SetBackendService(ctx, req, opts...) +} + +// SetProxyHeader changes the ProxyHeaderType for TargetTcpProxy. +func (c *TargetTcpProxiesClient) SetProxyHeader(ctx context.Context, req *computepb.SetProxyHeaderTargetTcpProxyRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.SetProxyHeader(ctx, req, opts...) +} + +// Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls. +type targetTcpProxiesRESTClient struct { + // The http endpoint to connect to. + endpoint string + + // The http client. + httpClient *http.Client + + // The x-goog-* metadata to be sent with each request. + xGoogMetadata metadata.MD +} + +// NewTargetTcpProxiesRESTClient creates a new target tcp proxies rest client. +// +// The TargetTcpProxies API. +func NewTargetTcpProxiesRESTClient(ctx context.Context, opts ...option.ClientOption) (*TargetTcpProxiesClient, error) { + clientOpts := append(defaultTargetTcpProxiesRESTClientOptions(), opts...) + httpClient, endpoint, err := httptransport.NewClient(ctx, clientOpts...) + if err != nil { + return nil, err + } + + c := &targetTcpProxiesRESTClient{ + endpoint: endpoint, + httpClient: httpClient, + } + c.setGoogleClientInfo() + + return &TargetTcpProxiesClient{internalClient: c, CallOptions: &TargetTcpProxiesCallOptions{}}, nil +} + +func defaultTargetTcpProxiesRESTClientOptions() []option.ClientOption { + return []option.ClientOption{ + internaloption.WithDefaultEndpoint("compute.googleapis.com"), + internaloption.WithDefaultMTLSEndpoint("compute.mtls.googleapis.com"), + internaloption.WithDefaultAudience("https://compute.googleapis.com/"), + internaloption.WithDefaultScopes(DefaultAuthScopes()...), + } +} + +// setGoogleClientInfo sets the name and version of the application in +// the `x-goog-api-client` header passed on each request. Intended for +// use by Google-written clients. +func (c *targetTcpProxiesRESTClient) setGoogleClientInfo(keyval ...string) { + kv := append([]string{"gl-go", versionGo()}, keyval...) + kv = append(kv, "gapic", versionClient, "gax", gax.Version, "rest", "UNKNOWN") + c.xGoogMetadata = metadata.Pairs("x-goog-api-client", gax.XGoogHeader(kv...)) +} + +// Close closes the connection to the API service. The user should invoke this when +// the client is no longer required. +func (c *targetTcpProxiesRESTClient) Close() error { + // Replace httpClient with nil to force cleanup. + c.httpClient = nil + return nil +} + +// Connection returns a connection to the API service. +// +// Deprecated. +func (c *targetTcpProxiesRESTClient) Connection() *grpc.ClientConn { + return nil +} + +// Delete deletes the specified TargetTcpProxy resource. +func (c *targetTcpProxiesRESTClient) Delete(ctx context.Context, req *computepb.DeleteTargetTcpProxyRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/global/targetTcpProxies/%v", req.GetProject(), req.GetTargetTcpProxy()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("DELETE", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Get returns the specified TargetTcpProxy resource. Gets a list of available target TCP proxies by making a list() request. +func (c *targetTcpProxiesRESTClient) Get(ctx context.Context, req *computepb.GetTargetTcpProxyRequest, opts ...gax.CallOption) (*computepb.TargetTcpProxy, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/global/targetTcpProxies/%v", req.GetProject(), req.GetTargetTcpProxy()) + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.TargetTcpProxy{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Insert creates a TargetTcpProxy resource in the specified project using the data included in the request. +func (c *targetTcpProxiesRESTClient) Insert(ctx context.Context, req *computepb.InsertTargetTcpProxyRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetTargetTcpProxyResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/global/targetTcpProxies", req.GetProject()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// List retrieves the list of TargetTcpProxy resources available to the specified project. +func (c *targetTcpProxiesRESTClient) List(ctx context.Context, req *computepb.ListTargetTcpProxiesRequest, opts ...gax.CallOption) (*computepb.TargetTcpProxyList, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/global/targetTcpProxies", 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() + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.TargetTcpProxyList{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// SetBackendService changes the BackendService for TargetTcpProxy. +func (c *targetTcpProxiesRESTClient) SetBackendService(ctx context.Context, req *computepb.SetBackendServiceTargetTcpProxyRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetTargetTcpProxiesSetBackendServiceRequestResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/global/targetTcpProxies/%v/setBackendService", req.GetProject(), req.GetTargetTcpProxy()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// SetProxyHeader changes the ProxyHeaderType for TargetTcpProxy. +func (c *targetTcpProxiesRESTClient) SetProxyHeader(ctx context.Context, req *computepb.SetProxyHeaderTargetTcpProxyRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetTargetTcpProxiesSetProxyHeaderRequestResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/global/targetTcpProxies/%v/setProxyHeader", req.GetProject(), req.GetTargetTcpProxy()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} diff --git a/compute/apiv1/target_tcp_proxies_client_example_test.go b/compute/apiv1/target_tcp_proxies_client_example_test.go new file mode 100644 index 00000000000..0e95e1f74eb --- /dev/null +++ b/compute/apiv1/target_tcp_proxies_client_example_test.go @@ -0,0 +1,150 @@ +// Copyright 2021 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_test + +import ( + "context" + + compute "cloud.google.com/go/compute/apiv1" + computepb "google.golang.org/genproto/googleapis/cloud/compute/v1" +) + +func ExampleNewTargetTcpProxiesRESTClient() { + ctx := context.Background() + c, err := compute.NewTargetTcpProxiesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + // TODO: Use client. + _ = c +} + +func ExampleTargetTcpProxiesClient_Delete() { + ctx := context.Background() + c, err := compute.NewTargetTcpProxiesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.DeleteTargetTcpProxyRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Delete(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleTargetTcpProxiesClient_Get() { + ctx := context.Background() + c, err := compute.NewTargetTcpProxiesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.GetTargetTcpProxyRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Get(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleTargetTcpProxiesClient_Insert() { + ctx := context.Background() + c, err := compute.NewTargetTcpProxiesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.InsertTargetTcpProxyRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Insert(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleTargetTcpProxiesClient_List() { + ctx := context.Background() + c, err := compute.NewTargetTcpProxiesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.ListTargetTcpProxiesRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.List(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleTargetTcpProxiesClient_SetBackendService() { + ctx := context.Background() + c, err := compute.NewTargetTcpProxiesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.SetBackendServiceTargetTcpProxyRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.SetBackendService(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleTargetTcpProxiesClient_SetProxyHeader() { + ctx := context.Background() + c, err := compute.NewTargetTcpProxiesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.SetProxyHeaderTargetTcpProxyRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.SetProxyHeader(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} diff --git a/compute/apiv1/target_vpn_gateways_client.go b/compute/apiv1/target_vpn_gateways_client.go new file mode 100644 index 00000000000..996e785297f --- /dev/null +++ b/compute/apiv1/target_vpn_gateways_client.go @@ -0,0 +1,452 @@ +// Copyright 2021 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/ioutil" + "net/http" + "net/url" + + gax "github.com/googleapis/gax-go/v2" + "google.golang.org/api/option" + "google.golang.org/api/option/internaloption" + httptransport "google.golang.org/api/transport/http" + computepb "google.golang.org/genproto/googleapis/cloud/compute/v1" + "google.golang.org/grpc" + "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/encoding/protojson" +) + +var newTargetVpnGatewaysClientHook clientHook + +// TargetVpnGatewaysCallOptions contains the retry settings for each method of TargetVpnGatewaysClient. +type TargetVpnGatewaysCallOptions struct { + AggregatedList []gax.CallOption + Delete []gax.CallOption + Get []gax.CallOption + Insert []gax.CallOption + List []gax.CallOption +} + +// internalTargetVpnGatewaysClient is an interface that defines the methods availaible from Google Compute Engine API. +type internalTargetVpnGatewaysClient interface { + Close() error + setGoogleClientInfo(...string) + Connection() *grpc.ClientConn + AggregatedList(context.Context, *computepb.AggregatedListTargetVpnGatewaysRequest, ...gax.CallOption) (*computepb.TargetVpnGatewayAggregatedList, error) + Delete(context.Context, *computepb.DeleteTargetVpnGatewayRequest, ...gax.CallOption) (*computepb.Operation, error) + Get(context.Context, *computepb.GetTargetVpnGatewayRequest, ...gax.CallOption) (*computepb.TargetVpnGateway, error) + Insert(context.Context, *computepb.InsertTargetVpnGatewayRequest, ...gax.CallOption) (*computepb.Operation, error) + List(context.Context, *computepb.ListTargetVpnGatewaysRequest, ...gax.CallOption) (*computepb.TargetVpnGatewayList, error) +} + +// TargetVpnGatewaysClient 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 TargetVpnGateways API. +type TargetVpnGatewaysClient struct { + // The internal transport-dependent client. + internalClient internalTargetVpnGatewaysClient + + // The call options for this service. + CallOptions *TargetVpnGatewaysCallOptions +} + +// 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 *TargetVpnGatewaysClient) 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 *TargetVpnGatewaysClient) setGoogleClientInfo(keyval ...string) { + c.internalClient.setGoogleClientInfo(keyval...) +} + +// Connection returns a connection to the API service. +// +// Deprecated. +func (c *TargetVpnGatewaysClient) Connection() *grpc.ClientConn { + return c.internalClient.Connection() +} + +// AggregatedList retrieves an aggregated list of target VPN gateways. +func (c *TargetVpnGatewaysClient) AggregatedList(ctx context.Context, req *computepb.AggregatedListTargetVpnGatewaysRequest, opts ...gax.CallOption) (*computepb.TargetVpnGatewayAggregatedList, error) { + return c.internalClient.AggregatedList(ctx, req, opts...) +} + +// Delete deletes the specified target VPN gateway. +func (c *TargetVpnGatewaysClient) Delete(ctx context.Context, req *computepb.DeleteTargetVpnGatewayRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.Delete(ctx, req, opts...) +} + +// Get returns the specified target VPN gateway. Gets a list of available target VPN gateways by making a list() request. +func (c *TargetVpnGatewaysClient) Get(ctx context.Context, req *computepb.GetTargetVpnGatewayRequest, opts ...gax.CallOption) (*computepb.TargetVpnGateway, error) { + return c.internalClient.Get(ctx, req, opts...) +} + +// Insert creates a target VPN gateway in the specified project and region using the data included in the request. +func (c *TargetVpnGatewaysClient) Insert(ctx context.Context, req *computepb.InsertTargetVpnGatewayRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.Insert(ctx, req, opts...) +} + +// List retrieves a list of target VPN gateways available to the specified project and region. +func (c *TargetVpnGatewaysClient) List(ctx context.Context, req *computepb.ListTargetVpnGatewaysRequest, opts ...gax.CallOption) (*computepb.TargetVpnGatewayList, error) { + return c.internalClient.List(ctx, req, opts...) +} + +// Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls. +type targetVpnGatewaysRESTClient struct { + // The http endpoint to connect to. + endpoint string + + // The http client. + httpClient *http.Client + + // The x-goog-* metadata to be sent with each request. + xGoogMetadata metadata.MD +} + +// NewTargetVpnGatewaysRESTClient creates a new target vpn gateways rest client. +// +// The TargetVpnGateways API. +func NewTargetVpnGatewaysRESTClient(ctx context.Context, opts ...option.ClientOption) (*TargetVpnGatewaysClient, error) { + clientOpts := append(defaultTargetVpnGatewaysRESTClientOptions(), opts...) + httpClient, endpoint, err := httptransport.NewClient(ctx, clientOpts...) + if err != nil { + return nil, err + } + + c := &targetVpnGatewaysRESTClient{ + endpoint: endpoint, + httpClient: httpClient, + } + c.setGoogleClientInfo() + + return &TargetVpnGatewaysClient{internalClient: c, CallOptions: &TargetVpnGatewaysCallOptions{}}, nil +} + +func defaultTargetVpnGatewaysRESTClientOptions() []option.ClientOption { + return []option.ClientOption{ + internaloption.WithDefaultEndpoint("compute.googleapis.com"), + internaloption.WithDefaultMTLSEndpoint("compute.mtls.googleapis.com"), + internaloption.WithDefaultAudience("https://compute.googleapis.com/"), + internaloption.WithDefaultScopes(DefaultAuthScopes()...), + } +} + +// setGoogleClientInfo sets the name and version of the application in +// the `x-goog-api-client` header passed on each request. Intended for +// use by Google-written clients. +func (c *targetVpnGatewaysRESTClient) setGoogleClientInfo(keyval ...string) { + kv := append([]string{"gl-go", versionGo()}, keyval...) + kv = append(kv, "gapic", versionClient, "gax", gax.Version, "rest", "UNKNOWN") + c.xGoogMetadata = metadata.Pairs("x-goog-api-client", gax.XGoogHeader(kv...)) +} + +// Close closes the connection to the API service. The user should invoke this when +// the client is no longer required. +func (c *targetVpnGatewaysRESTClient) Close() error { + // Replace httpClient with nil to force cleanup. + c.httpClient = nil + return nil +} + +// Connection returns a connection to the API service. +// +// Deprecated. +func (c *targetVpnGatewaysRESTClient) Connection() *grpc.ClientConn { + return nil +} + +// AggregatedList retrieves an aggregated list of target VPN gateways. +func (c *targetVpnGatewaysRESTClient) AggregatedList(ctx context.Context, req *computepb.AggregatedListTargetVpnGatewaysRequest, opts ...gax.CallOption) (*computepb.TargetVpnGatewayAggregatedList, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/aggregated/targetVpnGateways", req.GetProject()) + + params := url.Values{} + if req != nil && req.Filter != nil { + params.Add("filter", fmt.Sprintf("%v", req.GetFilter())) + } + if req != nil && req.IncludeAllScopes != nil { + params.Add("includeAllScopes", fmt.Sprintf("%v", req.GetIncludeAllScopes())) + } + 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() + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.TargetVpnGatewayAggregatedList{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Delete deletes the specified target VPN gateway. +func (c *targetVpnGatewaysRESTClient) Delete(ctx context.Context, req *computepb.DeleteTargetVpnGatewayRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/targetVpnGateways/%v", req.GetProject(), req.GetRegion(), req.GetTargetVpnGateway()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("DELETE", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Get returns the specified target VPN gateway. Gets a list of available target VPN gateways by making a list() request. +func (c *targetVpnGatewaysRESTClient) Get(ctx context.Context, req *computepb.GetTargetVpnGatewayRequest, opts ...gax.CallOption) (*computepb.TargetVpnGateway, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/targetVpnGateways/%v", req.GetProject(), req.GetRegion(), req.GetTargetVpnGateway()) + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.TargetVpnGateway{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Insert creates a target VPN gateway in the specified project and region using the data included in the request. +func (c *targetVpnGatewaysRESTClient) Insert(ctx context.Context, req *computepb.InsertTargetVpnGatewayRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetTargetVpnGatewayResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/targetVpnGateways", req.GetProject(), req.GetRegion()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// List retrieves a list of target VPN gateways available to the specified project and region. +func (c *targetVpnGatewaysRESTClient) List(ctx context.Context, req *computepb.ListTargetVpnGatewaysRequest, opts ...gax.CallOption) (*computepb.TargetVpnGatewayList, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/targetVpnGateways", 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() + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.TargetVpnGatewayList{} + + return rsp, unm.Unmarshal(buf, rsp) +} diff --git a/compute/apiv1/target_vpn_gateways_client_example_test.go b/compute/apiv1/target_vpn_gateways_client_example_test.go new file mode 100644 index 00000000000..1c8e35cd606 --- /dev/null +++ b/compute/apiv1/target_vpn_gateways_client_example_test.go @@ -0,0 +1,131 @@ +// Copyright 2021 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_test + +import ( + "context" + + compute "cloud.google.com/go/compute/apiv1" + computepb "google.golang.org/genproto/googleapis/cloud/compute/v1" +) + +func ExampleNewTargetVpnGatewaysRESTClient() { + ctx := context.Background() + c, err := compute.NewTargetVpnGatewaysRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + // TODO: Use client. + _ = c +} + +func ExampleTargetVpnGatewaysClient_AggregatedList() { + ctx := context.Background() + c, err := compute.NewTargetVpnGatewaysRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.AggregatedListTargetVpnGatewaysRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.AggregatedList(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleTargetVpnGatewaysClient_Delete() { + ctx := context.Background() + c, err := compute.NewTargetVpnGatewaysRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.DeleteTargetVpnGatewayRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Delete(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleTargetVpnGatewaysClient_Get() { + ctx := context.Background() + c, err := compute.NewTargetVpnGatewaysRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.GetTargetVpnGatewayRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Get(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleTargetVpnGatewaysClient_Insert() { + ctx := context.Background() + c, err := compute.NewTargetVpnGatewaysRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.InsertTargetVpnGatewayRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Insert(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleTargetVpnGatewaysClient_List() { + ctx := context.Background() + c, err := compute.NewTargetVpnGatewaysRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.ListTargetVpnGatewaysRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.List(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} diff --git a/compute/apiv1/url_maps_client.go b/compute/apiv1/url_maps_client.go new file mode 100644 index 00000000000..798e93645d9 --- /dev/null +++ b/compute/apiv1/url_maps_client.go @@ -0,0 +1,687 @@ +// Copyright 2021 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/ioutil" + "net/http" + "net/url" + + gax "github.com/googleapis/gax-go/v2" + "google.golang.org/api/option" + "google.golang.org/api/option/internaloption" + httptransport "google.golang.org/api/transport/http" + computepb "google.golang.org/genproto/googleapis/cloud/compute/v1" + "google.golang.org/grpc" + "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/encoding/protojson" +) + +var newUrlMapsClientHook clientHook + +// UrlMapsCallOptions contains the retry settings for each method of UrlMapsClient. +type UrlMapsCallOptions struct { + AggregatedList []gax.CallOption + Delete []gax.CallOption + Get []gax.CallOption + Insert []gax.CallOption + InvalidateCache []gax.CallOption + List []gax.CallOption + Patch []gax.CallOption + Update []gax.CallOption + Validate []gax.CallOption +} + +// internalUrlMapsClient is an interface that defines the methods availaible from Google Compute Engine API. +type internalUrlMapsClient interface { + Close() error + setGoogleClientInfo(...string) + Connection() *grpc.ClientConn + AggregatedList(context.Context, *computepb.AggregatedListUrlMapsRequest, ...gax.CallOption) (*computepb.UrlMapsAggregatedList, error) + Delete(context.Context, *computepb.DeleteUrlMapRequest, ...gax.CallOption) (*computepb.Operation, error) + Get(context.Context, *computepb.GetUrlMapRequest, ...gax.CallOption) (*computepb.UrlMap, error) + Insert(context.Context, *computepb.InsertUrlMapRequest, ...gax.CallOption) (*computepb.Operation, error) + InvalidateCache(context.Context, *computepb.InvalidateCacheUrlMapRequest, ...gax.CallOption) (*computepb.Operation, error) + List(context.Context, *computepb.ListUrlMapsRequest, ...gax.CallOption) (*computepb.UrlMapList, error) + Patch(context.Context, *computepb.PatchUrlMapRequest, ...gax.CallOption) (*computepb.Operation, error) + Update(context.Context, *computepb.UpdateUrlMapRequest, ...gax.CallOption) (*computepb.Operation, error) + Validate(context.Context, *computepb.ValidateUrlMapRequest, ...gax.CallOption) (*computepb.UrlMapsValidateResponse, error) +} + +// UrlMapsClient 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 UrlMaps API. +type UrlMapsClient struct { + // The internal transport-dependent client. + internalClient internalUrlMapsClient + + // The call options for this service. + CallOptions *UrlMapsCallOptions +} + +// 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 *UrlMapsClient) 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 *UrlMapsClient) setGoogleClientInfo(keyval ...string) { + c.internalClient.setGoogleClientInfo(keyval...) +} + +// Connection returns a connection to the API service. +// +// Deprecated. +func (c *UrlMapsClient) Connection() *grpc.ClientConn { + return c.internalClient.Connection() +} + +// AggregatedList retrieves the list of all UrlMap resources, regional and global, available to the specified project. +func (c *UrlMapsClient) AggregatedList(ctx context.Context, req *computepb.AggregatedListUrlMapsRequest, opts ...gax.CallOption) (*computepb.UrlMapsAggregatedList, error) { + return c.internalClient.AggregatedList(ctx, req, opts...) +} + +// Delete deletes the specified UrlMap resource. +func (c *UrlMapsClient) Delete(ctx context.Context, req *computepb.DeleteUrlMapRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.Delete(ctx, req, opts...) +} + +// Get returns the specified UrlMap resource. Gets a list of available URL maps by making a list() request. +func (c *UrlMapsClient) Get(ctx context.Context, req *computepb.GetUrlMapRequest, opts ...gax.CallOption) (*computepb.UrlMap, error) { + return c.internalClient.Get(ctx, req, opts...) +} + +// Insert creates a UrlMap resource in the specified project using the data included in the request. +func (c *UrlMapsClient) Insert(ctx context.Context, req *computepb.InsertUrlMapRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.Insert(ctx, req, opts...) +} + +// InvalidateCache initiates a cache invalidation operation, invalidating the specified path, scoped to the specified UrlMap. +// +// For more information, see Invalidating cached content (at /cdn/docs/invalidating-cached-content). +func (c *UrlMapsClient) InvalidateCache(ctx context.Context, req *computepb.InvalidateCacheUrlMapRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.InvalidateCache(ctx, req, opts...) +} + +// List retrieves the list of UrlMap resources available to the specified project. +func (c *UrlMapsClient) List(ctx context.Context, req *computepb.ListUrlMapsRequest, opts ...gax.CallOption) (*computepb.UrlMapList, error) { + return c.internalClient.List(ctx, req, opts...) +} + +// Patch patches the specified UrlMap resource with the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. +func (c *UrlMapsClient) Patch(ctx context.Context, req *computepb.PatchUrlMapRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.Patch(ctx, req, opts...) +} + +// Update updates the specified UrlMap resource with the data included in the request. +func (c *UrlMapsClient) Update(ctx context.Context, req *computepb.UpdateUrlMapRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.Update(ctx, req, opts...) +} + +// Validate runs static validation for the UrlMap. In particular, the tests of the provided UrlMap will be run. Calling this method does NOT create the UrlMap. +func (c *UrlMapsClient) Validate(ctx context.Context, req *computepb.ValidateUrlMapRequest, opts ...gax.CallOption) (*computepb.UrlMapsValidateResponse, error) { + return c.internalClient.Validate(ctx, req, opts...) +} + +// Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls. +type urlMapsRESTClient struct { + // The http endpoint to connect to. + endpoint string + + // The http client. + httpClient *http.Client + + // The x-goog-* metadata to be sent with each request. + xGoogMetadata metadata.MD +} + +// NewUrlMapsRESTClient creates a new url maps rest client. +// +// The UrlMaps API. +func NewUrlMapsRESTClient(ctx context.Context, opts ...option.ClientOption) (*UrlMapsClient, error) { + clientOpts := append(defaultUrlMapsRESTClientOptions(), opts...) + httpClient, endpoint, err := httptransport.NewClient(ctx, clientOpts...) + if err != nil { + return nil, err + } + + c := &urlMapsRESTClient{ + endpoint: endpoint, + httpClient: httpClient, + } + c.setGoogleClientInfo() + + return &UrlMapsClient{internalClient: c, CallOptions: &UrlMapsCallOptions{}}, nil +} + +func defaultUrlMapsRESTClientOptions() []option.ClientOption { + return []option.ClientOption{ + internaloption.WithDefaultEndpoint("compute.googleapis.com"), + internaloption.WithDefaultMTLSEndpoint("compute.mtls.googleapis.com"), + internaloption.WithDefaultAudience("https://compute.googleapis.com/"), + internaloption.WithDefaultScopes(DefaultAuthScopes()...), + } +} + +// setGoogleClientInfo sets the name and version of the application in +// the `x-goog-api-client` header passed on each request. Intended for +// use by Google-written clients. +func (c *urlMapsRESTClient) setGoogleClientInfo(keyval ...string) { + kv := append([]string{"gl-go", versionGo()}, keyval...) + kv = append(kv, "gapic", versionClient, "gax", gax.Version, "rest", "UNKNOWN") + c.xGoogMetadata = metadata.Pairs("x-goog-api-client", gax.XGoogHeader(kv...)) +} + +// Close closes the connection to the API service. The user should invoke this when +// the client is no longer required. +func (c *urlMapsRESTClient) Close() error { + // Replace httpClient with nil to force cleanup. + c.httpClient = nil + return nil +} + +// Connection returns a connection to the API service. +// +// Deprecated. +func (c *urlMapsRESTClient) Connection() *grpc.ClientConn { + return nil +} + +// AggregatedList retrieves the list of all UrlMap resources, regional and global, available to the specified project. +func (c *urlMapsRESTClient) AggregatedList(ctx context.Context, req *computepb.AggregatedListUrlMapsRequest, opts ...gax.CallOption) (*computepb.UrlMapsAggregatedList, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/aggregated/urlMaps", req.GetProject()) + + params := url.Values{} + if req != nil && req.Filter != nil { + params.Add("filter", fmt.Sprintf("%v", req.GetFilter())) + } + if req != nil && req.IncludeAllScopes != nil { + params.Add("includeAllScopes", fmt.Sprintf("%v", req.GetIncludeAllScopes())) + } + 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() + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.UrlMapsAggregatedList{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Delete deletes the specified UrlMap resource. +func (c *urlMapsRESTClient) Delete(ctx context.Context, req *computepb.DeleteUrlMapRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/global/urlMaps/%v", req.GetProject(), req.GetUrlMap()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("DELETE", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Get returns the specified UrlMap resource. Gets a list of available URL maps by making a list() request. +func (c *urlMapsRESTClient) Get(ctx context.Context, req *computepb.GetUrlMapRequest, opts ...gax.CallOption) (*computepb.UrlMap, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/global/urlMaps/%v", req.GetProject(), req.GetUrlMap()) + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.UrlMap{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Insert creates a UrlMap resource in the specified project using the data included in the request. +func (c *urlMapsRESTClient) Insert(ctx context.Context, req *computepb.InsertUrlMapRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetUrlMapResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/global/urlMaps", req.GetProject()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// InvalidateCache initiates a cache invalidation operation, invalidating the specified path, scoped to the specified UrlMap. +// +// For more information, see Invalidating cached content (at /cdn/docs/invalidating-cached-content). +func (c *urlMapsRESTClient) InvalidateCache(ctx context.Context, req *computepb.InvalidateCacheUrlMapRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetCacheInvalidationRuleResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/global/urlMaps/%v/invalidateCache", req.GetProject(), req.GetUrlMap()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// List retrieves the list of UrlMap resources available to the specified project. +func (c *urlMapsRESTClient) List(ctx context.Context, req *computepb.ListUrlMapsRequest, opts ...gax.CallOption) (*computepb.UrlMapList, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/global/urlMaps", 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() + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.UrlMapList{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Patch patches the specified UrlMap resource with the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. +func (c *urlMapsRESTClient) Patch(ctx context.Context, req *computepb.PatchUrlMapRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetUrlMapResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/global/urlMaps/%v", req.GetProject(), req.GetUrlMap()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("PATCH", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Update updates the specified UrlMap resource with the data included in the request. +func (c *urlMapsRESTClient) Update(ctx context.Context, req *computepb.UpdateUrlMapRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetUrlMapResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("") + + params := url.Values{} + if req.GetProject() != "" { + params.Add("project", fmt.Sprintf("%v", req.GetProject())) + } + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + if req.GetUrlMap() != "" { + params.Add("urlMap", fmt.Sprintf("%v", req.GetUrlMap())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("PUT", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Validate runs static validation for the UrlMap. In particular, the tests of the provided UrlMap will be run. Calling this method does NOT create the UrlMap. +func (c *urlMapsRESTClient) Validate(ctx context.Context, req *computepb.ValidateUrlMapRequest, opts ...gax.CallOption) (*computepb.UrlMapsValidateResponse, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetUrlMapsValidateRequestResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/global/urlMaps/%v/validate", req.GetProject(), req.GetUrlMap()) + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.UrlMapsValidateResponse{} + + return rsp, unm.Unmarshal(buf, rsp) +} diff --git a/compute/apiv1/url_maps_client_example_test.go b/compute/apiv1/url_maps_client_example_test.go new file mode 100644 index 00000000000..d6f8304d1e7 --- /dev/null +++ b/compute/apiv1/url_maps_client_example_test.go @@ -0,0 +1,207 @@ +// Copyright 2021 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_test + +import ( + "context" + + compute "cloud.google.com/go/compute/apiv1" + computepb "google.golang.org/genproto/googleapis/cloud/compute/v1" +) + +func ExampleNewUrlMapsRESTClient() { + ctx := context.Background() + c, err := compute.NewUrlMapsRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + // TODO: Use client. + _ = c +} + +func ExampleUrlMapsClient_AggregatedList() { + ctx := context.Background() + c, err := compute.NewUrlMapsRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.AggregatedListUrlMapsRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.AggregatedList(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleUrlMapsClient_Delete() { + ctx := context.Background() + c, err := compute.NewUrlMapsRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.DeleteUrlMapRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Delete(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleUrlMapsClient_Get() { + ctx := context.Background() + c, err := compute.NewUrlMapsRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.GetUrlMapRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Get(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleUrlMapsClient_Insert() { + ctx := context.Background() + c, err := compute.NewUrlMapsRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.InsertUrlMapRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Insert(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleUrlMapsClient_InvalidateCache() { + ctx := context.Background() + c, err := compute.NewUrlMapsRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.InvalidateCacheUrlMapRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.InvalidateCache(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleUrlMapsClient_List() { + ctx := context.Background() + c, err := compute.NewUrlMapsRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.ListUrlMapsRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.List(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleUrlMapsClient_Patch() { + ctx := context.Background() + c, err := compute.NewUrlMapsRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.PatchUrlMapRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Patch(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleUrlMapsClient_Update() { + ctx := context.Background() + c, err := compute.NewUrlMapsRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.UpdateUrlMapRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Update(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleUrlMapsClient_Validate() { + ctx := context.Background() + c, err := compute.NewUrlMapsRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.ValidateUrlMapRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Validate(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} diff --git a/compute/apiv1/vpn_gateways_client.go b/compute/apiv1/vpn_gateways_client.go new file mode 100644 index 00000000000..80eb318a484 --- /dev/null +++ b/compute/apiv1/vpn_gateways_client.go @@ -0,0 +1,611 @@ +// Copyright 2021 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/ioutil" + "net/http" + "net/url" + + gax "github.com/googleapis/gax-go/v2" + "google.golang.org/api/option" + "google.golang.org/api/option/internaloption" + httptransport "google.golang.org/api/transport/http" + computepb "google.golang.org/genproto/googleapis/cloud/compute/v1" + "google.golang.org/grpc" + "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/encoding/protojson" +) + +var newVpnGatewaysClientHook clientHook + +// VpnGatewaysCallOptions contains the retry settings for each method of VpnGatewaysClient. +type VpnGatewaysCallOptions struct { + AggregatedList []gax.CallOption + Delete []gax.CallOption + Get []gax.CallOption + GetStatus []gax.CallOption + Insert []gax.CallOption + List []gax.CallOption + SetLabels []gax.CallOption + TestIamPermissions []gax.CallOption +} + +// internalVpnGatewaysClient is an interface that defines the methods availaible from Google Compute Engine API. +type internalVpnGatewaysClient interface { + Close() error + setGoogleClientInfo(...string) + Connection() *grpc.ClientConn + AggregatedList(context.Context, *computepb.AggregatedListVpnGatewaysRequest, ...gax.CallOption) (*computepb.VpnGatewayAggregatedList, error) + Delete(context.Context, *computepb.DeleteVpnGatewayRequest, ...gax.CallOption) (*computepb.Operation, error) + Get(context.Context, *computepb.GetVpnGatewayRequest, ...gax.CallOption) (*computepb.VpnGateway, error) + GetStatus(context.Context, *computepb.GetStatusVpnGatewayRequest, ...gax.CallOption) (*computepb.VpnGatewaysGetStatusResponse, error) + Insert(context.Context, *computepb.InsertVpnGatewayRequest, ...gax.CallOption) (*computepb.Operation, error) + List(context.Context, *computepb.ListVpnGatewaysRequest, ...gax.CallOption) (*computepb.VpnGatewayList, error) + SetLabels(context.Context, *computepb.SetLabelsVpnGatewayRequest, ...gax.CallOption) (*computepb.Operation, error) + TestIamPermissions(context.Context, *computepb.TestIamPermissionsVpnGatewayRequest, ...gax.CallOption) (*computepb.TestPermissionsResponse, error) +} + +// VpnGatewaysClient 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 VpnGateways API. +type VpnGatewaysClient struct { + // The internal transport-dependent client. + internalClient internalVpnGatewaysClient + + // The call options for this service. + CallOptions *VpnGatewaysCallOptions +} + +// 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 *VpnGatewaysClient) 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 *VpnGatewaysClient) setGoogleClientInfo(keyval ...string) { + c.internalClient.setGoogleClientInfo(keyval...) +} + +// Connection returns a connection to the API service. +// +// Deprecated. +func (c *VpnGatewaysClient) Connection() *grpc.ClientConn { + return c.internalClient.Connection() +} + +// AggregatedList retrieves an aggregated list of VPN gateways. +func (c *VpnGatewaysClient) AggregatedList(ctx context.Context, req *computepb.AggregatedListVpnGatewaysRequest, opts ...gax.CallOption) (*computepb.VpnGatewayAggregatedList, error) { + return c.internalClient.AggregatedList(ctx, req, opts...) +} + +// Delete deletes the specified VPN gateway. +func (c *VpnGatewaysClient) Delete(ctx context.Context, req *computepb.DeleteVpnGatewayRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.Delete(ctx, req, opts...) +} + +// Get returns the specified VPN gateway. Gets a list of available VPN gateways by making a list() request. +func (c *VpnGatewaysClient) Get(ctx context.Context, req *computepb.GetVpnGatewayRequest, opts ...gax.CallOption) (*computepb.VpnGateway, error) { + return c.internalClient.Get(ctx, req, opts...) +} + +// GetStatus returns the status for the specified VPN gateway. +func (c *VpnGatewaysClient) GetStatus(ctx context.Context, req *computepb.GetStatusVpnGatewayRequest, opts ...gax.CallOption) (*computepb.VpnGatewaysGetStatusResponse, error) { + return c.internalClient.GetStatus(ctx, req, opts...) +} + +// Insert creates a VPN gateway in the specified project and region using the data included in the request. +func (c *VpnGatewaysClient) Insert(ctx context.Context, req *computepb.InsertVpnGatewayRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.Insert(ctx, req, opts...) +} + +// List retrieves a list of VPN gateways available to the specified project and region. +func (c *VpnGatewaysClient) List(ctx context.Context, req *computepb.ListVpnGatewaysRequest, opts ...gax.CallOption) (*computepb.VpnGatewayList, error) { + return c.internalClient.List(ctx, req, opts...) +} + +// SetLabels sets the labels on a VpnGateway. To learn more about labels, read the Labeling Resources documentation. +func (c *VpnGatewaysClient) SetLabels(ctx context.Context, req *computepb.SetLabelsVpnGatewayRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.SetLabels(ctx, req, opts...) +} + +// TestIamPermissions returns permissions that a caller has on the specified resource. +func (c *VpnGatewaysClient) TestIamPermissions(ctx context.Context, req *computepb.TestIamPermissionsVpnGatewayRequest, opts ...gax.CallOption) (*computepb.TestPermissionsResponse, error) { + return c.internalClient.TestIamPermissions(ctx, req, opts...) +} + +// Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls. +type vpnGatewaysRESTClient struct { + // The http endpoint to connect to. + endpoint string + + // The http client. + httpClient *http.Client + + // The x-goog-* metadata to be sent with each request. + xGoogMetadata metadata.MD +} + +// NewVpnGatewaysRESTClient creates a new vpn gateways rest client. +// +// The VpnGateways API. +func NewVpnGatewaysRESTClient(ctx context.Context, opts ...option.ClientOption) (*VpnGatewaysClient, error) { + clientOpts := append(defaultVpnGatewaysRESTClientOptions(), opts...) + httpClient, endpoint, err := httptransport.NewClient(ctx, clientOpts...) + if err != nil { + return nil, err + } + + c := &vpnGatewaysRESTClient{ + endpoint: endpoint, + httpClient: httpClient, + } + c.setGoogleClientInfo() + + return &VpnGatewaysClient{internalClient: c, CallOptions: &VpnGatewaysCallOptions{}}, nil +} + +func defaultVpnGatewaysRESTClientOptions() []option.ClientOption { + return []option.ClientOption{ + internaloption.WithDefaultEndpoint("compute.googleapis.com"), + internaloption.WithDefaultMTLSEndpoint("compute.mtls.googleapis.com"), + internaloption.WithDefaultAudience("https://compute.googleapis.com/"), + internaloption.WithDefaultScopes(DefaultAuthScopes()...), + } +} + +// setGoogleClientInfo sets the name and version of the application in +// the `x-goog-api-client` header passed on each request. Intended for +// use by Google-written clients. +func (c *vpnGatewaysRESTClient) setGoogleClientInfo(keyval ...string) { + kv := append([]string{"gl-go", versionGo()}, keyval...) + kv = append(kv, "gapic", versionClient, "gax", gax.Version, "rest", "UNKNOWN") + c.xGoogMetadata = metadata.Pairs("x-goog-api-client", gax.XGoogHeader(kv...)) +} + +// Close closes the connection to the API service. The user should invoke this when +// the client is no longer required. +func (c *vpnGatewaysRESTClient) Close() error { + // Replace httpClient with nil to force cleanup. + c.httpClient = nil + return nil +} + +// Connection returns a connection to the API service. +// +// Deprecated. +func (c *vpnGatewaysRESTClient) Connection() *grpc.ClientConn { + return nil +} + +// AggregatedList retrieves an aggregated list of VPN gateways. +func (c *vpnGatewaysRESTClient) AggregatedList(ctx context.Context, req *computepb.AggregatedListVpnGatewaysRequest, opts ...gax.CallOption) (*computepb.VpnGatewayAggregatedList, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/aggregated/vpnGateways", req.GetProject()) + + params := url.Values{} + if req != nil && req.Filter != nil { + params.Add("filter", fmt.Sprintf("%v", req.GetFilter())) + } + if req != nil && req.IncludeAllScopes != nil { + params.Add("includeAllScopes", fmt.Sprintf("%v", req.GetIncludeAllScopes())) + } + 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() + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.VpnGatewayAggregatedList{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Delete deletes the specified VPN gateway. +func (c *vpnGatewaysRESTClient) Delete(ctx context.Context, req *computepb.DeleteVpnGatewayRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/vpnGateways/%v", req.GetProject(), req.GetRegion(), req.GetVpnGateway()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("DELETE", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Get returns the specified VPN gateway. Gets a list of available VPN gateways by making a list() request. +func (c *vpnGatewaysRESTClient) Get(ctx context.Context, req *computepb.GetVpnGatewayRequest, opts ...gax.CallOption) (*computepb.VpnGateway, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/vpnGateways/%v", req.GetProject(), req.GetRegion(), req.GetVpnGateway()) + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.VpnGateway{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// GetStatus returns the status for the specified VPN gateway. +func (c *vpnGatewaysRESTClient) GetStatus(ctx context.Context, req *computepb.GetStatusVpnGatewayRequest, opts ...gax.CallOption) (*computepb.VpnGatewaysGetStatusResponse, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/vpnGateways/%v/getStatus", req.GetProject(), req.GetRegion(), req.GetVpnGateway()) + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.VpnGatewaysGetStatusResponse{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Insert creates a VPN gateway in the specified project and region using the data included in the request. +func (c *vpnGatewaysRESTClient) Insert(ctx context.Context, req *computepb.InsertVpnGatewayRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetVpnGatewayResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/vpnGateways", req.GetProject(), req.GetRegion()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// List retrieves a list of VPN gateways available to the specified project and region. +func (c *vpnGatewaysRESTClient) List(ctx context.Context, req *computepb.ListVpnGatewaysRequest, opts ...gax.CallOption) (*computepb.VpnGatewayList, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/vpnGateways", 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() + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.VpnGatewayList{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// SetLabels sets the labels on a VpnGateway. To learn more about labels, read the Labeling Resources documentation. +func (c *vpnGatewaysRESTClient) SetLabels(ctx context.Context, req *computepb.SetLabelsVpnGatewayRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetRegionSetLabelsRequestResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/vpnGateways/%v/setLabels", req.GetProject(), req.GetRegion(), req.GetResource()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// TestIamPermissions returns permissions that a caller has on the specified resource. +func (c *vpnGatewaysRESTClient) TestIamPermissions(ctx context.Context, req *computepb.TestIamPermissionsVpnGatewayRequest, opts ...gax.CallOption) (*computepb.TestPermissionsResponse, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetTestPermissionsRequestResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/vpnGateways/%v/testIamPermissions", req.GetProject(), req.GetRegion(), req.GetResource()) + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.TestPermissionsResponse{} + + return rsp, unm.Unmarshal(buf, rsp) +} diff --git a/compute/apiv1/vpn_gateways_client_example_test.go b/compute/apiv1/vpn_gateways_client_example_test.go new file mode 100644 index 00000000000..74b8ecf2f1a --- /dev/null +++ b/compute/apiv1/vpn_gateways_client_example_test.go @@ -0,0 +1,188 @@ +// Copyright 2021 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_test + +import ( + "context" + + compute "cloud.google.com/go/compute/apiv1" + computepb "google.golang.org/genproto/googleapis/cloud/compute/v1" +) + +func ExampleNewVpnGatewaysRESTClient() { + ctx := context.Background() + c, err := compute.NewVpnGatewaysRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + // TODO: Use client. + _ = c +} + +func ExampleVpnGatewaysClient_AggregatedList() { + ctx := context.Background() + c, err := compute.NewVpnGatewaysRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.AggregatedListVpnGatewaysRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.AggregatedList(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleVpnGatewaysClient_Delete() { + ctx := context.Background() + c, err := compute.NewVpnGatewaysRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.DeleteVpnGatewayRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Delete(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleVpnGatewaysClient_Get() { + ctx := context.Background() + c, err := compute.NewVpnGatewaysRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.GetVpnGatewayRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Get(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleVpnGatewaysClient_GetStatus() { + ctx := context.Background() + c, err := compute.NewVpnGatewaysRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.GetStatusVpnGatewayRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.GetStatus(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleVpnGatewaysClient_Insert() { + ctx := context.Background() + c, err := compute.NewVpnGatewaysRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.InsertVpnGatewayRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Insert(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleVpnGatewaysClient_List() { + ctx := context.Background() + c, err := compute.NewVpnGatewaysRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.ListVpnGatewaysRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.List(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleVpnGatewaysClient_SetLabels() { + ctx := context.Background() + c, err := compute.NewVpnGatewaysRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.SetLabelsVpnGatewayRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.SetLabels(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleVpnGatewaysClient_TestIamPermissions() { + ctx := context.Background() + c, err := compute.NewVpnGatewaysRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.TestIamPermissionsVpnGatewayRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.TestIamPermissions(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} diff --git a/compute/apiv1/vpn_tunnels_client.go b/compute/apiv1/vpn_tunnels_client.go new file mode 100644 index 00000000000..718d75406b2 --- /dev/null +++ b/compute/apiv1/vpn_tunnels_client.go @@ -0,0 +1,452 @@ +// Copyright 2021 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/ioutil" + "net/http" + "net/url" + + gax "github.com/googleapis/gax-go/v2" + "google.golang.org/api/option" + "google.golang.org/api/option/internaloption" + httptransport "google.golang.org/api/transport/http" + computepb "google.golang.org/genproto/googleapis/cloud/compute/v1" + "google.golang.org/grpc" + "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/encoding/protojson" +) + +var newVpnTunnelsClientHook clientHook + +// VpnTunnelsCallOptions contains the retry settings for each method of VpnTunnelsClient. +type VpnTunnelsCallOptions struct { + AggregatedList []gax.CallOption + Delete []gax.CallOption + Get []gax.CallOption + Insert []gax.CallOption + List []gax.CallOption +} + +// internalVpnTunnelsClient is an interface that defines the methods availaible from Google Compute Engine API. +type internalVpnTunnelsClient interface { + Close() error + setGoogleClientInfo(...string) + Connection() *grpc.ClientConn + AggregatedList(context.Context, *computepb.AggregatedListVpnTunnelsRequest, ...gax.CallOption) (*computepb.VpnTunnelAggregatedList, error) + Delete(context.Context, *computepb.DeleteVpnTunnelRequest, ...gax.CallOption) (*computepb.Operation, error) + Get(context.Context, *computepb.GetVpnTunnelRequest, ...gax.CallOption) (*computepb.VpnTunnel, error) + Insert(context.Context, *computepb.InsertVpnTunnelRequest, ...gax.CallOption) (*computepb.Operation, error) + List(context.Context, *computepb.ListVpnTunnelsRequest, ...gax.CallOption) (*computepb.VpnTunnelList, error) +} + +// VpnTunnelsClient 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 VpnTunnels API. +type VpnTunnelsClient struct { + // The internal transport-dependent client. + internalClient internalVpnTunnelsClient + + // The call options for this service. + CallOptions *VpnTunnelsCallOptions +} + +// 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 *VpnTunnelsClient) 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 *VpnTunnelsClient) setGoogleClientInfo(keyval ...string) { + c.internalClient.setGoogleClientInfo(keyval...) +} + +// Connection returns a connection to the API service. +// +// Deprecated. +func (c *VpnTunnelsClient) Connection() *grpc.ClientConn { + return c.internalClient.Connection() +} + +// AggregatedList retrieves an aggregated list of VPN tunnels. +func (c *VpnTunnelsClient) AggregatedList(ctx context.Context, req *computepb.AggregatedListVpnTunnelsRequest, opts ...gax.CallOption) (*computepb.VpnTunnelAggregatedList, error) { + return c.internalClient.AggregatedList(ctx, req, opts...) +} + +// Delete deletes the specified VpnTunnel resource. +func (c *VpnTunnelsClient) Delete(ctx context.Context, req *computepb.DeleteVpnTunnelRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.Delete(ctx, req, opts...) +} + +// Get returns the specified VpnTunnel resource. Gets a list of available VPN tunnels by making a list() request. +func (c *VpnTunnelsClient) Get(ctx context.Context, req *computepb.GetVpnTunnelRequest, opts ...gax.CallOption) (*computepb.VpnTunnel, error) { + return c.internalClient.Get(ctx, req, opts...) +} + +// Insert creates a VpnTunnel resource in the specified project and region using the data included in the request. +func (c *VpnTunnelsClient) Insert(ctx context.Context, req *computepb.InsertVpnTunnelRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.Insert(ctx, req, opts...) +} + +// List retrieves a list of VpnTunnel resources contained in the specified project and region. +func (c *VpnTunnelsClient) List(ctx context.Context, req *computepb.ListVpnTunnelsRequest, opts ...gax.CallOption) (*computepb.VpnTunnelList, error) { + return c.internalClient.List(ctx, req, opts...) +} + +// Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls. +type vpnTunnelsRESTClient struct { + // The http endpoint to connect to. + endpoint string + + // The http client. + httpClient *http.Client + + // The x-goog-* metadata to be sent with each request. + xGoogMetadata metadata.MD +} + +// NewVpnTunnelsRESTClient creates a new vpn tunnels rest client. +// +// The VpnTunnels API. +func NewVpnTunnelsRESTClient(ctx context.Context, opts ...option.ClientOption) (*VpnTunnelsClient, error) { + clientOpts := append(defaultVpnTunnelsRESTClientOptions(), opts...) + httpClient, endpoint, err := httptransport.NewClient(ctx, clientOpts...) + if err != nil { + return nil, err + } + + c := &vpnTunnelsRESTClient{ + endpoint: endpoint, + httpClient: httpClient, + } + c.setGoogleClientInfo() + + return &VpnTunnelsClient{internalClient: c, CallOptions: &VpnTunnelsCallOptions{}}, nil +} + +func defaultVpnTunnelsRESTClientOptions() []option.ClientOption { + return []option.ClientOption{ + internaloption.WithDefaultEndpoint("compute.googleapis.com"), + internaloption.WithDefaultMTLSEndpoint("compute.mtls.googleapis.com"), + internaloption.WithDefaultAudience("https://compute.googleapis.com/"), + internaloption.WithDefaultScopes(DefaultAuthScopes()...), + } +} + +// setGoogleClientInfo sets the name and version of the application in +// the `x-goog-api-client` header passed on each request. Intended for +// use by Google-written clients. +func (c *vpnTunnelsRESTClient) setGoogleClientInfo(keyval ...string) { + kv := append([]string{"gl-go", versionGo()}, keyval...) + kv = append(kv, "gapic", versionClient, "gax", gax.Version, "rest", "UNKNOWN") + c.xGoogMetadata = metadata.Pairs("x-goog-api-client", gax.XGoogHeader(kv...)) +} + +// Close closes the connection to the API service. The user should invoke this when +// the client is no longer required. +func (c *vpnTunnelsRESTClient) Close() error { + // Replace httpClient with nil to force cleanup. + c.httpClient = nil + return nil +} + +// Connection returns a connection to the API service. +// +// Deprecated. +func (c *vpnTunnelsRESTClient) Connection() *grpc.ClientConn { + return nil +} + +// AggregatedList retrieves an aggregated list of VPN tunnels. +func (c *vpnTunnelsRESTClient) AggregatedList(ctx context.Context, req *computepb.AggregatedListVpnTunnelsRequest, opts ...gax.CallOption) (*computepb.VpnTunnelAggregatedList, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/aggregated/vpnTunnels", req.GetProject()) + + params := url.Values{} + if req != nil && req.Filter != nil { + params.Add("filter", fmt.Sprintf("%v", req.GetFilter())) + } + if req != nil && req.IncludeAllScopes != nil { + params.Add("includeAllScopes", fmt.Sprintf("%v", req.GetIncludeAllScopes())) + } + 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() + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.VpnTunnelAggregatedList{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Delete deletes the specified VpnTunnel resource. +func (c *vpnTunnelsRESTClient) Delete(ctx context.Context, req *computepb.DeleteVpnTunnelRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/vpnTunnels/%v", req.GetProject(), req.GetRegion(), req.GetVpnTunnel()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("DELETE", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Get returns the specified VpnTunnel resource. Gets a list of available VPN tunnels by making a list() request. +func (c *vpnTunnelsRESTClient) Get(ctx context.Context, req *computepb.GetVpnTunnelRequest, opts ...gax.CallOption) (*computepb.VpnTunnel, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/vpnTunnels/%v", req.GetProject(), req.GetRegion(), req.GetVpnTunnel()) + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.VpnTunnel{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Insert creates a VpnTunnel resource in the specified project and region using the data included in the request. +func (c *vpnTunnelsRESTClient) Insert(ctx context.Context, req *computepb.InsertVpnTunnelRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + body := req.GetVpnTunnelResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/vpnTunnels", req.GetProject(), req.GetRegion()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// List retrieves a list of VpnTunnel resources contained in the specified project and region. +func (c *vpnTunnelsRESTClient) List(ctx context.Context, req *computepb.ListVpnTunnelsRequest, opts ...gax.CallOption) (*computepb.VpnTunnelList, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/vpnTunnels", 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() + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.VpnTunnelList{} + + return rsp, unm.Unmarshal(buf, rsp) +} diff --git a/compute/apiv1/vpn_tunnels_client_example_test.go b/compute/apiv1/vpn_tunnels_client_example_test.go new file mode 100644 index 00000000000..d5354e683ee --- /dev/null +++ b/compute/apiv1/vpn_tunnels_client_example_test.go @@ -0,0 +1,131 @@ +// Copyright 2021 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_test + +import ( + "context" + + compute "cloud.google.com/go/compute/apiv1" + computepb "google.golang.org/genproto/googleapis/cloud/compute/v1" +) + +func ExampleNewVpnTunnelsRESTClient() { + ctx := context.Background() + c, err := compute.NewVpnTunnelsRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + // TODO: Use client. + _ = c +} + +func ExampleVpnTunnelsClient_AggregatedList() { + ctx := context.Background() + c, err := compute.NewVpnTunnelsRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.AggregatedListVpnTunnelsRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.AggregatedList(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleVpnTunnelsClient_Delete() { + ctx := context.Background() + c, err := compute.NewVpnTunnelsRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.DeleteVpnTunnelRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Delete(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleVpnTunnelsClient_Get() { + ctx := context.Background() + c, err := compute.NewVpnTunnelsRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.GetVpnTunnelRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Get(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleVpnTunnelsClient_Insert() { + ctx := context.Background() + c, err := compute.NewVpnTunnelsRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.InsertVpnTunnelRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Insert(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleVpnTunnelsClient_List() { + ctx := context.Background() + c, err := compute.NewVpnTunnelsRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.ListVpnTunnelsRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.List(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} diff --git a/compute/apiv1/zone_operations_client.go b/compute/apiv1/zone_operations_client.go new file mode 100644 index 00000000000..e77c5b33300 --- /dev/null +++ b/compute/apiv1/zone_operations_client.go @@ -0,0 +1,377 @@ +// Copyright 2021 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/ioutil" + "net/http" + "net/url" + + gax "github.com/googleapis/gax-go/v2" + "google.golang.org/api/option" + "google.golang.org/api/option/internaloption" + httptransport "google.golang.org/api/transport/http" + computepb "google.golang.org/genproto/googleapis/cloud/compute/v1" + "google.golang.org/grpc" + "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/encoding/protojson" +) + +var newZoneOperationsClientHook clientHook + +// ZoneOperationsCallOptions contains the retry settings for each method of ZoneOperationsClient. +type ZoneOperationsCallOptions struct { + Delete []gax.CallOption + Get []gax.CallOption + List []gax.CallOption + Wait []gax.CallOption +} + +// internalZoneOperationsClient is an interface that defines the methods availaible from Google Compute Engine API. +type internalZoneOperationsClient interface { + Close() error + setGoogleClientInfo(...string) + Connection() *grpc.ClientConn + Delete(context.Context, *computepb.DeleteZoneOperationRequest, ...gax.CallOption) (*computepb.DeleteZoneOperationResponse, error) + Get(context.Context, *computepb.GetZoneOperationRequest, ...gax.CallOption) (*computepb.Operation, error) + List(context.Context, *computepb.ListZoneOperationsRequest, ...gax.CallOption) (*computepb.OperationList, error) + Wait(context.Context, *computepb.WaitZoneOperationRequest, ...gax.CallOption) (*computepb.Operation, error) +} + +// ZoneOperationsClient 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 ZoneOperations API. +type ZoneOperationsClient struct { + // The internal transport-dependent client. + internalClient internalZoneOperationsClient + + // The call options for this service. + CallOptions *ZoneOperationsCallOptions +} + +// 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 *ZoneOperationsClient) 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 *ZoneOperationsClient) setGoogleClientInfo(keyval ...string) { + c.internalClient.setGoogleClientInfo(keyval...) +} + +// Connection returns a connection to the API service. +// +// Deprecated. +func (c *ZoneOperationsClient) Connection() *grpc.ClientConn { + return c.internalClient.Connection() +} + +// Delete deletes the specified zone-specific Operations resource. +func (c *ZoneOperationsClient) Delete(ctx context.Context, req *computepb.DeleteZoneOperationRequest, opts ...gax.CallOption) (*computepb.DeleteZoneOperationResponse, error) { + return c.internalClient.Delete(ctx, req, opts...) +} + +// Get retrieves the specified zone-specific Operations resource. +func (c *ZoneOperationsClient) Get(ctx context.Context, req *computepb.GetZoneOperationRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.Get(ctx, req, opts...) +} + +// List retrieves a list of Operation resources contained within the specified zone. +func (c *ZoneOperationsClient) List(ctx context.Context, req *computepb.ListZoneOperationsRequest, opts ...gax.CallOption) (*computepb.OperationList, error) { + return c.internalClient.List(ctx, req, opts...) +} + +// Wait waits for the specified Operation resource to return as DONE or for the request to approach the 2 minute deadline, and retrieves the specified Operation resource. This method differs from the GET method in that it waits for no more than the default deadline (2 minutes) and then returns the current state of the operation, which might be DONE or still in progress. +// +// This method is called on a best-effort basis. Specifically: +// +// In uncommon cases, when the server is overloaded, the request might return before the default deadline is reached, or might return after zero seconds. +// +// If the default deadline is reached, there is no guarantee that the operation is actually done when the method returns. Be prepared to retry if the operation is not DONE. +func (c *ZoneOperationsClient) Wait(ctx context.Context, req *computepb.WaitZoneOperationRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + return c.internalClient.Wait(ctx, req, opts...) +} + +// Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls. +type zoneOperationsRESTClient struct { + // The http endpoint to connect to. + endpoint string + + // The http client. + httpClient *http.Client + + // The x-goog-* metadata to be sent with each request. + xGoogMetadata metadata.MD +} + +// NewZoneOperationsRESTClient creates a new zone operations rest client. +// +// The ZoneOperations API. +func NewZoneOperationsRESTClient(ctx context.Context, opts ...option.ClientOption) (*ZoneOperationsClient, error) { + clientOpts := append(defaultZoneOperationsRESTClientOptions(), opts...) + httpClient, endpoint, err := httptransport.NewClient(ctx, clientOpts...) + if err != nil { + return nil, err + } + + c := &zoneOperationsRESTClient{ + endpoint: endpoint, + httpClient: httpClient, + } + c.setGoogleClientInfo() + + return &ZoneOperationsClient{internalClient: c, CallOptions: &ZoneOperationsCallOptions{}}, nil +} + +func defaultZoneOperationsRESTClientOptions() []option.ClientOption { + return []option.ClientOption{ + internaloption.WithDefaultEndpoint("compute.googleapis.com"), + internaloption.WithDefaultMTLSEndpoint("compute.mtls.googleapis.com"), + internaloption.WithDefaultAudience("https://compute.googleapis.com/"), + internaloption.WithDefaultScopes(DefaultAuthScopes()...), + } +} + +// setGoogleClientInfo sets the name and version of the application in +// the `x-goog-api-client` header passed on each request. Intended for +// use by Google-written clients. +func (c *zoneOperationsRESTClient) setGoogleClientInfo(keyval ...string) { + kv := append([]string{"gl-go", versionGo()}, keyval...) + kv = append(kv, "gapic", versionClient, "gax", gax.Version, "rest", "UNKNOWN") + c.xGoogMetadata = metadata.Pairs("x-goog-api-client", gax.XGoogHeader(kv...)) +} + +// Close closes the connection to the API service. The user should invoke this when +// the client is no longer required. +func (c *zoneOperationsRESTClient) Close() error { + // Replace httpClient with nil to force cleanup. + c.httpClient = nil + return nil +} + +// Connection returns a connection to the API service. +// +// Deprecated. +func (c *zoneOperationsRESTClient) Connection() *grpc.ClientConn { + return nil +} + +// Delete deletes the specified zone-specific Operations resource. +func (c *zoneOperationsRESTClient) Delete(ctx context.Context, req *computepb.DeleteZoneOperationRequest, opts ...gax.CallOption) (*computepb.DeleteZoneOperationResponse, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/zones/%v/operations/%v", req.GetProject(), req.GetZone(), req.GetOperation()) + + httpReq, err := http.NewRequest("DELETE", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.DeleteZoneOperationResponse{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Get retrieves the specified zone-specific Operations resource. +func (c *zoneOperationsRESTClient) Get(ctx context.Context, req *computepb.GetZoneOperationRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/zones/%v/operations/%v", req.GetProject(), req.GetZone(), req.GetOperation()) + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// List retrieves a list of Operation resources contained within the specified zone. +func (c *zoneOperationsRESTClient) List(ctx context.Context, req *computepb.ListZoneOperationsRequest, opts ...gax.CallOption) (*computepb.OperationList, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/zones/%v/operations", req.GetProject(), req.GetZone()) + + 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() + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.OperationList{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// Wait waits for the specified Operation resource to return as DONE or for the request to approach the 2 minute deadline, and retrieves the specified Operation resource. This method differs from the GET method in that it waits for no more than the default deadline (2 minutes) and then returns the current state of the operation, which might be DONE or still in progress. +// +// This method is called on a best-effort basis. Specifically: +// +// In uncommon cases, when the server is overloaded, the request might return before the default deadline is reached, or might return after zero seconds. +// +// If the default deadline is reached, there is no guarantee that the operation is actually done when the method returns. Be prepared to retry if the operation is not DONE. +func (c *zoneOperationsRESTClient) Wait(ctx context.Context, req *computepb.WaitZoneOperationRequest, opts ...gax.CallOption) (*computepb.Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/zones/%v/operations/%v/wait", req.GetProject(), req.GetZone(), req.GetOperation()) + + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Operation{} + + return rsp, unm.Unmarshal(buf, rsp) +} diff --git a/compute/apiv1/zone_operations_client_example_test.go b/compute/apiv1/zone_operations_client_example_test.go new file mode 100644 index 00000000000..f7f1c346c63 --- /dev/null +++ b/compute/apiv1/zone_operations_client_example_test.go @@ -0,0 +1,112 @@ +// Copyright 2021 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_test + +import ( + "context" + + compute "cloud.google.com/go/compute/apiv1" + computepb "google.golang.org/genproto/googleapis/cloud/compute/v1" +) + +func ExampleNewZoneOperationsRESTClient() { + ctx := context.Background() + c, err := compute.NewZoneOperationsRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + // TODO: Use client. + _ = c +} + +func ExampleZoneOperationsClient_Delete() { + ctx := context.Background() + c, err := compute.NewZoneOperationsRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.DeleteZoneOperationRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Delete(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleZoneOperationsClient_Get() { + ctx := context.Background() + c, err := compute.NewZoneOperationsRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.GetZoneOperationRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Get(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleZoneOperationsClient_List() { + ctx := context.Background() + c, err := compute.NewZoneOperationsRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.ListZoneOperationsRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.List(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleZoneOperationsClient_Wait() { + ctx := context.Background() + c, err := compute.NewZoneOperationsRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.WaitZoneOperationRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Wait(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} diff --git a/compute/apiv1/zones_client.go b/compute/apiv1/zones_client.go new file mode 100644 index 00000000000..bc02f75e4b6 --- /dev/null +++ b/compute/apiv1/zones_client.go @@ -0,0 +1,265 @@ +// Copyright 2021 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/ioutil" + "net/http" + "net/url" + + gax "github.com/googleapis/gax-go/v2" + "google.golang.org/api/option" + "google.golang.org/api/option/internaloption" + httptransport "google.golang.org/api/transport/http" + computepb "google.golang.org/genproto/googleapis/cloud/compute/v1" + "google.golang.org/grpc" + "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/encoding/protojson" +) + +var newZonesClientHook clientHook + +// ZonesCallOptions contains the retry settings for each method of ZonesClient. +type ZonesCallOptions struct { + Get []gax.CallOption + List []gax.CallOption +} + +// internalZonesClient is an interface that defines the methods availaible from Google Compute Engine API. +type internalZonesClient interface { + Close() error + setGoogleClientInfo(...string) + Connection() *grpc.ClientConn + Get(context.Context, *computepb.GetZoneRequest, ...gax.CallOption) (*computepb.Zone, error) + List(context.Context, *computepb.ListZonesRequest, ...gax.CallOption) (*computepb.ZoneList, error) +} + +// ZonesClient 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 Zones API. +type ZonesClient struct { + // The internal transport-dependent client. + internalClient internalZonesClient + + // The call options for this service. + CallOptions *ZonesCallOptions +} + +// 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 *ZonesClient) 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 *ZonesClient) setGoogleClientInfo(keyval ...string) { + c.internalClient.setGoogleClientInfo(keyval...) +} + +// Connection returns a connection to the API service. +// +// Deprecated. +func (c *ZonesClient) Connection() *grpc.ClientConn { + return c.internalClient.Connection() +} + +// Get returns the specified Zone resource. Gets a list of available zones by making a list() request. +func (c *ZonesClient) Get(ctx context.Context, req *computepb.GetZoneRequest, opts ...gax.CallOption) (*computepb.Zone, error) { + return c.internalClient.Get(ctx, req, opts...) +} + +// List retrieves the list of Zone resources available to the specified project. +func (c *ZonesClient) List(ctx context.Context, req *computepb.ListZonesRequest, opts ...gax.CallOption) (*computepb.ZoneList, error) { + return c.internalClient.List(ctx, req, opts...) +} + +// Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls. +type zonesRESTClient struct { + // The http endpoint to connect to. + endpoint string + + // The http client. + httpClient *http.Client + + // The x-goog-* metadata to be sent with each request. + xGoogMetadata metadata.MD +} + +// NewZonesRESTClient creates a new zones rest client. +// +// The Zones API. +func NewZonesRESTClient(ctx context.Context, opts ...option.ClientOption) (*ZonesClient, error) { + clientOpts := append(defaultZonesRESTClientOptions(), opts...) + httpClient, endpoint, err := httptransport.NewClient(ctx, clientOpts...) + if err != nil { + return nil, err + } + + c := &zonesRESTClient{ + endpoint: endpoint, + httpClient: httpClient, + } + c.setGoogleClientInfo() + + return &ZonesClient{internalClient: c, CallOptions: &ZonesCallOptions{}}, nil +} + +func defaultZonesRESTClientOptions() []option.ClientOption { + return []option.ClientOption{ + internaloption.WithDefaultEndpoint("compute.googleapis.com"), + internaloption.WithDefaultMTLSEndpoint("compute.mtls.googleapis.com"), + internaloption.WithDefaultAudience("https://compute.googleapis.com/"), + internaloption.WithDefaultScopes(DefaultAuthScopes()...), + } +} + +// setGoogleClientInfo sets the name and version of the application in +// the `x-goog-api-client` header passed on each request. Intended for +// use by Google-written clients. +func (c *zonesRESTClient) setGoogleClientInfo(keyval ...string) { + kv := append([]string{"gl-go", versionGo()}, keyval...) + kv = append(kv, "gapic", versionClient, "gax", gax.Version, "rest", "UNKNOWN") + c.xGoogMetadata = metadata.Pairs("x-goog-api-client", gax.XGoogHeader(kv...)) +} + +// Close closes the connection to the API service. The user should invoke this when +// the client is no longer required. +func (c *zonesRESTClient) Close() error { + // Replace httpClient with nil to force cleanup. + c.httpClient = nil + return nil +} + +// Connection returns a connection to the API service. +// +// Deprecated. +func (c *zonesRESTClient) Connection() *grpc.ClientConn { + return nil +} + +// Get returns the specified Zone resource. Gets a list of available zones by making a list() request. +func (c *zonesRESTClient) Get(ctx context.Context, req *computepb.GetZoneRequest, opts ...gax.CallOption) (*computepb.Zone, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/zones/%v", req.GetProject(), req.GetZone()) + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.Zone{} + + return rsp, unm.Unmarshal(buf, rsp) +} + +// List retrieves the list of Zone resources available to the specified project. +func (c *zonesRESTClient) List(ctx context.Context, req *computepb.ListZonesRequest, opts ...gax.CallOption) (*computepb.ZoneList, error) { + m := protojson.MarshalOptions{AllowPartial: true, EmitUnpopulated: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, _ := url.Parse(c.endpoint) + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/zones", 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() + + httpReq, err := http.NewRequest("GET", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return nil, err + } + httpReq = httpReq.WithContext(ctx) + // Set the headers + for k, v := range c.xGoogMetadata { + httpReq.Header[k] = v + } + httpReq.Header["Content-Type"] = []string{"application/json"} + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return nil, err + } + defer httpRsp.Body.Close() + + if httpRsp.StatusCode != http.StatusOK { + return nil, fmt.Errorf(httpRsp.Status) + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return nil, err + } + + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + rsp := &computepb.ZoneList{} + + return rsp, unm.Unmarshal(buf, rsp) +} diff --git a/compute/apiv1/zones_client_example_test.go b/compute/apiv1/zones_client_example_test.go new file mode 100644 index 00000000000..109f4704bb8 --- /dev/null +++ b/compute/apiv1/zones_client_example_test.go @@ -0,0 +1,74 @@ +// Copyright 2021 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_test + +import ( + "context" + + compute "cloud.google.com/go/compute/apiv1" + computepb "google.golang.org/genproto/googleapis/cloud/compute/v1" +) + +func ExampleNewZonesRESTClient() { + ctx := context.Background() + c, err := compute.NewZonesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + // TODO: Use client. + _ = c +} + +func ExampleZonesClient_Get() { + ctx := context.Background() + c, err := compute.NewZonesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.GetZoneRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.Get(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleZonesClient_List() { + ctx := context.Background() + c, err := compute.NewZonesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.ListZonesRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.List(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} diff --git a/internal/.repo-metadata-full.json b/internal/.repo-metadata-full.json index 1d782ddcefa..4e9f7ec2c64 100644 --- a/internal/.repo-metadata-full.json +++ b/internal/.repo-metadata-full.json @@ -314,6 +314,15 @@ "release_level": "beta", "library_type": "" }, + "cloud.google.com/go/compute/apiv1": { + "distribution_name": "cloud.google.com/go/compute/apiv1", + "description": "Google Compute Engine API", + "language": "Go", + "client_library_type": "generated", + "docs_url": "https://cloud.google.com/go/docs/reference/cloud.google.com/go/latest/compute/apiv1", + "release_level": "alpha", + "library_type": "" + }, "cloud.google.com/go/compute/metadata": { "distribution_name": "cloud.google.com/go/compute/metadata", "description": "Service Metadata API", From 0ef2a3b88e6341277ff5d14cf651e3b2e9a47106 Mon Sep 17 00:00:00 2001 From: yoshi-code-bot <70984784+yoshi-code-bot@users.noreply.github.com> Date: Thu, 1 Jul 2021 13:19:37 -0700 Subject: [PATCH 45/50] chore: release 0.86.0 (#4367) Co-authored-by: Cody Oss <6331106+codyoss@users.noreply.github.com> --- CHANGES.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CHANGES.md b/CHANGES.md index e2db8879fb4..b0d936c6057 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,5 +1,12 @@ # Changes +## [0.86.0](https://www.github.com/googleapis/google-cloud-go/compare/v0.85.0...v0.86.0) (2021-07-01) + + +### Features + +* **bigquery managedwriter:** schema conversion support ([#4357](https://www.github.com/googleapis/google-cloud-go/issues/4357)) ([f2b20f4](https://www.github.com/googleapis/google-cloud-go/commit/f2b20f493e2ed5a883ce42fa65695c03c574feb5)) + ## [0.85.0](https://www.github.com/googleapis/google-cloud-go/compare/v0.84.0...v0.85.0) (2021-06-30) From ef019401630c089ae81400d6eefdafc914312c2b Mon Sep 17 00:00:00 2001 From: tmdiep Date: Fri, 2 Jul 2021 07:02:31 +1000 Subject: [PATCH 46/50] test(pubsublite): testing support for operations (#4361) --- pubsublite/internal/test/mock.go | 53 ++++++++++++++++++++++++---- pubsublite/internal/test/util.go | 12 +++++++ pubsublite/internal/wire/rpc_test.go | 18 +++------- 3 files changed, 63 insertions(+), 20 deletions(-) diff --git a/pubsublite/internal/test/mock.go b/pubsublite/internal/test/mock.go index 425cda76c37..7ff8275d8ec 100644 --- a/pubsublite/internal/test/mock.go +++ b/pubsublite/internal/test/mock.go @@ -29,6 +29,7 @@ import ( emptypb "github.com/golang/protobuf/ptypes/empty" pb "google.golang.org/genproto/googleapis/cloud/pubsublite/v1" + lrpb "google.golang.org/genproto/googleapis/longrunning" ) // MockServer is an in-memory mock implementation of a Pub/Sub Lite service, @@ -62,6 +63,7 @@ func NewServer() (*Server, error) { pb.RegisterSubscriberServiceServer(srv.Gsrv, liteServer) pb.RegisterCursorServiceServer(srv.Gsrv, liteServer) pb.RegisterPartitionAssignmentServiceServer(srv.Gsrv, liteServer) + lrpb.RegisterOperationsServer(srv.Gsrv, liteServer) srv.Start() return &Server{LiteServer: liteServer, gRPCServer: srv}, nil } @@ -87,6 +89,7 @@ type mockLiteServer struct { pb.SubscriberServiceServer pb.CursorServiceServer pb.PartitionAssignmentServiceServer + lrpb.OperationsServer mu sync.Mutex @@ -277,7 +280,7 @@ func (s *mockLiteServer) doTopicResponse(ctx context.Context, req interface{}) ( } resp, ok := retResponse.(*pb.Topic) if !ok { - return nil, status.Errorf(codes.FailedPrecondition, "mockserver: invalid response type %v", reflect.TypeOf(retResponse)) + return nil, status.Errorf(codes.FailedPrecondition, "mockserver: invalid response type %T", retResponse) } return resp, nil } @@ -289,7 +292,19 @@ func (s *mockLiteServer) doSubscriptionResponse(ctx context.Context, req interfa } resp, ok := retResponse.(*pb.Subscription) if !ok { - return nil, status.Errorf(codes.FailedPrecondition, "mockserver: invalid response type %v", reflect.TypeOf(retResponse)) + return nil, status.Errorf(codes.FailedPrecondition, "mockserver: invalid response type %T", retResponse) + } + return resp, nil +} + +func (s *mockLiteServer) doOperationResponse(ctx context.Context, req interface{}) (*lrpb.Operation, error) { + retResponse, retErr := s.popGlobalVerifiers(req) + if retErr != nil { + return nil, retErr + } + resp, ok := retResponse.(*lrpb.Operation) + if !ok { + return nil, status.Errorf(codes.FailedPrecondition, "mockserver: invalid response type %T", retResponse) } return resp, nil } @@ -301,7 +316,7 @@ func (s *mockLiteServer) doEmptyResponse(ctx context.Context, req interface{}) ( } resp, ok := retResponse.(*emptypb.Empty) if !ok { - return nil, status.Errorf(codes.FailedPrecondition, "mockserver: invalid response type %v", reflect.TypeOf(retResponse)) + return nil, status.Errorf(codes.FailedPrecondition, "mockserver: invalid response type %T", retResponse) } return resp, nil } @@ -325,7 +340,7 @@ func (s *mockLiteServer) GetTopicPartitions(ctx context.Context, req *pb.GetTopi } resp, ok := retResponse.(*pb.TopicPartitions) if !ok { - return nil, status.Errorf(codes.FailedPrecondition, "mockserver: invalid response type %v", reflect.TypeOf(retResponse)) + return nil, status.Errorf(codes.FailedPrecondition, "mockserver: invalid response type %T", retResponse) } return resp, nil } @@ -346,6 +361,10 @@ func (s *mockLiteServer) UpdateSubscription(ctx context.Context, req *pb.UpdateS return s.doSubscriptionResponse(ctx, req) } +func (s *mockLiteServer) SeekSubscription(ctx context.Context, req *pb.SeekSubscriptionRequest) (*lrpb.Operation, error) { + return s.doOperationResponse(ctx, req) +} + func (s *mockLiteServer) DeleteSubscription(ctx context.Context, req *pb.DeleteSubscriptionRequest) (*emptypb.Empty, error) { return s.doEmptyResponse(ctx, req) } @@ -357,7 +376,7 @@ func (s *mockLiteServer) ListTopics(ctx context.Context, req *pb.ListTopicsReque } resp, ok := retResponse.(*pb.ListTopicsResponse) if !ok { - return nil, status.Errorf(codes.FailedPrecondition, "mockserver: invalid response type %v", reflect.TypeOf(retResponse)) + return nil, status.Errorf(codes.FailedPrecondition, "mockserver: invalid response type %T", retResponse) } return resp, nil } @@ -369,7 +388,7 @@ func (s *mockLiteServer) ListTopicSubscriptions(ctx context.Context, req *pb.Lis } resp, ok := retResponse.(*pb.ListTopicSubscriptionsResponse) if !ok { - return nil, status.Errorf(codes.FailedPrecondition, "mockserver: invalid response type %v", reflect.TypeOf(retResponse)) + return nil, status.Errorf(codes.FailedPrecondition, "mockserver: invalid response type %T", retResponse) } return resp, nil } @@ -381,7 +400,27 @@ func (s *mockLiteServer) ListSubscriptions(ctx context.Context, req *pb.ListSubs } resp, ok := retResponse.(*pb.ListSubscriptionsResponse) if !ok { - return nil, status.Errorf(codes.FailedPrecondition, "mockserver: invalid response type %v", reflect.TypeOf(retResponse)) + return nil, status.Errorf(codes.FailedPrecondition, "mockserver: invalid response type %T", retResponse) } return resp, nil } + +func (s *mockLiteServer) GetOperation(ctx context.Context, req *lrpb.GetOperationRequest) (*lrpb.Operation, error) { + return s.doOperationResponse(ctx, req) +} + +func (s *mockLiteServer) ListOperations(ctx context.Context, req *lrpb.ListOperationsRequest) (*lrpb.ListOperationsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "Unexpected ListOperations call") +} + +func (s *mockLiteServer) DeleteOperation(ctx context.Context, req *lrpb.DeleteOperationRequest) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "Unexpected DeleteOperation call") +} + +func (s *mockLiteServer) CancelOperation(ctx context.Context, req *lrpb.CancelOperationRequest) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "Unexpected CancelOperation call") +} + +func (s *mockLiteServer) WaitOperation(ctx context.Context, req *lrpb.WaitOperationRequest) (*lrpb.Operation, error) { + return nil, status.Errorf(codes.Unimplemented, "Unexpected WaitOperation call") +} diff --git a/pubsublite/internal/test/util.go b/pubsublite/internal/test/util.go index 6a35095afdf..29afb9a35f8 100644 --- a/pubsublite/internal/test/util.go +++ b/pubsublite/internal/test/util.go @@ -14,6 +14,7 @@ package test import ( + "log" "strings" "github.com/google/go-cmp/cmp" @@ -21,6 +22,8 @@ import ( "golang.org/x/xerrors" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" + "google.golang.org/protobuf/proto" + "google.golang.org/protobuf/types/known/anypb" ) // ErrorEqual compares two errors for equivalence. @@ -54,3 +57,12 @@ func (f *FakeSource) Int63() int64 { return f.Ret } // Seed is unimplemented. func (f *FakeSource) Seed(seed int64) {} + +// MakeAny packs a message into an Any proto. +func MakeAny(msg proto.Message) *anypb.Any { + any, err := anypb.New(msg) + if err != nil { + log.Fatalf("Failed to make Any: %v", err) + } + return any +} diff --git a/pubsublite/internal/wire/rpc_test.go b/pubsublite/internal/wire/rpc_test.go index 850a946a76f..e624b9e70e2 100644 --- a/pubsublite/internal/wire/rpc_test.go +++ b/pubsublite/internal/wire/rpc_test.go @@ -16,10 +16,10 @@ package wire import ( "encoding/base64" "errors" - "log" "testing" "cloud.google.com/go/internal/testutil" + "cloud.google.com/go/pubsublite/internal/test" "google.golang.org/genproto/googleapis/rpc/errdetails" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" @@ -30,18 +30,10 @@ import ( spb "google.golang.org/genproto/googleapis/rpc/status" ) -func makeAny(msg proto.Message) *anypb.Any { - any, err := anypb.New(msg) - if err != nil { - log.Fatalf("Failed to make Any: %v", err) - } - return any -} - func makeStreamResetSignal() error { statuspb := &spb.Status{ Code: int32(codes.Aborted), - Details: []*anypb.Any{makeAny(&errdetails.ErrorInfo{ + Details: []*anypb.Any{test.MakeAny(&errdetails.ErrorInfo{ Reason: "RESET", Domain: "pubsublite.googleapis.com", })}, } @@ -63,7 +55,7 @@ func TestIsStreamResetSignal(t *testing.T) { desc: "non-retryable code", err: status.ErrorProto(&spb.Status{ Code: int32(codes.FailedPrecondition), - Details: []*anypb.Any{makeAny(&errdetails.ErrorInfo{Reason: "RESET", Domain: "pubsublite.googleapis.com"})}, + Details: []*anypb.Any{test.MakeAny(&errdetails.ErrorInfo{Reason: "RESET", Domain: "pubsublite.googleapis.com"})}, }), want: false, }, @@ -71,7 +63,7 @@ func TestIsStreamResetSignal(t *testing.T) { desc: "wrong domain", err: status.ErrorProto(&spb.Status{ Code: int32(codes.Aborted), - Details: []*anypb.Any{makeAny(&errdetails.ErrorInfo{Reason: "RESET"})}, + Details: []*anypb.Any{test.MakeAny(&errdetails.ErrorInfo{Reason: "RESET"})}, }), want: false, }, @@ -79,7 +71,7 @@ func TestIsStreamResetSignal(t *testing.T) { desc: "wrong reason", err: status.ErrorProto(&spb.Status{ Code: int32(codes.Aborted), - Details: []*anypb.Any{makeAny(&errdetails.ErrorInfo{Domain: "pubsublite.googleapis.com"})}, + Details: []*anypb.Any{test.MakeAny(&errdetails.ErrorInfo{Domain: "pubsublite.googleapis.com"})}, }), want: false, }, From 2b3bb856961c324c0717b460d50f7af0cd1fb046 Mon Sep 17 00:00:00 2001 From: tmdiep Date: Fri, 2 Jul 2021 07:24:14 +1000 Subject: [PATCH 47/50] refactor(pubsublite): internal utils for reservations (#4363) Adds ReservationPath and modifies LocationPath to support zones or regions. --- pubsublite/integration_test.go | 2 +- pubsublite/internal/wire/resources.go | 48 +++++++++++++++--- pubsublite/internal/wire/resources_test.go | 59 +++++++++++++++++++++- 3 files changed, 100 insertions(+), 9 deletions(-) diff --git a/pubsublite/integration_test.go b/pubsublite/integration_test.go index 80076f59a01..53aff1ba399 100644 --- a/pubsublite/integration_test.go +++ b/pubsublite/integration_test.go @@ -130,7 +130,7 @@ func TestIntegration_ResourceAdminOperations(t *testing.T) { region, _ := wire.ZoneToRegion(zone) resourceID := resourceIDs.New() - locationPath := wire.LocationPath{Project: proj, Zone: zone}.String() + locationPath := wire.LocationPath{Project: proj, Location: zone}.String() topicPath := wire.TopicPath{Project: proj, Zone: zone, TopicID: resourceID}.String() subscriptionPath := wire.SubscriptionPath{Project: proj, Zone: zone, SubscriptionID: resourceID}.String() t.Logf("Topic path: %s", topicPath) diff --git a/pubsublite/internal/wire/resources.go b/pubsublite/internal/wire/resources.go index 228d632235b..f76bf5cedaf 100644 --- a/pubsublite/internal/wire/resources.go +++ b/pubsublite/internal/wire/resources.go @@ -49,18 +49,18 @@ func ZoneToRegion(zone string) (string, error) { return zone[0:strings.LastIndex(zone, "-")], nil } -// LocationPath stores a path consisting of a project and zone. +// LocationPath stores a path consisting of a project and zone/region. type LocationPath struct { // A Google Cloud project. The project ID (e.g. "my-project") or the project // number (e.g. "987654321") can be provided. Project string - // A Google Cloud zone, for example "us-central1-a". - Zone string + // A Google Cloud zone or region, for example "us-central1-a", "us-central1". + Location string } func (l LocationPath) String() string { - return fmt.Sprintf("projects/%s/locations/%s", l.Project, l.Zone) + return fmt.Sprintf("projects/%s/locations/%s", l.Project, l.Location) } var locPathRE = regexp.MustCompile(`^projects/([^/]+)/locations/([^/]+)$`) @@ -72,7 +72,7 @@ func ParseLocationPath(input string) (LocationPath, error) { return LocationPath{}, fmt.Errorf("pubsublite: invalid location path %q. valid format is %q", input, "projects/PROJECT_ID/locations/ZONE") } - return LocationPath{Project: parts[1], Zone: parts[2]}, nil + return LocationPath{Project: parts[1], Location: parts[2]}, nil } // TopicPath stores the full path of a Pub/Sub Lite topic. @@ -94,7 +94,7 @@ func (t TopicPath) String() string { // Location returns the topic's location path. func (t TopicPath) Location() LocationPath { - return LocationPath{Project: t.Project, Zone: t.Zone} + return LocationPath{Project: t.Project, Location: t.Zone} } var topicPathRE = regexp.MustCompile(`^projects/([^/]+)/locations/([^/]+)/topics/([^/]+)$`) @@ -129,7 +129,7 @@ func (s SubscriptionPath) String() string { // Location returns the subscription's location path. func (s SubscriptionPath) Location() LocationPath { - return LocationPath{Project: s.Project, Zone: s.Zone} + return LocationPath{Project: s.Project, Location: s.Zone} } var subsPathRE = regexp.MustCompile(`^projects/([^/]+)/locations/([^/]+)/subscriptions/([^/]+)$`) @@ -144,6 +144,40 @@ func ParseSubscriptionPath(input string) (SubscriptionPath, error) { return SubscriptionPath{Project: parts[1], Zone: parts[2], SubscriptionID: parts[3]}, nil } +// ReservationPath stores the full path of a Pub/Sub Lite reservation. +type ReservationPath struct { + // A Google Cloud project. The project ID (e.g. "my-project") or the project + // number (e.g. "987654321") can be provided. + Project string + + // A Google Cloud region. An example region is "us-central1". + Region string + + // The ID of the Pub/Sub Lite reservation, for example "my-reservation-name". + ReservationID string +} + +func (r ReservationPath) String() string { + return fmt.Sprintf("projects/%s/locations/%s/reservations/%s", r.Project, r.Region, r.ReservationID) +} + +// Location returns the reservation's location path. +func (r ReservationPath) Location() LocationPath { + return LocationPath{Project: r.Project, Location: r.Region} +} + +var reservationPathRE = regexp.MustCompile(`^projects/([^/]+)/locations/([^/]+)/reservations/([^/]+)$`) + +// ParseReservationPath parses the full path of a Pub/Sub Lite reservation. +func ParseReservationPath(input string) (ReservationPath, error) { + parts := reservationPathRE.FindStringSubmatch(input) + if len(parts) < 4 { + return ReservationPath{}, fmt.Errorf("pubsublite: invalid reservation path %q. valid format is %q", + input, "projects/PROJECT_ID/locations/REGION/reservations/RESERVATION_ID") + } + return ReservationPath{Project: parts[1], Region: parts[2], ReservationID: parts[3]}, nil +} + type topicPartition struct { Path string Partition int diff --git a/pubsublite/internal/wire/resources_test.go b/pubsublite/internal/wire/resources_test.go index 40582ebbde8..45772fbcaf6 100644 --- a/pubsublite/internal/wire/resources_test.go +++ b/pubsublite/internal/wire/resources_test.go @@ -120,7 +120,7 @@ func TestParseLocationPath(t *testing.T) { { desc: "valid: location path", input: "projects/987654321/locations/europe-west1-d", - wantPath: LocationPath{Project: "987654321", Zone: "europe-west1-d"}, + wantPath: LocationPath{Project: "987654321", Location: "europe-west1-d"}, }, { desc: "invalid: zone", @@ -270,3 +270,60 @@ func TestParseSubscriptionPath(t *testing.T) { }) } } + +func TestParseReservationPath(t *testing.T) { + for _, tc := range []struct { + desc string + input string + wantPath ReservationPath + wantErr bool + }{ + { + desc: "valid: reservation path", + input: "projects/987654321/locations/europe-west1/reservations/my-reservation", + wantPath: ReservationPath{Project: "987654321", Region: "europe-west1", ReservationID: "my-reservation"}, + }, + { + desc: "invalid: region only", + input: "europe-west1", + wantErr: true, + }, + { + desc: "invalid: topic path", + input: "projects/987654321/locations/europe-west1-d/topics/my-topic", + wantErr: true, + }, + { + desc: "invalid: missing project", + input: "projects//locations/europe-west1/reservations/my-reservation", + wantErr: true, + }, + { + desc: "invalid: missing region", + input: "projects/987654321/locations//reservations/my-reservation", + wantErr: true, + }, + { + desc: "invalid: missing reservation id", + input: "projects/987654321/locations/europe-west1/reservations/", + wantErr: true, + }, + { + desc: "invalid: has prefix", + input: "prefix/projects/987654321/locations/europe-west1/reservations/my-reservation", + wantErr: true, + }, + { + desc: "invalid: has suffix", + input: "projects/my-project/locations/us-west1/reservations/my-reservation/subresource/desc", + wantErr: true, + }, + } { + t.Run(tc.desc, func(t *testing.T) { + gotPath, gotErr := ParseReservationPath(tc.input) + if gotPath != tc.wantPath || (gotErr != nil) != tc.wantErr { + t.Errorf("ParseReservationPath(%q) = (%v, %v), want (%v, err=%v)", tc.input, gotPath, gotErr, tc.wantPath, tc.wantErr) + } + }) + } +} From 7c07a3d332546828cdcc990a8e6a1beee7972548 Mon Sep 17 00:00:00 2001 From: tmdiep Date: Fri, 2 Jul 2021 07:55:51 +1000 Subject: [PATCH 48/50] test(pubsublite): testing support for reservations (#4362) --- pubsublite/internal/test/mock.go | 52 ++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) diff --git a/pubsublite/internal/test/mock.go b/pubsublite/internal/test/mock.go index 7ff8275d8ec..770e5b4c24d 100644 --- a/pubsublite/internal/test/mock.go +++ b/pubsublite/internal/test/mock.go @@ -309,6 +309,18 @@ func (s *mockLiteServer) doOperationResponse(ctx context.Context, req interface{ return resp, nil } +func (s *mockLiteServer) doReservationResponse(ctx context.Context, req interface{}) (*pb.Reservation, error) { + retResponse, retErr := s.popGlobalVerifiers(req) + if retErr != nil { + return nil, retErr + } + resp, ok := retResponse.(*pb.Reservation) + if !ok { + return nil, status.Errorf(codes.FailedPrecondition, "mockserver: invalid response type %T", retResponse) + } + return resp, nil +} + func (s *mockLiteServer) doEmptyResponse(ctx context.Context, req interface{}) (*emptypb.Empty, error) { retResponse, retErr := s.popGlobalVerifiers(req) if retErr != nil { @@ -369,6 +381,22 @@ func (s *mockLiteServer) DeleteSubscription(ctx context.Context, req *pb.DeleteS return s.doEmptyResponse(ctx, req) } +func (s *mockLiteServer) CreateReservation(ctx context.Context, req *pb.CreateReservationRequest) (*pb.Reservation, error) { + return s.doReservationResponse(ctx, req) +} + +func (s *mockLiteServer) GetReservation(ctx context.Context, req *pb.GetReservationRequest) (*pb.Reservation, error) { + return s.doReservationResponse(ctx, req) +} + +func (s *mockLiteServer) UpdateReservation(ctx context.Context, req *pb.UpdateReservationRequest) (*pb.Reservation, error) { + return s.doReservationResponse(ctx, req) +} + +func (s *mockLiteServer) DeleteReservation(ctx context.Context, req *pb.DeleteReservationRequest) (*emptypb.Empty, error) { + return s.doEmptyResponse(ctx, req) +} + func (s *mockLiteServer) ListTopics(ctx context.Context, req *pb.ListTopicsRequest) (*pb.ListTopicsResponse, error) { retResponse, retErr := s.popGlobalVerifiers(req) if retErr != nil { @@ -405,6 +433,30 @@ func (s *mockLiteServer) ListSubscriptions(ctx context.Context, req *pb.ListSubs return resp, nil } +func (s *mockLiteServer) ListReservations(ctx context.Context, req *pb.ListReservationsRequest) (*pb.ListReservationsResponse, error) { + retResponse, retErr := s.popGlobalVerifiers(req) + if retErr != nil { + return nil, retErr + } + resp, ok := retResponse.(*pb.ListReservationsResponse) + if !ok { + return nil, status.Errorf(codes.FailedPrecondition, "mockserver: invalid response type %T", retResponse) + } + return resp, nil +} + +func (s *mockLiteServer) ListReservationTopics(ctx context.Context, req *pb.ListReservationTopicsRequest) (*pb.ListReservationTopicsResponse, error) { + retResponse, retErr := s.popGlobalVerifiers(req) + if retErr != nil { + return nil, retErr + } + resp, ok := retResponse.(*pb.ListReservationTopicsResponse) + if !ok { + return nil, status.Errorf(codes.FailedPrecondition, "mockserver: invalid response type %T", retResponse) + } + return resp, nil +} + func (s *mockLiteServer) GetOperation(ctx context.Context, req *lrpb.GetOperationRequest) (*lrpb.Operation, error) { return s.doOperationResponse(ctx, req) } From 16b006a877024c80b692613547c8f36c896ebd30 Mon Sep 17 00:00:00 2001 From: yoshi-code-bot <70984784+yoshi-code-bot@users.noreply.github.com> Date: Thu, 1 Jul 2021 16:40:19 -0700 Subject: [PATCH 49/50] chore: release pubsub 1.12.1 (#4334) Co-authored-by: Alex Hong <9397363+hongalex@users.noreply.github.com> --- pubsub/CHANGES.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pubsub/CHANGES.md b/pubsub/CHANGES.md index 980d03596b9..6cfb5e026ef 100644 --- a/pubsub/CHANGES.md +++ b/pubsub/CHANGES.md @@ -1,5 +1,12 @@ # Changes +### [1.12.1](https://www.github.com/googleapis/google-cloud-go/compare/pubsub/v1.12.0...pubsub/v1.12.1) (2021-07-01) + + +### Bug Fixes + +* **pubsub:** retry GOAWAY errors ([#4313](https://www.github.com/googleapis/google-cloud-go/issues/4313)) ([7076fef](https://www.github.com/googleapis/google-cloud-go/commit/7076fef5fef81cce47dbfbab3d7257cc7d3776bc)) + ## [1.12.0](https://www.github.com/googleapis/google-cloud-go/compare/pubsub/v1.11.0...pubsub/v1.12.0) (2021-06-23) From 35d98c8cad3a71400c2b47218a0fb9c80154e613 Mon Sep 17 00:00:00 2001 From: tmdiep Date: Tue, 6 Jul 2021 12:09:35 +1000 Subject: [PATCH 50/50] fix(pubsublite): lower gRPC keepalive timeouts (#4378) --- pubsublite/internal/wire/rpc.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pubsublite/internal/wire/rpc.go b/pubsublite/internal/wire/rpc.go index 188f148bb9c..b77df47db41 100644 --- a/pubsublite/internal/wire/rpc.go +++ b/pubsublite/internal/wire/rpc.go @@ -183,9 +183,11 @@ func isStreamResetSignal(err error) bool { func defaultClientOptions(region string) []option.ClientOption { return []option.ClientOption{ internaloption.WithDefaultEndpoint(region + pubsubLiteDefaultEndpoint), - // Keep inactive connections alive. + // Detect if transport is still alive if there is inactivity. option.WithGRPCDialOption(grpc.WithKeepaliveParams(keepalive.ClientParameters{ - Time: 5 * time.Minute, + Time: 1 * time.Minute, + Timeout: 1 * time.Minute, + PermitWithoutStream: true, })), } }