cloud.google.com/go/aiplatform@v1.106.0/apiv1/tensorboard_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 newTensorboardClientHook clientHook 42 43 // TensorboardCallOptions contains the retry settings for each method of TensorboardClient. 44 type TensorboardCallOptions struct { 45 CreateTensorboard []gax.CallOption 46 GetTensorboard []gax.CallOption 47 UpdateTensorboard []gax.CallOption 48 ListTensorboards []gax.CallOption 49 DeleteTensorboard []gax.CallOption 50 ReadTensorboardUsage []gax.CallOption 51 ReadTensorboardSize []gax.CallOption 52 CreateTensorboardExperiment []gax.CallOption 53 GetTensorboardExperiment []gax.CallOption 54 UpdateTensorboardExperiment []gax.CallOption 55 ListTensorboardExperiments []gax.CallOption 56 DeleteTensorboardExperiment []gax.CallOption 57 CreateTensorboardRun []gax.CallOption 58 BatchCreateTensorboardRuns []gax.CallOption 59 GetTensorboardRun []gax.CallOption 60 UpdateTensorboardRun []gax.CallOption 61 ListTensorboardRuns []gax.CallOption 62 DeleteTensorboardRun []gax.CallOption 63 BatchCreateTensorboardTimeSeries []gax.CallOption 64 CreateTensorboardTimeSeries []gax.CallOption 65 GetTensorboardTimeSeries []gax.CallOption 66 UpdateTensorboardTimeSeries []gax.CallOption 67 ListTensorboardTimeSeries []gax.CallOption 68 DeleteTensorboardTimeSeries []gax.CallOption 69 BatchReadTensorboardTimeSeriesData []gax.CallOption 70 ReadTensorboardTimeSeriesData []gax.CallOption 71 ReadTensorboardBlobData []gax.CallOption 72 WriteTensorboardExperimentData []gax.CallOption 73 WriteTensorboardRunData []gax.CallOption 74 ExportTensorboardTimeSeriesData []gax.CallOption 75 GetLocation []gax.CallOption 76 ListLocations []gax.CallOption 77 GetIamPolicy []gax.CallOption 78 SetIamPolicy []gax.CallOption 79 TestIamPermissions []gax.CallOption 80 CancelOperation []gax.CallOption 81 DeleteOperation []gax.CallOption 82 GetOperation []gax.CallOption 83 ListOperations []gax.CallOption 84 WaitOperation []gax.CallOption 85 } 86 87 func defaultTensorboardGRPCClientOptions() []option.ClientOption { 88 return []option.ClientOption{ 89 internaloption.WithDefaultEndpoint("aiplatform.googleapis.com:443"), 90 internaloption.WithDefaultEndpointTemplate("aiplatform.UNIVERSE_DOMAIN:443"), 91 internaloption.WithDefaultMTLSEndpoint("aiplatform.mtls.googleapis.com:443"), 92 internaloption.WithDefaultUniverseDomain("googleapis.com"), 93 internaloption.WithDefaultAudience("https://aiplatform.googleapis.com/"), 94 internaloption.WithDefaultScopes(DefaultAuthScopes()...), 95 internaloption.EnableJwtWithScope(), 96 internaloption.EnableNewAuthLibrary(), 97 option.WithGRPCDialOption(grpc.WithDefaultCallOptions( 98 grpc.MaxCallRecvMsgSize(math.MaxInt32))), 99 } 100 } 101 102 func defaultTensorboardCallOptions() *TensorboardCallOptions { 103 return &TensorboardCallOptions{ 104 CreateTensorboard: []gax.CallOption{}, 105 GetTensorboard: []gax.CallOption{}, 106 UpdateTensorboard: []gax.CallOption{}, 107 ListTensorboards: []gax.CallOption{}, 108 DeleteTensorboard: []gax.CallOption{}, 109 ReadTensorboardUsage: []gax.CallOption{}, 110 ReadTensorboardSize: []gax.CallOption{}, 111 CreateTensorboardExperiment: []gax.CallOption{}, 112 GetTensorboardExperiment: []gax.CallOption{}, 113 UpdateTensorboardExperiment: []gax.CallOption{}, 114 ListTensorboardExperiments: []gax.CallOption{}, 115 DeleteTensorboardExperiment: []gax.CallOption{}, 116 CreateTensorboardRun: []gax.CallOption{}, 117 BatchCreateTensorboardRuns: []gax.CallOption{}, 118 GetTensorboardRun: []gax.CallOption{}, 119 UpdateTensorboardRun: []gax.CallOption{}, 120 ListTensorboardRuns: []gax.CallOption{}, 121 DeleteTensorboardRun: []gax.CallOption{}, 122 BatchCreateTensorboardTimeSeries: []gax.CallOption{}, 123 CreateTensorboardTimeSeries: []gax.CallOption{}, 124 GetTensorboardTimeSeries: []gax.CallOption{}, 125 UpdateTensorboardTimeSeries: []gax.CallOption{}, 126 ListTensorboardTimeSeries: []gax.CallOption{}, 127 DeleteTensorboardTimeSeries: []gax.CallOption{}, 128 BatchReadTensorboardTimeSeriesData: []gax.CallOption{}, 129 ReadTensorboardTimeSeriesData: []gax.CallOption{}, 130 ReadTensorboardBlobData: []gax.CallOption{}, 131 WriteTensorboardExperimentData: []gax.CallOption{}, 132 WriteTensorboardRunData: []gax.CallOption{}, 133 ExportTensorboardTimeSeriesData: []gax.CallOption{}, 134 GetLocation: []gax.CallOption{}, 135 ListLocations: []gax.CallOption{}, 136 GetIamPolicy: []gax.CallOption{}, 137 SetIamPolicy: []gax.CallOption{}, 138 TestIamPermissions: []gax.CallOption{}, 139 CancelOperation: []gax.CallOption{}, 140 DeleteOperation: []gax.CallOption{}, 141 GetOperation: []gax.CallOption{}, 142 ListOperations: []gax.CallOption{}, 143 WaitOperation: []gax.CallOption{}, 144 } 145 } 146 147 // internalTensorboardClient is an interface that defines the methods available from Vertex AI API. 148 type internalTensorboardClient interface { 149 Close() error 150 setGoogleClientInfo(...string) 151 Connection() *grpc.ClientConn 152 CreateTensorboard(context.Context, *aiplatformpb.CreateTensorboardRequest, ...gax.CallOption) (*CreateTensorboardOperation, error) 153 CreateTensorboardOperation(name string) *CreateTensorboardOperation 154 GetTensorboard(context.Context, *aiplatformpb.GetTensorboardRequest, ...gax.CallOption) (*aiplatformpb.Tensorboard, error) 155 UpdateTensorboard(context.Context, *aiplatformpb.UpdateTensorboardRequest, ...gax.CallOption) (*UpdateTensorboardOperation, error) 156 UpdateTensorboardOperation(name string) *UpdateTensorboardOperation 157 ListTensorboards(context.Context, *aiplatformpb.ListTensorboardsRequest, ...gax.CallOption) *TensorboardIterator 158 DeleteTensorboard(context.Context, *aiplatformpb.DeleteTensorboardRequest, ...gax.CallOption) (*DeleteTensorboardOperation, error) 159 DeleteTensorboardOperation(name string) *DeleteTensorboardOperation 160 ReadTensorboardUsage(context.Context, *aiplatformpb.ReadTensorboardUsageRequest, ...gax.CallOption) (*aiplatformpb.ReadTensorboardUsageResponse, error) 161 ReadTensorboardSize(context.Context, *aiplatformpb.ReadTensorboardSizeRequest, ...gax.CallOption) (*aiplatformpb.ReadTensorboardSizeResponse, error) 162 CreateTensorboardExperiment(context.Context, *aiplatformpb.CreateTensorboardExperimentRequest, ...gax.CallOption) (*aiplatformpb.TensorboardExperiment, error) 163 GetTensorboardExperiment(context.Context, *aiplatformpb.GetTensorboardExperimentRequest, ...gax.CallOption) (*aiplatformpb.TensorboardExperiment, error) 164 UpdateTensorboardExperiment(context.Context, *aiplatformpb.UpdateTensorboardExperimentRequest, ...gax.CallOption) (*aiplatformpb.TensorboardExperiment, error) 165 ListTensorboardExperiments(context.Context, *aiplatformpb.ListTensorboardExperimentsRequest, ...gax.CallOption) *TensorboardExperimentIterator 166 DeleteTensorboardExperiment(context.Context, *aiplatformpb.DeleteTensorboardExperimentRequest, ...gax.CallOption) (*DeleteTensorboardExperimentOperation, error) 167 DeleteTensorboardExperimentOperation(name string) *DeleteTensorboardExperimentOperation 168 CreateTensorboardRun(context.Context, *aiplatformpb.CreateTensorboardRunRequest, ...gax.CallOption) (*aiplatformpb.TensorboardRun, error) 169 BatchCreateTensorboardRuns(context.Context, *aiplatformpb.BatchCreateTensorboardRunsRequest, ...gax.CallOption) (*aiplatformpb.BatchCreateTensorboardRunsResponse, error) 170 GetTensorboardRun(context.Context, *aiplatformpb.GetTensorboardRunRequest, ...gax.CallOption) (*aiplatformpb.TensorboardRun, error) 171 UpdateTensorboardRun(context.Context, *aiplatformpb.UpdateTensorboardRunRequest, ...gax.CallOption) (*aiplatformpb.TensorboardRun, error) 172 ListTensorboardRuns(context.Context, *aiplatformpb.ListTensorboardRunsRequest, ...gax.CallOption) *TensorboardRunIterator 173 DeleteTensorboardRun(context.Context, *aiplatformpb.DeleteTensorboardRunRequest, ...gax.CallOption) (*DeleteTensorboardRunOperation, error) 174 DeleteTensorboardRunOperation(name string) *DeleteTensorboardRunOperation 175 BatchCreateTensorboardTimeSeries(context.Context, *aiplatformpb.BatchCreateTensorboardTimeSeriesRequest, ...gax.CallOption) (*aiplatformpb.BatchCreateTensorboardTimeSeriesResponse, error) 176 CreateTensorboardTimeSeries(context.Context, *aiplatformpb.CreateTensorboardTimeSeriesRequest, ...gax.CallOption) (*aiplatformpb.TensorboardTimeSeries, error) 177 GetTensorboardTimeSeries(context.Context, *aiplatformpb.GetTensorboardTimeSeriesRequest, ...gax.CallOption) (*aiplatformpb.TensorboardTimeSeries, error) 178 UpdateTensorboardTimeSeries(context.Context, *aiplatformpb.UpdateTensorboardTimeSeriesRequest, ...gax.CallOption) (*aiplatformpb.TensorboardTimeSeries, error) 179 ListTensorboardTimeSeries(context.Context, *aiplatformpb.ListTensorboardTimeSeriesRequest, ...gax.CallOption) *TensorboardTimeSeriesIterator 180 DeleteTensorboardTimeSeries(context.Context, *aiplatformpb.DeleteTensorboardTimeSeriesRequest, ...gax.CallOption) (*DeleteTensorboardTimeSeriesOperation, error) 181 DeleteTensorboardTimeSeriesOperation(name string) *DeleteTensorboardTimeSeriesOperation 182 BatchReadTensorboardTimeSeriesData(context.Context, *aiplatformpb.BatchReadTensorboardTimeSeriesDataRequest, ...gax.CallOption) (*aiplatformpb.BatchReadTensorboardTimeSeriesDataResponse, error) 183 ReadTensorboardTimeSeriesData(context.Context, *aiplatformpb.ReadTensorboardTimeSeriesDataRequest, ...gax.CallOption) (*aiplatformpb.ReadTensorboardTimeSeriesDataResponse, error) 184 ReadTensorboardBlobData(context.Context, *aiplatformpb.ReadTensorboardBlobDataRequest, ...gax.CallOption) (aiplatformpb.TensorboardService_ReadTensorboardBlobDataClient, error) 185 WriteTensorboardExperimentData(context.Context, *aiplatformpb.WriteTensorboardExperimentDataRequest, ...gax.CallOption) (*aiplatformpb.WriteTensorboardExperimentDataResponse, error) 186 WriteTensorboardRunData(context.Context, *aiplatformpb.WriteTensorboardRunDataRequest, ...gax.CallOption) (*aiplatformpb.WriteTensorboardRunDataResponse, error) 187 ExportTensorboardTimeSeriesData(context.Context, *aiplatformpb.ExportTensorboardTimeSeriesDataRequest, ...gax.CallOption) *TimeSeriesDataPointIterator 188 GetLocation(context.Context, *locationpb.GetLocationRequest, ...gax.CallOption) (*locationpb.Location, error) 189 ListLocations(context.Context, *locationpb.ListLocationsRequest, ...gax.CallOption) *LocationIterator 190 GetIamPolicy(context.Context, *iampb.GetIamPolicyRequest, ...gax.CallOption) (*iampb.Policy, error) 191 SetIamPolicy(context.Context, *iampb.SetIamPolicyRequest, ...gax.CallOption) (*iampb.Policy, error) 192 TestIamPermissions(context.Context, *iampb.TestIamPermissionsRequest, ...gax.CallOption) (*iampb.TestIamPermissionsResponse, error) 193 CancelOperation(context.Context, *longrunningpb.CancelOperationRequest, ...gax.CallOption) error 194 DeleteOperation(context.Context, *longrunningpb.DeleteOperationRequest, ...gax.CallOption) error 195 GetOperation(context.Context, *longrunningpb.GetOperationRequest, ...gax.CallOption) (*longrunningpb.Operation, error) 196 ListOperations(context.Context, *longrunningpb.ListOperationsRequest, ...gax.CallOption) *OperationIterator 197 WaitOperation(context.Context, *longrunningpb.WaitOperationRequest, ...gax.CallOption) (*longrunningpb.Operation, error) 198 } 199 200 // TensorboardClient is a client for interacting with Vertex AI API. 201 // Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls. 202 // 203 // TensorboardService 204 type TensorboardClient struct { 205 // The internal transport-dependent client. 206 internalClient internalTensorboardClient 207 208 // The call options for this service. 209 CallOptions *TensorboardCallOptions 210 211 // LROClient is used internally to handle long-running operations. 212 // It is exposed so that its CallOptions can be modified if required. 213 // Users should not Close this client. 214 LROClient *lroauto.OperationsClient 215 } 216 217 // Wrapper methods routed to the internal client. 218 219 // Close closes the connection to the API service. The user should invoke this when 220 // the client is no longer required. 221 func (c *TensorboardClient) Close() error { 222 return c.internalClient.Close() 223 } 224 225 // setGoogleClientInfo sets the name and version of the application in 226 // the `x-goog-api-client` header passed on each request. Intended for 227 // use by Google-written clients. 228 func (c *TensorboardClient) setGoogleClientInfo(keyval ...string) { 229 c.internalClient.setGoogleClientInfo(keyval...) 230 } 231 232 // Connection returns a connection to the API service. 233 // 234 // Deprecated: Connections are now pooled so this method does not always 235 // return the same resource. 236 func (c *TensorboardClient) Connection() *grpc.ClientConn { 237 return c.internalClient.Connection() 238 } 239 240 // CreateTensorboard creates a Tensorboard. 241 func (c *TensorboardClient) CreateTensorboard(ctx context.Context, req *aiplatformpb.CreateTensorboardRequest, opts ...gax.CallOption) (*CreateTensorboardOperation, error) { 242 return c.internalClient.CreateTensorboard(ctx, req, opts...) 243 } 244 245 // CreateTensorboardOperation returns a new CreateTensorboardOperation from a given name. 246 // The name must be that of a previously created CreateTensorboardOperation, possibly from a different process. 247 func (c *TensorboardClient) CreateTensorboardOperation(name string) *CreateTensorboardOperation { 248 return c.internalClient.CreateTensorboardOperation(name) 249 } 250 251 // GetTensorboard gets a Tensorboard. 252 func (c *TensorboardClient) GetTensorboard(ctx context.Context, req *aiplatformpb.GetTensorboardRequest, opts ...gax.CallOption) (*aiplatformpb.Tensorboard, error) { 253 return c.internalClient.GetTensorboard(ctx, req, opts...) 254 } 255 256 // UpdateTensorboard updates a Tensorboard. 257 func (c *TensorboardClient) UpdateTensorboard(ctx context.Context, req *aiplatformpb.UpdateTensorboardRequest, opts ...gax.CallOption) (*UpdateTensorboardOperation, error) { 258 return c.internalClient.UpdateTensorboard(ctx, req, opts...) 259 } 260 261 // UpdateTensorboardOperation returns a new UpdateTensorboardOperation from a given name. 262 // The name must be that of a previously created UpdateTensorboardOperation, possibly from a different process. 263 func (c *TensorboardClient) UpdateTensorboardOperation(name string) *UpdateTensorboardOperation { 264 return c.internalClient.UpdateTensorboardOperation(name) 265 } 266 267 // ListTensorboards lists Tensorboards in a Location. 268 func (c *TensorboardClient) ListTensorboards(ctx context.Context, req *aiplatformpb.ListTensorboardsRequest, opts ...gax.CallOption) *TensorboardIterator { 269 return c.internalClient.ListTensorboards(ctx, req, opts...) 270 } 271 272 // DeleteTensorboard deletes a Tensorboard. 273 func (c *TensorboardClient) DeleteTensorboard(ctx context.Context, req *aiplatformpb.DeleteTensorboardRequest, opts ...gax.CallOption) (*DeleteTensorboardOperation, error) { 274 return c.internalClient.DeleteTensorboard(ctx, req, opts...) 275 } 276 277 // DeleteTensorboardOperation returns a new DeleteTensorboardOperation from a given name. 278 // The name must be that of a previously created DeleteTensorboardOperation, possibly from a different process. 279 func (c *TensorboardClient) DeleteTensorboardOperation(name string) *DeleteTensorboardOperation { 280 return c.internalClient.DeleteTensorboardOperation(name) 281 } 282 283 // ReadTensorboardUsage returns a list of monthly active users for a given TensorBoard instance. 284 func (c *TensorboardClient) ReadTensorboardUsage(ctx context.Context, req *aiplatformpb.ReadTensorboardUsageRequest, opts ...gax.CallOption) (*aiplatformpb.ReadTensorboardUsageResponse, error) { 285 return c.internalClient.ReadTensorboardUsage(ctx, req, opts...) 286 } 287 288 // ReadTensorboardSize returns the storage size for a given TensorBoard instance. 289 func (c *TensorboardClient) ReadTensorboardSize(ctx context.Context, req *aiplatformpb.ReadTensorboardSizeRequest, opts ...gax.CallOption) (*aiplatformpb.ReadTensorboardSizeResponse, error) { 290 return c.internalClient.ReadTensorboardSize(ctx, req, opts...) 291 } 292 293 // CreateTensorboardExperiment creates a TensorboardExperiment. 294 func (c *TensorboardClient) CreateTensorboardExperiment(ctx context.Context, req *aiplatformpb.CreateTensorboardExperimentRequest, opts ...gax.CallOption) (*aiplatformpb.TensorboardExperiment, error) { 295 return c.internalClient.CreateTensorboardExperiment(ctx, req, opts...) 296 } 297 298 // GetTensorboardExperiment gets a TensorboardExperiment. 299 func (c *TensorboardClient) GetTensorboardExperiment(ctx context.Context, req *aiplatformpb.GetTensorboardExperimentRequest, opts ...gax.CallOption) (*aiplatformpb.TensorboardExperiment, error) { 300 return c.internalClient.GetTensorboardExperiment(ctx, req, opts...) 301 } 302 303 // UpdateTensorboardExperiment updates a TensorboardExperiment. 304 func (c *TensorboardClient) UpdateTensorboardExperiment(ctx context.Context, req *aiplatformpb.UpdateTensorboardExperimentRequest, opts ...gax.CallOption) (*aiplatformpb.TensorboardExperiment, error) { 305 return c.internalClient.UpdateTensorboardExperiment(ctx, req, opts...) 306 } 307 308 // ListTensorboardExperiments lists TensorboardExperiments in a Location. 309 func (c *TensorboardClient) ListTensorboardExperiments(ctx context.Context, req *aiplatformpb.ListTensorboardExperimentsRequest, opts ...gax.CallOption) *TensorboardExperimentIterator { 310 return c.internalClient.ListTensorboardExperiments(ctx, req, opts...) 311 } 312 313 // DeleteTensorboardExperiment deletes a TensorboardExperiment. 314 func (c *TensorboardClient) DeleteTensorboardExperiment(ctx context.Context, req *aiplatformpb.DeleteTensorboardExperimentRequest, opts ...gax.CallOption) (*DeleteTensorboardExperimentOperation, error) { 315 return c.internalClient.DeleteTensorboardExperiment(ctx, req, opts...) 316 } 317 318 // DeleteTensorboardExperimentOperation returns a new DeleteTensorboardExperimentOperation from a given name. 319 // The name must be that of a previously created DeleteTensorboardExperimentOperation, possibly from a different process. 320 func (c *TensorboardClient) DeleteTensorboardExperimentOperation(name string) *DeleteTensorboardExperimentOperation { 321 return c.internalClient.DeleteTensorboardExperimentOperation(name) 322 } 323 324 // CreateTensorboardRun creates a TensorboardRun. 325 func (c *TensorboardClient) CreateTensorboardRun(ctx context.Context, req *aiplatformpb.CreateTensorboardRunRequest, opts ...gax.CallOption) (*aiplatformpb.TensorboardRun, error) { 326 return c.internalClient.CreateTensorboardRun(ctx, req, opts...) 327 } 328 329 // BatchCreateTensorboardRuns batch create TensorboardRuns. 330 func (c *TensorboardClient) BatchCreateTensorboardRuns(ctx context.Context, req *aiplatformpb.BatchCreateTensorboardRunsRequest, opts ...gax.CallOption) (*aiplatformpb.BatchCreateTensorboardRunsResponse, error) { 331 return c.internalClient.BatchCreateTensorboardRuns(ctx, req, opts...) 332 } 333 334 // GetTensorboardRun gets a TensorboardRun. 335 func (c *TensorboardClient) GetTensorboardRun(ctx context.Context, req *aiplatformpb.GetTensorboardRunRequest, opts ...gax.CallOption) (*aiplatformpb.TensorboardRun, error) { 336 return c.internalClient.GetTensorboardRun(ctx, req, opts...) 337 } 338 339 // UpdateTensorboardRun updates a TensorboardRun. 340 func (c *TensorboardClient) UpdateTensorboardRun(ctx context.Context, req *aiplatformpb.UpdateTensorboardRunRequest, opts ...gax.CallOption) (*aiplatformpb.TensorboardRun, error) { 341 return c.internalClient.UpdateTensorboardRun(ctx, req, opts...) 342 } 343 344 // ListTensorboardRuns lists TensorboardRuns in a Location. 345 func (c *TensorboardClient) ListTensorboardRuns(ctx context.Context, req *aiplatformpb.ListTensorboardRunsRequest, opts ...gax.CallOption) *TensorboardRunIterator { 346 return c.internalClient.ListTensorboardRuns(ctx, req, opts...) 347 } 348 349 // DeleteTensorboardRun deletes a TensorboardRun. 350 func (c *TensorboardClient) DeleteTensorboardRun(ctx context.Context, req *aiplatformpb.DeleteTensorboardRunRequest, opts ...gax.CallOption) (*DeleteTensorboardRunOperation, error) { 351 return c.internalClient.DeleteTensorboardRun(ctx, req, opts...) 352 } 353 354 // DeleteTensorboardRunOperation returns a new DeleteTensorboardRunOperation from a given name. 355 // The name must be that of a previously created DeleteTensorboardRunOperation, possibly from a different process. 356 func (c *TensorboardClient) DeleteTensorboardRunOperation(name string) *DeleteTensorboardRunOperation { 357 return c.internalClient.DeleteTensorboardRunOperation(name) 358 } 359 360 // BatchCreateTensorboardTimeSeries batch create TensorboardTimeSeries that belong to a TensorboardExperiment. 361 func (c *TensorboardClient) BatchCreateTensorboardTimeSeries(ctx context.Context, req *aiplatformpb.BatchCreateTensorboardTimeSeriesRequest, opts ...gax.CallOption) (*aiplatformpb.BatchCreateTensorboardTimeSeriesResponse, error) { 362 return c.internalClient.BatchCreateTensorboardTimeSeries(ctx, req, opts...) 363 } 364 365 // CreateTensorboardTimeSeries creates a TensorboardTimeSeries. 366 func (c *TensorboardClient) CreateTensorboardTimeSeries(ctx context.Context, req *aiplatformpb.CreateTensorboardTimeSeriesRequest, opts ...gax.CallOption) (*aiplatformpb.TensorboardTimeSeries, error) { 367 return c.internalClient.CreateTensorboardTimeSeries(ctx, req, opts...) 368 } 369 370 // GetTensorboardTimeSeries gets a TensorboardTimeSeries. 371 func (c *TensorboardClient) GetTensorboardTimeSeries(ctx context.Context, req *aiplatformpb.GetTensorboardTimeSeriesRequest, opts ...gax.CallOption) (*aiplatformpb.TensorboardTimeSeries, error) { 372 return c.internalClient.GetTensorboardTimeSeries(ctx, req, opts...) 373 } 374 375 // UpdateTensorboardTimeSeries updates a TensorboardTimeSeries. 376 func (c *TensorboardClient) UpdateTensorboardTimeSeries(ctx context.Context, req *aiplatformpb.UpdateTensorboardTimeSeriesRequest, opts ...gax.CallOption) (*aiplatformpb.TensorboardTimeSeries, error) { 377 return c.internalClient.UpdateTensorboardTimeSeries(ctx, req, opts...) 378 } 379 380 // ListTensorboardTimeSeries lists TensorboardTimeSeries in a Location. 381 func (c *TensorboardClient) ListTensorboardTimeSeries(ctx context.Context, req *aiplatformpb.ListTensorboardTimeSeriesRequest, opts ...gax.CallOption) *TensorboardTimeSeriesIterator { 382 return c.internalClient.ListTensorboardTimeSeries(ctx, req, opts...) 383 } 384 385 // DeleteTensorboardTimeSeries deletes a TensorboardTimeSeries. 386 func (c *TensorboardClient) DeleteTensorboardTimeSeries(ctx context.Context, req *aiplatformpb.DeleteTensorboardTimeSeriesRequest, opts ...gax.CallOption) (*DeleteTensorboardTimeSeriesOperation, error) { 387 return c.internalClient.DeleteTensorboardTimeSeries(ctx, req, opts...) 388 } 389 390 // DeleteTensorboardTimeSeriesOperation returns a new DeleteTensorboardTimeSeriesOperation from a given name. 391 // The name must be that of a previously created DeleteTensorboardTimeSeriesOperation, possibly from a different process. 392 func (c *TensorboardClient) DeleteTensorboardTimeSeriesOperation(name string) *DeleteTensorboardTimeSeriesOperation { 393 return c.internalClient.DeleteTensorboardTimeSeriesOperation(name) 394 } 395 396 // BatchReadTensorboardTimeSeriesData reads multiple TensorboardTimeSeries’ data. The data point number limit is 397 // 1000 for scalars, 100 for tensors and blob references. If the number of 398 // data points stored is less than the limit, all data is returned. 399 // Otherwise, the number limit of data points is randomly selected from 400 // this time series and returned. 401 func (c *TensorboardClient) BatchReadTensorboardTimeSeriesData(ctx context.Context, req *aiplatformpb.BatchReadTensorboardTimeSeriesDataRequest, opts ...gax.CallOption) (*aiplatformpb.BatchReadTensorboardTimeSeriesDataResponse, error) { 402 return c.internalClient.BatchReadTensorboardTimeSeriesData(ctx, req, opts...) 403 } 404 405 // ReadTensorboardTimeSeriesData reads a TensorboardTimeSeries’ data. By default, if the number of data 406 // points stored is less than 1000, all data is returned. Otherwise, 1000 407 // data points is randomly selected from this time series and returned. 408 // This value can be changed by changing max_data_points, which can’t be 409 // greater than 10k. 410 func (c *TensorboardClient) ReadTensorboardTimeSeriesData(ctx context.Context, req *aiplatformpb.ReadTensorboardTimeSeriesDataRequest, opts ...gax.CallOption) (*aiplatformpb.ReadTensorboardTimeSeriesDataResponse, error) { 411 return c.internalClient.ReadTensorboardTimeSeriesData(ctx, req, opts...) 412 } 413 414 // ReadTensorboardBlobData gets bytes of TensorboardBlobs. 415 // This is to allow reading blob data stored in consumer project’s Cloud 416 // Storage bucket without users having to obtain Cloud Storage access 417 // permission. 418 func (c *TensorboardClient) ReadTensorboardBlobData(ctx context.Context, req *aiplatformpb.ReadTensorboardBlobDataRequest, opts ...gax.CallOption) (aiplatformpb.TensorboardService_ReadTensorboardBlobDataClient, error) { 419 return c.internalClient.ReadTensorboardBlobData(ctx, req, opts...) 420 } 421 422 // WriteTensorboardExperimentData write time series data points of multiple TensorboardTimeSeries in multiple 423 // TensorboardRun’s. If any data fail to be ingested, an error is returned. 424 func (c *TensorboardClient) WriteTensorboardExperimentData(ctx context.Context, req *aiplatformpb.WriteTensorboardExperimentDataRequest, opts ...gax.CallOption) (*aiplatformpb.WriteTensorboardExperimentDataResponse, error) { 425 return c.internalClient.WriteTensorboardExperimentData(ctx, req, opts...) 426 } 427 428 // WriteTensorboardRunData write time series data points into multiple TensorboardTimeSeries under 429 // a TensorboardRun. If any data fail to be ingested, an error is returned. 430 func (c *TensorboardClient) WriteTensorboardRunData(ctx context.Context, req *aiplatformpb.WriteTensorboardRunDataRequest, opts ...gax.CallOption) (*aiplatformpb.WriteTensorboardRunDataResponse, error) { 431 return c.internalClient.WriteTensorboardRunData(ctx, req, opts...) 432 } 433 434 // ExportTensorboardTimeSeriesData exports a TensorboardTimeSeries’ data. Data is returned in paginated 435 // responses. 436 func (c *TensorboardClient) ExportTensorboardTimeSeriesData(ctx context.Context, req *aiplatformpb.ExportTensorboardTimeSeriesDataRequest, opts ...gax.CallOption) *TimeSeriesDataPointIterator { 437 return c.internalClient.ExportTensorboardTimeSeriesData(ctx, req, opts...) 438 } 439 440 // GetLocation gets information about a location. 441 func (c *TensorboardClient) GetLocation(ctx context.Context, req *locationpb.GetLocationRequest, opts ...gax.CallOption) (*locationpb.Location, error) { 442 return c.internalClient.GetLocation(ctx, req, opts...) 443 } 444 445 // ListLocations lists information about the supported locations for this service. 446 func (c *TensorboardClient) ListLocations(ctx context.Context, req *locationpb.ListLocationsRequest, opts ...gax.CallOption) *LocationIterator { 447 return c.internalClient.ListLocations(ctx, req, opts...) 448 } 449 450 // GetIamPolicy gets the access control policy for a resource. Returns an empty policy 451 // if the resource exists and does not have a policy set. 452 func (c *TensorboardClient) GetIamPolicy(ctx context.Context, req *iampb.GetIamPolicyRequest, opts ...gax.CallOption) (*iampb.Policy, error) { 453 return c.internalClient.GetIamPolicy(ctx, req, opts...) 454 } 455 456 // SetIamPolicy sets the access control policy on the specified resource. Replaces 457 // any existing policy. 458 // 459 // Can return NOT_FOUND, INVALID_ARGUMENT, and PERMISSION_DENIED 460 // errors. 461 func (c *TensorboardClient) SetIamPolicy(ctx context.Context, req *iampb.SetIamPolicyRequest, opts ...gax.CallOption) (*iampb.Policy, error) { 462 return c.internalClient.SetIamPolicy(ctx, req, opts...) 463 } 464 465 // TestIamPermissions returns permissions that a caller has on the specified resource. If the 466 // resource does not exist, this will return an empty set of 467 // permissions, not a NOT_FOUND error. 468 // 469 // Note: This operation is designed to be used for building 470 // permission-aware UIs and command-line tools, not for authorization 471 // checking. This operation may “fail open” without warning. 472 func (c *TensorboardClient) TestIamPermissions(ctx context.Context, req *iampb.TestIamPermissionsRequest, opts ...gax.CallOption) (*iampb.TestIamPermissionsResponse, error) { 473 return c.internalClient.TestIamPermissions(ctx, req, opts...) 474 } 475 476 // CancelOperation is a utility method from google.longrunning.Operations. 477 func (c *TensorboardClient) CancelOperation(ctx context.Context, req *longrunningpb.CancelOperationRequest, opts ...gax.CallOption) error { 478 return c.internalClient.CancelOperation(ctx, req, opts...) 479 } 480 481 // DeleteOperation is a utility method from google.longrunning.Operations. 482 func (c *TensorboardClient) DeleteOperation(ctx context.Context, req *longrunningpb.DeleteOperationRequest, opts ...gax.CallOption) error { 483 return c.internalClient.DeleteOperation(ctx, req, opts...) 484 } 485 486 // GetOperation is a utility method from google.longrunning.Operations. 487 func (c *TensorboardClient) GetOperation(ctx context.Context, req *longrunningpb.GetOperationRequest, opts ...gax.CallOption) (*longrunningpb.Operation, error) { 488 return c.internalClient.GetOperation(ctx, req, opts...) 489 } 490 491 // ListOperations is a utility method from google.longrunning.Operations. 492 func (c *TensorboardClient) ListOperations(ctx context.Context, req *longrunningpb.ListOperationsRequest, opts ...gax.CallOption) *OperationIterator { 493 return c.internalClient.ListOperations(ctx, req, opts...) 494 } 495 496 // WaitOperation is a utility method from google.longrunning.Operations. 497 func (c *TensorboardClient) WaitOperation(ctx context.Context, req *longrunningpb.WaitOperationRequest, opts ...gax.CallOption) (*longrunningpb.Operation, error) { 498 return c.internalClient.WaitOperation(ctx, req, opts...) 499 } 500 501 // tensorboardGRPCClient is a client for interacting with Vertex AI API over gRPC transport. 502 // 503 // Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls. 504 type tensorboardGRPCClient struct { 505 // Connection pool of gRPC connections to the service. 506 connPool gtransport.ConnPool 507 508 // Points back to the CallOptions field of the containing TensorboardClient 509 CallOptions **TensorboardCallOptions 510 511 // The gRPC API client. 512 tensorboardClient aiplatformpb.TensorboardServiceClient 513 514 // LROClient is used internally to handle long-running operations. 515 // It is exposed so that its CallOptions can be modified if required. 516 // Users should not Close this client. 517 LROClient **lroauto.OperationsClient 518 519 operationsClient longrunningpb.OperationsClient 520 521 iamPolicyClient iampb.IAMPolicyClient 522 523 locationsClient locationpb.LocationsClient 524 525 // The x-goog-* metadata to be sent with each request. 526 xGoogHeaders []string 527 528 logger *slog.Logger 529 } 530 531 // NewTensorboardClient creates a new tensorboard service client based on gRPC. 532 // The returned client must be Closed when it is done being used to clean up its underlying connections. 533 // 534 // TensorboardService 535 func NewTensorboardClient(ctx context.Context, opts ...option.ClientOption) (*TensorboardClient, error) { 536 clientOpts := defaultTensorboardGRPCClientOptions() 537 if newTensorboardClientHook != nil { 538 hookOpts, err := newTensorboardClientHook(ctx, clientHookParams{}) 539 if err != nil { 540 return nil, err 541 } 542 clientOpts = append(clientOpts, hookOpts...) 543 } 544 545 connPool, err := gtransport.DialPool(ctx, append(clientOpts, opts...)...) 546 if err != nil { 547 return nil, err 548 } 549 client := TensorboardClient{CallOptions: defaultTensorboardCallOptions()} 550 551 c := &tensorboardGRPCClient{ 552 connPool: connPool, 553 tensorboardClient: aiplatformpb.NewTensorboardServiceClient(connPool), 554 CallOptions: &client.CallOptions, 555 logger: internaloption.GetLogger(opts), 556 operationsClient: longrunningpb.NewOperationsClient(connPool), 557 iamPolicyClient: iampb.NewIAMPolicyClient(connPool), 558 locationsClient: locationpb.NewLocationsClient(connPool), 559 } 560 c.setGoogleClientInfo() 561 562 client.internalClient = c 563 564 client.LROClient, err = lroauto.NewOperationsClient(ctx, gtransport.WithConnPool(connPool)) 565 if err != nil { 566 // This error "should not happen", since we are just reusing old connection pool 567 // and never actually need to dial. 568 // If this does happen, we could leak connp. However, we cannot close conn: 569 // If the user invoked the constructor with option.WithGRPCConn, 570 // we would close a connection that's still in use. 571 // TODO: investigate error conditions. 572 return nil, err 573 } 574 c.LROClient = &client.LROClient 575 return &client, nil 576 } 577 578 // Connection returns a connection to the API service. 579 // 580 // Deprecated: Connections are now pooled so this method does not always 581 // return the same resource. 582 func (c *tensorboardGRPCClient) Connection() *grpc.ClientConn { 583 return c.connPool.Conn() 584 } 585 586 // setGoogleClientInfo sets the name and version of the application in 587 // the `x-goog-api-client` header passed on each request. Intended for 588 // use by Google-written clients. 589 func (c *tensorboardGRPCClient) setGoogleClientInfo(keyval ...string) { 590 kv := append([]string{"gl-go", gax.GoVersion}, keyval...) 591 kv = append(kv, "gapic", getVersionClient(), "gax", gax.Version, "grpc", grpc.Version, "pb", protoVersion) 592 c.xGoogHeaders = []string{ 593 "x-goog-api-client", gax.XGoogHeader(kv...), 594 } 595 } 596 597 // Close closes the connection to the API service. The user should invoke this when 598 // the client is no longer required. 599 func (c *tensorboardGRPCClient) Close() error { 600 return c.connPool.Close() 601 } 602 603 func (c *tensorboardGRPCClient) CreateTensorboard(ctx context.Context, req *aiplatformpb.CreateTensorboardRequest, opts ...gax.CallOption) (*CreateTensorboardOperation, error) { 604 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))} 605 606 hds = append(c.xGoogHeaders, hds...) 607 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) 608 opts = append((*c.CallOptions).CreateTensorboard[0:len((*c.CallOptions).CreateTensorboard):len((*c.CallOptions).CreateTensorboard)], opts...) 609 var resp *longrunningpb.Operation 610 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { 611 var err error 612 resp, err = executeRPC(ctx, c.tensorboardClient.CreateTensorboard, req, settings.GRPC, c.logger, "CreateTensorboard") 613 return err 614 }, opts...) 615 if err != nil { 616 return nil, err 617 } 618 return &CreateTensorboardOperation{ 619 lro: longrunning.InternalNewOperation(*c.LROClient, resp), 620 }, nil 621 } 622 623 func (c *tensorboardGRPCClient) GetTensorboard(ctx context.Context, req *aiplatformpb.GetTensorboardRequest, opts ...gax.CallOption) (*aiplatformpb.Tensorboard, error) { 624 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))} 625 626 hds = append(c.xGoogHeaders, hds...) 627 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) 628 opts = append((*c.CallOptions).GetTensorboard[0:len((*c.CallOptions).GetTensorboard):len((*c.CallOptions).GetTensorboard)], opts...) 629 var resp *aiplatformpb.Tensorboard 630 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { 631 var err error 632 resp, err = executeRPC(ctx, c.tensorboardClient.GetTensorboard, req, settings.GRPC, c.logger, "GetTensorboard") 633 return err 634 }, opts...) 635 if err != nil { 636 return nil, err 637 } 638 return resp, nil 639 } 640 641 func (c *tensorboardGRPCClient) UpdateTensorboard(ctx context.Context, req *aiplatformpb.UpdateTensorboardRequest, opts ...gax.CallOption) (*UpdateTensorboardOperation, error) { 642 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "tensorboard.name", url.QueryEscape(req.GetTensorboard().GetName()))} 643 644 hds = append(c.xGoogHeaders, hds...) 645 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) 646 opts = append((*c.CallOptions).UpdateTensorboard[0:len((*c.CallOptions).UpdateTensorboard):len((*c.CallOptions).UpdateTensorboard)], opts...) 647 var resp *longrunningpb.Operation 648 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { 649 var err error 650 resp, err = executeRPC(ctx, c.tensorboardClient.UpdateTensorboard, req, settings.GRPC, c.logger, "UpdateTensorboard") 651 return err 652 }, opts...) 653 if err != nil { 654 return nil, err 655 } 656 return &UpdateTensorboardOperation{ 657 lro: longrunning.InternalNewOperation(*c.LROClient, resp), 658 }, nil 659 } 660 661 func (c *tensorboardGRPCClient) ListTensorboards(ctx context.Context, req *aiplatformpb.ListTensorboardsRequest, opts ...gax.CallOption) *TensorboardIterator { 662 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))} 663 664 hds = append(c.xGoogHeaders, hds...) 665 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) 666 opts = append((*c.CallOptions).ListTensorboards[0:len((*c.CallOptions).ListTensorboards):len((*c.CallOptions).ListTensorboards)], opts...) 667 it := &TensorboardIterator{} 668 req = proto.Clone(req).(*aiplatformpb.ListTensorboardsRequest) 669 it.InternalFetch = func(pageSize int, pageToken string) ([]*aiplatformpb.Tensorboard, string, error) { 670 resp := &aiplatformpb.ListTensorboardsResponse{} 671 if pageToken != "" { 672 req.PageToken = pageToken 673 } 674 if pageSize > math.MaxInt32 { 675 req.PageSize = math.MaxInt32 676 } else if pageSize != 0 { 677 req.PageSize = int32(pageSize) 678 } 679 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { 680 var err error 681 resp, err = executeRPC(ctx, c.tensorboardClient.ListTensorboards, req, settings.GRPC, c.logger, "ListTensorboards") 682 return err 683 }, opts...) 684 if err != nil { 685 return nil, "", err 686 } 687 688 it.Response = resp 689 return resp.GetTensorboards(), resp.GetNextPageToken(), nil 690 } 691 fetch := func(pageSize int, pageToken string) (string, error) { 692 items, nextPageToken, err := it.InternalFetch(pageSize, pageToken) 693 if err != nil { 694 return "", err 695 } 696 it.items = append(it.items, items...) 697 return nextPageToken, nil 698 } 699 700 it.pageInfo, it.nextFunc = iterator.NewPageInfo(fetch, it.bufLen, it.takeBuf) 701 it.pageInfo.MaxSize = int(req.GetPageSize()) 702 it.pageInfo.Token = req.GetPageToken() 703 704 return it 705 } 706 707 func (c *tensorboardGRPCClient) DeleteTensorboard(ctx context.Context, req *aiplatformpb.DeleteTensorboardRequest, opts ...gax.CallOption) (*DeleteTensorboardOperation, error) { 708 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))} 709 710 hds = append(c.xGoogHeaders, hds...) 711 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) 712 opts = append((*c.CallOptions).DeleteTensorboard[0:len((*c.CallOptions).DeleteTensorboard):len((*c.CallOptions).DeleteTensorboard)], opts...) 713 var resp *longrunningpb.Operation 714 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { 715 var err error 716 resp, err = executeRPC(ctx, c.tensorboardClient.DeleteTensorboard, req, settings.GRPC, c.logger, "DeleteTensorboard") 717 return err 718 }, opts...) 719 if err != nil { 720 return nil, err 721 } 722 return &DeleteTensorboardOperation{ 723 lro: longrunning.InternalNewOperation(*c.LROClient, resp), 724 }, nil 725 } 726 727 func (c *tensorboardGRPCClient) ReadTensorboardUsage(ctx context.Context, req *aiplatformpb.ReadTensorboardUsageRequest, opts ...gax.CallOption) (*aiplatformpb.ReadTensorboardUsageResponse, error) { 728 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "tensorboard", url.QueryEscape(req.GetTensorboard()))} 729 730 hds = append(c.xGoogHeaders, hds...) 731 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) 732 opts = append((*c.CallOptions).ReadTensorboardUsage[0:len((*c.CallOptions).ReadTensorboardUsage):len((*c.CallOptions).ReadTensorboardUsage)], opts...) 733 var resp *aiplatformpb.ReadTensorboardUsageResponse 734 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { 735 var err error 736 resp, err = executeRPC(ctx, c.tensorboardClient.ReadTensorboardUsage, req, settings.GRPC, c.logger, "ReadTensorboardUsage") 737 return err 738 }, opts...) 739 if err != nil { 740 return nil, err 741 } 742 return resp, nil 743 } 744 745 func (c *tensorboardGRPCClient) ReadTensorboardSize(ctx context.Context, req *aiplatformpb.ReadTensorboardSizeRequest, opts ...gax.CallOption) (*aiplatformpb.ReadTensorboardSizeResponse, error) { 746 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "tensorboard", url.QueryEscape(req.GetTensorboard()))} 747 748 hds = append(c.xGoogHeaders, hds...) 749 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) 750 opts = append((*c.CallOptions).ReadTensorboardSize[0:len((*c.CallOptions).ReadTensorboardSize):len((*c.CallOptions).ReadTensorboardSize)], opts...) 751 var resp *aiplatformpb.ReadTensorboardSizeResponse 752 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { 753 var err error 754 resp, err = executeRPC(ctx, c.tensorboardClient.ReadTensorboardSize, req, settings.GRPC, c.logger, "ReadTensorboardSize") 755 return err 756 }, opts...) 757 if err != nil { 758 return nil, err 759 } 760 return resp, nil 761 } 762 763 func (c *tensorboardGRPCClient) CreateTensorboardExperiment(ctx context.Context, req *aiplatformpb.CreateTensorboardExperimentRequest, opts ...gax.CallOption) (*aiplatformpb.TensorboardExperiment, error) { 764 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))} 765 766 hds = append(c.xGoogHeaders, hds...) 767 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) 768 opts = append((*c.CallOptions).CreateTensorboardExperiment[0:len((*c.CallOptions).CreateTensorboardExperiment):len((*c.CallOptions).CreateTensorboardExperiment)], opts...) 769 var resp *aiplatformpb.TensorboardExperiment 770 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { 771 var err error 772 resp, err = executeRPC(ctx, c.tensorboardClient.CreateTensorboardExperiment, req, settings.GRPC, c.logger, "CreateTensorboardExperiment") 773 return err 774 }, opts...) 775 if err != nil { 776 return nil, err 777 } 778 return resp, nil 779 } 780 781 func (c *tensorboardGRPCClient) GetTensorboardExperiment(ctx context.Context, req *aiplatformpb.GetTensorboardExperimentRequest, opts ...gax.CallOption) (*aiplatformpb.TensorboardExperiment, error) { 782 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))} 783 784 hds = append(c.xGoogHeaders, hds...) 785 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) 786 opts = append((*c.CallOptions).GetTensorboardExperiment[0:len((*c.CallOptions).GetTensorboardExperiment):len((*c.CallOptions).GetTensorboardExperiment)], opts...) 787 var resp *aiplatformpb.TensorboardExperiment 788 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { 789 var err error 790 resp, err = executeRPC(ctx, c.tensorboardClient.GetTensorboardExperiment, req, settings.GRPC, c.logger, "GetTensorboardExperiment") 791 return err 792 }, opts...) 793 if err != nil { 794 return nil, err 795 } 796 return resp, nil 797 } 798 799 func (c *tensorboardGRPCClient) UpdateTensorboardExperiment(ctx context.Context, req *aiplatformpb.UpdateTensorboardExperimentRequest, opts ...gax.CallOption) (*aiplatformpb.TensorboardExperiment, error) { 800 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "tensorboard_experiment.name", url.QueryEscape(req.GetTensorboardExperiment().GetName()))} 801 802 hds = append(c.xGoogHeaders, hds...) 803 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) 804 opts = append((*c.CallOptions).UpdateTensorboardExperiment[0:len((*c.CallOptions).UpdateTensorboardExperiment):len((*c.CallOptions).UpdateTensorboardExperiment)], opts...) 805 var resp *aiplatformpb.TensorboardExperiment 806 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { 807 var err error 808 resp, err = executeRPC(ctx, c.tensorboardClient.UpdateTensorboardExperiment, req, settings.GRPC, c.logger, "UpdateTensorboardExperiment") 809 return err 810 }, opts...) 811 if err != nil { 812 return nil, err 813 } 814 return resp, nil 815 } 816 817 func (c *tensorboardGRPCClient) ListTensorboardExperiments(ctx context.Context, req *aiplatformpb.ListTensorboardExperimentsRequest, opts ...gax.CallOption) *TensorboardExperimentIterator { 818 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))} 819 820 hds = append(c.xGoogHeaders, hds...) 821 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) 822 opts = append((*c.CallOptions).ListTensorboardExperiments[0:len((*c.CallOptions).ListTensorboardExperiments):len((*c.CallOptions).ListTensorboardExperiments)], opts...) 823 it := &TensorboardExperimentIterator{} 824 req = proto.Clone(req).(*aiplatformpb.ListTensorboardExperimentsRequest) 825 it.InternalFetch = func(pageSize int, pageToken string) ([]*aiplatformpb.TensorboardExperiment, string, error) { 826 resp := &aiplatformpb.ListTensorboardExperimentsResponse{} 827 if pageToken != "" { 828 req.PageToken = pageToken 829 } 830 if pageSize > math.MaxInt32 { 831 req.PageSize = math.MaxInt32 832 } else if pageSize != 0 { 833 req.PageSize = int32(pageSize) 834 } 835 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { 836 var err error 837 resp, err = executeRPC(ctx, c.tensorboardClient.ListTensorboardExperiments, req, settings.GRPC, c.logger, "ListTensorboardExperiments") 838 return err 839 }, opts...) 840 if err != nil { 841 return nil, "", err 842 } 843 844 it.Response = resp 845 return resp.GetTensorboardExperiments(), resp.GetNextPageToken(), nil 846 } 847 fetch := func(pageSize int, pageToken string) (string, error) { 848 items, nextPageToken, err := it.InternalFetch(pageSize, pageToken) 849 if err != nil { 850 return "", err 851 } 852 it.items = append(it.items, items...) 853 return nextPageToken, nil 854 } 855 856 it.pageInfo, it.nextFunc = iterator.NewPageInfo(fetch, it.bufLen, it.takeBuf) 857 it.pageInfo.MaxSize = int(req.GetPageSize()) 858 it.pageInfo.Token = req.GetPageToken() 859 860 return it 861 } 862 863 func (c *tensorboardGRPCClient) DeleteTensorboardExperiment(ctx context.Context, req *aiplatformpb.DeleteTensorboardExperimentRequest, opts ...gax.CallOption) (*DeleteTensorboardExperimentOperation, error) { 864 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))} 865 866 hds = append(c.xGoogHeaders, hds...) 867 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) 868 opts = append((*c.CallOptions).DeleteTensorboardExperiment[0:len((*c.CallOptions).DeleteTensorboardExperiment):len((*c.CallOptions).DeleteTensorboardExperiment)], opts...) 869 var resp *longrunningpb.Operation 870 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { 871 var err error 872 resp, err = executeRPC(ctx, c.tensorboardClient.DeleteTensorboardExperiment, req, settings.GRPC, c.logger, "DeleteTensorboardExperiment") 873 return err 874 }, opts...) 875 if err != nil { 876 return nil, err 877 } 878 return &DeleteTensorboardExperimentOperation{ 879 lro: longrunning.InternalNewOperation(*c.LROClient, resp), 880 }, nil 881 } 882 883 func (c *tensorboardGRPCClient) CreateTensorboardRun(ctx context.Context, req *aiplatformpb.CreateTensorboardRunRequest, opts ...gax.CallOption) (*aiplatformpb.TensorboardRun, error) { 884 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))} 885 886 hds = append(c.xGoogHeaders, hds...) 887 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) 888 opts = append((*c.CallOptions).CreateTensorboardRun[0:len((*c.CallOptions).CreateTensorboardRun):len((*c.CallOptions).CreateTensorboardRun)], opts...) 889 var resp *aiplatformpb.TensorboardRun 890 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { 891 var err error 892 resp, err = executeRPC(ctx, c.tensorboardClient.CreateTensorboardRun, req, settings.GRPC, c.logger, "CreateTensorboardRun") 893 return err 894 }, opts...) 895 if err != nil { 896 return nil, err 897 } 898 return resp, nil 899 } 900 901 func (c *tensorboardGRPCClient) BatchCreateTensorboardRuns(ctx context.Context, req *aiplatformpb.BatchCreateTensorboardRunsRequest, opts ...gax.CallOption) (*aiplatformpb.BatchCreateTensorboardRunsResponse, error) { 902 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))} 903 904 hds = append(c.xGoogHeaders, hds...) 905 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) 906 opts = append((*c.CallOptions).BatchCreateTensorboardRuns[0:len((*c.CallOptions).BatchCreateTensorboardRuns):len((*c.CallOptions).BatchCreateTensorboardRuns)], opts...) 907 var resp *aiplatformpb.BatchCreateTensorboardRunsResponse 908 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { 909 var err error 910 resp, err = executeRPC(ctx, c.tensorboardClient.BatchCreateTensorboardRuns, req, settings.GRPC, c.logger, "BatchCreateTensorboardRuns") 911 return err 912 }, opts...) 913 if err != nil { 914 return nil, err 915 } 916 return resp, nil 917 } 918 919 func (c *tensorboardGRPCClient) GetTensorboardRun(ctx context.Context, req *aiplatformpb.GetTensorboardRunRequest, opts ...gax.CallOption) (*aiplatformpb.TensorboardRun, error) { 920 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))} 921 922 hds = append(c.xGoogHeaders, hds...) 923 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) 924 opts = append((*c.CallOptions).GetTensorboardRun[0:len((*c.CallOptions).GetTensorboardRun):len((*c.CallOptions).GetTensorboardRun)], opts...) 925 var resp *aiplatformpb.TensorboardRun 926 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { 927 var err error 928 resp, err = executeRPC(ctx, c.tensorboardClient.GetTensorboardRun, req, settings.GRPC, c.logger, "GetTensorboardRun") 929 return err 930 }, opts...) 931 if err != nil { 932 return nil, err 933 } 934 return resp, nil 935 } 936 937 func (c *tensorboardGRPCClient) UpdateTensorboardRun(ctx context.Context, req *aiplatformpb.UpdateTensorboardRunRequest, opts ...gax.CallOption) (*aiplatformpb.TensorboardRun, error) { 938 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "tensorboard_run.name", url.QueryEscape(req.GetTensorboardRun().GetName()))} 939 940 hds = append(c.xGoogHeaders, hds...) 941 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) 942 opts = append((*c.CallOptions).UpdateTensorboardRun[0:len((*c.CallOptions).UpdateTensorboardRun):len((*c.CallOptions).UpdateTensorboardRun)], opts...) 943 var resp *aiplatformpb.TensorboardRun 944 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { 945 var err error 946 resp, err = executeRPC(ctx, c.tensorboardClient.UpdateTensorboardRun, req, settings.GRPC, c.logger, "UpdateTensorboardRun") 947 return err 948 }, opts...) 949 if err != nil { 950 return nil, err 951 } 952 return resp, nil 953 } 954 955 func (c *tensorboardGRPCClient) ListTensorboardRuns(ctx context.Context, req *aiplatformpb.ListTensorboardRunsRequest, opts ...gax.CallOption) *TensorboardRunIterator { 956 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))} 957 958 hds = append(c.xGoogHeaders, hds...) 959 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) 960 opts = append((*c.CallOptions).ListTensorboardRuns[0:len((*c.CallOptions).ListTensorboardRuns):len((*c.CallOptions).ListTensorboardRuns)], opts...) 961 it := &TensorboardRunIterator{} 962 req = proto.Clone(req).(*aiplatformpb.ListTensorboardRunsRequest) 963 it.InternalFetch = func(pageSize int, pageToken string) ([]*aiplatformpb.TensorboardRun, string, error) { 964 resp := &aiplatformpb.ListTensorboardRunsResponse{} 965 if pageToken != "" { 966 req.PageToken = pageToken 967 } 968 if pageSize > math.MaxInt32 { 969 req.PageSize = math.MaxInt32 970 } else if pageSize != 0 { 971 req.PageSize = int32(pageSize) 972 } 973 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { 974 var err error 975 resp, err = executeRPC(ctx, c.tensorboardClient.ListTensorboardRuns, req, settings.GRPC, c.logger, "ListTensorboardRuns") 976 return err 977 }, opts...) 978 if err != nil { 979 return nil, "", err 980 } 981 982 it.Response = resp 983 return resp.GetTensorboardRuns(), resp.GetNextPageToken(), nil 984 } 985 fetch := func(pageSize int, pageToken string) (string, error) { 986 items, nextPageToken, err := it.InternalFetch(pageSize, pageToken) 987 if err != nil { 988 return "", err 989 } 990 it.items = append(it.items, items...) 991 return nextPageToken, nil 992 } 993 994 it.pageInfo, it.nextFunc = iterator.NewPageInfo(fetch, it.bufLen, it.takeBuf) 995 it.pageInfo.MaxSize = int(req.GetPageSize()) 996 it.pageInfo.Token = req.GetPageToken() 997 998 return it 999 } 1000 1001 func (c *tensorboardGRPCClient) DeleteTensorboardRun(ctx context.Context, req *aiplatformpb.DeleteTensorboardRunRequest, opts ...gax.CallOption) (*DeleteTensorboardRunOperation, error) { 1002 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))} 1003 1004 hds = append(c.xGoogHeaders, hds...) 1005 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) 1006 opts = append((*c.CallOptions).DeleteTensorboardRun[0:len((*c.CallOptions).DeleteTensorboardRun):len((*c.CallOptions).DeleteTensorboardRun)], opts...) 1007 var resp *longrunningpb.Operation 1008 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { 1009 var err error 1010 resp, err = executeRPC(ctx, c.tensorboardClient.DeleteTensorboardRun, req, settings.GRPC, c.logger, "DeleteTensorboardRun") 1011 return err 1012 }, opts...) 1013 if err != nil { 1014 return nil, err 1015 } 1016 return &DeleteTensorboardRunOperation{ 1017 lro: longrunning.InternalNewOperation(*c.LROClient, resp), 1018 }, nil 1019 } 1020 1021 func (c *tensorboardGRPCClient) BatchCreateTensorboardTimeSeries(ctx context.Context, req *aiplatformpb.BatchCreateTensorboardTimeSeriesRequest, opts ...gax.CallOption) (*aiplatformpb.BatchCreateTensorboardTimeSeriesResponse, error) { 1022 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))} 1023 1024 hds = append(c.xGoogHeaders, hds...) 1025 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) 1026 opts = append((*c.CallOptions).BatchCreateTensorboardTimeSeries[0:len((*c.CallOptions).BatchCreateTensorboardTimeSeries):len((*c.CallOptions).BatchCreateTensorboardTimeSeries)], opts...) 1027 var resp *aiplatformpb.BatchCreateTensorboardTimeSeriesResponse 1028 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { 1029 var err error 1030 resp, err = executeRPC(ctx, c.tensorboardClient.BatchCreateTensorboardTimeSeries, req, settings.GRPC, c.logger, "BatchCreateTensorboardTimeSeries") 1031 return err 1032 }, opts...) 1033 if err != nil { 1034 return nil, err 1035 } 1036 return resp, nil 1037 } 1038 1039 func (c *tensorboardGRPCClient) CreateTensorboardTimeSeries(ctx context.Context, req *aiplatformpb.CreateTensorboardTimeSeriesRequest, opts ...gax.CallOption) (*aiplatformpb.TensorboardTimeSeries, error) { 1040 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))} 1041 1042 hds = append(c.xGoogHeaders, hds...) 1043 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) 1044 opts = append((*c.CallOptions).CreateTensorboardTimeSeries[0:len((*c.CallOptions).CreateTensorboardTimeSeries):len((*c.CallOptions).CreateTensorboardTimeSeries)], opts...) 1045 var resp *aiplatformpb.TensorboardTimeSeries 1046 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { 1047 var err error 1048 resp, err = executeRPC(ctx, c.tensorboardClient.CreateTensorboardTimeSeries, req, settings.GRPC, c.logger, "CreateTensorboardTimeSeries") 1049 return err 1050 }, opts...) 1051 if err != nil { 1052 return nil, err 1053 } 1054 return resp, nil 1055 } 1056 1057 func (c *tensorboardGRPCClient) GetTensorboardTimeSeries(ctx context.Context, req *aiplatformpb.GetTensorboardTimeSeriesRequest, opts ...gax.CallOption) (*aiplatformpb.TensorboardTimeSeries, error) { 1058 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))} 1059 1060 hds = append(c.xGoogHeaders, hds...) 1061 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) 1062 opts = append((*c.CallOptions).GetTensorboardTimeSeries[0:len((*c.CallOptions).GetTensorboardTimeSeries):len((*c.CallOptions).GetTensorboardTimeSeries)], opts...) 1063 var resp *aiplatformpb.TensorboardTimeSeries 1064 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { 1065 var err error 1066 resp, err = executeRPC(ctx, c.tensorboardClient.GetTensorboardTimeSeries, req, settings.GRPC, c.logger, "GetTensorboardTimeSeries") 1067 return err 1068 }, opts...) 1069 if err != nil { 1070 return nil, err 1071 } 1072 return resp, nil 1073 } 1074 1075 func (c *tensorboardGRPCClient) UpdateTensorboardTimeSeries(ctx context.Context, req *aiplatformpb.UpdateTensorboardTimeSeriesRequest, opts ...gax.CallOption) (*aiplatformpb.TensorboardTimeSeries, error) { 1076 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "tensorboard_time_series.name", url.QueryEscape(req.GetTensorboardTimeSeries().GetName()))} 1077 1078 hds = append(c.xGoogHeaders, hds...) 1079 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) 1080 opts = append((*c.CallOptions).UpdateTensorboardTimeSeries[0:len((*c.CallOptions).UpdateTensorboardTimeSeries):len((*c.CallOptions).UpdateTensorboardTimeSeries)], opts...) 1081 var resp *aiplatformpb.TensorboardTimeSeries 1082 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { 1083 var err error 1084 resp, err = executeRPC(ctx, c.tensorboardClient.UpdateTensorboardTimeSeries, req, settings.GRPC, c.logger, "UpdateTensorboardTimeSeries") 1085 return err 1086 }, opts...) 1087 if err != nil { 1088 return nil, err 1089 } 1090 return resp, nil 1091 } 1092 1093 func (c *tensorboardGRPCClient) ListTensorboardTimeSeries(ctx context.Context, req *aiplatformpb.ListTensorboardTimeSeriesRequest, opts ...gax.CallOption) *TensorboardTimeSeriesIterator { 1094 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))} 1095 1096 hds = append(c.xGoogHeaders, hds...) 1097 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) 1098 opts = append((*c.CallOptions).ListTensorboardTimeSeries[0:len((*c.CallOptions).ListTensorboardTimeSeries):len((*c.CallOptions).ListTensorboardTimeSeries)], opts...) 1099 it := &TensorboardTimeSeriesIterator{} 1100 req = proto.Clone(req).(*aiplatformpb.ListTensorboardTimeSeriesRequest) 1101 it.InternalFetch = func(pageSize int, pageToken string) ([]*aiplatformpb.TensorboardTimeSeries, string, error) { 1102 resp := &aiplatformpb.ListTensorboardTimeSeriesResponse{} 1103 if pageToken != "" { 1104 req.PageToken = pageToken 1105 } 1106 if pageSize > math.MaxInt32 { 1107 req.PageSize = math.MaxInt32 1108 } else if pageSize != 0 { 1109 req.PageSize = int32(pageSize) 1110 } 1111 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { 1112 var err error 1113 resp, err = executeRPC(ctx, c.tensorboardClient.ListTensorboardTimeSeries, req, settings.GRPC, c.logger, "ListTensorboardTimeSeries") 1114 return err 1115 }, opts...) 1116 if err != nil { 1117 return nil, "", err 1118 } 1119 1120 it.Response = resp 1121 return resp.GetTensorboardTimeSeries(), resp.GetNextPageToken(), nil 1122 } 1123 fetch := func(pageSize int, pageToken string) (string, error) { 1124 items, nextPageToken, err := it.InternalFetch(pageSize, pageToken) 1125 if err != nil { 1126 return "", err 1127 } 1128 it.items = append(it.items, items...) 1129 return nextPageToken, nil 1130 } 1131 1132 it.pageInfo, it.nextFunc = iterator.NewPageInfo(fetch, it.bufLen, it.takeBuf) 1133 it.pageInfo.MaxSize = int(req.GetPageSize()) 1134 it.pageInfo.Token = req.GetPageToken() 1135 1136 return it 1137 } 1138 1139 func (c *tensorboardGRPCClient) DeleteTensorboardTimeSeries(ctx context.Context, req *aiplatformpb.DeleteTensorboardTimeSeriesRequest, opts ...gax.CallOption) (*DeleteTensorboardTimeSeriesOperation, error) { 1140 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))} 1141 1142 hds = append(c.xGoogHeaders, hds...) 1143 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) 1144 opts = append((*c.CallOptions).DeleteTensorboardTimeSeries[0:len((*c.CallOptions).DeleteTensorboardTimeSeries):len((*c.CallOptions).DeleteTensorboardTimeSeries)], opts...) 1145 var resp *longrunningpb.Operation 1146 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { 1147 var err error 1148 resp, err = executeRPC(ctx, c.tensorboardClient.DeleteTensorboardTimeSeries, req, settings.GRPC, c.logger, "DeleteTensorboardTimeSeries") 1149 return err 1150 }, opts...) 1151 if err != nil { 1152 return nil, err 1153 } 1154 return &DeleteTensorboardTimeSeriesOperation{ 1155 lro: longrunning.InternalNewOperation(*c.LROClient, resp), 1156 }, nil 1157 } 1158 1159 func (c *tensorboardGRPCClient) BatchReadTensorboardTimeSeriesData(ctx context.Context, req *aiplatformpb.BatchReadTensorboardTimeSeriesDataRequest, opts ...gax.CallOption) (*aiplatformpb.BatchReadTensorboardTimeSeriesDataResponse, error) { 1160 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "tensorboard", url.QueryEscape(req.GetTensorboard()))} 1161 1162 hds = append(c.xGoogHeaders, hds...) 1163 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) 1164 opts = append((*c.CallOptions).BatchReadTensorboardTimeSeriesData[0:len((*c.CallOptions).BatchReadTensorboardTimeSeriesData):len((*c.CallOptions).BatchReadTensorboardTimeSeriesData)], opts...) 1165 var resp *aiplatformpb.BatchReadTensorboardTimeSeriesDataResponse 1166 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { 1167 var err error 1168 resp, err = executeRPC(ctx, c.tensorboardClient.BatchReadTensorboardTimeSeriesData, req, settings.GRPC, c.logger, "BatchReadTensorboardTimeSeriesData") 1169 return err 1170 }, opts...) 1171 if err != nil { 1172 return nil, err 1173 } 1174 return resp, nil 1175 } 1176 1177 func (c *tensorboardGRPCClient) ReadTensorboardTimeSeriesData(ctx context.Context, req *aiplatformpb.ReadTensorboardTimeSeriesDataRequest, opts ...gax.CallOption) (*aiplatformpb.ReadTensorboardTimeSeriesDataResponse, error) { 1178 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "tensorboard_time_series", url.QueryEscape(req.GetTensorboardTimeSeries()))} 1179 1180 hds = append(c.xGoogHeaders, hds...) 1181 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) 1182 opts = append((*c.CallOptions).ReadTensorboardTimeSeriesData[0:len((*c.CallOptions).ReadTensorboardTimeSeriesData):len((*c.CallOptions).ReadTensorboardTimeSeriesData)], opts...) 1183 var resp *aiplatformpb.ReadTensorboardTimeSeriesDataResponse 1184 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { 1185 var err error 1186 resp, err = executeRPC(ctx, c.tensorboardClient.ReadTensorboardTimeSeriesData, req, settings.GRPC, c.logger, "ReadTensorboardTimeSeriesData") 1187 return err 1188 }, opts...) 1189 if err != nil { 1190 return nil, err 1191 } 1192 return resp, nil 1193 } 1194 1195 func (c *tensorboardGRPCClient) ReadTensorboardBlobData(ctx context.Context, req *aiplatformpb.ReadTensorboardBlobDataRequest, opts ...gax.CallOption) (aiplatformpb.TensorboardService_ReadTensorboardBlobDataClient, error) { 1196 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "time_series", url.QueryEscape(req.GetTimeSeries()))} 1197 1198 hds = append(c.xGoogHeaders, hds...) 1199 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) 1200 opts = append((*c.CallOptions).ReadTensorboardBlobData[0:len((*c.CallOptions).ReadTensorboardBlobData):len((*c.CallOptions).ReadTensorboardBlobData)], opts...) 1201 var resp aiplatformpb.TensorboardService_ReadTensorboardBlobDataClient 1202 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { 1203 var err error 1204 c.logger.DebugContext(ctx, "api streaming client request", "serviceName", serviceName, "rpcName", "ReadTensorboardBlobData") 1205 resp, err = c.tensorboardClient.ReadTensorboardBlobData(ctx, req, settings.GRPC...) 1206 c.logger.DebugContext(ctx, "api streaming client response", "serviceName", serviceName, "rpcName", "ReadTensorboardBlobData") 1207 return err 1208 }, opts...) 1209 if err != nil { 1210 return nil, err 1211 } 1212 return resp, nil 1213 } 1214 1215 func (c *tensorboardGRPCClient) WriteTensorboardExperimentData(ctx context.Context, req *aiplatformpb.WriteTensorboardExperimentDataRequest, opts ...gax.CallOption) (*aiplatformpb.WriteTensorboardExperimentDataResponse, error) { 1216 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "tensorboard_experiment", url.QueryEscape(req.GetTensorboardExperiment()))} 1217 1218 hds = append(c.xGoogHeaders, hds...) 1219 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) 1220 opts = append((*c.CallOptions).WriteTensorboardExperimentData[0:len((*c.CallOptions).WriteTensorboardExperimentData):len((*c.CallOptions).WriteTensorboardExperimentData)], opts...) 1221 var resp *aiplatformpb.WriteTensorboardExperimentDataResponse 1222 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { 1223 var err error 1224 resp, err = executeRPC(ctx, c.tensorboardClient.WriteTensorboardExperimentData, req, settings.GRPC, c.logger, "WriteTensorboardExperimentData") 1225 return err 1226 }, opts...) 1227 if err != nil { 1228 return nil, err 1229 } 1230 return resp, nil 1231 } 1232 1233 func (c *tensorboardGRPCClient) WriteTensorboardRunData(ctx context.Context, req *aiplatformpb.WriteTensorboardRunDataRequest, opts ...gax.CallOption) (*aiplatformpb.WriteTensorboardRunDataResponse, error) { 1234 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "tensorboard_run", url.QueryEscape(req.GetTensorboardRun()))} 1235 1236 hds = append(c.xGoogHeaders, hds...) 1237 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) 1238 opts = append((*c.CallOptions).WriteTensorboardRunData[0:len((*c.CallOptions).WriteTensorboardRunData):len((*c.CallOptions).WriteTensorboardRunData)], opts...) 1239 var resp *aiplatformpb.WriteTensorboardRunDataResponse 1240 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { 1241 var err error 1242 resp, err = executeRPC(ctx, c.tensorboardClient.WriteTensorboardRunData, req, settings.GRPC, c.logger, "WriteTensorboardRunData") 1243 return err 1244 }, opts...) 1245 if err != nil { 1246 return nil, err 1247 } 1248 return resp, nil 1249 } 1250 1251 func (c *tensorboardGRPCClient) ExportTensorboardTimeSeriesData(ctx context.Context, req *aiplatformpb.ExportTensorboardTimeSeriesDataRequest, opts ...gax.CallOption) *TimeSeriesDataPointIterator { 1252 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "tensorboard_time_series", url.QueryEscape(req.GetTensorboardTimeSeries()))} 1253 1254 hds = append(c.xGoogHeaders, hds...) 1255 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) 1256 opts = append((*c.CallOptions).ExportTensorboardTimeSeriesData[0:len((*c.CallOptions).ExportTensorboardTimeSeriesData):len((*c.CallOptions).ExportTensorboardTimeSeriesData)], opts...) 1257 it := &TimeSeriesDataPointIterator{} 1258 req = proto.Clone(req).(*aiplatformpb.ExportTensorboardTimeSeriesDataRequest) 1259 it.InternalFetch = func(pageSize int, pageToken string) ([]*aiplatformpb.TimeSeriesDataPoint, string, error) { 1260 resp := &aiplatformpb.ExportTensorboardTimeSeriesDataResponse{} 1261 if pageToken != "" { 1262 req.PageToken = pageToken 1263 } 1264 if pageSize > math.MaxInt32 { 1265 req.PageSize = math.MaxInt32 1266 } else if pageSize != 0 { 1267 req.PageSize = int32(pageSize) 1268 } 1269 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { 1270 var err error 1271 resp, err = executeRPC(ctx, c.tensorboardClient.ExportTensorboardTimeSeriesData, req, settings.GRPC, c.logger, "ExportTensorboardTimeSeriesData") 1272 return err 1273 }, opts...) 1274 if err != nil { 1275 return nil, "", err 1276 } 1277 1278 it.Response = resp 1279 return resp.GetTimeSeriesDataPoints(), resp.GetNextPageToken(), nil 1280 } 1281 fetch := func(pageSize int, pageToken string) (string, error) { 1282 items, nextPageToken, err := it.InternalFetch(pageSize, pageToken) 1283 if err != nil { 1284 return "", err 1285 } 1286 it.items = append(it.items, items...) 1287 return nextPageToken, nil 1288 } 1289 1290 it.pageInfo, it.nextFunc = iterator.NewPageInfo(fetch, it.bufLen, it.takeBuf) 1291 it.pageInfo.MaxSize = int(req.GetPageSize()) 1292 it.pageInfo.Token = req.GetPageToken() 1293 1294 return it 1295 } 1296 1297 func (c *tensorboardGRPCClient) GetLocation(ctx context.Context, req *locationpb.GetLocationRequest, opts ...gax.CallOption) (*locationpb.Location, error) { 1298 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))} 1299 1300 hds = append(c.xGoogHeaders, hds...) 1301 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) 1302 opts = append((*c.CallOptions).GetLocation[0:len((*c.CallOptions).GetLocation):len((*c.CallOptions).GetLocation)], opts...) 1303 var resp *locationpb.Location 1304 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { 1305 var err error 1306 resp, err = executeRPC(ctx, c.locationsClient.GetLocation, req, settings.GRPC, c.logger, "GetLocation") 1307 return err 1308 }, opts...) 1309 if err != nil { 1310 return nil, err 1311 } 1312 return resp, nil 1313 } 1314 1315 func (c *tensorboardGRPCClient) ListLocations(ctx context.Context, req *locationpb.ListLocationsRequest, opts ...gax.CallOption) *LocationIterator { 1316 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))} 1317 1318 hds = append(c.xGoogHeaders, hds...) 1319 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) 1320 opts = append((*c.CallOptions).ListLocations[0:len((*c.CallOptions).ListLocations):len((*c.CallOptions).ListLocations)], opts...) 1321 it := &LocationIterator{} 1322 req = proto.Clone(req).(*locationpb.ListLocationsRequest) 1323 it.InternalFetch = func(pageSize int, pageToken string) ([]*locationpb.Location, string, error) { 1324 resp := &locationpb.ListLocationsResponse{} 1325 if pageToken != "" { 1326 req.PageToken = pageToken 1327 } 1328 if pageSize > math.MaxInt32 { 1329 req.PageSize = math.MaxInt32 1330 } else if pageSize != 0 { 1331 req.PageSize = int32(pageSize) 1332 } 1333 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { 1334 var err error 1335 resp, err = executeRPC(ctx, c.locationsClient.ListLocations, req, settings.GRPC, c.logger, "ListLocations") 1336 return err 1337 }, opts...) 1338 if err != nil { 1339 return nil, "", err 1340 } 1341 1342 it.Response = resp 1343 return resp.GetLocations(), resp.GetNextPageToken(), nil 1344 } 1345 fetch := func(pageSize int, pageToken string) (string, error) { 1346 items, nextPageToken, err := it.InternalFetch(pageSize, pageToken) 1347 if err != nil { 1348 return "", err 1349 } 1350 it.items = append(it.items, items...) 1351 return nextPageToken, nil 1352 } 1353 1354 it.pageInfo, it.nextFunc = iterator.NewPageInfo(fetch, it.bufLen, it.takeBuf) 1355 it.pageInfo.MaxSize = int(req.GetPageSize()) 1356 it.pageInfo.Token = req.GetPageToken() 1357 1358 return it 1359 } 1360 1361 func (c *tensorboardGRPCClient) GetIamPolicy(ctx context.Context, req *iampb.GetIamPolicyRequest, opts ...gax.CallOption) (*iampb.Policy, error) { 1362 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "resource", url.QueryEscape(req.GetResource()))} 1363 1364 hds = append(c.xGoogHeaders, hds...) 1365 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) 1366 opts = append((*c.CallOptions).GetIamPolicy[0:len((*c.CallOptions).GetIamPolicy):len((*c.CallOptions).GetIamPolicy)], opts...) 1367 var resp *iampb.Policy 1368 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { 1369 var err error 1370 resp, err = executeRPC(ctx, c.iamPolicyClient.GetIamPolicy, req, settings.GRPC, c.logger, "GetIamPolicy") 1371 return err 1372 }, opts...) 1373 if err != nil { 1374 return nil, err 1375 } 1376 return resp, nil 1377 } 1378 1379 func (c *tensorboardGRPCClient) SetIamPolicy(ctx context.Context, req *iampb.SetIamPolicyRequest, opts ...gax.CallOption) (*iampb.Policy, error) { 1380 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "resource", url.QueryEscape(req.GetResource()))} 1381 1382 hds = append(c.xGoogHeaders, hds...) 1383 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) 1384 opts = append((*c.CallOptions).SetIamPolicy[0:len((*c.CallOptions).SetIamPolicy):len((*c.CallOptions).SetIamPolicy)], opts...) 1385 var resp *iampb.Policy 1386 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { 1387 var err error 1388 resp, err = executeRPC(ctx, c.iamPolicyClient.SetIamPolicy, req, settings.GRPC, c.logger, "SetIamPolicy") 1389 return err 1390 }, opts...) 1391 if err != nil { 1392 return nil, err 1393 } 1394 return resp, nil 1395 } 1396 1397 func (c *tensorboardGRPCClient) TestIamPermissions(ctx context.Context, req *iampb.TestIamPermissionsRequest, opts ...gax.CallOption) (*iampb.TestIamPermissionsResponse, error) { 1398 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "resource", url.QueryEscape(req.GetResource()))} 1399 1400 hds = append(c.xGoogHeaders, hds...) 1401 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) 1402 opts = append((*c.CallOptions).TestIamPermissions[0:len((*c.CallOptions).TestIamPermissions):len((*c.CallOptions).TestIamPermissions)], opts...) 1403 var resp *iampb.TestIamPermissionsResponse 1404 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { 1405 var err error 1406 resp, err = executeRPC(ctx, c.iamPolicyClient.TestIamPermissions, req, settings.GRPC, c.logger, "TestIamPermissions") 1407 return err 1408 }, opts...) 1409 if err != nil { 1410 return nil, err 1411 } 1412 return resp, nil 1413 } 1414 1415 func (c *tensorboardGRPCClient) CancelOperation(ctx context.Context, req *longrunningpb.CancelOperationRequest, opts ...gax.CallOption) error { 1416 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))} 1417 1418 hds = append(c.xGoogHeaders, hds...) 1419 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) 1420 opts = append((*c.CallOptions).CancelOperation[0:len((*c.CallOptions).CancelOperation):len((*c.CallOptions).CancelOperation)], opts...) 1421 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { 1422 var err error 1423 _, err = executeRPC(ctx, c.operationsClient.CancelOperation, req, settings.GRPC, c.logger, "CancelOperation") 1424 return err 1425 }, opts...) 1426 return err 1427 } 1428 1429 func (c *tensorboardGRPCClient) DeleteOperation(ctx context.Context, req *longrunningpb.DeleteOperationRequest, opts ...gax.CallOption) error { 1430 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))} 1431 1432 hds = append(c.xGoogHeaders, hds...) 1433 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) 1434 opts = append((*c.CallOptions).DeleteOperation[0:len((*c.CallOptions).DeleteOperation):len((*c.CallOptions).DeleteOperation)], opts...) 1435 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { 1436 var err error 1437 _, err = executeRPC(ctx, c.operationsClient.DeleteOperation, req, settings.GRPC, c.logger, "DeleteOperation") 1438 return err 1439 }, opts...) 1440 return err 1441 } 1442 1443 func (c *tensorboardGRPCClient) GetOperation(ctx context.Context, req *longrunningpb.GetOperationRequest, opts ...gax.CallOption) (*longrunningpb.Operation, error) { 1444 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))} 1445 1446 hds = append(c.xGoogHeaders, hds...) 1447 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) 1448 opts = append((*c.CallOptions).GetOperation[0:len((*c.CallOptions).GetOperation):len((*c.CallOptions).GetOperation)], opts...) 1449 var resp *longrunningpb.Operation 1450 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { 1451 var err error 1452 resp, err = executeRPC(ctx, c.operationsClient.GetOperation, req, settings.GRPC, c.logger, "GetOperation") 1453 return err 1454 }, opts...) 1455 if err != nil { 1456 return nil, err 1457 } 1458 return resp, nil 1459 } 1460 1461 func (c *tensorboardGRPCClient) ListOperations(ctx context.Context, req *longrunningpb.ListOperationsRequest, opts ...gax.CallOption) *OperationIterator { 1462 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))} 1463 1464 hds = append(c.xGoogHeaders, hds...) 1465 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) 1466 opts = append((*c.CallOptions).ListOperations[0:len((*c.CallOptions).ListOperations):len((*c.CallOptions).ListOperations)], opts...) 1467 it := &OperationIterator{} 1468 req = proto.Clone(req).(*longrunningpb.ListOperationsRequest) 1469 it.InternalFetch = func(pageSize int, pageToken string) ([]*longrunningpb.Operation, string, error) { 1470 resp := &longrunningpb.ListOperationsResponse{} 1471 if pageToken != "" { 1472 req.PageToken = pageToken 1473 } 1474 if pageSize > math.MaxInt32 { 1475 req.PageSize = math.MaxInt32 1476 } else if pageSize != 0 { 1477 req.PageSize = int32(pageSize) 1478 } 1479 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { 1480 var err error 1481 resp, err = executeRPC(ctx, c.operationsClient.ListOperations, req, settings.GRPC, c.logger, "ListOperations") 1482 return err 1483 }, opts...) 1484 if err != nil { 1485 return nil, "", err 1486 } 1487 1488 it.Response = resp 1489 return resp.GetOperations(), resp.GetNextPageToken(), nil 1490 } 1491 fetch := func(pageSize int, pageToken string) (string, error) { 1492 items, nextPageToken, err := it.InternalFetch(pageSize, pageToken) 1493 if err != nil { 1494 return "", err 1495 } 1496 it.items = append(it.items, items...) 1497 return nextPageToken, nil 1498 } 1499 1500 it.pageInfo, it.nextFunc = iterator.NewPageInfo(fetch, it.bufLen, it.takeBuf) 1501 it.pageInfo.MaxSize = int(req.GetPageSize()) 1502 it.pageInfo.Token = req.GetPageToken() 1503 1504 return it 1505 } 1506 1507 func (c *tensorboardGRPCClient) WaitOperation(ctx context.Context, req *longrunningpb.WaitOperationRequest, opts ...gax.CallOption) (*longrunningpb.Operation, error) { 1508 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))} 1509 1510 hds = append(c.xGoogHeaders, hds...) 1511 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) 1512 opts = append((*c.CallOptions).WaitOperation[0:len((*c.CallOptions).WaitOperation):len((*c.CallOptions).WaitOperation)], opts...) 1513 var resp *longrunningpb.Operation 1514 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { 1515 var err error 1516 resp, err = executeRPC(ctx, c.operationsClient.WaitOperation, req, settings.GRPC, c.logger, "WaitOperation") 1517 return err 1518 }, opts...) 1519 if err != nil { 1520 return nil, err 1521 } 1522 return resp, nil 1523 } 1524 1525 // CreateTensorboardOperation returns a new CreateTensorboardOperation from a given name. 1526 // The name must be that of a previously created CreateTensorboardOperation, possibly from a different process. 1527 func (c *tensorboardGRPCClient) CreateTensorboardOperation(name string) *CreateTensorboardOperation { 1528 return &CreateTensorboardOperation{ 1529 lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}), 1530 } 1531 } 1532 1533 // DeleteTensorboardOperation returns a new DeleteTensorboardOperation from a given name. 1534 // The name must be that of a previously created DeleteTensorboardOperation, possibly from a different process. 1535 func (c *tensorboardGRPCClient) DeleteTensorboardOperation(name string) *DeleteTensorboardOperation { 1536 return &DeleteTensorboardOperation{ 1537 lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}), 1538 } 1539 } 1540 1541 // DeleteTensorboardExperimentOperation returns a new DeleteTensorboardExperimentOperation from a given name. 1542 // The name must be that of a previously created DeleteTensorboardExperimentOperation, possibly from a different process. 1543 func (c *tensorboardGRPCClient) DeleteTensorboardExperimentOperation(name string) *DeleteTensorboardExperimentOperation { 1544 return &DeleteTensorboardExperimentOperation{ 1545 lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}), 1546 } 1547 } 1548 1549 // DeleteTensorboardRunOperation returns a new DeleteTensorboardRunOperation from a given name. 1550 // The name must be that of a previously created DeleteTensorboardRunOperation, possibly from a different process. 1551 func (c *tensorboardGRPCClient) DeleteTensorboardRunOperation(name string) *DeleteTensorboardRunOperation { 1552 return &DeleteTensorboardRunOperation{ 1553 lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}), 1554 } 1555 } 1556 1557 // DeleteTensorboardTimeSeriesOperation returns a new DeleteTensorboardTimeSeriesOperation from a given name. 1558 // The name must be that of a previously created DeleteTensorboardTimeSeriesOperation, possibly from a different process. 1559 func (c *tensorboardGRPCClient) DeleteTensorboardTimeSeriesOperation(name string) *DeleteTensorboardTimeSeriesOperation { 1560 return &DeleteTensorboardTimeSeriesOperation{ 1561 lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}), 1562 } 1563 } 1564 1565 // UpdateTensorboardOperation returns a new UpdateTensorboardOperation from a given name. 1566 // The name must be that of a previously created UpdateTensorboardOperation, possibly from a different process. 1567 func (c *tensorboardGRPCClient) UpdateTensorboardOperation(name string) *UpdateTensorboardOperation { 1568 return &UpdateTensorboardOperation{ 1569 lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}), 1570 } 1571 }