Debian Codegraph @

automl/apiv1beta1/auto_ml_client_example_test.go

raw
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 automl_test
18
19 import (
20 "context"
21
22 automl "cloud.google.com/go/automl/apiv1beta1"
23 automlpb "cloud.google.com/go/automl/apiv1beta1/automlpb"
24 "google.golang.org/api/iterator"
25 )
26
27 func ExampleNewClient() {
28 ctx := context.Background()
29 // This snippet has been automatically generated and should be regarded as a code template only.
30 // It will require modifications to work:
31 // - It may require correct/in-range values for request initialization.
32 // - It may require specifying regional endpoints when creating the service client as shown in:
33 // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
34 c, err := automl.NewClient(ctx)
35 if err != nil {
36 // TODO: Handle error.
37 }
38 defer c.Close()
39
40 // TODO: Use client.
41 _ = c
42 }
43
44 func ExampleNewRESTClient() {
45 ctx := context.Background()
46 // This snippet has been automatically generated and should be regarded as a code template only.
47 // It will require modifications to work:
48 // - It may require correct/in-range values for request initialization.
49 // - It may require specifying regional endpoints when creating the service client as shown in:
50 // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
51 c, err := automl.NewRESTClient(ctx)
52 if err != nil {
53 // TODO: Handle error.
54 }
55 defer c.Close()
56
57 // TODO: Use client.
58 _ = c
59 }
60
61 func ExampleClient_CreateDataset() {
62 ctx := context.Background()
63 // This snippet has been automatically generated and should be regarded as a code template only.
64 // It will require modifications to work:
65 // - It may require correct/in-range values for request initialization.
66 // - It may require specifying regional endpoints when creating the service client as shown in:
67 // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
68 c, err := automl.NewClient(ctx)
69 if err != nil {
70 // TODO: Handle error.
71 }
72 defer c.Close()
73
74 req := &automlpb.CreateDatasetRequest{
75 // TODO: Fill request struct fields.
76 // See https://pkg.go.dev/cloud.google.com/go/automl/apiv1beta1/automlpb#CreateDatasetRequest.
77 }
78 resp, err := c.CreateDataset(ctx, req)
79 if err != nil {
80 // TODO: Handle error.
81 }
82 // TODO: Use resp.
83 _ = resp
84 }
85
86 func ExampleClient_CreateModel() {
87 ctx := context.Background()
88 // This snippet has been automatically generated and should be regarded as a code template only.
89 // It will require modifications to work:
90 // - It may require correct/in-range values for request initialization.
91 // - It may require specifying regional endpoints when creating the service client as shown in:
92 // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
93 c, err := automl.NewClient(ctx)
94 if err != nil {
95 // TODO: Handle error.
96 }
97 defer c.Close()
98
99 req := &automlpb.CreateModelRequest{
100 // TODO: Fill request struct fields.
101 // See https://pkg.go.dev/cloud.google.com/go/automl/apiv1beta1/automlpb#CreateModelRequest.
102 }
103 op, err := c.CreateModel(ctx, req)
104 if err != nil {
105 // TODO: Handle error.
106 }
107
108 resp, err := op.Wait(ctx)
109 if err != nil {
110 // TODO: Handle error.
111 }
112 // TODO: Use resp.
113 _ = resp
114 }
115
116 func ExampleClient_DeleteDataset() {
117 ctx := context.Background()
118 // This snippet has been automatically generated and should be regarded as a code template only.
119 // It will require modifications to work:
120 // - It may require correct/in-range values for request initialization.
121 // - It may require specifying regional endpoints when creating the service client as shown in:
122 // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
123 c, err := automl.NewClient(ctx)
124 if err != nil {
125 // TODO: Handle error.
126 }
127 defer c.Close()
128
129 req := &automlpb.DeleteDatasetRequest{
130 // TODO: Fill request struct fields.
131 // See https://pkg.go.dev/cloud.google.com/go/automl/apiv1beta1/automlpb#DeleteDatasetRequest.
132 }
133 op, err := c.DeleteDataset(ctx, req)
134 if err != nil {
135 // TODO: Handle error.
136 }
137
138 err = op.Wait(ctx)
139 if err != nil {
140 // TODO: Handle error.
141 }
142 }
143
144 func ExampleClient_DeleteModel() {
145 ctx := context.Background()
146 // This snippet has been automatically generated and should be regarded as a code template only.
147 // It will require modifications to work:
148 // - It may require correct/in-range values for request initialization.
149 // - It may require specifying regional endpoints when creating the service client as shown in:
150 // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
151 c, err := automl.NewClient(ctx)
152 if err != nil {
153 // TODO: Handle error.
154 }
155 defer c.Close()
156
157 req := &automlpb.DeleteModelRequest{
158 // TODO: Fill request struct fields.
159 // See https://pkg.go.dev/cloud.google.com/go/automl/apiv1beta1/automlpb#DeleteModelRequest.
160 }
161 op, err := c.DeleteModel(ctx, req)
162 if err != nil {
163 // TODO: Handle error.
164 }
165
166 err = op.Wait(ctx)
167 if err != nil {
168 // TODO: Handle error.
169 }
170 }
171
172 func ExampleClient_DeployModel() {
173 ctx := context.Background()
174 // This snippet has been automatically generated and should be regarded as a code template only.
175 // It will require modifications to work:
176 // - It may require correct/in-range values for request initialization.
177 // - It may require specifying regional endpoints when creating the service client as shown in:
178 // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
179 c, err := automl.NewClient(ctx)
180 if err != nil {
181 // TODO: Handle error.
182 }
183 defer c.Close()
184
185 req := &automlpb.DeployModelRequest{
186 // TODO: Fill request struct fields.
187 // See https://pkg.go.dev/cloud.google.com/go/automl/apiv1beta1/automlpb#DeployModelRequest.
188 }
189 op, err := c.DeployModel(ctx, req)
190 if err != nil {
191 // TODO: Handle error.
192 }
193
194 err = op.Wait(ctx)
195 if err != nil {
196 // TODO: Handle error.
197 }
198 }
199
200 func ExampleClient_ExportData() {
201 ctx := context.Background()
202 // This snippet has been automatically generated and should be regarded as a code template only.
203 // It will require modifications to work:
204 // - It may require correct/in-range values for request initialization.
205 // - It may require specifying regional endpoints when creating the service client as shown in:
206 // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
207 c, err := automl.NewClient(ctx)
208 if err != nil {
209 // TODO: Handle error.
210 }
211 defer c.Close()
212
213 req := &automlpb.ExportDataRequest{
214 // TODO: Fill request struct fields.
215 // See https://pkg.go.dev/cloud.google.com/go/automl/apiv1beta1/automlpb#ExportDataRequest.
216 }
217 op, err := c.ExportData(ctx, req)
218 if err != nil {
219 // TODO: Handle error.
220 }
221
222 err = op.Wait(ctx)
223 if err != nil {
224 // TODO: Handle error.
225 }
226 }
227
228 func ExampleClient_ExportEvaluatedExamples() {
229 ctx := context.Background()
230 // This snippet has been automatically generated and should be regarded as a code template only.
231 // It will require modifications to work:
232 // - It may require correct/in-range values for request initialization.
233 // - It may require specifying regional endpoints when creating the service client as shown in:
234 // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
235 c, err := automl.NewClient(ctx)
236 if err != nil {
237 // TODO: Handle error.
238 }
239 defer c.Close()
240
241 req := &automlpb.ExportEvaluatedExamplesRequest{
242 // TODO: Fill request struct fields.
243 // See https://pkg.go.dev/cloud.google.com/go/automl/apiv1beta1/automlpb#ExportEvaluatedExamplesRequest.
244 }
245 op, err := c.ExportEvaluatedExamples(ctx, req)
246 if err != nil {
247 // TODO: Handle error.
248 }
249
250 err = op.Wait(ctx)
251 if err != nil {
252 // TODO: Handle error.
253 }
254 }
255
256 func ExampleClient_ExportModel() {
257 ctx := context.Background()
258 // This snippet has been automatically generated and should be regarded as a code template only.
259 // It will require modifications to work:
260 // - It may require correct/in-range values for request initialization.
261 // - It may require specifying regional endpoints when creating the service client as shown in:
262 // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
263 c, err := automl.NewClient(ctx)
264 if err != nil {
265 // TODO: Handle error.
266 }
267 defer c.Close()
268
269 req := &automlpb.ExportModelRequest{
270 // TODO: Fill request struct fields.
271 // See https://pkg.go.dev/cloud.google.com/go/automl/apiv1beta1/automlpb#ExportModelRequest.
272 }
273 op, err := c.ExportModel(ctx, req)
274 if err != nil {
275 // TODO: Handle error.
276 }
277
278 err = op.Wait(ctx)
279 if err != nil {
280 // TODO: Handle error.
281 }
282 }
283
284 func ExampleClient_GetAnnotationSpec() {
285 ctx := context.Background()
286 // This snippet has been automatically generated and should be regarded as a code template only.
287 // It will require modifications to work:
288 // - It may require correct/in-range values for request initialization.
289 // - It may require specifying regional endpoints when creating the service client as shown in:
290 // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
291 c, err := automl.NewClient(ctx)
292 if err != nil {
293 // TODO: Handle error.
294 }
295 defer c.Close()
296
297 req := &automlpb.GetAnnotationSpecRequest{
298 // TODO: Fill request struct fields.
299 // See https://pkg.go.dev/cloud.google.com/go/automl/apiv1beta1/automlpb#GetAnnotationSpecRequest.
300 }
301 resp, err := c.GetAnnotationSpec(ctx, req)
302 if err != nil {
303 // TODO: Handle error.
304 }
305 // TODO: Use resp.
306 _ = resp
307 }
308
309 func ExampleClient_GetColumnSpec() {
310 ctx := context.Background()
311 // This snippet has been automatically generated and should be regarded as a code template only.
312 // It will require modifications to work:
313 // - It may require correct/in-range values for request initialization.
314 // - It may require specifying regional endpoints when creating the service client as shown in:
315 // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
316 c, err := automl.NewClient(ctx)
317 if err != nil {
318 // TODO: Handle error.
319 }
320 defer c.Close()
321
322 req := &automlpb.GetColumnSpecRequest{
323 // TODO: Fill request struct fields.
324 // See https://pkg.go.dev/cloud.google.com/go/automl/apiv1beta1/automlpb#GetColumnSpecRequest.
325 }
326 resp, err := c.GetColumnSpec(ctx, req)
327 if err != nil {
328 // TODO: Handle error.
329 }
330 // TODO: Use resp.
331 _ = resp
332 }
333
334 func ExampleClient_GetDataset() {
335 ctx := context.Background()
336 // This snippet has been automatically generated and should be regarded as a code template only.
337 // It will require modifications to work:
338 // - It may require correct/in-range values for request initialization.
339 // - It may require specifying regional endpoints when creating the service client as shown in:
340 // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
341 c, err := automl.NewClient(ctx)
342 if err != nil {
343 // TODO: Handle error.
344 }
345 defer c.Close()
346
347 req := &automlpb.GetDatasetRequest{
348 // TODO: Fill request struct fields.
349 // See https://pkg.go.dev/cloud.google.com/go/automl/apiv1beta1/automlpb#GetDatasetRequest.
350 }
351 resp, err := c.GetDataset(ctx, req)
352 if err != nil {
353 // TODO: Handle error.
354 }
355 // TODO: Use resp.
356 _ = resp
357 }
358
359 func ExampleClient_GetModel() {
360 ctx := context.Background()
361 // This snippet has been automatically generated and should be regarded as a code template only.
362 // It will require modifications to work:
363 // - It may require correct/in-range values for request initialization.
364 // - It may require specifying regional endpoints when creating the service client as shown in:
365 // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
366 c, err := automl.NewClient(ctx)
367 if err != nil {
368 // TODO: Handle error.
369 }
370 defer c.Close()
371
372 req := &automlpb.GetModelRequest{
373 // TODO: Fill request struct fields.
374 // See https://pkg.go.dev/cloud.google.com/go/automl/apiv1beta1/automlpb#GetModelRequest.
375 }
376 resp, err := c.GetModel(ctx, req)
377 if err != nil {
378 // TODO: Handle error.
379 }
380 // TODO: Use resp.
381 _ = resp
382 }
383
384 func ExampleClient_GetModelEvaluation() {
385 ctx := context.Background()
386 // This snippet has been automatically generated and should be regarded as a code template only.
387 // It will require modifications to work:
388 // - It may require correct/in-range values for request initialization.
389 // - It may require specifying regional endpoints when creating the service client as shown in:
390 // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
391 c, err := automl.NewClient(ctx)
392 if err != nil {
393 // TODO: Handle error.
394 }
395 defer c.Close()
396
397 req := &automlpb.GetModelEvaluationRequest{
398 // TODO: Fill request struct fields.
399 // See https://pkg.go.dev/cloud.google.com/go/automl/apiv1beta1/automlpb#GetModelEvaluationRequest.
400 }
401 resp, err := c.GetModelEvaluation(ctx, req)
402 if err != nil {
403 // TODO: Handle error.
404 }
405 // TODO: Use resp.
406 _ = resp
407 }
408
409 func ExampleClient_GetTableSpec() {
410 ctx := context.Background()
411 // This snippet has been automatically generated and should be regarded as a code template only.
412 // It will require modifications to work:
413 // - It may require correct/in-range values for request initialization.
414 // - It may require specifying regional endpoints when creating the service client as shown in:
415 // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
416 c, err := automl.NewClient(ctx)
417 if err != nil {
418 // TODO: Handle error.
419 }
420 defer c.Close()
421
422 req := &automlpb.GetTableSpecRequest{
423 // TODO: Fill request struct fields.
424 // See https://pkg.go.dev/cloud.google.com/go/automl/apiv1beta1/automlpb#GetTableSpecRequest.
425 }
426 resp, err := c.GetTableSpec(ctx, req)
427 if err != nil {
428 // TODO: Handle error.
429 }
430 // TODO: Use resp.
431 _ = resp
432 }
433
434 func ExampleClient_ImportData() {
435 ctx := context.Background()
436 // This snippet has been automatically generated and should be regarded as a code template only.
437 // It will require modifications to work:
438 // - It may require correct/in-range values for request initialization.
439 // - It may require specifying regional endpoints when creating the service client as shown in:
440 // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
441 c, err := automl.NewClient(ctx)
442 if err != nil {
443 // TODO: Handle error.
444 }
445 defer c.Close()
446
447 req := &automlpb.ImportDataRequest{
448 // TODO: Fill request struct fields.
449 // See https://pkg.go.dev/cloud.google.com/go/automl/apiv1beta1/automlpb#ImportDataRequest.
450 }
451 op, err := c.ImportData(ctx, req)
452 if err != nil {
453 // TODO: Handle error.
454 }
455
456 err = op.Wait(ctx)
457 if err != nil {
458 // TODO: Handle error.
459 }
460 }
461
462 func ExampleClient_ListColumnSpecs() {
463 ctx := context.Background()
464 // This snippet has been automatically generated and should be regarded as a code template only.
465 // It will require modifications to work:
466 // - It may require correct/in-range values for request initialization.
467 // - It may require specifying regional endpoints when creating the service client as shown in:
468 // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
469 c, err := automl.NewClient(ctx)
470 if err != nil {
471 // TODO: Handle error.
472 }
473 defer c.Close()
474
475 req := &automlpb.ListColumnSpecsRequest{
476 // TODO: Fill request struct fields.
477 // See https://pkg.go.dev/cloud.google.com/go/automl/apiv1beta1/automlpb#ListColumnSpecsRequest.
478 }
479 it := c.ListColumnSpecs(ctx, req)
480 for {
481 resp, err := it.Next()
482 if err == iterator.Done {
483 break
484 }
485 if err != nil {
486 // TODO: Handle error.
487 }
488 // TODO: Use resp.
489 _ = resp
490
491 // If you need to access the underlying RPC response,
492 // you can do so by casting the `Response` as below.
493 // Otherwise, remove this line. Only populated after
494 // first call to Next(). Not safe for concurrent access.
495 _ = it.Response.(*automlpb.ListColumnSpecsResponse)
496 }
497 }
498
499 func ExampleClient_ListDatasets() {
500 ctx := context.Background()
501 // This snippet has been automatically generated and should be regarded as a code template only.
502 // It will require modifications to work:
503 // - It may require correct/in-range values for request initialization.
504 // - It may require specifying regional endpoints when creating the service client as shown in:
505 // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
506 c, err := automl.NewClient(ctx)
507 if err != nil {
508 // TODO: Handle error.
509 }
510 defer c.Close()
511
512 req := &automlpb.ListDatasetsRequest{
513 // TODO: Fill request struct fields.
514 // See https://pkg.go.dev/cloud.google.com/go/automl/apiv1beta1/automlpb#ListDatasetsRequest.
515 }
516 it := c.ListDatasets(ctx, req)
517 for {
518 resp, err := it.Next()
519 if err == iterator.Done {
520 break
521 }
522 if err != nil {
523 // TODO: Handle error.
524 }
525 // TODO: Use resp.
526 _ = resp
527
528 // If you need to access the underlying RPC response,
529 // you can do so by casting the `Response` as below.
530 // Otherwise, remove this line. Only populated after
531 // first call to Next(). Not safe for concurrent access.
532 _ = it.Response.(*automlpb.ListDatasetsResponse)
533 }
534 }
535
536 func ExampleClient_ListModelEvaluations() {
537 ctx := context.Background()
538 // This snippet has been automatically generated and should be regarded as a code template only.
539 // It will require modifications to work:
540 // - It may require correct/in-range values for request initialization.
541 // - It may require specifying regional endpoints when creating the service client as shown in:
542 // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
543 c, err := automl.NewClient(ctx)
544 if err != nil {
545 // TODO: Handle error.
546 }
547 defer c.Close()
548
549 req := &automlpb.ListModelEvaluationsRequest{
550 // TODO: Fill request struct fields.
551 // See https://pkg.go.dev/cloud.google.com/go/automl/apiv1beta1/automlpb#ListModelEvaluationsRequest.
552 }
553 it := c.ListModelEvaluations(ctx, req)
554 for {
555 resp, err := it.Next()
556 if err == iterator.Done {
557 break
558 }
559 if err != nil {
560 // TODO: Handle error.
561 }
562 // TODO: Use resp.
563 _ = resp
564
565 // If you need to access the underlying RPC response,
566 // you can do so by casting the `Response` as below.
567 // Otherwise, remove this line. Only populated after
568 // first call to Next(). Not safe for concurrent access.
569 _ = it.Response.(*automlpb.ListModelEvaluationsResponse)
570 }
571 }
572
573 func ExampleClient_ListModels() {
574 ctx := context.Background()
575 // This snippet has been automatically generated and should be regarded as a code template only.
576 // It will require modifications to work:
577 // - It may require correct/in-range values for request initialization.
578 // - It may require specifying regional endpoints when creating the service client as shown in:
579 // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
580 c, err := automl.NewClient(ctx)
581 if err != nil {
582 // TODO: Handle error.
583 }
584 defer c.Close()
585
586 req := &automlpb.ListModelsRequest{
587 // TODO: Fill request struct fields.
588 // See https://pkg.go.dev/cloud.google.com/go/automl/apiv1beta1/automlpb#ListModelsRequest.
589 }
590 it := c.ListModels(ctx, req)
591 for {
592 resp, err := it.Next()
593 if err == iterator.Done {
594 break
595 }
596 if err != nil {
597 // TODO: Handle error.
598 }
599 // TODO: Use resp.
600 _ = resp
601
602 // If you need to access the underlying RPC response,
603 // you can do so by casting the `Response` as below.
604 // Otherwise, remove this line. Only populated after
605 // first call to Next(). Not safe for concurrent access.
606 _ = it.Response.(*automlpb.ListModelsResponse)
607 }
608 }
609
610 func ExampleClient_ListTableSpecs() {
611 ctx := context.Background()
612 // This snippet has been automatically generated and should be regarded as a code template only.
613 // It will require modifications to work:
614 // - It may require correct/in-range values for request initialization.
615 // - It may require specifying regional endpoints when creating the service client as shown in:
616 // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
617 c, err := automl.NewClient(ctx)
618 if err != nil {
619 // TODO: Handle error.
620 }
621 defer c.Close()
622
623 req := &automlpb.ListTableSpecsRequest{
624 // TODO: Fill request struct fields.
625 // See https://pkg.go.dev/cloud.google.com/go/automl/apiv1beta1/automlpb#ListTableSpecsRequest.
626 }
627 it := c.ListTableSpecs(ctx, req)
628 for {
629 resp, err := it.Next()
630 if err == iterator.Done {
631 break
632 }
633 if err != nil {
634 // TODO: Handle error.
635 }
636 // TODO: Use resp.
637 _ = resp
638
639 // If you need to access the underlying RPC response,
640 // you can do so by casting the `Response` as below.
641 // Otherwise, remove this line. Only populated after
642 // first call to Next(). Not safe for concurrent access.
643 _ = it.Response.(*automlpb.ListTableSpecsResponse)
644 }
645 }
646
647 func ExampleClient_UndeployModel() {
648 ctx := context.Background()
649 // This snippet has been automatically generated and should be regarded as a code template only.
650 // It will require modifications to work:
651 // - It may require correct/in-range values for request initialization.
652 // - It may require specifying regional endpoints when creating the service client as shown in:
653 // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
654 c, err := automl.NewClient(ctx)
655 if err != nil {
656 // TODO: Handle error.
657 }
658 defer c.Close()
659
660 req := &automlpb.UndeployModelRequest{
661 // TODO: Fill request struct fields.
662 // See https://pkg.go.dev/cloud.google.com/go/automl/apiv1beta1/automlpb#UndeployModelRequest.
663 }
664 op, err := c.UndeployModel(ctx, req)
665 if err != nil {
666 // TODO: Handle error.
667 }
668
669 err = op.Wait(ctx)
670 if err != nil {
671 // TODO: Handle error.
672 }
673 }
674
675 func ExampleClient_UpdateColumnSpec() {
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 := automl.NewClient(ctx)
683 if err != nil {
684 // TODO: Handle error.
685 }
686 defer c.Close()
687
688 req := &automlpb.UpdateColumnSpecRequest{
689 // TODO: Fill request struct fields.
690 // See https://pkg.go.dev/cloud.google.com/go/automl/apiv1beta1/automlpb#UpdateColumnSpecRequest.
691 }
692 resp, err := c.UpdateColumnSpec(ctx, req)
693 if err != nil {
694 // TODO: Handle error.
695 }
696 // TODO: Use resp.
697 _ = resp
698 }
699
700 func ExampleClient_UpdateDataset() {
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 := automl.NewClient(ctx)
708 if err != nil {
709 // TODO: Handle error.
710 }
711 defer c.Close()
712
713 req := &automlpb.UpdateDatasetRequest{
714 // TODO: Fill request struct fields.
715 // See https://pkg.go.dev/cloud.google.com/go/automl/apiv1beta1/automlpb#UpdateDatasetRequest.
716 }
717 resp, err := c.UpdateDataset(ctx, req)
718 if err != nil {
719 // TODO: Handle error.
720 }
721 // TODO: Use resp.
722 _ = resp
723 }
724
725 func ExampleClient_UpdateTableSpec() {
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 := automl.NewClient(ctx)
733 if err != nil {
734 // TODO: Handle error.
735 }
736 defer c.Close()
737
738 req := &automlpb.UpdateTableSpecRequest{
739 // TODO: Fill request struct fields.
740 // See https://pkg.go.dev/cloud.google.com/go/automl/apiv1beta1/automlpb#UpdateTableSpecRequest.
741 }
742 resp, err := c.UpdateTableSpec(ctx, req)
743 if err != nil {
744 // TODO: Handle error.
745 }
746 // TODO: Use resp.
747 _ = resp
748 }