Debian Codegraph @

financialservices/apiv1/aml_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 financialservices_test
18
19 import (
20 "context"
21
22 financialservices "cloud.google.com/go/financialservices/apiv1"
23 financialservicespb "cloud.google.com/go/financialservices/apiv1/financialservicespb"
24 longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
25 "google.golang.org/api/iterator"
26 locationpb "google.golang.org/genproto/googleapis/cloud/location"
27 )
28
29 func ExampleNewAMLClient() {
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 := financialservices.NewAMLClient(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 ExampleNewAMLRESTClient() {
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 := financialservices.NewAMLRESTClient(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 ExampleAMLClient_CreateBacktestResult() {
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 := financialservices.NewAMLClient(ctx)
71 if err != nil {
72 // TODO: Handle error.
73 }
74 defer c.Close()
75
76 req := &financialservicespb.CreateBacktestResultRequest{
77 // TODO: Fill request struct fields.
78 // See https://pkg.go.dev/cloud.google.com/go/financialservices/apiv1/financialservicespb#CreateBacktestResultRequest.
79 }
80 op, err := c.CreateBacktestResult(ctx, req)
81 if err != nil {
82 // TODO: Handle error.
83 }
84
85 resp, err := op.Wait(ctx)
86 if err != nil {
87 // TODO: Handle error.
88 }
89 // TODO: Use resp.
90 _ = resp
91 }
92
93 func ExampleAMLClient_CreateDataset() {
94 ctx := context.Background()
95 // This snippet has been automatically generated and should be regarded as a code template only.
96 // It will require modifications to work:
97 // - It may require correct/in-range values for request initialization.
98 // - It may require specifying regional endpoints when creating the service client as shown in:
99 // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
100 c, err := financialservices.NewAMLClient(ctx)
101 if err != nil {
102 // TODO: Handle error.
103 }
104 defer c.Close()
105
106 req := &financialservicespb.CreateDatasetRequest{
107 // TODO: Fill request struct fields.
108 // See https://pkg.go.dev/cloud.google.com/go/financialservices/apiv1/financialservicespb#CreateDatasetRequest.
109 }
110 op, err := c.CreateDataset(ctx, req)
111 if err != nil {
112 // TODO: Handle error.
113 }
114
115 resp, err := op.Wait(ctx)
116 if err != nil {
117 // TODO: Handle error.
118 }
119 // TODO: Use resp.
120 _ = resp
121 }
122
123 func ExampleAMLClient_CreateEngineConfig() {
124 ctx := context.Background()
125 // This snippet has been automatically generated and should be regarded as a code template only.
126 // It will require modifications to work:
127 // - It may require correct/in-range values for request initialization.
128 // - It may require specifying regional endpoints when creating the service client as shown in:
129 // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
130 c, err := financialservices.NewAMLClient(ctx)
131 if err != nil {
132 // TODO: Handle error.
133 }
134 defer c.Close()
135
136 req := &financialservicespb.CreateEngineConfigRequest{
137 // TODO: Fill request struct fields.
138 // See https://pkg.go.dev/cloud.google.com/go/financialservices/apiv1/financialservicespb#CreateEngineConfigRequest.
139 }
140 op, err := c.CreateEngineConfig(ctx, req)
141 if err != nil {
142 // TODO: Handle error.
143 }
144
145 resp, err := op.Wait(ctx)
146 if err != nil {
147 // TODO: Handle error.
148 }
149 // TODO: Use resp.
150 _ = resp
151 }
152
153 func ExampleAMLClient_CreateInstance() {
154 ctx := context.Background()
155 // This snippet has been automatically generated and should be regarded as a code template only.
156 // It will require modifications to work:
157 // - It may require correct/in-range values for request initialization.
158 // - It may require specifying regional endpoints when creating the service client as shown in:
159 // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
160 c, err := financialservices.NewAMLClient(ctx)
161 if err != nil {
162 // TODO: Handle error.
163 }
164 defer c.Close()
165
166 req := &financialservicespb.CreateInstanceRequest{
167 // TODO: Fill request struct fields.
168 // See https://pkg.go.dev/cloud.google.com/go/financialservices/apiv1/financialservicespb#CreateInstanceRequest.
169 }
170 op, err := c.CreateInstance(ctx, req)
171 if err != nil {
172 // TODO: Handle error.
173 }
174
175 resp, err := op.Wait(ctx)
176 if err != nil {
177 // TODO: Handle error.
178 }
179 // TODO: Use resp.
180 _ = resp
181 }
182
183 func ExampleAMLClient_CreateModel() {
184 ctx := context.Background()
185 // This snippet has been automatically generated and should be regarded as a code template only.
186 // It will require modifications to work:
187 // - It may require correct/in-range values for request initialization.
188 // - It may require specifying regional endpoints when creating the service client as shown in:
189 // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
190 c, err := financialservices.NewAMLClient(ctx)
191 if err != nil {
192 // TODO: Handle error.
193 }
194 defer c.Close()
195
196 req := &financialservicespb.CreateModelRequest{
197 // TODO: Fill request struct fields.
198 // See https://pkg.go.dev/cloud.google.com/go/financialservices/apiv1/financialservicespb#CreateModelRequest.
199 }
200 op, err := c.CreateModel(ctx, req)
201 if err != nil {
202 // TODO: Handle error.
203 }
204
205 resp, err := op.Wait(ctx)
206 if err != nil {
207 // TODO: Handle error.
208 }
209 // TODO: Use resp.
210 _ = resp
211 }
212
213 func ExampleAMLClient_CreatePredictionResult() {
214 ctx := context.Background()
215 // This snippet has been automatically generated and should be regarded as a code template only.
216 // It will require modifications to work:
217 // - It may require correct/in-range values for request initialization.
218 // - It may require specifying regional endpoints when creating the service client as shown in:
219 // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
220 c, err := financialservices.NewAMLClient(ctx)
221 if err != nil {
222 // TODO: Handle error.
223 }
224 defer c.Close()
225
226 req := &financialservicespb.CreatePredictionResultRequest{
227 // TODO: Fill request struct fields.
228 // See https://pkg.go.dev/cloud.google.com/go/financialservices/apiv1/financialservicespb#CreatePredictionResultRequest.
229 }
230 op, err := c.CreatePredictionResult(ctx, req)
231 if err != nil {
232 // TODO: Handle error.
233 }
234
235 resp, err := op.Wait(ctx)
236 if err != nil {
237 // TODO: Handle error.
238 }
239 // TODO: Use resp.
240 _ = resp
241 }
242
243 func ExampleAMLClient_DeleteBacktestResult() {
244 ctx := context.Background()
245 // This snippet has been automatically generated and should be regarded as a code template only.
246 // It will require modifications to work:
247 // - It may require correct/in-range values for request initialization.
248 // - It may require specifying regional endpoints when creating the service client as shown in:
249 // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
250 c, err := financialservices.NewAMLClient(ctx)
251 if err != nil {
252 // TODO: Handle error.
253 }
254 defer c.Close()
255
256 req := &financialservicespb.DeleteBacktestResultRequest{
257 // TODO: Fill request struct fields.
258 // See https://pkg.go.dev/cloud.google.com/go/financialservices/apiv1/financialservicespb#DeleteBacktestResultRequest.
259 }
260 op, err := c.DeleteBacktestResult(ctx, req)
261 if err != nil {
262 // TODO: Handle error.
263 }
264
265 err = op.Wait(ctx)
266 if err != nil {
267 // TODO: Handle error.
268 }
269 }
270
271 func ExampleAMLClient_DeleteDataset() {
272 ctx := context.Background()
273 // This snippet has been automatically generated and should be regarded as a code template only.
274 // It will require modifications to work:
275 // - It may require correct/in-range values for request initialization.
276 // - It may require specifying regional endpoints when creating the service client as shown in:
277 // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
278 c, err := financialservices.NewAMLClient(ctx)
279 if err != nil {
280 // TODO: Handle error.
281 }
282 defer c.Close()
283
284 req := &financialservicespb.DeleteDatasetRequest{
285 // TODO: Fill request struct fields.
286 // See https://pkg.go.dev/cloud.google.com/go/financialservices/apiv1/financialservicespb#DeleteDatasetRequest.
287 }
288 op, err := c.DeleteDataset(ctx, req)
289 if err != nil {
290 // TODO: Handle error.
291 }
292
293 err = op.Wait(ctx)
294 if err != nil {
295 // TODO: Handle error.
296 }
297 }
298
299 func ExampleAMLClient_DeleteEngineConfig() {
300 ctx := context.Background()
301 // This snippet has been automatically generated and should be regarded as a code template only.
302 // It will require modifications to work:
303 // - It may require correct/in-range values for request initialization.
304 // - It may require specifying regional endpoints when creating the service client as shown in:
305 // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
306 c, err := financialservices.NewAMLClient(ctx)
307 if err != nil {
308 // TODO: Handle error.
309 }
310 defer c.Close()
311
312 req := &financialservicespb.DeleteEngineConfigRequest{
313 // TODO: Fill request struct fields.
314 // See https://pkg.go.dev/cloud.google.com/go/financialservices/apiv1/financialservicespb#DeleteEngineConfigRequest.
315 }
316 op, err := c.DeleteEngineConfig(ctx, req)
317 if err != nil {
318 // TODO: Handle error.
319 }
320
321 err = op.Wait(ctx)
322 if err != nil {
323 // TODO: Handle error.
324 }
325 }
326
327 func ExampleAMLClient_DeleteInstance() {
328 ctx := context.Background()
329 // This snippet has been automatically generated and should be regarded as a code template only.
330 // It will require modifications to work:
331 // - It may require correct/in-range values for request initialization.
332 // - It may require specifying regional endpoints when creating the service client as shown in:
333 // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
334 c, err := financialservices.NewAMLClient(ctx)
335 if err != nil {
336 // TODO: Handle error.
337 }
338 defer c.Close()
339
340 req := &financialservicespb.DeleteInstanceRequest{
341 // TODO: Fill request struct fields.
342 // See https://pkg.go.dev/cloud.google.com/go/financialservices/apiv1/financialservicespb#DeleteInstanceRequest.
343 }
344 op, err := c.DeleteInstance(ctx, req)
345 if err != nil {
346 // TODO: Handle error.
347 }
348
349 err = op.Wait(ctx)
350 if err != nil {
351 // TODO: Handle error.
352 }
353 }
354
355 func ExampleAMLClient_DeleteModel() {
356 ctx := context.Background()
357 // This snippet has been automatically generated and should be regarded as a code template only.
358 // It will require modifications to work:
359 // - It may require correct/in-range values for request initialization.
360 // - It may require specifying regional endpoints when creating the service client as shown in:
361 // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
362 c, err := financialservices.NewAMLClient(ctx)
363 if err != nil {
364 // TODO: Handle error.
365 }
366 defer c.Close()
367
368 req := &financialservicespb.DeleteModelRequest{
369 // TODO: Fill request struct fields.
370 // See https://pkg.go.dev/cloud.google.com/go/financialservices/apiv1/financialservicespb#DeleteModelRequest.
371 }
372 op, err := c.DeleteModel(ctx, req)
373 if err != nil {
374 // TODO: Handle error.
375 }
376
377 err = op.Wait(ctx)
378 if err != nil {
379 // TODO: Handle error.
380 }
381 }
382
383 func ExampleAMLClient_DeletePredictionResult() {
384 ctx := context.Background()
385 // This snippet has been automatically generated and should be regarded as a code template only.
386 // It will require modifications to work:
387 // - It may require correct/in-range values for request initialization.
388 // - It may require specifying regional endpoints when creating the service client as shown in:
389 // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
390 c, err := financialservices.NewAMLClient(ctx)
391 if err != nil {
392 // TODO: Handle error.
393 }
394 defer c.Close()
395
396 req := &financialservicespb.DeletePredictionResultRequest{
397 // TODO: Fill request struct fields.
398 // See https://pkg.go.dev/cloud.google.com/go/financialservices/apiv1/financialservicespb#DeletePredictionResultRequest.
399 }
400 op, err := c.DeletePredictionResult(ctx, req)
401 if err != nil {
402 // TODO: Handle error.
403 }
404
405 err = op.Wait(ctx)
406 if err != nil {
407 // TODO: Handle error.
408 }
409 }
410
411 func ExampleAMLClient_ExportBacktestResultMetadata() {
412 ctx := context.Background()
413 // This snippet has been automatically generated and should be regarded as a code template only.
414 // It will require modifications to work:
415 // - It may require correct/in-range values for request initialization.
416 // - It may require specifying regional endpoints when creating the service client as shown in:
417 // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
418 c, err := financialservices.NewAMLClient(ctx)
419 if err != nil {
420 // TODO: Handle error.
421 }
422 defer c.Close()
423
424 req := &financialservicespb.ExportBacktestResultMetadataRequest{
425 // TODO: Fill request struct fields.
426 // See https://pkg.go.dev/cloud.google.com/go/financialservices/apiv1/financialservicespb#ExportBacktestResultMetadataRequest.
427 }
428 op, err := c.ExportBacktestResultMetadata(ctx, req)
429 if err != nil {
430 // TODO: Handle error.
431 }
432
433 resp, err := op.Wait(ctx)
434 if err != nil {
435 // TODO: Handle error.
436 }
437 // TODO: Use resp.
438 _ = resp
439 }
440
441 func ExampleAMLClient_ExportEngineConfigMetadata() {
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 := financialservices.NewAMLClient(ctx)
449 if err != nil {
450 // TODO: Handle error.
451 }
452 defer c.Close()
453
454 req := &financialservicespb.ExportEngineConfigMetadataRequest{
455 // TODO: Fill request struct fields.
456 // See https://pkg.go.dev/cloud.google.com/go/financialservices/apiv1/financialservicespb#ExportEngineConfigMetadataRequest.
457 }
458 op, err := c.ExportEngineConfigMetadata(ctx, req)
459 if err != nil {
460 // TODO: Handle error.
461 }
462
463 resp, err := op.Wait(ctx)
464 if err != nil {
465 // TODO: Handle error.
466 }
467 // TODO: Use resp.
468 _ = resp
469 }
470
471 func ExampleAMLClient_ExportModelMetadata() {
472 ctx := context.Background()
473 // This snippet has been automatically generated and should be regarded as a code template only.
474 // It will require modifications to work:
475 // - It may require correct/in-range values for request initialization.
476 // - It may require specifying regional endpoints when creating the service client as shown in:
477 // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
478 c, err := financialservices.NewAMLClient(ctx)
479 if err != nil {
480 // TODO: Handle error.
481 }
482 defer c.Close()
483
484 req := &financialservicespb.ExportModelMetadataRequest{
485 // TODO: Fill request struct fields.
486 // See https://pkg.go.dev/cloud.google.com/go/financialservices/apiv1/financialservicespb#ExportModelMetadataRequest.
487 }
488 op, err := c.ExportModelMetadata(ctx, req)
489 if err != nil {
490 // TODO: Handle error.
491 }
492
493 resp, err := op.Wait(ctx)
494 if err != nil {
495 // TODO: Handle error.
496 }
497 // TODO: Use resp.
498 _ = resp
499 }
500
501 func ExampleAMLClient_ExportPredictionResultMetadata() {
502 ctx := context.Background()
503 // This snippet has been automatically generated and should be regarded as a code template only.
504 // It will require modifications to work:
505 // - It may require correct/in-range values for request initialization.
506 // - It may require specifying regional endpoints when creating the service client as shown in:
507 // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
508 c, err := financialservices.NewAMLClient(ctx)
509 if err != nil {
510 // TODO: Handle error.
511 }
512 defer c.Close()
513
514 req := &financialservicespb.ExportPredictionResultMetadataRequest{
515 // TODO: Fill request struct fields.
516 // See https://pkg.go.dev/cloud.google.com/go/financialservices/apiv1/financialservicespb#ExportPredictionResultMetadataRequest.
517 }
518 op, err := c.ExportPredictionResultMetadata(ctx, req)
519 if err != nil {
520 // TODO: Handle error.
521 }
522
523 resp, err := op.Wait(ctx)
524 if err != nil {
525 // TODO: Handle error.
526 }
527 // TODO: Use resp.
528 _ = resp
529 }
530
531 func ExampleAMLClient_ExportRegisteredParties() {
532 ctx := context.Background()
533 // This snippet has been automatically generated and should be regarded as a code template only.
534 // It will require modifications to work:
535 // - It may require correct/in-range values for request initialization.
536 // - It may require specifying regional endpoints when creating the service client as shown in:
537 // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
538 c, err := financialservices.NewAMLClient(ctx)
539 if err != nil {
540 // TODO: Handle error.
541 }
542 defer c.Close()
543
544 req := &financialservicespb.ExportRegisteredPartiesRequest{
545 // TODO: Fill request struct fields.
546 // See https://pkg.go.dev/cloud.google.com/go/financialservices/apiv1/financialservicespb#ExportRegisteredPartiesRequest.
547 }
548 op, err := c.ExportRegisteredParties(ctx, req)
549 if err != nil {
550 // TODO: Handle error.
551 }
552
553 resp, err := op.Wait(ctx)
554 if err != nil {
555 // TODO: Handle error.
556 }
557 // TODO: Use resp.
558 _ = resp
559 }
560
561 func ExampleAMLClient_GetBacktestResult() {
562 ctx := context.Background()
563 // This snippet has been automatically generated and should be regarded as a code template only.
564 // It will require modifications to work:
565 // - It may require correct/in-range values for request initialization.
566 // - It may require specifying regional endpoints when creating the service client as shown in:
567 // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
568 c, err := financialservices.NewAMLClient(ctx)
569 if err != nil {
570 // TODO: Handle error.
571 }
572 defer c.Close()
573
574 req := &financialservicespb.GetBacktestResultRequest{
575 // TODO: Fill request struct fields.
576 // See https://pkg.go.dev/cloud.google.com/go/financialservices/apiv1/financialservicespb#GetBacktestResultRequest.
577 }
578 resp, err := c.GetBacktestResult(ctx, req)
579 if err != nil {
580 // TODO: Handle error.
581 }
582 // TODO: Use resp.
583 _ = resp
584 }
585
586 func ExampleAMLClient_GetDataset() {
587 ctx := context.Background()
588 // This snippet has been automatically generated and should be regarded as a code template only.
589 // It will require modifications to work:
590 // - It may require correct/in-range values for request initialization.
591 // - It may require specifying regional endpoints when creating the service client as shown in:
592 // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
593 c, err := financialservices.NewAMLClient(ctx)
594 if err != nil {
595 // TODO: Handle error.
596 }
597 defer c.Close()
598
599 req := &financialservicespb.GetDatasetRequest{
600 // TODO: Fill request struct fields.
601 // See https://pkg.go.dev/cloud.google.com/go/financialservices/apiv1/financialservicespb#GetDatasetRequest.
602 }
603 resp, err := c.GetDataset(ctx, req)
604 if err != nil {
605 // TODO: Handle error.
606 }
607 // TODO: Use resp.
608 _ = resp
609 }
610
611 func ExampleAMLClient_GetEngineConfig() {
612 ctx := context.Background()
613 // This snippet has been automatically generated and should be regarded as a code template only.
614 // It will require modifications to work:
615 // - It may require correct/in-range values for request initialization.
616 // - It may require specifying regional endpoints when creating the service client as shown in:
617 // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
618 c, err := financialservices.NewAMLClient(ctx)
619 if err != nil {
620 // TODO: Handle error.
621 }
622 defer c.Close()
623
624 req := &financialservicespb.GetEngineConfigRequest{
625 // TODO: Fill request struct fields.
626 // See https://pkg.go.dev/cloud.google.com/go/financialservices/apiv1/financialservicespb#GetEngineConfigRequest.
627 }
628 resp, err := c.GetEngineConfig(ctx, req)
629 if err != nil {
630 // TODO: Handle error.
631 }
632 // TODO: Use resp.
633 _ = resp
634 }
635
636 func ExampleAMLClient_GetEngineVersion() {
637 ctx := context.Background()
638 // This snippet has been automatically generated and should be regarded as a code template only.
639 // It will require modifications to work:
640 // - It may require correct/in-range values for request initialization.
641 // - It may require specifying regional endpoints when creating the service client as shown in:
642 // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
643 c, err := financialservices.NewAMLClient(ctx)
644 if err != nil {
645 // TODO: Handle error.
646 }
647 defer c.Close()
648
649 req := &financialservicespb.GetEngineVersionRequest{
650 // TODO: Fill request struct fields.
651 // See https://pkg.go.dev/cloud.google.com/go/financialservices/apiv1/financialservicespb#GetEngineVersionRequest.
652 }
653 resp, err := c.GetEngineVersion(ctx, req)
654 if err != nil {
655 // TODO: Handle error.
656 }
657 // TODO: Use resp.
658 _ = resp
659 }
660
661 func ExampleAMLClient_GetInstance() {
662 ctx := context.Background()
663 // This snippet has been automatically generated and should be regarded as a code template only.
664 // It will require modifications to work:
665 // - It may require correct/in-range values for request initialization.
666 // - It may require specifying regional endpoints when creating the service client as shown in:
667 // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
668 c, err := financialservices.NewAMLClient(ctx)
669 if err != nil {
670 // TODO: Handle error.
671 }
672 defer c.Close()
673
674 req := &financialservicespb.GetInstanceRequest{
675 // TODO: Fill request struct fields.
676 // See https://pkg.go.dev/cloud.google.com/go/financialservices/apiv1/financialservicespb#GetInstanceRequest.
677 }
678 resp, err := c.GetInstance(ctx, req)
679 if err != nil {
680 // TODO: Handle error.
681 }
682 // TODO: Use resp.
683 _ = resp
684 }
685
686 func ExampleAMLClient_GetModel() {
687 ctx := context.Background()
688 // This snippet has been automatically generated and should be regarded as a code template only.
689 // It will require modifications to work:
690 // - It may require correct/in-range values for request initialization.
691 // - It may require specifying regional endpoints when creating the service client as shown in:
692 // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
693 c, err := financialservices.NewAMLClient(ctx)
694 if err != nil {
695 // TODO: Handle error.
696 }
697 defer c.Close()
698
699 req := &financialservicespb.GetModelRequest{
700 // TODO: Fill request struct fields.
701 // See https://pkg.go.dev/cloud.google.com/go/financialservices/apiv1/financialservicespb#GetModelRequest.
702 }
703 resp, err := c.GetModel(ctx, req)
704 if err != nil {
705 // TODO: Handle error.
706 }
707 // TODO: Use resp.
708 _ = resp
709 }
710
711 func ExampleAMLClient_GetPredictionResult() {
712 ctx := context.Background()
713 // This snippet has been automatically generated and should be regarded as a code template only.
714 // It will require modifications to work:
715 // - It may require correct/in-range values for request initialization.
716 // - It may require specifying regional endpoints when creating the service client as shown in:
717 // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
718 c, err := financialservices.NewAMLClient(ctx)
719 if err != nil {
720 // TODO: Handle error.
721 }
722 defer c.Close()
723
724 req := &financialservicespb.GetPredictionResultRequest{
725 // TODO: Fill request struct fields.
726 // See https://pkg.go.dev/cloud.google.com/go/financialservices/apiv1/financialservicespb#GetPredictionResultRequest.
727 }
728 resp, err := c.GetPredictionResult(ctx, req)
729 if err != nil {
730 // TODO: Handle error.
731 }
732 // TODO: Use resp.
733 _ = resp
734 }
735
736 func ExampleAMLClient_ImportRegisteredParties() {
737 ctx := context.Background()
738 // This snippet has been automatically generated and should be regarded as a code template only.
739 // It will require modifications to work:
740 // - It may require correct/in-range values for request initialization.
741 // - It may require specifying regional endpoints when creating the service client as shown in:
742 // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
743 c, err := financialservices.NewAMLClient(ctx)
744 if err != nil {
745 // TODO: Handle error.
746 }
747 defer c.Close()
748
749 req := &financialservicespb.ImportRegisteredPartiesRequest{
750 // TODO: Fill request struct fields.
751 // See https://pkg.go.dev/cloud.google.com/go/financialservices/apiv1/financialservicespb#ImportRegisteredPartiesRequest.
752 }
753 op, err := c.ImportRegisteredParties(ctx, req)
754 if err != nil {
755 // TODO: Handle error.
756 }
757
758 resp, err := op.Wait(ctx)
759 if err != nil {
760 // TODO: Handle error.
761 }
762 // TODO: Use resp.
763 _ = resp
764 }
765
766 func ExampleAMLClient_ListBacktestResults() {
767 ctx := context.Background()
768 // This snippet has been automatically generated and should be regarded as a code template only.
769 // It will require modifications to work:
770 // - It may require correct/in-range values for request initialization.
771 // - It may require specifying regional endpoints when creating the service client as shown in:
772 // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
773 c, err := financialservices.NewAMLClient(ctx)
774 if err != nil {
775 // TODO: Handle error.
776 }
777 defer c.Close()
778
779 req := &financialservicespb.ListBacktestResultsRequest{
780 // TODO: Fill request struct fields.
781 // See https://pkg.go.dev/cloud.google.com/go/financialservices/apiv1/financialservicespb#ListBacktestResultsRequest.
782 }
783 it := c.ListBacktestResults(ctx, req)
784 for {
785 resp, err := it.Next()
786 if err == iterator.Done {
787 break
788 }
789 if err != nil {
790 // TODO: Handle error.
791 }
792 // TODO: Use resp.
793 _ = resp
794
795 // If you need to access the underlying RPC response,
796 // you can do so by casting the `Response` as below.
797 // Otherwise, remove this line. Only populated after
798 // first call to Next(). Not safe for concurrent access.
799 _ = it.Response.(*financialservicespb.ListBacktestResultsResponse)
800 }
801 }
802
803 func ExampleAMLClient_ListDatasets() {
804 ctx := context.Background()
805 // This snippet has been automatically generated and should be regarded as a code template only.
806 // It will require modifications to work:
807 // - It may require correct/in-range values for request initialization.
808 // - It may require specifying regional endpoints when creating the service client as shown in:
809 // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
810 c, err := financialservices.NewAMLClient(ctx)
811 if err != nil {
812 // TODO: Handle error.
813 }
814 defer c.Close()
815
816 req := &financialservicespb.ListDatasetsRequest{
817 // TODO: Fill request struct fields.
818 // See https://pkg.go.dev/cloud.google.com/go/financialservices/apiv1/financialservicespb#ListDatasetsRequest.
819 }
820 it := c.ListDatasets(ctx, req)
821 for {
822 resp, err := it.Next()
823 if err == iterator.Done {
824 break
825 }
826 if err != nil {
827 // TODO: Handle error.
828 }
829 // TODO: Use resp.
830 _ = resp
831
832 // If you need to access the underlying RPC response,
833 // you can do so by casting the `Response` as below.
834 // Otherwise, remove this line. Only populated after
835 // first call to Next(). Not safe for concurrent access.
836 _ = it.Response.(*financialservicespb.ListDatasetsResponse)
837 }
838 }
839
840 func ExampleAMLClient_ListEngineConfigs() {
841 ctx := context.Background()
842 // This snippet has been automatically generated and should be regarded as a code template only.
843 // It will require modifications to work:
844 // - It may require correct/in-range values for request initialization.
845 // - It may require specifying regional endpoints when creating the service client as shown in:
846 // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
847 c, err := financialservices.NewAMLClient(ctx)
848 if err != nil {
849 // TODO: Handle error.
850 }
851 defer c.Close()
852
853 req := &financialservicespb.ListEngineConfigsRequest{
854 // TODO: Fill request struct fields.
855 // See https://pkg.go.dev/cloud.google.com/go/financialservices/apiv1/financialservicespb#ListEngineConfigsRequest.
856 }
857 it := c.ListEngineConfigs(ctx, req)
858 for {
859 resp, err := it.Next()
860 if err == iterator.Done {
861 break
862 }
863 if err != nil {
864 // TODO: Handle error.
865 }
866 // TODO: Use resp.
867 _ = resp
868
869 // If you need to access the underlying RPC response,
870 // you can do so by casting the `Response` as below.
871 // Otherwise, remove this line. Only populated after
872 // first call to Next(). Not safe for concurrent access.
873 _ = it.Response.(*financialservicespb.ListEngineConfigsResponse)
874 }
875 }
876
877 func ExampleAMLClient_ListEngineVersions() {
878 ctx := context.Background()
879 // This snippet has been automatically generated and should be regarded as a code template only.
880 // It will require modifications to work:
881 // - It may require correct/in-range values for request initialization.
882 // - It may require specifying regional endpoints when creating the service client as shown in:
883 // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
884 c, err := financialservices.NewAMLClient(ctx)
885 if err != nil {
886 // TODO: Handle error.
887 }
888 defer c.Close()
889
890 req := &financialservicespb.ListEngineVersionsRequest{
891 // TODO: Fill request struct fields.
892 // See https://pkg.go.dev/cloud.google.com/go/financialservices/apiv1/financialservicespb#ListEngineVersionsRequest.
893 }
894 it := c.ListEngineVersions(ctx, req)
895 for {
896 resp, err := it.Next()
897 if err == iterator.Done {
898 break
899 }
900 if err != nil {
901 // TODO: Handle error.
902 }
903 // TODO: Use resp.
904 _ = resp
905
906 // If you need to access the underlying RPC response,
907 // you can do so by casting the `Response` as below.
908 // Otherwise, remove this line. Only populated after
909 // first call to Next(). Not safe for concurrent access.
910 _ = it.Response.(*financialservicespb.ListEngineVersionsResponse)
911 }
912 }
913
914 func ExampleAMLClient_ListInstances() {
915 ctx := context.Background()
916 // This snippet has been automatically generated and should be regarded as a code template only.
917 // It will require modifications to work:
918 // - It may require correct/in-range values for request initialization.
919 // - It may require specifying regional endpoints when creating the service client as shown in:
920 // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
921 c, err := financialservices.NewAMLClient(ctx)
922 if err != nil {
923 // TODO: Handle error.
924 }
925 defer c.Close()
926
927 req := &financialservicespb.ListInstancesRequest{
928 // TODO: Fill request struct fields.
929 // See https://pkg.go.dev/cloud.google.com/go/financialservices/apiv1/financialservicespb#ListInstancesRequest.
930 }
931 it := c.ListInstances(ctx, req)
932 for {
933 resp, err := it.Next()
934 if err == iterator.Done {
935 break
936 }
937 if err != nil {
938 // TODO: Handle error.
939 }
940 // TODO: Use resp.
941 _ = resp
942
943 // If you need to access the underlying RPC response,
944 // you can do so by casting the `Response` as below.
945 // Otherwise, remove this line. Only populated after
946 // first call to Next(). Not safe for concurrent access.
947 _ = it.Response.(*financialservicespb.ListInstancesResponse)
948 }
949 }
950
951 func ExampleAMLClient_ListModels() {
952 ctx := context.Background()
953 // This snippet has been automatically generated and should be regarded as a code template only.
954 // It will require modifications to work:
955 // - It may require correct/in-range values for request initialization.
956 // - It may require specifying regional endpoints when creating the service client as shown in:
957 // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
958 c, err := financialservices.NewAMLClient(ctx)
959 if err != nil {
960 // TODO: Handle error.
961 }
962 defer c.Close()
963
964 req := &financialservicespb.ListModelsRequest{
965 // TODO: Fill request struct fields.
966 // See https://pkg.go.dev/cloud.google.com/go/financialservices/apiv1/financialservicespb#ListModelsRequest.
967 }
968 it := c.ListModels(ctx, req)
969 for {
970 resp, err := it.Next()
971 if err == iterator.Done {
972 break
973 }
974 if err != nil {
975 // TODO: Handle error.
976 }
977 // TODO: Use resp.
978 _ = resp
979
980 // If you need to access the underlying RPC response,
981 // you can do so by casting the `Response` as below.
982 // Otherwise, remove this line. Only populated after
983 // first call to Next(). Not safe for concurrent access.
984 _ = it.Response.(*financialservicespb.ListModelsResponse)
985 }
986 }
987
988 func ExampleAMLClient_ListPredictionResults() {
989 ctx := context.Background()
990 // This snippet has been automatically generated and should be regarded as a code template only.
991 // It will require modifications to work:
992 // - It may require correct/in-range values for request initialization.
993 // - It may require specifying regional endpoints when creating the service client as shown in:
994 // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
995 c, err := financialservices.NewAMLClient(ctx)
996 if err != nil {
997 // TODO: Handle error.
998 }
999 defer c.Close()
1000
1001 req := &financialservicespb.ListPredictionResultsRequest{
1002 // TODO: Fill request struct fields.
1003 // See https://pkg.go.dev/cloud.google.com/go/financialservices/apiv1/financialservicespb#ListPredictionResultsRequest.
1004 }
1005 it := c.ListPredictionResults(ctx, req)
1006 for {
1007 resp, err := it.Next()
1008 if err == iterator.Done {
1009 break
1010 }
1011 if err != nil {
1012 // TODO: Handle error.
1013 }
1014 // TODO: Use resp.
1015 _ = resp
1016
1017 // If you need to access the underlying RPC response,
1018 // you can do so by casting the `Response` as below.
1019 // Otherwise, remove this line. Only populated after
1020 // first call to Next(). Not safe for concurrent access.
1021 _ = it.Response.(*financialservicespb.ListPredictionResultsResponse)
1022 }
1023 }
1024
1025 func ExampleAMLClient_UpdateBacktestResult() {
1026 ctx := context.Background()
1027 // This snippet has been automatically generated and should be regarded as a code template only.
1028 // It will require modifications to work:
1029 // - It may require correct/in-range values for request initialization.
1030 // - It may require specifying regional endpoints when creating the service client as shown in:
1031 // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
1032 c, err := financialservices.NewAMLClient(ctx)
1033 if err != nil {
1034 // TODO: Handle error.
1035 }
1036 defer c.Close()
1037
1038 req := &financialservicespb.UpdateBacktestResultRequest{
1039 // TODO: Fill request struct fields.
1040 // See https://pkg.go.dev/cloud.google.com/go/financialservices/apiv1/financialservicespb#UpdateBacktestResultRequest.
1041 }
1042 op, err := c.UpdateBacktestResult(ctx, req)
1043 if err != nil {
1044 // TODO: Handle error.
1045 }
1046
1047 resp, err := op.Wait(ctx)
1048 if err != nil {
1049 // TODO: Handle error.
1050 }
1051 // TODO: Use resp.
1052 _ = resp
1053 }
1054
1055 func ExampleAMLClient_UpdateDataset() {
1056 ctx := context.Background()
1057 // This snippet has been automatically generated and should be regarded as a code template only.
1058 // It will require modifications to work:
1059 // - It may require correct/in-range values for request initialization.
1060 // - It may require specifying regional endpoints when creating the service client as shown in:
1061 // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
1062 c, err := financialservices.NewAMLClient(ctx)
1063 if err != nil {
1064 // TODO: Handle error.
1065 }
1066 defer c.Close()
1067
1068 req := &financialservicespb.UpdateDatasetRequest{
1069 // TODO: Fill request struct fields.
1070 // See https://pkg.go.dev/cloud.google.com/go/financialservices/apiv1/financialservicespb#UpdateDatasetRequest.
1071 }
1072 op, err := c.UpdateDataset(ctx, req)
1073 if err != nil {
1074 // TODO: Handle error.
1075 }
1076
1077 resp, err := op.Wait(ctx)
1078 if err != nil {
1079 // TODO: Handle error.
1080 }
1081 // TODO: Use resp.
1082 _ = resp
1083 }
1084
1085 func ExampleAMLClient_UpdateEngineConfig() {
1086 ctx := context.Background()
1087 // This snippet has been automatically generated and should be regarded as a code template only.
1088 // It will require modifications to work:
1089 // - It may require correct/in-range values for request initialization.
1090 // - It may require specifying regional endpoints when creating the service client as shown in:
1091 // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
1092 c, err := financialservices.NewAMLClient(ctx)
1093 if err != nil {
1094 // TODO: Handle error.
1095 }
1096 defer c.Close()
1097
1098 req := &financialservicespb.UpdateEngineConfigRequest{
1099 // TODO: Fill request struct fields.
1100 // See https://pkg.go.dev/cloud.google.com/go/financialservices/apiv1/financialservicespb#UpdateEngineConfigRequest.
1101 }
1102 op, err := c.UpdateEngineConfig(ctx, req)
1103 if err != nil {
1104 // TODO: Handle error.
1105 }
1106
1107 resp, err := op.Wait(ctx)
1108 if err != nil {
1109 // TODO: Handle error.
1110 }
1111 // TODO: Use resp.
1112 _ = resp
1113 }
1114
1115 func ExampleAMLClient_UpdateInstance() {
1116 ctx := context.Background()
1117 // This snippet has been automatically generated and should be regarded as a code template only.
1118 // It will require modifications to work:
1119 // - It may require correct/in-range values for request initialization.
1120 // - It may require specifying regional endpoints when creating the service client as shown in:
1121 // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
1122 c, err := financialservices.NewAMLClient(ctx)
1123 if err != nil {
1124 // TODO: Handle error.
1125 }
1126 defer c.Close()
1127
1128 req := &financialservicespb.UpdateInstanceRequest{
1129 // TODO: Fill request struct fields.
1130 // See https://pkg.go.dev/cloud.google.com/go/financialservices/apiv1/financialservicespb#UpdateInstanceRequest.
1131 }
1132 op, err := c.UpdateInstance(ctx, req)
1133 if err != nil {
1134 // TODO: Handle error.
1135 }
1136
1137 resp, err := op.Wait(ctx)
1138 if err != nil {
1139 // TODO: Handle error.
1140 }
1141 // TODO: Use resp.
1142 _ = resp
1143 }
1144
1145 func ExampleAMLClient_UpdateModel() {
1146 ctx := context.Background()
1147 // This snippet has been automatically generated and should be regarded as a code template only.
1148 // It will require modifications to work:
1149 // - It may require correct/in-range values for request initialization.
1150 // - It may require specifying regional endpoints when creating the service client as shown in:
1151 // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
1152 c, err := financialservices.NewAMLClient(ctx)
1153 if err != nil {
1154 // TODO: Handle error.
1155 }
1156 defer c.Close()
1157
1158 req := &financialservicespb.UpdateModelRequest{
1159 // TODO: Fill request struct fields.
1160 // See https://pkg.go.dev/cloud.google.com/go/financialservices/apiv1/financialservicespb#UpdateModelRequest.
1161 }
1162 op, err := c.UpdateModel(ctx, req)
1163 if err != nil {
1164 // TODO: Handle error.
1165 }
1166
1167 resp, err := op.Wait(ctx)
1168 if err != nil {
1169 // TODO: Handle error.
1170 }
1171 // TODO: Use resp.
1172 _ = resp
1173 }
1174
1175 func ExampleAMLClient_UpdatePredictionResult() {
1176 ctx := context.Background()
1177 // This snippet has been automatically generated and should be regarded as a code template only.
1178 // It will require modifications to work:
1179 // - It may require correct/in-range values for request initialization.
1180 // - It may require specifying regional endpoints when creating the service client as shown in:
1181 // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
1182 c, err := financialservices.NewAMLClient(ctx)
1183 if err != nil {
1184 // TODO: Handle error.
1185 }
1186 defer c.Close()
1187
1188 req := &financialservicespb.UpdatePredictionResultRequest{
1189 // TODO: Fill request struct fields.
1190 // See https://pkg.go.dev/cloud.google.com/go/financialservices/apiv1/financialservicespb#UpdatePredictionResultRequest.
1191 }
1192 op, err := c.UpdatePredictionResult(ctx, req)
1193 if err != nil {
1194 // TODO: Handle error.
1195 }
1196
1197 resp, err := op.Wait(ctx)
1198 if err != nil {
1199 // TODO: Handle error.
1200 }
1201 // TODO: Use resp.
1202 _ = resp
1203 }
1204
1205 func ExampleAMLClient_GetLocation() {
1206 ctx := context.Background()
1207 // This snippet has been automatically generated and should be regarded as a code template only.
1208 // It will require modifications to work:
1209 // - It may require correct/in-range values for request initialization.
1210 // - It may require specifying regional endpoints when creating the service client as shown in:
1211 // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
1212 c, err := financialservices.NewAMLClient(ctx)
1213 if err != nil {
1214 // TODO: Handle error.
1215 }
1216 defer c.Close()
1217
1218 req := &locationpb.GetLocationRequest{
1219 // TODO: Fill request struct fields.
1220 // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/location#GetLocationRequest.
1221 }
1222 resp, err := c.GetLocation(ctx, req)
1223 if err != nil {
1224 // TODO: Handle error.
1225 }
1226 // TODO: Use resp.
1227 _ = resp
1228 }
1229
1230 func ExampleAMLClient_ListLocations() {
1231 ctx := context.Background()
1232 // This snippet has been automatically generated and should be regarded as a code template only.
1233 // It will require modifications to work:
1234 // - It may require correct/in-range values for request initialization.
1235 // - It may require specifying regional endpoints when creating the service client as shown in:
1236 // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
1237 c, err := financialservices.NewAMLClient(ctx)
1238 if err != nil {
1239 // TODO: Handle error.
1240 }
1241 defer c.Close()
1242
1243 req := &locationpb.ListLocationsRequest{
1244 // TODO: Fill request struct fields.
1245 // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/location#ListLocationsRequest.
1246 }
1247 it := c.ListLocations(ctx, req)
1248 for {
1249 resp, err := it.Next()
1250 if err == iterator.Done {
1251 break
1252 }
1253 if err != nil {
1254 // TODO: Handle error.
1255 }
1256 // TODO: Use resp.
1257 _ = resp
1258
1259 // If you need to access the underlying RPC response,
1260 // you can do so by casting the `Response` as below.
1261 // Otherwise, remove this line. Only populated after
1262 // first call to Next(). Not safe for concurrent access.
1263 _ = it.Response.(*locationpb.ListLocationsResponse)
1264 }
1265 }
1266
1267 func ExampleAMLClient_CancelOperation() {
1268 ctx := context.Background()
1269 // This snippet has been automatically generated and should be regarded as a code template only.
1270 // It will require modifications to work:
1271 // - It may require correct/in-range values for request initialization.
1272 // - It may require specifying regional endpoints when creating the service client as shown in:
1273 // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
1274 c, err := financialservices.NewAMLClient(ctx)
1275 if err != nil {
1276 // TODO: Handle error.
1277 }
1278 defer c.Close()
1279
1280 req := &longrunningpb.CancelOperationRequest{
1281 // TODO: Fill request struct fields.
1282 // See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#CancelOperationRequest.
1283 }
1284 err = c.CancelOperation(ctx, req)
1285 if err != nil {
1286 // TODO: Handle error.
1287 }
1288 }
1289
1290 func ExampleAMLClient_DeleteOperation() {
1291 ctx := context.Background()
1292 // This snippet has been automatically generated and should be regarded as a code template only.
1293 // It will require modifications to work:
1294 // - It may require correct/in-range values for request initialization.
1295 // - It may require specifying regional endpoints when creating the service client as shown in:
1296 // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
1297 c, err := financialservices.NewAMLClient(ctx)
1298 if err != nil {
1299 // TODO: Handle error.
1300 }
1301 defer c.Close()
1302
1303 req := &longrunningpb.DeleteOperationRequest{
1304 // TODO: Fill request struct fields.
1305 // See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#DeleteOperationRequest.
1306 }
1307 err = c.DeleteOperation(ctx, req)
1308 if err != nil {
1309 // TODO: Handle error.
1310 }
1311 }
1312
1313 func ExampleAMLClient_GetOperation() {
1314 ctx := context.Background()
1315 // This snippet has been automatically generated and should be regarded as a code template only.
1316 // It will require modifications to work:
1317 // - It may require correct/in-range values for request initialization.
1318 // - It may require specifying regional endpoints when creating the service client as shown in:
1319 // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
1320 c, err := financialservices.NewAMLClient(ctx)
1321 if err != nil {
1322 // TODO: Handle error.
1323 }
1324 defer c.Close()
1325
1326 req := &longrunningpb.GetOperationRequest{
1327 // TODO: Fill request struct fields.
1328 // See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#GetOperationRequest.
1329 }
1330 resp, err := c.GetOperation(ctx, req)
1331 if err != nil {
1332 // TODO: Handle error.
1333 }
1334 // TODO: Use resp.
1335 _ = resp
1336 }
1337
1338 func ExampleAMLClient_ListOperations() {
1339 ctx := context.Background()
1340 // This snippet has been automatically generated and should be regarded as a code template only.
1341 // It will require modifications to work:
1342 // - It may require correct/in-range values for request initialization.
1343 // - It may require specifying regional endpoints when creating the service client as shown in:
1344 // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
1345 c, err := financialservices.NewAMLClient(ctx)
1346 if err != nil {
1347 // TODO: Handle error.
1348 }
1349 defer c.Close()
1350
1351 req := &longrunningpb.ListOperationsRequest{
1352 // TODO: Fill request struct fields.
1353 // See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#ListOperationsRequest.
1354 }
1355 it := c.ListOperations(ctx, req)
1356 for {
1357 resp, err := it.Next()
1358 if err == iterator.Done {
1359 break
1360 }
1361 if err != nil {
1362 // TODO: Handle error.
1363 }
1364 // TODO: Use resp.
1365 _ = resp
1366
1367 // If you need to access the underlying RPC response,
1368 // you can do so by casting the `Response` as below.
1369 // Otherwise, remove this line. Only populated after
1370 // first call to Next(). Not safe for concurrent access.
1371 _ = it.Response.(*longrunningpb.ListOperationsResponse)
1372 }
1373 }