| 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 visionai_test |
| 18 |
|
| 19 |
import ( |
| 20 |
"context" |
| 21 |
"io" |
| 22 |
|
| 23 |
longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb" |
| 24 |
visionai "cloud.google.com/go/visionai/apiv1" |
| 25 |
visionaipb "cloud.google.com/go/visionai/apiv1/visionaipb" |
| 26 |
"google.golang.org/api/iterator" |
| 27 |
) |
| 28 |
|
| 29 |
func ExampleNewWarehouseClient() { |
| 30 |
ctx := context.Background() |
| 31 |
// This snippet has been automatically generated and should be regarded as a code template only. |
| 32 |
// It will require modifications to work: |
| 33 |
// - It may require correct/in-range values for request initialization. |
| 34 |
// - It may require specifying regional endpoints when creating the service client as shown in: |
| 35 |
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options |
| 36 |
c, err := visionai.NewWarehouseClient(ctx) |
| 37 |
if err != nil { |
| 38 |
// TODO: Handle error. |
| 39 |
} |
| 40 |
defer c.Close() |
| 41 |
|
| 42 |
// TODO: Use client. |
| 43 |
_ = c |
| 44 |
} |
| 45 |
|
| 46 |
func ExampleNewWarehouseRESTClient() { |
| 47 |
ctx := context.Background() |
| 48 |
// This snippet has been automatically generated and should be regarded as a code template only. |
| 49 |
// It will require modifications to work: |
| 50 |
// - It may require correct/in-range values for request initialization. |
| 51 |
// - It may require specifying regional endpoints when creating the service client as shown in: |
| 52 |
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options |
| 53 |
c, err := visionai.NewWarehouseRESTClient(ctx) |
| 54 |
if err != nil { |
| 55 |
// TODO: Handle error. |
| 56 |
} |
| 57 |
defer c.Close() |
| 58 |
|
| 59 |
// TODO: Use client. |
| 60 |
_ = c |
| 61 |
} |
| 62 |
|
| 63 |
func ExampleWarehouseClient_AddCollectionItem() { |
| 64 |
ctx := context.Background() |
| 65 |
// This snippet has been automatically generated and should be regarded as a code template only. |
| 66 |
// It will require modifications to work: |
| 67 |
// - It may require correct/in-range values for request initialization. |
| 68 |
// - It may require specifying regional endpoints when creating the service client as shown in: |
| 69 |
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options |
| 70 |
c, err := visionai.NewWarehouseClient(ctx) |
| 71 |
if err != nil { |
| 72 |
// TODO: Handle error. |
| 73 |
} |
| 74 |
defer c.Close() |
| 75 |
|
| 76 |
req := &visionaipb.AddCollectionItemRequest{ |
| 77 |
// TODO: Fill request struct fields. |
| 78 |
// See https://pkg.go.dev/cloud.google.com/go/visionai/apiv1/visionaipb#AddCollectionItemRequest. |
| 79 |
} |
| 80 |
resp, err := c.AddCollectionItem(ctx, req) |
| 81 |
if err != nil { |
| 82 |
// TODO: Handle error. |
| 83 |
} |
| 84 |
// TODO: Use resp. |
| 85 |
_ = resp |
| 86 |
} |
| 87 |
|
| 88 |
func ExampleWarehouseClient_AnalyzeAsset() { |
| 89 |
ctx := context.Background() |
| 90 |
// This snippet has been automatically generated and should be regarded as a code template only. |
| 91 |
// It will require modifications to work: |
| 92 |
// - It may require correct/in-range values for request initialization. |
| 93 |
// - It may require specifying regional endpoints when creating the service client as shown in: |
| 94 |
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options |
| 95 |
c, err := visionai.NewWarehouseClient(ctx) |
| 96 |
if err != nil { |
| 97 |
// TODO: Handle error. |
| 98 |
} |
| 99 |
defer c.Close() |
| 100 |
|
| 101 |
req := &visionaipb.AnalyzeAssetRequest{ |
| 102 |
// TODO: Fill request struct fields. |
| 103 |
// See https://pkg.go.dev/cloud.google.com/go/visionai/apiv1/visionaipb#AnalyzeAssetRequest. |
| 104 |
} |
| 105 |
op, err := c.AnalyzeAsset(ctx, req) |
| 106 |
if err != nil { |
| 107 |
// TODO: Handle error. |
| 108 |
} |
| 109 |
|
| 110 |
resp, err := op.Wait(ctx) |
| 111 |
if err != nil { |
| 112 |
// TODO: Handle error. |
| 113 |
} |
| 114 |
// TODO: Use resp. |
| 115 |
_ = resp |
| 116 |
} |
| 117 |
|
| 118 |
func ExampleWarehouseClient_AnalyzeCorpus() { |
| 119 |
ctx := context.Background() |
| 120 |
// This snippet has been automatically generated and should be regarded as a code template only. |
| 121 |
// It will require modifications to work: |
| 122 |
// - It may require correct/in-range values for request initialization. |
| 123 |
// - It may require specifying regional endpoints when creating the service client as shown in: |
| 124 |
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options |
| 125 |
c, err := visionai.NewWarehouseClient(ctx) |
| 126 |
if err != nil { |
| 127 |
// TODO: Handle error. |
| 128 |
} |
| 129 |
defer c.Close() |
| 130 |
|
| 131 |
req := &visionaipb.AnalyzeCorpusRequest{ |
| 132 |
// TODO: Fill request struct fields. |
| 133 |
// See https://pkg.go.dev/cloud.google.com/go/visionai/apiv1/visionaipb#AnalyzeCorpusRequest. |
| 134 |
} |
| 135 |
op, err := c.AnalyzeCorpus(ctx, req) |
| 136 |
if err != nil { |
| 137 |
// TODO: Handle error. |
| 138 |
} |
| 139 |
|
| 140 |
resp, err := op.Wait(ctx) |
| 141 |
if err != nil { |
| 142 |
// TODO: Handle error. |
| 143 |
} |
| 144 |
// TODO: Use resp. |
| 145 |
_ = resp |
| 146 |
} |
| 147 |
|
| 148 |
func ExampleWarehouseClient_ClipAsset() { |
| 149 |
ctx := context.Background() |
| 150 |
// This snippet has been automatically generated and should be regarded as a code template only. |
| 151 |
// It will require modifications to work: |
| 152 |
// - It may require correct/in-range values for request initialization. |
| 153 |
// - It may require specifying regional endpoints when creating the service client as shown in: |
| 154 |
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options |
| 155 |
c, err := visionai.NewWarehouseClient(ctx) |
| 156 |
if err != nil { |
| 157 |
// TODO: Handle error. |
| 158 |
} |
| 159 |
defer c.Close() |
| 160 |
|
| 161 |
req := &visionaipb.ClipAssetRequest{ |
| 162 |
// TODO: Fill request struct fields. |
| 163 |
// See https://pkg.go.dev/cloud.google.com/go/visionai/apiv1/visionaipb#ClipAssetRequest. |
| 164 |
} |
| 165 |
resp, err := c.ClipAsset(ctx, req) |
| 166 |
if err != nil { |
| 167 |
// TODO: Handle error. |
| 168 |
} |
| 169 |
// TODO: Use resp. |
| 170 |
_ = resp |
| 171 |
} |
| 172 |
|
| 173 |
func ExampleWarehouseClient_CreateAnnotation() { |
| 174 |
ctx := context.Background() |
| 175 |
// This snippet has been automatically generated and should be regarded as a code template only. |
| 176 |
// It will require modifications to work: |
| 177 |
// - It may require correct/in-range values for request initialization. |
| 178 |
// - It may require specifying regional endpoints when creating the service client as shown in: |
| 179 |
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options |
| 180 |
c, err := visionai.NewWarehouseClient(ctx) |
| 181 |
if err != nil { |
| 182 |
// TODO: Handle error. |
| 183 |
} |
| 184 |
defer c.Close() |
| 185 |
|
| 186 |
req := &visionaipb.CreateAnnotationRequest{ |
| 187 |
// TODO: Fill request struct fields. |
| 188 |
// See https://pkg.go.dev/cloud.google.com/go/visionai/apiv1/visionaipb#CreateAnnotationRequest. |
| 189 |
} |
| 190 |
resp, err := c.CreateAnnotation(ctx, req) |
| 191 |
if err != nil { |
| 192 |
// TODO: Handle error. |
| 193 |
} |
| 194 |
// TODO: Use resp. |
| 195 |
_ = resp |
| 196 |
} |
| 197 |
|
| 198 |
func ExampleWarehouseClient_CreateAsset() { |
| 199 |
ctx := context.Background() |
| 200 |
// This snippet has been automatically generated and should be regarded as a code template only. |
| 201 |
// It will require modifications to work: |
| 202 |
// - It may require correct/in-range values for request initialization. |
| 203 |
// - It may require specifying regional endpoints when creating the service client as shown in: |
| 204 |
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options |
| 205 |
c, err := visionai.NewWarehouseClient(ctx) |
| 206 |
if err != nil { |
| 207 |
// TODO: Handle error. |
| 208 |
} |
| 209 |
defer c.Close() |
| 210 |
|
| 211 |
req := &visionaipb.CreateAssetRequest{ |
| 212 |
// TODO: Fill request struct fields. |
| 213 |
// See https://pkg.go.dev/cloud.google.com/go/visionai/apiv1/visionaipb#CreateAssetRequest. |
| 214 |
} |
| 215 |
resp, err := c.CreateAsset(ctx, req) |
| 216 |
if err != nil { |
| 217 |
// TODO: Handle error. |
| 218 |
} |
| 219 |
// TODO: Use resp. |
| 220 |
_ = resp |
| 221 |
} |
| 222 |
|
| 223 |
func ExampleWarehouseClient_CreateCollection() { |
| 224 |
ctx := context.Background() |
| 225 |
// This snippet has been automatically generated and should be regarded as a code template only. |
| 226 |
// It will require modifications to work: |
| 227 |
// - It may require correct/in-range values for request initialization. |
| 228 |
// - It may require specifying regional endpoints when creating the service client as shown in: |
| 229 |
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options |
| 230 |
c, err := visionai.NewWarehouseClient(ctx) |
| 231 |
if err != nil { |
| 232 |
// TODO: Handle error. |
| 233 |
} |
| 234 |
defer c.Close() |
| 235 |
|
| 236 |
req := &visionaipb.CreateCollectionRequest{ |
| 237 |
// TODO: Fill request struct fields. |
| 238 |
// See https://pkg.go.dev/cloud.google.com/go/visionai/apiv1/visionaipb#CreateCollectionRequest. |
| 239 |
} |
| 240 |
op, err := c.CreateCollection(ctx, req) |
| 241 |
if err != nil { |
| 242 |
// TODO: Handle error. |
| 243 |
} |
| 244 |
|
| 245 |
resp, err := op.Wait(ctx) |
| 246 |
if err != nil { |
| 247 |
// TODO: Handle error. |
| 248 |
} |
| 249 |
// TODO: Use resp. |
| 250 |
_ = resp |
| 251 |
} |
| 252 |
|
| 253 |
func ExampleWarehouseClient_CreateCorpus() { |
| 254 |
ctx := context.Background() |
| 255 |
// This snippet has been automatically generated and should be regarded as a code template only. |
| 256 |
// It will require modifications to work: |
| 257 |
// - It may require correct/in-range values for request initialization. |
| 258 |
// - It may require specifying regional endpoints when creating the service client as shown in: |
| 259 |
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options |
| 260 |
c, err := visionai.NewWarehouseClient(ctx) |
| 261 |
if err != nil { |
| 262 |
// TODO: Handle error. |
| 263 |
} |
| 264 |
defer c.Close() |
| 265 |
|
| 266 |
req := &visionaipb.CreateCorpusRequest{ |
| 267 |
// TODO: Fill request struct fields. |
| 268 |
// See https://pkg.go.dev/cloud.google.com/go/visionai/apiv1/visionaipb#CreateCorpusRequest. |
| 269 |
} |
| 270 |
op, err := c.CreateCorpus(ctx, req) |
| 271 |
if err != nil { |
| 272 |
// TODO: Handle error. |
| 273 |
} |
| 274 |
|
| 275 |
resp, err := op.Wait(ctx) |
| 276 |
if err != nil { |
| 277 |
// TODO: Handle error. |
| 278 |
} |
| 279 |
// TODO: Use resp. |
| 280 |
_ = resp |
| 281 |
} |
| 282 |
|
| 283 |
func ExampleWarehouseClient_CreateDataSchema() { |
| 284 |
ctx := context.Background() |
| 285 |
// This snippet has been automatically generated and should be regarded as a code template only. |
| 286 |
// It will require modifications to work: |
| 287 |
// - It may require correct/in-range values for request initialization. |
| 288 |
// - It may require specifying regional endpoints when creating the service client as shown in: |
| 289 |
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options |
| 290 |
c, err := visionai.NewWarehouseClient(ctx) |
| 291 |
if err != nil { |
| 292 |
// TODO: Handle error. |
| 293 |
} |
| 294 |
defer c.Close() |
| 295 |
|
| 296 |
req := &visionaipb.CreateDataSchemaRequest{ |
| 297 |
// TODO: Fill request struct fields. |
| 298 |
// See https://pkg.go.dev/cloud.google.com/go/visionai/apiv1/visionaipb#CreateDataSchemaRequest. |
| 299 |
} |
| 300 |
resp, err := c.CreateDataSchema(ctx, req) |
| 301 |
if err != nil { |
| 302 |
// TODO: Handle error. |
| 303 |
} |
| 304 |
// TODO: Use resp. |
| 305 |
_ = resp |
| 306 |
} |
| 307 |
|
| 308 |
func ExampleWarehouseClient_CreateIndex() { |
| 309 |
ctx := context.Background() |
| 310 |
// This snippet has been automatically generated and should be regarded as a code template only. |
| 311 |
// It will require modifications to work: |
| 312 |
// - It may require correct/in-range values for request initialization. |
| 313 |
// - It may require specifying regional endpoints when creating the service client as shown in: |
| 314 |
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options |
| 315 |
c, err := visionai.NewWarehouseClient(ctx) |
| 316 |
if err != nil { |
| 317 |
// TODO: Handle error. |
| 318 |
} |
| 319 |
defer c.Close() |
| 320 |
|
| 321 |
req := &visionaipb.CreateIndexRequest{ |
| 322 |
// TODO: Fill request struct fields. |
| 323 |
// See https://pkg.go.dev/cloud.google.com/go/visionai/apiv1/visionaipb#CreateIndexRequest. |
| 324 |
} |
| 325 |
op, err := c.CreateIndex(ctx, req) |
| 326 |
if err != nil { |
| 327 |
// TODO: Handle error. |
| 328 |
} |
| 329 |
|
| 330 |
resp, err := op.Wait(ctx) |
| 331 |
if err != nil { |
| 332 |
// TODO: Handle error. |
| 333 |
} |
| 334 |
// TODO: Use resp. |
| 335 |
_ = resp |
| 336 |
} |
| 337 |
|
| 338 |
func ExampleWarehouseClient_CreateIndexEndpoint() { |
| 339 |
ctx := context.Background() |
| 340 |
// This snippet has been automatically generated and should be regarded as a code template only. |
| 341 |
// It will require modifications to work: |
| 342 |
// - It may require correct/in-range values for request initialization. |
| 343 |
// - It may require specifying regional endpoints when creating the service client as shown in: |
| 344 |
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options |
| 345 |
c, err := visionai.NewWarehouseClient(ctx) |
| 346 |
if err != nil { |
| 347 |
// TODO: Handle error. |
| 348 |
} |
| 349 |
defer c.Close() |
| 350 |
|
| 351 |
req := &visionaipb.CreateIndexEndpointRequest{ |
| 352 |
// TODO: Fill request struct fields. |
| 353 |
// See https://pkg.go.dev/cloud.google.com/go/visionai/apiv1/visionaipb#CreateIndexEndpointRequest. |
| 354 |
} |
| 355 |
op, err := c.CreateIndexEndpoint(ctx, req) |
| 356 |
if err != nil { |
| 357 |
// TODO: Handle error. |
| 358 |
} |
| 359 |
|
| 360 |
resp, err := op.Wait(ctx) |
| 361 |
if err != nil { |
| 362 |
// TODO: Handle error. |
| 363 |
} |
| 364 |
// TODO: Use resp. |
| 365 |
_ = resp |
| 366 |
} |
| 367 |
|
| 368 |
func ExampleWarehouseClient_CreateSearchConfig() { |
| 369 |
ctx := context.Background() |
| 370 |
// This snippet has been automatically generated and should be regarded as a code template only. |
| 371 |
// It will require modifications to work: |
| 372 |
// - It may require correct/in-range values for request initialization. |
| 373 |
// - It may require specifying regional endpoints when creating the service client as shown in: |
| 374 |
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options |
| 375 |
c, err := visionai.NewWarehouseClient(ctx) |
| 376 |
if err != nil { |
| 377 |
// TODO: Handle error. |
| 378 |
} |
| 379 |
defer c.Close() |
| 380 |
|
| 381 |
req := &visionaipb.CreateSearchConfigRequest{ |
| 382 |
// TODO: Fill request struct fields. |
| 383 |
// See https://pkg.go.dev/cloud.google.com/go/visionai/apiv1/visionaipb#CreateSearchConfigRequest. |
| 384 |
} |
| 385 |
resp, err := c.CreateSearchConfig(ctx, req) |
| 386 |
if err != nil { |
| 387 |
// TODO: Handle error. |
| 388 |
} |
| 389 |
// TODO: Use resp. |
| 390 |
_ = resp |
| 391 |
} |
| 392 |
|
| 393 |
func ExampleWarehouseClient_CreateSearchHypernym() { |
| 394 |
ctx := context.Background() |
| 395 |
// This snippet has been automatically generated and should be regarded as a code template only. |
| 396 |
// It will require modifications to work: |
| 397 |
// - It may require correct/in-range values for request initialization. |
| 398 |
// - It may require specifying regional endpoints when creating the service client as shown in: |
| 399 |
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options |
| 400 |
c, err := visionai.NewWarehouseClient(ctx) |
| 401 |
if err != nil { |
| 402 |
// TODO: Handle error. |
| 403 |
} |
| 404 |
defer c.Close() |
| 405 |
|
| 406 |
req := &visionaipb.CreateSearchHypernymRequest{ |
| 407 |
// TODO: Fill request struct fields. |
| 408 |
// See https://pkg.go.dev/cloud.google.com/go/visionai/apiv1/visionaipb#CreateSearchHypernymRequest. |
| 409 |
} |
| 410 |
resp, err := c.CreateSearchHypernym(ctx, req) |
| 411 |
if err != nil { |
| 412 |
// TODO: Handle error. |
| 413 |
} |
| 414 |
// TODO: Use resp. |
| 415 |
_ = resp |
| 416 |
} |
| 417 |
|
| 418 |
func ExampleWarehouseClient_DeleteAnnotation() { |
| 419 |
ctx := context.Background() |
| 420 |
// This snippet has been automatically generated and should be regarded as a code template only. |
| 421 |
// It will require modifications to work: |
| 422 |
// - It may require correct/in-range values for request initialization. |
| 423 |
// - It may require specifying regional endpoints when creating the service client as shown in: |
| 424 |
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options |
| 425 |
c, err := visionai.NewWarehouseClient(ctx) |
| 426 |
if err != nil { |
| 427 |
// TODO: Handle error. |
| 428 |
} |
| 429 |
defer c.Close() |
| 430 |
|
| 431 |
req := &visionaipb.DeleteAnnotationRequest{ |
| 432 |
// TODO: Fill request struct fields. |
| 433 |
// See https://pkg.go.dev/cloud.google.com/go/visionai/apiv1/visionaipb#DeleteAnnotationRequest. |
| 434 |
} |
| 435 |
err = c.DeleteAnnotation(ctx, req) |
| 436 |
if err != nil { |
| 437 |
// TODO: Handle error. |
| 438 |
} |
| 439 |
} |
| 440 |
|
| 441 |
func ExampleWarehouseClient_DeleteAsset() { |
| 442 |
ctx := context.Background() |
| 443 |
// This snippet has been automatically generated and should be regarded as a code template only. |
| 444 |
// It will require modifications to work: |
| 445 |
// - It may require correct/in-range values for request initialization. |
| 446 |
// - It may require specifying regional endpoints when creating the service client as shown in: |
| 447 |
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options |
| 448 |
c, err := visionai.NewWarehouseClient(ctx) |
| 449 |
if err != nil { |
| 450 |
// TODO: Handle error. |
| 451 |
} |
| 452 |
defer c.Close() |
| 453 |
|
| 454 |
req := &visionaipb.DeleteAssetRequest{ |
| 455 |
// TODO: Fill request struct fields. |
| 456 |
// See https://pkg.go.dev/cloud.google.com/go/visionai/apiv1/visionaipb#DeleteAssetRequest. |
| 457 |
} |
| 458 |
op, err := c.DeleteAsset(ctx, req) |
| 459 |
if err != nil { |
| 460 |
// TODO: Handle error. |
| 461 |
} |
| 462 |
|
| 463 |
err = op.Wait(ctx) |
| 464 |
if err != nil { |
| 465 |
// TODO: Handle error. |
| 466 |
} |
| 467 |
} |
| 468 |
|
| 469 |
func ExampleWarehouseClient_DeleteCollection() { |
| 470 |
ctx := context.Background() |
| 471 |
// This snippet has been automatically generated and should be regarded as a code template only. |
| 472 |
// It will require modifications to work: |
| 473 |
// - It may require correct/in-range values for request initialization. |
| 474 |
// - It may require specifying regional endpoints when creating the service client as shown in: |
| 475 |
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options |
| 476 |
c, err := visionai.NewWarehouseClient(ctx) |
| 477 |
if err != nil { |
| 478 |
// TODO: Handle error. |
| 479 |
} |
| 480 |
defer c.Close() |
| 481 |
|
| 482 |
req := &visionaipb.DeleteCollectionRequest{ |
| 483 |
// TODO: Fill request struct fields. |
| 484 |
// See https://pkg.go.dev/cloud.google.com/go/visionai/apiv1/visionaipb#DeleteCollectionRequest. |
| 485 |
} |
| 486 |
op, err := c.DeleteCollection(ctx, req) |
| 487 |
if err != nil { |
| 488 |
// TODO: Handle error. |
| 489 |
} |
| 490 |
|
| 491 |
err = op.Wait(ctx) |
| 492 |
if err != nil { |
| 493 |
// TODO: Handle error. |
| 494 |
} |
| 495 |
} |
| 496 |
|
| 497 |
func ExampleWarehouseClient_DeleteCorpus() { |
| 498 |
ctx := context.Background() |
| 499 |
// This snippet has been automatically generated and should be regarded as a code template only. |
| 500 |
// It will require modifications to work: |
| 501 |
// - It may require correct/in-range values for request initialization. |
| 502 |
// - It may require specifying regional endpoints when creating the service client as shown in: |
| 503 |
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options |
| 504 |
c, err := visionai.NewWarehouseClient(ctx) |
| 505 |
if err != nil { |
| 506 |
// TODO: Handle error. |
| 507 |
} |
| 508 |
defer c.Close() |
| 509 |
|
| 510 |
req := &visionaipb.DeleteCorpusRequest{ |
| 511 |
// TODO: Fill request struct fields. |
| 512 |
// See https://pkg.go.dev/cloud.google.com/go/visionai/apiv1/visionaipb#DeleteCorpusRequest. |
| 513 |
} |
| 514 |
err = c.DeleteCorpus(ctx, req) |
| 515 |
if err != nil { |
| 516 |
// TODO: Handle error. |
| 517 |
} |
| 518 |
} |
| 519 |
|
| 520 |
func ExampleWarehouseClient_DeleteDataSchema() { |
| 521 |
ctx := context.Background() |
| 522 |
// This snippet has been automatically generated and should be regarded as a code template only. |
| 523 |
// It will require modifications to work: |
| 524 |
// - It may require correct/in-range values for request initialization. |
| 525 |
// - It may require specifying regional endpoints when creating the service client as shown in: |
| 526 |
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options |
| 527 |
c, err := visionai.NewWarehouseClient(ctx) |
| 528 |
if err != nil { |
| 529 |
// TODO: Handle error. |
| 530 |
} |
| 531 |
defer c.Close() |
| 532 |
|
| 533 |
req := &visionaipb.DeleteDataSchemaRequest{ |
| 534 |
// TODO: Fill request struct fields. |
| 535 |
// See https://pkg.go.dev/cloud.google.com/go/visionai/apiv1/visionaipb#DeleteDataSchemaRequest. |
| 536 |
} |
| 537 |
err = c.DeleteDataSchema(ctx, req) |
| 538 |
if err != nil { |
| 539 |
// TODO: Handle error. |
| 540 |
} |
| 541 |
} |
| 542 |
|
| 543 |
func ExampleWarehouseClient_DeleteIndex() { |
| 544 |
ctx := context.Background() |
| 545 |
// This snippet has been automatically generated and should be regarded as a code template only. |
| 546 |
// It will require modifications to work: |
| 547 |
// - It may require correct/in-range values for request initialization. |
| 548 |
// - It may require specifying regional endpoints when creating the service client as shown in: |
| 549 |
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options |
| 550 |
c, err := visionai.NewWarehouseClient(ctx) |
| 551 |
if err != nil { |
| 552 |
// TODO: Handle error. |
| 553 |
} |
| 554 |
defer c.Close() |
| 555 |
|
| 556 |
req := &visionaipb.DeleteIndexRequest{ |
| 557 |
// TODO: Fill request struct fields. |
| 558 |
// See https://pkg.go.dev/cloud.google.com/go/visionai/apiv1/visionaipb#DeleteIndexRequest. |
| 559 |
} |
| 560 |
op, err := c.DeleteIndex(ctx, req) |
| 561 |
if err != nil { |
| 562 |
// TODO: Handle error. |
| 563 |
} |
| 564 |
|
| 565 |
err = op.Wait(ctx) |
| 566 |
if err != nil { |
| 567 |
// TODO: Handle error. |
| 568 |
} |
| 569 |
} |
| 570 |
|
| 571 |
func ExampleWarehouseClient_DeleteIndexEndpoint() { |
| 572 |
ctx := context.Background() |
| 573 |
// This snippet has been automatically generated and should be regarded as a code template only. |
| 574 |
// It will require modifications to work: |
| 575 |
// - It may require correct/in-range values for request initialization. |
| 576 |
// - It may require specifying regional endpoints when creating the service client as shown in: |
| 577 |
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options |
| 578 |
c, err := visionai.NewWarehouseClient(ctx) |
| 579 |
if err != nil { |
| 580 |
// TODO: Handle error. |
| 581 |
} |
| 582 |
defer c.Close() |
| 583 |
|
| 584 |
req := &visionaipb.DeleteIndexEndpointRequest{ |
| 585 |
// TODO: Fill request struct fields. |
| 586 |
// See https://pkg.go.dev/cloud.google.com/go/visionai/apiv1/visionaipb#DeleteIndexEndpointRequest. |
| 587 |
} |
| 588 |
op, err := c.DeleteIndexEndpoint(ctx, req) |
| 589 |
if err != nil { |
| 590 |
// TODO: Handle error. |
| 591 |
} |
| 592 |
|
| 593 |
err = op.Wait(ctx) |
| 594 |
if err != nil { |
| 595 |
// TODO: Handle error. |
| 596 |
} |
| 597 |
} |
| 598 |
|
| 599 |
func ExampleWarehouseClient_DeleteSearchConfig() { |
| 600 |
ctx := context.Background() |
| 601 |
// This snippet has been automatically generated and should be regarded as a code template only. |
| 602 |
// It will require modifications to work: |
| 603 |
// - It may require correct/in-range values for request initialization. |
| 604 |
// - It may require specifying regional endpoints when creating the service client as shown in: |
| 605 |
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options |
| 606 |
c, err := visionai.NewWarehouseClient(ctx) |
| 607 |
if err != nil { |
| 608 |
// TODO: Handle error. |
| 609 |
} |
| 610 |
defer c.Close() |
| 611 |
|
| 612 |
req := &visionaipb.DeleteSearchConfigRequest{ |
| 613 |
// TODO: Fill request struct fields. |
| 614 |
// See https://pkg.go.dev/cloud.google.com/go/visionai/apiv1/visionaipb#DeleteSearchConfigRequest. |
| 615 |
} |
| 616 |
err = c.DeleteSearchConfig(ctx, req) |
| 617 |
if err != nil { |
| 618 |
// TODO: Handle error. |
| 619 |
} |
| 620 |
} |
| 621 |
|
| 622 |
func ExampleWarehouseClient_DeleteSearchHypernym() { |
| 623 |
ctx := context.Background() |
| 624 |
// This snippet has been automatically generated and should be regarded as a code template only. |
| 625 |
// It will require modifications to work: |
| 626 |
// - It may require correct/in-range values for request initialization. |
| 627 |
// - It may require specifying regional endpoints when creating the service client as shown in: |
| 628 |
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options |
| 629 |
c, err := visionai.NewWarehouseClient(ctx) |
| 630 |
if err != nil { |
| 631 |
// TODO: Handle error. |
| 632 |
} |
| 633 |
defer c.Close() |
| 634 |
|
| 635 |
req := &visionaipb.DeleteSearchHypernymRequest{ |
| 636 |
// TODO: Fill request struct fields. |
| 637 |
// See https://pkg.go.dev/cloud.google.com/go/visionai/apiv1/visionaipb#DeleteSearchHypernymRequest. |
| 638 |
} |
| 639 |
err = c.DeleteSearchHypernym(ctx, req) |
| 640 |
if err != nil { |
| 641 |
// TODO: Handle error. |
| 642 |
} |
| 643 |
} |
| 644 |
|
| 645 |
func ExampleWarehouseClient_DeployIndex() { |
| 646 |
ctx := context.Background() |
| 647 |
// This snippet has been automatically generated and should be regarded as a code template only. |
| 648 |
// It will require modifications to work: |
| 649 |
// - It may require correct/in-range values for request initialization. |
| 650 |
// - It may require specifying regional endpoints when creating the service client as shown in: |
| 651 |
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options |
| 652 |
c, err := visionai.NewWarehouseClient(ctx) |
| 653 |
if err != nil { |
| 654 |
// TODO: Handle error. |
| 655 |
} |
| 656 |
defer c.Close() |
| 657 |
|
| 658 |
req := &visionaipb.DeployIndexRequest{ |
| 659 |
// TODO: Fill request struct fields. |
| 660 |
// See https://pkg.go.dev/cloud.google.com/go/visionai/apiv1/visionaipb#DeployIndexRequest. |
| 661 |
} |
| 662 |
op, err := c.DeployIndex(ctx, req) |
| 663 |
if err != nil { |
| 664 |
// TODO: Handle error. |
| 665 |
} |
| 666 |
|
| 667 |
resp, err := op.Wait(ctx) |
| 668 |
if err != nil { |
| 669 |
// TODO: Handle error. |
| 670 |
} |
| 671 |
// TODO: Use resp. |
| 672 |
_ = resp |
| 673 |
} |
| 674 |
|
| 675 |
func ExampleWarehouseClient_GenerateHlsUri() { |
| 676 |
ctx := context.Background() |
| 677 |
// This snippet has been automatically generated and should be regarded as a code template only. |
| 678 |
// It will require modifications to work: |
| 679 |
// - It may require correct/in-range values for request initialization. |
| 680 |
// - It may require specifying regional endpoints when creating the service client as shown in: |
| 681 |
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options |
| 682 |
c, err := visionai.NewWarehouseClient(ctx) |
| 683 |
if err != nil { |
| 684 |
// TODO: Handle error. |
| 685 |
} |
| 686 |
defer c.Close() |
| 687 |
|
| 688 |
req := &visionaipb.GenerateHlsUriRequest{ |
| 689 |
// TODO: Fill request struct fields. |
| 690 |
// See https://pkg.go.dev/cloud.google.com/go/visionai/apiv1/visionaipb#GenerateHlsUriRequest. |
| 691 |
} |
| 692 |
resp, err := c.GenerateHlsUri(ctx, req) |
| 693 |
if err != nil { |
| 694 |
// TODO: Handle error. |
| 695 |
} |
| 696 |
// TODO: Use resp. |
| 697 |
_ = resp |
| 698 |
} |
| 699 |
|
| 700 |
func ExampleWarehouseClient_GenerateRetrievalUrl() { |
| 701 |
ctx := context.Background() |
| 702 |
// This snippet has been automatically generated and should be regarded as a code template only. |
| 703 |
// It will require modifications to work: |
| 704 |
// - It may require correct/in-range values for request initialization. |
| 705 |
// - It may require specifying regional endpoints when creating the service client as shown in: |
| 706 |
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options |
| 707 |
c, err := visionai.NewWarehouseClient(ctx) |
| 708 |
if err != nil { |
| 709 |
// TODO: Handle error. |
| 710 |
} |
| 711 |
defer c.Close() |
| 712 |
|
| 713 |
req := &visionaipb.GenerateRetrievalUrlRequest{ |
| 714 |
// TODO: Fill request struct fields. |
| 715 |
// See https://pkg.go.dev/cloud.google.com/go/visionai/apiv1/visionaipb#GenerateRetrievalUrlRequest. |
| 716 |
} |
| 717 |
resp, err := c.GenerateRetrievalUrl(ctx, req) |
| 718 |
if err != nil { |
| 719 |
// TODO: Handle error. |
| 720 |
} |
| 721 |
// TODO: Use resp. |
| 722 |
_ = resp |
| 723 |
} |
| 724 |
|
| 725 |
func ExampleWarehouseClient_GetAnnotation() { |
| 726 |
ctx := context.Background() |
| 727 |
// This snippet has been automatically generated and should be regarded as a code template only. |
| 728 |
// It will require modifications to work: |
| 729 |
// - It may require correct/in-range values for request initialization. |
| 730 |
// - It may require specifying regional endpoints when creating the service client as shown in: |
| 731 |
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options |
| 732 |
c, err := visionai.NewWarehouseClient(ctx) |
| 733 |
if err != nil { |
| 734 |
// TODO: Handle error. |
| 735 |
} |
| 736 |
defer c.Close() |
| 737 |
|
| 738 |
req := &visionaipb.GetAnnotationRequest{ |
| 739 |
// TODO: Fill request struct fields. |
| 740 |
// See https://pkg.go.dev/cloud.google.com/go/visionai/apiv1/visionaipb#GetAnnotationRequest. |
| 741 |
} |
| 742 |
resp, err := c.GetAnnotation(ctx, req) |
| 743 |
if err != nil { |
| 744 |
// TODO: Handle error. |
| 745 |
} |
| 746 |
// TODO: Use resp. |
| 747 |
_ = resp |
| 748 |
} |
| 749 |
|
| 750 |
func ExampleWarehouseClient_GetAsset() { |
| 751 |
ctx := context.Background() |
| 752 |
// This snippet has been automatically generated and should be regarded as a code template only. |
| 753 |
// It will require modifications to work: |
| 754 |
// - It may require correct/in-range values for request initialization. |
| 755 |
// - It may require specifying regional endpoints when creating the service client as shown in: |
| 756 |
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options |
| 757 |
c, err := visionai.NewWarehouseClient(ctx) |
| 758 |
if err != nil { |
| 759 |
// TODO: Handle error. |
| 760 |
} |
| 761 |
defer c.Close() |
| 762 |
|
| 763 |
req := &visionaipb.GetAssetRequest{ |
| 764 |
// TODO: Fill request struct fields. |
| 765 |
// See https://pkg.go.dev/cloud.google.com/go/visionai/apiv1/visionaipb#GetAssetRequest. |
| 766 |
} |
| 767 |
resp, err := c.GetAsset(ctx, req) |
| 768 |
if err != nil { |
| 769 |
// TODO: Handle error. |
| 770 |
} |
| 771 |
// TODO: Use resp. |
| 772 |
_ = resp |
| 773 |
} |
| 774 |
|
| 775 |
func ExampleWarehouseClient_GetCollection() { |
| 776 |
ctx := context.Background() |
| 777 |
// This snippet has been automatically generated and should be regarded as a code template only. |
| 778 |
// It will require modifications to work: |
| 779 |
// - It may require correct/in-range values for request initialization. |
| 780 |
// - It may require specifying regional endpoints when creating the service client as shown in: |
| 781 |
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options |
| 782 |
c, err := visionai.NewWarehouseClient(ctx) |
| 783 |
if err != nil { |
| 784 |
// TODO: Handle error. |
| 785 |
} |
| 786 |
defer c.Close() |
| 787 |
|
| 788 |
req := &visionaipb.GetCollectionRequest{ |
| 789 |
// TODO: Fill request struct fields. |
| 790 |
// See https://pkg.go.dev/cloud.google.com/go/visionai/apiv1/visionaipb#GetCollectionRequest. |
| 791 |
} |
| 792 |
resp, err := c.GetCollection(ctx, req) |
| 793 |
if err != nil { |
| 794 |
// TODO: Handle error. |
| 795 |
} |
| 796 |
// TODO: Use resp. |
| 797 |
_ = resp |
| 798 |
} |
| 799 |
|
| 800 |
func ExampleWarehouseClient_GetCorpus() { |
| 801 |
ctx := context.Background() |
| 802 |
// This snippet has been automatically generated and should be regarded as a code template only. |
| 803 |
// It will require modifications to work: |
| 804 |
// - It may require correct/in-range values for request initialization. |
| 805 |
// - It may require specifying regional endpoints when creating the service client as shown in: |
| 806 |
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options |
| 807 |
c, err := visionai.NewWarehouseClient(ctx) |
| 808 |
if err != nil { |
| 809 |
// TODO: Handle error. |
| 810 |
} |
| 811 |
defer c.Close() |
| 812 |
|
| 813 |
req := &visionaipb.GetCorpusRequest{ |
| 814 |
// TODO: Fill request struct fields. |
| 815 |
// See https://pkg.go.dev/cloud.google.com/go/visionai/apiv1/visionaipb#GetCorpusRequest. |
| 816 |
} |
| 817 |
resp, err := c.GetCorpus(ctx, req) |
| 818 |
if err != nil { |
| 819 |
// TODO: Handle error. |
| 820 |
} |
| 821 |
// TODO: Use resp. |
| 822 |
_ = resp |
| 823 |
} |
| 824 |
|
| 825 |
func ExampleWarehouseClient_GetDataSchema() { |
| 826 |
ctx := context.Background() |
| 827 |
// This snippet has been automatically generated and should be regarded as a code template only. |
| 828 |
// It will require modifications to work: |
| 829 |
// - It may require correct/in-range values for request initialization. |
| 830 |
// - It may require specifying regional endpoints when creating the service client as shown in: |
| 831 |
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options |
| 832 |
c, err := visionai.NewWarehouseClient(ctx) |
| 833 |
if err != nil { |
| 834 |
// TODO: Handle error. |
| 835 |
} |
| 836 |
defer c.Close() |
| 837 |
|
| 838 |
req := &visionaipb.GetDataSchemaRequest{ |
| 839 |
// TODO: Fill request struct fields. |
| 840 |
// See https://pkg.go.dev/cloud.google.com/go/visionai/apiv1/visionaipb#GetDataSchemaRequest. |
| 841 |
} |
| 842 |
resp, err := c.GetDataSchema(ctx, req) |
| 843 |
if err != nil { |
| 844 |
// TODO: Handle error. |
| 845 |
} |
| 846 |
// TODO: Use resp. |
| 847 |
_ = resp |
| 848 |
} |
| 849 |
|
| 850 |
func ExampleWarehouseClient_GetIndex() { |
| 851 |
ctx := context.Background() |
| 852 |
// This snippet has been automatically generated and should be regarded as a code template only. |
| 853 |
// It will require modifications to work: |
| 854 |
// - It may require correct/in-range values for request initialization. |
| 855 |
// - It may require specifying regional endpoints when creating the service client as shown in: |
| 856 |
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options |
| 857 |
c, err := visionai.NewWarehouseClient(ctx) |
| 858 |
if err != nil { |
| 859 |
// TODO: Handle error. |
| 860 |
} |
| 861 |
defer c.Close() |
| 862 |
|
| 863 |
req := &visionaipb.GetIndexRequest{ |
| 864 |
// TODO: Fill request struct fields. |
| 865 |
// See https://pkg.go.dev/cloud.google.com/go/visionai/apiv1/visionaipb#GetIndexRequest. |
| 866 |
} |
| 867 |
resp, err := c.GetIndex(ctx, req) |
| 868 |
if err != nil { |
| 869 |
// TODO: Handle error. |
| 870 |
} |
| 871 |
// TODO: Use resp. |
| 872 |
_ = resp |
| 873 |
} |
| 874 |
|
| 875 |
func ExampleWarehouseClient_GetIndexEndpoint() { |
| 876 |
ctx := context.Background() |
| 877 |
// This snippet has been automatically generated and should be regarded as a code template only. |
| 878 |
// It will require modifications to work: |
| 879 |
// - It may require correct/in-range values for request initialization. |
| 880 |
// - It may require specifying regional endpoints when creating the service client as shown in: |
| 881 |
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options |
| 882 |
c, err := visionai.NewWarehouseClient(ctx) |
| 883 |
if err != nil { |
| 884 |
// TODO: Handle error. |
| 885 |
} |
| 886 |
defer c.Close() |
| 887 |
|
| 888 |
req := &visionaipb.GetIndexEndpointRequest{ |
| 889 |
// TODO: Fill request struct fields. |
| 890 |
// See https://pkg.go.dev/cloud.google.com/go/visionai/apiv1/visionaipb#GetIndexEndpointRequest. |
| 891 |
} |
| 892 |
resp, err := c.GetIndexEndpoint(ctx, req) |
| 893 |
if err != nil { |
| 894 |
// TODO: Handle error. |
| 895 |
} |
| 896 |
// TODO: Use resp. |
| 897 |
_ = resp |
| 898 |
} |
| 899 |
|
| 900 |
func ExampleWarehouseClient_GetSearchConfig() { |
| 901 |
ctx := context.Background() |
| 902 |
// This snippet has been automatically generated and should be regarded as a code template only. |
| 903 |
// It will require modifications to work: |
| 904 |
// - It may require correct/in-range values for request initialization. |
| 905 |
// - It may require specifying regional endpoints when creating the service client as shown in: |
| 906 |
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options |
| 907 |
c, err := visionai.NewWarehouseClient(ctx) |
| 908 |
if err != nil { |
| 909 |
// TODO: Handle error. |
| 910 |
} |
| 911 |
defer c.Close() |
| 912 |
|
| 913 |
req := &visionaipb.GetSearchConfigRequest{ |
| 914 |
// TODO: Fill request struct fields. |
| 915 |
// See https://pkg.go.dev/cloud.google.com/go/visionai/apiv1/visionaipb#GetSearchConfigRequest. |
| 916 |
} |
| 917 |
resp, err := c.GetSearchConfig(ctx, req) |
| 918 |
if err != nil { |
| 919 |
// TODO: Handle error. |
| 920 |
} |
| 921 |
// TODO: Use resp. |
| 922 |
_ = resp |
| 923 |
} |
| 924 |
|
| 925 |
func ExampleWarehouseClient_GetSearchHypernym() { |
| 926 |
ctx := context.Background() |
| 927 |
// This snippet has been automatically generated and should be regarded as a code template only. |
| 928 |
// It will require modifications to work: |
| 929 |
// - It may require correct/in-range values for request initialization. |
| 930 |
// - It may require specifying regional endpoints when creating the service client as shown in: |
| 931 |
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options |
| 932 |
c, err := visionai.NewWarehouseClient(ctx) |
| 933 |
if err != nil { |
| 934 |
// TODO: Handle error. |
| 935 |
} |
| 936 |
defer c.Close() |
| 937 |
|
| 938 |
req := &visionaipb.GetSearchHypernymRequest{ |
| 939 |
// TODO: Fill request struct fields. |
| 940 |
// See https://pkg.go.dev/cloud.google.com/go/visionai/apiv1/visionaipb#GetSearchHypernymRequest. |
| 941 |
} |
| 942 |
resp, err := c.GetSearchHypernym(ctx, req) |
| 943 |
if err != nil { |
| 944 |
// TODO: Handle error. |
| 945 |
} |
| 946 |
// TODO: Use resp. |
| 947 |
_ = resp |
| 948 |
} |
| 949 |
|
| 950 |
func ExampleWarehouseClient_ImportAssets() { |
| 951 |
ctx := context.Background() |
| 952 |
// This snippet has been automatically generated and should be regarded as a code template only. |
| 953 |
// It will require modifications to work: |
| 954 |
// - It may require correct/in-range values for request initialization. |
| 955 |
// - It may require specifying regional endpoints when creating the service client as shown in: |
| 956 |
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options |
| 957 |
c, err := visionai.NewWarehouseClient(ctx) |
| 958 |
if err != nil { |
| 959 |
// TODO: Handle error. |
| 960 |
} |
| 961 |
defer c.Close() |
| 962 |
|
| 963 |
req := &visionaipb.ImportAssetsRequest{ |
| 964 |
// TODO: Fill request struct fields. |
| 965 |
// See https://pkg.go.dev/cloud.google.com/go/visionai/apiv1/visionaipb#ImportAssetsRequest. |
| 966 |
} |
| 967 |
op, err := c.ImportAssets(ctx, req) |
| 968 |
if err != nil { |
| 969 |
// TODO: Handle error. |
| 970 |
} |
| 971 |
|
| 972 |
resp, err := op.Wait(ctx) |
| 973 |
if err != nil { |
| 974 |
// TODO: Handle error. |
| 975 |
} |
| 976 |
// TODO: Use resp. |
| 977 |
_ = resp |
| 978 |
} |
| 979 |
|
| 980 |
func ExampleWarehouseClient_IndexAsset() { |
| 981 |
ctx := context.Background() |
| 982 |
// This snippet has been automatically generated and should be regarded as a code template only. |
| 983 |
// It will require modifications to work: |
| 984 |
// - It may require correct/in-range values for request initialization. |
| 985 |
// - It may require specifying regional endpoints when creating the service client as shown in: |
| 986 |
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options |
| 987 |
c, err := visionai.NewWarehouseClient(ctx) |
| 988 |
if err != nil { |
| 989 |
// TODO: Handle error. |
| 990 |
} |
| 991 |
defer c.Close() |
| 992 |
|
| 993 |
req := &visionaipb.IndexAssetRequest{ |
| 994 |
// TODO: Fill request struct fields. |
| 995 |
// See https://pkg.go.dev/cloud.google.com/go/visionai/apiv1/visionaipb#IndexAssetRequest. |
| 996 |
} |
| 997 |
op, err := c.IndexAsset(ctx, req) |
| 998 |
if err != nil { |
| 999 |
// TODO: Handle error. |
| 1000 |
} |
| 1001 |
|
| 1002 |
resp, err := op.Wait(ctx) |
| 1003 |
if err != nil { |
| 1004 |
// TODO: Handle error. |
| 1005 |
} |
| 1006 |
// TODO: Use resp. |
| 1007 |
_ = resp |
| 1008 |
} |
| 1009 |
|
| 1010 |
func ExampleWarehouseClient_IngestAsset() { |
| 1011 |
ctx := context.Background() |
| 1012 |
// This snippet has been automatically generated and should be regarded as a code template only. |
| 1013 |
// It will require modifications to work: |
| 1014 |
// - It may require correct/in-range values for request initialization. |
| 1015 |
// - It may require specifying regional endpoints when creating the service client as shown in: |
| 1016 |
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options |
| 1017 |
c, err := visionai.NewWarehouseClient(ctx) |
| 1018 |
if err != nil { |
| 1019 |
// TODO: Handle error. |
| 1020 |
} |
| 1021 |
defer c.Close() |
| 1022 |
stream, err := c.IngestAsset(ctx) |
| 1023 |
if err != nil { |
| 1024 |
// TODO: Handle error. |
| 1025 |
} |
| 1026 |
go func() { |
| 1027 |
reqs := []*visionaipb.IngestAssetRequest{ |
| 1028 |
// TODO: Create requests. |
| 1029 |
} |
| 1030 |
for _, req := range reqs { |
| 1031 |
if err := stream.Send(req); err != nil { |
| 1032 |
// TODO: Handle error. |
| 1033 |
} |
| 1034 |
} |
| 1035 |
stream.CloseSend() |
| 1036 |
}() |
| 1037 |
for { |
| 1038 |
resp, err := stream.Recv() |
| 1039 |
if err == io.EOF { |
| 1040 |
break |
| 1041 |
} |
| 1042 |
if err != nil { |
| 1043 |
// TODO: handle error. |
| 1044 |
} |
| 1045 |
// TODO: Use resp. |
| 1046 |
_ = resp |
| 1047 |
} |
| 1048 |
} |
| 1049 |
|
| 1050 |
func ExampleWarehouseClient_ListAnnotations() { |
| 1051 |
ctx := context.Background() |
| 1052 |
// This snippet has been automatically generated and should be regarded as a code template only. |
| 1053 |
// It will require modifications to work: |
| 1054 |
// - It may require correct/in-range values for request initialization. |
| 1055 |
// - It may require specifying regional endpoints when creating the service client as shown in: |
| 1056 |
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options |
| 1057 |
c, err := visionai.NewWarehouseClient(ctx) |
| 1058 |
if err != nil { |
| 1059 |
// TODO: Handle error. |
| 1060 |
} |
| 1061 |
defer c.Close() |
| 1062 |
|
| 1063 |
req := &visionaipb.ListAnnotationsRequest{ |
| 1064 |
// TODO: Fill request struct fields. |
| 1065 |
// See https://pkg.go.dev/cloud.google.com/go/visionai/apiv1/visionaipb#ListAnnotationsRequest. |
| 1066 |
} |
| 1067 |
it := c.ListAnnotations(ctx, req) |
| 1068 |
for { |
| 1069 |
resp, err := it.Next() |
| 1070 |
if err == iterator.Done { |
| 1071 |
break |
| 1072 |
} |
| 1073 |
if err != nil { |
| 1074 |
// TODO: Handle error. |
| 1075 |
} |
| 1076 |
// TODO: Use resp. |
| 1077 |
_ = resp |
| 1078 |
|
| 1079 |
// If you need to access the underlying RPC response, |
| 1080 |
// you can do so by casting the `Response` as below. |
| 1081 |
// Otherwise, remove this line. Only populated after |
| 1082 |
// first call to Next(). Not safe for concurrent access. |
| 1083 |
_ = it.Response.(*visionaipb.ListAnnotationsResponse) |
| 1084 |
} |
| 1085 |
} |
| 1086 |
|
| 1087 |
func ExampleWarehouseClient_ListAssets() { |
| 1088 |
ctx := context.Background() |
| 1089 |
// This snippet has been automatically generated and should be regarded as a code template only. |
| 1090 |
// It will require modifications to work: |
| 1091 |
// - It may require correct/in-range values for request initialization. |
| 1092 |
// - It may require specifying regional endpoints when creating the service client as shown in: |
| 1093 |
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options |
| 1094 |
c, err := visionai.NewWarehouseClient(ctx) |
| 1095 |
if err != nil { |
| 1096 |
// TODO: Handle error. |
| 1097 |
} |
| 1098 |
defer c.Close() |
| 1099 |
|
| 1100 |
req := &visionaipb.ListAssetsRequest{ |
| 1101 |
// TODO: Fill request struct fields. |
| 1102 |
// See https://pkg.go.dev/cloud.google.com/go/visionai/apiv1/visionaipb#ListAssetsRequest. |
| 1103 |
} |
| 1104 |
it := c.ListAssets(ctx, req) |
| 1105 |
for { |
| 1106 |
resp, err := it.Next() |
| 1107 |
if err == iterator.Done { |
| 1108 |
break |
| 1109 |
} |
| 1110 |
if err != nil { |
| 1111 |
// TODO: Handle error. |
| 1112 |
} |
| 1113 |
// TODO: Use resp. |
| 1114 |
_ = resp |
| 1115 |
|
| 1116 |
// If you need to access the underlying RPC response, |
| 1117 |
// you can do so by casting the `Response` as below. |
| 1118 |
// Otherwise, remove this line. Only populated after |
| 1119 |
// first call to Next(). Not safe for concurrent access. |
| 1120 |
_ = it.Response.(*visionaipb.ListAssetsResponse) |
| 1121 |
} |
| 1122 |
} |
| 1123 |
|
| 1124 |
func ExampleWarehouseClient_ListCollections() { |
| 1125 |
ctx := context.Background() |
| 1126 |
// This snippet has been automatically generated and should be regarded as a code template only. |
| 1127 |
// It will require modifications to work: |
| 1128 |
// - It may require correct/in-range values for request initialization. |
| 1129 |
// - It may require specifying regional endpoints when creating the service client as shown in: |
| 1130 |
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options |
| 1131 |
c, err := visionai.NewWarehouseClient(ctx) |
| 1132 |
if err != nil { |
| 1133 |
// TODO: Handle error. |
| 1134 |
} |
| 1135 |
defer c.Close() |
| 1136 |
|
| 1137 |
req := &visionaipb.ListCollectionsRequest{ |
| 1138 |
// TODO: Fill request struct fields. |
| 1139 |
// See https://pkg.go.dev/cloud.google.com/go/visionai/apiv1/visionaipb#ListCollectionsRequest. |
| 1140 |
} |
| 1141 |
it := c.ListCollections(ctx, req) |
| 1142 |
for { |
| 1143 |
resp, err := it.Next() |
| 1144 |
if err == iterator.Done { |
| 1145 |
break |
| 1146 |
} |
| 1147 |
if err != nil { |
| 1148 |
// TODO: Handle error. |
| 1149 |
} |
| 1150 |
// TODO: Use resp. |
| 1151 |
_ = resp |
| 1152 |
|
| 1153 |
// If you need to access the underlying RPC response, |
| 1154 |
// you can do so by casting the `Response` as below. |
| 1155 |
// Otherwise, remove this line. Only populated after |
| 1156 |
// first call to Next(). Not safe for concurrent access. |
| 1157 |
_ = it.Response.(*visionaipb.ListCollectionsResponse) |
| 1158 |
} |
| 1159 |
} |
| 1160 |
|
| 1161 |
func ExampleWarehouseClient_ListCorpora() { |
| 1162 |
ctx := context.Background() |
| 1163 |
// This snippet has been automatically generated and should be regarded as a code template only. |
| 1164 |
// It will require modifications to work: |
| 1165 |
// - It may require correct/in-range values for request initialization. |
| 1166 |
// - It may require specifying regional endpoints when creating the service client as shown in: |
| 1167 |
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options |
| 1168 |
c, err := visionai.NewWarehouseClient(ctx) |
| 1169 |
if err != nil { |
| 1170 |
// TODO: Handle error. |
| 1171 |
} |
| 1172 |
defer c.Close() |
| 1173 |
|
| 1174 |
req := &visionaipb.ListCorporaRequest{ |
| 1175 |
// TODO: Fill request struct fields. |
| 1176 |
// See https://pkg.go.dev/cloud.google.com/go/visionai/apiv1/visionaipb#ListCorporaRequest. |
| 1177 |
} |
| 1178 |
it := c.ListCorpora(ctx, req) |
| 1179 |
for { |
| 1180 |
resp, err := it.Next() |
| 1181 |
if err == iterator.Done { |
| 1182 |
break |
| 1183 |
} |
| 1184 |
if err != nil { |
| 1185 |
// TODO: Handle error. |
| 1186 |
} |
| 1187 |
// TODO: Use resp. |
| 1188 |
_ = resp |
| 1189 |
|
| 1190 |
// If you need to access the underlying RPC response, |
| 1191 |
// you can do so by casting the `Response` as below. |
| 1192 |
// Otherwise, remove this line. Only populated after |
| 1193 |
// first call to Next(). Not safe for concurrent access. |
| 1194 |
_ = it.Response.(*visionaipb.ListCorporaResponse) |
| 1195 |
} |
| 1196 |
} |
| 1197 |
|
| 1198 |
func ExampleWarehouseClient_ListDataSchemas() { |
| 1199 |
ctx := context.Background() |
| 1200 |
// This snippet has been automatically generated and should be regarded as a code template only. |
| 1201 |
// It will require modifications to work: |
| 1202 |
// - It may require correct/in-range values for request initialization. |
| 1203 |
// - It may require specifying regional endpoints when creating the service client as shown in: |
| 1204 |
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options |
| 1205 |
c, err := visionai.NewWarehouseClient(ctx) |
| 1206 |
if err != nil { |
| 1207 |
// TODO: Handle error. |
| 1208 |
} |
| 1209 |
defer c.Close() |
| 1210 |
|
| 1211 |
req := &visionaipb.ListDataSchemasRequest{ |
| 1212 |
// TODO: Fill request struct fields. |
| 1213 |
// See https://pkg.go.dev/cloud.google.com/go/visionai/apiv1/visionaipb#ListDataSchemasRequest. |
| 1214 |
} |
| 1215 |
it := c.ListDataSchemas(ctx, req) |
| 1216 |
for { |
| 1217 |
resp, err := it.Next() |
| 1218 |
if err == iterator.Done { |
| 1219 |
break |
| 1220 |
} |
| 1221 |
if err != nil { |
| 1222 |
// TODO: Handle error. |
| 1223 |
} |
| 1224 |
// TODO: Use resp. |
| 1225 |
_ = resp |
| 1226 |
|
| 1227 |
// If you need to access the underlying RPC response, |
| 1228 |
// you can do so by casting the `Response` as below. |
| 1229 |
// Otherwise, remove this line. Only populated after |
| 1230 |
// first call to Next(). Not safe for concurrent access. |
| 1231 |
_ = it.Response.(*visionaipb.ListDataSchemasResponse) |
| 1232 |
} |
| 1233 |
} |
| 1234 |
|
| 1235 |
func ExampleWarehouseClient_ListIndexEndpoints() { |
| 1236 |
ctx := context.Background() |
| 1237 |
// This snippet has been automatically generated and should be regarded as a code template only. |
| 1238 |
// It will require modifications to work: |
| 1239 |
// - It may require correct/in-range values for request initialization. |
| 1240 |
// - It may require specifying regional endpoints when creating the service client as shown in: |
| 1241 |
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options |
| 1242 |
c, err := visionai.NewWarehouseClient(ctx) |
| 1243 |
if err != nil { |
| 1244 |
// TODO: Handle error. |
| 1245 |
} |
| 1246 |
defer c.Close() |
| 1247 |
|
| 1248 |
req := &visionaipb.ListIndexEndpointsRequest{ |
| 1249 |
// TODO: Fill request struct fields. |
| 1250 |
// See https://pkg.go.dev/cloud.google.com/go/visionai/apiv1/visionaipb#ListIndexEndpointsRequest. |
| 1251 |
} |
| 1252 |
it := c.ListIndexEndpoints(ctx, req) |
| 1253 |
for { |
| 1254 |
resp, err := it.Next() |
| 1255 |
if err == iterator.Done { |
| 1256 |
break |
| 1257 |
} |
| 1258 |
if err != nil { |
| 1259 |
// TODO: Handle error. |
| 1260 |
} |
| 1261 |
// TODO: Use resp. |
| 1262 |
_ = resp |
| 1263 |
|
| 1264 |
// If you need to access the underlying RPC response, |
| 1265 |
// you can do so by casting the `Response` as below. |
| 1266 |
// Otherwise, remove this line. Only populated after |
| 1267 |
// first call to Next(). Not safe for concurrent access. |
| 1268 |
_ = it.Response.(*visionaipb.ListIndexEndpointsResponse) |
| 1269 |
} |
| 1270 |
} |
| 1271 |
|
| 1272 |
func ExampleWarehouseClient_ListIndexes() { |
| 1273 |
ctx := context.Background() |
| 1274 |
// This snippet has been automatically generated and should be regarded as a code template only. |
| 1275 |
// It will require modifications to work: |
| 1276 |
// - It may require correct/in-range values for request initialization. |
| 1277 |
// - It may require specifying regional endpoints when creating the service client as shown in: |
| 1278 |
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options |
| 1279 |
c, err := visionai.NewWarehouseClient(ctx) |
| 1280 |
if err != nil { |
| 1281 |
// TODO: Handle error. |
| 1282 |
} |
| 1283 |
defer c.Close() |
| 1284 |
|
| 1285 |
req := &visionaipb.ListIndexesRequest{ |
| 1286 |
// TODO: Fill request struct fields. |
| 1287 |
// See https://pkg.go.dev/cloud.google.com/go/visionai/apiv1/visionaipb#ListIndexesRequest. |
| 1288 |
} |
| 1289 |
it := c.ListIndexes(ctx, req) |
| 1290 |
for { |
| 1291 |
resp, err := it.Next() |
| 1292 |
if err == iterator.Done { |
| 1293 |
break |
| 1294 |
} |
| 1295 |
if err != nil { |
| 1296 |
// TODO: Handle error. |
| 1297 |
} |
| 1298 |
// TODO: Use resp. |
| 1299 |
_ = resp |
| 1300 |
|
| 1301 |
// If you need to access the underlying RPC response, |
| 1302 |
// you can do so by casting the `Response` as below. |
| 1303 |
// Otherwise, remove this line. Only populated after |
| 1304 |
// first call to Next(). Not safe for concurrent access. |
| 1305 |
_ = it.Response.(*visionaipb.ListIndexesResponse) |
| 1306 |
} |
| 1307 |
} |
| 1308 |
|
| 1309 |
func ExampleWarehouseClient_ListSearchConfigs() { |
| 1310 |
ctx := context.Background() |
| 1311 |
// This snippet has been automatically generated and should be regarded as a code template only. |
| 1312 |
// It will require modifications to work: |
| 1313 |
// - It may require correct/in-range values for request initialization. |
| 1314 |
// - It may require specifying regional endpoints when creating the service client as shown in: |
| 1315 |
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options |
| 1316 |
c, err := visionai.NewWarehouseClient(ctx) |
| 1317 |
if err != nil { |
| 1318 |
// TODO: Handle error. |
| 1319 |
} |
| 1320 |
defer c.Close() |
| 1321 |
|
| 1322 |
req := &visionaipb.ListSearchConfigsRequest{ |
| 1323 |
// TODO: Fill request struct fields. |
| 1324 |
// See https://pkg.go.dev/cloud.google.com/go/visionai/apiv1/visionaipb#ListSearchConfigsRequest. |
| 1325 |
} |
| 1326 |
it := c.ListSearchConfigs(ctx, req) |
| 1327 |
for { |
| 1328 |
resp, err := it.Next() |
| 1329 |
if err == iterator.Done { |
| 1330 |
break |
| 1331 |
} |
| 1332 |
if err != nil { |
| 1333 |
// TODO: Handle error. |
| 1334 |
} |
| 1335 |
// TODO: Use resp. |
| 1336 |
_ = resp |
| 1337 |
|
| 1338 |
// If you need to access the underlying RPC response, |
| 1339 |
// you can do so by casting the `Response` as below. |
| 1340 |
// Otherwise, remove this line. Only populated after |
| 1341 |
// first call to Next(). Not safe for concurrent access. |
| 1342 |
_ = it.Response.(*visionaipb.ListSearchConfigsResponse) |
| 1343 |
} |
| 1344 |
} |
| 1345 |
|
| 1346 |
func ExampleWarehouseClient_ListSearchHypernyms() { |
| 1347 |
ctx := context.Background() |
| 1348 |
// This snippet has been automatically generated and should be regarded as a code template only. |
| 1349 |
// It will require modifications to work: |
| 1350 |
// - It may require correct/in-range values for request initialization. |
| 1351 |
// - It may require specifying regional endpoints when creating the service client as shown in: |
| 1352 |
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options |
| 1353 |
c, err := visionai.NewWarehouseClient(ctx) |
| 1354 |
if err != nil { |
| 1355 |
// TODO: Handle error. |
| 1356 |
} |
| 1357 |
defer c.Close() |
| 1358 |
|
| 1359 |
req := &visionaipb.ListSearchHypernymsRequest{ |
| 1360 |
// TODO: Fill request struct fields. |
| 1361 |
// See https://pkg.go.dev/cloud.google.com/go/visionai/apiv1/visionaipb#ListSearchHypernymsRequest. |
| 1362 |
} |
| 1363 |
it := c.ListSearchHypernyms(ctx, req) |
| 1364 |
for { |
| 1365 |
resp, err := it.Next() |
| 1366 |
if err == iterator.Done { |
| 1367 |
break |
| 1368 |
} |
| 1369 |
if err != nil { |
| 1370 |
// TODO: Handle error. |
| 1371 |
} |
| 1372 |
// TODO: Use resp. |
| 1373 |
_ = resp |
| 1374 |
|
| 1375 |
// If you need to access the underlying RPC response, |
| 1376 |
// you can do so by casting the `Response` as below. |
| 1377 |
// Otherwise, remove this line. Only populated after |
| 1378 |
// first call to Next(). Not safe for concurrent access. |
| 1379 |
_ = it.Response.(*visionaipb.ListSearchHypernymsResponse) |
| 1380 |
} |
| 1381 |
} |
| 1382 |
|
| 1383 |
func ExampleWarehouseClient_RemoveCollectionItem() { |
| 1384 |
ctx := context.Background() |
| 1385 |
// This snippet has been automatically generated and should be regarded as a code template only. |
| 1386 |
// It will require modifications to work: |
| 1387 |
// - It may require correct/in-range values for request initialization. |
| 1388 |
// - It may require specifying regional endpoints when creating the service client as shown in: |
| 1389 |
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options |
| 1390 |
c, err := visionai.NewWarehouseClient(ctx) |
| 1391 |
if err != nil { |
| 1392 |
// TODO: Handle error. |
| 1393 |
} |
| 1394 |
defer c.Close() |
| 1395 |
|
| 1396 |
req := &visionaipb.RemoveCollectionItemRequest{ |
| 1397 |
// TODO: Fill request struct fields. |
| 1398 |
// See https://pkg.go.dev/cloud.google.com/go/visionai/apiv1/visionaipb#RemoveCollectionItemRequest. |
| 1399 |
} |
| 1400 |
resp, err := c.RemoveCollectionItem(ctx, req) |
| 1401 |
if err != nil { |
| 1402 |
// TODO: Handle error. |
| 1403 |
} |
| 1404 |
// TODO: Use resp. |
| 1405 |
_ = resp |
| 1406 |
} |
| 1407 |
|
| 1408 |
func ExampleWarehouseClient_RemoveIndexAsset() { |
| 1409 |
ctx := context.Background() |
| 1410 |
// This snippet has been automatically generated and should be regarded as a code template only. |
| 1411 |
// It will require modifications to work: |
| 1412 |
// - It may require correct/in-range values for request initialization. |
| 1413 |
// - It may require specifying regional endpoints when creating the service client as shown in: |
| 1414 |
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options |
| 1415 |
c, err := visionai.NewWarehouseClient(ctx) |
| 1416 |
if err != nil { |
| 1417 |
// TODO: Handle error. |
| 1418 |
} |
| 1419 |
defer c.Close() |
| 1420 |
|
| 1421 |
req := &visionaipb.RemoveIndexAssetRequest{ |
| 1422 |
// TODO: Fill request struct fields. |
| 1423 |
// See https://pkg.go.dev/cloud.google.com/go/visionai/apiv1/visionaipb#RemoveIndexAssetRequest. |
| 1424 |
} |
| 1425 |
op, err := c.RemoveIndexAsset(ctx, req) |
| 1426 |
if err != nil { |
| 1427 |
// TODO: Handle error. |
| 1428 |
} |
| 1429 |
|
| 1430 |
resp, err := op.Wait(ctx) |
| 1431 |
if err != nil { |
| 1432 |
// TODO: Handle error. |
| 1433 |
} |
| 1434 |
// TODO: Use resp. |
| 1435 |
_ = resp |
| 1436 |
} |
| 1437 |
|
| 1438 |
func ExampleWarehouseClient_SearchAssets() { |
| 1439 |
ctx := context.Background() |
| 1440 |
// This snippet has been automatically generated and should be regarded as a code template only. |
| 1441 |
// It will require modifications to work: |
| 1442 |
// - It may require correct/in-range values for request initialization. |
| 1443 |
// - It may require specifying regional endpoints when creating the service client as shown in: |
| 1444 |
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options |
| 1445 |
c, err := visionai.NewWarehouseClient(ctx) |
| 1446 |
if err != nil { |
| 1447 |
// TODO: Handle error. |
| 1448 |
} |
| 1449 |
defer c.Close() |
| 1450 |
|
| 1451 |
req := &visionaipb.SearchAssetsRequest{ |
| 1452 |
// TODO: Fill request struct fields. |
| 1453 |
// See https://pkg.go.dev/cloud.google.com/go/visionai/apiv1/visionaipb#SearchAssetsRequest. |
| 1454 |
} |
| 1455 |
it := c.SearchAssets(ctx, req) |
| 1456 |
for { |
| 1457 |
resp, err := it.Next() |
| 1458 |
if err == iterator.Done { |
| 1459 |
break |
| 1460 |
} |
| 1461 |
if err != nil { |
| 1462 |
// TODO: Handle error. |
| 1463 |
} |
| 1464 |
// TODO: Use resp. |
| 1465 |
_ = resp |
| 1466 |
|
| 1467 |
// If you need to access the underlying RPC response, |
| 1468 |
// you can do so by casting the `Response` as below. |
| 1469 |
// Otherwise, remove this line. Only populated after |
| 1470 |
// first call to Next(). Not safe for concurrent access. |
| 1471 |
_ = it.Response.(*visionaipb.SearchAssetsResponse) |
| 1472 |
} |
| 1473 |
} |
| 1474 |
|
| 1475 |
func ExampleWarehouseClient_SearchIndexEndpoint() { |
| 1476 |
ctx := context.Background() |
| 1477 |
// This snippet has been automatically generated and should be regarded as a code template only. |
| 1478 |
// It will require modifications to work: |
| 1479 |
// - It may require correct/in-range values for request initialization. |
| 1480 |
// - It may require specifying regional endpoints when creating the service client as shown in: |
| 1481 |
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options |
| 1482 |
c, err := visionai.NewWarehouseClient(ctx) |
| 1483 |
if err != nil { |
| 1484 |
// TODO: Handle error. |
| 1485 |
} |
| 1486 |
defer c.Close() |
| 1487 |
|
| 1488 |
req := &visionaipb.SearchIndexEndpointRequest{ |
| 1489 |
// TODO: Fill request struct fields. |
| 1490 |
// See https://pkg.go.dev/cloud.google.com/go/visionai/apiv1/visionaipb#SearchIndexEndpointRequest. |
| 1491 |
} |
| 1492 |
it := c.SearchIndexEndpoint(ctx, req) |
| 1493 |
for { |
| 1494 |
resp, err := it.Next() |
| 1495 |
if err == iterator.Done { |
| 1496 |
break |
| 1497 |
} |
| 1498 |
if err != nil { |
| 1499 |
// TODO: Handle error. |
| 1500 |
} |
| 1501 |
// TODO: Use resp. |
| 1502 |
_ = resp |
| 1503 |
|
| 1504 |
// If you need to access the underlying RPC response, |
| 1505 |
// you can do so by casting the `Response` as below. |
| 1506 |
// Otherwise, remove this line. Only populated after |
| 1507 |
// first call to Next(). Not safe for concurrent access. |
| 1508 |
_ = it.Response.(*visionaipb.SearchIndexEndpointResponse) |
| 1509 |
} |
| 1510 |
} |
| 1511 |
|
| 1512 |
func ExampleWarehouseClient_UndeployIndex() { |
| 1513 |
ctx := context.Background() |
| 1514 |
// This snippet has been automatically generated and should be regarded as a code template only. |
| 1515 |
// It will require modifications to work: |
| 1516 |
// - It may require correct/in-range values for request initialization. |
| 1517 |
// - It may require specifying regional endpoints when creating the service client as shown in: |
| 1518 |
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options |
| 1519 |
c, err := visionai.NewWarehouseClient(ctx) |
| 1520 |
if err != nil { |
| 1521 |
// TODO: Handle error. |
| 1522 |
} |
| 1523 |
defer c.Close() |
| 1524 |
|
| 1525 |
req := &visionaipb.UndeployIndexRequest{ |
| 1526 |
// TODO: Fill request struct fields. |
| 1527 |
// See https://pkg.go.dev/cloud.google.com/go/visionai/apiv1/visionaipb#UndeployIndexRequest. |
| 1528 |
} |
| 1529 |
op, err := c.UndeployIndex(ctx, req) |
| 1530 |
if err != nil { |
| 1531 |
// TODO: Handle error. |
| 1532 |
} |
| 1533 |
|
| 1534 |
resp, err := op.Wait(ctx) |
| 1535 |
if err != nil { |
| 1536 |
// TODO: Handle error. |
| 1537 |
} |
| 1538 |
// TODO: Use resp. |
| 1539 |
_ = resp |
| 1540 |
} |
| 1541 |
|
| 1542 |
func ExampleWarehouseClient_UpdateAnnotation() { |
| 1543 |
ctx := context.Background() |
| 1544 |
// This snippet has been automatically generated and should be regarded as a code template only. |
| 1545 |
// It will require modifications to work: |
| 1546 |
// - It may require correct/in-range values for request initialization. |
| 1547 |
// - It may require specifying regional endpoints when creating the service client as shown in: |
| 1548 |
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options |
| 1549 |
c, err := visionai.NewWarehouseClient(ctx) |
| 1550 |
if err != nil { |
| 1551 |
// TODO: Handle error. |
| 1552 |
} |
| 1553 |
defer c.Close() |
| 1554 |
|
| 1555 |
req := &visionaipb.UpdateAnnotationRequest{ |
| 1556 |
// TODO: Fill request struct fields. |
| 1557 |
// See https://pkg.go.dev/cloud.google.com/go/visionai/apiv1/visionaipb#UpdateAnnotationRequest. |
| 1558 |
} |
| 1559 |
resp, err := c.UpdateAnnotation(ctx, req) |
| 1560 |
if err != nil { |
| 1561 |
// TODO: Handle error. |
| 1562 |
} |
| 1563 |
// TODO: Use resp. |
| 1564 |
_ = resp |
| 1565 |
} |
| 1566 |
|
| 1567 |
func ExampleWarehouseClient_UpdateAsset() { |
| 1568 |
ctx := context.Background() |
| 1569 |
// This snippet has been automatically generated and should be regarded as a code template only. |
| 1570 |
// It will require modifications to work: |
| 1571 |
// - It may require correct/in-range values for request initialization. |
| 1572 |
// - It may require specifying regional endpoints when creating the service client as shown in: |
| 1573 |
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options |
| 1574 |
c, err := visionai.NewWarehouseClient(ctx) |
| 1575 |
if err != nil { |
| 1576 |
// TODO: Handle error. |
| 1577 |
} |
| 1578 |
defer c.Close() |
| 1579 |
|
| 1580 |
req := &visionaipb.UpdateAssetRequest{ |
| 1581 |
// TODO: Fill request struct fields. |
| 1582 |
// See https://pkg.go.dev/cloud.google.com/go/visionai/apiv1/visionaipb#UpdateAssetRequest. |
| 1583 |
} |
| 1584 |
resp, err := c.UpdateAsset(ctx, req) |
| 1585 |
if err != nil { |
| 1586 |
// TODO: Handle error. |
| 1587 |
} |
| 1588 |
// TODO: Use resp. |
| 1589 |
_ = resp |
| 1590 |
} |
| 1591 |
|
| 1592 |
func ExampleWarehouseClient_UpdateCollection() { |
| 1593 |
ctx := context.Background() |
| 1594 |
// This snippet has been automatically generated and should be regarded as a code template only. |
| 1595 |
// It will require modifications to work: |
| 1596 |
// - It may require correct/in-range values for request initialization. |
| 1597 |
// - It may require specifying regional endpoints when creating the service client as shown in: |
| 1598 |
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options |
| 1599 |
c, err := visionai.NewWarehouseClient(ctx) |
| 1600 |
if err != nil { |
| 1601 |
// TODO: Handle error. |
| 1602 |
} |
| 1603 |
defer c.Close() |
| 1604 |
|
| 1605 |
req := &visionaipb.UpdateCollectionRequest{ |
| 1606 |
// TODO: Fill request struct fields. |
| 1607 |
// See https://pkg.go.dev/cloud.google.com/go/visionai/apiv1/visionaipb#UpdateCollectionRequest. |
| 1608 |
} |
| 1609 |
resp, err := c.UpdateCollection(ctx, req) |
| 1610 |
if err != nil { |
| 1611 |
// TODO: Handle error. |
| 1612 |
} |
| 1613 |
// TODO: Use resp. |
| 1614 |
_ = resp |
| 1615 |
} |
| 1616 |
|
| 1617 |
func ExampleWarehouseClient_UpdateCorpus() { |
| 1618 |
ctx := context.Background() |
| 1619 |
// This snippet has been automatically generated and should be regarded as a code template only. |
| 1620 |
// It will require modifications to work: |
| 1621 |
// - It may require correct/in-range values for request initialization. |
| 1622 |
// - It may require specifying regional endpoints when creating the service client as shown in: |
| 1623 |
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options |
| 1624 |
c, err := visionai.NewWarehouseClient(ctx) |
| 1625 |
if err != nil { |
| 1626 |
// TODO: Handle error. |
| 1627 |
} |
| 1628 |
defer c.Close() |
| 1629 |
|
| 1630 |
req := &visionaipb.UpdateCorpusRequest{ |
| 1631 |
// TODO: Fill request struct fields. |
| 1632 |
// See https://pkg.go.dev/cloud.google.com/go/visionai/apiv1/visionaipb#UpdateCorpusRequest. |
| 1633 |
} |
| 1634 |
resp, err := c.UpdateCorpus(ctx, req) |
| 1635 |
if err != nil { |
| 1636 |
// TODO: Handle error. |
| 1637 |
} |
| 1638 |
// TODO: Use resp. |
| 1639 |
_ = resp |
| 1640 |
} |
| 1641 |
|
| 1642 |
func ExampleWarehouseClient_UpdateDataSchema() { |
| 1643 |
ctx := context.Background() |
| 1644 |
// This snippet has been automatically generated and should be regarded as a code template only. |
| 1645 |
// It will require modifications to work: |
| 1646 |
// - It may require correct/in-range values for request initialization. |
| 1647 |
// - It may require specifying regional endpoints when creating the service client as shown in: |
| 1648 |
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options |
| 1649 |
c, err := visionai.NewWarehouseClient(ctx) |
| 1650 |
if err != nil { |
| 1651 |
// TODO: Handle error. |
| 1652 |
} |
| 1653 |
defer c.Close() |
| 1654 |
|
| 1655 |
req := &visionaipb.UpdateDataSchemaRequest{ |
| 1656 |
// TODO: Fill request struct fields. |
| 1657 |
// See https://pkg.go.dev/cloud.google.com/go/visionai/apiv1/visionaipb#UpdateDataSchemaRequest. |
| 1658 |
} |
| 1659 |
resp, err := c.UpdateDataSchema(ctx, req) |
| 1660 |
if err != nil { |
| 1661 |
// TODO: Handle error. |
| 1662 |
} |
| 1663 |
// TODO: Use resp. |
| 1664 |
_ = resp |
| 1665 |
} |
| 1666 |
|
| 1667 |
func ExampleWarehouseClient_UpdateIndex() { |
| 1668 |
ctx := context.Background() |
| 1669 |
// This snippet has been automatically generated and should be regarded as a code template only. |
| 1670 |
// It will require modifications to work: |
| 1671 |
// - It may require correct/in-range values for request initialization. |
| 1672 |
// - It may require specifying regional endpoints when creating the service client as shown in: |
| 1673 |
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options |
| 1674 |
c, err := visionai.NewWarehouseClient(ctx) |
| 1675 |
if err != nil { |
| 1676 |
// TODO: Handle error. |
| 1677 |
} |
| 1678 |
defer c.Close() |
| 1679 |
|
| 1680 |
req := &visionaipb.UpdateIndexRequest{ |
| 1681 |
// TODO: Fill request struct fields. |
| 1682 |
// See https://pkg.go.dev/cloud.google.com/go/visionai/apiv1/visionaipb#UpdateIndexRequest. |
| 1683 |
} |
| 1684 |
op, err := c.UpdateIndex(ctx, req) |
| 1685 |
if err != nil { |
| 1686 |
// TODO: Handle error. |
| 1687 |
} |
| 1688 |
|
| 1689 |
resp, err := op.Wait(ctx) |
| 1690 |
if err != nil { |
| 1691 |
// TODO: Handle error. |
| 1692 |
} |
| 1693 |
// TODO: Use resp. |
| 1694 |
_ = resp |
| 1695 |
} |
| 1696 |
|
| 1697 |
func ExampleWarehouseClient_UpdateIndexEndpoint() { |
| 1698 |
ctx := context.Background() |
| 1699 |
// This snippet has been automatically generated and should be regarded as a code template only. |
| 1700 |
// It will require modifications to work: |
| 1701 |
// - It may require correct/in-range values for request initialization. |
| 1702 |
// - It may require specifying regional endpoints when creating the service client as shown in: |
| 1703 |
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options |
| 1704 |
c, err := visionai.NewWarehouseClient(ctx) |
| 1705 |
if err != nil { |
| 1706 |
// TODO: Handle error. |
| 1707 |
} |
| 1708 |
defer c.Close() |
| 1709 |
|
| 1710 |
req := &visionaipb.UpdateIndexEndpointRequest{ |
| 1711 |
// TODO: Fill request struct fields. |
| 1712 |
// See https://pkg.go.dev/cloud.google.com/go/visionai/apiv1/visionaipb#UpdateIndexEndpointRequest. |
| 1713 |
} |
| 1714 |
op, err := c.UpdateIndexEndpoint(ctx, req) |
| 1715 |
if err != nil { |
| 1716 |
// TODO: Handle error. |
| 1717 |
} |
| 1718 |
|
| 1719 |
resp, err := op.Wait(ctx) |
| 1720 |
if err != nil { |
| 1721 |
// TODO: Handle error. |
| 1722 |
} |
| 1723 |
// TODO: Use resp. |
| 1724 |
_ = resp |
| 1725 |
} |
| 1726 |
|
| 1727 |
func ExampleWarehouseClient_UpdateSearchConfig() { |
| 1728 |
ctx := context.Background() |
| 1729 |
// This snippet has been automatically generated and should be regarded as a code template only. |
| 1730 |
// It will require modifications to work: |
| 1731 |
// - It may require correct/in-range values for request initialization. |
| 1732 |
// - It may require specifying regional endpoints when creating the service client as shown in: |
| 1733 |
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options |
| 1734 |
c, err := visionai.NewWarehouseClient(ctx) |
| 1735 |
if err != nil { |
| 1736 |
// TODO: Handle error. |
| 1737 |
} |
| 1738 |
defer c.Close() |
| 1739 |
|
| 1740 |
req := &visionaipb.UpdateSearchConfigRequest{ |
| 1741 |
// TODO: Fill request struct fields. |
| 1742 |
// See https://pkg.go.dev/cloud.google.com/go/visionai/apiv1/visionaipb#UpdateSearchConfigRequest. |
| 1743 |
} |
| 1744 |
resp, err := c.UpdateSearchConfig(ctx, req) |
| 1745 |
if err != nil { |
| 1746 |
// TODO: Handle error. |
| 1747 |
} |
| 1748 |
// TODO: Use resp. |
| 1749 |
_ = resp |
| 1750 |
} |
| 1751 |
|
| 1752 |
func ExampleWarehouseClient_UpdateSearchHypernym() { |
| 1753 |
ctx := context.Background() |
| 1754 |
// This snippet has been automatically generated and should be regarded as a code template only. |
| 1755 |
// It will require modifications to work: |
| 1756 |
// - It may require correct/in-range values for request initialization. |
| 1757 |
// - It may require specifying regional endpoints when creating the service client as shown in: |
| 1758 |
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options |
| 1759 |
c, err := visionai.NewWarehouseClient(ctx) |
| 1760 |
if err != nil { |
| 1761 |
// TODO: Handle error. |
| 1762 |
} |
| 1763 |
defer c.Close() |
| 1764 |
|
| 1765 |
req := &visionaipb.UpdateSearchHypernymRequest{ |
| 1766 |
// TODO: Fill request struct fields. |
| 1767 |
// See https://pkg.go.dev/cloud.google.com/go/visionai/apiv1/visionaipb#UpdateSearchHypernymRequest. |
| 1768 |
} |
| 1769 |
resp, err := c.UpdateSearchHypernym(ctx, req) |
| 1770 |
if err != nil { |
| 1771 |
// TODO: Handle error. |
| 1772 |
} |
| 1773 |
// TODO: Use resp. |
| 1774 |
_ = resp |
| 1775 |
} |
| 1776 |
|
| 1777 |
func ExampleWarehouseClient_UploadAsset() { |
| 1778 |
ctx := context.Background() |
| 1779 |
// This snippet has been automatically generated and should be regarded as a code template only. |
| 1780 |
// It will require modifications to work: |
| 1781 |
// - It may require correct/in-range values for request initialization. |
| 1782 |
// - It may require specifying regional endpoints when creating the service client as shown in: |
| 1783 |
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options |
| 1784 |
c, err := visionai.NewWarehouseClient(ctx) |
| 1785 |
if err != nil { |
| 1786 |
// TODO: Handle error. |
| 1787 |
} |
| 1788 |
defer c.Close() |
| 1789 |
|
| 1790 |
req := &visionaipb.UploadAssetRequest{ |
| 1791 |
// TODO: Fill request struct fields. |
| 1792 |
// See https://pkg.go.dev/cloud.google.com/go/visionai/apiv1/visionaipb#UploadAssetRequest. |
| 1793 |
} |
| 1794 |
op, err := c.UploadAsset(ctx, req) |
| 1795 |
if err != nil { |
| 1796 |
// TODO: Handle error. |
| 1797 |
} |
| 1798 |
|
| 1799 |
resp, err := op.Wait(ctx) |
| 1800 |
if err != nil { |
| 1801 |
// TODO: Handle error. |
| 1802 |
} |
| 1803 |
// TODO: Use resp. |
| 1804 |
_ = resp |
| 1805 |
} |
| 1806 |
|
| 1807 |
func ExampleWarehouseClient_ViewCollectionItems() { |
| 1808 |
ctx := context.Background() |
| 1809 |
// This snippet has been automatically generated and should be regarded as a code template only. |
| 1810 |
// It will require modifications to work: |
| 1811 |
// - It may require correct/in-range values for request initialization. |
| 1812 |
// - It may require specifying regional endpoints when creating the service client as shown in: |
| 1813 |
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options |
| 1814 |
c, err := visionai.NewWarehouseClient(ctx) |
| 1815 |
if err != nil { |
| 1816 |
// TODO: Handle error. |
| 1817 |
} |
| 1818 |
defer c.Close() |
| 1819 |
|
| 1820 |
req := &visionaipb.ViewCollectionItemsRequest{ |
| 1821 |
// TODO: Fill request struct fields. |
| 1822 |
// See https://pkg.go.dev/cloud.google.com/go/visionai/apiv1/visionaipb#ViewCollectionItemsRequest. |
| 1823 |
} |
| 1824 |
it := c.ViewCollectionItems(ctx, req) |
| 1825 |
for { |
| 1826 |
resp, err := it.Next() |
| 1827 |
if err == iterator.Done { |
| 1828 |
break |
| 1829 |
} |
| 1830 |
if err != nil { |
| 1831 |
// TODO: Handle error. |
| 1832 |
} |
| 1833 |
// TODO: Use resp. |
| 1834 |
_ = resp |
| 1835 |
|
| 1836 |
// If you need to access the underlying RPC response, |
| 1837 |
// you can do so by casting the `Response` as below. |
| 1838 |
// Otherwise, remove this line. Only populated after |
| 1839 |
// first call to Next(). Not safe for concurrent access. |
| 1840 |
_ = it.Response.(*visionaipb.ViewCollectionItemsResponse) |
| 1841 |
} |
| 1842 |
} |
| 1843 |
|
| 1844 |
func ExampleWarehouseClient_ViewIndexedAssets() { |
| 1845 |
ctx := context.Background() |
| 1846 |
// This snippet has been automatically generated and should be regarded as a code template only. |
| 1847 |
// It will require modifications to work: |
| 1848 |
// - It may require correct/in-range values for request initialization. |
| 1849 |
// - It may require specifying regional endpoints when creating the service client as shown in: |
| 1850 |
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options |
| 1851 |
c, err := visionai.NewWarehouseClient(ctx) |
| 1852 |
if err != nil { |
| 1853 |
// TODO: Handle error. |
| 1854 |
} |
| 1855 |
defer c.Close() |
| 1856 |
|
| 1857 |
req := &visionaipb.ViewIndexedAssetsRequest{ |
| 1858 |
// TODO: Fill request struct fields. |
| 1859 |
// See https://pkg.go.dev/cloud.google.com/go/visionai/apiv1/visionaipb#ViewIndexedAssetsRequest. |
| 1860 |
} |
| 1861 |
it := c.ViewIndexedAssets(ctx, req) |
| 1862 |
for { |
| 1863 |
resp, err := it.Next() |
| 1864 |
if err == iterator.Done { |
| 1865 |
break |
| 1866 |
} |
| 1867 |
if err != nil { |
| 1868 |
// TODO: Handle error. |
| 1869 |
} |
| 1870 |
// TODO: Use resp. |
| 1871 |
_ = resp |
| 1872 |
|
| 1873 |
// If you need to access the underlying RPC response, |
| 1874 |
// you can do so by casting the `Response` as below. |
| 1875 |
// Otherwise, remove this line. Only populated after |
| 1876 |
// first call to Next(). Not safe for concurrent access. |
| 1877 |
_ = it.Response.(*visionaipb.ViewIndexedAssetsResponse) |
| 1878 |
} |
| 1879 |
} |
| 1880 |
|
| 1881 |
func ExampleWarehouseClient_CancelOperation() { |
| 1882 |
ctx := context.Background() |
| 1883 |
// This snippet has been automatically generated and should be regarded as a code template only. |
| 1884 |
// It will require modifications to work: |
| 1885 |
// - It may require correct/in-range values for request initialization. |
| 1886 |
// - It may require specifying regional endpoints when creating the service client as shown in: |
| 1887 |
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options |
| 1888 |
c, err := visionai.NewWarehouseClient(ctx) |
| 1889 |
if err != nil { |
| 1890 |
// TODO: Handle error. |
| 1891 |
} |
| 1892 |
defer c.Close() |
| 1893 |
|
| 1894 |
req := &longrunningpb.CancelOperationRequest{ |
| 1895 |
// TODO: Fill request struct fields. |
| 1896 |
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#CancelOperationRequest. |
| 1897 |
} |
| 1898 |
err = c.CancelOperation(ctx, req) |
| 1899 |
if err != nil { |
| 1900 |
// TODO: Handle error. |
| 1901 |
} |
| 1902 |
} |
| 1903 |
|
| 1904 |
func ExampleWarehouseClient_DeleteOperation() { |
| 1905 |
ctx := context.Background() |
| 1906 |
// This snippet has been automatically generated and should be regarded as a code template only. |
| 1907 |
// It will require modifications to work: |
| 1908 |
// - It may require correct/in-range values for request initialization. |
| 1909 |
// - It may require specifying regional endpoints when creating the service client as shown in: |
| 1910 |
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options |
| 1911 |
c, err := visionai.NewWarehouseClient(ctx) |
| 1912 |
if err != nil { |
| 1913 |
// TODO: Handle error. |
| 1914 |
} |
| 1915 |
defer c.Close() |
| 1916 |
|
| 1917 |
req := &longrunningpb.DeleteOperationRequest{ |
| 1918 |
// TODO: Fill request struct fields. |
| 1919 |
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#DeleteOperationRequest. |
| 1920 |
} |
| 1921 |
err = c.DeleteOperation(ctx, req) |
| 1922 |
if err != nil { |
| 1923 |
// TODO: Handle error. |
| 1924 |
} |
| 1925 |
} |
| 1926 |
|
| 1927 |
func ExampleWarehouseClient_GetOperation() { |
| 1928 |
ctx := context.Background() |
| 1929 |
// This snippet has been automatically generated and should be regarded as a code template only. |
| 1930 |
// It will require modifications to work: |
| 1931 |
// - It may require correct/in-range values for request initialization. |
| 1932 |
// - It may require specifying regional endpoints when creating the service client as shown in: |
| 1933 |
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options |
| 1934 |
c, err := visionai.NewWarehouseClient(ctx) |
| 1935 |
if err != nil { |
| 1936 |
// TODO: Handle error. |
| 1937 |
} |
| 1938 |
defer c.Close() |
| 1939 |
|
| 1940 |
req := &longrunningpb.GetOperationRequest{ |
| 1941 |
// TODO: Fill request struct fields. |
| 1942 |
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#GetOperationRequest. |
| 1943 |
} |
| 1944 |
resp, err := c.GetOperation(ctx, req) |
| 1945 |
if err != nil { |
| 1946 |
// TODO: Handle error. |
| 1947 |
} |
| 1948 |
// TODO: Use resp. |
| 1949 |
_ = resp |
| 1950 |
} |
| 1951 |
|
| 1952 |
func ExampleWarehouseClient_ListOperations() { |
| 1953 |
ctx := context.Background() |
| 1954 |
// This snippet has been automatically generated and should be regarded as a code template only. |
| 1955 |
// It will require modifications to work: |
| 1956 |
// - It may require correct/in-range values for request initialization. |
| 1957 |
// - It may require specifying regional endpoints when creating the service client as shown in: |
| 1958 |
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options |
| 1959 |
c, err := visionai.NewWarehouseClient(ctx) |
| 1960 |
if err != nil { |
| 1961 |
// TODO: Handle error. |
| 1962 |
} |
| 1963 |
defer c.Close() |
| 1964 |
|
| 1965 |
req := &longrunningpb.ListOperationsRequest{ |
| 1966 |
// TODO: Fill request struct fields. |
| 1967 |
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#ListOperationsRequest. |
| 1968 |
} |
| 1969 |
it := c.ListOperations(ctx, req) |
| 1970 |
for { |
| 1971 |
resp, err := it.Next() |
| 1972 |
if err == iterator.Done { |
| 1973 |
break |
| 1974 |
} |
| 1975 |
if err != nil { |
| 1976 |
// TODO: Handle error. |
| 1977 |
} |
| 1978 |
// TODO: Use resp. |
| 1979 |
_ = resp |
| 1980 |
|
| 1981 |
// If you need to access the underlying RPC response, |
| 1982 |
// you can do so by casting the `Response` as below. |
| 1983 |
// Otherwise, remove this line. Only populated after |
| 1984 |
// first call to Next(). Not safe for concurrent access. |
| 1985 |
_ = it.Response.(*longrunningpb.ListOperationsResponse) |
| 1986 |
} |
| 1987 |
} |