all: auto-regenerate gapics
This is an auto-generated regeneration of the gapic clients by
cloud.google.com/go/internal/gapicgen. Once the corresponding genproto PR is
submitted, genmgr 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/311
Change-Id: I406727dbb646a09a632fbb5a3d3f5e54e993a7ab
Reviewed-on: https://code-review.googlesource.com/c/gocloud/+/52650
Reviewed-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Tyler Bui-Palsulich <tbp@google.com>
diff --git a/asset/apiv1/doc.go b/asset/apiv1/doc.go
index b3ee2e1..e62183f 100644
--- a/asset/apiv1/doc.go
+++ b/asset/apiv1/doc.go
@@ -40,7 +40,7 @@
"google.golang.org/grpc/metadata"
)
-const versionClient = "20200226"
+const versionClient = "20200227"
func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context {
out, _ := metadata.FromOutgoingContext(ctx)
diff --git a/asset/apiv1beta1/doc.go b/asset/apiv1beta1/doc.go
index a21c993..ec2919f 100644
--- a/asset/apiv1beta1/doc.go
+++ b/asset/apiv1beta1/doc.go
@@ -42,7 +42,7 @@
"google.golang.org/grpc/metadata"
)
-const versionClient = "20200226"
+const versionClient = "20200227"
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 93d8ae2..2fc3c36 100644
--- a/asset/apiv1p2beta1/doc.go
+++ b/asset/apiv1p2beta1/doc.go
@@ -42,7 +42,7 @@
"google.golang.org/grpc/metadata"
)
-const versionClient = "20200226"
+const versionClient = "20200227"
func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context {
out, _ := metadata.FromOutgoingContext(ctx)
diff --git a/automl/apiv1beta1/doc.go b/automl/apiv1beta1/doc.go
index 08e4169..4301c85 100644
--- a/automl/apiv1beta1/doc.go
+++ b/automl/apiv1beta1/doc.go
@@ -98,4 +98,4 @@
return "UNKNOWN"
}
-const versionClient = "20200226"
+const versionClient = "20200227"
diff --git a/bigquery/datatransfer/apiv1/doc.go b/bigquery/datatransfer/apiv1/doc.go
index 28467ff..8c2d79a 100644
--- a/bigquery/datatransfer/apiv1/doc.go
+++ b/bigquery/datatransfer/apiv1/doc.go
@@ -41,7 +41,7 @@
"google.golang.org/grpc/metadata"
)
-const versionClient = "20200226"
+const versionClient = "20200227"
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 430cb03..977f262 100644
--- a/bigquery/go.mod
+++ b/bigquery/go.mod
@@ -11,6 +11,6 @@
golang.org/x/net v0.0.0-20200226121028-0de0cce0169b // indirect
golang.org/x/tools v0.0.0-20200226224502-204d844ad48d // indirect
google.golang.org/api v0.19.0
- google.golang.org/genproto v0.0.0-20200226201735-46b91f19d98c
+ google.golang.org/genproto v0.0.0-20200227132054-3f1135a288c9
google.golang.org/grpc v1.27.1
)
diff --git a/bigquery/go.sum b/bigquery/go.sum
index 22507f0..e42d012 100644
--- a/bigquery/go.sum
+++ b/bigquery/go.sum
@@ -311,8 +311,8 @@
google.golang.org/genproto v0.0.0-20200212174721-66ed5ce911ce/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63 h1:YzfoEYWbODU5Fbt37+h7X16BWQbad7Q4S6gclTKFXM8=
google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
-google.golang.org/genproto v0.0.0-20200226201735-46b91f19d98c h1:xFOdgVPpeowWAH0MJ5i0XMp+3yWiWamMtN/kx9xThIQ=
-google.golang.org/genproto v0.0.0-20200226201735-46b91f19d98c/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
+google.golang.org/genproto v0.0.0-20200227132054-3f1135a288c9 h1:Koy0f8zyrEVfIHetH7wjP5mQLUXiqDpubSg8V1fAxqc=
+google.golang.org/genproto v0.0.0-20200227132054-3f1135a288c9/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
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/reservation/apiv1beta1/doc.go b/bigquery/reservation/apiv1beta1/doc.go
index c96099b..66005e1 100644
--- a/bigquery/reservation/apiv1beta1/doc.go
+++ b/bigquery/reservation/apiv1beta1/doc.go
@@ -42,7 +42,7 @@
"google.golang.org/grpc/metadata"
)
-const versionClient = "20200226"
+const versionClient = "20200227"
func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context {
out, _ := metadata.FromOutgoingContext(ctx)
diff --git a/bigquery/storage/apiv1/doc.go b/bigquery/storage/apiv1/doc.go
index 555a726..f6e0b2b 100644
--- a/bigquery/storage/apiv1/doc.go
+++ b/bigquery/storage/apiv1/doc.go
@@ -40,7 +40,7 @@
"google.golang.org/grpc/metadata"
)
-const versionClient = "20200226"
+const versionClient = "20200227"
func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context {
out, _ := metadata.FromOutgoingContext(ctx)
diff --git a/bigquery/storage/apiv1alpha2/doc.go b/bigquery/storage/apiv1alpha2/doc.go
index 9386cbb..fc1df38 100644
--- a/bigquery/storage/apiv1alpha2/doc.go
+++ b/bigquery/storage/apiv1alpha2/doc.go
@@ -40,7 +40,7 @@
"google.golang.org/grpc/metadata"
)
-const versionClient = "20200226"
+const versionClient = "20200227"
func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context {
out, _ := metadata.FromOutgoingContext(ctx)
diff --git a/bigquery/storage/apiv1beta1/doc.go b/bigquery/storage/apiv1beta1/doc.go
index 33d41c9..c4d699b 100644
--- a/bigquery/storage/apiv1beta1/doc.go
+++ b/bigquery/storage/apiv1beta1/doc.go
@@ -40,7 +40,7 @@
"google.golang.org/grpc/metadata"
)
-const versionClient = "20200226"
+const versionClient = "20200227"
func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context {
out, _ := metadata.FromOutgoingContext(ctx)
diff --git a/bigquery/storage/apiv1beta2/doc.go b/bigquery/storage/apiv1beta2/doc.go
index 2e7fe38..7e1e04b 100644
--- a/bigquery/storage/apiv1beta2/doc.go
+++ b/bigquery/storage/apiv1beta2/doc.go
@@ -40,7 +40,7 @@
"google.golang.org/grpc/metadata"
)
-const versionClient = "20200226"
+const versionClient = "20200227"
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 681156c..5cebe62 100644
--- a/bigtable/go.mod
+++ b/bigtable/go.mod
@@ -13,7 +13,7 @@
golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d
golang.org/x/tools v0.0.0-20200226224502-204d844ad48d // indirect
google.golang.org/api v0.19.0
- google.golang.org/genproto v0.0.0-20200226201735-46b91f19d98c
+ google.golang.org/genproto v0.0.0-20200227132054-3f1135a288c9
google.golang.org/grpc v1.27.1
rsc.io/binaryregexp v0.2.0
)
diff --git a/bigtable/go.sum b/bigtable/go.sum
index ae18000..dbc2c52 100644
--- a/bigtable/go.sum
+++ b/bigtable/go.sum
@@ -320,8 +320,8 @@
google.golang.org/genproto v0.0.0-20200212174721-66ed5ce911ce/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63 h1:YzfoEYWbODU5Fbt37+h7X16BWQbad7Q4S6gclTKFXM8=
google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
-google.golang.org/genproto v0.0.0-20200226201735-46b91f19d98c h1:xFOdgVPpeowWAH0MJ5i0XMp+3yWiWamMtN/kx9xThIQ=
-google.golang.org/genproto v0.0.0-20200226201735-46b91f19d98c/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
+google.golang.org/genproto v0.0.0-20200227132054-3f1135a288c9 h1:Koy0f8zyrEVfIHetH7wjP5mQLUXiqDpubSg8V1fAxqc=
+google.golang.org/genproto v0.0.0-20200227132054-3f1135a288c9/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
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/billing/apiv1/doc.go b/billing/apiv1/doc.go
index ecfabe6..0b60ea1 100644
--- a/billing/apiv1/doc.go
+++ b/billing/apiv1/doc.go
@@ -43,7 +43,7 @@
"google.golang.org/grpc/metadata"
)
-const versionClient = "20200226"
+const versionClient = "20200227"
func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context {
out, _ := metadata.FromOutgoingContext(ctx)
diff --git a/cloudbuild/apiv1/v2/doc.go b/cloudbuild/apiv1/v2/doc.go
index b824dd4..d4c62b7 100644
--- a/cloudbuild/apiv1/v2/doc.go
+++ b/cloudbuild/apiv1/v2/doc.go
@@ -40,7 +40,7 @@
"google.golang.org/grpc/metadata"
)
-const versionClient = "20200226"
+const versionClient = "20200227"
func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context {
out, _ := metadata.FromOutgoingContext(ctx)
diff --git a/cloudtasks/apiv2/doc.go b/cloudtasks/apiv2/doc.go
index 63a3abc..f6b6a1d 100644
--- a/cloudtasks/apiv2/doc.go
+++ b/cloudtasks/apiv2/doc.go
@@ -40,7 +40,7 @@
"google.golang.org/grpc/metadata"
)
-const versionClient = "20200226"
+const versionClient = "20200227"
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 52eedfb..636aa6d 100644
--- a/cloudtasks/apiv2beta2/doc.go
+++ b/cloudtasks/apiv2beta2/doc.go
@@ -42,7 +42,7 @@
"google.golang.org/grpc/metadata"
)
-const versionClient = "20200226"
+const versionClient = "20200227"
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 60481d8..7ef3a45 100644
--- a/cloudtasks/apiv2beta3/doc.go
+++ b/cloudtasks/apiv2beta3/doc.go
@@ -42,7 +42,7 @@
"google.golang.org/grpc/metadata"
)
-const versionClient = "20200226"
+const versionClient = "20200227"
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 f2b9c0a..d4aa8b3 100644
--- a/containeranalysis/apiv1beta1/doc.go
+++ b/containeranalysis/apiv1beta1/doc.go
@@ -43,7 +43,7 @@
"google.golang.org/grpc/metadata"
)
-const versionClient = "20200226"
+const versionClient = "20200227"
func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context {
out, _ := metadata.FromOutgoingContext(ctx)
diff --git a/datacatalog/apiv1beta1/doc.go b/datacatalog/apiv1beta1/doc.go
index bc748f7..a1927eb 100644
--- a/datacatalog/apiv1beta1/doc.go
+++ b/datacatalog/apiv1beta1/doc.go
@@ -43,7 +43,7 @@
"google.golang.org/grpc/metadata"
)
-const versionClient = "20200226"
+const versionClient = "20200227"
func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context {
out, _ := metadata.FromOutgoingContext(ctx)
diff --git a/dataproc/apiv1/doc.go b/dataproc/apiv1/doc.go
index 6ffbb87..19ae3a0 100644
--- a/dataproc/apiv1/doc.go
+++ b/dataproc/apiv1/doc.go
@@ -40,7 +40,7 @@
"google.golang.org/grpc/metadata"
)
-const versionClient = "20200226"
+const versionClient = "20200227"
func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context {
out, _ := metadata.FromOutgoingContext(ctx)
diff --git a/dataproc/apiv1beta2/doc.go b/dataproc/apiv1beta2/doc.go
index 3dc8461..d478446 100644
--- a/dataproc/apiv1beta2/doc.go
+++ b/dataproc/apiv1beta2/doc.go
@@ -42,7 +42,7 @@
"google.golang.org/grpc/metadata"
)
-const versionClient = "20200226"
+const versionClient = "20200227"
func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context {
out, _ := metadata.FromOutgoingContext(ctx)
diff --git a/datastore/go.mod b/datastore/go.mod
index 1832b3b..c323861 100644
--- a/datastore/go.mod
+++ b/datastore/go.mod
@@ -11,6 +11,6 @@
golang.org/x/net v0.0.0-20200226121028-0de0cce0169b // indirect
golang.org/x/tools v0.0.0-20200226224502-204d844ad48d // indirect
google.golang.org/api v0.19.0
- google.golang.org/genproto v0.0.0-20200226201735-46b91f19d98c
+ google.golang.org/genproto v0.0.0-20200227132054-3f1135a288c9
google.golang.org/grpc v1.27.1
)
diff --git a/datastore/go.sum b/datastore/go.sum
index f226e61..963347d 100644
--- a/datastore/go.sum
+++ b/datastore/go.sum
@@ -314,8 +314,8 @@
google.golang.org/genproto v0.0.0-20200212174721-66ed5ce911ce/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63 h1:YzfoEYWbODU5Fbt37+h7X16BWQbad7Q4S6gclTKFXM8=
google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
-google.golang.org/genproto v0.0.0-20200226201735-46b91f19d98c h1:xFOdgVPpeowWAH0MJ5i0XMp+3yWiWamMtN/kx9xThIQ=
-google.golang.org/genproto v0.0.0-20200226201735-46b91f19d98c/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
+google.golang.org/genproto v0.0.0-20200227132054-3f1135a288c9 h1:Koy0f8zyrEVfIHetH7wjP5mQLUXiqDpubSg8V1fAxqc=
+google.golang.org/genproto v0.0.0-20200227132054-3f1135a288c9/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
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/doc.go b/debugger/apiv2/doc.go
index b7fdf44..89491fe 100644
--- a/debugger/apiv2/doc.go
+++ b/debugger/apiv2/doc.go
@@ -41,7 +41,7 @@
"google.golang.org/grpc/metadata"
)
-const versionClient = "20200226"
+const versionClient = "20200227"
func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context {
out, _ := metadata.FromOutgoingContext(ctx)
diff --git a/dialogflow/apiv2/doc.go b/dialogflow/apiv2/doc.go
index 4555236..4f1d1f3 100644
--- a/dialogflow/apiv2/doc.go
+++ b/dialogflow/apiv2/doc.go
@@ -41,7 +41,7 @@
"google.golang.org/grpc/metadata"
)
-const versionClient = "20200226"
+const versionClient = "20200227"
func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context {
out, _ := metadata.FromOutgoingContext(ctx)
diff --git a/dlp/apiv2/doc.go b/dlp/apiv2/doc.go
index 1e43d2c..f122040 100644
--- a/dlp/apiv2/doc.go
+++ b/dlp/apiv2/doc.go
@@ -42,7 +42,7 @@
"google.golang.org/grpc/metadata"
)
-const versionClient = "20200226"
+const versionClient = "20200227"
func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context {
out, _ := metadata.FromOutgoingContext(ctx)
diff --git a/errorreporting/apiv1beta1/doc.go b/errorreporting/apiv1beta1/doc.go
index 4eb8e53..6920626 100644
--- a/errorreporting/apiv1beta1/doc.go
+++ b/errorreporting/apiv1beta1/doc.go
@@ -44,7 +44,7 @@
"google.golang.org/grpc/metadata"
)
-const versionClient = "20200226"
+const versionClient = "20200227"
func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context {
out, _ := metadata.FromOutgoingContext(ctx)
diff --git a/expr/apiv1alpha1/doc.go b/expr/apiv1alpha1/doc.go
index 7b8f09d..a915832 100644
--- a/expr/apiv1alpha1/doc.go
+++ b/expr/apiv1alpha1/doc.go
@@ -42,7 +42,7 @@
"google.golang.org/grpc/metadata"
)
-const versionClient = "20200226"
+const versionClient = "20200227"
func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context {
out, _ := metadata.FromOutgoingContext(ctx)
diff --git a/firestore/apiv1/admin/doc.go b/firestore/apiv1/admin/doc.go
index 99db98e..06f9fca 100644
--- a/firestore/apiv1/admin/doc.go
+++ b/firestore/apiv1/admin/doc.go
@@ -41,7 +41,7 @@
"google.golang.org/grpc/metadata"
)
-const versionClient = "20200226"
+const versionClient = "20200227"
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 b0ac2b9..2320ca4 100644
--- a/firestore/apiv1/doc.go
+++ b/firestore/apiv1/doc.go
@@ -41,7 +41,7 @@
"google.golang.org/grpc/metadata"
)
-const versionClient = "20200226"
+const versionClient = "20200227"
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 477e01e..d101dd7 100644
--- a/firestore/apiv1/firestore_client.go
+++ b/firestore/apiv1/firestore_client.go
@@ -38,7 +38,6 @@
type CallOptions struct {
GetDocument []gax.CallOption
ListDocuments []gax.CallOption
- CreateDocument []gax.CallOption
UpdateDocument []gax.CallOption
DeleteDocument []gax.CallOption
BatchGetDocuments []gax.CallOption
@@ -49,6 +48,7 @@
Write []gax.CallOption
Listen []gax.CallOption
ListCollectionIds []gax.CallOption
+ CreateDocument []gax.CallOption
}
func defaultClientOptions() []option.ClientOption {
@@ -89,7 +89,6 @@
})
}),
},
- CreateDocument: []gax.CallOption{},
UpdateDocument: []gax.CallOption{},
DeleteDocument: []gax.CallOption{
gax.WithRetry(func() gax.Retryer {
@@ -184,6 +183,7 @@
})
}),
},
+ CreateDocument: []gax.CallOption{},
}
}
@@ -310,23 +310,6 @@
return it
}
-// CreateDocument creates a new document.
-func (c *Client) CreateDocument(ctx context.Context, req *firestorepb.CreateDocumentRequest, opts ...gax.CallOption) (*firestorepb.Document, 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.CreateDocument[0:len(c.CallOptions.CreateDocument):len(c.CallOptions.CreateDocument)], opts...)
- var resp *firestorepb.Document
- err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
- var err error
- resp, err = c.client.CreateDocument(ctx, req, settings.GRPC...)
- return err
- }, opts...)
- if err != nil {
- return nil, err
- }
- return resp, nil
-}
-
// UpdateDocument updates or inserts a document.
func (c *Client) UpdateDocument(ctx context.Context, req *firestorepb.UpdateDocumentRequest, opts ...gax.CallOption) (*firestorepb.Document, error) {
md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "document.name", url.QueryEscape(req.GetDocument().GetName())))
@@ -514,6 +497,23 @@
return it
}
+// CreateDocument creates a new document.
+func (c *Client) CreateDocument(ctx context.Context, req *firestorepb.CreateDocumentRequest, opts ...gax.CallOption) (*firestorepb.Document, 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.CreateDocument[0:len(c.CallOptions.CreateDocument):len(c.CallOptions.CreateDocument)], opts...)
+ var resp *firestorepb.Document
+ err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ var err error
+ resp, err = c.client.CreateDocument(ctx, req, settings.GRPC...)
+ return err
+ }, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return resp, nil
+}
+
// DocumentIterator manages a stream of *firestorepb.Document.
type DocumentIterator struct {
items []*firestorepb.Document
diff --git a/firestore/apiv1/firestore_client_example_test.go b/firestore/apiv1/firestore_client_example_test.go
index f1cb181..227eb59 100644
--- a/firestore/apiv1/firestore_client_example_test.go
+++ b/firestore/apiv1/firestore_client_example_test.go
@@ -82,26 +82,6 @@
}
}
-func ExampleClient_CreateDocument() {
- // import firestorepb "google.golang.org/genproto/googleapis/firestore/v1"
-
- ctx := context.Background()
- c, err := firestore.NewClient(ctx)
- if err != nil {
- // TODO: Handle error.
- }
-
- req := &firestorepb.CreateDocumentRequest{
- // TODO: Fill request struct fields.
- }
- resp, err := c.CreateDocument(ctx, req)
- if err != nil {
- // TODO: Handle error.
- }
- // TODO: Use resp.
- _ = resp
-}
-
func ExampleClient_UpdateDocument() {
// import firestorepb "google.golang.org/genproto/googleapis/firestore/v1"
@@ -292,3 +272,23 @@
_ = resp
}
}
+
+func ExampleClient_CreateDocument() {
+ // import firestorepb "google.golang.org/genproto/googleapis/firestore/v1"
+
+ ctx := context.Background()
+ c, err := firestore.NewClient(ctx)
+ if err != nil {
+ // TODO: Handle error.
+ }
+
+ req := &firestorepb.CreateDocumentRequest{
+ // TODO: Fill request struct fields.
+ }
+ resp, err := c.CreateDocument(ctx, req)
+ if err != nil {
+ // TODO: Handle error.
+ }
+ // TODO: Use resp.
+ _ = resp
+}
diff --git a/firestore/apiv1beta1/doc.go b/firestore/apiv1beta1/doc.go
index 59e643a..f466453 100644
--- a/firestore/apiv1beta1/doc.go
+++ b/firestore/apiv1beta1/doc.go
@@ -43,7 +43,7 @@
"google.golang.org/grpc/metadata"
)
-const versionClient = "20200226"
+const versionClient = "20200227"
func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context {
out, _ := metadata.FromOutgoingContext(ctx)
diff --git a/firestore/go.mod b/firestore/go.mod
index f2adc6c..e8dd406 100644
--- a/firestore/go.mod
+++ b/firestore/go.mod
@@ -11,6 +11,6 @@
golang.org/x/net v0.0.0-20200226121028-0de0cce0169b // indirect
golang.org/x/tools v0.0.0-20200226224502-204d844ad48d // indirect
google.golang.org/api v0.19.0
- google.golang.org/genproto v0.0.0-20200226201735-46b91f19d98c
+ google.golang.org/genproto v0.0.0-20200227132054-3f1135a288c9
google.golang.org/grpc v1.27.1
)
diff --git a/firestore/go.sum b/firestore/go.sum
index 4899dd1..e0c3b31 100644
--- a/firestore/go.sum
+++ b/firestore/go.sum
@@ -316,8 +316,8 @@
google.golang.org/genproto v0.0.0-20200212174721-66ed5ce911ce/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63 h1:YzfoEYWbODU5Fbt37+h7X16BWQbad7Q4S6gclTKFXM8=
google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
-google.golang.org/genproto v0.0.0-20200226201735-46b91f19d98c h1:xFOdgVPpeowWAH0MJ5i0XMp+3yWiWamMtN/kx9xThIQ=
-google.golang.org/genproto v0.0.0-20200226201735-46b91f19d98c/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
+google.golang.org/genproto v0.0.0-20200227132054-3f1135a288c9 h1:Koy0f8zyrEVfIHetH7wjP5mQLUXiqDpubSg8V1fAxqc=
+google.golang.org/genproto v0.0.0-20200227132054-3f1135a288c9/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
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 01afdd5..39f7a9e 100644
--- a/go.mod
+++ b/go.mod
@@ -7,7 +7,7 @@
cloud.google.com/go/datastore v1.1.0
cloud.google.com/go/pubsub v1.2.0
cloud.google.com/go/storage v1.6.0
- github.com/golang/mock v1.4.0
+ github.com/golang/mock v1.4.1
github.com/golang/protobuf v1.3.4
github.com/google/go-cmp v0.4.0
github.com/google/martian v2.1.0+incompatible
@@ -22,7 +22,7 @@
golang.org/x/text v0.3.2
golang.org/x/tools v0.0.0-20200226224502-204d844ad48d
google.golang.org/api v0.19.0
- google.golang.org/genproto v0.0.0-20200226201735-46b91f19d98c
+ google.golang.org/genproto v0.0.0-20200227132054-3f1135a288c9
google.golang.org/grpc v1.27.1
honnef.co/go/tools v0.0.1-2020.1.3
)
diff --git a/go.sum b/go.sum
index 4d10a49..919d61e 100644
--- a/go.sum
+++ b/go.sum
@@ -59,6 +59,8 @@
github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y=
github.com/golang/mock v1.4.0 h1:Rd1kQnQu0Hq3qvJppYSG0HtP+f5LPPUiDswTLiEegLg=
github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw=
+github.com/golang/mock v1.4.1 h1:ocYkMQY5RrXTYgXl7ICpV0IXwlEQGwKIsery4gyXa1U=
+github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw=
github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/golang/protobuf v1.3.1 h1:YF8+flBXS5eO826T4nzqPrxfhQThhXl0YzfuUPu4SBg=
github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
@@ -318,8 +320,8 @@
google.golang.org/genproto v0.0.0-20200204135345-fa8e72b47b90/go.mod h1:GmwEX6Z4W5gMy59cAlVYjN9JhxgbQH6Gn+gFDQe2lzA=
google.golang.org/genproto v0.0.0-20200212174721-66ed5ce911ce/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
-google.golang.org/genproto v0.0.0-20200226201735-46b91f19d98c h1:xFOdgVPpeowWAH0MJ5i0XMp+3yWiWamMtN/kx9xThIQ=
-google.golang.org/genproto v0.0.0-20200226201735-46b91f19d98c/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
+google.golang.org/genproto v0.0.0-20200227132054-3f1135a288c9 h1:Koy0f8zyrEVfIHetH7wjP5mQLUXiqDpubSg8V1fAxqc=
+google.golang.org/genproto v0.0.0-20200227132054-3f1135a288c9/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
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 9581806..d5b452c 100644
--- a/iam/credentials/apiv1/doc.go
+++ b/iam/credentials/apiv1/doc.go
@@ -41,7 +41,7 @@
"google.golang.org/grpc/metadata"
)
-const versionClient = "20200226"
+const versionClient = "20200227"
func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context {
out, _ := metadata.FromOutgoingContext(ctx)
diff --git a/internal/.repo-metadata-full.json b/internal/.repo-metadata-full.json
index bcf724f..40a54a9 100644
--- a/internal/.repo-metadata-full.json
+++ b/internal/.repo-metadata-full.json
@@ -407,6 +407,14 @@
"docs_url": "https://pkg.go.dev/cloud.google.com/go/pubsub",
"release_level": "ga"
},
+ "cloud.google.com/go/pubsub/apiv1": {
+ "distribution_name": "cloud.google.com/go/pubsub/apiv1",
+ "description": "Cloud Pub/Sub API",
+ "language": "Go",
+ "client_library_type": "generated",
+ "docs_url": "https://pkg.go.dev/cloud.google.com/go/pubsub/apiv1",
+ "release_level": "ga"
+ },
"cloud.google.com/go/recaptchaenterprise/apiv1beta1": {
"distribution_name": "cloud.google.com/go/recaptchaenterprise/apiv1beta1",
"description": "reCAPTCHA Enterprise API",
@@ -463,6 +471,14 @@
"docs_url": "https://pkg.go.dev/cloud.google.com/go/scheduler/apiv1beta1",
"release_level": "beta"
},
+ "cloud.google.com/go/secretmanager/apiv1": {
+ "distribution_name": "cloud.google.com/go/secretmanager/apiv1",
+ "description": "Secret Manager API",
+ "language": "Go",
+ "client_library_type": "generated",
+ "docs_url": "https://pkg.go.dev/cloud.google.com/go/secretmanager/apiv1",
+ "release_level": "beta"
+ },
"cloud.google.com/go/secretmanager/apiv1beta1": {
"distribution_name": "cloud.google.com/go/secretmanager/apiv1beta1",
"description": "Secret Manager API",
diff --git a/internal/gapicgen/go.mod b/internal/gapicgen/go.mod
index be291d1..f4b6732 100644
--- a/internal/gapicgen/go.mod
+++ b/internal/gapicgen/go.mod
@@ -8,8 +8,8 @@
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.11.1
- github.com/kr/pretty v0.2.0 // indirect
github.com/kr/text v0.2.0 // indirect
+ github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e // indirect
github.com/stretchr/testify v1.5.1 // indirect
golang.org/x/crypto v0.0.0-20200221231518-2aa609cf4a9d // indirect
golang.org/x/net v0.0.0-20200226121028-0de0cce0169b // indirect
@@ -17,9 +17,9 @@
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e
golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae // indirect
google.golang.org/appengine v1.6.5 // indirect
- google.golang.org/genproto v0.0.0-20200226201735-46b91f19d98c // indirect
+ google.golang.org/genproto v0.0.0-20200227132054-3f1135a288c9 // indirect
google.golang.org/grpc v1.27.1 // indirect
- gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 // indirect
+ gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f // indirect
gopkg.in/src-d/go-git.v4 v4.13.1
gopkg.in/yaml.v2 v2.2.8
)
diff --git a/internal/gapicgen/go.sum b/internal/gapicgen/go.sum
index b92bf59..465e12b 100644
--- a/internal/gapicgen/go.sum
+++ b/internal/gapicgen/go.sum
@@ -67,8 +67,6 @@
github.com/kevinburke/ssh_config v0.0.0-20190725054713-01f96b0aa0cd/go.mod h1:CT57kijsi8u/K/BOFA39wgDQJ9CxiF4nAY/ojJ6r6mM=
github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI=
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
-github.com/kr/pretty v0.2.0 h1:s5hAObm+yFO5uHYt5dYjxi2rXrsnmRpJx4OYvIWUaQs=
-github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
github.com/kr/pty v1.1.8/go.mod h1:O1sed60cT9XZ5uDucP5qwvh+TE3NnUj51EiZO/lmSfw=
github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE=
@@ -77,6 +75,8 @@
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
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/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs=
+github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno=
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=
@@ -165,8 +165,8 @@
google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc=
google.golang.org/genproto v0.0.0-20200212174721-66ed5ce911ce/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
-google.golang.org/genproto v0.0.0-20200226201735-46b91f19d98c h1:xFOdgVPpeowWAH0MJ5i0XMp+3yWiWamMtN/kx9xThIQ=
-google.golang.org/genproto v0.0.0-20200226201735-46b91f19d98c/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
+google.golang.org/genproto v0.0.0-20200227132054-3f1135a288c9 h1:Koy0f8zyrEVfIHetH7wjP5mQLUXiqDpubSg8V1fAxqc=
+google.golang.org/genproto v0.0.0-20200227132054-3f1135a288c9/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
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=
@@ -178,8 +178,8 @@
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=
-gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo=
-gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
+gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f h1:BLraFXnmrev5lT+xlilqcH8XK9/i0At2xKjWk4p6zsU=
+gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/src-d/go-billy.v4 v4.3.2 h1:0SQA1pRztfTFx2miS8sA97XvooFeNOmvUenF4o0EcVg=
gopkg.in/src-d/go-billy.v4 v4.3.2/go.mod h1:nDjArDMp+XMs1aFAESLRjfGSgfvoYN0hDfzEk0GjC98=
gopkg.in/src-d/go-git-fixtures.v3 v3.5.0 h1:ivZFOIltbce2Mo8IjzUHAFoq/IylO9WHhNOAJK+LsJg=
diff --git a/iot/apiv1/doc.go b/iot/apiv1/doc.go
index a6a62d8..3dea198 100644
--- a/iot/apiv1/doc.go
+++ b/iot/apiv1/doc.go
@@ -41,7 +41,7 @@
"google.golang.org/grpc/metadata"
)
-const versionClient = "20200226"
+const versionClient = "20200227"
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 28dcf07..a45ba27 100644
--- a/irm/apiv1alpha2/doc.go
+++ b/irm/apiv1alpha2/doc.go
@@ -40,7 +40,7 @@
"google.golang.org/grpc/metadata"
)
-const versionClient = "20200226"
+const versionClient = "20200227"
func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context {
out, _ := metadata.FromOutgoingContext(ctx)
diff --git a/kms/apiv1/doc.go b/kms/apiv1/doc.go
index 23161d8..37d1dc0 100644
--- a/kms/apiv1/doc.go
+++ b/kms/apiv1/doc.go
@@ -41,7 +41,7 @@
"google.golang.org/grpc/metadata"
)
-const versionClient = "20200226"
+const versionClient = "20200227"
func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context {
out, _ := metadata.FromOutgoingContext(ctx)
diff --git a/language/apiv1/doc.go b/language/apiv1/doc.go
index 593a55e..c31d774 100644
--- a/language/apiv1/doc.go
+++ b/language/apiv1/doc.go
@@ -42,7 +42,7 @@
"google.golang.org/grpc/metadata"
)
-const versionClient = "20200226"
+const versionClient = "20200227"
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 1ccc247..a210108 100644
--- a/language/apiv1beta2/doc.go
+++ b/language/apiv1beta2/doc.go
@@ -44,7 +44,7 @@
"google.golang.org/grpc/metadata"
)
-const versionClient = "20200226"
+const versionClient = "20200227"
func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context {
out, _ := metadata.FromOutgoingContext(ctx)
diff --git a/logging/apiv2/doc.go b/logging/apiv2/doc.go
index 4ee1dfb..77d5b8c 100644
--- a/logging/apiv2/doc.go
+++ b/logging/apiv2/doc.go
@@ -44,7 +44,7 @@
"google.golang.org/grpc/metadata"
)
-const versionClient = "20200226"
+const versionClient = "20200227"
func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context {
out, _ := metadata.FromOutgoingContext(ctx)
diff --git a/logging/go.mod b/logging/go.mod
index 68d66c2..77b6057 100644
--- a/logging/go.mod
+++ b/logging/go.mod
@@ -13,6 +13,6 @@
golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d
golang.org/x/tools v0.0.0-20200226224502-204d844ad48d // indirect
google.golang.org/api v0.19.0
- google.golang.org/genproto v0.0.0-20200226201735-46b91f19d98c
+ google.golang.org/genproto v0.0.0-20200227132054-3f1135a288c9
google.golang.org/grpc v1.27.1
)
diff --git a/logging/go.sum b/logging/go.sum
index bdcc076..d1afbc0 100644
--- a/logging/go.sum
+++ b/logging/go.sum
@@ -317,8 +317,8 @@
google.golang.org/genproto v0.0.0-20200212174721-66ed5ce911ce/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63 h1:YzfoEYWbODU5Fbt37+h7X16BWQbad7Q4S6gclTKFXM8=
google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
-google.golang.org/genproto v0.0.0-20200226201735-46b91f19d98c h1:xFOdgVPpeowWAH0MJ5i0XMp+3yWiWamMtN/kx9xThIQ=
-google.golang.org/genproto v0.0.0-20200226201735-46b91f19d98c/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
+google.golang.org/genproto v0.0.0-20200227132054-3f1135a288c9 h1:Koy0f8zyrEVfIHetH7wjP5mQLUXiqDpubSg8V1fAxqc=
+google.golang.org/genproto v0.0.0-20200227132054-3f1135a288c9/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
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 fe1f902..f313d33 100644
--- a/longrunning/autogen/doc.go
+++ b/longrunning/autogen/doc.go
@@ -40,7 +40,7 @@
"google.golang.org/grpc/metadata"
)
-const versionClient = "20200226"
+const versionClient = "20200227"
func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context {
out, _ := metadata.FromOutgoingContext(ctx)
diff --git a/memcache/apiv1beta2/doc.go b/memcache/apiv1beta2/doc.go
index 66a9ca4..e96b320 100644
--- a/memcache/apiv1beta2/doc.go
+++ b/memcache/apiv1beta2/doc.go
@@ -43,7 +43,7 @@
"google.golang.org/grpc/metadata"
)
-const versionClient = "20200226"
+const versionClient = "20200227"
func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context {
out, _ := metadata.FromOutgoingContext(ctx)
diff --git a/monitoring/apiv3/doc.go b/monitoring/apiv3/doc.go
index 46b6be9..d2b657a 100644
--- a/monitoring/apiv3/doc.go
+++ b/monitoring/apiv3/doc.go
@@ -45,7 +45,7 @@
"google.golang.org/grpc/metadata"
)
-const versionClient = "20200226"
+const versionClient = "20200227"
func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context {
out, _ := metadata.FromOutgoingContext(ctx)
diff --git a/osconfig/agentendpoint/apiv1beta/doc.go b/osconfig/agentendpoint/apiv1beta/doc.go
index 6cec5f3..6f63f6b 100644
--- a/osconfig/agentendpoint/apiv1beta/doc.go
+++ b/osconfig/agentendpoint/apiv1beta/doc.go
@@ -43,7 +43,7 @@
"google.golang.org/grpc/metadata"
)
-const versionClient = "20200226"
+const versionClient = "20200227"
func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context {
out, _ := metadata.FromOutgoingContext(ctx)
diff --git a/osconfig/apiv1beta/doc.go b/osconfig/apiv1beta/doc.go
index fcaffd4..0b9b3dc 100644
--- a/osconfig/apiv1beta/doc.go
+++ b/osconfig/apiv1beta/doc.go
@@ -43,7 +43,7 @@
"google.golang.org/grpc/metadata"
)
-const versionClient = "20200226"
+const versionClient = "20200227"
func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context {
out, _ := metadata.FromOutgoingContext(ctx)
diff --git a/oslogin/apiv1/doc.go b/oslogin/apiv1/doc.go
index a5d1aac..78d5b4b 100644
--- a/oslogin/apiv1/doc.go
+++ b/oslogin/apiv1/doc.go
@@ -41,7 +41,7 @@
"google.golang.org/grpc/metadata"
)
-const versionClient = "20200226"
+const versionClient = "20200227"
func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context {
out, _ := metadata.FromOutgoingContext(ctx)
diff --git a/oslogin/apiv1beta/doc.go b/oslogin/apiv1beta/doc.go
index 0942a0a..460d492 100644
--- a/oslogin/apiv1beta/doc.go
+++ b/oslogin/apiv1beta/doc.go
@@ -43,7 +43,7 @@
"google.golang.org/grpc/metadata"
)
-const versionClient = "20200226"
+const versionClient = "20200227"
func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context {
out, _ := metadata.FromOutgoingContext(ctx)
diff --git a/phishingprotection/apiv1beta1/doc.go b/phishingprotection/apiv1beta1/doc.go
index a7dadf4..d894280 100644
--- a/phishingprotection/apiv1beta1/doc.go
+++ b/phishingprotection/apiv1beta1/doc.go
@@ -40,7 +40,7 @@
"google.golang.org/grpc/metadata"
)
-const versionClient = "20200226"
+const versionClient = "20200227"
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 6d5ec2e..eb941f3 100644
--- a/pubsub/apiv1/doc.go
+++ b/pubsub/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 pubsub is an auto-generated package for the
// Cloud Pub/Sub API.
-
//
// Provides reliable, many-to-many, asynchronous messaging between
// applications.
@@ -31,8 +30,6 @@
//
// 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/pubsub in preference to this.
package pubsub // import "cloud.google.com/go/pubsub/apiv1"
import (
@@ -44,6 +41,8 @@
"google.golang.org/grpc/metadata"
)
+const versionClient = "20200227"
+
func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context {
out, _ := metadata.FromOutgoingContext(ctx)
out = out.Copy()
@@ -78,7 +77,7 @@
}
notSemverRune := func(r rune) bool {
- return strings.IndexRune("0123456789.", r) < 0
+ return !strings.ContainsRune("0123456789.", r)
}
if strings.HasPrefix(s, "go1") {
@@ -99,5 +98,3 @@
}
return "UNKNOWN"
}
-
-const versionClient = "20200226"
diff --git a/pubsub/apiv1/publisher_client.go b/pubsub/apiv1/publisher_client.go
index 0e1746d..e49e056 100644
--- a/pubsub/apiv1/publisher_client.go
+++ b/pubsub/apiv1/publisher_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 pubsub
@@ -27,7 +27,7 @@
gax "github.com/googleapis/gax-go/v2"
"google.golang.org/api/iterator"
"google.golang.org/api/option"
- "google.golang.org/api/transport"
+ gtransport "google.golang.org/api/transport/grpc"
pubsubpb "google.golang.org/genproto/googleapis/pubsub/v1"
"google.golang.org/grpc"
"google.golang.org/grpc/codes"
@@ -42,12 +42,14 @@
GetTopic []gax.CallOption
ListTopics []gax.CallOption
ListTopicSubscriptions []gax.CallOption
+ ListTopicSnapshots []gax.CallOption
DeleteTopic []gax.CallOption
}
func defaultPublisherClientOptions() []option.ClientOption {
return []option.ClientOption{
option.WithEndpoint("pubsub.googleapis.com:443"),
+ option.WithGRPCDialOption(grpc.WithDisableServiceConfig()),
option.WithScopes(DefaultAuthScopes()...),
option.WithGRPCDialOption(grpc.WithDefaultCallOptions(
grpc.MaxCallRecvMsgSize(math.MaxInt32))),
@@ -55,57 +57,97 @@
}
func defaultPublisherCallOptions() *PublisherCallOptions {
- retry := map[[2]string][]gax.CallOption{
- {"default", "idempotent"}: {
- gax.WithRetry(func() gax.Retryer {
- return gax.OnCodes([]codes.Code{
- codes.Aborted,
- codes.Unavailable,
- codes.Unknown,
- }, gax.Backoff{
- Initial: 100 * time.Millisecond,
- Max: 60000 * time.Millisecond,
- Multiplier: 1.3,
- })
- }),
- },
- {"default", "non_idempotent"}: {
+ return &PublisherCallOptions{
+ CreateTopic: []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,
})
}),
},
- {"messaging", "publish"}: {
+ UpdateTopic: []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,
+ })
+ }),
+ },
+ Publish: []gax.CallOption{
gax.WithRetry(func() gax.Retryer {
return gax.OnCodes([]codes.Code{
codes.Aborted,
codes.Canceled,
- codes.DeadlineExceeded,
codes.Internal,
codes.ResourceExhausted,
- codes.Unavailable,
codes.Unknown,
+ codes.Unavailable,
+ codes.DeadlineExceeded,
}, gax.Backoff{
Initial: 100 * time.Millisecond,
Max: 60000 * time.Millisecond,
- Multiplier: 1.3,
+ Multiplier: 1.30,
})
}),
},
- }
- return &PublisherCallOptions{
- CreateTopic: retry[[2]string{"default", "non_idempotent"}],
- UpdateTopic: retry[[2]string{"default", "non_idempotent"}],
- Publish: retry[[2]string{"messaging", "publish"}],
- GetTopic: retry[[2]string{"default", "idempotent"}],
- ListTopics: retry[[2]string{"default", "idempotent"}],
- ListTopicSubscriptions: retry[[2]string{"default", "idempotent"}],
- DeleteTopic: retry[[2]string{"default", "non_idempotent"}],
+ GetTopic: []gax.CallOption{
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnCodes([]codes.Code{
+ codes.Unknown,
+ codes.Aborted,
+ codes.Unavailable,
+ }, gax.Backoff{
+ Initial: 100 * time.Millisecond,
+ Max: 60000 * time.Millisecond,
+ Multiplier: 1.30,
+ })
+ }),
+ },
+ ListTopics: []gax.CallOption{
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnCodes([]codes.Code{
+ codes.Unknown,
+ codes.Aborted,
+ codes.Unavailable,
+ }, gax.Backoff{
+ Initial: 100 * time.Millisecond,
+ Max: 60000 * time.Millisecond,
+ Multiplier: 1.30,
+ })
+ }),
+ },
+ ListTopicSubscriptions: []gax.CallOption{
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnCodes([]codes.Code{
+ codes.Unknown,
+ codes.Aborted,
+ codes.Unavailable,
+ }, gax.Backoff{
+ Initial: 100 * time.Millisecond,
+ Max: 60000 * time.Millisecond,
+ Multiplier: 1.30,
+ })
+ }),
+ },
+ ListTopicSnapshots: []gax.CallOption{},
+ DeleteTopic: []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,
+ })
+ }),
+ },
}
}
@@ -113,8 +155,8 @@
//
// Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
type PublisherClient struct {
- // The connection to the service.
- conn *grpc.ClientConn
+ // Connection pool of gRPC connections to the service.
+ connPool gtransport.ConnPool
// The gRPC API client.
publisherClient pubsubpb.PublisherClient
@@ -131,29 +173,32 @@
// The service that an application uses to manipulate topics, and to send
// messages to a topic.
func NewPublisherClient(ctx context.Context, opts ...option.ClientOption) (*PublisherClient, error) {
- conn, err := transport.DialGRPC(ctx, append(defaultPublisherClientOptions(), opts...)...)
+ connPool, err := gtransport.DialPool(ctx, append(defaultPublisherClientOptions(), opts...)...)
if err != nil {
return nil, err
}
c := &PublisherClient{
- conn: conn,
+ connPool: connPool,
CallOptions: defaultPublisherCallOptions(),
- publisherClient: pubsubpb.NewPublisherClient(conn),
+ publisherClient: pubsubpb.NewPublisherClient(connPool),
}
c.SetGoogleClientInfo()
+
return c, nil
}
-// Connection returns the client's connection to the API service.
+// Connection returns a connection to the API service.
+//
+// Deprecated.
func (c *PublisherClient) Connection() *grpc.ClientConn {
- return c.conn
+ return c.connPool.Conn()
}
// Close closes the connection to the API service. The user should invoke this when
// the client is no longer required.
func (c *PublisherClient) Close() error {
- return c.conn.Close()
+ return c.connPool.Close()
}
// SetGoogleClientInfo sets the name and version of the application in
@@ -166,8 +211,8 @@
}
// CreateTopic creates the given topic with the given name. See the
-// <a href="https://cloud.google.com/pubsub/docs/admin#resource_names">
-// resource name rules</a>.
+//
+// resource name rules (at https://cloud.google.com/pubsub/docs/admin#resource_names).
func (c *PublisherClient) CreateTopic(ctx context.Context, req *pubsubpb.Topic, opts ...gax.CallOption) (*pubsubpb.Topic, error) {
md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName())))
ctx = insertMetadata(ctx, c.xGoogMetadata, md)
@@ -260,6 +305,8 @@
if err != nil {
return nil, "", err
}
+
+ it.Response = resp
return resp.Topics, resp.NextPageToken, nil
}
fetch := func(pageSize int, pageToken string) (string, error) {
@@ -299,6 +346,8 @@
if err != nil {
return nil, "", err
}
+
+ it.Response = resp
return resp.Subscriptions, resp.NextPageToken, nil
}
fetch := func(pageSize int, pageToken string) (string, error) {
@@ -315,6 +364,52 @@
return it
}
+// ListTopicSnapshots lists the names of the snapshots on this topic. Snapshots are used in
+// Seek (at https://cloud.google.com/pubsub/docs/replay-overview)
+// operations, which allow
+// you to manage message acknowledgments in bulk. That is, you can set the
+// acknowledgment state of messages in an existing subscription to the state
+// captured by a snapshot.
+func (c *PublisherClient) ListTopicSnapshots(ctx context.Context, req *pubsubpb.ListTopicSnapshotsRequest, opts ...gax.CallOption) *StringIterator {
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "topic", url.QueryEscape(req.GetTopic())))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
+ opts = append(c.CallOptions.ListTopicSnapshots[0:len(c.CallOptions.ListTopicSnapshots):len(c.CallOptions.ListTopicSnapshots)], opts...)
+ it := &StringIterator{}
+ req = proto.Clone(req).(*pubsubpb.ListTopicSnapshotsRequest)
+ it.InternalFetch = func(pageSize int, pageToken string) ([]string, string, error) {
+ var resp *pubsubpb.ListTopicSnapshotsResponse
+ 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.publisherClient.ListTopicSnapshots(ctx, req, settings.GRPC...)
+ return err
+ }, opts...)
+ if err != nil {
+ return nil, "", err
+ }
+
+ it.Response = resp
+ return resp.Snapshots, 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
+}
+
// DeleteTopic deletes the topic with the given name. Returns NOT_FOUND if the topic
// does not exist. After a topic is deleted, a new topic may be created with
// the same name; this is an entirely new topic with none of the old
@@ -338,6 +433,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.
//
@@ -380,6 +480,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/pubsub/apiv1/publisher_client_example_test.go b/pubsub/apiv1/publisher_client_example_test.go
index 7329995..9569262 100644
--- a/pubsub/apiv1/publisher_client_example_test.go
+++ b/pubsub/apiv1/publisher_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 pubsub_test
@@ -35,6 +35,8 @@
}
func ExamplePublisherClient_CreateTopic() {
+ // import pubsubpb "google.golang.org/genproto/googleapis/pubsub/v1"
+
ctx := context.Background()
c, err := pubsub.NewPublisherClient(ctx)
if err != nil {
@@ -53,6 +55,8 @@
}
func ExamplePublisherClient_UpdateTopic() {
+ // import pubsubpb "google.golang.org/genproto/googleapis/pubsub/v1"
+
ctx := context.Background()
c, err := pubsub.NewPublisherClient(ctx)
if err != nil {
@@ -71,6 +75,8 @@
}
func ExamplePublisherClient_Publish() {
+ // import pubsubpb "google.golang.org/genproto/googleapis/pubsub/v1"
+
ctx := context.Background()
c, err := pubsub.NewPublisherClient(ctx)
if err != nil {
@@ -89,6 +95,8 @@
}
func ExamplePublisherClient_GetTopic() {
+ // import pubsubpb "google.golang.org/genproto/googleapis/pubsub/v1"
+
ctx := context.Background()
c, err := pubsub.NewPublisherClient(ctx)
if err != nil {
@@ -107,6 +115,9 @@
}
func ExamplePublisherClient_ListTopics() {
+ // import pubsubpb "google.golang.org/genproto/googleapis/pubsub/v1"
+ // import "google.golang.org/api/iterator"
+
ctx := context.Background()
c, err := pubsub.NewPublisherClient(ctx)
if err != nil {
@@ -131,6 +142,9 @@
}
func ExamplePublisherClient_ListTopicSubscriptions() {
+ // import pubsubpb "google.golang.org/genproto/googleapis/pubsub/v1"
+ // import "google.golang.org/api/iterator"
+
ctx := context.Background()
c, err := pubsub.NewPublisherClient(ctx)
if err != nil {
@@ -154,6 +168,33 @@
}
}
+func ExamplePublisherClient_ListTopicSnapshots() {
+ // import pubsubpb "google.golang.org/genproto/googleapis/pubsub/v1"
+ // import "google.golang.org/api/iterator"
+
+ ctx := context.Background()
+ c, err := pubsub.NewPublisherClient(ctx)
+ if err != nil {
+ // TODO: Handle error.
+ }
+
+ req := &pubsubpb.ListTopicSnapshotsRequest{
+ // TODO: Fill request struct fields.
+ }
+ it := c.ListTopicSnapshots(ctx, req)
+ for {
+ resp, err := it.Next()
+ if err == iterator.Done {
+ break
+ }
+ if err != nil {
+ // TODO: Handle error.
+ }
+ // TODO: Use resp.
+ _ = resp
+ }
+}
+
func ExamplePublisherClient_DeleteTopic() {
ctx := context.Background()
c, err := pubsub.NewPublisherClient(ctx)
diff --git a/pubsub/apiv1/subscriber_client.go b/pubsub/apiv1/subscriber_client.go
index be104c2..87cea51 100644
--- a/pubsub/apiv1/subscriber_client.go
+++ b/pubsub/apiv1/subscriber_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 pubsub
@@ -27,7 +27,7 @@
gax "github.com/googleapis/gax-go/v2"
"google.golang.org/api/iterator"
"google.golang.org/api/option"
- "google.golang.org/api/transport"
+ gtransport "google.golang.org/api/transport/grpc"
pubsubpb "google.golang.org/genproto/googleapis/pubsub/v1"
"google.golang.org/grpc"
"google.golang.org/grpc/codes"
@@ -46,6 +46,7 @@
Pull []gax.CallOption
StreamingPull []gax.CallOption
ModifyPushConfig []gax.CallOption
+ GetSnapshot []gax.CallOption
ListSnapshots []gax.CallOption
CreateSnapshot []gax.CallOption
UpdateSnapshot []gax.CallOption
@@ -56,6 +57,7 @@
func defaultSubscriberClientOptions() []option.ClientOption {
return []option.ClientOption{
option.WithEndpoint("pubsub.googleapis.com:443"),
+ option.WithGRPCDialOption(grpc.WithDisableServiceConfig()),
option.WithScopes(DefaultAuthScopes()...),
option.WithGRPCDialOption(grpc.WithDefaultCallOptions(
grpc.MaxCallRecvMsgSize(math.MaxInt32))),
@@ -63,87 +65,189 @@
}
func defaultSubscriberCallOptions() *SubscriberCallOptions {
- retry := map[[2]string][]gax.CallOption{
- {"default", "idempotent"}: {
- gax.WithRetry(func() gax.Retryer {
- return gax.OnCodes([]codes.Code{
- codes.Aborted,
- codes.Unavailable,
- codes.Unknown,
- }, 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,
- })
- }),
- },
- {"messaging", "idempotent"}: {
- gax.WithRetry(func() gax.Retryer {
- return gax.OnCodes([]codes.Code{
- codes.Aborted,
- codes.Unavailable,
- codes.Unknown,
- }, gax.Backoff{
- Initial: 100 * time.Millisecond,
- Max: 60000 * time.Millisecond,
- Multiplier: 1.3,
- })
- }),
- },
- {"messaging", "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,
- })
- }),
- },
- {"streaming_messaging", "streaming_pull"}: {
- gax.WithRetry(func() gax.Retryer {
- return gax.OnCodes([]codes.Code{
- codes.Aborted,
- codes.DeadlineExceeded,
- codes.Internal,
- codes.ResourceExhausted,
- codes.Unavailable,
- }, gax.Backoff{
- Initial: 100 * time.Millisecond,
- Max: 60000 * time.Millisecond,
- Multiplier: 1.3,
- })
- }),
- },
- }
return &SubscriberCallOptions{
- CreateSubscription: retry[[2]string{"default", "idempotent"}],
- GetSubscription: retry[[2]string{"default", "idempotent"}],
- UpdateSubscription: retry[[2]string{"default", "non_idempotent"}],
- ListSubscriptions: retry[[2]string{"default", "idempotent"}],
- DeleteSubscription: retry[[2]string{"default", "non_idempotent"}],
- ModifyAckDeadline: retry[[2]string{"default", "non_idempotent"}],
- Acknowledge: retry[[2]string{"messaging", "non_idempotent"}],
- Pull: retry[[2]string{"messaging", "idempotent"}],
- StreamingPull: retry[[2]string{"streaming_messaging", "streaming_pull"}],
- ModifyPushConfig: retry[[2]string{"default", "non_idempotent"}],
- ListSnapshots: retry[[2]string{"default", "idempotent"}],
- CreateSnapshot: retry[[2]string{"default", "non_idempotent"}],
- UpdateSnapshot: retry[[2]string{"default", "non_idempotent"}],
- DeleteSnapshot: retry[[2]string{"default", "non_idempotent"}],
- Seek: retry[[2]string{"default", "idempotent"}],
+ CreateSubscription: []gax.CallOption{
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnCodes([]codes.Code{
+ codes.Unknown,
+ codes.Aborted,
+ codes.Unavailable,
+ }, gax.Backoff{
+ Initial: 100 * time.Millisecond,
+ Max: 60000 * time.Millisecond,
+ Multiplier: 1.30,
+ })
+ }),
+ },
+ GetSubscription: []gax.CallOption{
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnCodes([]codes.Code{
+ codes.Unknown,
+ codes.Aborted,
+ codes.Unavailable,
+ }, gax.Backoff{
+ Initial: 100 * time.Millisecond,
+ Max: 60000 * time.Millisecond,
+ Multiplier: 1.30,
+ })
+ }),
+ },
+ UpdateSubscription: []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,
+ })
+ }),
+ },
+ ListSubscriptions: []gax.CallOption{
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnCodes([]codes.Code{
+ codes.Unknown,
+ codes.Aborted,
+ 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.Unavailable,
+ }, gax.Backoff{
+ Initial: 100 * time.Millisecond,
+ Max: 60000 * time.Millisecond,
+ Multiplier: 1.30,
+ })
+ }),
+ },
+ ModifyAckDeadline: []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,
+ })
+ }),
+ },
+ Acknowledge: []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,
+ })
+ }),
+ },
+ Pull: []gax.CallOption{
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnCodes([]codes.Code{
+ codes.Unknown,
+ codes.Aborted,
+ codes.Unavailable,
+ }, gax.Backoff{
+ Initial: 100 * time.Millisecond,
+ Max: 60000 * time.Millisecond,
+ Multiplier: 1.30,
+ })
+ }),
+ },
+ StreamingPull: []gax.CallOption{
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnCodes([]codes.Code{
+ codes.DeadlineExceeded,
+ codes.ResourceExhausted,
+ codes.Aborted,
+ codes.Internal,
+ codes.Unavailable,
+ }, gax.Backoff{
+ Initial: 100 * time.Millisecond,
+ Max: 60000 * time.Millisecond,
+ Multiplier: 1.30,
+ })
+ }),
+ },
+ ModifyPushConfig: []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,
+ })
+ }),
+ },
+ GetSnapshot: []gax.CallOption{},
+ ListSnapshots: []gax.CallOption{
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnCodes([]codes.Code{
+ codes.Unknown,
+ codes.Aborted,
+ codes.Unavailable,
+ }, gax.Backoff{
+ Initial: 100 * time.Millisecond,
+ Max: 60000 * time.Millisecond,
+ Multiplier: 1.30,
+ })
+ }),
+ },
+ CreateSnapshot: []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,
+ })
+ }),
+ },
+ UpdateSnapshot: []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,
+ })
+ }),
+ },
+ DeleteSnapshot: []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,
+ })
+ }),
+ },
+ Seek: []gax.CallOption{
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnCodes([]codes.Code{
+ codes.Unknown,
+ codes.Aborted,
+ codes.Unavailable,
+ }, gax.Backoff{
+ Initial: 100 * time.Millisecond,
+ Max: 60000 * time.Millisecond,
+ Multiplier: 1.30,
+ })
+ }),
+ },
}
}
@@ -151,8 +255,8 @@
//
// Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
type SubscriberClient struct {
- // The connection to the service.
- conn *grpc.ClientConn
+ // Connection pool of gRPC connections to the service.
+ connPool gtransport.ConnPool
// The gRPC API client.
subscriberClient pubsubpb.SubscriberClient
@@ -170,29 +274,32 @@
// consume messages from a subscription via the Pull method or by
// establishing a bi-directional stream using the StreamingPull method.
func NewSubscriberClient(ctx context.Context, opts ...option.ClientOption) (*SubscriberClient, error) {
- conn, err := transport.DialGRPC(ctx, append(defaultSubscriberClientOptions(), opts...)...)
+ connPool, err := gtransport.DialPool(ctx, append(defaultSubscriberClientOptions(), opts...)...)
if err != nil {
return nil, err
}
c := &SubscriberClient{
- conn: conn,
+ connPool: connPool,
CallOptions: defaultSubscriberCallOptions(),
- subscriberClient: pubsubpb.NewSubscriberClient(conn),
+ subscriberClient: pubsubpb.NewSubscriberClient(connPool),
}
c.SetGoogleClientInfo()
+
return c, nil
}
-// Connection returns the client's connection to the API service.
+// Connection returns a connection to the API service.
+//
+// Deprecated.
func (c *SubscriberClient) Connection() *grpc.ClientConn {
- return c.conn
+ return c.connPool.Conn()
}
// Close closes the connection to the API service. The user should invoke this when
// the client is no longer required.
func (c *SubscriberClient) Close() error {
- return c.conn.Close()
+ return c.connPool.Close()
}
// SetGoogleClientInfo sets the name and version of the application in
@@ -205,10 +312,10 @@
}
// CreateSubscription creates a subscription to a given topic. See the
-// <a href="https://cloud.google.com/pubsub/docs/admin#resource_names">
-// resource name rules</a>.
+//
+// resource name rules (at https://cloud.google.com/pubsub/docs/admin#resource_names).
// If the subscription already exists, returns ALREADY_EXISTS.
-// If the corresponding topic doesn't exist, returns NOT_FOUND.
+// If the corresponding topic doesn’t exist, returns NOT_FOUND.
//
// If the name is not provided in the request, the server will assign a random
// name for this subscription on the same project as the topic, conforming
@@ -291,6 +398,8 @@
if err != nil {
return nil, "", err
}
+
+ it.Response = resp
return resp.Subscriptions, resp.NextPageToken, nil
}
fetch := func(pageSize int, pageToken string) (string, error) {
@@ -419,8 +528,29 @@
return err
}
+// GetSnapshot gets the configuration details of a snapshot. Snapshots are used in
+// Seek (at https://cloud.google.com/pubsub/docs/replay-overview)
+// operations, which allow you to manage message acknowledgments in bulk. That
+// is, you can set the acknowledgment state of messages in an existing
+// subscription to the state captured by a snapshot.
+func (c *SubscriberClient) GetSnapshot(ctx context.Context, req *pubsubpb.GetSnapshotRequest, opts ...gax.CallOption) (*pubsubpb.Snapshot, error) {
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "snapshot", url.QueryEscape(req.GetSnapshot())))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
+ opts = append(c.CallOptions.GetSnapshot[0:len(c.CallOptions.GetSnapshot):len(c.CallOptions.GetSnapshot)], opts...)
+ var resp *pubsubpb.Snapshot
+ err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ var err error
+ resp, err = c.subscriberClient.GetSnapshot(ctx, req, settings.GRPC...)
+ return err
+ }, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return resp, nil
+}
+
// ListSnapshots lists the existing snapshots. Snapshots are used in
-// <a href="https://cloud.google.com/pubsub/docs/replay-overview">Seek</a>
+// Seek (at https://cloud.google.com/pubsub/docs/replay-overview)
// operations, which allow
// you to manage message acknowledgments in bulk. That is, you can set the
// acknowledgment state of messages in an existing subscription to the state
@@ -447,6 +577,8 @@
if err != nil {
return nil, "", err
}
+
+ it.Response = resp
return resp.Snapshots, resp.NextPageToken, nil
}
fetch := func(pageSize int, pageToken string) (string, error) {
@@ -464,15 +596,17 @@
}
// CreateSnapshot creates a snapshot from the requested subscription. Snapshots are used in
-// <a href="https://cloud.google.com/pubsub/docs/replay-overview">Seek</a>
+// Seek (at https://cloud.google.com/pubsub/docs/replay-overview)
// operations, which allow
// you to manage message acknowledgments in bulk. That is, you can set the
// acknowledgment state of messages in an existing subscription to the state
// captured by a snapshot.
-// <br><br>If the snapshot already exists, returns ALREADY_EXISTS.
-// If the requested subscription doesn't exist, returns NOT_FOUND.
-// If the backlog in the subscription is too old -- and the resulting snapshot
-// would expire in less than 1 hour -- then FAILED_PRECONDITION is returned.
+//
+//
+// If the snapshot already exists, returns ALREADY_EXISTS.
+// If the requested subscription doesn’t exist, returns NOT_FOUND.
+// If the backlog in the subscription is too old – and the resulting snapshot
+// would expire in less than 1 hour – then FAILED_PRECONDITION is returned.
// See also the Snapshot.expire_time field. If the name is not provided in
// the request, the server will assign a random
// name for this snapshot on the same project as the subscription, conforming
@@ -498,7 +632,7 @@
}
// UpdateSnapshot updates an existing snapshot. Snapshots are used in
-// <a href="https://cloud.google.com/pubsub/docs/replay-overview">Seek</a>
+// Seek (at https://cloud.google.com/pubsub/docs/replay-overview)
// operations, which allow
// you to manage message acknowledgments in bulk. That is, you can set the
// acknowledgment state of messages in an existing subscription to the state
@@ -520,11 +654,13 @@
}
// DeleteSnapshot removes an existing snapshot. Snapshots are used in
-// <a href="https://cloud.google.com/pubsub/docs/replay-overview">Seek</a>
+// Seek (at https://cloud.google.com/pubsub/docs/replay-overview)
// operations, which allow
// you to manage message acknowledgments in bulk. That is, you can set the
// acknowledgment state of messages in an existing subscription to the state
-// captured by a snapshot.<br><br>
+// captured by a snapshot.
+//
+//
// When the snapshot is deleted, all messages retained in the snapshot
// are immediately dropped. After a snapshot is deleted, a new one may be
// created with the same name, but the new one has no association with the old
@@ -543,7 +679,7 @@
// Seek seeks an existing subscription to a point in time or to a given snapshot,
// whichever is provided in the request. Snapshots are used in
-// <a href="https://cloud.google.com/pubsub/docs/replay-overview">Seek</a>
+// Seek (at https://cloud.google.com/pubsub/docs/replay-overview)
// operations, which allow
// you to manage message acknowledgments in bulk. That is, you can set the
// acknowledgment state of messages in an existing subscription to the state
@@ -571,6 +707,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.
//
@@ -613,6 +754,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/pubsub/apiv1/subscriber_client_example_test.go b/pubsub/apiv1/subscriber_client_example_test.go
index 307e5e7..564db52 100644
--- a/pubsub/apiv1/subscriber_client_example_test.go
+++ b/pubsub/apiv1/subscriber_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 pubsub_test
@@ -36,6 +36,8 @@
}
func ExampleSubscriberClient_CreateSubscription() {
+ // import pubsubpb "google.golang.org/genproto/googleapis/pubsub/v1"
+
ctx := context.Background()
c, err := pubsub.NewSubscriberClient(ctx)
if err != nil {
@@ -54,6 +56,8 @@
}
func ExampleSubscriberClient_GetSubscription() {
+ // import pubsubpb "google.golang.org/genproto/googleapis/pubsub/v1"
+
ctx := context.Background()
c, err := pubsub.NewSubscriberClient(ctx)
if err != nil {
@@ -72,6 +76,8 @@
}
func ExampleSubscriberClient_UpdateSubscription() {
+ // import pubsubpb "google.golang.org/genproto/googleapis/pubsub/v1"
+
ctx := context.Background()
c, err := pubsub.NewSubscriberClient(ctx)
if err != nil {
@@ -90,6 +96,9 @@
}
func ExampleSubscriberClient_ListSubscriptions() {
+ // import pubsubpb "google.golang.org/genproto/googleapis/pubsub/v1"
+ // import "google.golang.org/api/iterator"
+
ctx := context.Background()
c, err := pubsub.NewSubscriberClient(ctx)
if err != nil {
@@ -162,6 +171,8 @@
}
func ExampleSubscriberClient_Pull() {
+ // import pubsubpb "google.golang.org/genproto/googleapis/pubsub/v1"
+
ctx := context.Background()
c, err := pubsub.NewSubscriberClient(ctx)
if err != nil {
@@ -180,6 +191,8 @@
}
func ExampleSubscriberClient_StreamingPull() {
+ // import pubsubpb "google.golang.org/genproto/googleapis/pubsub/v1"
+
ctx := context.Background()
c, err := pubsub.NewSubscriberClient(ctx)
if err != nil {
@@ -229,7 +242,30 @@
}
}
+func ExampleSubscriberClient_GetSnapshot() {
+ // import pubsubpb "google.golang.org/genproto/googleapis/pubsub/v1"
+
+ ctx := context.Background()
+ c, err := pubsub.NewSubscriberClient(ctx)
+ if err != nil {
+ // TODO: Handle error.
+ }
+
+ req := &pubsubpb.GetSnapshotRequest{
+ // TODO: Fill request struct fields.
+ }
+ resp, err := c.GetSnapshot(ctx, req)
+ if err != nil {
+ // TODO: Handle error.
+ }
+ // TODO: Use resp.
+ _ = resp
+}
+
func ExampleSubscriberClient_ListSnapshots() {
+ // import pubsubpb "google.golang.org/genproto/googleapis/pubsub/v1"
+ // import "google.golang.org/api/iterator"
+
ctx := context.Background()
c, err := pubsub.NewSubscriberClient(ctx)
if err != nil {
@@ -254,6 +290,8 @@
}
func ExampleSubscriberClient_CreateSnapshot() {
+ // import pubsubpb "google.golang.org/genproto/googleapis/pubsub/v1"
+
ctx := context.Background()
c, err := pubsub.NewSubscriberClient(ctx)
if err != nil {
@@ -272,6 +310,8 @@
}
func ExampleSubscriberClient_UpdateSnapshot() {
+ // import pubsubpb "google.golang.org/genproto/googleapis/pubsub/v1"
+
ctx := context.Background()
c, err := pubsub.NewSubscriberClient(ctx)
if err != nil {
@@ -306,6 +346,8 @@
}
func ExampleSubscriberClient_Seek() {
+ // import pubsubpb "google.golang.org/genproto/googleapis/pubsub/v1"
+
ctx := context.Background()
c, err := pubsub.NewSubscriberClient(ctx)
if err != nil {
diff --git a/pubsub/go.mod b/pubsub/go.mod
index dd78367..54046d4 100644
--- a/pubsub/go.mod
+++ b/pubsub/go.mod
@@ -15,6 +15,6 @@
golang.org/x/time v0.0.0-20191024005414-555d28b269f0
golang.org/x/tools v0.0.0-20200226224502-204d844ad48d // indirect
google.golang.org/api v0.19.0
- google.golang.org/genproto v0.0.0-20200226201735-46b91f19d98c
+ google.golang.org/genproto v0.0.0-20200227132054-3f1135a288c9
google.golang.org/grpc v1.27.1
)
diff --git a/pubsub/go.sum b/pubsub/go.sum
index 1533f75..9cb8509 100644
--- a/pubsub/go.sum
+++ b/pubsub/go.sum
@@ -314,8 +314,8 @@
google.golang.org/genproto v0.0.0-20200212174721-66ed5ce911ce/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63 h1:YzfoEYWbODU5Fbt37+h7X16BWQbad7Q4S6gclTKFXM8=
google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
-google.golang.org/genproto v0.0.0-20200226201735-46b91f19d98c h1:xFOdgVPpeowWAH0MJ5i0XMp+3yWiWamMtN/kx9xThIQ=
-google.golang.org/genproto v0.0.0-20200226201735-46b91f19d98c/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
+google.golang.org/genproto v0.0.0-20200227132054-3f1135a288c9 h1:Koy0f8zyrEVfIHetH7wjP5mQLUXiqDpubSg8V1fAxqc=
+google.golang.org/genproto v0.0.0-20200227132054-3f1135a288c9/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
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 fd8b2d3..8d333f6 100644
--- a/recaptchaenterprise/apiv1beta1/doc.go
+++ b/recaptchaenterprise/apiv1beta1/doc.go
@@ -40,7 +40,7 @@
"google.golang.org/grpc/metadata"
)
-const versionClient = "20200226"
+const versionClient = "20200227"
func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context {
out, _ := metadata.FromOutgoingContext(ctx)
diff --git a/recommender/apiv1/doc.go b/recommender/apiv1/doc.go
index c55dff7..b1e8943 100644
--- a/recommender/apiv1/doc.go
+++ b/recommender/apiv1/doc.go
@@ -40,7 +40,7 @@
"google.golang.org/grpc/metadata"
)
-const versionClient = "20200226"
+const versionClient = "20200227"
func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context {
out, _ := metadata.FromOutgoingContext(ctx)
diff --git a/recommender/apiv1beta1/doc.go b/recommender/apiv1beta1/doc.go
index e8eaf17..77a0823 100644
--- a/recommender/apiv1beta1/doc.go
+++ b/recommender/apiv1beta1/doc.go
@@ -40,7 +40,7 @@
"google.golang.org/grpc/metadata"
)
-const versionClient = "20200226"
+const versionClient = "20200227"
func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context {
out, _ := metadata.FromOutgoingContext(ctx)
diff --git a/redis/apiv1/doc.go b/redis/apiv1/doc.go
index 6539558..8cbd7f1 100644
--- a/redis/apiv1/doc.go
+++ b/redis/apiv1/doc.go
@@ -40,7 +40,7 @@
"google.golang.org/grpc/metadata"
)
-const versionClient = "20200226"
+const versionClient = "20200227"
func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context {
out, _ := metadata.FromOutgoingContext(ctx)
diff --git a/redis/apiv1beta1/doc.go b/redis/apiv1beta1/doc.go
index f0376d4..c84f7b4 100644
--- a/redis/apiv1beta1/doc.go
+++ b/redis/apiv1beta1/doc.go
@@ -42,7 +42,7 @@
"google.golang.org/grpc/metadata"
)
-const versionClient = "20200226"
+const versionClient = "20200227"
func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context {
out, _ := metadata.FromOutgoingContext(ctx)
diff --git a/scheduler/apiv1/doc.go b/scheduler/apiv1/doc.go
index a4fc32a..410c821 100644
--- a/scheduler/apiv1/doc.go
+++ b/scheduler/apiv1/doc.go
@@ -40,7 +40,7 @@
"google.golang.org/grpc/metadata"
)
-const versionClient = "20200226"
+const versionClient = "20200227"
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 131a6e8..4f0df12 100644
--- a/scheduler/apiv1beta1/doc.go
+++ b/scheduler/apiv1beta1/doc.go
@@ -42,7 +42,7 @@
"google.golang.org/grpc/metadata"
)
-const versionClient = "20200226"
+const versionClient = "20200227"
func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context {
out, _ := metadata.FromOutgoingContext(ctx)
diff --git a/secretmanager/apiv1/doc.go b/secretmanager/apiv1/doc.go
new file mode 100644
index 0000000..ec5e473
--- /dev/null
+++ b/secretmanager/apiv1/doc.go
@@ -0,0 +1,101 @@
+// Copyright 2020 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 secretmanager is an auto-generated package for the
+// Secret Manager API.
+//
+// Stores and manages access to application secrets. Provides convenience
+// while improving security.
+//
+// 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 secretmanager // import "cloud.google.com/go/secretmanager/apiv1"
+
+import (
+ "context"
+ "runtime"
+ "strings"
+ "unicode"
+
+ "google.golang.org/grpc/metadata"
+)
+
+const versionClient = "20200227"
+
+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",
+ }
+}
+
+// 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/secretmanager/apiv1/secret_manager_client.go b/secretmanager/apiv1/secret_manager_client.go
new file mode 100644
index 0000000..001f611
--- /dev/null
+++ b/secretmanager/apiv1/secret_manager_client.go
@@ -0,0 +1,583 @@
+// Copyright 2020 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 secretmanager
+
+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"
+ gtransport "google.golang.org/api/transport/grpc"
+ secretmanagerpb "google.golang.org/genproto/googleapis/cloud/secretmanager/v1"
+ iampb "google.golang.org/genproto/googleapis/iam/v1"
+ "google.golang.org/grpc"
+ "google.golang.org/grpc/codes"
+ "google.golang.org/grpc/metadata"
+)
+
+// CallOptions contains the retry settings for each method of Client.
+type CallOptions struct {
+ ListSecrets []gax.CallOption
+ CreateSecret []gax.CallOption
+ AddSecretVersion []gax.CallOption
+ GetSecret []gax.CallOption
+ UpdateSecret []gax.CallOption
+ DeleteSecret []gax.CallOption
+ ListSecretVersions []gax.CallOption
+ GetSecretVersion []gax.CallOption
+ AccessSecretVersion []gax.CallOption
+ DisableSecretVersion []gax.CallOption
+ EnableSecretVersion []gax.CallOption
+ DestroySecretVersion []gax.CallOption
+ SetIamPolicy []gax.CallOption
+ GetIamPolicy []gax.CallOption
+ TestIamPermissions []gax.CallOption
+}
+
+func defaultClientOptions() []option.ClientOption {
+ return []option.ClientOption{
+ option.WithEndpoint("secretmanager.googleapis.com:443"),
+ option.WithGRPCDialOption(grpc.WithDisableServiceConfig()),
+ option.WithScopes(DefaultAuthScopes()...),
+ option.WithGRPCDialOption(grpc.WithDefaultCallOptions(
+ grpc.MaxCallRecvMsgSize(math.MaxInt32))),
+ }
+}
+
+func defaultCallOptions() *CallOptions {
+ return &CallOptions{
+ ListSecrets: []gax.CallOption{},
+ CreateSecret: []gax.CallOption{},
+ AddSecretVersion: []gax.CallOption{},
+ GetSecret: []gax.CallOption{},
+ UpdateSecret: []gax.CallOption{},
+ DeleteSecret: []gax.CallOption{},
+ ListSecretVersions: []gax.CallOption{},
+ GetSecretVersion: []gax.CallOption{},
+ AccessSecretVersion: []gax.CallOption{
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnCodes([]codes.Code{
+ codes.Unavailable,
+ codes.Unknown,
+ }, gax.Backoff{
+ Initial: 1000 * time.Millisecond,
+ Max: 60000 * time.Millisecond,
+ Multiplier: 1.30,
+ })
+ }),
+ },
+ DisableSecretVersion: []gax.CallOption{},
+ EnableSecretVersion: []gax.CallOption{},
+ DestroySecretVersion: []gax.CallOption{},
+ SetIamPolicy: []gax.CallOption{},
+ GetIamPolicy: []gax.CallOption{},
+ TestIamPermissions: []gax.CallOption{},
+ }
+}
+
+// Client is a client for interacting with Secret Manager API.
+//
+// Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
+type Client struct {
+ // Connection pool of gRPC connections to the service.
+ connPool gtransport.ConnPool
+
+ // The gRPC API client.
+ client secretmanagerpb.SecretManagerServiceClient
+
+ // 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 secret manager service client.
+//
+// Secret Manager Service
+//
+// Manages secrets and operations using those secrets. Implements a REST
+// model with the following objects:
+//
+// [Secret][google.cloud.secretmanager.v1.Secret]
+//
+// [SecretVersion][google.cloud.secretmanager.v1.SecretVersion]
+func NewClient(ctx context.Context, opts ...option.ClientOption) (*Client, error) {
+ connPool, err := gtransport.DialPool(ctx, append(defaultClientOptions(), opts...)...)
+ if err != nil {
+ return nil, err
+ }
+ c := &Client{
+ connPool: connPool,
+ CallOptions: defaultCallOptions(),
+
+ client: secretmanagerpb.NewSecretManagerServiceClient(connPool),
+ }
+ c.setGoogleClientInfo()
+
+ return c, nil
+}
+
+// Connection returns a connection to the API service.
+//
+// Deprecated.
+func (c *Client) Connection() *grpc.ClientConn {
+ return c.connPool.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.connPool.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...))
+}
+
+// ListSecrets lists [Secrets][google.cloud.secretmanager.v1.Secret].
+func (c *Client) ListSecrets(ctx context.Context, req *secretmanagerpb.ListSecretsRequest, opts ...gax.CallOption) *SecretIterator {
+ 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.ListSecrets[0:len(c.CallOptions.ListSecrets):len(c.CallOptions.ListSecrets)], opts...)
+ it := &SecretIterator{}
+ req = proto.Clone(req).(*secretmanagerpb.ListSecretsRequest)
+ it.InternalFetch = func(pageSize int, pageToken string) ([]*secretmanagerpb.Secret, string, error) {
+ var resp *secretmanagerpb.ListSecretsResponse
+ 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.ListSecrets(ctx, req, settings.GRPC...)
+ return err
+ }, opts...)
+ if err != nil {
+ return nil, "", err
+ }
+
+ it.Response = resp
+ return resp.Secrets, 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
+}
+
+// CreateSecret creates a new [Secret][google.cloud.secretmanager.v1.Secret] containing no [SecretVersions][google.cloud.secretmanager.v1.SecretVersion].
+func (c *Client) CreateSecret(ctx context.Context, req *secretmanagerpb.CreateSecretRequest, opts ...gax.CallOption) (*secretmanagerpb.Secret, 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.CreateSecret[0:len(c.CallOptions.CreateSecret):len(c.CallOptions.CreateSecret)], opts...)
+ var resp *secretmanagerpb.Secret
+ err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ var err error
+ resp, err = c.client.CreateSecret(ctx, req, settings.GRPC...)
+ return err
+ }, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return resp, nil
+}
+
+// AddSecretVersion creates a new [SecretVersion][google.cloud.secretmanager.v1.SecretVersion] containing secret data and attaches
+// it to an existing [Secret][google.cloud.secretmanager.v1.Secret].
+func (c *Client) AddSecretVersion(ctx context.Context, req *secretmanagerpb.AddSecretVersionRequest, opts ...gax.CallOption) (*secretmanagerpb.SecretVersion, 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.AddSecretVersion[0:len(c.CallOptions.AddSecretVersion):len(c.CallOptions.AddSecretVersion)], opts...)
+ var resp *secretmanagerpb.SecretVersion
+ err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ var err error
+ resp, err = c.client.AddSecretVersion(ctx, req, settings.GRPC...)
+ return err
+ }, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return resp, nil
+}
+
+// GetSecret gets metadata for a given [Secret][google.cloud.secretmanager.v1.Secret].
+func (c *Client) GetSecret(ctx context.Context, req *secretmanagerpb.GetSecretRequest, opts ...gax.CallOption) (*secretmanagerpb.Secret, 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.GetSecret[0:len(c.CallOptions.GetSecret):len(c.CallOptions.GetSecret)], opts...)
+ var resp *secretmanagerpb.Secret
+ err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ var err error
+ resp, err = c.client.GetSecret(ctx, req, settings.GRPC...)
+ return err
+ }, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return resp, nil
+}
+
+// UpdateSecret updates metadata of an existing [Secret][google.cloud.secretmanager.v1.Secret].
+func (c *Client) UpdateSecret(ctx context.Context, req *secretmanagerpb.UpdateSecretRequest, opts ...gax.CallOption) (*secretmanagerpb.Secret, error) {
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "secret.name", url.QueryEscape(req.GetSecret().GetName())))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
+ opts = append(c.CallOptions.UpdateSecret[0:len(c.CallOptions.UpdateSecret):len(c.CallOptions.UpdateSecret)], opts...)
+ var resp *secretmanagerpb.Secret
+ err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ var err error
+ resp, err = c.client.UpdateSecret(ctx, req, settings.GRPC...)
+ return err
+ }, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return resp, nil
+}
+
+// DeleteSecret deletes a [Secret][google.cloud.secretmanager.v1.Secret].
+func (c *Client) DeleteSecret(ctx context.Context, req *secretmanagerpb.DeleteSecretRequest, 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.DeleteSecret[0:len(c.CallOptions.DeleteSecret):len(c.CallOptions.DeleteSecret)], opts...)
+ err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ var err error
+ _, err = c.client.DeleteSecret(ctx, req, settings.GRPC...)
+ return err
+ }, opts...)
+ return err
+}
+
+// ListSecretVersions lists [SecretVersions][google.cloud.secretmanager.v1.SecretVersion]. This call does not return secret
+// data.
+func (c *Client) ListSecretVersions(ctx context.Context, req *secretmanagerpb.ListSecretVersionsRequest, opts ...gax.CallOption) *SecretVersionIterator {
+ 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.ListSecretVersions[0:len(c.CallOptions.ListSecretVersions):len(c.CallOptions.ListSecretVersions)], opts...)
+ it := &SecretVersionIterator{}
+ req = proto.Clone(req).(*secretmanagerpb.ListSecretVersionsRequest)
+ it.InternalFetch = func(pageSize int, pageToken string) ([]*secretmanagerpb.SecretVersion, string, error) {
+ var resp *secretmanagerpb.ListSecretVersionsResponse
+ 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.ListSecretVersions(ctx, req, settings.GRPC...)
+ return err
+ }, opts...)
+ if err != nil {
+ return nil, "", err
+ }
+
+ it.Response = resp
+ return resp.Versions, 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
+}
+
+// GetSecretVersion gets metadata for a [SecretVersion][google.cloud.secretmanager.v1.SecretVersion].
+//
+// projects/*/secrets/*/versions/latest is an alias to the latest
+// [SecretVersion][google.cloud.secretmanager.v1.SecretVersion].
+func (c *Client) GetSecretVersion(ctx context.Context, req *secretmanagerpb.GetSecretVersionRequest, opts ...gax.CallOption) (*secretmanagerpb.SecretVersion, 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.GetSecretVersion[0:len(c.CallOptions.GetSecretVersion):len(c.CallOptions.GetSecretVersion)], opts...)
+ var resp *secretmanagerpb.SecretVersion
+ err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ var err error
+ resp, err = c.client.GetSecretVersion(ctx, req, settings.GRPC...)
+ return err
+ }, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return resp, nil
+}
+
+// AccessSecretVersion accesses a [SecretVersion][google.cloud.secretmanager.v1.SecretVersion]. This call returns the secret data.
+//
+// projects/*/secrets/*/versions/latest is an alias to the latest
+// [SecretVersion][google.cloud.secretmanager.v1.SecretVersion].
+func (c *Client) AccessSecretVersion(ctx context.Context, req *secretmanagerpb.AccessSecretVersionRequest, opts ...gax.CallOption) (*secretmanagerpb.AccessSecretVersionResponse, 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.AccessSecretVersion[0:len(c.CallOptions.AccessSecretVersion):len(c.CallOptions.AccessSecretVersion)], opts...)
+ var resp *secretmanagerpb.AccessSecretVersionResponse
+ err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ var err error
+ resp, err = c.client.AccessSecretVersion(ctx, req, settings.GRPC...)
+ return err
+ }, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return resp, nil
+}
+
+// DisableSecretVersion disables a [SecretVersion][google.cloud.secretmanager.v1.SecretVersion].
+//
+// Sets the [state][google.cloud.secretmanager.v1.SecretVersion.state] of the [SecretVersion][google.cloud.secretmanager.v1.SecretVersion] to
+// [DISABLED][google.cloud.secretmanager.v1.SecretVersion.State.DISABLED].
+func (c *Client) DisableSecretVersion(ctx context.Context, req *secretmanagerpb.DisableSecretVersionRequest, opts ...gax.CallOption) (*secretmanagerpb.SecretVersion, 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.DisableSecretVersion[0:len(c.CallOptions.DisableSecretVersion):len(c.CallOptions.DisableSecretVersion)], opts...)
+ var resp *secretmanagerpb.SecretVersion
+ err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ var err error
+ resp, err = c.client.DisableSecretVersion(ctx, req, settings.GRPC...)
+ return err
+ }, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return resp, nil
+}
+
+// EnableSecretVersion enables a [SecretVersion][google.cloud.secretmanager.v1.SecretVersion].
+//
+// Sets the [state][google.cloud.secretmanager.v1.SecretVersion.state] of the [SecretVersion][google.cloud.secretmanager.v1.SecretVersion] to
+// [ENABLED][google.cloud.secretmanager.v1.SecretVersion.State.ENABLED].
+func (c *Client) EnableSecretVersion(ctx context.Context, req *secretmanagerpb.EnableSecretVersionRequest, opts ...gax.CallOption) (*secretmanagerpb.SecretVersion, 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.EnableSecretVersion[0:len(c.CallOptions.EnableSecretVersion):len(c.CallOptions.EnableSecretVersion)], opts...)
+ var resp *secretmanagerpb.SecretVersion
+ err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ var err error
+ resp, err = c.client.EnableSecretVersion(ctx, req, settings.GRPC...)
+ return err
+ }, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return resp, nil
+}
+
+// DestroySecretVersion destroys a [SecretVersion][google.cloud.secretmanager.v1.SecretVersion].
+//
+// Sets the [state][google.cloud.secretmanager.v1.SecretVersion.state] of the [SecretVersion][google.cloud.secretmanager.v1.SecretVersion] to
+// [DESTROYED][google.cloud.secretmanager.v1.SecretVersion.State.DESTROYED] and irrevocably destroys the
+// secret data.
+func (c *Client) DestroySecretVersion(ctx context.Context, req *secretmanagerpb.DestroySecretVersionRequest, opts ...gax.CallOption) (*secretmanagerpb.SecretVersion, 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.DestroySecretVersion[0:len(c.CallOptions.DestroySecretVersion):len(c.CallOptions.DestroySecretVersion)], opts...)
+ var resp *secretmanagerpb.SecretVersion
+ err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ var err error
+ resp, err = c.client.DestroySecretVersion(ctx, req, settings.GRPC...)
+ return err
+ }, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return resp, nil
+}
+
+// SetIamPolicy sets the access control policy on the specified secret. Replaces any
+// existing policy.
+//
+// Permissions on [SecretVersions][google.cloud.secretmanager.v1.SecretVersion] are enforced according
+// to the policy set on the associated [Secret][google.cloud.secretmanager.v1.Secret].
+func (c *Client) SetIamPolicy(ctx context.Context, req *iampb.SetIamPolicyRequest, opts ...gax.CallOption) (*iampb.Policy, error) {
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "resource", url.QueryEscape(req.GetResource())))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
+ opts = append(c.CallOptions.SetIamPolicy[0:len(c.CallOptions.SetIamPolicy):len(c.CallOptions.SetIamPolicy)], opts...)
+ var resp *iampb.Policy
+ err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ var err error
+ resp, err = c.client.SetIamPolicy(ctx, req, settings.GRPC...)
+ return err
+ }, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return resp, nil
+}
+
+// GetIamPolicy gets the access control policy for a secret.
+// Returns empty policy if the secret exists and does not have a policy set.
+func (c *Client) GetIamPolicy(ctx context.Context, req *iampb.GetIamPolicyRequest, opts ...gax.CallOption) (*iampb.Policy, error) {
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "resource", url.QueryEscape(req.GetResource())))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
+ opts = append(c.CallOptions.GetIamPolicy[0:len(c.CallOptions.GetIamPolicy):len(c.CallOptions.GetIamPolicy)], opts...)
+ var resp *iampb.Policy
+ err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ var err error
+ resp, err = c.client.GetIamPolicy(ctx, req, settings.GRPC...)
+ return err
+ }, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return resp, nil
+}
+
+// TestIamPermissions returns permissions that a caller has for the specified secret.
+// If the secret does not exist, this call returns an empty set of
+// permissions, not a NOT_FOUND error.
+//
+// Note: This operation is designed to be used for building permission-aware
+// UIs and command-line tools, not for authorization checking. This operation
+// may “fail open” without warning.
+func (c *Client) TestIamPermissions(ctx context.Context, req *iampb.TestIamPermissionsRequest, opts ...gax.CallOption) (*iampb.TestIamPermissionsResponse, error) {
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "resource", url.QueryEscape(req.GetResource())))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
+ opts = append(c.CallOptions.TestIamPermissions[0:len(c.CallOptions.TestIamPermissions):len(c.CallOptions.TestIamPermissions)], opts...)
+ var resp *iampb.TestIamPermissionsResponse
+ err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ var err error
+ resp, err = c.client.TestIamPermissions(ctx, req, settings.GRPC...)
+ return err
+ }, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return resp, nil
+}
+
+// SecretIterator manages a stream of *secretmanagerpb.Secret.
+type SecretIterator struct {
+ items []*secretmanagerpb.Secret
+ 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 []*secretmanagerpb.Secret, nextPageToken string, err error)
+}
+
+// PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
+func (it *SecretIterator) 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 *SecretIterator) Next() (*secretmanagerpb.Secret, error) {
+ var item *secretmanagerpb.Secret
+ if err := it.nextFunc(); err != nil {
+ return item, err
+ }
+ item = it.items[0]
+ it.items = it.items[1:]
+ return item, nil
+}
+
+func (it *SecretIterator) bufLen() int {
+ return len(it.items)
+}
+
+func (it *SecretIterator) takeBuf() interface{} {
+ b := it.items
+ it.items = nil
+ return b
+}
+
+// SecretVersionIterator manages a stream of *secretmanagerpb.SecretVersion.
+type SecretVersionIterator struct {
+ items []*secretmanagerpb.SecretVersion
+ 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 []*secretmanagerpb.SecretVersion, nextPageToken string, err error)
+}
+
+// PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
+func (it *SecretVersionIterator) 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 *SecretVersionIterator) Next() (*secretmanagerpb.SecretVersion, error) {
+ var item *secretmanagerpb.SecretVersion
+ if err := it.nextFunc(); err != nil {
+ return item, err
+ }
+ item = it.items[0]
+ it.items = it.items[1:]
+ return item, nil
+}
+
+func (it *SecretVersionIterator) bufLen() int {
+ return len(it.items)
+}
+
+func (it *SecretVersionIterator) takeBuf() interface{} {
+ b := it.items
+ it.items = nil
+ return b
+}
diff --git a/secretmanager/apiv1/secret_manager_client_example_test.go b/secretmanager/apiv1/secret_manager_client_example_test.go
new file mode 100644
index 0000000..2b96e39
--- /dev/null
+++ b/secretmanager/apiv1/secret_manager_client_example_test.go
@@ -0,0 +1,346 @@
+// Copyright 2020 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 secretmanager_test
+
+import (
+ "context"
+
+ secretmanager "cloud.google.com/go/secretmanager/apiv1"
+ "google.golang.org/api/iterator"
+ secretmanagerpb "google.golang.org/genproto/googleapis/cloud/secretmanager/v1"
+ iampb "google.golang.org/genproto/googleapis/iam/v1"
+)
+
+func ExampleNewClient() {
+ ctx := context.Background()
+ c, err := secretmanager.NewClient(ctx)
+ if err != nil {
+ // TODO: Handle error.
+ }
+ // TODO: Use client.
+ _ = c
+}
+
+func ExampleClient_ListSecrets() {
+ // import secretmanagerpb "google.golang.org/genproto/googleapis/cloud/secretmanager/v1"
+ // import "google.golang.org/api/iterator"
+
+ ctx := context.Background()
+ c, err := secretmanager.NewClient(ctx)
+ if err != nil {
+ // TODO: Handle error.
+ }
+
+ req := &secretmanagerpb.ListSecretsRequest{
+ // TODO: Fill request struct fields.
+ }
+ it := c.ListSecrets(ctx, req)
+ for {
+ resp, err := it.Next()
+ if err == iterator.Done {
+ break
+ }
+ if err != nil {
+ // TODO: Handle error.
+ }
+ // TODO: Use resp.
+ _ = resp
+ }
+}
+
+func ExampleClient_CreateSecret() {
+ // import secretmanagerpb "google.golang.org/genproto/googleapis/cloud/secretmanager/v1"
+
+ ctx := context.Background()
+ c, err := secretmanager.NewClient(ctx)
+ if err != nil {
+ // TODO: Handle error.
+ }
+
+ req := &secretmanagerpb.CreateSecretRequest{
+ // TODO: Fill request struct fields.
+ }
+ resp, err := c.CreateSecret(ctx, req)
+ if err != nil {
+ // TODO: Handle error.
+ }
+ // TODO: Use resp.
+ _ = resp
+}
+
+func ExampleClient_AddSecretVersion() {
+ // import secretmanagerpb "google.golang.org/genproto/googleapis/cloud/secretmanager/v1"
+
+ ctx := context.Background()
+ c, err := secretmanager.NewClient(ctx)
+ if err != nil {
+ // TODO: Handle error.
+ }
+
+ req := &secretmanagerpb.AddSecretVersionRequest{
+ // TODO: Fill request struct fields.
+ }
+ resp, err := c.AddSecretVersion(ctx, req)
+ if err != nil {
+ // TODO: Handle error.
+ }
+ // TODO: Use resp.
+ _ = resp
+}
+
+func ExampleClient_GetSecret() {
+ // import secretmanagerpb "google.golang.org/genproto/googleapis/cloud/secretmanager/v1"
+
+ ctx := context.Background()
+ c, err := secretmanager.NewClient(ctx)
+ if err != nil {
+ // TODO: Handle error.
+ }
+
+ req := &secretmanagerpb.GetSecretRequest{
+ // TODO: Fill request struct fields.
+ }
+ resp, err := c.GetSecret(ctx, req)
+ if err != nil {
+ // TODO: Handle error.
+ }
+ // TODO: Use resp.
+ _ = resp
+}
+
+func ExampleClient_UpdateSecret() {
+ // import secretmanagerpb "google.golang.org/genproto/googleapis/cloud/secretmanager/v1"
+
+ ctx := context.Background()
+ c, err := secretmanager.NewClient(ctx)
+ if err != nil {
+ // TODO: Handle error.
+ }
+
+ req := &secretmanagerpb.UpdateSecretRequest{
+ // TODO: Fill request struct fields.
+ }
+ resp, err := c.UpdateSecret(ctx, req)
+ if err != nil {
+ // TODO: Handle error.
+ }
+ // TODO: Use resp.
+ _ = resp
+}
+
+func ExampleClient_DeleteSecret() {
+ ctx := context.Background()
+ c, err := secretmanager.NewClient(ctx)
+ if err != nil {
+ // TODO: Handle error.
+ }
+
+ req := &secretmanagerpb.DeleteSecretRequest{
+ // TODO: Fill request struct fields.
+ }
+ err = c.DeleteSecret(ctx, req)
+ if err != nil {
+ // TODO: Handle error.
+ }
+}
+
+func ExampleClient_ListSecretVersions() {
+ // import secretmanagerpb "google.golang.org/genproto/googleapis/cloud/secretmanager/v1"
+ // import "google.golang.org/api/iterator"
+
+ ctx := context.Background()
+ c, err := secretmanager.NewClient(ctx)
+ if err != nil {
+ // TODO: Handle error.
+ }
+
+ req := &secretmanagerpb.ListSecretVersionsRequest{
+ // TODO: Fill request struct fields.
+ }
+ it := c.ListSecretVersions(ctx, req)
+ for {
+ resp, err := it.Next()
+ if err == iterator.Done {
+ break
+ }
+ if err != nil {
+ // TODO: Handle error.
+ }
+ // TODO: Use resp.
+ _ = resp
+ }
+}
+
+func ExampleClient_GetSecretVersion() {
+ // import secretmanagerpb "google.golang.org/genproto/googleapis/cloud/secretmanager/v1"
+
+ ctx := context.Background()
+ c, err := secretmanager.NewClient(ctx)
+ if err != nil {
+ // TODO: Handle error.
+ }
+
+ req := &secretmanagerpb.GetSecretVersionRequest{
+ // TODO: Fill request struct fields.
+ }
+ resp, err := c.GetSecretVersion(ctx, req)
+ if err != nil {
+ // TODO: Handle error.
+ }
+ // TODO: Use resp.
+ _ = resp
+}
+
+func ExampleClient_AccessSecretVersion() {
+ // import secretmanagerpb "google.golang.org/genproto/googleapis/cloud/secretmanager/v1"
+
+ ctx := context.Background()
+ c, err := secretmanager.NewClient(ctx)
+ if err != nil {
+ // TODO: Handle error.
+ }
+
+ req := &secretmanagerpb.AccessSecretVersionRequest{
+ // TODO: Fill request struct fields.
+ }
+ resp, err := c.AccessSecretVersion(ctx, req)
+ if err != nil {
+ // TODO: Handle error.
+ }
+ // TODO: Use resp.
+ _ = resp
+}
+
+func ExampleClient_DisableSecretVersion() {
+ // import secretmanagerpb "google.golang.org/genproto/googleapis/cloud/secretmanager/v1"
+
+ ctx := context.Background()
+ c, err := secretmanager.NewClient(ctx)
+ if err != nil {
+ // TODO: Handle error.
+ }
+
+ req := &secretmanagerpb.DisableSecretVersionRequest{
+ // TODO: Fill request struct fields.
+ }
+ resp, err := c.DisableSecretVersion(ctx, req)
+ if err != nil {
+ // TODO: Handle error.
+ }
+ // TODO: Use resp.
+ _ = resp
+}
+
+func ExampleClient_EnableSecretVersion() {
+ // import secretmanagerpb "google.golang.org/genproto/googleapis/cloud/secretmanager/v1"
+
+ ctx := context.Background()
+ c, err := secretmanager.NewClient(ctx)
+ if err != nil {
+ // TODO: Handle error.
+ }
+
+ req := &secretmanagerpb.EnableSecretVersionRequest{
+ // TODO: Fill request struct fields.
+ }
+ resp, err := c.EnableSecretVersion(ctx, req)
+ if err != nil {
+ // TODO: Handle error.
+ }
+ // TODO: Use resp.
+ _ = resp
+}
+
+func ExampleClient_DestroySecretVersion() {
+ // import secretmanagerpb "google.golang.org/genproto/googleapis/cloud/secretmanager/v1"
+
+ ctx := context.Background()
+ c, err := secretmanager.NewClient(ctx)
+ if err != nil {
+ // TODO: Handle error.
+ }
+
+ req := &secretmanagerpb.DestroySecretVersionRequest{
+ // TODO: Fill request struct fields.
+ }
+ resp, err := c.DestroySecretVersion(ctx, req)
+ if err != nil {
+ // TODO: Handle error.
+ }
+ // TODO: Use resp.
+ _ = resp
+}
+
+func ExampleClient_SetIamPolicy() {
+ // import iampb "google.golang.org/genproto/googleapis/iam/v1"
+
+ ctx := context.Background()
+ c, err := secretmanager.NewClient(ctx)
+ if err != nil {
+ // TODO: Handle error.
+ }
+
+ req := &iampb.SetIamPolicyRequest{
+ // TODO: Fill request struct fields.
+ }
+ resp, err := c.SetIamPolicy(ctx, req)
+ if err != nil {
+ // TODO: Handle error.
+ }
+ // TODO: Use resp.
+ _ = resp
+}
+
+func ExampleClient_GetIamPolicy() {
+ // import iampb "google.golang.org/genproto/googleapis/iam/v1"
+
+ ctx := context.Background()
+ c, err := secretmanager.NewClient(ctx)
+ if err != nil {
+ // TODO: Handle error.
+ }
+
+ req := &iampb.GetIamPolicyRequest{
+ // TODO: Fill request struct fields.
+ }
+ resp, err := c.GetIamPolicy(ctx, req)
+ if err != nil {
+ // TODO: Handle error.
+ }
+ // TODO: Use resp.
+ _ = resp
+}
+
+func ExampleClient_TestIamPermissions() {
+ // import iampb "google.golang.org/genproto/googleapis/iam/v1"
+
+ ctx := context.Background()
+ c, err := secretmanager.NewClient(ctx)
+ if err != nil {
+ // TODO: Handle error.
+ }
+
+ req := &iampb.TestIamPermissionsRequest{
+ // TODO: Fill request struct fields.
+ }
+ resp, err := c.TestIamPermissions(ctx, req)
+ if err != nil {
+ // TODO: Handle error.
+ }
+ // TODO: Use resp.
+ _ = resp
+}
diff --git a/secretmanager/apiv1beta1/doc.go b/secretmanager/apiv1beta1/doc.go
index b043920..682e43b 100644
--- a/secretmanager/apiv1beta1/doc.go
+++ b/secretmanager/apiv1beta1/doc.go
@@ -42,7 +42,7 @@
"google.golang.org/grpc/metadata"
)
-const versionClient = "20200226"
+const versionClient = "20200227"
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 affe0f7..705228f 100644
--- a/securitycenter/apiv1/doc.go
+++ b/securitycenter/apiv1/doc.go
@@ -41,7 +41,7 @@
"google.golang.org/grpc/metadata"
)
-const versionClient = "20200226"
+const versionClient = "20200227"
func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context {
out, _ := metadata.FromOutgoingContext(ctx)
diff --git a/securitycenter/apiv1beta1/doc.go b/securitycenter/apiv1beta1/doc.go
index 03e7e95..79bce68 100644
--- a/securitycenter/apiv1beta1/doc.go
+++ b/securitycenter/apiv1beta1/doc.go
@@ -43,7 +43,7 @@
"google.golang.org/grpc/metadata"
)
-const versionClient = "20200226"
+const versionClient = "20200227"
func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context {
out, _ := metadata.FromOutgoingContext(ctx)
diff --git a/securitycenter/apiv1p1beta1/doc.go b/securitycenter/apiv1p1beta1/doc.go
index a3b89c4..b4bee80 100644
--- a/securitycenter/apiv1p1beta1/doc.go
+++ b/securitycenter/apiv1p1beta1/doc.go
@@ -43,7 +43,7 @@
"google.golang.org/grpc/metadata"
)
-const versionClient = "20200226"
+const versionClient = "20200227"
func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context {
out, _ := metadata.FromOutgoingContext(ctx)
diff --git a/spanner/admin/database/apiv1/database_admin_client.go b/spanner/admin/database/apiv1/database_admin_client.go
index ba6f71a..cee77fe 100644
--- a/spanner/admin/database/apiv1/database_admin_client.go
+++ b/spanner/admin/database/apiv1/database_admin_client.go
@@ -264,8 +264,8 @@
// have a name of the format <database_name>/operations/<operation_id> and
// can be used to track preparation of the database. The
// [metadata][google.longrunning.Operation.metadata] field type is
-// [CreateDatabaseMetadata][google.spanner.admin.database.v1.CreateDatabaseMetadata].
-// The [response][google.longrunning.Operation.response] field type is
+// [CreateDatabaseMetadata][google.spanner.admin.database.v1.CreateDatabaseMetadata]. The
+// [response][google.longrunning.Operation.response] field type is
// [Database][google.spanner.admin.database.v1.Database], if successful.
func (c *DatabaseAdminClient) CreateDatabase(ctx context.Context, req *databasepb.CreateDatabaseRequest, opts ...gax.CallOption) (*CreateDatabaseOperation, error) {
md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent())))
@@ -308,8 +308,7 @@
// the format <database_name>/operations/<operation_id> and can be used to
// track execution of the schema change(s). The
// [metadata][google.longrunning.Operation.metadata] field type is
-// [UpdateDatabaseDdlMetadata][google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata].
-// The operation has no response.
+// [UpdateDatabaseDdlMetadata][google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata]. The operation has no response.
func (c *DatabaseAdminClient) UpdateDatabaseDdl(ctx context.Context, req *databasepb.UpdateDatabaseDdlRequest, opts ...gax.CallOption) (*UpdateDatabaseDdlOperation, error) {
md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "database", url.QueryEscape(req.GetDatabase())))
ctx = insertMetadata(ctx, c.xGoogMetadata, md)
diff --git a/spanner/admin/database/apiv1/doc.go b/spanner/admin/database/apiv1/doc.go
index 8a5bd7c..4a67671 100644
--- a/spanner/admin/database/apiv1/doc.go
+++ b/spanner/admin/database/apiv1/doc.go
@@ -38,7 +38,7 @@
"google.golang.org/grpc/metadata"
)
-const versionClient = "20200226"
+const versionClient = "20200227"
func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context {
out, _ := metadata.FromOutgoingContext(ctx)
diff --git a/spanner/admin/instance/apiv1/doc.go b/spanner/admin/instance/apiv1/doc.go
index 490f492..4e77751 100644
--- a/spanner/admin/instance/apiv1/doc.go
+++ b/spanner/admin/instance/apiv1/doc.go
@@ -38,7 +38,7 @@
"google.golang.org/grpc/metadata"
)
-const versionClient = "20200226"
+const versionClient = "20200227"
func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context {
out, _ := metadata.FromOutgoingContext(ctx)
diff --git a/spanner/apiv1/doc.go b/spanner/apiv1/doc.go
index a0f8f4e..11435f7 100644
--- a/spanner/apiv1/doc.go
+++ b/spanner/apiv1/doc.go
@@ -41,7 +41,7 @@
"google.golang.org/grpc/metadata"
)
-const versionClient = "20200226"
+const versionClient = "20200227"
func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context {
out, _ := metadata.FromOutgoingContext(ctx)
diff --git a/spanner/apiv1/spanner_client.go b/spanner/apiv1/spanner_client.go
index 6067f9c..754af1d 100644
--- a/spanner/apiv1/spanner_client.go
+++ b/spanner/apiv1/spanner_client.go
@@ -287,7 +287,7 @@
//
// Active sessions use additional server resources, so it is a good idea to
// delete idle and unneeded sessions.
-// Aside from explicit deletes, Cloud Spanner can delete sessions for which no
+// Aside from explicit deletes, Cloud Spanner may delete sessions for which no
// operations are sent for more than an hour. If a session is deleted,
// requests to it return NOT_FOUND.
//
@@ -411,12 +411,10 @@
//
// Operations inside read-write transactions might return ABORTED. If
// this occurs, the application should restart the transaction from
-// the beginning. See [Transaction][google.spanner.v1.Transaction] for more
-// details.
+// the beginning. See [Transaction][google.spanner.v1.Transaction] for more details.
//
// Larger result sets can be fetched in streaming fashion by calling
-// [ExecuteStreamingSql][google.spanner.v1.Spanner.ExecuteStreamingSql]
-// instead.
+// [ExecuteStreamingSql][google.spanner.v1.Spanner.ExecuteStreamingSql] instead.
func (c *Client) ExecuteSql(ctx context.Context, req *spannerpb.ExecuteSqlRequest, opts ...gax.CallOption) (*spannerpb.ResultSet, error) {
md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "session", url.QueryEscape(req.GetSession())))
ctx = insertMetadata(ctx, c.xGoogMetadata, md)
@@ -433,11 +431,11 @@
return resp, nil
}
-// ExecuteStreamingSql like [ExecuteSql][google.spanner.v1.Spanner.ExecuteSql], except returns the
-// result set as a stream. Unlike
-// [ExecuteSql][google.spanner.v1.Spanner.ExecuteSql], there is no limit on
-// the size of the returned result set. However, no individual row in the
-// result set can exceed 100 MiB, and no column value can exceed 10 MiB.
+// ExecuteStreamingSql like [ExecuteSql][google.spanner.v1.Spanner.ExecuteSql], except returns the result
+// set as a stream. Unlike [ExecuteSql][google.spanner.v1.Spanner.ExecuteSql], there
+// is no limit on the size of the returned result set. However, no
+// individual row in the result set can exceed 100 MiB, and no
+// column value can exceed 10 MiB.
func (c *Client) ExecuteStreamingSql(ctx context.Context, req *spannerpb.ExecuteSqlRequest, opts ...gax.CallOption) (spannerpb.Spanner_ExecuteStreamingSqlClient, error) {
md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "session", url.QueryEscape(req.GetSession())))
ctx = insertMetadata(ctx, c.xGoogMetadata, md)
@@ -459,10 +457,9 @@
// [ExecuteSql][google.spanner.v1.Spanner.ExecuteSql].
//
// Statements are executed in sequential order. A request can succeed even if
-// a statement fails. The
-// [ExecuteBatchDmlResponse.status][google.spanner.v1.ExecuteBatchDmlResponse.status]
-// field in the response provides information about the statement that failed.
-// Clients must inspect this field to determine whether an error occurred.
+// a statement fails. The [ExecuteBatchDmlResponse.status][google.spanner.v1.ExecuteBatchDmlResponse.status] field in the
+// response provides information about the statement that failed. Clients must
+// inspect this field to determine whether an error occurred.
//
// Execution stops after the first failed statement; the remaining statements
// are not executed.
@@ -484,15 +481,14 @@
// Read reads rows from the database using key lookups and scans, as a
// simple key/value style alternative to
-// [ExecuteSql][google.spanner.v1.Spanner.ExecuteSql]. This method cannot be
-// used to return a result set larger than 10 MiB; if the read matches more
+// [ExecuteSql][google.spanner.v1.Spanner.ExecuteSql]. This method cannot be used to
+// return a result set larger than 10 MiB; if the read matches more
// data than that, the read fails with a FAILED_PRECONDITION
// error.
//
// Reads inside read-write transactions might return ABORTED. If
// this occurs, the application should restart the transaction from
-// the beginning. See [Transaction][google.spanner.v1.Transaction] for more
-// details.
+// the beginning. See [Transaction][google.spanner.v1.Transaction] for more details.
//
// Larger result sets can be yielded in streaming fashion by calling
// [StreamingRead][google.spanner.v1.Spanner.StreamingRead] instead.
@@ -512,9 +508,9 @@
return resp, nil
}
-// StreamingRead like [Read][google.spanner.v1.Spanner.Read], except returns the result set
-// as a stream. Unlike [Read][google.spanner.v1.Spanner.Read], there is no
-// limit on the size of the returned result set. However, no individual row in
+// StreamingRead like [Read][google.spanner.v1.Spanner.Read], except returns the result set as a
+// stream. Unlike [Read][google.spanner.v1.Spanner.Read], there is no limit on the
+// size of the returned result set. However, no individual row in
// the result set can exceed 100 MiB, and no column value can exceed
// 10 MiB.
func (c *Client) StreamingRead(ctx context.Context, req *spannerpb.ReadRequest, opts ...gax.CallOption) (spannerpb.Spanner_StreamingReadClient, error) {
@@ -534,8 +530,7 @@
}
// BeginTransaction begins a new transaction. This step can often be skipped:
-// [Read][google.spanner.v1.Spanner.Read],
-// [ExecuteSql][google.spanner.v1.Spanner.ExecuteSql] and
+// [Read][google.spanner.v1.Spanner.Read], [ExecuteSql][google.spanner.v1.Spanner.ExecuteSql] and
// [Commit][google.spanner.v1.Spanner.Commit] can begin a new transaction as a
// side-effect.
func (c *Client) BeginTransaction(ctx context.Context, req *spannerpb.BeginTransactionRequest, opts ...gax.CallOption) (*spannerpb.Transaction, error) {
@@ -580,9 +575,8 @@
// Rollback rolls back a transaction, releasing any locks it holds. It is a good
// idea to call this for any transaction that includes one or more
-// [Read][google.spanner.v1.Spanner.Read] or
-// [ExecuteSql][google.spanner.v1.Spanner.ExecuteSql] requests and ultimately
-// decides not to commit.
+// [Read][google.spanner.v1.Spanner.Read] or [ExecuteSql][google.spanner.v1.Spanner.ExecuteSql] requests and
+// ultimately decides not to commit.
//
// Rollback returns OK if it successfully aborts the transaction, the
// transaction was already aborted, or the transaction is not
@@ -601,11 +595,10 @@
// PartitionQuery creates a set of partition tokens that can be used to execute a query
// operation in parallel. Each of the returned partition tokens can be used
-// by [ExecuteStreamingSql][google.spanner.v1.Spanner.ExecuteStreamingSql] to
-// specify a subset of the query result to read. The same session and
-// read-only transaction must be used by the PartitionQueryRequest used to
-// create the partition tokens and the ExecuteSqlRequests that use the
-// partition tokens.
+// by [ExecuteStreamingSql][google.spanner.v1.Spanner.ExecuteStreamingSql] to specify a subset
+// of the query result to read. The same session and read-only transaction
+// must be used by the PartitionQueryRequest used to create the
+// partition tokens and the ExecuteSqlRequests that use the partition tokens.
//
// Partition tokens become invalid when the session used to create them
// is deleted, is idle for too long, begins a new transaction, or becomes too
@@ -629,13 +622,12 @@
// PartitionRead creates a set of partition tokens that can be used to execute a read
// operation in parallel. Each of the returned partition tokens can be used
-// by [StreamingRead][google.spanner.v1.Spanner.StreamingRead] to specify a
-// subset of the read result to read. The same session and read-only
-// transaction must be used by the PartitionReadRequest used to create the
-// partition tokens and the ReadRequests that use the partition tokens. There
-// are no ordering guarantees on rows returned among the returned partition
-// tokens, or even within each individual StreamingRead call issued with a
-// partition_token.
+// by [StreamingRead][google.spanner.v1.Spanner.StreamingRead] to specify a subset of the read
+// result to read. The same session and read-only transaction must be used by
+// the PartitionReadRequest used to create the partition tokens and the
+// ReadRequests that use the partition tokens. There are no ordering
+// guarantees on rows returned among the returned partition tokens, or even
+// within each individual StreamingRead call issued with a partition_token.
//
// Partition tokens become invalid when the session used to create them
// is deleted, is idle for too long, begins a new transaction, or becomes too
diff --git a/spanner/go.mod b/spanner/go.mod
index 2b264ed..3678f72 100644
--- a/spanner/go.mod
+++ b/spanner/go.mod
@@ -13,6 +13,6 @@
golang.org/x/tools v0.0.0-20200226224502-204d844ad48d // indirect
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543
google.golang.org/api v0.19.0
- google.golang.org/genproto v0.0.0-20200226201735-46b91f19d98c
+ google.golang.org/genproto v0.0.0-20200227132054-3f1135a288c9
google.golang.org/grpc v1.27.1
)
diff --git a/spanner/go.sum b/spanner/go.sum
index 5afd771..3d7977a 100644
--- a/spanner/go.sum
+++ b/spanner/go.sum
@@ -313,8 +313,8 @@
google.golang.org/genproto v0.0.0-20200212174721-66ed5ce911ce/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63 h1:YzfoEYWbODU5Fbt37+h7X16BWQbad7Q4S6gclTKFXM8=
google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
-google.golang.org/genproto v0.0.0-20200226201735-46b91f19d98c h1:xFOdgVPpeowWAH0MJ5i0XMp+3yWiWamMtN/kx9xThIQ=
-google.golang.org/genproto v0.0.0-20200226201735-46b91f19d98c/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
+google.golang.org/genproto v0.0.0-20200227132054-3f1135a288c9 h1:Koy0f8zyrEVfIHetH7wjP5mQLUXiqDpubSg8V1fAxqc=
+google.golang.org/genproto v0.0.0-20200227132054-3f1135a288c9/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
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 fc0b56d..a304558 100644
--- a/speech/apiv1/doc.go
+++ b/speech/apiv1/doc.go
@@ -40,7 +40,7 @@
"google.golang.org/grpc/metadata"
)
-const versionClient = "20200226"
+const versionClient = "20200227"
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 b7674bb..e41fde8 100644
--- a/speech/apiv1p1beta1/doc.go
+++ b/speech/apiv1p1beta1/doc.go
@@ -42,7 +42,7 @@
"google.golang.org/grpc/metadata"
)
-const versionClient = "20200226"
+const versionClient = "20200227"
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 eb89385..b02eb2c 100644
--- a/storage/go.mod
+++ b/storage/go.mod
@@ -14,7 +14,7 @@
golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae // indirect
golang.org/x/tools v0.0.0-20200226224502-204d844ad48d // indirect
google.golang.org/api v0.19.0
- google.golang.org/genproto v0.0.0-20200226201735-46b91f19d98c
+ google.golang.org/genproto v0.0.0-20200227132054-3f1135a288c9
google.golang.org/grpc v1.27.1
honnef.co/go/tools v0.0.1-2020.1.3 // indirect
)
diff --git a/storage/go.sum b/storage/go.sum
index c7312cb..5637f47 100644
--- a/storage/go.sum
+++ b/storage/go.sum
@@ -292,8 +292,8 @@
google.golang.org/genproto v0.0.0-20200204135345-fa8e72b47b90/go.mod h1:GmwEX6Z4W5gMy59cAlVYjN9JhxgbQH6Gn+gFDQe2lzA=
google.golang.org/genproto v0.0.0-20200212174721-66ed5ce911ce h1:1mbrb1tUU+Zmt5C94IGKADBTJZjZXAd+BubWi7r9EiI=
google.golang.org/genproto v0.0.0-20200212174721-66ed5ce911ce/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
-google.golang.org/genproto v0.0.0-20200226201735-46b91f19d98c h1:xFOdgVPpeowWAH0MJ5i0XMp+3yWiWamMtN/kx9xThIQ=
-google.golang.org/genproto v0.0.0-20200226201735-46b91f19d98c/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
+google.golang.org/genproto v0.0.0-20200227132054-3f1135a288c9 h1:Koy0f8zyrEVfIHetH7wjP5mQLUXiqDpubSg8V1fAxqc=
+google.golang.org/genproto v0.0.0-20200227132054-3f1135a288c9/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
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 9797c04..14a1561 100644
--- a/talent/apiv4beta1/doc.go
+++ b/talent/apiv4beta1/doc.go
@@ -43,7 +43,7 @@
"google.golang.org/grpc/metadata"
)
-const versionClient = "20200226"
+const versionClient = "20200227"
func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context {
out, _ := metadata.FromOutgoingContext(ctx)
diff --git a/texttospeech/apiv1/doc.go b/texttospeech/apiv1/doc.go
index c95c73a..8f85874 100644
--- a/texttospeech/apiv1/doc.go
+++ b/texttospeech/apiv1/doc.go
@@ -41,7 +41,7 @@
"google.golang.org/grpc/metadata"
)
-const versionClient = "20200226"
+const versionClient = "20200227"
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 20275c8..285cac0 100644
--- a/trace/apiv1/doc.go
+++ b/trace/apiv1/doc.go
@@ -44,7 +44,7 @@
"google.golang.org/grpc/metadata"
)
-const versionClient = "20200226"
+const versionClient = "20200227"
func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context {
out, _ := metadata.FromOutgoingContext(ctx)
diff --git a/trace/apiv2/doc.go b/trace/apiv2/doc.go
index e358a56..77e389c 100644
--- a/trace/apiv2/doc.go
+++ b/trace/apiv2/doc.go
@@ -44,7 +44,7 @@
"google.golang.org/grpc/metadata"
)
-const versionClient = "20200226"
+const versionClient = "20200227"
func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context {
out, _ := metadata.FromOutgoingContext(ctx)
diff --git a/translate/apiv3/doc.go b/translate/apiv3/doc.go
index 96da218..533a686 100644
--- a/translate/apiv3/doc.go
+++ b/translate/apiv3/doc.go
@@ -40,7 +40,7 @@
"google.golang.org/grpc/metadata"
)
-const versionClient = "20200226"
+const versionClient = "20200227"
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 69d7381..85c7623 100644
--- a/videointelligence/apiv1/doc.go
+++ b/videointelligence/apiv1/doc.go
@@ -42,7 +42,7 @@
"google.golang.org/grpc/metadata"
)
-const versionClient = "20200226"
+const versionClient = "20200227"
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 822e00e..9670a35 100644
--- a/videointelligence/apiv1beta2/doc.go
+++ b/videointelligence/apiv1beta2/doc.go
@@ -44,7 +44,7 @@
"google.golang.org/grpc/metadata"
)
-const versionClient = "20200226"
+const versionClient = "20200227"
func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context {
out, _ := metadata.FromOutgoingContext(ctx)
diff --git a/vision/apiv1/doc.go b/vision/apiv1/doc.go
index a769799..ea7b1b6 100644
--- a/vision/apiv1/doc.go
+++ b/vision/apiv1/doc.go
@@ -42,7 +42,7 @@
"google.golang.org/grpc/metadata"
)
-const versionClient = "20200226"
+const versionClient = "20200227"
func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context {
out, _ := metadata.FromOutgoingContext(ctx)
diff --git a/vision/apiv1p1beta1/doc.go b/vision/apiv1p1beta1/doc.go
index 9453af7..5844235 100644
--- a/vision/apiv1p1beta1/doc.go
+++ b/vision/apiv1p1beta1/doc.go
@@ -44,7 +44,7 @@
"google.golang.org/grpc/metadata"
)
-const versionClient = "20200226"
+const versionClient = "20200227"
func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context {
out, _ := metadata.FromOutgoingContext(ctx)
diff --git a/webrisk/apiv1beta1/doc.go b/webrisk/apiv1beta1/doc.go
index 425b9c7..4fa0951 100644
--- a/webrisk/apiv1beta1/doc.go
+++ b/webrisk/apiv1beta1/doc.go
@@ -40,7 +40,7 @@
"google.golang.org/grpc/metadata"
)
-const versionClient = "20200226"
+const versionClient = "20200227"
func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context {
out, _ := metadata.FromOutgoingContext(ctx)