From 064d6cb43aca28ca5c9eca5b4345a9a60d5a2db4 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Thu, 5 Mar 2020 10:08:10 +0000 Subject: [PATCH] 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/317 Change-Id: I548f0a55a5dd1510718250fccc039f9db68e455b Reviewed-on: https://code-review.googlesource.com/c/gocloud/+/52832 Reviewed-by: kokoro Reviewed-by: Tyler Bui-Palsulich --- asset/apiv1/doc.go | 2 +- asset/apiv1beta1/doc.go | 2 +- asset/apiv1p2beta1/doc.go | 2 +- automl/apiv1/auto_ml_client.go | 598 +++++--- automl/apiv1/auto_ml_client_example_test.go | 143 +- automl/apiv1/doc.go | 11 +- automl/apiv1/prediction_client.go | 90 +- .../apiv1/prediction_client_example_test.go | 8 +- automl/apiv1beta1/auto_ml_client.go | 1274 ++++++++++------- .../apiv1beta1/auto_ml_client_example_test.go | 319 +++-- automl/apiv1beta1/doc.go | 12 +- automl/apiv1beta1/prediction_client.go | 42 +- .../prediction_client_example_test.go | 6 +- bigquery/datatransfer/apiv1/doc.go | 2 +- bigquery/go.mod | 2 +- bigquery/go.sum | 4 +- bigquery/reservation/apiv1beta1/doc.go | 2 +- bigquery/storage/apiv1/doc.go | 2 +- bigquery/storage/apiv1alpha2/doc.go | 2 +- bigquery/storage/apiv1beta1/doc.go | 2 +- bigquery/storage/apiv1beta2/doc.go | 2 +- bigtable/go.mod | 2 +- bigtable/go.sum | 4 +- billing/apiv1/doc.go | 2 +- cloudbuild/apiv1/v2/doc.go | 2 +- cloudtasks/apiv2/doc.go | 2 +- cloudtasks/apiv2beta2/doc.go | 2 +- cloudtasks/apiv2beta3/doc.go | 2 +- containeranalysis/apiv1beta1/doc.go | 2 +- datacatalog/apiv1beta1/doc.go | 2 +- dataproc/apiv1/doc.go | 2 +- dataproc/apiv1beta2/doc.go | 2 +- datastore/go.mod | 2 +- datastore/go.sum | 4 +- debugger/apiv2/doc.go | 2 +- dialogflow/apiv2/doc.go | 2 +- dlp/apiv2/doc.go | 2 +- errorreporting/apiv1beta1/doc.go | 2 +- expr/apiv1alpha1/doc.go | 2 +- firestore/apiv1/admin/doc.go | 2 +- firestore/apiv1/doc.go | 2 +- firestore/apiv1beta1/doc.go | 2 +- firestore/go.mod | 2 +- firestore/go.sum | 4 +- go.mod | 2 +- go.sum | 4 +- iam/credentials/apiv1/doc.go | 2 +- internal/.repo-metadata-full.json | 4 +- internal/gapicgen/go.mod | 2 +- internal/gapicgen/go.sum | 4 +- iot/apiv1/doc.go | 2 +- irm/apiv1alpha2/doc.go | 2 +- kms/apiv1/doc.go | 2 +- language/apiv1/doc.go | 2 +- language/apiv1beta2/doc.go | 2 +- logging/apiv2/doc.go | 2 +- logging/go.mod | 2 +- logging/go.sum | 4 +- longrunning/autogen/doc.go | 2 +- memcache/apiv1beta2/doc.go | 2 +- monitoring/apiv3/doc.go | 2 +- osconfig/agentendpoint/apiv1beta/doc.go | 2 +- osconfig/apiv1beta/doc.go | 2 +- oslogin/apiv1/doc.go | 2 +- oslogin/apiv1beta/doc.go | 2 +- phishingprotection/apiv1beta1/doc.go | 2 +- pubsub/apiv1/doc.go | 2 +- pubsub/apiv1/publisher_client.go | 14 +- pubsub/apiv1/subscriber_client.go | 14 +- pubsub/go.mod | 2 +- pubsub/go.sum | 4 +- recaptchaenterprise/apiv1beta1/doc.go | 2 +- recommender/apiv1/doc.go | 2 +- recommender/apiv1beta1/doc.go | 2 +- redis/apiv1/doc.go | 2 +- redis/apiv1beta1/doc.go | 2 +- scheduler/apiv1/doc.go | 2 +- scheduler/apiv1beta1/doc.go | 2 +- secretmanager/apiv1/doc.go | 2 +- secretmanager/apiv1beta1/doc.go | 2 +- securitycenter/apiv1/doc.go | 2 +- securitycenter/apiv1beta1/doc.go | 2 +- securitycenter/apiv1p1beta1/doc.go | 2 +- spanner/admin/database/apiv1/doc.go | 2 +- spanner/admin/instance/apiv1/doc.go | 2 +- spanner/apiv1/doc.go | 2 +- spanner/go.mod | 2 +- spanner/go.sum | 4 +- speech/apiv1/doc.go | 2 +- speech/apiv1p1beta1/doc.go | 2 +- storage/go.mod | 2 +- storage/go.sum | 4 +- talent/apiv4beta1/doc.go | 2 +- texttospeech/apiv1/doc.go | 2 +- trace/apiv1/doc.go | 2 +- trace/apiv2/doc.go | 2 +- translate/apiv3/doc.go | 2 +- videointelligence/apiv1/doc.go | 2 +- videointelligence/apiv1beta2/doc.go | 2 +- vision/apiv1/doc.go | 2 +- vision/apiv1p1beta1/doc.go | 2 +- webrisk/apiv1beta1/doc.go | 2 +- 102 files changed, 1591 insertions(+), 1142 deletions(-) diff --git a/asset/apiv1/doc.go b/asset/apiv1/doc.go index 74ddfaa065a8..3e7ae6763aaa 100644 --- a/asset/apiv1/doc.go +++ b/asset/apiv1/doc.go @@ -40,7 +40,7 @@ import ( "google.golang.org/grpc/metadata" ) -const versionClient = "20200304" +const versionClient = "20200305" 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 15669f2ef14b..4d6bcfd79d5b 100644 --- a/asset/apiv1beta1/doc.go +++ b/asset/apiv1beta1/doc.go @@ -42,7 +42,7 @@ import ( "google.golang.org/grpc/metadata" ) -const versionClient = "20200304" +const versionClient = "20200305" 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 50865953a25a..976a9331dee2 100644 --- a/asset/apiv1p2beta1/doc.go +++ b/asset/apiv1p2beta1/doc.go @@ -42,7 +42,7 @@ import ( "google.golang.org/grpc/metadata" ) -const versionClient = "20200304" +const versionClient = "20200305" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/automl/apiv1/auto_ml_client.go b/automl/apiv1/auto_ml_client.go index edde45b40d78..cffc9484bd47 100644 --- a/automl/apiv1/auto_ml_client.go +++ b/automl/apiv1/auto_ml_client.go @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC +// 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. @@ -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 automl @@ -29,7 +29,7 @@ import ( 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" automlpb "google.golang.org/genproto/googleapis/cloud/automl/v1" longrunningpb "google.golang.org/genproto/googleapis/longrunning" "google.golang.org/grpc" @@ -40,18 +40,18 @@ import ( // CallOptions contains the retry settings for each method of Client. type CallOptions struct { CreateDataset []gax.CallOption - UpdateDataset []gax.CallOption GetDataset []gax.CallOption ListDatasets []gax.CallOption + UpdateDataset []gax.CallOption DeleteDataset []gax.CallOption ImportData []gax.CallOption ExportData []gax.CallOption GetAnnotationSpec []gax.CallOption CreateModel []gax.CallOption GetModel []gax.CallOption - UpdateModel []gax.CallOption ListModels []gax.CallOption DeleteModel []gax.CallOption + UpdateModel []gax.CallOption DeployModel []gax.CallOption UndeployModel []gax.CallOption ExportModel []gax.CallOption @@ -62,6 +62,7 @@ type CallOptions struct { func defaultClientOptions() []option.ClientOption { return []option.ClientOption{ option.WithEndpoint("automl.googleapis.com:443"), + option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithScopes(DefaultAuthScopes()...), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), @@ -69,8 +70,9 @@ func defaultClientOptions() []option.ClientOption { } func defaultCallOptions() *CallOptions { - retry := map[[2]string][]gax.CallOption{ - {"default", "idempotent"}: { + return &CallOptions{ + CreateDataset: []gax.CallOption{}, + GetDataset: []gax.CallOption{ gax.WithRetry(func() gax.Retryer { return gax.OnCodes([]codes.Code{ codes.DeadlineExceeded, @@ -78,30 +80,114 @@ func defaultCallOptions() *CallOptions { }, gax.Backoff{ Initial: 100 * time.Millisecond, Max: 60000 * time.Millisecond, - Multiplier: 1.3, + Multiplier: 1.30, + }) + }), + }, + ListDatasets: []gax.CallOption{ + gax.WithRetry(func() gax.Retryer { + return gax.OnCodes([]codes.Code{ + codes.DeadlineExceeded, + codes.Unavailable, + }, gax.Backoff{ + Initial: 100 * time.Millisecond, + Max: 60000 * time.Millisecond, + Multiplier: 1.30, + }) + }), + }, + UpdateDataset: []gax.CallOption{}, + DeleteDataset: []gax.CallOption{ + gax.WithRetry(func() gax.Retryer { + return gax.OnCodes([]codes.Code{ + codes.DeadlineExceeded, + codes.Unavailable, + }, gax.Backoff{ + Initial: 100 * time.Millisecond, + Max: 60000 * time.Millisecond, + Multiplier: 1.30, + }) + }), + }, + ImportData: []gax.CallOption{}, + ExportData: []gax.CallOption{}, + GetAnnotationSpec: []gax.CallOption{ + gax.WithRetry(func() gax.Retryer { + return gax.OnCodes([]codes.Code{ + codes.DeadlineExceeded, + codes.Unavailable, + }, gax.Backoff{ + Initial: 100 * time.Millisecond, + Max: 60000 * time.Millisecond, + Multiplier: 1.30, + }) + }), + }, + CreateModel: []gax.CallOption{}, + GetModel: []gax.CallOption{ + gax.WithRetry(func() gax.Retryer { + return gax.OnCodes([]codes.Code{ + codes.DeadlineExceeded, + codes.Unavailable, + }, gax.Backoff{ + Initial: 100 * time.Millisecond, + Max: 60000 * time.Millisecond, + Multiplier: 1.30, + }) + }), + }, + ListModels: []gax.CallOption{ + gax.WithRetry(func() gax.Retryer { + return gax.OnCodes([]codes.Code{ + codes.DeadlineExceeded, + codes.Unavailable, + }, gax.Backoff{ + Initial: 100 * time.Millisecond, + Max: 60000 * time.Millisecond, + Multiplier: 1.30, + }) + }), + }, + DeleteModel: []gax.CallOption{ + gax.WithRetry(func() gax.Retryer { + return gax.OnCodes([]codes.Code{ + codes.DeadlineExceeded, + codes.Unavailable, + }, gax.Backoff{ + Initial: 100 * time.Millisecond, + Max: 60000 * time.Millisecond, + Multiplier: 1.30, + }) + }), + }, + UpdateModel: []gax.CallOption{}, + DeployModel: []gax.CallOption{}, + UndeployModel: []gax.CallOption{}, + ExportModel: []gax.CallOption{}, + GetModelEvaluation: []gax.CallOption{ + gax.WithRetry(func() gax.Retryer { + return gax.OnCodes([]codes.Code{ + codes.DeadlineExceeded, + codes.Unavailable, + }, gax.Backoff{ + Initial: 100 * time.Millisecond, + Max: 60000 * time.Millisecond, + Multiplier: 1.30, + }) + }), + }, + ListModelEvaluations: []gax.CallOption{ + gax.WithRetry(func() gax.Retryer { + return gax.OnCodes([]codes.Code{ + codes.DeadlineExceeded, + codes.Unavailable, + }, gax.Backoff{ + Initial: 100 * time.Millisecond, + Max: 60000 * time.Millisecond, + Multiplier: 1.30, }) }), }, - } - return &CallOptions{ - CreateDataset: retry[[2]string{"default", "non_idempotent"}], - UpdateDataset: retry[[2]string{"default", "non_idempotent"}], - GetDataset: retry[[2]string{"default", "idempotent"}], - ListDatasets: retry[[2]string{"default", "idempotent"}], - DeleteDataset: retry[[2]string{"default", "idempotent"}], - ImportData: retry[[2]string{"default", "non_idempotent"}], - ExportData: retry[[2]string{"default", "non_idempotent"}], - GetAnnotationSpec: retry[[2]string{"default", "idempotent"}], - CreateModel: retry[[2]string{"default", "non_idempotent"}], - GetModel: retry[[2]string{"default", "idempotent"}], - UpdateModel: retry[[2]string{"default", "non_idempotent"}], - ListModels: retry[[2]string{"default", "idempotent"}], - DeleteModel: retry[[2]string{"default", "idempotent"}], - DeployModel: retry[[2]string{"default", "non_idempotent"}], - UndeployModel: retry[[2]string{"default", "non_idempotent"}], - ExportModel: retry[[2]string{"default", "non_idempotent"}], - GetModelEvaluation: retry[[2]string{"default", "idempotent"}], - ListModelEvaluations: retry[[2]string{"default", "idempotent"}], } } @@ -109,8 +195,8 @@ func defaultCallOptions() *CallOptions { // // Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls. type Client struct { - // The connection to the service. - conn *grpc.ClientConn + // Connection pool of gRPC connections to the service. + connPool gtransport.ConnPool // The gRPC API client. client automlpb.AutoMlClient @@ -135,49 +221,51 @@ type Client struct { // The server never reuses names that it has created after the resources with // those names are deleted. // -// An ID of a resource is the last element of the item's resource name. For +// An ID of a resource is the last element of the item’s resource name. For // projects/{project_id}/locations/{location_id}/datasets/{dataset_id}, then // the id for the item is {dataset_id}. // -// Currently the only supported location_id is "us-central1". +// Currently the only supported location_id is “us-central1”. // // On any input that is documented to expect a string parameter in // snake_case or kebab-case, either of those cases is accepted. func NewClient(ctx context.Context, opts ...option.ClientOption) (*Client, error) { - conn, err := transport.DialGRPC(ctx, append(defaultClientOptions(), opts...)...) + connPool, err := gtransport.DialPool(ctx, append(defaultClientOptions(), opts...)...) if err != nil { return nil, err } c := &Client{ - conn: conn, + connPool: connPool, CallOptions: defaultCallOptions(), - client: automlpb.NewAutoMlClient(conn), + client: automlpb.NewAutoMlClient(connPool), } c.setGoogleClientInfo() - c.LROClient, err = lroauto.NewOperationsClient(ctx, option.WithGRPCConn(conn)) + c.LROClient, err = lroauto.NewOperationsClient(ctx, gtransport.WithConnPool(connPool)) if err != nil { - // This error "should not happen", since we are just reusing old connection + // This error "should not happen", since we are just reusing old connection pool // and never actually need to dial. - // If this does happen, we could leak conn. However, we cannot close conn: - // If the user invoked the function with option.WithGRPCConn, + // If this does happen, we could leak connp. However, we cannot close conn: + // If the user invoked the constructor with option.WithGRPCConn, // we would close a connection that's still in use. - // TODO(pongad): investigate error conditions. + // TODO: investigate error conditions. return nil, err } return c, nil } -// Connection returns the client's connection to the API service. +// Connection returns a connection to the API service. +// +// Deprecated. func (c *Client) 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 *Client) Close() error { - return c.conn.Close() + return c.connPool.Close() } // setGoogleClientInfo sets the name and version of the application in @@ -208,23 +296,6 @@ func (c *Client) CreateDataset(ctx context.Context, req *automlpb.CreateDatasetR }, nil } -// UpdateDataset updates a dataset. -func (c *Client) UpdateDataset(ctx context.Context, req *automlpb.UpdateDatasetRequest, opts ...gax.CallOption) (*automlpb.Dataset, error) { - md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "dataset.name", url.QueryEscape(req.GetDataset().GetName()))) - ctx = insertMetadata(ctx, c.xGoogMetadata, md) - opts = append(c.CallOptions.UpdateDataset[0:len(c.CallOptions.UpdateDataset):len(c.CallOptions.UpdateDataset)], opts...) - var resp *automlpb.Dataset - err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { - var err error - resp, err = c.client.UpdateDataset(ctx, req, settings.GRPC...) - return err - }, opts...) - if err != nil { - return nil, err - } - return resp, nil -} - // GetDataset gets a dataset. func (c *Client) GetDataset(ctx context.Context, req *automlpb.GetDatasetRequest, opts ...gax.CallOption) (*automlpb.Dataset, error) { md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))) @@ -265,6 +336,8 @@ func (c *Client) ListDatasets(ctx context.Context, req *automlpb.ListDatasetsReq if err != nil { return nil, "", err } + + it.Response = resp return resp.Datasets, resp.NextPageToken, nil } fetch := func(pageSize int, pageToken string) (string, error) { @@ -281,6 +354,23 @@ func (c *Client) ListDatasets(ctx context.Context, req *automlpb.ListDatasetsReq return it } +// UpdateDataset updates a dataset. +func (c *Client) UpdateDataset(ctx context.Context, req *automlpb.UpdateDatasetRequest, opts ...gax.CallOption) (*automlpb.Dataset, error) { + md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "dataset.name", url.QueryEscape(req.GetDataset().GetName()))) + ctx = insertMetadata(ctx, c.xGoogMetadata, md) + opts = append(c.CallOptions.UpdateDataset[0:len(c.CallOptions.UpdateDataset):len(c.CallOptions.UpdateDataset)], opts...) + var resp *automlpb.Dataset + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + resp, err = c.client.UpdateDataset(ctx, req, settings.GRPC...) + return err + }, opts...) + if err != nil { + return nil, err + } + return resp, nil +} + // DeleteDataset deletes a dataset and all of its contents. // Returns empty response in the // [response][google.longrunning.Operation.response] field when it completes, @@ -305,6 +395,15 @@ func (c *Client) DeleteDataset(ctx context.Context, req *automlpb.DeleteDatasetR } // ImportData imports data into a dataset. +// For Tables this method can only be called on an empty Dataset. +// +// For Tables: +// +// A +// [schema_inference_version][google.cloud.automl.v1.InputConfig.params] +// parameter must be explicitly set. +// Returns an empty response in the +// [response][google.longrunning.Operation.response] field when it completes. func (c *Client) ImportData(ctx context.Context, req *automlpb.ImportDataRequest, opts ...gax.CallOption) (*ImportDataOperation, error) { md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))) ctx = insertMetadata(ctx, c.xGoogMetadata, md) @@ -323,7 +422,7 @@ func (c *Client) ImportData(ctx context.Context, req *automlpb.ImportDataRequest }, nil } -// ExportData exports dataset's data to the provided output location. +// ExportData exports dataset’s data to the provided output location. // Returns an empty response in the // [response][google.longrunning.Operation.response] field when it completes. func (c *Client) ExportData(ctx context.Context, req *automlpb.ExportDataRequest, opts ...gax.CallOption) (*ExportDataOperation, error) { @@ -401,23 +500,6 @@ func (c *Client) GetModel(ctx context.Context, req *automlpb.GetModelRequest, op return resp, nil } -// UpdateModel updates a model. -func (c *Client) UpdateModel(ctx context.Context, req *automlpb.UpdateModelRequest, opts ...gax.CallOption) (*automlpb.Model, error) { - md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "model.name", url.QueryEscape(req.GetModel().GetName()))) - ctx = insertMetadata(ctx, c.xGoogMetadata, md) - opts = append(c.CallOptions.UpdateModel[0:len(c.CallOptions.UpdateModel):len(c.CallOptions.UpdateModel)], opts...) - var resp *automlpb.Model - err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { - var err error - resp, err = c.client.UpdateModel(ctx, req, settings.GRPC...) - return err - }, opts...) - if err != nil { - return nil, err - } - return resp, nil -} - // ListModels lists models. func (c *Client) ListModels(ctx context.Context, req *automlpb.ListModelsRequest, opts ...gax.CallOption) *ModelIterator { md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))) @@ -441,6 +523,8 @@ func (c *Client) ListModels(ctx context.Context, req *automlpb.ListModelsRequest if err != nil { return nil, "", err } + + it.Response = resp return resp.Model, resp.NextPageToken, nil } fetch := func(pageSize int, pageToken string) (string, error) { @@ -480,15 +564,32 @@ func (c *Client) DeleteModel(ctx context.Context, req *automlpb.DeleteModelReque }, nil } +// UpdateModel updates a model. +func (c *Client) UpdateModel(ctx context.Context, req *automlpb.UpdateModelRequest, opts ...gax.CallOption) (*automlpb.Model, error) { + md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "model.name", url.QueryEscape(req.GetModel().GetName()))) + ctx = insertMetadata(ctx, c.xGoogMetadata, md) + opts = append(c.CallOptions.UpdateModel[0:len(c.CallOptions.UpdateModel):len(c.CallOptions.UpdateModel)], opts...) + var resp *automlpb.Model + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + resp, err = c.client.UpdateModel(ctx, req, settings.GRPC...) + return err + }, opts...) + if err != nil { + return nil, err + } + return resp, nil +} + // DeployModel deploys a model. If a model is already deployed, deploying it with the // same parameters has no effect. Deploying with different parametrs // (as e.g. changing // -// [node_number][google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata.node_number]) -// will reset the deployment state without pausing the model's availability. +// [node_number][google.cloud.automl.v1p1beta.ImageObjectDetectionModelDeploymentMetadata.node_number]) +// will reset the deployment state without pausing the model’s availability. // -// Only applicable for Text Classification, Image Object Detection; all other -// domains manage deployment automatically. +// Only applicable for Text Classification, Image Object Detection , Tables, and Image Segmentation; all other domains manage +// deployment automatically. // // Returns an empty response in the // [response][google.longrunning.Operation.response] field when it completes. @@ -512,7 +613,7 @@ func (c *Client) DeployModel(ctx context.Context, req *automlpb.DeployModelReque // UndeployModel undeploys a model. If the model is not deployed this method has no effect. // -// Only applicable for Text Classification, Image Object Detection; +// Only applicable for Text Classification, Image Object Detection and Tables; // all other domains manage deployment automatically. // // Returns an empty response in the @@ -535,7 +636,7 @@ func (c *Client) UndeployModel(ctx context.Context, req *automlpb.UndeployModelR }, nil } -// ExportModel exports a trained, "export-able", model to a user specified Google Cloud +// ExportModel exports a trained, “export-able”, model to a user specified Google Cloud // Storage location. A model is considered export-able if and only if it has // an export format defined for it in // [ModelExportOutputConfig][google.cloud.automl.v1.ModelExportOutputConfig]. @@ -600,6 +701,8 @@ func (c *Client) ListModelEvaluations(ctx context.Context, req *automlpb.ListMod if err != nil { return nil, "", err } + + it.Response = resp return resp.ModelEvaluation, resp.NextPageToken, nil } fetch := func(pageSize int, pageToken string) (string, error) { @@ -616,132 +719,6 @@ func (c *Client) ListModelEvaluations(ctx context.Context, req *automlpb.ListMod return it } -// DatasetIterator manages a stream of *automlpb.Dataset. -type DatasetIterator struct { - items []*automlpb.Dataset - pageInfo *iterator.PageInfo - nextFunc func() error - - // InternalFetch is for use by the Google Cloud Libraries only. - // It is not part of the stable interface of this package. - // - // InternalFetch returns results from a single call to the underlying RPC. - // The number of results is no greater than pageSize. - // If there are no more results, nextPageToken is empty and err is nil. - InternalFetch func(pageSize int, pageToken string) (results []*automlpb.Dataset, nextPageToken string, err error) -} - -// PageInfo supports pagination. See the google.golang.org/api/iterator package for details. -func (it *DatasetIterator) 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 *DatasetIterator) Next() (*automlpb.Dataset, error) { - var item *automlpb.Dataset - if err := it.nextFunc(); err != nil { - return item, err - } - item = it.items[0] - it.items = it.items[1:] - return item, nil -} - -func (it *DatasetIterator) bufLen() int { - return len(it.items) -} - -func (it *DatasetIterator) takeBuf() interface{} { - b := it.items - it.items = nil - return b -} - -// ModelEvaluationIterator manages a stream of *automlpb.ModelEvaluation. -type ModelEvaluationIterator struct { - items []*automlpb.ModelEvaluation - pageInfo *iterator.PageInfo - nextFunc func() error - - // InternalFetch is for use by the Google Cloud Libraries only. - // It is not part of the stable interface of this package. - // - // InternalFetch returns results from a single call to the underlying RPC. - // The number of results is no greater than pageSize. - // If there are no more results, nextPageToken is empty and err is nil. - InternalFetch func(pageSize int, pageToken string) (results []*automlpb.ModelEvaluation, nextPageToken string, err error) -} - -// PageInfo supports pagination. See the google.golang.org/api/iterator package for details. -func (it *ModelEvaluationIterator) 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 *ModelEvaluationIterator) Next() (*automlpb.ModelEvaluation, error) { - var item *automlpb.ModelEvaluation - if err := it.nextFunc(); err != nil { - return item, err - } - item = it.items[0] - it.items = it.items[1:] - return item, nil -} - -func (it *ModelEvaluationIterator) bufLen() int { - return len(it.items) -} - -func (it *ModelEvaluationIterator) takeBuf() interface{} { - b := it.items - it.items = nil - return b -} - -// ModelIterator manages a stream of *automlpb.Model. -type ModelIterator struct { - items []*automlpb.Model - pageInfo *iterator.PageInfo - nextFunc func() error - - // InternalFetch is for use by the Google Cloud Libraries only. - // It is not part of the stable interface of this package. - // - // InternalFetch returns results from a single call to the underlying RPC. - // The number of results is no greater than pageSize. - // If there are no more results, nextPageToken is empty and err is nil. - InternalFetch func(pageSize int, pageToken string) (results []*automlpb.Model, nextPageToken string, err error) -} - -// PageInfo supports pagination. See the google.golang.org/api/iterator package for details. -func (it *ModelIterator) 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 *ModelIterator) Next() (*automlpb.Model, error) { - var item *automlpb.Model - if err := it.nextFunc(); err != nil { - return item, err - } - item = it.items[0] - it.items = it.items[1:] - return item, nil -} - -func (it *ModelIterator) bufLen() int { - return len(it.items) -} - -func (it *ModelIterator) takeBuf() interface{} { - b := it.items - it.items = nil - return b -} - // CreateDatasetOperation manages a long-running operation from CreateDataset. type CreateDatasetOperation struct { lro *longrunning.Operation @@ -760,7 +737,7 @@ func (c *Client) CreateDatasetOperation(name string) *CreateDatasetOperation { // See documentation of Poll for error-handling information. func (op *CreateDatasetOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*automlpb.Dataset, error) { var resp automlpb.Dataset - if err := op.lro.WaitWithInterval(ctx, &resp, 5000*time.Millisecond, opts...); err != nil { + if err := op.lro.WaitWithInterval(ctx, &resp, time.Minute, opts...); err != nil { return nil, err } return &resp, nil @@ -829,7 +806,7 @@ func (c *Client) CreateModelOperation(name string) *CreateModelOperation { // See documentation of Poll for error-handling information. func (op *CreateModelOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*automlpb.Model, error) { var resp automlpb.Model - if err := op.lro.WaitWithInterval(ctx, &resp, 5000*time.Millisecond, opts...); err != nil { + if err := op.lro.WaitWithInterval(ctx, &resp, time.Minute, opts...); err != nil { return nil, err } return &resp, nil @@ -893,11 +870,11 @@ func (c *Client) DeleteDatasetOperation(name string) *DeleteDatasetOperation { } } -// Wait blocks until the long-running operation is completed, returning any error encountered. +// Wait blocks until the long-running operation is completed, returning the response and any errors encountered. // // See documentation of Poll for error-handling information. func (op *DeleteDatasetOperation) Wait(ctx context.Context, opts ...gax.CallOption) error { - return op.lro.WaitWithInterval(ctx, nil, 5000*time.Millisecond, opts...) + return op.lro.WaitWithInterval(ctx, nil, time.Minute, opts...) } // Poll fetches the latest state of the long-running operation. @@ -906,7 +883,9 @@ func (op *DeleteDatasetOperation) Wait(ctx context.Context, opts ...gax.CallOpti // // If Poll fails, the error is returned and op is unmodified. If Poll succeeds and // the operation has completed with failure, the error is returned and op.Done will return true. -// If Poll succeeds and the operation has completed successfully, op.Done will return true. +// If Poll succeeds and the operation has completed successfully, +// op.Done will return true, and the response of the operation is returned. +// If Poll succeeds and the operation has not completed, the returned response and error are both nil. func (op *DeleteDatasetOperation) Poll(ctx context.Context, opts ...gax.CallOption) error { return op.lro.Poll(ctx, nil, opts...) } @@ -949,11 +928,11 @@ func (c *Client) DeleteModelOperation(name string) *DeleteModelOperation { } } -// Wait blocks until the long-running operation is completed, returning any error encountered. +// Wait blocks until the long-running operation is completed, returning the response and any errors encountered. // // See documentation of Poll for error-handling information. func (op *DeleteModelOperation) Wait(ctx context.Context, opts ...gax.CallOption) error { - return op.lro.WaitWithInterval(ctx, nil, 5000*time.Millisecond, opts...) + return op.lro.WaitWithInterval(ctx, nil, time.Minute, opts...) } // Poll fetches the latest state of the long-running operation. @@ -962,7 +941,9 @@ func (op *DeleteModelOperation) Wait(ctx context.Context, opts ...gax.CallOption // // If Poll fails, the error is returned and op is unmodified. If Poll succeeds and // the operation has completed with failure, the error is returned and op.Done will return true. -// If Poll succeeds and the operation has completed successfully, op.Done will return true. +// If Poll succeeds and the operation has completed successfully, +// op.Done will return true, and the response of the operation is returned. +// If Poll succeeds and the operation has not completed, the returned response and error are both nil. func (op *DeleteModelOperation) Poll(ctx context.Context, opts ...gax.CallOption) error { return op.lro.Poll(ctx, nil, opts...) } @@ -1005,11 +986,11 @@ func (c *Client) DeployModelOperation(name string) *DeployModelOperation { } } -// Wait blocks until the long-running operation is completed, returning any error encountered. +// Wait blocks until the long-running operation is completed, returning the response and any errors encountered. // // See documentation of Poll for error-handling information. func (op *DeployModelOperation) Wait(ctx context.Context, opts ...gax.CallOption) error { - return op.lro.WaitWithInterval(ctx, nil, 5000*time.Millisecond, opts...) + return op.lro.WaitWithInterval(ctx, nil, time.Minute, opts...) } // Poll fetches the latest state of the long-running operation. @@ -1018,7 +999,9 @@ func (op *DeployModelOperation) Wait(ctx context.Context, opts ...gax.CallOption // // If Poll fails, the error is returned and op is unmodified. If Poll succeeds and // the operation has completed with failure, the error is returned and op.Done will return true. -// If Poll succeeds and the operation has completed successfully, op.Done will return true. +// If Poll succeeds and the operation has completed successfully, +// op.Done will return true, and the response of the operation is returned. +// If Poll succeeds and the operation has not completed, the returned response and error are both nil. func (op *DeployModelOperation) Poll(ctx context.Context, opts ...gax.CallOption) error { return op.lro.Poll(ctx, nil, opts...) } @@ -1061,11 +1044,11 @@ func (c *Client) ExportDataOperation(name string) *ExportDataOperation { } } -// Wait blocks until the long-running operation is completed, returning any error encountered. +// Wait blocks until the long-running operation is completed, returning the response and any errors encountered. // // See documentation of Poll for error-handling information. func (op *ExportDataOperation) Wait(ctx context.Context, opts ...gax.CallOption) error { - return op.lro.WaitWithInterval(ctx, nil, 5000*time.Millisecond, opts...) + return op.lro.WaitWithInterval(ctx, nil, time.Minute, opts...) } // Poll fetches the latest state of the long-running operation. @@ -1074,7 +1057,9 @@ func (op *ExportDataOperation) Wait(ctx context.Context, opts ...gax.CallOption) // // If Poll fails, the error is returned and op is unmodified. If Poll succeeds and // the operation has completed with failure, the error is returned and op.Done will return true. -// If Poll succeeds and the operation has completed successfully, op.Done will return true. +// If Poll succeeds and the operation has completed successfully, +// op.Done will return true, and the response of the operation is returned. +// If Poll succeeds and the operation has not completed, the returned response and error are both nil. func (op *ExportDataOperation) Poll(ctx context.Context, opts ...gax.CallOption) error { return op.lro.Poll(ctx, nil, opts...) } @@ -1117,11 +1102,11 @@ func (c *Client) ExportModelOperation(name string) *ExportModelOperation { } } -// Wait blocks until the long-running operation is completed, returning any error encountered. +// Wait blocks until the long-running operation is completed, returning the response and any errors encountered. // // See documentation of Poll for error-handling information. func (op *ExportModelOperation) Wait(ctx context.Context, opts ...gax.CallOption) error { - return op.lro.WaitWithInterval(ctx, nil, 5000*time.Millisecond, opts...) + return op.lro.WaitWithInterval(ctx, nil, time.Minute, opts...) } // Poll fetches the latest state of the long-running operation. @@ -1130,7 +1115,9 @@ func (op *ExportModelOperation) Wait(ctx context.Context, opts ...gax.CallOption // // If Poll fails, the error is returned and op is unmodified. If Poll succeeds and // the operation has completed with failure, the error is returned and op.Done will return true. -// If Poll succeeds and the operation has completed successfully, op.Done will return true. +// If Poll succeeds and the operation has completed successfully, +// op.Done will return true, and the response of the operation is returned. +// If Poll succeeds and the operation has not completed, the returned response and error are both nil. func (op *ExportModelOperation) Poll(ctx context.Context, opts ...gax.CallOption) error { return op.lro.Poll(ctx, nil, opts...) } @@ -1173,11 +1160,11 @@ func (c *Client) ImportDataOperation(name string) *ImportDataOperation { } } -// Wait blocks until the long-running operation is completed, returning any error encountered. +// Wait blocks until the long-running operation is completed, returning the response and any errors encountered. // // See documentation of Poll for error-handling information. func (op *ImportDataOperation) Wait(ctx context.Context, opts ...gax.CallOption) error { - return op.lro.WaitWithInterval(ctx, nil, 5000*time.Millisecond, opts...) + return op.lro.WaitWithInterval(ctx, nil, time.Minute, opts...) } // Poll fetches the latest state of the long-running operation. @@ -1186,7 +1173,9 @@ func (op *ImportDataOperation) Wait(ctx context.Context, opts ...gax.CallOption) // // If Poll fails, the error is returned and op is unmodified. If Poll succeeds and // the operation has completed with failure, the error is returned and op.Done will return true. -// If Poll succeeds and the operation has completed successfully, op.Done will return true. +// If Poll succeeds and the operation has completed successfully, +// op.Done will return true, and the response of the operation is returned. +// If Poll succeeds and the operation has not completed, the returned response and error are both nil. func (op *ImportDataOperation) Poll(ctx context.Context, opts ...gax.CallOption) error { return op.lro.Poll(ctx, nil, opts...) } @@ -1229,11 +1218,11 @@ func (c *Client) UndeployModelOperation(name string) *UndeployModelOperation { } } -// Wait blocks until the long-running operation is completed, returning any error encountered. +// Wait blocks until the long-running operation is completed, returning the response and any errors encountered. // // See documentation of Poll for error-handling information. func (op *UndeployModelOperation) Wait(ctx context.Context, opts ...gax.CallOption) error { - return op.lro.WaitWithInterval(ctx, nil, 5000*time.Millisecond, opts...) + return op.lro.WaitWithInterval(ctx, nil, time.Minute, opts...) } // Poll fetches the latest state of the long-running operation. @@ -1242,7 +1231,9 @@ func (op *UndeployModelOperation) Wait(ctx context.Context, opts ...gax.CallOpti // // If Poll fails, the error is returned and op is unmodified. If Poll succeeds and // the operation has completed with failure, the error is returned and op.Done will return true. -// If Poll succeeds and the operation has completed successfully, op.Done will return true. +// If Poll succeeds and the operation has completed successfully, +// op.Done will return true, and the response of the operation is returned. +// If Poll succeeds and the operation has not completed, the returned response and error are both nil. func (op *UndeployModelOperation) Poll(ctx context.Context, opts ...gax.CallOption) error { return op.lro.Poll(ctx, nil, opts...) } @@ -1271,3 +1262,144 @@ func (op *UndeployModelOperation) Done() bool { func (op *UndeployModelOperation) Name() string { return op.lro.Name() } + +// DatasetIterator manages a stream of *automlpb.Dataset. +type DatasetIterator struct { + items []*automlpb.Dataset + 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 []*automlpb.Dataset, nextPageToken string, err error) +} + +// PageInfo supports pagination. See the google.golang.org/api/iterator package for details. +func (it *DatasetIterator) 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 *DatasetIterator) Next() (*automlpb.Dataset, error) { + var item *automlpb.Dataset + if err := it.nextFunc(); err != nil { + return item, err + } + item = it.items[0] + it.items = it.items[1:] + return item, nil +} + +func (it *DatasetIterator) bufLen() int { + return len(it.items) +} + +func (it *DatasetIterator) takeBuf() interface{} { + b := it.items + it.items = nil + return b +} + +// ModelEvaluationIterator manages a stream of *automlpb.ModelEvaluation. +type ModelEvaluationIterator struct { + items []*automlpb.ModelEvaluation + 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 []*automlpb.ModelEvaluation, nextPageToken string, err error) +} + +// PageInfo supports pagination. See the google.golang.org/api/iterator package for details. +func (it *ModelEvaluationIterator) 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 *ModelEvaluationIterator) Next() (*automlpb.ModelEvaluation, error) { + var item *automlpb.ModelEvaluation + if err := it.nextFunc(); err != nil { + return item, err + } + item = it.items[0] + it.items = it.items[1:] + return item, nil +} + +func (it *ModelEvaluationIterator) bufLen() int { + return len(it.items) +} + +func (it *ModelEvaluationIterator) takeBuf() interface{} { + b := it.items + it.items = nil + return b +} + +// ModelIterator manages a stream of *automlpb.Model. +type ModelIterator struct { + items []*automlpb.Model + 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 []*automlpb.Model, nextPageToken string, err error) +} + +// PageInfo supports pagination. See the google.golang.org/api/iterator package for details. +func (it *ModelIterator) 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 *ModelIterator) Next() (*automlpb.Model, error) { + var item *automlpb.Model + if err := it.nextFunc(); err != nil { + return item, err + } + item = it.items[0] + it.items = it.items[1:] + return item, nil +} + +func (it *ModelIterator) bufLen() int { + return len(it.items) +} + +func (it *ModelIterator) takeBuf() interface{} { + b := it.items + it.items = nil + return b +} diff --git a/automl/apiv1/auto_ml_client_example_test.go b/automl/apiv1/auto_ml_client_example_test.go index 01b7d6554010..643e1d0b0ad1 100644 --- a/automl/apiv1/auto_ml_client_example_test.go +++ b/automl/apiv1/auto_ml_client_example_test.go @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC +// 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. @@ -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 automl_test @@ -35,6 +35,8 @@ func ExampleNewClient() { } func ExampleClient_CreateDataset() { + // import automlpb "google.golang.org/genproto/googleapis/cloud/automl/v1" + ctx := context.Background() c, err := automl.NewClient(ctx) if err != nil { @@ -57,25 +59,9 @@ func ExampleClient_CreateDataset() { _ = resp } -func ExampleClient_UpdateDataset() { - ctx := context.Background() - c, err := automl.NewClient(ctx) - if err != nil { - // TODO: Handle error. - } - - req := &automlpb.UpdateDatasetRequest{ - // TODO: Fill request struct fields. - } - resp, err := c.UpdateDataset(ctx, req) - if err != nil { - // TODO: Handle error. - } - // TODO: Use resp. - _ = resp -} - func ExampleClient_GetDataset() { + // import automlpb "google.golang.org/genproto/googleapis/cloud/automl/v1" + ctx := context.Background() c, err := automl.NewClient(ctx) if err != nil { @@ -94,6 +80,9 @@ func ExampleClient_GetDataset() { } func ExampleClient_ListDatasets() { + // import automlpb "google.golang.org/genproto/googleapis/cloud/automl/v1" + // import "google.golang.org/api/iterator" + ctx := context.Background() c, err := automl.NewClient(ctx) if err != nil { @@ -117,7 +106,29 @@ func ExampleClient_ListDatasets() { } } +func ExampleClient_UpdateDataset() { + // import automlpb "google.golang.org/genproto/googleapis/cloud/automl/v1" + + ctx := context.Background() + c, err := automl.NewClient(ctx) + if err != nil { + // TODO: Handle error. + } + + req := &automlpb.UpdateDatasetRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.UpdateDataset(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + func ExampleClient_DeleteDataset() { + // import automlpb "google.golang.org/genproto/googleapis/cloud/automl/v1" + ctx := context.Background() c, err := automl.NewClient(ctx) if err != nil { @@ -133,10 +144,14 @@ func ExampleClient_DeleteDataset() { } err = op.Wait(ctx) - // TODO: Handle error. + if err != nil { + // TODO: Handle error. + } } func ExampleClient_ImportData() { + // import automlpb "google.golang.org/genproto/googleapis/cloud/automl/v1" + ctx := context.Background() c, err := automl.NewClient(ctx) if err != nil { @@ -152,10 +167,14 @@ func ExampleClient_ImportData() { } err = op.Wait(ctx) - // TODO: Handle error. + if err != nil { + // TODO: Handle error. + } } func ExampleClient_ExportData() { + // import automlpb "google.golang.org/genproto/googleapis/cloud/automl/v1" + ctx := context.Background() c, err := automl.NewClient(ctx) if err != nil { @@ -171,10 +190,14 @@ func ExampleClient_ExportData() { } err = op.Wait(ctx) - // TODO: Handle error. + if err != nil { + // TODO: Handle error. + } } func ExampleClient_GetAnnotationSpec() { + // import automlpb "google.golang.org/genproto/googleapis/cloud/automl/v1" + ctx := context.Background() c, err := automl.NewClient(ctx) if err != nil { @@ -193,6 +216,8 @@ func ExampleClient_GetAnnotationSpec() { } func ExampleClient_CreateModel() { + // import automlpb "google.golang.org/genproto/googleapis/cloud/automl/v1" + ctx := context.Background() c, err := automl.NewClient(ctx) if err != nil { @@ -216,6 +241,8 @@ func ExampleClient_CreateModel() { } func ExampleClient_GetModel() { + // import automlpb "google.golang.org/genproto/googleapis/cloud/automl/v1" + ctx := context.Background() c, err := automl.NewClient(ctx) if err != nil { @@ -233,25 +260,10 @@ func ExampleClient_GetModel() { _ = resp } -func ExampleClient_UpdateModel() { - ctx := context.Background() - c, err := automl.NewClient(ctx) - if err != nil { - // TODO: Handle error. - } - - req := &automlpb.UpdateModelRequest{ - // TODO: Fill request struct fields. - } - resp, err := c.UpdateModel(ctx, req) - if err != nil { - // TODO: Handle error. - } - // TODO: Use resp. - _ = resp -} - func ExampleClient_ListModels() { + // import automlpb "google.golang.org/genproto/googleapis/cloud/automl/v1" + // import "google.golang.org/api/iterator" + ctx := context.Background() c, err := automl.NewClient(ctx) if err != nil { @@ -276,6 +288,8 @@ func ExampleClient_ListModels() { } func ExampleClient_DeleteModel() { + // import automlpb "google.golang.org/genproto/googleapis/cloud/automl/v1" + ctx := context.Background() c, err := automl.NewClient(ctx) if err != nil { @@ -291,10 +305,34 @@ func ExampleClient_DeleteModel() { } err = op.Wait(ctx) - // TODO: Handle error. + if err != nil { + // TODO: Handle error. + } +} + +func ExampleClient_UpdateModel() { + // import automlpb "google.golang.org/genproto/googleapis/cloud/automl/v1" + + ctx := context.Background() + c, err := automl.NewClient(ctx) + if err != nil { + // TODO: Handle error. + } + + req := &automlpb.UpdateModelRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.UpdateModel(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp } func ExampleClient_DeployModel() { + // import automlpb "google.golang.org/genproto/googleapis/cloud/automl/v1" + ctx := context.Background() c, err := automl.NewClient(ctx) if err != nil { @@ -310,10 +348,14 @@ func ExampleClient_DeployModel() { } err = op.Wait(ctx) - // TODO: Handle error. + if err != nil { + // TODO: Handle error. + } } func ExampleClient_UndeployModel() { + // import automlpb "google.golang.org/genproto/googleapis/cloud/automl/v1" + ctx := context.Background() c, err := automl.NewClient(ctx) if err != nil { @@ -329,10 +371,14 @@ func ExampleClient_UndeployModel() { } err = op.Wait(ctx) - // TODO: Handle error. + if err != nil { + // TODO: Handle error. + } } func ExampleClient_ExportModel() { + // import automlpb "google.golang.org/genproto/googleapis/cloud/automl/v1" + ctx := context.Background() c, err := automl.NewClient(ctx) if err != nil { @@ -348,10 +394,14 @@ func ExampleClient_ExportModel() { } err = op.Wait(ctx) - // TODO: Handle error. + if err != nil { + // TODO: Handle error. + } } func ExampleClient_GetModelEvaluation() { + // import automlpb "google.golang.org/genproto/googleapis/cloud/automl/v1" + ctx := context.Background() c, err := automl.NewClient(ctx) if err != nil { @@ -370,6 +420,9 @@ func ExampleClient_GetModelEvaluation() { } func ExampleClient_ListModelEvaluations() { + // import automlpb "google.golang.org/genproto/googleapis/cloud/automl/v1" + // import "google.golang.org/api/iterator" + ctx := context.Background() c, err := automl.NewClient(ctx) if err != nil { diff --git a/automl/apiv1/doc.go b/automl/apiv1/doc.go index 4f9017a98720..472ed10cc29e 100644 --- a/automl/apiv1/doc.go +++ b/automl/apiv1/doc.go @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC +// 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. @@ -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 automl is an auto-generated package for the // Cloud AutoML API. - // // Train high-quality custom machine learning models with minimum effort and // machine learning expertise. @@ -42,6 +41,8 @@ import ( "google.golang.org/grpc/metadata" ) +const versionClient = "20200305" + func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) out = out.Copy() @@ -75,7 +76,7 @@ func versionGo() string { } notSemverRune := func(r rune) bool { - return strings.IndexRune("0123456789.", r) < 0 + return !strings.ContainsRune("0123456789.", r) } if strings.HasPrefix(s, "go1") { @@ -96,5 +97,3 @@ func versionGo() string { } return "UNKNOWN" } - -const versionClient = "20191108" diff --git a/automl/apiv1/prediction_client.go b/automl/apiv1/prediction_client.go index 77bfe9f704a3..1f971c75a954 100644 --- a/automl/apiv1/prediction_client.go +++ b/automl/apiv1/prediction_client.go @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC +// 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. @@ -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 automl @@ -27,7 +27,7 @@ import ( lroauto "cloud.google.com/go/longrunning/autogen" gax "github.com/googleapis/gax-go/v2" "google.golang.org/api/option" - "google.golang.org/api/transport" + gtransport "google.golang.org/api/transport/grpc" automlpb "google.golang.org/genproto/googleapis/cloud/automl/v1" longrunningpb "google.golang.org/genproto/googleapis/longrunning" "google.golang.org/grpc" @@ -43,6 +43,7 @@ type PredictionCallOptions struct { func defaultPredictionClientOptions() []option.ClientOption { return []option.ClientOption{ option.WithEndpoint("automl.googleapis.com:443"), + option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithScopes(DefaultAuthScopes()...), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), @@ -50,10 +51,9 @@ func defaultPredictionClientOptions() []option.ClientOption { } func defaultPredictionCallOptions() *PredictionCallOptions { - retry := map[[2]string][]gax.CallOption{} return &PredictionCallOptions{ - Predict: retry[[2]string{"default", "non_idempotent"}], - BatchPredict: retry[[2]string{"default", "non_idempotent"}], + Predict: []gax.CallOption{}, + BatchPredict: []gax.CallOption{}, } } @@ -61,8 +61,8 @@ func defaultPredictionCallOptions() *PredictionCallOptions { // // Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls. type PredictionClient struct { - // The connection to the service. - conn *grpc.ClientConn + // Connection pool of gRPC connections to the service. + connPool gtransport.ConnPool // The gRPC API client. predictionClient automlpb.PredictionServiceClient @@ -86,40 +86,42 @@ type PredictionClient struct { // On any input that is documented to expect a string parameter in // snake_case or kebab-case, either of those cases is accepted. func NewPredictionClient(ctx context.Context, opts ...option.ClientOption) (*PredictionClient, error) { - conn, err := transport.DialGRPC(ctx, append(defaultPredictionClientOptions(), opts...)...) + connPool, err := gtransport.DialPool(ctx, append(defaultPredictionClientOptions(), opts...)...) if err != nil { return nil, err } c := &PredictionClient{ - conn: conn, + connPool: connPool, CallOptions: defaultPredictionCallOptions(), - predictionClient: automlpb.NewPredictionServiceClient(conn), + predictionClient: automlpb.NewPredictionServiceClient(connPool), } c.setGoogleClientInfo() - c.LROClient, err = lroauto.NewOperationsClient(ctx, option.WithGRPCConn(conn)) + c.LROClient, err = lroauto.NewOperationsClient(ctx, gtransport.WithConnPool(connPool)) if err != nil { - // This error "should not happen", since we are just reusing old connection + // This error "should not happen", since we are just reusing old connection pool // and never actually need to dial. - // If this does happen, we could leak conn. However, we cannot close conn: - // If the user invoked the function with option.WithGRPCConn, + // If this does happen, we could leak connp. However, we cannot close conn: + // If the user invoked the constructor with option.WithGRPCConn, // we would close a connection that's still in use. - // TODO(pongad): investigate error conditions. + // TODO: investigate error conditions. return nil, err } return c, nil } -// Connection returns the client's connection to the API service. +// Connection returns a connection to the API service. +// +// Deprecated. func (c *PredictionClient) 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 *PredictionClient) Close() error { - return c.conn.Close() + return c.connPool.Close() } // setGoogleClientInfo sets the name and version of the application in @@ -131,27 +133,9 @@ func (c *PredictionClient) setGoogleClientInfo(keyval ...string) { c.xGoogMetadata = metadata.Pairs("x-goog-api-client", gax.XGoogHeader(kv...)) } -// Predict perform an online prediction. The prediction result will be directly +// Predict perform an online prediction. The prediction result is directly // returned in the response. -// Available for following ML problems, and their expected request payloads: -// -// Image Classification - Image in .JPEG, .GIF or .PNG format, image_bytes -// up to 30MB. -// -// Image Object Detection - Image in .JPEG, .GIF or .PNG format, image_bytes -// up to 30MB. -// -// Text Classification - TextSnippet, content up to 60,000 characters, -// UTF-8 encoded. -// -// Text Extraction - TextSnippet, content up to 30,000 characters, -// UTF-8 NFC encoded. -// -// Translation - TextSnippet, content up to 25,000 characters, UTF-8 -// encoded. -// -// Text Sentiment - TextSnippet, content up 500 characters, UTF-8 -// encoded. +// Available for following ML scenarios, and their expected request payloads: func (c *PredictionClient) Predict(ctx context.Context, req *automlpb.PredictRequest, opts ...gax.CallOption) (*automlpb.PredictResponse, error) { md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))) ctx = insertMetadata(ctx, c.xGoogMetadata, md) @@ -168,21 +152,27 @@ func (c *PredictionClient) Predict(ctx context.Context, req *automlpb.PredictReq return resp, nil } -// BatchPredict perform a batch prediction. Unlike the online -// [Predict][google.cloud.automl.v1.PredictionService.Predict], batch -// prediction result won't be immediately available in the response. Instead, +// BatchPredict perform a batch prediction. Unlike the online [Predict][google.cloud.automl.v1.PredictionService.Predict], batch +// prediction result won’t be immediately available in the response. Instead, // a long running operation object is returned. User can poll the operation // result via [GetOperation][google.longrunning.Operations.GetOperation] -// method. Once the operation is done, -// [BatchPredictResult][google.cloud.automl.v1.BatchPredictResult] is returned -// in the [response][google.longrunning.Operation.response] field. Available -// for following ML problems: +// method. Once the operation is done, [BatchPredictResult][google.cloud.automl.v1.BatchPredictResult] is returned in +// the [response][google.longrunning.Operation.response] field. +// Available for following ML scenarios: +// +// AutoML Vision Classification +// +// AutoML Vision Object Detection +// +// AutoML Video Intelligence Classification +// +// AutoML Video Intelligence Object Tracking * AutoML Natural Language Classification // -// Image Classification +// AutoML Natural Language Entity Extraction // -// Image Object Detection +// AutoML Natural Language Sentiment Analysis // -// Text Extraction +// AutoML Tables func (c *PredictionClient) BatchPredict(ctx context.Context, req *automlpb.BatchPredictRequest, opts ...gax.CallOption) (*BatchPredictOperation, error) { md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))) ctx = insertMetadata(ctx, c.xGoogMetadata, md) @@ -219,7 +209,7 @@ func (c *PredictionClient) BatchPredictOperation(name string) *BatchPredictOpera // See documentation of Poll for error-handling information. func (op *BatchPredictOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*automlpb.BatchPredictResult, error) { var resp automlpb.BatchPredictResult - if err := op.lro.WaitWithInterval(ctx, &resp, 5000*time.Millisecond, opts...); err != nil { + if err := op.lro.WaitWithInterval(ctx, &resp, time.Minute, opts...); err != nil { return nil, err } return &resp, nil diff --git a/automl/apiv1/prediction_client_example_test.go b/automl/apiv1/prediction_client_example_test.go index fe443525fe15..7b27724118da 100644 --- a/automl/apiv1/prediction_client_example_test.go +++ b/automl/apiv1/prediction_client_example_test.go @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC +// 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. @@ -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 automl_test @@ -34,6 +34,8 @@ func ExampleNewPredictionClient() { } func ExamplePredictionClient_Predict() { + // import automlpb "google.golang.org/genproto/googleapis/cloud/automl/v1" + ctx := context.Background() c, err := automl.NewPredictionClient(ctx) if err != nil { @@ -52,6 +54,8 @@ func ExamplePredictionClient_Predict() { } func ExamplePredictionClient_BatchPredict() { + // import automlpb "google.golang.org/genproto/googleapis/cloud/automl/v1" + ctx := context.Background() c, err := automl.NewPredictionClient(ctx) if err != nil { diff --git a/automl/apiv1beta1/auto_ml_client.go b/automl/apiv1beta1/auto_ml_client.go index 5187b4872134..56ec7fe69470 100644 --- a/automl/apiv1beta1/auto_ml_client.go +++ b/automl/apiv1beta1/auto_ml_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 automl @@ -29,7 +29,7 @@ import ( 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" automlpb "google.golang.org/genproto/googleapis/cloud/automl/v1beta1" longrunningpb "google.golang.org/genproto/googleapis/longrunning" "google.golang.org/grpc" @@ -40,34 +40,35 @@ import ( // CallOptions contains the retry settings for each method of Client. type CallOptions struct { CreateDataset []gax.CallOption - UpdateDataset []gax.CallOption GetDataset []gax.CallOption ListDatasets []gax.CallOption + UpdateDataset []gax.CallOption DeleteDataset []gax.CallOption ImportData []gax.CallOption ExportData []gax.CallOption + GetAnnotationSpec []gax.CallOption + GetTableSpec []gax.CallOption + ListTableSpecs []gax.CallOption + UpdateTableSpec []gax.CallOption + GetColumnSpec []gax.CallOption + ListColumnSpecs []gax.CallOption + UpdateColumnSpec []gax.CallOption CreateModel []gax.CallOption GetModel []gax.CallOption ListModels []gax.CallOption DeleteModel []gax.CallOption DeployModel []gax.CallOption UndeployModel []gax.CallOption - GetModelEvaluation []gax.CallOption ExportModel []gax.CallOption ExportEvaluatedExamples []gax.CallOption + GetModelEvaluation []gax.CallOption ListModelEvaluations []gax.CallOption - GetAnnotationSpec []gax.CallOption - GetTableSpec []gax.CallOption - ListTableSpecs []gax.CallOption - UpdateTableSpec []gax.CallOption - GetColumnSpec []gax.CallOption - ListColumnSpecs []gax.CallOption - UpdateColumnSpec []gax.CallOption } func defaultClientOptions() []option.ClientOption { return []option.ClientOption{ option.WithEndpoint("automl.googleapis.com:443"), + option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithScopes(DefaultAuthScopes()...), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), @@ -75,45 +76,163 @@ func defaultClientOptions() []option.ClientOption { } func defaultCallOptions() *CallOptions { - retry := map[[2]string][]gax.CallOption{ - {"default", "idempotent"}: { + return &CallOptions{ + CreateDataset: []gax.CallOption{}, + GetDataset: []gax.CallOption{ gax.WithRetry(func() gax.Retryer { return gax.OnCodes([]codes.Code{ + codes.Unavailable, codes.DeadlineExceeded, + }, gax.Backoff{ + Initial: 100 * time.Millisecond, + Max: 60000 * time.Millisecond, + Multiplier: 1.30, + }) + }), + }, + ListDatasets: []gax.CallOption{ + gax.WithRetry(func() gax.Retryer { + return gax.OnCodes([]codes.Code{ codes.Unavailable, + codes.DeadlineExceeded, }, gax.Backoff{ Initial: 100 * time.Millisecond, Max: 60000 * time.Millisecond, - Multiplier: 1.3, + Multiplier: 1.30, }) }), }, - } - return &CallOptions{ - CreateDataset: retry[[2]string{"default", "non_idempotent"}], - UpdateDataset: retry[[2]string{"default", "non_idempotent"}], - GetDataset: retry[[2]string{"default", "idempotent"}], - ListDatasets: retry[[2]string{"default", "idempotent"}], - DeleteDataset: retry[[2]string{"default", "idempotent"}], - ImportData: retry[[2]string{"default", "non_idempotent"}], - ExportData: retry[[2]string{"default", "non_idempotent"}], - CreateModel: retry[[2]string{"default", "non_idempotent"}], - GetModel: retry[[2]string{"default", "idempotent"}], - ListModels: retry[[2]string{"default", "idempotent"}], - DeleteModel: retry[[2]string{"default", "idempotent"}], - DeployModel: retry[[2]string{"default", "non_idempotent"}], - UndeployModel: retry[[2]string{"default", "non_idempotent"}], - GetModelEvaluation: retry[[2]string{"default", "idempotent"}], - ExportModel: retry[[2]string{"default", "non_idempotent"}], - ExportEvaluatedExamples: retry[[2]string{"default", "non_idempotent"}], - ListModelEvaluations: retry[[2]string{"default", "non_idempotent"}], - GetAnnotationSpec: retry[[2]string{"default", "idempotent"}], - GetTableSpec: retry[[2]string{"default", "idempotent"}], - ListTableSpecs: retry[[2]string{"default", "idempotent"}], - UpdateTableSpec: retry[[2]string{"default", "non_idempotent"}], - GetColumnSpec: retry[[2]string{"default", "idempotent"}], - ListColumnSpecs: retry[[2]string{"default", "idempotent"}], - UpdateColumnSpec: retry[[2]string{"default", "non_idempotent"}], + UpdateDataset: []gax.CallOption{}, + DeleteDataset: []gax.CallOption{ + gax.WithRetry(func() gax.Retryer { + return gax.OnCodes([]codes.Code{ + codes.Unavailable, + codes.DeadlineExceeded, + }, gax.Backoff{ + Initial: 100 * time.Millisecond, + Max: 60000 * time.Millisecond, + Multiplier: 1.30, + }) + }), + }, + ImportData: []gax.CallOption{}, + ExportData: []gax.CallOption{}, + GetAnnotationSpec: []gax.CallOption{ + gax.WithRetry(func() gax.Retryer { + return gax.OnCodes([]codes.Code{ + codes.Unavailable, + codes.DeadlineExceeded, + }, gax.Backoff{ + Initial: 100 * time.Millisecond, + Max: 60000 * time.Millisecond, + Multiplier: 1.30, + }) + }), + }, + GetTableSpec: []gax.CallOption{ + gax.WithRetry(func() gax.Retryer { + return gax.OnCodes([]codes.Code{ + codes.Unavailable, + codes.DeadlineExceeded, + }, gax.Backoff{ + Initial: 100 * time.Millisecond, + Max: 60000 * time.Millisecond, + Multiplier: 1.30, + }) + }), + }, + ListTableSpecs: []gax.CallOption{ + gax.WithRetry(func() gax.Retryer { + return gax.OnCodes([]codes.Code{ + codes.Unavailable, + codes.DeadlineExceeded, + }, gax.Backoff{ + Initial: 100 * time.Millisecond, + Max: 60000 * time.Millisecond, + Multiplier: 1.30, + }) + }), + }, + UpdateTableSpec: []gax.CallOption{}, + GetColumnSpec: []gax.CallOption{ + gax.WithRetry(func() gax.Retryer { + return gax.OnCodes([]codes.Code{ + codes.Unavailable, + codes.DeadlineExceeded, + }, gax.Backoff{ + Initial: 100 * time.Millisecond, + Max: 60000 * time.Millisecond, + Multiplier: 1.30, + }) + }), + }, + ListColumnSpecs: []gax.CallOption{ + gax.WithRetry(func() gax.Retryer { + return gax.OnCodes([]codes.Code{ + codes.Unavailable, + codes.DeadlineExceeded, + }, gax.Backoff{ + Initial: 100 * time.Millisecond, + Max: 60000 * time.Millisecond, + Multiplier: 1.30, + }) + }), + }, + UpdateColumnSpec: []gax.CallOption{}, + CreateModel: []gax.CallOption{}, + GetModel: []gax.CallOption{ + gax.WithRetry(func() gax.Retryer { + return gax.OnCodes([]codes.Code{ + codes.Unavailable, + codes.DeadlineExceeded, + }, gax.Backoff{ + Initial: 100 * time.Millisecond, + Max: 60000 * time.Millisecond, + Multiplier: 1.30, + }) + }), + }, + ListModels: []gax.CallOption{ + gax.WithRetry(func() gax.Retryer { + return gax.OnCodes([]codes.Code{ + codes.Unavailable, + codes.DeadlineExceeded, + }, gax.Backoff{ + Initial: 100 * time.Millisecond, + Max: 60000 * time.Millisecond, + Multiplier: 1.30, + }) + }), + }, + DeleteModel: []gax.CallOption{ + gax.WithRetry(func() gax.Retryer { + return gax.OnCodes([]codes.Code{ + codes.Unavailable, + codes.DeadlineExceeded, + }, gax.Backoff{ + Initial: 100 * time.Millisecond, + Max: 60000 * time.Millisecond, + Multiplier: 1.30, + }) + }), + }, + DeployModel: []gax.CallOption{}, + UndeployModel: []gax.CallOption{}, + ExportModel: []gax.CallOption{}, + ExportEvaluatedExamples: []gax.CallOption{}, + GetModelEvaluation: []gax.CallOption{ + gax.WithRetry(func() gax.Retryer { + return gax.OnCodes([]codes.Code{ + codes.Unavailable, + codes.DeadlineExceeded, + }, gax.Backoff{ + Initial: 100 * time.Millisecond, + Max: 60000 * time.Millisecond, + Multiplier: 1.30, + }) + }), + }, + ListModelEvaluations: []gax.CallOption{}, } } @@ -121,8 +240,8 @@ func defaultCallOptions() *CallOptions { // // Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls. type Client struct { - // The connection to the service. - conn *grpc.ClientConn + // Connection pool of gRPC connections to the service. + connPool gtransport.ConnPool // The gRPC API client. client automlpb.AutoMlClient @@ -147,49 +266,51 @@ type Client struct { // The server never reuses names that it has created after the resources with // those names are deleted. // -// An ID of a resource is the last element of the item's resource name. For +// An ID of a resource is the last element of the item’s resource name. For // projects/{project_id}/locations/{location_id}/datasets/{dataset_id}, then // the id for the item is {dataset_id}. // -// Currently the only supported location_id is "us-central1". +// Currently the only supported location_id is “us-central1”. // // On any input that is documented to expect a string parameter in // snake_case or kebab-case, either of those cases is accepted. func NewClient(ctx context.Context, opts ...option.ClientOption) (*Client, error) { - conn, err := transport.DialGRPC(ctx, append(defaultClientOptions(), opts...)...) + connPool, err := gtransport.DialPool(ctx, append(defaultClientOptions(), opts...)...) if err != nil { return nil, err } c := &Client{ - conn: conn, + connPool: connPool, CallOptions: defaultCallOptions(), - client: automlpb.NewAutoMlClient(conn), + client: automlpb.NewAutoMlClient(connPool), } c.setGoogleClientInfo() - c.LROClient, err = lroauto.NewOperationsClient(ctx, option.WithGRPCConn(conn)) + c.LROClient, err = lroauto.NewOperationsClient(ctx, gtransport.WithConnPool(connPool)) if err != nil { - // This error "should not happen", since we are just reusing old connection + // This error "should not happen", since we are just reusing old connection pool // and never actually need to dial. - // If this does happen, we could leak conn. However, we cannot close conn: - // If the user invoked the function with option.WithGRPCConn, + // If this does happen, we could leak connp. However, we cannot close conn: + // If the user invoked the constructor with option.WithGRPCConn, // we would close a connection that's still in use. - // TODO(pongad): investigate error conditions. + // TODO: investigate error conditions. return nil, err } return c, nil } -// Connection returns the client's connection to the API service. +// Connection returns a connection to the API service. +// +// Deprecated. func (c *Client) 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 *Client) Close() error { - return c.conn.Close() + return c.connPool.Close() } // setGoogleClientInfo sets the name and version of the application in @@ -218,23 +339,6 @@ func (c *Client) CreateDataset(ctx context.Context, req *automlpb.CreateDatasetR return resp, nil } -// UpdateDataset updates a dataset. -func (c *Client) UpdateDataset(ctx context.Context, req *automlpb.UpdateDatasetRequest, opts ...gax.CallOption) (*automlpb.Dataset, error) { - md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "dataset.name", url.QueryEscape(req.GetDataset().GetName()))) - ctx = insertMetadata(ctx, c.xGoogMetadata, md) - opts = append(c.CallOptions.UpdateDataset[0:len(c.CallOptions.UpdateDataset):len(c.CallOptions.UpdateDataset)], opts...) - var resp *automlpb.Dataset - err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { - var err error - resp, err = c.client.UpdateDataset(ctx, req, settings.GRPC...) - return err - }, opts...) - if err != nil { - return nil, err - } - return resp, nil -} - // GetDataset gets a dataset. func (c *Client) GetDataset(ctx context.Context, req *automlpb.GetDatasetRequest, opts ...gax.CallOption) (*automlpb.Dataset, error) { md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))) @@ -275,6 +379,8 @@ func (c *Client) ListDatasets(ctx context.Context, req *automlpb.ListDatasetsReq if err != nil { return nil, "", err } + + it.Response = resp return resp.Datasets, resp.NextPageToken, nil } fetch := func(pageSize int, pageToken string) (string, error) { @@ -291,6 +397,23 @@ func (c *Client) ListDatasets(ctx context.Context, req *automlpb.ListDatasetsReq return it } +// UpdateDataset updates a dataset. +func (c *Client) UpdateDataset(ctx context.Context, req *automlpb.UpdateDatasetRequest, opts ...gax.CallOption) (*automlpb.Dataset, error) { + md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "dataset.name", url.QueryEscape(req.GetDataset().GetName()))) + ctx = insertMetadata(ctx, c.xGoogMetadata, md) + opts = append(c.CallOptions.UpdateDataset[0:len(c.CallOptions.UpdateDataset):len(c.CallOptions.UpdateDataset)], opts...) + var resp *automlpb.Dataset + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + resp, err = c.client.UpdateDataset(ctx, req, settings.GRPC...) + return err + }, opts...) + if err != nil { + return nil, err + } + return resp, nil +} + // DeleteDataset deletes a dataset and all of its contents. // Returns empty response in the // [response][google.longrunning.Operation.response] field when it completes, @@ -342,7 +465,7 @@ func (c *Client) ImportData(ctx context.Context, req *automlpb.ImportDataRequest }, nil } -// ExportData exports dataset's data to the provided output location. +// ExportData exports dataset’s data to the provided output location. // Returns an empty response in the // [response][google.longrunning.Operation.response] field when it completes. func (c *Client) ExportData(ctx context.Context, req *automlpb.ExportDataRequest, opts ...gax.CallOption) (*ExportDataOperation, error) { @@ -363,38 +486,32 @@ func (c *Client) ExportData(ctx context.Context, req *automlpb.ExportDataRequest }, nil } -// CreateModel creates a model. -// Returns a Model in the [response][google.longrunning.Operation.response] -// field when it completes. -// When you create a model, several model evaluations are created for it: -// a global evaluation, and one evaluation for each annotation spec. -func (c *Client) CreateModel(ctx context.Context, req *automlpb.CreateModelRequest, opts ...gax.CallOption) (*CreateModelOperation, error) { - md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))) +// GetAnnotationSpec gets an annotation spec. +func (c *Client) GetAnnotationSpec(ctx context.Context, req *automlpb.GetAnnotationSpecRequest, opts ...gax.CallOption) (*automlpb.AnnotationSpec, 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.CreateModel[0:len(c.CallOptions.CreateModel):len(c.CallOptions.CreateModel)], opts...) - var resp *longrunningpb.Operation + opts = append(c.CallOptions.GetAnnotationSpec[0:len(c.CallOptions.GetAnnotationSpec):len(c.CallOptions.GetAnnotationSpec)], opts...) + var resp *automlpb.AnnotationSpec err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { var err error - resp, err = c.client.CreateModel(ctx, req, settings.GRPC...) + resp, err = c.client.GetAnnotationSpec(ctx, req, settings.GRPC...) return err }, opts...) if err != nil { return nil, err } - return &CreateModelOperation{ - lro: longrunning.InternalNewOperation(c.LROClient, resp), - }, nil + return resp, nil } -// GetModel gets a model. -func (c *Client) GetModel(ctx context.Context, req *automlpb.GetModelRequest, opts ...gax.CallOption) (*automlpb.Model, error) { +// GetTableSpec gets a table spec. +func (c *Client) GetTableSpec(ctx context.Context, req *automlpb.GetTableSpecRequest, opts ...gax.CallOption) (*automlpb.TableSpec, 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.GetModel[0:len(c.CallOptions.GetModel):len(c.CallOptions.GetModel)], opts...) - var resp *automlpb.Model + opts = append(c.CallOptions.GetTableSpec[0:len(c.CallOptions.GetTableSpec):len(c.CallOptions.GetTableSpec)], opts...) + var resp *automlpb.TableSpec err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { var err error - resp, err = c.client.GetModel(ctx, req, settings.GRPC...) + resp, err = c.client.GetTableSpec(ctx, req, settings.GRPC...) return err }, opts...) if err != nil { @@ -403,15 +520,15 @@ func (c *Client) GetModel(ctx context.Context, req *automlpb.GetModelRequest, op return resp, nil } -// ListModels lists models. -func (c *Client) ListModels(ctx context.Context, req *automlpb.ListModelsRequest, opts ...gax.CallOption) *ModelIterator { +// ListTableSpecs lists table specs in a dataset. +func (c *Client) ListTableSpecs(ctx context.Context, req *automlpb.ListTableSpecsRequest, opts ...gax.CallOption) *TableSpecIterator { 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.ListModels[0:len(c.CallOptions.ListModels):len(c.CallOptions.ListModels)], opts...) - it := &ModelIterator{} - req = proto.Clone(req).(*automlpb.ListModelsRequest) - it.InternalFetch = func(pageSize int, pageToken string) ([]*automlpb.Model, string, error) { - var resp *automlpb.ListModelsResponse + opts = append(c.CallOptions.ListTableSpecs[0:len(c.CallOptions.ListTableSpecs):len(c.CallOptions.ListTableSpecs)], opts...) + it := &TableSpecIterator{} + req = proto.Clone(req).(*automlpb.ListTableSpecsRequest) + it.InternalFetch = func(pageSize int, pageToken string) ([]*automlpb.TableSpec, string, error) { + var resp *automlpb.ListTableSpecsResponse req.PageToken = pageToken if pageSize > math.MaxInt32 { req.PageSize = math.MaxInt32 @@ -420,13 +537,15 @@ func (c *Client) ListModels(ctx context.Context, req *automlpb.ListModelsRequest } err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { var err error - resp, err = c.client.ListModels(ctx, req, settings.GRPC...) + resp, err = c.client.ListTableSpecs(ctx, req, settings.GRPC...) return err }, opts...) if err != nil { return nil, "", err } - return resp.Model, resp.NextPageToken, nil + + it.Response = resp + return resp.TableSpecs, resp.NextPageToken, nil } fetch := func(pageSize int, pageToken string) (string, error) { items, nextPageToken, err := it.InternalFetch(pageSize, pageToken) @@ -442,102 +561,258 @@ func (c *Client) ListModels(ctx context.Context, req *automlpb.ListModelsRequest return it } -// DeleteModel deletes a model. -// Returns google.protobuf.Empty in the -// [response][google.longrunning.Operation.response] field when it completes, -// and delete_details in the -// [metadata][google.longrunning.Operation.metadata] field. -func (c *Client) DeleteModel(ctx context.Context, req *automlpb.DeleteModelRequest, opts ...gax.CallOption) (*DeleteModelOperation, error) { - md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))) +// UpdateTableSpec updates a table spec. +func (c *Client) UpdateTableSpec(ctx context.Context, req *automlpb.UpdateTableSpecRequest, opts ...gax.CallOption) (*automlpb.TableSpec, error) { + md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "table_spec.name", url.QueryEscape(req.GetTableSpec().GetName()))) ctx = insertMetadata(ctx, c.xGoogMetadata, md) - opts = append(c.CallOptions.DeleteModel[0:len(c.CallOptions.DeleteModel):len(c.CallOptions.DeleteModel)], opts...) - var resp *longrunningpb.Operation + opts = append(c.CallOptions.UpdateTableSpec[0:len(c.CallOptions.UpdateTableSpec):len(c.CallOptions.UpdateTableSpec)], opts...) + var resp *automlpb.TableSpec err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { var err error - resp, err = c.client.DeleteModel(ctx, req, settings.GRPC...) + resp, err = c.client.UpdateTableSpec(ctx, req, settings.GRPC...) return err }, opts...) if err != nil { return nil, err } - return &DeleteModelOperation{ - lro: longrunning.InternalNewOperation(c.LROClient, resp), - }, nil + return resp, nil } -// DeployModel deploys a model. If a model is already deployed, deploying it with the -// same parameters has no effect. Deploying with different parametrs -// (as e.g. changing -// -// [node_number][google.cloud.automl.v1beta1.ImageObjectDetectionModelDeploymentMetadata.node_number]) -// will reset the deployment state without pausing the model's availability. -// -// Only applicable for Text Classification, Image Object Detection , Tables, and Image Segmentation; all other domains manage -// deployment automatically. -// -// Returns an empty response in the -// [response][google.longrunning.Operation.response] field when it completes. -func (c *Client) DeployModel(ctx context.Context, req *automlpb.DeployModelRequest, opts ...gax.CallOption) (*DeployModelOperation, error) { +// GetColumnSpec gets a column spec. +func (c *Client) GetColumnSpec(ctx context.Context, req *automlpb.GetColumnSpecRequest, opts ...gax.CallOption) (*automlpb.ColumnSpec, 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.DeployModel[0:len(c.CallOptions.DeployModel):len(c.CallOptions.DeployModel)], opts...) - var resp *longrunningpb.Operation + opts = append(c.CallOptions.GetColumnSpec[0:len(c.CallOptions.GetColumnSpec):len(c.CallOptions.GetColumnSpec)], opts...) + var resp *automlpb.ColumnSpec err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { var err error - resp, err = c.client.DeployModel(ctx, req, settings.GRPC...) + resp, err = c.client.GetColumnSpec(ctx, req, settings.GRPC...) return err }, opts...) if err != nil { return nil, err } - return &DeployModelOperation{ + return resp, nil +} + +// ListColumnSpecs lists column specs in a table spec. +func (c *Client) ListColumnSpecs(ctx context.Context, req *automlpb.ListColumnSpecsRequest, opts ...gax.CallOption) *ColumnSpecIterator { + 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.ListColumnSpecs[0:len(c.CallOptions.ListColumnSpecs):len(c.CallOptions.ListColumnSpecs)], opts...) + it := &ColumnSpecIterator{} + req = proto.Clone(req).(*automlpb.ListColumnSpecsRequest) + it.InternalFetch = func(pageSize int, pageToken string) ([]*automlpb.ColumnSpec, string, error) { + var resp *automlpb.ListColumnSpecsResponse + 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.ListColumnSpecs(ctx, req, settings.GRPC...) + return err + }, opts...) + if err != nil { + return nil, "", err + } + + it.Response = resp + return resp.ColumnSpecs, 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 +} + +// UpdateColumnSpec updates a column spec. +func (c *Client) UpdateColumnSpec(ctx context.Context, req *automlpb.UpdateColumnSpecRequest, opts ...gax.CallOption) (*automlpb.ColumnSpec, error) { + md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "column_spec.name", url.QueryEscape(req.GetColumnSpec().GetName()))) + ctx = insertMetadata(ctx, c.xGoogMetadata, md) + opts = append(c.CallOptions.UpdateColumnSpec[0:len(c.CallOptions.UpdateColumnSpec):len(c.CallOptions.UpdateColumnSpec)], opts...) + var resp *automlpb.ColumnSpec + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + resp, err = c.client.UpdateColumnSpec(ctx, req, settings.GRPC...) + return err + }, opts...) + if err != nil { + return nil, err + } + return resp, nil +} + +// CreateModel creates a model. +// Returns a Model in the [response][google.longrunning.Operation.response] +// field when it completes. +// When you create a model, several model evaluations are created for it: +// a global evaluation, and one evaluation for each annotation spec. +func (c *Client) CreateModel(ctx context.Context, req *automlpb.CreateModelRequest, opts ...gax.CallOption) (*CreateModelOperation, 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.CreateModel[0:len(c.CallOptions.CreateModel):len(c.CallOptions.CreateModel)], opts...) + var resp *longrunningpb.Operation + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + resp, err = c.client.CreateModel(ctx, req, settings.GRPC...) + return err + }, opts...) + if err != nil { + return nil, err + } + return &CreateModelOperation{ lro: longrunning.InternalNewOperation(c.LROClient, resp), }, nil } -// UndeployModel undeploys a model. If the model is not deployed this method has no effect. +// GetModel gets a model. +func (c *Client) GetModel(ctx context.Context, req *automlpb.GetModelRequest, opts ...gax.CallOption) (*automlpb.Model, 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.GetModel[0:len(c.CallOptions.GetModel):len(c.CallOptions.GetModel)], opts...) + var resp *automlpb.Model + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + resp, err = c.client.GetModel(ctx, req, settings.GRPC...) + return err + }, opts...) + if err != nil { + return nil, err + } + return resp, nil +} + +// ListModels lists models. +func (c *Client) ListModels(ctx context.Context, req *automlpb.ListModelsRequest, opts ...gax.CallOption) *ModelIterator { + 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.ListModels[0:len(c.CallOptions.ListModels):len(c.CallOptions.ListModels)], opts...) + it := &ModelIterator{} + req = proto.Clone(req).(*automlpb.ListModelsRequest) + it.InternalFetch = func(pageSize int, pageToken string) ([]*automlpb.Model, string, error) { + var resp *automlpb.ListModelsResponse + 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.ListModels(ctx, req, settings.GRPC...) + return err + }, opts...) + if err != nil { + return nil, "", err + } + + it.Response = resp + return resp.Model, 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 +} + +// DeleteModel deletes a model. +// Returns google.protobuf.Empty in the +// [response][google.longrunning.Operation.response] field when it completes, +// and delete_details in the +// [metadata][google.longrunning.Operation.metadata] field. +func (c *Client) DeleteModel(ctx context.Context, req *automlpb.DeleteModelRequest, opts ...gax.CallOption) (*DeleteModelOperation, 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.DeleteModel[0:len(c.CallOptions.DeleteModel):len(c.CallOptions.DeleteModel)], opts...) + var resp *longrunningpb.Operation + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + resp, err = c.client.DeleteModel(ctx, req, settings.GRPC...) + return err + }, opts...) + if err != nil { + return nil, err + } + return &DeleteModelOperation{ + lro: longrunning.InternalNewOperation(c.LROClient, resp), + }, nil +} + +// DeployModel deploys a model. If a model is already deployed, deploying it with the +// same parameters has no effect. Deploying with different parametrs +// (as e.g. changing // -// Only applicable for Text Classification, Image Object Detection and Tables; -// all other domains manage deployment automatically. +// [node_number][google.cloud.automl.v1beta1.ImageObjectDetectionModelDeploymentMetadata.node_number]) +// will reset the deployment state without pausing the model’s availability. +// +// Only applicable for Text Classification, Image Object Detection , Tables, and Image Segmentation; all other domains manage +// deployment automatically. // // Returns an empty response in the // [response][google.longrunning.Operation.response] field when it completes. -func (c *Client) UndeployModel(ctx context.Context, req *automlpb.UndeployModelRequest, opts ...gax.CallOption) (*UndeployModelOperation, error) { +func (c *Client) DeployModel(ctx context.Context, req *automlpb.DeployModelRequest, opts ...gax.CallOption) (*DeployModelOperation, 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.UndeployModel[0:len(c.CallOptions.UndeployModel):len(c.CallOptions.UndeployModel)], opts...) + opts = append(c.CallOptions.DeployModel[0:len(c.CallOptions.DeployModel):len(c.CallOptions.DeployModel)], opts...) var resp *longrunningpb.Operation err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { var err error - resp, err = c.client.UndeployModel(ctx, req, settings.GRPC...) + resp, err = c.client.DeployModel(ctx, req, settings.GRPC...) return err }, opts...) if err != nil { return nil, err } - return &UndeployModelOperation{ + return &DeployModelOperation{ lro: longrunning.InternalNewOperation(c.LROClient, resp), }, nil } -// GetModelEvaluation gets a model evaluation. -func (c *Client) GetModelEvaluation(ctx context.Context, req *automlpb.GetModelEvaluationRequest, opts ...gax.CallOption) (*automlpb.ModelEvaluation, error) { +// UndeployModel undeploys a model. If the model is not deployed this method has no effect. +// +// Only applicable for Text Classification, Image Object Detection and Tables; +// all other domains manage deployment automatically. +// +// Returns an empty response in the +// [response][google.longrunning.Operation.response] field when it completes. +func (c *Client) UndeployModel(ctx context.Context, req *automlpb.UndeployModelRequest, opts ...gax.CallOption) (*UndeployModelOperation, 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.GetModelEvaluation[0:len(c.CallOptions.GetModelEvaluation):len(c.CallOptions.GetModelEvaluation)], opts...) - var resp *automlpb.ModelEvaluation + opts = append(c.CallOptions.UndeployModel[0:len(c.CallOptions.UndeployModel):len(c.CallOptions.UndeployModel)], opts...) + var resp *longrunningpb.Operation err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { var err error - resp, err = c.client.GetModelEvaluation(ctx, req, settings.GRPC...) + resp, err = c.client.UndeployModel(ctx, req, settings.GRPC...) return err }, opts...) if err != nil { return nil, err } - return resp, nil + return &UndeployModelOperation{ + lro: longrunning.InternalNewOperation(c.LROClient, resp), + }, nil } -// ExportModel exports a trained, "export-able", model to a user specified Google Cloud +// ExportModel exports a trained, “export-able”, model to a user specified Google Cloud // Storage location. A model is considered export-able if and only if it has // an export format defined for it in // @@ -595,6 +870,23 @@ func (c *Client) ExportEvaluatedExamples(ctx context.Context, req *automlpb.Expo }, nil } +// GetModelEvaluation gets a model evaluation. +func (c *Client) GetModelEvaluation(ctx context.Context, req *automlpb.GetModelEvaluationRequest, opts ...gax.CallOption) (*automlpb.ModelEvaluation, 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.GetModelEvaluation[0:len(c.CallOptions.GetModelEvaluation):len(c.CallOptions.GetModelEvaluation)], opts...) + var resp *automlpb.ModelEvaluation + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + resp, err = c.client.GetModelEvaluation(ctx, req, settings.GRPC...) + return err + }, opts...) + if err != nil { + return nil, err + } + return resp, nil +} + // ListModelEvaluations lists model evaluations. func (c *Client) ListModelEvaluations(ctx context.Context, req *automlpb.ListModelEvaluationsRequest, opts ...gax.CallOption) *ModelEvaluationIterator { md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))) @@ -618,393 +910,22 @@ func (c *Client) ListModelEvaluations(ctx context.Context, req *automlpb.ListMod if err != nil { return nil, "", err } + + it.Response = resp return resp.ModelEvaluation, 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 -} - -// GetAnnotationSpec gets an annotation spec. -func (c *Client) GetAnnotationSpec(ctx context.Context, req *automlpb.GetAnnotationSpecRequest, opts ...gax.CallOption) (*automlpb.AnnotationSpec, 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.GetAnnotationSpec[0:len(c.CallOptions.GetAnnotationSpec):len(c.CallOptions.GetAnnotationSpec)], opts...) - var resp *automlpb.AnnotationSpec - err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { - var err error - resp, err = c.client.GetAnnotationSpec(ctx, req, settings.GRPC...) - return err - }, opts...) - if err != nil { - return nil, err - } - return resp, nil -} - -// GetTableSpec gets a table spec. -func (c *Client) GetTableSpec(ctx context.Context, req *automlpb.GetTableSpecRequest, opts ...gax.CallOption) (*automlpb.TableSpec, 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.GetTableSpec[0:len(c.CallOptions.GetTableSpec):len(c.CallOptions.GetTableSpec)], opts...) - var resp *automlpb.TableSpec - err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { - var err error - resp, err = c.client.GetTableSpec(ctx, req, settings.GRPC...) - return err - }, opts...) - if err != nil { - return nil, err - } - return resp, nil -} - -// ListTableSpecs lists table specs in a dataset. -func (c *Client) ListTableSpecs(ctx context.Context, req *automlpb.ListTableSpecsRequest, opts ...gax.CallOption) *TableSpecIterator { - 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.ListTableSpecs[0:len(c.CallOptions.ListTableSpecs):len(c.CallOptions.ListTableSpecs)], opts...) - it := &TableSpecIterator{} - req = proto.Clone(req).(*automlpb.ListTableSpecsRequest) - it.InternalFetch = func(pageSize int, pageToken string) ([]*automlpb.TableSpec, string, error) { - var resp *automlpb.ListTableSpecsResponse - 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.ListTableSpecs(ctx, req, settings.GRPC...) - return err - }, opts...) - if err != nil { - return nil, "", err - } - return resp.TableSpecs, 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 -} - -// UpdateTableSpec updates a table spec. -func (c *Client) UpdateTableSpec(ctx context.Context, req *automlpb.UpdateTableSpecRequest, opts ...gax.CallOption) (*automlpb.TableSpec, error) { - md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "table_spec.name", url.QueryEscape(req.GetTableSpec().GetName()))) - ctx = insertMetadata(ctx, c.xGoogMetadata, md) - opts = append(c.CallOptions.UpdateTableSpec[0:len(c.CallOptions.UpdateTableSpec):len(c.CallOptions.UpdateTableSpec)], opts...) - var resp *automlpb.TableSpec - err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { - var err error - resp, err = c.client.UpdateTableSpec(ctx, req, settings.GRPC...) - return err - }, opts...) - if err != nil { - return nil, err - } - return resp, nil -} - -// GetColumnSpec gets a column spec. -func (c *Client) GetColumnSpec(ctx context.Context, req *automlpb.GetColumnSpecRequest, opts ...gax.CallOption) (*automlpb.ColumnSpec, 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.GetColumnSpec[0:len(c.CallOptions.GetColumnSpec):len(c.CallOptions.GetColumnSpec)], opts...) - var resp *automlpb.ColumnSpec - err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { - var err error - resp, err = c.client.GetColumnSpec(ctx, req, settings.GRPC...) - return err - }, opts...) - if err != nil { - return nil, err - } - return resp, nil -} - -// ListColumnSpecs lists column specs in a table spec. -func (c *Client) ListColumnSpecs(ctx context.Context, req *automlpb.ListColumnSpecsRequest, opts ...gax.CallOption) *ColumnSpecIterator { - 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.ListColumnSpecs[0:len(c.CallOptions.ListColumnSpecs):len(c.CallOptions.ListColumnSpecs)], opts...) - it := &ColumnSpecIterator{} - req = proto.Clone(req).(*automlpb.ListColumnSpecsRequest) - it.InternalFetch = func(pageSize int, pageToken string) ([]*automlpb.ColumnSpec, string, error) { - var resp *automlpb.ListColumnSpecsResponse - 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.ListColumnSpecs(ctx, req, settings.GRPC...) - return err - }, opts...) - if err != nil { - return nil, "", err - } - return resp.ColumnSpecs, 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 -} - -// UpdateColumnSpec updates a column spec. -func (c *Client) UpdateColumnSpec(ctx context.Context, req *automlpb.UpdateColumnSpecRequest, opts ...gax.CallOption) (*automlpb.ColumnSpec, error) { - md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "column_spec.name", url.QueryEscape(req.GetColumnSpec().GetName()))) - ctx = insertMetadata(ctx, c.xGoogMetadata, md) - opts = append(c.CallOptions.UpdateColumnSpec[0:len(c.CallOptions.UpdateColumnSpec):len(c.CallOptions.UpdateColumnSpec)], opts...) - var resp *automlpb.ColumnSpec - err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { - var err error - resp, err = c.client.UpdateColumnSpec(ctx, req, settings.GRPC...) - return err - }, opts...) - if err != nil { - return nil, err - } - return resp, nil -} - -// ColumnSpecIterator manages a stream of *automlpb.ColumnSpec. -type ColumnSpecIterator struct { - items []*automlpb.ColumnSpec - pageInfo *iterator.PageInfo - nextFunc func() error - - // InternalFetch is for use by the Google Cloud Libraries only. - // It is not part of the stable interface of this package. - // - // InternalFetch returns results from a single call to the underlying RPC. - // The number of results is no greater than pageSize. - // If there are no more results, nextPageToken is empty and err is nil. - InternalFetch func(pageSize int, pageToken string) (results []*automlpb.ColumnSpec, nextPageToken string, err error) -} - -// PageInfo supports pagination. See the google.golang.org/api/iterator package for details. -func (it *ColumnSpecIterator) 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 *ColumnSpecIterator) Next() (*automlpb.ColumnSpec, error) { - var item *automlpb.ColumnSpec - if err := it.nextFunc(); err != nil { - return item, err - } - item = it.items[0] - it.items = it.items[1:] - return item, nil -} - -func (it *ColumnSpecIterator) bufLen() int { - return len(it.items) -} - -func (it *ColumnSpecIterator) takeBuf() interface{} { - b := it.items - it.items = nil - return b -} - -// DatasetIterator manages a stream of *automlpb.Dataset. -type DatasetIterator struct { - items []*automlpb.Dataset - pageInfo *iterator.PageInfo - nextFunc func() error - - // InternalFetch is for use by the Google Cloud Libraries only. - // It is not part of the stable interface of this package. - // - // InternalFetch returns results from a single call to the underlying RPC. - // The number of results is no greater than pageSize. - // If there are no more results, nextPageToken is empty and err is nil. - InternalFetch func(pageSize int, pageToken string) (results []*automlpb.Dataset, nextPageToken string, err error) -} - -// PageInfo supports pagination. See the google.golang.org/api/iterator package for details. -func (it *DatasetIterator) 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 *DatasetIterator) Next() (*automlpb.Dataset, error) { - var item *automlpb.Dataset - if err := it.nextFunc(); err != nil { - return item, err - } - item = it.items[0] - it.items = it.items[1:] - return item, nil -} - -func (it *DatasetIterator) bufLen() int { - return len(it.items) -} - -func (it *DatasetIterator) takeBuf() interface{} { - b := it.items - it.items = nil - return b -} - -// ModelEvaluationIterator manages a stream of *automlpb.ModelEvaluation. -type ModelEvaluationIterator struct { - items []*automlpb.ModelEvaluation - pageInfo *iterator.PageInfo - nextFunc func() error - - // InternalFetch is for use by the Google Cloud Libraries only. - // It is not part of the stable interface of this package. - // - // InternalFetch returns results from a single call to the underlying RPC. - // The number of results is no greater than pageSize. - // If there are no more results, nextPageToken is empty and err is nil. - InternalFetch func(pageSize int, pageToken string) (results []*automlpb.ModelEvaluation, nextPageToken string, err error) -} - -// PageInfo supports pagination. See the google.golang.org/api/iterator package for details. -func (it *ModelEvaluationIterator) 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 *ModelEvaluationIterator) Next() (*automlpb.ModelEvaluation, error) { - var item *automlpb.ModelEvaluation - if err := it.nextFunc(); err != nil { - return item, err - } - item = it.items[0] - it.items = it.items[1:] - return item, nil -} - -func (it *ModelEvaluationIterator) bufLen() int { - return len(it.items) -} - -func (it *ModelEvaluationIterator) takeBuf() interface{} { - b := it.items - it.items = nil - return b -} - -// ModelIterator manages a stream of *automlpb.Model. -type ModelIterator struct { - items []*automlpb.Model - pageInfo *iterator.PageInfo - nextFunc func() error - - // InternalFetch is for use by the Google Cloud Libraries only. - // It is not part of the stable interface of this package. - // - // InternalFetch returns results from a single call to the underlying RPC. - // The number of results is no greater than pageSize. - // If there are no more results, nextPageToken is empty and err is nil. - InternalFetch func(pageSize int, pageToken string) (results []*automlpb.Model, nextPageToken string, err error) -} - -// PageInfo supports pagination. See the google.golang.org/api/iterator package for details. -func (it *ModelIterator) 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 *ModelIterator) Next() (*automlpb.Model, error) { - var item *automlpb.Model - if err := it.nextFunc(); err != nil { - return item, err - } - item = it.items[0] - it.items = it.items[1:] - return item, nil -} - -func (it *ModelIterator) bufLen() int { - return len(it.items) -} - -func (it *ModelIterator) takeBuf() interface{} { - b := it.items - it.items = nil - return b -} - -// TableSpecIterator manages a stream of *automlpb.TableSpec. -type TableSpecIterator struct { - items []*automlpb.TableSpec - pageInfo *iterator.PageInfo - nextFunc func() error - - // InternalFetch is for use by the Google Cloud Libraries only. - // It is not part of the stable interface of this package. - // - // InternalFetch returns results from a single call to the underlying RPC. - // The number of results is no greater than pageSize. - // If there are no more results, nextPageToken is empty and err is nil. - InternalFetch func(pageSize int, pageToken string) (results []*automlpb.TableSpec, nextPageToken string, err error) -} - -// PageInfo supports pagination. See the google.golang.org/api/iterator package for details. -func (it *TableSpecIterator) 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 *TableSpecIterator) Next() (*automlpb.TableSpec, error) { - var item *automlpb.TableSpec - if err := it.nextFunc(); err != nil { - return item, err - } - item = it.items[0] - it.items = it.items[1:] - return item, nil -} - -func (it *TableSpecIterator) bufLen() int { - return len(it.items) -} - -func (it *TableSpecIterator) takeBuf() interface{} { - b := it.items - it.items = nil - return b + 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 } // CreateModelOperation manages a long-running operation from CreateModel. @@ -1025,7 +946,7 @@ func (c *Client) CreateModelOperation(name string) *CreateModelOperation { // See documentation of Poll for error-handling information. func (op *CreateModelOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*automlpb.Model, error) { var resp automlpb.Model - if err := op.lro.WaitWithInterval(ctx, &resp, 5000*time.Millisecond, opts...); err != nil { + if err := op.lro.WaitWithInterval(ctx, &resp, time.Minute, opts...); err != nil { return nil, err } return &resp, nil @@ -1089,11 +1010,11 @@ func (c *Client) DeleteDatasetOperation(name string) *DeleteDatasetOperation { } } -// Wait blocks until the long-running operation is completed, returning any error encountered. +// Wait blocks until the long-running operation is completed, returning the response and any errors encountered. // // See documentation of Poll for error-handling information. func (op *DeleteDatasetOperation) Wait(ctx context.Context, opts ...gax.CallOption) error { - return op.lro.WaitWithInterval(ctx, nil, 5000*time.Millisecond, opts...) + return op.lro.WaitWithInterval(ctx, nil, time.Minute, opts...) } // Poll fetches the latest state of the long-running operation. @@ -1102,7 +1023,9 @@ func (op *DeleteDatasetOperation) Wait(ctx context.Context, opts ...gax.CallOpti // // If Poll fails, the error is returned and op is unmodified. If Poll succeeds and // the operation has completed with failure, the error is returned and op.Done will return true. -// If Poll succeeds and the operation has completed successfully, op.Done will return true. +// If Poll succeeds and the operation has completed successfully, +// op.Done will return true, and the response of the operation is returned. +// If Poll succeeds and the operation has not completed, the returned response and error are both nil. func (op *DeleteDatasetOperation) Poll(ctx context.Context, opts ...gax.CallOption) error { return op.lro.Poll(ctx, nil, opts...) } @@ -1145,11 +1068,11 @@ func (c *Client) DeleteModelOperation(name string) *DeleteModelOperation { } } -// Wait blocks until the long-running operation is completed, returning any error encountered. +// Wait blocks until the long-running operation is completed, returning the response and any errors encountered. // // See documentation of Poll for error-handling information. func (op *DeleteModelOperation) Wait(ctx context.Context, opts ...gax.CallOption) error { - return op.lro.WaitWithInterval(ctx, nil, 5000*time.Millisecond, opts...) + return op.lro.WaitWithInterval(ctx, nil, time.Minute, opts...) } // Poll fetches the latest state of the long-running operation. @@ -1158,7 +1081,9 @@ func (op *DeleteModelOperation) Wait(ctx context.Context, opts ...gax.CallOption // // If Poll fails, the error is returned and op is unmodified. If Poll succeeds and // the operation has completed with failure, the error is returned and op.Done will return true. -// If Poll succeeds and the operation has completed successfully, op.Done will return true. +// If Poll succeeds and the operation has completed successfully, +// op.Done will return true, and the response of the operation is returned. +// If Poll succeeds and the operation has not completed, the returned response and error are both nil. func (op *DeleteModelOperation) Poll(ctx context.Context, opts ...gax.CallOption) error { return op.lro.Poll(ctx, nil, opts...) } @@ -1201,11 +1126,11 @@ func (c *Client) DeployModelOperation(name string) *DeployModelOperation { } } -// Wait blocks until the long-running operation is completed, returning any error encountered. +// Wait blocks until the long-running operation is completed, returning the response and any errors encountered. // // See documentation of Poll for error-handling information. func (op *DeployModelOperation) Wait(ctx context.Context, opts ...gax.CallOption) error { - return op.lro.WaitWithInterval(ctx, nil, 5000*time.Millisecond, opts...) + return op.lro.WaitWithInterval(ctx, nil, time.Minute, opts...) } // Poll fetches the latest state of the long-running operation. @@ -1214,7 +1139,9 @@ func (op *DeployModelOperation) Wait(ctx context.Context, opts ...gax.CallOption // // If Poll fails, the error is returned and op is unmodified. If Poll succeeds and // the operation has completed with failure, the error is returned and op.Done will return true. -// If Poll succeeds and the operation has completed successfully, op.Done will return true. +// If Poll succeeds and the operation has completed successfully, +// op.Done will return true, and the response of the operation is returned. +// If Poll succeeds and the operation has not completed, the returned response and error are both nil. func (op *DeployModelOperation) Poll(ctx context.Context, opts ...gax.CallOption) error { return op.lro.Poll(ctx, nil, opts...) } @@ -1257,11 +1184,11 @@ func (c *Client) ExportDataOperation(name string) *ExportDataOperation { } } -// Wait blocks until the long-running operation is completed, returning any error encountered. +// Wait blocks until the long-running operation is completed, returning the response and any errors encountered. // // See documentation of Poll for error-handling information. func (op *ExportDataOperation) Wait(ctx context.Context, opts ...gax.CallOption) error { - return op.lro.WaitWithInterval(ctx, nil, 5000*time.Millisecond, opts...) + return op.lro.WaitWithInterval(ctx, nil, time.Minute, opts...) } // Poll fetches the latest state of the long-running operation. @@ -1270,7 +1197,9 @@ func (op *ExportDataOperation) Wait(ctx context.Context, opts ...gax.CallOption) // // If Poll fails, the error is returned and op is unmodified. If Poll succeeds and // the operation has completed with failure, the error is returned and op.Done will return true. -// If Poll succeeds and the operation has completed successfully, op.Done will return true. +// If Poll succeeds and the operation has completed successfully, +// op.Done will return true, and the response of the operation is returned. +// If Poll succeeds and the operation has not completed, the returned response and error are both nil. func (op *ExportDataOperation) Poll(ctx context.Context, opts ...gax.CallOption) error { return op.lro.Poll(ctx, nil, opts...) } @@ -1313,11 +1242,11 @@ func (c *Client) ExportEvaluatedExamplesOperation(name string) *ExportEvaluatedE } } -// Wait blocks until the long-running operation is completed, returning any error encountered. +// Wait blocks until the long-running operation is completed, returning the response and any errors encountered. // // See documentation of Poll for error-handling information. func (op *ExportEvaluatedExamplesOperation) Wait(ctx context.Context, opts ...gax.CallOption) error { - return op.lro.WaitWithInterval(ctx, nil, 5000*time.Millisecond, opts...) + return op.lro.WaitWithInterval(ctx, nil, time.Minute, opts...) } // Poll fetches the latest state of the long-running operation. @@ -1326,7 +1255,9 @@ func (op *ExportEvaluatedExamplesOperation) Wait(ctx context.Context, opts ...ga // // If Poll fails, the error is returned and op is unmodified. If Poll succeeds and // the operation has completed with failure, the error is returned and op.Done will return true. -// If Poll succeeds and the operation has completed successfully, op.Done will return true. +// If Poll succeeds and the operation has completed successfully, +// op.Done will return true, and the response of the operation is returned. +// If Poll succeeds and the operation has not completed, the returned response and error are both nil. func (op *ExportEvaluatedExamplesOperation) Poll(ctx context.Context, opts ...gax.CallOption) error { return op.lro.Poll(ctx, nil, opts...) } @@ -1369,11 +1300,11 @@ func (c *Client) ExportModelOperation(name string) *ExportModelOperation { } } -// Wait blocks until the long-running operation is completed, returning any error encountered. +// Wait blocks until the long-running operation is completed, returning the response and any errors encountered. // // See documentation of Poll for error-handling information. func (op *ExportModelOperation) Wait(ctx context.Context, opts ...gax.CallOption) error { - return op.lro.WaitWithInterval(ctx, nil, 5000*time.Millisecond, opts...) + return op.lro.WaitWithInterval(ctx, nil, time.Minute, opts...) } // Poll fetches the latest state of the long-running operation. @@ -1382,7 +1313,9 @@ func (op *ExportModelOperation) Wait(ctx context.Context, opts ...gax.CallOption // // If Poll fails, the error is returned and op is unmodified. If Poll succeeds and // the operation has completed with failure, the error is returned and op.Done will return true. -// If Poll succeeds and the operation has completed successfully, op.Done will return true. +// If Poll succeeds and the operation has completed successfully, +// op.Done will return true, and the response of the operation is returned. +// If Poll succeeds and the operation has not completed, the returned response and error are both nil. func (op *ExportModelOperation) Poll(ctx context.Context, opts ...gax.CallOption) error { return op.lro.Poll(ctx, nil, opts...) } @@ -1425,11 +1358,11 @@ func (c *Client) ImportDataOperation(name string) *ImportDataOperation { } } -// Wait blocks until the long-running operation is completed, returning any error encountered. +// Wait blocks until the long-running operation is completed, returning the response and any errors encountered. // // See documentation of Poll for error-handling information. func (op *ImportDataOperation) Wait(ctx context.Context, opts ...gax.CallOption) error { - return op.lro.WaitWithInterval(ctx, nil, 5000*time.Millisecond, opts...) + return op.lro.WaitWithInterval(ctx, nil, time.Minute, opts...) } // Poll fetches the latest state of the long-running operation. @@ -1438,7 +1371,9 @@ func (op *ImportDataOperation) Wait(ctx context.Context, opts ...gax.CallOption) // // If Poll fails, the error is returned and op is unmodified. If Poll succeeds and // the operation has completed with failure, the error is returned and op.Done will return true. -// If Poll succeeds and the operation has completed successfully, op.Done will return true. +// If Poll succeeds and the operation has completed successfully, +// op.Done will return true, and the response of the operation is returned. +// If Poll succeeds and the operation has not completed, the returned response and error are both nil. func (op *ImportDataOperation) Poll(ctx context.Context, opts ...gax.CallOption) error { return op.lro.Poll(ctx, nil, opts...) } @@ -1481,11 +1416,11 @@ func (c *Client) UndeployModelOperation(name string) *UndeployModelOperation { } } -// Wait blocks until the long-running operation is completed, returning any error encountered. +// Wait blocks until the long-running operation is completed, returning the response and any errors encountered. // // See documentation of Poll for error-handling information. func (op *UndeployModelOperation) Wait(ctx context.Context, opts ...gax.CallOption) error { - return op.lro.WaitWithInterval(ctx, nil, 5000*time.Millisecond, opts...) + return op.lro.WaitWithInterval(ctx, nil, time.Minute, opts...) } // Poll fetches the latest state of the long-running operation. @@ -1494,7 +1429,9 @@ func (op *UndeployModelOperation) Wait(ctx context.Context, opts ...gax.CallOpti // // If Poll fails, the error is returned and op is unmodified. If Poll succeeds and // the operation has completed with failure, the error is returned and op.Done will return true. -// If Poll succeeds and the operation has completed successfully, op.Done will return true. +// If Poll succeeds and the operation has completed successfully, +// op.Done will return true, and the response of the operation is returned. +// If Poll succeeds and the operation has not completed, the returned response and error are both nil. func (op *UndeployModelOperation) Poll(ctx context.Context, opts ...gax.CallOption) error { return op.lro.Poll(ctx, nil, opts...) } @@ -1523,3 +1460,238 @@ func (op *UndeployModelOperation) Done() bool { func (op *UndeployModelOperation) Name() string { return op.lro.Name() } + +// ColumnSpecIterator manages a stream of *automlpb.ColumnSpec. +type ColumnSpecIterator struct { + items []*automlpb.ColumnSpec + 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 []*automlpb.ColumnSpec, nextPageToken string, err error) +} + +// PageInfo supports pagination. See the google.golang.org/api/iterator package for details. +func (it *ColumnSpecIterator) 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 *ColumnSpecIterator) Next() (*automlpb.ColumnSpec, error) { + var item *automlpb.ColumnSpec + if err := it.nextFunc(); err != nil { + return item, err + } + item = it.items[0] + it.items = it.items[1:] + return item, nil +} + +func (it *ColumnSpecIterator) bufLen() int { + return len(it.items) +} + +func (it *ColumnSpecIterator) takeBuf() interface{} { + b := it.items + it.items = nil + return b +} + +// DatasetIterator manages a stream of *automlpb.Dataset. +type DatasetIterator struct { + items []*automlpb.Dataset + 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 []*automlpb.Dataset, nextPageToken string, err error) +} + +// PageInfo supports pagination. See the google.golang.org/api/iterator package for details. +func (it *DatasetIterator) 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 *DatasetIterator) Next() (*automlpb.Dataset, error) { + var item *automlpb.Dataset + if err := it.nextFunc(); err != nil { + return item, err + } + item = it.items[0] + it.items = it.items[1:] + return item, nil +} + +func (it *DatasetIterator) bufLen() int { + return len(it.items) +} + +func (it *DatasetIterator) takeBuf() interface{} { + b := it.items + it.items = nil + return b +} + +// ModelEvaluationIterator manages a stream of *automlpb.ModelEvaluation. +type ModelEvaluationIterator struct { + items []*automlpb.ModelEvaluation + 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 []*automlpb.ModelEvaluation, nextPageToken string, err error) +} + +// PageInfo supports pagination. See the google.golang.org/api/iterator package for details. +func (it *ModelEvaluationIterator) 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 *ModelEvaluationIterator) Next() (*automlpb.ModelEvaluation, error) { + var item *automlpb.ModelEvaluation + if err := it.nextFunc(); err != nil { + return item, err + } + item = it.items[0] + it.items = it.items[1:] + return item, nil +} + +func (it *ModelEvaluationIterator) bufLen() int { + return len(it.items) +} + +func (it *ModelEvaluationIterator) takeBuf() interface{} { + b := it.items + it.items = nil + return b +} + +// ModelIterator manages a stream of *automlpb.Model. +type ModelIterator struct { + items []*automlpb.Model + 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 []*automlpb.Model, nextPageToken string, err error) +} + +// PageInfo supports pagination. See the google.golang.org/api/iterator package for details. +func (it *ModelIterator) 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 *ModelIterator) Next() (*automlpb.Model, error) { + var item *automlpb.Model + if err := it.nextFunc(); err != nil { + return item, err + } + item = it.items[0] + it.items = it.items[1:] + return item, nil +} + +func (it *ModelIterator) bufLen() int { + return len(it.items) +} + +func (it *ModelIterator) takeBuf() interface{} { + b := it.items + it.items = nil + return b +} + +// TableSpecIterator manages a stream of *automlpb.TableSpec. +type TableSpecIterator struct { + items []*automlpb.TableSpec + 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 []*automlpb.TableSpec, nextPageToken string, err error) +} + +// PageInfo supports pagination. See the google.golang.org/api/iterator package for details. +func (it *TableSpecIterator) 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 *TableSpecIterator) Next() (*automlpb.TableSpec, error) { + var item *automlpb.TableSpec + if err := it.nextFunc(); err != nil { + return item, err + } + item = it.items[0] + it.items = it.items[1:] + return item, nil +} + +func (it *TableSpecIterator) bufLen() int { + return len(it.items) +} + +func (it *TableSpecIterator) takeBuf() interface{} { + b := it.items + it.items = nil + return b +} diff --git a/automl/apiv1beta1/auto_ml_client_example_test.go b/automl/apiv1beta1/auto_ml_client_example_test.go index d05049d8ed82..2e0498e6df2e 100644 --- a/automl/apiv1beta1/auto_ml_client_example_test.go +++ b/automl/apiv1beta1/auto_ml_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 automl_test @@ -35,6 +35,8 @@ func ExampleNewClient() { } func ExampleClient_CreateDataset() { + // import automlpb "google.golang.org/genproto/googleapis/cloud/automl/v1beta1" + ctx := context.Background() c, err := automl.NewClient(ctx) if err != nil { @@ -52,25 +54,9 @@ func ExampleClient_CreateDataset() { _ = resp } -func ExampleClient_UpdateDataset() { - ctx := context.Background() - c, err := automl.NewClient(ctx) - if err != nil { - // TODO: Handle error. - } - - req := &automlpb.UpdateDatasetRequest{ - // TODO: Fill request struct fields. - } - resp, err := c.UpdateDataset(ctx, req) - if err != nil { - // TODO: Handle error. - } - // TODO: Use resp. - _ = resp -} - func ExampleClient_GetDataset() { + // import automlpb "google.golang.org/genproto/googleapis/cloud/automl/v1beta1" + ctx := context.Background() c, err := automl.NewClient(ctx) if err != nil { @@ -89,6 +75,9 @@ func ExampleClient_GetDataset() { } func ExampleClient_ListDatasets() { + // import automlpb "google.golang.org/genproto/googleapis/cloud/automl/v1beta1" + // import "google.golang.org/api/iterator" + ctx := context.Background() c, err := automl.NewClient(ctx) if err != nil { @@ -112,7 +101,29 @@ func ExampleClient_ListDatasets() { } } +func ExampleClient_UpdateDataset() { + // import automlpb "google.golang.org/genproto/googleapis/cloud/automl/v1beta1" + + ctx := context.Background() + c, err := automl.NewClient(ctx) + if err != nil { + // TODO: Handle error. + } + + req := &automlpb.UpdateDatasetRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.UpdateDataset(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + func ExampleClient_DeleteDataset() { + // import automlpb "google.golang.org/genproto/googleapis/cloud/automl/v1beta1" + ctx := context.Background() c, err := automl.NewClient(ctx) if err != nil { @@ -128,10 +139,14 @@ func ExampleClient_DeleteDataset() { } err = op.Wait(ctx) - // TODO: Handle error. + if err != nil { + // TODO: Handle error. + } } func ExampleClient_ImportData() { + // import automlpb "google.golang.org/genproto/googleapis/cloud/automl/v1beta1" + ctx := context.Background() c, err := automl.NewClient(ctx) if err != nil { @@ -147,10 +162,14 @@ func ExampleClient_ImportData() { } err = op.Wait(ctx) - // TODO: Handle error. + if err != nil { + // TODO: Handle error. + } } func ExampleClient_ExportData() { + // import automlpb "google.golang.org/genproto/googleapis/cloud/automl/v1beta1" + ctx := context.Background() c, err := automl.NewClient(ctx) if err != nil { @@ -166,25 +185,24 @@ func ExampleClient_ExportData() { } err = op.Wait(ctx) - // TODO: Handle error. + if err != nil { + // TODO: Handle error. + } } -func ExampleClient_CreateModel() { +func ExampleClient_GetAnnotationSpec() { + // import automlpb "google.golang.org/genproto/googleapis/cloud/automl/v1beta1" + ctx := context.Background() c, err := automl.NewClient(ctx) if err != nil { // TODO: Handle error. } - req := &automlpb.CreateModelRequest{ + req := &automlpb.GetAnnotationSpecRequest{ // TODO: Fill request struct fields. } - op, err := c.CreateModel(ctx, req) - if err != nil { - // TODO: Handle error. - } - - resp, err := op.Wait(ctx) + resp, err := c.GetAnnotationSpec(ctx, req) if err != nil { // TODO: Handle error. } @@ -192,17 +210,19 @@ func ExampleClient_CreateModel() { _ = resp } -func ExampleClient_GetModel() { +func ExampleClient_GetTableSpec() { + // import automlpb "google.golang.org/genproto/googleapis/cloud/automl/v1beta1" + ctx := context.Background() c, err := automl.NewClient(ctx) if err != nil { // TODO: Handle error. } - req := &automlpb.GetModelRequest{ + req := &automlpb.GetTableSpecRequest{ // TODO: Fill request struct fields. } - resp, err := c.GetModel(ctx, req) + resp, err := c.GetTableSpec(ctx, req) if err != nil { // TODO: Handle error. } @@ -210,17 +230,20 @@ func ExampleClient_GetModel() { _ = resp } -func ExampleClient_ListModels() { +func ExampleClient_ListTableSpecs() { + // import automlpb "google.golang.org/genproto/googleapis/cloud/automl/v1beta1" + // import "google.golang.org/api/iterator" + ctx := context.Background() c, err := automl.NewClient(ctx) if err != nil { // TODO: Handle error. } - req := &automlpb.ListModelsRequest{ + req := &automlpb.ListTableSpecsRequest{ // TODO: Fill request struct fields. } - it := c.ListModels(ctx, req) + it := c.ListTableSpecs(ctx, req) for { resp, err := it.Next() if err == iterator.Done { @@ -234,74 +257,86 @@ func ExampleClient_ListModels() { } } -func ExampleClient_DeleteModel() { +func ExampleClient_UpdateTableSpec() { + // import automlpb "google.golang.org/genproto/googleapis/cloud/automl/v1beta1" + ctx := context.Background() c, err := automl.NewClient(ctx) if err != nil { // TODO: Handle error. } - req := &automlpb.DeleteModelRequest{ + req := &automlpb.UpdateTableSpecRequest{ // TODO: Fill request struct fields. } - op, err := c.DeleteModel(ctx, req) + resp, err := c.UpdateTableSpec(ctx, req) if err != nil { // TODO: Handle error. } - - err = op.Wait(ctx) - // TODO: Handle error. + // TODO: Use resp. + _ = resp } -func ExampleClient_DeployModel() { +func ExampleClient_GetColumnSpec() { + // import automlpb "google.golang.org/genproto/googleapis/cloud/automl/v1beta1" + ctx := context.Background() c, err := automl.NewClient(ctx) if err != nil { // TODO: Handle error. } - req := &automlpb.DeployModelRequest{ + req := &automlpb.GetColumnSpecRequest{ // TODO: Fill request struct fields. } - op, err := c.DeployModel(ctx, req) + resp, err := c.GetColumnSpec(ctx, req) if err != nil { // TODO: Handle error. } - - err = op.Wait(ctx) - // TODO: Handle error. + // TODO: Use resp. + _ = resp } -func ExampleClient_UndeployModel() { +func ExampleClient_ListColumnSpecs() { + // import automlpb "google.golang.org/genproto/googleapis/cloud/automl/v1beta1" + // import "google.golang.org/api/iterator" + ctx := context.Background() c, err := automl.NewClient(ctx) if err != nil { // TODO: Handle error. } - req := &automlpb.UndeployModelRequest{ + req := &automlpb.ListColumnSpecsRequest{ // TODO: Fill request struct fields. } - op, err := c.UndeployModel(ctx, req) - if err != nil { - // TODO: Handle error. + it := c.ListColumnSpecs(ctx, req) + for { + resp, err := it.Next() + if err == iterator.Done { + break + } + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp } - - err = op.Wait(ctx) - // TODO: Handle error. } -func ExampleClient_GetModelEvaluation() { +func ExampleClient_UpdateColumnSpec() { + // import automlpb "google.golang.org/genproto/googleapis/cloud/automl/v1beta1" + ctx := context.Background() c, err := automl.NewClient(ctx) if err != nil { // TODO: Handle error. } - req := &automlpb.GetModelEvaluationRequest{ + req := &automlpb.UpdateColumnSpecRequest{ // TODO: Fill request struct fields. } - resp, err := c.GetModelEvaluation(ctx, req) + resp, err := c.UpdateColumnSpec(ctx, req) if err != nil { // TODO: Handle error. } @@ -309,55 +344,65 @@ func ExampleClient_GetModelEvaluation() { _ = resp } -func ExampleClient_ExportModel() { +func ExampleClient_CreateModel() { + // import automlpb "google.golang.org/genproto/googleapis/cloud/automl/v1beta1" + ctx := context.Background() c, err := automl.NewClient(ctx) if err != nil { // TODO: Handle error. } - req := &automlpb.ExportModelRequest{ + req := &automlpb.CreateModelRequest{ // TODO: Fill request struct fields. } - op, err := c.ExportModel(ctx, req) + op, err := c.CreateModel(ctx, req) if err != nil { // TODO: Handle error. } - err = op.Wait(ctx) - // TODO: Handle error. + resp, err := op.Wait(ctx) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp } -func ExampleClient_ExportEvaluatedExamples() { +func ExampleClient_GetModel() { + // import automlpb "google.golang.org/genproto/googleapis/cloud/automl/v1beta1" + ctx := context.Background() c, err := automl.NewClient(ctx) if err != nil { // TODO: Handle error. } - req := &automlpb.ExportEvaluatedExamplesRequest{ + req := &automlpb.GetModelRequest{ // TODO: Fill request struct fields. } - op, err := c.ExportEvaluatedExamples(ctx, req) + resp, err := c.GetModel(ctx, req) if err != nil { // TODO: Handle error. } - - err = op.Wait(ctx) - // TODO: Handle error. + // TODO: Use resp. + _ = resp } -func ExampleClient_ListModelEvaluations() { +func ExampleClient_ListModels() { + // import automlpb "google.golang.org/genproto/googleapis/cloud/automl/v1beta1" + // import "google.golang.org/api/iterator" + ctx := context.Background() c, err := automl.NewClient(ctx) if err != nil { // TODO: Handle error. } - req := &automlpb.ListModelEvaluationsRequest{ + req := &automlpb.ListModelsRequest{ // TODO: Fill request struct fields. } - it := c.ListModelEvaluations(ctx, req) + it := c.ListModels(ctx, req) for { resp, err := it.Next() if err == iterator.Done { @@ -371,95 +416,134 @@ func ExampleClient_ListModelEvaluations() { } } -func ExampleClient_GetAnnotationSpec() { +func ExampleClient_DeleteModel() { + // import automlpb "google.golang.org/genproto/googleapis/cloud/automl/v1beta1" + ctx := context.Background() c, err := automl.NewClient(ctx) if err != nil { // TODO: Handle error. } - req := &automlpb.GetAnnotationSpecRequest{ + req := &automlpb.DeleteModelRequest{ // TODO: Fill request struct fields. } - resp, err := c.GetAnnotationSpec(ctx, req) + op, err := c.DeleteModel(ctx, req) + if err != nil { + // TODO: Handle error. + } + + err = op.Wait(ctx) if err != nil { // TODO: Handle error. } - // TODO: Use resp. - _ = resp } -func ExampleClient_GetTableSpec() { +func ExampleClient_DeployModel() { + // import automlpb "google.golang.org/genproto/googleapis/cloud/automl/v1beta1" + ctx := context.Background() c, err := automl.NewClient(ctx) if err != nil { // TODO: Handle error. } - req := &automlpb.GetTableSpecRequest{ + req := &automlpb.DeployModelRequest{ // TODO: Fill request struct fields. } - resp, err := c.GetTableSpec(ctx, req) + op, err := c.DeployModel(ctx, req) + if err != nil { + // TODO: Handle error. + } + + err = op.Wait(ctx) if err != nil { // TODO: Handle error. } - // TODO: Use resp. - _ = resp } -func ExampleClient_ListTableSpecs() { +func ExampleClient_UndeployModel() { + // import automlpb "google.golang.org/genproto/googleapis/cloud/automl/v1beta1" + ctx := context.Background() c, err := automl.NewClient(ctx) if err != nil { // TODO: Handle error. } - req := &automlpb.ListTableSpecsRequest{ + req := &automlpb.UndeployModelRequest{ // TODO: Fill request struct fields. } - it := c.ListTableSpecs(ctx, req) - for { - resp, err := it.Next() - if err == iterator.Done { - break - } - if err != nil { - // TODO: Handle error. - } - // TODO: Use resp. - _ = resp + op, err := c.UndeployModel(ctx, req) + if err != nil { + // TODO: Handle error. + } + + err = op.Wait(ctx) + if err != nil { + // TODO: Handle error. } } -func ExampleClient_UpdateTableSpec() { +func ExampleClient_ExportModel() { + // import automlpb "google.golang.org/genproto/googleapis/cloud/automl/v1beta1" + ctx := context.Background() c, err := automl.NewClient(ctx) if err != nil { // TODO: Handle error. } - req := &automlpb.UpdateTableSpecRequest{ + req := &automlpb.ExportModelRequest{ // TODO: Fill request struct fields. } - resp, err := c.UpdateTableSpec(ctx, req) + op, err := c.ExportModel(ctx, req) + if err != nil { + // TODO: Handle error. + } + + err = op.Wait(ctx) if err != nil { // TODO: Handle error. } - // TODO: Use resp. - _ = resp } -func ExampleClient_GetColumnSpec() { +func ExampleClient_ExportEvaluatedExamples() { + // import automlpb "google.golang.org/genproto/googleapis/cloud/automl/v1beta1" + ctx := context.Background() c, err := automl.NewClient(ctx) if err != nil { // TODO: Handle error. } - req := &automlpb.GetColumnSpecRequest{ + req := &automlpb.ExportEvaluatedExamplesRequest{ // TODO: Fill request struct fields. } - resp, err := c.GetColumnSpec(ctx, req) + op, err := c.ExportEvaluatedExamples(ctx, req) + if err != nil { + // TODO: Handle error. + } + + err = op.Wait(ctx) + if err != nil { + // TODO: Handle error. + } +} + +func ExampleClient_GetModelEvaluation() { + // import automlpb "google.golang.org/genproto/googleapis/cloud/automl/v1beta1" + + ctx := context.Background() + c, err := automl.NewClient(ctx) + if err != nil { + // TODO: Handle error. + } + + req := &automlpb.GetModelEvaluationRequest{ + // TODO: Fill request struct fields. + } + resp, err := c.GetModelEvaluation(ctx, req) if err != nil { // TODO: Handle error. } @@ -467,17 +551,20 @@ func ExampleClient_GetColumnSpec() { _ = resp } -func ExampleClient_ListColumnSpecs() { +func ExampleClient_ListModelEvaluations() { + // import automlpb "google.golang.org/genproto/googleapis/cloud/automl/v1beta1" + // import "google.golang.org/api/iterator" + ctx := context.Background() c, err := automl.NewClient(ctx) if err != nil { // TODO: Handle error. } - req := &automlpb.ListColumnSpecsRequest{ + req := &automlpb.ListModelEvaluationsRequest{ // TODO: Fill request struct fields. } - it := c.ListColumnSpecs(ctx, req) + it := c.ListModelEvaluations(ctx, req) for { resp, err := it.Next() if err == iterator.Done { @@ -490,21 +577,3 @@ func ExampleClient_ListColumnSpecs() { _ = resp } } - -func ExampleClient_UpdateColumnSpec() { - ctx := context.Background() - c, err := automl.NewClient(ctx) - if err != nil { - // TODO: Handle error. - } - - req := &automlpb.UpdateColumnSpecRequest{ - // TODO: Fill request struct fields. - } - resp, err := c.UpdateColumnSpec(ctx, req) - if err != nil { - // TODO: Handle error. - } - // TODO: Use resp. - _ = resp -} diff --git a/automl/apiv1beta1/doc.go b/automl/apiv1beta1/doc.go index c9dd19d9bad2..f197affe04f7 100644 --- a/automl/apiv1beta1/doc.go +++ b/automl/apiv1beta1/doc.go @@ -12,16 +12,16 @@ // See the License for the specific language governing permissions and // limitations under the License. -// Code generated by gapic-generator. DO NOT EDIT. +// Code generated by protoc-gen-go_gapic. DO NOT EDIT. // Package automl is an auto-generated package for the // Cloud AutoML API. // -// NOTE: This package is in beta. It is not stable, and may be subject to changes. -// // Train high-quality custom machine learning models with minimum effort and // machine learning expertise. // +// 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 @@ -43,6 +43,8 @@ import ( "google.golang.org/grpc/metadata" ) +const versionClient = "20200305" + func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) out = out.Copy() @@ -76,7 +78,7 @@ func versionGo() string { } notSemverRune := func(r rune) bool { - return strings.IndexRune("0123456789.", r) < 0 + return !strings.ContainsRune("0123456789.", r) } if strings.HasPrefix(s, "go1") { @@ -97,5 +99,3 @@ func versionGo() string { } return "UNKNOWN" } - -const versionClient = "20200304" diff --git a/automl/apiv1beta1/prediction_client.go b/automl/apiv1beta1/prediction_client.go index f02e734cc25f..1ff6754c71ae 100644 --- a/automl/apiv1beta1/prediction_client.go +++ b/automl/apiv1beta1/prediction_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 automl @@ -27,7 +27,7 @@ import ( lroauto "cloud.google.com/go/longrunning/autogen" gax "github.com/googleapis/gax-go/v2" "google.golang.org/api/option" - "google.golang.org/api/transport" + gtransport "google.golang.org/api/transport/grpc" automlpb "google.golang.org/genproto/googleapis/cloud/automl/v1beta1" longrunningpb "google.golang.org/genproto/googleapis/longrunning" "google.golang.org/grpc" @@ -43,6 +43,7 @@ type PredictionCallOptions struct { func defaultPredictionClientOptions() []option.ClientOption { return []option.ClientOption{ option.WithEndpoint("automl.googleapis.com:443"), + option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), option.WithScopes(DefaultAuthScopes()...), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), @@ -50,10 +51,9 @@ func defaultPredictionClientOptions() []option.ClientOption { } func defaultPredictionCallOptions() *PredictionCallOptions { - retry := map[[2]string][]gax.CallOption{} return &PredictionCallOptions{ - Predict: retry[[2]string{"default", "non_idempotent"}], - BatchPredict: retry[[2]string{"default", "non_idempotent"}], + Predict: []gax.CallOption{}, + BatchPredict: []gax.CallOption{}, } } @@ -61,8 +61,8 @@ func defaultPredictionCallOptions() *PredictionCallOptions { // // Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls. type PredictionClient struct { - // The connection to the service. - conn *grpc.ClientConn + // Connection pool of gRPC connections to the service. + connPool gtransport.ConnPool // The gRPC API client. predictionClient automlpb.PredictionServiceClient @@ -86,40 +86,42 @@ type PredictionClient struct { // On any input that is documented to expect a string parameter in // snake_case or kebab-case, either of those cases is accepted. func NewPredictionClient(ctx context.Context, opts ...option.ClientOption) (*PredictionClient, error) { - conn, err := transport.DialGRPC(ctx, append(defaultPredictionClientOptions(), opts...)...) + connPool, err := gtransport.DialPool(ctx, append(defaultPredictionClientOptions(), opts...)...) if err != nil { return nil, err } c := &PredictionClient{ - conn: conn, + connPool: connPool, CallOptions: defaultPredictionCallOptions(), - predictionClient: automlpb.NewPredictionServiceClient(conn), + predictionClient: automlpb.NewPredictionServiceClient(connPool), } c.setGoogleClientInfo() - c.LROClient, err = lroauto.NewOperationsClient(ctx, option.WithGRPCConn(conn)) + c.LROClient, err = lroauto.NewOperationsClient(ctx, gtransport.WithConnPool(connPool)) if err != nil { - // This error "should not happen", since we are just reusing old connection + // This error "should not happen", since we are just reusing old connection pool // and never actually need to dial. - // If this does happen, we could leak conn. However, we cannot close conn: - // If the user invoked the function with option.WithGRPCConn, + // If this does happen, we could leak connp. However, we cannot close conn: + // If the user invoked the constructor with option.WithGRPCConn, // we would close a connection that's still in use. - // TODO(pongad): investigate error conditions. + // TODO: investigate error conditions. return nil, err } return c, nil } -// Connection returns the client's connection to the API service. +// Connection returns a connection to the API service. +// +// Deprecated. func (c *PredictionClient) 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 *PredictionClient) Close() error { - return c.conn.Close() + return c.connPool.Close() } // setGoogleClientInfo sets the name and version of the application in @@ -174,7 +176,7 @@ func (c *PredictionClient) Predict(ctx context.Context, req *automlpb.PredictReq } // BatchPredict perform a batch prediction. Unlike the online [Predict][google.cloud.automl.v1beta1.PredictionService.Predict], batch -// prediction result won't be immediately available in the response. Instead, +// prediction result won’t be immediately available in the response. Instead, // a long running operation object is returned. User can poll the operation // result via [GetOperation][google.longrunning.Operations.GetOperation] // method. Once the operation is done, [BatchPredictResult][google.cloud.automl.v1beta1.BatchPredictResult] is returned in @@ -226,7 +228,7 @@ func (c *PredictionClient) BatchPredictOperation(name string) *BatchPredictOpera // See documentation of Poll for error-handling information. func (op *BatchPredictOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*automlpb.BatchPredictResult, error) { var resp automlpb.BatchPredictResult - if err := op.lro.WaitWithInterval(ctx, &resp, 5000*time.Millisecond, opts...); err != nil { + if err := op.lro.WaitWithInterval(ctx, &resp, time.Minute, opts...); err != nil { return nil, err } return &resp, nil diff --git a/automl/apiv1beta1/prediction_client_example_test.go b/automl/apiv1beta1/prediction_client_example_test.go index 96b926fe3d2d..2191e363f975 100644 --- a/automl/apiv1beta1/prediction_client_example_test.go +++ b/automl/apiv1beta1/prediction_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 automl_test @@ -34,6 +34,8 @@ func ExampleNewPredictionClient() { } func ExamplePredictionClient_Predict() { + // import automlpb "google.golang.org/genproto/googleapis/cloud/automl/v1beta1" + ctx := context.Background() c, err := automl.NewPredictionClient(ctx) if err != nil { @@ -52,6 +54,8 @@ func ExamplePredictionClient_Predict() { } func ExamplePredictionClient_BatchPredict() { + // import automlpb "google.golang.org/genproto/googleapis/cloud/automl/v1beta1" + ctx := context.Background() c, err := automl.NewPredictionClient(ctx) if err != nil { diff --git a/bigquery/datatransfer/apiv1/doc.go b/bigquery/datatransfer/apiv1/doc.go index ada40465fb3c..0655859e202c 100644 --- a/bigquery/datatransfer/apiv1/doc.go +++ b/bigquery/datatransfer/apiv1/doc.go @@ -41,7 +41,7 @@ import ( "google.golang.org/grpc/metadata" ) -const versionClient = "20200304" +const versionClient = "20200305" 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 530bb84d494f..8ec9522db934 100644 --- a/bigquery/go.mod +++ b/bigquery/go.mod @@ -14,6 +14,6 @@ require ( golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527 // indirect golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb // indirect google.golang.org/api v0.20.0 - google.golang.org/genproto v0.0.0-20200304201815-d429ff31ee6c + google.golang.org/genproto v0.0.0-20200305110556-506484158171 google.golang.org/grpc v1.27.1 ) diff --git a/bigquery/go.sum b/bigquery/go.sum index 53884da004e7..b3dfacae8745 100644 --- a/bigquery/go.sum +++ b/bigquery/go.sum @@ -318,8 +318,8 @@ google.golang.org/genproto v0.0.0-20200212174721-66ed5ce911ce h1:1mbrb1tUU+Zmt5C 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-20200304201815-d429ff31ee6c h1:Mm69MraVZ+yh1vw8pQOUW4uJkkSEQbbTr076A94lvqs= -google.golang.org/genproto v0.0.0-20200304201815-d429ff31ee6c/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200305110556-506484158171 h1:xes2Q2k+d/+YNXVw0FpZkIDJiaux4OVrRKXRAzH6A0U= +google.golang.org/genproto v0.0.0-20200305110556-506484158171/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 f24262c37df5..380a8b5cacdc 100644 --- a/bigquery/reservation/apiv1beta1/doc.go +++ b/bigquery/reservation/apiv1beta1/doc.go @@ -42,7 +42,7 @@ import ( "google.golang.org/grpc/metadata" ) -const versionClient = "20200304" +const versionClient = "20200305" 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 d266e576a7a8..288e0cbbf691 100644 --- a/bigquery/storage/apiv1/doc.go +++ b/bigquery/storage/apiv1/doc.go @@ -40,7 +40,7 @@ import ( "google.golang.org/grpc/metadata" ) -const versionClient = "20200304" +const versionClient = "20200305" 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 a759cdd3cada..38225ab8bc37 100644 --- a/bigquery/storage/apiv1alpha2/doc.go +++ b/bigquery/storage/apiv1alpha2/doc.go @@ -40,7 +40,7 @@ import ( "google.golang.org/grpc/metadata" ) -const versionClient = "20200304" +const versionClient = "20200305" 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 2aa76910dc61..1e2ac9aa635f 100644 --- a/bigquery/storage/apiv1beta1/doc.go +++ b/bigquery/storage/apiv1beta1/doc.go @@ -40,7 +40,7 @@ import ( "google.golang.org/grpc/metadata" ) -const versionClient = "20200304" +const versionClient = "20200305" 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 eb903ca958cf..7ee9e0b1678f 100644 --- a/bigquery/storage/apiv1beta2/doc.go +++ b/bigquery/storage/apiv1beta2/doc.go @@ -40,7 +40,7 @@ import ( "google.golang.org/grpc/metadata" ) -const versionClient = "20200304" +const versionClient = "20200305" 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 018823e43c08..89e5cf25630f 100644 --- a/bigtable/go.mod +++ b/bigtable/go.mod @@ -16,7 +16,7 @@ require ( golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527 // indirect golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb // indirect google.golang.org/api v0.20.0 - google.golang.org/genproto v0.0.0-20200304201815-d429ff31ee6c + google.golang.org/genproto v0.0.0-20200305110556-506484158171 google.golang.org/grpc v1.27.1 rsc.io/binaryregexp v0.2.0 ) diff --git a/bigtable/go.sum b/bigtable/go.sum index 965f7ce3c904..804009c11cfb 100644 --- a/bigtable/go.sum +++ b/bigtable/go.sum @@ -336,8 +336,8 @@ google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63 h1:YzfoEYWbODU5Fbt google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200228133532-8c2c7df3a383 h1:Vo0fD5w0fUKriWlZLyrim2GXbumyN0D6euW79T9PgEE= google.golang.org/genproto v0.0.0-20200228133532-8c2c7df3a383/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200304201815-d429ff31ee6c h1:Mm69MraVZ+yh1vw8pQOUW4uJkkSEQbbTr076A94lvqs= -google.golang.org/genproto v0.0.0-20200304201815-d429ff31ee6c/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200305110556-506484158171 h1:xes2Q2k+d/+YNXVw0FpZkIDJiaux4OVrRKXRAzH6A0U= +google.golang.org/genproto v0.0.0-20200305110556-506484158171/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 daa4ae50ef44..e2bcf4d90379 100644 --- a/billing/apiv1/doc.go +++ b/billing/apiv1/doc.go @@ -43,7 +43,7 @@ import ( "google.golang.org/grpc/metadata" ) -const versionClient = "20200304" +const versionClient = "20200305" 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 73e4e15a091d..df7a056dec96 100644 --- a/cloudbuild/apiv1/v2/doc.go +++ b/cloudbuild/apiv1/v2/doc.go @@ -40,7 +40,7 @@ import ( "google.golang.org/grpc/metadata" ) -const versionClient = "20200304" +const versionClient = "20200305" 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 de9a7be15113..a5fc5d870ab8 100644 --- a/cloudtasks/apiv2/doc.go +++ b/cloudtasks/apiv2/doc.go @@ -40,7 +40,7 @@ import ( "google.golang.org/grpc/metadata" ) -const versionClient = "20200304" +const versionClient = "20200305" 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 921ee284715b..4401834ced5a 100644 --- a/cloudtasks/apiv2beta2/doc.go +++ b/cloudtasks/apiv2beta2/doc.go @@ -42,7 +42,7 @@ import ( "google.golang.org/grpc/metadata" ) -const versionClient = "20200304" +const versionClient = "20200305" 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 31f1f021a447..234cff0f3d1d 100644 --- a/cloudtasks/apiv2beta3/doc.go +++ b/cloudtasks/apiv2beta3/doc.go @@ -42,7 +42,7 @@ import ( "google.golang.org/grpc/metadata" ) -const versionClient = "20200304" +const versionClient = "20200305" 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 ce97309220d8..5d19382a012b 100644 --- a/containeranalysis/apiv1beta1/doc.go +++ b/containeranalysis/apiv1beta1/doc.go @@ -43,7 +43,7 @@ import ( "google.golang.org/grpc/metadata" ) -const versionClient = "20200304" +const versionClient = "20200305" 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 deee77e870e1..811b6905c626 100644 --- a/datacatalog/apiv1beta1/doc.go +++ b/datacatalog/apiv1beta1/doc.go @@ -43,7 +43,7 @@ import ( "google.golang.org/grpc/metadata" ) -const versionClient = "20200304" +const versionClient = "20200305" 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 cdfa45473c55..88d7622b9637 100644 --- a/dataproc/apiv1/doc.go +++ b/dataproc/apiv1/doc.go @@ -40,7 +40,7 @@ import ( "google.golang.org/grpc/metadata" ) -const versionClient = "20200304" +const versionClient = "20200305" 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 98a4fc8ad053..c7054fddd69f 100644 --- a/dataproc/apiv1beta2/doc.go +++ b/dataproc/apiv1beta2/doc.go @@ -42,7 +42,7 @@ import ( "google.golang.org/grpc/metadata" ) -const versionClient = "20200304" +const versionClient = "20200305" 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 488cdff2bde9..d5291f1f0f43 100644 --- a/datastore/go.mod +++ b/datastore/go.mod @@ -14,6 +14,6 @@ require ( golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527 // indirect golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb // indirect google.golang.org/api v0.20.0 - google.golang.org/genproto v0.0.0-20200304201815-d429ff31ee6c + google.golang.org/genproto v0.0.0-20200305110556-506484158171 google.golang.org/grpc v1.27.1 ) diff --git a/datastore/go.sum b/datastore/go.sum index 223b53eefd57..2b2b7fc706be 100644 --- a/datastore/go.sum +++ b/datastore/go.sum @@ -330,8 +330,8 @@ google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63 h1:YzfoEYWbODU5Fbt google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200228133532-8c2c7df3a383 h1:Vo0fD5w0fUKriWlZLyrim2GXbumyN0D6euW79T9PgEE= google.golang.org/genproto v0.0.0-20200228133532-8c2c7df3a383/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200304201815-d429ff31ee6c h1:Mm69MraVZ+yh1vw8pQOUW4uJkkSEQbbTr076A94lvqs= -google.golang.org/genproto v0.0.0-20200304201815-d429ff31ee6c/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200305110556-506484158171 h1:xes2Q2k+d/+YNXVw0FpZkIDJiaux4OVrRKXRAzH6A0U= +google.golang.org/genproto v0.0.0-20200305110556-506484158171/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 0452a76b00b5..1b4e427e2fa9 100644 --- a/debugger/apiv2/doc.go +++ b/debugger/apiv2/doc.go @@ -41,7 +41,7 @@ import ( "google.golang.org/grpc/metadata" ) -const versionClient = "20200304" +const versionClient = "20200305" 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 869c9130edcc..9f1da0ff837f 100644 --- a/dialogflow/apiv2/doc.go +++ b/dialogflow/apiv2/doc.go @@ -41,7 +41,7 @@ import ( "google.golang.org/grpc/metadata" ) -const versionClient = "20200304" +const versionClient = "20200305" 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 c3cbb090937e..e24c79b4d800 100644 --- a/dlp/apiv2/doc.go +++ b/dlp/apiv2/doc.go @@ -42,7 +42,7 @@ import ( "google.golang.org/grpc/metadata" ) -const versionClient = "20200304" +const versionClient = "20200305" 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 296bf57dfc22..9a74084276f5 100644 --- a/errorreporting/apiv1beta1/doc.go +++ b/errorreporting/apiv1beta1/doc.go @@ -44,7 +44,7 @@ import ( "google.golang.org/grpc/metadata" ) -const versionClient = "20200304" +const versionClient = "20200305" 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 4b80c21f8e8c..7508ecce135e 100644 --- a/expr/apiv1alpha1/doc.go +++ b/expr/apiv1alpha1/doc.go @@ -42,7 +42,7 @@ import ( "google.golang.org/grpc/metadata" ) -const versionClient = "20200304" +const versionClient = "20200305" 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 2b4cc3d73ff2..748d723314ac 100644 --- a/firestore/apiv1/admin/doc.go +++ b/firestore/apiv1/admin/doc.go @@ -41,7 +41,7 @@ import ( "google.golang.org/grpc/metadata" ) -const versionClient = "20200304" +const versionClient = "20200305" 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 13919f7081df..aad5a96149de 100644 --- a/firestore/apiv1/doc.go +++ b/firestore/apiv1/doc.go @@ -41,7 +41,7 @@ import ( "google.golang.org/grpc/metadata" ) -const versionClient = "20200304" +const versionClient = "20200305" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/firestore/apiv1beta1/doc.go b/firestore/apiv1beta1/doc.go index e0661a25bc30..408980ba6f44 100644 --- a/firestore/apiv1beta1/doc.go +++ b/firestore/apiv1beta1/doc.go @@ -43,7 +43,7 @@ import ( "google.golang.org/grpc/metadata" ) -const versionClient = "20200304" +const versionClient = "20200305" 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 99b59cd2028d..4d53fbc862c1 100644 --- a/firestore/go.mod +++ b/firestore/go.mod @@ -14,6 +14,6 @@ require ( golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527 // indirect golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb // indirect google.golang.org/api v0.20.0 - google.golang.org/genproto v0.0.0-20200304201815-d429ff31ee6c + google.golang.org/genproto v0.0.0-20200305110556-506484158171 google.golang.org/grpc v1.27.1 ) diff --git a/firestore/go.sum b/firestore/go.sum index 7838c3561856..811ed192432e 100644 --- a/firestore/go.sum +++ b/firestore/go.sum @@ -332,8 +332,8 @@ google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63 h1:YzfoEYWbODU5Fbt google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200228133532-8c2c7df3a383 h1:Vo0fD5w0fUKriWlZLyrim2GXbumyN0D6euW79T9PgEE= google.golang.org/genproto v0.0.0-20200228133532-8c2c7df3a383/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200304201815-d429ff31ee6c h1:Mm69MraVZ+yh1vw8pQOUW4uJkkSEQbbTr076A94lvqs= -google.golang.org/genproto v0.0.0-20200304201815-d429ff31ee6c/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200305110556-506484158171 h1:xes2Q2k+d/+YNXVw0FpZkIDJiaux4OVrRKXRAzH6A0U= +google.golang.org/genproto v0.0.0-20200305110556-506484158171/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 7bc53d0da707..46c31dc818bb 100644 --- a/go.mod +++ b/go.mod @@ -23,7 +23,7 @@ require ( golang.org/x/text v0.3.2 golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb google.golang.org/api v0.20.0 - google.golang.org/genproto v0.0.0-20200304201815-d429ff31ee6c + google.golang.org/genproto v0.0.0-20200305110556-506484158171 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 25a002cd026a..2c80b77c1e37 100644 --- a/go.sum +++ b/go.sum @@ -327,8 +327,8 @@ google.golang.org/genproto v0.0.0-20200122232147-0452cf42e150/go.mod h1:n3cpQtvx 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-20200304201815-d429ff31ee6c h1:Mm69MraVZ+yh1vw8pQOUW4uJkkSEQbbTr076A94lvqs= -google.golang.org/genproto v0.0.0-20200304201815-d429ff31ee6c/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200305110556-506484158171 h1:xes2Q2k+d/+YNXVw0FpZkIDJiaux4OVrRKXRAzH6A0U= +google.golang.org/genproto v0.0.0-20200305110556-506484158171/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 dc41b55428f5..e4ce395338ad 100644 --- a/iam/credentials/apiv1/doc.go +++ b/iam/credentials/apiv1/doc.go @@ -41,7 +41,7 @@ import ( "google.golang.org/grpc/metadata" ) -const versionClient = "20200304" +const versionClient = "20200305" 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 b7276a0d6387..2bf3be15f5d0 100644 --- a/internal/.repo-metadata-full.json +++ b/internal/.repo-metadata-full.json @@ -28,7 +28,7 @@ "description": "Cloud AutoML API", "language": "Go", "client_library_type": "generated", - "docs_url": "https://pkg.go.dev/loud.google.com/go/automl/apiv1", + "docs_url": "https://pkg.go.dev/cloud.google.com/go/automl/apiv1", "release_level": "ga" }, "cloud.google.com/go/automl/apiv1beta1": { @@ -36,7 +36,7 @@ "description": "Cloud AutoML API", "language": "Go", "client_library_type": "generated", - "docs_url": "https://pkg.go.dev/loud.google.com/go/automl/apiv1beta1", + "docs_url": "https://pkg.go.dev/cloud.google.com/go/automl/apiv1beta1", "release_level": "beta" }, "cloud.google.com/go/bigquery": { diff --git a/internal/gapicgen/go.mod b/internal/gapicgen/go.mod index 177895356e76..54bff84036de 100644 --- a/internal/gapicgen/go.mod +++ b/internal/gapicgen/go.mod @@ -17,7 +17,7 @@ require ( golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527 // indirect google.golang.org/appengine v1.6.5 // indirect - google.golang.org/genproto v0.0.0-20200304201815-d429ff31ee6c // indirect + google.golang.org/genproto v0.0.0-20200305110556-506484158171 // indirect google.golang.org/grpc v1.27.1 // indirect gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f // indirect gopkg.in/src-d/go-git.v4 v4.13.1 diff --git a/internal/gapicgen/go.sum b/internal/gapicgen/go.sum index 48bf2922297a..8713c2f3f8a8 100644 --- a/internal/gapicgen/go.sum +++ b/internal/gapicgen/go.sum @@ -165,8 +165,8 @@ google.golang.org/genproto v0.0.0-20170818010345-ee236bd376b0/go.mod h1:JiN7NxoA 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-20200304201815-d429ff31ee6c h1:Mm69MraVZ+yh1vw8pQOUW4uJkkSEQbbTr076A94lvqs= -google.golang.org/genproto v0.0.0-20200304201815-d429ff31ee6c/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200305110556-506484158171 h1:xes2Q2k+d/+YNXVw0FpZkIDJiaux4OVrRKXRAzH6A0U= +google.golang.org/genproto v0.0.0-20200305110556-506484158171/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= diff --git a/iot/apiv1/doc.go b/iot/apiv1/doc.go index a9f44f5cfb1d..255db8442537 100644 --- a/iot/apiv1/doc.go +++ b/iot/apiv1/doc.go @@ -41,7 +41,7 @@ import ( "google.golang.org/grpc/metadata" ) -const versionClient = "20200304" +const versionClient = "20200305" 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 f09968f57207..ecac147a0927 100644 --- a/irm/apiv1alpha2/doc.go +++ b/irm/apiv1alpha2/doc.go @@ -40,7 +40,7 @@ import ( "google.golang.org/grpc/metadata" ) -const versionClient = "20200304" +const versionClient = "20200305" 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 fce0a37cbbe7..6787d7d6306f 100644 --- a/kms/apiv1/doc.go +++ b/kms/apiv1/doc.go @@ -41,7 +41,7 @@ import ( "google.golang.org/grpc/metadata" ) -const versionClient = "20200304" +const versionClient = "20200305" 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 49c8089415c1..22a2e6dbbca4 100644 --- a/language/apiv1/doc.go +++ b/language/apiv1/doc.go @@ -42,7 +42,7 @@ import ( "google.golang.org/grpc/metadata" ) -const versionClient = "20200304" +const versionClient = "20200305" 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 aef247a5440d..72897a09268c 100644 --- a/language/apiv1beta2/doc.go +++ b/language/apiv1beta2/doc.go @@ -44,7 +44,7 @@ import ( "google.golang.org/grpc/metadata" ) -const versionClient = "20200304" +const versionClient = "20200305" 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 41e71257d8c6..054e000b3099 100644 --- a/logging/apiv2/doc.go +++ b/logging/apiv2/doc.go @@ -44,7 +44,7 @@ import ( "google.golang.org/grpc/metadata" ) -const versionClient = "20200304" +const versionClient = "20200305" 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 6cf88e81fda6..8dfaf091a096 100644 --- a/logging/go.mod +++ b/logging/go.mod @@ -17,6 +17,6 @@ require ( golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527 // indirect golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb // indirect google.golang.org/api v0.20.0 - google.golang.org/genproto v0.0.0-20200304201815-d429ff31ee6c + google.golang.org/genproto v0.0.0-20200305110556-506484158171 google.golang.org/grpc v1.27.1 ) diff --git a/logging/go.sum b/logging/go.sum index 4c62f5720d26..0fb6da5fcff8 100644 --- a/logging/go.sum +++ b/logging/go.sum @@ -333,8 +333,8 @@ google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63 h1:YzfoEYWbODU5Fbt google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200228133532-8c2c7df3a383 h1:Vo0fD5w0fUKriWlZLyrim2GXbumyN0D6euW79T9PgEE= google.golang.org/genproto v0.0.0-20200228133532-8c2c7df3a383/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200304201815-d429ff31ee6c h1:Mm69MraVZ+yh1vw8pQOUW4uJkkSEQbbTr076A94lvqs= -google.golang.org/genproto v0.0.0-20200304201815-d429ff31ee6c/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200305110556-506484158171 h1:xes2Q2k+d/+YNXVw0FpZkIDJiaux4OVrRKXRAzH6A0U= +google.golang.org/genproto v0.0.0-20200305110556-506484158171/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 3b5cf45a4c5e..ce59da63ab30 100644 --- a/longrunning/autogen/doc.go +++ b/longrunning/autogen/doc.go @@ -40,7 +40,7 @@ import ( "google.golang.org/grpc/metadata" ) -const versionClient = "20200304" +const versionClient = "20200305" 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 44f82fae3fd1..5022fed2d8b2 100644 --- a/memcache/apiv1beta2/doc.go +++ b/memcache/apiv1beta2/doc.go @@ -43,7 +43,7 @@ import ( "google.golang.org/grpc/metadata" ) -const versionClient = "20200304" +const versionClient = "20200305" 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 a8c78ab80373..a551f39071a3 100644 --- a/monitoring/apiv3/doc.go +++ b/monitoring/apiv3/doc.go @@ -45,7 +45,7 @@ import ( "google.golang.org/grpc/metadata" ) -const versionClient = "20200304" +const versionClient = "20200305" 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 ec2157be8ae3..06e890e241c6 100644 --- a/osconfig/agentendpoint/apiv1beta/doc.go +++ b/osconfig/agentendpoint/apiv1beta/doc.go @@ -43,7 +43,7 @@ import ( "google.golang.org/grpc/metadata" ) -const versionClient = "20200304" +const versionClient = "20200305" 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 58ddcdd330b3..580f6ae094fc 100644 --- a/osconfig/apiv1beta/doc.go +++ b/osconfig/apiv1beta/doc.go @@ -43,7 +43,7 @@ import ( "google.golang.org/grpc/metadata" ) -const versionClient = "20200304" +const versionClient = "20200305" 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 821188e55ac1..596d13650b9e 100644 --- a/oslogin/apiv1/doc.go +++ b/oslogin/apiv1/doc.go @@ -41,7 +41,7 @@ import ( "google.golang.org/grpc/metadata" ) -const versionClient = "20200304" +const versionClient = "20200305" 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 4667712f5227..2e93f7b00995 100644 --- a/oslogin/apiv1beta/doc.go +++ b/oslogin/apiv1beta/doc.go @@ -43,7 +43,7 @@ import ( "google.golang.org/grpc/metadata" ) -const versionClient = "20200304" +const versionClient = "20200305" 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 fd9c082e9c39..eab60cdcd842 100644 --- a/phishingprotection/apiv1beta1/doc.go +++ b/phishingprotection/apiv1beta1/doc.go @@ -40,7 +40,7 @@ import ( "google.golang.org/grpc/metadata" ) -const versionClient = "20200304" +const versionClient = "20200305" 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 7cfdccbc265e..66738fd7463e 100644 --- a/pubsub/apiv1/doc.go +++ b/pubsub/apiv1/doc.go @@ -41,7 +41,7 @@ import ( "google.golang.org/grpc/metadata" ) -const versionClient = "20200304" +const versionClient = "20200305" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/pubsub/apiv1/publisher_client.go b/pubsub/apiv1/publisher_client.go index e49e05643986..96c392f826bc 100644 --- a/pubsub/apiv1/publisher_client.go +++ b/pubsub/apiv1/publisher_client.go @@ -136,7 +136,19 @@ func defaultPublisherCallOptions() *PublisherCallOptions { }) }), }, - ListTopicSnapshots: []gax.CallOption{}, + ListTopicSnapshots: []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, + }) + }), + }, DeleteTopic: []gax.CallOption{ gax.WithRetry(func() gax.Retryer { return gax.OnCodes([]codes.Code{ diff --git a/pubsub/apiv1/subscriber_client.go b/pubsub/apiv1/subscriber_client.go index 87cea51ac013..5bbf8908059b 100644 --- a/pubsub/apiv1/subscriber_client.go +++ b/pubsub/apiv1/subscriber_client.go @@ -188,7 +188,19 @@ func defaultSubscriberCallOptions() *SubscriberCallOptions { }) }), }, - GetSnapshot: []gax.CallOption{}, + GetSnapshot: []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, + }) + }), + }, ListSnapshots: []gax.CallOption{ gax.WithRetry(func() gax.Retryer { return gax.OnCodes([]codes.Code{ diff --git a/pubsub/go.mod b/pubsub/go.mod index 75cfedaba580..0db3d5a21ed4 100644 --- a/pubsub/go.mod +++ b/pubsub/go.mod @@ -18,6 +18,6 @@ require ( golang.org/x/time v0.0.0-20191024005414-555d28b269f0 golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb // indirect google.golang.org/api v0.20.0 - google.golang.org/genproto v0.0.0-20200304201815-d429ff31ee6c + google.golang.org/genproto v0.0.0-20200305110556-506484158171 google.golang.org/grpc v1.27.1 ) diff --git a/pubsub/go.sum b/pubsub/go.sum index b002f598fc61..22b52154a282 100644 --- a/pubsub/go.sum +++ b/pubsub/go.sum @@ -330,8 +330,8 @@ google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63 h1:YzfoEYWbODU5Fbt google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200228133532-8c2c7df3a383 h1:Vo0fD5w0fUKriWlZLyrim2GXbumyN0D6euW79T9PgEE= google.golang.org/genproto v0.0.0-20200228133532-8c2c7df3a383/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200304201815-d429ff31ee6c h1:Mm69MraVZ+yh1vw8pQOUW4uJkkSEQbbTr076A94lvqs= -google.golang.org/genproto v0.0.0-20200304201815-d429ff31ee6c/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200305110556-506484158171 h1:xes2Q2k+d/+YNXVw0FpZkIDJiaux4OVrRKXRAzH6A0U= +google.golang.org/genproto v0.0.0-20200305110556-506484158171/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 2876f99c15a8..5238c562389a 100644 --- a/recaptchaenterprise/apiv1beta1/doc.go +++ b/recaptchaenterprise/apiv1beta1/doc.go @@ -40,7 +40,7 @@ import ( "google.golang.org/grpc/metadata" ) -const versionClient = "20200304" +const versionClient = "20200305" 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 5f9fe426424c..dd23fe515fc7 100644 --- a/recommender/apiv1/doc.go +++ b/recommender/apiv1/doc.go @@ -40,7 +40,7 @@ import ( "google.golang.org/grpc/metadata" ) -const versionClient = "20200304" +const versionClient = "20200305" 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 15a4ecf309e9..577216595cb8 100644 --- a/recommender/apiv1beta1/doc.go +++ b/recommender/apiv1beta1/doc.go @@ -40,7 +40,7 @@ import ( "google.golang.org/grpc/metadata" ) -const versionClient = "20200304" +const versionClient = "20200305" 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 a82239a0ecaf..53a6240b7bf6 100644 --- a/redis/apiv1/doc.go +++ b/redis/apiv1/doc.go @@ -40,7 +40,7 @@ import ( "google.golang.org/grpc/metadata" ) -const versionClient = "20200304" +const versionClient = "20200305" 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 c4798289b5d3..d364fb82a59e 100644 --- a/redis/apiv1beta1/doc.go +++ b/redis/apiv1beta1/doc.go @@ -42,7 +42,7 @@ import ( "google.golang.org/grpc/metadata" ) -const versionClient = "20200304" +const versionClient = "20200305" 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 6b0ff3bdd241..d68810b7f0fc 100644 --- a/scheduler/apiv1/doc.go +++ b/scheduler/apiv1/doc.go @@ -40,7 +40,7 @@ import ( "google.golang.org/grpc/metadata" ) -const versionClient = "20200304" +const versionClient = "20200305" 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 cae0d2bd3196..ad29aadb1ffa 100644 --- a/scheduler/apiv1beta1/doc.go +++ b/scheduler/apiv1beta1/doc.go @@ -42,7 +42,7 @@ import ( "google.golang.org/grpc/metadata" ) -const versionClient = "20200304" +const versionClient = "20200305" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/secretmanager/apiv1/doc.go b/secretmanager/apiv1/doc.go index c5abaa808c55..e89f5c6b81fd 100644 --- a/secretmanager/apiv1/doc.go +++ b/secretmanager/apiv1/doc.go @@ -43,7 +43,7 @@ import ( "google.golang.org/grpc/metadata" ) -const versionClient = "20200304" +const versionClient = "20200305" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/secretmanager/apiv1beta1/doc.go b/secretmanager/apiv1beta1/doc.go index 999567a18dd3..b824f01aa6c1 100644 --- a/secretmanager/apiv1beta1/doc.go +++ b/secretmanager/apiv1beta1/doc.go @@ -42,7 +42,7 @@ import ( "google.golang.org/grpc/metadata" ) -const versionClient = "20200304" +const versionClient = "20200305" 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 50ddcd0ca47e..0f2f446e23d4 100644 --- a/securitycenter/apiv1/doc.go +++ b/securitycenter/apiv1/doc.go @@ -41,7 +41,7 @@ import ( "google.golang.org/grpc/metadata" ) -const versionClient = "20200304" +const versionClient = "20200305" 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 ef63d0340d17..6c362e59d90d 100644 --- a/securitycenter/apiv1beta1/doc.go +++ b/securitycenter/apiv1beta1/doc.go @@ -43,7 +43,7 @@ import ( "google.golang.org/grpc/metadata" ) -const versionClient = "20200304" +const versionClient = "20200305" 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 1000642a4619..180f020fcf9f 100644 --- a/securitycenter/apiv1p1beta1/doc.go +++ b/securitycenter/apiv1p1beta1/doc.go @@ -43,7 +43,7 @@ import ( "google.golang.org/grpc/metadata" ) -const versionClient = "20200304" +const versionClient = "20200305" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/spanner/admin/database/apiv1/doc.go b/spanner/admin/database/apiv1/doc.go index bfca80f7efcd..b22435b87c6e 100644 --- a/spanner/admin/database/apiv1/doc.go +++ b/spanner/admin/database/apiv1/doc.go @@ -38,7 +38,7 @@ import ( "google.golang.org/grpc/metadata" ) -const versionClient = "20200304" +const versionClient = "20200305" 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 5afb2f8e0e15..cfa9d6504e45 100644 --- a/spanner/admin/instance/apiv1/doc.go +++ b/spanner/admin/instance/apiv1/doc.go @@ -38,7 +38,7 @@ import ( "google.golang.org/grpc/metadata" ) -const versionClient = "20200304" +const versionClient = "20200305" 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 802ae91a27c2..0df0b0c25caf 100644 --- a/spanner/apiv1/doc.go +++ b/spanner/apiv1/doc.go @@ -41,7 +41,7 @@ import ( "google.golang.org/grpc/metadata" ) -const versionClient = "20200304" +const versionClient = "20200305" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/spanner/go.mod b/spanner/go.mod index e89dc9a56997..58e16da2f285 100644 --- a/spanner/go.mod +++ b/spanner/go.mod @@ -16,6 +16,6 @@ require ( golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb // indirect golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 google.golang.org/api v0.20.0 - google.golang.org/genproto v0.0.0-20200304201815-d429ff31ee6c + google.golang.org/genproto v0.0.0-20200305110556-506484158171 google.golang.org/grpc v1.27.1 ) diff --git a/spanner/go.sum b/spanner/go.sum index 50ccec2e7b9a..b2dc823f27ba 100644 --- a/spanner/go.sum +++ b/spanner/go.sum @@ -329,8 +329,8 @@ google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63 h1:YzfoEYWbODU5Fbt google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200228133532-8c2c7df3a383 h1:Vo0fD5w0fUKriWlZLyrim2GXbumyN0D6euW79T9PgEE= google.golang.org/genproto v0.0.0-20200228133532-8c2c7df3a383/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200304201815-d429ff31ee6c h1:Mm69MraVZ+yh1vw8pQOUW4uJkkSEQbbTr076A94lvqs= -google.golang.org/genproto v0.0.0-20200304201815-d429ff31ee6c/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200305110556-506484158171 h1:xes2Q2k+d/+YNXVw0FpZkIDJiaux4OVrRKXRAzH6A0U= +google.golang.org/genproto v0.0.0-20200305110556-506484158171/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 131b495555b3..814349217c29 100644 --- a/speech/apiv1/doc.go +++ b/speech/apiv1/doc.go @@ -40,7 +40,7 @@ import ( "google.golang.org/grpc/metadata" ) -const versionClient = "20200304" +const versionClient = "20200305" 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 8c57b103916a..40a3471e0e05 100644 --- a/speech/apiv1p1beta1/doc.go +++ b/speech/apiv1p1beta1/doc.go @@ -42,7 +42,7 @@ import ( "google.golang.org/grpc/metadata" ) -const versionClient = "20200304" +const versionClient = "20200305" 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 e828294da665..e53f5e7db8ae 100644 --- a/storage/go.mod +++ b/storage/go.mod @@ -15,6 +15,6 @@ require ( golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527 // indirect golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb // indirect google.golang.org/api v0.20.0 - google.golang.org/genproto v0.0.0-20200304201815-d429ff31ee6c + google.golang.org/genproto v0.0.0-20200305110556-506484158171 google.golang.org/grpc v1.27.1 ) diff --git a/storage/go.sum b/storage/go.sum index ea02c41554d6..ddbfca32d3f2 100644 --- a/storage/go.sum +++ b/storage/go.sum @@ -313,8 +313,8 @@ google.golang.org/genproto v0.0.0-20200212174721-66ed5ce911ce/go.mod h1:55QSHmfG google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200228133532-8c2c7df3a383 h1:Vo0fD5w0fUKriWlZLyrim2GXbumyN0D6euW79T9PgEE= google.golang.org/genproto v0.0.0-20200228133532-8c2c7df3a383/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200304201815-d429ff31ee6c h1:Mm69MraVZ+yh1vw8pQOUW4uJkkSEQbbTr076A94lvqs= -google.golang.org/genproto v0.0.0-20200304201815-d429ff31ee6c/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200305110556-506484158171 h1:xes2Q2k+d/+YNXVw0FpZkIDJiaux4OVrRKXRAzH6A0U= +google.golang.org/genproto v0.0.0-20200305110556-506484158171/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 8357fabd2ce6..3bc9e3b71ede 100644 --- a/talent/apiv4beta1/doc.go +++ b/talent/apiv4beta1/doc.go @@ -43,7 +43,7 @@ import ( "google.golang.org/grpc/metadata" ) -const versionClient = "20200304" +const versionClient = "20200305" 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 577b54aafcee..c648eef0c99b 100644 --- a/texttospeech/apiv1/doc.go +++ b/texttospeech/apiv1/doc.go @@ -41,7 +41,7 @@ import ( "google.golang.org/grpc/metadata" ) -const versionClient = "20200304" +const versionClient = "20200305" 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 901f87a3b81a..0553e5d75b27 100644 --- a/trace/apiv1/doc.go +++ b/trace/apiv1/doc.go @@ -44,7 +44,7 @@ import ( "google.golang.org/grpc/metadata" ) -const versionClient = "20200304" +const versionClient = "20200305" 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 69e7e05d0b0b..261e4baa8e45 100644 --- a/trace/apiv2/doc.go +++ b/trace/apiv2/doc.go @@ -44,7 +44,7 @@ import ( "google.golang.org/grpc/metadata" ) -const versionClient = "20200304" +const versionClient = "20200305" 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 cdc439dd1709..0138dcb70798 100644 --- a/translate/apiv3/doc.go +++ b/translate/apiv3/doc.go @@ -40,7 +40,7 @@ import ( "google.golang.org/grpc/metadata" ) -const versionClient = "20200304" +const versionClient = "20200305" 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 0f0f2ba1a7fc..e904b8b99ecb 100644 --- a/videointelligence/apiv1/doc.go +++ b/videointelligence/apiv1/doc.go @@ -42,7 +42,7 @@ import ( "google.golang.org/grpc/metadata" ) -const versionClient = "20200304" +const versionClient = "20200305" 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 ca50818909ea..f5910502a150 100644 --- a/videointelligence/apiv1beta2/doc.go +++ b/videointelligence/apiv1beta2/doc.go @@ -44,7 +44,7 @@ import ( "google.golang.org/grpc/metadata" ) -const versionClient = "20200304" +const versionClient = "20200305" 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 f407d7c15780..0db9204f75bf 100644 --- a/vision/apiv1/doc.go +++ b/vision/apiv1/doc.go @@ -42,7 +42,7 @@ import ( "google.golang.org/grpc/metadata" ) -const versionClient = "20200304" +const versionClient = "20200305" 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 0d430f6a170f..02605cc0fca4 100644 --- a/vision/apiv1p1beta1/doc.go +++ b/vision/apiv1p1beta1/doc.go @@ -44,7 +44,7 @@ import ( "google.golang.org/grpc/metadata" ) -const versionClient = "20200304" +const versionClient = "20200305" 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 3a8fccb5cb40..3e07be827a3e 100644 --- a/webrisk/apiv1beta1/doc.go +++ b/webrisk/apiv1beta1/doc.go @@ -40,7 +40,7 @@ import ( "google.golang.org/grpc/metadata" ) -const versionClient = "20200304" +const versionClient = "20200305" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx)