blob: 046a3468bec28bb0d63dc18ee7ba5ba125648ff7 [file] [log] [blame]
// Copyright 2024 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"
aiplatformpb "cloud.google.com/go/aiplatform/apiv1/aiplatformpb"
iampb "cloud.google.com/go/iam/apiv1/iampb"
"cloud.google.com/go/longrunning"
lroauto "cloud.google.com/go/longrunning/autogen"
longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
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"
locationpb "google.golang.org/genproto/googleapis/cloud/location"
"google.golang.org/grpc"
"google.golang.org/protobuf/proto"
)
var newFeatureOnlineStoreAdminClientHook clientHook
// FeatureOnlineStoreAdminCallOptions contains the retry settings for each method of FeatureOnlineStoreAdminClient.
type FeatureOnlineStoreAdminCallOptions struct {
CreateFeatureOnlineStore []gax.CallOption
GetFeatureOnlineStore []gax.CallOption
ListFeatureOnlineStores []gax.CallOption
UpdateFeatureOnlineStore []gax.CallOption
DeleteFeatureOnlineStore []gax.CallOption
CreateFeatureView []gax.CallOption
GetFeatureView []gax.CallOption
ListFeatureViews []gax.CallOption
UpdateFeatureView []gax.CallOption
DeleteFeatureView []gax.CallOption
SyncFeatureView []gax.CallOption
GetFeatureViewSync []gax.CallOption
ListFeatureViewSyncs []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 defaultFeatureOnlineStoreAdminGRPCClientOptions() []option.ClientOption {
return []option.ClientOption{
internaloption.WithDefaultEndpoint("aiplatform.googleapis.com:443"),
internaloption.WithDefaultEndpointTemplate("aiplatform.UNIVERSE_DOMAIN:443"),
internaloption.WithDefaultMTLSEndpoint("aiplatform.mtls.googleapis.com:443"),
internaloption.WithDefaultUniverseDomain("googleapis.com"),
internaloption.WithDefaultAudience("https://aiplatform.googleapis.com/"),
internaloption.WithDefaultScopes(DefaultAuthScopes()...),
internaloption.EnableJwtWithScope(),
option.WithGRPCDialOption(grpc.WithDefaultCallOptions(
grpc.MaxCallRecvMsgSize(math.MaxInt32))),
}
}
func defaultFeatureOnlineStoreAdminCallOptions() *FeatureOnlineStoreAdminCallOptions {
return &FeatureOnlineStoreAdminCallOptions{
CreateFeatureOnlineStore: []gax.CallOption{},
GetFeatureOnlineStore: []gax.CallOption{},
ListFeatureOnlineStores: []gax.CallOption{},
UpdateFeatureOnlineStore: []gax.CallOption{},
DeleteFeatureOnlineStore: []gax.CallOption{},
CreateFeatureView: []gax.CallOption{},
GetFeatureView: []gax.CallOption{},
ListFeatureViews: []gax.CallOption{},
UpdateFeatureView: []gax.CallOption{},
DeleteFeatureView: []gax.CallOption{},
SyncFeatureView: []gax.CallOption{},
GetFeatureViewSync: []gax.CallOption{},
ListFeatureViewSyncs: []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{},
}
}
// internalFeatureOnlineStoreAdminClient is an interface that defines the methods available from Vertex AI API.
type internalFeatureOnlineStoreAdminClient interface {
Close() error
setGoogleClientInfo(...string)
Connection() *grpc.ClientConn
CreateFeatureOnlineStore(context.Context, *aiplatformpb.CreateFeatureOnlineStoreRequest, ...gax.CallOption) (*CreateFeatureOnlineStoreOperation, error)
CreateFeatureOnlineStoreOperation(name string) *CreateFeatureOnlineStoreOperation
GetFeatureOnlineStore(context.Context, *aiplatformpb.GetFeatureOnlineStoreRequest, ...gax.CallOption) (*aiplatformpb.FeatureOnlineStore, error)
ListFeatureOnlineStores(context.Context, *aiplatformpb.ListFeatureOnlineStoresRequest, ...gax.CallOption) *FeatureOnlineStoreIterator
UpdateFeatureOnlineStore(context.Context, *aiplatformpb.UpdateFeatureOnlineStoreRequest, ...gax.CallOption) (*UpdateFeatureOnlineStoreOperation, error)
UpdateFeatureOnlineStoreOperation(name string) *UpdateFeatureOnlineStoreOperation
DeleteFeatureOnlineStore(context.Context, *aiplatformpb.DeleteFeatureOnlineStoreRequest, ...gax.CallOption) (*DeleteFeatureOnlineStoreOperation, error)
DeleteFeatureOnlineStoreOperation(name string) *DeleteFeatureOnlineStoreOperation
CreateFeatureView(context.Context, *aiplatformpb.CreateFeatureViewRequest, ...gax.CallOption) (*CreateFeatureViewOperation, error)
CreateFeatureViewOperation(name string) *CreateFeatureViewOperation
GetFeatureView(context.Context, *aiplatformpb.GetFeatureViewRequest, ...gax.CallOption) (*aiplatformpb.FeatureView, error)
ListFeatureViews(context.Context, *aiplatformpb.ListFeatureViewsRequest, ...gax.CallOption) *FeatureViewIterator
UpdateFeatureView(context.Context, *aiplatformpb.UpdateFeatureViewRequest, ...gax.CallOption) (*UpdateFeatureViewOperation, error)
UpdateFeatureViewOperation(name string) *UpdateFeatureViewOperation
DeleteFeatureView(context.Context, *aiplatformpb.DeleteFeatureViewRequest, ...gax.CallOption) (*DeleteFeatureViewOperation, error)
DeleteFeatureViewOperation(name string) *DeleteFeatureViewOperation
SyncFeatureView(context.Context, *aiplatformpb.SyncFeatureViewRequest, ...gax.CallOption) (*aiplatformpb.SyncFeatureViewResponse, error)
GetFeatureViewSync(context.Context, *aiplatformpb.GetFeatureViewSyncRequest, ...gax.CallOption) (*aiplatformpb.FeatureViewSync, error)
ListFeatureViewSyncs(context.Context, *aiplatformpb.ListFeatureViewSyncsRequest, ...gax.CallOption) *FeatureViewSyncIterator
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)
}
// FeatureOnlineStoreAdminClient 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.
//
// The service that handles CRUD and List for resources for
// FeatureOnlineStore.
type FeatureOnlineStoreAdminClient struct {
// The internal transport-dependent client.
internalClient internalFeatureOnlineStoreAdminClient
// The call options for this service.
CallOptions *FeatureOnlineStoreAdminCallOptions
// 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 *FeatureOnlineStoreAdminClient) 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 *FeatureOnlineStoreAdminClient) setGoogleClientInfo(keyval ...string) {
c.internalClient.setGoogleClientInfo(keyval...)
}
// Connection returns a connection to the API service.
//
// Deprecated: Connections are now pooled so this method does not always
// return the same resource.
func (c *FeatureOnlineStoreAdminClient) Connection() *grpc.ClientConn {
return c.internalClient.Connection()
}
// CreateFeatureOnlineStore creates a new FeatureOnlineStore in a given project and location.
func (c *FeatureOnlineStoreAdminClient) CreateFeatureOnlineStore(ctx context.Context, req *aiplatformpb.CreateFeatureOnlineStoreRequest, opts ...gax.CallOption) (*CreateFeatureOnlineStoreOperation, error) {
return c.internalClient.CreateFeatureOnlineStore(ctx, req, opts...)
}
// CreateFeatureOnlineStoreOperation returns a new CreateFeatureOnlineStoreOperation from a given name.
// The name must be that of a previously created CreateFeatureOnlineStoreOperation, possibly from a different process.
func (c *FeatureOnlineStoreAdminClient) CreateFeatureOnlineStoreOperation(name string) *CreateFeatureOnlineStoreOperation {
return c.internalClient.CreateFeatureOnlineStoreOperation(name)
}
// GetFeatureOnlineStore gets details of a single FeatureOnlineStore.
func (c *FeatureOnlineStoreAdminClient) GetFeatureOnlineStore(ctx context.Context, req *aiplatformpb.GetFeatureOnlineStoreRequest, opts ...gax.CallOption) (*aiplatformpb.FeatureOnlineStore, error) {
return c.internalClient.GetFeatureOnlineStore(ctx, req, opts...)
}
// ListFeatureOnlineStores lists FeatureOnlineStores in a given project and location.
func (c *FeatureOnlineStoreAdminClient) ListFeatureOnlineStores(ctx context.Context, req *aiplatformpb.ListFeatureOnlineStoresRequest, opts ...gax.CallOption) *FeatureOnlineStoreIterator {
return c.internalClient.ListFeatureOnlineStores(ctx, req, opts...)
}
// UpdateFeatureOnlineStore updates the parameters of a single FeatureOnlineStore.
func (c *FeatureOnlineStoreAdminClient) UpdateFeatureOnlineStore(ctx context.Context, req *aiplatformpb.UpdateFeatureOnlineStoreRequest, opts ...gax.CallOption) (*UpdateFeatureOnlineStoreOperation, error) {
return c.internalClient.UpdateFeatureOnlineStore(ctx, req, opts...)
}
// UpdateFeatureOnlineStoreOperation returns a new UpdateFeatureOnlineStoreOperation from a given name.
// The name must be that of a previously created UpdateFeatureOnlineStoreOperation, possibly from a different process.
func (c *FeatureOnlineStoreAdminClient) UpdateFeatureOnlineStoreOperation(name string) *UpdateFeatureOnlineStoreOperation {
return c.internalClient.UpdateFeatureOnlineStoreOperation(name)
}
// DeleteFeatureOnlineStore deletes a single FeatureOnlineStore. The FeatureOnlineStore must not
// contain any FeatureViews.
func (c *FeatureOnlineStoreAdminClient) DeleteFeatureOnlineStore(ctx context.Context, req *aiplatformpb.DeleteFeatureOnlineStoreRequest, opts ...gax.CallOption) (*DeleteFeatureOnlineStoreOperation, error) {
return c.internalClient.DeleteFeatureOnlineStore(ctx, req, opts...)
}
// DeleteFeatureOnlineStoreOperation returns a new DeleteFeatureOnlineStoreOperation from a given name.
// The name must be that of a previously created DeleteFeatureOnlineStoreOperation, possibly from a different process.
func (c *FeatureOnlineStoreAdminClient) DeleteFeatureOnlineStoreOperation(name string) *DeleteFeatureOnlineStoreOperation {
return c.internalClient.DeleteFeatureOnlineStoreOperation(name)
}
// CreateFeatureView creates a new FeatureView in a given FeatureOnlineStore.
func (c *FeatureOnlineStoreAdminClient) CreateFeatureView(ctx context.Context, req *aiplatformpb.CreateFeatureViewRequest, opts ...gax.CallOption) (*CreateFeatureViewOperation, error) {
return c.internalClient.CreateFeatureView(ctx, req, opts...)
}
// CreateFeatureViewOperation returns a new CreateFeatureViewOperation from a given name.
// The name must be that of a previously created CreateFeatureViewOperation, possibly from a different process.
func (c *FeatureOnlineStoreAdminClient) CreateFeatureViewOperation(name string) *CreateFeatureViewOperation {
return c.internalClient.CreateFeatureViewOperation(name)
}
// GetFeatureView gets details of a single FeatureView.
func (c *FeatureOnlineStoreAdminClient) GetFeatureView(ctx context.Context, req *aiplatformpb.GetFeatureViewRequest, opts ...gax.CallOption) (*aiplatformpb.FeatureView, error) {
return c.internalClient.GetFeatureView(ctx, req, opts...)
}
// ListFeatureViews lists FeatureViews in a given FeatureOnlineStore.
func (c *FeatureOnlineStoreAdminClient) ListFeatureViews(ctx context.Context, req *aiplatformpb.ListFeatureViewsRequest, opts ...gax.CallOption) *FeatureViewIterator {
return c.internalClient.ListFeatureViews(ctx, req, opts...)
}
// UpdateFeatureView updates the parameters of a single FeatureView.
func (c *FeatureOnlineStoreAdminClient) UpdateFeatureView(ctx context.Context, req *aiplatformpb.UpdateFeatureViewRequest, opts ...gax.CallOption) (*UpdateFeatureViewOperation, error) {
return c.internalClient.UpdateFeatureView(ctx, req, opts...)
}
// UpdateFeatureViewOperation returns a new UpdateFeatureViewOperation from a given name.
// The name must be that of a previously created UpdateFeatureViewOperation, possibly from a different process.
func (c *FeatureOnlineStoreAdminClient) UpdateFeatureViewOperation(name string) *UpdateFeatureViewOperation {
return c.internalClient.UpdateFeatureViewOperation(name)
}
// DeleteFeatureView deletes a single FeatureView.
func (c *FeatureOnlineStoreAdminClient) DeleteFeatureView(ctx context.Context, req *aiplatformpb.DeleteFeatureViewRequest, opts ...gax.CallOption) (*DeleteFeatureViewOperation, error) {
return c.internalClient.DeleteFeatureView(ctx, req, opts...)
}
// DeleteFeatureViewOperation returns a new DeleteFeatureViewOperation from a given name.
// The name must be that of a previously created DeleteFeatureViewOperation, possibly from a different process.
func (c *FeatureOnlineStoreAdminClient) DeleteFeatureViewOperation(name string) *DeleteFeatureViewOperation {
return c.internalClient.DeleteFeatureViewOperation(name)
}
// SyncFeatureView triggers on-demand sync for the FeatureView.
func (c *FeatureOnlineStoreAdminClient) SyncFeatureView(ctx context.Context, req *aiplatformpb.SyncFeatureViewRequest, opts ...gax.CallOption) (*aiplatformpb.SyncFeatureViewResponse, error) {
return c.internalClient.SyncFeatureView(ctx, req, opts...)
}
// GetFeatureViewSync gets details of a single FeatureViewSync.
func (c *FeatureOnlineStoreAdminClient) GetFeatureViewSync(ctx context.Context, req *aiplatformpb.GetFeatureViewSyncRequest, opts ...gax.CallOption) (*aiplatformpb.FeatureViewSync, error) {
return c.internalClient.GetFeatureViewSync(ctx, req, opts...)
}
// ListFeatureViewSyncs lists FeatureViewSyncs in a given FeatureView.
func (c *FeatureOnlineStoreAdminClient) ListFeatureViewSyncs(ctx context.Context, req *aiplatformpb.ListFeatureViewSyncsRequest, opts ...gax.CallOption) *FeatureViewSyncIterator {
return c.internalClient.ListFeatureViewSyncs(ctx, req, opts...)
}
// GetLocation gets information about a location.
func (c *FeatureOnlineStoreAdminClient) 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 *FeatureOnlineStoreAdminClient) 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 *FeatureOnlineStoreAdminClient) 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 *FeatureOnlineStoreAdminClient) 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 *FeatureOnlineStoreAdminClient) 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 *FeatureOnlineStoreAdminClient) 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 *FeatureOnlineStoreAdminClient) 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 *FeatureOnlineStoreAdminClient) 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 *FeatureOnlineStoreAdminClient) 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 *FeatureOnlineStoreAdminClient) WaitOperation(ctx context.Context, req *longrunningpb.WaitOperationRequest, opts ...gax.CallOption) (*longrunningpb.Operation, error) {
return c.internalClient.WaitOperation(ctx, req, opts...)
}
// featureOnlineStoreAdminGRPCClient 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 featureOnlineStoreAdminGRPCClient struct {
// Connection pool of gRPC connections to the service.
connPool gtransport.ConnPool
// Points back to the CallOptions field of the containing FeatureOnlineStoreAdminClient
CallOptions **FeatureOnlineStoreAdminCallOptions
// The gRPC API client.
featureOnlineStoreAdminClient aiplatformpb.FeatureOnlineStoreAdminServiceClient
// 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.
xGoogHeaders []string
}
// NewFeatureOnlineStoreAdminClient creates a new feature online store admin service client based on gRPC.
// The returned client must be Closed when it is done being used to clean up its underlying connections.
//
// The service that handles CRUD and List for resources for
// FeatureOnlineStore.
func NewFeatureOnlineStoreAdminClient(ctx context.Context, opts ...option.ClientOption) (*FeatureOnlineStoreAdminClient, error) {
clientOpts := defaultFeatureOnlineStoreAdminGRPCClientOptions()
if newFeatureOnlineStoreAdminClientHook != nil {
hookOpts, err := newFeatureOnlineStoreAdminClientHook(ctx, clientHookParams{})
if err != nil {
return nil, err
}
clientOpts = append(clientOpts, hookOpts...)
}
connPool, err := gtransport.DialPool(ctx, append(clientOpts, opts...)...)
if err != nil {
return nil, err
}
client := FeatureOnlineStoreAdminClient{CallOptions: defaultFeatureOnlineStoreAdminCallOptions()}
c := &featureOnlineStoreAdminGRPCClient{
connPool: connPool,
featureOnlineStoreAdminClient: aiplatformpb.NewFeatureOnlineStoreAdminServiceClient(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: Connections are now pooled so this method does not always
// return the same resource.
func (c *featureOnlineStoreAdminGRPCClient) 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 *featureOnlineStoreAdminGRPCClient) setGoogleClientInfo(keyval ...string) {
kv := append([]string{"gl-go", gax.GoVersion}, keyval...)
kv = append(kv, "gapic", getVersionClient(), "gax", gax.Version, "grpc", grpc.Version)
c.xGoogHeaders = []string{"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 *featureOnlineStoreAdminGRPCClient) Close() error {
return c.connPool.Close()
}
func (c *featureOnlineStoreAdminGRPCClient) CreateFeatureOnlineStore(ctx context.Context, req *aiplatformpb.CreateFeatureOnlineStoreRequest, opts ...gax.CallOption) (*CreateFeatureOnlineStoreOperation, error) {
hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))}
hds = append(c.xGoogHeaders, hds...)
ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
opts = append((*c.CallOptions).CreateFeatureOnlineStore[0:len((*c.CallOptions).CreateFeatureOnlineStore):len((*c.CallOptions).CreateFeatureOnlineStore)], opts...)
var resp *longrunningpb.Operation
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
var err error
resp, err = c.featureOnlineStoreAdminClient.CreateFeatureOnlineStore(ctx, req, settings.GRPC...)
return err
}, opts...)
if err != nil {
return nil, err
}
return &CreateFeatureOnlineStoreOperation{
lro: longrunning.InternalNewOperation(*c.LROClient, resp),
}, nil
}
func (c *featureOnlineStoreAdminGRPCClient) GetFeatureOnlineStore(ctx context.Context, req *aiplatformpb.GetFeatureOnlineStoreRequest, opts ...gax.CallOption) (*aiplatformpb.FeatureOnlineStore, error) {
hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
hds = append(c.xGoogHeaders, hds...)
ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
opts = append((*c.CallOptions).GetFeatureOnlineStore[0:len((*c.CallOptions).GetFeatureOnlineStore):len((*c.CallOptions).GetFeatureOnlineStore)], opts...)
var resp *aiplatformpb.FeatureOnlineStore
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
var err error
resp, err = c.featureOnlineStoreAdminClient.GetFeatureOnlineStore(ctx, req, settings.GRPC...)
return err
}, opts...)
if err != nil {
return nil, err
}
return resp, nil
}
func (c *featureOnlineStoreAdminGRPCClient) ListFeatureOnlineStores(ctx context.Context, req *aiplatformpb.ListFeatureOnlineStoresRequest, opts ...gax.CallOption) *FeatureOnlineStoreIterator {
hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))}
hds = append(c.xGoogHeaders, hds...)
ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
opts = append((*c.CallOptions).ListFeatureOnlineStores[0:len((*c.CallOptions).ListFeatureOnlineStores):len((*c.CallOptions).ListFeatureOnlineStores)], opts...)
it := &FeatureOnlineStoreIterator{}
req = proto.Clone(req).(*aiplatformpb.ListFeatureOnlineStoresRequest)
it.InternalFetch = func(pageSize int, pageToken string) ([]*aiplatformpb.FeatureOnlineStore, string, error) {
resp := &aiplatformpb.ListFeatureOnlineStoresResponse{}
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.featureOnlineStoreAdminClient.ListFeatureOnlineStores(ctx, req, settings.GRPC...)
return err
}, opts...)
if err != nil {
return nil, "", err
}
it.Response = resp
return resp.GetFeatureOnlineStores(), 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 *featureOnlineStoreAdminGRPCClient) UpdateFeatureOnlineStore(ctx context.Context, req *aiplatformpb.UpdateFeatureOnlineStoreRequest, opts ...gax.CallOption) (*UpdateFeatureOnlineStoreOperation, error) {
hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "feature_online_store.name", url.QueryEscape(req.GetFeatureOnlineStore().GetName()))}
hds = append(c.xGoogHeaders, hds...)
ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
opts = append((*c.CallOptions).UpdateFeatureOnlineStore[0:len((*c.CallOptions).UpdateFeatureOnlineStore):len((*c.CallOptions).UpdateFeatureOnlineStore)], opts...)
var resp *longrunningpb.Operation
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
var err error
resp, err = c.featureOnlineStoreAdminClient.UpdateFeatureOnlineStore(ctx, req, settings.GRPC...)
return err
}, opts...)
if err != nil {
return nil, err
}
return &UpdateFeatureOnlineStoreOperation{
lro: longrunning.InternalNewOperation(*c.LROClient, resp),
}, nil
}
func (c *featureOnlineStoreAdminGRPCClient) DeleteFeatureOnlineStore(ctx context.Context, req *aiplatformpb.DeleteFeatureOnlineStoreRequest, opts ...gax.CallOption) (*DeleteFeatureOnlineStoreOperation, error) {
hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
hds = append(c.xGoogHeaders, hds...)
ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
opts = append((*c.CallOptions).DeleteFeatureOnlineStore[0:len((*c.CallOptions).DeleteFeatureOnlineStore):len((*c.CallOptions).DeleteFeatureOnlineStore)], opts...)
var resp *longrunningpb.Operation
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
var err error
resp, err = c.featureOnlineStoreAdminClient.DeleteFeatureOnlineStore(ctx, req, settings.GRPC...)
return err
}, opts...)
if err != nil {
return nil, err
}
return &DeleteFeatureOnlineStoreOperation{
lro: longrunning.InternalNewOperation(*c.LROClient, resp),
}, nil
}
func (c *featureOnlineStoreAdminGRPCClient) CreateFeatureView(ctx context.Context, req *aiplatformpb.CreateFeatureViewRequest, opts ...gax.CallOption) (*CreateFeatureViewOperation, error) {
hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))}
hds = append(c.xGoogHeaders, hds...)
ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
opts = append((*c.CallOptions).CreateFeatureView[0:len((*c.CallOptions).CreateFeatureView):len((*c.CallOptions).CreateFeatureView)], opts...)
var resp *longrunningpb.Operation
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
var err error
resp, err = c.featureOnlineStoreAdminClient.CreateFeatureView(ctx, req, settings.GRPC...)
return err
}, opts...)
if err != nil {
return nil, err
}
return &CreateFeatureViewOperation{
lro: longrunning.InternalNewOperation(*c.LROClient, resp),
}, nil
}
func (c *featureOnlineStoreAdminGRPCClient) GetFeatureView(ctx context.Context, req *aiplatformpb.GetFeatureViewRequest, opts ...gax.CallOption) (*aiplatformpb.FeatureView, error) {
hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
hds = append(c.xGoogHeaders, hds...)
ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
opts = append((*c.CallOptions).GetFeatureView[0:len((*c.CallOptions).GetFeatureView):len((*c.CallOptions).GetFeatureView)], opts...)
var resp *aiplatformpb.FeatureView
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
var err error
resp, err = c.featureOnlineStoreAdminClient.GetFeatureView(ctx, req, settings.GRPC...)
return err
}, opts...)
if err != nil {
return nil, err
}
return resp, nil
}
func (c *featureOnlineStoreAdminGRPCClient) ListFeatureViews(ctx context.Context, req *aiplatformpb.ListFeatureViewsRequest, opts ...gax.CallOption) *FeatureViewIterator {
hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))}
hds = append(c.xGoogHeaders, hds...)
ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
opts = append((*c.CallOptions).ListFeatureViews[0:len((*c.CallOptions).ListFeatureViews):len((*c.CallOptions).ListFeatureViews)], opts...)
it := &FeatureViewIterator{}
req = proto.Clone(req).(*aiplatformpb.ListFeatureViewsRequest)
it.InternalFetch = func(pageSize int, pageToken string) ([]*aiplatformpb.FeatureView, string, error) {
resp := &aiplatformpb.ListFeatureViewsResponse{}
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.featureOnlineStoreAdminClient.ListFeatureViews(ctx, req, settings.GRPC...)
return err
}, opts...)
if err != nil {
return nil, "", err
}
it.Response = resp
return resp.GetFeatureViews(), 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 *featureOnlineStoreAdminGRPCClient) UpdateFeatureView(ctx context.Context, req *aiplatformpb.UpdateFeatureViewRequest, opts ...gax.CallOption) (*UpdateFeatureViewOperation, error) {
hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "feature_view.name", url.QueryEscape(req.GetFeatureView().GetName()))}
hds = append(c.xGoogHeaders, hds...)
ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
opts = append((*c.CallOptions).UpdateFeatureView[0:len((*c.CallOptions).UpdateFeatureView):len((*c.CallOptions).UpdateFeatureView)], opts...)
var resp *longrunningpb.Operation
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
var err error
resp, err = c.featureOnlineStoreAdminClient.UpdateFeatureView(ctx, req, settings.GRPC...)
return err
}, opts...)
if err != nil {
return nil, err
}
return &UpdateFeatureViewOperation{
lro: longrunning.InternalNewOperation(*c.LROClient, resp),
}, nil
}
func (c *featureOnlineStoreAdminGRPCClient) DeleteFeatureView(ctx context.Context, req *aiplatformpb.DeleteFeatureViewRequest, opts ...gax.CallOption) (*DeleteFeatureViewOperation, error) {
hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
hds = append(c.xGoogHeaders, hds...)
ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
opts = append((*c.CallOptions).DeleteFeatureView[0:len((*c.CallOptions).DeleteFeatureView):len((*c.CallOptions).DeleteFeatureView)], opts...)
var resp *longrunningpb.Operation
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
var err error
resp, err = c.featureOnlineStoreAdminClient.DeleteFeatureView(ctx, req, settings.GRPC...)
return err
}, opts...)
if err != nil {
return nil, err
}
return &DeleteFeatureViewOperation{
lro: longrunning.InternalNewOperation(*c.LROClient, resp),
}, nil
}
func (c *featureOnlineStoreAdminGRPCClient) SyncFeatureView(ctx context.Context, req *aiplatformpb.SyncFeatureViewRequest, opts ...gax.CallOption) (*aiplatformpb.SyncFeatureViewResponse, error) {
hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "feature_view", url.QueryEscape(req.GetFeatureView()))}
hds = append(c.xGoogHeaders, hds...)
ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
opts = append((*c.CallOptions).SyncFeatureView[0:len((*c.CallOptions).SyncFeatureView):len((*c.CallOptions).SyncFeatureView)], opts...)
var resp *aiplatformpb.SyncFeatureViewResponse
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
var err error
resp, err = c.featureOnlineStoreAdminClient.SyncFeatureView(ctx, req, settings.GRPC...)
return err
}, opts...)
if err != nil {
return nil, err
}
return resp, nil
}
func (c *featureOnlineStoreAdminGRPCClient) GetFeatureViewSync(ctx context.Context, req *aiplatformpb.GetFeatureViewSyncRequest, opts ...gax.CallOption) (*aiplatformpb.FeatureViewSync, error) {
hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
hds = append(c.xGoogHeaders, hds...)
ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
opts = append((*c.CallOptions).GetFeatureViewSync[0:len((*c.CallOptions).GetFeatureViewSync):len((*c.CallOptions).GetFeatureViewSync)], opts...)
var resp *aiplatformpb.FeatureViewSync
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
var err error
resp, err = c.featureOnlineStoreAdminClient.GetFeatureViewSync(ctx, req, settings.GRPC...)
return err
}, opts...)
if err != nil {
return nil, err
}
return resp, nil
}
func (c *featureOnlineStoreAdminGRPCClient) ListFeatureViewSyncs(ctx context.Context, req *aiplatformpb.ListFeatureViewSyncsRequest, opts ...gax.CallOption) *FeatureViewSyncIterator {
hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))}
hds = append(c.xGoogHeaders, hds...)
ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
opts = append((*c.CallOptions).ListFeatureViewSyncs[0:len((*c.CallOptions).ListFeatureViewSyncs):len((*c.CallOptions).ListFeatureViewSyncs)], opts...)
it := &FeatureViewSyncIterator{}
req = proto.Clone(req).(*aiplatformpb.ListFeatureViewSyncsRequest)
it.InternalFetch = func(pageSize int, pageToken string) ([]*aiplatformpb.FeatureViewSync, string, error) {
resp := &aiplatformpb.ListFeatureViewSyncsResponse{}
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.featureOnlineStoreAdminClient.ListFeatureViewSyncs(ctx, req, settings.GRPC...)
return err
}, opts...)
if err != nil {
return nil, "", err
}
it.Response = resp
return resp.GetFeatureViewSyncs(), 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 *featureOnlineStoreAdminGRPCClient) GetLocation(ctx context.Context, req *locationpb.GetLocationRequest, opts ...gax.CallOption) (*locationpb.Location, error) {
hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
hds = append(c.xGoogHeaders, hds...)
ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
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 *featureOnlineStoreAdminGRPCClient) ListLocations(ctx context.Context, req *locationpb.ListLocationsRequest, opts ...gax.CallOption) *LocationIterator {
hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
hds = append(c.xGoogHeaders, hds...)
ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
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 *featureOnlineStoreAdminGRPCClient) GetIamPolicy(ctx context.Context, req *iampb.GetIamPolicyRequest, opts ...gax.CallOption) (*iampb.Policy, error) {
hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "resource", url.QueryEscape(req.GetResource()))}
hds = append(c.xGoogHeaders, hds...)
ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
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 *featureOnlineStoreAdminGRPCClient) SetIamPolicy(ctx context.Context, req *iampb.SetIamPolicyRequest, opts ...gax.CallOption) (*iampb.Policy, error) {
hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "resource", url.QueryEscape(req.GetResource()))}
hds = append(c.xGoogHeaders, hds...)
ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
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 *featureOnlineStoreAdminGRPCClient) TestIamPermissions(ctx context.Context, req *iampb.TestIamPermissionsRequest, opts ...gax.CallOption) (*iampb.TestIamPermissionsResponse, error) {
hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "resource", url.QueryEscape(req.GetResource()))}
hds = append(c.xGoogHeaders, hds...)
ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
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 *featureOnlineStoreAdminGRPCClient) CancelOperation(ctx context.Context, req *longrunningpb.CancelOperationRequest, opts ...gax.CallOption) error {
hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
hds = append(c.xGoogHeaders, hds...)
ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
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 *featureOnlineStoreAdminGRPCClient) DeleteOperation(ctx context.Context, req *longrunningpb.DeleteOperationRequest, opts ...gax.CallOption) error {
hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
hds = append(c.xGoogHeaders, hds...)
ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
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 *featureOnlineStoreAdminGRPCClient) GetOperation(ctx context.Context, req *longrunningpb.GetOperationRequest, opts ...gax.CallOption) (*longrunningpb.Operation, error) {
hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
hds = append(c.xGoogHeaders, hds...)
ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
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 *featureOnlineStoreAdminGRPCClient) ListOperations(ctx context.Context, req *longrunningpb.ListOperationsRequest, opts ...gax.CallOption) *OperationIterator {
hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
hds = append(c.xGoogHeaders, hds...)
ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
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 *featureOnlineStoreAdminGRPCClient) WaitOperation(ctx context.Context, req *longrunningpb.WaitOperationRequest, opts ...gax.CallOption) (*longrunningpb.Operation, error) {
hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
hds = append(c.xGoogHeaders, hds...)
ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
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
}
// CreateFeatureOnlineStoreOperation returns a new CreateFeatureOnlineStoreOperation from a given name.
// The name must be that of a previously created CreateFeatureOnlineStoreOperation, possibly from a different process.
func (c *featureOnlineStoreAdminGRPCClient) CreateFeatureOnlineStoreOperation(name string) *CreateFeatureOnlineStoreOperation {
return &CreateFeatureOnlineStoreOperation{
lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}),
}
}
// CreateFeatureViewOperation returns a new CreateFeatureViewOperation from a given name.
// The name must be that of a previously created CreateFeatureViewOperation, possibly from a different process.
func (c *featureOnlineStoreAdminGRPCClient) CreateFeatureViewOperation(name string) *CreateFeatureViewOperation {
return &CreateFeatureViewOperation{
lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}),
}
}
// DeleteFeatureOnlineStoreOperation returns a new DeleteFeatureOnlineStoreOperation from a given name.
// The name must be that of a previously created DeleteFeatureOnlineStoreOperation, possibly from a different process.
func (c *featureOnlineStoreAdminGRPCClient) DeleteFeatureOnlineStoreOperation(name string) *DeleteFeatureOnlineStoreOperation {
return &DeleteFeatureOnlineStoreOperation{
lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}),
}
}
// DeleteFeatureViewOperation returns a new DeleteFeatureViewOperation from a given name.
// The name must be that of a previously created DeleteFeatureViewOperation, possibly from a different process.
func (c *featureOnlineStoreAdminGRPCClient) DeleteFeatureViewOperation(name string) *DeleteFeatureViewOperation {
return &DeleteFeatureViewOperation{
lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}),
}
}
// UpdateFeatureOnlineStoreOperation returns a new UpdateFeatureOnlineStoreOperation from a given name.
// The name must be that of a previously created UpdateFeatureOnlineStoreOperation, possibly from a different process.
func (c *featureOnlineStoreAdminGRPCClient) UpdateFeatureOnlineStoreOperation(name string) *UpdateFeatureOnlineStoreOperation {
return &UpdateFeatureOnlineStoreOperation{
lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}),
}
}
// UpdateFeatureViewOperation returns a new UpdateFeatureViewOperation from a given name.
// The name must be that of a previously created UpdateFeatureViewOperation, possibly from a different process.
func (c *featureOnlineStoreAdminGRPCClient) UpdateFeatureViewOperation(name string) *UpdateFeatureViewOperation {
return &UpdateFeatureViewOperation{
lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}),
}
}