From f44da6714778017116a364c070648b08ab37f232 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Mon, 1 Aug 2022 08:21:40 -0700 Subject: [PATCH] chore(all): auto-regenerate gapics (#6455) This is an auto-generated regeneration of the gapic clients by cloud.google.com/go/internal/gapicgen. Once the corresponding genproto PR is submitted, genbot will update this PR with a newer dependency to the newer version of genproto and assign reviewers to this PR. If you have been assigned to review this PR, please: - Ensure that the version of genproto in go.mod has been updated. - Ensure that CI is passing. If it's failing, it requires your manual attention. - Approve and submit this PR if you believe it's ready to ship. Corresponding genproto PR: https://github.com/googleapis/go-genproto/pull/869 Changes: feat(retail): support case insensitive match on search facets feat: allow disabling spell check in search requests feat: allow adding labels in search requests feat: allow returning min/max values on search numeric facets feat: allow using serving configs as an alias of placements feat: allow enabling recommendation filtering on custom attributes feat: return output BigQuery table on product / event export response docs: keep the API doc up-to-date with recent changes PiperOrigin-RevId: 463980128 Source-Link: https://github.com/googleapis/googleapis/commit/d6bce0ee59fb796e8df417f3058e4197a1a0c38a feat(aiplatform): making network arg optional in aiplatform v1 custom_job.proto feat: added SHARED_RESOURCES enum to aiplatform v1 model.proto docs: doc edits to aiplatform v1 dataset_service.proto, job_service.proto, model_service.proto, pipeline_service.proto, saved_query.proto, study.proto, types.proto PiperOrigin-RevId: 463932566 Source-Link: https://github.com/googleapis/googleapis/commit/37aaa1e56495d4aea90a2b588add247e070f155d feat(aiplatform): making network arg optional in aiplatform v1beta1 custom_job.proto feat: DeploymentResourcePool and DeployementResourcePoolService added to aiplatform v1beta1 model.proto (cl/463147866) docs: doc edits to aiplatform v1beta1 job_service.proto, model_service.proto, pipeline_service.proto, saved_query.proto, study.proto, types.proto PiperOrigin-RevId: 463932106 Source-Link: https://github.com/googleapis/googleapis/commit/efbe03db268487cd42bfa21fa81c44318a293ae0 chore(longrunning): configure stand-alone LongRunning client for PHP PiperOrigin-RevId: 463896105 Source-Link: https://github.com/googleapis/googleapis/commit/378a63c8bc24ab2c6f9d7dabe280b18d313c914d docs(contactcenterinsights): Updating comments chore:remove LRO to API list PiperOrigin-RevId: 463893258 Source-Link: https://github.com/googleapis/googleapis/commit/e47c0cdef77eb713e9d76adafda26d98d15bd4ac fix(analytics/admin): Add py_test targets PiperOrigin-RevId: 463701296 Source-Link: https://github.com/googleapis/googleapis/commit/abe15226ba1a40a09f696bf587ad2db0f1f03b78 fix(container): revert bad publishing This RPC is not supposed to be published at this moment because Java generator cannot support this path template. It will be re-published when the generator is fixed. PiperOrigin-RevId: 463701283 Source-Link: https://github.com/googleapis/googleapis/commit/080f9b60da4759bd0b6f28363ecbbf0571cf64b9 docs(bigquery/storage): clarify size limitations for AppendRowsRequest chore: add preferred_min_stream_count to CreateReadSessionRequest chore: add write_stream to AppendRowsResponse PiperOrigin-RevId: 463602530 Source-Link: https://github.com/googleapis/googleapis/commit/d33b3fa0897cee1cc57b5b428587052c87e9bf25 feat(bigquery/connection): Add service_account_id output field to CloudSQL properties Clients can now observe the Service Account that is being used when connecting to the CloudSQL from the BigQuery. PiperOrigin-RevId: 463445598 Source-Link: https://github.com/googleapis/googleapis/commit/fe833ddc7356b404547de4d3c2495ef3881c25d0 feat(dataform): Release API version v1beta1 (no changes to v1alpha2) PiperOrigin-RevId: 463269555 Source-Link: https://github.com/googleapis/googleapis/commit/5261728f2ee874bc9f14bfecc52e4a178acaf711 docs(dialogflow): added an explicit note that DetectIntentRequest's text input is limited by 256 characters PiperOrigin-RevId: 463252698 Source-Link: https://github.com/googleapis/googleapis/commit/eeacaabc368d70217b086f66c2c1644b105f337c chore(networksecurity): Update networksecurity v1 BUILD.bazel for python PiperOrigin-RevId: 463219549 Source-Link: https://github.com/googleapis/googleapis/commit/039daa2938fb67ec5516a4295578d8355ac1be3a feat(aiplatform): add DeploymentResourcePool in aiplatform v1beta1 deployment_resource_pool.proto feat: add DeploymentResourcePoolService in aiplatform v1beta1 deployment_resource_pool_service.proto feat: add SHARED_RESOURCES to DeploymentResourcesType in aiplatform v1beta1 model.proto PiperOrigin-RevId: 463147866 Source-Link: https://github.com/googleapis/googleapis/commit/627646187513c840b8481a0b4f6249eba04a418f chore(functions): Configure Ruby Bazel builds for Functions V2 client PiperOrigin-RevId: 463142926 Source-Link: https://github.com/googleapis/googleapis/commit/fbe2cfc2ada1b5ee6a521043a9bd7a2d81062411 fix(spanner/admin/database): target new spanner db admin service config chore: remove old spanner db admin service config PiperOrigin-RevId: 463110616 Source-Link: https://github.com/googleapis/googleapis/commit/0f38696be1577d078a47908cf40aaaf4a0d62ce9 --- admin/database/apiv1/database_admin_client.go | 129 +++++++++++++++++- .../database_admin_client_example_test.go | 83 +++++++++++ admin/database/apiv1/doc.go | 5 +- admin/database/apiv1/gapic_metadata.json | 20 +++ go.mod | 4 +- go.sum | 8 +- 6 files changed, 239 insertions(+), 10 deletions(-) diff --git a/admin/database/apiv1/database_admin_client.go b/admin/database/apiv1/database_admin_client.go index 779df7d..30580ae 100644 --- a/admin/database/apiv1/database_admin_client.go +++ b/admin/database/apiv1/database_admin_client.go @@ -62,6 +62,10 @@ type DatabaseAdminCallOptions struct { ListDatabaseOperations []gax.CallOption ListBackupOperations []gax.CallOption ListDatabaseRoles []gax.CallOption + CancelOperation []gax.CallOption + DeleteOperation []gax.CallOption + GetOperation []gax.CallOption + ListOperations []gax.CallOption } func defaultDatabaseAdminGRPCClientOptions() []option.ClientOption { @@ -240,10 +244,14 @@ func defaultDatabaseAdminCallOptions() *DatabaseAdminCallOptions { }) }), }, + CancelOperation: []gax.CallOption{}, + DeleteOperation: []gax.CallOption{}, + GetOperation: []gax.CallOption{}, + ListOperations: []gax.CallOption{}, } } -// internalDatabaseAdminClient is an interface that defines the methods available from Cloud Spanner Database Admin API. +// internalDatabaseAdminClient is an interface that defines the methods available from Cloud Spanner API. type internalDatabaseAdminClient interface { Close() error setGoogleClientInfo(...string) @@ -272,9 +280,13 @@ type internalDatabaseAdminClient interface { ListDatabaseOperations(context.Context, *databasepb.ListDatabaseOperationsRequest, ...gax.CallOption) *OperationIterator ListBackupOperations(context.Context, *databasepb.ListBackupOperationsRequest, ...gax.CallOption) *OperationIterator ListDatabaseRoles(context.Context, *databasepb.ListDatabaseRolesRequest, ...gax.CallOption) *DatabaseRoleIterator + CancelOperation(context.Context, *longrunningpb.CancelOperationRequest, ...gax.CallOption) error + DeleteOperation(context.Context, *longrunningpb.DeleteOperationRequest, ...gax.CallOption) error + GetOperation(context.Context, *longrunningpb.GetOperationRequest, ...gax.CallOption) (*longrunningpb.Operation, error) + ListOperations(context.Context, *longrunningpb.ListOperationsRequest, ...gax.CallOption) *OperationIterator } -// DatabaseAdminClient is a client for interacting with Cloud Spanner Database Admin API. +// DatabaseAdminClient is a client for interacting with Cloud Spanner API. // Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls. // // Cloud Spanner Database Admin API @@ -545,7 +557,27 @@ func (c *DatabaseAdminClient) ListDatabaseRoles(ctx context.Context, req *databa return c.internalClient.ListDatabaseRoles(ctx, req, opts...) } -// databaseAdminGRPCClient is a client for interacting with Cloud Spanner Database Admin API over gRPC transport. +// CancelOperation is a utility method from google.longrunning.Operations. +func (c *DatabaseAdminClient) CancelOperation(ctx context.Context, req *longrunningpb.CancelOperationRequest, opts ...gax.CallOption) error { + return c.internalClient.CancelOperation(ctx, req, opts...) +} + +// DeleteOperation is a utility method from google.longrunning.Operations. +func (c *DatabaseAdminClient) DeleteOperation(ctx context.Context, req *longrunningpb.DeleteOperationRequest, opts ...gax.CallOption) error { + return c.internalClient.DeleteOperation(ctx, req, opts...) +} + +// GetOperation is a utility method from google.longrunning.Operations. +func (c *DatabaseAdminClient) GetOperation(ctx context.Context, req *longrunningpb.GetOperationRequest, opts ...gax.CallOption) (*longrunningpb.Operation, error) { + return c.internalClient.GetOperation(ctx, req, opts...) +} + +// ListOperations is a utility method from google.longrunning.Operations. +func (c *DatabaseAdminClient) ListOperations(ctx context.Context, req *longrunningpb.ListOperationsRequest, opts ...gax.CallOption) *OperationIterator { + return c.internalClient.ListOperations(ctx, req, opts...) +} + +// databaseAdminGRPCClient is a client for interacting with Cloud Spanner API over gRPC transport. // // Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls. type databaseAdminGRPCClient struct { @@ -566,6 +598,8 @@ type databaseAdminGRPCClient struct { // Users should not Close this client. LROClient **lroauto.OperationsClient + operationsClient longrunningpb.OperationsClient + // The x-goog-* metadata to be sent with each request. xGoogMetadata metadata.MD } @@ -610,6 +644,7 @@ func NewDatabaseAdminClient(ctx context.Context, opts ...option.ClientOption) (* disableDeadlines: disableDeadlines, databaseAdminClient: databasepb.NewDatabaseAdminClient(connPool), CallOptions: &client.CallOptions, + operationsClient: longrunningpb.NewOperationsClient(connPool), } c.setGoogleClientInfo() @@ -1186,6 +1221,94 @@ func (c *databaseAdminGRPCClient) ListDatabaseRoles(ctx context.Context, req *da return it } +func (c *databaseAdminGRPCClient) CancelOperation(ctx context.Context, req *longrunningpb.CancelOperationRequest, 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).CancelOperation[0:len((*c.CallOptions).CancelOperation):len((*c.CallOptions).CancelOperation)], opts...) + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + _, err = c.operationsClient.CancelOperation(ctx, req, settings.GRPC...) + return err + }, opts...) + return err +} + +func (c *databaseAdminGRPCClient) DeleteOperation(ctx context.Context, req *longrunningpb.DeleteOperationRequest, 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).DeleteOperation[0:len((*c.CallOptions).DeleteOperation):len((*c.CallOptions).DeleteOperation)], opts...) + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + _, err = c.operationsClient.DeleteOperation(ctx, req, settings.GRPC...) + return err + }, opts...) + return err +} + +func (c *databaseAdminGRPCClient) GetOperation(ctx context.Context, req *longrunningpb.GetOperationRequest, opts ...gax.CallOption) (*longrunningpb.Operation, 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).GetOperation[0:len((*c.CallOptions).GetOperation):len((*c.CallOptions).GetOperation)], opts...) + var resp *longrunningpb.Operation + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + resp, err = c.operationsClient.GetOperation(ctx, req, settings.GRPC...) + return err + }, opts...) + if err != nil { + return nil, err + } + return resp, nil +} + +func (c *databaseAdminGRPCClient) ListOperations(ctx context.Context, req *longrunningpb.ListOperationsRequest, opts ...gax.CallOption) *OperationIterator { + 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).ListOperations[0:len((*c.CallOptions).ListOperations):len((*c.CallOptions).ListOperations)], opts...) + it := &OperationIterator{} + req = proto.Clone(req).(*longrunningpb.ListOperationsRequest) + it.InternalFetch = func(pageSize int, pageToken string) ([]*longrunningpb.Operation, string, error) { + resp := &longrunningpb.ListOperationsResponse{} + if pageToken != "" { + req.PageToken = pageToken + } + if pageSize > math.MaxInt32 { + req.PageSize = math.MaxInt32 + } else if pageSize != 0 { + req.PageSize = int32(pageSize) + } + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + resp, err = c.operationsClient.ListOperations(ctx, req, settings.GRPC...) + return err + }, opts...) + if err != nil { + return nil, "", err + } + + it.Response = resp + return resp.GetOperations(), resp.GetNextPageToken(), nil + } + fetch := func(pageSize int, pageToken string) (string, error) { + items, nextPageToken, err := it.InternalFetch(pageSize, pageToken) + if err != nil { + return "", err + } + it.items = append(it.items, items...) + return nextPageToken, nil + } + + it.pageInfo, it.nextFunc = iterator.NewPageInfo(fetch, it.bufLen, it.takeBuf) + it.pageInfo.MaxSize = int(req.GetPageSize()) + it.pageInfo.Token = req.GetPageToken() + + return it +} + // CopyBackupOperation manages a long-running operation from CopyBackup. type CopyBackupOperation struct { lro *longrunning.Operation diff --git a/admin/database/apiv1/database_admin_client_example_test.go b/admin/database/apiv1/database_admin_client_example_test.go index f0e8565..f50e836 100644 --- a/admin/database/apiv1/database_admin_client_example_test.go +++ b/admin/database/apiv1/database_admin_client_example_test.go @@ -22,6 +22,7 @@ import ( database "cloud.google.com/go/spanner/admin/database/apiv1" "google.golang.org/api/iterator" iampb "google.golang.org/genproto/googleapis/iam/v1" + longrunningpb "google.golang.org/genproto/googleapis/longrunning" databasepb "google.golang.org/genproto/googleapis/spanner/admin/database/v1" ) @@ -465,3 +466,85 @@ func ExampleDatabaseAdminClient_ListDatabaseRoles() { _ = resp } } + +func ExampleDatabaseAdminClient_CancelOperation() { + ctx := context.Background() + c, err := database.NewDatabaseAdminClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &longrunningpb.CancelOperationRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/longrunning#CancelOperationRequest. + } + err = c.CancelOperation(ctx, req) + if err != nil { + // TODO: Handle error. + } +} + +func ExampleDatabaseAdminClient_DeleteOperation() { + ctx := context.Background() + c, err := database.NewDatabaseAdminClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &longrunningpb.DeleteOperationRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/longrunning#DeleteOperationRequest. + } + err = c.DeleteOperation(ctx, req) + if err != nil { + // TODO: Handle error. + } +} + +func ExampleDatabaseAdminClient_GetOperation() { + ctx := context.Background() + c, err := database.NewDatabaseAdminClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &longrunningpb.GetOperationRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/longrunning#GetOperationRequest. + } + resp, err := c.GetOperation(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleDatabaseAdminClient_ListOperations() { + ctx := context.Background() + c, err := database.NewDatabaseAdminClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &longrunningpb.ListOperationsRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/longrunning#ListOperationsRequest. + } + it := c.ListOperations(ctx, req) + for { + resp, err := it.Next() + if err == iterator.Done { + break + } + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp + } +} diff --git a/admin/database/apiv1/doc.go b/admin/database/apiv1/doc.go index d0f2482..2cf12a8 100644 --- a/admin/database/apiv1/doc.go +++ b/admin/database/apiv1/doc.go @@ -15,7 +15,10 @@ // Code generated by protoc-gen-go_gapic. DO NOT EDIT. // Package database is an auto-generated package for the -// Cloud Spanner Database Admin API. +// Cloud Spanner API. +// +// Cloud Spanner is a managed, mission-critical, globally consistent and +// scalable relational database service. // // Example usage // diff --git a/admin/database/apiv1/gapic_metadata.json b/admin/database/apiv1/gapic_metadata.json index b55d79c..dbc6307 100644 --- a/admin/database/apiv1/gapic_metadata.json +++ b/admin/database/apiv1/gapic_metadata.json @@ -10,6 +10,11 @@ "grpc": { "libraryClient": "DatabaseAdminClient", "rpcs": { + "CancelOperation": { + "methods": [ + "CancelOperation" + ] + }, "CopyBackup": { "methods": [ "CopyBackup" @@ -30,6 +35,11 @@ "DeleteBackup" ] }, + "DeleteOperation": { + "methods": [ + "DeleteOperation" + ] + }, "DropDatabase": { "methods": [ "DropDatabase" @@ -55,6 +65,11 @@ "GetIamPolicy" ] }, + "GetOperation": { + "methods": [ + "GetOperation" + ] + }, "ListBackupOperations": { "methods": [ "ListBackupOperations" @@ -80,6 +95,11 @@ "ListDatabases" ] }, + "ListOperations": { + "methods": [ + "ListOperations" + ] + }, "RestoreDatabase": { "methods": [ "RestoreDatabase" diff --git a/go.mod b/go.mod index f88bd99..7137051 100644 --- a/go.mod +++ b/go.mod @@ -9,8 +9,8 @@ require ( github.com/googleapis/gax-go/v2 v2.4.0 go.opencensus.io v0.23.0 golang.org/x/xerrors v0.0.0-20220609144429-65e65417b02f - google.golang.org/api v0.86.0 - google.golang.org/genproto v0.0.0-20220725144611-272f38e5d71b + google.golang.org/api v0.90.0 + google.golang.org/genproto v0.0.0-20220801145646-83ce21fca29f google.golang.org/grpc v1.48.0 google.golang.org/protobuf v1.28.0 ) diff --git a/go.sum b/go.sum index 6691561..69f7828 100644 --- a/go.sum +++ b/go.sum @@ -509,8 +509,8 @@ google.golang.org/api v0.75.0/go.mod h1:pU9QmyHLnzlpar1Mjt4IbapUCy8J+6HD6GeELN69 google.golang.org/api v0.78.0/go.mod h1:1Sg78yoMLOhlQTeF+ARBoytAcH1NNyyl390YMy6rKmw= google.golang.org/api v0.80.0/go.mod h1:xY3nI94gbvBrE0J6NHXhxOmW97HG7Khjkku6AFB3Hyg= google.golang.org/api v0.84.0/go.mod h1:NTsGnUFJMYROtiquksZHBWtHfeMC7iYthki7Eq3pa8o= -google.golang.org/api v0.86.0 h1:ZAnyOHQFIuWso1BodVfSaRyffD74T9ERGFa3k1fNk/U= -google.golang.org/api v0.86.0/go.mod h1:+Sem1dnrKlrXMR/X0bPnMWyluQe4RsNoYfmNLhOIkzw= +google.golang.org/api v0.90.0 h1:WMnUWAvihIClUYFNeFA69VTuR3duKS3IalMGDQcLvq8= +google.golang.org/api v0.90.0/go.mod h1:+Sem1dnrKlrXMR/X0bPnMWyluQe4RsNoYfmNLhOIkzw= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= @@ -599,8 +599,8 @@ google.golang.org/genproto v0.0.0-20220608133413-ed9918b62aac/go.mod h1:KEWEmljW google.golang.org/genproto v0.0.0-20220616135557-88e70c0c3a90/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= google.golang.org/genproto v0.0.0-20220617124728-180714bec0ad/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= google.golang.org/genproto v0.0.0-20220624142145-8cd45d7dbd1f/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= -google.golang.org/genproto v0.0.0-20220725144611-272f38e5d71b h1:SfSkJugek6xm7lWywqth4r2iTrYLpD8lOj1nMIIhMNM= -google.golang.org/genproto v0.0.0-20220725144611-272f38e5d71b/go.mod h1:iHe1svFLAZg9VWz891+QbRMwUv9O/1Ww+/mngYeThbc= +google.golang.org/genproto v0.0.0-20220801145646-83ce21fca29f h1:XVHpVMvPs4MtH3h6cThzKs2snNexcfd35vQx2T3IuIY= +google.golang.org/genproto v0.0.0-20220801145646-83ce21fca29f/go.mod h1:iHe1svFLAZg9VWz891+QbRMwUv9O/1Ww+/mngYeThbc= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM=