diff --git a/aiplatform/apiv1beta1/deployment_resource_pool_client.go b/aiplatform/apiv1beta1/deployment_resource_pool_client.go new file mode 100644 index 000000000000..b7d88f21e72d --- /dev/null +++ b/aiplatform/apiv1beta1/deployment_resource_pool_client.go @@ -0,0 +1,943 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by protoc-gen-go_gapic. DO NOT EDIT. + +package aiplatform + +import ( + "context" + "fmt" + "math" + "net/url" + "time" + + "cloud.google.com/go/longrunning" + lroauto "cloud.google.com/go/longrunning/autogen" + gax "github.com/googleapis/gax-go/v2" + "google.golang.org/api/iterator" + "google.golang.org/api/option" + "google.golang.org/api/option/internaloption" + gtransport "google.golang.org/api/transport/grpc" + aiplatformpb "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1" + locationpb "google.golang.org/genproto/googleapis/cloud/location" + iampb "google.golang.org/genproto/googleapis/iam/v1" + longrunningpb "google.golang.org/genproto/googleapis/longrunning" + "google.golang.org/grpc" + "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/proto" +) + +var newDeploymentResourcePoolClientHook clientHook + +// DeploymentResourcePoolCallOptions contains the retry settings for each method of DeploymentResourcePoolClient. +type DeploymentResourcePoolCallOptions struct { + CreateDeploymentResourcePool []gax.CallOption + GetDeploymentResourcePool []gax.CallOption + ListDeploymentResourcePools []gax.CallOption + DeleteDeploymentResourcePool []gax.CallOption + QueryDeployedModels []gax.CallOption + GetLocation []gax.CallOption + ListLocations []gax.CallOption + GetIamPolicy []gax.CallOption + SetIamPolicy []gax.CallOption + TestIamPermissions []gax.CallOption + CancelOperation []gax.CallOption + DeleteOperation []gax.CallOption + GetOperation []gax.CallOption + ListOperations []gax.CallOption + WaitOperation []gax.CallOption +} + +func defaultDeploymentResourcePoolGRPCClientOptions() []option.ClientOption { + return []option.ClientOption{ + internaloption.WithDefaultEndpoint("aiplatform.googleapis.com:443"), + internaloption.WithDefaultMTLSEndpoint("aiplatform.mtls.googleapis.com:443"), + internaloption.WithDefaultAudience("https://aiplatform.googleapis.com/"), + internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), + option.WithGRPCDialOption(grpc.WithDefaultCallOptions( + grpc.MaxCallRecvMsgSize(math.MaxInt32))), + } +} + +func defaultDeploymentResourcePoolCallOptions() *DeploymentResourcePoolCallOptions { + return &DeploymentResourcePoolCallOptions{ + CreateDeploymentResourcePool: []gax.CallOption{}, + GetDeploymentResourcePool: []gax.CallOption{}, + ListDeploymentResourcePools: []gax.CallOption{}, + DeleteDeploymentResourcePool: []gax.CallOption{}, + QueryDeployedModels: []gax.CallOption{}, + GetLocation: []gax.CallOption{}, + ListLocations: []gax.CallOption{}, + GetIamPolicy: []gax.CallOption{}, + SetIamPolicy: []gax.CallOption{}, + TestIamPermissions: []gax.CallOption{}, + CancelOperation: []gax.CallOption{}, + DeleteOperation: []gax.CallOption{}, + GetOperation: []gax.CallOption{}, + ListOperations: []gax.CallOption{}, + WaitOperation: []gax.CallOption{}, + } +} + +// internalDeploymentResourcePoolClient is an interface that defines the methods available from Vertex AI API. +type internalDeploymentResourcePoolClient interface { + Close() error + setGoogleClientInfo(...string) + Connection() *grpc.ClientConn + CreateDeploymentResourcePool(context.Context, *aiplatformpb.CreateDeploymentResourcePoolRequest, ...gax.CallOption) (*CreateDeploymentResourcePoolOperation, error) + CreateDeploymentResourcePoolOperation(name string) *CreateDeploymentResourcePoolOperation + GetDeploymentResourcePool(context.Context, *aiplatformpb.GetDeploymentResourcePoolRequest, ...gax.CallOption) (*aiplatformpb.DeploymentResourcePool, error) + ListDeploymentResourcePools(context.Context, *aiplatformpb.ListDeploymentResourcePoolsRequest, ...gax.CallOption) *DeploymentResourcePoolIterator + DeleteDeploymentResourcePool(context.Context, *aiplatformpb.DeleteDeploymentResourcePoolRequest, ...gax.CallOption) (*DeleteDeploymentResourcePoolOperation, error) + DeleteDeploymentResourcePoolOperation(name string) *DeleteDeploymentResourcePoolOperation + QueryDeployedModels(context.Context, *aiplatformpb.QueryDeployedModelsRequest, ...gax.CallOption) *DeployedModelIterator + GetLocation(context.Context, *locationpb.GetLocationRequest, ...gax.CallOption) (*locationpb.Location, error) + ListLocations(context.Context, *locationpb.ListLocationsRequest, ...gax.CallOption) *LocationIterator + GetIamPolicy(context.Context, *iampb.GetIamPolicyRequest, ...gax.CallOption) (*iampb.Policy, error) + SetIamPolicy(context.Context, *iampb.SetIamPolicyRequest, ...gax.CallOption) (*iampb.Policy, error) + TestIamPermissions(context.Context, *iampb.TestIamPermissionsRequest, ...gax.CallOption) (*iampb.TestIamPermissionsResponse, error) + CancelOperation(context.Context, *longrunningpb.CancelOperationRequest, ...gax.CallOption) error + DeleteOperation(context.Context, *longrunningpb.DeleteOperationRequest, ...gax.CallOption) error + GetOperation(context.Context, *longrunningpb.GetOperationRequest, ...gax.CallOption) (*longrunningpb.Operation, error) + ListOperations(context.Context, *longrunningpb.ListOperationsRequest, ...gax.CallOption) *OperationIterator + WaitOperation(context.Context, *longrunningpb.WaitOperationRequest, ...gax.CallOption) (*longrunningpb.Operation, error) +} + +// DeploymentResourcePoolClient is a client for interacting with Vertex AI API. +// Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls. +// +// A service that manages the DeploymentResourcePool resource. +type DeploymentResourcePoolClient struct { + // The internal transport-dependent client. + internalClient internalDeploymentResourcePoolClient + + // The call options for this service. + CallOptions *DeploymentResourcePoolCallOptions + + // LROClient is used internally to handle long-running operations. + // It is exposed so that its CallOptions can be modified if required. + // Users should not Close this client. + LROClient *lroauto.OperationsClient +} + +// Wrapper methods routed to the internal client. + +// Close closes the connection to the API service. The user should invoke this when +// the client is no longer required. +func (c *DeploymentResourcePoolClient) Close() error { + return c.internalClient.Close() +} + +// setGoogleClientInfo sets the name and version of the application in +// the `x-goog-api-client` header passed on each request. Intended for +// use by Google-written clients. +func (c *DeploymentResourcePoolClient) setGoogleClientInfo(keyval ...string) { + c.internalClient.setGoogleClientInfo(keyval...) +} + +// Connection returns a connection to the API service. +// +// Deprecated. +func (c *DeploymentResourcePoolClient) Connection() *grpc.ClientConn { + return c.internalClient.Connection() +} + +// CreateDeploymentResourcePool create a DeploymentResourcePool. +func (c *DeploymentResourcePoolClient) CreateDeploymentResourcePool(ctx context.Context, req *aiplatformpb.CreateDeploymentResourcePoolRequest, opts ...gax.CallOption) (*CreateDeploymentResourcePoolOperation, error) { + return c.internalClient.CreateDeploymentResourcePool(ctx, req, opts...) +} + +// CreateDeploymentResourcePoolOperation returns a new CreateDeploymentResourcePoolOperation from a given name. +// The name must be that of a previously created CreateDeploymentResourcePoolOperation, possibly from a different process. +func (c *DeploymentResourcePoolClient) CreateDeploymentResourcePoolOperation(name string) *CreateDeploymentResourcePoolOperation { + return c.internalClient.CreateDeploymentResourcePoolOperation(name) +} + +// GetDeploymentResourcePool get a DeploymentResourcePool. +func (c *DeploymentResourcePoolClient) GetDeploymentResourcePool(ctx context.Context, req *aiplatformpb.GetDeploymentResourcePoolRequest, opts ...gax.CallOption) (*aiplatformpb.DeploymentResourcePool, error) { + return c.internalClient.GetDeploymentResourcePool(ctx, req, opts...) +} + +// ListDeploymentResourcePools list DeploymentResourcePools in a location. +func (c *DeploymentResourcePoolClient) ListDeploymentResourcePools(ctx context.Context, req *aiplatformpb.ListDeploymentResourcePoolsRequest, opts ...gax.CallOption) *DeploymentResourcePoolIterator { + return c.internalClient.ListDeploymentResourcePools(ctx, req, opts...) +} + +// DeleteDeploymentResourcePool delete a DeploymentResourcePool. +func (c *DeploymentResourcePoolClient) DeleteDeploymentResourcePool(ctx context.Context, req *aiplatformpb.DeleteDeploymentResourcePoolRequest, opts ...gax.CallOption) (*DeleteDeploymentResourcePoolOperation, error) { + return c.internalClient.DeleteDeploymentResourcePool(ctx, req, opts...) +} + +// DeleteDeploymentResourcePoolOperation returns a new DeleteDeploymentResourcePoolOperation from a given name. +// The name must be that of a previously created DeleteDeploymentResourcePoolOperation, possibly from a different process. +func (c *DeploymentResourcePoolClient) DeleteDeploymentResourcePoolOperation(name string) *DeleteDeploymentResourcePoolOperation { + return c.internalClient.DeleteDeploymentResourcePoolOperation(name) +} + +// QueryDeployedModels list DeployedModels that have been deployed on this DeploymentResourcePool. +func (c *DeploymentResourcePoolClient) QueryDeployedModels(ctx context.Context, req *aiplatformpb.QueryDeployedModelsRequest, opts ...gax.CallOption) *DeployedModelIterator { + return c.internalClient.QueryDeployedModels(ctx, req, opts...) +} + +// GetLocation gets information about a location. +func (c *DeploymentResourcePoolClient) GetLocation(ctx context.Context, req *locationpb.GetLocationRequest, opts ...gax.CallOption) (*locationpb.Location, error) { + return c.internalClient.GetLocation(ctx, req, opts...) +} + +// ListLocations lists information about the supported locations for this service. +func (c *DeploymentResourcePoolClient) ListLocations(ctx context.Context, req *locationpb.ListLocationsRequest, opts ...gax.CallOption) *LocationIterator { + return c.internalClient.ListLocations(ctx, req, opts...) +} + +// GetIamPolicy gets the access control policy for a resource. Returns an empty policy +// if the resource exists and does not have a policy set. +func (c *DeploymentResourcePoolClient) GetIamPolicy(ctx context.Context, req *iampb.GetIamPolicyRequest, opts ...gax.CallOption) (*iampb.Policy, error) { + return c.internalClient.GetIamPolicy(ctx, req, opts...) +} + +// SetIamPolicy sets the access control policy on the specified resource. Replaces +// any existing policy. +// +// Can return NOT_FOUND, INVALID_ARGUMENT, and PERMISSION_DENIED +// errors. +func (c *DeploymentResourcePoolClient) SetIamPolicy(ctx context.Context, req *iampb.SetIamPolicyRequest, opts ...gax.CallOption) (*iampb.Policy, error) { + return c.internalClient.SetIamPolicy(ctx, req, opts...) +} + +// TestIamPermissions returns permissions that a caller has on the specified resource. If the +// resource does not exist, this will return an empty set of +// permissions, not a NOT_FOUND error. +// +// Note: This operation is designed to be used for building +// permission-aware UIs and command-line tools, not for authorization +// checking. This operation may “fail open” without warning. +func (c *DeploymentResourcePoolClient) TestIamPermissions(ctx context.Context, req *iampb.TestIamPermissionsRequest, opts ...gax.CallOption) (*iampb.TestIamPermissionsResponse, error) { + return c.internalClient.TestIamPermissions(ctx, req, opts...) +} + +// CancelOperation is a utility method from google.longrunning.Operations. +func (c *DeploymentResourcePoolClient) CancelOperation(ctx context.Context, req *longrunningpb.CancelOperationRequest, opts ...gax.CallOption) error { + return c.internalClient.CancelOperation(ctx, req, opts...) +} + +// DeleteOperation is a utility method from google.longrunning.Operations. +func (c *DeploymentResourcePoolClient) DeleteOperation(ctx context.Context, req *longrunningpb.DeleteOperationRequest, opts ...gax.CallOption) error { + return c.internalClient.DeleteOperation(ctx, req, opts...) +} + +// GetOperation is a utility method from google.longrunning.Operations. +func (c *DeploymentResourcePoolClient) GetOperation(ctx context.Context, req *longrunningpb.GetOperationRequest, opts ...gax.CallOption) (*longrunningpb.Operation, error) { + return c.internalClient.GetOperation(ctx, req, opts...) +} + +// ListOperations is a utility method from google.longrunning.Operations. +func (c *DeploymentResourcePoolClient) ListOperations(ctx context.Context, req *longrunningpb.ListOperationsRequest, opts ...gax.CallOption) *OperationIterator { + return c.internalClient.ListOperations(ctx, req, opts...) +} + +// WaitOperation is a utility method from google.longrunning.Operations. +func (c *DeploymentResourcePoolClient) WaitOperation(ctx context.Context, req *longrunningpb.WaitOperationRequest, opts ...gax.CallOption) (*longrunningpb.Operation, error) { + return c.internalClient.WaitOperation(ctx, req, opts...) +} + +// deploymentResourcePoolGRPCClient is a client for interacting with Vertex AI API over gRPC transport. +// +// Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls. +type deploymentResourcePoolGRPCClient struct { + // Connection pool of gRPC connections to the service. + connPool gtransport.ConnPool + + // flag to opt out of default deadlines via GOOGLE_API_GO_EXPERIMENTAL_DISABLE_DEFAULT_DEADLINE + disableDeadlines bool + + // Points back to the CallOptions field of the containing DeploymentResourcePoolClient + CallOptions **DeploymentResourcePoolCallOptions + + // The gRPC API client. + deploymentResourcePoolClient aiplatformpb.DeploymentResourcePoolServiceClient + + // LROClient is used internally to handle long-running operations. + // It is exposed so that its CallOptions can be modified if required. + // Users should not Close this client. + LROClient **lroauto.OperationsClient + + operationsClient longrunningpb.OperationsClient + + iamPolicyClient iampb.IAMPolicyClient + + locationsClient locationpb.LocationsClient + + // The x-goog-* metadata to be sent with each request. + xGoogMetadata metadata.MD +} + +// NewDeploymentResourcePoolClient creates a new deployment resource pool service client based on gRPC. +// The returned client must be Closed when it is done being used to clean up its underlying connections. +// +// A service that manages the DeploymentResourcePool resource. +func NewDeploymentResourcePoolClient(ctx context.Context, opts ...option.ClientOption) (*DeploymentResourcePoolClient, error) { + clientOpts := defaultDeploymentResourcePoolGRPCClientOptions() + if newDeploymentResourcePoolClientHook != nil { + hookOpts, err := newDeploymentResourcePoolClientHook(ctx, clientHookParams{}) + if err != nil { + return nil, err + } + clientOpts = append(clientOpts, hookOpts...) + } + + disableDeadlines, err := checkDisableDeadlines() + if err != nil { + return nil, err + } + + connPool, err := gtransport.DialPool(ctx, append(clientOpts, opts...)...) + if err != nil { + return nil, err + } + client := DeploymentResourcePoolClient{CallOptions: defaultDeploymentResourcePoolCallOptions()} + + c := &deploymentResourcePoolGRPCClient{ + connPool: connPool, + disableDeadlines: disableDeadlines, + deploymentResourcePoolClient: aiplatformpb.NewDeploymentResourcePoolServiceClient(connPool), + CallOptions: &client.CallOptions, + operationsClient: longrunningpb.NewOperationsClient(connPool), + iamPolicyClient: iampb.NewIAMPolicyClient(connPool), + locationsClient: locationpb.NewLocationsClient(connPool), + } + c.setGoogleClientInfo() + + client.internalClient = c + + client.LROClient, err = lroauto.NewOperationsClient(ctx, gtransport.WithConnPool(connPool)) + if err != nil { + // This error "should not happen", since we are just reusing old connection pool + // and never actually need to dial. + // If this does happen, we could leak connp. However, we cannot close conn: + // If the user invoked the constructor with option.WithGRPCConn, + // we would close a connection that's still in use. + // TODO: investigate error conditions. + return nil, err + } + c.LROClient = &client.LROClient + return &client, nil +} + +// Connection returns a connection to the API service. +// +// Deprecated. +func (c *deploymentResourcePoolGRPCClient) Connection() *grpc.ClientConn { + return c.connPool.Conn() +} + +// setGoogleClientInfo sets the name and version of the application in +// the `x-goog-api-client` header passed on each request. Intended for +// use by Google-written clients. +func (c *deploymentResourcePoolGRPCClient) setGoogleClientInfo(keyval ...string) { + kv := append([]string{"gl-go", versionGo()}, keyval...) + kv = append(kv, "gapic", getVersionClient(), "gax", gax.Version, "grpc", grpc.Version) + c.xGoogMetadata = metadata.Pairs("x-goog-api-client", gax.XGoogHeader(kv...)) +} + +// Close closes the connection to the API service. The user should invoke this when +// the client is no longer required. +func (c *deploymentResourcePoolGRPCClient) Close() error { + return c.connPool.Close() +} + +func (c *deploymentResourcePoolGRPCClient) CreateDeploymentResourcePool(ctx context.Context, req *aiplatformpb.CreateDeploymentResourcePoolRequest, opts ...gax.CallOption) (*CreateDeploymentResourcePoolOperation, 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).CreateDeploymentResourcePool[0:len((*c.CallOptions).CreateDeploymentResourcePool):len((*c.CallOptions).CreateDeploymentResourcePool)], opts...) + var resp *longrunningpb.Operation + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + resp, err = c.deploymentResourcePoolClient.CreateDeploymentResourcePool(ctx, req, settings.GRPC...) + return err + }, opts...) + if err != nil { + return nil, err + } + return &CreateDeploymentResourcePoolOperation{ + lro: longrunning.InternalNewOperation(*c.LROClient, resp), + }, nil +} + +func (c *deploymentResourcePoolGRPCClient) GetDeploymentResourcePool(ctx context.Context, req *aiplatformpb.GetDeploymentResourcePoolRequest, opts ...gax.CallOption) (*aiplatformpb.DeploymentResourcePool, 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).GetDeploymentResourcePool[0:len((*c.CallOptions).GetDeploymentResourcePool):len((*c.CallOptions).GetDeploymentResourcePool)], opts...) + var resp *aiplatformpb.DeploymentResourcePool + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + resp, err = c.deploymentResourcePoolClient.GetDeploymentResourcePool(ctx, req, settings.GRPC...) + return err + }, opts...) + if err != nil { + return nil, err + } + return resp, nil +} + +func (c *deploymentResourcePoolGRPCClient) ListDeploymentResourcePools(ctx context.Context, req *aiplatformpb.ListDeploymentResourcePoolsRequest, opts ...gax.CallOption) *DeploymentResourcePoolIterator { + 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).ListDeploymentResourcePools[0:len((*c.CallOptions).ListDeploymentResourcePools):len((*c.CallOptions).ListDeploymentResourcePools)], opts...) + it := &DeploymentResourcePoolIterator{} + req = proto.Clone(req).(*aiplatformpb.ListDeploymentResourcePoolsRequest) + it.InternalFetch = func(pageSize int, pageToken string) ([]*aiplatformpb.DeploymentResourcePool, string, error) { + resp := &aiplatformpb.ListDeploymentResourcePoolsResponse{} + if pageToken != "" { + req.PageToken = pageToken + } + if pageSize > math.MaxInt32 { + req.PageSize = math.MaxInt32 + } else if pageSize != 0 { + req.PageSize = int32(pageSize) + } + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + resp, err = c.deploymentResourcePoolClient.ListDeploymentResourcePools(ctx, req, settings.GRPC...) + return err + }, opts...) + if err != nil { + return nil, "", err + } + + it.Response = resp + return resp.GetDeploymentResourcePools(), resp.GetNextPageToken(), nil + } + fetch := func(pageSize int, pageToken string) (string, error) { + items, nextPageToken, err := it.InternalFetch(pageSize, pageToken) + if err != nil { + return "", err + } + it.items = append(it.items, items...) + return nextPageToken, nil + } + + it.pageInfo, it.nextFunc = iterator.NewPageInfo(fetch, it.bufLen, it.takeBuf) + it.pageInfo.MaxSize = int(req.GetPageSize()) + it.pageInfo.Token = req.GetPageToken() + + return it +} + +func (c *deploymentResourcePoolGRPCClient) DeleteDeploymentResourcePool(ctx context.Context, req *aiplatformpb.DeleteDeploymentResourcePoolRequest, opts ...gax.CallOption) (*DeleteDeploymentResourcePoolOperation, 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).DeleteDeploymentResourcePool[0:len((*c.CallOptions).DeleteDeploymentResourcePool):len((*c.CallOptions).DeleteDeploymentResourcePool)], opts...) + var resp *longrunningpb.Operation + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + resp, err = c.deploymentResourcePoolClient.DeleteDeploymentResourcePool(ctx, req, settings.GRPC...) + return err + }, opts...) + if err != nil { + return nil, err + } + return &DeleteDeploymentResourcePoolOperation{ + lro: longrunning.InternalNewOperation(*c.LROClient, resp), + }, nil +} + +func (c *deploymentResourcePoolGRPCClient) QueryDeployedModels(ctx context.Context, req *aiplatformpb.QueryDeployedModelsRequest, opts ...gax.CallOption) *DeployedModelIterator { + md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "deployment_resource_pool", url.QueryEscape(req.GetDeploymentResourcePool()))) + + ctx = insertMetadata(ctx, c.xGoogMetadata, md) + opts = append((*c.CallOptions).QueryDeployedModels[0:len((*c.CallOptions).QueryDeployedModels):len((*c.CallOptions).QueryDeployedModels)], opts...) + it := &DeployedModelIterator{} + req = proto.Clone(req).(*aiplatformpb.QueryDeployedModelsRequest) + it.InternalFetch = func(pageSize int, pageToken string) ([]*aiplatformpb.DeployedModel, string, error) { + resp := &aiplatformpb.QueryDeployedModelsResponse{} + if pageToken != "" { + req.PageToken = pageToken + } + if pageSize > math.MaxInt32 { + req.PageSize = math.MaxInt32 + } else if pageSize != 0 { + req.PageSize = int32(pageSize) + } + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + resp, err = c.deploymentResourcePoolClient.QueryDeployedModels(ctx, req, settings.GRPC...) + return err + }, opts...) + if err != nil { + return nil, "", err + } + + it.Response = resp + return resp.GetDeployedModels(), resp.GetNextPageToken(), nil + } + fetch := func(pageSize int, pageToken string) (string, error) { + items, nextPageToken, err := it.InternalFetch(pageSize, pageToken) + if err != nil { + return "", err + } + it.items = append(it.items, items...) + return nextPageToken, nil + } + + it.pageInfo, it.nextFunc = iterator.NewPageInfo(fetch, it.bufLen, it.takeBuf) + it.pageInfo.MaxSize = int(req.GetPageSize()) + it.pageInfo.Token = req.GetPageToken() + + return it +} + +func (c *deploymentResourcePoolGRPCClient) GetLocation(ctx context.Context, req *locationpb.GetLocationRequest, opts ...gax.CallOption) (*locationpb.Location, 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).GetLocation[0:len((*c.CallOptions).GetLocation):len((*c.CallOptions).GetLocation)], opts...) + var resp *locationpb.Location + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + resp, err = c.locationsClient.GetLocation(ctx, req, settings.GRPC...) + return err + }, opts...) + if err != nil { + return nil, err + } + return resp, nil +} + +func (c *deploymentResourcePoolGRPCClient) ListLocations(ctx context.Context, req *locationpb.ListLocationsRequest, opts ...gax.CallOption) *LocationIterator { + 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).ListLocations[0:len((*c.CallOptions).ListLocations):len((*c.CallOptions).ListLocations)], opts...) + it := &LocationIterator{} + req = proto.Clone(req).(*locationpb.ListLocationsRequest) + it.InternalFetch = func(pageSize int, pageToken string) ([]*locationpb.Location, string, error) { + resp := &locationpb.ListLocationsResponse{} + if pageToken != "" { + req.PageToken = pageToken + } + if pageSize > math.MaxInt32 { + req.PageSize = math.MaxInt32 + } else if pageSize != 0 { + req.PageSize = int32(pageSize) + } + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + resp, err = c.locationsClient.ListLocations(ctx, req, settings.GRPC...) + return err + }, opts...) + if err != nil { + return nil, "", err + } + + it.Response = resp + return resp.GetLocations(), resp.GetNextPageToken(), nil + } + fetch := func(pageSize int, pageToken string) (string, error) { + items, nextPageToken, err := it.InternalFetch(pageSize, pageToken) + if err != nil { + return "", err + } + it.items = append(it.items, items...) + return nextPageToken, nil + } + + it.pageInfo, it.nextFunc = iterator.NewPageInfo(fetch, it.bufLen, it.takeBuf) + it.pageInfo.MaxSize = int(req.GetPageSize()) + it.pageInfo.Token = req.GetPageToken() + + return it +} + +func (c *deploymentResourcePoolGRPCClient) GetIamPolicy(ctx context.Context, req *iampb.GetIamPolicyRequest, opts ...gax.CallOption) (*iampb.Policy, error) { + md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "resource", url.QueryEscape(req.GetResource()))) + + ctx = insertMetadata(ctx, c.xGoogMetadata, md) + opts = append((*c.CallOptions).GetIamPolicy[0:len((*c.CallOptions).GetIamPolicy):len((*c.CallOptions).GetIamPolicy)], opts...) + var resp *iampb.Policy + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + resp, err = c.iamPolicyClient.GetIamPolicy(ctx, req, settings.GRPC...) + return err + }, opts...) + if err != nil { + return nil, err + } + return resp, nil +} + +func (c *deploymentResourcePoolGRPCClient) SetIamPolicy(ctx context.Context, req *iampb.SetIamPolicyRequest, opts ...gax.CallOption) (*iampb.Policy, error) { + md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "resource", url.QueryEscape(req.GetResource()))) + + ctx = insertMetadata(ctx, c.xGoogMetadata, md) + opts = append((*c.CallOptions).SetIamPolicy[0:len((*c.CallOptions).SetIamPolicy):len((*c.CallOptions).SetIamPolicy)], opts...) + var resp *iampb.Policy + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + resp, err = c.iamPolicyClient.SetIamPolicy(ctx, req, settings.GRPC...) + return err + }, opts...) + if err != nil { + return nil, err + } + return resp, nil +} + +func (c *deploymentResourcePoolGRPCClient) TestIamPermissions(ctx context.Context, req *iampb.TestIamPermissionsRequest, opts ...gax.CallOption) (*iampb.TestIamPermissionsResponse, error) { + md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "resource", url.QueryEscape(req.GetResource()))) + + ctx = insertMetadata(ctx, c.xGoogMetadata, md) + opts = append((*c.CallOptions).TestIamPermissions[0:len((*c.CallOptions).TestIamPermissions):len((*c.CallOptions).TestIamPermissions)], opts...) + var resp *iampb.TestIamPermissionsResponse + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + resp, err = c.iamPolicyClient.TestIamPermissions(ctx, req, settings.GRPC...) + return err + }, opts...) + if err != nil { + return nil, err + } + return resp, nil +} + +func (c *deploymentResourcePoolGRPCClient) CancelOperation(ctx context.Context, req *longrunningpb.CancelOperationRequest, opts ...gax.CallOption) error { + md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))) + + ctx = insertMetadata(ctx, c.xGoogMetadata, md) + opts = append((*c.CallOptions).CancelOperation[0:len((*c.CallOptions).CancelOperation):len((*c.CallOptions).CancelOperation)], opts...) + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + _, err = c.operationsClient.CancelOperation(ctx, req, settings.GRPC...) + return err + }, opts...) + return err +} + +func (c *deploymentResourcePoolGRPCClient) DeleteOperation(ctx context.Context, req *longrunningpb.DeleteOperationRequest, opts ...gax.CallOption) error { + md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))) + + ctx = insertMetadata(ctx, c.xGoogMetadata, md) + opts = append((*c.CallOptions).DeleteOperation[0:len((*c.CallOptions).DeleteOperation):len((*c.CallOptions).DeleteOperation)], opts...) + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + _, err = c.operationsClient.DeleteOperation(ctx, req, settings.GRPC...) + return err + }, opts...) + return err +} + +func (c *deploymentResourcePoolGRPCClient) GetOperation(ctx context.Context, req *longrunningpb.GetOperationRequest, opts ...gax.CallOption) (*longrunningpb.Operation, error) { + md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))) + + ctx = insertMetadata(ctx, c.xGoogMetadata, md) + opts = append((*c.CallOptions).GetOperation[0:len((*c.CallOptions).GetOperation):len((*c.CallOptions).GetOperation)], opts...) + var resp *longrunningpb.Operation + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + resp, err = c.operationsClient.GetOperation(ctx, req, settings.GRPC...) + return err + }, opts...) + if err != nil { + return nil, err + } + return resp, nil +} + +func (c *deploymentResourcePoolGRPCClient) ListOperations(ctx context.Context, req *longrunningpb.ListOperationsRequest, opts ...gax.CallOption) *OperationIterator { + md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))) + + ctx = insertMetadata(ctx, c.xGoogMetadata, md) + opts = append((*c.CallOptions).ListOperations[0:len((*c.CallOptions).ListOperations):len((*c.CallOptions).ListOperations)], opts...) + it := &OperationIterator{} + req = proto.Clone(req).(*longrunningpb.ListOperationsRequest) + it.InternalFetch = func(pageSize int, pageToken string) ([]*longrunningpb.Operation, string, error) { + resp := &longrunningpb.ListOperationsResponse{} + if pageToken != "" { + req.PageToken = pageToken + } + if pageSize > math.MaxInt32 { + req.PageSize = math.MaxInt32 + } else if pageSize != 0 { + req.PageSize = int32(pageSize) + } + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + resp, err = c.operationsClient.ListOperations(ctx, req, settings.GRPC...) + return err + }, opts...) + if err != nil { + return nil, "", err + } + + it.Response = resp + return resp.GetOperations(), resp.GetNextPageToken(), nil + } + fetch := func(pageSize int, pageToken string) (string, error) { + items, nextPageToken, err := it.InternalFetch(pageSize, pageToken) + if err != nil { + return "", err + } + it.items = append(it.items, items...) + return nextPageToken, nil + } + + it.pageInfo, it.nextFunc = iterator.NewPageInfo(fetch, it.bufLen, it.takeBuf) + it.pageInfo.MaxSize = int(req.GetPageSize()) + it.pageInfo.Token = req.GetPageToken() + + return it +} + +func (c *deploymentResourcePoolGRPCClient) WaitOperation(ctx context.Context, req *longrunningpb.WaitOperationRequest, opts ...gax.CallOption) (*longrunningpb.Operation, error) { + md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))) + + ctx = insertMetadata(ctx, c.xGoogMetadata, md) + opts = append((*c.CallOptions).WaitOperation[0:len((*c.CallOptions).WaitOperation):len((*c.CallOptions).WaitOperation)], opts...) + var resp *longrunningpb.Operation + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + resp, err = c.operationsClient.WaitOperation(ctx, req, settings.GRPC...) + return err + }, opts...) + if err != nil { + return nil, err + } + return resp, nil +} + +// CreateDeploymentResourcePoolOperation manages a long-running operation from CreateDeploymentResourcePool. +type CreateDeploymentResourcePoolOperation struct { + lro *longrunning.Operation +} + +// CreateDeploymentResourcePoolOperation returns a new CreateDeploymentResourcePoolOperation from a given name. +// The name must be that of a previously created CreateDeploymentResourcePoolOperation, possibly from a different process. +func (c *deploymentResourcePoolGRPCClient) CreateDeploymentResourcePoolOperation(name string) *CreateDeploymentResourcePoolOperation { + return &CreateDeploymentResourcePoolOperation{ + lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}), + } +} + +// Wait blocks until the long-running operation is completed, returning the response and any errors encountered. +// +// See documentation of Poll for error-handling information. +func (op *CreateDeploymentResourcePoolOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*aiplatformpb.DeploymentResourcePool, error) { + var resp aiplatformpb.DeploymentResourcePool + if err := op.lro.WaitWithInterval(ctx, &resp, time.Minute, opts...); err != nil { + return nil, err + } + return &resp, nil +} + +// Poll fetches the latest state of the long-running operation. +// +// Poll also fetches the latest metadata, which can be retrieved by Metadata. +// +// If Poll fails, the error is returned and op is unmodified. If Poll succeeds and +// the operation has completed with failure, the error is returned and op.Done will return true. +// If Poll succeeds and the operation has completed successfully, +// op.Done will return true, and the response of the operation is returned. +// If Poll succeeds and the operation has not completed, the returned response and error are both nil. +func (op *CreateDeploymentResourcePoolOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*aiplatformpb.DeploymentResourcePool, error) { + var resp aiplatformpb.DeploymentResourcePool + if err := op.lro.Poll(ctx, &resp, opts...); err != nil { + return nil, err + } + if !op.Done() { + return nil, nil + } + return &resp, nil +} + +// Metadata returns metadata associated with the long-running operation. +// Metadata itself does not contact the server, but Poll does. +// To get the latest metadata, call this method after a successful call to Poll. +// If the metadata is not available, the returned metadata and error are both nil. +func (op *CreateDeploymentResourcePoolOperation) Metadata() (*aiplatformpb.CreateDeploymentResourcePoolOperationMetadata, error) { + var meta aiplatformpb.CreateDeploymentResourcePoolOperationMetadata + if err := op.lro.Metadata(&meta); err == longrunning.ErrNoMetadata { + return nil, nil + } else if err != nil { + return nil, err + } + return &meta, nil +} + +// Done reports whether the long-running operation has completed. +func (op *CreateDeploymentResourcePoolOperation) Done() bool { + return op.lro.Done() +} + +// Name returns the name of the long-running operation. +// The name is assigned by the server and is unique within the service from which the operation is created. +func (op *CreateDeploymentResourcePoolOperation) Name() string { + return op.lro.Name() +} + +// DeleteDeploymentResourcePoolOperation manages a long-running operation from DeleteDeploymentResourcePool. +type DeleteDeploymentResourcePoolOperation struct { + lro *longrunning.Operation +} + +// DeleteDeploymentResourcePoolOperation returns a new DeleteDeploymentResourcePoolOperation from a given name. +// The name must be that of a previously created DeleteDeploymentResourcePoolOperation, possibly from a different process. +func (c *deploymentResourcePoolGRPCClient) DeleteDeploymentResourcePoolOperation(name string) *DeleteDeploymentResourcePoolOperation { + return &DeleteDeploymentResourcePoolOperation{ + lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}), + } +} + +// Wait blocks until the long-running operation is completed, returning the response and any errors encountered. +// +// See documentation of Poll for error-handling information. +func (op *DeleteDeploymentResourcePoolOperation) Wait(ctx context.Context, opts ...gax.CallOption) error { + return op.lro.WaitWithInterval(ctx, nil, time.Minute, opts...) +} + +// Poll fetches the latest state of the long-running operation. +// +// Poll also fetches the latest metadata, which can be retrieved by Metadata. +// +// If Poll fails, the error is returned and op is unmodified. If Poll succeeds and +// the operation has completed with failure, the error is returned and op.Done will return true. +// If Poll succeeds and the operation has completed successfully, +// op.Done will return true, and the response of the operation is returned. +// If Poll succeeds and the operation has not completed, the returned response and error are both nil. +func (op *DeleteDeploymentResourcePoolOperation) Poll(ctx context.Context, opts ...gax.CallOption) error { + return op.lro.Poll(ctx, nil, opts...) +} + +// Metadata returns metadata associated with the long-running operation. +// Metadata itself does not contact the server, but Poll does. +// To get the latest metadata, call this method after a successful call to Poll. +// If the metadata is not available, the returned metadata and error are both nil. +func (op *DeleteDeploymentResourcePoolOperation) Metadata() (*aiplatformpb.DeleteOperationMetadata, error) { + var meta aiplatformpb.DeleteOperationMetadata + if err := op.lro.Metadata(&meta); err == longrunning.ErrNoMetadata { + return nil, nil + } else if err != nil { + return nil, err + } + return &meta, nil +} + +// Done reports whether the long-running operation has completed. +func (op *DeleteDeploymentResourcePoolOperation) Done() bool { + return op.lro.Done() +} + +// Name returns the name of the long-running operation. +// The name is assigned by the server and is unique within the service from which the operation is created. +func (op *DeleteDeploymentResourcePoolOperation) Name() string { + return op.lro.Name() +} + +// DeployedModelIterator manages a stream of *aiplatformpb.DeployedModel. +type DeployedModelIterator struct { + items []*aiplatformpb.DeployedModel + 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 []*aiplatformpb.DeployedModel, nextPageToken string, err error) +} + +// PageInfo supports pagination. See the google.golang.org/api/iterator package for details. +func (it *DeployedModelIterator) 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 *DeployedModelIterator) Next() (*aiplatformpb.DeployedModel, error) { + var item *aiplatformpb.DeployedModel + if err := it.nextFunc(); err != nil { + return item, err + } + item = it.items[0] + it.items = it.items[1:] + return item, nil +} + +func (it *DeployedModelIterator) bufLen() int { + return len(it.items) +} + +func (it *DeployedModelIterator) takeBuf() interface{} { + b := it.items + it.items = nil + return b +} + +// DeploymentResourcePoolIterator manages a stream of *aiplatformpb.DeploymentResourcePool. +type DeploymentResourcePoolIterator struct { + items []*aiplatformpb.DeploymentResourcePool + 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 []*aiplatformpb.DeploymentResourcePool, nextPageToken string, err error) +} + +// PageInfo supports pagination. See the google.golang.org/api/iterator package for details. +func (it *DeploymentResourcePoolIterator) 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 *DeploymentResourcePoolIterator) Next() (*aiplatformpb.DeploymentResourcePool, error) { + var item *aiplatformpb.DeploymentResourcePool + if err := it.nextFunc(); err != nil { + return item, err + } + item = it.items[0] + it.items = it.items[1:] + return item, nil +} + +func (it *DeploymentResourcePoolIterator) bufLen() int { + return len(it.items) +} + +func (it *DeploymentResourcePoolIterator) takeBuf() interface{} { + b := it.items + it.items = nil + return b +} diff --git a/aiplatform/apiv1beta1/deployment_resource_pool_client_example_test.go b/aiplatform/apiv1beta1/deployment_resource_pool_client_example_test.go new file mode 100644 index 000000000000..4a5c81d98400 --- /dev/null +++ b/aiplatform/apiv1beta1/deployment_resource_pool_client_example_test.go @@ -0,0 +1,368 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by protoc-gen-go_gapic. DO NOT EDIT. + +package aiplatform_test + +import ( + "context" + + aiplatform "cloud.google.com/go/aiplatform/apiv1beta1" + "google.golang.org/api/iterator" + aiplatformpb "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1" + locationpb "google.golang.org/genproto/googleapis/cloud/location" + iampb "google.golang.org/genproto/googleapis/iam/v1" + longrunningpb "google.golang.org/genproto/googleapis/longrunning" +) + +func ExampleNewDeploymentResourcePoolClient() { + ctx := context.Background() + c, err := aiplatform.NewDeploymentResourcePoolClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + // TODO: Use client. + _ = c +} + +func ExampleDeploymentResourcePoolClient_CreateDeploymentResourcePool() { + ctx := context.Background() + c, err := aiplatform.NewDeploymentResourcePoolClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &aiplatformpb.CreateDeploymentResourcePoolRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1#CreateDeploymentResourcePoolRequest. + } + op, err := c.CreateDeploymentResourcePool(ctx, req) + if err != nil { + // TODO: Handle error. + } + + resp, err := op.Wait(ctx) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleDeploymentResourcePoolClient_GetDeploymentResourcePool() { + ctx := context.Background() + c, err := aiplatform.NewDeploymentResourcePoolClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &aiplatformpb.GetDeploymentResourcePoolRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1#GetDeploymentResourcePoolRequest. + } + resp, err := c.GetDeploymentResourcePool(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleDeploymentResourcePoolClient_ListDeploymentResourcePools() { + ctx := context.Background() + c, err := aiplatform.NewDeploymentResourcePoolClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &aiplatformpb.ListDeploymentResourcePoolsRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1#ListDeploymentResourcePoolsRequest. + } + it := c.ListDeploymentResourcePools(ctx, req) + for { + resp, err := it.Next() + if err == iterator.Done { + break + } + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp + } +} + +func ExampleDeploymentResourcePoolClient_DeleteDeploymentResourcePool() { + ctx := context.Background() + c, err := aiplatform.NewDeploymentResourcePoolClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &aiplatformpb.DeleteDeploymentResourcePoolRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1#DeleteDeploymentResourcePoolRequest. + } + op, err := c.DeleteDeploymentResourcePool(ctx, req) + if err != nil { + // TODO: Handle error. + } + + err = op.Wait(ctx) + if err != nil { + // TODO: Handle error. + } +} + +func ExampleDeploymentResourcePoolClient_QueryDeployedModels() { + ctx := context.Background() + c, err := aiplatform.NewDeploymentResourcePoolClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &aiplatformpb.QueryDeployedModelsRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1#QueryDeployedModelsRequest. + } + it := c.QueryDeployedModels(ctx, req) + for { + resp, err := it.Next() + if err == iterator.Done { + break + } + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp + } +} + +func ExampleDeploymentResourcePoolClient_GetLocation() { + ctx := context.Background() + c, err := aiplatform.NewDeploymentResourcePoolClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &locationpb.GetLocationRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/location#GetLocationRequest. + } + resp, err := c.GetLocation(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleDeploymentResourcePoolClient_ListLocations() { + ctx := context.Background() + c, err := aiplatform.NewDeploymentResourcePoolClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &locationpb.ListLocationsRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/location#ListLocationsRequest. + } + it := c.ListLocations(ctx, req) + for { + resp, err := it.Next() + if err == iterator.Done { + break + } + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp + } +} + +func ExampleDeploymentResourcePoolClient_GetIamPolicy() { + ctx := context.Background() + c, err := aiplatform.NewDeploymentResourcePoolClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &iampb.GetIamPolicyRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/iam/v1#GetIamPolicyRequest. + } + resp, err := c.GetIamPolicy(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleDeploymentResourcePoolClient_SetIamPolicy() { + ctx := context.Background() + c, err := aiplatform.NewDeploymentResourcePoolClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &iampb.SetIamPolicyRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/iam/v1#SetIamPolicyRequest. + } + resp, err := c.SetIamPolicy(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleDeploymentResourcePoolClient_TestIamPermissions() { + ctx := context.Background() + c, err := aiplatform.NewDeploymentResourcePoolClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &iampb.TestIamPermissionsRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/iam/v1#TestIamPermissionsRequest. + } + resp, err := c.TestIamPermissions(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleDeploymentResourcePoolClient_CancelOperation() { + ctx := context.Background() + c, err := aiplatform.NewDeploymentResourcePoolClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &longrunningpb.CancelOperationRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/longrunning#CancelOperationRequest. + } + err = c.CancelOperation(ctx, req) + if err != nil { + // TODO: Handle error. + } +} + +func ExampleDeploymentResourcePoolClient_DeleteOperation() { + ctx := context.Background() + c, err := aiplatform.NewDeploymentResourcePoolClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &longrunningpb.DeleteOperationRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/longrunning#DeleteOperationRequest. + } + err = c.DeleteOperation(ctx, req) + if err != nil { + // TODO: Handle error. + } +} + +func ExampleDeploymentResourcePoolClient_GetOperation() { + ctx := context.Background() + c, err := aiplatform.NewDeploymentResourcePoolClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &longrunningpb.GetOperationRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/longrunning#GetOperationRequest. + } + resp, err := c.GetOperation(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleDeploymentResourcePoolClient_ListOperations() { + ctx := context.Background() + c, err := aiplatform.NewDeploymentResourcePoolClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &longrunningpb.ListOperationsRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/longrunning#ListOperationsRequest. + } + it := c.ListOperations(ctx, req) + for { + resp, err := it.Next() + if err == iterator.Done { + break + } + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp + } +} + +func ExampleDeploymentResourcePoolClient_WaitOperation() { + ctx := context.Background() + c, err := aiplatform.NewDeploymentResourcePoolClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &longrunningpb.WaitOperationRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/longrunning#WaitOperationRequest. + } + resp, err := c.WaitOperation(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} diff --git a/aiplatform/apiv1beta1/gapic_metadata.json b/aiplatform/apiv1beta1/gapic_metadata.json index 548d1d8e554c..8ddcc92203a5 100644 --- a/aiplatform/apiv1beta1/gapic_metadata.json +++ b/aiplatform/apiv1beta1/gapic_metadata.json @@ -119,6 +119,90 @@ } } }, + "DeploymentResourcePoolService": { + "clients": { + "grpc": { + "libraryClient": "DeploymentResourcePoolClient", + "rpcs": { + "CancelOperation": { + "methods": [ + "CancelOperation" + ] + }, + "CreateDeploymentResourcePool": { + "methods": [ + "CreateDeploymentResourcePool" + ] + }, + "DeleteDeploymentResourcePool": { + "methods": [ + "DeleteDeploymentResourcePool" + ] + }, + "DeleteOperation": { + "methods": [ + "DeleteOperation" + ] + }, + "GetDeploymentResourcePool": { + "methods": [ + "GetDeploymentResourcePool" + ] + }, + "GetIamPolicy": { + "methods": [ + "GetIamPolicy" + ] + }, + "GetLocation": { + "methods": [ + "GetLocation" + ] + }, + "GetOperation": { + "methods": [ + "GetOperation" + ] + }, + "ListDeploymentResourcePools": { + "methods": [ + "ListDeploymentResourcePools" + ] + }, + "ListLocations": { + "methods": [ + "ListLocations" + ] + }, + "ListOperations": { + "methods": [ + "ListOperations" + ] + }, + "QueryDeployedModels": { + "methods": [ + "QueryDeployedModels" + ] + }, + "SetIamPolicy": { + "methods": [ + "SetIamPolicy" + ] + }, + "TestIamPermissions": { + "methods": [ + "TestIamPermissions" + ] + }, + "WaitOperation": { + "methods": [ + "WaitOperation" + ] + } + } + } + } + }, "EndpointService": { "clients": { "grpc": { diff --git a/aiplatform/go.mod b/aiplatform/go.mod index bd8fd52c1ad4..dba3f1e75ff3 100644 --- a/aiplatform/go.mod +++ b/aiplatform/go.mod @@ -5,8 +5,8 @@ go 1.17 require ( cloud.google.com/go v0.102.1 github.com/googleapis/gax-go/v2 v2.4.0 - google.golang.org/api v0.88.0 - google.golang.org/genproto v0.0.0-20220720214146-176da50484ac + google.golang.org/api v0.90.0 + google.golang.org/genproto v0.0.0-20220801145646-83ce21fca29f google.golang.org/grpc v1.48.0 google.golang.org/protobuf v1.28.0 ) diff --git a/aiplatform/go.sum b/aiplatform/go.sum index 0294ba316c73..caab97273379 100644 --- a/aiplatform/go.sum +++ b/aiplatform/go.sum @@ -499,8 +499,8 @@ google.golang.org/api v0.75.0/go.mod h1:pU9QmyHLnzlpar1Mjt4IbapUCy8J+6HD6GeELN69 google.golang.org/api v0.78.0/go.mod h1:1Sg78yoMLOhlQTeF+ARBoytAcH1NNyyl390YMy6rKmw= google.golang.org/api v0.80.0/go.mod h1:xY3nI94gbvBrE0J6NHXhxOmW97HG7Khjkku6AFB3Hyg= google.golang.org/api v0.84.0/go.mod h1:NTsGnUFJMYROtiquksZHBWtHfeMC7iYthki7Eq3pa8o= -google.golang.org/api v0.88.0 h1:MPwxQRqpyskYhr2iNyfsQ8R06eeyhe7UEuR30p136ZQ= -google.golang.org/api v0.88.0/go.mod h1:+Sem1dnrKlrXMR/X0bPnMWyluQe4RsNoYfmNLhOIkzw= +google.golang.org/api v0.90.0 h1:WMnUWAvihIClUYFNeFA69VTuR3duKS3IalMGDQcLvq8= +google.golang.org/api v0.90.0/go.mod h1:+Sem1dnrKlrXMR/X0bPnMWyluQe4RsNoYfmNLhOIkzw= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= @@ -589,8 +589,8 @@ google.golang.org/genproto v0.0.0-20220608133413-ed9918b62aac/go.mod h1:KEWEmljW google.golang.org/genproto v0.0.0-20220616135557-88e70c0c3a90/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= google.golang.org/genproto v0.0.0-20220617124728-180714bec0ad/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= google.golang.org/genproto v0.0.0-20220624142145-8cd45d7dbd1f/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= -google.golang.org/genproto v0.0.0-20220720214146-176da50484ac h1:EOa+Yrhx1C0O+4pHeXeWrCwdI0tWI6IfUU56Vebs9wQ= -google.golang.org/genproto v0.0.0-20220720214146-176da50484ac/go.mod h1:GkXuJDJ6aQ7lnJcRF+SJVgFdQhypqgl3LB1C9vabdRE= +google.golang.org/genproto v0.0.0-20220801145646-83ce21fca29f h1:XVHpVMvPs4MtH3h6cThzKs2snNexcfd35vQx2T3IuIY= +google.golang.org/genproto v0.0.0-20220801145646-83ce21fca29f/go.mod h1:iHe1svFLAZg9VWz891+QbRMwUv9O/1Ww+/mngYeThbc= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= diff --git a/analytics/go.mod b/analytics/go.mod index f2a89576c7d5..55b7b00fa2c8 100644 --- a/analytics/go.mod +++ b/analytics/go.mod @@ -4,8 +4,8 @@ go 1.17 require ( github.com/googleapis/gax-go/v2 v2.4.0 - google.golang.org/api v0.85.0 - google.golang.org/genproto v0.0.0-20220623142657-077d458a5694 + google.golang.org/api v0.90.0 + google.golang.org/genproto v0.0.0-20220801145646-83ce21fca29f google.golang.org/grpc v1.48.0 google.golang.org/protobuf v1.28.0 ) @@ -17,9 +17,9 @@ require ( github.com/google/go-cmp v0.5.8 // indirect github.com/googleapis/enterprise-certificate-proxy v0.1.0 // indirect go.opencensus.io v0.23.0 // indirect - golang.org/x/net v0.0.0-20220617184016-355a448f1bc9 // indirect - golang.org/x/oauth2 v0.0.0-20220608161450-d0670ef3b1eb // indirect - golang.org/x/sys v0.0.0-20220615213510-4f61da869c0c // indirect + golang.org/x/net v0.0.0-20220624214902-1bab6f366d9e // indirect + golang.org/x/oauth2 v0.0.0-20220622183110-fd043fe589d2 // indirect + golang.org/x/sys v0.0.0-20220624220833-87e55d714810 // indirect golang.org/x/text v0.3.7 // indirect google.golang.org/appengine v1.6.7 // indirect ) diff --git a/analytics/go.sum b/analytics/go.sum index daf92c558c09..73927e22c07d 100644 --- a/analytics/go.sum +++ b/analytics/go.sum @@ -161,6 +161,7 @@ github.com/google/pprof v0.0.0-20210609004039-a478d1d731e9/go.mod h1:kpwsk12EmLe github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/enterprise-certificate-proxy v0.0.0-20220520183353-fd19c99a87aa/go.mod h1:17drOmN3MwGY7t0e+Ei9b45FFGA3fBs3x36SsCg1hq8= github.com/googleapis/enterprise-certificate-proxy v0.1.0 h1:zO8WHNx/MYiAKJ3d5spxZXZE6KHmIQGQcAzwUzV7qQw= github.com/googleapis/enterprise-certificate-proxy v0.1.0/go.mod h1:17drOmN3MwGY7t0e+Ei9b45FFGA3fBs3x36SsCg1hq8= @@ -289,8 +290,8 @@ golang.org/x/net v0.0.0-20220325170049-de3da57026de/go.mod h1:CfG3xpIq0wQ8r1q4Su golang.org/x/net v0.0.0-20220412020605-290c469a71a5/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220607020251-c690dde0001d/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.0.0-20220617184016-355a448f1bc9 h1:Yqz/iviulwKwAREEeUd3nbBFn0XuyJqkoft2IlrvOhc= -golang.org/x/net v0.0.0-20220617184016-355a448f1bc9/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= +golang.org/x/net v0.0.0-20220624214902-1bab6f366d9e h1:TsQ7F31D3bUCLeqPT0u+yjp1guoArKaNKmCr22PYgTQ= +golang.org/x/net v0.0.0-20220624214902-1bab6f366d9e/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -310,8 +311,9 @@ golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8/go.mod h1:KelEdhl1UZF7XfJ golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= golang.org/x/oauth2 v0.0.0-20220309155454-6242fa91716a/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= golang.org/x/oauth2 v0.0.0-20220411215720-9780585627b5/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= -golang.org/x/oauth2 v0.0.0-20220608161450-d0670ef3b1eb h1:8tDJ3aechhddbdPAxpycgXHJRMLpk/Ab+aa4OgdN5/g= golang.org/x/oauth2 v0.0.0-20220608161450-d0670ef3b1eb/go.mod h1:jaDAt6Dkxork7LmZnYtzbRWj0W47D86a3TGe0YHBvmE= +golang.org/x/oauth2 v0.0.0-20220622183110-fd043fe589d2 h1:+jnHzr9VPj32ykQVai5DNahi9+NSp7yYuCsl5eAQtL0= +golang.org/x/oauth2 v0.0.0-20220622183110-fd043fe589d2/go.mod h1:jaDAt6Dkxork7LmZnYtzbRWj0W47D86a3TGe0YHBvmE= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -382,8 +384,8 @@ golang.org/x/sys v0.0.0-20220502124256-b6088ccd6cba/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220610221304-9f5ed59c137d/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220615213510-4f61da869c0c h1:aFV+BgZ4svzjfabn8ERpuB4JI4N6/rdy1iusx77G3oU= -golang.org/x/sys v0.0.0-20220615213510-4f61da869c0c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220624220833-87e55d714810 h1:rHZQSjJdAI4Xf5Qzeh2bBc5YJIkPFVM6oDtMFYmgws0= +golang.org/x/sys v0.0.0-20220624220833-87e55d714810/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -496,8 +498,8 @@ google.golang.org/api v0.75.0/go.mod h1:pU9QmyHLnzlpar1Mjt4IbapUCy8J+6HD6GeELN69 google.golang.org/api v0.78.0/go.mod h1:1Sg78yoMLOhlQTeF+ARBoytAcH1NNyyl390YMy6rKmw= google.golang.org/api v0.80.0/go.mod h1:xY3nI94gbvBrE0J6NHXhxOmW97HG7Khjkku6AFB3Hyg= google.golang.org/api v0.84.0/go.mod h1:NTsGnUFJMYROtiquksZHBWtHfeMC7iYthki7Eq3pa8o= -google.golang.org/api v0.85.0 h1:8rJoHuRxx+vCmZtAO/3k1dRLvYNVyTJtZ5oaFZvhgvc= -google.golang.org/api v0.85.0/go.mod h1:AqZf8Ep9uZ2pyTvgL+x0D3Zt0eoT9b5E8fmzfu6FO2g= +google.golang.org/api v0.90.0 h1:WMnUWAvihIClUYFNeFA69VTuR3duKS3IalMGDQcLvq8= +google.golang.org/api v0.90.0/go.mod h1:+Sem1dnrKlrXMR/X0bPnMWyluQe4RsNoYfmNLhOIkzw= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= @@ -584,9 +586,9 @@ google.golang.org/genproto v0.0.0-20220518221133-4f43b3371335/go.mod h1:RAyBrSAP google.golang.org/genproto v0.0.0-20220523171625-347a074981d8/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4= google.golang.org/genproto v0.0.0-20220608133413-ed9918b62aac/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= google.golang.org/genproto v0.0.0-20220616135557-88e70c0c3a90/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= -google.golang.org/genproto v0.0.0-20220617124728-180714bec0ad/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= -google.golang.org/genproto v0.0.0-20220623142657-077d458a5694 h1:itnFmgk4Ls5nT+mYO2ZK6F0DpKsGZLhB5BB9y5ZL2HA= -google.golang.org/genproto v0.0.0-20220623142657-077d458a5694/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= +google.golang.org/genproto v0.0.0-20220624142145-8cd45d7dbd1f/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= +google.golang.org/genproto v0.0.0-20220801145646-83ce21fca29f h1:XVHpVMvPs4MtH3h6cThzKs2snNexcfd35vQx2T3IuIY= +google.golang.org/genproto v0.0.0-20220801145646-83ce21fca29f/go.mod h1:iHe1svFLAZg9VWz891+QbRMwUv9O/1Ww+/mngYeThbc= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= diff --git a/bigquery/connection/apiv1beta1/connection_client.go b/bigquery/connection/apiv1beta1/connection_client.go index 5cd5d0e6ca47..f0acaa53fff8 100644 --- a/bigquery/connection/apiv1beta1/connection_client.go +++ b/bigquery/connection/apiv1beta1/connection_client.go @@ -249,7 +249,7 @@ func (c *Client) GetIamPolicy(ctx context.Context, req *iampb.GetIamPolicyReques // SetIamPolicy sets the access control policy on the specified resource. Replaces any // existing policy. // -// Can return Public Errors: NOT_FOUND, INVALID_ARGUMENT and PERMISSION_DENIED +// Can return NOT_FOUND, INVALID_ARGUMENT, and PERMISSION_DENIED errors. func (c *Client) SetIamPolicy(ctx context.Context, req *iampb.SetIamPolicyRequest, opts ...gax.CallOption) (*iampb.Policy, error) { return c.internalClient.SetIamPolicy(ctx, req, opts...) } @@ -995,7 +995,7 @@ func (c *restClient) GetIamPolicy(ctx context.Context, req *iampb.GetIamPolicyRe // SetIamPolicy sets the access control policy on the specified resource. Replaces any // existing policy. // -// Can return Public Errors: NOT_FOUND, INVALID_ARGUMENT and PERMISSION_DENIED +// Can return NOT_FOUND, INVALID_ARGUMENT, and PERMISSION_DENIED errors. func (c *restClient) SetIamPolicy(ctx context.Context, req *iampb.SetIamPolicyRequest, opts ...gax.CallOption) (*iampb.Policy, error) { m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true} jsonReq, err := m.Marshal(req) diff --git a/bigquery/go.mod b/bigquery/go.mod index 886dfd3347f6..fb1355e86b73 100644 --- a/bigquery/go.mod +++ b/bigquery/go.mod @@ -13,8 +13,8 @@ require ( go.opencensus.io v0.23.0 golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f golang.org/x/xerrors v0.0.0-20220609144429-65e65417b02f - google.golang.org/api v0.87.0 - google.golang.org/genproto v0.0.0-20220714211235-042d03aeabc9 + google.golang.org/api v0.90.0 + google.golang.org/genproto v0.0.0-20220801145646-83ce21fca29f google.golang.org/grpc v1.48.0 google.golang.org/protobuf v1.28.0 ) diff --git a/bigquery/go.sum b/bigquery/go.sum index 199b3e5e4b68..44a1d5731eb6 100644 --- a/bigquery/go.sum +++ b/bigquery/go.sum @@ -514,8 +514,8 @@ google.golang.org/api v0.78.0/go.mod h1:1Sg78yoMLOhlQTeF+ARBoytAcH1NNyyl390YMy6r google.golang.org/api v0.80.0/go.mod h1:xY3nI94gbvBrE0J6NHXhxOmW97HG7Khjkku6AFB3Hyg= google.golang.org/api v0.84.0/go.mod h1:NTsGnUFJMYROtiquksZHBWtHfeMC7iYthki7Eq3pa8o= google.golang.org/api v0.85.0/go.mod h1:AqZf8Ep9uZ2pyTvgL+x0D3Zt0eoT9b5E8fmzfu6FO2g= -google.golang.org/api v0.87.0 h1:pUQVF/F+X7Tl1lo4LJoJf5BOpjtmINU80p9XpYTU2p4= -google.golang.org/api v0.87.0/go.mod h1:+Sem1dnrKlrXMR/X0bPnMWyluQe4RsNoYfmNLhOIkzw= +google.golang.org/api v0.90.0 h1:WMnUWAvihIClUYFNeFA69VTuR3duKS3IalMGDQcLvq8= +google.golang.org/api v0.90.0/go.mod h1:+Sem1dnrKlrXMR/X0bPnMWyluQe4RsNoYfmNLhOIkzw= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= @@ -604,8 +604,8 @@ google.golang.org/genproto v0.0.0-20220608133413-ed9918b62aac/go.mod h1:KEWEmljW google.golang.org/genproto v0.0.0-20220616135557-88e70c0c3a90/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= google.golang.org/genproto v0.0.0-20220617124728-180714bec0ad/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= google.golang.org/genproto v0.0.0-20220624142145-8cd45d7dbd1f/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= -google.golang.org/genproto v0.0.0-20220714211235-042d03aeabc9 h1:zfXhTgBfGlIh3jMXN06W8qbhFGsh6MJNJiYEuhTddOI= -google.golang.org/genproto v0.0.0-20220714211235-042d03aeabc9/go.mod h1:GkXuJDJ6aQ7lnJcRF+SJVgFdQhypqgl3LB1C9vabdRE= +google.golang.org/genproto v0.0.0-20220801145646-83ce21fca29f h1:XVHpVMvPs4MtH3h6cThzKs2snNexcfd35vQx2T3IuIY= +google.golang.org/genproto v0.0.0-20220801145646-83ce21fca29f/go.mod h1:iHe1svFLAZg9VWz891+QbRMwUv9O/1Ww+/mngYeThbc= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= diff --git a/contactcenterinsights/apiv1/contact_center_insights_client.go b/contactcenterinsights/apiv1/contact_center_insights_client.go index 6e0512228463..8c0e3c778123 100644 --- a/contactcenterinsights/apiv1/contact_center_insights_client.go +++ b/contactcenterinsights/apiv1/contact_center_insights_client.go @@ -76,9 +76,6 @@ type CallOptions struct { ListViews []gax.CallOption UpdateView []gax.CallOption DeleteView []gax.CallOption - CancelOperation []gax.CallOption - GetOperation []gax.CallOption - ListOperations []gax.CallOption } func defaultGRPCClientOptions() []option.ClientOption { @@ -469,39 +466,6 @@ func defaultCallOptions() *CallOptions { }) }), }, - CancelOperation: []gax.CallOption{ - gax.WithRetry(func() gax.Retryer { - return gax.OnCodes([]codes.Code{ - codes.Unavailable, - }, gax.Backoff{ - Initial: 1000 * time.Millisecond, - Max: 10000 * time.Millisecond, - Multiplier: 1.30, - }) - }), - }, - GetOperation: []gax.CallOption{ - gax.WithRetry(func() gax.Retryer { - return gax.OnCodes([]codes.Code{ - codes.Unavailable, - }, gax.Backoff{ - Initial: 1000 * time.Millisecond, - Max: 10000 * time.Millisecond, - Multiplier: 1.30, - }) - }), - }, - ListOperations: []gax.CallOption{ - gax.WithRetry(func() gax.Retryer { - return gax.OnCodes([]codes.Code{ - codes.Unavailable, - }, gax.Backoff{ - Initial: 1000 * time.Millisecond, - Max: 10000 * time.Millisecond, - Multiplier: 1.30, - }) - }), - }, } } @@ -550,9 +514,6 @@ type internalClient interface { ListViews(context.Context, *contactcenterinsightspb.ListViewsRequest, ...gax.CallOption) *ViewIterator UpdateView(context.Context, *contactcenterinsightspb.UpdateViewRequest, ...gax.CallOption) (*contactcenterinsightspb.View, error) DeleteView(context.Context, *contactcenterinsightspb.DeleteViewRequest, ...gax.CallOption) error - CancelOperation(context.Context, *longrunningpb.CancelOperationRequest, ...gax.CallOption) error - GetOperation(context.Context, *longrunningpb.GetOperationRequest, ...gax.CallOption) (*longrunningpb.Operation, error) - ListOperations(context.Context, *longrunningpb.ListOperationsRequest, ...gax.CallOption) *OperationIterator } // Client is a client for interacting with Contact Center AI Insights API. @@ -803,21 +764,6 @@ func (c *Client) DeleteView(ctx context.Context, req *contactcenterinsightspb.De return c.internalClient.DeleteView(ctx, req, opts...) } -// CancelOperation is a utility method from google.longrunning.Operations. -func (c *Client) CancelOperation(ctx context.Context, req *longrunningpb.CancelOperationRequest, opts ...gax.CallOption) error { - return c.internalClient.CancelOperation(ctx, req, opts...) -} - -// GetOperation is a utility method from google.longrunning.Operations. -func (c *Client) GetOperation(ctx context.Context, req *longrunningpb.GetOperationRequest, opts ...gax.CallOption) (*longrunningpb.Operation, error) { - return c.internalClient.GetOperation(ctx, req, opts...) -} - -// ListOperations is a utility method from google.longrunning.Operations. -func (c *Client) ListOperations(ctx context.Context, req *longrunningpb.ListOperationsRequest, opts ...gax.CallOption) *OperationIterator { - return c.internalClient.ListOperations(ctx, req, opts...) -} - // gRPCClient is a client for interacting with Contact Center AI Insights API over gRPC transport. // // Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls. @@ -839,8 +785,6 @@ type gRPCClient struct { // Users should not Close this client. LROClient **lroauto.OperationsClient - operationsClient longrunningpb.OperationsClient - // The x-goog-* metadata to be sent with each request. xGoogMetadata metadata.MD } @@ -875,7 +819,6 @@ func NewClient(ctx context.Context, opts ...option.ClientOption) (*Client, error disableDeadlines: disableDeadlines, client: contactcenterinsightspb.NewContactCenterInsightsClient(connPool), CallOptions: &client.CallOptions, - operationsClient: longrunningpb.NewOperationsClient(connPool), } c.setGoogleClientInfo() @@ -1753,91 +1696,6 @@ func (c *gRPCClient) DeleteView(ctx context.Context, req *contactcenterinsightsp return err } -func (c *gRPCClient) CancelOperation(ctx context.Context, req *longrunningpb.CancelOperationRequest, opts ...gax.CallOption) error { - if _, ok := ctx.Deadline(); !ok && !c.disableDeadlines { - cctx, cancel := context.WithTimeout(ctx, 60000*time.Millisecond) - defer cancel() - ctx = cctx - } - md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))) - - ctx = insertMetadata(ctx, c.xGoogMetadata, md) - opts = append((*c.CallOptions).CancelOperation[0:len((*c.CallOptions).CancelOperation):len((*c.CallOptions).CancelOperation)], opts...) - err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { - var err error - _, err = c.operationsClient.CancelOperation(ctx, req, settings.GRPC...) - return err - }, opts...) - return err -} - -func (c *gRPCClient) GetOperation(ctx context.Context, req *longrunningpb.GetOperationRequest, opts ...gax.CallOption) (*longrunningpb.Operation, error) { - if _, ok := ctx.Deadline(); !ok && !c.disableDeadlines { - cctx, cancel := context.WithTimeout(ctx, 60000*time.Millisecond) - defer cancel() - ctx = cctx - } - md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))) - - ctx = insertMetadata(ctx, c.xGoogMetadata, md) - opts = append((*c.CallOptions).GetOperation[0:len((*c.CallOptions).GetOperation):len((*c.CallOptions).GetOperation)], opts...) - var resp *longrunningpb.Operation - err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { - var err error - resp, err = c.operationsClient.GetOperation(ctx, req, settings.GRPC...) - return err - }, opts...) - if err != nil { - return nil, err - } - return resp, nil -} - -func (c *gRPCClient) ListOperations(ctx context.Context, req *longrunningpb.ListOperationsRequest, opts ...gax.CallOption) *OperationIterator { - md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))) - - ctx = insertMetadata(ctx, c.xGoogMetadata, md) - opts = append((*c.CallOptions).ListOperations[0:len((*c.CallOptions).ListOperations):len((*c.CallOptions).ListOperations)], opts...) - it := &OperationIterator{} - req = proto.Clone(req).(*longrunningpb.ListOperationsRequest) - it.InternalFetch = func(pageSize int, pageToken string) ([]*longrunningpb.Operation, string, error) { - resp := &longrunningpb.ListOperationsResponse{} - if pageToken != "" { - req.PageToken = pageToken - } - if pageSize > math.MaxInt32 { - req.PageSize = math.MaxInt32 - } else if pageSize != 0 { - req.PageSize = int32(pageSize) - } - err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { - var err error - resp, err = c.operationsClient.ListOperations(ctx, req, settings.GRPC...) - return err - }, opts...) - if err != nil { - return nil, "", err - } - - it.Response = resp - return resp.GetOperations(), resp.GetNextPageToken(), nil - } - fetch := func(pageSize int, pageToken string) (string, error) { - items, nextPageToken, err := it.InternalFetch(pageSize, pageToken) - if err != nil { - return "", err - } - it.items = append(it.items, items...) - return nextPageToken, nil - } - - it.pageInfo, it.nextFunc = iterator.NewPageInfo(fetch, it.bufLen, it.takeBuf) - it.pageInfo.MaxSize = int(req.GetPageSize()) - it.pageInfo.Token = req.GetPageToken() - - return it -} - // CreateAnalysisOperation manages a long-running operation from CreateAnalysis. type CreateAnalysisOperation struct { lro *longrunning.Operation @@ -2335,53 +2193,6 @@ func (it *ConversationIterator) takeBuf() interface{} { return b } -// OperationIterator manages a stream of *longrunningpb.Operation. -type OperationIterator struct { - items []*longrunningpb.Operation - 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 []*longrunningpb.Operation, nextPageToken string, err error) -} - -// PageInfo supports pagination. See the google.golang.org/api/iterator package for details. -func (it *OperationIterator) 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 *OperationIterator) Next() (*longrunningpb.Operation, error) { - var item *longrunningpb.Operation - if err := it.nextFunc(); err != nil { - return item, err - } - item = it.items[0] - it.items = it.items[1:] - return item, nil -} - -func (it *OperationIterator) bufLen() int { - return len(it.items) -} - -func (it *OperationIterator) takeBuf() interface{} { - b := it.items - it.items = nil - return b -} - // PhraseMatcherIterator manages a stream of *contactcenterinsightspb.PhraseMatcher. type PhraseMatcherIterator struct { items []*contactcenterinsightspb.PhraseMatcher diff --git a/contactcenterinsights/apiv1/contact_center_insights_client_example_test.go b/contactcenterinsights/apiv1/contact_center_insights_client_example_test.go index 30e7fab8816c..7fb1b3f426bb 100644 --- a/contactcenterinsights/apiv1/contact_center_insights_client_example_test.go +++ b/contactcenterinsights/apiv1/contact_center_insights_client_example_test.go @@ -22,7 +22,6 @@ import ( contactcenterinsights "cloud.google.com/go/contactcenterinsights/apiv1" "google.golang.org/api/iterator" contactcenterinsightspb "google.golang.org/genproto/googleapis/cloud/contactcenterinsights/v1" - longrunningpb "google.golang.org/genproto/googleapis/longrunning" ) func ExampleNewClient() { @@ -760,67 +759,3 @@ func ExampleClient_DeleteView() { // TODO: Handle error. } } - -func ExampleClient_CancelOperation() { - ctx := context.Background() - c, err := contactcenterinsights.NewClient(ctx) - if err != nil { - // TODO: Handle error. - } - defer c.Close() - - req := &longrunningpb.CancelOperationRequest{ - // TODO: Fill request struct fields. - // See https://pkg.go.dev/google.golang.org/genproto/googleapis/longrunning#CancelOperationRequest. - } - err = c.CancelOperation(ctx, req) - if err != nil { - // TODO: Handle error. - } -} - -func ExampleClient_GetOperation() { - ctx := context.Background() - c, err := contactcenterinsights.NewClient(ctx) - if err != nil { - // TODO: Handle error. - } - defer c.Close() - - req := &longrunningpb.GetOperationRequest{ - // TODO: Fill request struct fields. - // See https://pkg.go.dev/google.golang.org/genproto/googleapis/longrunning#GetOperationRequest. - } - resp, err := c.GetOperation(ctx, req) - if err != nil { - // TODO: Handle error. - } - // TODO: Use resp. - _ = resp -} - -func ExampleClient_ListOperations() { - ctx := context.Background() - c, err := contactcenterinsights.NewClient(ctx) - if err != nil { - // TODO: Handle error. - } - defer c.Close() - - req := &longrunningpb.ListOperationsRequest{ - // TODO: Fill request struct fields. - // See https://pkg.go.dev/google.golang.org/genproto/googleapis/longrunning#ListOperationsRequest. - } - it := c.ListOperations(ctx, req) - for { - resp, err := it.Next() - if err == iterator.Done { - break - } - if err != nil { - // TODO: Handle error. - } - // TODO: Use resp. - _ = resp - } -} diff --git a/contactcenterinsights/apiv1/gapic_metadata.json b/contactcenterinsights/apiv1/gapic_metadata.json index 1943a9d4efc8..0e9a3529db15 100644 --- a/contactcenterinsights/apiv1/gapic_metadata.json +++ b/contactcenterinsights/apiv1/gapic_metadata.json @@ -20,11 +20,6 @@ "CalculateStats" ] }, - "CancelOperation": { - "methods": [ - "CancelOperation" - ] - }, "CreateAnalysis": { "methods": [ "CreateAnalysis" @@ -105,11 +100,6 @@ "GetIssueModel" ] }, - "GetOperation": { - "methods": [ - "GetOperation" - ] - }, "GetPhraseMatcher": { "methods": [ "GetPhraseMatcher" @@ -145,11 +135,6 @@ "ListIssues" ] }, - "ListOperations": { - "methods": [ - "ListOperations" - ] - }, "ListPhraseMatchers": { "methods": [ "ListPhraseMatchers" diff --git a/contactcenterinsights/go.mod b/contactcenterinsights/go.mod index 486b10ebce64..39ffc5d0daa6 100644 --- a/contactcenterinsights/go.mod +++ b/contactcenterinsights/go.mod @@ -5,8 +5,8 @@ go 1.17 require ( cloud.google.com/go v0.102.1 github.com/googleapis/gax-go/v2 v2.4.0 - google.golang.org/api v0.85.0 - google.golang.org/genproto v0.0.0-20220624142145-8cd45d7dbd1f + google.golang.org/api v0.90.0 + google.golang.org/genproto v0.0.0-20220801145646-83ce21fca29f google.golang.org/grpc v1.48.0 google.golang.org/protobuf v1.28.0 ) @@ -18,9 +18,9 @@ require ( github.com/google/go-cmp v0.5.8 // indirect github.com/googleapis/enterprise-certificate-proxy v0.1.0 // indirect go.opencensus.io v0.23.0 // indirect - golang.org/x/net v0.0.0-20220617184016-355a448f1bc9 // indirect - golang.org/x/oauth2 v0.0.0-20220608161450-d0670ef3b1eb // indirect - golang.org/x/sys v0.0.0-20220615213510-4f61da869c0c // indirect + golang.org/x/net v0.0.0-20220624214902-1bab6f366d9e // indirect + golang.org/x/oauth2 v0.0.0-20220622183110-fd043fe589d2 // indirect + golang.org/x/sys v0.0.0-20220624220833-87e55d714810 // indirect golang.org/x/text v0.3.7 // indirect google.golang.org/appengine v1.6.7 // indirect ) diff --git a/contactcenterinsights/go.sum b/contactcenterinsights/go.sum index 1115c4b74a9d..caab97273379 100644 --- a/contactcenterinsights/go.sum +++ b/contactcenterinsights/go.sum @@ -162,6 +162,7 @@ github.com/google/pprof v0.0.0-20210609004039-a478d1d731e9/go.mod h1:kpwsk12EmLe github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/enterprise-certificate-proxy v0.0.0-20220520183353-fd19c99a87aa/go.mod h1:17drOmN3MwGY7t0e+Ei9b45FFGA3fBs3x36SsCg1hq8= github.com/googleapis/enterprise-certificate-proxy v0.1.0 h1:zO8WHNx/MYiAKJ3d5spxZXZE6KHmIQGQcAzwUzV7qQw= github.com/googleapis/enterprise-certificate-proxy v0.1.0/go.mod h1:17drOmN3MwGY7t0e+Ei9b45FFGA3fBs3x36SsCg1hq8= @@ -290,8 +291,8 @@ golang.org/x/net v0.0.0-20220325170049-de3da57026de/go.mod h1:CfG3xpIq0wQ8r1q4Su golang.org/x/net v0.0.0-20220412020605-290c469a71a5/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220607020251-c690dde0001d/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.0.0-20220617184016-355a448f1bc9 h1:Yqz/iviulwKwAREEeUd3nbBFn0XuyJqkoft2IlrvOhc= -golang.org/x/net v0.0.0-20220617184016-355a448f1bc9/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= +golang.org/x/net v0.0.0-20220624214902-1bab6f366d9e h1:TsQ7F31D3bUCLeqPT0u+yjp1guoArKaNKmCr22PYgTQ= +golang.org/x/net v0.0.0-20220624214902-1bab6f366d9e/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -311,8 +312,9 @@ golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8/go.mod h1:KelEdhl1UZF7XfJ golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= golang.org/x/oauth2 v0.0.0-20220309155454-6242fa91716a/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= golang.org/x/oauth2 v0.0.0-20220411215720-9780585627b5/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= -golang.org/x/oauth2 v0.0.0-20220608161450-d0670ef3b1eb h1:8tDJ3aechhddbdPAxpycgXHJRMLpk/Ab+aa4OgdN5/g= golang.org/x/oauth2 v0.0.0-20220608161450-d0670ef3b1eb/go.mod h1:jaDAt6Dkxork7LmZnYtzbRWj0W47D86a3TGe0YHBvmE= +golang.org/x/oauth2 v0.0.0-20220622183110-fd043fe589d2 h1:+jnHzr9VPj32ykQVai5DNahi9+NSp7yYuCsl5eAQtL0= +golang.org/x/oauth2 v0.0.0-20220622183110-fd043fe589d2/go.mod h1:jaDAt6Dkxork7LmZnYtzbRWj0W47D86a3TGe0YHBvmE= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -383,8 +385,8 @@ golang.org/x/sys v0.0.0-20220502124256-b6088ccd6cba/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220610221304-9f5ed59c137d/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220615213510-4f61da869c0c h1:aFV+BgZ4svzjfabn8ERpuB4JI4N6/rdy1iusx77G3oU= -golang.org/x/sys v0.0.0-20220615213510-4f61da869c0c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220624220833-87e55d714810 h1:rHZQSjJdAI4Xf5Qzeh2bBc5YJIkPFVM6oDtMFYmgws0= +golang.org/x/sys v0.0.0-20220624220833-87e55d714810/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -497,8 +499,8 @@ google.golang.org/api v0.75.0/go.mod h1:pU9QmyHLnzlpar1Mjt4IbapUCy8J+6HD6GeELN69 google.golang.org/api v0.78.0/go.mod h1:1Sg78yoMLOhlQTeF+ARBoytAcH1NNyyl390YMy6rKmw= google.golang.org/api v0.80.0/go.mod h1:xY3nI94gbvBrE0J6NHXhxOmW97HG7Khjkku6AFB3Hyg= google.golang.org/api v0.84.0/go.mod h1:NTsGnUFJMYROtiquksZHBWtHfeMC7iYthki7Eq3pa8o= -google.golang.org/api v0.85.0 h1:8rJoHuRxx+vCmZtAO/3k1dRLvYNVyTJtZ5oaFZvhgvc= -google.golang.org/api v0.85.0/go.mod h1:AqZf8Ep9uZ2pyTvgL+x0D3Zt0eoT9b5E8fmzfu6FO2g= +google.golang.org/api v0.90.0 h1:WMnUWAvihIClUYFNeFA69VTuR3duKS3IalMGDQcLvq8= +google.golang.org/api v0.90.0/go.mod h1:+Sem1dnrKlrXMR/X0bPnMWyluQe4RsNoYfmNLhOIkzw= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= @@ -586,8 +588,9 @@ google.golang.org/genproto v0.0.0-20220523171625-347a074981d8/go.mod h1:RAyBrSAP google.golang.org/genproto v0.0.0-20220608133413-ed9918b62aac/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= google.golang.org/genproto v0.0.0-20220616135557-88e70c0c3a90/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= google.golang.org/genproto v0.0.0-20220617124728-180714bec0ad/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= -google.golang.org/genproto v0.0.0-20220624142145-8cd45d7dbd1f h1:hJ/Y5SqPXbarffmAsApliUlcvMU+wScNGfyop4bZm8o= google.golang.org/genproto v0.0.0-20220624142145-8cd45d7dbd1f/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= +google.golang.org/genproto v0.0.0-20220801145646-83ce21fca29f h1:XVHpVMvPs4MtH3h6cThzKs2snNexcfd35vQx2T3IuIY= +google.golang.org/genproto v0.0.0-20220801145646-83ce21fca29f/go.mod h1:iHe1svFLAZg9VWz891+QbRMwUv9O/1Ww+/mngYeThbc= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= diff --git a/dataform/go.mod b/dataform/go.mod index e2181882d425..a7e5779f1d52 100644 --- a/dataform/go.mod +++ b/dataform/go.mod @@ -4,8 +4,8 @@ go 1.18 require ( github.com/googleapis/gax-go/v2 v2.4.0 - google.golang.org/api v0.86.0 - google.golang.org/genproto v0.0.0-20220706185917-7780775163c4 + google.golang.org/api v0.90.0 + google.golang.org/genproto v0.0.0-20220801145646-83ce21fca29f google.golang.org/grpc v1.48.0 google.golang.org/protobuf v1.28.0 ) diff --git a/dataform/go.sum b/dataform/go.sum index 6936d9189efb..d853871458bc 100644 --- a/dataform/go.sum +++ b/dataform/go.sum @@ -497,8 +497,8 @@ google.golang.org/api v0.75.0/go.mod h1:pU9QmyHLnzlpar1Mjt4IbapUCy8J+6HD6GeELN69 google.golang.org/api v0.78.0/go.mod h1:1Sg78yoMLOhlQTeF+ARBoytAcH1NNyyl390YMy6rKmw= google.golang.org/api v0.80.0/go.mod h1:xY3nI94gbvBrE0J6NHXhxOmW97HG7Khjkku6AFB3Hyg= google.golang.org/api v0.84.0/go.mod h1:NTsGnUFJMYROtiquksZHBWtHfeMC7iYthki7Eq3pa8o= -google.golang.org/api v0.86.0 h1:ZAnyOHQFIuWso1BodVfSaRyffD74T9ERGFa3k1fNk/U= -google.golang.org/api v0.86.0/go.mod h1:+Sem1dnrKlrXMR/X0bPnMWyluQe4RsNoYfmNLhOIkzw= +google.golang.org/api v0.90.0 h1:WMnUWAvihIClUYFNeFA69VTuR3duKS3IalMGDQcLvq8= +google.golang.org/api v0.90.0/go.mod h1:+Sem1dnrKlrXMR/X0bPnMWyluQe4RsNoYfmNLhOIkzw= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= @@ -586,8 +586,8 @@ google.golang.org/genproto v0.0.0-20220523171625-347a074981d8/go.mod h1:RAyBrSAP google.golang.org/genproto v0.0.0-20220608133413-ed9918b62aac/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= google.golang.org/genproto v0.0.0-20220616135557-88e70c0c3a90/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= google.golang.org/genproto v0.0.0-20220624142145-8cd45d7dbd1f/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= -google.golang.org/genproto v0.0.0-20220706185917-7780775163c4 h1:7YDGQC/0sigNGzsEWyb9s72jTxlFdwVEYNJHbfQ+Dtg= -google.golang.org/genproto v0.0.0-20220706185917-7780775163c4/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= +google.golang.org/genproto v0.0.0-20220801145646-83ce21fca29f h1:XVHpVMvPs4MtH3h6cThzKs2snNexcfd35vQx2T3IuIY= +google.golang.org/genproto v0.0.0-20220801145646-83ce21fca29f/go.mod h1:iHe1svFLAZg9VWz891+QbRMwUv9O/1Ww+/mngYeThbc= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= diff --git a/dialogflow/go.mod b/dialogflow/go.mod index 5b80070632b0..d22cf0dd28e9 100644 --- a/dialogflow/go.mod +++ b/dialogflow/go.mod @@ -6,8 +6,8 @@ require ( cloud.google.com/go v0.102.1 github.com/golang/protobuf v1.5.2 github.com/googleapis/gax-go/v2 v2.4.0 - google.golang.org/api v0.86.0 - google.golang.org/genproto v0.0.0-20220706185917-7780775163c4 + google.golang.org/api v0.90.0 + google.golang.org/genproto v0.0.0-20220801145646-83ce21fca29f google.golang.org/grpc v1.48.0 google.golang.org/protobuf v1.28.0 ) diff --git a/dialogflow/go.sum b/dialogflow/go.sum index 2fc74eaa45fd..caab97273379 100644 --- a/dialogflow/go.sum +++ b/dialogflow/go.sum @@ -499,8 +499,8 @@ google.golang.org/api v0.75.0/go.mod h1:pU9QmyHLnzlpar1Mjt4IbapUCy8J+6HD6GeELN69 google.golang.org/api v0.78.0/go.mod h1:1Sg78yoMLOhlQTeF+ARBoytAcH1NNyyl390YMy6rKmw= google.golang.org/api v0.80.0/go.mod h1:xY3nI94gbvBrE0J6NHXhxOmW97HG7Khjkku6AFB3Hyg= google.golang.org/api v0.84.0/go.mod h1:NTsGnUFJMYROtiquksZHBWtHfeMC7iYthki7Eq3pa8o= -google.golang.org/api v0.86.0 h1:ZAnyOHQFIuWso1BodVfSaRyffD74T9ERGFa3k1fNk/U= -google.golang.org/api v0.86.0/go.mod h1:+Sem1dnrKlrXMR/X0bPnMWyluQe4RsNoYfmNLhOIkzw= +google.golang.org/api v0.90.0 h1:WMnUWAvihIClUYFNeFA69VTuR3duKS3IalMGDQcLvq8= +google.golang.org/api v0.90.0/go.mod h1:+Sem1dnrKlrXMR/X0bPnMWyluQe4RsNoYfmNLhOIkzw= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= @@ -589,8 +589,8 @@ google.golang.org/genproto v0.0.0-20220608133413-ed9918b62aac/go.mod h1:KEWEmljW google.golang.org/genproto v0.0.0-20220616135557-88e70c0c3a90/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= google.golang.org/genproto v0.0.0-20220617124728-180714bec0ad/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= google.golang.org/genproto v0.0.0-20220624142145-8cd45d7dbd1f/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= -google.golang.org/genproto v0.0.0-20220706185917-7780775163c4 h1:7YDGQC/0sigNGzsEWyb9s72jTxlFdwVEYNJHbfQ+Dtg= -google.golang.org/genproto v0.0.0-20220706185917-7780775163c4/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= +google.golang.org/genproto v0.0.0-20220801145646-83ce21fca29f h1:XVHpVMvPs4MtH3h6cThzKs2snNexcfd35vQx2T3IuIY= +google.golang.org/genproto v0.0.0-20220801145646-83ce21fca29f/go.mod h1:iHe1svFLAZg9VWz891+QbRMwUv9O/1Ww+/mngYeThbc= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= diff --git a/functions/go.mod b/functions/go.mod index daffa44c27b7..bf8f71fd2b13 100644 --- a/functions/go.mod +++ b/functions/go.mod @@ -6,8 +6,8 @@ require ( cloud.google.com/go v0.102.1 github.com/google/go-cmp v0.5.8 github.com/googleapis/gax-go/v2 v2.4.0 - google.golang.org/api v0.85.0 - google.golang.org/genproto v0.0.0-20220714211235-042d03aeabc9 + google.golang.org/api v0.90.0 + google.golang.org/genproto v0.0.0-20220801145646-83ce21fca29f google.golang.org/grpc v1.48.0 google.golang.org/protobuf v1.28.0 ) @@ -18,9 +18,9 @@ require ( github.com/golang/protobuf v1.5.2 // indirect github.com/googleapis/enterprise-certificate-proxy v0.1.0 // indirect go.opencensus.io v0.23.0 // indirect - golang.org/x/net v0.0.0-20220617184016-355a448f1bc9 // indirect - golang.org/x/oauth2 v0.0.0-20220608161450-d0670ef3b1eb // indirect - golang.org/x/sys v0.0.0-20220615213510-4f61da869c0c // indirect + golang.org/x/net v0.0.0-20220624214902-1bab6f366d9e // indirect + golang.org/x/oauth2 v0.0.0-20220622183110-fd043fe589d2 // indirect + golang.org/x/sys v0.0.0-20220624220833-87e55d714810 // indirect golang.org/x/text v0.3.7 // indirect google.golang.org/appengine v1.6.7 // indirect ) diff --git a/functions/go.sum b/functions/go.sum index e4f2e666670a..caab97273379 100644 --- a/functions/go.sum +++ b/functions/go.sum @@ -162,6 +162,7 @@ github.com/google/pprof v0.0.0-20210609004039-a478d1d731e9/go.mod h1:kpwsk12EmLe github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/enterprise-certificate-proxy v0.0.0-20220520183353-fd19c99a87aa/go.mod h1:17drOmN3MwGY7t0e+Ei9b45FFGA3fBs3x36SsCg1hq8= github.com/googleapis/enterprise-certificate-proxy v0.1.0 h1:zO8WHNx/MYiAKJ3d5spxZXZE6KHmIQGQcAzwUzV7qQw= github.com/googleapis/enterprise-certificate-proxy v0.1.0/go.mod h1:17drOmN3MwGY7t0e+Ei9b45FFGA3fBs3x36SsCg1hq8= @@ -290,8 +291,8 @@ golang.org/x/net v0.0.0-20220325170049-de3da57026de/go.mod h1:CfG3xpIq0wQ8r1q4Su golang.org/x/net v0.0.0-20220412020605-290c469a71a5/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220607020251-c690dde0001d/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.0.0-20220617184016-355a448f1bc9 h1:Yqz/iviulwKwAREEeUd3nbBFn0XuyJqkoft2IlrvOhc= -golang.org/x/net v0.0.0-20220617184016-355a448f1bc9/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= +golang.org/x/net v0.0.0-20220624214902-1bab6f366d9e h1:TsQ7F31D3bUCLeqPT0u+yjp1guoArKaNKmCr22PYgTQ= +golang.org/x/net v0.0.0-20220624214902-1bab6f366d9e/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -311,8 +312,9 @@ golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8/go.mod h1:KelEdhl1UZF7XfJ golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= golang.org/x/oauth2 v0.0.0-20220309155454-6242fa91716a/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= golang.org/x/oauth2 v0.0.0-20220411215720-9780585627b5/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= -golang.org/x/oauth2 v0.0.0-20220608161450-d0670ef3b1eb h1:8tDJ3aechhddbdPAxpycgXHJRMLpk/Ab+aa4OgdN5/g= golang.org/x/oauth2 v0.0.0-20220608161450-d0670ef3b1eb/go.mod h1:jaDAt6Dkxork7LmZnYtzbRWj0W47D86a3TGe0YHBvmE= +golang.org/x/oauth2 v0.0.0-20220622183110-fd043fe589d2 h1:+jnHzr9VPj32ykQVai5DNahi9+NSp7yYuCsl5eAQtL0= +golang.org/x/oauth2 v0.0.0-20220622183110-fd043fe589d2/go.mod h1:jaDAt6Dkxork7LmZnYtzbRWj0W47D86a3TGe0YHBvmE= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -383,8 +385,8 @@ golang.org/x/sys v0.0.0-20220502124256-b6088ccd6cba/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220610221304-9f5ed59c137d/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220615213510-4f61da869c0c h1:aFV+BgZ4svzjfabn8ERpuB4JI4N6/rdy1iusx77G3oU= -golang.org/x/sys v0.0.0-20220615213510-4f61da869c0c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220624220833-87e55d714810 h1:rHZQSjJdAI4Xf5Qzeh2bBc5YJIkPFVM6oDtMFYmgws0= +golang.org/x/sys v0.0.0-20220624220833-87e55d714810/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -497,8 +499,8 @@ google.golang.org/api v0.75.0/go.mod h1:pU9QmyHLnzlpar1Mjt4IbapUCy8J+6HD6GeELN69 google.golang.org/api v0.78.0/go.mod h1:1Sg78yoMLOhlQTeF+ARBoytAcH1NNyyl390YMy6rKmw= google.golang.org/api v0.80.0/go.mod h1:xY3nI94gbvBrE0J6NHXhxOmW97HG7Khjkku6AFB3Hyg= google.golang.org/api v0.84.0/go.mod h1:NTsGnUFJMYROtiquksZHBWtHfeMC7iYthki7Eq3pa8o= -google.golang.org/api v0.85.0 h1:8rJoHuRxx+vCmZtAO/3k1dRLvYNVyTJtZ5oaFZvhgvc= -google.golang.org/api v0.85.0/go.mod h1:AqZf8Ep9uZ2pyTvgL+x0D3Zt0eoT9b5E8fmzfu6FO2g= +google.golang.org/api v0.90.0 h1:WMnUWAvihIClUYFNeFA69VTuR3duKS3IalMGDQcLvq8= +google.golang.org/api v0.90.0/go.mod h1:+Sem1dnrKlrXMR/X0bPnMWyluQe4RsNoYfmNLhOIkzw= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= @@ -586,8 +588,9 @@ google.golang.org/genproto v0.0.0-20220523171625-347a074981d8/go.mod h1:RAyBrSAP google.golang.org/genproto v0.0.0-20220608133413-ed9918b62aac/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= google.golang.org/genproto v0.0.0-20220616135557-88e70c0c3a90/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= google.golang.org/genproto v0.0.0-20220617124728-180714bec0ad/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= -google.golang.org/genproto v0.0.0-20220714211235-042d03aeabc9 h1:zfXhTgBfGlIh3jMXN06W8qbhFGsh6MJNJiYEuhTddOI= -google.golang.org/genproto v0.0.0-20220714211235-042d03aeabc9/go.mod h1:GkXuJDJ6aQ7lnJcRF+SJVgFdQhypqgl3LB1C9vabdRE= +google.golang.org/genproto v0.0.0-20220624142145-8cd45d7dbd1f/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= +google.golang.org/genproto v0.0.0-20220801145646-83ce21fca29f h1:XVHpVMvPs4MtH3h6cThzKs2snNexcfd35vQx2T3IuIY= +google.golang.org/genproto v0.0.0-20220801145646-83ce21fca29f/go.mod h1:iHe1svFLAZg9VWz891+QbRMwUv9O/1Ww+/mngYeThbc= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= diff --git a/go.mod b/go.mod index 45ba1ad0684f..2b4325af5793 100644 --- a/go.mod +++ b/go.mod @@ -12,8 +12,8 @@ require ( go.opencensus.io v0.23.0 golang.org/x/oauth2 v0.0.0-20220622183110-fd043fe589d2 golang.org/x/xerrors v0.0.0-20220609144429-65e65417b02f - google.golang.org/api v0.88.0 - google.golang.org/genproto v0.0.0-20220720214146-176da50484ac + google.golang.org/api v0.90.0 + google.golang.org/genproto v0.0.0-20220801145646-83ce21fca29f google.golang.org/grpc v1.48.0 google.golang.org/protobuf v1.28.0 ) diff --git a/go.sum b/go.sum index da24ae6551e5..44bb27ee0fa9 100644 --- a/go.sum +++ b/go.sum @@ -510,8 +510,8 @@ google.golang.org/api v0.78.0/go.mod h1:1Sg78yoMLOhlQTeF+ARBoytAcH1NNyyl390YMy6r google.golang.org/api v0.80.0/go.mod h1:xY3nI94gbvBrE0J6NHXhxOmW97HG7Khjkku6AFB3Hyg= google.golang.org/api v0.84.0/go.mod h1:NTsGnUFJMYROtiquksZHBWtHfeMC7iYthki7Eq3pa8o= google.golang.org/api v0.85.0/go.mod h1:AqZf8Ep9uZ2pyTvgL+x0D3Zt0eoT9b5E8fmzfu6FO2g= -google.golang.org/api v0.88.0 h1:MPwxQRqpyskYhr2iNyfsQ8R06eeyhe7UEuR30p136ZQ= -google.golang.org/api v0.88.0/go.mod h1:+Sem1dnrKlrXMR/X0bPnMWyluQe4RsNoYfmNLhOIkzw= +google.golang.org/api v0.90.0 h1:WMnUWAvihIClUYFNeFA69VTuR3duKS3IalMGDQcLvq8= +google.golang.org/api v0.90.0/go.mod h1:+Sem1dnrKlrXMR/X0bPnMWyluQe4RsNoYfmNLhOIkzw= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= @@ -600,8 +600,8 @@ google.golang.org/genproto v0.0.0-20220608133413-ed9918b62aac/go.mod h1:KEWEmljW google.golang.org/genproto v0.0.0-20220616135557-88e70c0c3a90/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= google.golang.org/genproto v0.0.0-20220617124728-180714bec0ad/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= google.golang.org/genproto v0.0.0-20220624142145-8cd45d7dbd1f/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= -google.golang.org/genproto v0.0.0-20220720214146-176da50484ac h1:EOa+Yrhx1C0O+4pHeXeWrCwdI0tWI6IfUU56Vebs9wQ= -google.golang.org/genproto v0.0.0-20220720214146-176da50484ac/go.mod h1:GkXuJDJ6aQ7lnJcRF+SJVgFdQhypqgl3LB1C9vabdRE= +google.golang.org/genproto v0.0.0-20220801145646-83ce21fca29f h1:XVHpVMvPs4MtH3h6cThzKs2snNexcfd35vQx2T3IuIY= +google.golang.org/genproto v0.0.0-20220801145646-83ce21fca29f/go.mod h1:iHe1svFLAZg9VWz891+QbRMwUv9O/1Ww+/mngYeThbc= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= diff --git a/internal/.repo-metadata-full.json b/internal/.repo-metadata-full.json index 8a9bd5a458ee..4ef6c56788a2 100644 --- a/internal/.repo-metadata-full.json +++ b/internal/.repo-metadata-full.json @@ -1576,7 +1576,7 @@ }, "cloud.google.com/go/spanner/admin/database/apiv1": { "distribution_name": "cloud.google.com/go/spanner/admin/database/apiv1", - "description": "Cloud Spanner Database Admin API", + "description": "Cloud Spanner API", "language": "Go", "client_library_type": "generated", "docs_url": "https://cloud.google.com/go/docs/reference/cloud.google.com/go/spanner/latest/admin/database/apiv1", diff --git a/internal/generated/snippets/aiplatform/apiv1/snippet_metadata.google.cloud.aiplatform.v1.json b/internal/generated/snippets/aiplatform/apiv1/snippet_metadata.google.cloud.aiplatform.v1.json index f5d3258c2243..8d9e5eba1ac9 100644 --- a/internal/generated/snippets/aiplatform/apiv1/snippet_metadata.google.cloud.aiplatform.v1.json +++ b/internal/generated/snippets/aiplatform/apiv1/snippet_metadata.google.cloud.aiplatform.v1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "cloud.google.com/go/aiplatform/apiv1", - "version": "1.14.0", + "version": "1.15.0", "language": "GO", "apis": [ { diff --git a/internal/generated/snippets/aiplatform/apiv1beta1/DeploymentResourcePoolClient/CancelOperation/main.go b/internal/generated/snippets/aiplatform/apiv1beta1/DeploymentResourcePoolClient/CancelOperation/main.go new file mode 100644 index 000000000000..e05025184256 --- /dev/null +++ b/internal/generated/snippets/aiplatform/apiv1beta1/DeploymentResourcePoolClient/CancelOperation/main.go @@ -0,0 +1,46 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by cloud.google.com/go/internal/gapicgen/gensnippets. DO NOT EDIT. + +// [START aiplatform_v1beta1_generated_DeploymentResourcePoolService_CancelOperation_sync] + +package main + +import ( + "context" + + aiplatform "cloud.google.com/go/aiplatform/apiv1beta1" + longrunningpb "google.golang.org/genproto/googleapis/longrunning" +) + +func main() { + ctx := context.Background() + c, err := aiplatform.NewDeploymentResourcePoolClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &longrunningpb.CancelOperationRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/longrunning#CancelOperationRequest. + } + err = c.CancelOperation(ctx, req) + if err != nil { + // TODO: Handle error. + } +} + +// [END aiplatform_v1beta1_generated_DeploymentResourcePoolService_CancelOperation_sync] diff --git a/internal/generated/snippets/aiplatform/apiv1beta1/DeploymentResourcePoolClient/CreateDeploymentResourcePool/main.go b/internal/generated/snippets/aiplatform/apiv1beta1/DeploymentResourcePoolClient/CreateDeploymentResourcePool/main.go new file mode 100644 index 000000000000..0d86048ffcfd --- /dev/null +++ b/internal/generated/snippets/aiplatform/apiv1beta1/DeploymentResourcePoolClient/CreateDeploymentResourcePool/main.go @@ -0,0 +1,53 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by cloud.google.com/go/internal/gapicgen/gensnippets. DO NOT EDIT. + +// [START aiplatform_v1beta1_generated_DeploymentResourcePoolService_CreateDeploymentResourcePool_sync] + +package main + +import ( + "context" + + aiplatform "cloud.google.com/go/aiplatform/apiv1beta1" + aiplatformpb "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1" +) + +func main() { + ctx := context.Background() + c, err := aiplatform.NewDeploymentResourcePoolClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &aiplatformpb.CreateDeploymentResourcePoolRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1#CreateDeploymentResourcePoolRequest. + } + op, err := c.CreateDeploymentResourcePool(ctx, req) + if err != nil { + // TODO: Handle error. + } + + resp, err := op.Wait(ctx) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +// [END aiplatform_v1beta1_generated_DeploymentResourcePoolService_CreateDeploymentResourcePool_sync] diff --git a/internal/generated/snippets/aiplatform/apiv1beta1/DeploymentResourcePoolClient/DeleteDeploymentResourcePool/main.go b/internal/generated/snippets/aiplatform/apiv1beta1/DeploymentResourcePoolClient/DeleteDeploymentResourcePool/main.go new file mode 100644 index 000000000000..e1103594afa9 --- /dev/null +++ b/internal/generated/snippets/aiplatform/apiv1beta1/DeploymentResourcePoolClient/DeleteDeploymentResourcePool/main.go @@ -0,0 +1,51 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by cloud.google.com/go/internal/gapicgen/gensnippets. DO NOT EDIT. + +// [START aiplatform_v1beta1_generated_DeploymentResourcePoolService_DeleteDeploymentResourcePool_sync] + +package main + +import ( + "context" + + aiplatform "cloud.google.com/go/aiplatform/apiv1beta1" + aiplatformpb "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1" +) + +func main() { + ctx := context.Background() + c, err := aiplatform.NewDeploymentResourcePoolClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &aiplatformpb.DeleteDeploymentResourcePoolRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1#DeleteDeploymentResourcePoolRequest. + } + op, err := c.DeleteDeploymentResourcePool(ctx, req) + if err != nil { + // TODO: Handle error. + } + + err = op.Wait(ctx) + if err != nil { + // TODO: Handle error. + } +} + +// [END aiplatform_v1beta1_generated_DeploymentResourcePoolService_DeleteDeploymentResourcePool_sync] diff --git a/internal/generated/snippets/aiplatform/apiv1beta1/DeploymentResourcePoolClient/DeleteOperation/main.go b/internal/generated/snippets/aiplatform/apiv1beta1/DeploymentResourcePoolClient/DeleteOperation/main.go new file mode 100644 index 000000000000..59653b9aec5a --- /dev/null +++ b/internal/generated/snippets/aiplatform/apiv1beta1/DeploymentResourcePoolClient/DeleteOperation/main.go @@ -0,0 +1,46 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by cloud.google.com/go/internal/gapicgen/gensnippets. DO NOT EDIT. + +// [START aiplatform_v1beta1_generated_DeploymentResourcePoolService_DeleteOperation_sync] + +package main + +import ( + "context" + + aiplatform "cloud.google.com/go/aiplatform/apiv1beta1" + longrunningpb "google.golang.org/genproto/googleapis/longrunning" +) + +func main() { + ctx := context.Background() + c, err := aiplatform.NewDeploymentResourcePoolClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &longrunningpb.DeleteOperationRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/longrunning#DeleteOperationRequest. + } + err = c.DeleteOperation(ctx, req) + if err != nil { + // TODO: Handle error. + } +} + +// [END aiplatform_v1beta1_generated_DeploymentResourcePoolService_DeleteOperation_sync] diff --git a/internal/generated/snippets/aiplatform/apiv1beta1/DeploymentResourcePoolClient/GetDeploymentResourcePool/main.go b/internal/generated/snippets/aiplatform/apiv1beta1/DeploymentResourcePoolClient/GetDeploymentResourcePool/main.go new file mode 100644 index 000000000000..20d603188baf --- /dev/null +++ b/internal/generated/snippets/aiplatform/apiv1beta1/DeploymentResourcePoolClient/GetDeploymentResourcePool/main.go @@ -0,0 +1,48 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by cloud.google.com/go/internal/gapicgen/gensnippets. DO NOT EDIT. + +// [START aiplatform_v1beta1_generated_DeploymentResourcePoolService_GetDeploymentResourcePool_sync] + +package main + +import ( + "context" + + aiplatform "cloud.google.com/go/aiplatform/apiv1beta1" + aiplatformpb "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1" +) + +func main() { + ctx := context.Background() + c, err := aiplatform.NewDeploymentResourcePoolClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &aiplatformpb.GetDeploymentResourcePoolRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1#GetDeploymentResourcePoolRequest. + } + resp, err := c.GetDeploymentResourcePool(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +// [END aiplatform_v1beta1_generated_DeploymentResourcePoolService_GetDeploymentResourcePool_sync] diff --git a/internal/generated/snippets/aiplatform/apiv1beta1/DeploymentResourcePoolClient/GetIamPolicy/main.go b/internal/generated/snippets/aiplatform/apiv1beta1/DeploymentResourcePoolClient/GetIamPolicy/main.go new file mode 100644 index 000000000000..3fbf81195925 --- /dev/null +++ b/internal/generated/snippets/aiplatform/apiv1beta1/DeploymentResourcePoolClient/GetIamPolicy/main.go @@ -0,0 +1,48 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by cloud.google.com/go/internal/gapicgen/gensnippets. DO NOT EDIT. + +// [START aiplatform_v1beta1_generated_DeploymentResourcePoolService_GetIamPolicy_sync] + +package main + +import ( + "context" + + aiplatform "cloud.google.com/go/aiplatform/apiv1beta1" + iampb "google.golang.org/genproto/googleapis/iam/v1" +) + +func main() { + ctx := context.Background() + c, err := aiplatform.NewDeploymentResourcePoolClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &iampb.GetIamPolicyRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/iam/v1#GetIamPolicyRequest. + } + resp, err := c.GetIamPolicy(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +// [END aiplatform_v1beta1_generated_DeploymentResourcePoolService_GetIamPolicy_sync] diff --git a/internal/generated/snippets/aiplatform/apiv1beta1/DeploymentResourcePoolClient/GetLocation/main.go b/internal/generated/snippets/aiplatform/apiv1beta1/DeploymentResourcePoolClient/GetLocation/main.go new file mode 100644 index 000000000000..976e77943df6 --- /dev/null +++ b/internal/generated/snippets/aiplatform/apiv1beta1/DeploymentResourcePoolClient/GetLocation/main.go @@ -0,0 +1,48 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by cloud.google.com/go/internal/gapicgen/gensnippets. DO NOT EDIT. + +// [START aiplatform_v1beta1_generated_DeploymentResourcePoolService_GetLocation_sync] + +package main + +import ( + "context" + + aiplatform "cloud.google.com/go/aiplatform/apiv1beta1" + locationpb "google.golang.org/genproto/googleapis/cloud/location" +) + +func main() { + ctx := context.Background() + c, err := aiplatform.NewDeploymentResourcePoolClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &locationpb.GetLocationRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/location#GetLocationRequest. + } + resp, err := c.GetLocation(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +// [END aiplatform_v1beta1_generated_DeploymentResourcePoolService_GetLocation_sync] diff --git a/internal/generated/snippets/aiplatform/apiv1beta1/DeploymentResourcePoolClient/GetOperation/main.go b/internal/generated/snippets/aiplatform/apiv1beta1/DeploymentResourcePoolClient/GetOperation/main.go new file mode 100644 index 000000000000..14f300706ab4 --- /dev/null +++ b/internal/generated/snippets/aiplatform/apiv1beta1/DeploymentResourcePoolClient/GetOperation/main.go @@ -0,0 +1,48 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by cloud.google.com/go/internal/gapicgen/gensnippets. DO NOT EDIT. + +// [START aiplatform_v1beta1_generated_DeploymentResourcePoolService_GetOperation_sync] + +package main + +import ( + "context" + + aiplatform "cloud.google.com/go/aiplatform/apiv1beta1" + longrunningpb "google.golang.org/genproto/googleapis/longrunning" +) + +func main() { + ctx := context.Background() + c, err := aiplatform.NewDeploymentResourcePoolClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &longrunningpb.GetOperationRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/longrunning#GetOperationRequest. + } + resp, err := c.GetOperation(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +// [END aiplatform_v1beta1_generated_DeploymentResourcePoolService_GetOperation_sync] diff --git a/internal/generated/snippets/aiplatform/apiv1beta1/DeploymentResourcePoolClient/ListDeploymentResourcePools/main.go b/internal/generated/snippets/aiplatform/apiv1beta1/DeploymentResourcePoolClient/ListDeploymentResourcePools/main.go new file mode 100644 index 000000000000..0f789b6df8cb --- /dev/null +++ b/internal/generated/snippets/aiplatform/apiv1beta1/DeploymentResourcePoolClient/ListDeploymentResourcePools/main.go @@ -0,0 +1,55 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by cloud.google.com/go/internal/gapicgen/gensnippets. DO NOT EDIT. + +// [START aiplatform_v1beta1_generated_DeploymentResourcePoolService_ListDeploymentResourcePools_sync] + +package main + +import ( + "context" + + aiplatform "cloud.google.com/go/aiplatform/apiv1beta1" + "google.golang.org/api/iterator" + aiplatformpb "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1" +) + +func main() { + ctx := context.Background() + c, err := aiplatform.NewDeploymentResourcePoolClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &aiplatformpb.ListDeploymentResourcePoolsRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1#ListDeploymentResourcePoolsRequest. + } + it := c.ListDeploymentResourcePools(ctx, req) + for { + resp, err := it.Next() + if err == iterator.Done { + break + } + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp + } +} + +// [END aiplatform_v1beta1_generated_DeploymentResourcePoolService_ListDeploymentResourcePools_sync] diff --git a/internal/generated/snippets/aiplatform/apiv1beta1/DeploymentResourcePoolClient/ListLocations/main.go b/internal/generated/snippets/aiplatform/apiv1beta1/DeploymentResourcePoolClient/ListLocations/main.go new file mode 100644 index 000000000000..3895678a50cd --- /dev/null +++ b/internal/generated/snippets/aiplatform/apiv1beta1/DeploymentResourcePoolClient/ListLocations/main.go @@ -0,0 +1,55 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by cloud.google.com/go/internal/gapicgen/gensnippets. DO NOT EDIT. + +// [START aiplatform_v1beta1_generated_DeploymentResourcePoolService_ListLocations_sync] + +package main + +import ( + "context" + + aiplatform "cloud.google.com/go/aiplatform/apiv1beta1" + "google.golang.org/api/iterator" + locationpb "google.golang.org/genproto/googleapis/cloud/location" +) + +func main() { + ctx := context.Background() + c, err := aiplatform.NewDeploymentResourcePoolClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &locationpb.ListLocationsRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/location#ListLocationsRequest. + } + it := c.ListLocations(ctx, req) + for { + resp, err := it.Next() + if err == iterator.Done { + break + } + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp + } +} + +// [END aiplatform_v1beta1_generated_DeploymentResourcePoolService_ListLocations_sync] diff --git a/internal/generated/snippets/aiplatform/apiv1beta1/DeploymentResourcePoolClient/ListOperations/main.go b/internal/generated/snippets/aiplatform/apiv1beta1/DeploymentResourcePoolClient/ListOperations/main.go new file mode 100644 index 000000000000..cf567a25aea9 --- /dev/null +++ b/internal/generated/snippets/aiplatform/apiv1beta1/DeploymentResourcePoolClient/ListOperations/main.go @@ -0,0 +1,55 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by cloud.google.com/go/internal/gapicgen/gensnippets. DO NOT EDIT. + +// [START aiplatform_v1beta1_generated_DeploymentResourcePoolService_ListOperations_sync] + +package main + +import ( + "context" + + aiplatform "cloud.google.com/go/aiplatform/apiv1beta1" + "google.golang.org/api/iterator" + longrunningpb "google.golang.org/genproto/googleapis/longrunning" +) + +func main() { + ctx := context.Background() + c, err := aiplatform.NewDeploymentResourcePoolClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &longrunningpb.ListOperationsRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/longrunning#ListOperationsRequest. + } + it := c.ListOperations(ctx, req) + for { + resp, err := it.Next() + if err == iterator.Done { + break + } + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp + } +} + +// [END aiplatform_v1beta1_generated_DeploymentResourcePoolService_ListOperations_sync] diff --git a/internal/generated/snippets/aiplatform/apiv1beta1/DeploymentResourcePoolClient/QueryDeployedModels/main.go b/internal/generated/snippets/aiplatform/apiv1beta1/DeploymentResourcePoolClient/QueryDeployedModels/main.go new file mode 100644 index 000000000000..22f097aced13 --- /dev/null +++ b/internal/generated/snippets/aiplatform/apiv1beta1/DeploymentResourcePoolClient/QueryDeployedModels/main.go @@ -0,0 +1,55 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by cloud.google.com/go/internal/gapicgen/gensnippets. DO NOT EDIT. + +// [START aiplatform_v1beta1_generated_DeploymentResourcePoolService_QueryDeployedModels_sync] + +package main + +import ( + "context" + + aiplatform "cloud.google.com/go/aiplatform/apiv1beta1" + "google.golang.org/api/iterator" + aiplatformpb "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1" +) + +func main() { + ctx := context.Background() + c, err := aiplatform.NewDeploymentResourcePoolClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &aiplatformpb.QueryDeployedModelsRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1#QueryDeployedModelsRequest. + } + it := c.QueryDeployedModels(ctx, req) + for { + resp, err := it.Next() + if err == iterator.Done { + break + } + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp + } +} + +// [END aiplatform_v1beta1_generated_DeploymentResourcePoolService_QueryDeployedModels_sync] diff --git a/internal/generated/snippets/aiplatform/apiv1beta1/DeploymentResourcePoolClient/SetIamPolicy/main.go b/internal/generated/snippets/aiplatform/apiv1beta1/DeploymentResourcePoolClient/SetIamPolicy/main.go new file mode 100644 index 000000000000..8c628dd3c643 --- /dev/null +++ b/internal/generated/snippets/aiplatform/apiv1beta1/DeploymentResourcePoolClient/SetIamPolicy/main.go @@ -0,0 +1,48 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by cloud.google.com/go/internal/gapicgen/gensnippets. DO NOT EDIT. + +// [START aiplatform_v1beta1_generated_DeploymentResourcePoolService_SetIamPolicy_sync] + +package main + +import ( + "context" + + aiplatform "cloud.google.com/go/aiplatform/apiv1beta1" + iampb "google.golang.org/genproto/googleapis/iam/v1" +) + +func main() { + ctx := context.Background() + c, err := aiplatform.NewDeploymentResourcePoolClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &iampb.SetIamPolicyRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/iam/v1#SetIamPolicyRequest. + } + resp, err := c.SetIamPolicy(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +// [END aiplatform_v1beta1_generated_DeploymentResourcePoolService_SetIamPolicy_sync] diff --git a/internal/generated/snippets/aiplatform/apiv1beta1/DeploymentResourcePoolClient/TestIamPermissions/main.go b/internal/generated/snippets/aiplatform/apiv1beta1/DeploymentResourcePoolClient/TestIamPermissions/main.go new file mode 100644 index 000000000000..a427b684ceb2 --- /dev/null +++ b/internal/generated/snippets/aiplatform/apiv1beta1/DeploymentResourcePoolClient/TestIamPermissions/main.go @@ -0,0 +1,48 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by cloud.google.com/go/internal/gapicgen/gensnippets. DO NOT EDIT. + +// [START aiplatform_v1beta1_generated_DeploymentResourcePoolService_TestIamPermissions_sync] + +package main + +import ( + "context" + + aiplatform "cloud.google.com/go/aiplatform/apiv1beta1" + iampb "google.golang.org/genproto/googleapis/iam/v1" +) + +func main() { + ctx := context.Background() + c, err := aiplatform.NewDeploymentResourcePoolClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &iampb.TestIamPermissionsRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/iam/v1#TestIamPermissionsRequest. + } + resp, err := c.TestIamPermissions(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +// [END aiplatform_v1beta1_generated_DeploymentResourcePoolService_TestIamPermissions_sync] diff --git a/internal/generated/snippets/aiplatform/apiv1beta1/DeploymentResourcePoolClient/WaitOperation/main.go b/internal/generated/snippets/aiplatform/apiv1beta1/DeploymentResourcePoolClient/WaitOperation/main.go new file mode 100644 index 000000000000..3ea5193016b5 --- /dev/null +++ b/internal/generated/snippets/aiplatform/apiv1beta1/DeploymentResourcePoolClient/WaitOperation/main.go @@ -0,0 +1,48 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by cloud.google.com/go/internal/gapicgen/gensnippets. DO NOT EDIT. + +// [START aiplatform_v1beta1_generated_DeploymentResourcePoolService_WaitOperation_sync] + +package main + +import ( + "context" + + aiplatform "cloud.google.com/go/aiplatform/apiv1beta1" + longrunningpb "google.golang.org/genproto/googleapis/longrunning" +) + +func main() { + ctx := context.Background() + c, err := aiplatform.NewDeploymentResourcePoolClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &longrunningpb.WaitOperationRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/longrunning#WaitOperationRequest. + } + resp, err := c.WaitOperation(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +// [END aiplatform_v1beta1_generated_DeploymentResourcePoolService_WaitOperation_sync] diff --git a/internal/generated/snippets/aiplatform/apiv1beta1/snippet_metadata.google.cloud.aiplatform.v1beta1.json b/internal/generated/snippets/aiplatform/apiv1beta1/snippet_metadata.google.cloud.aiplatform.v1beta1.json index f0c738d83aea..0715f63df7b5 100644 --- a/internal/generated/snippets/aiplatform/apiv1beta1/snippet_metadata.google.cloud.aiplatform.v1beta1.json +++ b/internal/generated/snippets/aiplatform/apiv1beta1/snippet_metadata.google.cloud.aiplatform.v1beta1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "cloud.google.com/go/aiplatform/apiv1beta1", - "version": "1.14.0", + "version": "1.15.0", "language": "GO", "apis": [ { @@ -975,6 +975,694 @@ } ] }, + { + "regionTag": "aiplatform_v1beta1_generated_DeploymentResourcePoolService_CancelOperation_sync", + "title": "aiplatform CancelOperation Sample", + "description": "CancelOperation is a utility method from google.longrunning.Operations.", + "file": "DeploymentResourcePoolClient/CancelOperation/main.go", + "language": "GO", + "clientMethod": { + "shortName": "CancelOperation", + "fullName": "google.cloud.aiplatform.v1beta1.DeploymentResourcePoolClient.CancelOperation", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "longrunningpb.CancelOperationRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "client": { + "shortName": "DeploymentResourcePoolClient", + "fullName": "google.cloud.aiplatform.v1beta1.DeploymentResourcePoolClient" + }, + "method": { + "shortName": "CancelOperation", + "fullName": "google.cloud.aiplatform.v1beta1.DeploymentResourcePoolService.CancelOperation", + "service": { + "shortName": "DeploymentResourcePoolService", + "fullName": "google.cloud.aiplatform.v1beta1.DeploymentResourcePoolService" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 45, + "type": "FULL" + } + ] + }, + { + "regionTag": "aiplatform_v1beta1_generated_DeploymentResourcePoolService_CreateDeploymentResourcePool_sync", + "title": "aiplatform CreateDeploymentResourcePool Sample", + "description": "CreateDeploymentResourcePool create a DeploymentResourcePool.", + "file": "DeploymentResourcePoolClient/CreateDeploymentResourcePool/main.go", + "language": "GO", + "clientMethod": { + "shortName": "CreateDeploymentResourcePool", + "fullName": "google.cloud.aiplatform.v1beta1.DeploymentResourcePoolClient.CreateDeploymentResourcePool", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "aiplatformpb.CreateDeploymentResourcePoolRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "resultType": "CreateDeploymentResourcePoolOperation", + "client": { + "shortName": "DeploymentResourcePoolClient", + "fullName": "google.cloud.aiplatform.v1beta1.DeploymentResourcePoolClient" + }, + "method": { + "shortName": "CreateDeploymentResourcePool", + "fullName": "google.cloud.aiplatform.v1beta1.DeploymentResourcePoolService.CreateDeploymentResourcePool", + "service": { + "shortName": "DeploymentResourcePoolService", + "fullName": "google.cloud.aiplatform.v1beta1.DeploymentResourcePoolService" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 52, + "type": "FULL" + } + ] + }, + { + "regionTag": "aiplatform_v1beta1_generated_DeploymentResourcePoolService_DeleteDeploymentResourcePool_sync", + "title": "aiplatform DeleteDeploymentResourcePool Sample", + "description": "DeleteDeploymentResourcePool delete a DeploymentResourcePool.", + "file": "DeploymentResourcePoolClient/DeleteDeploymentResourcePool/main.go", + "language": "GO", + "clientMethod": { + "shortName": "DeleteDeploymentResourcePool", + "fullName": "google.cloud.aiplatform.v1beta1.DeploymentResourcePoolClient.DeleteDeploymentResourcePool", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "aiplatformpb.DeleteDeploymentResourcePoolRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "resultType": "DeleteDeploymentResourcePoolOperation", + "client": { + "shortName": "DeploymentResourcePoolClient", + "fullName": "google.cloud.aiplatform.v1beta1.DeploymentResourcePoolClient" + }, + "method": { + "shortName": "DeleteDeploymentResourcePool", + "fullName": "google.cloud.aiplatform.v1beta1.DeploymentResourcePoolService.DeleteDeploymentResourcePool", + "service": { + "shortName": "DeploymentResourcePoolService", + "fullName": "google.cloud.aiplatform.v1beta1.DeploymentResourcePoolService" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 50, + "type": "FULL" + } + ] + }, + { + "regionTag": "aiplatform_v1beta1_generated_DeploymentResourcePoolService_DeleteOperation_sync", + "title": "aiplatform DeleteOperation Sample", + "description": "DeleteOperation is a utility method from google.longrunning.Operations.", + "file": "DeploymentResourcePoolClient/DeleteOperation/main.go", + "language": "GO", + "clientMethod": { + "shortName": "DeleteOperation", + "fullName": "google.cloud.aiplatform.v1beta1.DeploymentResourcePoolClient.DeleteOperation", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "longrunningpb.DeleteOperationRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "client": { + "shortName": "DeploymentResourcePoolClient", + "fullName": "google.cloud.aiplatform.v1beta1.DeploymentResourcePoolClient" + }, + "method": { + "shortName": "DeleteOperation", + "fullName": "google.cloud.aiplatform.v1beta1.DeploymentResourcePoolService.DeleteOperation", + "service": { + "shortName": "DeploymentResourcePoolService", + "fullName": "google.cloud.aiplatform.v1beta1.DeploymentResourcePoolService" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 45, + "type": "FULL" + } + ] + }, + { + "regionTag": "aiplatform_v1beta1_generated_DeploymentResourcePoolService_GetDeploymentResourcePool_sync", + "title": "aiplatform GetDeploymentResourcePool Sample", + "description": "GetDeploymentResourcePool get a DeploymentResourcePool.", + "file": "DeploymentResourcePoolClient/GetDeploymentResourcePool/main.go", + "language": "GO", + "clientMethod": { + "shortName": "GetDeploymentResourcePool", + "fullName": "google.cloud.aiplatform.v1beta1.DeploymentResourcePoolClient.GetDeploymentResourcePool", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "aiplatformpb.GetDeploymentResourcePoolRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "resultType": "aiplatformpb.DeploymentResourcePool", + "client": { + "shortName": "DeploymentResourcePoolClient", + "fullName": "google.cloud.aiplatform.v1beta1.DeploymentResourcePoolClient" + }, + "method": { + "shortName": "GetDeploymentResourcePool", + "fullName": "google.cloud.aiplatform.v1beta1.DeploymentResourcePoolService.GetDeploymentResourcePool", + "service": { + "shortName": "DeploymentResourcePoolService", + "fullName": "google.cloud.aiplatform.v1beta1.DeploymentResourcePoolService" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 47, + "type": "FULL" + } + ] + }, + { + "regionTag": "aiplatform_v1beta1_generated_DeploymentResourcePoolService_GetIamPolicy_sync", + "title": "aiplatform GetIamPolicy Sample", + "description": "GetIamPolicy gets the access control policy for a resource. Returns an empty policy\nif the resource exists and does not have a policy set.", + "file": "DeploymentResourcePoolClient/GetIamPolicy/main.go", + "language": "GO", + "clientMethod": { + "shortName": "GetIamPolicy", + "fullName": "google.cloud.aiplatform.v1beta1.DeploymentResourcePoolClient.GetIamPolicy", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "iampb.GetIamPolicyRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "resultType": "iampb.Policy", + "client": { + "shortName": "DeploymentResourcePoolClient", + "fullName": "google.cloud.aiplatform.v1beta1.DeploymentResourcePoolClient" + }, + "method": { + "shortName": "GetIamPolicy", + "fullName": "google.cloud.aiplatform.v1beta1.DeploymentResourcePoolService.GetIamPolicy", + "service": { + "shortName": "DeploymentResourcePoolService", + "fullName": "google.cloud.aiplatform.v1beta1.DeploymentResourcePoolService" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 47, + "type": "FULL" + } + ] + }, + { + "regionTag": "aiplatform_v1beta1_generated_DeploymentResourcePoolService_GetLocation_sync", + "title": "aiplatform GetLocation Sample", + "description": "GetLocation gets information about a location.", + "file": "DeploymentResourcePoolClient/GetLocation/main.go", + "language": "GO", + "clientMethod": { + "shortName": "GetLocation", + "fullName": "google.cloud.aiplatform.v1beta1.DeploymentResourcePoolClient.GetLocation", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "locationpb.GetLocationRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "resultType": "locationpb.Location", + "client": { + "shortName": "DeploymentResourcePoolClient", + "fullName": "google.cloud.aiplatform.v1beta1.DeploymentResourcePoolClient" + }, + "method": { + "shortName": "GetLocation", + "fullName": "google.cloud.aiplatform.v1beta1.DeploymentResourcePoolService.GetLocation", + "service": { + "shortName": "DeploymentResourcePoolService", + "fullName": "google.cloud.aiplatform.v1beta1.DeploymentResourcePoolService" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 47, + "type": "FULL" + } + ] + }, + { + "regionTag": "aiplatform_v1beta1_generated_DeploymentResourcePoolService_GetOperation_sync", + "title": "aiplatform GetOperation Sample", + "description": "GetOperation is a utility method from google.longrunning.Operations.", + "file": "DeploymentResourcePoolClient/GetOperation/main.go", + "language": "GO", + "clientMethod": { + "shortName": "GetOperation", + "fullName": "google.cloud.aiplatform.v1beta1.DeploymentResourcePoolClient.GetOperation", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "longrunningpb.GetOperationRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "resultType": "longrunningpb.Operation", + "client": { + "shortName": "DeploymentResourcePoolClient", + "fullName": "google.cloud.aiplatform.v1beta1.DeploymentResourcePoolClient" + }, + "method": { + "shortName": "GetOperation", + "fullName": "google.cloud.aiplatform.v1beta1.DeploymentResourcePoolService.GetOperation", + "service": { + "shortName": "DeploymentResourcePoolService", + "fullName": "google.cloud.aiplatform.v1beta1.DeploymentResourcePoolService" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 47, + "type": "FULL" + } + ] + }, + { + "regionTag": "aiplatform_v1beta1_generated_DeploymentResourcePoolService_ListDeploymentResourcePools_sync", + "title": "aiplatform ListDeploymentResourcePools Sample", + "description": "ListDeploymentResourcePools list DeploymentResourcePools in a location.", + "file": "DeploymentResourcePoolClient/ListDeploymentResourcePools/main.go", + "language": "GO", + "clientMethod": { + "shortName": "ListDeploymentResourcePools", + "fullName": "google.cloud.aiplatform.v1beta1.DeploymentResourcePoolClient.ListDeploymentResourcePools", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "aiplatformpb.ListDeploymentResourcePoolsRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "resultType": "DeploymentResourcePoolIterator", + "client": { + "shortName": "DeploymentResourcePoolClient", + "fullName": "google.cloud.aiplatform.v1beta1.DeploymentResourcePoolClient" + }, + "method": { + "shortName": "ListDeploymentResourcePools", + "fullName": "google.cloud.aiplatform.v1beta1.DeploymentResourcePoolService.ListDeploymentResourcePools", + "service": { + "shortName": "DeploymentResourcePoolService", + "fullName": "google.cloud.aiplatform.v1beta1.DeploymentResourcePoolService" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 54, + "type": "FULL" + } + ] + }, + { + "regionTag": "aiplatform_v1beta1_generated_DeploymentResourcePoolService_ListLocations_sync", + "title": "aiplatform ListLocations Sample", + "description": "ListLocations lists information about the supported locations for this service.", + "file": "DeploymentResourcePoolClient/ListLocations/main.go", + "language": "GO", + "clientMethod": { + "shortName": "ListLocations", + "fullName": "google.cloud.aiplatform.v1beta1.DeploymentResourcePoolClient.ListLocations", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "locationpb.ListLocationsRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "resultType": "LocationIterator", + "client": { + "shortName": "DeploymentResourcePoolClient", + "fullName": "google.cloud.aiplatform.v1beta1.DeploymentResourcePoolClient" + }, + "method": { + "shortName": "ListLocations", + "fullName": "google.cloud.aiplatform.v1beta1.DeploymentResourcePoolService.ListLocations", + "service": { + "shortName": "DeploymentResourcePoolService", + "fullName": "google.cloud.aiplatform.v1beta1.DeploymentResourcePoolService" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 54, + "type": "FULL" + } + ] + }, + { + "regionTag": "aiplatform_v1beta1_generated_DeploymentResourcePoolService_ListOperations_sync", + "title": "aiplatform ListOperations Sample", + "description": "ListOperations is a utility method from google.longrunning.Operations.", + "file": "DeploymentResourcePoolClient/ListOperations/main.go", + "language": "GO", + "clientMethod": { + "shortName": "ListOperations", + "fullName": "google.cloud.aiplatform.v1beta1.DeploymentResourcePoolClient.ListOperations", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "longrunningpb.ListOperationsRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "resultType": "OperationIterator", + "client": { + "shortName": "DeploymentResourcePoolClient", + "fullName": "google.cloud.aiplatform.v1beta1.DeploymentResourcePoolClient" + }, + "method": { + "shortName": "ListOperations", + "fullName": "google.cloud.aiplatform.v1beta1.DeploymentResourcePoolService.ListOperations", + "service": { + "shortName": "DeploymentResourcePoolService", + "fullName": "google.cloud.aiplatform.v1beta1.DeploymentResourcePoolService" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 54, + "type": "FULL" + } + ] + }, + { + "regionTag": "aiplatform_v1beta1_generated_DeploymentResourcePoolService_QueryDeployedModels_sync", + "title": "aiplatform QueryDeployedModels Sample", + "description": "QueryDeployedModels list DeployedModels that have been deployed on this DeploymentResourcePool.", + "file": "DeploymentResourcePoolClient/QueryDeployedModels/main.go", + "language": "GO", + "clientMethod": { + "shortName": "QueryDeployedModels", + "fullName": "google.cloud.aiplatform.v1beta1.DeploymentResourcePoolClient.QueryDeployedModels", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "aiplatformpb.QueryDeployedModelsRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "resultType": "DeployedModelIterator", + "client": { + "shortName": "DeploymentResourcePoolClient", + "fullName": "google.cloud.aiplatform.v1beta1.DeploymentResourcePoolClient" + }, + "method": { + "shortName": "QueryDeployedModels", + "fullName": "google.cloud.aiplatform.v1beta1.DeploymentResourcePoolService.QueryDeployedModels", + "service": { + "shortName": "DeploymentResourcePoolService", + "fullName": "google.cloud.aiplatform.v1beta1.DeploymentResourcePoolService" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 54, + "type": "FULL" + } + ] + }, + { + "regionTag": "aiplatform_v1beta1_generated_DeploymentResourcePoolService_SetIamPolicy_sync", + "title": "aiplatform SetIamPolicy Sample", + "description": "SetIamPolicy sets the access control policy on the specified resource. Replaces\nany existing policy.\n\nCan return NOT_FOUND, INVALID_ARGUMENT, and PERMISSION_DENIED\nerrors.", + "file": "DeploymentResourcePoolClient/SetIamPolicy/main.go", + "language": "GO", + "clientMethod": { + "shortName": "SetIamPolicy", + "fullName": "google.cloud.aiplatform.v1beta1.DeploymentResourcePoolClient.SetIamPolicy", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "iampb.SetIamPolicyRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "resultType": "iampb.Policy", + "client": { + "shortName": "DeploymentResourcePoolClient", + "fullName": "google.cloud.aiplatform.v1beta1.DeploymentResourcePoolClient" + }, + "method": { + "shortName": "SetIamPolicy", + "fullName": "google.cloud.aiplatform.v1beta1.DeploymentResourcePoolService.SetIamPolicy", + "service": { + "shortName": "DeploymentResourcePoolService", + "fullName": "google.cloud.aiplatform.v1beta1.DeploymentResourcePoolService" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 47, + "type": "FULL" + } + ] + }, + { + "regionTag": "aiplatform_v1beta1_generated_DeploymentResourcePoolService_TestIamPermissions_sync", + "title": "aiplatform TestIamPermissions Sample", + "description": "TestIamPermissions returns permissions that a caller has on the specified resource. If the\nresource does not exist, this will return an empty set of\npermissions, not a NOT_FOUND error.\n\nNote: This operation is designed to be used for building\npermission-aware UIs and command-line tools, not for authorization\nchecking. This operation may “fail open” without warning.", + "file": "DeploymentResourcePoolClient/TestIamPermissions/main.go", + "language": "GO", + "clientMethod": { + "shortName": "TestIamPermissions", + "fullName": "google.cloud.aiplatform.v1beta1.DeploymentResourcePoolClient.TestIamPermissions", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "iampb.TestIamPermissionsRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "resultType": "iampb.TestIamPermissionsResponse", + "client": { + "shortName": "DeploymentResourcePoolClient", + "fullName": "google.cloud.aiplatform.v1beta1.DeploymentResourcePoolClient" + }, + "method": { + "shortName": "TestIamPermissions", + "fullName": "google.cloud.aiplatform.v1beta1.DeploymentResourcePoolService.TestIamPermissions", + "service": { + "shortName": "DeploymentResourcePoolService", + "fullName": "google.cloud.aiplatform.v1beta1.DeploymentResourcePoolService" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 47, + "type": "FULL" + } + ] + }, + { + "regionTag": "aiplatform_v1beta1_generated_DeploymentResourcePoolService_WaitOperation_sync", + "title": "aiplatform WaitOperation Sample", + "description": "WaitOperation is a utility method from google.longrunning.Operations.", + "file": "DeploymentResourcePoolClient/WaitOperation/main.go", + "language": "GO", + "clientMethod": { + "shortName": "WaitOperation", + "fullName": "google.cloud.aiplatform.v1beta1.DeploymentResourcePoolClient.WaitOperation", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "longrunningpb.WaitOperationRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "resultType": "longrunningpb.Operation", + "client": { + "shortName": "DeploymentResourcePoolClient", + "fullName": "google.cloud.aiplatform.v1beta1.DeploymentResourcePoolClient" + }, + "method": { + "shortName": "WaitOperation", + "fullName": "google.cloud.aiplatform.v1beta1.DeploymentResourcePoolService.WaitOperation", + "service": { + "shortName": "DeploymentResourcePoolService", + "fullName": "google.cloud.aiplatform.v1beta1.DeploymentResourcePoolService" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 47, + "type": "FULL" + } + ] + }, { "regionTag": "aiplatform_v1beta1_generated_EndpointService_CancelOperation_sync", "title": "aiplatform CancelOperation Sample", diff --git a/internal/generated/snippets/artifactregistry/apiv1/Client/CreateRepository/main.go b/internal/generated/snippets/artifactregistry/apiv1/Client/CreateRepository/main.go new file mode 100644 index 000000000000..a8b949dcda5a --- /dev/null +++ b/internal/generated/snippets/artifactregistry/apiv1/Client/CreateRepository/main.go @@ -0,0 +1,53 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by cloud.google.com/go/internal/gapicgen/gensnippets. DO NOT EDIT. + +// [START artifactregistry_v1_generated_ArtifactRegistry_CreateRepository_sync] + +package main + +import ( + "context" + + artifactregistry "cloud.google.com/go/artifactregistry/apiv1" + artifactregistrypb "google.golang.org/genproto/googleapis/devtools/artifactregistry/v1" +) + +func main() { + ctx := context.Background() + c, err := artifactregistry.NewClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &artifactregistrypb.CreateRepositoryRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/devtools/artifactregistry/v1#CreateRepositoryRequest. + } + op, err := c.CreateRepository(ctx, req) + if err != nil { + // TODO: Handle error. + } + + resp, err := op.Wait(ctx) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +// [END artifactregistry_v1_generated_ArtifactRegistry_CreateRepository_sync] diff --git a/internal/generated/snippets/artifactregistry/apiv1/Client/CreateTag/main.go b/internal/generated/snippets/artifactregistry/apiv1/Client/CreateTag/main.go new file mode 100644 index 000000000000..bd5efed0da97 --- /dev/null +++ b/internal/generated/snippets/artifactregistry/apiv1/Client/CreateTag/main.go @@ -0,0 +1,48 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by cloud.google.com/go/internal/gapicgen/gensnippets. DO NOT EDIT. + +// [START artifactregistry_v1_generated_ArtifactRegistry_CreateTag_sync] + +package main + +import ( + "context" + + artifactregistry "cloud.google.com/go/artifactregistry/apiv1" + artifactregistrypb "google.golang.org/genproto/googleapis/devtools/artifactregistry/v1" +) + +func main() { + ctx := context.Background() + c, err := artifactregistry.NewClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &artifactregistrypb.CreateTagRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/devtools/artifactregistry/v1#CreateTagRequest. + } + resp, err := c.CreateTag(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +// [END artifactregistry_v1_generated_ArtifactRegistry_CreateTag_sync] diff --git a/internal/generated/snippets/artifactregistry/apiv1/Client/DeletePackage/main.go b/internal/generated/snippets/artifactregistry/apiv1/Client/DeletePackage/main.go new file mode 100644 index 000000000000..c13cd755501e --- /dev/null +++ b/internal/generated/snippets/artifactregistry/apiv1/Client/DeletePackage/main.go @@ -0,0 +1,51 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by cloud.google.com/go/internal/gapicgen/gensnippets. DO NOT EDIT. + +// [START artifactregistry_v1_generated_ArtifactRegistry_DeletePackage_sync] + +package main + +import ( + "context" + + artifactregistry "cloud.google.com/go/artifactregistry/apiv1" + artifactregistrypb "google.golang.org/genproto/googleapis/devtools/artifactregistry/v1" +) + +func main() { + ctx := context.Background() + c, err := artifactregistry.NewClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &artifactregistrypb.DeletePackageRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/devtools/artifactregistry/v1#DeletePackageRequest. + } + op, err := c.DeletePackage(ctx, req) + if err != nil { + // TODO: Handle error. + } + + err = op.Wait(ctx) + if err != nil { + // TODO: Handle error. + } +} + +// [END artifactregistry_v1_generated_ArtifactRegistry_DeletePackage_sync] diff --git a/internal/generated/snippets/artifactregistry/apiv1/Client/DeleteRepository/main.go b/internal/generated/snippets/artifactregistry/apiv1/Client/DeleteRepository/main.go new file mode 100644 index 000000000000..fd617883bb82 --- /dev/null +++ b/internal/generated/snippets/artifactregistry/apiv1/Client/DeleteRepository/main.go @@ -0,0 +1,51 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by cloud.google.com/go/internal/gapicgen/gensnippets. DO NOT EDIT. + +// [START artifactregistry_v1_generated_ArtifactRegistry_DeleteRepository_sync] + +package main + +import ( + "context" + + artifactregistry "cloud.google.com/go/artifactregistry/apiv1" + artifactregistrypb "google.golang.org/genproto/googleapis/devtools/artifactregistry/v1" +) + +func main() { + ctx := context.Background() + c, err := artifactregistry.NewClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &artifactregistrypb.DeleteRepositoryRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/devtools/artifactregistry/v1#DeleteRepositoryRequest. + } + op, err := c.DeleteRepository(ctx, req) + if err != nil { + // TODO: Handle error. + } + + err = op.Wait(ctx) + if err != nil { + // TODO: Handle error. + } +} + +// [END artifactregistry_v1_generated_ArtifactRegistry_DeleteRepository_sync] diff --git a/internal/generated/snippets/artifactregistry/apiv1/Client/DeleteTag/main.go b/internal/generated/snippets/artifactregistry/apiv1/Client/DeleteTag/main.go new file mode 100644 index 000000000000..a9273605a5e8 --- /dev/null +++ b/internal/generated/snippets/artifactregistry/apiv1/Client/DeleteTag/main.go @@ -0,0 +1,46 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by cloud.google.com/go/internal/gapicgen/gensnippets. DO NOT EDIT. + +// [START artifactregistry_v1_generated_ArtifactRegistry_DeleteTag_sync] + +package main + +import ( + "context" + + artifactregistry "cloud.google.com/go/artifactregistry/apiv1" + artifactregistrypb "google.golang.org/genproto/googleapis/devtools/artifactregistry/v1" +) + +func main() { + ctx := context.Background() + c, err := artifactregistry.NewClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &artifactregistrypb.DeleteTagRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/devtools/artifactregistry/v1#DeleteTagRequest. + } + err = c.DeleteTag(ctx, req) + if err != nil { + // TODO: Handle error. + } +} + +// [END artifactregistry_v1_generated_ArtifactRegistry_DeleteTag_sync] diff --git a/internal/generated/snippets/artifactregistry/apiv1/Client/DeleteVersion/main.go b/internal/generated/snippets/artifactregistry/apiv1/Client/DeleteVersion/main.go new file mode 100644 index 000000000000..971fae8790dd --- /dev/null +++ b/internal/generated/snippets/artifactregistry/apiv1/Client/DeleteVersion/main.go @@ -0,0 +1,51 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by cloud.google.com/go/internal/gapicgen/gensnippets. DO NOT EDIT. + +// [START artifactregistry_v1_generated_ArtifactRegistry_DeleteVersion_sync] + +package main + +import ( + "context" + + artifactregistry "cloud.google.com/go/artifactregistry/apiv1" + artifactregistrypb "google.golang.org/genproto/googleapis/devtools/artifactregistry/v1" +) + +func main() { + ctx := context.Background() + c, err := artifactregistry.NewClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &artifactregistrypb.DeleteVersionRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/devtools/artifactregistry/v1#DeleteVersionRequest. + } + op, err := c.DeleteVersion(ctx, req) + if err != nil { + // TODO: Handle error. + } + + err = op.Wait(ctx) + if err != nil { + // TODO: Handle error. + } +} + +// [END artifactregistry_v1_generated_ArtifactRegistry_DeleteVersion_sync] diff --git a/internal/generated/snippets/artifactregistry/apiv1/Client/GetDockerImage/main.go b/internal/generated/snippets/artifactregistry/apiv1/Client/GetDockerImage/main.go new file mode 100644 index 000000000000..3505e45737bf --- /dev/null +++ b/internal/generated/snippets/artifactregistry/apiv1/Client/GetDockerImage/main.go @@ -0,0 +1,48 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by cloud.google.com/go/internal/gapicgen/gensnippets. DO NOT EDIT. + +// [START artifactregistry_v1_generated_ArtifactRegistry_GetDockerImage_sync] + +package main + +import ( + "context" + + artifactregistry "cloud.google.com/go/artifactregistry/apiv1" + artifactregistrypb "google.golang.org/genproto/googleapis/devtools/artifactregistry/v1" +) + +func main() { + ctx := context.Background() + c, err := artifactregistry.NewClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &artifactregistrypb.GetDockerImageRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/devtools/artifactregistry/v1#GetDockerImageRequest. + } + resp, err := c.GetDockerImage(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +// [END artifactregistry_v1_generated_ArtifactRegistry_GetDockerImage_sync] diff --git a/internal/generated/snippets/artifactregistry/apiv1/Client/GetFile/main.go b/internal/generated/snippets/artifactregistry/apiv1/Client/GetFile/main.go new file mode 100644 index 000000000000..bd8994897dc0 --- /dev/null +++ b/internal/generated/snippets/artifactregistry/apiv1/Client/GetFile/main.go @@ -0,0 +1,48 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by cloud.google.com/go/internal/gapicgen/gensnippets. DO NOT EDIT. + +// [START artifactregistry_v1_generated_ArtifactRegistry_GetFile_sync] + +package main + +import ( + "context" + + artifactregistry "cloud.google.com/go/artifactregistry/apiv1" + artifactregistrypb "google.golang.org/genproto/googleapis/devtools/artifactregistry/v1" +) + +func main() { + ctx := context.Background() + c, err := artifactregistry.NewClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &artifactregistrypb.GetFileRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/devtools/artifactregistry/v1#GetFileRequest. + } + resp, err := c.GetFile(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +// [END artifactregistry_v1_generated_ArtifactRegistry_GetFile_sync] diff --git a/internal/generated/snippets/artifactregistry/apiv1/Client/GetIamPolicy/main.go b/internal/generated/snippets/artifactregistry/apiv1/Client/GetIamPolicy/main.go new file mode 100644 index 000000000000..938f4a337447 --- /dev/null +++ b/internal/generated/snippets/artifactregistry/apiv1/Client/GetIamPolicy/main.go @@ -0,0 +1,48 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by cloud.google.com/go/internal/gapicgen/gensnippets. DO NOT EDIT. + +// [START artifactregistry_v1_generated_ArtifactRegistry_GetIamPolicy_sync] + +package main + +import ( + "context" + + artifactregistry "cloud.google.com/go/artifactregistry/apiv1" + iampb "google.golang.org/genproto/googleapis/iam/v1" +) + +func main() { + ctx := context.Background() + c, err := artifactregistry.NewClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &iampb.GetIamPolicyRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/iam/v1#GetIamPolicyRequest. + } + resp, err := c.GetIamPolicy(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +// [END artifactregistry_v1_generated_ArtifactRegistry_GetIamPolicy_sync] diff --git a/internal/generated/snippets/artifactregistry/apiv1/Client/GetPackage/main.go b/internal/generated/snippets/artifactregistry/apiv1/Client/GetPackage/main.go new file mode 100644 index 000000000000..0d1092ed684e --- /dev/null +++ b/internal/generated/snippets/artifactregistry/apiv1/Client/GetPackage/main.go @@ -0,0 +1,48 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by cloud.google.com/go/internal/gapicgen/gensnippets. DO NOT EDIT. + +// [START artifactregistry_v1_generated_ArtifactRegistry_GetPackage_sync] + +package main + +import ( + "context" + + artifactregistry "cloud.google.com/go/artifactregistry/apiv1" + artifactregistrypb "google.golang.org/genproto/googleapis/devtools/artifactregistry/v1" +) + +func main() { + ctx := context.Background() + c, err := artifactregistry.NewClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &artifactregistrypb.GetPackageRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/devtools/artifactregistry/v1#GetPackageRequest. + } + resp, err := c.GetPackage(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +// [END artifactregistry_v1_generated_ArtifactRegistry_GetPackage_sync] diff --git a/internal/generated/snippets/artifactregistry/apiv1/Client/GetProjectSettings/main.go b/internal/generated/snippets/artifactregistry/apiv1/Client/GetProjectSettings/main.go new file mode 100644 index 000000000000..e11278c92c4e --- /dev/null +++ b/internal/generated/snippets/artifactregistry/apiv1/Client/GetProjectSettings/main.go @@ -0,0 +1,48 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by cloud.google.com/go/internal/gapicgen/gensnippets. DO NOT EDIT. + +// [START artifactregistry_v1_generated_ArtifactRegistry_GetProjectSettings_sync] + +package main + +import ( + "context" + + artifactregistry "cloud.google.com/go/artifactregistry/apiv1" + artifactregistrypb "google.golang.org/genproto/googleapis/devtools/artifactregistry/v1" +) + +func main() { + ctx := context.Background() + c, err := artifactregistry.NewClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &artifactregistrypb.GetProjectSettingsRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/devtools/artifactregistry/v1#GetProjectSettingsRequest. + } + resp, err := c.GetProjectSettings(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +// [END artifactregistry_v1_generated_ArtifactRegistry_GetProjectSettings_sync] diff --git a/internal/generated/snippets/artifactregistry/apiv1/Client/GetRepository/main.go b/internal/generated/snippets/artifactregistry/apiv1/Client/GetRepository/main.go new file mode 100644 index 000000000000..0b733d22244b --- /dev/null +++ b/internal/generated/snippets/artifactregistry/apiv1/Client/GetRepository/main.go @@ -0,0 +1,48 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by cloud.google.com/go/internal/gapicgen/gensnippets. DO NOT EDIT. + +// [START artifactregistry_v1_generated_ArtifactRegistry_GetRepository_sync] + +package main + +import ( + "context" + + artifactregistry "cloud.google.com/go/artifactregistry/apiv1" + artifactregistrypb "google.golang.org/genproto/googleapis/devtools/artifactregistry/v1" +) + +func main() { + ctx := context.Background() + c, err := artifactregistry.NewClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &artifactregistrypb.GetRepositoryRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/devtools/artifactregistry/v1#GetRepositoryRequest. + } + resp, err := c.GetRepository(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +// [END artifactregistry_v1_generated_ArtifactRegistry_GetRepository_sync] diff --git a/internal/generated/snippets/artifactregistry/apiv1/Client/GetTag/main.go b/internal/generated/snippets/artifactregistry/apiv1/Client/GetTag/main.go new file mode 100644 index 000000000000..829367e97a90 --- /dev/null +++ b/internal/generated/snippets/artifactregistry/apiv1/Client/GetTag/main.go @@ -0,0 +1,48 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by cloud.google.com/go/internal/gapicgen/gensnippets. DO NOT EDIT. + +// [START artifactregistry_v1_generated_ArtifactRegistry_GetTag_sync] + +package main + +import ( + "context" + + artifactregistry "cloud.google.com/go/artifactregistry/apiv1" + artifactregistrypb "google.golang.org/genproto/googleapis/devtools/artifactregistry/v1" +) + +func main() { + ctx := context.Background() + c, err := artifactregistry.NewClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &artifactregistrypb.GetTagRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/devtools/artifactregistry/v1#GetTagRequest. + } + resp, err := c.GetTag(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +// [END artifactregistry_v1_generated_ArtifactRegistry_GetTag_sync] diff --git a/internal/generated/snippets/artifactregistry/apiv1/Client/GetVersion/main.go b/internal/generated/snippets/artifactregistry/apiv1/Client/GetVersion/main.go new file mode 100644 index 000000000000..72ba15d389e3 --- /dev/null +++ b/internal/generated/snippets/artifactregistry/apiv1/Client/GetVersion/main.go @@ -0,0 +1,48 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by cloud.google.com/go/internal/gapicgen/gensnippets. DO NOT EDIT. + +// [START artifactregistry_v1_generated_ArtifactRegistry_GetVersion_sync] + +package main + +import ( + "context" + + artifactregistry "cloud.google.com/go/artifactregistry/apiv1" + artifactregistrypb "google.golang.org/genproto/googleapis/devtools/artifactregistry/v1" +) + +func main() { + ctx := context.Background() + c, err := artifactregistry.NewClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &artifactregistrypb.GetVersionRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/devtools/artifactregistry/v1#GetVersionRequest. + } + resp, err := c.GetVersion(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +// [END artifactregistry_v1_generated_ArtifactRegistry_GetVersion_sync] diff --git a/internal/generated/snippets/artifactregistry/apiv1/Client/ImportAptArtifacts/main.go b/internal/generated/snippets/artifactregistry/apiv1/Client/ImportAptArtifacts/main.go new file mode 100644 index 000000000000..a10cc2dad4d2 --- /dev/null +++ b/internal/generated/snippets/artifactregistry/apiv1/Client/ImportAptArtifacts/main.go @@ -0,0 +1,53 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by cloud.google.com/go/internal/gapicgen/gensnippets. DO NOT EDIT. + +// [START artifactregistry_v1_generated_ArtifactRegistry_ImportAptArtifacts_sync] + +package main + +import ( + "context" + + artifactregistry "cloud.google.com/go/artifactregistry/apiv1" + artifactregistrypb "google.golang.org/genproto/googleapis/devtools/artifactregistry/v1" +) + +func main() { + ctx := context.Background() + c, err := artifactregistry.NewClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &artifactregistrypb.ImportAptArtifactsRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/devtools/artifactregistry/v1#ImportAptArtifactsRequest. + } + op, err := c.ImportAptArtifacts(ctx, req) + if err != nil { + // TODO: Handle error. + } + + resp, err := op.Wait(ctx) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +// [END artifactregistry_v1_generated_ArtifactRegistry_ImportAptArtifacts_sync] diff --git a/internal/generated/snippets/artifactregistry/apiv1/Client/ImportYumArtifacts/main.go b/internal/generated/snippets/artifactregistry/apiv1/Client/ImportYumArtifacts/main.go new file mode 100644 index 000000000000..e410129fe0e7 --- /dev/null +++ b/internal/generated/snippets/artifactregistry/apiv1/Client/ImportYumArtifacts/main.go @@ -0,0 +1,53 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by cloud.google.com/go/internal/gapicgen/gensnippets. DO NOT EDIT. + +// [START artifactregistry_v1_generated_ArtifactRegistry_ImportYumArtifacts_sync] + +package main + +import ( + "context" + + artifactregistry "cloud.google.com/go/artifactregistry/apiv1" + artifactregistrypb "google.golang.org/genproto/googleapis/devtools/artifactregistry/v1" +) + +func main() { + ctx := context.Background() + c, err := artifactregistry.NewClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &artifactregistrypb.ImportYumArtifactsRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/devtools/artifactregistry/v1#ImportYumArtifactsRequest. + } + op, err := c.ImportYumArtifacts(ctx, req) + if err != nil { + // TODO: Handle error. + } + + resp, err := op.Wait(ctx) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +// [END artifactregistry_v1_generated_ArtifactRegistry_ImportYumArtifacts_sync] diff --git a/internal/generated/snippets/artifactregistry/apiv1/Client/ListDockerImages/main.go b/internal/generated/snippets/artifactregistry/apiv1/Client/ListDockerImages/main.go new file mode 100644 index 000000000000..8a19b892c1b0 --- /dev/null +++ b/internal/generated/snippets/artifactregistry/apiv1/Client/ListDockerImages/main.go @@ -0,0 +1,55 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by cloud.google.com/go/internal/gapicgen/gensnippets. DO NOT EDIT. + +// [START artifactregistry_v1_generated_ArtifactRegistry_ListDockerImages_sync] + +package main + +import ( + "context" + + artifactregistry "cloud.google.com/go/artifactregistry/apiv1" + "google.golang.org/api/iterator" + artifactregistrypb "google.golang.org/genproto/googleapis/devtools/artifactregistry/v1" +) + +func main() { + ctx := context.Background() + c, err := artifactregistry.NewClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &artifactregistrypb.ListDockerImagesRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/devtools/artifactregistry/v1#ListDockerImagesRequest. + } + it := c.ListDockerImages(ctx, req) + for { + resp, err := it.Next() + if err == iterator.Done { + break + } + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp + } +} + +// [END artifactregistry_v1_generated_ArtifactRegistry_ListDockerImages_sync] diff --git a/internal/generated/snippets/artifactregistry/apiv1/Client/ListFiles/main.go b/internal/generated/snippets/artifactregistry/apiv1/Client/ListFiles/main.go new file mode 100644 index 000000000000..bb9b95b43150 --- /dev/null +++ b/internal/generated/snippets/artifactregistry/apiv1/Client/ListFiles/main.go @@ -0,0 +1,55 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by cloud.google.com/go/internal/gapicgen/gensnippets. DO NOT EDIT. + +// [START artifactregistry_v1_generated_ArtifactRegistry_ListFiles_sync] + +package main + +import ( + "context" + + artifactregistry "cloud.google.com/go/artifactregistry/apiv1" + "google.golang.org/api/iterator" + artifactregistrypb "google.golang.org/genproto/googleapis/devtools/artifactregistry/v1" +) + +func main() { + ctx := context.Background() + c, err := artifactregistry.NewClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &artifactregistrypb.ListFilesRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/devtools/artifactregistry/v1#ListFilesRequest. + } + it := c.ListFiles(ctx, req) + for { + resp, err := it.Next() + if err == iterator.Done { + break + } + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp + } +} + +// [END artifactregistry_v1_generated_ArtifactRegistry_ListFiles_sync] diff --git a/internal/generated/snippets/artifactregistry/apiv1/Client/ListPackages/main.go b/internal/generated/snippets/artifactregistry/apiv1/Client/ListPackages/main.go new file mode 100644 index 000000000000..86a323b0cc83 --- /dev/null +++ b/internal/generated/snippets/artifactregistry/apiv1/Client/ListPackages/main.go @@ -0,0 +1,55 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by cloud.google.com/go/internal/gapicgen/gensnippets. DO NOT EDIT. + +// [START artifactregistry_v1_generated_ArtifactRegistry_ListPackages_sync] + +package main + +import ( + "context" + + artifactregistry "cloud.google.com/go/artifactregistry/apiv1" + "google.golang.org/api/iterator" + artifactregistrypb "google.golang.org/genproto/googleapis/devtools/artifactregistry/v1" +) + +func main() { + ctx := context.Background() + c, err := artifactregistry.NewClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &artifactregistrypb.ListPackagesRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/devtools/artifactregistry/v1#ListPackagesRequest. + } + it := c.ListPackages(ctx, req) + for { + resp, err := it.Next() + if err == iterator.Done { + break + } + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp + } +} + +// [END artifactregistry_v1_generated_ArtifactRegistry_ListPackages_sync] diff --git a/internal/generated/snippets/artifactregistry/apiv1/Client/ListRepositories/main.go b/internal/generated/snippets/artifactregistry/apiv1/Client/ListRepositories/main.go new file mode 100644 index 000000000000..cd5415ed030a --- /dev/null +++ b/internal/generated/snippets/artifactregistry/apiv1/Client/ListRepositories/main.go @@ -0,0 +1,55 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by cloud.google.com/go/internal/gapicgen/gensnippets. DO NOT EDIT. + +// [START artifactregistry_v1_generated_ArtifactRegistry_ListRepositories_sync] + +package main + +import ( + "context" + + artifactregistry "cloud.google.com/go/artifactregistry/apiv1" + "google.golang.org/api/iterator" + artifactregistrypb "google.golang.org/genproto/googleapis/devtools/artifactregistry/v1" +) + +func main() { + ctx := context.Background() + c, err := artifactregistry.NewClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &artifactregistrypb.ListRepositoriesRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/devtools/artifactregistry/v1#ListRepositoriesRequest. + } + it := c.ListRepositories(ctx, req) + for { + resp, err := it.Next() + if err == iterator.Done { + break + } + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp + } +} + +// [END artifactregistry_v1_generated_ArtifactRegistry_ListRepositories_sync] diff --git a/internal/generated/snippets/artifactregistry/apiv1/Client/ListTags/main.go b/internal/generated/snippets/artifactregistry/apiv1/Client/ListTags/main.go new file mode 100644 index 000000000000..f70b02d878a3 --- /dev/null +++ b/internal/generated/snippets/artifactregistry/apiv1/Client/ListTags/main.go @@ -0,0 +1,55 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by cloud.google.com/go/internal/gapicgen/gensnippets. DO NOT EDIT. + +// [START artifactregistry_v1_generated_ArtifactRegistry_ListTags_sync] + +package main + +import ( + "context" + + artifactregistry "cloud.google.com/go/artifactregistry/apiv1" + "google.golang.org/api/iterator" + artifactregistrypb "google.golang.org/genproto/googleapis/devtools/artifactregistry/v1" +) + +func main() { + ctx := context.Background() + c, err := artifactregistry.NewClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &artifactregistrypb.ListTagsRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/devtools/artifactregistry/v1#ListTagsRequest. + } + it := c.ListTags(ctx, req) + for { + resp, err := it.Next() + if err == iterator.Done { + break + } + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp + } +} + +// [END artifactregistry_v1_generated_ArtifactRegistry_ListTags_sync] diff --git a/internal/generated/snippets/artifactregistry/apiv1/Client/ListVersions/main.go b/internal/generated/snippets/artifactregistry/apiv1/Client/ListVersions/main.go new file mode 100644 index 000000000000..109bd350f253 --- /dev/null +++ b/internal/generated/snippets/artifactregistry/apiv1/Client/ListVersions/main.go @@ -0,0 +1,55 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by cloud.google.com/go/internal/gapicgen/gensnippets. DO NOT EDIT. + +// [START artifactregistry_v1_generated_ArtifactRegistry_ListVersions_sync] + +package main + +import ( + "context" + + artifactregistry "cloud.google.com/go/artifactregistry/apiv1" + "google.golang.org/api/iterator" + artifactregistrypb "google.golang.org/genproto/googleapis/devtools/artifactregistry/v1" +) + +func main() { + ctx := context.Background() + c, err := artifactregistry.NewClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &artifactregistrypb.ListVersionsRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/devtools/artifactregistry/v1#ListVersionsRequest. + } + it := c.ListVersions(ctx, req) + for { + resp, err := it.Next() + if err == iterator.Done { + break + } + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp + } +} + +// [END artifactregistry_v1_generated_ArtifactRegistry_ListVersions_sync] diff --git a/internal/generated/snippets/artifactregistry/apiv1/Client/SetIamPolicy/main.go b/internal/generated/snippets/artifactregistry/apiv1/Client/SetIamPolicy/main.go new file mode 100644 index 000000000000..9ad1def9a2ea --- /dev/null +++ b/internal/generated/snippets/artifactregistry/apiv1/Client/SetIamPolicy/main.go @@ -0,0 +1,48 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by cloud.google.com/go/internal/gapicgen/gensnippets. DO NOT EDIT. + +// [START artifactregistry_v1_generated_ArtifactRegistry_SetIamPolicy_sync] + +package main + +import ( + "context" + + artifactregistry "cloud.google.com/go/artifactregistry/apiv1" + iampb "google.golang.org/genproto/googleapis/iam/v1" +) + +func main() { + ctx := context.Background() + c, err := artifactregistry.NewClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &iampb.SetIamPolicyRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/iam/v1#SetIamPolicyRequest. + } + resp, err := c.SetIamPolicy(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +// [END artifactregistry_v1_generated_ArtifactRegistry_SetIamPolicy_sync] diff --git a/internal/generated/snippets/artifactregistry/apiv1/Client/TestIamPermissions/main.go b/internal/generated/snippets/artifactregistry/apiv1/Client/TestIamPermissions/main.go new file mode 100644 index 000000000000..e34d11a62ab6 --- /dev/null +++ b/internal/generated/snippets/artifactregistry/apiv1/Client/TestIamPermissions/main.go @@ -0,0 +1,48 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by cloud.google.com/go/internal/gapicgen/gensnippets. DO NOT EDIT. + +// [START artifactregistry_v1_generated_ArtifactRegistry_TestIamPermissions_sync] + +package main + +import ( + "context" + + artifactregistry "cloud.google.com/go/artifactregistry/apiv1" + iampb "google.golang.org/genproto/googleapis/iam/v1" +) + +func main() { + ctx := context.Background() + c, err := artifactregistry.NewClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &iampb.TestIamPermissionsRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/iam/v1#TestIamPermissionsRequest. + } + resp, err := c.TestIamPermissions(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +// [END artifactregistry_v1_generated_ArtifactRegistry_TestIamPermissions_sync] diff --git a/internal/generated/snippets/artifactregistry/apiv1/Client/UpdateProjectSettings/main.go b/internal/generated/snippets/artifactregistry/apiv1/Client/UpdateProjectSettings/main.go new file mode 100644 index 000000000000..39e8a53ebac5 --- /dev/null +++ b/internal/generated/snippets/artifactregistry/apiv1/Client/UpdateProjectSettings/main.go @@ -0,0 +1,48 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by cloud.google.com/go/internal/gapicgen/gensnippets. DO NOT EDIT. + +// [START artifactregistry_v1_generated_ArtifactRegistry_UpdateProjectSettings_sync] + +package main + +import ( + "context" + + artifactregistry "cloud.google.com/go/artifactregistry/apiv1" + artifactregistrypb "google.golang.org/genproto/googleapis/devtools/artifactregistry/v1" +) + +func main() { + ctx := context.Background() + c, err := artifactregistry.NewClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &artifactregistrypb.UpdateProjectSettingsRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/devtools/artifactregistry/v1#UpdateProjectSettingsRequest. + } + resp, err := c.UpdateProjectSettings(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +// [END artifactregistry_v1_generated_ArtifactRegistry_UpdateProjectSettings_sync] diff --git a/internal/generated/snippets/artifactregistry/apiv1/Client/UpdateRepository/main.go b/internal/generated/snippets/artifactregistry/apiv1/Client/UpdateRepository/main.go new file mode 100644 index 000000000000..182d6094970a --- /dev/null +++ b/internal/generated/snippets/artifactregistry/apiv1/Client/UpdateRepository/main.go @@ -0,0 +1,48 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by cloud.google.com/go/internal/gapicgen/gensnippets. DO NOT EDIT. + +// [START artifactregistry_v1_generated_ArtifactRegistry_UpdateRepository_sync] + +package main + +import ( + "context" + + artifactregistry "cloud.google.com/go/artifactregistry/apiv1" + artifactregistrypb "google.golang.org/genproto/googleapis/devtools/artifactregistry/v1" +) + +func main() { + ctx := context.Background() + c, err := artifactregistry.NewClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &artifactregistrypb.UpdateRepositoryRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/devtools/artifactregistry/v1#UpdateRepositoryRequest. + } + resp, err := c.UpdateRepository(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +// [END artifactregistry_v1_generated_ArtifactRegistry_UpdateRepository_sync] diff --git a/internal/generated/snippets/artifactregistry/apiv1/Client/UpdateTag/main.go b/internal/generated/snippets/artifactregistry/apiv1/Client/UpdateTag/main.go new file mode 100644 index 000000000000..b19bc48c9b66 --- /dev/null +++ b/internal/generated/snippets/artifactregistry/apiv1/Client/UpdateTag/main.go @@ -0,0 +1,48 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by cloud.google.com/go/internal/gapicgen/gensnippets. DO NOT EDIT. + +// [START artifactregistry_v1_generated_ArtifactRegistry_UpdateTag_sync] + +package main + +import ( + "context" + + artifactregistry "cloud.google.com/go/artifactregistry/apiv1" + artifactregistrypb "google.golang.org/genproto/googleapis/devtools/artifactregistry/v1" +) + +func main() { + ctx := context.Background() + c, err := artifactregistry.NewClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &artifactregistrypb.UpdateTagRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/devtools/artifactregistry/v1#UpdateTagRequest. + } + resp, err := c.UpdateTag(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +// [END artifactregistry_v1_generated_ArtifactRegistry_UpdateTag_sync] diff --git a/internal/generated/snippets/artifactregistry/apiv1/snippet_metadata.google.devtools.artifactregistry.v1.json b/internal/generated/snippets/artifactregistry/apiv1/snippet_metadata.google.devtools.artifactregistry.v1.json new file mode 100644 index 000000000000..bb06efdf3c4c --- /dev/null +++ b/internal/generated/snippets/artifactregistry/apiv1/snippet_metadata.google.devtools.artifactregistry.v1.json @@ -0,0 +1,1256 @@ +{ + "clientLibrary": { + "name": "cloud.google.com/go/artifactregistry/apiv1", + "version": "1.4.0", + "language": "GO", + "apis": [ + { + "id": "google.devtools.artifactregistry.v1", + "version": "v1" + } + ] + }, + "snippets": [ + { + "regionTag": "artifactregistry_v1_generated_ArtifactRegistry_CreateRepository_sync", + "title": "artifactregistry CreateRepository Sample", + "description": "CreateRepository creates a repository. The returned Operation will finish once the\nrepository has been created. Its response will be the created Repository.", + "file": "Client/CreateRepository/main.go", + "language": "GO", + "clientMethod": { + "shortName": "CreateRepository", + "fullName": "google.devtools.artifactregistry.v1.Client.CreateRepository", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "artifactregistrypb.CreateRepositoryRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "resultType": "CreateRepositoryOperation", + "client": { + "shortName": "Client", + "fullName": "google.devtools.artifactregistry.v1.Client" + }, + "method": { + "shortName": "CreateRepository", + "fullName": "google.devtools.artifactregistry.v1.ArtifactRegistry.CreateRepository", + "service": { + "shortName": "ArtifactRegistry", + "fullName": "google.devtools.artifactregistry.v1.ArtifactRegistry" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 52, + "type": "FULL" + } + ] + }, + { + "regionTag": "artifactregistry_v1_generated_ArtifactRegistry_CreateTag_sync", + "title": "artifactregistry CreateTag Sample", + "description": "CreateTag creates a tag.", + "file": "Client/CreateTag/main.go", + "language": "GO", + "clientMethod": { + "shortName": "CreateTag", + "fullName": "google.devtools.artifactregistry.v1.Client.CreateTag", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "artifactregistrypb.CreateTagRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "resultType": "artifactregistrypb.Tag", + "client": { + "shortName": "Client", + "fullName": "google.devtools.artifactregistry.v1.Client" + }, + "method": { + "shortName": "CreateTag", + "fullName": "google.devtools.artifactregistry.v1.ArtifactRegistry.CreateTag", + "service": { + "shortName": "ArtifactRegistry", + "fullName": "google.devtools.artifactregistry.v1.ArtifactRegistry" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 47, + "type": "FULL" + } + ] + }, + { + "regionTag": "artifactregistry_v1_generated_ArtifactRegistry_DeletePackage_sync", + "title": "artifactregistry DeletePackage Sample", + "description": "DeletePackage deletes a package and all of its versions and tags. The returned operation\nwill complete once the package has been deleted.", + "file": "Client/DeletePackage/main.go", + "language": "GO", + "clientMethod": { + "shortName": "DeletePackage", + "fullName": "google.devtools.artifactregistry.v1.Client.DeletePackage", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "artifactregistrypb.DeletePackageRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "resultType": "DeletePackageOperation", + "client": { + "shortName": "Client", + "fullName": "google.devtools.artifactregistry.v1.Client" + }, + "method": { + "shortName": "DeletePackage", + "fullName": "google.devtools.artifactregistry.v1.ArtifactRegistry.DeletePackage", + "service": { + "shortName": "ArtifactRegistry", + "fullName": "google.devtools.artifactregistry.v1.ArtifactRegistry" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 50, + "type": "FULL" + } + ] + }, + { + "regionTag": "artifactregistry_v1_generated_ArtifactRegistry_DeleteRepository_sync", + "title": "artifactregistry DeleteRepository Sample", + "description": "DeleteRepository deletes a repository and all of its contents. The returned Operation will\nfinish once the repository has been deleted. It will not have any Operation\nmetadata and will return a google.protobuf.Empty response.", + "file": "Client/DeleteRepository/main.go", + "language": "GO", + "clientMethod": { + "shortName": "DeleteRepository", + "fullName": "google.devtools.artifactregistry.v1.Client.DeleteRepository", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "artifactregistrypb.DeleteRepositoryRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "resultType": "DeleteRepositoryOperation", + "client": { + "shortName": "Client", + "fullName": "google.devtools.artifactregistry.v1.Client" + }, + "method": { + "shortName": "DeleteRepository", + "fullName": "google.devtools.artifactregistry.v1.ArtifactRegistry.DeleteRepository", + "service": { + "shortName": "ArtifactRegistry", + "fullName": "google.devtools.artifactregistry.v1.ArtifactRegistry" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 50, + "type": "FULL" + } + ] + }, + { + "regionTag": "artifactregistry_v1_generated_ArtifactRegistry_DeleteTag_sync", + "title": "artifactregistry DeleteTag Sample", + "description": "DeleteTag deletes a tag.", + "file": "Client/DeleteTag/main.go", + "language": "GO", + "clientMethod": { + "shortName": "DeleteTag", + "fullName": "google.devtools.artifactregistry.v1.Client.DeleteTag", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "artifactregistrypb.DeleteTagRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "client": { + "shortName": "Client", + "fullName": "google.devtools.artifactregistry.v1.Client" + }, + "method": { + "shortName": "DeleteTag", + "fullName": "google.devtools.artifactregistry.v1.ArtifactRegistry.DeleteTag", + "service": { + "shortName": "ArtifactRegistry", + "fullName": "google.devtools.artifactregistry.v1.ArtifactRegistry" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 45, + "type": "FULL" + } + ] + }, + { + "regionTag": "artifactregistry_v1_generated_ArtifactRegistry_DeleteVersion_sync", + "title": "artifactregistry DeleteVersion Sample", + "description": "DeleteVersion deletes a version and all of its content. The returned operation will\ncomplete once the version has been deleted.", + "file": "Client/DeleteVersion/main.go", + "language": "GO", + "clientMethod": { + "shortName": "DeleteVersion", + "fullName": "google.devtools.artifactregistry.v1.Client.DeleteVersion", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "artifactregistrypb.DeleteVersionRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "resultType": "DeleteVersionOperation", + "client": { + "shortName": "Client", + "fullName": "google.devtools.artifactregistry.v1.Client" + }, + "method": { + "shortName": "DeleteVersion", + "fullName": "google.devtools.artifactregistry.v1.ArtifactRegistry.DeleteVersion", + "service": { + "shortName": "ArtifactRegistry", + "fullName": "google.devtools.artifactregistry.v1.ArtifactRegistry" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 50, + "type": "FULL" + } + ] + }, + { + "regionTag": "artifactregistry_v1_generated_ArtifactRegistry_GetDockerImage_sync", + "title": "artifactregistry GetDockerImage Sample", + "description": "GetDockerImage gets a docker image.", + "file": "Client/GetDockerImage/main.go", + "language": "GO", + "clientMethod": { + "shortName": "GetDockerImage", + "fullName": "google.devtools.artifactregistry.v1.Client.GetDockerImage", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "artifactregistrypb.GetDockerImageRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "resultType": "artifactregistrypb.DockerImage", + "client": { + "shortName": "Client", + "fullName": "google.devtools.artifactregistry.v1.Client" + }, + "method": { + "shortName": "GetDockerImage", + "fullName": "google.devtools.artifactregistry.v1.ArtifactRegistry.GetDockerImage", + "service": { + "shortName": "ArtifactRegistry", + "fullName": "google.devtools.artifactregistry.v1.ArtifactRegistry" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 47, + "type": "FULL" + } + ] + }, + { + "regionTag": "artifactregistry_v1_generated_ArtifactRegistry_GetFile_sync", + "title": "artifactregistry GetFile Sample", + "description": "GetFile gets a file.", + "file": "Client/GetFile/main.go", + "language": "GO", + "clientMethod": { + "shortName": "GetFile", + "fullName": "google.devtools.artifactregistry.v1.Client.GetFile", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "artifactregistrypb.GetFileRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "resultType": "artifactregistrypb.File", + "client": { + "shortName": "Client", + "fullName": "google.devtools.artifactregistry.v1.Client" + }, + "method": { + "shortName": "GetFile", + "fullName": "google.devtools.artifactregistry.v1.ArtifactRegistry.GetFile", + "service": { + "shortName": "ArtifactRegistry", + "fullName": "google.devtools.artifactregistry.v1.ArtifactRegistry" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 47, + "type": "FULL" + } + ] + }, + { + "regionTag": "artifactregistry_v1_generated_ArtifactRegistry_GetIamPolicy_sync", + "title": "artifactregistry GetIamPolicy Sample", + "description": "GetIamPolicy gets the IAM policy for a given resource.", + "file": "Client/GetIamPolicy/main.go", + "language": "GO", + "clientMethod": { + "shortName": "GetIamPolicy", + "fullName": "google.devtools.artifactregistry.v1.Client.GetIamPolicy", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "iampb.GetIamPolicyRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "resultType": "iampb.Policy", + "client": { + "shortName": "Client", + "fullName": "google.devtools.artifactregistry.v1.Client" + }, + "method": { + "shortName": "GetIamPolicy", + "fullName": "google.devtools.artifactregistry.v1.ArtifactRegistry.GetIamPolicy", + "service": { + "shortName": "ArtifactRegistry", + "fullName": "google.devtools.artifactregistry.v1.ArtifactRegistry" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 47, + "type": "FULL" + } + ] + }, + { + "regionTag": "artifactregistry_v1_generated_ArtifactRegistry_GetPackage_sync", + "title": "artifactregistry GetPackage Sample", + "description": "GetPackage gets a package.", + "file": "Client/GetPackage/main.go", + "language": "GO", + "clientMethod": { + "shortName": "GetPackage", + "fullName": "google.devtools.artifactregistry.v1.Client.GetPackage", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "artifactregistrypb.GetPackageRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "resultType": "artifactregistrypb.Package", + "client": { + "shortName": "Client", + "fullName": "google.devtools.artifactregistry.v1.Client" + }, + "method": { + "shortName": "GetPackage", + "fullName": "google.devtools.artifactregistry.v1.ArtifactRegistry.GetPackage", + "service": { + "shortName": "ArtifactRegistry", + "fullName": "google.devtools.artifactregistry.v1.ArtifactRegistry" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 47, + "type": "FULL" + } + ] + }, + { + "regionTag": "artifactregistry_v1_generated_ArtifactRegistry_GetProjectSettings_sync", + "title": "artifactregistry GetProjectSettings Sample", + "description": "GetProjectSettings retrieves the Settings for the Project.", + "file": "Client/GetProjectSettings/main.go", + "language": "GO", + "clientMethod": { + "shortName": "GetProjectSettings", + "fullName": "google.devtools.artifactregistry.v1.Client.GetProjectSettings", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "artifactregistrypb.GetProjectSettingsRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "resultType": "artifactregistrypb.ProjectSettings", + "client": { + "shortName": "Client", + "fullName": "google.devtools.artifactregistry.v1.Client" + }, + "method": { + "shortName": "GetProjectSettings", + "fullName": "google.devtools.artifactregistry.v1.ArtifactRegistry.GetProjectSettings", + "service": { + "shortName": "ArtifactRegistry", + "fullName": "google.devtools.artifactregistry.v1.ArtifactRegistry" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 47, + "type": "FULL" + } + ] + }, + { + "regionTag": "artifactregistry_v1_generated_ArtifactRegistry_GetRepository_sync", + "title": "artifactregistry GetRepository Sample", + "description": "GetRepository gets a repository.", + "file": "Client/GetRepository/main.go", + "language": "GO", + "clientMethod": { + "shortName": "GetRepository", + "fullName": "google.devtools.artifactregistry.v1.Client.GetRepository", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "artifactregistrypb.GetRepositoryRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "resultType": "artifactregistrypb.Repository", + "client": { + "shortName": "Client", + "fullName": "google.devtools.artifactregistry.v1.Client" + }, + "method": { + "shortName": "GetRepository", + "fullName": "google.devtools.artifactregistry.v1.ArtifactRegistry.GetRepository", + "service": { + "shortName": "ArtifactRegistry", + "fullName": "google.devtools.artifactregistry.v1.ArtifactRegistry" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 47, + "type": "FULL" + } + ] + }, + { + "regionTag": "artifactregistry_v1_generated_ArtifactRegistry_GetTag_sync", + "title": "artifactregistry GetTag Sample", + "description": "GetTag gets a tag.", + "file": "Client/GetTag/main.go", + "language": "GO", + "clientMethod": { + "shortName": "GetTag", + "fullName": "google.devtools.artifactregistry.v1.Client.GetTag", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "artifactregistrypb.GetTagRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "resultType": "artifactregistrypb.Tag", + "client": { + "shortName": "Client", + "fullName": "google.devtools.artifactregistry.v1.Client" + }, + "method": { + "shortName": "GetTag", + "fullName": "google.devtools.artifactregistry.v1.ArtifactRegistry.GetTag", + "service": { + "shortName": "ArtifactRegistry", + "fullName": "google.devtools.artifactregistry.v1.ArtifactRegistry" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 47, + "type": "FULL" + } + ] + }, + { + "regionTag": "artifactregistry_v1_generated_ArtifactRegistry_GetVersion_sync", + "title": "artifactregistry GetVersion Sample", + "description": "GetVersion gets a version", + "file": "Client/GetVersion/main.go", + "language": "GO", + "clientMethod": { + "shortName": "GetVersion", + "fullName": "google.devtools.artifactregistry.v1.Client.GetVersion", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "artifactregistrypb.GetVersionRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "resultType": "artifactregistrypb.Version", + "client": { + "shortName": "Client", + "fullName": "google.devtools.artifactregistry.v1.Client" + }, + "method": { + "shortName": "GetVersion", + "fullName": "google.devtools.artifactregistry.v1.ArtifactRegistry.GetVersion", + "service": { + "shortName": "ArtifactRegistry", + "fullName": "google.devtools.artifactregistry.v1.ArtifactRegistry" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 47, + "type": "FULL" + } + ] + }, + { + "regionTag": "artifactregistry_v1_generated_ArtifactRegistry_ImportAptArtifacts_sync", + "title": "artifactregistry ImportAptArtifacts Sample", + "description": "ImportAptArtifacts imports Apt artifacts. The returned Operation will complete once the\nresources are imported. Package, Version, and File resources are created\nbased on the imported artifacts. Imported artifacts that conflict with\nexisting resources are ignored.", + "file": "Client/ImportAptArtifacts/main.go", + "language": "GO", + "clientMethod": { + "shortName": "ImportAptArtifacts", + "fullName": "google.devtools.artifactregistry.v1.Client.ImportAptArtifacts", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "artifactregistrypb.ImportAptArtifactsRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "resultType": "ImportAptArtifactsOperation", + "client": { + "shortName": "Client", + "fullName": "google.devtools.artifactregistry.v1.Client" + }, + "method": { + "shortName": "ImportAptArtifacts", + "fullName": "google.devtools.artifactregistry.v1.ArtifactRegistry.ImportAptArtifacts", + "service": { + "shortName": "ArtifactRegistry", + "fullName": "google.devtools.artifactregistry.v1.ArtifactRegistry" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 52, + "type": "FULL" + } + ] + }, + { + "regionTag": "artifactregistry_v1_generated_ArtifactRegistry_ImportYumArtifacts_sync", + "title": "artifactregistry ImportYumArtifacts Sample", + "description": "ImportYumArtifacts imports Yum (RPM) artifacts. The returned Operation will complete once the\nresources are imported. Package, Version, and File resources are created\nbased on the imported artifacts. Imported artifacts that conflict with\nexisting resources are ignored.", + "file": "Client/ImportYumArtifacts/main.go", + "language": "GO", + "clientMethod": { + "shortName": "ImportYumArtifacts", + "fullName": "google.devtools.artifactregistry.v1.Client.ImportYumArtifacts", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "artifactregistrypb.ImportYumArtifactsRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "resultType": "ImportYumArtifactsOperation", + "client": { + "shortName": "Client", + "fullName": "google.devtools.artifactregistry.v1.Client" + }, + "method": { + "shortName": "ImportYumArtifacts", + "fullName": "google.devtools.artifactregistry.v1.ArtifactRegistry.ImportYumArtifacts", + "service": { + "shortName": "ArtifactRegistry", + "fullName": "google.devtools.artifactregistry.v1.ArtifactRegistry" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 52, + "type": "FULL" + } + ] + }, + { + "regionTag": "artifactregistry_v1_generated_ArtifactRegistry_ListDockerImages_sync", + "title": "artifactregistry ListDockerImages Sample", + "description": "ListDockerImages lists docker images.", + "file": "Client/ListDockerImages/main.go", + "language": "GO", + "clientMethod": { + "shortName": "ListDockerImages", + "fullName": "google.devtools.artifactregistry.v1.Client.ListDockerImages", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "artifactregistrypb.ListDockerImagesRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "resultType": "DockerImageIterator", + "client": { + "shortName": "Client", + "fullName": "google.devtools.artifactregistry.v1.Client" + }, + "method": { + "shortName": "ListDockerImages", + "fullName": "google.devtools.artifactregistry.v1.ArtifactRegistry.ListDockerImages", + "service": { + "shortName": "ArtifactRegistry", + "fullName": "google.devtools.artifactregistry.v1.ArtifactRegistry" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 54, + "type": "FULL" + } + ] + }, + { + "regionTag": "artifactregistry_v1_generated_ArtifactRegistry_ListFiles_sync", + "title": "artifactregistry ListFiles Sample", + "description": "ListFiles lists files.", + "file": "Client/ListFiles/main.go", + "language": "GO", + "clientMethod": { + "shortName": "ListFiles", + "fullName": "google.devtools.artifactregistry.v1.Client.ListFiles", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "artifactregistrypb.ListFilesRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "resultType": "FileIterator", + "client": { + "shortName": "Client", + "fullName": "google.devtools.artifactregistry.v1.Client" + }, + "method": { + "shortName": "ListFiles", + "fullName": "google.devtools.artifactregistry.v1.ArtifactRegistry.ListFiles", + "service": { + "shortName": "ArtifactRegistry", + "fullName": "google.devtools.artifactregistry.v1.ArtifactRegistry" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 54, + "type": "FULL" + } + ] + }, + { + "regionTag": "artifactregistry_v1_generated_ArtifactRegistry_ListPackages_sync", + "title": "artifactregistry ListPackages Sample", + "description": "ListPackages lists packages.", + "file": "Client/ListPackages/main.go", + "language": "GO", + "clientMethod": { + "shortName": "ListPackages", + "fullName": "google.devtools.artifactregistry.v1.Client.ListPackages", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "artifactregistrypb.ListPackagesRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "resultType": "PackageIterator", + "client": { + "shortName": "Client", + "fullName": "google.devtools.artifactregistry.v1.Client" + }, + "method": { + "shortName": "ListPackages", + "fullName": "google.devtools.artifactregistry.v1.ArtifactRegistry.ListPackages", + "service": { + "shortName": "ArtifactRegistry", + "fullName": "google.devtools.artifactregistry.v1.ArtifactRegistry" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 54, + "type": "FULL" + } + ] + }, + { + "regionTag": "artifactregistry_v1_generated_ArtifactRegistry_ListRepositories_sync", + "title": "artifactregistry ListRepositories Sample", + "description": "ListRepositories lists repositories.", + "file": "Client/ListRepositories/main.go", + "language": "GO", + "clientMethod": { + "shortName": "ListRepositories", + "fullName": "google.devtools.artifactregistry.v1.Client.ListRepositories", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "artifactregistrypb.ListRepositoriesRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "resultType": "RepositoryIterator", + "client": { + "shortName": "Client", + "fullName": "google.devtools.artifactregistry.v1.Client" + }, + "method": { + "shortName": "ListRepositories", + "fullName": "google.devtools.artifactregistry.v1.ArtifactRegistry.ListRepositories", + "service": { + "shortName": "ArtifactRegistry", + "fullName": "google.devtools.artifactregistry.v1.ArtifactRegistry" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 54, + "type": "FULL" + } + ] + }, + { + "regionTag": "artifactregistry_v1_generated_ArtifactRegistry_ListTags_sync", + "title": "artifactregistry ListTags Sample", + "description": "ListTags lists tags.", + "file": "Client/ListTags/main.go", + "language": "GO", + "clientMethod": { + "shortName": "ListTags", + "fullName": "google.devtools.artifactregistry.v1.Client.ListTags", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "artifactregistrypb.ListTagsRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "resultType": "TagIterator", + "client": { + "shortName": "Client", + "fullName": "google.devtools.artifactregistry.v1.Client" + }, + "method": { + "shortName": "ListTags", + "fullName": "google.devtools.artifactregistry.v1.ArtifactRegistry.ListTags", + "service": { + "shortName": "ArtifactRegistry", + "fullName": "google.devtools.artifactregistry.v1.ArtifactRegistry" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 54, + "type": "FULL" + } + ] + }, + { + "regionTag": "artifactregistry_v1_generated_ArtifactRegistry_ListVersions_sync", + "title": "artifactregistry ListVersions Sample", + "description": "ListVersions lists versions.", + "file": "Client/ListVersions/main.go", + "language": "GO", + "clientMethod": { + "shortName": "ListVersions", + "fullName": "google.devtools.artifactregistry.v1.Client.ListVersions", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "artifactregistrypb.ListVersionsRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "resultType": "VersionIterator", + "client": { + "shortName": "Client", + "fullName": "google.devtools.artifactregistry.v1.Client" + }, + "method": { + "shortName": "ListVersions", + "fullName": "google.devtools.artifactregistry.v1.ArtifactRegistry.ListVersions", + "service": { + "shortName": "ArtifactRegistry", + "fullName": "google.devtools.artifactregistry.v1.ArtifactRegistry" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 54, + "type": "FULL" + } + ] + }, + { + "regionTag": "artifactregistry_v1_generated_ArtifactRegistry_SetIamPolicy_sync", + "title": "artifactregistry SetIamPolicy Sample", + "description": "SetIamPolicy updates the IAM policy for a given resource.", + "file": "Client/SetIamPolicy/main.go", + "language": "GO", + "clientMethod": { + "shortName": "SetIamPolicy", + "fullName": "google.devtools.artifactregistry.v1.Client.SetIamPolicy", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "iampb.SetIamPolicyRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "resultType": "iampb.Policy", + "client": { + "shortName": "Client", + "fullName": "google.devtools.artifactregistry.v1.Client" + }, + "method": { + "shortName": "SetIamPolicy", + "fullName": "google.devtools.artifactregistry.v1.ArtifactRegistry.SetIamPolicy", + "service": { + "shortName": "ArtifactRegistry", + "fullName": "google.devtools.artifactregistry.v1.ArtifactRegistry" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 47, + "type": "FULL" + } + ] + }, + { + "regionTag": "artifactregistry_v1_generated_ArtifactRegistry_TestIamPermissions_sync", + "title": "artifactregistry TestIamPermissions Sample", + "description": "TestIamPermissions tests if the caller has a list of permissions on a resource.", + "file": "Client/TestIamPermissions/main.go", + "language": "GO", + "clientMethod": { + "shortName": "TestIamPermissions", + "fullName": "google.devtools.artifactregistry.v1.Client.TestIamPermissions", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "iampb.TestIamPermissionsRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "resultType": "iampb.TestIamPermissionsResponse", + "client": { + "shortName": "Client", + "fullName": "google.devtools.artifactregistry.v1.Client" + }, + "method": { + "shortName": "TestIamPermissions", + "fullName": "google.devtools.artifactregistry.v1.ArtifactRegistry.TestIamPermissions", + "service": { + "shortName": "ArtifactRegistry", + "fullName": "google.devtools.artifactregistry.v1.ArtifactRegistry" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 47, + "type": "FULL" + } + ] + }, + { + "regionTag": "artifactregistry_v1_generated_ArtifactRegistry_UpdateProjectSettings_sync", + "title": "artifactregistry UpdateProjectSettings Sample", + "description": "UpdateProjectSettings updates the Settings for the Project.", + "file": "Client/UpdateProjectSettings/main.go", + "language": "GO", + "clientMethod": { + "shortName": "UpdateProjectSettings", + "fullName": "google.devtools.artifactregistry.v1.Client.UpdateProjectSettings", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "artifactregistrypb.UpdateProjectSettingsRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "resultType": "artifactregistrypb.ProjectSettings", + "client": { + "shortName": "Client", + "fullName": "google.devtools.artifactregistry.v1.Client" + }, + "method": { + "shortName": "UpdateProjectSettings", + "fullName": "google.devtools.artifactregistry.v1.ArtifactRegistry.UpdateProjectSettings", + "service": { + "shortName": "ArtifactRegistry", + "fullName": "google.devtools.artifactregistry.v1.ArtifactRegistry" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 47, + "type": "FULL" + } + ] + }, + { + "regionTag": "artifactregistry_v1_generated_ArtifactRegistry_UpdateRepository_sync", + "title": "artifactregistry UpdateRepository Sample", + "description": "UpdateRepository updates a repository.", + "file": "Client/UpdateRepository/main.go", + "language": "GO", + "clientMethod": { + "shortName": "UpdateRepository", + "fullName": "google.devtools.artifactregistry.v1.Client.UpdateRepository", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "artifactregistrypb.UpdateRepositoryRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "resultType": "artifactregistrypb.Repository", + "client": { + "shortName": "Client", + "fullName": "google.devtools.artifactregistry.v1.Client" + }, + "method": { + "shortName": "UpdateRepository", + "fullName": "google.devtools.artifactregistry.v1.ArtifactRegistry.UpdateRepository", + "service": { + "shortName": "ArtifactRegistry", + "fullName": "google.devtools.artifactregistry.v1.ArtifactRegistry" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 47, + "type": "FULL" + } + ] + }, + { + "regionTag": "artifactregistry_v1_generated_ArtifactRegistry_UpdateTag_sync", + "title": "artifactregistry UpdateTag Sample", + "description": "UpdateTag updates a tag.", + "file": "Client/UpdateTag/main.go", + "language": "GO", + "clientMethod": { + "shortName": "UpdateTag", + "fullName": "google.devtools.artifactregistry.v1.Client.UpdateTag", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "artifactregistrypb.UpdateTagRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "resultType": "artifactregistrypb.Tag", + "client": { + "shortName": "Client", + "fullName": "google.devtools.artifactregistry.v1.Client" + }, + "method": { + "shortName": "UpdateTag", + "fullName": "google.devtools.artifactregistry.v1.ArtifactRegistry.UpdateTag", + "service": { + "shortName": "ArtifactRegistry", + "fullName": "google.devtools.artifactregistry.v1.ArtifactRegistry" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 47, + "type": "FULL" + } + ] + } + ] +} \ No newline at end of file diff --git a/internal/generated/snippets/artifactregistry/apiv1beta2/snippet_metadata.google.devtools.artifactregistry.v1beta2.json b/internal/generated/snippets/artifactregistry/apiv1beta2/snippet_metadata.google.devtools.artifactregistry.v1beta2.json index f9dc566e4d68..17656ec063f2 100644 --- a/internal/generated/snippets/artifactregistry/apiv1beta2/snippet_metadata.google.devtools.artifactregistry.v1beta2.json +++ b/internal/generated/snippets/artifactregistry/apiv1beta2/snippet_metadata.google.devtools.artifactregistry.v1beta2.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "cloud.google.com/go/artifactregistry/apiv1beta2", - "version": "1.3.0", + "version": "1.4.0", "language": "GO", "apis": [ { diff --git a/internal/generated/snippets/bigquery/connection/apiv1beta1/snippet_metadata.google.cloud.bigquery.connection.v1beta1.json b/internal/generated/snippets/bigquery/connection/apiv1beta1/snippet_metadata.google.cloud.bigquery.connection.v1beta1.json index 04b3a41e9a25..50b24aacf823 100644 --- a/internal/generated/snippets/bigquery/connection/apiv1beta1/snippet_metadata.google.cloud.bigquery.connection.v1beta1.json +++ b/internal/generated/snippets/bigquery/connection/apiv1beta1/snippet_metadata.google.cloud.bigquery.connection.v1beta1.json @@ -243,7 +243,7 @@ { "regionTag": "bigqueryconnection_v1beta1_generated_ConnectionService_SetIamPolicy_sync", "title": "bigqueryconnection SetIamPolicy Sample", - "description": "SetIamPolicy sets the access control policy on the specified resource. Replaces any\nexisting policy.\n\nCan return Public Errors: NOT_FOUND, INVALID_ARGUMENT and PERMISSION_DENIED", + "description": "SetIamPolicy sets the access control policy on the specified resource. Replaces any\nexisting policy.\n\nCan return NOT_FOUND, INVALID_ARGUMENT, and PERMISSION_DENIED errors.", "file": "Client/SetIamPolicy/main.go", "language": "GO", "clientMethod": { diff --git a/internal/generated/snippets/contactcenterinsights/apiv1/snippet_metadata.google.cloud.contactcenterinsights.v1.json b/internal/generated/snippets/contactcenterinsights/apiv1/snippet_metadata.google.cloud.contactcenterinsights.v1.json index 9e07a9d3b5c7..ca059968f1d1 100644 --- a/internal/generated/snippets/contactcenterinsights/apiv1/snippet_metadata.google.cloud.contactcenterinsights.v1.json +++ b/internal/generated/snippets/contactcenterinsights/apiv1/snippet_metadata.google.cloud.contactcenterinsights.v1.json @@ -103,51 +103,6 @@ } ] }, - { - "regionTag": "contactcenterinsights_v1_generated_ContactCenterInsights_CancelOperation_sync", - "title": "contactcenterinsights CancelOperation Sample", - "description": "CancelOperation is a utility method from google.longrunning.Operations.", - "file": "Client/CancelOperation/main.go", - "language": "GO", - "clientMethod": { - "shortName": "CancelOperation", - "fullName": "google.cloud.contactcenterinsights.v1.Client.CancelOperation", - "parameters": [ - { - "type": "context.Context", - "name": "ctx" - }, - { - "type": "longrunningpb.CancelOperationRequest", - "name": "req" - }, - { - "type": "...gax.CallOption", - "name": "opts" - } - ], - "client": { - "shortName": "Client", - "fullName": "google.cloud.contactcenterinsights.v1.Client" - }, - "method": { - "shortName": "CancelOperation", - "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights.CancelOperation", - "service": { - "shortName": "ContactCenterInsights", - "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights" - } - } - }, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 18, - "end": 45, - "type": "FULL" - } - ] - }, { "regionTag": "contactcenterinsights_v1_generated_ContactCenterInsights_CreateAnalysis_sync", "title": "contactcenterinsights CreateAnalysis Sample", @@ -880,52 +835,6 @@ } ] }, - { - "regionTag": "contactcenterinsights_v1_generated_ContactCenterInsights_GetOperation_sync", - "title": "contactcenterinsights GetOperation Sample", - "description": "GetOperation is a utility method from google.longrunning.Operations.", - "file": "Client/GetOperation/main.go", - "language": "GO", - "clientMethod": { - "shortName": "GetOperation", - "fullName": "google.cloud.contactcenterinsights.v1.Client.GetOperation", - "parameters": [ - { - "type": "context.Context", - "name": "ctx" - }, - { - "type": "longrunningpb.GetOperationRequest", - "name": "req" - }, - { - "type": "...gax.CallOption", - "name": "opts" - } - ], - "resultType": "longrunningpb.Operation", - "client": { - "shortName": "Client", - "fullName": "google.cloud.contactcenterinsights.v1.Client" - }, - "method": { - "shortName": "GetOperation", - "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights.GetOperation", - "service": { - "shortName": "ContactCenterInsights", - "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights" - } - } - }, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 18, - "end": 47, - "type": "FULL" - } - ] - }, { "regionTag": "contactcenterinsights_v1_generated_ContactCenterInsights_GetPhraseMatcher_sync", "title": "contactcenterinsights GetPhraseMatcher Sample", @@ -1248,52 +1157,6 @@ } ] }, - { - "regionTag": "contactcenterinsights_v1_generated_ContactCenterInsights_ListOperations_sync", - "title": "contactcenterinsights ListOperations Sample", - "description": "ListOperations is a utility method from google.longrunning.Operations.", - "file": "Client/ListOperations/main.go", - "language": "GO", - "clientMethod": { - "shortName": "ListOperations", - "fullName": "google.cloud.contactcenterinsights.v1.Client.ListOperations", - "parameters": [ - { - "type": "context.Context", - "name": "ctx" - }, - { - "type": "longrunningpb.ListOperationsRequest", - "name": "req" - }, - { - "type": "...gax.CallOption", - "name": "opts" - } - ], - "resultType": "OperationIterator", - "client": { - "shortName": "Client", - "fullName": "google.cloud.contactcenterinsights.v1.Client" - }, - "method": { - "shortName": "ListOperations", - "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights.ListOperations", - "service": { - "shortName": "ContactCenterInsights", - "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights" - } - } - }, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 18, - "end": 54, - "type": "FULL" - } - ] - }, { "regionTag": "contactcenterinsights_v1_generated_ContactCenterInsights_ListPhraseMatchers_sync", "title": "contactcenterinsights ListPhraseMatchers Sample", diff --git a/internal/generated/snippets/go.mod b/internal/generated/snippets/go.mod index 0c832212841e..d5b14f84364d 100644 --- a/internal/generated/snippets/go.mod +++ b/internal/generated/snippets/go.mod @@ -119,8 +119,8 @@ require ( cloud.google.com/go/websecurityscanner v1.0.0 cloud.google.com/go/workflows v1.1.0 github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect - google.golang.org/api v0.88.0 - google.golang.org/genproto v0.0.0-20220725144611-272f38e5d71b + google.golang.org/api v0.90.0 + google.golang.org/genproto v0.0.0-20220801145646-83ce21fca29f ) require ( diff --git a/internal/generated/snippets/go.sum b/internal/generated/snippets/go.sum index d900d4f130dd..ca9048edb46d 100644 --- a/internal/generated/snippets/go.sum +++ b/internal/generated/snippets/go.sum @@ -192,8 +192,9 @@ google.golang.org/api v0.78.0/go.mod h1:1Sg78yoMLOhlQTeF+ARBoytAcH1NNyyl390YMy6r google.golang.org/api v0.85.0/go.mod h1:AqZf8Ep9uZ2pyTvgL+x0D3Zt0eoT9b5E8fmzfu6FO2g= google.golang.org/api v0.86.0/go.mod h1:+Sem1dnrKlrXMR/X0bPnMWyluQe4RsNoYfmNLhOIkzw= google.golang.org/api v0.87.0/go.mod h1:+Sem1dnrKlrXMR/X0bPnMWyluQe4RsNoYfmNLhOIkzw= -google.golang.org/api v0.88.0 h1:MPwxQRqpyskYhr2iNyfsQ8R06eeyhe7UEuR30p136ZQ= google.golang.org/api v0.88.0/go.mod h1:+Sem1dnrKlrXMR/X0bPnMWyluQe4RsNoYfmNLhOIkzw= +google.golang.org/api v0.90.0 h1:WMnUWAvihIClUYFNeFA69VTuR3duKS3IalMGDQcLvq8= +google.golang.org/api v0.90.0/go.mod h1:+Sem1dnrKlrXMR/X0bPnMWyluQe4RsNoYfmNLhOIkzw= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= @@ -216,7 +217,6 @@ google.golang.org/genproto v0.0.0-20220429170224-98d788798c3e/go.mod h1:8w6bsBMX google.golang.org/genproto v0.0.0-20220505152158-f39f71e6c8f3/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4= google.golang.org/genproto v0.0.0-20220617124728-180714bec0ad/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= google.golang.org/genproto v0.0.0-20220621134657-43db42f103f7/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= -google.golang.org/genproto v0.0.0-20220623142657-077d458a5694/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= google.golang.org/genproto v0.0.0-20220624142145-8cd45d7dbd1f/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= google.golang.org/genproto v0.0.0-20220628213854-d9e0b6570c03/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= google.golang.org/genproto v0.0.0-20220630135532-f4acab7bd6cf/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= @@ -225,12 +225,12 @@ google.golang.org/genproto v0.0.0-20220706132729-d86698d07c53/go.mod h1:KEWEmljW google.golang.org/genproto v0.0.0-20220706185917-7780775163c4/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= google.golang.org/genproto v0.0.0-20220707144311-dc4cdde2ef63/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= google.golang.org/genproto v0.0.0-20220712132514-bdd2acd4974d/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= -google.golang.org/genproto v0.0.0-20220714211235-042d03aeabc9/go.mod h1:GkXuJDJ6aQ7lnJcRF+SJVgFdQhypqgl3LB1C9vabdRE= google.golang.org/genproto v0.0.0-20220718134204-073382fd740c/go.mod h1:GkXuJDJ6aQ7lnJcRF+SJVgFdQhypqgl3LB1C9vabdRE= google.golang.org/genproto v0.0.0-20220719170305-83ca9fad585f/go.mod h1:GkXuJDJ6aQ7lnJcRF+SJVgFdQhypqgl3LB1C9vabdRE= google.golang.org/genproto v0.0.0-20220720214146-176da50484ac/go.mod h1:GkXuJDJ6aQ7lnJcRF+SJVgFdQhypqgl3LB1C9vabdRE= -google.golang.org/genproto v0.0.0-20220725144611-272f38e5d71b h1:SfSkJugek6xm7lWywqth4r2iTrYLpD8lOj1nMIIhMNM= google.golang.org/genproto v0.0.0-20220725144611-272f38e5d71b/go.mod h1:iHe1svFLAZg9VWz891+QbRMwUv9O/1Ww+/mngYeThbc= +google.golang.org/genproto v0.0.0-20220801145646-83ce21fca29f h1:XVHpVMvPs4MtH3h6cThzKs2snNexcfd35vQx2T3IuIY= +google.golang.org/genproto v0.0.0-20220801145646-83ce21fca29f/go.mod h1:iHe1svFLAZg9VWz891+QbRMwUv9O/1Ww+/mngYeThbc= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= diff --git a/internal/godocfx/go.mod b/internal/godocfx/go.mod index 4869552dac08..b98c7d83c41e 100644 --- a/internal/godocfx/go.mod +++ b/internal/godocfx/go.mod @@ -30,9 +30,9 @@ require ( golang.org/x/sys v0.0.0-20220624220833-87e55d714810 // indirect golang.org/x/text v0.3.7 // indirect golang.org/x/xerrors v0.0.0-20220609144429-65e65417b02f // indirect - google.golang.org/api v0.88.0 // indirect + google.golang.org/api v0.90.0 // indirect google.golang.org/appengine v1.6.7 // indirect - google.golang.org/genproto v0.0.0-20220720214146-176da50484ac // indirect + google.golang.org/genproto v0.0.0-20220801145646-83ce21fca29f // indirect google.golang.org/grpc v1.48.0 // indirect google.golang.org/protobuf v1.28.0 // indirect ) diff --git a/internal/godocfx/go.sum b/internal/godocfx/go.sum index 053640c135a8..f99f8dda46c0 100644 --- a/internal/godocfx/go.sum +++ b/internal/godocfx/go.sum @@ -235,8 +235,8 @@ google.golang.org/api v0.75.0/go.mod h1:pU9QmyHLnzlpar1Mjt4IbapUCy8J+6HD6GeELN69 google.golang.org/api v0.78.0/go.mod h1:1Sg78yoMLOhlQTeF+ARBoytAcH1NNyyl390YMy6rKmw= google.golang.org/api v0.84.0/go.mod h1:NTsGnUFJMYROtiquksZHBWtHfeMC7iYthki7Eq3pa8o= google.golang.org/api v0.85.0/go.mod h1:AqZf8Ep9uZ2pyTvgL+x0D3Zt0eoT9b5E8fmzfu6FO2g= -google.golang.org/api v0.88.0 h1:MPwxQRqpyskYhr2iNyfsQ8R06eeyhe7UEuR30p136ZQ= -google.golang.org/api v0.88.0/go.mod h1:+Sem1dnrKlrXMR/X0bPnMWyluQe4RsNoYfmNLhOIkzw= +google.golang.org/api v0.90.0 h1:WMnUWAvihIClUYFNeFA69VTuR3duKS3IalMGDQcLvq8= +google.golang.org/api v0.90.0/go.mod h1:+Sem1dnrKlrXMR/X0bPnMWyluQe4RsNoYfmNLhOIkzw= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= @@ -272,8 +272,8 @@ google.golang.org/genproto v0.0.0-20220616135557-88e70c0c3a90/go.mod h1:KEWEmljW google.golang.org/genproto v0.0.0-20220617124728-180714bec0ad/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= google.golang.org/genproto v0.0.0-20220622131801-db39fadba55f/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= google.golang.org/genproto v0.0.0-20220624142145-8cd45d7dbd1f/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= -google.golang.org/genproto v0.0.0-20220720214146-176da50484ac h1:EOa+Yrhx1C0O+4pHeXeWrCwdI0tWI6IfUU56Vebs9wQ= -google.golang.org/genproto v0.0.0-20220720214146-176da50484ac/go.mod h1:GkXuJDJ6aQ7lnJcRF+SJVgFdQhypqgl3LB1C9vabdRE= +google.golang.org/genproto v0.0.0-20220801145646-83ce21fca29f h1:XVHpVMvPs4MtH3h6cThzKs2snNexcfd35vQx2T3IuIY= +google.golang.org/genproto v0.0.0-20220801145646-83ce21fca29f/go.mod h1:iHe1svFLAZg9VWz891+QbRMwUv9O/1Ww+/mngYeThbc= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= diff --git a/networksecurity/go.mod b/networksecurity/go.mod index ecebd41091c7..6ced29514cca 100644 --- a/networksecurity/go.mod +++ b/networksecurity/go.mod @@ -5,8 +5,8 @@ go 1.17 require ( cloud.google.com/go v0.102.1 github.com/googleapis/gax-go/v2 v2.4.0 - google.golang.org/api v0.85.0 - google.golang.org/genproto v0.0.0-20220725144611-272f38e5d71b + google.golang.org/api v0.90.0 + google.golang.org/genproto v0.0.0-20220801145646-83ce21fca29f google.golang.org/grpc v1.48.0 google.golang.org/protobuf v1.28.0 ) @@ -18,9 +18,9 @@ require ( github.com/google/go-cmp v0.5.8 // indirect github.com/googleapis/enterprise-certificate-proxy v0.1.0 // indirect go.opencensus.io v0.23.0 // indirect - golang.org/x/net v0.0.0-20220617184016-355a448f1bc9 // indirect - golang.org/x/oauth2 v0.0.0-20220608161450-d0670ef3b1eb // indirect - golang.org/x/sys v0.0.0-20220615213510-4f61da869c0c // indirect + golang.org/x/net v0.0.0-20220624214902-1bab6f366d9e // indirect + golang.org/x/oauth2 v0.0.0-20220622183110-fd043fe589d2 // indirect + golang.org/x/sys v0.0.0-20220624220833-87e55d714810 // indirect golang.org/x/text v0.3.7 // indirect google.golang.org/appengine v1.6.7 // indirect ) diff --git a/networksecurity/go.sum b/networksecurity/go.sum index e7107b43cc20..caab97273379 100644 --- a/networksecurity/go.sum +++ b/networksecurity/go.sum @@ -162,6 +162,7 @@ github.com/google/pprof v0.0.0-20210609004039-a478d1d731e9/go.mod h1:kpwsk12EmLe github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/enterprise-certificate-proxy v0.0.0-20220520183353-fd19c99a87aa/go.mod h1:17drOmN3MwGY7t0e+Ei9b45FFGA3fBs3x36SsCg1hq8= github.com/googleapis/enterprise-certificate-proxy v0.1.0 h1:zO8WHNx/MYiAKJ3d5spxZXZE6KHmIQGQcAzwUzV7qQw= github.com/googleapis/enterprise-certificate-proxy v0.1.0/go.mod h1:17drOmN3MwGY7t0e+Ei9b45FFGA3fBs3x36SsCg1hq8= @@ -290,8 +291,8 @@ golang.org/x/net v0.0.0-20220325170049-de3da57026de/go.mod h1:CfG3xpIq0wQ8r1q4Su golang.org/x/net v0.0.0-20220412020605-290c469a71a5/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220607020251-c690dde0001d/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.0.0-20220617184016-355a448f1bc9 h1:Yqz/iviulwKwAREEeUd3nbBFn0XuyJqkoft2IlrvOhc= -golang.org/x/net v0.0.0-20220617184016-355a448f1bc9/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= +golang.org/x/net v0.0.0-20220624214902-1bab6f366d9e h1:TsQ7F31D3bUCLeqPT0u+yjp1guoArKaNKmCr22PYgTQ= +golang.org/x/net v0.0.0-20220624214902-1bab6f366d9e/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -311,8 +312,9 @@ golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8/go.mod h1:KelEdhl1UZF7XfJ golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= golang.org/x/oauth2 v0.0.0-20220309155454-6242fa91716a/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= golang.org/x/oauth2 v0.0.0-20220411215720-9780585627b5/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= -golang.org/x/oauth2 v0.0.0-20220608161450-d0670ef3b1eb h1:8tDJ3aechhddbdPAxpycgXHJRMLpk/Ab+aa4OgdN5/g= golang.org/x/oauth2 v0.0.0-20220608161450-d0670ef3b1eb/go.mod h1:jaDAt6Dkxork7LmZnYtzbRWj0W47D86a3TGe0YHBvmE= +golang.org/x/oauth2 v0.0.0-20220622183110-fd043fe589d2 h1:+jnHzr9VPj32ykQVai5DNahi9+NSp7yYuCsl5eAQtL0= +golang.org/x/oauth2 v0.0.0-20220622183110-fd043fe589d2/go.mod h1:jaDAt6Dkxork7LmZnYtzbRWj0W47D86a3TGe0YHBvmE= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -383,8 +385,8 @@ golang.org/x/sys v0.0.0-20220502124256-b6088ccd6cba/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220610221304-9f5ed59c137d/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220615213510-4f61da869c0c h1:aFV+BgZ4svzjfabn8ERpuB4JI4N6/rdy1iusx77G3oU= -golang.org/x/sys v0.0.0-20220615213510-4f61da869c0c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220624220833-87e55d714810 h1:rHZQSjJdAI4Xf5Qzeh2bBc5YJIkPFVM6oDtMFYmgws0= +golang.org/x/sys v0.0.0-20220624220833-87e55d714810/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -497,8 +499,8 @@ google.golang.org/api v0.75.0/go.mod h1:pU9QmyHLnzlpar1Mjt4IbapUCy8J+6HD6GeELN69 google.golang.org/api v0.78.0/go.mod h1:1Sg78yoMLOhlQTeF+ARBoytAcH1NNyyl390YMy6rKmw= google.golang.org/api v0.80.0/go.mod h1:xY3nI94gbvBrE0J6NHXhxOmW97HG7Khjkku6AFB3Hyg= google.golang.org/api v0.84.0/go.mod h1:NTsGnUFJMYROtiquksZHBWtHfeMC7iYthki7Eq3pa8o= -google.golang.org/api v0.85.0 h1:8rJoHuRxx+vCmZtAO/3k1dRLvYNVyTJtZ5oaFZvhgvc= -google.golang.org/api v0.85.0/go.mod h1:AqZf8Ep9uZ2pyTvgL+x0D3Zt0eoT9b5E8fmzfu6FO2g= +google.golang.org/api v0.90.0 h1:WMnUWAvihIClUYFNeFA69VTuR3duKS3IalMGDQcLvq8= +google.golang.org/api v0.90.0/go.mod h1:+Sem1dnrKlrXMR/X0bPnMWyluQe4RsNoYfmNLhOIkzw= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= @@ -586,8 +588,9 @@ google.golang.org/genproto v0.0.0-20220523171625-347a074981d8/go.mod h1:RAyBrSAP google.golang.org/genproto v0.0.0-20220608133413-ed9918b62aac/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= google.golang.org/genproto v0.0.0-20220616135557-88e70c0c3a90/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= google.golang.org/genproto v0.0.0-20220617124728-180714bec0ad/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= -google.golang.org/genproto v0.0.0-20220725144611-272f38e5d71b h1:SfSkJugek6xm7lWywqth4r2iTrYLpD8lOj1nMIIhMNM= -google.golang.org/genproto v0.0.0-20220725144611-272f38e5d71b/go.mod h1:iHe1svFLAZg9VWz891+QbRMwUv9O/1Ww+/mngYeThbc= +google.golang.org/genproto v0.0.0-20220624142145-8cd45d7dbd1f/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= +google.golang.org/genproto v0.0.0-20220801145646-83ce21fca29f h1:XVHpVMvPs4MtH3h6cThzKs2snNexcfd35vQx2T3IuIY= +google.golang.org/genproto v0.0.0-20220801145646-83ce21fca29f/go.mod h1:iHe1svFLAZg9VWz891+QbRMwUv9O/1Ww+/mngYeThbc= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= diff --git a/retail/apiv2beta/catalog_client.go b/retail/apiv2beta/catalog_client.go index add028be5099..c4b43232768b 100644 --- a/retail/apiv2beta/catalog_client.go +++ b/retail/apiv2beta/catalog_client.go @@ -29,6 +29,7 @@ import ( "google.golang.org/api/option/internaloption" gtransport "google.golang.org/api/transport/grpc" retailpb "google.golang.org/genproto/googleapis/cloud/retail/v2beta" + longrunningpb "google.golang.org/genproto/googleapis/longrunning" "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/metadata" @@ -50,6 +51,8 @@ type CatalogCallOptions struct { AddCatalogAttribute []gax.CallOption RemoveCatalogAttribute []gax.CallOption ReplaceCatalogAttribute []gax.CallOption + GetOperation []gax.CallOption + ListOperations []gax.CallOption } func defaultCatalogGRPCClientOptions() []option.ClientOption { @@ -198,6 +201,19 @@ func defaultCatalogCallOptions() *CatalogCallOptions { }) }), }, + GetOperation: []gax.CallOption{}, + ListOperations: []gax.CallOption{ + gax.WithRetry(func() gax.Retryer { + return gax.OnCodes([]codes.Code{ + codes.Unavailable, + codes.DeadlineExceeded, + }, gax.Backoff{ + Initial: 100 * time.Millisecond, + Max: 300000 * time.Millisecond, + Multiplier: 1.30, + }) + }), + }, } } @@ -217,6 +233,8 @@ type internalCatalogClient interface { AddCatalogAttribute(context.Context, *retailpb.AddCatalogAttributeRequest, ...gax.CallOption) (*retailpb.AttributesConfig, error) RemoveCatalogAttribute(context.Context, *retailpb.RemoveCatalogAttributeRequest, ...gax.CallOption) (*retailpb.AttributesConfig, error) ReplaceCatalogAttribute(context.Context, *retailpb.ReplaceCatalogAttributeRequest, ...gax.CallOption) (*retailpb.AttributesConfig, error) + GetOperation(context.Context, *longrunningpb.GetOperationRequest, ...gax.CallOption) (*longrunningpb.Operation, error) + ListOperations(context.Context, *longrunningpb.ListOperationsRequest, ...gax.CallOption) *OperationIterator } // CatalogClient is a client for interacting with Retail API. @@ -371,6 +389,16 @@ func (c *CatalogClient) ReplaceCatalogAttribute(ctx context.Context, req *retail return c.internalClient.ReplaceCatalogAttribute(ctx, req, opts...) } +// GetOperation is a utility method from google.longrunning.Operations. +func (c *CatalogClient) GetOperation(ctx context.Context, req *longrunningpb.GetOperationRequest, opts ...gax.CallOption) (*longrunningpb.Operation, error) { + return c.internalClient.GetOperation(ctx, req, opts...) +} + +// ListOperations is a utility method from google.longrunning.Operations. +func (c *CatalogClient) ListOperations(ctx context.Context, req *longrunningpb.ListOperationsRequest, opts ...gax.CallOption) *OperationIterator { + return c.internalClient.ListOperations(ctx, req, opts...) +} + // catalogGRPCClient is a client for interacting with Retail API over gRPC transport. // // Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls. @@ -387,6 +415,8 @@ type catalogGRPCClient struct { // The gRPC API client. catalogClient retailpb.CatalogServiceClient + operationsClient longrunningpb.OperationsClient + // The x-goog-* metadata to be sent with each request. xGoogMetadata metadata.MD } @@ -421,6 +451,7 @@ func NewCatalogClient(ctx context.Context, opts ...option.ClientOption) (*Catalo disableDeadlines: disableDeadlines, catalogClient: retailpb.NewCatalogServiceClient(connPool), CallOptions: &client.CallOptions, + operationsClient: longrunningpb.NewOperationsClient(connPool), } c.setGoogleClientInfo() @@ -712,6 +743,68 @@ func (c *catalogGRPCClient) ReplaceCatalogAttribute(ctx context.Context, req *re return resp, nil } +func (c *catalogGRPCClient) GetOperation(ctx context.Context, req *longrunningpb.GetOperationRequest, opts ...gax.CallOption) (*longrunningpb.Operation, error) { + md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))) + + ctx = insertMetadata(ctx, c.xGoogMetadata, md) + opts = append((*c.CallOptions).GetOperation[0:len((*c.CallOptions).GetOperation):len((*c.CallOptions).GetOperation)], opts...) + var resp *longrunningpb.Operation + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + resp, err = c.operationsClient.GetOperation(ctx, req, settings.GRPC...) + return err + }, opts...) + if err != nil { + return nil, err + } + return resp, nil +} + +func (c *catalogGRPCClient) ListOperations(ctx context.Context, req *longrunningpb.ListOperationsRequest, opts ...gax.CallOption) *OperationIterator { + md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))) + + ctx = insertMetadata(ctx, c.xGoogMetadata, md) + opts = append((*c.CallOptions).ListOperations[0:len((*c.CallOptions).ListOperations):len((*c.CallOptions).ListOperations)], opts...) + it := &OperationIterator{} + req = proto.Clone(req).(*longrunningpb.ListOperationsRequest) + it.InternalFetch = func(pageSize int, pageToken string) ([]*longrunningpb.Operation, string, error) { + resp := &longrunningpb.ListOperationsResponse{} + if pageToken != "" { + req.PageToken = pageToken + } + if pageSize > math.MaxInt32 { + req.PageSize = math.MaxInt32 + } else if pageSize != 0 { + req.PageSize = int32(pageSize) + } + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + resp, err = c.operationsClient.ListOperations(ctx, req, settings.GRPC...) + return err + }, opts...) + if err != nil { + return nil, "", err + } + + it.Response = resp + return resp.GetOperations(), resp.GetNextPageToken(), nil + } + fetch := func(pageSize int, pageToken string) (string, error) { + items, nextPageToken, err := it.InternalFetch(pageSize, pageToken) + if err != nil { + return "", err + } + it.items = append(it.items, items...) + return nextPageToken, nil + } + + it.pageInfo, it.nextFunc = iterator.NewPageInfo(fetch, it.bufLen, it.takeBuf) + it.pageInfo.MaxSize = int(req.GetPageSize()) + it.pageInfo.Token = req.GetPageToken() + + return it +} + // CatalogIterator manages a stream of *retailpb.Catalog. type CatalogIterator struct { items []*retailpb.Catalog @@ -758,3 +851,50 @@ func (it *CatalogIterator) takeBuf() interface{} { it.items = nil return b } + +// OperationIterator manages a stream of *longrunningpb.Operation. +type OperationIterator struct { + items []*longrunningpb.Operation + 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 []*longrunningpb.Operation, nextPageToken string, err error) +} + +// PageInfo supports pagination. See the google.golang.org/api/iterator package for details. +func (it *OperationIterator) 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 *OperationIterator) Next() (*longrunningpb.Operation, error) { + var item *longrunningpb.Operation + if err := it.nextFunc(); err != nil { + return item, err + } + item = it.items[0] + it.items = it.items[1:] + return item, nil +} + +func (it *OperationIterator) bufLen() int { + return len(it.items) +} + +func (it *OperationIterator) takeBuf() interface{} { + b := it.items + it.items = nil + return b +} diff --git a/retail/apiv2beta/catalog_client_example_test.go b/retail/apiv2beta/catalog_client_example_test.go index 0e8f5641e0dc..986cefb2be06 100644 --- a/retail/apiv2beta/catalog_client_example_test.go +++ b/retail/apiv2beta/catalog_client_example_test.go @@ -22,6 +22,7 @@ import ( retail "cloud.google.com/go/retail/apiv2beta" "google.golang.org/api/iterator" retailpb "google.golang.org/genproto/googleapis/cloud/retail/v2beta" + longrunningpb "google.golang.org/genproto/googleapis/longrunning" ) func ExampleNewCatalogClient() { @@ -259,3 +260,49 @@ func ExampleCatalogClient_ReplaceCatalogAttribute() { // TODO: Use resp. _ = resp } + +func ExampleCatalogClient_GetOperation() { + ctx := context.Background() + c, err := retail.NewCatalogClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &longrunningpb.GetOperationRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/longrunning#GetOperationRequest. + } + resp, err := c.GetOperation(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleCatalogClient_ListOperations() { + ctx := context.Background() + c, err := retail.NewCatalogClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &longrunningpb.ListOperationsRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/longrunning#ListOperationsRequest. + } + it := c.ListOperations(ctx, req) + for { + resp, err := it.Next() + if err == iterator.Done { + break + } + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp + } +} diff --git a/retail/apiv2beta/completion_client.go b/retail/apiv2beta/completion_client.go index 2b40d4e64e09..cebe0ee84026 100644 --- a/retail/apiv2beta/completion_client.go +++ b/retail/apiv2beta/completion_client.go @@ -26,6 +26,7 @@ import ( "cloud.google.com/go/longrunning" lroauto "cloud.google.com/go/longrunning/autogen" gax "github.com/googleapis/gax-go/v2" + "google.golang.org/api/iterator" "google.golang.org/api/option" "google.golang.org/api/option/internaloption" gtransport "google.golang.org/api/transport/grpc" @@ -34,6 +35,7 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/proto" ) var newCompletionClientHook clientHook @@ -42,6 +44,8 @@ var newCompletionClientHook clientHook type CompletionCallOptions struct { CompleteQuery []gax.CallOption ImportCompletionData []gax.CallOption + GetOperation []gax.CallOption + ListOperations []gax.CallOption } func defaultCompletionGRPCClientOptions() []option.ClientOption { @@ -82,6 +86,19 @@ func defaultCompletionCallOptions() *CompletionCallOptions { }) }), }, + GetOperation: []gax.CallOption{}, + ListOperations: []gax.CallOption{ + gax.WithRetry(func() gax.Retryer { + return gax.OnCodes([]codes.Code{ + codes.Unavailable, + codes.DeadlineExceeded, + }, gax.Backoff{ + Initial: 100 * time.Millisecond, + Max: 300000 * time.Millisecond, + Multiplier: 1.30, + }) + }), + }, } } @@ -93,6 +110,8 @@ type internalCompletionClient interface { CompleteQuery(context.Context, *retailpb.CompleteQueryRequest, ...gax.CallOption) (*retailpb.CompleteQueryResponse, error) ImportCompletionData(context.Context, *retailpb.ImportCompletionDataRequest, ...gax.CallOption) (*ImportCompletionDataOperation, error) ImportCompletionDataOperation(name string) *ImportCompletionDataOperation + GetOperation(context.Context, *longrunningpb.GetOperationRequest, ...gax.CallOption) (*longrunningpb.Operation, error) + ListOperations(context.Context, *longrunningpb.ListOperationsRequest, ...gax.CallOption) *OperationIterator } // CompletionClient is a client for interacting with Retail API. @@ -164,6 +183,16 @@ func (c *CompletionClient) ImportCompletionDataOperation(name string) *ImportCom return c.internalClient.ImportCompletionDataOperation(name) } +// GetOperation is a utility method from google.longrunning.Operations. +func (c *CompletionClient) GetOperation(ctx context.Context, req *longrunningpb.GetOperationRequest, opts ...gax.CallOption) (*longrunningpb.Operation, error) { + return c.internalClient.GetOperation(ctx, req, opts...) +} + +// ListOperations is a utility method from google.longrunning.Operations. +func (c *CompletionClient) ListOperations(ctx context.Context, req *longrunningpb.ListOperationsRequest, opts ...gax.CallOption) *OperationIterator { + return c.internalClient.ListOperations(ctx, req, opts...) +} + // completionGRPCClient is a client for interacting with Retail API over gRPC transport. // // Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls. @@ -185,6 +214,8 @@ type completionGRPCClient struct { // Users should not Close this client. LROClient **lroauto.OperationsClient + operationsClient longrunningpb.OperationsClient + // The x-goog-* metadata to be sent with each request. xGoogMetadata metadata.MD } @@ -222,6 +253,7 @@ func NewCompletionClient(ctx context.Context, opts ...option.ClientOption) (*Com disableDeadlines: disableDeadlines, completionClient: retailpb.NewCompletionServiceClient(connPool), CallOptions: &client.CallOptions, + operationsClient: longrunningpb.NewOperationsClient(connPool), } c.setGoogleClientInfo() @@ -309,6 +341,68 @@ func (c *completionGRPCClient) ImportCompletionData(ctx context.Context, req *re }, nil } +func (c *completionGRPCClient) GetOperation(ctx context.Context, req *longrunningpb.GetOperationRequest, opts ...gax.CallOption) (*longrunningpb.Operation, error) { + md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))) + + ctx = insertMetadata(ctx, c.xGoogMetadata, md) + opts = append((*c.CallOptions).GetOperation[0:len((*c.CallOptions).GetOperation):len((*c.CallOptions).GetOperation)], opts...) + var resp *longrunningpb.Operation + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + resp, err = c.operationsClient.GetOperation(ctx, req, settings.GRPC...) + return err + }, opts...) + if err != nil { + return nil, err + } + return resp, nil +} + +func (c *completionGRPCClient) ListOperations(ctx context.Context, req *longrunningpb.ListOperationsRequest, opts ...gax.CallOption) *OperationIterator { + md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))) + + ctx = insertMetadata(ctx, c.xGoogMetadata, md) + opts = append((*c.CallOptions).ListOperations[0:len((*c.CallOptions).ListOperations):len((*c.CallOptions).ListOperations)], opts...) + it := &OperationIterator{} + req = proto.Clone(req).(*longrunningpb.ListOperationsRequest) + it.InternalFetch = func(pageSize int, pageToken string) ([]*longrunningpb.Operation, string, error) { + resp := &longrunningpb.ListOperationsResponse{} + if pageToken != "" { + req.PageToken = pageToken + } + if pageSize > math.MaxInt32 { + req.PageSize = math.MaxInt32 + } else if pageSize != 0 { + req.PageSize = int32(pageSize) + } + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + resp, err = c.operationsClient.ListOperations(ctx, req, settings.GRPC...) + return err + }, opts...) + if err != nil { + return nil, "", err + } + + it.Response = resp + return resp.GetOperations(), resp.GetNextPageToken(), nil + } + fetch := func(pageSize int, pageToken string) (string, error) { + items, nextPageToken, err := it.InternalFetch(pageSize, pageToken) + if err != nil { + return "", err + } + it.items = append(it.items, items...) + return nextPageToken, nil + } + + it.pageInfo, it.nextFunc = iterator.NewPageInfo(fetch, it.bufLen, it.takeBuf) + it.pageInfo.MaxSize = int(req.GetPageSize()) + it.pageInfo.Token = req.GetPageToken() + + return it +} + // ImportCompletionDataOperation manages a long-running operation from ImportCompletionData. type ImportCompletionDataOperation struct { lro *longrunning.Operation diff --git a/retail/apiv2beta/completion_client_example_test.go b/retail/apiv2beta/completion_client_example_test.go index c69fca095ef5..0a8c11e2c502 100644 --- a/retail/apiv2beta/completion_client_example_test.go +++ b/retail/apiv2beta/completion_client_example_test.go @@ -20,7 +20,9 @@ import ( "context" retail "cloud.google.com/go/retail/apiv2beta" + "google.golang.org/api/iterator" retailpb "google.golang.org/genproto/googleapis/cloud/retail/v2beta" + longrunningpb "google.golang.org/genproto/googleapis/longrunning" ) func ExampleNewCompletionClient() { @@ -79,3 +81,49 @@ func ExampleCompletionClient_ImportCompletionData() { // TODO: Use resp. _ = resp } + +func ExampleCompletionClient_GetOperation() { + ctx := context.Background() + c, err := retail.NewCompletionClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &longrunningpb.GetOperationRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/longrunning#GetOperationRequest. + } + resp, err := c.GetOperation(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleCompletionClient_ListOperations() { + ctx := context.Background() + c, err := retail.NewCompletionClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &longrunningpb.ListOperationsRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/longrunning#ListOperationsRequest. + } + it := c.ListOperations(ctx, req) + for { + resp, err := it.Next() + if err == iterator.Done { + break + } + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp + } +} diff --git a/retail/apiv2beta/control_client.go b/retail/apiv2beta/control_client.go index 30ed24040406..e4c761f97016 100644 --- a/retail/apiv2beta/control_client.go +++ b/retail/apiv2beta/control_client.go @@ -21,6 +21,7 @@ import ( "fmt" "math" "net/url" + "time" gax "github.com/googleapis/gax-go/v2" "google.golang.org/api/iterator" @@ -28,7 +29,9 @@ import ( "google.golang.org/api/option/internaloption" gtransport "google.golang.org/api/transport/grpc" retailpb "google.golang.org/genproto/googleapis/cloud/retail/v2beta" + longrunningpb "google.golang.org/genproto/googleapis/longrunning" "google.golang.org/grpc" + "google.golang.org/grpc/codes" "google.golang.org/grpc/metadata" "google.golang.org/protobuf/proto" ) @@ -37,11 +40,13 @@ var newControlClientHook clientHook // ControlCallOptions contains the retry settings for each method of ControlClient. type ControlCallOptions struct { - CreateControl []gax.CallOption - DeleteControl []gax.CallOption - UpdateControl []gax.CallOption - GetControl []gax.CallOption - ListControls []gax.CallOption + CreateControl []gax.CallOption + DeleteControl []gax.CallOption + UpdateControl []gax.CallOption + GetControl []gax.CallOption + ListControls []gax.CallOption + GetOperation []gax.CallOption + ListOperations []gax.CallOption } func defaultControlGRPCClientOptions() []option.ClientOption { @@ -63,6 +68,19 @@ func defaultControlCallOptions() *ControlCallOptions { UpdateControl: []gax.CallOption{}, GetControl: []gax.CallOption{}, ListControls: []gax.CallOption{}, + GetOperation: []gax.CallOption{}, + ListOperations: []gax.CallOption{ + gax.WithRetry(func() gax.Retryer { + return gax.OnCodes([]codes.Code{ + codes.Unavailable, + codes.DeadlineExceeded, + }, gax.Backoff{ + Initial: 100 * time.Millisecond, + Max: 300000 * time.Millisecond, + Multiplier: 1.30, + }) + }), + }, } } @@ -76,6 +94,8 @@ type internalControlClient interface { UpdateControl(context.Context, *retailpb.UpdateControlRequest, ...gax.CallOption) (*retailpb.Control, error) GetControl(context.Context, *retailpb.GetControlRequest, ...gax.CallOption) (*retailpb.Control, error) ListControls(context.Context, *retailpb.ListControlsRequest, ...gax.CallOption) *ControlIterator + GetOperation(context.Context, *longrunningpb.GetOperationRequest, ...gax.CallOption) (*longrunningpb.Operation, error) + ListOperations(context.Context, *longrunningpb.ListOperationsRequest, ...gax.CallOption) *OperationIterator } // ControlClient is a client for interacting with Retail API. @@ -148,6 +168,16 @@ func (c *ControlClient) ListControls(ctx context.Context, req *retailpb.ListCont return c.internalClient.ListControls(ctx, req, opts...) } +// GetOperation is a utility method from google.longrunning.Operations. +func (c *ControlClient) GetOperation(ctx context.Context, req *longrunningpb.GetOperationRequest, opts ...gax.CallOption) (*longrunningpb.Operation, error) { + return c.internalClient.GetOperation(ctx, req, opts...) +} + +// ListOperations is a utility method from google.longrunning.Operations. +func (c *ControlClient) ListOperations(ctx context.Context, req *longrunningpb.ListOperationsRequest, opts ...gax.CallOption) *OperationIterator { + return c.internalClient.ListOperations(ctx, req, opts...) +} + // controlGRPCClient is a client for interacting with Retail API over gRPC transport. // // Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls. @@ -164,6 +194,8 @@ type controlGRPCClient struct { // The gRPC API client. controlClient retailpb.ControlServiceClient + operationsClient longrunningpb.OperationsClient + // The x-goog-* metadata to be sent with each request. xGoogMetadata metadata.MD } @@ -198,6 +230,7 @@ func NewControlClient(ctx context.Context, opts ...option.ClientOption) (*Contro disableDeadlines: disableDeadlines, controlClient: retailpb.NewControlServiceClient(connPool), CallOptions: &client.CallOptions, + operationsClient: longrunningpb.NewOperationsClient(connPool), } c.setGoogleClientInfo() @@ -337,6 +370,68 @@ func (c *controlGRPCClient) ListControls(ctx context.Context, req *retailpb.List return it } +func (c *controlGRPCClient) GetOperation(ctx context.Context, req *longrunningpb.GetOperationRequest, opts ...gax.CallOption) (*longrunningpb.Operation, error) { + md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))) + + ctx = insertMetadata(ctx, c.xGoogMetadata, md) + opts = append((*c.CallOptions).GetOperation[0:len((*c.CallOptions).GetOperation):len((*c.CallOptions).GetOperation)], opts...) + var resp *longrunningpb.Operation + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + resp, err = c.operationsClient.GetOperation(ctx, req, settings.GRPC...) + return err + }, opts...) + if err != nil { + return nil, err + } + return resp, nil +} + +func (c *controlGRPCClient) ListOperations(ctx context.Context, req *longrunningpb.ListOperationsRequest, opts ...gax.CallOption) *OperationIterator { + md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))) + + ctx = insertMetadata(ctx, c.xGoogMetadata, md) + opts = append((*c.CallOptions).ListOperations[0:len((*c.CallOptions).ListOperations):len((*c.CallOptions).ListOperations)], opts...) + it := &OperationIterator{} + req = proto.Clone(req).(*longrunningpb.ListOperationsRequest) + it.InternalFetch = func(pageSize int, pageToken string) ([]*longrunningpb.Operation, string, error) { + resp := &longrunningpb.ListOperationsResponse{} + if pageToken != "" { + req.PageToken = pageToken + } + if pageSize > math.MaxInt32 { + req.PageSize = math.MaxInt32 + } else if pageSize != 0 { + req.PageSize = int32(pageSize) + } + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + resp, err = c.operationsClient.ListOperations(ctx, req, settings.GRPC...) + return err + }, opts...) + if err != nil { + return nil, "", err + } + + it.Response = resp + return resp.GetOperations(), resp.GetNextPageToken(), nil + } + fetch := func(pageSize int, pageToken string) (string, error) { + items, nextPageToken, err := it.InternalFetch(pageSize, pageToken) + if err != nil { + return "", err + } + it.items = append(it.items, items...) + return nextPageToken, nil + } + + it.pageInfo, it.nextFunc = iterator.NewPageInfo(fetch, it.bufLen, it.takeBuf) + it.pageInfo.MaxSize = int(req.GetPageSize()) + it.pageInfo.Token = req.GetPageToken() + + return it +} + // ControlIterator manages a stream of *retailpb.Control. type ControlIterator struct { items []*retailpb.Control diff --git a/retail/apiv2beta/control_client_example_test.go b/retail/apiv2beta/control_client_example_test.go index b4011dc82679..2a650134fc68 100644 --- a/retail/apiv2beta/control_client_example_test.go +++ b/retail/apiv2beta/control_client_example_test.go @@ -22,6 +22,7 @@ import ( retail "cloud.google.com/go/retail/apiv2beta" "google.golang.org/api/iterator" retailpb "google.golang.org/genproto/googleapis/cloud/retail/v2beta" + longrunningpb "google.golang.org/genproto/googleapis/longrunning" ) func ExampleNewControlClient() { @@ -139,3 +140,49 @@ func ExampleControlClient_ListControls() { _ = resp } } + +func ExampleControlClient_GetOperation() { + ctx := context.Background() + c, err := retail.NewControlClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &longrunningpb.GetOperationRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/longrunning#GetOperationRequest. + } + resp, err := c.GetOperation(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleControlClient_ListOperations() { + ctx := context.Background() + c, err := retail.NewControlClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &longrunningpb.ListOperationsRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/longrunning#ListOperationsRequest. + } + it := c.ListOperations(ctx, req) + for { + resp, err := it.Next() + if err == iterator.Done { + break + } + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp + } +} diff --git a/retail/apiv2beta/gapic_metadata.json b/retail/apiv2beta/gapic_metadata.json index 14d717a59b26..777c7c4bef72 100644 --- a/retail/apiv2beta/gapic_metadata.json +++ b/retail/apiv2beta/gapic_metadata.json @@ -30,11 +30,21 @@ "GetDefaultBranch" ] }, + "GetOperation": { + "methods": [ + "GetOperation" + ] + }, "ListCatalogs": { "methods": [ "ListCatalogs" ] }, + "ListOperations": { + "methods": [ + "ListOperations" + ] + }, "RemoveCatalogAttribute": { "methods": [ "RemoveCatalogAttribute" @@ -79,10 +89,20 @@ "CompleteQuery" ] }, + "GetOperation": { + "methods": [ + "GetOperation" + ] + }, "ImportCompletionData": { "methods": [ "ImportCompletionData" ] + }, + "ListOperations": { + "methods": [ + "ListOperations" + ] } } } @@ -108,11 +128,21 @@ "GetControl" ] }, + "GetOperation": { + "methods": [ + "GetOperation" + ] + }, "ListControls": { "methods": [ "ListControls" ] }, + "ListOperations": { + "methods": [ + "ListOperations" + ] + }, "UpdateControl": { "methods": [ "UpdateControl" @@ -127,6 +157,16 @@ "grpc": { "libraryClient": "PredictionClient", "rpcs": { + "GetOperation": { + "methods": [ + "GetOperation" + ] + }, + "ListOperations": { + "methods": [ + "ListOperations" + ] + }, "Predict": { "methods": [ "Predict" @@ -161,6 +201,11 @@ "DeleteProduct" ] }, + "GetOperation": { + "methods": [ + "GetOperation" + ] + }, "GetProduct": { "methods": [ "GetProduct" @@ -171,6 +216,11 @@ "ImportProducts" ] }, + "ListOperations": { + "methods": [ + "ListOperations" + ] + }, "ListProducts": { "methods": [ "ListProducts" @@ -205,6 +255,16 @@ "grpc": { "libraryClient": "SearchClient", "rpcs": { + "GetOperation": { + "methods": [ + "GetOperation" + ] + }, + "ListOperations": { + "methods": [ + "ListOperations" + ] + }, "Search": { "methods": [ "Search" @@ -234,11 +294,21 @@ "DeleteServingConfig" ] }, + "GetOperation": { + "methods": [ + "GetOperation" + ] + }, "GetServingConfig": { "methods": [ "GetServingConfig" ] }, + "ListOperations": { + "methods": [ + "ListOperations" + ] + }, "ListServingConfigs": { "methods": [ "ListServingConfigs" @@ -268,11 +338,21 @@ "CollectUserEvent" ] }, + "GetOperation": { + "methods": [ + "GetOperation" + ] + }, "ImportUserEvents": { "methods": [ "ImportUserEvents" ] }, + "ListOperations": { + "methods": [ + "ListOperations" + ] + }, "PurgeUserEvents": { "methods": [ "PurgeUserEvents" diff --git a/retail/apiv2beta/prediction_client.go b/retail/apiv2beta/prediction_client.go index 680c546d7aba..d45e734298e5 100644 --- a/retail/apiv2beta/prediction_client.go +++ b/retail/apiv2beta/prediction_client.go @@ -24,20 +24,25 @@ import ( "time" gax "github.com/googleapis/gax-go/v2" + "google.golang.org/api/iterator" "google.golang.org/api/option" "google.golang.org/api/option/internaloption" gtransport "google.golang.org/api/transport/grpc" retailpb "google.golang.org/genproto/googleapis/cloud/retail/v2beta" + longrunningpb "google.golang.org/genproto/googleapis/longrunning" "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/proto" ) var newPredictionClientHook clientHook // PredictionCallOptions contains the retry settings for each method of PredictionClient. type PredictionCallOptions struct { - Predict []gax.CallOption + Predict []gax.CallOption + GetOperation []gax.CallOption + ListOperations []gax.CallOption } func defaultPredictionGRPCClientOptions() []option.ClientOption { @@ -66,6 +71,19 @@ func defaultPredictionCallOptions() *PredictionCallOptions { }) }), }, + GetOperation: []gax.CallOption{}, + ListOperations: []gax.CallOption{ + gax.WithRetry(func() gax.Retryer { + return gax.OnCodes([]codes.Code{ + codes.Unavailable, + codes.DeadlineExceeded, + }, gax.Backoff{ + Initial: 100 * time.Millisecond, + Max: 300000 * time.Millisecond, + Multiplier: 1.30, + }) + }), + }, } } @@ -75,6 +93,8 @@ type internalPredictionClient interface { setGoogleClientInfo(...string) Connection() *grpc.ClientConn Predict(context.Context, *retailpb.PredictRequest, ...gax.CallOption) (*retailpb.PredictResponse, error) + GetOperation(context.Context, *longrunningpb.GetOperationRequest, ...gax.CallOption) (*longrunningpb.Operation, error) + ListOperations(context.Context, *longrunningpb.ListOperationsRequest, ...gax.CallOption) *OperationIterator } // PredictionClient is a client for interacting with Retail API. @@ -116,6 +136,16 @@ func (c *PredictionClient) Predict(ctx context.Context, req *retailpb.PredictReq return c.internalClient.Predict(ctx, req, opts...) } +// GetOperation is a utility method from google.longrunning.Operations. +func (c *PredictionClient) GetOperation(ctx context.Context, req *longrunningpb.GetOperationRequest, opts ...gax.CallOption) (*longrunningpb.Operation, error) { + return c.internalClient.GetOperation(ctx, req, opts...) +} + +// ListOperations is a utility method from google.longrunning.Operations. +func (c *PredictionClient) ListOperations(ctx context.Context, req *longrunningpb.ListOperationsRequest, opts ...gax.CallOption) *OperationIterator { + return c.internalClient.ListOperations(ctx, req, opts...) +} + // predictionGRPCClient is a client for interacting with Retail API over gRPC transport. // // Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls. @@ -132,6 +162,8 @@ type predictionGRPCClient struct { // The gRPC API client. predictionClient retailpb.PredictionServiceClient + operationsClient longrunningpb.OperationsClient + // The x-goog-* metadata to be sent with each request. xGoogMetadata metadata.MD } @@ -166,6 +198,7 @@ func NewPredictionClient(ctx context.Context, opts ...option.ClientOption) (*Pre disableDeadlines: disableDeadlines, predictionClient: retailpb.NewPredictionServiceClient(connPool), CallOptions: &client.CallOptions, + operationsClient: longrunningpb.NewOperationsClient(connPool), } c.setGoogleClientInfo() @@ -217,3 +250,65 @@ func (c *predictionGRPCClient) Predict(ctx context.Context, req *retailpb.Predic } return resp, nil } + +func (c *predictionGRPCClient) GetOperation(ctx context.Context, req *longrunningpb.GetOperationRequest, opts ...gax.CallOption) (*longrunningpb.Operation, error) { + md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))) + + ctx = insertMetadata(ctx, c.xGoogMetadata, md) + opts = append((*c.CallOptions).GetOperation[0:len((*c.CallOptions).GetOperation):len((*c.CallOptions).GetOperation)], opts...) + var resp *longrunningpb.Operation + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + resp, err = c.operationsClient.GetOperation(ctx, req, settings.GRPC...) + return err + }, opts...) + if err != nil { + return nil, err + } + return resp, nil +} + +func (c *predictionGRPCClient) ListOperations(ctx context.Context, req *longrunningpb.ListOperationsRequest, opts ...gax.CallOption) *OperationIterator { + md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))) + + ctx = insertMetadata(ctx, c.xGoogMetadata, md) + opts = append((*c.CallOptions).ListOperations[0:len((*c.CallOptions).ListOperations):len((*c.CallOptions).ListOperations)], opts...) + it := &OperationIterator{} + req = proto.Clone(req).(*longrunningpb.ListOperationsRequest) + it.InternalFetch = func(pageSize int, pageToken string) ([]*longrunningpb.Operation, string, error) { + resp := &longrunningpb.ListOperationsResponse{} + if pageToken != "" { + req.PageToken = pageToken + } + if pageSize > math.MaxInt32 { + req.PageSize = math.MaxInt32 + } else if pageSize != 0 { + req.PageSize = int32(pageSize) + } + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + resp, err = c.operationsClient.ListOperations(ctx, req, settings.GRPC...) + return err + }, opts...) + if err != nil { + return nil, "", err + } + + it.Response = resp + return resp.GetOperations(), resp.GetNextPageToken(), nil + } + fetch := func(pageSize int, pageToken string) (string, error) { + items, nextPageToken, err := it.InternalFetch(pageSize, pageToken) + if err != nil { + return "", err + } + it.items = append(it.items, items...) + return nextPageToken, nil + } + + it.pageInfo, it.nextFunc = iterator.NewPageInfo(fetch, it.bufLen, it.takeBuf) + it.pageInfo.MaxSize = int(req.GetPageSize()) + it.pageInfo.Token = req.GetPageToken() + + return it +} diff --git a/retail/apiv2beta/prediction_client_example_test.go b/retail/apiv2beta/prediction_client_example_test.go index 7bb9ddd3d56c..da387a1b9704 100644 --- a/retail/apiv2beta/prediction_client_example_test.go +++ b/retail/apiv2beta/prediction_client_example_test.go @@ -20,7 +20,9 @@ import ( "context" retail "cloud.google.com/go/retail/apiv2beta" + "google.golang.org/api/iterator" retailpb "google.golang.org/genproto/googleapis/cloud/retail/v2beta" + longrunningpb "google.golang.org/genproto/googleapis/longrunning" ) func ExampleNewPredictionClient() { @@ -54,3 +56,49 @@ func ExamplePredictionClient_Predict() { // TODO: Use resp. _ = resp } + +func ExamplePredictionClient_GetOperation() { + ctx := context.Background() + c, err := retail.NewPredictionClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &longrunningpb.GetOperationRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/longrunning#GetOperationRequest. + } + resp, err := c.GetOperation(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExamplePredictionClient_ListOperations() { + ctx := context.Background() + c, err := retail.NewPredictionClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &longrunningpb.ListOperationsRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/longrunning#ListOperationsRequest. + } + it := c.ListOperations(ctx, req) + for { + resp, err := it.Next() + if err == iterator.Done { + break + } + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp + } +} diff --git a/retail/apiv2beta/product_client.go b/retail/apiv2beta/product_client.go index 95319cb3f95f..9a9329719d8e 100644 --- a/retail/apiv2beta/product_client.go +++ b/retail/apiv2beta/product_client.go @@ -53,6 +53,8 @@ type ProductCallOptions struct { RemoveFulfillmentPlaces []gax.CallOption AddLocalInventories []gax.CallOption RemoveLocalInventories []gax.CallOption + GetOperation []gax.CallOption + ListOperations []gax.CallOption } func defaultProductGRPCClientOptions() []option.ClientOption { @@ -201,6 +203,19 @@ func defaultProductCallOptions() *ProductCallOptions { }) }), }, + GetOperation: []gax.CallOption{}, + ListOperations: []gax.CallOption{ + gax.WithRetry(func() gax.Retryer { + return gax.OnCodes([]codes.Code{ + codes.Unavailable, + codes.DeadlineExceeded, + }, gax.Backoff{ + Initial: 100 * time.Millisecond, + Max: 300000 * time.Millisecond, + Multiplier: 1.30, + }) + }), + }, } } @@ -226,6 +241,8 @@ type internalProductClient interface { AddLocalInventoriesOperation(name string) *AddLocalInventoriesOperation RemoveLocalInventories(context.Context, *retailpb.RemoveLocalInventoriesRequest, ...gax.CallOption) (*RemoveLocalInventoriesOperation, error) RemoveLocalInventoriesOperation(name string) *RemoveLocalInventoriesOperation + GetOperation(context.Context, *longrunningpb.GetOperationRequest, ...gax.CallOption) (*longrunningpb.Operation, error) + ListOperations(context.Context, *longrunningpb.ListOperationsRequest, ...gax.CallOption) *OperationIterator } // ProductClient is a client for interacting with Retail API. @@ -295,7 +312,7 @@ func (c *ProductClient) DeleteProduct(ctx context.Context, req *retailpb.DeleteP // ImportProducts bulk import of multiple Products. // -// Request processing may be synchronous. No partial updating is supported. +// Request processing may be synchronous. // Non-existing items are created. // // Note that it is possible for a subset of the @@ -320,19 +337,21 @@ func (c *ProductClient) ImportProductsOperation(name string) *ImportProductsOper // enqueued and processed downstream. As a consequence, when a response is // returned, updates are not immediately manifested in the // Product queried by -// GetProduct or -// ListProducts. +// ProductService.GetProduct +// or +// ProductService.ListProducts. // // When inventory is updated with -// CreateProduct +// ProductService.CreateProduct // and -// UpdateProduct, +// ProductService.UpdateProduct, // the specified inventory field value(s) will overwrite any existing value(s) // while ignoring the last update time for this field. Furthermore, the last // update time for the specified inventory fields will be overwritten to the // time of the -// CreateProduct or -// UpdateProduct +// ProductService.CreateProduct +// or +// ProductService.UpdateProduct // request. // // If no inventory fields are set in @@ -344,10 +363,10 @@ func (c *ProductClient) ImportProductsOperation(name string) *ImportProductsOper // then any existing inventory information will be preserved. // // Pre-existing inventory information can only be updated with -// SetInventory, -// AddFulfillmentPlaces, +// ProductService.SetInventory, +// ProductService.AddFulfillmentPlaces, // and -// RemoveFulfillmentPlaces. +// ProductService.RemoveFulfillmentPlaces. // // This feature is only available for users who have Retail Search enabled. // Please enable Retail Search on Cloud Console before using this feature. @@ -370,8 +389,9 @@ func (c *ProductClient) SetInventoryOperation(name string) *SetInventoryOperatio // enqueued and processed downstream. As a consequence, when a response is // returned, the added place IDs are not immediately manifested in the // Product queried by -// GetProduct or -// ListProducts. +// ProductService.GetProduct +// or +// ProductService.ListProducts. // // This feature is only available for users who have Retail Search enabled. // Please enable Retail Search on Cloud Console before using this feature. @@ -394,8 +414,9 @@ func (c *ProductClient) AddFulfillmentPlacesOperation(name string) *AddFulfillme // enqueued and processed downstream. As a consequence, when a response is // returned, the removed place IDs are not immediately manifested in the // Product queried by -// GetProduct or -// ListProducts. +// ProductService.GetProduct +// or +// ProductService.ListProducts. // // This feature is only available for users who have Retail Search enabled. // Please enable Retail Search on Cloud Console before using this feature. @@ -419,13 +440,14 @@ func (c *ProductClient) RemoveFulfillmentPlacesOperation(name string) *RemoveFul // and processed downstream. As a consequence, when a response is returned, // updates are not immediately manifested in the // Product queried by -// GetProduct or -// ListProducts. +// ProductService.GetProduct +// or +// ProductService.ListProducts. // // Local inventory information can only be modified using this method. -// CreateProduct +// ProductService.CreateProduct // and -// UpdateProduct +// ProductService.UpdateProduct // has no effect on local inventories. // // This feature is only available for users who have Retail Search enabled. @@ -448,13 +470,14 @@ func (c *ProductClient) AddLocalInventoriesOperation(name string) *AddLocalInven // enqueued and processed downstream. As a consequence, when a response is // returned, removals are not immediately manifested in the // Product queried by -// GetProduct or -// ListProducts. +// ProductService.GetProduct +// or +// ProductService.ListProducts. // // Local inventory information can only be removed using this method. -// CreateProduct +// ProductService.CreateProduct // and -// UpdateProduct +// ProductService.UpdateProduct // has no effect on local inventories. // // This feature is only available for users who have Retail Search enabled. @@ -469,6 +492,16 @@ func (c *ProductClient) RemoveLocalInventoriesOperation(name string) *RemoveLoca return c.internalClient.RemoveLocalInventoriesOperation(name) } +// GetOperation is a utility method from google.longrunning.Operations. +func (c *ProductClient) GetOperation(ctx context.Context, req *longrunningpb.GetOperationRequest, opts ...gax.CallOption) (*longrunningpb.Operation, error) { + return c.internalClient.GetOperation(ctx, req, opts...) +} + +// ListOperations is a utility method from google.longrunning.Operations. +func (c *ProductClient) ListOperations(ctx context.Context, req *longrunningpb.ListOperationsRequest, opts ...gax.CallOption) *OperationIterator { + return c.internalClient.ListOperations(ctx, req, opts...) +} + // productGRPCClient is a client for interacting with Retail API over gRPC transport. // // Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls. @@ -490,6 +523,8 @@ type productGRPCClient struct { // Users should not Close this client. LROClient **lroauto.OperationsClient + operationsClient longrunningpb.OperationsClient + // The x-goog-* metadata to be sent with each request. xGoogMetadata metadata.MD } @@ -525,6 +560,7 @@ func NewProductClient(ctx context.Context, opts ...option.ClientOption) (*Produc disableDeadlines: disableDeadlines, productClient: retailpb.NewProductServiceClient(connPool), CallOptions: &client.CallOptions, + operationsClient: longrunningpb.NewOperationsClient(connPool), } c.setGoogleClientInfo() @@ -839,6 +875,68 @@ func (c *productGRPCClient) RemoveLocalInventories(ctx context.Context, req *ret }, nil } +func (c *productGRPCClient) GetOperation(ctx context.Context, req *longrunningpb.GetOperationRequest, opts ...gax.CallOption) (*longrunningpb.Operation, error) { + md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))) + + ctx = insertMetadata(ctx, c.xGoogMetadata, md) + opts = append((*c.CallOptions).GetOperation[0:len((*c.CallOptions).GetOperation):len((*c.CallOptions).GetOperation)], opts...) + var resp *longrunningpb.Operation + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + resp, err = c.operationsClient.GetOperation(ctx, req, settings.GRPC...) + return err + }, opts...) + if err != nil { + return nil, err + } + return resp, nil +} + +func (c *productGRPCClient) ListOperations(ctx context.Context, req *longrunningpb.ListOperationsRequest, opts ...gax.CallOption) *OperationIterator { + md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))) + + ctx = insertMetadata(ctx, c.xGoogMetadata, md) + opts = append((*c.CallOptions).ListOperations[0:len((*c.CallOptions).ListOperations):len((*c.CallOptions).ListOperations)], opts...) + it := &OperationIterator{} + req = proto.Clone(req).(*longrunningpb.ListOperationsRequest) + it.InternalFetch = func(pageSize int, pageToken string) ([]*longrunningpb.Operation, string, error) { + resp := &longrunningpb.ListOperationsResponse{} + if pageToken != "" { + req.PageToken = pageToken + } + if pageSize > math.MaxInt32 { + req.PageSize = math.MaxInt32 + } else if pageSize != 0 { + req.PageSize = int32(pageSize) + } + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + resp, err = c.operationsClient.ListOperations(ctx, req, settings.GRPC...) + return err + }, opts...) + if err != nil { + return nil, "", err + } + + it.Response = resp + return resp.GetOperations(), resp.GetNextPageToken(), nil + } + fetch := func(pageSize int, pageToken string) (string, error) { + items, nextPageToken, err := it.InternalFetch(pageSize, pageToken) + if err != nil { + return "", err + } + it.items = append(it.items, items...) + return nextPageToken, nil + } + + it.pageInfo, it.nextFunc = iterator.NewPageInfo(fetch, it.bufLen, it.takeBuf) + it.pageInfo.MaxSize = int(req.GetPageSize()) + it.pageInfo.Token = req.GetPageToken() + + return it +} + // AddFulfillmentPlacesOperation manages a long-running operation from AddFulfillmentPlaces. type AddFulfillmentPlacesOperation struct { lro *longrunning.Operation diff --git a/retail/apiv2beta/product_client_example_test.go b/retail/apiv2beta/product_client_example_test.go index 88f151a8dedd..bf5474562da2 100644 --- a/retail/apiv2beta/product_client_example_test.go +++ b/retail/apiv2beta/product_client_example_test.go @@ -22,6 +22,7 @@ import ( retail "cloud.google.com/go/retail/apiv2beta" "google.golang.org/api/iterator" retailpb "google.golang.org/genproto/googleapis/cloud/retail/v2beta" + longrunningpb "google.golang.org/genproto/googleapis/longrunning" ) func ExampleNewProductClient() { @@ -289,3 +290,49 @@ func ExampleProductClient_RemoveLocalInventories() { // TODO: Use resp. _ = resp } + +func ExampleProductClient_GetOperation() { + ctx := context.Background() + c, err := retail.NewProductClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &longrunningpb.GetOperationRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/longrunning#GetOperationRequest. + } + resp, err := c.GetOperation(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleProductClient_ListOperations() { + ctx := context.Background() + c, err := retail.NewProductClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &longrunningpb.ListOperationsRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/longrunning#ListOperationsRequest. + } + it := c.ListOperations(ctx, req) + for { + resp, err := it.Next() + if err == iterator.Done { + break + } + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp + } +} diff --git a/retail/apiv2beta/search_client.go b/retail/apiv2beta/search_client.go index 6135d43198d2..6bb03a7540eb 100644 --- a/retail/apiv2beta/search_client.go +++ b/retail/apiv2beta/search_client.go @@ -29,6 +29,7 @@ import ( "google.golang.org/api/option/internaloption" gtransport "google.golang.org/api/transport/grpc" retailpb "google.golang.org/genproto/googleapis/cloud/retail/v2beta" + longrunningpb "google.golang.org/genproto/googleapis/longrunning" "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/metadata" @@ -39,7 +40,9 @@ var newSearchClientHook clientHook // SearchCallOptions contains the retry settings for each method of SearchClient. type SearchCallOptions struct { - Search []gax.CallOption + Search []gax.CallOption + GetOperation []gax.CallOption + ListOperations []gax.CallOption } func defaultSearchGRPCClientOptions() []option.ClientOption { @@ -68,6 +71,19 @@ func defaultSearchCallOptions() *SearchCallOptions { }) }), }, + GetOperation: []gax.CallOption{}, + ListOperations: []gax.CallOption{ + gax.WithRetry(func() gax.Retryer { + return gax.OnCodes([]codes.Code{ + codes.Unavailable, + codes.DeadlineExceeded, + }, gax.Backoff{ + Initial: 100 * time.Millisecond, + Max: 300000 * time.Millisecond, + Multiplier: 1.30, + }) + }), + }, } } @@ -77,6 +93,8 @@ type internalSearchClient interface { setGoogleClientInfo(...string) Connection() *grpc.ClientConn Search(context.Context, *retailpb.SearchRequest, ...gax.CallOption) *SearchResponse_SearchResultIterator + GetOperation(context.Context, *longrunningpb.GetOperationRequest, ...gax.CallOption) (*longrunningpb.Operation, error) + ListOperations(context.Context, *longrunningpb.ListOperationsRequest, ...gax.CallOption) *OperationIterator } // SearchClient is a client for interacting with Retail API. @@ -124,6 +142,16 @@ func (c *SearchClient) Search(ctx context.Context, req *retailpb.SearchRequest, return c.internalClient.Search(ctx, req, opts...) } +// GetOperation is a utility method from google.longrunning.Operations. +func (c *SearchClient) GetOperation(ctx context.Context, req *longrunningpb.GetOperationRequest, opts ...gax.CallOption) (*longrunningpb.Operation, error) { + return c.internalClient.GetOperation(ctx, req, opts...) +} + +// ListOperations is a utility method from google.longrunning.Operations. +func (c *SearchClient) ListOperations(ctx context.Context, req *longrunningpb.ListOperationsRequest, opts ...gax.CallOption) *OperationIterator { + return c.internalClient.ListOperations(ctx, req, opts...) +} + // searchGRPCClient is a client for interacting with Retail API over gRPC transport. // // Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls. @@ -140,6 +168,8 @@ type searchGRPCClient struct { // The gRPC API client. searchClient retailpb.SearchServiceClient + operationsClient longrunningpb.OperationsClient + // The x-goog-* metadata to be sent with each request. xGoogMetadata metadata.MD } @@ -177,6 +207,7 @@ func NewSearchClient(ctx context.Context, opts ...option.ClientOption) (*SearchC disableDeadlines: disableDeadlines, searchClient: retailpb.NewSearchServiceClient(connPool), CallOptions: &client.CallOptions, + operationsClient: longrunningpb.NewOperationsClient(connPool), } c.setGoogleClientInfo() @@ -252,6 +283,68 @@ func (c *searchGRPCClient) Search(ctx context.Context, req *retailpb.SearchReque return it } +func (c *searchGRPCClient) GetOperation(ctx context.Context, req *longrunningpb.GetOperationRequest, opts ...gax.CallOption) (*longrunningpb.Operation, error) { + md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))) + + ctx = insertMetadata(ctx, c.xGoogMetadata, md) + opts = append((*c.CallOptions).GetOperation[0:len((*c.CallOptions).GetOperation):len((*c.CallOptions).GetOperation)], opts...) + var resp *longrunningpb.Operation + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + resp, err = c.operationsClient.GetOperation(ctx, req, settings.GRPC...) + return err + }, opts...) + if err != nil { + return nil, err + } + return resp, nil +} + +func (c *searchGRPCClient) ListOperations(ctx context.Context, req *longrunningpb.ListOperationsRequest, opts ...gax.CallOption) *OperationIterator { + md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))) + + ctx = insertMetadata(ctx, c.xGoogMetadata, md) + opts = append((*c.CallOptions).ListOperations[0:len((*c.CallOptions).ListOperations):len((*c.CallOptions).ListOperations)], opts...) + it := &OperationIterator{} + req = proto.Clone(req).(*longrunningpb.ListOperationsRequest) + it.InternalFetch = func(pageSize int, pageToken string) ([]*longrunningpb.Operation, string, error) { + resp := &longrunningpb.ListOperationsResponse{} + if pageToken != "" { + req.PageToken = pageToken + } + if pageSize > math.MaxInt32 { + req.PageSize = math.MaxInt32 + } else if pageSize != 0 { + req.PageSize = int32(pageSize) + } + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + resp, err = c.operationsClient.ListOperations(ctx, req, settings.GRPC...) + return err + }, opts...) + if err != nil { + return nil, "", err + } + + it.Response = resp + return resp.GetOperations(), resp.GetNextPageToken(), nil + } + fetch := func(pageSize int, pageToken string) (string, error) { + items, nextPageToken, err := it.InternalFetch(pageSize, pageToken) + if err != nil { + return "", err + } + it.items = append(it.items, items...) + return nextPageToken, nil + } + + it.pageInfo, it.nextFunc = iterator.NewPageInfo(fetch, it.bufLen, it.takeBuf) + it.pageInfo.MaxSize = int(req.GetPageSize()) + it.pageInfo.Token = req.GetPageToken() + + return it +} + // SearchResponse_SearchResultIterator manages a stream of *retailpb.SearchResponse_SearchResult. type SearchResponse_SearchResultIterator struct { items []*retailpb.SearchResponse_SearchResult diff --git a/retail/apiv2beta/search_client_example_test.go b/retail/apiv2beta/search_client_example_test.go index bbdb3a31ab72..bda4917a35c2 100644 --- a/retail/apiv2beta/search_client_example_test.go +++ b/retail/apiv2beta/search_client_example_test.go @@ -22,6 +22,7 @@ import ( retail "cloud.google.com/go/retail/apiv2beta" "google.golang.org/api/iterator" retailpb "google.golang.org/genproto/googleapis/cloud/retail/v2beta" + longrunningpb "google.golang.org/genproto/googleapis/longrunning" ) func ExampleNewSearchClient() { @@ -61,3 +62,49 @@ func ExampleSearchClient_Search() { _ = resp } } + +func ExampleSearchClient_GetOperation() { + ctx := context.Background() + c, err := retail.NewSearchClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &longrunningpb.GetOperationRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/longrunning#GetOperationRequest. + } + resp, err := c.GetOperation(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleSearchClient_ListOperations() { + ctx := context.Background() + c, err := retail.NewSearchClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &longrunningpb.ListOperationsRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/longrunning#ListOperationsRequest. + } + it := c.ListOperations(ctx, req) + for { + resp, err := it.Next() + if err == iterator.Done { + break + } + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp + } +} diff --git a/retail/apiv2beta/serving_config_client.go b/retail/apiv2beta/serving_config_client.go index e991b29d2fd2..c3f9e0f64e96 100644 --- a/retail/apiv2beta/serving_config_client.go +++ b/retail/apiv2beta/serving_config_client.go @@ -21,6 +21,7 @@ import ( "fmt" "math" "net/url" + "time" gax "github.com/googleapis/gax-go/v2" "google.golang.org/api/iterator" @@ -28,7 +29,9 @@ import ( "google.golang.org/api/option/internaloption" gtransport "google.golang.org/api/transport/grpc" retailpb "google.golang.org/genproto/googleapis/cloud/retail/v2beta" + longrunningpb "google.golang.org/genproto/googleapis/longrunning" "google.golang.org/grpc" + "google.golang.org/grpc/codes" "google.golang.org/grpc/metadata" "google.golang.org/protobuf/proto" ) @@ -44,6 +47,8 @@ type ServingConfigCallOptions struct { ListServingConfigs []gax.CallOption AddControl []gax.CallOption RemoveControl []gax.CallOption + GetOperation []gax.CallOption + ListOperations []gax.CallOption } func defaultServingConfigGRPCClientOptions() []option.ClientOption { @@ -67,6 +72,19 @@ func defaultServingConfigCallOptions() *ServingConfigCallOptions { ListServingConfigs: []gax.CallOption{}, AddControl: []gax.CallOption{}, RemoveControl: []gax.CallOption{}, + GetOperation: []gax.CallOption{}, + ListOperations: []gax.CallOption{ + gax.WithRetry(func() gax.Retryer { + return gax.OnCodes([]codes.Code{ + codes.Unavailable, + codes.DeadlineExceeded, + }, gax.Backoff{ + Initial: 100 * time.Millisecond, + Max: 300000 * time.Millisecond, + Multiplier: 1.30, + }) + }), + }, } } @@ -82,6 +100,8 @@ type internalServingConfigClient interface { ListServingConfigs(context.Context, *retailpb.ListServingConfigsRequest, ...gax.CallOption) *ServingConfigIterator AddControl(context.Context, *retailpb.AddControlRequest, ...gax.CallOption) (*retailpb.ServingConfig, error) RemoveControl(context.Context, *retailpb.RemoveControlRequest, ...gax.CallOption) (*retailpb.ServingConfig, error) + GetOperation(context.Context, *longrunningpb.GetOperationRequest, ...gax.CallOption) (*longrunningpb.Operation, error) + ListOperations(context.Context, *longrunningpb.ListOperationsRequest, ...gax.CallOption) *OperationIterator } // ServingConfigClient is a client for interacting with Retail API. @@ -170,6 +190,16 @@ func (c *ServingConfigClient) RemoveControl(ctx context.Context, req *retailpb.R return c.internalClient.RemoveControl(ctx, req, opts...) } +// GetOperation is a utility method from google.longrunning.Operations. +func (c *ServingConfigClient) GetOperation(ctx context.Context, req *longrunningpb.GetOperationRequest, opts ...gax.CallOption) (*longrunningpb.Operation, error) { + return c.internalClient.GetOperation(ctx, req, opts...) +} + +// ListOperations is a utility method from google.longrunning.Operations. +func (c *ServingConfigClient) ListOperations(ctx context.Context, req *longrunningpb.ListOperationsRequest, opts ...gax.CallOption) *OperationIterator { + return c.internalClient.ListOperations(ctx, req, opts...) +} + // servingConfigGRPCClient is a client for interacting with Retail API over gRPC transport. // // Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls. @@ -186,6 +216,8 @@ type servingConfigGRPCClient struct { // The gRPC API client. servingConfigClient retailpb.ServingConfigServiceClient + operationsClient longrunningpb.OperationsClient + // The x-goog-* metadata to be sent with each request. xGoogMetadata metadata.MD } @@ -220,6 +252,7 @@ func NewServingConfigClient(ctx context.Context, opts ...option.ClientOption) (* disableDeadlines: disableDeadlines, servingConfigClient: retailpb.NewServingConfigServiceClient(connPool), CallOptions: &client.CallOptions, + operationsClient: longrunningpb.NewOperationsClient(connPool), } c.setGoogleClientInfo() @@ -393,6 +426,68 @@ func (c *servingConfigGRPCClient) RemoveControl(ctx context.Context, req *retail return resp, nil } +func (c *servingConfigGRPCClient) GetOperation(ctx context.Context, req *longrunningpb.GetOperationRequest, opts ...gax.CallOption) (*longrunningpb.Operation, error) { + md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))) + + ctx = insertMetadata(ctx, c.xGoogMetadata, md) + opts = append((*c.CallOptions).GetOperation[0:len((*c.CallOptions).GetOperation):len((*c.CallOptions).GetOperation)], opts...) + var resp *longrunningpb.Operation + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + resp, err = c.operationsClient.GetOperation(ctx, req, settings.GRPC...) + return err + }, opts...) + if err != nil { + return nil, err + } + return resp, nil +} + +func (c *servingConfigGRPCClient) ListOperations(ctx context.Context, req *longrunningpb.ListOperationsRequest, opts ...gax.CallOption) *OperationIterator { + md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))) + + ctx = insertMetadata(ctx, c.xGoogMetadata, md) + opts = append((*c.CallOptions).ListOperations[0:len((*c.CallOptions).ListOperations):len((*c.CallOptions).ListOperations)], opts...) + it := &OperationIterator{} + req = proto.Clone(req).(*longrunningpb.ListOperationsRequest) + it.InternalFetch = func(pageSize int, pageToken string) ([]*longrunningpb.Operation, string, error) { + resp := &longrunningpb.ListOperationsResponse{} + if pageToken != "" { + req.PageToken = pageToken + } + if pageSize > math.MaxInt32 { + req.PageSize = math.MaxInt32 + } else if pageSize != 0 { + req.PageSize = int32(pageSize) + } + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + resp, err = c.operationsClient.ListOperations(ctx, req, settings.GRPC...) + return err + }, opts...) + if err != nil { + return nil, "", err + } + + it.Response = resp + return resp.GetOperations(), resp.GetNextPageToken(), nil + } + fetch := func(pageSize int, pageToken string) (string, error) { + items, nextPageToken, err := it.InternalFetch(pageSize, pageToken) + if err != nil { + return "", err + } + it.items = append(it.items, items...) + return nextPageToken, nil + } + + it.pageInfo, it.nextFunc = iterator.NewPageInfo(fetch, it.bufLen, it.takeBuf) + it.pageInfo.MaxSize = int(req.GetPageSize()) + it.pageInfo.Token = req.GetPageToken() + + return it +} + // ServingConfigIterator manages a stream of *retailpb.ServingConfig. type ServingConfigIterator struct { items []*retailpb.ServingConfig diff --git a/retail/apiv2beta/serving_config_client_example_test.go b/retail/apiv2beta/serving_config_client_example_test.go index 80f88f5feed5..c497093772eb 100644 --- a/retail/apiv2beta/serving_config_client_example_test.go +++ b/retail/apiv2beta/serving_config_client_example_test.go @@ -22,6 +22,7 @@ import ( retail "cloud.google.com/go/retail/apiv2beta" "google.golang.org/api/iterator" retailpb "google.golang.org/genproto/googleapis/cloud/retail/v2beta" + longrunningpb "google.golang.org/genproto/googleapis/longrunning" ) func ExampleNewServingConfigClient() { @@ -179,3 +180,49 @@ func ExampleServingConfigClient_RemoveControl() { // TODO: Use resp. _ = resp } + +func ExampleServingConfigClient_GetOperation() { + ctx := context.Background() + c, err := retail.NewServingConfigClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &longrunningpb.GetOperationRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/longrunning#GetOperationRequest. + } + resp, err := c.GetOperation(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleServingConfigClient_ListOperations() { + ctx := context.Background() + c, err := retail.NewServingConfigClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &longrunningpb.ListOperationsRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/longrunning#ListOperationsRequest. + } + it := c.ListOperations(ctx, req) + for { + resp, err := it.Next() + if err == iterator.Done { + break + } + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp + } +} diff --git a/retail/apiv2beta/user_event_client.go b/retail/apiv2beta/user_event_client.go index 4ffc4f65ea43..2ff8296abf5d 100644 --- a/retail/apiv2beta/user_event_client.go +++ b/retail/apiv2beta/user_event_client.go @@ -26,6 +26,7 @@ import ( "cloud.google.com/go/longrunning" lroauto "cloud.google.com/go/longrunning/autogen" gax "github.com/googleapis/gax-go/v2" + "google.golang.org/api/iterator" "google.golang.org/api/option" "google.golang.org/api/option/internaloption" gtransport "google.golang.org/api/transport/grpc" @@ -35,6 +36,7 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/proto" ) var newUserEventClientHook clientHook @@ -46,6 +48,8 @@ type UserEventCallOptions struct { PurgeUserEvents []gax.CallOption ImportUserEvents []gax.CallOption RejoinUserEvents []gax.CallOption + GetOperation []gax.CallOption + ListOperations []gax.CallOption } func defaultUserEventGRPCClientOptions() []option.ClientOption { @@ -122,6 +126,19 @@ func defaultUserEventCallOptions() *UserEventCallOptions { }) }), }, + GetOperation: []gax.CallOption{}, + ListOperations: []gax.CallOption{ + gax.WithRetry(func() gax.Retryer { + return gax.OnCodes([]codes.Code{ + codes.Unavailable, + codes.DeadlineExceeded, + }, gax.Backoff{ + Initial: 100 * time.Millisecond, + Max: 300000 * time.Millisecond, + Multiplier: 1.30, + }) + }), + }, } } @@ -138,6 +155,8 @@ type internalUserEventClient interface { ImportUserEventsOperation(name string) *ImportUserEventsOperation RejoinUserEvents(context.Context, *retailpb.RejoinUserEventsRequest, ...gax.CallOption) (*RejoinUserEventsOperation, error) RejoinUserEventsOperation(name string) *RejoinUserEventsOperation + GetOperation(context.Context, *longrunningpb.GetOperationRequest, ...gax.CallOption) (*longrunningpb.Operation, error) + ListOperations(context.Context, *longrunningpb.ListOperationsRequest, ...gax.CallOption) *OperationIterator } // UserEventClient is a client for interacting with Retail API. @@ -242,6 +261,16 @@ func (c *UserEventClient) RejoinUserEventsOperation(name string) *RejoinUserEven return c.internalClient.RejoinUserEventsOperation(name) } +// GetOperation is a utility method from google.longrunning.Operations. +func (c *UserEventClient) GetOperation(ctx context.Context, req *longrunningpb.GetOperationRequest, opts ...gax.CallOption) (*longrunningpb.Operation, error) { + return c.internalClient.GetOperation(ctx, req, opts...) +} + +// ListOperations is a utility method from google.longrunning.Operations. +func (c *UserEventClient) ListOperations(ctx context.Context, req *longrunningpb.ListOperationsRequest, opts ...gax.CallOption) *OperationIterator { + return c.internalClient.ListOperations(ctx, req, opts...) +} + // userEventGRPCClient is a client for interacting with Retail API over gRPC transport. // // Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls. @@ -263,6 +292,8 @@ type userEventGRPCClient struct { // Users should not Close this client. LROClient **lroauto.OperationsClient + operationsClient longrunningpb.OperationsClient + // The x-goog-* metadata to be sent with each request. xGoogMetadata metadata.MD } @@ -297,6 +328,7 @@ func NewUserEventClient(ctx context.Context, opts ...option.ClientOption) (*User disableDeadlines: disableDeadlines, userEventClient: retailpb.NewUserEventServiceClient(connPool), CallOptions: &client.CallOptions, + operationsClient: longrunningpb.NewOperationsClient(connPool), } c.setGoogleClientInfo() @@ -454,6 +486,68 @@ func (c *userEventGRPCClient) RejoinUserEvents(ctx context.Context, req *retailp }, nil } +func (c *userEventGRPCClient) GetOperation(ctx context.Context, req *longrunningpb.GetOperationRequest, opts ...gax.CallOption) (*longrunningpb.Operation, error) { + md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))) + + ctx = insertMetadata(ctx, c.xGoogMetadata, md) + opts = append((*c.CallOptions).GetOperation[0:len((*c.CallOptions).GetOperation):len((*c.CallOptions).GetOperation)], opts...) + var resp *longrunningpb.Operation + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + resp, err = c.operationsClient.GetOperation(ctx, req, settings.GRPC...) + return err + }, opts...) + if err != nil { + return nil, err + } + return resp, nil +} + +func (c *userEventGRPCClient) ListOperations(ctx context.Context, req *longrunningpb.ListOperationsRequest, opts ...gax.CallOption) *OperationIterator { + md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))) + + ctx = insertMetadata(ctx, c.xGoogMetadata, md) + opts = append((*c.CallOptions).ListOperations[0:len((*c.CallOptions).ListOperations):len((*c.CallOptions).ListOperations)], opts...) + it := &OperationIterator{} + req = proto.Clone(req).(*longrunningpb.ListOperationsRequest) + it.InternalFetch = func(pageSize int, pageToken string) ([]*longrunningpb.Operation, string, error) { + resp := &longrunningpb.ListOperationsResponse{} + if pageToken != "" { + req.PageToken = pageToken + } + if pageSize > math.MaxInt32 { + req.PageSize = math.MaxInt32 + } else if pageSize != 0 { + req.PageSize = int32(pageSize) + } + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + resp, err = c.operationsClient.ListOperations(ctx, req, settings.GRPC...) + return err + }, opts...) + if err != nil { + return nil, "", err + } + + it.Response = resp + return resp.GetOperations(), resp.GetNextPageToken(), nil + } + fetch := func(pageSize int, pageToken string) (string, error) { + items, nextPageToken, err := it.InternalFetch(pageSize, pageToken) + if err != nil { + return "", err + } + it.items = append(it.items, items...) + return nextPageToken, nil + } + + it.pageInfo, it.nextFunc = iterator.NewPageInfo(fetch, it.bufLen, it.takeBuf) + it.pageInfo.MaxSize = int(req.GetPageSize()) + it.pageInfo.Token = req.GetPageToken() + + return it +} + // ImportUserEventsOperation manages a long-running operation from ImportUserEvents. type ImportUserEventsOperation struct { lro *longrunning.Operation diff --git a/retail/apiv2beta/user_event_client_example_test.go b/retail/apiv2beta/user_event_client_example_test.go index aa6eed0c3107..9ff50954259f 100644 --- a/retail/apiv2beta/user_event_client_example_test.go +++ b/retail/apiv2beta/user_event_client_example_test.go @@ -20,7 +20,9 @@ import ( "context" retail "cloud.google.com/go/retail/apiv2beta" + "google.golang.org/api/iterator" retailpb "google.golang.org/genproto/googleapis/cloud/retail/v2beta" + longrunningpb "google.golang.org/genproto/googleapis/longrunning" ) func ExampleNewUserEventClient() { @@ -149,3 +151,49 @@ func ExampleUserEventClient_RejoinUserEvents() { // TODO: Use resp. _ = resp } + +func ExampleUserEventClient_GetOperation() { + ctx := context.Background() + c, err := retail.NewUserEventClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &longrunningpb.GetOperationRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/longrunning#GetOperationRequest. + } + resp, err := c.GetOperation(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleUserEventClient_ListOperations() { + ctx := context.Background() + c, err := retail.NewUserEventClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &longrunningpb.ListOperationsRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/longrunning#ListOperationsRequest. + } + it := c.ListOperations(ctx, req) + for { + resp, err := it.Next() + if err == iterator.Done { + break + } + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp + } +} diff --git a/retail/go.mod b/retail/go.mod index daded6ebaa2b..26801f86a623 100644 --- a/retail/go.mod +++ b/retail/go.mod @@ -5,8 +5,8 @@ go 1.17 require ( cloud.google.com/go v0.102.1 github.com/googleapis/gax-go/v2 v2.4.0 - google.golang.org/api v0.85.0 - google.golang.org/genproto v0.0.0-20220617124728-180714bec0ad + google.golang.org/api v0.90.0 + google.golang.org/genproto v0.0.0-20220801145646-83ce21fca29f google.golang.org/grpc v1.48.0 google.golang.org/protobuf v1.28.0 ) @@ -18,9 +18,9 @@ require ( github.com/google/go-cmp v0.5.8 // indirect github.com/googleapis/enterprise-certificate-proxy v0.1.0 // indirect go.opencensus.io v0.23.0 // indirect - golang.org/x/net v0.0.0-20220617184016-355a448f1bc9 // indirect - golang.org/x/oauth2 v0.0.0-20220608161450-d0670ef3b1eb // indirect - golang.org/x/sys v0.0.0-20220615213510-4f61da869c0c // indirect + golang.org/x/net v0.0.0-20220624214902-1bab6f366d9e // indirect + golang.org/x/oauth2 v0.0.0-20220622183110-fd043fe589d2 // indirect + golang.org/x/sys v0.0.0-20220624220833-87e55d714810 // indirect golang.org/x/text v0.3.7 // indirect google.golang.org/appengine v1.6.7 // indirect ) diff --git a/retail/go.sum b/retail/go.sum index 0180b5715942..caab97273379 100644 --- a/retail/go.sum +++ b/retail/go.sum @@ -162,6 +162,7 @@ github.com/google/pprof v0.0.0-20210609004039-a478d1d731e9/go.mod h1:kpwsk12EmLe github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/enterprise-certificate-proxy v0.0.0-20220520183353-fd19c99a87aa/go.mod h1:17drOmN3MwGY7t0e+Ei9b45FFGA3fBs3x36SsCg1hq8= github.com/googleapis/enterprise-certificate-proxy v0.1.0 h1:zO8WHNx/MYiAKJ3d5spxZXZE6KHmIQGQcAzwUzV7qQw= github.com/googleapis/enterprise-certificate-proxy v0.1.0/go.mod h1:17drOmN3MwGY7t0e+Ei9b45FFGA3fBs3x36SsCg1hq8= @@ -290,8 +291,8 @@ golang.org/x/net v0.0.0-20220325170049-de3da57026de/go.mod h1:CfG3xpIq0wQ8r1q4Su golang.org/x/net v0.0.0-20220412020605-290c469a71a5/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220607020251-c690dde0001d/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.0.0-20220617184016-355a448f1bc9 h1:Yqz/iviulwKwAREEeUd3nbBFn0XuyJqkoft2IlrvOhc= -golang.org/x/net v0.0.0-20220617184016-355a448f1bc9/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= +golang.org/x/net v0.0.0-20220624214902-1bab6f366d9e h1:TsQ7F31D3bUCLeqPT0u+yjp1guoArKaNKmCr22PYgTQ= +golang.org/x/net v0.0.0-20220624214902-1bab6f366d9e/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -311,8 +312,9 @@ golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8/go.mod h1:KelEdhl1UZF7XfJ golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= golang.org/x/oauth2 v0.0.0-20220309155454-6242fa91716a/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= golang.org/x/oauth2 v0.0.0-20220411215720-9780585627b5/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= -golang.org/x/oauth2 v0.0.0-20220608161450-d0670ef3b1eb h1:8tDJ3aechhddbdPAxpycgXHJRMLpk/Ab+aa4OgdN5/g= golang.org/x/oauth2 v0.0.0-20220608161450-d0670ef3b1eb/go.mod h1:jaDAt6Dkxork7LmZnYtzbRWj0W47D86a3TGe0YHBvmE= +golang.org/x/oauth2 v0.0.0-20220622183110-fd043fe589d2 h1:+jnHzr9VPj32ykQVai5DNahi9+NSp7yYuCsl5eAQtL0= +golang.org/x/oauth2 v0.0.0-20220622183110-fd043fe589d2/go.mod h1:jaDAt6Dkxork7LmZnYtzbRWj0W47D86a3TGe0YHBvmE= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -383,8 +385,8 @@ golang.org/x/sys v0.0.0-20220502124256-b6088ccd6cba/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220610221304-9f5ed59c137d/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220615213510-4f61da869c0c h1:aFV+BgZ4svzjfabn8ERpuB4JI4N6/rdy1iusx77G3oU= -golang.org/x/sys v0.0.0-20220615213510-4f61da869c0c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220624220833-87e55d714810 h1:rHZQSjJdAI4Xf5Qzeh2bBc5YJIkPFVM6oDtMFYmgws0= +golang.org/x/sys v0.0.0-20220624220833-87e55d714810/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -497,8 +499,8 @@ google.golang.org/api v0.75.0/go.mod h1:pU9QmyHLnzlpar1Mjt4IbapUCy8J+6HD6GeELN69 google.golang.org/api v0.78.0/go.mod h1:1Sg78yoMLOhlQTeF+ARBoytAcH1NNyyl390YMy6rKmw= google.golang.org/api v0.80.0/go.mod h1:xY3nI94gbvBrE0J6NHXhxOmW97HG7Khjkku6AFB3Hyg= google.golang.org/api v0.84.0/go.mod h1:NTsGnUFJMYROtiquksZHBWtHfeMC7iYthki7Eq3pa8o= -google.golang.org/api v0.85.0 h1:8rJoHuRxx+vCmZtAO/3k1dRLvYNVyTJtZ5oaFZvhgvc= -google.golang.org/api v0.85.0/go.mod h1:AqZf8Ep9uZ2pyTvgL+x0D3Zt0eoT9b5E8fmzfu6FO2g= +google.golang.org/api v0.90.0 h1:WMnUWAvihIClUYFNeFA69VTuR3duKS3IalMGDQcLvq8= +google.golang.org/api v0.90.0/go.mod h1:+Sem1dnrKlrXMR/X0bPnMWyluQe4RsNoYfmNLhOIkzw= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= @@ -585,8 +587,10 @@ google.golang.org/genproto v0.0.0-20220518221133-4f43b3371335/go.mod h1:RAyBrSAP google.golang.org/genproto v0.0.0-20220523171625-347a074981d8/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4= google.golang.org/genproto v0.0.0-20220608133413-ed9918b62aac/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= google.golang.org/genproto v0.0.0-20220616135557-88e70c0c3a90/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= -google.golang.org/genproto v0.0.0-20220617124728-180714bec0ad h1:kqrS+lhvaMHCxul6sKQvKJ8nAAhlVItmZV822hYFH/U= google.golang.org/genproto v0.0.0-20220617124728-180714bec0ad/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= +google.golang.org/genproto v0.0.0-20220624142145-8cd45d7dbd1f/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= +google.golang.org/genproto v0.0.0-20220801145646-83ce21fca29f h1:XVHpVMvPs4MtH3h6cThzKs2snNexcfd35vQx2T3IuIY= +google.golang.org/genproto v0.0.0-20220801145646-83ce21fca29f/go.mod h1:iHe1svFLAZg9VWz891+QbRMwUv9O/1Ww+/mngYeThbc= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= diff --git a/spanner/admin/database/apiv1/database_admin_client.go b/spanner/admin/database/apiv1/database_admin_client.go index 779df7d3d9d4..30580ae82de0 100644 --- a/spanner/admin/database/apiv1/database_admin_client.go +++ b/spanner/admin/database/apiv1/database_admin_client.go @@ -62,6 +62,10 @@ type DatabaseAdminCallOptions struct { ListDatabaseOperations []gax.CallOption ListBackupOperations []gax.CallOption ListDatabaseRoles []gax.CallOption + CancelOperation []gax.CallOption + DeleteOperation []gax.CallOption + GetOperation []gax.CallOption + ListOperations []gax.CallOption } func defaultDatabaseAdminGRPCClientOptions() []option.ClientOption { @@ -240,10 +244,14 @@ func defaultDatabaseAdminCallOptions() *DatabaseAdminCallOptions { }) }), }, + CancelOperation: []gax.CallOption{}, + DeleteOperation: []gax.CallOption{}, + GetOperation: []gax.CallOption{}, + ListOperations: []gax.CallOption{}, } } -// internalDatabaseAdminClient is an interface that defines the methods available from Cloud Spanner Database Admin API. +// internalDatabaseAdminClient is an interface that defines the methods available from Cloud Spanner API. type internalDatabaseAdminClient interface { Close() error setGoogleClientInfo(...string) @@ -272,9 +280,13 @@ type internalDatabaseAdminClient interface { ListDatabaseOperations(context.Context, *databasepb.ListDatabaseOperationsRequest, ...gax.CallOption) *OperationIterator ListBackupOperations(context.Context, *databasepb.ListBackupOperationsRequest, ...gax.CallOption) *OperationIterator ListDatabaseRoles(context.Context, *databasepb.ListDatabaseRolesRequest, ...gax.CallOption) *DatabaseRoleIterator + CancelOperation(context.Context, *longrunningpb.CancelOperationRequest, ...gax.CallOption) error + DeleteOperation(context.Context, *longrunningpb.DeleteOperationRequest, ...gax.CallOption) error + GetOperation(context.Context, *longrunningpb.GetOperationRequest, ...gax.CallOption) (*longrunningpb.Operation, error) + ListOperations(context.Context, *longrunningpb.ListOperationsRequest, ...gax.CallOption) *OperationIterator } -// DatabaseAdminClient is a client for interacting with Cloud Spanner Database Admin API. +// DatabaseAdminClient is a client for interacting with Cloud Spanner API. // Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls. // // Cloud Spanner Database Admin API @@ -545,7 +557,27 @@ func (c *DatabaseAdminClient) ListDatabaseRoles(ctx context.Context, req *databa return c.internalClient.ListDatabaseRoles(ctx, req, opts...) } -// databaseAdminGRPCClient is a client for interacting with Cloud Spanner Database Admin API over gRPC transport. +// CancelOperation is a utility method from google.longrunning.Operations. +func (c *DatabaseAdminClient) CancelOperation(ctx context.Context, req *longrunningpb.CancelOperationRequest, opts ...gax.CallOption) error { + return c.internalClient.CancelOperation(ctx, req, opts...) +} + +// DeleteOperation is a utility method from google.longrunning.Operations. +func (c *DatabaseAdminClient) DeleteOperation(ctx context.Context, req *longrunningpb.DeleteOperationRequest, opts ...gax.CallOption) error { + return c.internalClient.DeleteOperation(ctx, req, opts...) +} + +// GetOperation is a utility method from google.longrunning.Operations. +func (c *DatabaseAdminClient) GetOperation(ctx context.Context, req *longrunningpb.GetOperationRequest, opts ...gax.CallOption) (*longrunningpb.Operation, error) { + return c.internalClient.GetOperation(ctx, req, opts...) +} + +// ListOperations is a utility method from google.longrunning.Operations. +func (c *DatabaseAdminClient) ListOperations(ctx context.Context, req *longrunningpb.ListOperationsRequest, opts ...gax.CallOption) *OperationIterator { + return c.internalClient.ListOperations(ctx, req, opts...) +} + +// databaseAdminGRPCClient is a client for interacting with Cloud Spanner API over gRPC transport. // // Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls. type databaseAdminGRPCClient struct { @@ -566,6 +598,8 @@ type databaseAdminGRPCClient struct { // Users should not Close this client. LROClient **lroauto.OperationsClient + operationsClient longrunningpb.OperationsClient + // The x-goog-* metadata to be sent with each request. xGoogMetadata metadata.MD } @@ -610,6 +644,7 @@ func NewDatabaseAdminClient(ctx context.Context, opts ...option.ClientOption) (* disableDeadlines: disableDeadlines, databaseAdminClient: databasepb.NewDatabaseAdminClient(connPool), CallOptions: &client.CallOptions, + operationsClient: longrunningpb.NewOperationsClient(connPool), } c.setGoogleClientInfo() @@ -1186,6 +1221,94 @@ func (c *databaseAdminGRPCClient) ListDatabaseRoles(ctx context.Context, req *da return it } +func (c *databaseAdminGRPCClient) CancelOperation(ctx context.Context, req *longrunningpb.CancelOperationRequest, opts ...gax.CallOption) error { + md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))) + + ctx = insertMetadata(ctx, c.xGoogMetadata, md) + opts = append((*c.CallOptions).CancelOperation[0:len((*c.CallOptions).CancelOperation):len((*c.CallOptions).CancelOperation)], opts...) + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + _, err = c.operationsClient.CancelOperation(ctx, req, settings.GRPC...) + return err + }, opts...) + return err +} + +func (c *databaseAdminGRPCClient) DeleteOperation(ctx context.Context, req *longrunningpb.DeleteOperationRequest, opts ...gax.CallOption) error { + md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))) + + ctx = insertMetadata(ctx, c.xGoogMetadata, md) + opts = append((*c.CallOptions).DeleteOperation[0:len((*c.CallOptions).DeleteOperation):len((*c.CallOptions).DeleteOperation)], opts...) + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + _, err = c.operationsClient.DeleteOperation(ctx, req, settings.GRPC...) + return err + }, opts...) + return err +} + +func (c *databaseAdminGRPCClient) GetOperation(ctx context.Context, req *longrunningpb.GetOperationRequest, opts ...gax.CallOption) (*longrunningpb.Operation, error) { + md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))) + + ctx = insertMetadata(ctx, c.xGoogMetadata, md) + opts = append((*c.CallOptions).GetOperation[0:len((*c.CallOptions).GetOperation):len((*c.CallOptions).GetOperation)], opts...) + var resp *longrunningpb.Operation + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + resp, err = c.operationsClient.GetOperation(ctx, req, settings.GRPC...) + return err + }, opts...) + if err != nil { + return nil, err + } + return resp, nil +} + +func (c *databaseAdminGRPCClient) ListOperations(ctx context.Context, req *longrunningpb.ListOperationsRequest, opts ...gax.CallOption) *OperationIterator { + md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))) + + ctx = insertMetadata(ctx, c.xGoogMetadata, md) + opts = append((*c.CallOptions).ListOperations[0:len((*c.CallOptions).ListOperations):len((*c.CallOptions).ListOperations)], opts...) + it := &OperationIterator{} + req = proto.Clone(req).(*longrunningpb.ListOperationsRequest) + it.InternalFetch = func(pageSize int, pageToken string) ([]*longrunningpb.Operation, string, error) { + resp := &longrunningpb.ListOperationsResponse{} + if pageToken != "" { + req.PageToken = pageToken + } + if pageSize > math.MaxInt32 { + req.PageSize = math.MaxInt32 + } else if pageSize != 0 { + req.PageSize = int32(pageSize) + } + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + resp, err = c.operationsClient.ListOperations(ctx, req, settings.GRPC...) + return err + }, opts...) + if err != nil { + return nil, "", err + } + + it.Response = resp + return resp.GetOperations(), resp.GetNextPageToken(), nil + } + fetch := func(pageSize int, pageToken string) (string, error) { + items, nextPageToken, err := it.InternalFetch(pageSize, pageToken) + if err != nil { + return "", err + } + it.items = append(it.items, items...) + return nextPageToken, nil + } + + it.pageInfo, it.nextFunc = iterator.NewPageInfo(fetch, it.bufLen, it.takeBuf) + it.pageInfo.MaxSize = int(req.GetPageSize()) + it.pageInfo.Token = req.GetPageToken() + + return it +} + // CopyBackupOperation manages a long-running operation from CopyBackup. type CopyBackupOperation struct { lro *longrunning.Operation diff --git a/spanner/admin/database/apiv1/database_admin_client_example_test.go b/spanner/admin/database/apiv1/database_admin_client_example_test.go index f0e8565b5f83..f50e836a71bb 100644 --- a/spanner/admin/database/apiv1/database_admin_client_example_test.go +++ b/spanner/admin/database/apiv1/database_admin_client_example_test.go @@ -22,6 +22,7 @@ import ( database "cloud.google.com/go/spanner/admin/database/apiv1" "google.golang.org/api/iterator" iampb "google.golang.org/genproto/googleapis/iam/v1" + longrunningpb "google.golang.org/genproto/googleapis/longrunning" databasepb "google.golang.org/genproto/googleapis/spanner/admin/database/v1" ) @@ -465,3 +466,85 @@ func ExampleDatabaseAdminClient_ListDatabaseRoles() { _ = resp } } + +func ExampleDatabaseAdminClient_CancelOperation() { + ctx := context.Background() + c, err := database.NewDatabaseAdminClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &longrunningpb.CancelOperationRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/longrunning#CancelOperationRequest. + } + err = c.CancelOperation(ctx, req) + if err != nil { + // TODO: Handle error. + } +} + +func ExampleDatabaseAdminClient_DeleteOperation() { + ctx := context.Background() + c, err := database.NewDatabaseAdminClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &longrunningpb.DeleteOperationRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/longrunning#DeleteOperationRequest. + } + err = c.DeleteOperation(ctx, req) + if err != nil { + // TODO: Handle error. + } +} + +func ExampleDatabaseAdminClient_GetOperation() { + ctx := context.Background() + c, err := database.NewDatabaseAdminClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &longrunningpb.GetOperationRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/longrunning#GetOperationRequest. + } + resp, err := c.GetOperation(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleDatabaseAdminClient_ListOperations() { + ctx := context.Background() + c, err := database.NewDatabaseAdminClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &longrunningpb.ListOperationsRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/longrunning#ListOperationsRequest. + } + it := c.ListOperations(ctx, req) + for { + resp, err := it.Next() + if err == iterator.Done { + break + } + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp + } +} diff --git a/spanner/admin/database/apiv1/doc.go b/spanner/admin/database/apiv1/doc.go index d0f2482fe7a6..2cf12a800315 100644 --- a/spanner/admin/database/apiv1/doc.go +++ b/spanner/admin/database/apiv1/doc.go @@ -15,7 +15,10 @@ // Code generated by protoc-gen-go_gapic. DO NOT EDIT. // Package database is an auto-generated package for the -// Cloud Spanner Database Admin API. +// Cloud Spanner API. +// +// Cloud Spanner is a managed, mission-critical, globally consistent and +// scalable relational database service. // // Example usage // diff --git a/spanner/admin/database/apiv1/gapic_metadata.json b/spanner/admin/database/apiv1/gapic_metadata.json index b55d79c00614..dbc6307230f7 100644 --- a/spanner/admin/database/apiv1/gapic_metadata.json +++ b/spanner/admin/database/apiv1/gapic_metadata.json @@ -10,6 +10,11 @@ "grpc": { "libraryClient": "DatabaseAdminClient", "rpcs": { + "CancelOperation": { + "methods": [ + "CancelOperation" + ] + }, "CopyBackup": { "methods": [ "CopyBackup" @@ -30,6 +35,11 @@ "DeleteBackup" ] }, + "DeleteOperation": { + "methods": [ + "DeleteOperation" + ] + }, "DropDatabase": { "methods": [ "DropDatabase" @@ -55,6 +65,11 @@ "GetIamPolicy" ] }, + "GetOperation": { + "methods": [ + "GetOperation" + ] + }, "ListBackupOperations": { "methods": [ "ListBackupOperations" @@ -80,6 +95,11 @@ "ListDatabases" ] }, + "ListOperations": { + "methods": [ + "ListOperations" + ] + }, "RestoreDatabase": { "methods": [ "RestoreDatabase" diff --git a/spanner/go.mod b/spanner/go.mod index f88bd99575c2..71370517ff38 100644 --- a/spanner/go.mod +++ b/spanner/go.mod @@ -9,8 +9,8 @@ require ( github.com/googleapis/gax-go/v2 v2.4.0 go.opencensus.io v0.23.0 golang.org/x/xerrors v0.0.0-20220609144429-65e65417b02f - google.golang.org/api v0.86.0 - google.golang.org/genproto v0.0.0-20220725144611-272f38e5d71b + google.golang.org/api v0.90.0 + google.golang.org/genproto v0.0.0-20220801145646-83ce21fca29f google.golang.org/grpc v1.48.0 google.golang.org/protobuf v1.28.0 ) diff --git a/spanner/go.sum b/spanner/go.sum index 6691561b8bc4..69f7828ff9b8 100644 --- a/spanner/go.sum +++ b/spanner/go.sum @@ -509,8 +509,8 @@ google.golang.org/api v0.75.0/go.mod h1:pU9QmyHLnzlpar1Mjt4IbapUCy8J+6HD6GeELN69 google.golang.org/api v0.78.0/go.mod h1:1Sg78yoMLOhlQTeF+ARBoytAcH1NNyyl390YMy6rKmw= google.golang.org/api v0.80.0/go.mod h1:xY3nI94gbvBrE0J6NHXhxOmW97HG7Khjkku6AFB3Hyg= google.golang.org/api v0.84.0/go.mod h1:NTsGnUFJMYROtiquksZHBWtHfeMC7iYthki7Eq3pa8o= -google.golang.org/api v0.86.0 h1:ZAnyOHQFIuWso1BodVfSaRyffD74T9ERGFa3k1fNk/U= -google.golang.org/api v0.86.0/go.mod h1:+Sem1dnrKlrXMR/X0bPnMWyluQe4RsNoYfmNLhOIkzw= +google.golang.org/api v0.90.0 h1:WMnUWAvihIClUYFNeFA69VTuR3duKS3IalMGDQcLvq8= +google.golang.org/api v0.90.0/go.mod h1:+Sem1dnrKlrXMR/X0bPnMWyluQe4RsNoYfmNLhOIkzw= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= @@ -599,8 +599,8 @@ google.golang.org/genproto v0.0.0-20220608133413-ed9918b62aac/go.mod h1:KEWEmljW google.golang.org/genproto v0.0.0-20220616135557-88e70c0c3a90/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= google.golang.org/genproto v0.0.0-20220617124728-180714bec0ad/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= google.golang.org/genproto v0.0.0-20220624142145-8cd45d7dbd1f/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= -google.golang.org/genproto v0.0.0-20220725144611-272f38e5d71b h1:SfSkJugek6xm7lWywqth4r2iTrYLpD8lOj1nMIIhMNM= -google.golang.org/genproto v0.0.0-20220725144611-272f38e5d71b/go.mod h1:iHe1svFLAZg9VWz891+QbRMwUv9O/1Ww+/mngYeThbc= +google.golang.org/genproto v0.0.0-20220801145646-83ce21fca29f h1:XVHpVMvPs4MtH3h6cThzKs2snNexcfd35vQx2T3IuIY= +google.golang.org/genproto v0.0.0-20220801145646-83ce21fca29f/go.mod h1:iHe1svFLAZg9VWz891+QbRMwUv9O/1Ww+/mngYeThbc= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM=