all: auto-regenerate gapics
This is an auto-generated regeneration of the gapic clients by autogogen. Once
the corresponding genproto PR is submitted, autotogen will update this CL with
a newer dependency to the newer version of genproto and assign reviewers to
this CL.
If you have been assigned to review this CL, 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.
- +2 and submit this CL if you believe it's ready to ship.
Corresponding genproto PR: https://github.com/googleapis/go-genproto/pull/280
Change-Id: I4da72e8420a57420783ac7f01364f967c10f6450
Reviewed-on: https://code-review.googlesource.com/c/gocloud/+/49631
Reviewed-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Chris Broadfoot <cbro@google.com>
Reviewed-by: Cody Oss <codyoss@google.com>
diff --git a/asset/apiv1/doc.go b/asset/apiv1/doc.go
index 517e427..b9abbf9 100644
--- a/asset/apiv1/doc.go
+++ b/asset/apiv1/doc.go
@@ -43,7 +43,7 @@
"google.golang.org/grpc/metadata"
)
-const versionClient = "20191206"
+const versionClient = "20191216"
func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context {
out, _ := metadata.FromOutgoingContext(ctx)
diff --git a/asset/apiv1p2beta1/doc.go b/asset/apiv1p2beta1/doc.go
index 1e54b8f..c53c564 100644
--- a/asset/apiv1p2beta1/doc.go
+++ b/asset/apiv1p2beta1/doc.go
@@ -97,4 +97,4 @@
return "UNKNOWN"
}
-const versionClient = "20191206"
+const versionClient = "20191216"
diff --git a/automl/apiv1beta1/doc.go b/automl/apiv1beta1/doc.go
index 1c3a0a9..dc2b90c 100644
--- a/automl/apiv1beta1/doc.go
+++ b/automl/apiv1beta1/doc.go
@@ -98,4 +98,4 @@
return "UNKNOWN"
}
-const versionClient = "20191206"
+const versionClient = "20191216"
diff --git a/bigquery/datatransfer/apiv1/doc.go b/bigquery/datatransfer/apiv1/doc.go
index 66572ec..8b4ac4d 100644
--- a/bigquery/datatransfer/apiv1/doc.go
+++ b/bigquery/datatransfer/apiv1/doc.go
@@ -44,7 +44,7 @@
"google.golang.org/grpc/metadata"
)
-const versionClient = "20191206"
+const versionClient = "20191216"
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 77148fc..47e1526 100644
--- a/bigquery/go.mod
+++ b/bigquery/go.mod
@@ -10,8 +10,8 @@
github.com/googleapis/gax-go/v2 v2.0.5
golang.org/x/exp v0.0.0-20191129062945-2f5052295587 // indirect
golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f // indirect
- golang.org/x/tools v0.0.0-20191206204035-259af5ff87bd // indirect
+ golang.org/x/tools v0.0.0-20191216173652-a0e659d51361 // indirect
google.golang.org/api v0.14.0
- google.golang.org/genproto v0.0.0-20191206224255-0243a4be9c8f
+ google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1
google.golang.org/grpc v1.21.1
)
diff --git a/bigquery/go.sum b/bigquery/go.sum
index f325f36..6e6818c 100644
--- a/bigquery/go.sum
+++ b/bigquery/go.sum
@@ -58,6 +58,7 @@
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/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 h1:OeRHuibLsmZkFj773W4LcfAGsSxJgfPONhr8cmO+eLA=
@@ -82,6 +83,7 @@
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=
+golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg=
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=
@@ -135,9 +137,10 @@
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-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
-golang.org/x/tools v0.0.0-20191206204035-259af5ff87bd h1:Zc7EU2PqpsNeIfOoVA7hvQX4cS3YDJEs5KlfatT3hLo=
-golang.org/x/tools v0.0.0-20191206204035-259af5ff87bd/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
+golang.org/x/tools v0.0.0-20191216173652-a0e659d51361 h1:RIIXAeV6GvDBuADKumTODatUqANFZ+5BPMnzsy4hulY=
+golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
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=
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 h1:VGGbLNyPF7dvYHhcUGYBBGCRDDK0RRJAI6KCvo0CL+E=
@@ -160,8 +163,8 @@
google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc=
google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51 h1:Ex1mq5jaJof+kRnYi3SlYJ8KKa9Ao3NHyIT5XJ1gF6U=
google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8=
-google.golang.org/genproto v0.0.0-20191206224255-0243a4be9c8f h1:naitw5DILWPQvG0oG04mR9jF8fmKpRdW3E3zzKA4D0Y=
-google.golang.org/genproto v0.0.0-20191206224255-0243a4be9c8f/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
+google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1 h1:aQktFqmDE2yjveXJlVIfslDFmFnUXSqG0i6KRcJAeMc=
+google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
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 h1:j6XxA85m/6txkUCHvzlV5f+HBNl/1r5cZ2A/3IEFOO8=
diff --git a/bigquery/storage/apiv1beta1/doc.go b/bigquery/storage/apiv1beta1/doc.go
index 07d188e..ac12e27 100644
--- a/bigquery/storage/apiv1beta1/doc.go
+++ b/bigquery/storage/apiv1beta1/doc.go
@@ -41,7 +41,7 @@
"google.golang.org/grpc/metadata"
)
-const versionClient = "20191206"
+const versionClient = "20191216"
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 9f18dff..9544d62 100644
--- a/bigtable/go.mod
+++ b/bigtable/go.mod
@@ -15,10 +15,10 @@
golang.org/x/net v0.0.0-20191028085509-fe3aa8a45271 // indirect
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45
golang.org/x/sys v0.0.0-20191029155521-f43be2a4598c // indirect
- golang.org/x/tools v0.0.0-20191206204035-259af5ff87bd // indirect
+ golang.org/x/tools v0.0.0-20191216173652-a0e659d51361 // indirect
google.golang.org/api v0.14.0
google.golang.org/appengine v1.6.5 // indirect
- google.golang.org/genproto v0.0.0-20191206224255-0243a4be9c8f
+ google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1
google.golang.org/grpc v1.24.0
rsc.io/binaryregexp v0.2.0
)
diff --git a/bigtable/go.sum b/bigtable/go.sum
index 23cfbf3..53fcab2 100644
--- a/bigtable/go.sum
+++ b/bigtable/go.sum
@@ -71,6 +71,7 @@
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/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 h1:OeRHuibLsmZkFj773W4LcfAGsSxJgfPONhr8cmO+eLA=
@@ -99,6 +100,7 @@
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=
+golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg=
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=
@@ -159,9 +161,10 @@
golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5 h1:hKsoRgsbwY1NafxrwTs+k64bikrLBkAgPir1TNCj3Zs=
golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5/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-20191206204035-259af5ff87bd h1:Zc7EU2PqpsNeIfOoVA7hvQX4cS3YDJEs5KlfatT3hLo=
-golang.org/x/tools v0.0.0-20191206204035-259af5ff87bd/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
+golang.org/x/tools v0.0.0-20191216173652-a0e659d51361 h1:RIIXAeV6GvDBuADKumTODatUqANFZ+5BPMnzsy4hulY=
+golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
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=
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 h1:VGGbLNyPF7dvYHhcUGYBBGCRDDK0RRJAI6KCvo0CL+E=
@@ -191,8 +194,8 @@
google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8=
google.golang.org/genproto v0.0.0-20191028173616-919d9bdd9fe6 h1:UXl+Zk3jqqcbEVV7ace5lrt4YdA4tXiz3f/KbmD29Vo=
google.golang.org/genproto v0.0.0-20191028173616-919d9bdd9fe6/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
-google.golang.org/genproto v0.0.0-20191206224255-0243a4be9c8f h1:naitw5DILWPQvG0oG04mR9jF8fmKpRdW3E3zzKA4D0Y=
-google.golang.org/genproto v0.0.0-20191206224255-0243a4be9c8f/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
+google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1 h1:aQktFqmDE2yjveXJlVIfslDFmFnUXSqG0i6KRcJAeMc=
+google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
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 h1:j6XxA85m/6txkUCHvzlV5f+HBNl/1r5cZ2A/3IEFOO8=
diff --git a/cloudbuild/apiv1/doc.go b/cloudbuild/apiv1/doc.go
index a2c8e22..3014840 100644
--- a/cloudbuild/apiv1/doc.go
+++ b/cloudbuild/apiv1/doc.go
@@ -96,4 +96,4 @@
return "UNKNOWN"
}
-const versionClient = "20191206"
+const versionClient = "20191216"
diff --git a/cloudtasks/apiv2/doc.go b/cloudtasks/apiv2/doc.go
index e523791..ec948e0 100644
--- a/cloudtasks/apiv2/doc.go
+++ b/cloudtasks/apiv2/doc.go
@@ -41,7 +41,7 @@
"google.golang.org/grpc/metadata"
)
-const versionClient = "20191206"
+const versionClient = "20191216"
func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context {
out, _ := metadata.FromOutgoingContext(ctx)
diff --git a/cloudtasks/apiv2beta2/doc.go b/cloudtasks/apiv2beta2/doc.go
index ad47210..a621b11 100644
--- a/cloudtasks/apiv2beta2/doc.go
+++ b/cloudtasks/apiv2beta2/doc.go
@@ -43,7 +43,7 @@
"google.golang.org/grpc/metadata"
)
-const versionClient = "20191206"
+const versionClient = "20191216"
func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context {
out, _ := metadata.FromOutgoingContext(ctx)
diff --git a/cloudtasks/apiv2beta3/doc.go b/cloudtasks/apiv2beta3/doc.go
index 0996a48..5d200c4 100644
--- a/cloudtasks/apiv2beta3/doc.go
+++ b/cloudtasks/apiv2beta3/doc.go
@@ -43,7 +43,7 @@
"google.golang.org/grpc/metadata"
)
-const versionClient = "20191206"
+const versionClient = "20191216"
func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context {
out, _ := metadata.FromOutgoingContext(ctx)
diff --git a/containeranalysis/apiv1beta1/doc.go b/containeranalysis/apiv1beta1/doc.go
index 08a4c0a..38e7dd3 100644
--- a/containeranalysis/apiv1beta1/doc.go
+++ b/containeranalysis/apiv1beta1/doc.go
@@ -99,4 +99,4 @@
return "UNKNOWN"
}
-const versionClient = "20191206"
+const versionClient = "20191216"
diff --git a/dataproc/apiv1/autoscaling_policy_client.go b/dataproc/apiv1/autoscaling_policy_client.go
new file mode 100644
index 0000000..1563904
--- /dev/null
+++ b/dataproc/apiv1/autoscaling_policy_client.go
@@ -0,0 +1,310 @@
+// Copyright 2019 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 dataproc
+
+import (
+ "context"
+ "fmt"
+ "math"
+ "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"
+ "google.golang.org/api/transport"
+ dataprocpb "google.golang.org/genproto/googleapis/cloud/dataproc/v1"
+ "google.golang.org/grpc"
+ "google.golang.org/grpc/codes"
+ "google.golang.org/grpc/metadata"
+)
+
+// AutoscalingPolicyCallOptions contains the retry settings for each method of AutoscalingPolicyClient.
+type AutoscalingPolicyCallOptions struct {
+ CreateAutoscalingPolicy []gax.CallOption
+ UpdateAutoscalingPolicy []gax.CallOption
+ GetAutoscalingPolicy []gax.CallOption
+ ListAutoscalingPolicies []gax.CallOption
+ DeleteAutoscalingPolicy []gax.CallOption
+}
+
+func defaultAutoscalingPolicyClientOptions() []option.ClientOption {
+ return []option.ClientOption{
+ option.WithEndpoint("dataproc.googleapis.com:443"),
+ option.WithGRPCDialOption(grpc.WithDisableServiceConfig()),
+ option.WithScopes(DefaultAuthScopes()...),
+ option.WithGRPCDialOption(grpc.WithDefaultCallOptions(
+ grpc.MaxCallRecvMsgSize(math.MaxInt32))),
+ }
+}
+
+func defaultAutoscalingPolicyCallOptions() *AutoscalingPolicyCallOptions {
+ return &AutoscalingPolicyCallOptions{
+ CreateAutoscalingPolicy: []gax.CallOption{},
+ UpdateAutoscalingPolicy: []gax.CallOption{
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnCodes([]codes.Code{
+ codes.DeadlineExceeded,
+ codes.Unavailable,
+ }, gax.Backoff{
+ Initial: 100 * time.Millisecond,
+ Max: 60000 * time.Millisecond,
+ Multiplier: 1.30,
+ })
+ }),
+ },
+ GetAutoscalingPolicy: []gax.CallOption{
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnCodes([]codes.Code{
+ codes.DeadlineExceeded,
+ codes.Unavailable,
+ }, gax.Backoff{
+ Initial: 100 * time.Millisecond,
+ Max: 60000 * time.Millisecond,
+ Multiplier: 1.30,
+ })
+ }),
+ },
+ ListAutoscalingPolicies: []gax.CallOption{
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnCodes([]codes.Code{
+ codes.DeadlineExceeded,
+ codes.Unavailable,
+ }, gax.Backoff{
+ Initial: 100 * time.Millisecond,
+ Max: 60000 * time.Millisecond,
+ Multiplier: 1.30,
+ })
+ }),
+ },
+ DeleteAutoscalingPolicy: []gax.CallOption{},
+ }
+}
+
+// AutoscalingPolicyClient is a client for interacting with Cloud Dataproc API.
+//
+// Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
+type AutoscalingPolicyClient struct {
+ // The connection to the service.
+ conn *grpc.ClientConn
+
+ // The gRPC API client.
+ autoscalingPolicyClient dataprocpb.AutoscalingPolicyServiceClient
+
+ // The call options for this service.
+ CallOptions *AutoscalingPolicyCallOptions
+
+ // The x-goog-* metadata to be sent with each request.
+ xGoogMetadata metadata.MD
+}
+
+// NewAutoscalingPolicyClient creates a new autoscaling policy service client.
+//
+// The API interface for managing autoscaling policies in the
+// Dataproc API.
+func NewAutoscalingPolicyClient(ctx context.Context, opts ...option.ClientOption) (*AutoscalingPolicyClient, error) {
+ conn, err := transport.DialGRPC(ctx, append(defaultAutoscalingPolicyClientOptions(), opts...)...)
+ if err != nil {
+ return nil, err
+ }
+ c := &AutoscalingPolicyClient{
+ conn: conn,
+ CallOptions: defaultAutoscalingPolicyCallOptions(),
+
+ autoscalingPolicyClient: dataprocpb.NewAutoscalingPolicyServiceClient(conn),
+ }
+ c.setGoogleClientInfo()
+
+ return c, nil
+}
+
+// Connection returns the client's connection to the API service.
+func (c *AutoscalingPolicyClient) Connection() *grpc.ClientConn {
+ return c.conn
+}
+
+// Close closes the connection to the API service. The user should invoke this when
+// the client is no longer required.
+func (c *AutoscalingPolicyClient) Close() error {
+ return c.conn.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 *AutoscalingPolicyClient) 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...))
+}
+
+// CreateAutoscalingPolicy creates new autoscaling policy.
+func (c *AutoscalingPolicyClient) CreateAutoscalingPolicy(ctx context.Context, req *dataprocpb.CreateAutoscalingPolicyRequest, opts ...gax.CallOption) (*dataprocpb.AutoscalingPolicy, 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.CreateAutoscalingPolicy[0:len(c.CallOptions.CreateAutoscalingPolicy):len(c.CallOptions.CreateAutoscalingPolicy)], opts...)
+ var resp *dataprocpb.AutoscalingPolicy
+ err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ var err error
+ resp, err = c.autoscalingPolicyClient.CreateAutoscalingPolicy(ctx, req, settings.GRPC...)
+ return err
+ }, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return resp, nil
+}
+
+// UpdateAutoscalingPolicy updates (replaces) autoscaling policy.
+//
+// Disabled check for update_mask, because all updates will be full
+// replacements.
+func (c *AutoscalingPolicyClient) UpdateAutoscalingPolicy(ctx context.Context, req *dataprocpb.UpdateAutoscalingPolicyRequest, opts ...gax.CallOption) (*dataprocpb.AutoscalingPolicy, error) {
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "policy.name", url.QueryEscape(req.GetPolicy().GetName())))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
+ opts = append(c.CallOptions.UpdateAutoscalingPolicy[0:len(c.CallOptions.UpdateAutoscalingPolicy):len(c.CallOptions.UpdateAutoscalingPolicy)], opts...)
+ var resp *dataprocpb.AutoscalingPolicy
+ err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ var err error
+ resp, err = c.autoscalingPolicyClient.UpdateAutoscalingPolicy(ctx, req, settings.GRPC...)
+ return err
+ }, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return resp, nil
+}
+
+// GetAutoscalingPolicy retrieves autoscaling policy.
+func (c *AutoscalingPolicyClient) GetAutoscalingPolicy(ctx context.Context, req *dataprocpb.GetAutoscalingPolicyRequest, opts ...gax.CallOption) (*dataprocpb.AutoscalingPolicy, 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.GetAutoscalingPolicy[0:len(c.CallOptions.GetAutoscalingPolicy):len(c.CallOptions.GetAutoscalingPolicy)], opts...)
+ var resp *dataprocpb.AutoscalingPolicy
+ err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ var err error
+ resp, err = c.autoscalingPolicyClient.GetAutoscalingPolicy(ctx, req, settings.GRPC...)
+ return err
+ }, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return resp, nil
+}
+
+// ListAutoscalingPolicies lists autoscaling policies in the project.
+func (c *AutoscalingPolicyClient) ListAutoscalingPolicies(ctx context.Context, req *dataprocpb.ListAutoscalingPoliciesRequest, opts ...gax.CallOption) *AutoscalingPolicyIterator {
+ 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.ListAutoscalingPolicies[0:len(c.CallOptions.ListAutoscalingPolicies):len(c.CallOptions.ListAutoscalingPolicies)], opts...)
+ it := &AutoscalingPolicyIterator{}
+ req = proto.Clone(req).(*dataprocpb.ListAutoscalingPoliciesRequest)
+ it.InternalFetch = func(pageSize int, pageToken string) ([]*dataprocpb.AutoscalingPolicy, string, error) {
+ var resp *dataprocpb.ListAutoscalingPoliciesResponse
+ 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.autoscalingPolicyClient.ListAutoscalingPolicies(ctx, req, settings.GRPC...)
+ return err
+ }, opts...)
+ if err != nil {
+ return nil, "", err
+ }
+
+ it.Response = resp
+ return resp.Policies, resp.NextPageToken, 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.PageSize)
+ it.pageInfo.Token = req.PageToken
+ return it
+}
+
+// DeleteAutoscalingPolicy deletes an autoscaling policy. It is an error to delete an autoscaling
+// policy that is in use by one or more clusters.
+func (c *AutoscalingPolicyClient) DeleteAutoscalingPolicy(ctx context.Context, req *dataprocpb.DeleteAutoscalingPolicyRequest, opts ...gax.CallOption) 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.DeleteAutoscalingPolicy[0:len(c.CallOptions.DeleteAutoscalingPolicy):len(c.CallOptions.DeleteAutoscalingPolicy)], opts...)
+ err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ var err error
+ _, err = c.autoscalingPolicyClient.DeleteAutoscalingPolicy(ctx, req, settings.GRPC...)
+ return err
+ }, opts...)
+ return err
+}
+
+// AutoscalingPolicyIterator manages a stream of *dataprocpb.AutoscalingPolicy.
+type AutoscalingPolicyIterator struct {
+ items []*dataprocpb.AutoscalingPolicy
+ 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 []*dataprocpb.AutoscalingPolicy, nextPageToken string, err error)
+}
+
+// PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
+func (it *AutoscalingPolicyIterator) 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 *AutoscalingPolicyIterator) Next() (*dataprocpb.AutoscalingPolicy, error) {
+ var item *dataprocpb.AutoscalingPolicy
+ if err := it.nextFunc(); err != nil {
+ return item, err
+ }
+ item = it.items[0]
+ it.items = it.items[1:]
+ return item, nil
+}
+
+func (it *AutoscalingPolicyIterator) bufLen() int {
+ return len(it.items)
+}
+
+func (it *AutoscalingPolicyIterator) takeBuf() interface{} {
+ b := it.items
+ it.items = nil
+ return b
+}
diff --git a/dataproc/apiv1/autoscaling_policy_client_example_test.go b/dataproc/apiv1/autoscaling_policy_client_example_test.go
new file mode 100644
index 0000000..67c2c33
--- /dev/null
+++ b/dataproc/apiv1/autoscaling_policy_client_example_test.go
@@ -0,0 +1,138 @@
+// Copyright 2019 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 dataproc_test
+
+import (
+ "context"
+
+ dataproc "cloud.google.com/go/dataproc/apiv1"
+ "google.golang.org/api/iterator"
+ dataprocpb "google.golang.org/genproto/googleapis/cloud/dataproc/v1"
+)
+
+func ExampleNewAutoscalingPolicyClient() {
+ ctx := context.Background()
+ c, err := dataproc.NewAutoscalingPolicyClient(ctx)
+ if err != nil {
+ // TODO: Handle error.
+ }
+ // TODO: Use client.
+ _ = c
+}
+
+func ExampleAutoscalingPolicyClient_CreateAutoscalingPolicy() {
+ // import dataprocpb "google.golang.org/genproto/googleapis/cloud/dataproc/v1"
+
+ ctx := context.Background()
+ c, err := dataproc.NewAutoscalingPolicyClient(ctx)
+ if err != nil {
+ // TODO: Handle error.
+ }
+
+ req := &dataprocpb.CreateAutoscalingPolicyRequest{
+ // TODO: Fill request struct fields.
+ }
+ resp, err := c.CreateAutoscalingPolicy(ctx, req)
+ if err != nil {
+ // TODO: Handle error.
+ }
+ // TODO: Use resp.
+ _ = resp
+}
+
+func ExampleAutoscalingPolicyClient_UpdateAutoscalingPolicy() {
+ // import dataprocpb "google.golang.org/genproto/googleapis/cloud/dataproc/v1"
+
+ ctx := context.Background()
+ c, err := dataproc.NewAutoscalingPolicyClient(ctx)
+ if err != nil {
+ // TODO: Handle error.
+ }
+
+ req := &dataprocpb.UpdateAutoscalingPolicyRequest{
+ // TODO: Fill request struct fields.
+ }
+ resp, err := c.UpdateAutoscalingPolicy(ctx, req)
+ if err != nil {
+ // TODO: Handle error.
+ }
+ // TODO: Use resp.
+ _ = resp
+}
+
+func ExampleAutoscalingPolicyClient_GetAutoscalingPolicy() {
+ // import dataprocpb "google.golang.org/genproto/googleapis/cloud/dataproc/v1"
+
+ ctx := context.Background()
+ c, err := dataproc.NewAutoscalingPolicyClient(ctx)
+ if err != nil {
+ // TODO: Handle error.
+ }
+
+ req := &dataprocpb.GetAutoscalingPolicyRequest{
+ // TODO: Fill request struct fields.
+ }
+ resp, err := c.GetAutoscalingPolicy(ctx, req)
+ if err != nil {
+ // TODO: Handle error.
+ }
+ // TODO: Use resp.
+ _ = resp
+}
+
+func ExampleAutoscalingPolicyClient_ListAutoscalingPolicies() {
+ // import dataprocpb "google.golang.org/genproto/googleapis/cloud/dataproc/v1"
+ // import "google.golang.org/api/iterator"
+
+ ctx := context.Background()
+ c, err := dataproc.NewAutoscalingPolicyClient(ctx)
+ if err != nil {
+ // TODO: Handle error.
+ }
+
+ req := &dataprocpb.ListAutoscalingPoliciesRequest{
+ // TODO: Fill request struct fields.
+ }
+ it := c.ListAutoscalingPolicies(ctx, req)
+ for {
+ resp, err := it.Next()
+ if err == iterator.Done {
+ break
+ }
+ if err != nil {
+ // TODO: Handle error.
+ }
+ // TODO: Use resp.
+ _ = resp
+ }
+}
+
+func ExampleAutoscalingPolicyClient_DeleteAutoscalingPolicy() {
+ ctx := context.Background()
+ c, err := dataproc.NewAutoscalingPolicyClient(ctx)
+ if err != nil {
+ // TODO: Handle error.
+ }
+
+ req := &dataprocpb.DeleteAutoscalingPolicyRequest{
+ // TODO: Fill request struct fields.
+ }
+ err = c.DeleteAutoscalingPolicy(ctx, req)
+ if err != nil {
+ // TODO: Handle error.
+ }
+}
diff --git a/dataproc/apiv1/cluster_controller_client.go b/dataproc/apiv1/cluster_controller_client.go
index 4d431ad..a51480c 100644
--- a/dataproc/apiv1/cluster_controller_client.go
+++ b/dataproc/apiv1/cluster_controller_client.go
@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-// Code generated by gapic-generator. DO NOT EDIT.
+// Code generated by protoc-gen-go_gapic. DO NOT EDIT.
package dataproc
@@ -48,6 +48,7 @@
func defaultClusterControllerClientOptions() []option.ClientOption {
return []option.ClientOption{
option.WithEndpoint("dataproc.googleapis.com:443"),
+ option.WithGRPCDialOption(grpc.WithDisableServiceConfig()),
option.WithScopes(DefaultAuthScopes()...),
option.WithGRPCDialOption(grpc.WithDefaultCallOptions(
grpc.MaxCallRecvMsgSize(math.MaxInt32))),
@@ -55,43 +56,81 @@
}
func defaultClusterControllerCallOptions() *ClusterControllerCallOptions {
- retry := map[[2]string][]gax.CallOption{
- {"default", "idempotent"}: {
- gax.WithRetry(func() gax.Retryer {
- return gax.OnCodes([]codes.Code{
- codes.DeadlineExceeded,
- codes.Internal,
- codes.Unavailable,
- }, gax.Backoff{
- Initial: 100 * time.Millisecond,
- Max: 60000 * time.Millisecond,
- Multiplier: 1.3,
- })
- }),
- },
- {"default", "non_idempotent"}: {
- gax.WithRetry(func() gax.Retryer {
- return gax.OnCodes([]codes.Code{
- codes.Unavailable,
- }, gax.Backoff{
- Initial: 100 * time.Millisecond,
- Max: 60000 * time.Millisecond,
- Multiplier: 1.3,
- })
- }),
- },
- }
return &ClusterControllerCallOptions{
- CreateCluster: retry[[2]string{"default", "non_idempotent"}],
- UpdateCluster: retry[[2]string{"default", "non_idempotent"}],
- DeleteCluster: retry[[2]string{"default", "non_idempotent"}],
- GetCluster: retry[[2]string{"default", "idempotent"}],
- ListClusters: retry[[2]string{"default", "idempotent"}],
- DiagnoseCluster: retry[[2]string{"default", "non_idempotent"}],
+ CreateCluster: []gax.CallOption{
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnCodes([]codes.Code{
+ codes.Unavailable,
+ }, gax.Backoff{
+ Initial: 100 * time.Millisecond,
+ Max: 60000 * time.Millisecond,
+ Multiplier: 1.30,
+ })
+ }),
+ },
+ UpdateCluster: []gax.CallOption{
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnCodes([]codes.Code{
+ codes.Unavailable,
+ }, gax.Backoff{
+ Initial: 100 * time.Millisecond,
+ Max: 60000 * time.Millisecond,
+ Multiplier: 1.30,
+ })
+ }),
+ },
+ DeleteCluster: []gax.CallOption{
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnCodes([]codes.Code{
+ codes.Unavailable,
+ }, gax.Backoff{
+ Initial: 100 * time.Millisecond,
+ Max: 60000 * time.Millisecond,
+ Multiplier: 1.30,
+ })
+ }),
+ },
+ GetCluster: []gax.CallOption{
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnCodes([]codes.Code{
+ codes.Internal,
+ codes.DeadlineExceeded,
+ codes.Unavailable,
+ }, gax.Backoff{
+ Initial: 100 * time.Millisecond,
+ Max: 60000 * time.Millisecond,
+ Multiplier: 1.30,
+ })
+ }),
+ },
+ ListClusters: []gax.CallOption{
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnCodes([]codes.Code{
+ codes.Internal,
+ codes.DeadlineExceeded,
+ codes.Unavailable,
+ }, gax.Backoff{
+ Initial: 100 * time.Millisecond,
+ Max: 60000 * time.Millisecond,
+ Multiplier: 1.30,
+ })
+ }),
+ },
+ DiagnoseCluster: []gax.CallOption{
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnCodes([]codes.Code{
+ codes.Unavailable,
+ }, gax.Backoff{
+ Initial: 100 * time.Millisecond,
+ Max: 60000 * time.Millisecond,
+ Multiplier: 1.30,
+ })
+ }),
+ },
}
}
-// ClusterControllerClient is a client for interacting with Google Cloud Dataproc API.
+// ClusterControllerClient is a client for interacting with Cloud Dataproc API.
//
// Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
type ClusterControllerClient struct {
@@ -261,6 +300,8 @@
if err != nil {
return nil, "", err
}
+
+ it.Response = resp
return resp.Clusters, resp.NextPageToken, nil
}
fetch := func(pageSize int, pageToken string) (string, error) {
@@ -301,48 +342,6 @@
}, nil
}
-// ClusterIterator manages a stream of *dataprocpb.Cluster.
-type ClusterIterator struct {
- items []*dataprocpb.Cluster
- pageInfo *iterator.PageInfo
- nextFunc func() error
-
- // 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 []*dataprocpb.Cluster, nextPageToken string, err error)
-}
-
-// PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
-func (it *ClusterIterator) 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 *ClusterIterator) Next() (*dataprocpb.Cluster, error) {
- var item *dataprocpb.Cluster
- if err := it.nextFunc(); err != nil {
- return item, err
- }
- item = it.items[0]
- it.items = it.items[1:]
- return item, nil
-}
-
-func (it *ClusterIterator) bufLen() int {
- return len(it.items)
-}
-
-func (it *ClusterIterator) takeBuf() interface{} {
- b := it.items
- it.items = nil
- return b
-}
-
// CreateClusterOperation manages a long-running operation from CreateCluster.
type CreateClusterOperation struct {
lro *longrunning.Operation
@@ -361,7 +360,7 @@
// See documentation of Poll for error-handling information.
func (op *CreateClusterOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*dataprocpb.Cluster, error) {
var resp dataprocpb.Cluster
- if err := op.lro.WaitWithInterval(ctx, &resp, 10000*time.Millisecond, opts...); err != nil {
+ if err := op.lro.WaitWithInterval(ctx, &resp, time.Minute, opts...); err != nil {
return nil, err
}
return &resp, nil
@@ -425,11 +424,11 @@
}
}
-// Wait blocks until the long-running operation is completed, returning any error encountered.
+// 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 *DeleteClusterOperation) Wait(ctx context.Context, opts ...gax.CallOption) error {
- return op.lro.WaitWithInterval(ctx, nil, 10000*time.Millisecond, opts...)
+ return op.lro.WaitWithInterval(ctx, nil, time.Minute, opts...)
}
// Poll fetches the latest state of the long-running operation.
@@ -438,7 +437,9 @@
//
// 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.
+// 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 *DeleteClusterOperation) Poll(ctx context.Context, opts ...gax.CallOption) error {
return op.lro.Poll(ctx, nil, opts...)
}
@@ -481,11 +482,11 @@
}
}
-// Wait blocks until the long-running operation is completed, returning any error encountered.
+// 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 *DiagnoseClusterOperation) Wait(ctx context.Context, opts ...gax.CallOption) error {
- return op.lro.WaitWithInterval(ctx, nil, 10000*time.Millisecond, opts...)
+ return op.lro.WaitWithInterval(ctx, nil, time.Minute, opts...)
}
// Poll fetches the latest state of the long-running operation.
@@ -494,7 +495,9 @@
//
// 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.
+// 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 *DiagnoseClusterOperation) Poll(ctx context.Context, opts ...gax.CallOption) error {
return op.lro.Poll(ctx, nil, opts...)
}
@@ -542,7 +545,7 @@
// See documentation of Poll for error-handling information.
func (op *UpdateClusterOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*dataprocpb.Cluster, error) {
var resp dataprocpb.Cluster
- if err := op.lro.WaitWithInterval(ctx, &resp, 10000*time.Millisecond, opts...); err != nil {
+ if err := op.lro.WaitWithInterval(ctx, &resp, time.Minute, opts...); err != nil {
return nil, err
}
return &resp, nil
@@ -592,3 +595,50 @@
func (op *UpdateClusterOperation) Name() string {
return op.lro.Name()
}
+
+// ClusterIterator manages a stream of *dataprocpb.Cluster.
+type ClusterIterator struct {
+ items []*dataprocpb.Cluster
+ 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 []*dataprocpb.Cluster, nextPageToken string, err error)
+}
+
+// PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
+func (it *ClusterIterator) 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 *ClusterIterator) Next() (*dataprocpb.Cluster, error) {
+ var item *dataprocpb.Cluster
+ if err := it.nextFunc(); err != nil {
+ return item, err
+ }
+ item = it.items[0]
+ it.items = it.items[1:]
+ return item, nil
+}
+
+func (it *ClusterIterator) bufLen() int {
+ return len(it.items)
+}
+
+func (it *ClusterIterator) takeBuf() interface{} {
+ b := it.items
+ it.items = nil
+ return b
+}
diff --git a/dataproc/apiv1/cluster_controller_client_example_test.go b/dataproc/apiv1/cluster_controller_client_example_test.go
index 79a5e57..b95d347 100644
--- a/dataproc/apiv1/cluster_controller_client_example_test.go
+++ b/dataproc/apiv1/cluster_controller_client_example_test.go
@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-// Code generated by gapic-generator. DO NOT EDIT.
+// Code generated by protoc-gen-go_gapic. DO NOT EDIT.
package dataproc_test
@@ -35,6 +35,8 @@
}
func ExampleClusterControllerClient_CreateCluster() {
+ // import dataprocpb "google.golang.org/genproto/googleapis/cloud/dataproc/v1"
+
ctx := context.Background()
c, err := dataproc.NewClusterControllerClient(ctx)
if err != nil {
@@ -58,6 +60,8 @@
}
func ExampleClusterControllerClient_UpdateCluster() {
+ // import dataprocpb "google.golang.org/genproto/googleapis/cloud/dataproc/v1"
+
ctx := context.Background()
c, err := dataproc.NewClusterControllerClient(ctx)
if err != nil {
@@ -81,6 +85,8 @@
}
func ExampleClusterControllerClient_DeleteCluster() {
+ // import dataprocpb "google.golang.org/genproto/googleapis/cloud/dataproc/v1"
+
ctx := context.Background()
c, err := dataproc.NewClusterControllerClient(ctx)
if err != nil {
@@ -96,10 +102,14 @@
}
err = op.Wait(ctx)
- // TODO: Handle error.
+ if err != nil {
+ // TODO: Handle error.
+ }
}
func ExampleClusterControllerClient_GetCluster() {
+ // import dataprocpb "google.golang.org/genproto/googleapis/cloud/dataproc/v1"
+
ctx := context.Background()
c, err := dataproc.NewClusterControllerClient(ctx)
if err != nil {
@@ -118,6 +128,9 @@
}
func ExampleClusterControllerClient_ListClusters() {
+ // import dataprocpb "google.golang.org/genproto/googleapis/cloud/dataproc/v1"
+ // import "google.golang.org/api/iterator"
+
ctx := context.Background()
c, err := dataproc.NewClusterControllerClient(ctx)
if err != nil {
@@ -142,6 +155,8 @@
}
func ExampleClusterControllerClient_DiagnoseCluster() {
+ // import dataprocpb "google.golang.org/genproto/googleapis/cloud/dataproc/v1"
+
ctx := context.Background()
c, err := dataproc.NewClusterControllerClient(ctx)
if err != nil {
@@ -157,5 +172,7 @@
}
err = op.Wait(ctx)
- // TODO: Handle error.
+ if err != nil {
+ // TODO: Handle error.
+ }
}
diff --git a/dataproc/apiv1/doc.go b/dataproc/apiv1/doc.go
index 7a8f12d..44061fd 100644
--- a/dataproc/apiv1/doc.go
+++ b/dataproc/apiv1/doc.go
@@ -12,15 +12,15 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-// Code generated by gapic-generator. DO NOT EDIT.
+// Code generated by protoc-gen-go_gapic. DO NOT EDIT.
// Package dataproc is an auto-generated package for the
-// Google Cloud Dataproc API.
-//
-// NOTE: This package is in alpha. It is not stable, and is likely to change.
+// Cloud Dataproc API.
//
// Manages Hadoop-based clusters and jobs on Google Cloud Platform.
//
+// 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
@@ -31,6 +31,7 @@
//
// For information about setting deadlines, reusing contexts, and more
// please visit godoc.org/cloud.google.com/go.
+
package dataproc // import "cloud.google.com/go/dataproc/apiv1"
import (
@@ -42,6 +43,8 @@
"google.golang.org/grpc/metadata"
)
+const versionClient = "20191216"
+
func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context {
out, _ := metadata.FromOutgoingContext(ctx)
out = out.Copy()
@@ -75,7 +78,7 @@
}
notSemverRune := func(r rune) bool {
- return strings.IndexRune("0123456789.", r) < 0
+ return !strings.ContainsRune("0123456789.", r)
}
if strings.HasPrefix(s, "go1") {
@@ -96,5 +99,3 @@
}
return "UNKNOWN"
}
-
-const versionClient = "UNKNOWN"
diff --git a/dataproc/apiv1/job_controller_client.go b/dataproc/apiv1/job_controller_client.go
index eb6e5c5..73f3f24 100644
--- a/dataproc/apiv1/job_controller_client.go
+++ b/dataproc/apiv1/job_controller_client.go
@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-// Code generated by gapic-generator. DO NOT EDIT.
+// Code generated by protoc-gen-go_gapic. DO NOT EDIT.
package dataproc
@@ -45,6 +45,7 @@
func defaultJobControllerClientOptions() []option.ClientOption {
return []option.ClientOption{
option.WithEndpoint("dataproc.googleapis.com:443"),
+ option.WithGRPCDialOption(grpc.WithDisableServiceConfig()),
option.WithScopes(DefaultAuthScopes()...),
option.WithGRPCDialOption(grpc.WithDefaultCallOptions(
grpc.MaxCallRecvMsgSize(math.MaxInt32))),
@@ -52,8 +53,19 @@
}
func defaultJobControllerCallOptions() *JobControllerCallOptions {
- retry := map[[2]string][]gax.CallOption{
- {"default", "idempotent"}: {
+ return &JobControllerCallOptions{
+ SubmitJob: []gax.CallOption{
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnCodes([]codes.Code{
+ codes.Unavailable,
+ }, gax.Backoff{
+ Initial: 100 * time.Millisecond,
+ Max: 60000 * time.Millisecond,
+ Multiplier: 1.30,
+ })
+ }),
+ },
+ GetJob: []gax.CallOption{
gax.WithRetry(func() gax.Retryer {
return gax.OnCodes([]codes.Code{
codes.DeadlineExceeded,
@@ -62,33 +74,62 @@
}, gax.Backoff{
Initial: 100 * time.Millisecond,
Max: 60000 * time.Millisecond,
- Multiplier: 1.3,
+ Multiplier: 1.30,
})
}),
},
- {"default", "non_idempotent"}: {
+ ListJobs: []gax.CallOption{
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnCodes([]codes.Code{
+ codes.DeadlineExceeded,
+ codes.Internal,
+ codes.Unavailable,
+ }, gax.Backoff{
+ Initial: 100 * time.Millisecond,
+ Max: 60000 * time.Millisecond,
+ Multiplier: 1.30,
+ })
+ }),
+ },
+ UpdateJob: []gax.CallOption{
gax.WithRetry(func() gax.Retryer {
return gax.OnCodes([]codes.Code{
codes.Unavailable,
}, gax.Backoff{
Initial: 100 * time.Millisecond,
Max: 60000 * time.Millisecond,
- Multiplier: 1.3,
+ Multiplier: 1.30,
+ })
+ }),
+ },
+ CancelJob: []gax.CallOption{
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnCodes([]codes.Code{
+ codes.DeadlineExceeded,
+ codes.Internal,
+ codes.Unavailable,
+ }, gax.Backoff{
+ Initial: 100 * time.Millisecond,
+ Max: 60000 * time.Millisecond,
+ Multiplier: 1.30,
+ })
+ }),
+ },
+ DeleteJob: []gax.CallOption{
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnCodes([]codes.Code{
+ codes.Unavailable,
+ }, gax.Backoff{
+ Initial: 100 * time.Millisecond,
+ Max: 60000 * time.Millisecond,
+ Multiplier: 1.30,
})
}),
},
}
- return &JobControllerCallOptions{
- SubmitJob: retry[[2]string{"default", "non_idempotent"}],
- GetJob: retry[[2]string{"default", "idempotent"}],
- ListJobs: retry[[2]string{"default", "idempotent"}],
- UpdateJob: retry[[2]string{"default", "non_idempotent"}],
- CancelJob: retry[[2]string{"default", "idempotent"}],
- DeleteJob: retry[[2]string{"default", "non_idempotent"}],
- }
}
-// JobControllerClient is a client for interacting with Google Cloud Dataproc API.
+// JobControllerClient is a client for interacting with Cloud Dataproc API.
//
// Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
type JobControllerClient struct {
@@ -120,6 +161,7 @@
jobControllerClient: dataprocpb.NewJobControllerClient(conn),
}
c.setGoogleClientInfo()
+
return c, nil
}
@@ -197,6 +239,8 @@
if err != nil {
return nil, "", err
}
+
+ it.Response = resp
return resp.Jobs, resp.NextPageToken, nil
}
fetch := func(pageSize int, pageToken string) (string, error) {
@@ -268,6 +312,11 @@
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.
//
diff --git a/dataproc/apiv1/job_controller_client_example_test.go b/dataproc/apiv1/job_controller_client_example_test.go
index 43980b1..7dd1f8c 100644
--- a/dataproc/apiv1/job_controller_client_example_test.go
+++ b/dataproc/apiv1/job_controller_client_example_test.go
@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-// Code generated by gapic-generator. DO NOT EDIT.
+// Code generated by protoc-gen-go_gapic. DO NOT EDIT.
package dataproc_test
@@ -35,6 +35,8 @@
}
func ExampleJobControllerClient_SubmitJob() {
+ // import dataprocpb "google.golang.org/genproto/googleapis/cloud/dataproc/v1"
+
ctx := context.Background()
c, err := dataproc.NewJobControllerClient(ctx)
if err != nil {
@@ -53,6 +55,8 @@
}
func ExampleJobControllerClient_GetJob() {
+ // import dataprocpb "google.golang.org/genproto/googleapis/cloud/dataproc/v1"
+
ctx := context.Background()
c, err := dataproc.NewJobControllerClient(ctx)
if err != nil {
@@ -71,6 +75,9 @@
}
func ExampleJobControllerClient_ListJobs() {
+ // import dataprocpb "google.golang.org/genproto/googleapis/cloud/dataproc/v1"
+ // import "google.golang.org/api/iterator"
+
ctx := context.Background()
c, err := dataproc.NewJobControllerClient(ctx)
if err != nil {
@@ -95,6 +102,8 @@
}
func ExampleJobControllerClient_UpdateJob() {
+ // import dataprocpb "google.golang.org/genproto/googleapis/cloud/dataproc/v1"
+
ctx := context.Background()
c, err := dataproc.NewJobControllerClient(ctx)
if err != nil {
@@ -113,6 +122,8 @@
}
func ExampleJobControllerClient_CancelJob() {
+ // import dataprocpb "google.golang.org/genproto/googleapis/cloud/dataproc/v1"
+
ctx := context.Background()
c, err := dataproc.NewJobControllerClient(ctx)
if err != nil {
diff --git a/dataproc/apiv1/workflow_template_client.go b/dataproc/apiv1/workflow_template_client.go
index e9959e5..be9e0dc 100644
--- a/dataproc/apiv1/workflow_template_client.go
+++ b/dataproc/apiv1/workflow_template_client.go
@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-// Code generated by gapic-generator. DO NOT EDIT.
+// Code generated by protoc-gen-go_gapic. DO NOT EDIT.
package dataproc
@@ -51,6 +51,7 @@
func defaultWorkflowTemplateClientOptions() []option.ClientOption {
return []option.ClientOption{
option.WithEndpoint("dataproc.googleapis.com:443"),
+ option.WithGRPCDialOption(grpc.WithDisableServiceConfig()),
option.WithScopes(DefaultAuthScopes()...),
option.WithGRPCDialOption(grpc.WithDefaultCallOptions(
grpc.MaxCallRecvMsgSize(math.MaxInt32))),
@@ -58,8 +59,19 @@
}
func defaultWorkflowTemplateCallOptions() *WorkflowTemplateCallOptions {
- retry := map[[2]string][]gax.CallOption{
- {"default", "idempotent"}: {
+ return &WorkflowTemplateCallOptions{
+ CreateWorkflowTemplate: []gax.CallOption{
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnCodes([]codes.Code{
+ codes.Unavailable,
+ }, gax.Backoff{
+ Initial: 100 * time.Millisecond,
+ Max: 60000 * time.Millisecond,
+ Multiplier: 1.30,
+ })
+ }),
+ },
+ GetWorkflowTemplate: []gax.CallOption{
gax.WithRetry(func() gax.Retryer {
return gax.OnCodes([]codes.Code{
codes.DeadlineExceeded,
@@ -68,34 +80,71 @@
}, gax.Backoff{
Initial: 100 * time.Millisecond,
Max: 60000 * time.Millisecond,
- Multiplier: 1.3,
+ Multiplier: 1.30,
})
}),
},
- {"default", "non_idempotent"}: {
+ InstantiateWorkflowTemplate: []gax.CallOption{
gax.WithRetry(func() gax.Retryer {
return gax.OnCodes([]codes.Code{
codes.Unavailable,
}, gax.Backoff{
Initial: 100 * time.Millisecond,
Max: 60000 * time.Millisecond,
- Multiplier: 1.3,
+ Multiplier: 1.30,
+ })
+ }),
+ },
+ InstantiateInlineWorkflowTemplate: []gax.CallOption{
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnCodes([]codes.Code{
+ codes.Unavailable,
+ }, gax.Backoff{
+ Initial: 100 * time.Millisecond,
+ Max: 60000 * time.Millisecond,
+ Multiplier: 1.30,
+ })
+ }),
+ },
+ UpdateWorkflowTemplate: []gax.CallOption{
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnCodes([]codes.Code{
+ codes.Unavailable,
+ }, gax.Backoff{
+ Initial: 100 * time.Millisecond,
+ Max: 60000 * time.Millisecond,
+ Multiplier: 1.30,
+ })
+ }),
+ },
+ ListWorkflowTemplates: []gax.CallOption{
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnCodes([]codes.Code{
+ codes.DeadlineExceeded,
+ codes.Internal,
+ codes.Unavailable,
+ }, gax.Backoff{
+ Initial: 100 * time.Millisecond,
+ Max: 60000 * time.Millisecond,
+ Multiplier: 1.30,
+ })
+ }),
+ },
+ DeleteWorkflowTemplate: []gax.CallOption{
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnCodes([]codes.Code{
+ codes.Unavailable,
+ }, gax.Backoff{
+ Initial: 100 * time.Millisecond,
+ Max: 60000 * time.Millisecond,
+ Multiplier: 1.30,
})
}),
},
}
- return &WorkflowTemplateCallOptions{
- CreateWorkflowTemplate: retry[[2]string{"default", "non_idempotent"}],
- GetWorkflowTemplate: retry[[2]string{"default", "idempotent"}],
- InstantiateWorkflowTemplate: retry[[2]string{"default", "non_idempotent"}],
- InstantiateInlineWorkflowTemplate: retry[[2]string{"default", "non_idempotent"}],
- UpdateWorkflowTemplate: retry[[2]string{"default", "non_idempotent"}],
- ListWorkflowTemplates: retry[[2]string{"default", "idempotent"}],
- DeleteWorkflowTemplate: retry[[2]string{"default", "non_idempotent"}],
- }
}
-// WorkflowTemplateClient is a client for interacting with Google Cloud Dataproc API.
+// WorkflowTemplateClient is a client for interacting with Cloud Dataproc API.
//
// Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
type WorkflowTemplateClient struct {
@@ -120,7 +169,7 @@
// NewWorkflowTemplateClient creates a new workflow template service client.
//
// The API interface for managing Workflow Templates in the
-// Cloud Dataproc API.
+// Dataproc API.
func NewWorkflowTemplateClient(ctx context.Context, opts ...option.ClientOption) (*WorkflowTemplateClient, error) {
conn, err := transport.DialGRPC(ctx, append(defaultWorkflowTemplateClientOptions(), opts...)...)
if err != nil {
@@ -325,6 +374,8 @@
if err != nil {
return nil, "", err
}
+
+ it.Response = resp
return resp.Templates, resp.NextPageToken, nil
}
fetch := func(pageSize int, pageToken string) (string, error) {
@@ -354,48 +405,6 @@
return err
}
-// WorkflowTemplateIterator manages a stream of *dataprocpb.WorkflowTemplate.
-type WorkflowTemplateIterator struct {
- items []*dataprocpb.WorkflowTemplate
- pageInfo *iterator.PageInfo
- nextFunc func() error
-
- // 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 []*dataprocpb.WorkflowTemplate, nextPageToken string, err error)
-}
-
-// PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
-func (it *WorkflowTemplateIterator) 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 *WorkflowTemplateIterator) Next() (*dataprocpb.WorkflowTemplate, error) {
- var item *dataprocpb.WorkflowTemplate
- if err := it.nextFunc(); err != nil {
- return item, err
- }
- item = it.items[0]
- it.items = it.items[1:]
- return item, nil
-}
-
-func (it *WorkflowTemplateIterator) bufLen() int {
- return len(it.items)
-}
-
-func (it *WorkflowTemplateIterator) takeBuf() interface{} {
- b := it.items
- it.items = nil
- return b
-}
-
// InstantiateInlineWorkflowTemplateOperation manages a long-running operation from InstantiateInlineWorkflowTemplate.
type InstantiateInlineWorkflowTemplateOperation struct {
lro *longrunning.Operation
@@ -409,11 +418,11 @@
}
}
-// Wait blocks until the long-running operation is completed, returning any error encountered.
+// 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 *InstantiateInlineWorkflowTemplateOperation) Wait(ctx context.Context, opts ...gax.CallOption) error {
- return op.lro.WaitWithInterval(ctx, nil, 10000*time.Millisecond, opts...)
+ return op.lro.WaitWithInterval(ctx, nil, time.Minute, opts...)
}
// Poll fetches the latest state of the long-running operation.
@@ -422,7 +431,9 @@
//
// 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.
+// 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 *InstantiateInlineWorkflowTemplateOperation) Poll(ctx context.Context, opts ...gax.CallOption) error {
return op.lro.Poll(ctx, nil, opts...)
}
@@ -465,11 +476,11 @@
}
}
-// Wait blocks until the long-running operation is completed, returning any error encountered.
+// 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 *InstantiateWorkflowTemplateOperation) Wait(ctx context.Context, opts ...gax.CallOption) error {
- return op.lro.WaitWithInterval(ctx, nil, 10000*time.Millisecond, opts...)
+ return op.lro.WaitWithInterval(ctx, nil, time.Minute, opts...)
}
// Poll fetches the latest state of the long-running operation.
@@ -478,7 +489,9 @@
//
// 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.
+// 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 *InstantiateWorkflowTemplateOperation) Poll(ctx context.Context, opts ...gax.CallOption) error {
return op.lro.Poll(ctx, nil, opts...)
}
@@ -507,3 +520,50 @@
func (op *InstantiateWorkflowTemplateOperation) Name() string {
return op.lro.Name()
}
+
+// WorkflowTemplateIterator manages a stream of *dataprocpb.WorkflowTemplate.
+type WorkflowTemplateIterator struct {
+ items []*dataprocpb.WorkflowTemplate
+ 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 []*dataprocpb.WorkflowTemplate, nextPageToken string, err error)
+}
+
+// PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
+func (it *WorkflowTemplateIterator) 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 *WorkflowTemplateIterator) Next() (*dataprocpb.WorkflowTemplate, error) {
+ var item *dataprocpb.WorkflowTemplate
+ if err := it.nextFunc(); err != nil {
+ return item, err
+ }
+ item = it.items[0]
+ it.items = it.items[1:]
+ return item, nil
+}
+
+func (it *WorkflowTemplateIterator) bufLen() int {
+ return len(it.items)
+}
+
+func (it *WorkflowTemplateIterator) takeBuf() interface{} {
+ b := it.items
+ it.items = nil
+ return b
+}
diff --git a/dataproc/apiv1/workflow_template_client_example_test.go b/dataproc/apiv1/workflow_template_client_example_test.go
index b6ad6aa..7d1f28d 100644
--- a/dataproc/apiv1/workflow_template_client_example_test.go
+++ b/dataproc/apiv1/workflow_template_client_example_test.go
@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-// Code generated by gapic-generator. DO NOT EDIT.
+// Code generated by protoc-gen-go_gapic. DO NOT EDIT.
package dataproc_test
@@ -35,6 +35,8 @@
}
func ExampleWorkflowTemplateClient_CreateWorkflowTemplate() {
+ // import dataprocpb "google.golang.org/genproto/googleapis/cloud/dataproc/v1"
+
ctx := context.Background()
c, err := dataproc.NewWorkflowTemplateClient(ctx)
if err != nil {
@@ -53,6 +55,8 @@
}
func ExampleWorkflowTemplateClient_GetWorkflowTemplate() {
+ // import dataprocpb "google.golang.org/genproto/googleapis/cloud/dataproc/v1"
+
ctx := context.Background()
c, err := dataproc.NewWorkflowTemplateClient(ctx)
if err != nil {
@@ -71,6 +75,8 @@
}
func ExampleWorkflowTemplateClient_InstantiateWorkflowTemplate() {
+ // import dataprocpb "google.golang.org/genproto/googleapis/cloud/dataproc/v1"
+
ctx := context.Background()
c, err := dataproc.NewWorkflowTemplateClient(ctx)
if err != nil {
@@ -86,10 +92,14 @@
}
err = op.Wait(ctx)
- // TODO: Handle error.
+ if err != nil {
+ // TODO: Handle error.
+ }
}
func ExampleWorkflowTemplateClient_InstantiateInlineWorkflowTemplate() {
+ // import dataprocpb "google.golang.org/genproto/googleapis/cloud/dataproc/v1"
+
ctx := context.Background()
c, err := dataproc.NewWorkflowTemplateClient(ctx)
if err != nil {
@@ -105,10 +115,14 @@
}
err = op.Wait(ctx)
- // TODO: Handle error.
+ if err != nil {
+ // TODO: Handle error.
+ }
}
func ExampleWorkflowTemplateClient_UpdateWorkflowTemplate() {
+ // import dataprocpb "google.golang.org/genproto/googleapis/cloud/dataproc/v1"
+
ctx := context.Background()
c, err := dataproc.NewWorkflowTemplateClient(ctx)
if err != nil {
@@ -127,6 +141,9 @@
}
func ExampleWorkflowTemplateClient_ListWorkflowTemplates() {
+ // import dataprocpb "google.golang.org/genproto/googleapis/cloud/dataproc/v1"
+ // import "google.golang.org/api/iterator"
+
ctx := context.Background()
c, err := dataproc.NewWorkflowTemplateClient(ctx)
if err != nil {
diff --git a/dataproc/apiv1beta2/autoscaling_policy_client.go b/dataproc/apiv1beta2/autoscaling_policy_client.go
index 783253b..23eddf3 100644
--- a/dataproc/apiv1beta2/autoscaling_policy_client.go
+++ b/dataproc/apiv1beta2/autoscaling_policy_client.go
@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-// Code generated by gapic-generator. DO NOT EDIT.
+// Code generated by protoc-gen-go_gapic. DO NOT EDIT.
package dataproc
@@ -46,6 +46,7 @@
func defaultAutoscalingPolicyClientOptions() []option.ClientOption {
return []option.ClientOption{
option.WithEndpoint("dataproc.googleapis.com:443"),
+ option.WithGRPCDialOption(grpc.WithDisableServiceConfig()),
option.WithScopes(DefaultAuthScopes()...),
option.WithGRPCDialOption(grpc.WithDefaultCallOptions(
grpc.MaxCallRecvMsgSize(math.MaxInt32))),
@@ -53,8 +54,9 @@
}
func defaultAutoscalingPolicyCallOptions() *AutoscalingPolicyCallOptions {
- retry := map[[2]string][]gax.CallOption{
- {"default", "idempotent"}: {
+ return &AutoscalingPolicyCallOptions{
+ CreateAutoscalingPolicy: []gax.CallOption{},
+ UpdateAutoscalingPolicy: []gax.CallOption{
gax.WithRetry(func() gax.Retryer {
return gax.OnCodes([]codes.Code{
codes.DeadlineExceeded,
@@ -62,21 +64,39 @@
}, gax.Backoff{
Initial: 100 * time.Millisecond,
Max: 60000 * time.Millisecond,
- Multiplier: 1.3,
+ Multiplier: 1.30,
})
}),
},
- }
- return &AutoscalingPolicyCallOptions{
- CreateAutoscalingPolicy: retry[[2]string{"default", "non_idempotent"}],
- UpdateAutoscalingPolicy: retry[[2]string{"default", "idempotent"}],
- GetAutoscalingPolicy: retry[[2]string{"default", "idempotent"}],
- ListAutoscalingPolicies: retry[[2]string{"default", "idempotent"}],
- DeleteAutoscalingPolicy: retry[[2]string{"default", "non_idempotent"}],
+ GetAutoscalingPolicy: []gax.CallOption{
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnCodes([]codes.Code{
+ codes.DeadlineExceeded,
+ codes.Unavailable,
+ }, gax.Backoff{
+ Initial: 100 * time.Millisecond,
+ Max: 60000 * time.Millisecond,
+ Multiplier: 1.30,
+ })
+ }),
+ },
+ ListAutoscalingPolicies: []gax.CallOption{
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnCodes([]codes.Code{
+ codes.DeadlineExceeded,
+ codes.Unavailable,
+ }, gax.Backoff{
+ Initial: 100 * time.Millisecond,
+ Max: 60000 * time.Millisecond,
+ Multiplier: 1.30,
+ })
+ }),
+ },
+ DeleteAutoscalingPolicy: []gax.CallOption{},
}
}
-// AutoscalingPolicyClient is a client for interacting with Google Cloud Dataproc API.
+// AutoscalingPolicyClient is a client for interacting with Cloud Dataproc API.
//
// Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
type AutoscalingPolicyClient struct {
@@ -109,6 +129,7 @@
autoscalingPolicyClient: dataprocpb.NewAutoscalingPolicyServiceClient(conn),
}
c.setGoogleClientInfo()
+
return c, nil
}
@@ -209,6 +230,8 @@
if err != nil {
return nil, "", err
}
+
+ it.Response = resp
return resp.Policies, resp.NextPageToken, nil
}
fetch := func(pageSize int, pageToken string) (string, error) {
@@ -245,6 +268,11 @@
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.
//
diff --git a/dataproc/apiv1beta2/autoscaling_policy_client_example_test.go b/dataproc/apiv1beta2/autoscaling_policy_client_example_test.go
index f92d1e8..b27e5e3 100644
--- a/dataproc/apiv1beta2/autoscaling_policy_client_example_test.go
+++ b/dataproc/apiv1beta2/autoscaling_policy_client_example_test.go
@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-// Code generated by gapic-generator. DO NOT EDIT.
+// Code generated by protoc-gen-go_gapic. DO NOT EDIT.
package dataproc_test
@@ -35,6 +35,8 @@
}
func ExampleAutoscalingPolicyClient_CreateAutoscalingPolicy() {
+ // import dataprocpb "google.golang.org/genproto/googleapis/cloud/dataproc/v1beta2"
+
ctx := context.Background()
c, err := dataproc.NewAutoscalingPolicyClient(ctx)
if err != nil {
@@ -53,6 +55,8 @@
}
func ExampleAutoscalingPolicyClient_UpdateAutoscalingPolicy() {
+ // import dataprocpb "google.golang.org/genproto/googleapis/cloud/dataproc/v1beta2"
+
ctx := context.Background()
c, err := dataproc.NewAutoscalingPolicyClient(ctx)
if err != nil {
@@ -71,6 +75,8 @@
}
func ExampleAutoscalingPolicyClient_GetAutoscalingPolicy() {
+ // import dataprocpb "google.golang.org/genproto/googleapis/cloud/dataproc/v1beta2"
+
ctx := context.Background()
c, err := dataproc.NewAutoscalingPolicyClient(ctx)
if err != nil {
@@ -89,6 +95,9 @@
}
func ExampleAutoscalingPolicyClient_ListAutoscalingPolicies() {
+ // import dataprocpb "google.golang.org/genproto/googleapis/cloud/dataproc/v1beta2"
+ // import "google.golang.org/api/iterator"
+
ctx := context.Background()
c, err := dataproc.NewAutoscalingPolicyClient(ctx)
if err != nil {
diff --git a/dataproc/apiv1beta2/cluster_controller_client.go b/dataproc/apiv1beta2/cluster_controller_client.go
index 80b59a5..962eb28 100644
--- a/dataproc/apiv1beta2/cluster_controller_client.go
+++ b/dataproc/apiv1beta2/cluster_controller_client.go
@@ -12,13 +12,15 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-// Code generated by gapic-generator. DO NOT EDIT.
+// Code generated by protoc-gen-go_gapic. DO NOT EDIT.
package dataproc
import (
"context"
+ "fmt"
"math"
+ "net/url"
"time"
"cloud.google.com/go/longrunning"
@@ -48,6 +50,7 @@
func defaultClusterControllerClientOptions() []option.ClientOption {
return []option.ClientOption{
option.WithEndpoint("dataproc.googleapis.com:443"),
+ option.WithGRPCDialOption(grpc.WithDisableServiceConfig()),
option.WithScopes(DefaultAuthScopes()...),
option.WithGRPCDialOption(grpc.WithDefaultCallOptions(
grpc.MaxCallRecvMsgSize(math.MaxInt32))),
@@ -55,43 +58,81 @@
}
func defaultClusterControllerCallOptions() *ClusterControllerCallOptions {
- retry := map[[2]string][]gax.CallOption{
- {"default", "idempotent"}: {
- gax.WithRetry(func() gax.Retryer {
- return gax.OnCodes([]codes.Code{
- codes.DeadlineExceeded,
- codes.Internal,
- codes.Unavailable,
- }, gax.Backoff{
- Initial: 100 * time.Millisecond,
- Max: 60000 * time.Millisecond,
- Multiplier: 1.3,
- })
- }),
- },
- {"default", "non_idempotent"}: {
- gax.WithRetry(func() gax.Retryer {
- return gax.OnCodes([]codes.Code{
- codes.Unavailable,
- }, gax.Backoff{
- Initial: 100 * time.Millisecond,
- Max: 60000 * time.Millisecond,
- Multiplier: 1.3,
- })
- }),
- },
- }
return &ClusterControllerCallOptions{
- CreateCluster: retry[[2]string{"default", "non_idempotent"}],
- UpdateCluster: retry[[2]string{"default", "non_idempotent"}],
- DeleteCluster: retry[[2]string{"default", "non_idempotent"}],
- GetCluster: retry[[2]string{"default", "idempotent"}],
- ListClusters: retry[[2]string{"default", "idempotent"}],
- DiagnoseCluster: retry[[2]string{"default", "non_idempotent"}],
+ CreateCluster: []gax.CallOption{
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnCodes([]codes.Code{
+ codes.Unavailable,
+ }, gax.Backoff{
+ Initial: 100 * time.Millisecond,
+ Max: 60000 * time.Millisecond,
+ Multiplier: 1.30,
+ })
+ }),
+ },
+ UpdateCluster: []gax.CallOption{
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnCodes([]codes.Code{
+ codes.Unavailable,
+ }, gax.Backoff{
+ Initial: 100 * time.Millisecond,
+ Max: 60000 * time.Millisecond,
+ Multiplier: 1.30,
+ })
+ }),
+ },
+ DeleteCluster: []gax.CallOption{
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnCodes([]codes.Code{
+ codes.Unavailable,
+ }, gax.Backoff{
+ Initial: 100 * time.Millisecond,
+ Max: 60000 * time.Millisecond,
+ Multiplier: 1.30,
+ })
+ }),
+ },
+ GetCluster: []gax.CallOption{
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnCodes([]codes.Code{
+ codes.Internal,
+ codes.DeadlineExceeded,
+ codes.Unavailable,
+ }, gax.Backoff{
+ Initial: 100 * time.Millisecond,
+ Max: 60000 * time.Millisecond,
+ Multiplier: 1.30,
+ })
+ }),
+ },
+ ListClusters: []gax.CallOption{
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnCodes([]codes.Code{
+ codes.Internal,
+ codes.DeadlineExceeded,
+ codes.Unavailable,
+ }, gax.Backoff{
+ Initial: 100 * time.Millisecond,
+ Max: 60000 * time.Millisecond,
+ Multiplier: 1.30,
+ })
+ }),
+ },
+ DiagnoseCluster: []gax.CallOption{
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnCodes([]codes.Code{
+ codes.Unavailable,
+ }, gax.Backoff{
+ Initial: 100 * time.Millisecond,
+ Max: 60000 * time.Millisecond,
+ Multiplier: 1.30,
+ })
+ }),
+ },
}
}
-// ClusterControllerClient is a client for interacting with Google Cloud Dataproc API.
+// ClusterControllerClient is a client for interacting with Cloud Dataproc API.
//
// Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
type ClusterControllerClient struct {
@@ -167,7 +208,8 @@
// [Operation.metadata][google.longrunning.Operation.metadata] will be
// ClusterOperationMetadata (at /dataproc/docs/reference/rpc/google.cloud.dataproc.v1beta2#clusteroperationmetadata).
func (c *ClusterControllerClient) CreateCluster(ctx context.Context, req *dataprocpb.CreateClusterRequest, opts ...gax.CallOption) (*CreateClusterOperation, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v&%s=%v", "project_id", url.QueryEscape(req.GetProjectId()), "region", url.QueryEscape(req.GetRegion())))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.CreateCluster[0:len(c.CallOptions.CreateCluster):len(c.CallOptions.CreateCluster)], opts...)
var resp *longrunningpb.Operation
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -187,7 +229,8 @@
// [Operation.metadata][google.longrunning.Operation.metadata] will be
// ClusterOperationMetadata (at /dataproc/docs/reference/rpc/google.cloud.dataproc.v1beta2#clusteroperationmetadata).
func (c *ClusterControllerClient) UpdateCluster(ctx context.Context, req *dataprocpb.UpdateClusterRequest, opts ...gax.CallOption) (*UpdateClusterOperation, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v&%s=%v&%s=%v", "project_id", url.QueryEscape(req.GetProjectId()), "region", url.QueryEscape(req.GetRegion()), "cluster_name", url.QueryEscape(req.GetClusterName())))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.UpdateCluster[0:len(c.CallOptions.UpdateCluster):len(c.CallOptions.UpdateCluster)], opts...)
var resp *longrunningpb.Operation
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -207,7 +250,8 @@
// [Operation.metadata][google.longrunning.Operation.metadata] will be
// ClusterOperationMetadata (at /dataproc/docs/reference/rpc/google.cloud.dataproc.v1beta2#clusteroperationmetadata).
func (c *ClusterControllerClient) DeleteCluster(ctx context.Context, req *dataprocpb.DeleteClusterRequest, opts ...gax.CallOption) (*DeleteClusterOperation, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v&%s=%v&%s=%v", "project_id", url.QueryEscape(req.GetProjectId()), "region", url.QueryEscape(req.GetRegion()), "cluster_name", url.QueryEscape(req.GetClusterName())))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.DeleteCluster[0:len(c.CallOptions.DeleteCluster):len(c.CallOptions.DeleteCluster)], opts...)
var resp *longrunningpb.Operation
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -225,7 +269,8 @@
// GetCluster gets the resource representation for a cluster in a project.
func (c *ClusterControllerClient) GetCluster(ctx context.Context, req *dataprocpb.GetClusterRequest, opts ...gax.CallOption) (*dataprocpb.Cluster, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v&%s=%v&%s=%v", "project_id", url.QueryEscape(req.GetProjectId()), "region", url.QueryEscape(req.GetRegion()), "cluster_name", url.QueryEscape(req.GetClusterName())))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.GetCluster[0:len(c.CallOptions.GetCluster):len(c.CallOptions.GetCluster)], opts...)
var resp *dataprocpb.Cluster
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -241,7 +286,8 @@
// ListClusters lists all regions/{region}/clusters in a project.
func (c *ClusterControllerClient) ListClusters(ctx context.Context, req *dataprocpb.ListClustersRequest, opts ...gax.CallOption) *ClusterIterator {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v&%s=%v", "project_id", url.QueryEscape(req.GetProjectId()), "region", url.QueryEscape(req.GetRegion())))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.ListClusters[0:len(c.CallOptions.ListClusters):len(c.CallOptions.ListClusters)], opts...)
it := &ClusterIterator{}
req = proto.Clone(req).(*dataprocpb.ListClustersRequest)
@@ -261,6 +307,8 @@
if err != nil {
return nil, "", err
}
+
+ it.Response = resp
return resp.Clusters, resp.NextPageToken, nil
}
fetch := func(pageSize int, pageToken string) (string, error) {
@@ -285,7 +333,8 @@
// contains
// Empty (at google.protobuf.Empty).
func (c *ClusterControllerClient) DiagnoseCluster(ctx context.Context, req *dataprocpb.DiagnoseClusterRequest, opts ...gax.CallOption) (*DiagnoseClusterOperation, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v&%s=%v&%s=%v", "project_id", url.QueryEscape(req.GetProjectId()), "region", url.QueryEscape(req.GetRegion()), "cluster_name", url.QueryEscape(req.GetClusterName())))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.DiagnoseCluster[0:len(c.CallOptions.DiagnoseCluster):len(c.CallOptions.DiagnoseCluster)], opts...)
var resp *longrunningpb.Operation
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -301,48 +350,6 @@
}, nil
}
-// ClusterIterator manages a stream of *dataprocpb.Cluster.
-type ClusterIterator struct {
- items []*dataprocpb.Cluster
- pageInfo *iterator.PageInfo
- nextFunc func() error
-
- // 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 []*dataprocpb.Cluster, nextPageToken string, err error)
-}
-
-// PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
-func (it *ClusterIterator) 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 *ClusterIterator) Next() (*dataprocpb.Cluster, error) {
- var item *dataprocpb.Cluster
- if err := it.nextFunc(); err != nil {
- return item, err
- }
- item = it.items[0]
- it.items = it.items[1:]
- return item, nil
-}
-
-func (it *ClusterIterator) bufLen() int {
- return len(it.items)
-}
-
-func (it *ClusterIterator) takeBuf() interface{} {
- b := it.items
- it.items = nil
- return b
-}
-
// CreateClusterOperation manages a long-running operation from CreateCluster.
type CreateClusterOperation struct {
lro *longrunning.Operation
@@ -361,7 +368,7 @@
// See documentation of Poll for error-handling information.
func (op *CreateClusterOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*dataprocpb.Cluster, error) {
var resp dataprocpb.Cluster
- if err := op.lro.WaitWithInterval(ctx, &resp, 10000*time.Millisecond, opts...); err != nil {
+ if err := op.lro.WaitWithInterval(ctx, &resp, time.Minute, opts...); err != nil {
return nil, err
}
return &resp, nil
@@ -425,11 +432,11 @@
}
}
-// Wait blocks until the long-running operation is completed, returning any error encountered.
+// 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 *DeleteClusterOperation) Wait(ctx context.Context, opts ...gax.CallOption) error {
- return op.lro.WaitWithInterval(ctx, nil, 10000*time.Millisecond, opts...)
+ return op.lro.WaitWithInterval(ctx, nil, time.Minute, opts...)
}
// Poll fetches the latest state of the long-running operation.
@@ -438,7 +445,9 @@
//
// 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.
+// 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 *DeleteClusterOperation) Poll(ctx context.Context, opts ...gax.CallOption) error {
return op.lro.Poll(ctx, nil, opts...)
}
@@ -481,11 +490,11 @@
}
}
-// Wait blocks until the long-running operation is completed, returning any error encountered.
+// 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 *DiagnoseClusterOperation) Wait(ctx context.Context, opts ...gax.CallOption) error {
- return op.lro.WaitWithInterval(ctx, nil, 10000*time.Millisecond, opts...)
+ return op.lro.WaitWithInterval(ctx, nil, time.Minute, opts...)
}
// Poll fetches the latest state of the long-running operation.
@@ -494,7 +503,9 @@
//
// 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.
+// 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 *DiagnoseClusterOperation) Poll(ctx context.Context, opts ...gax.CallOption) error {
return op.lro.Poll(ctx, nil, opts...)
}
@@ -503,8 +514,8 @@
// 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 *DiagnoseClusterOperation) Metadata() (*dataprocpb.DiagnoseClusterResults, error) {
- var meta dataprocpb.DiagnoseClusterResults
+func (op *DiagnoseClusterOperation) Metadata() (*dataprocpb.ClusterOperationMetadata, error) {
+ var meta dataprocpb.ClusterOperationMetadata
if err := op.lro.Metadata(&meta); err == longrunning.ErrNoMetadata {
return nil, nil
} else if err != nil {
@@ -542,7 +553,7 @@
// See documentation of Poll for error-handling information.
func (op *UpdateClusterOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*dataprocpb.Cluster, error) {
var resp dataprocpb.Cluster
- if err := op.lro.WaitWithInterval(ctx, &resp, 10000*time.Millisecond, opts...); err != nil {
+ if err := op.lro.WaitWithInterval(ctx, &resp, time.Minute, opts...); err != nil {
return nil, err
}
return &resp, nil
@@ -592,3 +603,50 @@
func (op *UpdateClusterOperation) Name() string {
return op.lro.Name()
}
+
+// ClusterIterator manages a stream of *dataprocpb.Cluster.
+type ClusterIterator struct {
+ items []*dataprocpb.Cluster
+ 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 []*dataprocpb.Cluster, nextPageToken string, err error)
+}
+
+// PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
+func (it *ClusterIterator) 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 *ClusterIterator) Next() (*dataprocpb.Cluster, error) {
+ var item *dataprocpb.Cluster
+ if err := it.nextFunc(); err != nil {
+ return item, err
+ }
+ item = it.items[0]
+ it.items = it.items[1:]
+ return item, nil
+}
+
+func (it *ClusterIterator) bufLen() int {
+ return len(it.items)
+}
+
+func (it *ClusterIterator) takeBuf() interface{} {
+ b := it.items
+ it.items = nil
+ return b
+}
diff --git a/dataproc/apiv1beta2/cluster_controller_client_example_test.go b/dataproc/apiv1beta2/cluster_controller_client_example_test.go
index 11687ac..17b0c89 100644
--- a/dataproc/apiv1beta2/cluster_controller_client_example_test.go
+++ b/dataproc/apiv1beta2/cluster_controller_client_example_test.go
@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-// Code generated by gapic-generator. DO NOT EDIT.
+// Code generated by protoc-gen-go_gapic. DO NOT EDIT.
package dataproc_test
@@ -35,6 +35,8 @@
}
func ExampleClusterControllerClient_CreateCluster() {
+ // import dataprocpb "google.golang.org/genproto/googleapis/cloud/dataproc/v1beta2"
+
ctx := context.Background()
c, err := dataproc.NewClusterControllerClient(ctx)
if err != nil {
@@ -58,6 +60,8 @@
}
func ExampleClusterControllerClient_UpdateCluster() {
+ // import dataprocpb "google.golang.org/genproto/googleapis/cloud/dataproc/v1beta2"
+
ctx := context.Background()
c, err := dataproc.NewClusterControllerClient(ctx)
if err != nil {
@@ -81,6 +85,8 @@
}
func ExampleClusterControllerClient_DeleteCluster() {
+ // import dataprocpb "google.golang.org/genproto/googleapis/cloud/dataproc/v1beta2"
+
ctx := context.Background()
c, err := dataproc.NewClusterControllerClient(ctx)
if err != nil {
@@ -96,10 +102,14 @@
}
err = op.Wait(ctx)
- // TODO: Handle error.
+ if err != nil {
+ // TODO: Handle error.
+ }
}
func ExampleClusterControllerClient_GetCluster() {
+ // import dataprocpb "google.golang.org/genproto/googleapis/cloud/dataproc/v1beta2"
+
ctx := context.Background()
c, err := dataproc.NewClusterControllerClient(ctx)
if err != nil {
@@ -118,6 +128,9 @@
}
func ExampleClusterControllerClient_ListClusters() {
+ // import dataprocpb "google.golang.org/genproto/googleapis/cloud/dataproc/v1beta2"
+ // import "google.golang.org/api/iterator"
+
ctx := context.Background()
c, err := dataproc.NewClusterControllerClient(ctx)
if err != nil {
@@ -142,6 +155,8 @@
}
func ExampleClusterControllerClient_DiagnoseCluster() {
+ // import dataprocpb "google.golang.org/genproto/googleapis/cloud/dataproc/v1beta2"
+
ctx := context.Background()
c, err := dataproc.NewClusterControllerClient(ctx)
if err != nil {
@@ -157,5 +172,7 @@
}
err = op.Wait(ctx)
- // TODO: Handle error.
+ if err != nil {
+ // TODO: Handle error.
+ }
}
diff --git a/dataproc/apiv1beta2/doc.go b/dataproc/apiv1beta2/doc.go
index 978a278..0d2a46c 100644
--- a/dataproc/apiv1beta2/doc.go
+++ b/dataproc/apiv1beta2/doc.go
@@ -12,15 +12,15 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-// Code generated by gapic-generator. DO NOT EDIT.
+// Code generated by protoc-gen-go_gapic. DO NOT EDIT.
// Package dataproc is an auto-generated package for the
-// Google Cloud Dataproc API.
-//
-// NOTE: This package is in beta. It is not stable, and may be subject to changes.
+// Cloud Dataproc API.
//
// Manages Hadoop-based clusters and jobs 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
@@ -31,6 +31,7 @@
//
// For information about setting deadlines, reusing contexts, and more
// please visit godoc.org/cloud.google.com/go.
+
package dataproc // import "cloud.google.com/go/dataproc/apiv1beta2"
import (
@@ -42,6 +43,8 @@
"google.golang.org/grpc/metadata"
)
+const versionClient = "20191216"
+
func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context {
out, _ := metadata.FromOutgoingContext(ctx)
out = out.Copy()
@@ -75,7 +78,7 @@
}
notSemverRune := func(r rune) bool {
- return strings.IndexRune("0123456789.", r) < 0
+ return !strings.ContainsRune("0123456789.", r)
}
if strings.HasPrefix(s, "go1") {
@@ -96,5 +99,3 @@
}
return "UNKNOWN"
}
-
-const versionClient = "20191206"
diff --git a/dataproc/apiv1beta2/job_controller_client.go b/dataproc/apiv1beta2/job_controller_client.go
index 86dfe74..11eeba7 100644
--- a/dataproc/apiv1beta2/job_controller_client.go
+++ b/dataproc/apiv1beta2/job_controller_client.go
@@ -12,13 +12,15 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-// Code generated by gapic-generator. DO NOT EDIT.
+// Code generated by protoc-gen-go_gapic. DO NOT EDIT.
package dataproc
import (
"context"
+ "fmt"
"math"
+ "net/url"
"time"
"github.com/golang/protobuf/proto"
@@ -45,6 +47,7 @@
func defaultJobControllerClientOptions() []option.ClientOption {
return []option.ClientOption{
option.WithEndpoint("dataproc.googleapis.com:443"),
+ option.WithGRPCDialOption(grpc.WithDisableServiceConfig()),
option.WithScopes(DefaultAuthScopes()...),
option.WithGRPCDialOption(grpc.WithDefaultCallOptions(
grpc.MaxCallRecvMsgSize(math.MaxInt32))),
@@ -52,8 +55,19 @@
}
func defaultJobControllerCallOptions() *JobControllerCallOptions {
- retry := map[[2]string][]gax.CallOption{
- {"default", "idempotent"}: {
+ return &JobControllerCallOptions{
+ SubmitJob: []gax.CallOption{
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnCodes([]codes.Code{
+ codes.Unavailable,
+ }, gax.Backoff{
+ Initial: 100 * time.Millisecond,
+ Max: 60000 * time.Millisecond,
+ Multiplier: 1.30,
+ })
+ }),
+ },
+ GetJob: []gax.CallOption{
gax.WithRetry(func() gax.Retryer {
return gax.OnCodes([]codes.Code{
codes.DeadlineExceeded,
@@ -62,33 +76,62 @@
}, gax.Backoff{
Initial: 100 * time.Millisecond,
Max: 60000 * time.Millisecond,
- Multiplier: 1.3,
+ Multiplier: 1.30,
})
}),
},
- {"default", "non_idempotent"}: {
+ ListJobs: []gax.CallOption{
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnCodes([]codes.Code{
+ codes.DeadlineExceeded,
+ codes.Internal,
+ codes.Unavailable,
+ }, gax.Backoff{
+ Initial: 100 * time.Millisecond,
+ Max: 60000 * time.Millisecond,
+ Multiplier: 1.30,
+ })
+ }),
+ },
+ UpdateJob: []gax.CallOption{
gax.WithRetry(func() gax.Retryer {
return gax.OnCodes([]codes.Code{
codes.Unavailable,
}, gax.Backoff{
Initial: 100 * time.Millisecond,
Max: 60000 * time.Millisecond,
- Multiplier: 1.3,
+ Multiplier: 1.30,
+ })
+ }),
+ },
+ CancelJob: []gax.CallOption{
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnCodes([]codes.Code{
+ codes.DeadlineExceeded,
+ codes.Internal,
+ codes.Unavailable,
+ }, gax.Backoff{
+ Initial: 100 * time.Millisecond,
+ Max: 60000 * time.Millisecond,
+ Multiplier: 1.30,
+ })
+ }),
+ },
+ DeleteJob: []gax.CallOption{
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnCodes([]codes.Code{
+ codes.Unavailable,
+ }, gax.Backoff{
+ Initial: 100 * time.Millisecond,
+ Max: 60000 * time.Millisecond,
+ Multiplier: 1.30,
})
}),
},
}
- return &JobControllerCallOptions{
- SubmitJob: retry[[2]string{"default", "non_idempotent"}],
- GetJob: retry[[2]string{"default", "idempotent"}],
- ListJobs: retry[[2]string{"default", "idempotent"}],
- UpdateJob: retry[[2]string{"default", "non_idempotent"}],
- CancelJob: retry[[2]string{"default", "idempotent"}],
- DeleteJob: retry[[2]string{"default", "non_idempotent"}],
- }
}
-// JobControllerClient is a client for interacting with Google Cloud Dataproc API.
+// JobControllerClient is a client for interacting with Cloud Dataproc API.
//
// Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
type JobControllerClient struct {
@@ -120,6 +163,7 @@
jobControllerClient: dataprocpb.NewJobControllerClient(conn),
}
c.setGoogleClientInfo()
+
return c, nil
}
@@ -145,7 +189,8 @@
// SubmitJob submits a job to a cluster.
func (c *JobControllerClient) SubmitJob(ctx context.Context, req *dataprocpb.SubmitJobRequest, opts ...gax.CallOption) (*dataprocpb.Job, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v&%s=%v", "project_id", url.QueryEscape(req.GetProjectId()), "region", url.QueryEscape(req.GetRegion())))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.SubmitJob[0:len(c.CallOptions.SubmitJob):len(c.CallOptions.SubmitJob)], opts...)
var resp *dataprocpb.Job
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -161,7 +206,8 @@
// GetJob gets the resource representation for a job in a project.
func (c *JobControllerClient) GetJob(ctx context.Context, req *dataprocpb.GetJobRequest, opts ...gax.CallOption) (*dataprocpb.Job, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v&%s=%v&%s=%v", "project_id", url.QueryEscape(req.GetProjectId()), "region", url.QueryEscape(req.GetRegion()), "job_id", url.QueryEscape(req.GetJobId())))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.GetJob[0:len(c.CallOptions.GetJob):len(c.CallOptions.GetJob)], opts...)
var resp *dataprocpb.Job
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -177,7 +223,8 @@
// ListJobs lists regions/{region}/jobs in a project.
func (c *JobControllerClient) ListJobs(ctx context.Context, req *dataprocpb.ListJobsRequest, opts ...gax.CallOption) *JobIterator {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v&%s=%v", "project_id", url.QueryEscape(req.GetProjectId()), "region", url.QueryEscape(req.GetRegion())))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.ListJobs[0:len(c.CallOptions.ListJobs):len(c.CallOptions.ListJobs)], opts...)
it := &JobIterator{}
req = proto.Clone(req).(*dataprocpb.ListJobsRequest)
@@ -197,6 +244,8 @@
if err != nil {
return nil, "", err
}
+
+ it.Response = resp
return resp.Jobs, resp.NextPageToken, nil
}
fetch := func(pageSize int, pageToken string) (string, error) {
@@ -215,7 +264,8 @@
// UpdateJob updates a job in a project.
func (c *JobControllerClient) UpdateJob(ctx context.Context, req *dataprocpb.UpdateJobRequest, opts ...gax.CallOption) (*dataprocpb.Job, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v&%s=%v&%s=%v", "project_id", url.QueryEscape(req.GetProjectId()), "region", url.QueryEscape(req.GetRegion()), "job_id", url.QueryEscape(req.GetJobId())))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.UpdateJob[0:len(c.CallOptions.UpdateJob):len(c.CallOptions.UpdateJob)], opts...)
var resp *dataprocpb.Job
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -235,7 +285,8 @@
// or
// regions/{region}/jobs.get (at /dataproc/docs/reference/rest/v1beta2/projects.regions.jobs/get).
func (c *JobControllerClient) CancelJob(ctx context.Context, req *dataprocpb.CancelJobRequest, opts ...gax.CallOption) (*dataprocpb.Job, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v&%s=%v&%s=%v", "project_id", url.QueryEscape(req.GetProjectId()), "region", url.QueryEscape(req.GetRegion()), "job_id", url.QueryEscape(req.GetJobId())))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.CancelJob[0:len(c.CallOptions.CancelJob):len(c.CallOptions.CancelJob)], opts...)
var resp *dataprocpb.Job
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -252,7 +303,8 @@
// DeleteJob deletes the job from the project. If the job is active, the delete fails,
// and the response returns FAILED_PRECONDITION.
func (c *JobControllerClient) DeleteJob(ctx context.Context, req *dataprocpb.DeleteJobRequest, opts ...gax.CallOption) error {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v&%s=%v&%s=%v", "project_id", url.QueryEscape(req.GetProjectId()), "region", url.QueryEscape(req.GetRegion()), "job_id", url.QueryEscape(req.GetJobId())))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.DeleteJob[0:len(c.CallOptions.DeleteJob):len(c.CallOptions.DeleteJob)], opts...)
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
var err error
@@ -268,6 +320,11 @@
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.
//
diff --git a/dataproc/apiv1beta2/job_controller_client_example_test.go b/dataproc/apiv1beta2/job_controller_client_example_test.go
index 4fc0cab..e30f65f 100644
--- a/dataproc/apiv1beta2/job_controller_client_example_test.go
+++ b/dataproc/apiv1beta2/job_controller_client_example_test.go
@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-// Code generated by gapic-generator. DO NOT EDIT.
+// Code generated by protoc-gen-go_gapic. DO NOT EDIT.
package dataproc_test
@@ -35,6 +35,8 @@
}
func ExampleJobControllerClient_SubmitJob() {
+ // import dataprocpb "google.golang.org/genproto/googleapis/cloud/dataproc/v1beta2"
+
ctx := context.Background()
c, err := dataproc.NewJobControllerClient(ctx)
if err != nil {
@@ -53,6 +55,8 @@
}
func ExampleJobControllerClient_GetJob() {
+ // import dataprocpb "google.golang.org/genproto/googleapis/cloud/dataproc/v1beta2"
+
ctx := context.Background()
c, err := dataproc.NewJobControllerClient(ctx)
if err != nil {
@@ -71,6 +75,9 @@
}
func ExampleJobControllerClient_ListJobs() {
+ // import dataprocpb "google.golang.org/genproto/googleapis/cloud/dataproc/v1beta2"
+ // import "google.golang.org/api/iterator"
+
ctx := context.Background()
c, err := dataproc.NewJobControllerClient(ctx)
if err != nil {
@@ -95,6 +102,8 @@
}
func ExampleJobControllerClient_UpdateJob() {
+ // import dataprocpb "google.golang.org/genproto/googleapis/cloud/dataproc/v1beta2"
+
ctx := context.Background()
c, err := dataproc.NewJobControllerClient(ctx)
if err != nil {
@@ -113,6 +122,8 @@
}
func ExampleJobControllerClient_CancelJob() {
+ // import dataprocpb "google.golang.org/genproto/googleapis/cloud/dataproc/v1beta2"
+
ctx := context.Background()
c, err := dataproc.NewJobControllerClient(ctx)
if err != nil {
diff --git a/dataproc/apiv1beta2/workflow_template_client.go b/dataproc/apiv1beta2/workflow_template_client.go
index 53b50f5..b91b25b 100644
--- a/dataproc/apiv1beta2/workflow_template_client.go
+++ b/dataproc/apiv1beta2/workflow_template_client.go
@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-// Code generated by gapic-generator. DO NOT EDIT.
+// Code generated by protoc-gen-go_gapic. DO NOT EDIT.
package dataproc
@@ -51,6 +51,7 @@
func defaultWorkflowTemplateClientOptions() []option.ClientOption {
return []option.ClientOption{
option.WithEndpoint("dataproc.googleapis.com:443"),
+ option.WithGRPCDialOption(grpc.WithDisableServiceConfig()),
option.WithScopes(DefaultAuthScopes()...),
option.WithGRPCDialOption(grpc.WithDefaultCallOptions(
grpc.MaxCallRecvMsgSize(math.MaxInt32))),
@@ -58,8 +59,19 @@
}
func defaultWorkflowTemplateCallOptions() *WorkflowTemplateCallOptions {
- retry := map[[2]string][]gax.CallOption{
- {"default", "idempotent"}: {
+ return &WorkflowTemplateCallOptions{
+ CreateWorkflowTemplate: []gax.CallOption{
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnCodes([]codes.Code{
+ codes.Unavailable,
+ }, gax.Backoff{
+ Initial: 100 * time.Millisecond,
+ Max: 60000 * time.Millisecond,
+ Multiplier: 1.30,
+ })
+ }),
+ },
+ GetWorkflowTemplate: []gax.CallOption{
gax.WithRetry(func() gax.Retryer {
return gax.OnCodes([]codes.Code{
codes.DeadlineExceeded,
@@ -68,34 +80,71 @@
}, gax.Backoff{
Initial: 100 * time.Millisecond,
Max: 60000 * time.Millisecond,
- Multiplier: 1.3,
+ Multiplier: 1.30,
})
}),
},
- {"default", "non_idempotent"}: {
+ InstantiateWorkflowTemplate: []gax.CallOption{
gax.WithRetry(func() gax.Retryer {
return gax.OnCodes([]codes.Code{
codes.Unavailable,
}, gax.Backoff{
Initial: 100 * time.Millisecond,
Max: 60000 * time.Millisecond,
- Multiplier: 1.3,
+ Multiplier: 1.30,
+ })
+ }),
+ },
+ InstantiateInlineWorkflowTemplate: []gax.CallOption{
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnCodes([]codes.Code{
+ codes.Unavailable,
+ }, gax.Backoff{
+ Initial: 100 * time.Millisecond,
+ Max: 60000 * time.Millisecond,
+ Multiplier: 1.30,
+ })
+ }),
+ },
+ UpdateWorkflowTemplate: []gax.CallOption{
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnCodes([]codes.Code{
+ codes.Unavailable,
+ }, gax.Backoff{
+ Initial: 100 * time.Millisecond,
+ Max: 60000 * time.Millisecond,
+ Multiplier: 1.30,
+ })
+ }),
+ },
+ ListWorkflowTemplates: []gax.CallOption{
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnCodes([]codes.Code{
+ codes.DeadlineExceeded,
+ codes.Internal,
+ codes.Unavailable,
+ }, gax.Backoff{
+ Initial: 100 * time.Millisecond,
+ Max: 60000 * time.Millisecond,
+ Multiplier: 1.30,
+ })
+ }),
+ },
+ DeleteWorkflowTemplate: []gax.CallOption{
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnCodes([]codes.Code{
+ codes.Unavailable,
+ }, gax.Backoff{
+ Initial: 100 * time.Millisecond,
+ Max: 60000 * time.Millisecond,
+ Multiplier: 1.30,
})
}),
},
}
- return &WorkflowTemplateCallOptions{
- CreateWorkflowTemplate: retry[[2]string{"default", "non_idempotent"}],
- GetWorkflowTemplate: retry[[2]string{"default", "idempotent"}],
- InstantiateWorkflowTemplate: retry[[2]string{"default", "non_idempotent"}],
- InstantiateInlineWorkflowTemplate: retry[[2]string{"default", "non_idempotent"}],
- UpdateWorkflowTemplate: retry[[2]string{"default", "non_idempotent"}],
- ListWorkflowTemplates: retry[[2]string{"default", "idempotent"}],
- DeleteWorkflowTemplate: retry[[2]string{"default", "non_idempotent"}],
- }
}
-// WorkflowTemplateClient is a client for interacting with Google Cloud Dataproc API.
+// WorkflowTemplateClient is a client for interacting with Cloud Dataproc API.
//
// Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
type WorkflowTemplateClient struct {
@@ -325,6 +374,8 @@
if err != nil {
return nil, "", err
}
+
+ it.Response = resp
return resp.Templates, resp.NextPageToken, nil
}
fetch := func(pageSize int, pageToken string) (string, error) {
@@ -354,48 +405,6 @@
return err
}
-// WorkflowTemplateIterator manages a stream of *dataprocpb.WorkflowTemplate.
-type WorkflowTemplateIterator struct {
- items []*dataprocpb.WorkflowTemplate
- pageInfo *iterator.PageInfo
- nextFunc func() error
-
- // 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 []*dataprocpb.WorkflowTemplate, nextPageToken string, err error)
-}
-
-// PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
-func (it *WorkflowTemplateIterator) 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 *WorkflowTemplateIterator) Next() (*dataprocpb.WorkflowTemplate, error) {
- var item *dataprocpb.WorkflowTemplate
- if err := it.nextFunc(); err != nil {
- return item, err
- }
- item = it.items[0]
- it.items = it.items[1:]
- return item, nil
-}
-
-func (it *WorkflowTemplateIterator) bufLen() int {
- return len(it.items)
-}
-
-func (it *WorkflowTemplateIterator) takeBuf() interface{} {
- b := it.items
- it.items = nil
- return b
-}
-
// InstantiateInlineWorkflowTemplateOperation manages a long-running operation from InstantiateInlineWorkflowTemplate.
type InstantiateInlineWorkflowTemplateOperation struct {
lro *longrunning.Operation
@@ -409,11 +418,11 @@
}
}
-// Wait blocks until the long-running operation is completed, returning any error encountered.
+// 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 *InstantiateInlineWorkflowTemplateOperation) Wait(ctx context.Context, opts ...gax.CallOption) error {
- return op.lro.WaitWithInterval(ctx, nil, 10000*time.Millisecond, opts...)
+ return op.lro.WaitWithInterval(ctx, nil, time.Minute, opts...)
}
// Poll fetches the latest state of the long-running operation.
@@ -422,7 +431,9 @@
//
// 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.
+// 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 *InstantiateInlineWorkflowTemplateOperation) Poll(ctx context.Context, opts ...gax.CallOption) error {
return op.lro.Poll(ctx, nil, opts...)
}
@@ -465,11 +476,11 @@
}
}
-// Wait blocks until the long-running operation is completed, returning any error encountered.
+// 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 *InstantiateWorkflowTemplateOperation) Wait(ctx context.Context, opts ...gax.CallOption) error {
- return op.lro.WaitWithInterval(ctx, nil, 10000*time.Millisecond, opts...)
+ return op.lro.WaitWithInterval(ctx, nil, time.Minute, opts...)
}
// Poll fetches the latest state of the long-running operation.
@@ -478,7 +489,9 @@
//
// 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.
+// 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 *InstantiateWorkflowTemplateOperation) Poll(ctx context.Context, opts ...gax.CallOption) error {
return op.lro.Poll(ctx, nil, opts...)
}
@@ -507,3 +520,50 @@
func (op *InstantiateWorkflowTemplateOperation) Name() string {
return op.lro.Name()
}
+
+// WorkflowTemplateIterator manages a stream of *dataprocpb.WorkflowTemplate.
+type WorkflowTemplateIterator struct {
+ items []*dataprocpb.WorkflowTemplate
+ 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 []*dataprocpb.WorkflowTemplate, nextPageToken string, err error)
+}
+
+// PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
+func (it *WorkflowTemplateIterator) 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 *WorkflowTemplateIterator) Next() (*dataprocpb.WorkflowTemplate, error) {
+ var item *dataprocpb.WorkflowTemplate
+ if err := it.nextFunc(); err != nil {
+ return item, err
+ }
+ item = it.items[0]
+ it.items = it.items[1:]
+ return item, nil
+}
+
+func (it *WorkflowTemplateIterator) bufLen() int {
+ return len(it.items)
+}
+
+func (it *WorkflowTemplateIterator) takeBuf() interface{} {
+ b := it.items
+ it.items = nil
+ return b
+}
diff --git a/dataproc/apiv1beta2/workflow_template_client_example_test.go b/dataproc/apiv1beta2/workflow_template_client_example_test.go
index 0569c9c..7028225 100644
--- a/dataproc/apiv1beta2/workflow_template_client_example_test.go
+++ b/dataproc/apiv1beta2/workflow_template_client_example_test.go
@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-// Code generated by gapic-generator. DO NOT EDIT.
+// Code generated by protoc-gen-go_gapic. DO NOT EDIT.
package dataproc_test
@@ -35,6 +35,8 @@
}
func ExampleWorkflowTemplateClient_CreateWorkflowTemplate() {
+ // import dataprocpb "google.golang.org/genproto/googleapis/cloud/dataproc/v1beta2"
+
ctx := context.Background()
c, err := dataproc.NewWorkflowTemplateClient(ctx)
if err != nil {
@@ -53,6 +55,8 @@
}
func ExampleWorkflowTemplateClient_GetWorkflowTemplate() {
+ // import dataprocpb "google.golang.org/genproto/googleapis/cloud/dataproc/v1beta2"
+
ctx := context.Background()
c, err := dataproc.NewWorkflowTemplateClient(ctx)
if err != nil {
@@ -71,6 +75,8 @@
}
func ExampleWorkflowTemplateClient_InstantiateWorkflowTemplate() {
+ // import dataprocpb "google.golang.org/genproto/googleapis/cloud/dataproc/v1beta2"
+
ctx := context.Background()
c, err := dataproc.NewWorkflowTemplateClient(ctx)
if err != nil {
@@ -86,10 +92,14 @@
}
err = op.Wait(ctx)
- // TODO: Handle error.
+ if err != nil {
+ // TODO: Handle error.
+ }
}
func ExampleWorkflowTemplateClient_InstantiateInlineWorkflowTemplate() {
+ // import dataprocpb "google.golang.org/genproto/googleapis/cloud/dataproc/v1beta2"
+
ctx := context.Background()
c, err := dataproc.NewWorkflowTemplateClient(ctx)
if err != nil {
@@ -105,10 +115,14 @@
}
err = op.Wait(ctx)
- // TODO: Handle error.
+ if err != nil {
+ // TODO: Handle error.
+ }
}
func ExampleWorkflowTemplateClient_UpdateWorkflowTemplate() {
+ // import dataprocpb "google.golang.org/genproto/googleapis/cloud/dataproc/v1beta2"
+
ctx := context.Background()
c, err := dataproc.NewWorkflowTemplateClient(ctx)
if err != nil {
@@ -127,6 +141,9 @@
}
func ExampleWorkflowTemplateClient_ListWorkflowTemplates() {
+ // import dataprocpb "google.golang.org/genproto/googleapis/cloud/dataproc/v1beta2"
+ // import "google.golang.org/api/iterator"
+
ctx := context.Background()
c, err := dataproc.NewWorkflowTemplateClient(ctx)
if err != nil {
diff --git a/datastore/go.mod b/datastore/go.mod
index 4adefd0..bca7706 100644
--- a/datastore/go.mod
+++ b/datastore/go.mod
@@ -10,8 +10,8 @@
github.com/googleapis/gax-go/v2 v2.0.5
golang.org/x/exp v0.0.0-20191129062945-2f5052295587 // indirect
golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f // indirect
- golang.org/x/tools v0.0.0-20191206204035-259af5ff87bd // indirect
+ golang.org/x/tools v0.0.0-20191216173652-a0e659d51361 // indirect
google.golang.org/api v0.14.0
- google.golang.org/genproto v0.0.0-20191206224255-0243a4be9c8f
+ google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1
google.golang.org/grpc v1.21.1
)
diff --git a/datastore/go.sum b/datastore/go.sum
index 76f8cd4..92def3d 100644
--- a/datastore/go.sum
+++ b/datastore/go.sum
@@ -58,6 +58,7 @@
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/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 h1:OeRHuibLsmZkFj773W4LcfAGsSxJgfPONhr8cmO+eLA=
@@ -82,6 +83,7 @@
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=
+golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg=
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=
@@ -135,9 +137,10 @@
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-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
-golang.org/x/tools v0.0.0-20191206204035-259af5ff87bd h1:Zc7EU2PqpsNeIfOoVA7hvQX4cS3YDJEs5KlfatT3hLo=
-golang.org/x/tools v0.0.0-20191206204035-259af5ff87bd/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
+golang.org/x/tools v0.0.0-20191216173652-a0e659d51361 h1:RIIXAeV6GvDBuADKumTODatUqANFZ+5BPMnzsy4hulY=
+golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
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=
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 h1:VGGbLNyPF7dvYHhcUGYBBGCRDDK0RRJAI6KCvo0CL+E=
@@ -161,8 +164,8 @@
google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc=
google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51 h1:Ex1mq5jaJof+kRnYi3SlYJ8KKa9Ao3NHyIT5XJ1gF6U=
google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8=
-google.golang.org/genproto v0.0.0-20191206224255-0243a4be9c8f h1:naitw5DILWPQvG0oG04mR9jF8fmKpRdW3E3zzKA4D0Y=
-google.golang.org/genproto v0.0.0-20191206224255-0243a4be9c8f/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
+google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1 h1:aQktFqmDE2yjveXJlVIfslDFmFnUXSqG0i6KRcJAeMc=
+google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
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 h1:j6XxA85m/6txkUCHvzlV5f+HBNl/1r5cZ2A/3IEFOO8=
diff --git a/debugger/apiv2/controller2_client.go b/debugger/apiv2/controller2_client.go
index e073d52..c848c35 100644
--- a/debugger/apiv2/controller2_client.go
+++ b/debugger/apiv2/controller2_client.go
@@ -12,15 +12,13 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-// Code generated by gapic-generator. DO NOT EDIT.
+// Code generated by protoc-gen-go_gapic. DO NOT EDIT.
package debugger
import (
"context"
- "fmt"
"math"
- "net/url"
"time"
gax "github.com/googleapis/gax-go/v2"
@@ -34,14 +32,15 @@
// Controller2CallOptions contains the retry settings for each method of Controller2Client.
type Controller2CallOptions struct {
- UpdateActiveBreakpoint []gax.CallOption
RegisterDebuggee []gax.CallOption
ListActiveBreakpoints []gax.CallOption
+ UpdateActiveBreakpoint []gax.CallOption
}
func defaultController2ClientOptions() []option.ClientOption {
return []option.ClientOption{
option.WithEndpoint("clouddebugger.googleapis.com:443"),
+ option.WithGRPCDialOption(grpc.WithDisableServiceConfig()),
option.WithScopes(DefaultAuthScopes()...),
option.WithGRPCDialOption(grpc.WithDefaultCallOptions(
grpc.MaxCallRecvMsgSize(math.MaxInt32))),
@@ -49,24 +48,32 @@
}
func defaultController2CallOptions() *Controller2CallOptions {
- retry := map[[2]string][]gax.CallOption{
- {"default", "idempotent"}: {
+ return &Controller2CallOptions{
+ RegisterDebuggee: []gax.CallOption{},
+ ListActiveBreakpoints: []gax.CallOption{
gax.WithRetry(func() gax.Retryer {
return gax.OnCodes([]codes.Code{
- codes.DeadlineExceeded,
codes.Unavailable,
+ codes.DeadlineExceeded,
}, gax.Backoff{
Initial: 100 * time.Millisecond,
Max: 60000 * time.Millisecond,
- Multiplier: 1.3,
+ Multiplier: 1.30,
})
}),
},
- }
- return &Controller2CallOptions{
- UpdateActiveBreakpoint: retry[[2]string{"default", "idempotent"}],
- RegisterDebuggee: retry[[2]string{"default", "non_idempotent"}],
- ListActiveBreakpoints: retry[[2]string{"default", "idempotent"}],
+ UpdateActiveBreakpoint: []gax.CallOption{
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnCodes([]codes.Code{
+ codes.Unavailable,
+ codes.DeadlineExceeded,
+ }, gax.Backoff{
+ Initial: 100 * time.Millisecond,
+ Max: 60000 * time.Millisecond,
+ Multiplier: 1.30,
+ })
+ }),
+ },
}
}
@@ -120,7 +127,8 @@
controller2Client: clouddebuggerpb.NewController2Client(conn),
}
- c.SetGoogleClientInfo()
+ c.setGoogleClientInfo()
+
return c, nil
}
@@ -135,38 +143,15 @@
return c.conn.Close()
}
-// SetGoogleClientInfo sets the name and version of the application in
+// 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 *Controller2Client) SetGoogleClientInfo(keyval ...string) {
+func (c *Controller2Client) 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...))
}
-// UpdateActiveBreakpoint updates the breakpoint state or mutable fields.
-// The entire Breakpoint message must be sent back to the controller service.
-//
-// Updates to active breakpoint fields are only allowed if the new value
-// does not change the breakpoint specification. Updates to the location,
-// condition and expressions fields should not alter the breakpoint
-// semantics. These may only make changes such as canonicalizing a value
-// or snapping the location to the correct line of code.
-func (c *Controller2Client) UpdateActiveBreakpoint(ctx context.Context, req *clouddebuggerpb.UpdateActiveBreakpointRequest, opts ...gax.CallOption) (*clouddebuggerpb.UpdateActiveBreakpointResponse, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
- opts = append(c.CallOptions.UpdateActiveBreakpoint[0:len(c.CallOptions.UpdateActiveBreakpoint):len(c.CallOptions.UpdateActiveBreakpoint)], opts...)
- var resp *clouddebuggerpb.UpdateActiveBreakpointResponse
- err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
- var err error
- resp, err = c.controller2Client.UpdateActiveBreakpoint(ctx, req, settings.GRPC...)
- return err
- }, opts...)
- if err != nil {
- return nil, err
- }
- return resp, nil
-}
-
// RegisterDebuggee registers the debuggee with the controller service.
//
// All agents attached to the same application must call this method with
@@ -198,7 +183,7 @@
// fields) is semantically immutable, although the field values may
// change. For example, an agent may update the location line number
// to reflect the actual line where the breakpoint was set, but this
-// doesn't change the breakpoint semantics.
+// doesn’t change the breakpoint semantics.
//
// This means that an agent does not need to check if a breakpoint has changed
// when it encounters the same breakpoint on a successive call.
@@ -206,8 +191,7 @@
// until the controller removes them from the active list to avoid
// setting those breakpoints again.
func (c *Controller2Client) ListActiveBreakpoints(ctx context.Context, req *clouddebuggerpb.ListActiveBreakpointsRequest, opts ...gax.CallOption) (*clouddebuggerpb.ListActiveBreakpointsResponse, error) {
- md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "debuggee_id", url.QueryEscape(req.GetDebuggeeId())))
- ctx = insertMetadata(ctx, c.xGoogMetadata, md)
+ ctx = insertMetadata(ctx, c.xGoogMetadata)
opts = append(c.CallOptions.ListActiveBreakpoints[0:len(c.CallOptions.ListActiveBreakpoints):len(c.CallOptions.ListActiveBreakpoints)], opts...)
var resp *clouddebuggerpb.ListActiveBreakpointsResponse
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -220,3 +204,26 @@
}
return resp, nil
}
+
+// UpdateActiveBreakpoint updates the breakpoint state or mutable fields.
+// The entire Breakpoint message must be sent back to the controller service.
+//
+// Updates to active breakpoint fields are only allowed if the new value
+// does not change the breakpoint specification. Updates to the location,
+// condition and expressions fields should not alter the breakpoint
+// semantics. These may only make changes such as canonicalizing a value
+// or snapping the location to the correct line of code.
+func (c *Controller2Client) UpdateActiveBreakpoint(ctx context.Context, req *clouddebuggerpb.UpdateActiveBreakpointRequest, opts ...gax.CallOption) (*clouddebuggerpb.UpdateActiveBreakpointResponse, error) {
+ ctx = insertMetadata(ctx, c.xGoogMetadata)
+ opts = append(c.CallOptions.UpdateActiveBreakpoint[0:len(c.CallOptions.UpdateActiveBreakpoint):len(c.CallOptions.UpdateActiveBreakpoint)], opts...)
+ var resp *clouddebuggerpb.UpdateActiveBreakpointResponse
+ err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ var err error
+ resp, err = c.controller2Client.UpdateActiveBreakpoint(ctx, req, settings.GRPC...)
+ return err
+ }, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return resp, nil
+}
diff --git a/debugger/apiv2/controller2_client_example_test.go b/debugger/apiv2/controller2_client_example_test.go
index fa988ff..d1e303f 100644
--- a/debugger/apiv2/controller2_client_example_test.go
+++ b/debugger/apiv2/controller2_client_example_test.go
@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-// Code generated by gapic-generator. DO NOT EDIT.
+// Code generated by protoc-gen-go_gapic. DO NOT EDIT.
package debugger_test
@@ -33,25 +33,9 @@
_ = c
}
-func ExampleController2Client_UpdateActiveBreakpoint() {
- ctx := context.Background()
- c, err := debugger.NewController2Client(ctx)
- if err != nil {
- // TODO: Handle error.
- }
-
- req := &clouddebuggerpb.UpdateActiveBreakpointRequest{
- // TODO: Fill request struct fields.
- }
- resp, err := c.UpdateActiveBreakpoint(ctx, req)
- if err != nil {
- // TODO: Handle error.
- }
- // TODO: Use resp.
- _ = resp
-}
-
func ExampleController2Client_RegisterDebuggee() {
+ // import clouddebuggerpb "google.golang.org/genproto/googleapis/devtools/clouddebugger/v2"
+
ctx := context.Background()
c, err := debugger.NewController2Client(ctx)
if err != nil {
@@ -70,6 +54,8 @@
}
func ExampleController2Client_ListActiveBreakpoints() {
+ // import clouddebuggerpb "google.golang.org/genproto/googleapis/devtools/clouddebugger/v2"
+
ctx := context.Background()
c, err := debugger.NewController2Client(ctx)
if err != nil {
@@ -86,3 +72,23 @@
// TODO: Use resp.
_ = resp
}
+
+func ExampleController2Client_UpdateActiveBreakpoint() {
+ // import clouddebuggerpb "google.golang.org/genproto/googleapis/devtools/clouddebugger/v2"
+
+ ctx := context.Background()
+ c, err := debugger.NewController2Client(ctx)
+ if err != nil {
+ // TODO: Handle error.
+ }
+
+ req := &clouddebuggerpb.UpdateActiveBreakpointRequest{
+ // TODO: Fill request struct fields.
+ }
+ resp, err := c.UpdateActiveBreakpoint(ctx, req)
+ if err != nil {
+ // TODO: Handle error.
+ }
+ // TODO: Use resp.
+ _ = resp
+}
diff --git a/debugger/apiv2/debugger2_client.go b/debugger/apiv2/debugger2_client.go
index a70e4b6..9a594d6 100644
--- a/debugger/apiv2/debugger2_client.go
+++ b/debugger/apiv2/debugger2_client.go
@@ -12,15 +12,13 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-// Code generated by gapic-generator. DO NOT EDIT.
+// Code generated by protoc-gen-go_gapic. DO NOT EDIT.
package debugger
import (
"context"
- "fmt"
"math"
- "net/url"
"time"
gax "github.com/googleapis/gax-go/v2"
@@ -34,9 +32,9 @@
// Debugger2CallOptions contains the retry settings for each method of Debugger2Client.
type Debugger2CallOptions struct {
- DeleteBreakpoint []gax.CallOption
SetBreakpoint []gax.CallOption
GetBreakpoint []gax.CallOption
+ DeleteBreakpoint []gax.CallOption
ListBreakpoints []gax.CallOption
ListDebuggees []gax.CallOption
}
@@ -44,6 +42,7 @@
func defaultDebugger2ClientOptions() []option.ClientOption {
return []option.ClientOption{
option.WithEndpoint("clouddebugger.googleapis.com:443"),
+ option.WithGRPCDialOption(grpc.WithDisableServiceConfig()),
option.WithScopes(DefaultAuthScopes()...),
option.WithGRPCDialOption(grpc.WithDefaultCallOptions(
grpc.MaxCallRecvMsgSize(math.MaxInt32))),
@@ -51,26 +50,56 @@
}
func defaultDebugger2CallOptions() *Debugger2CallOptions {
- retry := map[[2]string][]gax.CallOption{
- {"default", "idempotent"}: {
+ return &Debugger2CallOptions{
+ SetBreakpoint: []gax.CallOption{},
+ GetBreakpoint: []gax.CallOption{
gax.WithRetry(func() gax.Retryer {
return gax.OnCodes([]codes.Code{
- codes.DeadlineExceeded,
codes.Unavailable,
+ codes.DeadlineExceeded,
}, gax.Backoff{
Initial: 100 * time.Millisecond,
Max: 60000 * time.Millisecond,
- Multiplier: 1.3,
+ Multiplier: 1.30,
})
}),
},
- }
- return &Debugger2CallOptions{
- DeleteBreakpoint: retry[[2]string{"default", "idempotent"}],
- SetBreakpoint: retry[[2]string{"default", "non_idempotent"}],
- GetBreakpoint: retry[[2]string{"default", "idempotent"}],
- ListBreakpoints: retry[[2]string{"default", "idempotent"}],
- ListDebuggees: retry[[2]string{"default", "idempotent"}],
+ DeleteBreakpoint: []gax.CallOption{
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnCodes([]codes.Code{
+ codes.Unavailable,
+ codes.DeadlineExceeded,
+ }, gax.Backoff{
+ Initial: 100 * time.Millisecond,
+ Max: 60000 * time.Millisecond,
+ Multiplier: 1.30,
+ })
+ }),
+ },
+ ListBreakpoints: []gax.CallOption{
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnCodes([]codes.Code{
+ codes.Unavailable,
+ codes.DeadlineExceeded,
+ }, gax.Backoff{
+ Initial: 100 * time.Millisecond,
+ Max: 60000 * time.Millisecond,
+ Multiplier: 1.30,
+ })
+ }),
+ },
+ ListDebuggees: []gax.CallOption{
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnCodes([]codes.Code{
+ codes.Unavailable,
+ codes.DeadlineExceeded,
+ }, gax.Backoff{
+ Initial: 100 * time.Millisecond,
+ Max: 60000 * time.Millisecond,
+ Multiplier: 1.30,
+ })
+ }),
+ },
}
}
@@ -116,7 +145,8 @@
debugger2Client: clouddebuggerpb.NewDebugger2Client(conn),
}
- c.SetGoogleClientInfo()
+ c.setGoogleClientInfo()
+
return c, nil
}
@@ -131,31 +161,18 @@
return c.conn.Close()
}
-// SetGoogleClientInfo sets the name and version of the application in
+// 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 *Debugger2Client) SetGoogleClientInfo(keyval ...string) {
+func (c *Debugger2Client) 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...))
}
-// DeleteBreakpoint deletes the breakpoint from the debuggee.
-func (c *Debugger2Client) DeleteBreakpoint(ctx context.Context, req *clouddebuggerpb.DeleteBreakpointRequest, opts ...gax.CallOption) error {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
- opts = append(c.CallOptions.DeleteBreakpoint[0:len(c.CallOptions.DeleteBreakpoint):len(c.CallOptions.DeleteBreakpoint)], opts...)
- err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
- var err error
- _, err = c.debugger2Client.DeleteBreakpoint(ctx, req, settings.GRPC...)
- return err
- }, opts...)
- return err
-}
-
// SetBreakpoint sets the breakpoint to the debuggee.
func (c *Debugger2Client) SetBreakpoint(ctx context.Context, req *clouddebuggerpb.SetBreakpointRequest, opts ...gax.CallOption) (*clouddebuggerpb.SetBreakpointResponse, error) {
- md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "debuggee_id", url.QueryEscape(req.GetDebuggeeId())))
- ctx = insertMetadata(ctx, c.xGoogMetadata, md)
+ ctx = insertMetadata(ctx, c.xGoogMetadata)
opts = append(c.CallOptions.SetBreakpoint[0:len(c.CallOptions.SetBreakpoint):len(c.CallOptions.SetBreakpoint)], opts...)
var resp *clouddebuggerpb.SetBreakpointResponse
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -185,10 +202,21 @@
return resp, nil
}
+// DeleteBreakpoint deletes the breakpoint from the debuggee.
+func (c *Debugger2Client) DeleteBreakpoint(ctx context.Context, req *clouddebuggerpb.DeleteBreakpointRequest, opts ...gax.CallOption) error {
+ ctx = insertMetadata(ctx, c.xGoogMetadata)
+ opts = append(c.CallOptions.DeleteBreakpoint[0:len(c.CallOptions.DeleteBreakpoint):len(c.CallOptions.DeleteBreakpoint)], opts...)
+ err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ var err error
+ _, err = c.debugger2Client.DeleteBreakpoint(ctx, req, settings.GRPC...)
+ return err
+ }, opts...)
+ return err
+}
+
// ListBreakpoints lists all breakpoints for the debuggee.
func (c *Debugger2Client) ListBreakpoints(ctx context.Context, req *clouddebuggerpb.ListBreakpointsRequest, opts ...gax.CallOption) (*clouddebuggerpb.ListBreakpointsResponse, error) {
- md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "debuggee_id", url.QueryEscape(req.GetDebuggeeId())))
- ctx = insertMetadata(ctx, c.xGoogMetadata, md)
+ ctx = insertMetadata(ctx, c.xGoogMetadata)
opts = append(c.CallOptions.ListBreakpoints[0:len(c.CallOptions.ListBreakpoints):len(c.CallOptions.ListBreakpoints)], opts...)
var resp *clouddebuggerpb.ListBreakpointsResponse
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
diff --git a/debugger/apiv2/debugger2_client_example_test.go b/debugger/apiv2/debugger2_client_example_test.go
index 5c9a13e..c9505aa 100644
--- a/debugger/apiv2/debugger2_client_example_test.go
+++ b/debugger/apiv2/debugger2_client_example_test.go
@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-// Code generated by gapic-generator. DO NOT EDIT.
+// Code generated by protoc-gen-go_gapic. DO NOT EDIT.
package debugger_test
@@ -33,23 +33,9 @@
_ = c
}
-func ExampleDebugger2Client_DeleteBreakpoint() {
- ctx := context.Background()
- c, err := debugger.NewDebugger2Client(ctx)
- if err != nil {
- // TODO: Handle error.
- }
-
- req := &clouddebuggerpb.DeleteBreakpointRequest{
- // TODO: Fill request struct fields.
- }
- err = c.DeleteBreakpoint(ctx, req)
- if err != nil {
- // TODO: Handle error.
- }
-}
-
func ExampleDebugger2Client_SetBreakpoint() {
+ // import clouddebuggerpb "google.golang.org/genproto/googleapis/devtools/clouddebugger/v2"
+
ctx := context.Background()
c, err := debugger.NewDebugger2Client(ctx)
if err != nil {
@@ -68,6 +54,8 @@
}
func ExampleDebugger2Client_GetBreakpoint() {
+ // import clouddebuggerpb "google.golang.org/genproto/googleapis/devtools/clouddebugger/v2"
+
ctx := context.Background()
c, err := debugger.NewDebugger2Client(ctx)
if err != nil {
@@ -85,7 +73,25 @@
_ = resp
}
+func ExampleDebugger2Client_DeleteBreakpoint() {
+ ctx := context.Background()
+ c, err := debugger.NewDebugger2Client(ctx)
+ if err != nil {
+ // TODO: Handle error.
+ }
+
+ req := &clouddebuggerpb.DeleteBreakpointRequest{
+ // TODO: Fill request struct fields.
+ }
+ err = c.DeleteBreakpoint(ctx, req)
+ if err != nil {
+ // TODO: Handle error.
+ }
+}
+
func ExampleDebugger2Client_ListBreakpoints() {
+ // import clouddebuggerpb "google.golang.org/genproto/googleapis/devtools/clouddebugger/v2"
+
ctx := context.Background()
c, err := debugger.NewDebugger2Client(ctx)
if err != nil {
@@ -104,6 +110,8 @@
}
func ExampleDebugger2Client_ListDebuggees() {
+ // import clouddebuggerpb "google.golang.org/genproto/googleapis/devtools/clouddebugger/v2"
+
ctx := context.Background()
c, err := debugger.NewDebugger2Client(ctx)
if err != nil {
diff --git a/debugger/apiv2/doc.go b/debugger/apiv2/doc.go
index 2f63e18..035c9e1 100644
--- a/debugger/apiv2/doc.go
+++ b/debugger/apiv2/doc.go
@@ -12,13 +12,11 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-// Code generated by gapic-generator. DO NOT EDIT.
+// Code generated by protoc-gen-go_gapic. DO NOT EDIT.
// Package debugger is an auto-generated package for the
// Stackdriver Debugger API.
//
-// NOTE: This package is in alpha. It is not stable, and is likely to change.
-//
// Examines the call stack and variables of a running application without
// stopping or slowing it down.
//
@@ -32,8 +30,7 @@
//
// For information about setting deadlines, reusing contexts, and more
// please visit godoc.org/cloud.google.com/go.
-//
-// Use the client at cloud.google.com/go/cmd/go-cloud-debug-agent in preference to this.
+
package debugger // import "cloud.google.com/go/debugger/apiv2"
import (
@@ -45,6 +42,8 @@
"google.golang.org/grpc/metadata"
)
+const versionClient = "20191216"
+
func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context {
out, _ := metadata.FromOutgoingContext(ctx)
out = out.Copy()
@@ -79,7 +78,7 @@
}
notSemverRune := func(r rune) bool {
- return strings.IndexRune("0123456789.", r) < 0
+ return !strings.ContainsRune("0123456789.", r)
}
if strings.HasPrefix(s, "go1") {
@@ -100,5 +99,3 @@
}
return "UNKNOWN"
}
-
-const versionClient = "20191206"
diff --git a/dialogflow/apiv2/doc.go b/dialogflow/apiv2/doc.go
index 74f2eed..1615335 100644
--- a/dialogflow/apiv2/doc.go
+++ b/dialogflow/apiv2/doc.go
@@ -98,4 +98,4 @@
return "UNKNOWN"
}
-const versionClient = "20191206"
+const versionClient = "20191216"
diff --git a/dlp/apiv2/dlp_client.go b/dlp/apiv2/dlp_client.go
index aab1f67..c9cbe8a 100644
--- a/dlp/apiv2/dlp_client.go
+++ b/dlp/apiv2/dlp_client.go
@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-// Code generated by gapic-generator. DO NOT EDIT.
+// Code generated by protoc-gen-go_gapic. DO NOT EDIT.
package dlp
@@ -51,16 +51,17 @@
GetDeidentifyTemplate []gax.CallOption
ListDeidentifyTemplates []gax.CallOption
DeleteDeidentifyTemplate []gax.CallOption
+ CreateJobTrigger []gax.CallOption
+ UpdateJobTrigger []gax.CallOption
+ GetJobTrigger []gax.CallOption
+ ListJobTriggers []gax.CallOption
+ DeleteJobTrigger []gax.CallOption
+ ActivateJobTrigger []gax.CallOption
CreateDlpJob []gax.CallOption
ListDlpJobs []gax.CallOption
GetDlpJob []gax.CallOption
DeleteDlpJob []gax.CallOption
CancelDlpJob []gax.CallOption
- ListJobTriggers []gax.CallOption
- GetJobTrigger []gax.CallOption
- DeleteJobTrigger []gax.CallOption
- UpdateJobTrigger []gax.CallOption
- CreateJobTrigger []gax.CallOption
CreateStoredInfoType []gax.CallOption
UpdateStoredInfoType []gax.CallOption
GetStoredInfoType []gax.CallOption
@@ -71,6 +72,7 @@
func defaultClientOptions() []option.ClientOption {
return []option.ClientOption{
option.WithEndpoint("dlp.googleapis.com:443"),
+ option.WithGRPCDialOption(grpc.WithDisableServiceConfig()),
option.WithScopes(DefaultAuthScopes()...),
option.WithGRPCDialOption(grpc.WithDefaultCallOptions(
grpc.MaxCallRecvMsgSize(math.MaxInt32))),
@@ -78,51 +80,258 @@
}
func defaultCallOptions() *CallOptions {
- retry := map[[2]string][]gax.CallOption{
- {"default", "idempotent"}: {
+ return &CallOptions{
+ InspectContent: []gax.CallOption{
gax.WithRetry(func() gax.Retryer {
return gax.OnCodes([]codes.Code{
- codes.DeadlineExceeded,
codes.Unavailable,
+ codes.DeadlineExceeded,
}, gax.Backoff{
Initial: 100 * time.Millisecond,
Max: 60000 * time.Millisecond,
- Multiplier: 1.3,
+ Multiplier: 1.30,
})
}),
},
- }
- return &CallOptions{
- InspectContent: retry[[2]string{"default", "idempotent"}],
- RedactImage: retry[[2]string{"default", "idempotent"}],
- DeidentifyContent: retry[[2]string{"default", "idempotent"}],
- ReidentifyContent: retry[[2]string{"default", "idempotent"}],
- ListInfoTypes: retry[[2]string{"default", "idempotent"}],
- CreateInspectTemplate: retry[[2]string{"default", "non_idempotent"}],
- UpdateInspectTemplate: retry[[2]string{"default", "non_idempotent"}],
- GetInspectTemplate: retry[[2]string{"default", "idempotent"}],
- ListInspectTemplates: retry[[2]string{"default", "idempotent"}],
- DeleteInspectTemplate: retry[[2]string{"default", "idempotent"}],
- CreateDeidentifyTemplate: retry[[2]string{"default", "non_idempotent"}],
- UpdateDeidentifyTemplate: retry[[2]string{"default", "non_idempotent"}],
- GetDeidentifyTemplate: retry[[2]string{"default", "idempotent"}],
- ListDeidentifyTemplates: retry[[2]string{"default", "idempotent"}],
- DeleteDeidentifyTemplate: retry[[2]string{"default", "idempotent"}],
- CreateDlpJob: retry[[2]string{"default", "non_idempotent"}],
- ListDlpJobs: retry[[2]string{"default", "idempotent"}],
- GetDlpJob: retry[[2]string{"default", "idempotent"}],
- DeleteDlpJob: retry[[2]string{"default", "idempotent"}],
- CancelDlpJob: retry[[2]string{"default", "non_idempotent"}],
- ListJobTriggers: retry[[2]string{"default", "idempotent"}],
- GetJobTrigger: retry[[2]string{"default", "idempotent"}],
- DeleteJobTrigger: retry[[2]string{"default", "idempotent"}],
- UpdateJobTrigger: retry[[2]string{"default", "non_idempotent"}],
- CreateJobTrigger: retry[[2]string{"default", "non_idempotent"}],
- CreateStoredInfoType: retry[[2]string{"default", "non_idempotent"}],
- UpdateStoredInfoType: retry[[2]string{"default", "non_idempotent"}],
- GetStoredInfoType: retry[[2]string{"default", "idempotent"}],
- ListStoredInfoTypes: retry[[2]string{"default", "idempotent"}],
- DeleteStoredInfoType: retry[[2]string{"default", "idempotent"}],
+ RedactImage: []gax.CallOption{
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnCodes([]codes.Code{
+ codes.Unavailable,
+ codes.DeadlineExceeded,
+ }, gax.Backoff{
+ Initial: 100 * time.Millisecond,
+ Max: 60000 * time.Millisecond,
+ Multiplier: 1.30,
+ })
+ }),
+ },
+ DeidentifyContent: []gax.CallOption{
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnCodes([]codes.Code{
+ codes.Unavailable,
+ codes.DeadlineExceeded,
+ }, gax.Backoff{
+ Initial: 100 * time.Millisecond,
+ Max: 60000 * time.Millisecond,
+ Multiplier: 1.30,
+ })
+ }),
+ },
+ ReidentifyContent: []gax.CallOption{
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnCodes([]codes.Code{
+ codes.Unavailable,
+ codes.DeadlineExceeded,
+ }, gax.Backoff{
+ Initial: 100 * time.Millisecond,
+ Max: 60000 * time.Millisecond,
+ Multiplier: 1.30,
+ })
+ }),
+ },
+ ListInfoTypes: []gax.CallOption{
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnCodes([]codes.Code{
+ codes.Unavailable,
+ codes.DeadlineExceeded,
+ }, gax.Backoff{
+ Initial: 100 * time.Millisecond,
+ Max: 60000 * time.Millisecond,
+ Multiplier: 1.30,
+ })
+ }),
+ },
+ CreateInspectTemplate: []gax.CallOption{},
+ UpdateInspectTemplate: []gax.CallOption{},
+ GetInspectTemplate: []gax.CallOption{
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnCodes([]codes.Code{
+ codes.Unavailable,
+ codes.DeadlineExceeded,
+ }, gax.Backoff{
+ Initial: 100 * time.Millisecond,
+ Max: 60000 * time.Millisecond,
+ Multiplier: 1.30,
+ })
+ }),
+ },
+ ListInspectTemplates: []gax.CallOption{
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnCodes([]codes.Code{
+ codes.Unavailable,
+ codes.DeadlineExceeded,
+ }, gax.Backoff{
+ Initial: 100 * time.Millisecond,
+ Max: 60000 * time.Millisecond,
+ Multiplier: 1.30,
+ })
+ }),
+ },
+ DeleteInspectTemplate: []gax.CallOption{
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnCodes([]codes.Code{
+ codes.Unavailable,
+ codes.DeadlineExceeded,
+ }, gax.Backoff{
+ Initial: 100 * time.Millisecond,
+ Max: 60000 * time.Millisecond,
+ Multiplier: 1.30,
+ })
+ }),
+ },
+ CreateDeidentifyTemplate: []gax.CallOption{},
+ UpdateDeidentifyTemplate: []gax.CallOption{},
+ GetDeidentifyTemplate: []gax.CallOption{
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnCodes([]codes.Code{
+ codes.Unavailable,
+ codes.DeadlineExceeded,
+ }, gax.Backoff{
+ Initial: 100 * time.Millisecond,
+ Max: 60000 * time.Millisecond,
+ Multiplier: 1.30,
+ })
+ }),
+ },
+ ListDeidentifyTemplates: []gax.CallOption{
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnCodes([]codes.Code{
+ codes.Unavailable,
+ codes.DeadlineExceeded,
+ }, gax.Backoff{
+ Initial: 100 * time.Millisecond,
+ Max: 60000 * time.Millisecond,
+ Multiplier: 1.30,
+ })
+ }),
+ },
+ DeleteDeidentifyTemplate: []gax.CallOption{
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnCodes([]codes.Code{
+ codes.Unavailable,
+ codes.DeadlineExceeded,
+ }, gax.Backoff{
+ Initial: 100 * time.Millisecond,
+ Max: 60000 * time.Millisecond,
+ Multiplier: 1.30,
+ })
+ }),
+ },
+ CreateJobTrigger: []gax.CallOption{},
+ UpdateJobTrigger: []gax.CallOption{},
+ GetJobTrigger: []gax.CallOption{
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnCodes([]codes.Code{
+ codes.Unavailable,
+ codes.DeadlineExceeded,
+ }, gax.Backoff{
+ Initial: 100 * time.Millisecond,
+ Max: 60000 * time.Millisecond,
+ Multiplier: 1.30,
+ })
+ }),
+ },
+ ListJobTriggers: []gax.CallOption{
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnCodes([]codes.Code{
+ codes.Unavailable,
+ codes.DeadlineExceeded,
+ }, gax.Backoff{
+ Initial: 100 * time.Millisecond,
+ Max: 60000 * time.Millisecond,
+ Multiplier: 1.30,
+ })
+ }),
+ },
+ DeleteJobTrigger: []gax.CallOption{
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnCodes([]codes.Code{
+ codes.Unavailable,
+ codes.DeadlineExceeded,
+ }, gax.Backoff{
+ Initial: 100 * time.Millisecond,
+ Max: 60000 * time.Millisecond,
+ Multiplier: 1.30,
+ })
+ }),
+ },
+ ActivateJobTrigger: []gax.CallOption{},
+ CreateDlpJob: []gax.CallOption{},
+ ListDlpJobs: []gax.CallOption{
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnCodes([]codes.Code{
+ codes.Unavailable,
+ codes.DeadlineExceeded,
+ }, gax.Backoff{
+ Initial: 100 * time.Millisecond,
+ Max: 60000 * time.Millisecond,
+ Multiplier: 1.30,
+ })
+ }),
+ },
+ GetDlpJob: []gax.CallOption{
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnCodes([]codes.Code{
+ codes.Unavailable,
+ codes.DeadlineExceeded,
+ }, gax.Backoff{
+ Initial: 100 * time.Millisecond,
+ Max: 60000 * time.Millisecond,
+ Multiplier: 1.30,
+ })
+ }),
+ },
+ DeleteDlpJob: []gax.CallOption{
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnCodes([]codes.Code{
+ codes.Unavailable,
+ codes.DeadlineExceeded,
+ }, gax.Backoff{
+ Initial: 100 * time.Millisecond,
+ Max: 60000 * time.Millisecond,
+ Multiplier: 1.30,
+ })
+ }),
+ },
+ CancelDlpJob: []gax.CallOption{},
+ CreateStoredInfoType: []gax.CallOption{},
+ UpdateStoredInfoType: []gax.CallOption{},
+ GetStoredInfoType: []gax.CallOption{
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnCodes([]codes.Code{
+ codes.Unavailable,
+ codes.DeadlineExceeded,
+ }, gax.Backoff{
+ Initial: 100 * time.Millisecond,
+ Max: 60000 * time.Millisecond,
+ Multiplier: 1.30,
+ })
+ }),
+ },
+ ListStoredInfoTypes: []gax.CallOption{
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnCodes([]codes.Code{
+ codes.Unavailable,
+ codes.DeadlineExceeded,
+ }, gax.Backoff{
+ Initial: 100 * time.Millisecond,
+ Max: 60000 * time.Millisecond,
+ Multiplier: 1.30,
+ })
+ }),
+ },
+ DeleteStoredInfoType: []gax.CallOption{
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnCodes([]codes.Code{
+ codes.Unavailable,
+ codes.DeadlineExceeded,
+ }, gax.Backoff{
+ Initial: 100 * time.Millisecond,
+ Max: 60000 * time.Millisecond,
+ Multiplier: 1.30,
+ })
+ }),
+ },
}
}
@@ -153,7 +362,7 @@
// scheduling of data scans on Google Cloud Platform based data sets.
//
// To learn more about concepts and find how-to guides see
-// https://cloud.google.com/dlp/docs/.
+// https://cloud.google.com/dlp/docs/ (at https://cloud.google.com/dlp/docs/).
func NewClient(ctx context.Context, opts ...option.ClientOption) (*Client, error) {
conn, err := transport.DialGRPC(ctx, append(defaultClientOptions(), opts...)...)
if err != nil {
@@ -166,6 +375,7 @@
client: dlppb.NewDlpServiceClient(conn),
}
c.setGoogleClientInfo()
+
return c, nil
}
@@ -196,8 +406,8 @@
// system will automatically choose what detectors to run. By default this may
// be all types, but may change over time as detectors are updated.
//
-// For how to guides, see https://cloud.google.com/dlp/docs/inspecting-images
-// and https://cloud.google.com/dlp/docs/inspecting-text,
+// For how to guides, see https://cloud.google.com/dlp/docs/inspecting-images (at https://cloud.google.com/dlp/docs/inspecting-images)
+// and https://cloud.google.com/dlp/docs/inspecting-text (at https://cloud.google.com/dlp/docs/inspecting-text),
func (c *Client) InspectContent(ctx context.Context, req *dlppb.InspectContentRequest, opts ...gax.CallOption) (*dlppb.InspectContentResponse, error) {
md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent())))
ctx = insertMetadata(ctx, c.xGoogMetadata, md)
@@ -216,7 +426,7 @@
// RedactImage redacts potentially sensitive info from an image.
// This method has limits on input size, processing time, and output size.
-// See https://cloud.google.com/dlp/docs/redacting-sensitive-data-images to
+// See https://cloud.google.com/dlp/docs/redacting-sensitive-data-images (at https://cloud.google.com/dlp/docs/redacting-sensitive-data-images) to
// learn more.
//
// When no InfoTypes or CustomInfoTypes are specified in this request, the
@@ -240,7 +450,7 @@
// DeidentifyContent de-identifies potentially sensitive info from a ContentItem.
// This method has limits on input size and output size.
-// See https://cloud.google.com/dlp/docs/deidentify-sensitive-data to
+// See https://cloud.google.com/dlp/docs/deidentify-sensitive-data (at https://cloud.google.com/dlp/docs/deidentify-sensitive-data) to
// learn more.
//
// When no InfoTypes or CustomInfoTypes are specified in this request, the
@@ -264,7 +474,7 @@
// ReidentifyContent re-identifies content that has been de-identified.
// See
-// https://cloud.google.com/dlp/docs/pseudonymization#re-identification_in_free_text_code_example
+// https://cloud.google.com/dlp/docs/pseudonymization#re-identification_in_free_text_code_example (at https://cloud.google.com/dlp/docs/pseudonymization#re-identification_in_free_text_code_example)
// to learn more.
func (c *Client) ReidentifyContent(ctx context.Context, req *dlppb.ReidentifyContentRequest, opts ...gax.CallOption) (*dlppb.ReidentifyContentResponse, error) {
md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent())))
@@ -283,11 +493,10 @@
}
// ListInfoTypes returns a list of the sensitive information types that the DLP API
-// supports. See https://cloud.google.com/dlp/docs/infotypes-reference to
+// supports. See https://cloud.google.com/dlp/docs/infotypes-reference (at https://cloud.google.com/dlp/docs/infotypes-reference) to
// learn more.
func (c *Client) ListInfoTypes(ctx context.Context, req *dlppb.ListInfoTypesRequest, opts ...gax.CallOption) (*dlppb.ListInfoTypesResponse, error) {
- md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "location_id", url.QueryEscape(req.GetLocationId())))
- ctx = insertMetadata(ctx, c.xGoogMetadata, md)
+ ctx = insertMetadata(ctx, c.xGoogMetadata)
opts = append(c.CallOptions.ListInfoTypes[0:len(c.CallOptions.ListInfoTypes):len(c.CallOptions.ListInfoTypes)], opts...)
var resp *dlppb.ListInfoTypesResponse
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -303,7 +512,7 @@
// CreateInspectTemplate creates an InspectTemplate for re-using frequently used configuration
// for inspecting content, images, and storage.
-// See https://cloud.google.com/dlp/docs/creating-templates to learn more.
+// See https://cloud.google.com/dlp/docs/creating-templates (at https://cloud.google.com/dlp/docs/creating-templates) to learn more.
func (c *Client) CreateInspectTemplate(ctx context.Context, req *dlppb.CreateInspectTemplateRequest, opts ...gax.CallOption) (*dlppb.InspectTemplate, error) {
md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent())))
ctx = insertMetadata(ctx, c.xGoogMetadata, md)
@@ -321,7 +530,7 @@
}
// UpdateInspectTemplate updates the InspectTemplate.
-// See https://cloud.google.com/dlp/docs/creating-templates to learn more.
+// See https://cloud.google.com/dlp/docs/creating-templates (at https://cloud.google.com/dlp/docs/creating-templates) to learn more.
func (c *Client) UpdateInspectTemplate(ctx context.Context, req *dlppb.UpdateInspectTemplateRequest, opts ...gax.CallOption) (*dlppb.InspectTemplate, error) {
md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName())))
ctx = insertMetadata(ctx, c.xGoogMetadata, md)
@@ -339,7 +548,7 @@
}
// GetInspectTemplate gets an InspectTemplate.
-// See https://cloud.google.com/dlp/docs/creating-templates to learn more.
+// See https://cloud.google.com/dlp/docs/creating-templates (at https://cloud.google.com/dlp/docs/creating-templates) to learn more.
func (c *Client) GetInspectTemplate(ctx context.Context, req *dlppb.GetInspectTemplateRequest, opts ...gax.CallOption) (*dlppb.InspectTemplate, error) {
md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName())))
ctx = insertMetadata(ctx, c.xGoogMetadata, md)
@@ -357,7 +566,7 @@
}
// ListInspectTemplates lists InspectTemplates.
-// See https://cloud.google.com/dlp/docs/creating-templates to learn more.
+// See https://cloud.google.com/dlp/docs/creating-templates (at https://cloud.google.com/dlp/docs/creating-templates) to learn more.
func (c *Client) ListInspectTemplates(ctx context.Context, req *dlppb.ListInspectTemplatesRequest, opts ...gax.CallOption) *InspectTemplateIterator {
md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent())))
ctx = insertMetadata(ctx, c.xGoogMetadata, md)
@@ -380,6 +589,8 @@
if err != nil {
return nil, "", err
}
+
+ it.Response = resp
return resp.InspectTemplates, resp.NextPageToken, nil
}
fetch := func(pageSize int, pageToken string) (string, error) {
@@ -397,7 +608,7 @@
}
// DeleteInspectTemplate deletes an InspectTemplate.
-// See https://cloud.google.com/dlp/docs/creating-templates to learn more.
+// See https://cloud.google.com/dlp/docs/creating-templates (at https://cloud.google.com/dlp/docs/creating-templates) to learn more.
func (c *Client) DeleteInspectTemplate(ctx context.Context, req *dlppb.DeleteInspectTemplateRequest, opts ...gax.CallOption) error {
md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName())))
ctx = insertMetadata(ctx, c.xGoogMetadata, md)
@@ -412,7 +623,7 @@
// CreateDeidentifyTemplate creates a DeidentifyTemplate for re-using frequently used configuration
// for de-identifying content, images, and storage.
-// See https://cloud.google.com/dlp/docs/creating-templates-deid to learn
+// See https://cloud.google.com/dlp/docs/creating-templates-deid (at https://cloud.google.com/dlp/docs/creating-templates-deid) to learn
// more.
func (c *Client) CreateDeidentifyTemplate(ctx context.Context, req *dlppb.CreateDeidentifyTemplateRequest, opts ...gax.CallOption) (*dlppb.DeidentifyTemplate, error) {
md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent())))
@@ -431,7 +642,7 @@
}
// UpdateDeidentifyTemplate updates the DeidentifyTemplate.
-// See https://cloud.google.com/dlp/docs/creating-templates-deid to learn
+// See https://cloud.google.com/dlp/docs/creating-templates-deid (at https://cloud.google.com/dlp/docs/creating-templates-deid) to learn
// more.
func (c *Client) UpdateDeidentifyTemplate(ctx context.Context, req *dlppb.UpdateDeidentifyTemplateRequest, opts ...gax.CallOption) (*dlppb.DeidentifyTemplate, error) {
md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName())))
@@ -450,7 +661,7 @@
}
// GetDeidentifyTemplate gets a DeidentifyTemplate.
-// See https://cloud.google.com/dlp/docs/creating-templates-deid to learn
+// See https://cloud.google.com/dlp/docs/creating-templates-deid (at https://cloud.google.com/dlp/docs/creating-templates-deid) to learn
// more.
func (c *Client) GetDeidentifyTemplate(ctx context.Context, req *dlppb.GetDeidentifyTemplateRequest, opts ...gax.CallOption) (*dlppb.DeidentifyTemplate, error) {
md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName())))
@@ -469,7 +680,7 @@
}
// ListDeidentifyTemplates lists DeidentifyTemplates.
-// See https://cloud.google.com/dlp/docs/creating-templates-deid to learn
+// See https://cloud.google.com/dlp/docs/creating-templates-deid (at https://cloud.google.com/dlp/docs/creating-templates-deid) to learn
// more.
func (c *Client) ListDeidentifyTemplates(ctx context.Context, req *dlppb.ListDeidentifyTemplatesRequest, opts ...gax.CallOption) *DeidentifyTemplateIterator {
md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent())))
@@ -493,6 +704,8 @@
if err != nil {
return nil, "", err
}
+
+ it.Response = resp
return resp.DeidentifyTemplates, resp.NextPageToken, nil
}
fetch := func(pageSize int, pageToken string) (string, error) {
@@ -510,7 +723,7 @@
}
// DeleteDeidentifyTemplate deletes a DeidentifyTemplate.
-// See https://cloud.google.com/dlp/docs/creating-templates-deid to learn
+// See https://cloud.google.com/dlp/docs/creating-templates-deid (at https://cloud.google.com/dlp/docs/creating-templates-deid) to learn
// more.
func (c *Client) DeleteDeidentifyTemplate(ctx context.Context, req *dlppb.DeleteDeidentifyTemplateRequest, opts ...gax.CallOption) error {
md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName())))
@@ -524,21 +737,17 @@
return err
}
-// CreateDlpJob creates a new job to inspect storage or calculate risk metrics.
-// See https://cloud.google.com/dlp/docs/inspecting-storage and
-// https://cloud.google.com/dlp/docs/compute-risk-analysis to learn more.
-//
-// When no InfoTypes or CustomInfoTypes are specified in inspect jobs, the
-// system will automatically choose what detectors to run. By default this may
-// be all types, but may change over time as detectors are updated.
-func (c *Client) CreateDlpJob(ctx context.Context, req *dlppb.CreateDlpJobRequest, opts ...gax.CallOption) (*dlppb.DlpJob, error) {
+// CreateJobTrigger creates a job trigger to run DLP actions such as scanning storage for
+// sensitive information on a set schedule.
+// See https://cloud.google.com/dlp/docs/creating-job-triggers (at https://cloud.google.com/dlp/docs/creating-job-triggers) to learn more.
+func (c *Client) CreateJobTrigger(ctx context.Context, req *dlppb.CreateJobTriggerRequest, opts ...gax.CallOption) (*dlppb.JobTrigger, 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.CreateDlpJob[0:len(c.CallOptions.CreateDlpJob):len(c.CallOptions.CreateDlpJob)], opts...)
- var resp *dlppb.DlpJob
+ opts = append(c.CallOptions.CreateJobTrigger[0:len(c.CallOptions.CreateJobTrigger):len(c.CallOptions.CreateJobTrigger)], opts...)
+ var resp *dlppb.JobTrigger
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
var err error
- resp, err = c.client.CreateDlpJob(ctx, req, settings.GRPC...)
+ resp, err = c.client.CreateJobTrigger(ctx, req, settings.GRPC...)
return err
}, opts...)
if err != nil {
@@ -547,58 +756,16 @@
return resp, nil
}
-// ListDlpJobs lists DlpJobs that match the specified filter in the request.
-// See https://cloud.google.com/dlp/docs/inspecting-storage and
-// https://cloud.google.com/dlp/docs/compute-risk-analysis to learn more.
-func (c *Client) ListDlpJobs(ctx context.Context, req *dlppb.ListDlpJobsRequest, opts ...gax.CallOption) *DlpJobIterator {
- 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.ListDlpJobs[0:len(c.CallOptions.ListDlpJobs):len(c.CallOptions.ListDlpJobs)], opts...)
- it := &DlpJobIterator{}
- req = proto.Clone(req).(*dlppb.ListDlpJobsRequest)
- it.InternalFetch = func(pageSize int, pageToken string) ([]*dlppb.DlpJob, string, error) {
- var resp *dlppb.ListDlpJobsResponse
- 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.ListDlpJobs(ctx, req, settings.GRPC...)
- return err
- }, opts...)
- if err != nil {
- return nil, "", err
- }
- return resp.Jobs, resp.NextPageToken, 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.PageSize)
- it.pageInfo.Token = req.PageToken
- return it
-}
-
-// GetDlpJob gets the latest state of a long-running DlpJob.
-// See https://cloud.google.com/dlp/docs/inspecting-storage and
-// https://cloud.google.com/dlp/docs/compute-risk-analysis to learn more.
-func (c *Client) GetDlpJob(ctx context.Context, req *dlppb.GetDlpJobRequest, opts ...gax.CallOption) (*dlppb.DlpJob, error) {
+// UpdateJobTrigger updates a job trigger.
+// See https://cloud.google.com/dlp/docs/creating-job-triggers (at https://cloud.google.com/dlp/docs/creating-job-triggers) to learn more.
+func (c *Client) UpdateJobTrigger(ctx context.Context, req *dlppb.UpdateJobTriggerRequest, opts ...gax.CallOption) (*dlppb.JobTrigger, 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.GetDlpJob[0:len(c.CallOptions.GetDlpJob):len(c.CallOptions.GetDlpJob)], opts...)
- var resp *dlppb.DlpJob
+ opts = append(c.CallOptions.UpdateJobTrigger[0:len(c.CallOptions.UpdateJobTrigger):len(c.CallOptions.UpdateJobTrigger)], opts...)
+ var resp *dlppb.JobTrigger
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
var err error
- resp, err = c.client.GetDlpJob(ctx, req, settings.GRPC...)
+ resp, err = c.client.UpdateJobTrigger(ctx, req, settings.GRPC...)
return err
}, opts...)
if err != nil {
@@ -607,42 +774,26 @@
return resp, nil
}
-// DeleteDlpJob deletes a long-running DlpJob. This method indicates that the client is
-// no longer interested in the DlpJob result. The job will be cancelled if
-// possible.
-// See https://cloud.google.com/dlp/docs/inspecting-storage and
-// https://cloud.google.com/dlp/docs/compute-risk-analysis to learn more.
-func (c *Client) DeleteDlpJob(ctx context.Context, req *dlppb.DeleteDlpJobRequest, opts ...gax.CallOption) error {
+// GetJobTrigger gets a job trigger.
+// See https://cloud.google.com/dlp/docs/creating-job-triggers (at https://cloud.google.com/dlp/docs/creating-job-triggers) to learn more.
+func (c *Client) GetJobTrigger(ctx context.Context, req *dlppb.GetJobTriggerRequest, opts ...gax.CallOption) (*dlppb.JobTrigger, 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.DeleteDlpJob[0:len(c.CallOptions.DeleteDlpJob):len(c.CallOptions.DeleteDlpJob)], opts...)
+ opts = append(c.CallOptions.GetJobTrigger[0:len(c.CallOptions.GetJobTrigger):len(c.CallOptions.GetJobTrigger)], opts...)
+ var resp *dlppb.JobTrigger
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
var err error
- _, err = c.client.DeleteDlpJob(ctx, req, settings.GRPC...)
+ resp, err = c.client.GetJobTrigger(ctx, req, settings.GRPC...)
return err
}, opts...)
- return err
-}
-
-// CancelDlpJob starts asynchronous cancellation on a long-running DlpJob. The server
-// makes a best effort to cancel the DlpJob, but success is not
-// guaranteed.
-// See https://cloud.google.com/dlp/docs/inspecting-storage and
-// https://cloud.google.com/dlp/docs/compute-risk-analysis to learn more.
-func (c *Client) CancelDlpJob(ctx context.Context, req *dlppb.CancelDlpJobRequest, opts ...gax.CallOption) 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.CancelDlpJob[0:len(c.CallOptions.CancelDlpJob):len(c.CallOptions.CancelDlpJob)], opts...)
- err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
- var err error
- _, err = c.client.CancelDlpJob(ctx, req, settings.GRPC...)
- return err
- }, opts...)
- return err
+ if err != nil {
+ return nil, err
+ }
+ return resp, nil
}
// ListJobTriggers lists job triggers.
-// See https://cloud.google.com/dlp/docs/creating-job-triggers to learn more.
+// See https://cloud.google.com/dlp/docs/creating-job-triggers (at https://cloud.google.com/dlp/docs/creating-job-triggers) to learn more.
func (c *Client) ListJobTriggers(ctx context.Context, req *dlppb.ListJobTriggersRequest, opts ...gax.CallOption) *JobTriggerIterator {
md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent())))
ctx = insertMetadata(ctx, c.xGoogMetadata, md)
@@ -665,6 +816,8 @@
if err != nil {
return nil, "", err
}
+
+ it.Response = resp
return resp.JobTriggers, resp.NextPageToken, nil
}
fetch := func(pageSize int, pageToken string) (string, error) {
@@ -681,26 +834,8 @@
return it
}
-// GetJobTrigger gets a job trigger.
-// See https://cloud.google.com/dlp/docs/creating-job-triggers to learn more.
-func (c *Client) GetJobTrigger(ctx context.Context, req *dlppb.GetJobTriggerRequest, opts ...gax.CallOption) (*dlppb.JobTrigger, 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.GetJobTrigger[0:len(c.CallOptions.GetJobTrigger):len(c.CallOptions.GetJobTrigger)], opts...)
- var resp *dlppb.JobTrigger
- err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
- var err error
- resp, err = c.client.GetJobTrigger(ctx, req, settings.GRPC...)
- return err
- }, opts...)
- if err != nil {
- return nil, err
- }
- return resp, nil
-}
-
// DeleteJobTrigger deletes a job trigger.
-// See https://cloud.google.com/dlp/docs/creating-job-triggers to learn more.
+// See https://cloud.google.com/dlp/docs/creating-job-triggers (at https://cloud.google.com/dlp/docs/creating-job-triggers) to learn more.
func (c *Client) DeleteJobTrigger(ctx context.Context, req *dlppb.DeleteJobTriggerRequest, opts ...gax.CallOption) error {
md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName())))
ctx = insertMetadata(ctx, c.xGoogMetadata, md)
@@ -713,16 +848,16 @@
return err
}
-// UpdateJobTrigger updates a job trigger.
-// See https://cloud.google.com/dlp/docs/creating-job-triggers to learn more.
-func (c *Client) UpdateJobTrigger(ctx context.Context, req *dlppb.UpdateJobTriggerRequest, opts ...gax.CallOption) (*dlppb.JobTrigger, error) {
+// ActivateJobTrigger activate a job trigger. Causes the immediate execute of a trigger
+// instead of waiting on the trigger event to occur.
+func (c *Client) ActivateJobTrigger(ctx context.Context, req *dlppb.ActivateJobTriggerRequest, opts ...gax.CallOption) (*dlppb.DlpJob, 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.UpdateJobTrigger[0:len(c.CallOptions.UpdateJobTrigger):len(c.CallOptions.UpdateJobTrigger)], opts...)
- var resp *dlppb.JobTrigger
+ opts = append(c.CallOptions.ActivateJobTrigger[0:len(c.CallOptions.ActivateJobTrigger):len(c.CallOptions.ActivateJobTrigger)], opts...)
+ var resp *dlppb.DlpJob
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
var err error
- resp, err = c.client.UpdateJobTrigger(ctx, req, settings.GRPC...)
+ resp, err = c.client.ActivateJobTrigger(ctx, req, settings.GRPC...)
return err
}, opts...)
if err != nil {
@@ -731,17 +866,21 @@
return resp, nil
}
-// CreateJobTrigger creates a job trigger to run DLP actions such as scanning storage for
-// sensitive information on a set schedule.
-// See https://cloud.google.com/dlp/docs/creating-job-triggers to learn more.
-func (c *Client) CreateJobTrigger(ctx context.Context, req *dlppb.CreateJobTriggerRequest, opts ...gax.CallOption) (*dlppb.JobTrigger, error) {
+// CreateDlpJob creates a new job to inspect storage or calculate risk metrics.
+// See https://cloud.google.com/dlp/docs/inspecting-storage (at https://cloud.google.com/dlp/docs/inspecting-storage) and
+// https://cloud.google.com/dlp/docs/compute-risk-analysis (at https://cloud.google.com/dlp/docs/compute-risk-analysis) to learn more.
+//
+// When no InfoTypes or CustomInfoTypes are specified in inspect jobs, the
+// system will automatically choose what detectors to run. By default this may
+// be all types, but may change over time as detectors are updated.
+func (c *Client) CreateDlpJob(ctx context.Context, req *dlppb.CreateDlpJobRequest, opts ...gax.CallOption) (*dlppb.DlpJob, 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.CreateJobTrigger[0:len(c.CallOptions.CreateJobTrigger):len(c.CallOptions.CreateJobTrigger)], opts...)
- var resp *dlppb.JobTrigger
+ opts = append(c.CallOptions.CreateDlpJob[0:len(c.CallOptions.CreateDlpJob):len(c.CallOptions.CreateDlpJob)], opts...)
+ var resp *dlppb.DlpJob
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
var err error
- resp, err = c.client.CreateJobTrigger(ctx, req, settings.GRPC...)
+ resp, err = c.client.CreateDlpJob(ctx, req, settings.GRPC...)
return err
}, opts...)
if err != nil {
@@ -750,8 +889,104 @@
return resp, nil
}
+// ListDlpJobs lists DlpJobs that match the specified filter in the request.
+// See https://cloud.google.com/dlp/docs/inspecting-storage (at https://cloud.google.com/dlp/docs/inspecting-storage) and
+// https://cloud.google.com/dlp/docs/compute-risk-analysis (at https://cloud.google.com/dlp/docs/compute-risk-analysis) to learn more.
+func (c *Client) ListDlpJobs(ctx context.Context, req *dlppb.ListDlpJobsRequest, opts ...gax.CallOption) *DlpJobIterator {
+ 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.ListDlpJobs[0:len(c.CallOptions.ListDlpJobs):len(c.CallOptions.ListDlpJobs)], opts...)
+ it := &DlpJobIterator{}
+ req = proto.Clone(req).(*dlppb.ListDlpJobsRequest)
+ it.InternalFetch = func(pageSize int, pageToken string) ([]*dlppb.DlpJob, string, error) {
+ var resp *dlppb.ListDlpJobsResponse
+ 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.ListDlpJobs(ctx, req, settings.GRPC...)
+ return err
+ }, opts...)
+ if err != nil {
+ return nil, "", err
+ }
+
+ it.Response = resp
+ return resp.Jobs, resp.NextPageToken, 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.PageSize)
+ it.pageInfo.Token = req.PageToken
+ return it
+}
+
+// GetDlpJob gets the latest state of a long-running DlpJob.
+// See https://cloud.google.com/dlp/docs/inspecting-storage (at https://cloud.google.com/dlp/docs/inspecting-storage) and
+// https://cloud.google.com/dlp/docs/compute-risk-analysis (at https://cloud.google.com/dlp/docs/compute-risk-analysis) to learn more.
+func (c *Client) GetDlpJob(ctx context.Context, req *dlppb.GetDlpJobRequest, opts ...gax.CallOption) (*dlppb.DlpJob, 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.GetDlpJob[0:len(c.CallOptions.GetDlpJob):len(c.CallOptions.GetDlpJob)], opts...)
+ var resp *dlppb.DlpJob
+ err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ var err error
+ resp, err = c.client.GetDlpJob(ctx, req, settings.GRPC...)
+ return err
+ }, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return resp, nil
+}
+
+// DeleteDlpJob deletes a long-running DlpJob. This method indicates that the client is
+// no longer interested in the DlpJob result. The job will be cancelled if
+// possible.
+// See https://cloud.google.com/dlp/docs/inspecting-storage (at https://cloud.google.com/dlp/docs/inspecting-storage) and
+// https://cloud.google.com/dlp/docs/compute-risk-analysis (at https://cloud.google.com/dlp/docs/compute-risk-analysis) to learn more.
+func (c *Client) DeleteDlpJob(ctx context.Context, req *dlppb.DeleteDlpJobRequest, opts ...gax.CallOption) 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.DeleteDlpJob[0:len(c.CallOptions.DeleteDlpJob):len(c.CallOptions.DeleteDlpJob)], opts...)
+ err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ var err error
+ _, err = c.client.DeleteDlpJob(ctx, req, settings.GRPC...)
+ return err
+ }, opts...)
+ return err
+}
+
+// CancelDlpJob starts asynchronous cancellation on a long-running DlpJob. The server
+// makes a best effort to cancel the DlpJob, but success is not
+// guaranteed.
+// See https://cloud.google.com/dlp/docs/inspecting-storage (at https://cloud.google.com/dlp/docs/inspecting-storage) and
+// https://cloud.google.com/dlp/docs/compute-risk-analysis (at https://cloud.google.com/dlp/docs/compute-risk-analysis) to learn more.
+func (c *Client) CancelDlpJob(ctx context.Context, req *dlppb.CancelDlpJobRequest, opts ...gax.CallOption) 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.CancelDlpJob[0:len(c.CallOptions.CancelDlpJob):len(c.CallOptions.CancelDlpJob)], opts...)
+ err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ var err error
+ _, err = c.client.CancelDlpJob(ctx, req, settings.GRPC...)
+ return err
+ }, opts...)
+ return err
+}
+
// CreateStoredInfoType creates a pre-built stored infoType to be used for inspection.
-// See https://cloud.google.com/dlp/docs/creating-stored-infotypes to
+// See https://cloud.google.com/dlp/docs/creating-stored-infotypes (at https://cloud.google.com/dlp/docs/creating-stored-infotypes) to
// learn more.
func (c *Client) CreateStoredInfoType(ctx context.Context, req *dlppb.CreateStoredInfoTypeRequest, opts ...gax.CallOption) (*dlppb.StoredInfoType, error) {
md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent())))
@@ -771,7 +1006,7 @@
// UpdateStoredInfoType updates the stored infoType by creating a new version. The existing version
// will continue to be used until the new version is ready.
-// See https://cloud.google.com/dlp/docs/creating-stored-infotypes to
+// See https://cloud.google.com/dlp/docs/creating-stored-infotypes (at https://cloud.google.com/dlp/docs/creating-stored-infotypes) to
// learn more.
func (c *Client) UpdateStoredInfoType(ctx context.Context, req *dlppb.UpdateStoredInfoTypeRequest, opts ...gax.CallOption) (*dlppb.StoredInfoType, error) {
md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName())))
@@ -790,7 +1025,7 @@
}
// GetStoredInfoType gets a stored infoType.
-// See https://cloud.google.com/dlp/docs/creating-stored-infotypes to
+// See https://cloud.google.com/dlp/docs/creating-stored-infotypes (at https://cloud.google.com/dlp/docs/creating-stored-infotypes) to
// learn more.
func (c *Client) GetStoredInfoType(ctx context.Context, req *dlppb.GetStoredInfoTypeRequest, opts ...gax.CallOption) (*dlppb.StoredInfoType, error) {
md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName())))
@@ -809,7 +1044,7 @@
}
// ListStoredInfoTypes lists stored infoTypes.
-// See https://cloud.google.com/dlp/docs/creating-stored-infotypes to
+// See https://cloud.google.com/dlp/docs/creating-stored-infotypes (at https://cloud.google.com/dlp/docs/creating-stored-infotypes) to
// learn more.
func (c *Client) ListStoredInfoTypes(ctx context.Context, req *dlppb.ListStoredInfoTypesRequest, opts ...gax.CallOption) *StoredInfoTypeIterator {
md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent())))
@@ -833,6 +1068,8 @@
if err != nil {
return nil, "", err
}
+
+ it.Response = resp
return resp.StoredInfoTypes, resp.NextPageToken, nil
}
fetch := func(pageSize int, pageToken string) (string, error) {
@@ -850,7 +1087,7 @@
}
// DeleteStoredInfoType deletes a stored infoType.
-// See https://cloud.google.com/dlp/docs/creating-stored-infotypes to
+// See https://cloud.google.com/dlp/docs/creating-stored-infotypes (at https://cloud.google.com/dlp/docs/creating-stored-infotypes) to
// learn more.
func (c *Client) DeleteStoredInfoType(ctx context.Context, req *dlppb.DeleteStoredInfoTypeRequest, opts ...gax.CallOption) error {
md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName())))
@@ -870,6 +1107,11 @@
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.
//
@@ -912,6 +1154,11 @@
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.
//
@@ -954,6 +1201,11 @@
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.
//
@@ -996,6 +1248,11 @@
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.
//
@@ -1038,6 +1295,11 @@
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.
//
diff --git a/dlp/apiv2/dlp_client_example_test.go b/dlp/apiv2/dlp_client_example_test.go
index 0830fce..7d7a3c2 100644
--- a/dlp/apiv2/dlp_client_example_test.go
+++ b/dlp/apiv2/dlp_client_example_test.go
@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-// Code generated by gapic-generator. DO NOT EDIT.
+// Code generated by protoc-gen-go_gapic. DO NOT EDIT.
package dlp_test
@@ -35,6 +35,8 @@
}
func ExampleClient_InspectContent() {
+ // import dlppb "google.golang.org/genproto/googleapis/privacy/dlp/v2"
+
ctx := context.Background()
c, err := dlp.NewClient(ctx)
if err != nil {
@@ -53,6 +55,8 @@
}
func ExampleClient_RedactImage() {
+ // import dlppb "google.golang.org/genproto/googleapis/privacy/dlp/v2"
+
ctx := context.Background()
c, err := dlp.NewClient(ctx)
if err != nil {
@@ -71,6 +75,8 @@
}
func ExampleClient_DeidentifyContent() {
+ // import dlppb "google.golang.org/genproto/googleapis/privacy/dlp/v2"
+
ctx := context.Background()
c, err := dlp.NewClient(ctx)
if err != nil {
@@ -89,6 +95,8 @@
}
func ExampleClient_ReidentifyContent() {
+ // import dlppb "google.golang.org/genproto/googleapis/privacy/dlp/v2"
+
ctx := context.Background()
c, err := dlp.NewClient(ctx)
if err != nil {
@@ -107,6 +115,8 @@
}
func ExampleClient_ListInfoTypes() {
+ // import dlppb "google.golang.org/genproto/googleapis/privacy/dlp/v2"
+
ctx := context.Background()
c, err := dlp.NewClient(ctx)
if err != nil {
@@ -125,6 +135,8 @@
}
func ExampleClient_CreateInspectTemplate() {
+ // import dlppb "google.golang.org/genproto/googleapis/privacy/dlp/v2"
+
ctx := context.Background()
c, err := dlp.NewClient(ctx)
if err != nil {
@@ -143,6 +155,8 @@
}
func ExampleClient_UpdateInspectTemplate() {
+ // import dlppb "google.golang.org/genproto/googleapis/privacy/dlp/v2"
+
ctx := context.Background()
c, err := dlp.NewClient(ctx)
if err != nil {
@@ -161,6 +175,8 @@
}
func ExampleClient_GetInspectTemplate() {
+ // import dlppb "google.golang.org/genproto/googleapis/privacy/dlp/v2"
+
ctx := context.Background()
c, err := dlp.NewClient(ctx)
if err != nil {
@@ -179,6 +195,9 @@
}
func ExampleClient_ListInspectTemplates() {
+ // import dlppb "google.golang.org/genproto/googleapis/privacy/dlp/v2"
+ // import "google.golang.org/api/iterator"
+
ctx := context.Background()
c, err := dlp.NewClient(ctx)
if err != nil {
@@ -219,6 +238,8 @@
}
func ExampleClient_CreateDeidentifyTemplate() {
+ // import dlppb "google.golang.org/genproto/googleapis/privacy/dlp/v2"
+
ctx := context.Background()
c, err := dlp.NewClient(ctx)
if err != nil {
@@ -237,6 +258,8 @@
}
func ExampleClient_UpdateDeidentifyTemplate() {
+ // import dlppb "google.golang.org/genproto/googleapis/privacy/dlp/v2"
+
ctx := context.Background()
c, err := dlp.NewClient(ctx)
if err != nil {
@@ -255,6 +278,8 @@
}
func ExampleClient_GetDeidentifyTemplate() {
+ // import dlppb "google.golang.org/genproto/googleapis/privacy/dlp/v2"
+
ctx := context.Background()
c, err := dlp.NewClient(ctx)
if err != nil {
@@ -273,6 +298,9 @@
}
func ExampleClient_ListDeidentifyTemplates() {
+ // import dlppb "google.golang.org/genproto/googleapis/privacy/dlp/v2"
+ // import "google.golang.org/api/iterator"
+
ctx := context.Background()
c, err := dlp.NewClient(ctx)
if err != nil {
@@ -312,7 +340,132 @@
}
}
+func ExampleClient_CreateJobTrigger() {
+ // import dlppb "google.golang.org/genproto/googleapis/privacy/dlp/v2"
+
+ ctx := context.Background()
+ c, err := dlp.NewClient(ctx)
+ if err != nil {
+ // TODO: Handle error.
+ }
+
+ req := &dlppb.CreateJobTriggerRequest{
+ // TODO: Fill request struct fields.
+ }
+ resp, err := c.CreateJobTrigger(ctx, req)
+ if err != nil {
+ // TODO: Handle error.
+ }
+ // TODO: Use resp.
+ _ = resp
+}
+
+func ExampleClient_UpdateJobTrigger() {
+ // import dlppb "google.golang.org/genproto/googleapis/privacy/dlp/v2"
+
+ ctx := context.Background()
+ c, err := dlp.NewClient(ctx)
+ if err != nil {
+ // TODO: Handle error.
+ }
+
+ req := &dlppb.UpdateJobTriggerRequest{
+ // TODO: Fill request struct fields.
+ }
+ resp, err := c.UpdateJobTrigger(ctx, req)
+ if err != nil {
+ // TODO: Handle error.
+ }
+ // TODO: Use resp.
+ _ = resp
+}
+
+func ExampleClient_GetJobTrigger() {
+ // import dlppb "google.golang.org/genproto/googleapis/privacy/dlp/v2"
+
+ ctx := context.Background()
+ c, err := dlp.NewClient(ctx)
+ if err != nil {
+ // TODO: Handle error.
+ }
+
+ req := &dlppb.GetJobTriggerRequest{
+ // TODO: Fill request struct fields.
+ }
+ resp, err := c.GetJobTrigger(ctx, req)
+ if err != nil {
+ // TODO: Handle error.
+ }
+ // TODO: Use resp.
+ _ = resp
+}
+
+func ExampleClient_ListJobTriggers() {
+ // import dlppb "google.golang.org/genproto/googleapis/privacy/dlp/v2"
+ // import "google.golang.org/api/iterator"
+
+ ctx := context.Background()
+ c, err := dlp.NewClient(ctx)
+ if err != nil {
+ // TODO: Handle error.
+ }
+
+ req := &dlppb.ListJobTriggersRequest{
+ // TODO: Fill request struct fields.
+ }
+ it := c.ListJobTriggers(ctx, req)
+ for {
+ resp, err := it.Next()
+ if err == iterator.Done {
+ break
+ }
+ if err != nil {
+ // TODO: Handle error.
+ }
+ // TODO: Use resp.
+ _ = resp
+ }
+}
+
+func ExampleClient_DeleteJobTrigger() {
+ ctx := context.Background()
+ c, err := dlp.NewClient(ctx)
+ if err != nil {
+ // TODO: Handle error.
+ }
+
+ req := &dlppb.DeleteJobTriggerRequest{
+ // TODO: Fill request struct fields.
+ }
+ err = c.DeleteJobTrigger(ctx, req)
+ if err != nil {
+ // TODO: Handle error.
+ }
+}
+
+func ExampleClient_ActivateJobTrigger() {
+ // import dlppb "google.golang.org/genproto/googleapis/privacy/dlp/v2"
+
+ ctx := context.Background()
+ c, err := dlp.NewClient(ctx)
+ if err != nil {
+ // TODO: Handle error.
+ }
+
+ req := &dlppb.ActivateJobTriggerRequest{
+ // TODO: Fill request struct fields.
+ }
+ resp, err := c.ActivateJobTrigger(ctx, req)
+ if err != nil {
+ // TODO: Handle error.
+ }
+ // TODO: Use resp.
+ _ = resp
+}
+
func ExampleClient_CreateDlpJob() {
+ // import dlppb "google.golang.org/genproto/googleapis/privacy/dlp/v2"
+
ctx := context.Background()
c, err := dlp.NewClient(ctx)
if err != nil {
@@ -331,6 +484,9 @@
}
func ExampleClient_ListDlpJobs() {
+ // import dlppb "google.golang.org/genproto/googleapis/privacy/dlp/v2"
+ // import "google.golang.org/api/iterator"
+
ctx := context.Background()
c, err := dlp.NewClient(ctx)
if err != nil {
@@ -355,6 +511,8 @@
}
func ExampleClient_GetDlpJob() {
+ // import dlppb "google.golang.org/genproto/googleapis/privacy/dlp/v2"
+
ctx := context.Background()
c, err := dlp.NewClient(ctx)
if err != nil {
@@ -404,101 +562,9 @@
}
}
-func ExampleClient_ListJobTriggers() {
- ctx := context.Background()
- c, err := dlp.NewClient(ctx)
- if err != nil {
- // TODO: Handle error.
- }
-
- req := &dlppb.ListJobTriggersRequest{
- // TODO: Fill request struct fields.
- }
- it := c.ListJobTriggers(ctx, req)
- for {
- resp, err := it.Next()
- if err == iterator.Done {
- break
- }
- if err != nil {
- // TODO: Handle error.
- }
- // TODO: Use resp.
- _ = resp
- }
-}
-
-func ExampleClient_GetJobTrigger() {
- ctx := context.Background()
- c, err := dlp.NewClient(ctx)
- if err != nil {
- // TODO: Handle error.
- }
-
- req := &dlppb.GetJobTriggerRequest{
- // TODO: Fill request struct fields.
- }
- resp, err := c.GetJobTrigger(ctx, req)
- if err != nil {
- // TODO: Handle error.
- }
- // TODO: Use resp.
- _ = resp
-}
-
-func ExampleClient_DeleteJobTrigger() {
- ctx := context.Background()
- c, err := dlp.NewClient(ctx)
- if err != nil {
- // TODO: Handle error.
- }
-
- req := &dlppb.DeleteJobTriggerRequest{
- // TODO: Fill request struct fields.
- }
- err = c.DeleteJobTrigger(ctx, req)
- if err != nil {
- // TODO: Handle error.
- }
-}
-
-func ExampleClient_UpdateJobTrigger() {
- ctx := context.Background()
- c, err := dlp.NewClient(ctx)
- if err != nil {
- // TODO: Handle error.
- }
-
- req := &dlppb.UpdateJobTriggerRequest{
- // TODO: Fill request struct fields.
- }
- resp, err := c.UpdateJobTrigger(ctx, req)
- if err != nil {
- // TODO: Handle error.
- }
- // TODO: Use resp.
- _ = resp
-}
-
-func ExampleClient_CreateJobTrigger() {
- ctx := context.Background()
- c, err := dlp.NewClient(ctx)
- if err != nil {
- // TODO: Handle error.
- }
-
- req := &dlppb.CreateJobTriggerRequest{
- // TODO: Fill request struct fields.
- }
- resp, err := c.CreateJobTrigger(ctx, req)
- if err != nil {
- // TODO: Handle error.
- }
- // TODO: Use resp.
- _ = resp
-}
-
func ExampleClient_CreateStoredInfoType() {
+ // import dlppb "google.golang.org/genproto/googleapis/privacy/dlp/v2"
+
ctx := context.Background()
c, err := dlp.NewClient(ctx)
if err != nil {
@@ -517,6 +583,8 @@
}
func ExampleClient_UpdateStoredInfoType() {
+ // import dlppb "google.golang.org/genproto/googleapis/privacy/dlp/v2"
+
ctx := context.Background()
c, err := dlp.NewClient(ctx)
if err != nil {
@@ -535,6 +603,8 @@
}
func ExampleClient_GetStoredInfoType() {
+ // import dlppb "google.golang.org/genproto/googleapis/privacy/dlp/v2"
+
ctx := context.Background()
c, err := dlp.NewClient(ctx)
if err != nil {
@@ -553,6 +623,9 @@
}
func ExampleClient_ListStoredInfoTypes() {
+ // import dlppb "google.golang.org/genproto/googleapis/privacy/dlp/v2"
+ // import "google.golang.org/api/iterator"
+
ctx := context.Background()
c, err := dlp.NewClient(ctx)
if err != nil {
diff --git a/dlp/apiv2/doc.go b/dlp/apiv2/doc.go
index b7090b1..a835e12 100644
--- a/dlp/apiv2/doc.go
+++ b/dlp/apiv2/doc.go
@@ -12,11 +12,10 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-// Code generated by gapic-generator. DO NOT EDIT.
+// Code generated by protoc-gen-go_gapic. DO NOT EDIT.
// Package dlp is an auto-generated package for the
// Cloud Data Loss Prevention (DLP) API.
-
//
// Provides methods for detection, risk analysis, and de-identification of
// privacy-sensitive fragments in text, images, and Google Cloud Platform
@@ -32,6 +31,7 @@
//
// For information about setting deadlines, reusing contexts, and more
// please visit godoc.org/cloud.google.com/go.
+
package dlp // import "cloud.google.com/go/dlp/apiv2"
import (
@@ -43,6 +43,8 @@
"google.golang.org/grpc/metadata"
)
+const versionClient = "20191216"
+
func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context {
out, _ := metadata.FromOutgoingContext(ctx)
out = out.Copy()
@@ -76,7 +78,7 @@
}
notSemverRune := func(r rune) bool {
- return strings.IndexRune("0123456789.", r) < 0
+ return !strings.ContainsRune("0123456789.", r)
}
if strings.HasPrefix(s, "go1") {
@@ -97,5 +99,3 @@
}
return "UNKNOWN"
}
-
-const versionClient = "20191206"
diff --git a/errorreporting/apiv1beta1/doc.go b/errorreporting/apiv1beta1/doc.go
index 91b19bd..430c579 100644
--- a/errorreporting/apiv1beta1/doc.go
+++ b/errorreporting/apiv1beta1/doc.go
@@ -12,17 +12,17 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-// Code generated by gapic-generator. DO NOT EDIT.
+// Code generated by protoc-gen-go_gapic. DO NOT EDIT.
// Package errorreporting is an auto-generated package for the
// Stackdriver Error Reporting API.
//
-// NOTE: This package is in beta. It is not stable, and may be subject to changes.
-//
// Groups and counts similar errors from cloud services and applications,
// reports new errors, and provides access to error groups and their
// associated errors.
//
+// 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
@@ -33,8 +33,7 @@
//
// For information about setting deadlines, reusing contexts, and more
// please visit godoc.org/cloud.google.com/go.
-//
-// Use the client at cloud.google.com/go/errorreporting in preference to this.
+
package errorreporting // import "cloud.google.com/go/errorreporting/apiv1beta1"
import (
@@ -46,6 +45,8 @@
"google.golang.org/grpc/metadata"
)
+const versionClient = "20191216"
+
func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context {
out, _ := metadata.FromOutgoingContext(ctx)
out = out.Copy()
@@ -79,7 +80,7 @@
}
notSemverRune := func(r rune) bool {
- return strings.IndexRune("0123456789.", r) < 0
+ return !strings.ContainsRune("0123456789.", r)
}
if strings.HasPrefix(s, "go1") {
@@ -100,5 +101,3 @@
}
return "UNKNOWN"
}
-
-const versionClient = "20191206"
diff --git a/errorreporting/apiv1beta1/error_group_client.go b/errorreporting/apiv1beta1/error_group_client.go
index 4939250..d64eacd 100644
--- a/errorreporting/apiv1beta1/error_group_client.go
+++ b/errorreporting/apiv1beta1/error_group_client.go
@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-// Code generated by gapic-generator. DO NOT EDIT.
+// Code generated by protoc-gen-go_gapic. DO NOT EDIT.
package errorreporting
@@ -41,6 +41,7 @@
func defaultErrorGroupClientOptions() []option.ClientOption {
return []option.ClientOption{
option.WithEndpoint("clouderrorreporting.googleapis.com:443"),
+ option.WithGRPCDialOption(grpc.WithDisableServiceConfig()),
option.WithScopes(DefaultAuthScopes()...),
option.WithGRPCDialOption(grpc.WithDefaultCallOptions(
grpc.MaxCallRecvMsgSize(math.MaxInt32))),
@@ -48,23 +49,31 @@
}
func defaultErrorGroupCallOptions() *ErrorGroupCallOptions {
- retry := map[[2]string][]gax.CallOption{
- {"default", "idempotent"}: {
+ return &ErrorGroupCallOptions{
+ GetGroup: []gax.CallOption{
gax.WithRetry(func() gax.Retryer {
return gax.OnCodes([]codes.Code{
- codes.DeadlineExceeded,
codes.Unavailable,
+ codes.DeadlineExceeded,
}, gax.Backoff{
Initial: 100 * time.Millisecond,
Max: 60000 * time.Millisecond,
- Multiplier: 1.3,
+ Multiplier: 1.30,
})
}),
},
- }
- return &ErrorGroupCallOptions{
- GetGroup: retry[[2]string{"default", "idempotent"}],
- UpdateGroup: retry[[2]string{"default", "non_idempotent"}],
+ UpdateGroup: []gax.CallOption{
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnCodes([]codes.Code{
+ codes.Unavailable,
+ codes.DeadlineExceeded,
+ }, gax.Backoff{
+ Initial: 100 * time.Millisecond,
+ Max: 60000 * time.Millisecond,
+ Multiplier: 1.30,
+ })
+ }),
+ },
}
}
@@ -100,6 +109,7 @@
errorGroupClient: clouderrorreportingpb.NewErrorGroupServiceClient(conn),
}
c.SetGoogleClientInfo()
+
return c, nil
}
diff --git a/errorreporting/apiv1beta1/error_group_client_example_test.go b/errorreporting/apiv1beta1/error_group_client_example_test.go
index 3bac84d..8556798 100644
--- a/errorreporting/apiv1beta1/error_group_client_example_test.go
+++ b/errorreporting/apiv1beta1/error_group_client_example_test.go
@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-// Code generated by gapic-generator. DO NOT EDIT.
+// Code generated by protoc-gen-go_gapic. DO NOT EDIT.
package errorreporting_test
@@ -34,6 +34,8 @@
}
func ExampleErrorGroupClient_GetGroup() {
+ // import clouderrorreportingpb "google.golang.org/genproto/googleapis/devtools/clouderrorreporting/v1beta1"
+
ctx := context.Background()
c, err := errorreporting.NewErrorGroupClient(ctx)
if err != nil {
@@ -52,6 +54,8 @@
}
func ExampleErrorGroupClient_UpdateGroup() {
+ // import clouderrorreportingpb "google.golang.org/genproto/googleapis/devtools/clouderrorreporting/v1beta1"
+
ctx := context.Background()
c, err := errorreporting.NewErrorGroupClient(ctx)
if err != nil {
diff --git a/errorreporting/apiv1beta1/error_stats_client.go b/errorreporting/apiv1beta1/error_stats_client.go
index d7fcd24..d60f0a0 100644
--- a/errorreporting/apiv1beta1/error_stats_client.go
+++ b/errorreporting/apiv1beta1/error_stats_client.go
@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-// Code generated by gapic-generator. DO NOT EDIT.
+// Code generated by protoc-gen-go_gapic. DO NOT EDIT.
package errorreporting
@@ -44,6 +44,7 @@
func defaultErrorStatsClientOptions() []option.ClientOption {
return []option.ClientOption{
option.WithEndpoint("clouderrorreporting.googleapis.com:443"),
+ option.WithGRPCDialOption(grpc.WithDisableServiceConfig()),
option.WithScopes(DefaultAuthScopes()...),
option.WithGRPCDialOption(grpc.WithDefaultCallOptions(
grpc.MaxCallRecvMsgSize(math.MaxInt32))),
@@ -51,24 +52,43 @@
}
func defaultErrorStatsCallOptions() *ErrorStatsCallOptions {
- retry := map[[2]string][]gax.CallOption{
- {"default", "idempotent"}: {
+ return &ErrorStatsCallOptions{
+ ListGroupStats: []gax.CallOption{
gax.WithRetry(func() gax.Retryer {
return gax.OnCodes([]codes.Code{
- codes.DeadlineExceeded,
codes.Unavailable,
+ codes.DeadlineExceeded,
}, gax.Backoff{
Initial: 100 * time.Millisecond,
Max: 60000 * time.Millisecond,
- Multiplier: 1.3,
+ Multiplier: 1.30,
})
}),
},
- }
- return &ErrorStatsCallOptions{
- ListGroupStats: retry[[2]string{"default", "idempotent"}],
- ListEvents: retry[[2]string{"default", "idempotent"}],
- DeleteEvents: retry[[2]string{"default", "non_idempotent"}],
+ ListEvents: []gax.CallOption{
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnCodes([]codes.Code{
+ codes.Unavailable,
+ codes.DeadlineExceeded,
+ }, gax.Backoff{
+ Initial: 100 * time.Millisecond,
+ Max: 60000 * time.Millisecond,
+ Multiplier: 1.30,
+ })
+ }),
+ },
+ DeleteEvents: []gax.CallOption{
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnCodes([]codes.Code{
+ codes.Unavailable,
+ codes.DeadlineExceeded,
+ }, gax.Backoff{
+ Initial: 100 * time.Millisecond,
+ Max: 60000 * time.Millisecond,
+ Multiplier: 1.30,
+ })
+ }),
+ },
}
}
@@ -105,6 +125,7 @@
errorStatsClient: clouderrorreportingpb.NewErrorStatsServiceClient(conn),
}
c.SetGoogleClientInfo()
+
return c, nil
}
@@ -151,6 +172,8 @@
if err != nil {
return nil, "", err
}
+
+ it.Response = resp
return resp.ErrorGroupStats, resp.NextPageToken, nil
}
fetch := func(pageSize int, pageToken string) (string, error) {
@@ -190,6 +213,8 @@
if err != nil {
return nil, "", err
}
+
+ it.Response = resp
return resp.ErrorEvents, resp.NextPageToken, nil
}
fetch := func(pageSize int, pageToken string) (string, error) {
@@ -229,6 +254,11 @@
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.
//
@@ -271,6 +301,11 @@
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.
//
diff --git a/errorreporting/apiv1beta1/error_stats_client_example_test.go b/errorreporting/apiv1beta1/error_stats_client_example_test.go
index f387274..9350382 100644
--- a/errorreporting/apiv1beta1/error_stats_client_example_test.go
+++ b/errorreporting/apiv1beta1/error_stats_client_example_test.go
@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-// Code generated by gapic-generator. DO NOT EDIT.
+// Code generated by protoc-gen-go_gapic. DO NOT EDIT.
package errorreporting_test
@@ -35,6 +35,9 @@
}
func ExampleErrorStatsClient_ListGroupStats() {
+ // import clouderrorreportingpb "google.golang.org/genproto/googleapis/devtools/clouderrorreporting/v1beta1"
+ // import "google.golang.org/api/iterator"
+
ctx := context.Background()
c, err := errorreporting.NewErrorStatsClient(ctx)
if err != nil {
@@ -59,6 +62,9 @@
}
func ExampleErrorStatsClient_ListEvents() {
+ // import clouderrorreportingpb "google.golang.org/genproto/googleapis/devtools/clouderrorreporting/v1beta1"
+ // import "google.golang.org/api/iterator"
+
ctx := context.Background()
c, err := errorreporting.NewErrorStatsClient(ctx)
if err != nil {
@@ -83,6 +89,8 @@
}
func ExampleErrorStatsClient_DeleteEvents() {
+ // import clouderrorreportingpb "google.golang.org/genproto/googleapis/devtools/clouderrorreporting/v1beta1"
+
ctx := context.Background()
c, err := errorreporting.NewErrorStatsClient(ctx)
if err != nil {
diff --git a/errorreporting/apiv1beta1/report_errors_client.go b/errorreporting/apiv1beta1/report_errors_client.go
index 8841280..c2367ff 100644
--- a/errorreporting/apiv1beta1/report_errors_client.go
+++ b/errorreporting/apiv1beta1/report_errors_client.go
@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-// Code generated by gapic-generator. DO NOT EDIT.
+// Code generated by protoc-gen-go_gapic. DO NOT EDIT.
package errorreporting
@@ -38,6 +38,7 @@
func defaultReportErrorsClientOptions() []option.ClientOption {
return []option.ClientOption{
option.WithEndpoint("clouderrorreporting.googleapis.com:443"),
+ option.WithGRPCDialOption(grpc.WithDisableServiceConfig()),
option.WithScopes(DefaultAuthScopes()...),
option.WithGRPCDialOption(grpc.WithDefaultCallOptions(
grpc.MaxCallRecvMsgSize(math.MaxInt32))),
@@ -45,9 +46,8 @@
}
func defaultReportErrorsCallOptions() *ReportErrorsCallOptions {
- retry := map[[2]string][]gax.CallOption{}
return &ReportErrorsCallOptions{
- ReportErrorEvent: retry[[2]string{"default", "non_idempotent"}],
+ ReportErrorEvent: []gax.CallOption{},
}
}
@@ -83,6 +83,7 @@
reportErrorsClient: clouderrorreportingpb.NewReportErrorsServiceClient(conn),
}
c.SetGoogleClientInfo()
+
return c, nil
}
@@ -108,13 +109,12 @@
// ReportErrorEvent report an individual error event.
//
-// This endpoint accepts **either** an OAuth token,
-// **or** an [API key](https://support.google.com/cloud/answer/6158862)
+// This endpoint accepts either an OAuth token,
+// or an API key (at https://support.google.com/cloud/answer/6158862)
// for authentication. To use an API key, append it to the URL as the value of
-// a `key` parameter. For example:
+// a key parameter. For example:
//
-// `POST
-// https://clouderrorreporting.googleapis.com/v1beta1/projects/example-project/events:report?key=123ABC456`
+// POST https://clouderrorreporting.googleapis.com/v1beta1/projects/example-project/events:report?key=123ABC456
func (c *ReportErrorsClient) ReportErrorEvent(ctx context.Context, req *clouderrorreportingpb.ReportErrorEventRequest, opts ...gax.CallOption) (*clouderrorreportingpb.ReportErrorEventResponse, error) {
md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "project_name", url.QueryEscape(req.GetProjectName())))
ctx = insertMetadata(ctx, c.xGoogMetadata, md)
diff --git a/errorreporting/apiv1beta1/report_errors_client_example_test.go b/errorreporting/apiv1beta1/report_errors_client_example_test.go
index 79a124e..c0283d6 100644
--- a/errorreporting/apiv1beta1/report_errors_client_example_test.go
+++ b/errorreporting/apiv1beta1/report_errors_client_example_test.go
@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-// Code generated by gapic-generator. DO NOT EDIT.
+// Code generated by protoc-gen-go_gapic. DO NOT EDIT.
package errorreporting_test
@@ -34,6 +34,8 @@
}
func ExampleReportErrorsClient_ReportErrorEvent() {
+ // import clouderrorreportingpb "google.golang.org/genproto/googleapis/devtools/clouderrorreporting/v1beta1"
+
ctx := context.Background()
c, err := errorreporting.NewReportErrorsClient(ctx)
if err != nil {
diff --git a/expr/apiv1alpha1/doc.go b/expr/apiv1alpha1/doc.go
index 0a86383..040c707 100644
--- a/expr/apiv1alpha1/doc.go
+++ b/expr/apiv1alpha1/doc.go
@@ -95,4 +95,4 @@
return "UNKNOWN"
}
-const versionClient = "20191206"
+const versionClient = "20191216"
diff --git a/firestore/apiv1/admin/doc.go b/firestore/apiv1/admin/doc.go
index 64eaaf6..d548a14 100644
--- a/firestore/apiv1/admin/doc.go
+++ b/firestore/apiv1/admin/doc.go
@@ -44,7 +44,7 @@
"google.golang.org/grpc/metadata"
)
-const versionClient = "20191212"
+const versionClient = "20191216"
func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context {
out, _ := metadata.FromOutgoingContext(ctx)
diff --git a/firestore/apiv1/doc.go b/firestore/apiv1/doc.go
index d3e1a1e..0611bde 100644
--- a/firestore/apiv1/doc.go
+++ b/firestore/apiv1/doc.go
@@ -15,12 +15,9 @@
// Code generated by protoc-gen-go_gapic. DO NOT EDIT.
// Package firestore is an auto-generated package for the
-// Cloud Firestore API.
+// Google Cloud Firestore API.
+
//
-// Accesses the NoSQL document database built for automatic scaling, high
-// performance, and ease of application development.
-//
-// NOTE: This package is in beta. It is not stable, and may be subject to changes.
//
// Use of Context
//
@@ -32,6 +29,9 @@
//
// For information about setting deadlines, reusing contexts, and more
// please visit godoc.org/cloud.google.com/go.
+//
+// For information about setting deadlines, reusing contexts, and more
+// please visit godoc.org/cloud.google.com/go.
package firestore // import "cloud.google.com/go/firestore/apiv1"
@@ -44,7 +44,7 @@
"google.golang.org/grpc/metadata"
)
-const versionClient = "20191212"
+const versionClient = "20191216"
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 8a682c3..cdb27f5 100644
--- a/firestore/apiv1/firestore_client.go
+++ b/firestore/apiv1/firestore_client.go
@@ -69,16 +69,7 @@
codes.Unavailable,
codes.Internal,
codes.DeadlineExceeded,
- }, gax.Backoff{
- Initial: 100 * time.Millisecond,
- Max: 60000 * time.Millisecond,
- Multiplier: 1.30,
- })
- }),
- },
- ListDocuments: []gax.CallOption{
- gax.WithRetry(func() gax.Retryer {
- return gax.OnCodes([]codes.Code{
+ codes.Internal,
codes.Unavailable,
codes.Internal,
codes.DeadlineExceeded,
@@ -97,16 +88,7 @@
codes.Unavailable,
codes.Internal,
codes.DeadlineExceeded,
- }, gax.Backoff{
- Initial: 100 * time.Millisecond,
- Max: 60000 * time.Millisecond,
- Multiplier: 1.30,
- })
- }),
- },
- BatchGetDocuments: []gax.CallOption{
- gax.WithRetry(func() gax.Retryer {
- return gax.OnCodes([]codes.Code{
+ codes.Internal,
codes.Unavailable,
codes.Internal,
codes.DeadlineExceeded,
diff --git a/firestore/apiv1/mock_test.go b/firestore/apiv1/mock_test.go
index 80173f1..f7bdf76 100644
--- a/firestore/apiv1/mock_test.go
+++ b/firestore/apiv1/mock_test.go
@@ -1,4 +1,4 @@
-// Copyright 2018 Google LLC
+// Copyright 2019 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/firestore/go.mod b/firestore/go.mod
index d9f4ec0..4eb1f2e 100644
--- a/firestore/go.mod
+++ b/firestore/go.mod
@@ -10,8 +10,8 @@
github.com/googleapis/gax-go/v2 v2.0.5
golang.org/x/exp v0.0.0-20191129062945-2f5052295587 // indirect
golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f // indirect
- golang.org/x/tools v0.0.0-20191206204035-259af5ff87bd // indirect
+ golang.org/x/tools v0.0.0-20191216173652-a0e659d51361 // indirect
google.golang.org/api v0.14.0
- google.golang.org/genproto v0.0.0-20191206224255-0243a4be9c8f
+ google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1
google.golang.org/grpc v1.21.1
)
diff --git a/firestore/go.sum b/firestore/go.sum
index 829e64d..6438eec 100644
--- a/firestore/go.sum
+++ b/firestore/go.sum
@@ -58,6 +58,7 @@
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/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 h1:OeRHuibLsmZkFj773W4LcfAGsSxJgfPONhr8cmO+eLA=
@@ -82,6 +83,7 @@
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=
+golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg=
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=
@@ -135,9 +137,10 @@
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-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
-golang.org/x/tools v0.0.0-20191206204035-259af5ff87bd h1:Zc7EU2PqpsNeIfOoVA7hvQX4cS3YDJEs5KlfatT3hLo=
-golang.org/x/tools v0.0.0-20191206204035-259af5ff87bd/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
+golang.org/x/tools v0.0.0-20191216173652-a0e659d51361 h1:RIIXAeV6GvDBuADKumTODatUqANFZ+5BPMnzsy4hulY=
+golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
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=
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=
@@ -160,8 +163,8 @@
google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc=
google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51 h1:Ex1mq5jaJof+kRnYi3SlYJ8KKa9Ao3NHyIT5XJ1gF6U=
google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8=
-google.golang.org/genproto v0.0.0-20191206224255-0243a4be9c8f h1:naitw5DILWPQvG0oG04mR9jF8fmKpRdW3E3zzKA4D0Y=
-google.golang.org/genproto v0.0.0-20191206224255-0243a4be9c8f/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
+google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1 h1:aQktFqmDE2yjveXJlVIfslDFmFnUXSqG0i6KRcJAeMc=
+google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
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 h1:j6XxA85m/6txkUCHvzlV5f+HBNl/1r5cZ2A/3IEFOO8=
diff --git a/go.mod b/go.mod
index 6e495cb..2ddfd3e 100644
--- a/go.mod
+++ b/go.mod
@@ -22,9 +22,9 @@
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e // indirect
golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e // indirect
golang.org/x/text v0.3.2
- golang.org/x/tools v0.0.0-20191206204035-259af5ff87bd
+ golang.org/x/tools v0.0.0-20191216173652-a0e659d51361
google.golang.org/api v0.14.0
- google.golang.org/genproto v0.0.0-20191206224255-0243a4be9c8f
+ google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1
google.golang.org/grpc v1.21.1
honnef.co/go/tools v0.0.1-2019.2.3
)
diff --git a/go.sum b/go.sum
index a2203c5..aec122a 100644
--- a/go.sum
+++ b/go.sum
@@ -70,6 +70,7 @@
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/exp v0.0.0-20190121172915-509febef88a4 h1:c2HOrn5iMezYjSlGPncknSEr/8x5LELb/ilJbXi9DEA=
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=
@@ -96,6 +97,7 @@
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=
+golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg=
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=
@@ -166,9 +168,10 @@
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-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
-golang.org/x/tools v0.0.0-20191206204035-259af5ff87bd h1:Zc7EU2PqpsNeIfOoVA7hvQX4cS3YDJEs5KlfatT3hLo=
-golang.org/x/tools v0.0.0-20191206204035-259af5ff87bd/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
+golang.org/x/tools v0.0.0-20191216173652-a0e659d51361 h1:RIIXAeV6GvDBuADKumTODatUqANFZ+5BPMnzsy4hulY=
+golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
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=
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 h1:VGGbLNyPF7dvYHhcUGYBBGCRDDK0RRJAI6KCvo0CL+E=
@@ -197,8 +200,8 @@
google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc=
google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51 h1:Ex1mq5jaJof+kRnYi3SlYJ8KKa9Ao3NHyIT5XJ1gF6U=
google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8=
-google.golang.org/genproto v0.0.0-20191206224255-0243a4be9c8f h1:naitw5DILWPQvG0oG04mR9jF8fmKpRdW3E3zzKA4D0Y=
-google.golang.org/genproto v0.0.0-20191206224255-0243a4be9c8f/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
+google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1 h1:aQktFqmDE2yjveXJlVIfslDFmFnUXSqG0i6KRcJAeMc=
+google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
google.golang.org/grpc v1.19.0 h1:cfg4PD8YEdSFnm7qLV4++93WcmhH2nIUhMjhdCvl3j8=
google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
google.golang.org/grpc v1.20.1 h1:Hz2g2wirWK7H0qIIhGIqRGTuMwTE8HEKFnDZZ7lm9NU=
diff --git a/iam/credentials/apiv1/doc.go b/iam/credentials/apiv1/doc.go
index fead891..767d2b3 100644
--- a/iam/credentials/apiv1/doc.go
+++ b/iam/credentials/apiv1/doc.go
@@ -97,4 +97,4 @@
return "UNKNOWN"
}
-const versionClient = "20191206"
+const versionClient = "20191216"
diff --git a/internal/gapicgen/go.mod b/internal/gapicgen/go.mod
index 453773d..67e9371 100644
--- a/internal/gapicgen/go.mod
+++ b/internal/gapicgen/go.mod
@@ -7,10 +7,13 @@
github.com/google/go-github v17.0.0+incompatible
github.com/google/go-querystring v1.0.0 // indirect
github.com/googleapis/gapic-generator-go v0.9.7
+ golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550 // indirect
golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553 // indirect
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e
golang.org/x/sys v0.0.0-20191210023423-ac6580df4449 // indirect
google.golang.org/appengine v1.5.0 // indirect
+ google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1 // indirect
+ google.golang.org/grpc v1.20.1 // indirect
gopkg.in/src-d/go-git.v4 v4.13.1
)
diff --git a/internal/gapicgen/go.sum b/internal/gapicgen/go.sum
index 7293d59..1d42746 100644
--- a/internal/gapicgen/go.sum
+++ b/internal/gapicgen/go.sum
@@ -1,6 +1,7 @@
cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
cloud.google.com/go v0.34.0 h1:eOI3/cP2VTU6uZLDYAoic+eyzzB9YyGmJ7eIjl8rOPg=
cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
+github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ=
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/alcortesm/tgz v0.0.0-20161220082320-9c5fe88206d7 h1:uSoVVbwJiQipAclBbw+8quDsfcvFjOpI5iCf4p/cqCs=
github.com/alcortesm/tgz v0.0.0-20161220082320-9c5fe88206d7/go.mod h1:6zEj6s6u/ghQa61ZWa/C2Aw3RkjiTBOix7dkqa1VLIs=
@@ -31,6 +32,7 @@
github.com/golang-commonmark/mdurl v0.0.0-20180910110917-8d018c6567d6/go.mod h1:J66ZGl/dC2mj4ElzGfrLUq0N90HvQoUbrYgYNJUjuMs=
github.com/golang-commonmark/puny v0.0.0-20180910110745-050be392d8b8 h1:DUgQdQmDg4sk4SfNR+qOkXcopGz36BL02vp/V7WbPQI=
github.com/golang-commonmark/puny v0.0.0-20180910110745-050be392d8b8/go.mod h1:/8a6mcbf/Hwg6MjnHHp5vqCWw0Bsves9HLPObHAj7XA=
+github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b h1:VKtxabqXZkF25pY9ekfRL6a582T4P37/31XEstQ5p58=
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=
github.com/golang/protobuf v1.2.0 h1:P3YflyNX/ehuJFLhxviNdFxQPkGK5cDcApsge1SqnvM=
@@ -62,15 +64,18 @@
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y=
github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0=
+github.com/opennota/wd v0.0.0-20180911144301-b446539ab1e7 h1:cVQhwfBgiKTMAdYPbVeuIiTkdY59qZ3sp5RpyO8CNtg=
github.com/opennota/wd v0.0.0-20180911144301-b446539ab1e7/go.mod h1:CS6cd3lWylVJV6EWs4Q/lkDEVGQOrEbBdwCowzzkN6A=
github.com/pelletier/go-buffruneio v0.2.0/go.mod h1:JkE26KsDizTr40EUHkXVtNPvgGtbSNq5BcowyYOWdKo=
github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I=
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
+github.com/russross/blackfriday v2.0.0+incompatible h1:cBXrhZNUf9C+La9/YpS+UHpUT8YD6Td9ZMSU9APFcsk=
github.com/russross/blackfriday v2.0.0+incompatible/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g=
github.com/sergi/go-diff v1.0.0 h1:Kpca3qRNrduNnOQeazBd0ysaKrUJiIuISHxogkT9RPQ=
github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo=
+github.com/shurcooL/sanitized_anchor_name v1.0.0 h1:PdmoCO6wvbs+7yrJyMORt4/BmY5IYyJwS/kOiWx8mHo=
github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc=
github.com/src-d/gcfg v1.4.0 h1:xXbNR5AlLSA315x2UO+fTSSAXCDf+Ar38/6oyGbDKQ4=
github.com/src-d/gcfg v1.4.0/go.mod h1:p/UMsR43ujA89BJY9duynAwIpvqEujIH/jFlfL7jWoI=
@@ -84,14 +89,19 @@
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4 h1:HuIa8hRrWRSrqYzx1qI49NNxhdi2PrY7gxVSq1JjLDc=
golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
+golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550 h1:ObdrDkeb4kJdCP557AjRjq69pTHfNouLtWZG7j9rPN8=
+golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
+golang.org/x/exp v0.0.0-20190121172915-509febef88a4 h1:c2HOrn5iMezYjSlGPncknSEr/8x5LELb/ilJbXi9DEA=
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/net v0.0.0-20180530234432-1e491301e022/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
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=
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-20190724013045-ca1201d0de80 h1:Ao/3l156eZf2AW5wK8a7/smtodRU+gha3+BeqJ69lRk=
@@ -122,6 +132,7 @@
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-20190729092621-ff9f1409240a h1:mEQZbbaBjWyLNy0tmZmgEuQAR8XOQ3hL8GYi3J/NG64=
golang.org/x/tools v0.0.0-20190729092621-ff9f1409240a/go.mod h1:jcCCGcm9btYwXyDqrUWc6MKQKKGJCWEQ3AfLSRIbEuI=
google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
@@ -133,9 +144,13 @@
google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
google.golang.org/genproto v0.0.0-20191206224255-0243a4be9c8f h1:naitw5DILWPQvG0oG04mR9jF8fmKpRdW3E3zzKA4D0Y=
google.golang.org/genproto v0.0.0-20191206224255-0243a4be9c8f/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
+google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1 h1:aQktFqmDE2yjveXJlVIfslDFmFnUXSqG0i6KRcJAeMc=
+google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
google.golang.org/grpc v1.8.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw=
google.golang.org/grpc v1.19.0 h1:cfg4PD8YEdSFnm7qLV4++93WcmhH2nIUhMjhdCvl3j8=
google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
+google.golang.org/grpc v1.20.1 h1:Hz2g2wirWK7H0qIIhGIqRGTuMwTE8HEKFnDZZ7lm9NU=
+google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38=
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/iot/apiv1/doc.go b/iot/apiv1/doc.go
index 9a8e9bc..6ec54a6 100644
--- a/iot/apiv1/doc.go
+++ b/iot/apiv1/doc.go
@@ -42,7 +42,7 @@
"google.golang.org/grpc/metadata"
)
-const versionClient = "20191206"
+const versionClient = "20191216"
func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context {
out, _ := metadata.FromOutgoingContext(ctx)
diff --git a/irm/apiv1alpha2/doc.go b/irm/apiv1alpha2/doc.go
index 5bc1732..a11c79d 100644
--- a/irm/apiv1alpha2/doc.go
+++ b/irm/apiv1alpha2/doc.go
@@ -12,14 +12,13 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-// Code generated by gapic-generator. DO NOT EDIT.
+// Code generated by protoc-gen-go_gapic. DO NOT EDIT.
// Package irm is an auto-generated package for the
// Stackdriver Incident Response & Management 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
@@ -30,6 +29,7 @@
//
// For information about setting deadlines, reusing contexts, and more
// please visit godoc.org/cloud.google.com/go.
+
package irm // import "cloud.google.com/go/irm/apiv1alpha2"
import (
@@ -41,6 +41,8 @@
"google.golang.org/grpc/metadata"
)
+const versionClient = "20191216"
+
func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context {
out, _ := metadata.FromOutgoingContext(ctx)
out = out.Copy()
@@ -74,7 +76,7 @@
}
notSemverRune := func(r rune) bool {
- return strings.IndexRune("0123456789.", r) < 0
+ return !strings.ContainsRune("0123456789.", r)
}
if strings.HasPrefix(s, "go1") {
@@ -95,5 +97,3 @@
}
return "UNKNOWN"
}
-
-const versionClient = "20191206"
diff --git a/irm/apiv1alpha2/incident_client.go b/irm/apiv1alpha2/incident_client.go
index 89172d8..c676457 100644
--- a/irm/apiv1alpha2/incident_client.go
+++ b/irm/apiv1alpha2/incident_client.go
@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-// Code generated by gapic-generator. DO NOT EDIT.
+// Code generated by protoc-gen-go_gapic. DO NOT EDIT.
package irm
@@ -48,8 +48,8 @@
ListTags []gax.CallOption
CreateSignal []gax.CallOption
SearchSignals []gax.CallOption
- GetSignal []gax.CallOption
LookupSignal []gax.CallOption
+ GetSignal []gax.CallOption
UpdateSignal []gax.CallOption
EscalateIncident []gax.CallOption
CreateArtifact []gax.CallOption
@@ -73,6 +73,7 @@
func defaultIncidentClientOptions() []option.ClientOption {
return []option.ClientOption{
option.WithEndpoint("irm.googleapis.com:443"),
+ option.WithGRPCDialOption(grpc.WithDisableServiceConfig()),
option.WithScopes(DefaultAuthScopes()...),
option.WithGRPCDialOption(grpc.WithDefaultCallOptions(
grpc.MaxCallRecvMsgSize(math.MaxInt32))),
@@ -80,8 +81,9 @@
}
func defaultIncidentCallOptions() *IncidentCallOptions {
- retry := map[[2]string][]gax.CallOption{
- {"default", "idempotent"}: {
+ return &IncidentCallOptions{
+ CreateIncident: []gax.CallOption{},
+ GetIncident: []gax.CallOption{
gax.WithRetry(func() gax.Retryer {
return gax.OnCodes([]codes.Code{
codes.DeadlineExceeded,
@@ -89,44 +91,194 @@
}, gax.Backoff{
Initial: 100 * time.Millisecond,
Max: 60000 * time.Millisecond,
- Multiplier: 1.3,
+ Multiplier: 1.30,
})
}),
},
- }
- return &IncidentCallOptions{
- CreateIncident: retry[[2]string{"default", "non_idempotent"}],
- GetIncident: retry[[2]string{"default", "idempotent"}],
- SearchIncidents: retry[[2]string{"default", "idempotent"}],
- UpdateIncident: retry[[2]string{"default", "non_idempotent"}],
- SearchSimilarIncidents: retry[[2]string{"default", "idempotent"}],
- CreateAnnotation: retry[[2]string{"default", "non_idempotent"}],
- ListAnnotations: retry[[2]string{"default", "idempotent"}],
- CreateTag: retry[[2]string{"default", "non_idempotent"}],
- DeleteTag: retry[[2]string{"default", "idempotent"}],
- ListTags: retry[[2]string{"default", "idempotent"}],
- CreateSignal: retry[[2]string{"default", "non_idempotent"}],
- SearchSignals: retry[[2]string{"default", "idempotent"}],
- GetSignal: retry[[2]string{"default", "idempotent"}],
- LookupSignal: retry[[2]string{"default", "idempotent"}],
- UpdateSignal: retry[[2]string{"default", "non_idempotent"}],
- EscalateIncident: retry[[2]string{"default", "non_idempotent"}],
- CreateArtifact: retry[[2]string{"default", "non_idempotent"}],
- ListArtifacts: retry[[2]string{"default", "idempotent"}],
- UpdateArtifact: retry[[2]string{"default", "non_idempotent"}],
- DeleteArtifact: retry[[2]string{"default", "idempotent"}],
- SendShiftHandoff: retry[[2]string{"default", "non_idempotent"}],
- CreateSubscription: retry[[2]string{"default", "non_idempotent"}],
- UpdateSubscription: retry[[2]string{"default", "non_idempotent"}],
- ListSubscriptions: retry[[2]string{"default", "idempotent"}],
- DeleteSubscription: retry[[2]string{"default", "idempotent"}],
- CreateIncidentRoleAssignment: retry[[2]string{"default", "non_idempotent"}],
- DeleteIncidentRoleAssignment: retry[[2]string{"default", "idempotent"}],
- ListIncidentRoleAssignments: retry[[2]string{"default", "idempotent"}],
- RequestIncidentRoleHandover: retry[[2]string{"default", "non_idempotent"}],
- ConfirmIncidentRoleHandover: retry[[2]string{"default", "non_idempotent"}],
- ForceIncidentRoleHandover: retry[[2]string{"default", "non_idempotent"}],
- CancelIncidentRoleHandover: retry[[2]string{"default", "non_idempotent"}],
+ SearchIncidents: []gax.CallOption{
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnCodes([]codes.Code{
+ codes.DeadlineExceeded,
+ codes.Unavailable,
+ }, gax.Backoff{
+ Initial: 100 * time.Millisecond,
+ Max: 60000 * time.Millisecond,
+ Multiplier: 1.30,
+ })
+ }),
+ },
+ UpdateIncident: []gax.CallOption{},
+ SearchSimilarIncidents: []gax.CallOption{
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnCodes([]codes.Code{
+ codes.DeadlineExceeded,
+ codes.Unavailable,
+ }, gax.Backoff{
+ Initial: 100 * time.Millisecond,
+ Max: 60000 * time.Millisecond,
+ Multiplier: 1.30,
+ })
+ }),
+ },
+ CreateAnnotation: []gax.CallOption{},
+ ListAnnotations: []gax.CallOption{
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnCodes([]codes.Code{
+ codes.DeadlineExceeded,
+ codes.Unavailable,
+ }, gax.Backoff{
+ Initial: 100 * time.Millisecond,
+ Max: 60000 * time.Millisecond,
+ Multiplier: 1.30,
+ })
+ }),
+ },
+ CreateTag: []gax.CallOption{},
+ DeleteTag: []gax.CallOption{
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnCodes([]codes.Code{
+ codes.DeadlineExceeded,
+ codes.Unavailable,
+ }, gax.Backoff{
+ Initial: 100 * time.Millisecond,
+ Max: 60000 * time.Millisecond,
+ Multiplier: 1.30,
+ })
+ }),
+ },
+ ListTags: []gax.CallOption{
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnCodes([]codes.Code{
+ codes.DeadlineExceeded,
+ codes.Unavailable,
+ }, gax.Backoff{
+ Initial: 100 * time.Millisecond,
+ Max: 60000 * time.Millisecond,
+ Multiplier: 1.30,
+ })
+ }),
+ },
+ CreateSignal: []gax.CallOption{},
+ SearchSignals: []gax.CallOption{
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnCodes([]codes.Code{
+ codes.DeadlineExceeded,
+ codes.Unavailable,
+ }, gax.Backoff{
+ Initial: 100 * time.Millisecond,
+ Max: 60000 * time.Millisecond,
+ Multiplier: 1.30,
+ })
+ }),
+ },
+ LookupSignal: []gax.CallOption{
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnCodes([]codes.Code{
+ codes.DeadlineExceeded,
+ codes.Unavailable,
+ }, gax.Backoff{
+ Initial: 100 * time.Millisecond,
+ Max: 60000 * time.Millisecond,
+ Multiplier: 1.30,
+ })
+ }),
+ },
+ GetSignal: []gax.CallOption{
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnCodes([]codes.Code{
+ codes.DeadlineExceeded,
+ codes.Unavailable,
+ }, gax.Backoff{
+ Initial: 100 * time.Millisecond,
+ Max: 60000 * time.Millisecond,
+ Multiplier: 1.30,
+ })
+ }),
+ },
+ UpdateSignal: []gax.CallOption{},
+ EscalateIncident: []gax.CallOption{},
+ CreateArtifact: []gax.CallOption{},
+ ListArtifacts: []gax.CallOption{
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnCodes([]codes.Code{
+ codes.DeadlineExceeded,
+ codes.Unavailable,
+ }, gax.Backoff{
+ Initial: 100 * time.Millisecond,
+ Max: 60000 * time.Millisecond,
+ Multiplier: 1.30,
+ })
+ }),
+ },
+ UpdateArtifact: []gax.CallOption{},
+ DeleteArtifact: []gax.CallOption{
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnCodes([]codes.Code{
+ codes.DeadlineExceeded,
+ codes.Unavailable,
+ }, gax.Backoff{
+ Initial: 100 * time.Millisecond,
+ Max: 60000 * time.Millisecond,
+ Multiplier: 1.30,
+ })
+ }),
+ },
+ SendShiftHandoff: []gax.CallOption{},
+ CreateSubscription: []gax.CallOption{},
+ UpdateSubscription: []gax.CallOption{},
+ ListSubscriptions: []gax.CallOption{
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnCodes([]codes.Code{
+ codes.DeadlineExceeded,
+ codes.Unavailable,
+ }, gax.Backoff{
+ Initial: 100 * time.Millisecond,
+ Max: 60000 * time.Millisecond,
+ Multiplier: 1.30,
+ })
+ }),
+ },
+ DeleteSubscription: []gax.CallOption{
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnCodes([]codes.Code{
+ codes.DeadlineExceeded,
+ codes.Unavailable,
+ }, gax.Backoff{
+ Initial: 100 * time.Millisecond,
+ Max: 60000 * time.Millisecond,
+ Multiplier: 1.30,
+ })
+ }),
+ },
+ CreateIncidentRoleAssignment: []gax.CallOption{},
+ DeleteIncidentRoleAssignment: []gax.CallOption{
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnCodes([]codes.Code{
+ codes.DeadlineExceeded,
+ codes.Unavailable,
+ }, gax.Backoff{
+ Initial: 100 * time.Millisecond,
+ Max: 60000 * time.Millisecond,
+ Multiplier: 1.30,
+ })
+ }),
+ },
+ ListIncidentRoleAssignments: []gax.CallOption{
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnCodes([]codes.Code{
+ codes.DeadlineExceeded,
+ codes.Unavailable,
+ }, gax.Backoff{
+ Initial: 100 * time.Millisecond,
+ Max: 60000 * time.Millisecond,
+ Multiplier: 1.30,
+ })
+ }),
+ },
+ RequestIncidentRoleHandover: []gax.CallOption{},
+ ConfirmIncidentRoleHandover: []gax.CallOption{},
+ ForceIncidentRoleHandover: []gax.CallOption{},
+ CancelIncidentRoleHandover: []gax.CallOption{},
}
}
@@ -162,6 +314,7 @@
incidentClient: irmpb.NewIncidentServiceClient(conn),
}
c.setGoogleClientInfo()
+
return c, nil
}
@@ -243,6 +396,8 @@
if err != nil {
return nil, "", err
}
+
+ it.Response = resp
return resp.Incidents, resp.NextPageToken, nil
}
fetch := func(pageSize int, pageToken string) (string, error) {
@@ -276,9 +431,9 @@
return resp, nil
}
-// SearchSimilarIncidents returns a list of incidents that are "similar" to the specified incident
+// SearchSimilarIncidents returns a list of incidents that are “similar” to the specified incident
// or signal. This functionality is provided on a best-effort basis and the
-// definition of "similar" is subject to change.
+// definition of “similar” is subject to change.
func (c *IncidentClient) SearchSimilarIncidents(ctx context.Context, req *irmpb.SearchSimilarIncidentsRequest, opts ...gax.CallOption) *SearchSimilarIncidentsResponse_ResultIterator {
md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName())))
ctx = insertMetadata(ctx, c.xGoogMetadata, md)
@@ -301,6 +456,8 @@
if err != nil {
return nil, "", err
}
+
+ it.Response = resp
return resp.Results, resp.NextPageToken, nil
}
fetch := func(pageSize int, pageToken string) (string, error) {
@@ -317,8 +474,8 @@
return it
}
-// CreateAnnotation creates an annotation on an existing incident. Only 'text/plain' and
-// 'text/markdown' annotations can be created via this method.
+// CreateAnnotation creates an annotation on an existing incident. Only ‘text/plain’ and
+// ‘text/markdown’ annotations can be created via this method.
func (c *IncidentClient) CreateAnnotation(ctx context.Context, req *irmpb.CreateAnnotationRequest, opts ...gax.CallOption) (*irmpb.Annotation, error) {
md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent())))
ctx = insertMetadata(ctx, c.xGoogMetadata, md)
@@ -359,6 +516,8 @@
if err != nil {
return nil, "", err
}
+
+ it.Response = resp
return resp.Annotations, resp.NextPageToken, nil
}
fetch := func(pageSize int, pageToken string) (string, error) {
@@ -428,6 +587,8 @@
if err != nil {
return nil, "", err
}
+
+ it.Response = resp
return resp.Tags, resp.NextPageToken, nil
}
fetch := func(pageSize int, pageToken string) (string, error) {
@@ -485,6 +646,8 @@
if err != nil {
return nil, "", err
}
+
+ it.Response = resp
return resp.Signals, resp.NextPageToken, nil
}
fetch := func(pageSize int, pageToken string) (string, error) {
@@ -501,6 +664,22 @@
return it
}
+// LookupSignal finds a signal by other unique IDs.
+func (c *IncidentClient) LookupSignal(ctx context.Context, req *irmpb.LookupSignalRequest, opts ...gax.CallOption) (*irmpb.Signal, error) {
+ ctx = insertMetadata(ctx, c.xGoogMetadata)
+ opts = append(c.CallOptions.LookupSignal[0:len(c.CallOptions.LookupSignal):len(c.CallOptions.LookupSignal)], opts...)
+ var resp *irmpb.Signal
+ err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ var err error
+ resp, err = c.incidentClient.LookupSignal(ctx, req, settings.GRPC...)
+ return err
+ }, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return resp, nil
+}
+
// GetSignal returns a signal by name.
func (c *IncidentClient) GetSignal(ctx context.Context, req *irmpb.GetSignalRequest, opts ...gax.CallOption) (*irmpb.Signal, error) {
md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName())))
@@ -518,22 +697,6 @@
return resp, nil
}
-// LookupSignal finds a signal by other unique IDs.
-func (c *IncidentClient) LookupSignal(ctx context.Context, req *irmpb.LookupSignalRequest, opts ...gax.CallOption) (*irmpb.Signal, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
- opts = append(c.CallOptions.LookupSignal[0:len(c.CallOptions.LookupSignal):len(c.CallOptions.LookupSignal)], opts...)
- var resp *irmpb.Signal
- err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
- var err error
- resp, err = c.incidentClient.LookupSignal(ctx, req, settings.GRPC...)
- return err
- }, opts...)
- if err != nil {
- return nil, err
- }
- return resp, nil
-}
-
// UpdateSignal updates an existing signal (for example, to assign/unassign it to an
// incident).
func (c *IncidentClient) UpdateSignal(ctx context.Context, req *irmpb.UpdateSignalRequest, opts ...gax.CallOption) (*irmpb.Signal, error) {
@@ -609,6 +772,8 @@
if err != nil {
return nil, "", err
}
+
+ it.Response = resp
return resp.Artifacts, resp.NextPageToken, nil
}
fetch := func(pageSize int, pageToken string) (string, error) {
@@ -732,6 +897,8 @@
if err != nil {
return nil, "", err
}
+
+ it.Response = resp
return resp.Subscriptions, resp.NextPageToken, nil
}
fetch := func(pageSize int, pageToken string) (string, error) {
@@ -818,6 +985,8 @@
if err != nil {
return nil, "", err
}
+
+ it.Response = resp
return resp.IncidentRoleAssignments, resp.NextPageToken, nil
}
fetch := func(pageSize int, pageToken string) (string, error) {
@@ -853,8 +1022,8 @@
return resp, nil
}
-// ConfirmIncidentRoleHandover confirms a role handover. This will fail if the 'proposed_assignee' field
-// of the IncidentRoleAssignment is not equal to the 'new_assignee' field of
+// ConfirmIncidentRoleHandover confirms a role handover. This will fail if the ‘proposed_assignee’ field
+// of the IncidentRoleAssignment is not equal to the ‘new_assignee’ field of
// the request. If the caller is not the new_assignee,
// ForceIncidentRoleHandover should be used instead.
func (c *IncidentClient) ConfirmIncidentRoleHandover(ctx context.Context, req *irmpb.ConfirmIncidentRoleHandoverRequest, opts ...gax.CallOption) (*irmpb.IncidentRoleAssignment, error) {
@@ -873,8 +1042,8 @@
return resp, nil
}
-// ForceIncidentRoleHandover forces a role handover. This will fail if the 'proposed_assignee' field of
-// the IncidentRoleAssignment is not equal to the 'new_assignee' field of the
+// ForceIncidentRoleHandover forces a role handover. This will fail if the ‘proposed_assignee’ field of
+// the IncidentRoleAssignment is not equal to the ‘new_assignee’ field of the
// request. If the caller is the new_assignee, ConfirmIncidentRoleHandover
// should be used instead.
func (c *IncidentClient) ForceIncidentRoleHandover(ctx context.Context, req *irmpb.ForceIncidentRoleHandoverRequest, opts ...gax.CallOption) (*irmpb.IncidentRoleAssignment, error) {
@@ -893,8 +1062,8 @@
return resp, nil
}
-// CancelIncidentRoleHandover cancels a role handover. This will fail if the 'proposed_assignee' field of
-// the IncidentRoleAssignment is not equal to the 'new_assignee' field of the
+// CancelIncidentRoleHandover cancels a role handover. This will fail if the ‘proposed_assignee’ field of
+// the IncidentRoleAssignment is not equal to the ‘new_assignee’ field of the
// request.
func (c *IncidentClient) CancelIncidentRoleHandover(ctx context.Context, req *irmpb.CancelIncidentRoleHandoverRequest, opts ...gax.CallOption) (*irmpb.IncidentRoleAssignment, error) {
md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName())))
@@ -918,6 +1087,11 @@
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.
//
@@ -960,6 +1134,11 @@
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.
//
@@ -1002,6 +1181,11 @@
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.
//
@@ -1044,6 +1228,11 @@
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.
//
@@ -1086,6 +1275,11 @@
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.
//
@@ -1128,6 +1322,11 @@
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.
//
@@ -1170,6 +1369,11 @@
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.
//
@@ -1212,6 +1416,11 @@
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.
//
diff --git a/irm/apiv1alpha2/incident_client_example_test.go b/irm/apiv1alpha2/incident_client_example_test.go
index 8bce2f7..53f6627 100644
--- a/irm/apiv1alpha2/incident_client_example_test.go
+++ b/irm/apiv1alpha2/incident_client_example_test.go
@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-// Code generated by gapic-generator. DO NOT EDIT.
+// Code generated by protoc-gen-go_gapic. DO NOT EDIT.
package irm_test
@@ -35,6 +35,8 @@
}
func ExampleIncidentClient_CreateIncident() {
+ // import irmpb "google.golang.org/genproto/googleapis/cloud/irm/v1alpha2"
+
ctx := context.Background()
c, err := irm.NewIncidentClient(ctx)
if err != nil {
@@ -53,6 +55,8 @@
}
func ExampleIncidentClient_GetIncident() {
+ // import irmpb "google.golang.org/genproto/googleapis/cloud/irm/v1alpha2"
+
ctx := context.Background()
c, err := irm.NewIncidentClient(ctx)
if err != nil {
@@ -71,6 +75,9 @@
}
func ExampleIncidentClient_SearchIncidents() {
+ // import irmpb "google.golang.org/genproto/googleapis/cloud/irm/v1alpha2"
+ // import "google.golang.org/api/iterator"
+
ctx := context.Background()
c, err := irm.NewIncidentClient(ctx)
if err != nil {
@@ -95,6 +102,8 @@
}
func ExampleIncidentClient_UpdateIncident() {
+ // import irmpb "google.golang.org/genproto/googleapis/cloud/irm/v1alpha2"
+
ctx := context.Background()
c, err := irm.NewIncidentClient(ctx)
if err != nil {
@@ -113,6 +122,9 @@
}
func ExampleIncidentClient_SearchSimilarIncidents() {
+ // import irmpb "google.golang.org/genproto/googleapis/cloud/irm/v1alpha2"
+ // import "google.golang.org/api/iterator"
+
ctx := context.Background()
c, err := irm.NewIncidentClient(ctx)
if err != nil {
@@ -137,6 +149,8 @@
}
func ExampleIncidentClient_CreateAnnotation() {
+ // import irmpb "google.golang.org/genproto/googleapis/cloud/irm/v1alpha2"
+
ctx := context.Background()
c, err := irm.NewIncidentClient(ctx)
if err != nil {
@@ -155,6 +169,9 @@
}
func ExampleIncidentClient_ListAnnotations() {
+ // import irmpb "google.golang.org/genproto/googleapis/cloud/irm/v1alpha2"
+ // import "google.golang.org/api/iterator"
+
ctx := context.Background()
c, err := irm.NewIncidentClient(ctx)
if err != nil {
@@ -179,6 +196,8 @@
}
func ExampleIncidentClient_CreateTag() {
+ // import irmpb "google.golang.org/genproto/googleapis/cloud/irm/v1alpha2"
+
ctx := context.Background()
c, err := irm.NewIncidentClient(ctx)
if err != nil {
@@ -213,6 +232,9 @@
}
func ExampleIncidentClient_ListTags() {
+ // import irmpb "google.golang.org/genproto/googleapis/cloud/irm/v1alpha2"
+ // import "google.golang.org/api/iterator"
+
ctx := context.Background()
c, err := irm.NewIncidentClient(ctx)
if err != nil {
@@ -237,6 +259,8 @@
}
func ExampleIncidentClient_CreateSignal() {
+ // import irmpb "google.golang.org/genproto/googleapis/cloud/irm/v1alpha2"
+
ctx := context.Background()
c, err := irm.NewIncidentClient(ctx)
if err != nil {
@@ -255,6 +279,9 @@
}
func ExampleIncidentClient_SearchSignals() {
+ // import irmpb "google.golang.org/genproto/googleapis/cloud/irm/v1alpha2"
+ // import "google.golang.org/api/iterator"
+
ctx := context.Background()
c, err := irm.NewIncidentClient(ctx)
if err != nil {
@@ -278,25 +305,9 @@
}
}
-func ExampleIncidentClient_GetSignal() {
- ctx := context.Background()
- c, err := irm.NewIncidentClient(ctx)
- if err != nil {
- // TODO: Handle error.
- }
-
- req := &irmpb.GetSignalRequest{
- // TODO: Fill request struct fields.
- }
- resp, err := c.GetSignal(ctx, req)
- if err != nil {
- // TODO: Handle error.
- }
- // TODO: Use resp.
- _ = resp
-}
-
func ExampleIncidentClient_LookupSignal() {
+ // import irmpb "google.golang.org/genproto/googleapis/cloud/irm/v1alpha2"
+
ctx := context.Background()
c, err := irm.NewIncidentClient(ctx)
if err != nil {
@@ -314,7 +325,29 @@
_ = resp
}
+func ExampleIncidentClient_GetSignal() {
+ // import irmpb "google.golang.org/genproto/googleapis/cloud/irm/v1alpha2"
+
+ ctx := context.Background()
+ c, err := irm.NewIncidentClient(ctx)
+ if err != nil {
+ // TODO: Handle error.
+ }
+
+ req := &irmpb.GetSignalRequest{
+ // TODO: Fill request struct fields.
+ }
+ resp, err := c.GetSignal(ctx, req)
+ if err != nil {
+ // TODO: Handle error.
+ }
+ // TODO: Use resp.
+ _ = resp
+}
+
func ExampleIncidentClient_UpdateSignal() {
+ // import irmpb "google.golang.org/genproto/googleapis/cloud/irm/v1alpha2"
+
ctx := context.Background()
c, err := irm.NewIncidentClient(ctx)
if err != nil {
@@ -333,6 +366,8 @@
}
func ExampleIncidentClient_EscalateIncident() {
+ // import irmpb "google.golang.org/genproto/googleapis/cloud/irm/v1alpha2"
+
ctx := context.Background()
c, err := irm.NewIncidentClient(ctx)
if err != nil {
@@ -351,6 +386,8 @@
}
func ExampleIncidentClient_CreateArtifact() {
+ // import irmpb "google.golang.org/genproto/googleapis/cloud/irm/v1alpha2"
+
ctx := context.Background()
c, err := irm.NewIncidentClient(ctx)
if err != nil {
@@ -369,6 +406,9 @@
}
func ExampleIncidentClient_ListArtifacts() {
+ // import irmpb "google.golang.org/genproto/googleapis/cloud/irm/v1alpha2"
+ // import "google.golang.org/api/iterator"
+
ctx := context.Background()
c, err := irm.NewIncidentClient(ctx)
if err != nil {
@@ -393,6 +433,8 @@
}
func ExampleIncidentClient_UpdateArtifact() {
+ // import irmpb "google.golang.org/genproto/googleapis/cloud/irm/v1alpha2"
+
ctx := context.Background()
c, err := irm.NewIncidentClient(ctx)
if err != nil {
@@ -427,6 +469,8 @@
}
func ExampleIncidentClient_SendShiftHandoff() {
+ // import irmpb "google.golang.org/genproto/googleapis/cloud/irm/v1alpha2"
+
ctx := context.Background()
c, err := irm.NewIncidentClient(ctx)
if err != nil {
@@ -445,6 +489,8 @@
}
func ExampleIncidentClient_CreateSubscription() {
+ // import irmpb "google.golang.org/genproto/googleapis/cloud/irm/v1alpha2"
+
ctx := context.Background()
c, err := irm.NewIncidentClient(ctx)
if err != nil {
@@ -463,6 +509,8 @@
}
func ExampleIncidentClient_UpdateSubscription() {
+ // import irmpb "google.golang.org/genproto/googleapis/cloud/irm/v1alpha2"
+
ctx := context.Background()
c, err := irm.NewIncidentClient(ctx)
if err != nil {
@@ -481,6 +529,9 @@
}
func ExampleIncidentClient_ListSubscriptions() {
+ // import irmpb "google.golang.org/genproto/googleapis/cloud/irm/v1alpha2"
+ // import "google.golang.org/api/iterator"
+
ctx := context.Background()
c, err := irm.NewIncidentClient(ctx)
if err != nil {
@@ -521,6 +572,8 @@
}
func ExampleIncidentClient_CreateIncidentRoleAssignment() {
+ // import irmpb "google.golang.org/genproto/googleapis/cloud/irm/v1alpha2"
+
ctx := context.Background()
c, err := irm.NewIncidentClient(ctx)
if err != nil {
@@ -555,6 +608,9 @@
}
func ExampleIncidentClient_ListIncidentRoleAssignments() {
+ // import irmpb "google.golang.org/genproto/googleapis/cloud/irm/v1alpha2"
+ // import "google.golang.org/api/iterator"
+
ctx := context.Background()
c, err := irm.NewIncidentClient(ctx)
if err != nil {
@@ -579,6 +635,8 @@
}
func ExampleIncidentClient_RequestIncidentRoleHandover() {
+ // import irmpb "google.golang.org/genproto/googleapis/cloud/irm/v1alpha2"
+
ctx := context.Background()
c, err := irm.NewIncidentClient(ctx)
if err != nil {
@@ -597,6 +655,8 @@
}
func ExampleIncidentClient_ConfirmIncidentRoleHandover() {
+ // import irmpb "google.golang.org/genproto/googleapis/cloud/irm/v1alpha2"
+
ctx := context.Background()
c, err := irm.NewIncidentClient(ctx)
if err != nil {
@@ -615,6 +675,8 @@
}
func ExampleIncidentClient_ForceIncidentRoleHandover() {
+ // import irmpb "google.golang.org/genproto/googleapis/cloud/irm/v1alpha2"
+
ctx := context.Background()
c, err := irm.NewIncidentClient(ctx)
if err != nil {
@@ -633,6 +695,8 @@
}
func ExampleIncidentClient_CancelIncidentRoleHandover() {
+ // import irmpb "google.golang.org/genproto/googleapis/cloud/irm/v1alpha2"
+
ctx := context.Background()
c, err := irm.NewIncidentClient(ctx)
if err != nil {
diff --git a/kms/apiv1/doc.go b/kms/apiv1/doc.go
index 0f28554..4b1adc6 100644
--- a/kms/apiv1/doc.go
+++ b/kms/apiv1/doc.go
@@ -12,11 +12,10 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-// Code generated by gapic-generator. DO NOT EDIT.
+// Code generated by protoc-gen-go_gapic. DO NOT EDIT.
// Package kms is an auto-generated package for the
// Cloud Key Management Service (KMS) API.
-
//
// Manages keys and performs cryptographic operations in a central cloud
// service, for direct use by other cloud resources and applications.
@@ -31,6 +30,7 @@
//
// For information about setting deadlines, reusing contexts, and more
// please visit godoc.org/cloud.google.com/go.
+
package kms // import "cloud.google.com/go/kms/apiv1"
import (
@@ -42,6 +42,8 @@
"google.golang.org/grpc/metadata"
)
+const versionClient = "20191216"
+
func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context {
out, _ := metadata.FromOutgoingContext(ctx)
out = out.Copy()
@@ -76,7 +78,7 @@
}
notSemverRune := func(r rune) bool {
- return strings.IndexRune("0123456789.", r) < 0
+ return !strings.ContainsRune("0123456789.", r)
}
if strings.HasPrefix(s, "go1") {
@@ -97,5 +99,3 @@
}
return "UNKNOWN"
}
-
-const versionClient = "20191206"
diff --git a/kms/apiv1/key_management_client.go b/kms/apiv1/key_management_client.go
index 2903072..68824c1 100644
--- a/kms/apiv1/key_management_client.go
+++ b/kms/apiv1/key_management_client.go
@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-// Code generated by gapic-generator. DO NOT EDIT.
+// Code generated by protoc-gen-go_gapic. DO NOT EDIT.
package kms
@@ -37,33 +37,34 @@
// KeyManagementCallOptions contains the retry settings for each method of KeyManagementClient.
type KeyManagementCallOptions struct {
ListKeyRings []gax.CallOption
- ListImportJobs []gax.CallOption
ListCryptoKeys []gax.CallOption
ListCryptoKeyVersions []gax.CallOption
+ ListImportJobs []gax.CallOption
GetKeyRing []gax.CallOption
- GetImportJob []gax.CallOption
GetCryptoKey []gax.CallOption
GetCryptoKeyVersion []gax.CallOption
+ GetPublicKey []gax.CallOption
+ GetImportJob []gax.CallOption
CreateKeyRing []gax.CallOption
- CreateImportJob []gax.CallOption
CreateCryptoKey []gax.CallOption
CreateCryptoKeyVersion []gax.CallOption
ImportCryptoKeyVersion []gax.CallOption
+ CreateImportJob []gax.CallOption
UpdateCryptoKey []gax.CallOption
UpdateCryptoKeyVersion []gax.CallOption
Encrypt []gax.CallOption
Decrypt []gax.CallOption
+ AsymmetricSign []gax.CallOption
+ AsymmetricDecrypt []gax.CallOption
UpdateCryptoKeyPrimaryVersion []gax.CallOption
DestroyCryptoKeyVersion []gax.CallOption
RestoreCryptoKeyVersion []gax.CallOption
- GetPublicKey []gax.CallOption
- AsymmetricDecrypt []gax.CallOption
- AsymmetricSign []gax.CallOption
}
func defaultKeyManagementClientOptions() []option.ClientOption {
return []option.ClientOption{
option.WithEndpoint("cloudkms.googleapis.com:443"),
+ option.WithGRPCDialOption(grpc.WithDisableServiceConfig()),
option.WithScopes(DefaultAuthScopes()...),
option.WithGRPCDialOption(grpc.WithDefaultCallOptions(
grpc.MaxCallRecvMsgSize(math.MaxInt32))),
@@ -71,45 +72,282 @@
}
func defaultKeyManagementCallOptions() *KeyManagementCallOptions {
- retry := map[[2]string][]gax.CallOption{
- {"default", "retryable"}: {
+ return &KeyManagementCallOptions{
+ ListKeyRings: []gax.CallOption{
gax.WithRetry(func() gax.Retryer {
return gax.OnCodes([]codes.Code{
- codes.DeadlineExceeded,
codes.Internal,
codes.Unavailable,
+ codes.DeadlineExceeded,
}, gax.Backoff{
Initial: 100 * time.Millisecond,
Max: 60000 * time.Millisecond,
- Multiplier: 1.3,
+ Multiplier: 1.30,
})
}),
},
- }
- return &KeyManagementCallOptions{
- ListKeyRings: retry[[2]string{"default", "retryable"}],
- ListImportJobs: retry[[2]string{"default", "retryable"}],
- ListCryptoKeys: retry[[2]string{"default", "retryable"}],
- ListCryptoKeyVersions: retry[[2]string{"default", "retryable"}],
- GetKeyRing: retry[[2]string{"default", "retryable"}],
- GetImportJob: retry[[2]string{"default", "retryable"}],
- GetCryptoKey: retry[[2]string{"default", "retryable"}],
- GetCryptoKeyVersion: retry[[2]string{"default", "retryable"}],
- CreateKeyRing: retry[[2]string{"default", "retryable"}],
- CreateImportJob: retry[[2]string{"default", "retryable"}],
- CreateCryptoKey: retry[[2]string{"default", "retryable"}],
- CreateCryptoKeyVersion: retry[[2]string{"default", "non_retryable"}],
- ImportCryptoKeyVersion: retry[[2]string{"default", "non_retryable"}],
- UpdateCryptoKey: retry[[2]string{"default", "retryable"}],
- UpdateCryptoKeyVersion: retry[[2]string{"default", "retryable"}],
- Encrypt: retry[[2]string{"default", "retryable"}],
- Decrypt: retry[[2]string{"default", "retryable"}],
- UpdateCryptoKeyPrimaryVersion: retry[[2]string{"default", "retryable"}],
- DestroyCryptoKeyVersion: retry[[2]string{"default", "retryable"}],
- RestoreCryptoKeyVersion: retry[[2]string{"default", "retryable"}],
- GetPublicKey: retry[[2]string{"default", "retryable"}],
- AsymmetricDecrypt: retry[[2]string{"default", "retryable"}],
- AsymmetricSign: retry[[2]string{"default", "retryable"}],
+ ListCryptoKeys: []gax.CallOption{
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnCodes([]codes.Code{
+ codes.Internal,
+ codes.Unavailable,
+ codes.DeadlineExceeded,
+ }, gax.Backoff{
+ Initial: 100 * time.Millisecond,
+ Max: 60000 * time.Millisecond,
+ Multiplier: 1.30,
+ })
+ }),
+ },
+ ListCryptoKeyVersions: []gax.CallOption{
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnCodes([]codes.Code{
+ codes.Internal,
+ codes.Unavailable,
+ codes.DeadlineExceeded,
+ }, gax.Backoff{
+ Initial: 100 * time.Millisecond,
+ Max: 60000 * time.Millisecond,
+ Multiplier: 1.30,
+ })
+ }),
+ },
+ ListImportJobs: []gax.CallOption{
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnCodes([]codes.Code{
+ codes.Internal,
+ codes.Unavailable,
+ codes.DeadlineExceeded,
+ }, gax.Backoff{
+ Initial: 100 * time.Millisecond,
+ Max: 60000 * time.Millisecond,
+ Multiplier: 1.30,
+ })
+ }),
+ },
+ GetKeyRing: []gax.CallOption{
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnCodes([]codes.Code{
+ codes.Internal,
+ codes.Unavailable,
+ codes.DeadlineExceeded,
+ }, gax.Backoff{
+ Initial: 100 * time.Millisecond,
+ Max: 60000 * time.Millisecond,
+ Multiplier: 1.30,
+ })
+ }),
+ },
+ GetCryptoKey: []gax.CallOption{
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnCodes([]codes.Code{
+ codes.Internal,
+ codes.Unavailable,
+ codes.DeadlineExceeded,
+ }, gax.Backoff{
+ Initial: 100 * time.Millisecond,
+ Max: 60000 * time.Millisecond,
+ Multiplier: 1.30,
+ })
+ }),
+ },
+ GetCryptoKeyVersion: []gax.CallOption{
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnCodes([]codes.Code{
+ codes.Internal,
+ codes.Unavailable,
+ codes.DeadlineExceeded,
+ }, gax.Backoff{
+ Initial: 100 * time.Millisecond,
+ Max: 60000 * time.Millisecond,
+ Multiplier: 1.30,
+ })
+ }),
+ },
+ GetPublicKey: []gax.CallOption{
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnCodes([]codes.Code{
+ codes.Internal,
+ codes.Unavailable,
+ codes.DeadlineExceeded,
+ }, gax.Backoff{
+ Initial: 100 * time.Millisecond,
+ Max: 60000 * time.Millisecond,
+ Multiplier: 1.30,
+ })
+ }),
+ },
+ GetImportJob: []gax.CallOption{
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnCodes([]codes.Code{
+ codes.Internal,
+ codes.Unavailable,
+ codes.DeadlineExceeded,
+ }, gax.Backoff{
+ Initial: 100 * time.Millisecond,
+ Max: 60000 * time.Millisecond,
+ Multiplier: 1.30,
+ })
+ }),
+ },
+ CreateKeyRing: []gax.CallOption{
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnCodes([]codes.Code{
+ codes.Internal,
+ codes.Unavailable,
+ codes.DeadlineExceeded,
+ }, gax.Backoff{
+ Initial: 100 * time.Millisecond,
+ Max: 60000 * time.Millisecond,
+ Multiplier: 1.30,
+ })
+ }),
+ },
+ CreateCryptoKey: []gax.CallOption{
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnCodes([]codes.Code{
+ codes.Internal,
+ codes.Unavailable,
+ codes.DeadlineExceeded,
+ }, gax.Backoff{
+ Initial: 100 * time.Millisecond,
+ Max: 60000 * time.Millisecond,
+ Multiplier: 1.30,
+ })
+ }),
+ },
+ CreateCryptoKeyVersion: []gax.CallOption{},
+ ImportCryptoKeyVersion: []gax.CallOption{},
+ CreateImportJob: []gax.CallOption{
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnCodes([]codes.Code{
+ codes.Internal,
+ codes.Unavailable,
+ codes.DeadlineExceeded,
+ }, gax.Backoff{
+ Initial: 100 * time.Millisecond,
+ Max: 60000 * time.Millisecond,
+ Multiplier: 1.30,
+ })
+ }),
+ },
+ UpdateCryptoKey: []gax.CallOption{
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnCodes([]codes.Code{
+ codes.Internal,
+ codes.Unavailable,
+ codes.DeadlineExceeded,
+ }, gax.Backoff{
+ Initial: 100 * time.Millisecond,
+ Max: 60000 * time.Millisecond,
+ Multiplier: 1.30,
+ })
+ }),
+ },
+ UpdateCryptoKeyVersion: []gax.CallOption{
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnCodes([]codes.Code{
+ codes.Internal,
+ codes.Unavailable,
+ codes.DeadlineExceeded,
+ }, gax.Backoff{
+ Initial: 100 * time.Millisecond,
+ Max: 60000 * time.Millisecond,
+ Multiplier: 1.30,
+ })
+ }),
+ },
+ Encrypt: []gax.CallOption{
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnCodes([]codes.Code{
+ codes.Internal,
+ codes.Unavailable,
+ codes.DeadlineExceeded,
+ }, gax.Backoff{
+ Initial: 100 * time.Millisecond,
+ Max: 60000 * time.Millisecond,
+ Multiplier: 1.30,
+ })
+ }),
+ },
+ Decrypt: []gax.CallOption{
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnCodes([]codes.Code{
+ codes.Internal,
+ codes.Unavailable,
+ codes.DeadlineExceeded,
+ }, gax.Backoff{
+ Initial: 100 * time.Millisecond,
+ Max: 60000 * time.Millisecond,
+ Multiplier: 1.30,
+ })
+ }),
+ },
+ AsymmetricSign: []gax.CallOption{
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnCodes([]codes.Code{
+ codes.Internal,
+ codes.Unavailable,
+ codes.DeadlineExceeded,
+ }, gax.Backoff{
+ Initial: 100 * time.Millisecond,
+ Max: 60000 * time.Millisecond,
+ Multiplier: 1.30,
+ })
+ }),
+ },
+ AsymmetricDecrypt: []gax.CallOption{
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnCodes([]codes.Code{
+ codes.Internal,
+ codes.Unavailable,
+ codes.DeadlineExceeded,
+ }, gax.Backoff{
+ Initial: 100 * time.Millisecond,
+ Max: 60000 * time.Millisecond,
+ Multiplier: 1.30,
+ })
+ }),
+ },
+ UpdateCryptoKeyPrimaryVersion: []gax.CallOption{
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnCodes([]codes.Code{
+ codes.Internal,
+ codes.Unavailable,
+ codes.DeadlineExceeded,
+ }, gax.Backoff{
+ Initial: 100 * time.Millisecond,
+ Max: 60000 * time.Millisecond,
+ Multiplier: 1.30,
+ })
+ }),
+ },
+ DestroyCryptoKeyVersion: []gax.CallOption{
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnCodes([]codes.Code{
+ codes.Internal,
+ codes.Unavailable,
+ codes.DeadlineExceeded,
+ }, gax.Backoff{
+ Initial: 100 * time.Millisecond,
+ Max: 60000 * time.Millisecond,
+ Multiplier: 1.30,
+ })
+ }),
+ },
+ RestoreCryptoKeyVersion: []gax.CallOption{
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnCodes([]codes.Code{
+ codes.Internal,
+ codes.Unavailable,
+ codes.DeadlineExceeded,
+ }, gax.Backoff{
+ Initial: 100 * time.Millisecond,
+ Max: 60000 * time.Millisecond,
+ Multiplier: 1.30,
+ })
+ }),
+ },
}
}
@@ -157,6 +395,7 @@
keyManagementClient: kmspb.NewKeyManagementServiceClient(conn),
}
c.setGoogleClientInfo()
+
return c, nil
}
@@ -203,46 +442,9 @@
if err != nil {
return nil, "", err
}
- return resp.KeyRings, resp.NextPageToken, 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.PageSize)
- it.pageInfo.Token = req.PageToken
- return it
-}
-// ListImportJobs lists [ImportJobs][google.cloud.kms.v1.ImportJob].
-func (c *KeyManagementClient) ListImportJobs(ctx context.Context, req *kmspb.ListImportJobsRequest, opts ...gax.CallOption) *ImportJobIterator {
- 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.ListImportJobs[0:len(c.CallOptions.ListImportJobs):len(c.CallOptions.ListImportJobs)], opts...)
- it := &ImportJobIterator{}
- req = proto.Clone(req).(*kmspb.ListImportJobsRequest)
- it.InternalFetch = func(pageSize int, pageToken string) ([]*kmspb.ImportJob, string, error) {
- var resp *kmspb.ListImportJobsResponse
- 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.keyManagementClient.ListImportJobs(ctx, req, settings.GRPC...)
- return err
- }, opts...)
- if err != nil {
- return nil, "", err
- }
- return resp.ImportJobs, resp.NextPageToken, nil
+ it.Response = resp
+ return resp.KeyRings, resp.NextPageToken, nil
}
fetch := func(pageSize int, pageToken string) (string, error) {
items, nextPageToken, err := it.InternalFetch(pageSize, pageToken)
@@ -281,6 +483,8 @@
if err != nil {
return nil, "", err
}
+
+ it.Response = resp
return resp.CryptoKeys, resp.NextPageToken, nil
}
fetch := func(pageSize int, pageToken string) (string, error) {
@@ -320,6 +524,8 @@
if err != nil {
return nil, "", err
}
+
+ it.Response = resp
return resp.CryptoKeyVersions, resp.NextPageToken, nil
}
fetch := func(pageSize int, pageToken string) (string, error) {
@@ -336,6 +542,47 @@
return it
}
+// ListImportJobs lists [ImportJobs][google.cloud.kms.v1.ImportJob].
+func (c *KeyManagementClient) ListImportJobs(ctx context.Context, req *kmspb.ListImportJobsRequest, opts ...gax.CallOption) *ImportJobIterator {
+ 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.ListImportJobs[0:len(c.CallOptions.ListImportJobs):len(c.CallOptions.ListImportJobs)], opts...)
+ it := &ImportJobIterator{}
+ req = proto.Clone(req).(*kmspb.ListImportJobsRequest)
+ it.InternalFetch = func(pageSize int, pageToken string) ([]*kmspb.ImportJob, string, error) {
+ var resp *kmspb.ListImportJobsResponse
+ 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.keyManagementClient.ListImportJobs(ctx, req, settings.GRPC...)
+ return err
+ }, opts...)
+ if err != nil {
+ return nil, "", err
+ }
+
+ it.Response = resp
+ return resp.ImportJobs, resp.NextPageToken, 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.PageSize)
+ it.pageInfo.Token = req.PageToken
+ return it
+}
+
// GetKeyRing returns metadata for a given [KeyRing][google.cloud.kms.v1.KeyRing].
func (c *KeyManagementClient) GetKeyRing(ctx context.Context, req *kmspb.GetKeyRingRequest, opts ...gax.CallOption) (*kmspb.KeyRing, error) {
md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName())))
@@ -353,23 +600,6 @@
return resp, nil
}
-// GetImportJob returns metadata for a given [ImportJob][google.cloud.kms.v1.ImportJob].
-func (c *KeyManagementClient) GetImportJob(ctx context.Context, req *kmspb.GetImportJobRequest, opts ...gax.CallOption) (*kmspb.ImportJob, 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.GetImportJob[0:len(c.CallOptions.GetImportJob):len(c.CallOptions.GetImportJob)], opts...)
- var resp *kmspb.ImportJob
- err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
- var err error
- resp, err = c.keyManagementClient.GetImportJob(ctx, req, settings.GRPC...)
- return err
- }, opts...)
- if err != nil {
- return nil, err
- }
- return resp, nil
-}
-
// GetCryptoKey returns metadata for a given [CryptoKey][google.cloud.kms.v1.CryptoKey], as well as its
// [primary][google.cloud.kms.v1.CryptoKey.primary] [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion].
func (c *KeyManagementClient) GetCryptoKey(ctx context.Context, req *kmspb.GetCryptoKeyRequest, opts ...gax.CallOption) (*kmspb.CryptoKey, error) {
@@ -405,6 +635,43 @@
return resp, nil
}
+// GetPublicKey returns the public key for the given [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]. The
+// [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] must be
+// [ASYMMETRIC_SIGN][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ASYMMETRIC_SIGN] or
+// [ASYMMETRIC_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ASYMMETRIC_DECRYPT].
+func (c *KeyManagementClient) GetPublicKey(ctx context.Context, req *kmspb.GetPublicKeyRequest, opts ...gax.CallOption) (*kmspb.PublicKey, 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.GetPublicKey[0:len(c.CallOptions.GetPublicKey):len(c.CallOptions.GetPublicKey)], opts...)
+ var resp *kmspb.PublicKey
+ err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ var err error
+ resp, err = c.keyManagementClient.GetPublicKey(ctx, req, settings.GRPC...)
+ return err
+ }, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return resp, nil
+}
+
+// GetImportJob returns metadata for a given [ImportJob][google.cloud.kms.v1.ImportJob].
+func (c *KeyManagementClient) GetImportJob(ctx context.Context, req *kmspb.GetImportJobRequest, opts ...gax.CallOption) (*kmspb.ImportJob, 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.GetImportJob[0:len(c.CallOptions.GetImportJob):len(c.CallOptions.GetImportJob)], opts...)
+ var resp *kmspb.ImportJob
+ err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ var err error
+ resp, err = c.keyManagementClient.GetImportJob(ctx, req, settings.GRPC...)
+ return err
+ }, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return resp, nil
+}
+
// CreateKeyRing create a new [KeyRing][google.cloud.kms.v1.KeyRing] in a given Project and Location.
func (c *KeyManagementClient) CreateKeyRing(ctx context.Context, req *kmspb.CreateKeyRingRequest, opts ...gax.CallOption) (*kmspb.KeyRing, error) {
md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent())))
@@ -422,25 +689,6 @@
return resp, nil
}
-// CreateImportJob create a new [ImportJob][google.cloud.kms.v1.ImportJob] within a [KeyRing][google.cloud.kms.v1.KeyRing].
-//
-// [ImportJob.import_method][google.cloud.kms.v1.ImportJob.import_method] is required.
-func (c *KeyManagementClient) CreateImportJob(ctx context.Context, req *kmspb.CreateImportJobRequest, opts ...gax.CallOption) (*kmspb.ImportJob, 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.CreateImportJob[0:len(c.CallOptions.CreateImportJob):len(c.CallOptions.CreateImportJob)], opts...)
- var resp *kmspb.ImportJob
- err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
- var err error
- resp, err = c.keyManagementClient.CreateImportJob(ctx, req, settings.GRPC...)
- return err
- }, opts...)
- if err != nil {
- return nil, err
- }
- return resp, nil
-}
-
// CreateCryptoKey create a new [CryptoKey][google.cloud.kms.v1.CryptoKey] within a [KeyRing][google.cloud.kms.v1.KeyRing].
//
// [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] and
@@ -504,6 +752,25 @@
return resp, nil
}
+// CreateImportJob create a new [ImportJob][google.cloud.kms.v1.ImportJob] within a [KeyRing][google.cloud.kms.v1.KeyRing].
+//
+// [ImportJob.import_method][google.cloud.kms.v1.ImportJob.import_method] is required.
+func (c *KeyManagementClient) CreateImportJob(ctx context.Context, req *kmspb.CreateImportJobRequest, opts ...gax.CallOption) (*kmspb.ImportJob, 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.CreateImportJob[0:len(c.CallOptions.CreateImportJob):len(c.CallOptions.CreateImportJob)], opts...)
+ var resp *kmspb.ImportJob
+ err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ var err error
+ resp, err = c.keyManagementClient.CreateImportJob(ctx, req, settings.GRPC...)
+ return err
+ }, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return resp, nil
+}
+
// UpdateCryptoKey update a [CryptoKey][google.cloud.kms.v1.CryptoKey].
func (c *KeyManagementClient) UpdateCryptoKey(ctx context.Context, req *kmspb.UpdateCryptoKeyRequest, opts ...gax.CallOption) (*kmspb.CryptoKey, error) {
md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "crypto_key.name", url.QueryEscape(req.GetCryptoKey().GetName())))
@@ -581,6 +848,44 @@
return resp, nil
}
+// AsymmetricSign signs data using a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] with [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose]
+// ASYMMETRIC_SIGN, producing a signature that can be verified with the public
+// key retrieved from [GetPublicKey][google.cloud.kms.v1.KeyManagementService.GetPublicKey].
+func (c *KeyManagementClient) AsymmetricSign(ctx context.Context, req *kmspb.AsymmetricSignRequest, opts ...gax.CallOption) (*kmspb.AsymmetricSignResponse, 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.AsymmetricSign[0:len(c.CallOptions.AsymmetricSign):len(c.CallOptions.AsymmetricSign)], opts...)
+ var resp *kmspb.AsymmetricSignResponse
+ err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ var err error
+ resp, err = c.keyManagementClient.AsymmetricSign(ctx, req, settings.GRPC...)
+ return err
+ }, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return resp, nil
+}
+
+// AsymmetricDecrypt decrypts data that was encrypted with a public key retrieved from
+// [GetPublicKey][google.cloud.kms.v1.KeyManagementService.GetPublicKey] corresponding to a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] with
+// [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] ASYMMETRIC_DECRYPT.
+func (c *KeyManagementClient) AsymmetricDecrypt(ctx context.Context, req *kmspb.AsymmetricDecryptRequest, opts ...gax.CallOption) (*kmspb.AsymmetricDecryptResponse, 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.AsymmetricDecrypt[0:len(c.CallOptions.AsymmetricDecrypt):len(c.CallOptions.AsymmetricDecrypt)], opts...)
+ var resp *kmspb.AsymmetricDecryptResponse
+ err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ var err error
+ resp, err = c.keyManagementClient.AsymmetricDecrypt(ctx, req, settings.GRPC...)
+ return err
+ }, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return resp, nil
+}
+
// UpdateCryptoKeyPrimaryVersion update the version of a [CryptoKey][google.cloud.kms.v1.CryptoKey] that will be used in [Encrypt][google.cloud.kms.v1.KeyManagementService.Encrypt].
//
// Returns an error if called on an asymmetric key.
@@ -651,70 +956,17 @@
return resp, nil
}
-// GetPublicKey returns the public key for the given [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]. The
-// [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] must be
-// [ASYMMETRIC_SIGN][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ASYMMETRIC_SIGN] or
-// [ASYMMETRIC_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ASYMMETRIC_DECRYPT].
-func (c *KeyManagementClient) GetPublicKey(ctx context.Context, req *kmspb.GetPublicKeyRequest, opts ...gax.CallOption) (*kmspb.PublicKey, 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.GetPublicKey[0:len(c.CallOptions.GetPublicKey):len(c.CallOptions.GetPublicKey)], opts...)
- var resp *kmspb.PublicKey
- err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
- var err error
- resp, err = c.keyManagementClient.GetPublicKey(ctx, req, settings.GRPC...)
- return err
- }, opts...)
- if err != nil {
- return nil, err
- }
- return resp, nil
-}
-
-// AsymmetricDecrypt decrypts data that was encrypted with a public key retrieved from
-// [GetPublicKey][google.cloud.kms.v1.KeyManagementService.GetPublicKey] corresponding to a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] with
-// [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] ASYMMETRIC_DECRYPT.
-func (c *KeyManagementClient) AsymmetricDecrypt(ctx context.Context, req *kmspb.AsymmetricDecryptRequest, opts ...gax.CallOption) (*kmspb.AsymmetricDecryptResponse, 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.AsymmetricDecrypt[0:len(c.CallOptions.AsymmetricDecrypt):len(c.CallOptions.AsymmetricDecrypt)], opts...)
- var resp *kmspb.AsymmetricDecryptResponse
- err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
- var err error
- resp, err = c.keyManagementClient.AsymmetricDecrypt(ctx, req, settings.GRPC...)
- return err
- }, opts...)
- if err != nil {
- return nil, err
- }
- return resp, nil
-}
-
-// AsymmetricSign signs data using a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] with [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose]
-// ASYMMETRIC_SIGN, producing a signature that can be verified with the public
-// key retrieved from [GetPublicKey][google.cloud.kms.v1.KeyManagementService.GetPublicKey].
-func (c *KeyManagementClient) AsymmetricSign(ctx context.Context, req *kmspb.AsymmetricSignRequest, opts ...gax.CallOption) (*kmspb.AsymmetricSignResponse, 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.AsymmetricSign[0:len(c.CallOptions.AsymmetricSign):len(c.CallOptions.AsymmetricSign)], opts...)
- var resp *kmspb.AsymmetricSignResponse
- err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
- var err error
- resp, err = c.keyManagementClient.AsymmetricSign(ctx, req, settings.GRPC...)
- return err
- }, opts...)
- if err != nil {
- return nil, err
- }
- return resp, nil
-}
-
// CryptoKeyIterator manages a stream of *kmspb.CryptoKey.
type CryptoKeyIterator struct {
items []*kmspb.CryptoKey
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.
//
@@ -757,6 +1009,11 @@
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.
//
@@ -799,6 +1056,11 @@
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.
//
@@ -841,6 +1103,11 @@
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.
//
diff --git a/kms/apiv1/key_management_client_example_test.go b/kms/apiv1/key_management_client_example_test.go
index f8f0fa4..36d75e9 100644
--- a/kms/apiv1/key_management_client_example_test.go
+++ b/kms/apiv1/key_management_client_example_test.go
@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-// Code generated by gapic-generator. DO NOT EDIT.
+// Code generated by protoc-gen-go_gapic. DO NOT EDIT.
package kms_test
@@ -35,6 +35,9 @@
}
func ExampleKeyManagementClient_ListKeyRings() {
+ // import kmspb "google.golang.org/genproto/googleapis/cloud/kms/v1"
+ // import "google.golang.org/api/iterator"
+
ctx := context.Background()
c, err := kms.NewKeyManagementClient(ctx)
if err != nil {
@@ -58,31 +61,10 @@
}
}
-func ExampleKeyManagementClient_ListImportJobs() {
- ctx := context.Background()
- c, err := kms.NewKeyManagementClient(ctx)
- if err != nil {
- // TODO: Handle error.
- }
-
- req := &kmspb.ListImportJobsRequest{
- // TODO: Fill request struct fields.
- }
- it := c.ListImportJobs(ctx, req)
- for {
- resp, err := it.Next()
- if err == iterator.Done {
- break
- }
- if err != nil {
- // TODO: Handle error.
- }
- // TODO: Use resp.
- _ = resp
- }
-}
-
func ExampleKeyManagementClient_ListCryptoKeys() {
+ // import kmspb "google.golang.org/genproto/googleapis/cloud/kms/v1"
+ // import "google.golang.org/api/iterator"
+
ctx := context.Background()
c, err := kms.NewKeyManagementClient(ctx)
if err != nil {
@@ -107,6 +89,9 @@
}
func ExampleKeyManagementClient_ListCryptoKeyVersions() {
+ // import kmspb "google.golang.org/genproto/googleapis/cloud/kms/v1"
+ // import "google.golang.org/api/iterator"
+
ctx := context.Background()
c, err := kms.NewKeyManagementClient(ctx)
if err != nil {
@@ -130,7 +115,36 @@
}
}
+func ExampleKeyManagementClient_ListImportJobs() {
+ // import kmspb "google.golang.org/genproto/googleapis/cloud/kms/v1"
+ // import "google.golang.org/api/iterator"
+
+ ctx := context.Background()
+ c, err := kms.NewKeyManagementClient(ctx)
+ if err != nil {
+ // TODO: Handle error.
+ }
+
+ req := &kmspb.ListImportJobsRequest{
+ // TODO: Fill request struct fields.
+ }
+ it := c.ListImportJobs(ctx, req)
+ for {
+ resp, err := it.Next()
+ if err == iterator.Done {
+ break
+ }
+ if err != nil {
+ // TODO: Handle error.
+ }
+ // TODO: Use resp.
+ _ = resp
+ }
+}
+
func ExampleKeyManagementClient_GetKeyRing() {
+ // import kmspb "google.golang.org/genproto/googleapis/cloud/kms/v1"
+
ctx := context.Background()
c, err := kms.NewKeyManagementClient(ctx)
if err != nil {
@@ -148,25 +162,9 @@
_ = resp
}
-func ExampleKeyManagementClient_GetImportJob() {
- ctx := context.Background()
- c, err := kms.NewKeyManagementClient(ctx)
- if err != nil {
- // TODO: Handle error.
- }
-
- req := &kmspb.GetImportJobRequest{
- // TODO: Fill request struct fields.
- }
- resp, err := c.GetImportJob(ctx, req)
- if err != nil {
- // TODO: Handle error.
- }
- // TODO: Use resp.
- _ = resp
-}
-
func ExampleKeyManagementClient_GetCryptoKey() {
+ // import kmspb "google.golang.org/genproto/googleapis/cloud/kms/v1"
+
ctx := context.Background()
c, err := kms.NewKeyManagementClient(ctx)
if err != nil {
@@ -185,6 +183,8 @@
}
func ExampleKeyManagementClient_GetCryptoKeyVersion() {
+ // import kmspb "google.golang.org/genproto/googleapis/cloud/kms/v1"
+
ctx := context.Background()
c, err := kms.NewKeyManagementClient(ctx)
if err != nil {
@@ -202,7 +202,49 @@
_ = resp
}
+func ExampleKeyManagementClient_GetPublicKey() {
+ // import kmspb "google.golang.org/genproto/googleapis/cloud/kms/v1"
+
+ ctx := context.Background()
+ c, err := kms.NewKeyManagementClient(ctx)
+ if err != nil {
+ // TODO: Handle error.
+ }
+
+ req := &kmspb.GetPublicKeyRequest{
+ // TODO: Fill request struct fields.
+ }
+ resp, err := c.GetPublicKey(ctx, req)
+ if err != nil {
+ // TODO: Handle error.
+ }
+ // TODO: Use resp.
+ _ = resp
+}
+
+func ExampleKeyManagementClient_GetImportJob() {
+ // import kmspb "google.golang.org/genproto/googleapis/cloud/kms/v1"
+
+ ctx := context.Background()
+ c, err := kms.NewKeyManagementClient(ctx)
+ if err != nil {
+ // TODO: Handle error.
+ }
+
+ req := &kmspb.GetImportJobRequest{
+ // TODO: Fill request struct fields.
+ }
+ resp, err := c.GetImportJob(ctx, req)
+ if err != nil {
+ // TODO: Handle error.
+ }
+ // TODO: Use resp.
+ _ = resp
+}
+
func ExampleKeyManagementClient_CreateKeyRing() {
+ // import kmspb "google.golang.org/genproto/googleapis/cloud/kms/v1"
+
ctx := context.Background()
c, err := kms.NewKeyManagementClient(ctx)
if err != nil {
@@ -220,25 +262,9 @@
_ = resp
}
-func ExampleKeyManagementClient_CreateImportJob() {
- ctx := context.Background()
- c, err := kms.NewKeyManagementClient(ctx)
- if err != nil {
- // TODO: Handle error.
- }
-
- req := &kmspb.CreateImportJobRequest{
- // TODO: Fill request struct fields.
- }
- resp, err := c.CreateImportJob(ctx, req)
- if err != nil {
- // TODO: Handle error.
- }
- // TODO: Use resp.
- _ = resp
-}
-
func ExampleKeyManagementClient_CreateCryptoKey() {
+ // import kmspb "google.golang.org/genproto/googleapis/cloud/kms/v1"
+
ctx := context.Background()
c, err := kms.NewKeyManagementClient(ctx)
if err != nil {
@@ -257,6 +283,8 @@
}
func ExampleKeyManagementClient_CreateCryptoKeyVersion() {
+ // import kmspb "google.golang.org/genproto/googleapis/cloud/kms/v1"
+
ctx := context.Background()
c, err := kms.NewKeyManagementClient(ctx)
if err != nil {
@@ -275,6 +303,8 @@
}
func ExampleKeyManagementClient_ImportCryptoKeyVersion() {
+ // import kmspb "google.golang.org/genproto/googleapis/cloud/kms/v1"
+
ctx := context.Background()
c, err := kms.NewKeyManagementClient(ctx)
if err != nil {
@@ -292,7 +322,29 @@
_ = resp
}
+func ExampleKeyManagementClient_CreateImportJob() {
+ // import kmspb "google.golang.org/genproto/googleapis/cloud/kms/v1"
+
+ ctx := context.Background()
+ c, err := kms.NewKeyManagementClient(ctx)
+ if err != nil {
+ // TODO: Handle error.
+ }
+
+ req := &kmspb.CreateImportJobRequest{
+ // TODO: Fill request struct fields.
+ }
+ resp, err := c.CreateImportJob(ctx, req)
+ if err != nil {
+ // TODO: Handle error.
+ }
+ // TODO: Use resp.
+ _ = resp
+}
+
func ExampleKeyManagementClient_UpdateCryptoKey() {
+ // import kmspb "google.golang.org/genproto/googleapis/cloud/kms/v1"
+
ctx := context.Background()
c, err := kms.NewKeyManagementClient(ctx)
if err != nil {
@@ -311,6 +363,8 @@
}
func ExampleKeyManagementClient_UpdateCryptoKeyVersion() {
+ // import kmspb "google.golang.org/genproto/googleapis/cloud/kms/v1"
+
ctx := context.Background()
c, err := kms.NewKeyManagementClient(ctx)
if err != nil {
@@ -329,6 +383,8 @@
}
func ExampleKeyManagementClient_Encrypt() {
+ // import kmspb "google.golang.org/genproto/googleapis/cloud/kms/v1"
+
ctx := context.Background()
c, err := kms.NewKeyManagementClient(ctx)
if err != nil {
@@ -347,6 +403,8 @@
}
func ExampleKeyManagementClient_Decrypt() {
+ // import kmspb "google.golang.org/genproto/googleapis/cloud/kms/v1"
+
ctx := context.Background()
c, err := kms.NewKeyManagementClient(ctx)
if err != nil {
@@ -364,7 +422,49 @@
_ = resp
}
+func ExampleKeyManagementClient_AsymmetricSign() {
+ // import kmspb "google.golang.org/genproto/googleapis/cloud/kms/v1"
+
+ ctx := context.Background()
+ c, err := kms.NewKeyManagementClient(ctx)
+ if err != nil {
+ // TODO: Handle error.
+ }
+
+ req := &kmspb.AsymmetricSignRequest{
+ // TODO: Fill request struct fields.
+ }
+ resp, err := c.AsymmetricSign(ctx, req)
+ if err != nil {
+ // TODO: Handle error.
+ }
+ // TODO: Use resp.
+ _ = resp
+}
+
+func ExampleKeyManagementClient_AsymmetricDecrypt() {
+ // import kmspb "google.golang.org/genproto/googleapis/cloud/kms/v1"
+
+ ctx := context.Background()
+ c, err := kms.NewKeyManagementClient(ctx)
+ if err != nil {
+ // TODO: Handle error.
+ }
+
+ req := &kmspb.AsymmetricDecryptRequest{
+ // TODO: Fill request struct fields.
+ }
+ resp, err := c.AsymmetricDecrypt(ctx, req)
+ if err != nil {
+ // TODO: Handle error.
+ }
+ // TODO: Use resp.
+ _ = resp
+}
+
func ExampleKeyManagementClient_UpdateCryptoKeyPrimaryVersion() {
+ // import kmspb "google.golang.org/genproto/googleapis/cloud/kms/v1"
+
ctx := context.Background()
c, err := kms.NewKeyManagementClient(ctx)
if err != nil {
@@ -383,6 +483,8 @@
}
func ExampleKeyManagementClient_DestroyCryptoKeyVersion() {
+ // import kmspb "google.golang.org/genproto/googleapis/cloud/kms/v1"
+
ctx := context.Background()
c, err := kms.NewKeyManagementClient(ctx)
if err != nil {
@@ -401,6 +503,8 @@
}
func ExampleKeyManagementClient_RestoreCryptoKeyVersion() {
+ // import kmspb "google.golang.org/genproto/googleapis/cloud/kms/v1"
+
ctx := context.Background()
c, err := kms.NewKeyManagementClient(ctx)
if err != nil {
@@ -417,57 +521,3 @@
// TODO: Use resp.
_ = resp
}
-
-func ExampleKeyManagementClient_GetPublicKey() {
- ctx := context.Background()
- c, err := kms.NewKeyManagementClient(ctx)
- if err != nil {
- // TODO: Handle error.
- }
-
- req := &kmspb.GetPublicKeyRequest{
- // TODO: Fill request struct fields.
- }
- resp, err := c.GetPublicKey(ctx, req)
- if err != nil {
- // TODO: Handle error.
- }
- // TODO: Use resp.
- _ = resp
-}
-
-func ExampleKeyManagementClient_AsymmetricDecrypt() {
- ctx := context.Background()
- c, err := kms.NewKeyManagementClient(ctx)
- if err != nil {
- // TODO: Handle error.
- }
-
- req := &kmspb.AsymmetricDecryptRequest{
- // TODO: Fill request struct fields.
- }
- resp, err := c.AsymmetricDecrypt(ctx, req)
- if err != nil {
- // TODO: Handle error.
- }
- // TODO: Use resp.
- _ = resp
-}
-
-func ExampleKeyManagementClient_AsymmetricSign() {
- ctx := context.Background()
- c, err := kms.NewKeyManagementClient(ctx)
- if err != nil {
- // TODO: Handle error.
- }
-
- req := &kmspb.AsymmetricSignRequest{
- // TODO: Fill request struct fields.
- }
- resp, err := c.AsymmetricSign(ctx, req)
- if err != nil {
- // TODO: Handle error.
- }
- // TODO: Use resp.
- _ = resp
-}
diff --git a/language/apiv1/doc.go b/language/apiv1/doc.go
index 184e63b..20a0274 100644
--- a/language/apiv1/doc.go
+++ b/language/apiv1/doc.go
@@ -45,7 +45,7 @@
"google.golang.org/grpc/metadata"
)
-const versionClient = "20191206"
+const versionClient = "20191216"
func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context {
out, _ := metadata.FromOutgoingContext(ctx)
diff --git a/language/apiv1beta2/doc.go b/language/apiv1beta2/doc.go
index bfaa159..402a43f 100644
--- a/language/apiv1beta2/doc.go
+++ b/language/apiv1beta2/doc.go
@@ -12,17 +12,17 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-// Code generated by gapic-generator. DO NOT EDIT.
+// Code generated by protoc-gen-go_gapic. DO NOT EDIT.
// Package language is an auto-generated package for the
-// Google Cloud Natural Language API.
+// Cloud Natural Language API.
+//
+// Provides natural language understanding technologies, such as sentiment
+// analysis, entity recognition, entity sentiment analysis, and other text
+// annotations, to developers.
//
// NOTE: This package is in beta. It is not stable, and may be subject to changes.
//
-// Google Cloud Natural Language API provides natural language understanding
-// technologies to developers. Examples include sentiment analysis, entity
-// recognition, and text annotations.
-//
// Use of Context
//
// The ctx passed to NewClient is used for authentication requests and
@@ -33,6 +33,7 @@
//
// For information about setting deadlines, reusing contexts, and more
// please visit godoc.org/cloud.google.com/go.
+
package language // import "cloud.google.com/go/language/apiv1beta2"
import (
@@ -44,6 +45,8 @@
"google.golang.org/grpc/metadata"
)
+const versionClient = "20191216"
+
func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context {
out, _ := metadata.FromOutgoingContext(ctx)
out = out.Copy()
@@ -58,6 +61,7 @@
// DefaultAuthScopes reports the default set of authentication scopes to use with this package.
func DefaultAuthScopes() []string {
return []string{
+ "https://www.googleapis.com/auth/cloud-language",
"https://www.googleapis.com/auth/cloud-platform",
}
}
@@ -77,7 +81,7 @@
}
notSemverRune := func(r rune) bool {
- return strings.IndexRune("0123456789.", r) < 0
+ return !strings.ContainsRune("0123456789.", r)
}
if strings.HasPrefix(s, "go1") {
@@ -98,5 +102,3 @@
}
return "UNKNOWN"
}
-
-const versionClient = "20191206"
diff --git a/language/apiv1beta2/language_client.go b/language/apiv1beta2/language_client.go
index 0c5bc5a..4e565c6 100644
--- a/language/apiv1beta2/language_client.go
+++ b/language/apiv1beta2/language_client.go
@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-// Code generated by gapic-generator. DO NOT EDIT.
+// Code generated by protoc-gen-go_gapic. DO NOT EDIT.
package language
@@ -43,6 +43,7 @@
func defaultClientOptions() []option.ClientOption {
return []option.ClientOption{
option.WithEndpoint("language.googleapis.com:443"),
+ option.WithGRPCDialOption(grpc.WithDisableServiceConfig()),
option.WithScopes(DefaultAuthScopes()...),
option.WithGRPCDialOption(grpc.WithDefaultCallOptions(
grpc.MaxCallRecvMsgSize(math.MaxInt32))),
@@ -50,31 +51,83 @@
}
func defaultCallOptions() *CallOptions {
- retry := map[[2]string][]gax.CallOption{
- {"default", "idempotent"}: {
+ return &CallOptions{
+ AnalyzeSentiment: []gax.CallOption{
gax.WithRetry(func() gax.Retryer {
return gax.OnCodes([]codes.Code{
- codes.DeadlineExceeded,
codes.Unavailable,
+ codes.DeadlineExceeded,
}, gax.Backoff{
Initial: 100 * time.Millisecond,
Max: 60000 * time.Millisecond,
- Multiplier: 1.3,
+ Multiplier: 1.30,
+ })
+ }),
+ },
+ AnalyzeEntities: []gax.CallOption{
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnCodes([]codes.Code{
+ codes.Unavailable,
+ codes.DeadlineExceeded,
+ }, gax.Backoff{
+ Initial: 100 * time.Millisecond,
+ Max: 60000 * time.Millisecond,
+ Multiplier: 1.30,
+ })
+ }),
+ },
+ AnalyzeEntitySentiment: []gax.CallOption{
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnCodes([]codes.Code{
+ codes.Unavailable,
+ codes.DeadlineExceeded,
+ }, gax.Backoff{
+ Initial: 100 * time.Millisecond,
+ Max: 60000 * time.Millisecond,
+ Multiplier: 1.30,
+ })
+ }),
+ },
+ AnalyzeSyntax: []gax.CallOption{
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnCodes([]codes.Code{
+ codes.Unavailable,
+ codes.DeadlineExceeded,
+ }, gax.Backoff{
+ Initial: 100 * time.Millisecond,
+ Max: 60000 * time.Millisecond,
+ Multiplier: 1.30,
+ })
+ }),
+ },
+ ClassifyText: []gax.CallOption{
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnCodes([]codes.Code{
+ codes.Unavailable,
+ codes.DeadlineExceeded,
+ }, gax.Backoff{
+ Initial: 100 * time.Millisecond,
+ Max: 60000 * time.Millisecond,
+ Multiplier: 1.30,
+ })
+ }),
+ },
+ AnnotateText: []gax.CallOption{
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnCodes([]codes.Code{
+ codes.Unavailable,
+ codes.DeadlineExceeded,
+ }, gax.Backoff{
+ Initial: 100 * time.Millisecond,
+ Max: 60000 * time.Millisecond,
+ Multiplier: 1.30,
})
}),
},
}
- return &CallOptions{
- AnalyzeSentiment: retry[[2]string{"default", "idempotent"}],
- AnalyzeEntities: retry[[2]string{"default", "idempotent"}],
- AnalyzeEntitySentiment: retry[[2]string{"default", "idempotent"}],
- AnalyzeSyntax: retry[[2]string{"default", "idempotent"}],
- ClassifyText: retry[[2]string{"default", "idempotent"}],
- AnnotateText: retry[[2]string{"default", "idempotent"}],
- }
}
-// Client is a client for interacting with Google Cloud Natural Language API.
+// Client is a client for interacting with Cloud Natural Language API.
//
// Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
type Client struct {
@@ -107,6 +160,7 @@
client: languagepb.NewLanguageServiceClient(conn),
}
c.setGoogleClientInfo()
+
return c, nil
}
@@ -182,7 +236,7 @@
}
// AnalyzeSyntax analyzes the syntax of the text and provides sentence boundaries and
-// tokenization along with part of speech tags, dependency trees, and other
+// tokenization along with part-of-speech tags, dependency trees, and other
// properties.
func (c *Client) AnalyzeSyntax(ctx context.Context, req *languagepb.AnalyzeSyntaxRequest, opts ...gax.CallOption) (*languagepb.AnalyzeSyntaxResponse, error) {
ctx = insertMetadata(ctx, c.xGoogMetadata)
diff --git a/language/apiv1beta2/language_client_example_test.go b/language/apiv1beta2/language_client_example_test.go
index d35c265..5c726f8 100644
--- a/language/apiv1beta2/language_client_example_test.go
+++ b/language/apiv1beta2/language_client_example_test.go
@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-// Code generated by gapic-generator. DO NOT EDIT.
+// Code generated by protoc-gen-go_gapic. DO NOT EDIT.
package language_test
@@ -34,6 +34,8 @@
}
func ExampleClient_AnalyzeSentiment() {
+ // import languagepb "google.golang.org/genproto/googleapis/cloud/language/v1beta2"
+
ctx := context.Background()
c, err := language.NewClient(ctx)
if err != nil {
@@ -52,6 +54,8 @@
}
func ExampleClient_AnalyzeEntities() {
+ // import languagepb "google.golang.org/genproto/googleapis/cloud/language/v1beta2"
+
ctx := context.Background()
c, err := language.NewClient(ctx)
if err != nil {
@@ -70,6 +74,8 @@
}
func ExampleClient_AnalyzeEntitySentiment() {
+ // import languagepb "google.golang.org/genproto/googleapis/cloud/language/v1beta2"
+
ctx := context.Background()
c, err := language.NewClient(ctx)
if err != nil {
@@ -88,6 +94,8 @@
}
func ExampleClient_AnalyzeSyntax() {
+ // import languagepb "google.golang.org/genproto/googleapis/cloud/language/v1beta2"
+
ctx := context.Background()
c, err := language.NewClient(ctx)
if err != nil {
@@ -106,6 +114,8 @@
}
func ExampleClient_ClassifyText() {
+ // import languagepb "google.golang.org/genproto/googleapis/cloud/language/v1beta2"
+
ctx := context.Background()
c, err := language.NewClient(ctx)
if err != nil {
@@ -124,6 +134,8 @@
}
func ExampleClient_AnnotateText() {
+ // import languagepb "google.golang.org/genproto/googleapis/cloud/language/v1beta2"
+
ctx := context.Background()
c, err := language.NewClient(ctx)
if err != nil {
diff --git a/logging/apiv2/doc.go b/logging/apiv2/doc.go
index 599eccb..d08e5a0 100644
--- a/logging/apiv2/doc.go
+++ b/logging/apiv2/doc.go
@@ -106,4 +106,4 @@
return "UNKNOWN"
}
-const versionClient = "20191206"
+const versionClient = "20191216"
diff --git a/logging/go.mod b/logging/go.mod
index 1aeb201..a549745 100644
--- a/logging/go.mod
+++ b/logging/go.mod
@@ -12,8 +12,8 @@
golang.org/x/exp v0.0.0-20191129062945-2f5052295587 // indirect
golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f // indirect
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45
- golang.org/x/tools v0.0.0-20191206204035-259af5ff87bd // indirect
+ golang.org/x/tools v0.0.0-20191216173652-a0e659d51361 // indirect
google.golang.org/api v0.14.0
- google.golang.org/genproto v0.0.0-20191206224255-0243a4be9c8f
+ google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1
google.golang.org/grpc v1.21.1
)
diff --git a/logging/go.sum b/logging/go.sum
index 3b25cee..4c65789 100644
--- a/logging/go.sum
+++ b/logging/go.sum
@@ -59,6 +59,7 @@
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/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 h1:OeRHuibLsmZkFj773W4LcfAGsSxJgfPONhr8cmO+eLA=
@@ -83,6 +84,7 @@
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=
+golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg=
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=
@@ -136,9 +138,10 @@
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-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
-golang.org/x/tools v0.0.0-20191206204035-259af5ff87bd h1:Zc7EU2PqpsNeIfOoVA7hvQX4cS3YDJEs5KlfatT3hLo=
-golang.org/x/tools v0.0.0-20191206204035-259af5ff87bd/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
+golang.org/x/tools v0.0.0-20191216173652-a0e659d51361 h1:RIIXAeV6GvDBuADKumTODatUqANFZ+5BPMnzsy4hulY=
+golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
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=
google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE=
google.golang.org/api v0.7.0 h1:9sdfJOzWlkqPltHAuzT2Cp+yrBeY1KRVYgms8soxMwM=
google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M=
@@ -161,8 +164,8 @@
google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc=
google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51 h1:Ex1mq5jaJof+kRnYi3SlYJ8KKa9Ao3NHyIT5XJ1gF6U=
google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8=
-google.golang.org/genproto v0.0.0-20191206224255-0243a4be9c8f h1:naitw5DILWPQvG0oG04mR9jF8fmKpRdW3E3zzKA4D0Y=
-google.golang.org/genproto v0.0.0-20191206224255-0243a4be9c8f/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
+google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1 h1:aQktFqmDE2yjveXJlVIfslDFmFnUXSqG0i6KRcJAeMc=
+google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
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 h1:j6XxA85m/6txkUCHvzlV5f+HBNl/1r5cZ2A/3IEFOO8=
diff --git a/longrunning/autogen/doc.go b/longrunning/autogen/doc.go
index d07f95d..ea3c6a7 100644
--- a/longrunning/autogen/doc.go
+++ b/longrunning/autogen/doc.go
@@ -96,4 +96,4 @@
return "UNKNOWN"
}
-const versionClient = "20191206"
+const versionClient = "20191216"
diff --git a/monitoring/apiv3/doc.go b/monitoring/apiv3/doc.go
index d0ada9e..a9fa74d 100644
--- a/monitoring/apiv3/doc.go
+++ b/monitoring/apiv3/doc.go
@@ -105,4 +105,4 @@
return "UNKNOWN"
}
-const versionClient = "20191206"
+const versionClient = "20191216"
diff --git a/osconfig/agentendpoint/apiv1beta/agent_endpoint_client.go b/osconfig/agentendpoint/apiv1beta/agent_endpoint_client.go
new file mode 100644
index 0000000..0553e44
--- /dev/null
+++ b/osconfig/agentendpoint/apiv1beta/agent_endpoint_client.go
@@ -0,0 +1,196 @@
+// Copyright 2019 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 agentendpoint
+
+import (
+ "context"
+ "math"
+
+ gax "github.com/googleapis/gax-go/v2"
+ "google.golang.org/api/option"
+ "google.golang.org/api/transport"
+ agentendpointpb "google.golang.org/genproto/googleapis/cloud/osconfig/agentendpoint/v1beta"
+ "google.golang.org/grpc"
+ "google.golang.org/grpc/metadata"
+)
+
+// CallOptions contains the retry settings for each method of Client.
+type CallOptions struct {
+ ReceiveTaskNotification []gax.CallOption
+ StartNextTask []gax.CallOption
+ ReportTaskProgress []gax.CallOption
+ ReportTaskComplete []gax.CallOption
+ LookupEffectiveGuestPolicy []gax.CallOption
+}
+
+func defaultClientOptions() []option.ClientOption {
+ return []option.ClientOption{
+ option.WithEndpoint("osconfig.googleapis.com:443"),
+ option.WithGRPCDialOption(grpc.WithDisableServiceConfig()),
+ option.WithScopes(DefaultAuthScopes()...),
+ option.WithGRPCDialOption(grpc.WithDefaultCallOptions(
+ grpc.MaxCallRecvMsgSize(math.MaxInt32))),
+ }
+}
+
+func defaultCallOptions() *CallOptions {
+ return &CallOptions{
+ ReceiveTaskNotification: []gax.CallOption{},
+ StartNextTask: []gax.CallOption{},
+ ReportTaskProgress: []gax.CallOption{},
+ ReportTaskComplete: []gax.CallOption{},
+ LookupEffectiveGuestPolicy: []gax.CallOption{},
+ }
+}
+
+// Client is a client for interacting with Cloud OS Config API.
+//
+// Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
+type Client struct {
+ // The connection to the service.
+ conn *grpc.ClientConn
+
+ // The gRPC API client.
+ client agentendpointpb.AgentEndpointServiceClient
+
+ // The call options for this service.
+ CallOptions *CallOptions
+
+ // The x-goog-* metadata to be sent with each request.
+ xGoogMetadata metadata.MD
+}
+
+// NewClient creates a new agent endpoint service client.
+//
+// OS Config agent endpoint API.
+func NewClient(ctx context.Context, opts ...option.ClientOption) (*Client, error) {
+ conn, err := transport.DialGRPC(ctx, append(defaultClientOptions(), opts...)...)
+ if err != nil {
+ return nil, err
+ }
+ c := &Client{
+ conn: conn,
+ CallOptions: defaultCallOptions(),
+
+ client: agentendpointpb.NewAgentEndpointServiceClient(conn),
+ }
+ c.setGoogleClientInfo()
+
+ return c, nil
+}
+
+// Connection returns the client's connection to the API service.
+func (c *Client) Connection() *grpc.ClientConn {
+ return c.conn
+}
+
+// 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.conn.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) {
+ 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...))
+}
+
+// ReceiveTaskNotification stream established by client to receive Task notifications.
+func (c *Client) ReceiveTaskNotification(ctx context.Context, req *agentendpointpb.ReceiveTaskNotificationRequest, opts ...gax.CallOption) (agentendpointpb.AgentEndpointService_ReceiveTaskNotificationClient, error) {
+ ctx = insertMetadata(ctx, c.xGoogMetadata)
+ opts = append(c.CallOptions.ReceiveTaskNotification[0:len(c.CallOptions.ReceiveTaskNotification):len(c.CallOptions.ReceiveTaskNotification)], opts...)
+ var resp agentendpointpb.AgentEndpointService_ReceiveTaskNotificationClient
+ err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ var err error
+ resp, err = c.client.ReceiveTaskNotification(ctx, req, settings.GRPC...)
+ return err
+ }, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return resp, nil
+}
+
+// StartNextTask signals the start of a task execution and returns the task info.
+func (c *Client) StartNextTask(ctx context.Context, req *agentendpointpb.StartNextTaskRequest, opts ...gax.CallOption) (*agentendpointpb.StartNextTaskResponse, error) {
+ ctx = insertMetadata(ctx, c.xGoogMetadata)
+ opts = append(c.CallOptions.StartNextTask[0:len(c.CallOptions.StartNextTask):len(c.CallOptions.StartNextTask)], opts...)
+ var resp *agentendpointpb.StartNextTaskResponse
+ err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ var err error
+ resp, err = c.client.StartNextTask(ctx, req, settings.GRPC...)
+ return err
+ }, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return resp, nil
+}
+
+// ReportTaskProgress signals an intermediary progress checkpoint in task execution.
+func (c *Client) ReportTaskProgress(ctx context.Context, req *agentendpointpb.ReportTaskProgressRequest, opts ...gax.CallOption) (*agentendpointpb.ReportTaskProgressResponse, error) {
+ ctx = insertMetadata(ctx, c.xGoogMetadata)
+ opts = append(c.CallOptions.ReportTaskProgress[0:len(c.CallOptions.ReportTaskProgress):len(c.CallOptions.ReportTaskProgress)], opts...)
+ var resp *agentendpointpb.ReportTaskProgressResponse
+ err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ var err error
+ resp, err = c.client.ReportTaskProgress(ctx, req, settings.GRPC...)
+ return err
+ }, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return resp, nil
+}
+
+// ReportTaskComplete signals that the task execution is complete and optionally returns the next
+// task.
+func (c *Client) ReportTaskComplete(ctx context.Context, req *agentendpointpb.ReportTaskCompleteRequest, opts ...gax.CallOption) (*agentendpointpb.ReportTaskCompleteResponse, error) {
+ ctx = insertMetadata(ctx, c.xGoogMetadata)
+ opts = append(c.CallOptions.ReportTaskComplete[0:len(c.CallOptions.ReportTaskComplete):len(c.CallOptions.ReportTaskComplete)], opts...)
+ var resp *agentendpointpb.ReportTaskCompleteResponse
+ err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ var err error
+ resp, err = c.client.ReportTaskComplete(ctx, req, settings.GRPC...)
+ return err
+ }, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return resp, nil
+}
+
+// LookupEffectiveGuestPolicy lookup the effective guest policy that applies to a VM instance. This
+// lookup merges all policies that are assigned to the instance ancestry.
+func (c *Client) LookupEffectiveGuestPolicy(ctx context.Context, req *agentendpointpb.LookupEffectiveGuestPolicyRequest, opts ...gax.CallOption) (*agentendpointpb.EffectiveGuestPolicy, error) {
+ ctx = insertMetadata(ctx, c.xGoogMetadata)
+ opts = append(c.CallOptions.LookupEffectiveGuestPolicy[0:len(c.CallOptions.LookupEffectiveGuestPolicy):len(c.CallOptions.LookupEffectiveGuestPolicy)], opts...)
+ var resp *agentendpointpb.EffectiveGuestPolicy
+ err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ var err error
+ resp, err = c.client.LookupEffectiveGuestPolicy(ctx, req, settings.GRPC...)
+ return err
+ }, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return resp, nil
+}
diff --git a/osconfig/agentendpoint/apiv1beta/agent_endpoint_client_example_test.go b/osconfig/agentendpoint/apiv1beta/agent_endpoint_client_example_test.go
new file mode 100644
index 0000000..89654cb
--- /dev/null
+++ b/osconfig/agentendpoint/apiv1beta/agent_endpoint_client_example_test.go
@@ -0,0 +1,114 @@
+// Copyright 2019 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 agentendpoint_test
+
+import (
+ "context"
+
+ agentendpoint "cloud.google.com/go/osconfig/agentendpoint/apiv1beta"
+ agentendpointpb "google.golang.org/genproto/googleapis/cloud/osconfig/agentendpoint/v1beta"
+)
+
+func ExampleNewClient() {
+ ctx := context.Background()
+ c, err := agentendpoint.NewClient(ctx)
+ if err != nil {
+ // TODO: Handle error.
+ }
+ // TODO: Use client.
+ _ = c
+}
+
+func ExampleClient_StartNextTask() {
+ // import agentendpointpb "google.golang.org/genproto/googleapis/cloud/osconfig/agentendpoint/v1beta"
+
+ ctx := context.Background()
+ c, err := agentendpoint.NewClient(ctx)
+ if err != nil {
+ // TODO: Handle error.
+ }
+
+ req := &agentendpointpb.StartNextTaskRequest{
+ // TODO: Fill request struct fields.
+ }
+ resp, err := c.StartNextTask(ctx, req)
+ if err != nil {
+ // TODO: Handle error.
+ }
+ // TODO: Use resp.
+ _ = resp
+}
+
+func ExampleClient_ReportTaskProgress() {
+ // import agentendpointpb "google.golang.org/genproto/googleapis/cloud/osconfig/agentendpoint/v1beta"
+
+ ctx := context.Background()
+ c, err := agentendpoint.NewClient(ctx)
+ if err != nil {
+ // TODO: Handle error.
+ }
+
+ req := &agentendpointpb.ReportTaskProgressRequest{
+ // TODO: Fill request struct fields.
+ }
+ resp, err := c.ReportTaskProgress(ctx, req)
+ if err != nil {
+ // TODO: Handle error.
+ }
+ // TODO: Use resp.
+ _ = resp
+}
+
+func ExampleClient_ReportTaskComplete() {
+ // import agentendpointpb "google.golang.org/genproto/googleapis/cloud/osconfig/agentendpoint/v1beta"
+
+ ctx := context.Background()
+ c, err := agentendpoint.NewClient(ctx)
+ if err != nil {
+ // TODO: Handle error.
+ }
+
+ req := &agentendpointpb.ReportTaskCompleteRequest{
+ // TODO: Fill request struct fields.
+ }
+ resp, err := c.ReportTaskComplete(ctx, req)
+ if err != nil {
+ // TODO: Handle error.
+ }
+ // TODO: Use resp.
+ _ = resp
+}
+
+func ExampleClient_LookupEffectiveGuestPolicy() {
+ // import agentendpointpb "google.golang.org/genproto/googleapis/cloud/osconfig/agentendpoint/v1beta"
+
+ ctx := context.Background()
+ c, err := agentendpoint.NewClient(ctx)
+ if err != nil {
+ // TODO: Handle error.
+ }
+
+ req := &agentendpointpb.LookupEffectiveGuestPolicyRequest{
+ // TODO: Fill request struct fields.
+ }
+ resp, err := c.LookupEffectiveGuestPolicy(ctx, req)
+ if err != nil {
+ // TODO: Handle error.
+ }
+ // TODO: Use resp.
+ _ = resp
+}
diff --git a/osconfig/agentendpoint/apiv1beta/doc.go b/osconfig/agentendpoint/apiv1beta/doc.go
new file mode 100644
index 0000000..3fc4819
--- /dev/null
+++ b/osconfig/agentendpoint/apiv1beta/doc.go
@@ -0,0 +1,100 @@
+// Copyright 2019 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 agentendpoint is an auto-generated package for the
+// Cloud OS Config API.
+//
+// OS management tools that can be used for patch management, patch
+// compliance, and configuration management on VM instances.
+//
+// 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 godoc.org/cloud.google.com/go.
+
+package agentendpoint // import "cloud.google.com/go/osconfig/agentendpoint/apiv1beta"
+
+import (
+ "context"
+ "runtime"
+ "strings"
+ "unicode"
+
+ "google.golang.org/grpc/metadata"
+)
+
+const versionClient = "20191216"
+
+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)
+}
+
+// DefaultAuthScopes reports the default set of authentication scopes to use with this package.
+func DefaultAuthScopes() []string {
+ return []string{}
+}
+
+// versionGo returns the Go runtime version. The returned string
+// has no whitespace, suitable for reporting in header.
+func versionGo() string {
+ const develPrefix = "devel +"
+
+ s := runtime.Version()
+ if strings.HasPrefix(s, develPrefix) {
+ s = s[len(develPrefix):]
+ if p := strings.IndexFunc(s, unicode.IsSpace); p >= 0 {
+ s = s[:p]
+ }
+ return s
+ }
+
+ notSemverRune := func(r rune) bool {
+ return !strings.ContainsRune("0123456789.", r)
+ }
+
+ if strings.HasPrefix(s, "go1") {
+ s = s[2:]
+ var prerelease string
+ if p := strings.IndexFunc(s, notSemverRune); p >= 0 {
+ s, prerelease = s[:p], s[p:]
+ }
+ if strings.HasSuffix(s, ".") {
+ s += "0"
+ } else if strings.Count(s, ".") < 2 {
+ s += ".0"
+ }
+ if prerelease != "" {
+ s += "-" + prerelease
+ }
+ return s
+ }
+ return "UNKNOWN"
+}
diff --git a/osconfig/apiv1beta/doc.go b/osconfig/apiv1beta/doc.go
new file mode 100644
index 0000000..c560cc2
--- /dev/null
+++ b/osconfig/apiv1beta/doc.go
@@ -0,0 +1,103 @@
+// Copyright 2019 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 osconfig is an auto-generated package for the
+// Cloud OS Config API.
+//
+// OS management tools that can be used for patch management, patch
+// compliance, and configuration management on VM instances.
+//
+// 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 godoc.org/cloud.google.com/go.
+
+package osconfig // import "cloud.google.com/go/osconfig/apiv1beta"
+
+import (
+ "context"
+ "runtime"
+ "strings"
+ "unicode"
+
+ "google.golang.org/grpc/metadata"
+)
+
+const versionClient = "20191216"
+
+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)
+}
+
+// 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",
+ }
+}
+
+// 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/osconfig/apiv1beta/os_config_client.go b/osconfig/apiv1beta/os_config_client.go
new file mode 100644
index 0000000..1704a48
--- /dev/null
+++ b/osconfig/apiv1beta/os_config_client.go
@@ -0,0 +1,675 @@
+// Copyright 2019 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 osconfig
+
+import (
+ "context"
+ "fmt"
+ "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"
+ "google.golang.org/api/transport"
+ osconfigpb "google.golang.org/genproto/googleapis/cloud/osconfig/v1beta"
+ "google.golang.org/grpc"
+ "google.golang.org/grpc/metadata"
+)
+
+// CallOptions contains the retry settings for each method of Client.
+type CallOptions struct {
+ ExecutePatchJob []gax.CallOption
+ GetPatchJob []gax.CallOption
+ CancelPatchJob []gax.CallOption
+ ListPatchJobs []gax.CallOption
+ ListPatchJobInstanceDetails []gax.CallOption
+ CreatePatchDeployment []gax.CallOption
+ GetPatchDeployment []gax.CallOption
+ ListPatchDeployments []gax.CallOption
+ DeletePatchDeployment []gax.CallOption
+ CreateGuestPolicy []gax.CallOption
+ GetGuestPolicy []gax.CallOption
+ ListGuestPolicies []gax.CallOption
+ UpdateGuestPolicy []gax.CallOption
+ DeleteGuestPolicy []gax.CallOption
+ LookupEffectiveGuestPolicy []gax.CallOption
+}
+
+func defaultClientOptions() []option.ClientOption {
+ return []option.ClientOption{
+ option.WithEndpoint("osconfig.googleapis.com:443"),
+ option.WithGRPCDialOption(grpc.WithDisableServiceConfig()),
+ option.WithScopes(DefaultAuthScopes()...),
+ option.WithGRPCDialOption(grpc.WithDefaultCallOptions(
+ grpc.MaxCallRecvMsgSize(math.MaxInt32))),
+ }
+}
+
+func defaultCallOptions() *CallOptions {
+ return &CallOptions{
+ ExecutePatchJob: []gax.CallOption{},
+ GetPatchJob: []gax.CallOption{},
+ CancelPatchJob: []gax.CallOption{},
+ ListPatchJobs: []gax.CallOption{},
+ ListPatchJobInstanceDetails: []gax.CallOption{},
+ CreatePatchDeployment: []gax.CallOption{},
+ GetPatchDeployment: []gax.CallOption{},
+ ListPatchDeployments: []gax.CallOption{},
+ DeletePatchDeployment: []gax.CallOption{},
+ CreateGuestPolicy: []gax.CallOption{},
+ GetGuestPolicy: []gax.CallOption{},
+ ListGuestPolicies: []gax.CallOption{},
+ UpdateGuestPolicy: []gax.CallOption{},
+ DeleteGuestPolicy: []gax.CallOption{},
+ LookupEffectiveGuestPolicy: []gax.CallOption{},
+ }
+}
+
+// Client is a client for interacting with Cloud OS Config API.
+//
+// Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
+type Client struct {
+ // The connection to the service.
+ conn *grpc.ClientConn
+
+ // The gRPC API client.
+ client osconfigpb.OsConfigServiceClient
+
+ // The call options for this service.
+ CallOptions *CallOptions
+
+ // The x-goog-* metadata to be sent with each request.
+ xGoogMetadata metadata.MD
+}
+
+// NewClient creates a new os config service client.
+//
+// OS Config API
+//
+// The OS Config service is a server-side component that you can use to
+// manage package installations and patch jobs for virtual machine instances.
+func NewClient(ctx context.Context, opts ...option.ClientOption) (*Client, error) {
+ conn, err := transport.DialGRPC(ctx, append(defaultClientOptions(), opts...)...)
+ if err != nil {
+ return nil, err
+ }
+ c := &Client{
+ conn: conn,
+ CallOptions: defaultCallOptions(),
+
+ client: osconfigpb.NewOsConfigServiceClient(conn),
+ }
+ c.setGoogleClientInfo()
+
+ return c, nil
+}
+
+// Connection returns the client's connection to the API service.
+func (c *Client) Connection() *grpc.ClientConn {
+ return c.conn
+}
+
+// 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.conn.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) {
+ 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...))
+}
+
+// ExecutePatchJob patch VM instances by creating and running a patch job.
+func (c *Client) ExecutePatchJob(ctx context.Context, req *osconfigpb.ExecutePatchJobRequest, opts ...gax.CallOption) (*osconfigpb.PatchJob, 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.ExecutePatchJob[0:len(c.CallOptions.ExecutePatchJob):len(c.CallOptions.ExecutePatchJob)], opts...)
+ var resp *osconfigpb.PatchJob
+ err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ var err error
+ resp, err = c.client.ExecutePatchJob(ctx, req, settings.GRPC...)
+ return err
+ }, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return resp, nil
+}
+
+// GetPatchJob get the patch job. This can be used to track the progress of an
+// ongoing patch job or review the details of completed jobs.
+func (c *Client) GetPatchJob(ctx context.Context, req *osconfigpb.GetPatchJobRequest, opts ...gax.CallOption) (*osconfigpb.PatchJob, 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.GetPatchJob[0:len(c.CallOptions.GetPatchJob):len(c.CallOptions.GetPatchJob)], opts...)
+ var resp *osconfigpb.PatchJob
+ err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ var err error
+ resp, err = c.client.GetPatchJob(ctx, req, settings.GRPC...)
+ return err
+ }, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return resp, nil
+}
+
+// CancelPatchJob cancel a patch job. The patch job must be active. Canceled patch jobs
+// cannot be restarted.
+func (c *Client) CancelPatchJob(ctx context.Context, req *osconfigpb.CancelPatchJobRequest, opts ...gax.CallOption) (*osconfigpb.PatchJob, 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.CancelPatchJob[0:len(c.CallOptions.CancelPatchJob):len(c.CallOptions.CancelPatchJob)], opts...)
+ var resp *osconfigpb.PatchJob
+ err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ var err error
+ resp, err = c.client.CancelPatchJob(ctx, req, settings.GRPC...)
+ return err
+ }, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return resp, nil
+}
+
+// ListPatchJobs get a list of patch jobs.
+func (c *Client) ListPatchJobs(ctx context.Context, req *osconfigpb.ListPatchJobsRequest, opts ...gax.CallOption) *PatchJobIterator {
+ 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.ListPatchJobs[0:len(c.CallOptions.ListPatchJobs):len(c.CallOptions.ListPatchJobs)], opts...)
+ it := &PatchJobIterator{}
+ req = proto.Clone(req).(*osconfigpb.ListPatchJobsRequest)
+ it.InternalFetch = func(pageSize int, pageToken string) ([]*osconfigpb.PatchJob, string, error) {
+ var resp *osconfigpb.ListPatchJobsResponse
+ 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.ListPatchJobs(ctx, req, settings.GRPC...)
+ return err
+ }, opts...)
+ if err != nil {
+ return nil, "", err
+ }
+
+ it.Response = resp
+ return resp.PatchJobs, resp.NextPageToken, 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.PageSize)
+ it.pageInfo.Token = req.PageToken
+ return it
+}
+
+// ListPatchJobInstanceDetails get a list of instance details for a given patch job.
+func (c *Client) ListPatchJobInstanceDetails(ctx context.Context, req *osconfigpb.ListPatchJobInstanceDetailsRequest, opts ...gax.CallOption) *PatchJobInstanceDetailsIterator {
+ 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.ListPatchJobInstanceDetails[0:len(c.CallOptions.ListPatchJobInstanceDetails):len(c.CallOptions.ListPatchJobInstanceDetails)], opts...)
+ it := &PatchJobInstanceDetailsIterator{}
+ req = proto.Clone(req).(*osconfigpb.ListPatchJobInstanceDetailsRequest)
+ it.InternalFetch = func(pageSize int, pageToken string) ([]*osconfigpb.PatchJobInstanceDetails, string, error) {
+ var resp *osconfigpb.ListPatchJobInstanceDetailsResponse
+ 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.ListPatchJobInstanceDetails(ctx, req, settings.GRPC...)
+ return err
+ }, opts...)
+ if err != nil {
+ return nil, "", err
+ }
+
+ it.Response = resp
+ return resp.PatchJobInstanceDetails, resp.NextPageToken, 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.PageSize)
+ it.pageInfo.Token = req.PageToken
+ return it
+}
+
+// CreatePatchDeployment create an OS Config patch deployment.
+func (c *Client) CreatePatchDeployment(ctx context.Context, req *osconfigpb.CreatePatchDeploymentRequest, opts ...gax.CallOption) (*osconfigpb.PatchDeployment, 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.CreatePatchDeployment[0:len(c.CallOptions.CreatePatchDeployment):len(c.CallOptions.CreatePatchDeployment)], opts...)
+ var resp *osconfigpb.PatchDeployment
+ err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ var err error
+ resp, err = c.client.CreatePatchDeployment(ctx, req, settings.GRPC...)
+ return err
+ }, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return resp, nil
+}
+
+// GetPatchDeployment get an OS Config patch deployment.
+func (c *Client) GetPatchDeployment(ctx context.Context, req *osconfigpb.GetPatchDeploymentRequest, opts ...gax.CallOption) (*osconfigpb.PatchDeployment, 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.GetPatchDeployment[0:len(c.CallOptions.GetPatchDeployment):len(c.CallOptions.GetPatchDeployment)], opts...)
+ var resp *osconfigpb.PatchDeployment
+ err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ var err error
+ resp, err = c.client.GetPatchDeployment(ctx, req, settings.GRPC...)
+ return err
+ }, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return resp, nil
+}
+
+// ListPatchDeployments get a page of OS Config patch deployments.
+func (c *Client) ListPatchDeployments(ctx context.Context, req *osconfigpb.ListPatchDeploymentsRequest, opts ...gax.CallOption) *PatchDeploymentIterator {
+ 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.ListPatchDeployments[0:len(c.CallOptions.ListPatchDeployments):len(c.CallOptions.ListPatchDeployments)], opts...)
+ it := &PatchDeploymentIterator{}
+ req = proto.Clone(req).(*osconfigpb.ListPatchDeploymentsRequest)
+ it.InternalFetch = func(pageSize int, pageToken string) ([]*osconfigpb.PatchDeployment, string, error) {
+ var resp *osconfigpb.ListPatchDeploymentsResponse
+ 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.ListPatchDeployments(ctx, req, settings.GRPC...)
+ return err
+ }, opts...)
+ if err != nil {
+ return nil, "", err
+ }
+
+ it.Response = resp
+ return resp.PatchDeployments, resp.NextPageToken, 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.PageSize)
+ it.pageInfo.Token = req.PageToken
+ return it
+}
+
+// DeletePatchDeployment delete an OS Config patch deployment.
+func (c *Client) DeletePatchDeployment(ctx context.Context, req *osconfigpb.DeletePatchDeploymentRequest, opts ...gax.CallOption) 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.DeletePatchDeployment[0:len(c.CallOptions.DeletePatchDeployment):len(c.CallOptions.DeletePatchDeployment)], opts...)
+ err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ var err error
+ _, err = c.client.DeletePatchDeployment(ctx, req, settings.GRPC...)
+ return err
+ }, opts...)
+ return err
+}
+
+// CreateGuestPolicy create an OS Config guest policy.
+func (c *Client) CreateGuestPolicy(ctx context.Context, req *osconfigpb.CreateGuestPolicyRequest, opts ...gax.CallOption) (*osconfigpb.GuestPolicy, 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.CreateGuestPolicy[0:len(c.CallOptions.CreateGuestPolicy):len(c.CallOptions.CreateGuestPolicy)], opts...)
+ var resp *osconfigpb.GuestPolicy
+ err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ var err error
+ resp, err = c.client.CreateGuestPolicy(ctx, req, settings.GRPC...)
+ return err
+ }, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return resp, nil
+}
+
+// GetGuestPolicy get an OS Config guest policy.
+func (c *Client) GetGuestPolicy(ctx context.Context, req *osconfigpb.GetGuestPolicyRequest, opts ...gax.CallOption) (*osconfigpb.GuestPolicy, 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.GetGuestPolicy[0:len(c.CallOptions.GetGuestPolicy):len(c.CallOptions.GetGuestPolicy)], opts...)
+ var resp *osconfigpb.GuestPolicy
+ err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ var err error
+ resp, err = c.client.GetGuestPolicy(ctx, req, settings.GRPC...)
+ return err
+ }, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return resp, nil
+}
+
+// ListGuestPolicies get a page of OS Config guest policies.
+func (c *Client) ListGuestPolicies(ctx context.Context, req *osconfigpb.ListGuestPoliciesRequest, opts ...gax.CallOption) *GuestPolicyIterator {
+ 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.ListGuestPolicies[0:len(c.CallOptions.ListGuestPolicies):len(c.CallOptions.ListGuestPolicies)], opts...)
+ it := &GuestPolicyIterator{}
+ req = proto.Clone(req).(*osconfigpb.ListGuestPoliciesRequest)
+ it.InternalFetch = func(pageSize int, pageToken string) ([]*osconfigpb.GuestPolicy, string, error) {
+ var resp *osconfigpb.ListGuestPoliciesResponse
+ 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.ListGuestPolicies(ctx, req, settings.GRPC...)
+ return err
+ }, opts...)
+ if err != nil {
+ return nil, "", err
+ }
+
+ it.Response = resp
+ return resp.GuestPolicies, resp.NextPageToken, 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.PageSize)
+ it.pageInfo.Token = req.PageToken
+ return it
+}
+
+// UpdateGuestPolicy update an OS Config guest policy.
+func (c *Client) UpdateGuestPolicy(ctx context.Context, req *osconfigpb.UpdateGuestPolicyRequest, opts ...gax.CallOption) (*osconfigpb.GuestPolicy, error) {
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "guest_policy.name", url.QueryEscape(req.GetGuestPolicy().GetName())))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
+ opts = append(c.CallOptions.UpdateGuestPolicy[0:len(c.CallOptions.UpdateGuestPolicy):len(c.CallOptions.UpdateGuestPolicy)], opts...)
+ var resp *osconfigpb.GuestPolicy
+ err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ var err error
+ resp, err = c.client.UpdateGuestPolicy(ctx, req, settings.GRPC...)
+ return err
+ }, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return resp, nil
+}
+
+// DeleteGuestPolicy delete an OS Config guest policy.
+func (c *Client) DeleteGuestPolicy(ctx context.Context, req *osconfigpb.DeleteGuestPolicyRequest, opts ...gax.CallOption) 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.DeleteGuestPolicy[0:len(c.CallOptions.DeleteGuestPolicy):len(c.CallOptions.DeleteGuestPolicy)], opts...)
+ err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ var err error
+ _, err = c.client.DeleteGuestPolicy(ctx, req, settings.GRPC...)
+ return err
+ }, opts...)
+ return err
+}
+
+// LookupEffectiveGuestPolicy lookup the effective guest policy that applies to a VM instance. This
+// lookup merges all policies that are assigned to the instance ancestry.
+func (c *Client) LookupEffectiveGuestPolicy(ctx context.Context, req *osconfigpb.LookupEffectiveGuestPolicyRequest, opts ...gax.CallOption) (*osconfigpb.EffectiveGuestPolicy, error) {
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "instance", url.QueryEscape(req.GetInstance())))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
+ opts = append(c.CallOptions.LookupEffectiveGuestPolicy[0:len(c.CallOptions.LookupEffectiveGuestPolicy):len(c.CallOptions.LookupEffectiveGuestPolicy)], opts...)
+ var resp *osconfigpb.EffectiveGuestPolicy
+ err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ var err error
+ resp, err = c.client.LookupEffectiveGuestPolicy(ctx, req, settings.GRPC...)
+ return err
+ }, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return resp, nil
+}
+
+// GuestPolicyIterator manages a stream of *osconfigpb.GuestPolicy.
+type GuestPolicyIterator struct {
+ items []*osconfigpb.GuestPolicy
+ 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 []*osconfigpb.GuestPolicy, nextPageToken string, err error)
+}
+
+// PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
+func (it *GuestPolicyIterator) 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 *GuestPolicyIterator) Next() (*osconfigpb.GuestPolicy, error) {
+ var item *osconfigpb.GuestPolicy
+ if err := it.nextFunc(); err != nil {
+ return item, err
+ }
+ item = it.items[0]
+ it.items = it.items[1:]
+ return item, nil
+}
+
+func (it *GuestPolicyIterator) bufLen() int {
+ return len(it.items)
+}
+
+func (it *GuestPolicyIterator) takeBuf() interface{} {
+ b := it.items
+ it.items = nil
+ return b
+}
+
+// PatchDeploymentIterator manages a stream of *osconfigpb.PatchDeployment.
+type PatchDeploymentIterator struct {
+ items []*osconfigpb.PatchDeployment
+ 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 []*osconfigpb.PatchDeployment, nextPageToken string, err error)
+}
+
+// PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
+func (it *PatchDeploymentIterator) 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 *PatchDeploymentIterator) Next() (*osconfigpb.PatchDeployment, error) {
+ var item *osconfigpb.PatchDeployment
+ if err := it.nextFunc(); err != nil {
+ return item, err
+ }
+ item = it.items[0]
+ it.items = it.items[1:]
+ return item, nil
+}
+
+func (it *PatchDeploymentIterator) bufLen() int {
+ return len(it.items)
+}
+
+func (it *PatchDeploymentIterator) takeBuf() interface{} {
+ b := it.items
+ it.items = nil
+ return b
+}
+
+// PatchJobInstanceDetailsIterator manages a stream of *osconfigpb.PatchJobInstanceDetails.
+type PatchJobInstanceDetailsIterator struct {
+ items []*osconfigpb.PatchJobInstanceDetails
+ 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 []*osconfigpb.PatchJobInstanceDetails, nextPageToken string, err error)
+}
+
+// PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
+func (it *PatchJobInstanceDetailsIterator) 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 *PatchJobInstanceDetailsIterator) Next() (*osconfigpb.PatchJobInstanceDetails, error) {
+ var item *osconfigpb.PatchJobInstanceDetails
+ if err := it.nextFunc(); err != nil {
+ return item, err
+ }
+ item = it.items[0]
+ it.items = it.items[1:]
+ return item, nil
+}
+
+func (it *PatchJobInstanceDetailsIterator) bufLen() int {
+ return len(it.items)
+}
+
+func (it *PatchJobInstanceDetailsIterator) takeBuf() interface{} {
+ b := it.items
+ it.items = nil
+ return b
+}
+
+// PatchJobIterator manages a stream of *osconfigpb.PatchJob.
+type PatchJobIterator struct {
+ items []*osconfigpb.PatchJob
+ 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 []*osconfigpb.PatchJob, nextPageToken string, err error)
+}
+
+// PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
+func (it *PatchJobIterator) 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 *PatchJobIterator) Next() (*osconfigpb.PatchJob, error) {
+ var item *osconfigpb.PatchJob
+ if err := it.nextFunc(); err != nil {
+ return item, err
+ }
+ item = it.items[0]
+ it.items = it.items[1:]
+ return item, nil
+}
+
+func (it *PatchJobIterator) bufLen() int {
+ return len(it.items)
+}
+
+func (it *PatchJobIterator) takeBuf() interface{} {
+ b := it.items
+ it.items = nil
+ return b
+}
diff --git a/osconfig/apiv1beta/os_config_client_example_test.go b/osconfig/apiv1beta/os_config_client_example_test.go
new file mode 100644
index 0000000..cb0cebb
--- /dev/null
+++ b/osconfig/apiv1beta/os_config_client_example_test.go
@@ -0,0 +1,355 @@
+// Copyright 2019 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 osconfig_test
+
+import (
+ "context"
+
+ osconfig "cloud.google.com/go/osconfig/apiv1beta"
+ "google.golang.org/api/iterator"
+ osconfigpb "google.golang.org/genproto/googleapis/cloud/osconfig/v1beta"
+)
+
+func ExampleNewClient() {
+ ctx := context.Background()
+ c, err := osconfig.NewClient(ctx)
+ if err != nil {
+ // TODO: Handle error.
+ }
+ // TODO: Use client.
+ _ = c
+}
+
+func ExampleClient_ExecutePatchJob() {
+ // import osconfigpb "google.golang.org/genproto/googleapis/cloud/osconfig/v1beta"
+
+ ctx := context.Background()
+ c, err := osconfig.NewClient(ctx)
+ if err != nil {
+ // TODO: Handle error.
+ }
+
+ req := &osconfigpb.ExecutePatchJobRequest{
+ // TODO: Fill request struct fields.
+ }
+ resp, err := c.ExecutePatchJob(ctx, req)
+ if err != nil {
+ // TODO: Handle error.
+ }
+ // TODO: Use resp.
+ _ = resp
+}
+
+func ExampleClient_GetPatchJob() {
+ // import osconfigpb "google.golang.org/genproto/googleapis/cloud/osconfig/v1beta"
+
+ ctx := context.Background()
+ c, err := osconfig.NewClient(ctx)
+ if err != nil {
+ // TODO: Handle error.
+ }
+
+ req := &osconfigpb.GetPatchJobRequest{
+ // TODO: Fill request struct fields.
+ }
+ resp, err := c.GetPatchJob(ctx, req)
+ if err != nil {
+ // TODO: Handle error.
+ }
+ // TODO: Use resp.
+ _ = resp
+}
+
+func ExampleClient_CancelPatchJob() {
+ // import osconfigpb "google.golang.org/genproto/googleapis/cloud/osconfig/v1beta"
+
+ ctx := context.Background()
+ c, err := osconfig.NewClient(ctx)
+ if err != nil {
+ // TODO: Handle error.
+ }
+
+ req := &osconfigpb.CancelPatchJobRequest{
+ // TODO: Fill request struct fields.
+ }
+ resp, err := c.CancelPatchJob(ctx, req)
+ if err != nil {
+ // TODO: Handle error.
+ }
+ // TODO: Use resp.
+ _ = resp
+}
+
+func ExampleClient_ListPatchJobs() {
+ // import osconfigpb "google.golang.org/genproto/googleapis/cloud/osconfig/v1beta"
+ // import "google.golang.org/api/iterator"
+
+ ctx := context.Background()
+ c, err := osconfig.NewClient(ctx)
+ if err != nil {
+ // TODO: Handle error.
+ }
+
+ req := &osconfigpb.ListPatchJobsRequest{
+ // TODO: Fill request struct fields.
+ }
+ it := c.ListPatchJobs(ctx, req)
+ for {
+ resp, err := it.Next()
+ if err == iterator.Done {
+ break
+ }
+ if err != nil {
+ // TODO: Handle error.
+ }
+ // TODO: Use resp.
+ _ = resp
+ }
+}
+
+func ExampleClient_ListPatchJobInstanceDetails() {
+ // import osconfigpb "google.golang.org/genproto/googleapis/cloud/osconfig/v1beta"
+ // import "google.golang.org/api/iterator"
+
+ ctx := context.Background()
+ c, err := osconfig.NewClient(ctx)
+ if err != nil {
+ // TODO: Handle error.
+ }
+
+ req := &osconfigpb.ListPatchJobInstanceDetailsRequest{
+ // TODO: Fill request struct fields.
+ }
+ it := c.ListPatchJobInstanceDetails(ctx, req)
+ for {
+ resp, err := it.Next()
+ if err == iterator.Done {
+ break
+ }
+ if err != nil {
+ // TODO: Handle error.
+ }
+ // TODO: Use resp.
+ _ = resp
+ }
+}
+
+func ExampleClient_CreatePatchDeployment() {
+ // import osconfigpb "google.golang.org/genproto/googleapis/cloud/osconfig/v1beta"
+
+ ctx := context.Background()
+ c, err := osconfig.NewClient(ctx)
+ if err != nil {
+ // TODO: Handle error.
+ }
+
+ req := &osconfigpb.CreatePatchDeploymentRequest{
+ // TODO: Fill request struct fields.
+ }
+ resp, err := c.CreatePatchDeployment(ctx, req)
+ if err != nil {
+ // TODO: Handle error.
+ }
+ // TODO: Use resp.
+ _ = resp
+}
+
+func ExampleClient_GetPatchDeployment() {
+ // import osconfigpb "google.golang.org/genproto/googleapis/cloud/osconfig/v1beta"
+
+ ctx := context.Background()
+ c, err := osconfig.NewClient(ctx)
+ if err != nil {
+ // TODO: Handle error.
+ }
+
+ req := &osconfigpb.GetPatchDeploymentRequest{
+ // TODO: Fill request struct fields.
+ }
+ resp, err := c.GetPatchDeployment(ctx, req)
+ if err != nil {
+ // TODO: Handle error.
+ }
+ // TODO: Use resp.
+ _ = resp
+}
+
+func ExampleClient_ListPatchDeployments() {
+ // import osconfigpb "google.golang.org/genproto/googleapis/cloud/osconfig/v1beta"
+ // import "google.golang.org/api/iterator"
+
+ ctx := context.Background()
+ c, err := osconfig.NewClient(ctx)
+ if err != nil {
+ // TODO: Handle error.
+ }
+
+ req := &osconfigpb.ListPatchDeploymentsRequest{
+ // TODO: Fill request struct fields.
+ }
+ it := c.ListPatchDeployments(ctx, req)
+ for {
+ resp, err := it.Next()
+ if err == iterator.Done {
+ break
+ }
+ if err != nil {
+ // TODO: Handle error.
+ }
+ // TODO: Use resp.
+ _ = resp
+ }
+}
+
+func ExampleClient_DeletePatchDeployment() {
+ ctx := context.Background()
+ c, err := osconfig.NewClient(ctx)
+ if err != nil {
+ // TODO: Handle error.
+ }
+
+ req := &osconfigpb.DeletePatchDeploymentRequest{
+ // TODO: Fill request struct fields.
+ }
+ err = c.DeletePatchDeployment(ctx, req)
+ if err != nil {
+ // TODO: Handle error.
+ }
+}
+
+func ExampleClient_CreateGuestPolicy() {
+ // import osconfigpb "google.golang.org/genproto/googleapis/cloud/osconfig/v1beta"
+
+ ctx := context.Background()
+ c, err := osconfig.NewClient(ctx)
+ if err != nil {
+ // TODO: Handle error.
+ }
+
+ req := &osconfigpb.CreateGuestPolicyRequest{
+ // TODO: Fill request struct fields.
+ }
+ resp, err := c.CreateGuestPolicy(ctx, req)
+ if err != nil {
+ // TODO: Handle error.
+ }
+ // TODO: Use resp.
+ _ = resp
+}
+
+func ExampleClient_GetGuestPolicy() {
+ // import osconfigpb "google.golang.org/genproto/googleapis/cloud/osconfig/v1beta"
+
+ ctx := context.Background()
+ c, err := osconfig.NewClient(ctx)
+ if err != nil {
+ // TODO: Handle error.
+ }
+
+ req := &osconfigpb.GetGuestPolicyRequest{
+ // TODO: Fill request struct fields.
+ }
+ resp, err := c.GetGuestPolicy(ctx, req)
+ if err != nil {
+ // TODO: Handle error.
+ }
+ // TODO: Use resp.
+ _ = resp
+}
+
+func ExampleClient_ListGuestPolicies() {
+ // import osconfigpb "google.golang.org/genproto/googleapis/cloud/osconfig/v1beta"
+ // import "google.golang.org/api/iterator"
+
+ ctx := context.Background()
+ c, err := osconfig.NewClient(ctx)
+ if err != nil {
+ // TODO: Handle error.
+ }
+
+ req := &osconfigpb.ListGuestPoliciesRequest{
+ // TODO: Fill request struct fields.
+ }
+ it := c.ListGuestPolicies(ctx, req)
+ for {
+ resp, err := it.Next()
+ if err == iterator.Done {
+ break
+ }
+ if err != nil {
+ // TODO: Handle error.
+ }
+ // TODO: Use resp.
+ _ = resp
+ }
+}
+
+func ExampleClient_UpdateGuestPolicy() {
+ // import osconfigpb "google.golang.org/genproto/googleapis/cloud/osconfig/v1beta"
+
+ ctx := context.Background()
+ c, err := osconfig.NewClient(ctx)
+ if err != nil {
+ // TODO: Handle error.
+ }
+
+ req := &osconfigpb.UpdateGuestPolicyRequest{
+ // TODO: Fill request struct fields.
+ }
+ resp, err := c.UpdateGuestPolicy(ctx, req)
+ if err != nil {
+ // TODO: Handle error.
+ }
+ // TODO: Use resp.
+ _ = resp
+}
+
+func ExampleClient_DeleteGuestPolicy() {
+ ctx := context.Background()
+ c, err := osconfig.NewClient(ctx)
+ if err != nil {
+ // TODO: Handle error.
+ }
+
+ req := &osconfigpb.DeleteGuestPolicyRequest{
+ // TODO: Fill request struct fields.
+ }
+ err = c.DeleteGuestPolicy(ctx, req)
+ if err != nil {
+ // TODO: Handle error.
+ }
+}
+
+func ExampleClient_LookupEffectiveGuestPolicy() {
+ // import osconfigpb "google.golang.org/genproto/googleapis/cloud/osconfig/v1beta"
+
+ ctx := context.Background()
+ c, err := osconfig.NewClient(ctx)
+ if err != nil {
+ // TODO: Handle error.
+ }
+
+ req := &osconfigpb.LookupEffectiveGuestPolicyRequest{
+ // TODO: Fill request struct fields.
+ }
+ resp, err := c.LookupEffectiveGuestPolicy(ctx, req)
+ if err != nil {
+ // TODO: Handle error.
+ }
+ // TODO: Use resp.
+ _ = resp
+}
diff --git a/oslogin/apiv1/doc.go b/oslogin/apiv1/doc.go
index 6288855..06266ef 100644
--- a/oslogin/apiv1/doc.go
+++ b/oslogin/apiv1/doc.go
@@ -12,16 +12,15 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-// Code generated by gapic-generator. DO NOT EDIT.
+// Code generated by protoc-gen-go_gapic. DO NOT EDIT.
// Package oslogin is an auto-generated package for the
// Cloud OS Login API.
//
-// NOTE: This package is in alpha. It is not stable, and is likely to change.
-//
// You can use OS Login to manage access to your VM instances using IAM
-// roles.
-// For more information, read [OS Login](/compute/docs/oslogin/).
+// roles. For more information, read [OS Login](/compute/docs/oslogin/).
+//
+// NOTE: This package is in alpha. It is not stable, and is likely to change.
//
// Use of Context
//
@@ -33,6 +32,7 @@
//
// For information about setting deadlines, reusing contexts, and more
// please visit godoc.org/cloud.google.com/go.
+
package oslogin // import "cloud.google.com/go/oslogin/apiv1"
import (
@@ -44,6 +44,8 @@
"google.golang.org/grpc/metadata"
)
+const versionClient = "20191216"
+
func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context {
out, _ := metadata.FromOutgoingContext(ctx)
out = out.Copy()
@@ -78,7 +80,7 @@
}
notSemverRune := func(r rune) bool {
- return strings.IndexRune("0123456789.", r) < 0
+ return !strings.ContainsRune("0123456789.", r)
}
if strings.HasPrefix(s, "go1") {
@@ -99,5 +101,3 @@
}
return "UNKNOWN"
}
-
-const versionClient = "20191108"
diff --git a/oslogin/apiv1/os_login_client.go b/oslogin/apiv1/os_login_client.go
index 2e0ec23..ce2c70b 100644
--- a/oslogin/apiv1/os_login_client.go
+++ b/oslogin/apiv1/os_login_client.go
@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-// Code generated by gapic-generator. DO NOT EDIT.
+// Code generated by protoc-gen-go_gapic. DO NOT EDIT.
package oslogin
@@ -46,6 +46,7 @@
func defaultClientOptions() []option.ClientOption {
return []option.ClientOption{
option.WithEndpoint("oslogin.googleapis.com:443"),
+ option.WithGRPCDialOption(grpc.WithDisableServiceConfig()),
option.WithScopes(DefaultAuthScopes()...),
option.WithGRPCDialOption(grpc.WithDefaultCallOptions(
grpc.MaxCallRecvMsgSize(math.MaxInt32))),
@@ -53,27 +54,79 @@
}
func defaultCallOptions() *CallOptions {
- retry := map[[2]string][]gax.CallOption{
- {"default", "idempotent"}: {
+ return &CallOptions{
+ DeletePosixAccount: []gax.CallOption{
gax.WithRetry(func() gax.Retryer {
return gax.OnCodes([]codes.Code{
- codes.DeadlineExceeded,
codes.Unavailable,
+ codes.DeadlineExceeded,
}, gax.Backoff{
Initial: 100 * time.Millisecond,
Max: 60000 * time.Millisecond,
- Multiplier: 1.3,
+ Multiplier: 1.30,
})
}),
},
- }
- return &CallOptions{
- DeletePosixAccount: retry[[2]string{"default", "non_idempotent"}],
- DeleteSshPublicKey: retry[[2]string{"default", "non_idempotent"}],
- GetLoginProfile: retry[[2]string{"default", "idempotent"}],
- GetSshPublicKey: retry[[2]string{"default", "idempotent"}],
- ImportSshPublicKey: retry[[2]string{"default", "non_idempotent"}],
- UpdateSshPublicKey: retry[[2]string{"default", "non_idempotent"}],
+ DeleteSshPublicKey: []gax.CallOption{
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnCodes([]codes.Code{
+ codes.Unavailable,
+ codes.DeadlineExceeded,
+ }, gax.Backoff{
+ Initial: 100 * time.Millisecond,
+ Max: 60000 * time.Millisecond,
+ Multiplier: 1.30,
+ })
+ }),
+ },
+ GetLoginProfile: []gax.CallOption{
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnCodes([]codes.Code{
+ codes.Unavailable,
+ codes.DeadlineExceeded,
+ }, gax.Backoff{
+ Initial: 100 * time.Millisecond,
+ Max: 60000 * time.Millisecond,
+ Multiplier: 1.30,
+ })
+ }),
+ },
+ GetSshPublicKey: []gax.CallOption{
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnCodes([]codes.Code{
+ codes.Unavailable,
+ codes.DeadlineExceeded,
+ }, gax.Backoff{
+ Initial: 100 * time.Millisecond,
+ Max: 60000 * time.Millisecond,
+ Multiplier: 1.30,
+ })
+ }),
+ },
+ ImportSshPublicKey: []gax.CallOption{
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnCodes([]codes.Code{
+ codes.Unavailable,
+ codes.DeadlineExceeded,
+ }, gax.Backoff{
+ Initial: 100 * time.Millisecond,
+ Max: 60000 * time.Millisecond,
+ Multiplier: 1.30,
+ })
+ }),
+ },
+ UpdateSshPublicKey: []gax.CallOption{
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnCodes([]codes.Code{
+ codes.Unavailable,
+ codes.DeadlineExceeded,
+ }, gax.Backoff{
+ Initial: 100 * time.Millisecond,
+ Max: 60000 * time.Millisecond,
+ Multiplier: 1.30,
+ })
+ }),
+ },
}
}
@@ -112,6 +165,7 @@
client: osloginpb.NewOsLoginServiceClient(conn),
}
c.setGoogleClientInfo()
+
return c, nil
}
diff --git a/oslogin/apiv1/os_login_client_example_test.go b/oslogin/apiv1/os_login_client_example_test.go
index af66f9c..a540c8a 100644
--- a/oslogin/apiv1/os_login_client_example_test.go
+++ b/oslogin/apiv1/os_login_client_example_test.go
@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-// Code generated by gapic-generator. DO NOT EDIT.
+// Code generated by protoc-gen-go_gapic. DO NOT EDIT.
package oslogin_test
@@ -66,6 +66,8 @@
}
func ExampleClient_GetLoginProfile() {
+ // import osloginpb "google.golang.org/genproto/googleapis/cloud/oslogin/v1"
+
ctx := context.Background()
c, err := oslogin.NewClient(ctx)
if err != nil {
@@ -84,6 +86,8 @@
}
func ExampleClient_GetSshPublicKey() {
+ // import osloginpb "google.golang.org/genproto/googleapis/cloud/oslogin/v1"
+
ctx := context.Background()
c, err := oslogin.NewClient(ctx)
if err != nil {
@@ -102,6 +106,8 @@
}
func ExampleClient_ImportSshPublicKey() {
+ // import osloginpb "google.golang.org/genproto/googleapis/cloud/oslogin/v1"
+
ctx := context.Background()
c, err := oslogin.NewClient(ctx)
if err != nil {
@@ -120,6 +126,8 @@
}
func ExampleClient_UpdateSshPublicKey() {
+ // import osloginpb "google.golang.org/genproto/googleapis/cloud/oslogin/v1"
+
ctx := context.Background()
c, err := oslogin.NewClient(ctx)
if err != nil {
diff --git a/oslogin/apiv1beta/doc.go b/oslogin/apiv1beta/doc.go
index eca9fbd..0c4b127 100644
--- a/oslogin/apiv1beta/doc.go
+++ b/oslogin/apiv1beta/doc.go
@@ -12,15 +12,16 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-// Code generated by gapic-generator. DO NOT EDIT.
+// Code generated by protoc-gen-go_gapic. DO NOT EDIT.
// Package oslogin is an auto-generated package for the
-// Google Cloud OS Login API.
+// Cloud OS Login API.
+//
+// You can use OS Login to manage access to your VM instances using IAM
+// roles. For more information, read [OS Login](/compute/docs/oslogin/).
//
// NOTE: This package is in beta. It is not stable, and may be subject to changes.
//
-// Manages OS login configuration for Google account users.
-//
// Use of Context
//
// The ctx passed to NewClient is used for authentication requests and
@@ -31,6 +32,7 @@
//
// For information about setting deadlines, reusing contexts, and more
// please visit godoc.org/cloud.google.com/go.
+
package oslogin // import "cloud.google.com/go/oslogin/apiv1beta"
import (
@@ -42,6 +44,8 @@
"google.golang.org/grpc/metadata"
)
+const versionClient = "20191216"
+
func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context {
out, _ := metadata.FromOutgoingContext(ctx)
out = out.Copy()
@@ -78,7 +82,7 @@
}
notSemverRune := func(r rune) bool {
- return strings.IndexRune("0123456789.", r) < 0
+ return !strings.ContainsRune("0123456789.", r)
}
if strings.HasPrefix(s, "go1") {
@@ -99,5 +103,3 @@
}
return "UNKNOWN"
}
-
-const versionClient = "20191206"
diff --git a/oslogin/apiv1beta/os_login_client.go b/oslogin/apiv1beta/os_login_client.go
index f0fbb6f..eecdf43 100644
--- a/oslogin/apiv1beta/os_login_client.go
+++ b/oslogin/apiv1beta/os_login_client.go
@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-// Code generated by gapic-generator. DO NOT EDIT.
+// Code generated by protoc-gen-go_gapic. DO NOT EDIT.
package oslogin
@@ -46,6 +46,7 @@
func defaultClientOptions() []option.ClientOption {
return []option.ClientOption{
option.WithEndpoint("oslogin.googleapis.com:443"),
+ option.WithGRPCDialOption(grpc.WithDisableServiceConfig()),
option.WithScopes(DefaultAuthScopes()...),
option.WithGRPCDialOption(grpc.WithDefaultCallOptions(
grpc.MaxCallRecvMsgSize(math.MaxInt32))),
@@ -53,31 +54,83 @@
}
func defaultCallOptions() *CallOptions {
- retry := map[[2]string][]gax.CallOption{
- {"default", "idempotent"}: {
+ return &CallOptions{
+ DeletePosixAccount: []gax.CallOption{
gax.WithRetry(func() gax.Retryer {
return gax.OnCodes([]codes.Code{
- codes.DeadlineExceeded,
codes.Unavailable,
+ codes.DeadlineExceeded,
}, gax.Backoff{
Initial: 100 * time.Millisecond,
Max: 60000 * time.Millisecond,
- Multiplier: 1.3,
+ Multiplier: 1.30,
+ })
+ }),
+ },
+ DeleteSshPublicKey: []gax.CallOption{
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnCodes([]codes.Code{
+ codes.Unavailable,
+ codes.DeadlineExceeded,
+ }, gax.Backoff{
+ Initial: 100 * time.Millisecond,
+ Max: 60000 * time.Millisecond,
+ Multiplier: 1.30,
+ })
+ }),
+ },
+ GetLoginProfile: []gax.CallOption{
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnCodes([]codes.Code{
+ codes.Unavailable,
+ codes.DeadlineExceeded,
+ }, gax.Backoff{
+ Initial: 100 * time.Millisecond,
+ Max: 60000 * time.Millisecond,
+ Multiplier: 1.30,
+ })
+ }),
+ },
+ GetSshPublicKey: []gax.CallOption{
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnCodes([]codes.Code{
+ codes.Unavailable,
+ codes.DeadlineExceeded,
+ }, gax.Backoff{
+ Initial: 100 * time.Millisecond,
+ Max: 60000 * time.Millisecond,
+ Multiplier: 1.30,
+ })
+ }),
+ },
+ ImportSshPublicKey: []gax.CallOption{
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnCodes([]codes.Code{
+ codes.Unavailable,
+ codes.DeadlineExceeded,
+ }, gax.Backoff{
+ Initial: 100 * time.Millisecond,
+ Max: 60000 * time.Millisecond,
+ Multiplier: 1.30,
+ })
+ }),
+ },
+ UpdateSshPublicKey: []gax.CallOption{
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnCodes([]codes.Code{
+ codes.Unavailable,
+ codes.DeadlineExceeded,
+ }, gax.Backoff{
+ Initial: 100 * time.Millisecond,
+ Max: 60000 * time.Millisecond,
+ Multiplier: 1.30,
})
}),
},
}
- return &CallOptions{
- DeletePosixAccount: retry[[2]string{"default", "idempotent"}],
- DeleteSshPublicKey: retry[[2]string{"default", "idempotent"}],
- GetLoginProfile: retry[[2]string{"default", "idempotent"}],
- GetSshPublicKey: retry[[2]string{"default", "idempotent"}],
- ImportSshPublicKey: retry[[2]string{"default", "idempotent"}],
- UpdateSshPublicKey: retry[[2]string{"default", "idempotent"}],
- }
}
-// Client is a client for interacting with Google Cloud OS Login API.
+// Client is a client for interacting with Cloud OS Login API.
//
// Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
type Client struct {
@@ -112,6 +165,7 @@
client: osloginpb.NewOsLoginServiceClient(conn),
}
c.setGoogleClientInfo()
+
return c, nil
}
diff --git a/oslogin/apiv1beta/os_login_client_example_test.go b/oslogin/apiv1beta/os_login_client_example_test.go
index 9a4cfed..06660bf 100644
--- a/oslogin/apiv1beta/os_login_client_example_test.go
+++ b/oslogin/apiv1beta/os_login_client_example_test.go
@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-// Code generated by gapic-generator. DO NOT EDIT.
+// Code generated by protoc-gen-go_gapic. DO NOT EDIT.
package oslogin_test
@@ -66,6 +66,8 @@
}
func ExampleClient_GetLoginProfile() {
+ // import osloginpb "google.golang.org/genproto/googleapis/cloud/oslogin/v1beta"
+
ctx := context.Background()
c, err := oslogin.NewClient(ctx)
if err != nil {
@@ -84,6 +86,8 @@
}
func ExampleClient_GetSshPublicKey() {
+ // import osloginpb "google.golang.org/genproto/googleapis/cloud/oslogin/v1beta"
+
ctx := context.Background()
c, err := oslogin.NewClient(ctx)
if err != nil {
@@ -102,6 +106,8 @@
}
func ExampleClient_ImportSshPublicKey() {
+ // import osloginpb "google.golang.org/genproto/googleapis/cloud/oslogin/v1beta"
+
ctx := context.Background()
c, err := oslogin.NewClient(ctx)
if err != nil {
@@ -120,6 +126,8 @@
}
func ExampleClient_UpdateSshPublicKey() {
+ // import osloginpb "google.golang.org/genproto/googleapis/cloud/oslogin/v1beta"
+
ctx := context.Background()
c, err := oslogin.NewClient(ctx)
if err != nil {
diff --git a/phishingprotection/apiv1beta1/doc.go b/phishingprotection/apiv1beta1/doc.go
index 4d75df4..8fffc73 100644
--- a/phishingprotection/apiv1beta1/doc.go
+++ b/phishingprotection/apiv1beta1/doc.go
@@ -41,7 +41,7 @@
"google.golang.org/grpc/metadata"
)
-const versionClient = "20191206"
+const versionClient = "20191216"
func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context {
out, _ := metadata.FromOutgoingContext(ctx)
diff --git a/pubsub/apiv1/doc.go b/pubsub/apiv1/doc.go
index 77a562d..4a2f826 100644
--- a/pubsub/apiv1/doc.go
+++ b/pubsub/apiv1/doc.go
@@ -100,4 +100,4 @@
return "UNKNOWN"
}
-const versionClient = "20191206"
+const versionClient = "20191216"
diff --git a/pubsub/go.mod b/pubsub/go.mod
index 52613a3..dfe085c 100644
--- a/pubsub/go.mod
+++ b/pubsub/go.mod
@@ -14,8 +14,8 @@
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45
golang.org/x/sync v0.0.0-20190423024810-112230192c58
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4
- golang.org/x/tools v0.0.0-20191206204035-259af5ff87bd // indirect
+ golang.org/x/tools v0.0.0-20191216173652-a0e659d51361 // indirect
google.golang.org/api v0.14.0
- google.golang.org/genproto v0.0.0-20191206224255-0243a4be9c8f
+ google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1
google.golang.org/grpc v1.21.1
)
diff --git a/pubsub/go.sum b/pubsub/go.sum
index 033a38f..331ae77 100644
--- a/pubsub/go.sum
+++ b/pubsub/go.sum
@@ -58,6 +58,7 @@
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/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 h1:OeRHuibLsmZkFj773W4LcfAGsSxJgfPONhr8cmO+eLA=
@@ -82,6 +83,7 @@
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=
+golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg=
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=
@@ -136,9 +138,10 @@
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-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
-golang.org/x/tools v0.0.0-20191206204035-259af5ff87bd h1:Zc7EU2PqpsNeIfOoVA7hvQX4cS3YDJEs5KlfatT3hLo=
-golang.org/x/tools v0.0.0-20191206204035-259af5ff87bd/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
+golang.org/x/tools v0.0.0-20191216173652-a0e659d51361 h1:RIIXAeV6GvDBuADKumTODatUqANFZ+5BPMnzsy4hulY=
+golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
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=
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=
@@ -161,8 +164,8 @@
google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc=
google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51 h1:Ex1mq5jaJof+kRnYi3SlYJ8KKa9Ao3NHyIT5XJ1gF6U=
google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8=
-google.golang.org/genproto v0.0.0-20191206224255-0243a4be9c8f h1:naitw5DILWPQvG0oG04mR9jF8fmKpRdW3E3zzKA4D0Y=
-google.golang.org/genproto v0.0.0-20191206224255-0243a4be9c8f/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
+google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1 h1:aQktFqmDE2yjveXJlVIfslDFmFnUXSqG0i6KRcJAeMc=
+google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
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 h1:j6XxA85m/6txkUCHvzlV5f+HBNl/1r5cZ2A/3IEFOO8=
diff --git a/recaptchaenterprise/apiv1beta1/doc.go b/recaptchaenterprise/apiv1beta1/doc.go
index 2dfe4be..58176ae 100644
--- a/recaptchaenterprise/apiv1beta1/doc.go
+++ b/recaptchaenterprise/apiv1beta1/doc.go
@@ -12,14 +12,13 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-// Code generated by gapic-generator. DO NOT EDIT.
+// Code generated by protoc-gen-go_gapic. DO NOT EDIT.
// Package recaptchaenterprise is an auto-generated package for the
// reCAPTCHA Enterprise 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
@@ -30,6 +29,7 @@
//
// For information about setting deadlines, reusing contexts, and more
// please visit godoc.org/cloud.google.com/go.
+
package recaptchaenterprise // import "cloud.google.com/go/recaptchaenterprise/apiv1beta1"
import (
@@ -41,6 +41,8 @@
"google.golang.org/grpc/metadata"
)
+const versionClient = "20191216"
+
func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context {
out, _ := metadata.FromOutgoingContext(ctx)
out = out.Copy()
@@ -74,7 +76,7 @@
}
notSemverRune := func(r rune) bool {
- return strings.IndexRune("0123456789.", r) < 0
+ return !strings.ContainsRune("0123456789.", r)
}
if strings.HasPrefix(s, "go1") {
@@ -95,5 +97,3 @@
}
return "UNKNOWN"
}
-
-const versionClient = "20191206"
diff --git a/recaptchaenterprise/apiv1beta1/recaptcha_enterprise_service_v1_beta1_client.go b/recaptchaenterprise/apiv1beta1/recaptcha_enterprise_service_v1_beta1_client.go
index f3d5f8c..8d0931a 100644
--- a/recaptchaenterprise/apiv1beta1/recaptcha_enterprise_service_v1_beta1_client.go
+++ b/recaptchaenterprise/apiv1beta1/recaptcha_enterprise_service_v1_beta1_client.go
@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-// Code generated by gapic-generator. DO NOT EDIT.
+// Code generated by protoc-gen-go_gapic. DO NOT EDIT.
package recaptchaenterprise
@@ -21,7 +21,6 @@
"fmt"
"math"
"net/url"
- "time"
"github.com/golang/protobuf/proto"
gax "github.com/googleapis/gax-go/v2"
@@ -30,7 +29,6 @@
"google.golang.org/api/transport"
recaptchaenterprisepb "google.golang.org/genproto/googleapis/cloud/recaptchaenterprise/v1beta1"
"google.golang.org/grpc"
- "google.golang.org/grpc/codes"
"google.golang.org/grpc/metadata"
)
@@ -48,6 +46,7 @@
func defaultRecaptchaEnterpriseServiceV1Beta1ClientOptions() []option.ClientOption {
return []option.ClientOption{
option.WithEndpoint("recaptchaenterprise.googleapis.com:443"),
+ option.WithGRPCDialOption(grpc.WithDisableServiceConfig()),
option.WithScopes(DefaultAuthScopes()...),
option.WithGRPCDialOption(grpc.WithDefaultCallOptions(
grpc.MaxCallRecvMsgSize(math.MaxInt32))),
@@ -55,28 +54,14 @@
}
func defaultRecaptchaEnterpriseServiceV1Beta1CallOptions() *RecaptchaEnterpriseServiceV1Beta1CallOptions {
- retry := map[[2]string][]gax.CallOption{
- {"default", "idempotent"}: {
- gax.WithRetry(func() gax.Retryer {
- return gax.OnCodes([]codes.Code{
- codes.DeadlineExceeded,
- codes.Unavailable,
- }, gax.Backoff{
- Initial: 100 * time.Millisecond,
- Max: 60000 * time.Millisecond,
- Multiplier: 1.3,
- })
- }),
- },
- }
return &RecaptchaEnterpriseServiceV1Beta1CallOptions{
- CreateAssessment: retry[[2]string{"default", "non_idempotent"}],
- AnnotateAssessment: retry[[2]string{"default", "non_idempotent"}],
- CreateKey: retry[[2]string{"default", "non_idempotent"}],
- ListKeys: retry[[2]string{"default", "idempotent"}],
- GetKey: retry[[2]string{"default", "idempotent"}],
- UpdateKey: retry[[2]string{"default", "non_idempotent"}],
- DeleteKey: retry[[2]string{"default", "non_idempotent"}],
+ CreateAssessment: []gax.CallOption{},
+ AnnotateAssessment: []gax.CallOption{},
+ CreateKey: []gax.CallOption{},
+ ListKeys: []gax.CallOption{},
+ GetKey: []gax.CallOption{},
+ UpdateKey: []gax.CallOption{},
+ DeleteKey: []gax.CallOption{},
}
}
@@ -112,6 +97,7 @@
recaptchaEnterpriseServiceV1Beta1Client: recaptchaenterprisepb.NewRecaptchaEnterpriseServiceV1Beta1Client(conn),
}
c.setGoogleClientInfo()
+
return c, nil
}
@@ -210,6 +196,8 @@
if err != nil {
return nil, "", err
}
+
+ it.Response = resp
return resp.Keys, resp.NextPageToken, nil
}
fetch := func(pageSize int, pageToken string) (string, error) {
@@ -279,6 +267,11 @@
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.
//
diff --git a/recaptchaenterprise/apiv1beta1/recaptcha_enterprise_service_v1_beta1_client_example_test.go b/recaptchaenterprise/apiv1beta1/recaptcha_enterprise_service_v1_beta1_client_example_test.go
index acc293b..8fd8a1e 100644
--- a/recaptchaenterprise/apiv1beta1/recaptcha_enterprise_service_v1_beta1_client_example_test.go
+++ b/recaptchaenterprise/apiv1beta1/recaptcha_enterprise_service_v1_beta1_client_example_test.go
@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-// Code generated by gapic-generator. DO NOT EDIT.
+// Code generated by protoc-gen-go_gapic. DO NOT EDIT.
package recaptchaenterprise_test
@@ -35,6 +35,8 @@
}
func ExampleRecaptchaEnterpriseServiceV1Beta1Client_CreateAssessment() {
+ // import recaptchaenterprisepb "google.golang.org/genproto/googleapis/cloud/recaptchaenterprise/v1beta1"
+
ctx := context.Background()
c, err := recaptchaenterprise.NewRecaptchaEnterpriseServiceV1Beta1Client(ctx)
if err != nil {
@@ -53,6 +55,8 @@
}
func ExampleRecaptchaEnterpriseServiceV1Beta1Client_AnnotateAssessment() {
+ // import recaptchaenterprisepb "google.golang.org/genproto/googleapis/cloud/recaptchaenterprise/v1beta1"
+
ctx := context.Background()
c, err := recaptchaenterprise.NewRecaptchaEnterpriseServiceV1Beta1Client(ctx)
if err != nil {
@@ -71,6 +75,8 @@
}
func ExampleRecaptchaEnterpriseServiceV1Beta1Client_CreateKey() {
+ // import recaptchaenterprisepb "google.golang.org/genproto/googleapis/cloud/recaptchaenterprise/v1beta1"
+
ctx := context.Background()
c, err := recaptchaenterprise.NewRecaptchaEnterpriseServiceV1Beta1Client(ctx)
if err != nil {
@@ -89,6 +95,9 @@
}
func ExampleRecaptchaEnterpriseServiceV1Beta1Client_ListKeys() {
+ // import recaptchaenterprisepb "google.golang.org/genproto/googleapis/cloud/recaptchaenterprise/v1beta1"
+ // import "google.golang.org/api/iterator"
+
ctx := context.Background()
c, err := recaptchaenterprise.NewRecaptchaEnterpriseServiceV1Beta1Client(ctx)
if err != nil {
@@ -113,6 +122,8 @@
}
func ExampleRecaptchaEnterpriseServiceV1Beta1Client_GetKey() {
+ // import recaptchaenterprisepb "google.golang.org/genproto/googleapis/cloud/recaptchaenterprise/v1beta1"
+
ctx := context.Background()
c, err := recaptchaenterprise.NewRecaptchaEnterpriseServiceV1Beta1Client(ctx)
if err != nil {
@@ -131,6 +142,8 @@
}
func ExampleRecaptchaEnterpriseServiceV1Beta1Client_UpdateKey() {
+ // import recaptchaenterprisepb "google.golang.org/genproto/googleapis/cloud/recaptchaenterprise/v1beta1"
+
ctx := context.Background()
c, err := recaptchaenterprise.NewRecaptchaEnterpriseServiceV1Beta1Client(ctx)
if err != nil {
diff --git a/recommender/apiv1beta1/doc.go b/recommender/apiv1beta1/doc.go
index 5f78488..9dc5f59 100644
--- a/recommender/apiv1beta1/doc.go
+++ b/recommender/apiv1beta1/doc.go
@@ -41,7 +41,7 @@
"google.golang.org/grpc/metadata"
)
-const versionClient = "20191206"
+const versionClient = "20191216"
func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context {
out, _ := metadata.FromOutgoingContext(ctx)
diff --git a/redis/apiv1/cloud_redis_client.go b/redis/apiv1/cloud_redis_client.go
index e031b1f..5277b1d 100644
--- a/redis/apiv1/cloud_redis_client.go
+++ b/redis/apiv1/cloud_redis_client.go
@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-// Code generated by gapic-generator. DO NOT EDIT.
+// Code generated by protoc-gen-go_gapic. DO NOT EDIT.
package redis
@@ -51,6 +51,7 @@
func defaultCloudRedisClientOptions() []option.ClientOption {
return []option.ClientOption{
option.WithEndpoint("redis.googleapis.com:443"),
+ option.WithGRPCDialOption(grpc.WithDisableServiceConfig()),
option.WithScopes(DefaultAuthScopes()...),
option.WithGRPCDialOption(grpc.WithDefaultCallOptions(
grpc.MaxCallRecvMsgSize(math.MaxInt32))),
@@ -58,16 +59,15 @@
}
func defaultCloudRedisCallOptions() *CloudRedisCallOptions {
- retry := map[[2]string][]gax.CallOption{}
return &CloudRedisCallOptions{
- ListInstances: retry[[2]string{"default", "non_idempotent"}],
- GetInstance: retry[[2]string{"default", "non_idempotent"}],
- CreateInstance: retry[[2]string{"default", "non_idempotent"}],
- UpdateInstance: retry[[2]string{"default", "non_idempotent"}],
- ImportInstance: retry[[2]string{"default", "non_idempotent"}],
- ExportInstance: retry[[2]string{"default", "non_idempotent"}],
- FailoverInstance: retry[[2]string{"default", "non_idempotent"}],
- DeleteInstance: retry[[2]string{"default", "non_idempotent"}],
+ ListInstances: []gax.CallOption{},
+ GetInstance: []gax.CallOption{},
+ CreateInstance: []gax.CallOption{},
+ UpdateInstance: []gax.CallOption{},
+ ImportInstance: []gax.CallOption{},
+ ExportInstance: []gax.CallOption{},
+ FailoverInstance: []gax.CallOption{},
+ DeleteInstance: []gax.CallOption{},
}
}
@@ -192,6 +192,8 @@
if err != nil {
return nil, "", err
}
+
+ it.Response = resp
return resp.Instances, resp.NextPageToken, nil
}
fetch := func(pageSize int, pageToken string) (string, error) {
@@ -227,7 +229,7 @@
// CreateInstance creates a Redis instance based on the specified tier and memory size.
//
-// By default, the instance is accessible from the project's
+// By default, the instance is accessible from the project’s
// default network (at /compute/docs/networks-and-firewalls#networks).
//
// The creation is executed asynchronously and callers may check the returned
@@ -368,48 +370,6 @@
}, nil
}
-// InstanceIterator manages a stream of *redispb.Instance.
-type InstanceIterator struct {
- items []*redispb.Instance
- pageInfo *iterator.PageInfo
- nextFunc func() error
-
- // 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 []*redispb.Instance, nextPageToken string, err error)
-}
-
-// PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
-func (it *InstanceIterator) PageInfo() *iterator.PageInfo {
- return it.pageInfo
-}
-
-// Next returns the next result. Its second return value is iterator.Done if there are no more
-// results. Once Next returns Done, all subsequent calls will return Done.
-func (it *InstanceIterator) Next() (*redispb.Instance, error) {
- var item *redispb.Instance
- if err := it.nextFunc(); err != nil {
- return item, err
- }
- item = it.items[0]
- it.items = it.items[1:]
- return item, nil
-}
-
-func (it *InstanceIterator) bufLen() int {
- return len(it.items)
-}
-
-func (it *InstanceIterator) takeBuf() interface{} {
- b := it.items
- it.items = nil
- return b
-}
-
// CreateInstanceOperation manages a long-running operation from CreateInstance.
type CreateInstanceOperation struct {
lro *longrunning.Operation
@@ -428,7 +388,7 @@
// See documentation of Poll for error-handling information.
func (op *CreateInstanceOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*redispb.Instance, error) {
var resp redispb.Instance
- if err := op.lro.WaitWithInterval(ctx, &resp, 360000*time.Millisecond, opts...); err != nil {
+ if err := op.lro.WaitWithInterval(ctx, &resp, time.Minute, opts...); err != nil {
return nil, err
}
return &resp, nil
@@ -492,11 +452,11 @@
}
}
-// Wait blocks until the long-running operation is completed, returning any error encountered.
+// 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 *DeleteInstanceOperation) Wait(ctx context.Context, opts ...gax.CallOption) error {
- return op.lro.WaitWithInterval(ctx, nil, 360000*time.Millisecond, opts...)
+ return op.lro.WaitWithInterval(ctx, nil, time.Minute, opts...)
}
// Poll fetches the latest state of the long-running operation.
@@ -505,7 +465,9 @@
//
// 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.
+// 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 *DeleteInstanceOperation) Poll(ctx context.Context, opts ...gax.CallOption) error {
return op.lro.Poll(ctx, nil, opts...)
}
@@ -553,7 +515,7 @@
// See documentation of Poll for error-handling information.
func (op *ExportInstanceOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*redispb.Instance, error) {
var resp redispb.Instance
- if err := op.lro.WaitWithInterval(ctx, &resp, 360000*time.Millisecond, opts...); err != nil {
+ if err := op.lro.WaitWithInterval(ctx, &resp, time.Minute, opts...); err != nil {
return nil, err
}
return &resp, nil
@@ -622,7 +584,7 @@
// See documentation of Poll for error-handling information.
func (op *FailoverInstanceOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*redispb.Instance, error) {
var resp redispb.Instance
- if err := op.lro.WaitWithInterval(ctx, &resp, 360000*time.Millisecond, opts...); err != nil {
+ if err := op.lro.WaitWithInterval(ctx, &resp, time.Minute, opts...); err != nil {
return nil, err
}
return &resp, nil
@@ -691,7 +653,7 @@
// See documentation of Poll for error-handling information.
func (op *ImportInstanceOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*redispb.Instance, error) {
var resp redispb.Instance
- if err := op.lro.WaitWithInterval(ctx, &resp, 360000*time.Millisecond, opts...); err != nil {
+ if err := op.lro.WaitWithInterval(ctx, &resp, time.Minute, opts...); err != nil {
return nil, err
}
return &resp, nil
@@ -760,7 +722,7 @@
// See documentation of Poll for error-handling information.
func (op *UpdateInstanceOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*redispb.Instance, error) {
var resp redispb.Instance
- if err := op.lro.WaitWithInterval(ctx, &resp, 360000*time.Millisecond, opts...); err != nil {
+ if err := op.lro.WaitWithInterval(ctx, &resp, time.Minute, opts...); err != nil {
return nil, err
}
return &resp, nil
@@ -810,3 +772,50 @@
func (op *UpdateInstanceOperation) Name() string {
return op.lro.Name()
}
+
+// InstanceIterator manages a stream of *redispb.Instance.
+type InstanceIterator struct {
+ items []*redispb.Instance
+ pageInfo *iterator.PageInfo
+ nextFunc func() error
+
+ // Response is the raw response for the current page.
+ // It must be cast to the RPC response type.
+ // Calling Next() or InternalFetch() updates this value.
+ Response interface{}
+
+ // InternalFetch is for use by the Google Cloud Libraries only.
+ // It is not part of the stable interface of this package.
+ //
+ // InternalFetch returns results from a single call to the underlying RPC.
+ // The number of results is no greater than pageSize.
+ // If there are no more results, nextPageToken is empty and err is nil.
+ InternalFetch func(pageSize int, pageToken string) (results []*redispb.Instance, nextPageToken string, err error)
+}
+
+// PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
+func (it *InstanceIterator) PageInfo() *iterator.PageInfo {
+ return it.pageInfo
+}
+
+// Next returns the next result. Its second return value is iterator.Done if there are no more
+// results. Once Next returns Done, all subsequent calls will return Done.
+func (it *InstanceIterator) Next() (*redispb.Instance, error) {
+ var item *redispb.Instance
+ if err := it.nextFunc(); err != nil {
+ return item, err
+ }
+ item = it.items[0]
+ it.items = it.items[1:]
+ return item, nil
+}
+
+func (it *InstanceIterator) bufLen() int {
+ return len(it.items)
+}
+
+func (it *InstanceIterator) takeBuf() interface{} {
+ b := it.items
+ it.items = nil
+ return b
+}
diff --git a/redis/apiv1/cloud_redis_client_example_test.go b/redis/apiv1/cloud_redis_client_example_test.go
index faa1e4a..bb315b3 100644
--- a/redis/apiv1/cloud_redis_client_example_test.go
+++ b/redis/apiv1/cloud_redis_client_example_test.go
@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-// Code generated by gapic-generator. DO NOT EDIT.
+// Code generated by protoc-gen-go_gapic. DO NOT EDIT.
package redis_test
@@ -35,6 +35,9 @@
}
func ExampleCloudRedisClient_ListInstances() {
+ // import redispb "google.golang.org/genproto/googleapis/cloud/redis/v1"
+ // import "google.golang.org/api/iterator"
+
ctx := context.Background()
c, err := redis.NewCloudRedisClient(ctx)
if err != nil {
@@ -59,6 +62,8 @@
}
func ExampleCloudRedisClient_GetInstance() {
+ // import redispb "google.golang.org/genproto/googleapis/cloud/redis/v1"
+
ctx := context.Background()
c, err := redis.NewCloudRedisClient(ctx)
if err != nil {
@@ -77,6 +82,8 @@
}
func ExampleCloudRedisClient_CreateInstance() {
+ // import redispb "google.golang.org/genproto/googleapis/cloud/redis/v1"
+
ctx := context.Background()
c, err := redis.NewCloudRedisClient(ctx)
if err != nil {
@@ -100,6 +107,8 @@
}
func ExampleCloudRedisClient_UpdateInstance() {
+ // import redispb "google.golang.org/genproto/googleapis/cloud/redis/v1"
+
ctx := context.Background()
c, err := redis.NewCloudRedisClient(ctx)
if err != nil {
@@ -123,6 +132,8 @@
}
func ExampleCloudRedisClient_ImportInstance() {
+ // import redispb "google.golang.org/genproto/googleapis/cloud/redis/v1"
+
ctx := context.Background()
c, err := redis.NewCloudRedisClient(ctx)
if err != nil {
@@ -146,6 +157,8 @@
}
func ExampleCloudRedisClient_ExportInstance() {
+ // import redispb "google.golang.org/genproto/googleapis/cloud/redis/v1"
+
ctx := context.Background()
c, err := redis.NewCloudRedisClient(ctx)
if err != nil {
@@ -169,6 +182,8 @@
}
func ExampleCloudRedisClient_FailoverInstance() {
+ // import redispb "google.golang.org/genproto/googleapis/cloud/redis/v1"
+
ctx := context.Background()
c, err := redis.NewCloudRedisClient(ctx)
if err != nil {
@@ -192,6 +207,8 @@
}
func ExampleCloudRedisClient_DeleteInstance() {
+ // import redispb "google.golang.org/genproto/googleapis/cloud/redis/v1"
+
ctx := context.Background()
c, err := redis.NewCloudRedisClient(ctx)
if err != nil {
@@ -207,5 +224,7 @@
}
err = op.Wait(ctx)
- // TODO: Handle error.
+ if err != nil {
+ // TODO: Handle error.
+ }
}
diff --git a/redis/apiv1/doc.go b/redis/apiv1/doc.go
index c9cbe24..6c626ca 100644
--- a/redis/apiv1/doc.go
+++ b/redis/apiv1/doc.go
@@ -12,15 +12,15 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-// Code generated by gapic-generator. DO NOT EDIT.
+// Code generated by protoc-gen-go_gapic. DO NOT EDIT.
// Package redis is an auto-generated package for the
// Google Cloud Memorystore for Redis API.
//
-// NOTE: This package is in alpha. It is not stable, and is likely to change.
-//
// Creates and manages Redis instances on the Google Cloud Platform.
//
+// 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
@@ -31,6 +31,7 @@
//
// For information about setting deadlines, reusing contexts, and more
// please visit godoc.org/cloud.google.com/go.
+
package redis // import "cloud.google.com/go/redis/apiv1"
import (
@@ -42,6 +43,8 @@
"google.golang.org/grpc/metadata"
)
+const versionClient = "20191216"
+
func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context {
out, _ := metadata.FromOutgoingContext(ctx)
out = out.Copy()
@@ -75,7 +78,7 @@
}
notSemverRune := func(r rune) bool {
- return strings.IndexRune("0123456789.", r) < 0
+ return !strings.ContainsRune("0123456789.", r)
}
if strings.HasPrefix(s, "go1") {
@@ -96,5 +99,3 @@
}
return "UNKNOWN"
}
-
-const versionClient = "20191206"
diff --git a/redis/apiv1beta1/cloud_redis_client.go b/redis/apiv1beta1/cloud_redis_client.go
index c94036d..9305ed1b 100644
--- a/redis/apiv1beta1/cloud_redis_client.go
+++ b/redis/apiv1beta1/cloud_redis_client.go
@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-// Code generated by gapic-generator. DO NOT EDIT.
+// Code generated by protoc-gen-go_gapic. DO NOT EDIT.
package redis
@@ -52,6 +52,7 @@
func defaultCloudRedisClientOptions() []option.ClientOption {
return []option.ClientOption{
option.WithEndpoint("redis.googleapis.com:443"),
+ option.WithGRPCDialOption(grpc.WithDisableServiceConfig()),
option.WithScopes(DefaultAuthScopes()...),
option.WithGRPCDialOption(grpc.WithDefaultCallOptions(
grpc.MaxCallRecvMsgSize(math.MaxInt32))),
@@ -59,16 +60,15 @@
}
func defaultCloudRedisCallOptions() *CloudRedisCallOptions {
- retry := map[[2]string][]gax.CallOption{}
return &CloudRedisCallOptions{
- ListInstances: retry[[2]string{"default", "non_idempotent"}],
- GetInstance: retry[[2]string{"default", "non_idempotent"}],
- CreateInstance: retry[[2]string{"default", "non_idempotent"}],
- UpdateInstance: retry[[2]string{"default", "non_idempotent"}],
- ImportInstance: retry[[2]string{"default", "non_idempotent"}],
- ExportInstance: retry[[2]string{"default", "non_idempotent"}],
- FailoverInstance: retry[[2]string{"default", "non_idempotent"}],
- DeleteInstance: retry[[2]string{"default", "non_idempotent"}],
+ ListInstances: []gax.CallOption{},
+ GetInstance: []gax.CallOption{},
+ CreateInstance: []gax.CallOption{},
+ UpdateInstance: []gax.CallOption{},
+ ImportInstance: []gax.CallOption{},
+ ExportInstance: []gax.CallOption{},
+ FailoverInstance: []gax.CallOption{},
+ DeleteInstance: []gax.CallOption{},
}
}
@@ -193,6 +193,8 @@
if err != nil {
return nil, "", err
}
+
+ it.Response = resp
return resp.Instances, resp.NextPageToken, nil
}
fetch := func(pageSize int, pageToken string) (string, error) {
@@ -228,7 +230,7 @@
// CreateInstance creates a Redis instance based on the specified tier and memory size.
//
-// By default, the instance is accessible from the project's
+// By default, the instance is accessible from the project’s
// default network (at /compute/docs/networks-and-firewalls#networks).
//
// The creation is executed asynchronously and callers may check the returned
@@ -369,48 +371,6 @@
}, nil
}
-// InstanceIterator manages a stream of *redispb.Instance.
-type InstanceIterator struct {
- items []*redispb.Instance
- pageInfo *iterator.PageInfo
- nextFunc func() error
-
- // 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 []*redispb.Instance, nextPageToken string, err error)
-}
-
-// PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
-func (it *InstanceIterator) PageInfo() *iterator.PageInfo {
- return it.pageInfo
-}
-
-// Next returns the next result. Its second return value is iterator.Done if there are no more
-// results. Once Next returns Done, all subsequent calls will return Done.
-func (it *InstanceIterator) Next() (*redispb.Instance, error) {
- var item *redispb.Instance
- if err := it.nextFunc(); err != nil {
- return item, err
- }
- item = it.items[0]
- it.items = it.items[1:]
- return item, nil
-}
-
-func (it *InstanceIterator) bufLen() int {
- return len(it.items)
-}
-
-func (it *InstanceIterator) takeBuf() interface{} {
- b := it.items
- it.items = nil
- return b
-}
-
// CreateInstanceOperation manages a long-running operation from CreateInstance.
type CreateInstanceOperation struct {
lro *longrunning.Operation
@@ -429,7 +389,7 @@
// See documentation of Poll for error-handling information.
func (op *CreateInstanceOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*redispb.Instance, error) {
var resp redispb.Instance
- if err := op.lro.WaitWithInterval(ctx, &resp, 360000*time.Millisecond, opts...); err != nil {
+ if err := op.lro.WaitWithInterval(ctx, &resp, time.Minute, opts...); err != nil {
return nil, err
}
return &resp, nil
@@ -493,11 +453,11 @@
}
}
-// Wait blocks until the long-running operation is completed, returning any error encountered.
+// 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 *DeleteInstanceOperation) Wait(ctx context.Context, opts ...gax.CallOption) error {
- return op.lro.WaitWithInterval(ctx, nil, 360000*time.Millisecond, opts...)
+ return op.lro.WaitWithInterval(ctx, nil, time.Minute, opts...)
}
// Poll fetches the latest state of the long-running operation.
@@ -506,7 +466,9 @@
//
// 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.
+// 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 *DeleteInstanceOperation) Poll(ctx context.Context, opts ...gax.CallOption) error {
return op.lro.Poll(ctx, nil, opts...)
}
@@ -554,7 +516,7 @@
// See documentation of Poll for error-handling information.
func (op *ExportInstanceOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*redispb.Instance, error) {
var resp redispb.Instance
- if err := op.lro.WaitWithInterval(ctx, &resp, 360000*time.Millisecond, opts...); err != nil {
+ if err := op.lro.WaitWithInterval(ctx, &resp, time.Minute, opts...); err != nil {
return nil, err
}
return &resp, nil
@@ -623,7 +585,7 @@
// See documentation of Poll for error-handling information.
func (op *FailoverInstanceOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*redispb.Instance, error) {
var resp redispb.Instance
- if err := op.lro.WaitWithInterval(ctx, &resp, 360000*time.Millisecond, opts...); err != nil {
+ if err := op.lro.WaitWithInterval(ctx, &resp, time.Minute, opts...); err != nil {
return nil, err
}
return &resp, nil
@@ -692,7 +654,7 @@
// See documentation of Poll for error-handling information.
func (op *ImportInstanceOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*redispb.Instance, error) {
var resp redispb.Instance
- if err := op.lro.WaitWithInterval(ctx, &resp, 360000*time.Millisecond, opts...); err != nil {
+ if err := op.lro.WaitWithInterval(ctx, &resp, time.Minute, opts...); err != nil {
return nil, err
}
return &resp, nil
@@ -761,7 +723,7 @@
// See documentation of Poll for error-handling information.
func (op *UpdateInstanceOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*redispb.Instance, error) {
var resp redispb.Instance
- if err := op.lro.WaitWithInterval(ctx, &resp, 360000*time.Millisecond, opts...); err != nil {
+ if err := op.lro.WaitWithInterval(ctx, &resp, time.Minute, opts...); err != nil {
return nil, err
}
return &resp, nil
@@ -811,3 +773,50 @@
func (op *UpdateInstanceOperation) Name() string {
return op.lro.Name()
}
+
+// InstanceIterator manages a stream of *redispb.Instance.
+type InstanceIterator struct {
+ items []*redispb.Instance
+ pageInfo *iterator.PageInfo
+ nextFunc func() error
+
+ // Response is the raw response for the current page.
+ // It must be cast to the RPC response type.
+ // Calling Next() or InternalFetch() updates this value.
+ Response interface{}
+
+ // InternalFetch is for use by the Google Cloud Libraries only.
+ // It is not part of the stable interface of this package.
+ //
+ // InternalFetch returns results from a single call to the underlying RPC.
+ // The number of results is no greater than pageSize.
+ // If there are no more results, nextPageToken is empty and err is nil.
+ InternalFetch func(pageSize int, pageToken string) (results []*redispb.Instance, nextPageToken string, err error)
+}
+
+// PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
+func (it *InstanceIterator) PageInfo() *iterator.PageInfo {
+ return it.pageInfo
+}
+
+// Next returns the next result. Its second return value is iterator.Done if there are no more
+// results. Once Next returns Done, all subsequent calls will return Done.
+func (it *InstanceIterator) Next() (*redispb.Instance, error) {
+ var item *redispb.Instance
+ if err := it.nextFunc(); err != nil {
+ return item, err
+ }
+ item = it.items[0]
+ it.items = it.items[1:]
+ return item, nil
+}
+
+func (it *InstanceIterator) bufLen() int {
+ return len(it.items)
+}
+
+func (it *InstanceIterator) takeBuf() interface{} {
+ b := it.items
+ it.items = nil
+ return b
+}
diff --git a/redis/apiv1beta1/cloud_redis_client_example_test.go b/redis/apiv1beta1/cloud_redis_client_example_test.go
index fdbc09b..12623a0 100644
--- a/redis/apiv1beta1/cloud_redis_client_example_test.go
+++ b/redis/apiv1beta1/cloud_redis_client_example_test.go
@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-// Code generated by gapic-generator. DO NOT EDIT.
+// Code generated by protoc-gen-go_gapic. DO NOT EDIT.
package redis_test
@@ -35,6 +35,9 @@
}
func ExampleCloudRedisClient_ListInstances() {
+ // import redispb "google.golang.org/genproto/googleapis/cloud/redis/v1beta1"
+ // import "google.golang.org/api/iterator"
+
ctx := context.Background()
c, err := redis.NewCloudRedisClient(ctx)
if err != nil {
@@ -59,6 +62,8 @@
}
func ExampleCloudRedisClient_GetInstance() {
+ // import redispb "google.golang.org/genproto/googleapis/cloud/redis/v1beta1"
+
ctx := context.Background()
c, err := redis.NewCloudRedisClient(ctx)
if err != nil {
@@ -77,6 +82,8 @@
}
func ExampleCloudRedisClient_CreateInstance() {
+ // import redispb "google.golang.org/genproto/googleapis/cloud/redis/v1beta1"
+
ctx := context.Background()
c, err := redis.NewCloudRedisClient(ctx)
if err != nil {
@@ -100,6 +107,8 @@
}
func ExampleCloudRedisClient_UpdateInstance() {
+ // import redispb "google.golang.org/genproto/googleapis/cloud/redis/v1beta1"
+
ctx := context.Background()
c, err := redis.NewCloudRedisClient(ctx)
if err != nil {
@@ -123,6 +132,8 @@
}
func ExampleCloudRedisClient_ImportInstance() {
+ // import redispb "google.golang.org/genproto/googleapis/cloud/redis/v1beta1"
+
ctx := context.Background()
c, err := redis.NewCloudRedisClient(ctx)
if err != nil {
@@ -146,6 +157,8 @@
}
func ExampleCloudRedisClient_ExportInstance() {
+ // import redispb "google.golang.org/genproto/googleapis/cloud/redis/v1beta1"
+
ctx := context.Background()
c, err := redis.NewCloudRedisClient(ctx)
if err != nil {
@@ -169,6 +182,8 @@
}
func ExampleCloudRedisClient_FailoverInstance() {
+ // import redispb "google.golang.org/genproto/googleapis/cloud/redis/v1beta1"
+
ctx := context.Background()
c, err := redis.NewCloudRedisClient(ctx)
if err != nil {
@@ -192,6 +207,8 @@
}
func ExampleCloudRedisClient_DeleteInstance() {
+ // import redispb "google.golang.org/genproto/googleapis/cloud/redis/v1beta1"
+
ctx := context.Background()
c, err := redis.NewCloudRedisClient(ctx)
if err != nil {
@@ -207,5 +224,7 @@
}
err = op.Wait(ctx)
- // TODO: Handle error.
+ if err != nil {
+ // TODO: Handle error.
+ }
}
diff --git a/redis/apiv1beta1/doc.go b/redis/apiv1beta1/doc.go
index fa91b67..6990c0c 100644
--- a/redis/apiv1beta1/doc.go
+++ b/redis/apiv1beta1/doc.go
@@ -12,15 +12,15 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-// Code generated by gapic-generator. DO NOT EDIT.
+// Code generated by protoc-gen-go_gapic. DO NOT EDIT.
// Package redis is an auto-generated package for the
// Google Cloud Memorystore for Redis API.
//
-// NOTE: This package is in beta. It is not stable, and may be subject to changes.
-//
// Creates and manages Redis instances on the 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
@@ -31,6 +31,7 @@
//
// For information about setting deadlines, reusing contexts, and more
// please visit godoc.org/cloud.google.com/go.
+
package redis // import "cloud.google.com/go/redis/apiv1beta1"
import (
@@ -42,6 +43,8 @@
"google.golang.org/grpc/metadata"
)
+const versionClient = "20191216"
+
func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context {
out, _ := metadata.FromOutgoingContext(ctx)
out = out.Copy()
@@ -75,7 +78,7 @@
}
notSemverRune := func(r rune) bool {
- return strings.IndexRune("0123456789.", r) < 0
+ return !strings.ContainsRune("0123456789.", r)
}
if strings.HasPrefix(s, "go1") {
@@ -96,5 +99,3 @@
}
return "UNKNOWN"
}
-
-const versionClient = "UNKNOWN"
diff --git a/scheduler/apiv1/doc.go b/scheduler/apiv1/doc.go
index d18f9a2..cba2df2 100644
--- a/scheduler/apiv1/doc.go
+++ b/scheduler/apiv1/doc.go
@@ -41,7 +41,7 @@
"google.golang.org/grpc/metadata"
)
-const versionClient = "20191206"
+const versionClient = "20191216"
func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context {
out, _ := metadata.FromOutgoingContext(ctx)
diff --git a/scheduler/apiv1beta1/doc.go b/scheduler/apiv1beta1/doc.go
index cde0a80..336f5bc 100644
--- a/scheduler/apiv1beta1/doc.go
+++ b/scheduler/apiv1beta1/doc.go
@@ -43,7 +43,7 @@
"google.golang.org/grpc/metadata"
)
-const versionClient = "20191206"
+const versionClient = "20191216"
func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context {
out, _ := metadata.FromOutgoingContext(ctx)
diff --git a/secretmanager/apiv1beta1/doc.go b/secretmanager/apiv1beta1/doc.go
index 2acfe8d..9387083 100644
--- a/secretmanager/apiv1beta1/doc.go
+++ b/secretmanager/apiv1beta1/doc.go
@@ -43,7 +43,7 @@
"google.golang.org/grpc/metadata"
)
-const versionClient = "20191206"
+const versionClient = "20191216"
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 a85da7c..bb29f32 100644
--- a/securitycenter/apiv1/doc.go
+++ b/securitycenter/apiv1/doc.go
@@ -12,16 +12,16 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-// Code generated by gapic-generator. DO NOT EDIT.
+// Code generated by protoc-gen-go_gapic. DO NOT EDIT.
// Package securitycenter is an auto-generated package for the
// Cloud Security Command Center API.
//
-// NOTE: This package is in alpha. It is not stable, and is likely to change.
-//
// Cloud Security Command Center API provides access to temporal views of
// assets and findings within an organization.
//
+// 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
@@ -32,6 +32,7 @@
//
// For information about setting deadlines, reusing contexts, and more
// please visit godoc.org/cloud.google.com/go.
+
package securitycenter // import "cloud.google.com/go/securitycenter/apiv1"
import (
@@ -43,6 +44,8 @@
"google.golang.org/grpc/metadata"
)
+const versionClient = "20191216"
+
func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context {
out, _ := metadata.FromOutgoingContext(ctx)
out = out.Copy()
@@ -76,7 +79,7 @@
}
notSemverRune := func(r rune) bool {
- return strings.IndexRune("0123456789.", r) < 0
+ return !strings.ContainsRune("0123456789.", r)
}
if strings.HasPrefix(s, "go1") {
@@ -97,5 +100,3 @@
}
return "UNKNOWN"
}
-
-const versionClient = "20191206"
diff --git a/securitycenter/apiv1/security_center_client.go b/securitycenter/apiv1/security_center_client.go
index c12c47d..519f349 100644
--- a/securitycenter/apiv1/security_center_client.go
+++ b/securitycenter/apiv1/security_center_client.go
@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-// Code generated by gapic-generator. DO NOT EDIT.
+// Code generated by protoc-gen-go_gapic. DO NOT EDIT.
package securitycenter
@@ -26,6 +26,7 @@
"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"
"google.golang.org/api/option"
@@ -63,6 +64,7 @@
func defaultClientOptions() []option.ClientOption {
return []option.ClientOption{
option.WithEndpoint("securitycenter.googleapis.com:443"),
+ option.WithGRPCDialOption(grpc.WithDisableServiceConfig()),
option.WithScopes(DefaultAuthScopes()...),
option.WithGRPCDialOption(grpc.WithDefaultCallOptions(
grpc.MaxCallRecvMsgSize(math.MaxInt32))),
@@ -70,8 +72,10 @@
}
func defaultCallOptions() *CallOptions {
- retry := map[[2]string][]gax.CallOption{
- {"default", "idempotent"}: {
+ return &CallOptions{
+ CreateSource: []gax.CallOption{},
+ CreateFinding: []gax.CallOption{},
+ GetIamPolicy: []gax.CallOption{
gax.WithRetry(func() gax.Retryer {
return gax.OnCodes([]codes.Code{
codes.DeadlineExceeded,
@@ -79,30 +83,113 @@
}, gax.Backoff{
Initial: 100 * time.Millisecond,
Max: 60000 * time.Millisecond,
- Multiplier: 1.3,
+ Multiplier: 1.30,
})
}),
},
- }
- return &CallOptions{
- CreateSource: retry[[2]string{"default", "non_idempotent"}],
- CreateFinding: retry[[2]string{"default", "non_idempotent"}],
- GetIamPolicy: retry[[2]string{"default", "idempotent"}],
- GetOrganizationSettings: retry[[2]string{"default", "idempotent"}],
- GetSource: retry[[2]string{"default", "idempotent"}],
- GroupAssets: retry[[2]string{"default", "idempotent"}],
- GroupFindings: retry[[2]string{"default", "idempotent"}],
- ListAssets: retry[[2]string{"default", "idempotent"}],
- ListFindings: retry[[2]string{"default", "idempotent"}],
- ListSources: retry[[2]string{"default", "idempotent"}],
- RunAssetDiscovery: retry[[2]string{"default", "non_idempotent"}],
- SetFindingState: retry[[2]string{"default", "non_idempotent"}],
- SetIamPolicy: retry[[2]string{"default", "non_idempotent"}],
- TestIamPermissions: retry[[2]string{"default", "idempotent"}],
- UpdateFinding: retry[[2]string{"default", "non_idempotent"}],
- UpdateOrganizationSettings: retry[[2]string{"default", "non_idempotent"}],
- UpdateSource: retry[[2]string{"default", "non_idempotent"}],
- UpdateSecurityMarks: retry[[2]string{"default", "non_idempotent"}],
+ GetOrganizationSettings: []gax.CallOption{
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnCodes([]codes.Code{
+ codes.DeadlineExceeded,
+ codes.Unavailable,
+ }, gax.Backoff{
+ Initial: 100 * time.Millisecond,
+ Max: 60000 * time.Millisecond,
+ Multiplier: 1.30,
+ })
+ }),
+ },
+ GetSource: []gax.CallOption{
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnCodes([]codes.Code{
+ codes.DeadlineExceeded,
+ codes.Unavailable,
+ }, gax.Backoff{
+ Initial: 100 * time.Millisecond,
+ Max: 60000 * time.Millisecond,
+ Multiplier: 1.30,
+ })
+ }),
+ },
+ GroupAssets: []gax.CallOption{
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnCodes([]codes.Code{
+ codes.DeadlineExceeded,
+ codes.Unavailable,
+ }, gax.Backoff{
+ Initial: 100 * time.Millisecond,
+ Max: 60000 * time.Millisecond,
+ Multiplier: 1.30,
+ })
+ }),
+ },
+ GroupFindings: []gax.CallOption{
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnCodes([]codes.Code{
+ codes.DeadlineExceeded,
+ codes.Unavailable,
+ }, gax.Backoff{
+ Initial: 100 * time.Millisecond,
+ Max: 60000 * time.Millisecond,
+ Multiplier: 1.30,
+ })
+ }),
+ },
+ ListAssets: []gax.CallOption{
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnCodes([]codes.Code{
+ codes.DeadlineExceeded,
+ codes.Unavailable,
+ }, gax.Backoff{
+ Initial: 100 * time.Millisecond,
+ Max: 60000 * time.Millisecond,
+ Multiplier: 1.30,
+ })
+ }),
+ },
+ ListFindings: []gax.CallOption{
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnCodes([]codes.Code{
+ codes.DeadlineExceeded,
+ codes.Unavailable,
+ }, gax.Backoff{
+ Initial: 100 * time.Millisecond,
+ Max: 60000 * time.Millisecond,
+ Multiplier: 1.30,
+ })
+ }),
+ },
+ ListSources: []gax.CallOption{
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnCodes([]codes.Code{
+ codes.DeadlineExceeded,
+ codes.Unavailable,
+ }, gax.Backoff{
+ Initial: 100 * time.Millisecond,
+ Max: 60000 * time.Millisecond,
+ Multiplier: 1.30,
+ })
+ }),
+ },
+ RunAssetDiscovery: []gax.CallOption{},
+ SetFindingState: []gax.CallOption{},
+ SetIamPolicy: []gax.CallOption{},
+ TestIamPermissions: []gax.CallOption{
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnCodes([]codes.Code{
+ codes.DeadlineExceeded,
+ codes.Unavailable,
+ }, gax.Backoff{
+ Initial: 100 * time.Millisecond,
+ Max: 60000 * time.Millisecond,
+ Multiplier: 1.30,
+ })
+ }),
+ },
+ UpdateFinding: []gax.CallOption{},
+ UpdateOrganizationSettings: []gax.CallOption{},
+ UpdateSource: []gax.CallOption{},
+ UpdateSecurityMarks: []gax.CallOption{},
}
}
@@ -263,7 +350,7 @@
return resp, nil
}
-// GroupAssets filters an organization's assets and groups them by their specified
+// GroupAssets filters an organization’s assets and groups them by their specified
// properties.
func (c *Client) GroupAssets(ctx context.Context, req *securitycenterpb.GroupAssetsRequest, opts ...gax.CallOption) *GroupResultIterator {
md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent())))
@@ -287,6 +374,8 @@
if err != nil {
return nil, "", err
}
+
+ it.Response = resp
return resp.GroupByResults, resp.NextPageToken, nil
}
fetch := func(pageSize int, pageToken string) (string, error) {
@@ -303,11 +392,11 @@
return it
}
-// GroupFindings filters an organization or source's findings and groups them by their
+// GroupFindings filters an organization or source’s findings and groups them by their
// specified properties.
//
// To group across all sources provide a - as the source id.
-// Example: /v1/organizations/123/sources/-/findings
+// Example: /v1/organizations/{organization_id}/sources/-/findings
func (c *Client) GroupFindings(ctx context.Context, req *securitycenterpb.GroupFindingsRequest, opts ...gax.CallOption) *GroupResultIterator {
md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent())))
ctx = insertMetadata(ctx, c.xGoogMetadata, md)
@@ -330,6 +419,8 @@
if err != nil {
return nil, "", err
}
+
+ it.Response = resp
return resp.GroupByResults, resp.NextPageToken, nil
}
fetch := func(pageSize int, pageToken string) (string, error) {
@@ -346,7 +437,7 @@
return it
}
-// ListAssets lists an organization's assets.
+// ListAssets lists an organization’s assets.
func (c *Client) ListAssets(ctx context.Context, req *securitycenterpb.ListAssetsRequest, opts ...gax.CallOption) *ListAssetsResponse_ListAssetsResultIterator {
md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent())))
ctx = insertMetadata(ctx, c.xGoogMetadata, md)
@@ -369,6 +460,8 @@
if err != nil {
return nil, "", err
}
+
+ it.Response = resp
return resp.ListAssetsResults, resp.NextPageToken, nil
}
fetch := func(pageSize int, pageToken string) (string, error) {
@@ -385,10 +478,10 @@
return it
}
-// ListFindings lists an organization or source's findings.
+// ListFindings lists an organization or source’s findings.
//
// To list across all sources provide a - as the source id.
-// Example: /v1/organizations/123/sources/-/findings
+// Example: /v1/organizations/{organization_id}/sources/-/findings
func (c *Client) ListFindings(ctx context.Context, req *securitycenterpb.ListFindingsRequest, opts ...gax.CallOption) *ListFindingsResponse_ListFindingsResultIterator {
md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent())))
ctx = insertMetadata(ctx, c.xGoogMetadata, md)
@@ -411,6 +504,8 @@
if err != nil {
return nil, "", err
}
+
+ it.Response = resp
return resp.ListFindingsResults, resp.NextPageToken, nil
}
fetch := func(pageSize int, pageToken string) (string, error) {
@@ -450,6 +545,8 @@
if err != nil {
return nil, "", err
}
+
+ it.Response = resp
return resp.Sources, resp.NextPageToken, nil
}
fetch := func(pageSize int, pageToken string) (string, error) {
@@ -559,7 +656,7 @@
return resp, nil
}
-// UpdateOrganizationSettings updates an organization's settings.
+// UpdateOrganizationSettings updates an organization’s settings.
func (c *Client) UpdateOrganizationSettings(ctx context.Context, req *securitycenterpb.UpdateOrganizationSettingsRequest, opts ...gax.CallOption) (*securitycenterpb.OrganizationSettings, error) {
md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "organization_settings.name", url.QueryEscape(req.GetOrganizationSettings().GetName())))
ctx = insertMetadata(ctx, c.xGoogMetadata, md)
@@ -610,12 +707,86 @@
return resp, nil
}
+// RunAssetDiscoveryOperation manages a long-running operation from RunAssetDiscovery.
+type RunAssetDiscoveryOperation struct {
+ lro *longrunning.Operation
+}
+
+// RunAssetDiscoveryOperation returns a new RunAssetDiscoveryOperation from a given name.
+// The name must be that of a previously created RunAssetDiscoveryOperation, possibly from a different process.
+func (c *Client) RunAssetDiscoveryOperation(name string) *RunAssetDiscoveryOperation {
+ return &RunAssetDiscoveryOperation{
+ 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 *RunAssetDiscoveryOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*securitycenterpb.RunAssetDiscoveryResponse, error) {
+ var resp securitycenterpb.RunAssetDiscoveryResponse
+ 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 *RunAssetDiscoveryOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*securitycenterpb.RunAssetDiscoveryResponse, error) {
+ var resp securitycenterpb.RunAssetDiscoveryResponse
+ 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 *RunAssetDiscoveryOperation) Metadata() (*emptypb.Empty, error) {
+ var meta emptypb.Empty
+ 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 *RunAssetDiscoveryOperation) 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 *RunAssetDiscoveryOperation) Name() string {
+ return op.lro.Name()
+}
+
// GroupResultIterator manages a stream of *securitycenterpb.GroupResult.
type GroupResultIterator struct {
items []*securitycenterpb.GroupResult
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.
//
@@ -658,6 +829,11 @@
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.
//
@@ -700,6 +876,11 @@
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.
//
@@ -742,6 +923,11 @@
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.
//
@@ -777,56 +963,3 @@
it.items = nil
return b
}
-
-// RunAssetDiscoveryOperation manages a long-running operation from RunAssetDiscovery.
-type RunAssetDiscoveryOperation struct {
- lro *longrunning.Operation
-}
-
-// RunAssetDiscoveryOperation returns a new RunAssetDiscoveryOperation from a given name.
-// The name must be that of a previously created RunAssetDiscoveryOperation, possibly from a different process.
-func (c *Client) RunAssetDiscoveryOperation(name string) *RunAssetDiscoveryOperation {
- return &RunAssetDiscoveryOperation{
- 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 *RunAssetDiscoveryOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*securitycenterpb.RunAssetDiscoveryResponse, error) {
- var resp securitycenterpb.RunAssetDiscoveryResponse
- if err := op.lro.WaitWithInterval(ctx, &resp, 5000*time.Millisecond, opts...); err != nil {
- return nil, err
- }
- return &resp, nil
-}
-
-// Poll fetches the latest state of the long-running operation.
-//
-// 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 *RunAssetDiscoveryOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*securitycenterpb.RunAssetDiscoveryResponse, error) {
- var resp securitycenterpb.RunAssetDiscoveryResponse
- if err := op.lro.Poll(ctx, &resp, opts...); err != nil {
- return nil, err
- }
- if !op.Done() {
- return nil, nil
- }
- return &resp, nil
-}
-
-// Done reports whether the long-running operation has completed.
-func (op *RunAssetDiscoveryOperation) 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 *RunAssetDiscoveryOperation) Name() string {
- return op.lro.Name()
-}
diff --git a/securitycenter/apiv1/security_center_client_example_test.go b/securitycenter/apiv1/security_center_client_example_test.go
index 5767f2c..1106963 100644
--- a/securitycenter/apiv1/security_center_client_example_test.go
+++ b/securitycenter/apiv1/security_center_client_example_test.go
@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-// Code generated by gapic-generator. DO NOT EDIT.
+// Code generated by protoc-gen-go_gapic. DO NOT EDIT.
package securitycenter_test
@@ -36,6 +36,8 @@
}
func ExampleClient_CreateSource() {
+ // import securitycenterpb "google.golang.org/genproto/googleapis/cloud/securitycenter/v1"
+
ctx := context.Background()
c, err := securitycenter.NewClient(ctx)
if err != nil {
@@ -54,6 +56,8 @@
}
func ExampleClient_CreateFinding() {
+ // import securitycenterpb "google.golang.org/genproto/googleapis/cloud/securitycenter/v1"
+
ctx := context.Background()
c, err := securitycenter.NewClient(ctx)
if err != nil {
@@ -72,6 +76,8 @@
}
func ExampleClient_GetIamPolicy() {
+ // import iampb "google.golang.org/genproto/googleapis/iam/v1"
+
ctx := context.Background()
c, err := securitycenter.NewClient(ctx)
if err != nil {
@@ -90,6 +96,8 @@
}
func ExampleClient_GetOrganizationSettings() {
+ // import securitycenterpb "google.golang.org/genproto/googleapis/cloud/securitycenter/v1"
+
ctx := context.Background()
c, err := securitycenter.NewClient(ctx)
if err != nil {
@@ -108,6 +116,8 @@
}
func ExampleClient_GetSource() {
+ // import securitycenterpb "google.golang.org/genproto/googleapis/cloud/securitycenter/v1"
+
ctx := context.Background()
c, err := securitycenter.NewClient(ctx)
if err != nil {
@@ -126,6 +136,9 @@
}
func ExampleClient_GroupAssets() {
+ // import securitycenterpb "google.golang.org/genproto/googleapis/cloud/securitycenter/v1"
+ // import "google.golang.org/api/iterator"
+
ctx := context.Background()
c, err := securitycenter.NewClient(ctx)
if err != nil {
@@ -150,6 +163,9 @@
}
func ExampleClient_GroupFindings() {
+ // import securitycenterpb "google.golang.org/genproto/googleapis/cloud/securitycenter/v1"
+ // import "google.golang.org/api/iterator"
+
ctx := context.Background()
c, err := securitycenter.NewClient(ctx)
if err != nil {
@@ -174,6 +190,9 @@
}
func ExampleClient_ListAssets() {
+ // import securitycenterpb "google.golang.org/genproto/googleapis/cloud/securitycenter/v1"
+ // import "google.golang.org/api/iterator"
+
ctx := context.Background()
c, err := securitycenter.NewClient(ctx)
if err != nil {
@@ -198,6 +217,9 @@
}
func ExampleClient_ListFindings() {
+ // import securitycenterpb "google.golang.org/genproto/googleapis/cloud/securitycenter/v1"
+ // import "google.golang.org/api/iterator"
+
ctx := context.Background()
c, err := securitycenter.NewClient(ctx)
if err != nil {
@@ -222,6 +244,9 @@
}
func ExampleClient_ListSources() {
+ // import securitycenterpb "google.golang.org/genproto/googleapis/cloud/securitycenter/v1"
+ // import "google.golang.org/api/iterator"
+
ctx := context.Background()
c, err := securitycenter.NewClient(ctx)
if err != nil {
@@ -246,6 +271,8 @@
}
func ExampleClient_RunAssetDiscovery() {
+ // import securitycenterpb "google.golang.org/genproto/googleapis/cloud/securitycenter/v1"
+
ctx := context.Background()
c, err := securitycenter.NewClient(ctx)
if err != nil {
@@ -269,6 +296,8 @@
}
func ExampleClient_SetFindingState() {
+ // import securitycenterpb "google.golang.org/genproto/googleapis/cloud/securitycenter/v1"
+
ctx := context.Background()
c, err := securitycenter.NewClient(ctx)
if err != nil {
@@ -287,6 +316,8 @@
}
func ExampleClient_SetIamPolicy() {
+ // import iampb "google.golang.org/genproto/googleapis/iam/v1"
+
ctx := context.Background()
c, err := securitycenter.NewClient(ctx)
if err != nil {
@@ -305,6 +336,8 @@
}
func ExampleClient_TestIamPermissions() {
+ // import iampb "google.golang.org/genproto/googleapis/iam/v1"
+
ctx := context.Background()
c, err := securitycenter.NewClient(ctx)
if err != nil {
@@ -323,6 +356,8 @@
}
func ExampleClient_UpdateFinding() {
+ // import securitycenterpb "google.golang.org/genproto/googleapis/cloud/securitycenter/v1"
+
ctx := context.Background()
c, err := securitycenter.NewClient(ctx)
if err != nil {
@@ -341,6 +376,8 @@
}
func ExampleClient_UpdateOrganizationSettings() {
+ // import securitycenterpb "google.golang.org/genproto/googleapis/cloud/securitycenter/v1"
+
ctx := context.Background()
c, err := securitycenter.NewClient(ctx)
if err != nil {
@@ -359,6 +396,8 @@
}
func ExampleClient_UpdateSource() {
+ // import securitycenterpb "google.golang.org/genproto/googleapis/cloud/securitycenter/v1"
+
ctx := context.Background()
c, err := securitycenter.NewClient(ctx)
if err != nil {
@@ -377,6 +416,8 @@
}
func ExampleClient_UpdateSecurityMarks() {
+ // import securitycenterpb "google.golang.org/genproto/googleapis/cloud/securitycenter/v1"
+
ctx := context.Background()
c, err := securitycenter.NewClient(ctx)
if err != nil {
diff --git a/securitycenter/apiv1beta1/doc.go b/securitycenter/apiv1beta1/doc.go
index 6497154..e9d1f79 100644
--- a/securitycenter/apiv1beta1/doc.go
+++ b/securitycenter/apiv1beta1/doc.go
@@ -98,4 +98,4 @@
return "UNKNOWN"
}
-const versionClient = "UNKNOWN"
+const versionClient = "20191216"
diff --git a/spanner/admin/database/apiv1/database_admin_client.go b/spanner/admin/database/apiv1/database_admin_client.go
index 6f76cef..f1d0cd4 100644
--- a/spanner/admin/database/apiv1/database_admin_client.go
+++ b/spanner/admin/database/apiv1/database_admin_client.go
@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-// Code generated by gapic-generator. DO NOT EDIT.
+// Code generated by protoc-gen-go_gapic. DO NOT EDIT.
package database
@@ -40,6 +40,7 @@
// DatabaseAdminCallOptions contains the retry settings for each method of DatabaseAdminClient.
type DatabaseAdminCallOptions struct {
+ ListDatabases []gax.CallOption
CreateDatabase []gax.CallOption
GetDatabase []gax.CallOption
UpdateDatabaseDdl []gax.CallOption
@@ -48,12 +49,12 @@
SetIamPolicy []gax.CallOption
GetIamPolicy []gax.CallOption
TestIamPermissions []gax.CallOption
- ListDatabases []gax.CallOption
}
func defaultDatabaseAdminClientOptions() []option.ClientOption {
return []option.ClientOption{
option.WithEndpoint("spanner.googleapis.com:443"),
+ option.WithGRPCDialOption(grpc.WithDisableServiceConfig()),
option.WithScopes(DefaultAuthScopes()...),
option.WithGRPCDialOption(grpc.WithDefaultCallOptions(
grpc.MaxCallRecvMsgSize(math.MaxInt32))),
@@ -61,30 +62,82 @@
}
func defaultDatabaseAdminCallOptions() *DatabaseAdminCallOptions {
- retry := map[[2]string][]gax.CallOption{
- {"default", "idempotent"}: {
+ return &DatabaseAdminCallOptions{
+ ListDatabases: []gax.CallOption{
gax.WithRetry(func() gax.Retryer {
return gax.OnCodes([]codes.Code{
- codes.DeadlineExceeded,
codes.Unavailable,
+ codes.DeadlineExceeded,
}, gax.Backoff{
Initial: 1000 * time.Millisecond,
Max: 32000 * time.Millisecond,
- Multiplier: 1.3,
+ Multiplier: 1.30,
})
}),
},
- }
- return &DatabaseAdminCallOptions{
- CreateDatabase: retry[[2]string{"default", "non_idempotent"}],
- GetDatabase: retry[[2]string{"default", "idempotent"}],
- UpdateDatabaseDdl: retry[[2]string{"default", "idempotent"}],
- DropDatabase: retry[[2]string{"default", "idempotent"}],
- GetDatabaseDdl: retry[[2]string{"default", "idempotent"}],
- SetIamPolicy: retry[[2]string{"default", "non_idempotent"}],
- GetIamPolicy: retry[[2]string{"default", "idempotent"}],
- TestIamPermissions: retry[[2]string{"default", "non_idempotent"}],
- ListDatabases: retry[[2]string{"default", "idempotent"}],
+ CreateDatabase: []gax.CallOption{},
+ GetDatabase: []gax.CallOption{
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnCodes([]codes.Code{
+ codes.Unavailable,
+ codes.DeadlineExceeded,
+ }, gax.Backoff{
+ Initial: 1000 * time.Millisecond,
+ Max: 32000 * time.Millisecond,
+ Multiplier: 1.30,
+ })
+ }),
+ },
+ UpdateDatabaseDdl: []gax.CallOption{
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnCodes([]codes.Code{
+ codes.Unavailable,
+ codes.DeadlineExceeded,
+ }, gax.Backoff{
+ Initial: 1000 * time.Millisecond,
+ Max: 32000 * time.Millisecond,
+ Multiplier: 1.30,
+ })
+ }),
+ },
+ DropDatabase: []gax.CallOption{
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnCodes([]codes.Code{
+ codes.Unavailable,
+ codes.DeadlineExceeded,
+ }, gax.Backoff{
+ Initial: 1000 * time.Millisecond,
+ Max: 32000 * time.Millisecond,
+ Multiplier: 1.30,
+ })
+ }),
+ },
+ GetDatabaseDdl: []gax.CallOption{
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnCodes([]codes.Code{
+ codes.Unavailable,
+ codes.DeadlineExceeded,
+ }, gax.Backoff{
+ Initial: 1000 * time.Millisecond,
+ Max: 32000 * time.Millisecond,
+ Multiplier: 1.30,
+ })
+ }),
+ },
+ SetIamPolicy: []gax.CallOption{},
+ GetIamPolicy: []gax.CallOption{
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnCodes([]codes.Code{
+ codes.Unavailable,
+ codes.DeadlineExceeded,
+ }, gax.Backoff{
+ Initial: 1000 * time.Millisecond,
+ Max: 32000 * time.Millisecond,
+ Multiplier: 1.30,
+ })
+ }),
+ },
+ TestIamPermissions: []gax.CallOption{},
}
}
@@ -163,6 +216,47 @@
c.xGoogMetadata = metadata.Pairs("x-goog-api-client", gax.XGoogHeader(kv...))
}
+// ListDatabases lists Cloud Spanner databases.
+func (c *DatabaseAdminClient) ListDatabases(ctx context.Context, req *databasepb.ListDatabasesRequest, opts ...gax.CallOption) *DatabaseIterator {
+ 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.ListDatabases[0:len(c.CallOptions.ListDatabases):len(c.CallOptions.ListDatabases)], opts...)
+ it := &DatabaseIterator{}
+ req = proto.Clone(req).(*databasepb.ListDatabasesRequest)
+ it.InternalFetch = func(pageSize int, pageToken string) ([]*databasepb.Database, string, error) {
+ var resp *databasepb.ListDatabasesResponse
+ 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.databaseAdminClient.ListDatabases(ctx, req, settings.GRPC...)
+ return err
+ }, opts...)
+ if err != nil {
+ return nil, "", err
+ }
+
+ it.Response = resp
+ return resp.Databases, resp.NextPageToken, 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.PageSize)
+ it.pageInfo.Token = req.PageToken
+ return it
+}
+
// CreateDatabase creates a new Cloud Spanner database and starts to prepare it for serving.
// The returned [long-running operation][google.longrunning.Operation] will
// have a name of the format <database_name>/operations/<operation_id> and
@@ -329,87 +423,6 @@
return resp, nil
}
-// ListDatabases lists Cloud Spanner databases.
-func (c *DatabaseAdminClient) ListDatabases(ctx context.Context, req *databasepb.ListDatabasesRequest, opts ...gax.CallOption) *DatabaseIterator {
- 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.ListDatabases[0:len(c.CallOptions.ListDatabases):len(c.CallOptions.ListDatabases)], opts...)
- it := &DatabaseIterator{}
- req = proto.Clone(req).(*databasepb.ListDatabasesRequest)
- it.InternalFetch = func(pageSize int, pageToken string) ([]*databasepb.Database, string, error) {
- var resp *databasepb.ListDatabasesResponse
- 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.databaseAdminClient.ListDatabases(ctx, req, settings.GRPC...)
- return err
- }, opts...)
- if err != nil {
- return nil, "", err
- }
- return resp.Databases, resp.NextPageToken, 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.PageSize)
- it.pageInfo.Token = req.PageToken
- return it
-}
-
-// DatabaseIterator manages a stream of *databasepb.Database.
-type DatabaseIterator struct {
- items []*databasepb.Database
- pageInfo *iterator.PageInfo
- nextFunc func() error
-
- // 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 []*databasepb.Database, nextPageToken string, err error)
-}
-
-// PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
-func (it *DatabaseIterator) 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 *DatabaseIterator) Next() (*databasepb.Database, error) {
- var item *databasepb.Database
- if err := it.nextFunc(); err != nil {
- return item, err
- }
- item = it.items[0]
- it.items = it.items[1:]
- return item, nil
-}
-
-func (it *DatabaseIterator) bufLen() int {
- return len(it.items)
-}
-
-func (it *DatabaseIterator) takeBuf() interface{} {
- b := it.items
- it.items = nil
- return b
-}
-
// CreateDatabaseOperation manages a long-running operation from CreateDatabase.
type CreateDatabaseOperation struct {
lro *longrunning.Operation
@@ -428,7 +441,7 @@
// See documentation of Poll for error-handling information.
func (op *CreateDatabaseOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*databasepb.Database, error) {
var resp databasepb.Database
- if err := op.lro.WaitWithInterval(ctx, &resp, 45000*time.Millisecond, opts...); err != nil {
+ if err := op.lro.WaitWithInterval(ctx, &resp, time.Minute, opts...); err != nil {
return nil, err
}
return &resp, nil
@@ -492,11 +505,11 @@
}
}
-// Wait blocks until the long-running operation is completed, returning any error encountered.
+// 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 *UpdateDatabaseDdlOperation) Wait(ctx context.Context, opts ...gax.CallOption) error {
- return op.lro.WaitWithInterval(ctx, nil, 45000*time.Millisecond, opts...)
+ return op.lro.WaitWithInterval(ctx, nil, time.Minute, opts...)
}
// Poll fetches the latest state of the long-running operation.
@@ -505,7 +518,9 @@
//
// 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.
+// 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 *UpdateDatabaseDdlOperation) Poll(ctx context.Context, opts ...gax.CallOption) error {
return op.lro.Poll(ctx, nil, opts...)
}
@@ -534,3 +549,50 @@
func (op *UpdateDatabaseDdlOperation) Name() string {
return op.lro.Name()
}
+
+// DatabaseIterator manages a stream of *databasepb.Database.
+type DatabaseIterator struct {
+ items []*databasepb.Database
+ 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 []*databasepb.Database, nextPageToken string, err error)
+}
+
+// PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
+func (it *DatabaseIterator) 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 *DatabaseIterator) Next() (*databasepb.Database, error) {
+ var item *databasepb.Database
+ if err := it.nextFunc(); err != nil {
+ return item, err
+ }
+ item = it.items[0]
+ it.items = it.items[1:]
+ return item, nil
+}
+
+func (it *DatabaseIterator) bufLen() int {
+ return len(it.items)
+}
+
+func (it *DatabaseIterator) takeBuf() interface{} {
+ b := it.items
+ it.items = nil
+ return b
+}
diff --git a/spanner/admin/database/apiv1/database_admin_client_example_test.go b/spanner/admin/database/apiv1/database_admin_client_example_test.go
index 9612123..fef5bb6 100644
--- a/spanner/admin/database/apiv1/database_admin_client_example_test.go
+++ b/spanner/admin/database/apiv1/database_admin_client_example_test.go
@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-// Code generated by gapic-generator. DO NOT EDIT.
+// Code generated by protoc-gen-go_gapic. DO NOT EDIT.
package database_test
@@ -35,7 +35,36 @@
_ = c
}
+func ExampleDatabaseAdminClient_ListDatabases() {
+ // import databasepb "google.golang.org/genproto/googleapis/spanner/admin/database/v1"
+ // import "google.golang.org/api/iterator"
+
+ ctx := context.Background()
+ c, err := database.NewDatabaseAdminClient(ctx)
+ if err != nil {
+ // TODO: Handle error.
+ }
+
+ req := &databasepb.ListDatabasesRequest{
+ // TODO: Fill request struct fields.
+ }
+ it := c.ListDatabases(ctx, req)
+ for {
+ resp, err := it.Next()
+ if err == iterator.Done {
+ break
+ }
+ if err != nil {
+ // TODO: Handle error.
+ }
+ // TODO: Use resp.
+ _ = resp
+ }
+}
+
func ExampleDatabaseAdminClient_CreateDatabase() {
+ // import databasepb "google.golang.org/genproto/googleapis/spanner/admin/database/v1"
+
ctx := context.Background()
c, err := database.NewDatabaseAdminClient(ctx)
if err != nil {
@@ -59,6 +88,8 @@
}
func ExampleDatabaseAdminClient_GetDatabase() {
+ // import databasepb "google.golang.org/genproto/googleapis/spanner/admin/database/v1"
+
ctx := context.Background()
c, err := database.NewDatabaseAdminClient(ctx)
if err != nil {
@@ -77,6 +108,8 @@
}
func ExampleDatabaseAdminClient_UpdateDatabaseDdl() {
+ // import databasepb "google.golang.org/genproto/googleapis/spanner/admin/database/v1"
+
ctx := context.Background()
c, err := database.NewDatabaseAdminClient(ctx)
if err != nil {
@@ -92,7 +125,9 @@
}
err = op.Wait(ctx)
- // TODO: Handle error.
+ if err != nil {
+ // TODO: Handle error.
+ }
}
func ExampleDatabaseAdminClient_DropDatabase() {
@@ -112,6 +147,8 @@
}
func ExampleDatabaseAdminClient_GetDatabaseDdl() {
+ // import databasepb "google.golang.org/genproto/googleapis/spanner/admin/database/v1"
+
ctx := context.Background()
c, err := database.NewDatabaseAdminClient(ctx)
if err != nil {
@@ -130,6 +167,8 @@
}
func ExampleDatabaseAdminClient_SetIamPolicy() {
+ // import iampb "google.golang.org/genproto/googleapis/iam/v1"
+
ctx := context.Background()
c, err := database.NewDatabaseAdminClient(ctx)
if err != nil {
@@ -148,6 +187,8 @@
}
func ExampleDatabaseAdminClient_GetIamPolicy() {
+ // import iampb "google.golang.org/genproto/googleapis/iam/v1"
+
ctx := context.Background()
c, err := database.NewDatabaseAdminClient(ctx)
if err != nil {
@@ -166,6 +207,8 @@
}
func ExampleDatabaseAdminClient_TestIamPermissions() {
+ // import iampb "google.golang.org/genproto/googleapis/iam/v1"
+
ctx := context.Background()
c, err := database.NewDatabaseAdminClient(ctx)
if err != nil {
@@ -182,27 +225,3 @@
// TODO: Use resp.
_ = resp
}
-
-func ExampleDatabaseAdminClient_ListDatabases() {
- ctx := context.Background()
- c, err := database.NewDatabaseAdminClient(ctx)
- if err != nil {
- // TODO: Handle error.
- }
-
- req := &databasepb.ListDatabasesRequest{
- // TODO: Fill request struct fields.
- }
- it := c.ListDatabases(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/spanner/admin/database/apiv1/doc.go b/spanner/admin/database/apiv1/doc.go
index 64699eb..551716e 100644
--- a/spanner/admin/database/apiv1/doc.go
+++ b/spanner/admin/database/apiv1/doc.go
@@ -12,14 +12,13 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-// Code generated by gapic-generator. DO NOT EDIT.
+// Code generated by protoc-gen-go_gapic. DO NOT EDIT.
// Package database is an auto-generated package for the
// Cloud Spanner Database Admin 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
@@ -30,6 +29,7 @@
//
// For information about setting deadlines, reusing contexts, and more
// please visit godoc.org/cloud.google.com/go.
+
package database // import "cloud.google.com/go/spanner/admin/database/apiv1"
import (
@@ -41,6 +41,8 @@
"google.golang.org/grpc/metadata"
)
+const versionClient = "20191216"
+
func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context {
out, _ := metadata.FromOutgoingContext(ctx)
out = out.Copy()
@@ -75,7 +77,7 @@
}
notSemverRune := func(r rune) bool {
- return strings.IndexRune("0123456789.", r) < 0
+ return !strings.ContainsRune("0123456789.", r)
}
if strings.HasPrefix(s, "go1") {
@@ -96,5 +98,3 @@
}
return "UNKNOWN"
}
-
-const versionClient = "20191206"
diff --git a/spanner/admin/instance/apiv1/doc.go b/spanner/admin/instance/apiv1/doc.go
index 66c3c89..69aeb52 100644
--- a/spanner/admin/instance/apiv1/doc.go
+++ b/spanner/admin/instance/apiv1/doc.go
@@ -12,14 +12,13 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-// Code generated by gapic-generator. DO NOT EDIT.
+// Code generated by protoc-gen-go_gapic. DO NOT EDIT.
// Package instance is an auto-generated package for the
// Cloud Spanner Instance Admin 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
@@ -30,6 +29,7 @@
//
// For information about setting deadlines, reusing contexts, and more
// please visit godoc.org/cloud.google.com/go.
+
package instance // import "cloud.google.com/go/spanner/admin/instance/apiv1"
import (
@@ -41,6 +41,8 @@
"google.golang.org/grpc/metadata"
)
+const versionClient = "20191216"
+
func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context {
out, _ := metadata.FromOutgoingContext(ctx)
out = out.Copy()
@@ -75,7 +77,7 @@
}
notSemverRune := func(r rune) bool {
- return strings.IndexRune("0123456789.", r) < 0
+ return !strings.ContainsRune("0123456789.", r)
}
if strings.HasPrefix(s, "go1") {
@@ -96,5 +98,3 @@
}
return "UNKNOWN"
}
-
-const versionClient = "20191206"
diff --git a/spanner/admin/instance/apiv1/instance_admin_client.go b/spanner/admin/instance/apiv1/instance_admin_client.go
index c09a141..6f38e4a 100644
--- a/spanner/admin/instance/apiv1/instance_admin_client.go
+++ b/spanner/admin/instance/apiv1/instance_admin_client.go
@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-// Code generated by gapic-generator. DO NOT EDIT.
+// Code generated by protoc-gen-go_gapic. DO NOT EDIT.
package instance
@@ -55,6 +55,7 @@
func defaultInstanceAdminClientOptions() []option.ClientOption {
return []option.ClientOption{
option.WithEndpoint("spanner.googleapis.com:443"),
+ option.WithGRPCDialOption(grpc.WithDisableServiceConfig()),
option.WithScopes(DefaultAuthScopes()...),
option.WithGRPCDialOption(grpc.WithDefaultCallOptions(
grpc.MaxCallRecvMsgSize(math.MaxInt32))),
@@ -62,31 +63,83 @@
}
func defaultInstanceAdminCallOptions() *InstanceAdminCallOptions {
- retry := map[[2]string][]gax.CallOption{
- {"default", "idempotent"}: {
+ return &InstanceAdminCallOptions{
+ ListInstanceConfigs: []gax.CallOption{
gax.WithRetry(func() gax.Retryer {
return gax.OnCodes([]codes.Code{
- codes.DeadlineExceeded,
codes.Unavailable,
+ codes.DeadlineExceeded,
}, gax.Backoff{
Initial: 1000 * time.Millisecond,
Max: 32000 * time.Millisecond,
- Multiplier: 1.3,
+ Multiplier: 1.30,
})
}),
},
- }
- return &InstanceAdminCallOptions{
- ListInstanceConfigs: retry[[2]string{"default", "idempotent"}],
- GetInstanceConfig: retry[[2]string{"default", "idempotent"}],
- ListInstances: retry[[2]string{"default", "idempotent"}],
- GetInstance: retry[[2]string{"default", "idempotent"}],
- CreateInstance: retry[[2]string{"default", "non_idempotent"}],
- UpdateInstance: retry[[2]string{"default", "non_idempotent"}],
- DeleteInstance: retry[[2]string{"default", "idempotent"}],
- SetIamPolicy: retry[[2]string{"default", "non_idempotent"}],
- GetIamPolicy: retry[[2]string{"default", "idempotent"}],
- TestIamPermissions: retry[[2]string{"default", "non_idempotent"}],
+ GetInstanceConfig: []gax.CallOption{
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnCodes([]codes.Code{
+ codes.Unavailable,
+ codes.DeadlineExceeded,
+ }, gax.Backoff{
+ Initial: 1000 * time.Millisecond,
+ Max: 32000 * time.Millisecond,
+ Multiplier: 1.30,
+ })
+ }),
+ },
+ ListInstances: []gax.CallOption{
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnCodes([]codes.Code{
+ codes.Unavailable,
+ codes.DeadlineExceeded,
+ }, gax.Backoff{
+ Initial: 1000 * time.Millisecond,
+ Max: 32000 * time.Millisecond,
+ Multiplier: 1.30,
+ })
+ }),
+ },
+ GetInstance: []gax.CallOption{
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnCodes([]codes.Code{
+ codes.Unavailable,
+ codes.DeadlineExceeded,
+ }, gax.Backoff{
+ Initial: 1000 * time.Millisecond,
+ Max: 32000 * time.Millisecond,
+ Multiplier: 1.30,
+ })
+ }),
+ },
+ CreateInstance: []gax.CallOption{},
+ UpdateInstance: []gax.CallOption{},
+ DeleteInstance: []gax.CallOption{
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnCodes([]codes.Code{
+ codes.Unavailable,
+ codes.DeadlineExceeded,
+ }, gax.Backoff{
+ Initial: 1000 * time.Millisecond,
+ Max: 32000 * time.Millisecond,
+ Multiplier: 1.30,
+ })
+ }),
+ },
+ SetIamPolicy: []gax.CallOption{},
+ GetIamPolicy: []gax.CallOption{
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnCodes([]codes.Code{
+ codes.Unavailable,
+ codes.DeadlineExceeded,
+ }, gax.Backoff{
+ Initial: 1000 * time.Millisecond,
+ Max: 32000 * time.Millisecond,
+ Multiplier: 1.30,
+ })
+ }),
+ },
+ TestIamPermissions: []gax.CallOption{},
}
}
@@ -120,7 +173,7 @@
// modify and list instances. Instances are dedicated Cloud Spanner serving
// and storage resources to be used by Cloud Spanner databases.
//
-// Each instance has a "configuration", which dictates where the
+// Each instance has a “configuration”, which dictates where the
// serving resources for the Cloud Spanner instance are located (e.g.,
// US-central, Europe). Configurations are created by Google based on
// resource availability.
@@ -204,6 +257,8 @@
if err != nil {
return nil, "", err
}
+
+ it.Response = resp
return resp.InstanceConfigs, resp.NextPageToken, nil
}
fetch := func(pageSize int, pageToken string) (string, error) {
@@ -260,6 +315,8 @@
if err != nil {
return nil, "", err
}
+
+ it.Response = resp
return resp.Instances, resp.NextPageToken, nil
}
fetch := func(pageSize int, pageToken string) (string, error) {
@@ -321,9 +378,9 @@
//
// Databases can be created in the instance.
//
-// The instance's allocated resource levels are readable via the API.
+// The instance’s allocated resource levels are readable via the API.
//
-// The instance's state becomes READY.
+// The instance’s state becomes READY.
//
// The returned [long-running operation][google.longrunning.Operation] will
// have a name of the format <instance_name>/operations/<operation_id> and
@@ -358,12 +415,12 @@
//
// Immediately upon completion of this request:
//
-// For resource types for which a decrease in the instance's allocation
+// For resource types for which a decrease in the instance’s allocation
// has been requested, billing is based on the newly-requested level.
//
// Until completion of the returned operation:
//
-// Cancelling the operation sets its metadata's
+// Cancelling the operation sets its metadata’s
// [cancel_time][google.spanner.admin.instance.v1.UpdateInstanceMetadata.cancel_time], and begins
// restoring resources to their pre-request values. The operation
// is guaranteed to succeed at undoing all resource changes,
@@ -379,10 +436,10 @@
// Billing begins for all successfully-allocated resources (some types
// may have lower than the requested levels).
//
-// All newly-reserved resources are available for serving the instance's
+// All newly-reserved resources are available for serving the instance’s
// tables.
//
-// The instance's new resource levels are readable via the API.
+// The instance’s new resource levels are readable via the API.
//
// The returned [long-running operation][google.longrunning.Operation] will
// have a name of the format <instance_name>/operations/<operation_id> and
@@ -393,7 +450,7 @@
// [Instance][google.spanner.admin.instance.v1.Instance], if successful.
//
// Authorization requires spanner.instances.update permission on
-// resource [name][google.spanner.admin.instance.v1.Instance.name].
+// resource [name][google.spanner.admin.instance.v1.Instance.name (at http://google.spanner.admin.instance.v1.Instance.name)].
func (c *InstanceAdminClient) UpdateInstance(ctx context.Context, req *instancepb.UpdateInstanceRequest, opts ...gax.CallOption) (*UpdateInstanceOperation, error) {
md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "instance.name", url.QueryEscape(req.GetInstance().GetName())))
ctx = insertMetadata(ctx, c.xGoogMetadata, md)
@@ -416,7 +473,7 @@
//
// Immediately upon completion of the request:
//
-// Billing ceases for all of the instance's reserved resources.
+// Billing ceases for all of the instance’s reserved resources.
//
// Soon afterward:
//
@@ -499,90 +556,6 @@
return resp, nil
}
-// InstanceConfigIterator manages a stream of *instancepb.InstanceConfig.
-type InstanceConfigIterator struct {
- items []*instancepb.InstanceConfig
- pageInfo *iterator.PageInfo
- nextFunc func() error
-
- // 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 []*instancepb.InstanceConfig, nextPageToken string, err error)
-}
-
-// PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
-func (it *InstanceConfigIterator) 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 *InstanceConfigIterator) Next() (*instancepb.InstanceConfig, error) {
- var item *instancepb.InstanceConfig
- if err := it.nextFunc(); err != nil {
- return item, err
- }
- item = it.items[0]
- it.items = it.items[1:]
- return item, nil
-}
-
-func (it *InstanceConfigIterator) bufLen() int {
- return len(it.items)
-}
-
-func (it *InstanceConfigIterator) takeBuf() interface{} {
- b := it.items
- it.items = nil
- return b
-}
-
-// InstanceIterator manages a stream of *instancepb.Instance.
-type InstanceIterator struct {
- items []*instancepb.Instance
- pageInfo *iterator.PageInfo
- nextFunc func() error
-
- // 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 []*instancepb.Instance, nextPageToken string, err error)
-}
-
-// PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
-func (it *InstanceIterator) PageInfo() *iterator.PageInfo {
- return it.pageInfo
-}
-
-// Next returns the next result. Its second return value is iterator.Done if there are no more
-// results. Once Next returns Done, all subsequent calls will return Done.
-func (it *InstanceIterator) Next() (*instancepb.Instance, error) {
- var item *instancepb.Instance
- if err := it.nextFunc(); err != nil {
- return item, err
- }
- item = it.items[0]
- it.items = it.items[1:]
- return item, nil
-}
-
-func (it *InstanceIterator) bufLen() int {
- return len(it.items)
-}
-
-func (it *InstanceIterator) takeBuf() interface{} {
- b := it.items
- it.items = nil
- return b
-}
-
// CreateInstanceOperation manages a long-running operation from CreateInstance.
type CreateInstanceOperation struct {
lro *longrunning.Operation
@@ -601,7 +574,7 @@
// See documentation of Poll for error-handling information.
func (op *CreateInstanceOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*instancepb.Instance, error) {
var resp instancepb.Instance
- if err := op.lro.WaitWithInterval(ctx, &resp, 45000*time.Millisecond, opts...); err != nil {
+ if err := op.lro.WaitWithInterval(ctx, &resp, time.Minute, opts...); err != nil {
return nil, err
}
return &resp, nil
@@ -670,7 +643,7 @@
// See documentation of Poll for error-handling information.
func (op *UpdateInstanceOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*instancepb.Instance, error) {
var resp instancepb.Instance
- if err := op.lro.WaitWithInterval(ctx, &resp, 45000*time.Millisecond, opts...); err != nil {
+ if err := op.lro.WaitWithInterval(ctx, &resp, time.Minute, opts...); err != nil {
return nil, err
}
return &resp, nil
@@ -720,3 +693,97 @@
func (op *UpdateInstanceOperation) Name() string {
return op.lro.Name()
}
+
+// InstanceConfigIterator manages a stream of *instancepb.InstanceConfig.
+type InstanceConfigIterator struct {
+ items []*instancepb.InstanceConfig
+ 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 []*instancepb.InstanceConfig, nextPageToken string, err error)
+}
+
+// PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
+func (it *InstanceConfigIterator) 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 *InstanceConfigIterator) Next() (*instancepb.InstanceConfig, error) {
+ var item *instancepb.InstanceConfig
+ if err := it.nextFunc(); err != nil {
+ return item, err
+ }
+ item = it.items[0]
+ it.items = it.items[1:]
+ return item, nil
+}
+
+func (it *InstanceConfigIterator) bufLen() int {
+ return len(it.items)
+}
+
+func (it *InstanceConfigIterator) takeBuf() interface{} {
+ b := it.items
+ it.items = nil
+ return b
+}
+
+// InstanceIterator manages a stream of *instancepb.Instance.
+type InstanceIterator struct {
+ items []*instancepb.Instance
+ pageInfo *iterator.PageInfo
+ nextFunc func() error
+
+ // Response is the raw response for the current page.
+ // It must be cast to the RPC response type.
+ // Calling Next() or InternalFetch() updates this value.
+ Response interface{}
+
+ // InternalFetch is for use by the Google Cloud Libraries only.
+ // It is not part of the stable interface of this package.
+ //
+ // InternalFetch returns results from a single call to the underlying RPC.
+ // The number of results is no greater than pageSize.
+ // If there are no more results, nextPageToken is empty and err is nil.
+ InternalFetch func(pageSize int, pageToken string) (results []*instancepb.Instance, nextPageToken string, err error)
+}
+
+// PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
+func (it *InstanceIterator) PageInfo() *iterator.PageInfo {
+ return it.pageInfo
+}
+
+// Next returns the next result. Its second return value is iterator.Done if there are no more
+// results. Once Next returns Done, all subsequent calls will return Done.
+func (it *InstanceIterator) Next() (*instancepb.Instance, error) {
+ var item *instancepb.Instance
+ if err := it.nextFunc(); err != nil {
+ return item, err
+ }
+ item = it.items[0]
+ it.items = it.items[1:]
+ return item, nil
+}
+
+func (it *InstanceIterator) bufLen() int {
+ return len(it.items)
+}
+
+func (it *InstanceIterator) takeBuf() interface{} {
+ b := it.items
+ it.items = nil
+ return b
+}
diff --git a/spanner/admin/instance/apiv1/instance_admin_client_example_test.go b/spanner/admin/instance/apiv1/instance_admin_client_example_test.go
index e3441cb..7e5a9c4 100644
--- a/spanner/admin/instance/apiv1/instance_admin_client_example_test.go
+++ b/spanner/admin/instance/apiv1/instance_admin_client_example_test.go
@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-// Code generated by gapic-generator. DO NOT EDIT.
+// Code generated by protoc-gen-go_gapic. DO NOT EDIT.
package instance_test
@@ -36,6 +36,9 @@
}
func ExampleInstanceAdminClient_ListInstanceConfigs() {
+ // import instancepb "google.golang.org/genproto/googleapis/spanner/admin/instance/v1"
+ // import "google.golang.org/api/iterator"
+
ctx := context.Background()
c, err := instance.NewInstanceAdminClient(ctx)
if err != nil {
@@ -60,6 +63,8 @@
}
func ExampleInstanceAdminClient_GetInstanceConfig() {
+ // import instancepb "google.golang.org/genproto/googleapis/spanner/admin/instance/v1"
+
ctx := context.Background()
c, err := instance.NewInstanceAdminClient(ctx)
if err != nil {
@@ -78,6 +83,9 @@
}
func ExampleInstanceAdminClient_ListInstances() {
+ // import instancepb "google.golang.org/genproto/googleapis/spanner/admin/instance/v1"
+ // import "google.golang.org/api/iterator"
+
ctx := context.Background()
c, err := instance.NewInstanceAdminClient(ctx)
if err != nil {
@@ -102,6 +110,8 @@
}
func ExampleInstanceAdminClient_GetInstance() {
+ // import instancepb "google.golang.org/genproto/googleapis/spanner/admin/instance/v1"
+
ctx := context.Background()
c, err := instance.NewInstanceAdminClient(ctx)
if err != nil {
@@ -120,6 +130,8 @@
}
func ExampleInstanceAdminClient_CreateInstance() {
+ // import instancepb "google.golang.org/genproto/googleapis/spanner/admin/instance/v1"
+
ctx := context.Background()
c, err := instance.NewInstanceAdminClient(ctx)
if err != nil {
@@ -143,6 +155,8 @@
}
func ExampleInstanceAdminClient_UpdateInstance() {
+ // import instancepb "google.golang.org/genproto/googleapis/spanner/admin/instance/v1"
+
ctx := context.Background()
c, err := instance.NewInstanceAdminClient(ctx)
if err != nil {
@@ -182,6 +196,8 @@
}
func ExampleInstanceAdminClient_SetIamPolicy() {
+ // import iampb "google.golang.org/genproto/googleapis/iam/v1"
+
ctx := context.Background()
c, err := instance.NewInstanceAdminClient(ctx)
if err != nil {
@@ -200,6 +216,8 @@
}
func ExampleInstanceAdminClient_GetIamPolicy() {
+ // import iampb "google.golang.org/genproto/googleapis/iam/v1"
+
ctx := context.Background()
c, err := instance.NewInstanceAdminClient(ctx)
if err != nil {
@@ -218,6 +236,8 @@
}
func ExampleInstanceAdminClient_TestIamPermissions() {
+ // import iampb "google.golang.org/genproto/googleapis/iam/v1"
+
ctx := context.Background()
c, err := instance.NewInstanceAdminClient(ctx)
if err != nil {
diff --git a/spanner/apiv1/doc.go b/spanner/apiv1/doc.go
index 800a8a1..c5ff035 100644
--- a/spanner/apiv1/doc.go
+++ b/spanner/apiv1/doc.go
@@ -12,11 +12,10 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-// Code generated by gapic-generator. DO NOT EDIT.
+// Code generated by protoc-gen-go_gapic. DO NOT EDIT.
// Package spanner is an auto-generated package for the
// Cloud Spanner API.
-
//
// Cloud Spanner is a managed, mission-critical, globally consistent and
// scalable relational database service.
@@ -31,8 +30,7 @@
//
// For information about setting deadlines, reusing contexts, and more
// please visit godoc.org/cloud.google.com/go.
-//
-// Use the client at cloud.google.com/go/spanner in preference to this.
+
package spanner // import "cloud.google.com/go/spanner/apiv1"
import (
@@ -44,6 +42,8 @@
"google.golang.org/grpc/metadata"
)
+const versionClient = "20191216"
+
func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context {
out, _ := metadata.FromOutgoingContext(ctx)
out = out.Copy()
@@ -78,7 +78,7 @@
}
notSemverRune := func(r rune) bool {
- return strings.IndexRune("0123456789.", r) < 0
+ return !strings.ContainsRune("0123456789.", r)
}
if strings.HasPrefix(s, "go1") {
@@ -99,5 +99,3 @@
}
return "UNKNOWN"
}
-
-const versionClient = "20191206"
diff --git a/spanner/apiv1/spanner_client.go b/spanner/apiv1/spanner_client.go
index dc8128f..0a9b902 100644
--- a/spanner/apiv1/spanner_client.go
+++ b/spanner/apiv1/spanner_client.go
@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-// Code generated by gapic-generator. DO NOT EDIT.
+// Code generated by protoc-gen-go_gapic. DO NOT EDIT.
package spanner
@@ -56,6 +56,7 @@
func defaultClientOptions() []option.ClientOption {
return []option.ClientOption{
option.WithEndpoint("spanner.googleapis.com:443"),
+ option.WithGRPCDialOption(grpc.WithDisableServiceConfig()),
option.WithScopes(DefaultAuthScopes()...),
option.WithGRPCDialOption(grpc.WithDefaultCallOptions(
grpc.MaxCallRecvMsgSize(math.MaxInt32))),
@@ -63,46 +64,152 @@
}
func defaultCallOptions() *CallOptions {
- retry := map[[2]string][]gax.CallOption{
- {"default", "idempotent"}: {
- gax.WithRetry(func() gax.Retryer {
- return gax.OnCodes([]codes.Code{
- codes.Unavailable,
- }, gax.Backoff{
- Initial: 250 * time.Millisecond,
- Max: 32000 * time.Millisecond,
- Multiplier: 1.3,
- })
- }),
- },
- {"long_running", "long_running"}: {
- gax.WithRetry(func() gax.Retryer {
- return gax.OnCodes([]codes.Code{
- codes.Unavailable,
- }, gax.Backoff{
- Initial: 250 * time.Millisecond,
- Max: 32000 * time.Millisecond,
- Multiplier: 1.3,
- })
- }),
- },
- }
return &CallOptions{
- CreateSession: retry[[2]string{"default", "idempotent"}],
- BatchCreateSessions: retry[[2]string{"default", "idempotent"}],
- GetSession: retry[[2]string{"default", "idempotent"}],
- ListSessions: retry[[2]string{"default", "idempotent"}],
- DeleteSession: retry[[2]string{"default", "idempotent"}],
- ExecuteSql: retry[[2]string{"default", "idempotent"}],
- ExecuteStreamingSql: retry[[2]string{"streaming", "non_idempotent"}],
- ExecuteBatchDml: retry[[2]string{"default", "idempotent"}],
- Read: retry[[2]string{"default", "idempotent"}],
- StreamingRead: retry[[2]string{"streaming", "non_idempotent"}],
- BeginTransaction: retry[[2]string{"default", "idempotent"}],
- Commit: retry[[2]string{"long_running", "long_running"}],
- Rollback: retry[[2]string{"default", "idempotent"}],
- PartitionQuery: retry[[2]string{"default", "idempotent"}],
- PartitionRead: retry[[2]string{"default", "idempotent"}],
+ CreateSession: []gax.CallOption{
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnCodes([]codes.Code{
+ codes.Unavailable,
+ }, gax.Backoff{
+ Initial: 250 * time.Millisecond,
+ Max: 32000 * time.Millisecond,
+ Multiplier: 1.30,
+ })
+ }),
+ },
+ BatchCreateSessions: []gax.CallOption{
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnCodes([]codes.Code{
+ codes.Unavailable,
+ }, gax.Backoff{
+ Initial: 250 * time.Millisecond,
+ Max: 32000 * time.Millisecond,
+ Multiplier: 1.30,
+ })
+ }),
+ },
+ GetSession: []gax.CallOption{
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnCodes([]codes.Code{
+ codes.Unavailable,
+ }, gax.Backoff{
+ Initial: 250 * time.Millisecond,
+ Max: 32000 * time.Millisecond,
+ Multiplier: 1.30,
+ })
+ }),
+ },
+ ListSessions: []gax.CallOption{
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnCodes([]codes.Code{
+ codes.Unavailable,
+ }, gax.Backoff{
+ Initial: 250 * time.Millisecond,
+ Max: 32000 * time.Millisecond,
+ Multiplier: 1.30,
+ })
+ }),
+ },
+ DeleteSession: []gax.CallOption{
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnCodes([]codes.Code{
+ codes.Unavailable,
+ }, gax.Backoff{
+ Initial: 250 * time.Millisecond,
+ Max: 32000 * time.Millisecond,
+ Multiplier: 1.30,
+ })
+ }),
+ },
+ ExecuteSql: []gax.CallOption{
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnCodes([]codes.Code{
+ codes.Unavailable,
+ }, gax.Backoff{
+ Initial: 250 * time.Millisecond,
+ Max: 32000 * time.Millisecond,
+ Multiplier: 1.30,
+ })
+ }),
+ },
+ ExecuteStreamingSql: []gax.CallOption{},
+ ExecuteBatchDml: []gax.CallOption{
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnCodes([]codes.Code{
+ codes.Unavailable,
+ }, gax.Backoff{
+ Initial: 250 * time.Millisecond,
+ Max: 32000 * time.Millisecond,
+ Multiplier: 1.30,
+ })
+ }),
+ },
+ Read: []gax.CallOption{
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnCodes([]codes.Code{
+ codes.Unavailable,
+ }, gax.Backoff{
+ Initial: 250 * time.Millisecond,
+ Max: 32000 * time.Millisecond,
+ Multiplier: 1.30,
+ })
+ }),
+ },
+ StreamingRead: []gax.CallOption{},
+ BeginTransaction: []gax.CallOption{
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnCodes([]codes.Code{
+ codes.Unavailable,
+ }, gax.Backoff{
+ Initial: 250 * time.Millisecond,
+ Max: 32000 * time.Millisecond,
+ Multiplier: 1.30,
+ })
+ }),
+ },
+ Commit: []gax.CallOption{
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnCodes([]codes.Code{
+ codes.Unavailable,
+ }, gax.Backoff{
+ Initial: 250 * time.Millisecond,
+ Max: 32000 * time.Millisecond,
+ Multiplier: 1.30,
+ })
+ }),
+ },
+ Rollback: []gax.CallOption{
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnCodes([]codes.Code{
+ codes.Unavailable,
+ }, gax.Backoff{
+ Initial: 250 * time.Millisecond,
+ Max: 32000 * time.Millisecond,
+ Multiplier: 1.30,
+ })
+ }),
+ },
+ PartitionQuery: []gax.CallOption{
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnCodes([]codes.Code{
+ codes.Unavailable,
+ }, gax.Backoff{
+ Initial: 250 * time.Millisecond,
+ Max: 32000 * time.Millisecond,
+ Multiplier: 1.30,
+ })
+ }),
+ },
+ PartitionRead: []gax.CallOption{
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnCodes([]codes.Code{
+ codes.Unavailable,
+ }, gax.Backoff{
+ Initial: 250 * time.Millisecond,
+ Max: 32000 * time.Millisecond,
+ Multiplier: 1.30,
+ })
+ }),
+ },
}
}
@@ -141,6 +248,7 @@
client: spannerpb.NewSpannerClient(conn),
}
c.SetGoogleClientInfo()
+
return c, nil
}
@@ -202,7 +310,7 @@
// BatchCreateSessions creates multiple new sessions.
//
// This API can be used to initialize a session cache on the clients.
-// See https://goo.gl/TgSFN2 for best practices on session cache management.
+// See https://goo.gl/TgSFN2 (at https://goo.gl/TgSFN2) for best practices on session cache management.
func (c *Client) BatchCreateSessions(ctx context.Context, req *spannerpb.BatchCreateSessionsRequest, opts ...gax.CallOption) (*spannerpb.BatchCreateSessionsResponse, error) {
md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "database", url.QueryEscape(req.GetDatabase())))
ctx = insertMetadata(ctx, c.xGoogMetadata, md)
@@ -261,6 +369,8 @@
if err != nil {
return nil, "", err
}
+
+ it.Response = resp
return resp.Sessions, resp.NextPageToken, nil
}
fetch := func(pageSize int, pageToken string) (string, error) {
@@ -551,6 +661,11 @@
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.
//
diff --git a/spanner/apiv1/spanner_client_example_test.go b/spanner/apiv1/spanner_client_example_test.go
index caa0e6a..a1e1b0a 100644
--- a/spanner/apiv1/spanner_client_example_test.go
+++ b/spanner/apiv1/spanner_client_example_test.go
@@ -12,13 +12,12 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-// Code generated by gapic-generator. DO NOT EDIT.
+// Code generated by protoc-gen-go_gapic. DO NOT EDIT.
package spanner_test
import (
"context"
- "io"
spanner "cloud.google.com/go/spanner/apiv1"
"google.golang.org/api/iterator"
@@ -36,6 +35,8 @@
}
func ExampleClient_CreateSession() {
+ // import spannerpb "google.golang.org/genproto/googleapis/spanner/v1"
+
ctx := context.Background()
c, err := spanner.NewClient(ctx)
if err != nil {
@@ -54,6 +55,8 @@
}
func ExampleClient_BatchCreateSessions() {
+ // import spannerpb "google.golang.org/genproto/googleapis/spanner/v1"
+
ctx := context.Background()
c, err := spanner.NewClient(ctx)
if err != nil {
@@ -72,6 +75,8 @@
}
func ExampleClient_GetSession() {
+ // import spannerpb "google.golang.org/genproto/googleapis/spanner/v1"
+
ctx := context.Background()
c, err := spanner.NewClient(ctx)
if err != nil {
@@ -90,6 +95,9 @@
}
func ExampleClient_ListSessions() {
+ // import spannerpb "google.golang.org/genproto/googleapis/spanner/v1"
+ // import "google.golang.org/api/iterator"
+
ctx := context.Background()
c, err := spanner.NewClient(ctx)
if err != nil {
@@ -130,6 +138,8 @@
}
func ExampleClient_ExecuteSql() {
+ // import spannerpb "google.golang.org/genproto/googleapis/spanner/v1"
+
ctx := context.Background()
c, err := spanner.NewClient(ctx)
if err != nil {
@@ -147,34 +157,9 @@
_ = resp
}
-func ExampleClient_ExecuteStreamingSql() {
- ctx := context.Background()
- c, err := spanner.NewClient(ctx)
- if err != nil {
- // TODO: Handle error.
- }
-
- req := &spannerpb.ExecuteSqlRequest{
- // TODO: Fill request struct fields.
- }
- stream, err := c.ExecuteStreamingSql(ctx, req)
- if err != nil {
- // TODO: Handle error.
- }
- for {
- resp, err := stream.Recv()
- if err == io.EOF {
- break
- }
- if err != nil {
- // TODO: handle error.
- }
- // TODO: Use resp.
- _ = resp
- }
-}
-
func ExampleClient_ExecuteBatchDml() {
+ // import spannerpb "google.golang.org/genproto/googleapis/spanner/v1"
+
ctx := context.Background()
c, err := spanner.NewClient(ctx)
if err != nil {
@@ -193,6 +178,8 @@
}
func ExampleClient_Read() {
+ // import spannerpb "google.golang.org/genproto/googleapis/spanner/v1"
+
ctx := context.Background()
c, err := spanner.NewClient(ctx)
if err != nil {
@@ -210,34 +197,9 @@
_ = resp
}
-func ExampleClient_StreamingRead() {
- ctx := context.Background()
- c, err := spanner.NewClient(ctx)
- if err != nil {
- // TODO: Handle error.
- }
-
- req := &spannerpb.ReadRequest{
- // TODO: Fill request struct fields.
- }
- stream, err := c.StreamingRead(ctx, req)
- if err != nil {
- // TODO: Handle error.
- }
- for {
- resp, err := stream.Recv()
- if err == io.EOF {
- break
- }
- if err != nil {
- // TODO: handle error.
- }
- // TODO: Use resp.
- _ = resp
- }
-}
-
func ExampleClient_BeginTransaction() {
+ // import spannerpb "google.golang.org/genproto/googleapis/spanner/v1"
+
ctx := context.Background()
c, err := spanner.NewClient(ctx)
if err != nil {
@@ -256,6 +218,8 @@
}
func ExampleClient_Commit() {
+ // import spannerpb "google.golang.org/genproto/googleapis/spanner/v1"
+
ctx := context.Background()
c, err := spanner.NewClient(ctx)
if err != nil {
@@ -290,6 +254,8 @@
}
func ExampleClient_PartitionQuery() {
+ // import spannerpb "google.golang.org/genproto/googleapis/spanner/v1"
+
ctx := context.Background()
c, err := spanner.NewClient(ctx)
if err != nil {
@@ -308,6 +274,8 @@
}
func ExampleClient_PartitionRead() {
+ // import spannerpb "google.golang.org/genproto/googleapis/spanner/v1"
+
ctx := context.Background()
c, err := spanner.NewClient(ctx)
if err != nil {
diff --git a/spanner/go.mod b/spanner/go.mod
index 33d3361..bf4fcc4 100644
--- a/spanner/go.mod
+++ b/spanner/go.mod
@@ -11,8 +11,8 @@
go.opencensus.io v0.22.0
golang.org/x/exp v0.0.0-20191129062945-2f5052295587 // indirect
golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f // indirect
- golang.org/x/tools v0.0.0-20191206204035-259af5ff87bd // indirect
+ golang.org/x/tools v0.0.0-20191216173652-a0e659d51361 // indirect
google.golang.org/api v0.14.0
- google.golang.org/genproto v0.0.0-20191206224255-0243a4be9c8f
+ google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1
google.golang.org/grpc v1.21.1
)
diff --git a/spanner/go.sum b/spanner/go.sum
index caaf909..2a29363 100644
--- a/spanner/go.sum
+++ b/spanner/go.sum
@@ -58,6 +58,7 @@
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/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=
@@ -80,6 +81,7 @@
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=
+golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg=
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=
@@ -132,9 +134,10 @@
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-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
-golang.org/x/tools v0.0.0-20191206204035-259af5ff87bd h1:Zc7EU2PqpsNeIfOoVA7hvQX4cS3YDJEs5KlfatT3hLo=
-golang.org/x/tools v0.0.0-20191206204035-259af5ff87bd/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
+golang.org/x/tools v0.0.0-20191216173652-a0e659d51361 h1:RIIXAeV6GvDBuADKumTODatUqANFZ+5BPMnzsy4hulY=
+golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
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=
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=
@@ -156,8 +159,8 @@
google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc=
google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51 h1:Ex1mq5jaJof+kRnYi3SlYJ8KKa9Ao3NHyIT5XJ1gF6U=
google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8=
-google.golang.org/genproto v0.0.0-20191206224255-0243a4be9c8f h1:naitw5DILWPQvG0oG04mR9jF8fmKpRdW3E3zzKA4D0Y=
-google.golang.org/genproto v0.0.0-20191206224255-0243a4be9c8f/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
+google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1 h1:aQktFqmDE2yjveXJlVIfslDFmFnUXSqG0i6KRcJAeMc=
+google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
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 h1:j6XxA85m/6txkUCHvzlV5f+HBNl/1r5cZ2A/3IEFOO8=
diff --git a/speech/apiv1/doc.go b/speech/apiv1/doc.go
index b1a5f73..74f1ecd 100644
--- a/speech/apiv1/doc.go
+++ b/speech/apiv1/doc.go
@@ -41,7 +41,7 @@
"google.golang.org/grpc/metadata"
)
-const versionClient = "20191206"
+const versionClient = "20191216"
func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context {
out, _ := metadata.FromOutgoingContext(ctx)
diff --git a/speech/apiv1p1beta1/doc.go b/speech/apiv1p1beta1/doc.go
index 764fe78..c5ae9a4 100644
--- a/speech/apiv1p1beta1/doc.go
+++ b/speech/apiv1p1beta1/doc.go
@@ -43,7 +43,7 @@
"google.golang.org/grpc/metadata"
)
-const versionClient = "20191206"
+const versionClient = "20191216"
func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context {
out, _ := metadata.FromOutgoingContext(ctx)
diff --git a/storage/go.mod b/storage/go.mod
index 892e896..1ef2d31 100644
--- a/storage/go.mod
+++ b/storage/go.mod
@@ -10,8 +10,8 @@
golang.org/x/exp v0.0.0-20191129062945-2f5052295587 // indirect
golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f // indirect
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45
- golang.org/x/tools v0.0.0-20191206204035-259af5ff87bd // indirect
+ golang.org/x/tools v0.0.0-20191216173652-a0e659d51361 // indirect
google.golang.org/api v0.14.0
- google.golang.org/genproto v0.0.0-20191206224255-0243a4be9c8f
+ google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1
google.golang.org/grpc v1.21.1
)
diff --git a/storage/go.sum b/storage/go.sum
index 3536c68..aa41067 100644
--- a/storage/go.sum
+++ b/storage/go.sum
@@ -56,6 +56,7 @@
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/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=
@@ -78,6 +79,7 @@
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=
+golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg=
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=
@@ -130,9 +132,10 @@
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-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
-golang.org/x/tools v0.0.0-20191206204035-259af5ff87bd h1:Zc7EU2PqpsNeIfOoVA7hvQX4cS3YDJEs5KlfatT3hLo=
-golang.org/x/tools v0.0.0-20191206204035-259af5ff87bd/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
+golang.org/x/tools v0.0.0-20191216173652-a0e659d51361 h1:RIIXAeV6GvDBuADKumTODatUqANFZ+5BPMnzsy4hulY=
+golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
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=
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=
@@ -154,8 +157,8 @@
google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc=
google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51 h1:Ex1mq5jaJof+kRnYi3SlYJ8KKa9Ao3NHyIT5XJ1gF6U=
google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8=
-google.golang.org/genproto v0.0.0-20191206224255-0243a4be9c8f h1:naitw5DILWPQvG0oG04mR9jF8fmKpRdW3E3zzKA4D0Y=
-google.golang.org/genproto v0.0.0-20191206224255-0243a4be9c8f/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
+google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1 h1:aQktFqmDE2yjveXJlVIfslDFmFnUXSqG0i6KRcJAeMc=
+google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
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 h1:j6XxA85m/6txkUCHvzlV5f+HBNl/1r5cZ2A/3IEFOO8=
diff --git a/talent/apiv4beta1/doc.go b/talent/apiv4beta1/doc.go
index d9dbe12..9e925dc 100644
--- a/talent/apiv4beta1/doc.go
+++ b/talent/apiv4beta1/doc.go
@@ -99,4 +99,4 @@
return "UNKNOWN"
}
-const versionClient = "20191206"
+const versionClient = "20191216"
diff --git a/texttospeech/apiv1/doc.go b/texttospeech/apiv1/doc.go
index b214802..ecafce5 100644
--- a/texttospeech/apiv1/doc.go
+++ b/texttospeech/apiv1/doc.go
@@ -44,7 +44,7 @@
"google.golang.org/grpc/metadata"
)
-const versionClient = "20191206"
+const versionClient = "20191216"
func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context {
out, _ := metadata.FromOutgoingContext(ctx)
diff --git a/trace/apiv1/doc.go b/trace/apiv1/doc.go
index f2df64c..32b563f 100644
--- a/trace/apiv1/doc.go
+++ b/trace/apiv1/doc.go
@@ -12,18 +12,18 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-// Code generated by gapic-generator. DO NOT EDIT.
+// Code generated by protoc-gen-go_gapic. DO NOT EDIT.
// Package trace is an auto-generated package for the
// Stackdriver Trace API.
//
-// NOTE: This package is in alpha. It is not stable, and is likely to change.
-//
// Sends application trace data to Stackdriver Trace for viewing. Trace data
-// is
-// collected for all App Engine applications by default. Trace data from
-// other
-// applications can be provided using this API.
+// is collected for all App Engine applications by default. Trace data from
+// other applications can be provided using this API. This library is used to
+// interact with the Trace API directly. If you are looking to instrument
+// your application for Stackdriver Trace, we recommend using OpenCensus.
+//
+// NOTE: This package is in alpha. It is not stable, and is likely to change.
//
// Use of Context
//
@@ -35,8 +35,7 @@
//
// For information about setting deadlines, reusing contexts, and more
// please visit godoc.org/cloud.google.com/go.
-//
-// Use the client at cloud.google.com/go/trace in preference to this.
+
package trace // import "cloud.google.com/go/trace/apiv1"
import (
@@ -48,6 +47,8 @@
"google.golang.org/grpc/metadata"
)
+const versionClient = "20191216"
+
func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context {
out, _ := metadata.FromOutgoingContext(ctx)
out = out.Copy()
@@ -83,7 +84,7 @@
}
notSemverRune := func(r rune) bool {
- return strings.IndexRune("0123456789.", r) < 0
+ return !strings.ContainsRune("0123456789.", r)
}
if strings.HasPrefix(s, "go1") {
@@ -104,5 +105,3 @@
}
return "UNKNOWN"
}
-
-const versionClient = "UNKNOWN"
diff --git a/trace/apiv1/trace_client.go b/trace/apiv1/trace_client.go
index 7bfb411..700c61a 100644
--- a/trace/apiv1/trace_client.go
+++ b/trace/apiv1/trace_client.go
@@ -12,15 +12,13 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-// Code generated by gapic-generator. DO NOT EDIT.
+// Code generated by protoc-gen-go_gapic. DO NOT EDIT.
package trace
import (
"context"
- "fmt"
"math"
- "net/url"
"time"
"github.com/golang/protobuf/proto"
@@ -36,14 +34,15 @@
// CallOptions contains the retry settings for each method of Client.
type CallOptions struct {
- PatchTraces []gax.CallOption
- GetTrace []gax.CallOption
ListTraces []gax.CallOption
+ GetTrace []gax.CallOption
+ PatchTraces []gax.CallOption
}
func defaultClientOptions() []option.ClientOption {
return []option.ClientOption{
option.WithEndpoint("cloudtrace.googleapis.com:443"),
+ option.WithGRPCDialOption(grpc.WithDisableServiceConfig()),
option.WithScopes(DefaultAuthScopes()...),
option.WithGRPCDialOption(grpc.WithDefaultCallOptions(
grpc.MaxCallRecvMsgSize(math.MaxInt32))),
@@ -51,24 +50,43 @@
}
func defaultCallOptions() *CallOptions {
- retry := map[[2]string][]gax.CallOption{
- {"default", "idempotent"}: {
+ return &CallOptions{
+ ListTraces: []gax.CallOption{
gax.WithRetry(func() gax.Retryer {
return gax.OnCodes([]codes.Code{
- codes.DeadlineExceeded,
codes.Unavailable,
+ codes.DeadlineExceeded,
}, gax.Backoff{
Initial: 100 * time.Millisecond,
Max: 1000 * time.Millisecond,
- Multiplier: 1.2,
+ Multiplier: 1.20,
})
}),
},
- }
- return &CallOptions{
- PatchTraces: retry[[2]string{"default", "idempotent"}],
- GetTrace: retry[[2]string{"default", "idempotent"}],
- ListTraces: retry[[2]string{"default", "idempotent"}],
+ GetTrace: []gax.CallOption{
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnCodes([]codes.Code{
+ codes.Unavailable,
+ codes.DeadlineExceeded,
+ }, gax.Backoff{
+ Initial: 100 * time.Millisecond,
+ Max: 1000 * time.Millisecond,
+ Multiplier: 1.20,
+ })
+ }),
+ },
+ PatchTraces: []gax.CallOption{
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnCodes([]codes.Code{
+ codes.Unavailable,
+ codes.DeadlineExceeded,
+ }, gax.Backoff{
+ Initial: 100 * time.Millisecond,
+ Max: 1000 * time.Millisecond,
+ Multiplier: 1.20,
+ })
+ }),
+ },
}
}
@@ -108,6 +126,7 @@
client: cloudtracepb.NewTraceServiceClient(conn),
}
c.SetGoogleClientInfo()
+
return c, nil
}
@@ -131,43 +150,9 @@
c.xGoogMetadata = metadata.Pairs("x-goog-api-client", gax.XGoogHeader(kv...))
}
-// PatchTraces sends new traces to Stackdriver Trace or updates existing traces. If the ID
-// of a trace that you send matches that of an existing trace, any fields
-// in the existing trace and its spans are overwritten by the provided values,
-// and any new fields provided are merged with the existing trace data. If the
-// ID does not match, a new trace is created.
-func (c *Client) PatchTraces(ctx context.Context, req *cloudtracepb.PatchTracesRequest, opts ...gax.CallOption) error {
- md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "project_id", url.QueryEscape(req.GetProjectId())))
- ctx = insertMetadata(ctx, c.xGoogMetadata, md)
- opts = append(c.CallOptions.PatchTraces[0:len(c.CallOptions.PatchTraces):len(c.CallOptions.PatchTraces)], opts...)
- err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
- var err error
- _, err = c.client.PatchTraces(ctx, req, settings.GRPC...)
- return err
- }, opts...)
- return err
-}
-
-// GetTrace gets a single trace by its ID.
-func (c *Client) GetTrace(ctx context.Context, req *cloudtracepb.GetTraceRequest, opts ...gax.CallOption) (*cloudtracepb.Trace, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
- opts = append(c.CallOptions.GetTrace[0:len(c.CallOptions.GetTrace):len(c.CallOptions.GetTrace)], opts...)
- var resp *cloudtracepb.Trace
- err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
- var err error
- resp, err = c.client.GetTrace(ctx, req, settings.GRPC...)
- return err
- }, opts...)
- if err != nil {
- return nil, err
- }
- return resp, nil
-}
-
// ListTraces returns of a list of traces that match the specified filter conditions.
func (c *Client) ListTraces(ctx context.Context, req *cloudtracepb.ListTracesRequest, opts ...gax.CallOption) *TraceIterator {
- md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "project_id", url.QueryEscape(req.GetProjectId())))
- ctx = insertMetadata(ctx, c.xGoogMetadata, md)
+ ctx = insertMetadata(ctx, c.xGoogMetadata)
opts = append(c.CallOptions.ListTraces[0:len(c.CallOptions.ListTraces):len(c.CallOptions.ListTraces)], opts...)
it := &TraceIterator{}
req = proto.Clone(req).(*cloudtracepb.ListTracesRequest)
@@ -187,6 +172,8 @@
if err != nil {
return nil, "", err
}
+
+ it.Response = resp
return resp.Traces, resp.NextPageToken, nil
}
fetch := func(pageSize int, pageToken string) (string, error) {
@@ -203,12 +190,49 @@
return it
}
+// GetTrace gets a single trace by its ID.
+func (c *Client) GetTrace(ctx context.Context, req *cloudtracepb.GetTraceRequest, opts ...gax.CallOption) (*cloudtracepb.Trace, error) {
+ ctx = insertMetadata(ctx, c.xGoogMetadata)
+ opts = append(c.CallOptions.GetTrace[0:len(c.CallOptions.GetTrace):len(c.CallOptions.GetTrace)], opts...)
+ var resp *cloudtracepb.Trace
+ err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ var err error
+ resp, err = c.client.GetTrace(ctx, req, settings.GRPC...)
+ return err
+ }, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return resp, nil
+}
+
+// PatchTraces sends new traces to Stackdriver Trace or updates existing traces. If the ID
+// of a trace that you send matches that of an existing trace, any fields
+// in the existing trace and its spans are overwritten by the provided values,
+// and any new fields provided are merged with the existing trace data. If the
+// ID does not match, a new trace is created.
+func (c *Client) PatchTraces(ctx context.Context, req *cloudtracepb.PatchTracesRequest, opts ...gax.CallOption) error {
+ ctx = insertMetadata(ctx, c.xGoogMetadata)
+ opts = append(c.CallOptions.PatchTraces[0:len(c.CallOptions.PatchTraces):len(c.CallOptions.PatchTraces)], opts...)
+ err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ var err error
+ _, err = c.client.PatchTraces(ctx, req, settings.GRPC...)
+ return err
+ }, opts...)
+ return err
+}
+
// TraceIterator manages a stream of *cloudtracepb.Trace.
type TraceIterator struct {
items []*cloudtracepb.Trace
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.
//
diff --git a/trace/apiv1/trace_client_example_test.go b/trace/apiv1/trace_client_example_test.go
index 02efc27..25f82bb 100644
--- a/trace/apiv1/trace_client_example_test.go
+++ b/trace/apiv1/trace_client_example_test.go
@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-// Code generated by gapic-generator. DO NOT EDIT.
+// Code generated by protoc-gen-go_gapic. DO NOT EDIT.
package trace_test
@@ -34,41 +34,10 @@
_ = c
}
-func ExampleClient_PatchTraces() {
- ctx := context.Background()
- c, err := trace.NewClient(ctx)
- if err != nil {
- // TODO: Handle error.
- }
-
- req := &cloudtracepb.PatchTracesRequest{
- // TODO: Fill request struct fields.
- }
- err = c.PatchTraces(ctx, req)
- if err != nil {
- // TODO: Handle error.
- }
-}
-
-func ExampleClient_GetTrace() {
- ctx := context.Background()
- c, err := trace.NewClient(ctx)
- if err != nil {
- // TODO: Handle error.
- }
-
- req := &cloudtracepb.GetTraceRequest{
- // TODO: Fill request struct fields.
- }
- resp, err := c.GetTrace(ctx, req)
- if err != nil {
- // TODO: Handle error.
- }
- // TODO: Use resp.
- _ = resp
-}
-
func ExampleClient_ListTraces() {
+ // import cloudtracepb "google.golang.org/genproto/googleapis/devtools/cloudtrace/v1"
+ // import "google.golang.org/api/iterator"
+
ctx := context.Background()
c, err := trace.NewClient(ctx)
if err != nil {
@@ -91,3 +60,39 @@
_ = resp
}
}
+
+func ExampleClient_GetTrace() {
+ // import cloudtracepb "google.golang.org/genproto/googleapis/devtools/cloudtrace/v1"
+
+ ctx := context.Background()
+ c, err := trace.NewClient(ctx)
+ if err != nil {
+ // TODO: Handle error.
+ }
+
+ req := &cloudtracepb.GetTraceRequest{
+ // TODO: Fill request struct fields.
+ }
+ resp, err := c.GetTrace(ctx, req)
+ if err != nil {
+ // TODO: Handle error.
+ }
+ // TODO: Use resp.
+ _ = resp
+}
+
+func ExampleClient_PatchTraces() {
+ ctx := context.Background()
+ c, err := trace.NewClient(ctx)
+ if err != nil {
+ // TODO: Handle error.
+ }
+
+ req := &cloudtracepb.PatchTracesRequest{
+ // TODO: Fill request struct fields.
+ }
+ err = c.PatchTraces(ctx, req)
+ if err != nil {
+ // TODO: Handle error.
+ }
+}
diff --git a/trace/apiv2/doc.go b/trace/apiv2/doc.go
index 628b2eb..c7b69ce 100644
--- a/trace/apiv2/doc.go
+++ b/trace/apiv2/doc.go
@@ -12,19 +12,19 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-// Code generated by gapic-generator. DO NOT EDIT.
+// Code generated by protoc-gen-go_gapic. DO NOT EDIT.
// Package trace is an auto-generated package for the
// Stackdriver Trace API.
//
-// NOTE: This package is in alpha. It is not stable, and is likely to change.
-//
// Sends application trace data to Stackdriver Trace for viewing. Trace data
// is collected for all App Engine applications by default. Trace data from
// other applications can be provided using this API. This library is used to
// interact with the Trace API directly. If you are looking to instrument
// your application for Stackdriver Trace, we recommend using OpenCensus.
//
+// 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
@@ -35,6 +35,7 @@
//
// For information about setting deadlines, reusing contexts, and more
// please visit godoc.org/cloud.google.com/go.
+
package trace // import "cloud.google.com/go/trace/apiv2"
import (
@@ -46,6 +47,8 @@
"google.golang.org/grpc/metadata"
)
+const versionClient = "20191216"
+
func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context {
out, _ := metadata.FromOutgoingContext(ctx)
out = out.Copy()
@@ -80,7 +83,7 @@
}
notSemverRune := func(r rune) bool {
- return strings.IndexRune("0123456789.", r) < 0
+ return !strings.ContainsRune("0123456789.", r)
}
if strings.HasPrefix(s, "go1") {
@@ -101,5 +104,3 @@
}
return "UNKNOWN"
}
-
-const versionClient = "20191206"
diff --git a/trace/apiv2/trace_client.go b/trace/apiv2/trace_client.go
index b5e1885..5a26e0e 100644
--- a/trace/apiv2/trace_client.go
+++ b/trace/apiv2/trace_client.go
@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-// Code generated by gapic-generator. DO NOT EDIT.
+// Code generated by protoc-gen-go_gapic. DO NOT EDIT.
package trace
@@ -21,12 +21,14 @@
"fmt"
"math"
"net/url"
+ "time"
gax "github.com/googleapis/gax-go/v2"
"google.golang.org/api/option"
"google.golang.org/api/transport"
cloudtracepb "google.golang.org/genproto/googleapis/devtools/cloudtrace/v2"
"google.golang.org/grpc"
+ "google.golang.org/grpc/codes"
"google.golang.org/grpc/metadata"
)
@@ -39,6 +41,7 @@
func defaultClientOptions() []option.ClientOption {
return []option.ClientOption{
option.WithEndpoint("cloudtrace.googleapis.com:443"),
+ option.WithGRPCDialOption(grpc.WithDisableServiceConfig()),
option.WithScopes(DefaultAuthScopes()...),
option.WithGRPCDialOption(grpc.WithDefaultCallOptions(
grpc.MaxCallRecvMsgSize(math.MaxInt32))),
@@ -46,10 +49,20 @@
}
func defaultCallOptions() *CallOptions {
- retry := map[[2]string][]gax.CallOption{}
return &CallOptions{
- BatchWriteSpans: retry[[2]string{"default", "non_idempotent"}],
- CreateSpan: retry[[2]string{"default", "non_idempotent"}],
+ BatchWriteSpans: []gax.CallOption{},
+ CreateSpan: []gax.CallOption{
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnCodes([]codes.Code{
+ codes.Unavailable,
+ codes.DeadlineExceeded,
+ }, gax.Backoff{
+ Initial: 100 * time.Millisecond,
+ Max: 1000 * time.Millisecond,
+ Multiplier: 1.20,
+ })
+ }),
+ },
}
}
@@ -89,6 +102,7 @@
client: cloudtracepb.NewTraceServiceClient(conn),
}
c.setGoogleClientInfo()
+
return c, nil
}
diff --git a/trace/apiv2/trace_client_example_test.go b/trace/apiv2/trace_client_example_test.go
index 10d8022..003ef87 100644
--- a/trace/apiv2/trace_client_example_test.go
+++ b/trace/apiv2/trace_client_example_test.go
@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-// Code generated by gapic-generator. DO NOT EDIT.
+// Code generated by protoc-gen-go_gapic. DO NOT EDIT.
package trace_test
@@ -50,6 +50,8 @@
}
func ExampleClient_CreateSpan() {
+ // import cloudtracepb "google.golang.org/genproto/googleapis/devtools/cloudtrace/v2"
+
ctx := context.Background()
c, err := trace.NewClient(ctx)
if err != nil {
diff --git a/translate/apiv3/doc.go b/translate/apiv3/doc.go
index ef893e3..1bc5cb9 100644
--- a/translate/apiv3/doc.go
+++ b/translate/apiv3/doc.go
@@ -41,7 +41,7 @@
"google.golang.org/grpc/metadata"
)
-const versionClient = "20191206"
+const versionClient = "20191216"
func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context {
out, _ := metadata.FromOutgoingContext(ctx)
diff --git a/videointelligence/apiv1/doc.go b/videointelligence/apiv1/doc.go
index 8e13e2d..6c922fb 100644
--- a/videointelligence/apiv1/doc.go
+++ b/videointelligence/apiv1/doc.go
@@ -45,7 +45,7 @@
"google.golang.org/grpc/metadata"
)
-const versionClient = "20191206"
+const versionClient = "20191216"
func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context {
out, _ := metadata.FromOutgoingContext(ctx)
diff --git a/videointelligence/apiv1beta2/doc.go b/videointelligence/apiv1beta2/doc.go
index dc967f8..eafdad5 100644
--- a/videointelligence/apiv1beta2/doc.go
+++ b/videointelligence/apiv1beta2/doc.go
@@ -99,4 +99,4 @@
return "UNKNOWN"
}
-const versionClient = "20191206"
+const versionClient = "20191216"
diff --git a/vision/apiv1/doc.go b/vision/apiv1/doc.go
index 8748217..a58f525 100644
--- a/vision/apiv1/doc.go
+++ b/vision/apiv1/doc.go
@@ -43,7 +43,7 @@
"google.golang.org/grpc/metadata"
)
-const versionClient = "20191206"
+const versionClient = "20191216"
func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context {
out, _ := metadata.FromOutgoingContext(ctx)
diff --git a/vision/apiv1/product_search_client.go b/vision/apiv1/product_search_client.go
index e4d6c56..c76401c 100644
--- a/vision/apiv1/product_search_client.go
+++ b/vision/apiv1/product_search_client.go
@@ -26,7 +26,6 @@
"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"
"google.golang.org/api/option"
@@ -1009,11 +1008,7 @@
//
// See documentation of Poll for error-handling information.
func (op *PurgeProductsOperation) Wait(ctx context.Context, opts ...gax.CallOption) error {
- var resp emptypb.Empty
- if err := op.lro.WaitWithInterval(ctx, &resp, time.Minute, opts...); err != nil {
- return err
- }
- return nil
+ return op.lro.WaitWithInterval(ctx, nil, time.Minute, opts...)
}
// Poll fetches the latest state of the long-running operation.
@@ -1025,15 +1020,8 @@
// 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 *PurgeProductsOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*emptypb.Empty, error) {
- var resp emptypb.Empty
- if err := op.lro.Poll(ctx, &resp, opts...); err != nil {
- return nil, err
- }
- if !op.Done() {
- return nil, nil
- }
- return &resp, nil
+func (op *PurgeProductsOperation) Poll(ctx context.Context, opts ...gax.CallOption) error {
+ return op.lro.Poll(ctx, nil, opts...)
}
// Metadata returns metadata associated with the long-running operation.
diff --git a/vision/apiv1p1beta1/doc.go b/vision/apiv1p1beta1/doc.go
index bedde93..b78fa9f 100644
--- a/vision/apiv1p1beta1/doc.go
+++ b/vision/apiv1p1beta1/doc.go
@@ -101,4 +101,4 @@
return "UNKNOWN"
}
-const versionClient = "20191206"
+const versionClient = "20191216"
diff --git a/webrisk/apiv1beta1/doc.go b/webrisk/apiv1beta1/doc.go
index 6cd434d..2ae63ac 100644
--- a/webrisk/apiv1beta1/doc.go
+++ b/webrisk/apiv1beta1/doc.go
@@ -41,7 +41,7 @@
"google.golang.org/grpc/metadata"
)
-const versionClient = "20191206"
+const versionClient = "20191216"
func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context {
out, _ := metadata.FromOutgoingContext(ctx)