cloud.google.com/go/aiplatform@v1.106.0/apiv1/feature_online_store_admin_client.go (about) 1 // Copyright 2025 Google LLC 2 // 3 // Licensed under the Apache License, Version 2.0 (the "License"); 4 // you may not use this file except in compliance with the License. 5 // You may obtain a copy of the License at 6 // 7 // https://www.apache.org/licenses/LICENSE-2.0 8 // 9 // Unless required by applicable law or agreed to in writing, software 10 // distributed under the License is distributed on an "AS IS" BASIS, 11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 // See the License for the specific language governing permissions and 13 // limitations under the License. 14 15 // Code generated by protoc-gen-go_gapic. DO NOT EDIT. 16 17 package aiplatform 18 19 import ( 20 "context" 21 "fmt" 22 "log/slog" 23 "math" 24 "net/url" 25 26 aiplatformpb "cloud.google.com/go/aiplatform/apiv1/aiplatformpb" 27 iampb "cloud.google.com/go/iam/apiv1/iampb" 28 "cloud.google.com/go/longrunning" 29 lroauto "cloud.google.com/go/longrunning/autogen" 30 longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb" 31 gax "github.com/googleapis/gax-go/v2" 32 "google.golang.org/api/iterator" 33 "google.golang.org/api/option" 34 "google.golang.org/api/option/internaloption" 35 gtransport "google.golang.org/api/transport/grpc" 36 locationpb "google.golang.org/genproto/googleapis/cloud/location" 37 "google.golang.org/grpc" 38 "google.golang.org/protobuf/proto" 39 ) 40 41 var newFeatureOnlineStoreAdminClientHook clientHook 42 43 // FeatureOnlineStoreAdminCallOptions contains the retry settings for each method of FeatureOnlineStoreAdminClient. 44 type FeatureOnlineStoreAdminCallOptions struct { 45 CreateFeatureOnlineStore []gax.CallOption 46 GetFeatureOnlineStore []gax.CallOption 47 ListFeatureOnlineStores []gax.CallOption 48 UpdateFeatureOnlineStore []gax.CallOption 49 DeleteFeatureOnlineStore []gax.CallOption 50 CreateFeatureView []gax.CallOption 51 GetFeatureView []gax.CallOption 52 ListFeatureViews []gax.CallOption 53 UpdateFeatureView []gax.CallOption 54 DeleteFeatureView []gax.CallOption 55 SyncFeatureView []gax.CallOption 56 GetFeatureViewSync []gax.CallOption 57 ListFeatureViewSyncs []gax.CallOption 58 GetLocation []gax.CallOption 59 ListLocations []gax.CallOption 60 GetIamPolicy []gax.CallOption 61 SetIamPolicy []gax.CallOption 62 TestIamPermissions []gax.CallOption 63 CancelOperation []gax.CallOption 64 DeleteOperation []gax.CallOption 65 GetOperation []gax.CallOption 66 ListOperations []gax.CallOption 67 WaitOperation []gax.CallOption 68 } 69 70 func defaultFeatureOnlineStoreAdminGRPCClientOptions() []option.ClientOption { 71 return []option.ClientOption{ 72 internaloption.WithDefaultEndpoint("aiplatform.googleapis.com:443"), 73 internaloption.WithDefaultEndpointTemplate("aiplatform.UNIVERSE_DOMAIN:443"), 74 internaloption.WithDefaultMTLSEndpoint("aiplatform.mtls.googleapis.com:443"), 75 internaloption.WithDefaultUniverseDomain("googleapis.com"), 76 internaloption.WithDefaultAudience("https://aiplatform.googleapis.com/"), 77 internaloption.WithDefaultScopes(DefaultAuthScopes()...), 78 internaloption.EnableJwtWithScope(), 79 internaloption.EnableNewAuthLibrary(), 80 option.WithGRPCDialOption(grpc.WithDefaultCallOptions( 81 grpc.MaxCallRecvMsgSize(math.MaxInt32))), 82 } 83 } 84 85 func defaultFeatureOnlineStoreAdminCallOptions() *FeatureOnlineStoreAdminCallOptions { 86 return &FeatureOnlineStoreAdminCallOptions{ 87 CreateFeatureOnlineStore: []gax.CallOption{}, 88 GetFeatureOnlineStore: []gax.CallOption{}, 89 ListFeatureOnlineStores: []gax.CallOption{}, 90 UpdateFeatureOnlineStore: []gax.CallOption{}, 91 DeleteFeatureOnlineStore: []gax.CallOption{}, 92 CreateFeatureView: []gax.CallOption{}, 93 GetFeatureView: []gax.CallOption{}, 94 ListFeatureViews: []gax.CallOption{}, 95 UpdateFeatureView: []gax.CallOption{}, 96 DeleteFeatureView: []gax.CallOption{}, 97 SyncFeatureView: []gax.CallOption{}, 98 GetFeatureViewSync: []gax.CallOption{}, 99 ListFeatureViewSyncs: []gax.CallOption{}, 100 GetLocation: []gax.CallOption{}, 101 ListLocations: []gax.CallOption{}, 102 GetIamPolicy: []gax.CallOption{}, 103 SetIamPolicy: []gax.CallOption{}, 104 TestIamPermissions: []gax.CallOption{}, 105 CancelOperation: []gax.CallOption{}, 106 DeleteOperation: []gax.CallOption{}, 107 GetOperation: []gax.CallOption{}, 108 ListOperations: []gax.CallOption{}, 109 WaitOperation: []gax.CallOption{}, 110 } 111 } 112 113 // internalFeatureOnlineStoreAdminClient is an interface that defines the methods available from Vertex AI API. 114 type internalFeatureOnlineStoreAdminClient interface { 115 Close() error 116 setGoogleClientInfo(...string) 117 Connection() *grpc.ClientConn 118 CreateFeatureOnlineStore(context.Context, *aiplatformpb.CreateFeatureOnlineStoreRequest, ...gax.CallOption) (*CreateFeatureOnlineStoreOperation, error) 119 CreateFeatureOnlineStoreOperation(name string) *CreateFeatureOnlineStoreOperation 120 GetFeatureOnlineStore(context.Context, *aiplatformpb.GetFeatureOnlineStoreRequest, ...gax.CallOption) (*aiplatformpb.FeatureOnlineStore, error) 121 ListFeatureOnlineStores(context.Context, *aiplatformpb.ListFeatureOnlineStoresRequest, ...gax.CallOption) *FeatureOnlineStoreIterator 122 UpdateFeatureOnlineStore(context.Context, *aiplatformpb.UpdateFeatureOnlineStoreRequest, ...gax.CallOption) (*UpdateFeatureOnlineStoreOperation, error) 123 UpdateFeatureOnlineStoreOperation(name string) *UpdateFeatureOnlineStoreOperation 124 DeleteFeatureOnlineStore(context.Context, *aiplatformpb.DeleteFeatureOnlineStoreRequest, ...gax.CallOption) (*DeleteFeatureOnlineStoreOperation, error) 125 DeleteFeatureOnlineStoreOperation(name string) *DeleteFeatureOnlineStoreOperation 126 CreateFeatureView(context.Context, *aiplatformpb.CreateFeatureViewRequest, ...gax.CallOption) (*CreateFeatureViewOperation, error) 127 CreateFeatureViewOperation(name string) *CreateFeatureViewOperation 128 GetFeatureView(context.Context, *aiplatformpb.GetFeatureViewRequest, ...gax.CallOption) (*aiplatformpb.FeatureView, error) 129 ListFeatureViews(context.Context, *aiplatformpb.ListFeatureViewsRequest, ...gax.CallOption) *FeatureViewIterator 130 UpdateFeatureView(context.Context, *aiplatformpb.UpdateFeatureViewRequest, ...gax.CallOption) (*UpdateFeatureViewOperation, error) 131 UpdateFeatureViewOperation(name string) *UpdateFeatureViewOperation 132 DeleteFeatureView(context.Context, *aiplatformpb.DeleteFeatureViewRequest, ...gax.CallOption) (*DeleteFeatureViewOperation, error) 133 DeleteFeatureViewOperation(name string) *DeleteFeatureViewOperation 134 SyncFeatureView(context.Context, *aiplatformpb.SyncFeatureViewRequest, ...gax.CallOption) (*aiplatformpb.SyncFeatureViewResponse, error) 135 GetFeatureViewSync(context.Context, *aiplatformpb.GetFeatureViewSyncRequest, ...gax.CallOption) (*aiplatformpb.FeatureViewSync, error) 136 ListFeatureViewSyncs(context.Context, *aiplatformpb.ListFeatureViewSyncsRequest, ...gax.CallOption) *FeatureViewSyncIterator 137 GetLocation(context.Context, *locationpb.GetLocationRequest, ...gax.CallOption) (*locationpb.Location, error) 138 ListLocations(context.Context, *locationpb.ListLocationsRequest, ...gax.CallOption) *LocationIterator 139 GetIamPolicy(context.Context, *iampb.GetIamPolicyRequest, ...gax.CallOption) (*iampb.Policy, error) 140 SetIamPolicy(context.Context, *iampb.SetIamPolicyRequest, ...gax.CallOption) (*iampb.Policy, error) 141 TestIamPermissions(context.Context, *iampb.TestIamPermissionsRequest, ...gax.CallOption) (*iampb.TestIamPermissionsResponse, error) 142 CancelOperation(context.Context, *longrunningpb.CancelOperationRequest, ...gax.CallOption) error 143 DeleteOperation(context.Context, *longrunningpb.DeleteOperationRequest, ...gax.CallOption) error 144 GetOperation(context.Context, *longrunningpb.GetOperationRequest, ...gax.CallOption) (*longrunningpb.Operation, error) 145 ListOperations(context.Context, *longrunningpb.ListOperationsRequest, ...gax.CallOption) *OperationIterator 146 WaitOperation(context.Context, *longrunningpb.WaitOperationRequest, ...gax.CallOption) (*longrunningpb.Operation, error) 147 } 148 149 // FeatureOnlineStoreAdminClient is a client for interacting with Vertex AI API. 150 // Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls. 151 // 152 // The service that handles CRUD and List for resources for 153 // FeatureOnlineStore. 154 type FeatureOnlineStoreAdminClient struct { 155 // The internal transport-dependent client. 156 internalClient internalFeatureOnlineStoreAdminClient 157 158 // The call options for this service. 159 CallOptions *FeatureOnlineStoreAdminCallOptions 160 161 // LROClient is used internally to handle long-running operations. 162 // It is exposed so that its CallOptions can be modified if required. 163 // Users should not Close this client. 164 LROClient *lroauto.OperationsClient 165 } 166 167 // Wrapper methods routed to the internal client. 168 169 // Close closes the connection to the API service. The user should invoke this when 170 // the client is no longer required. 171 func (c *FeatureOnlineStoreAdminClient) Close() error { 172 return c.internalClient.Close() 173 } 174 175 // setGoogleClientInfo sets the name and version of the application in 176 // the `x-goog-api-client` header passed on each request. Intended for 177 // use by Google-written clients. 178 func (c *FeatureOnlineStoreAdminClient) setGoogleClientInfo(keyval ...string) { 179 c.internalClient.setGoogleClientInfo(keyval...) 180 } 181 182 // Connection returns a connection to the API service. 183 // 184 // Deprecated: Connections are now pooled so this method does not always 185 // return the same resource. 186 func (c *FeatureOnlineStoreAdminClient) Connection() *grpc.ClientConn { 187 return c.internalClient.Connection() 188 } 189 190 // CreateFeatureOnlineStore creates a new FeatureOnlineStore in a given project and location. 191 func (c *FeatureOnlineStoreAdminClient) CreateFeatureOnlineStore(ctx context.Context, req *aiplatformpb.CreateFeatureOnlineStoreRequest, opts ...gax.CallOption) (*CreateFeatureOnlineStoreOperation, error) { 192 return c.internalClient.CreateFeatureOnlineStore(ctx, req, opts...) 193 } 194 195 // CreateFeatureOnlineStoreOperation returns a new CreateFeatureOnlineStoreOperation from a given name. 196 // The name must be that of a previously created CreateFeatureOnlineStoreOperation, possibly from a different process. 197 func (c *FeatureOnlineStoreAdminClient) CreateFeatureOnlineStoreOperation(name string) *CreateFeatureOnlineStoreOperation { 198 return c.internalClient.CreateFeatureOnlineStoreOperation(name) 199 } 200 201 // GetFeatureOnlineStore gets details of a single FeatureOnlineStore. 202 func (c *FeatureOnlineStoreAdminClient) GetFeatureOnlineStore(ctx context.Context, req *aiplatformpb.GetFeatureOnlineStoreRequest, opts ...gax.CallOption) (*aiplatformpb.FeatureOnlineStore, error) { 203 return c.internalClient.GetFeatureOnlineStore(ctx, req, opts...) 204 } 205 206 // ListFeatureOnlineStores lists FeatureOnlineStores in a given project and location. 207 func (c *FeatureOnlineStoreAdminClient) ListFeatureOnlineStores(ctx context.Context, req *aiplatformpb.ListFeatureOnlineStoresRequest, opts ...gax.CallOption) *FeatureOnlineStoreIterator { 208 return c.internalClient.ListFeatureOnlineStores(ctx, req, opts...) 209 } 210 211 // UpdateFeatureOnlineStore updates the parameters of a single FeatureOnlineStore. 212 func (c *FeatureOnlineStoreAdminClient) UpdateFeatureOnlineStore(ctx context.Context, req *aiplatformpb.UpdateFeatureOnlineStoreRequest, opts ...gax.CallOption) (*UpdateFeatureOnlineStoreOperation, error) { 213 return c.internalClient.UpdateFeatureOnlineStore(ctx, req, opts...) 214 } 215 216 // UpdateFeatureOnlineStoreOperation returns a new UpdateFeatureOnlineStoreOperation from a given name. 217 // The name must be that of a previously created UpdateFeatureOnlineStoreOperation, possibly from a different process. 218 func (c *FeatureOnlineStoreAdminClient) UpdateFeatureOnlineStoreOperation(name string) *UpdateFeatureOnlineStoreOperation { 219 return c.internalClient.UpdateFeatureOnlineStoreOperation(name) 220 } 221 222 // DeleteFeatureOnlineStore deletes a single FeatureOnlineStore. The FeatureOnlineStore must not 223 // contain any FeatureViews. 224 func (c *FeatureOnlineStoreAdminClient) DeleteFeatureOnlineStore(ctx context.Context, req *aiplatformpb.DeleteFeatureOnlineStoreRequest, opts ...gax.CallOption) (*DeleteFeatureOnlineStoreOperation, error) { 225 return c.internalClient.DeleteFeatureOnlineStore(ctx, req, opts...) 226 } 227 228 // DeleteFeatureOnlineStoreOperation returns a new DeleteFeatureOnlineStoreOperation from a given name. 229 // The name must be that of a previously created DeleteFeatureOnlineStoreOperation, possibly from a different process. 230 func (c *FeatureOnlineStoreAdminClient) DeleteFeatureOnlineStoreOperation(name string) *DeleteFeatureOnlineStoreOperation { 231 return c.internalClient.DeleteFeatureOnlineStoreOperation(name) 232 } 233 234 // CreateFeatureView creates a new FeatureView in a given FeatureOnlineStore. 235 func (c *FeatureOnlineStoreAdminClient) CreateFeatureView(ctx context.Context, req *aiplatformpb.CreateFeatureViewRequest, opts ...gax.CallOption) (*CreateFeatureViewOperation, error) { 236 return c.internalClient.CreateFeatureView(ctx, req, opts...) 237 } 238 239 // CreateFeatureViewOperation returns a new CreateFeatureViewOperation from a given name. 240 // The name must be that of a previously created CreateFeatureViewOperation, possibly from a different process. 241 func (c *FeatureOnlineStoreAdminClient) CreateFeatureViewOperation(name string) *CreateFeatureViewOperation { 242 return c.internalClient.CreateFeatureViewOperation(name) 243 } 244 245 // GetFeatureView gets details of a single FeatureView. 246 func (c *FeatureOnlineStoreAdminClient) GetFeatureView(ctx context.Context, req *aiplatformpb.GetFeatureViewRequest, opts ...gax.CallOption) (*aiplatformpb.FeatureView, error) { 247 return c.internalClient.GetFeatureView(ctx, req, opts...) 248 } 249 250 // ListFeatureViews lists FeatureViews in a given FeatureOnlineStore. 251 func (c *FeatureOnlineStoreAdminClient) ListFeatureViews(ctx context.Context, req *aiplatformpb.ListFeatureViewsRequest, opts ...gax.CallOption) *FeatureViewIterator { 252 return c.internalClient.ListFeatureViews(ctx, req, opts...) 253 } 254 255 // UpdateFeatureView updates the parameters of a single FeatureView. 256 func (c *FeatureOnlineStoreAdminClient) UpdateFeatureView(ctx context.Context, req *aiplatformpb.UpdateFeatureViewRequest, opts ...gax.CallOption) (*UpdateFeatureViewOperation, error) { 257 return c.internalClient.UpdateFeatureView(ctx, req, opts...) 258 } 259 260 // UpdateFeatureViewOperation returns a new UpdateFeatureViewOperation from a given name. 261 // The name must be that of a previously created UpdateFeatureViewOperation, possibly from a different process. 262 func (c *FeatureOnlineStoreAdminClient) UpdateFeatureViewOperation(name string) *UpdateFeatureViewOperation { 263 return c.internalClient.UpdateFeatureViewOperation(name) 264 } 265 266 // DeleteFeatureView deletes a single FeatureView. 267 func (c *FeatureOnlineStoreAdminClient) DeleteFeatureView(ctx context.Context, req *aiplatformpb.DeleteFeatureViewRequest, opts ...gax.CallOption) (*DeleteFeatureViewOperation, error) { 268 return c.internalClient.DeleteFeatureView(ctx, req, opts...) 269 } 270 271 // DeleteFeatureViewOperation returns a new DeleteFeatureViewOperation from a given name. 272 // The name must be that of a previously created DeleteFeatureViewOperation, possibly from a different process. 273 func (c *FeatureOnlineStoreAdminClient) DeleteFeatureViewOperation(name string) *DeleteFeatureViewOperation { 274 return c.internalClient.DeleteFeatureViewOperation(name) 275 } 276 277 // SyncFeatureView triggers on-demand sync for the FeatureView. 278 func (c *FeatureOnlineStoreAdminClient) SyncFeatureView(ctx context.Context, req *aiplatformpb.SyncFeatureViewRequest, opts ...gax.CallOption) (*aiplatformpb.SyncFeatureViewResponse, error) { 279 return c.internalClient.SyncFeatureView(ctx, req, opts...) 280 } 281 282 // GetFeatureViewSync gets details of a single FeatureViewSync. 283 func (c *FeatureOnlineStoreAdminClient) GetFeatureViewSync(ctx context.Context, req *aiplatformpb.GetFeatureViewSyncRequest, opts ...gax.CallOption) (*aiplatformpb.FeatureViewSync, error) { 284 return c.internalClient.GetFeatureViewSync(ctx, req, opts...) 285 } 286 287 // ListFeatureViewSyncs lists FeatureViewSyncs in a given FeatureView. 288 func (c *FeatureOnlineStoreAdminClient) ListFeatureViewSyncs(ctx context.Context, req *aiplatformpb.ListFeatureViewSyncsRequest, opts ...gax.CallOption) *FeatureViewSyncIterator { 289 return c.internalClient.ListFeatureViewSyncs(ctx, req, opts...) 290 } 291 292 // GetLocation gets information about a location. 293 func (c *FeatureOnlineStoreAdminClient) GetLocation(ctx context.Context, req *locationpb.GetLocationRequest, opts ...gax.CallOption) (*locationpb.Location, error) { 294 return c.internalClient.GetLocation(ctx, req, opts...) 295 } 296 297 // ListLocations lists information about the supported locations for this service. 298 func (c *FeatureOnlineStoreAdminClient) ListLocations(ctx context.Context, req *locationpb.ListLocationsRequest, opts ...gax.CallOption) *LocationIterator { 299 return c.internalClient.ListLocations(ctx, req, opts...) 300 } 301 302 // GetIamPolicy gets the access control policy for a resource. Returns an empty policy 303 // if the resource exists and does not have a policy set. 304 func (c *FeatureOnlineStoreAdminClient) GetIamPolicy(ctx context.Context, req *iampb.GetIamPolicyRequest, opts ...gax.CallOption) (*iampb.Policy, error) { 305 return c.internalClient.GetIamPolicy(ctx, req, opts...) 306 } 307 308 // SetIamPolicy sets the access control policy on the specified resource. Replaces 309 // any existing policy. 310 // 311 // Can return NOT_FOUND, INVALID_ARGUMENT, and PERMISSION_DENIED 312 // errors. 313 func (c *FeatureOnlineStoreAdminClient) SetIamPolicy(ctx context.Context, req *iampb.SetIamPolicyRequest, opts ...gax.CallOption) (*iampb.Policy, error) { 314 return c.internalClient.SetIamPolicy(ctx, req, opts...) 315 } 316 317 // TestIamPermissions returns permissions that a caller has on the specified resource. If the 318 // resource does not exist, this will return an empty set of 319 // permissions, not a NOT_FOUND error. 320 // 321 // Note: This operation is designed to be used for building 322 // permission-aware UIs and command-line tools, not for authorization 323 // checking. This operation may “fail open” without warning. 324 func (c *FeatureOnlineStoreAdminClient) TestIamPermissions(ctx context.Context, req *iampb.TestIamPermissionsRequest, opts ...gax.CallOption) (*iampb.TestIamPermissionsResponse, error) { 325 return c.internalClient.TestIamPermissions(ctx, req, opts...) 326 } 327 328 // CancelOperation is a utility method from google.longrunning.Operations. 329 func (c *FeatureOnlineStoreAdminClient) CancelOperation(ctx context.Context, req *longrunningpb.CancelOperationRequest, opts ...gax.CallOption) error { 330 return c.internalClient.CancelOperation(ctx, req, opts...) 331 } 332 333 // DeleteOperation is a utility method from google.longrunning.Operations. 334 func (c *FeatureOnlineStoreAdminClient) DeleteOperation(ctx context.Context, req *longrunningpb.DeleteOperationRequest, opts ...gax.CallOption) error { 335 return c.internalClient.DeleteOperation(ctx, req, opts...) 336 } 337 338 // GetOperation is a utility method from google.longrunning.Operations. 339 func (c *FeatureOnlineStoreAdminClient) GetOperation(ctx context.Context, req *longrunningpb.GetOperationRequest, opts ...gax.CallOption) (*longrunningpb.Operation, error) { 340 return c.internalClient.GetOperation(ctx, req, opts...) 341 } 342 343 // ListOperations is a utility method from google.longrunning.Operations. 344 func (c *FeatureOnlineStoreAdminClient) ListOperations(ctx context.Context, req *longrunningpb.ListOperationsRequest, opts ...gax.CallOption) *OperationIterator { 345 return c.internalClient.ListOperations(ctx, req, opts...) 346 } 347 348 // WaitOperation is a utility method from google.longrunning.Operations. 349 func (c *FeatureOnlineStoreAdminClient) WaitOperation(ctx context.Context, req *longrunningpb.WaitOperationRequest, opts ...gax.CallOption) (*longrunningpb.Operation, error) { 350 return c.internalClient.WaitOperation(ctx, req, opts...) 351 } 352 353 // featureOnlineStoreAdminGRPCClient is a client for interacting with Vertex AI API over gRPC transport. 354 // 355 // Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls. 356 type featureOnlineStoreAdminGRPCClient struct { 357 // Connection pool of gRPC connections to the service. 358 connPool gtransport.ConnPool 359 360 // Points back to the CallOptions field of the containing FeatureOnlineStoreAdminClient 361 CallOptions **FeatureOnlineStoreAdminCallOptions 362 363 // The gRPC API client. 364 featureOnlineStoreAdminClient aiplatformpb.FeatureOnlineStoreAdminServiceClient 365 366 // LROClient is used internally to handle long-running operations. 367 // It is exposed so that its CallOptions can be modified if required. 368 // Users should not Close this client. 369 LROClient **lroauto.OperationsClient 370 371 operationsClient longrunningpb.OperationsClient 372 373 iamPolicyClient iampb.IAMPolicyClient 374 375 locationsClient locationpb.LocationsClient 376 377 // The x-goog-* metadata to be sent with each request. 378 xGoogHeaders []string 379 380 logger *slog.Logger 381 } 382 383 // NewFeatureOnlineStoreAdminClient creates a new feature online store admin service client based on gRPC. 384 // The returned client must be Closed when it is done being used to clean up its underlying connections. 385 // 386 // The service that handles CRUD and List for resources for 387 // FeatureOnlineStore. 388 func NewFeatureOnlineStoreAdminClient(ctx context.Context, opts ...option.ClientOption) (*FeatureOnlineStoreAdminClient, error) { 389 clientOpts := defaultFeatureOnlineStoreAdminGRPCClientOptions() 390 if newFeatureOnlineStoreAdminClientHook != nil { 391 hookOpts, err := newFeatureOnlineStoreAdminClientHook(ctx, clientHookParams{}) 392 if err != nil { 393 return nil, err 394 } 395 clientOpts = append(clientOpts, hookOpts...) 396 } 397 398 connPool, err := gtransport.DialPool(ctx, append(clientOpts, opts...)...) 399 if err != nil { 400 return nil, err 401 } 402 client := FeatureOnlineStoreAdminClient{CallOptions: defaultFeatureOnlineStoreAdminCallOptions()} 403 404 c := &featureOnlineStoreAdminGRPCClient{ 405 connPool: connPool, 406 featureOnlineStoreAdminClient: aiplatformpb.NewFeatureOnlineStoreAdminServiceClient(connPool), 407 CallOptions: &client.CallOptions, 408 logger: internaloption.GetLogger(opts), 409 operationsClient: longrunningpb.NewOperationsClient(connPool), 410 iamPolicyClient: iampb.NewIAMPolicyClient(connPool), 411 locationsClient: locationpb.NewLocationsClient(connPool), 412 } 413 c.setGoogleClientInfo() 414 415 client.internalClient = c 416 417 client.LROClient, err = lroauto.NewOperationsClient(ctx, gtransport.WithConnPool(connPool)) 418 if err != nil { 419 // This error "should not happen", since we are just reusing old connection pool 420 // and never actually need to dial. 421 // If this does happen, we could leak connp. However, we cannot close conn: 422 // If the user invoked the constructor with option.WithGRPCConn, 423 // we would close a connection that's still in use. 424 // TODO: investigate error conditions. 425 return nil, err 426 } 427 c.LROClient = &client.LROClient 428 return &client, nil 429 } 430 431 // Connection returns a connection to the API service. 432 // 433 // Deprecated: Connections are now pooled so this method does not always 434 // return the same resource. 435 func (c *featureOnlineStoreAdminGRPCClient) Connection() *grpc.ClientConn { 436 return c.connPool.Conn() 437 } 438 439 // setGoogleClientInfo sets the name and version of the application in 440 // the `x-goog-api-client` header passed on each request. Intended for 441 // use by Google-written clients. 442 func (c *featureOnlineStoreAdminGRPCClient) setGoogleClientInfo(keyval ...string) { 443 kv := append([]string{"gl-go", gax.GoVersion}, keyval...) 444 kv = append(kv, "gapic", getVersionClient(), "gax", gax.Version, "grpc", grpc.Version, "pb", protoVersion) 445 c.xGoogHeaders = []string{ 446 "x-goog-api-client", gax.XGoogHeader(kv...), 447 } 448 } 449 450 // Close closes the connection to the API service. The user should invoke this when 451 // the client is no longer required. 452 func (c *featureOnlineStoreAdminGRPCClient) Close() error { 453 return c.connPool.Close() 454 } 455 456 func (c *featureOnlineStoreAdminGRPCClient) CreateFeatureOnlineStore(ctx context.Context, req *aiplatformpb.CreateFeatureOnlineStoreRequest, opts ...gax.CallOption) (*CreateFeatureOnlineStoreOperation, error) { 457 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))} 458 459 hds = append(c.xGoogHeaders, hds...) 460 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) 461 opts = append((*c.CallOptions).CreateFeatureOnlineStore[0:len((*c.CallOptions).CreateFeatureOnlineStore):len((*c.CallOptions).CreateFeatureOnlineStore)], opts...) 462 var resp *longrunningpb.Operation 463 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { 464 var err error 465 resp, err = executeRPC(ctx, c.featureOnlineStoreAdminClient.CreateFeatureOnlineStore, req, settings.GRPC, c.logger, "CreateFeatureOnlineStore") 466 return err 467 }, opts...) 468 if err != nil { 469 return nil, err 470 } 471 return &CreateFeatureOnlineStoreOperation{ 472 lro: longrunning.InternalNewOperation(*c.LROClient, resp), 473 }, nil 474 } 475 476 func (c *featureOnlineStoreAdminGRPCClient) GetFeatureOnlineStore(ctx context.Context, req *aiplatformpb.GetFeatureOnlineStoreRequest, opts ...gax.CallOption) (*aiplatformpb.FeatureOnlineStore, error) { 477 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))} 478 479 hds = append(c.xGoogHeaders, hds...) 480 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) 481 opts = append((*c.CallOptions).GetFeatureOnlineStore[0:len((*c.CallOptions).GetFeatureOnlineStore):len((*c.CallOptions).GetFeatureOnlineStore)], opts...) 482 var resp *aiplatformpb.FeatureOnlineStore 483 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { 484 var err error 485 resp, err = executeRPC(ctx, c.featureOnlineStoreAdminClient.GetFeatureOnlineStore, req, settings.GRPC, c.logger, "GetFeatureOnlineStore") 486 return err 487 }, opts...) 488 if err != nil { 489 return nil, err 490 } 491 return resp, nil 492 } 493 494 func (c *featureOnlineStoreAdminGRPCClient) ListFeatureOnlineStores(ctx context.Context, req *aiplatformpb.ListFeatureOnlineStoresRequest, opts ...gax.CallOption) *FeatureOnlineStoreIterator { 495 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))} 496 497 hds = append(c.xGoogHeaders, hds...) 498 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) 499 opts = append((*c.CallOptions).ListFeatureOnlineStores[0:len((*c.CallOptions).ListFeatureOnlineStores):len((*c.CallOptions).ListFeatureOnlineStores)], opts...) 500 it := &FeatureOnlineStoreIterator{} 501 req = proto.Clone(req).(*aiplatformpb.ListFeatureOnlineStoresRequest) 502 it.InternalFetch = func(pageSize int, pageToken string) ([]*aiplatformpb.FeatureOnlineStore, string, error) { 503 resp := &aiplatformpb.ListFeatureOnlineStoresResponse{} 504 if pageToken != "" { 505 req.PageToken = pageToken 506 } 507 if pageSize > math.MaxInt32 { 508 req.PageSize = math.MaxInt32 509 } else if pageSize != 0 { 510 req.PageSize = int32(pageSize) 511 } 512 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { 513 var err error 514 resp, err = executeRPC(ctx, c.featureOnlineStoreAdminClient.ListFeatureOnlineStores, req, settings.GRPC, c.logger, "ListFeatureOnlineStores") 515 return err 516 }, opts...) 517 if err != nil { 518 return nil, "", err 519 } 520 521 it.Response = resp 522 return resp.GetFeatureOnlineStores(), resp.GetNextPageToken(), nil 523 } 524 fetch := func(pageSize int, pageToken string) (string, error) { 525 items, nextPageToken, err := it.InternalFetch(pageSize, pageToken) 526 if err != nil { 527 return "", err 528 } 529 it.items = append(it.items, items...) 530 return nextPageToken, nil 531 } 532 533 it.pageInfo, it.nextFunc = iterator.NewPageInfo(fetch, it.bufLen, it.takeBuf) 534 it.pageInfo.MaxSize = int(req.GetPageSize()) 535 it.pageInfo.Token = req.GetPageToken() 536 537 return it 538 } 539 540 func (c *featureOnlineStoreAdminGRPCClient) UpdateFeatureOnlineStore(ctx context.Context, req *aiplatformpb.UpdateFeatureOnlineStoreRequest, opts ...gax.CallOption) (*UpdateFeatureOnlineStoreOperation, error) { 541 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "feature_online_store.name", url.QueryEscape(req.GetFeatureOnlineStore().GetName()))} 542 543 hds = append(c.xGoogHeaders, hds...) 544 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) 545 opts = append((*c.CallOptions).UpdateFeatureOnlineStore[0:len((*c.CallOptions).UpdateFeatureOnlineStore):len((*c.CallOptions).UpdateFeatureOnlineStore)], opts...) 546 var resp *longrunningpb.Operation 547 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { 548 var err error 549 resp, err = executeRPC(ctx, c.featureOnlineStoreAdminClient.UpdateFeatureOnlineStore, req, settings.GRPC, c.logger, "UpdateFeatureOnlineStore") 550 return err 551 }, opts...) 552 if err != nil { 553 return nil, err 554 } 555 return &UpdateFeatureOnlineStoreOperation{ 556 lro: longrunning.InternalNewOperation(*c.LROClient, resp), 557 }, nil 558 } 559 560 func (c *featureOnlineStoreAdminGRPCClient) DeleteFeatureOnlineStore(ctx context.Context, req *aiplatformpb.DeleteFeatureOnlineStoreRequest, opts ...gax.CallOption) (*DeleteFeatureOnlineStoreOperation, error) { 561 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))} 562 563 hds = append(c.xGoogHeaders, hds...) 564 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) 565 opts = append((*c.CallOptions).DeleteFeatureOnlineStore[0:len((*c.CallOptions).DeleteFeatureOnlineStore):len((*c.CallOptions).DeleteFeatureOnlineStore)], opts...) 566 var resp *longrunningpb.Operation 567 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { 568 var err error 569 resp, err = executeRPC(ctx, c.featureOnlineStoreAdminClient.DeleteFeatureOnlineStore, req, settings.GRPC, c.logger, "DeleteFeatureOnlineStore") 570 return err 571 }, opts...) 572 if err != nil { 573 return nil, err 574 } 575 return &DeleteFeatureOnlineStoreOperation{ 576 lro: longrunning.InternalNewOperation(*c.LROClient, resp), 577 }, nil 578 } 579 580 func (c *featureOnlineStoreAdminGRPCClient) CreateFeatureView(ctx context.Context, req *aiplatformpb.CreateFeatureViewRequest, opts ...gax.CallOption) (*CreateFeatureViewOperation, error) { 581 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))} 582 583 hds = append(c.xGoogHeaders, hds...) 584 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) 585 opts = append((*c.CallOptions).CreateFeatureView[0:len((*c.CallOptions).CreateFeatureView):len((*c.CallOptions).CreateFeatureView)], opts...) 586 var resp *longrunningpb.Operation 587 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { 588 var err error 589 resp, err = executeRPC(ctx, c.featureOnlineStoreAdminClient.CreateFeatureView, req, settings.GRPC, c.logger, "CreateFeatureView") 590 return err 591 }, opts...) 592 if err != nil { 593 return nil, err 594 } 595 return &CreateFeatureViewOperation{ 596 lro: longrunning.InternalNewOperation(*c.LROClient, resp), 597 }, nil 598 } 599 600 func (c *featureOnlineStoreAdminGRPCClient) GetFeatureView(ctx context.Context, req *aiplatformpb.GetFeatureViewRequest, opts ...gax.CallOption) (*aiplatformpb.FeatureView, error) { 601 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))} 602 603 hds = append(c.xGoogHeaders, hds...) 604 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) 605 opts = append((*c.CallOptions).GetFeatureView[0:len((*c.CallOptions).GetFeatureView):len((*c.CallOptions).GetFeatureView)], opts...) 606 var resp *aiplatformpb.FeatureView 607 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { 608 var err error 609 resp, err = executeRPC(ctx, c.featureOnlineStoreAdminClient.GetFeatureView, req, settings.GRPC, c.logger, "GetFeatureView") 610 return err 611 }, opts...) 612 if err != nil { 613 return nil, err 614 } 615 return resp, nil 616 } 617 618 func (c *featureOnlineStoreAdminGRPCClient) ListFeatureViews(ctx context.Context, req *aiplatformpb.ListFeatureViewsRequest, opts ...gax.CallOption) *FeatureViewIterator { 619 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))} 620 621 hds = append(c.xGoogHeaders, hds...) 622 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) 623 opts = append((*c.CallOptions).ListFeatureViews[0:len((*c.CallOptions).ListFeatureViews):len((*c.CallOptions).ListFeatureViews)], opts...) 624 it := &FeatureViewIterator{} 625 req = proto.Clone(req).(*aiplatformpb.ListFeatureViewsRequest) 626 it.InternalFetch = func(pageSize int, pageToken string) ([]*aiplatformpb.FeatureView, string, error) { 627 resp := &aiplatformpb.ListFeatureViewsResponse{} 628 if pageToken != "" { 629 req.PageToken = pageToken 630 } 631 if pageSize > math.MaxInt32 { 632 req.PageSize = math.MaxInt32 633 } else if pageSize != 0 { 634 req.PageSize = int32(pageSize) 635 } 636 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { 637 var err error 638 resp, err = executeRPC(ctx, c.featureOnlineStoreAdminClient.ListFeatureViews, req, settings.GRPC, c.logger, "ListFeatureViews") 639 return err 640 }, opts...) 641 if err != nil { 642 return nil, "", err 643 } 644 645 it.Response = resp 646 return resp.GetFeatureViews(), resp.GetNextPageToken(), nil 647 } 648 fetch := func(pageSize int, pageToken string) (string, error) { 649 items, nextPageToken, err := it.InternalFetch(pageSize, pageToken) 650 if err != nil { 651 return "", err 652 } 653 it.items = append(it.items, items...) 654 return nextPageToken, nil 655 } 656 657 it.pageInfo, it.nextFunc = iterator.NewPageInfo(fetch, it.bufLen, it.takeBuf) 658 it.pageInfo.MaxSize = int(req.GetPageSize()) 659 it.pageInfo.Token = req.GetPageToken() 660 661 return it 662 } 663 664 func (c *featureOnlineStoreAdminGRPCClient) UpdateFeatureView(ctx context.Context, req *aiplatformpb.UpdateFeatureViewRequest, opts ...gax.CallOption) (*UpdateFeatureViewOperation, error) { 665 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "feature_view.name", url.QueryEscape(req.GetFeatureView().GetName()))} 666 667 hds = append(c.xGoogHeaders, hds...) 668 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) 669 opts = append((*c.CallOptions).UpdateFeatureView[0:len((*c.CallOptions).UpdateFeatureView):len((*c.CallOptions).UpdateFeatureView)], opts...) 670 var resp *longrunningpb.Operation 671 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { 672 var err error 673 resp, err = executeRPC(ctx, c.featureOnlineStoreAdminClient.UpdateFeatureView, req, settings.GRPC, c.logger, "UpdateFeatureView") 674 return err 675 }, opts...) 676 if err != nil { 677 return nil, err 678 } 679 return &UpdateFeatureViewOperation{ 680 lro: longrunning.InternalNewOperation(*c.LROClient, resp), 681 }, nil 682 } 683 684 func (c *featureOnlineStoreAdminGRPCClient) DeleteFeatureView(ctx context.Context, req *aiplatformpb.DeleteFeatureViewRequest, opts ...gax.CallOption) (*DeleteFeatureViewOperation, error) { 685 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))} 686 687 hds = append(c.xGoogHeaders, hds...) 688 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) 689 opts = append((*c.CallOptions).DeleteFeatureView[0:len((*c.CallOptions).DeleteFeatureView):len((*c.CallOptions).DeleteFeatureView)], opts...) 690 var resp *longrunningpb.Operation 691 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { 692 var err error 693 resp, err = executeRPC(ctx, c.featureOnlineStoreAdminClient.DeleteFeatureView, req, settings.GRPC, c.logger, "DeleteFeatureView") 694 return err 695 }, opts...) 696 if err != nil { 697 return nil, err 698 } 699 return &DeleteFeatureViewOperation{ 700 lro: longrunning.InternalNewOperation(*c.LROClient, resp), 701 }, nil 702 } 703 704 func (c *featureOnlineStoreAdminGRPCClient) SyncFeatureView(ctx context.Context, req *aiplatformpb.SyncFeatureViewRequest, opts ...gax.CallOption) (*aiplatformpb.SyncFeatureViewResponse, error) { 705 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "feature_view", url.QueryEscape(req.GetFeatureView()))} 706 707 hds = append(c.xGoogHeaders, hds...) 708 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) 709 opts = append((*c.CallOptions).SyncFeatureView[0:len((*c.CallOptions).SyncFeatureView):len((*c.CallOptions).SyncFeatureView)], opts...) 710 var resp *aiplatformpb.SyncFeatureViewResponse 711 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { 712 var err error 713 resp, err = executeRPC(ctx, c.featureOnlineStoreAdminClient.SyncFeatureView, req, settings.GRPC, c.logger, "SyncFeatureView") 714 return err 715 }, opts...) 716 if err != nil { 717 return nil, err 718 } 719 return resp, nil 720 } 721 722 func (c *featureOnlineStoreAdminGRPCClient) GetFeatureViewSync(ctx context.Context, req *aiplatformpb.GetFeatureViewSyncRequest, opts ...gax.CallOption) (*aiplatformpb.FeatureViewSync, error) { 723 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))} 724 725 hds = append(c.xGoogHeaders, hds...) 726 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) 727 opts = append((*c.CallOptions).GetFeatureViewSync[0:len((*c.CallOptions).GetFeatureViewSync):len((*c.CallOptions).GetFeatureViewSync)], opts...) 728 var resp *aiplatformpb.FeatureViewSync 729 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { 730 var err error 731 resp, err = executeRPC(ctx, c.featureOnlineStoreAdminClient.GetFeatureViewSync, req, settings.GRPC, c.logger, "GetFeatureViewSync") 732 return err 733 }, opts...) 734 if err != nil { 735 return nil, err 736 } 737 return resp, nil 738 } 739 740 func (c *featureOnlineStoreAdminGRPCClient) ListFeatureViewSyncs(ctx context.Context, req *aiplatformpb.ListFeatureViewSyncsRequest, opts ...gax.CallOption) *FeatureViewSyncIterator { 741 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))} 742 743 hds = append(c.xGoogHeaders, hds...) 744 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) 745 opts = append((*c.CallOptions).ListFeatureViewSyncs[0:len((*c.CallOptions).ListFeatureViewSyncs):len((*c.CallOptions).ListFeatureViewSyncs)], opts...) 746 it := &FeatureViewSyncIterator{} 747 req = proto.Clone(req).(*aiplatformpb.ListFeatureViewSyncsRequest) 748 it.InternalFetch = func(pageSize int, pageToken string) ([]*aiplatformpb.FeatureViewSync, string, error) { 749 resp := &aiplatformpb.ListFeatureViewSyncsResponse{} 750 if pageToken != "" { 751 req.PageToken = pageToken 752 } 753 if pageSize > math.MaxInt32 { 754 req.PageSize = math.MaxInt32 755 } else if pageSize != 0 { 756 req.PageSize = int32(pageSize) 757 } 758 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { 759 var err error 760 resp, err = executeRPC(ctx, c.featureOnlineStoreAdminClient.ListFeatureViewSyncs, req, settings.GRPC, c.logger, "ListFeatureViewSyncs") 761 return err 762 }, opts...) 763 if err != nil { 764 return nil, "", err 765 } 766 767 it.Response = resp 768 return resp.GetFeatureViewSyncs(), resp.GetNextPageToken(), nil 769 } 770 fetch := func(pageSize int, pageToken string) (string, error) { 771 items, nextPageToken, err := it.InternalFetch(pageSize, pageToken) 772 if err != nil { 773 return "", err 774 } 775 it.items = append(it.items, items...) 776 return nextPageToken, nil 777 } 778 779 it.pageInfo, it.nextFunc = iterator.NewPageInfo(fetch, it.bufLen, it.takeBuf) 780 it.pageInfo.MaxSize = int(req.GetPageSize()) 781 it.pageInfo.Token = req.GetPageToken() 782 783 return it 784 } 785 786 func (c *featureOnlineStoreAdminGRPCClient) GetLocation(ctx context.Context, req *locationpb.GetLocationRequest, opts ...gax.CallOption) (*locationpb.Location, error) { 787 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))} 788 789 hds = append(c.xGoogHeaders, hds...) 790 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) 791 opts = append((*c.CallOptions).GetLocation[0:len((*c.CallOptions).GetLocation):len((*c.CallOptions).GetLocation)], opts...) 792 var resp *locationpb.Location 793 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { 794 var err error 795 resp, err = executeRPC(ctx, c.locationsClient.GetLocation, req, settings.GRPC, c.logger, "GetLocation") 796 return err 797 }, opts...) 798 if err != nil { 799 return nil, err 800 } 801 return resp, nil 802 } 803 804 func (c *featureOnlineStoreAdminGRPCClient) ListLocations(ctx context.Context, req *locationpb.ListLocationsRequest, opts ...gax.CallOption) *LocationIterator { 805 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))} 806 807 hds = append(c.xGoogHeaders, hds...) 808 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) 809 opts = append((*c.CallOptions).ListLocations[0:len((*c.CallOptions).ListLocations):len((*c.CallOptions).ListLocations)], opts...) 810 it := &LocationIterator{} 811 req = proto.Clone(req).(*locationpb.ListLocationsRequest) 812 it.InternalFetch = func(pageSize int, pageToken string) ([]*locationpb.Location, string, error) { 813 resp := &locationpb.ListLocationsResponse{} 814 if pageToken != "" { 815 req.PageToken = pageToken 816 } 817 if pageSize > math.MaxInt32 { 818 req.PageSize = math.MaxInt32 819 } else if pageSize != 0 { 820 req.PageSize = int32(pageSize) 821 } 822 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { 823 var err error 824 resp, err = executeRPC(ctx, c.locationsClient.ListLocations, req, settings.GRPC, c.logger, "ListLocations") 825 return err 826 }, opts...) 827 if err != nil { 828 return nil, "", err 829 } 830 831 it.Response = resp 832 return resp.GetLocations(), resp.GetNextPageToken(), nil 833 } 834 fetch := func(pageSize int, pageToken string) (string, error) { 835 items, nextPageToken, err := it.InternalFetch(pageSize, pageToken) 836 if err != nil { 837 return "", err 838 } 839 it.items = append(it.items, items...) 840 return nextPageToken, nil 841 } 842 843 it.pageInfo, it.nextFunc = iterator.NewPageInfo(fetch, it.bufLen, it.takeBuf) 844 it.pageInfo.MaxSize = int(req.GetPageSize()) 845 it.pageInfo.Token = req.GetPageToken() 846 847 return it 848 } 849 850 func (c *featureOnlineStoreAdminGRPCClient) GetIamPolicy(ctx context.Context, req *iampb.GetIamPolicyRequest, opts ...gax.CallOption) (*iampb.Policy, error) { 851 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "resource", url.QueryEscape(req.GetResource()))} 852 853 hds = append(c.xGoogHeaders, hds...) 854 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) 855 opts = append((*c.CallOptions).GetIamPolicy[0:len((*c.CallOptions).GetIamPolicy):len((*c.CallOptions).GetIamPolicy)], opts...) 856 var resp *iampb.Policy 857 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { 858 var err error 859 resp, err = executeRPC(ctx, c.iamPolicyClient.GetIamPolicy, req, settings.GRPC, c.logger, "GetIamPolicy") 860 return err 861 }, opts...) 862 if err != nil { 863 return nil, err 864 } 865 return resp, nil 866 } 867 868 func (c *featureOnlineStoreAdminGRPCClient) SetIamPolicy(ctx context.Context, req *iampb.SetIamPolicyRequest, opts ...gax.CallOption) (*iampb.Policy, error) { 869 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "resource", url.QueryEscape(req.GetResource()))} 870 871 hds = append(c.xGoogHeaders, hds...) 872 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) 873 opts = append((*c.CallOptions).SetIamPolicy[0:len((*c.CallOptions).SetIamPolicy):len((*c.CallOptions).SetIamPolicy)], opts...) 874 var resp *iampb.Policy 875 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { 876 var err error 877 resp, err = executeRPC(ctx, c.iamPolicyClient.SetIamPolicy, req, settings.GRPC, c.logger, "SetIamPolicy") 878 return err 879 }, opts...) 880 if err != nil { 881 return nil, err 882 } 883 return resp, nil 884 } 885 886 func (c *featureOnlineStoreAdminGRPCClient) TestIamPermissions(ctx context.Context, req *iampb.TestIamPermissionsRequest, opts ...gax.CallOption) (*iampb.TestIamPermissionsResponse, error) { 887 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "resource", url.QueryEscape(req.GetResource()))} 888 889 hds = append(c.xGoogHeaders, hds...) 890 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) 891 opts = append((*c.CallOptions).TestIamPermissions[0:len((*c.CallOptions).TestIamPermissions):len((*c.CallOptions).TestIamPermissions)], opts...) 892 var resp *iampb.TestIamPermissionsResponse 893 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { 894 var err error 895 resp, err = executeRPC(ctx, c.iamPolicyClient.TestIamPermissions, req, settings.GRPC, c.logger, "TestIamPermissions") 896 return err 897 }, opts...) 898 if err != nil { 899 return nil, err 900 } 901 return resp, nil 902 } 903 904 func (c *featureOnlineStoreAdminGRPCClient) CancelOperation(ctx context.Context, req *longrunningpb.CancelOperationRequest, opts ...gax.CallOption) error { 905 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))} 906 907 hds = append(c.xGoogHeaders, hds...) 908 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) 909 opts = append((*c.CallOptions).CancelOperation[0:len((*c.CallOptions).CancelOperation):len((*c.CallOptions).CancelOperation)], opts...) 910 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { 911 var err error 912 _, err = executeRPC(ctx, c.operationsClient.CancelOperation, req, settings.GRPC, c.logger, "CancelOperation") 913 return err 914 }, opts...) 915 return err 916 } 917 918 func (c *featureOnlineStoreAdminGRPCClient) DeleteOperation(ctx context.Context, req *longrunningpb.DeleteOperationRequest, opts ...gax.CallOption) error { 919 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))} 920 921 hds = append(c.xGoogHeaders, hds...) 922 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) 923 opts = append((*c.CallOptions).DeleteOperation[0:len((*c.CallOptions).DeleteOperation):len((*c.CallOptions).DeleteOperation)], opts...) 924 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { 925 var err error 926 _, err = executeRPC(ctx, c.operationsClient.DeleteOperation, req, settings.GRPC, c.logger, "DeleteOperation") 927 return err 928 }, opts...) 929 return err 930 } 931 932 func (c *featureOnlineStoreAdminGRPCClient) GetOperation(ctx context.Context, req *longrunningpb.GetOperationRequest, opts ...gax.CallOption) (*longrunningpb.Operation, error) { 933 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))} 934 935 hds = append(c.xGoogHeaders, hds...) 936 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) 937 opts = append((*c.CallOptions).GetOperation[0:len((*c.CallOptions).GetOperation):len((*c.CallOptions).GetOperation)], opts...) 938 var resp *longrunningpb.Operation 939 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { 940 var err error 941 resp, err = executeRPC(ctx, c.operationsClient.GetOperation, req, settings.GRPC, c.logger, "GetOperation") 942 return err 943 }, opts...) 944 if err != nil { 945 return nil, err 946 } 947 return resp, nil 948 } 949 950 func (c *featureOnlineStoreAdminGRPCClient) ListOperations(ctx context.Context, req *longrunningpb.ListOperationsRequest, opts ...gax.CallOption) *OperationIterator { 951 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))} 952 953 hds = append(c.xGoogHeaders, hds...) 954 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) 955 opts = append((*c.CallOptions).ListOperations[0:len((*c.CallOptions).ListOperations):len((*c.CallOptions).ListOperations)], opts...) 956 it := &OperationIterator{} 957 req = proto.Clone(req).(*longrunningpb.ListOperationsRequest) 958 it.InternalFetch = func(pageSize int, pageToken string) ([]*longrunningpb.Operation, string, error) { 959 resp := &longrunningpb.ListOperationsResponse{} 960 if pageToken != "" { 961 req.PageToken = pageToken 962 } 963 if pageSize > math.MaxInt32 { 964 req.PageSize = math.MaxInt32 965 } else if pageSize != 0 { 966 req.PageSize = int32(pageSize) 967 } 968 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { 969 var err error 970 resp, err = executeRPC(ctx, c.operationsClient.ListOperations, req, settings.GRPC, c.logger, "ListOperations") 971 return err 972 }, opts...) 973 if err != nil { 974 return nil, "", err 975 } 976 977 it.Response = resp 978 return resp.GetOperations(), resp.GetNextPageToken(), nil 979 } 980 fetch := func(pageSize int, pageToken string) (string, error) { 981 items, nextPageToken, err := it.InternalFetch(pageSize, pageToken) 982 if err != nil { 983 return "", err 984 } 985 it.items = append(it.items, items...) 986 return nextPageToken, nil 987 } 988 989 it.pageInfo, it.nextFunc = iterator.NewPageInfo(fetch, it.bufLen, it.takeBuf) 990 it.pageInfo.MaxSize = int(req.GetPageSize()) 991 it.pageInfo.Token = req.GetPageToken() 992 993 return it 994 } 995 996 func (c *featureOnlineStoreAdminGRPCClient) WaitOperation(ctx context.Context, req *longrunningpb.WaitOperationRequest, opts ...gax.CallOption) (*longrunningpb.Operation, error) { 997 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))} 998 999 hds = append(c.xGoogHeaders, hds...) 1000 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) 1001 opts = append((*c.CallOptions).WaitOperation[0:len((*c.CallOptions).WaitOperation):len((*c.CallOptions).WaitOperation)], opts...) 1002 var resp *longrunningpb.Operation 1003 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { 1004 var err error 1005 resp, err = executeRPC(ctx, c.operationsClient.WaitOperation, req, settings.GRPC, c.logger, "WaitOperation") 1006 return err 1007 }, opts...) 1008 if err != nil { 1009 return nil, err 1010 } 1011 return resp, nil 1012 } 1013 1014 // CreateFeatureOnlineStoreOperation returns a new CreateFeatureOnlineStoreOperation from a given name. 1015 // The name must be that of a previously created CreateFeatureOnlineStoreOperation, possibly from a different process. 1016 func (c *featureOnlineStoreAdminGRPCClient) CreateFeatureOnlineStoreOperation(name string) *CreateFeatureOnlineStoreOperation { 1017 return &CreateFeatureOnlineStoreOperation{ 1018 lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}), 1019 } 1020 } 1021 1022 // CreateFeatureViewOperation returns a new CreateFeatureViewOperation from a given name. 1023 // The name must be that of a previously created CreateFeatureViewOperation, possibly from a different process. 1024 func (c *featureOnlineStoreAdminGRPCClient) CreateFeatureViewOperation(name string) *CreateFeatureViewOperation { 1025 return &CreateFeatureViewOperation{ 1026 lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}), 1027 } 1028 } 1029 1030 // DeleteFeatureOnlineStoreOperation returns a new DeleteFeatureOnlineStoreOperation from a given name. 1031 // The name must be that of a previously created DeleteFeatureOnlineStoreOperation, possibly from a different process. 1032 func (c *featureOnlineStoreAdminGRPCClient) DeleteFeatureOnlineStoreOperation(name string) *DeleteFeatureOnlineStoreOperation { 1033 return &DeleteFeatureOnlineStoreOperation{ 1034 lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}), 1035 } 1036 } 1037 1038 // DeleteFeatureViewOperation returns a new DeleteFeatureViewOperation from a given name. 1039 // The name must be that of a previously created DeleteFeatureViewOperation, possibly from a different process. 1040 func (c *featureOnlineStoreAdminGRPCClient) DeleteFeatureViewOperation(name string) *DeleteFeatureViewOperation { 1041 return &DeleteFeatureViewOperation{ 1042 lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}), 1043 } 1044 } 1045 1046 // UpdateFeatureOnlineStoreOperation returns a new UpdateFeatureOnlineStoreOperation from a given name. 1047 // The name must be that of a previously created UpdateFeatureOnlineStoreOperation, possibly from a different process. 1048 func (c *featureOnlineStoreAdminGRPCClient) UpdateFeatureOnlineStoreOperation(name string) *UpdateFeatureOnlineStoreOperation { 1049 return &UpdateFeatureOnlineStoreOperation{ 1050 lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}), 1051 } 1052 } 1053 1054 // UpdateFeatureViewOperation returns a new UpdateFeatureViewOperation from a given name. 1055 // The name must be that of a previously created UpdateFeatureViewOperation, possibly from a different process. 1056 func (c *featureOnlineStoreAdminGRPCClient) UpdateFeatureViewOperation(name string) *UpdateFeatureViewOperation { 1057 return &UpdateFeatureViewOperation{ 1058 lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}), 1059 } 1060 }