Debian Codegraph @

gkemulticloud/apiv1/azure_clusters_client_example_test.go

raw symbols SCIP
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 gkemulticloud_test
18
19 import (
20 "context"
21
22 gkemulticloud "cloud.google.com/go/gkemulticloud/apiv1"
23 gkemulticloudpb "cloud.google.com/go/gkemulticloud/apiv1/gkemulticloudpb"
24 longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
25 "google.golang.org/api/iterator"
26 )
27
28 func ExampleNewAzureClustersClient() {
29 ctx := context.Background()
30 // This snippet has been automatically generated and should be regarded as a code template only.
31 // It will require modifications to work:
32 // - It may require correct/in-range values for request initialization.
33 // - It may require specifying regional endpoints when creating the service client as shown in:
34 // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
35 c, err := gkemulticloud.NewAzureClustersClient(ctx)
36 if err != nil {
37 // TODO: Handle error.
38 }
39 defer c.Close()
40
41 // TODO: Use client.
42 _ = c
43 }
44
45 func ExampleAzureClustersClient_CreateAzureClient() {
46 ctx := context.Background()
47 // This snippet has been automatically generated and should be regarded as a code template only.
48 // It will require modifications to work:
49 // - It may require correct/in-range values for request initialization.
50 // - It may require specifying regional endpoints when creating the service client as shown in:
51 // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
52 c, err := gkemulticloud.NewAzureClustersClient(ctx)
53 if err != nil {
54 // TODO: Handle error.
55 }
56 defer c.Close()
57
58 req := &gkemulticloudpb.CreateAzureClientRequest{
59 // TODO: Fill request struct fields.
60 // See https://pkg.go.dev/cloud.google.com/go/gkemulticloud/apiv1/gkemulticloudpb#CreateAzureClientRequest.
61 }
62 op, err := c.CreateAzureClient(ctx, req)
63 if err != nil {
64 // TODO: Handle error.
65 }
66
67 resp, err := op.Wait(ctx)
68 if err != nil {
69 // TODO: Handle error.
70 }
71 // TODO: Use resp.
72 _ = resp
73 }
74
75 func ExampleAzureClustersClient_CreateAzureCluster() {
76 ctx := context.Background()
77 // This snippet has been automatically generated and should be regarded as a code template only.
78 // It will require modifications to work:
79 // - It may require correct/in-range values for request initialization.
80 // - It may require specifying regional endpoints when creating the service client as shown in:
81 // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
82 c, err := gkemulticloud.NewAzureClustersClient(ctx)
83 if err != nil {
84 // TODO: Handle error.
85 }
86 defer c.Close()
87
88 req := &gkemulticloudpb.CreateAzureClusterRequest{
89 // TODO: Fill request struct fields.
90 // See https://pkg.go.dev/cloud.google.com/go/gkemulticloud/apiv1/gkemulticloudpb#CreateAzureClusterRequest.
91 }
92 op, err := c.CreateAzureCluster(ctx, req)
93 if err != nil {
94 // TODO: Handle error.
95 }
96
97 resp, err := op.Wait(ctx)
98 if err != nil {
99 // TODO: Handle error.
100 }
101 // TODO: Use resp.
102 _ = resp
103 }
104
105 func ExampleAzureClustersClient_CreateAzureNodePool() {
106 ctx := context.Background()
107 // This snippet has been automatically generated and should be regarded as a code template only.
108 // It will require modifications to work:
109 // - It may require correct/in-range values for request initialization.
110 // - It may require specifying regional endpoints when creating the service client as shown in:
111 // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
112 c, err := gkemulticloud.NewAzureClustersClient(ctx)
113 if err != nil {
114 // TODO: Handle error.
115 }
116 defer c.Close()
117
118 req := &gkemulticloudpb.CreateAzureNodePoolRequest{
119 // TODO: Fill request struct fields.
120 // See https://pkg.go.dev/cloud.google.com/go/gkemulticloud/apiv1/gkemulticloudpb#CreateAzureNodePoolRequest.
121 }
122 op, err := c.CreateAzureNodePool(ctx, req)
123 if err != nil {
124 // TODO: Handle error.
125 }
126
127 resp, err := op.Wait(ctx)
128 if err != nil {
129 // TODO: Handle error.
130 }
131 // TODO: Use resp.
132 _ = resp
133 }
134
135 func ExampleAzureClustersClient_DeleteAzureClient() {
136 ctx := context.Background()
137 // This snippet has been automatically generated and should be regarded as a code template only.
138 // It will require modifications to work:
139 // - It may require correct/in-range values for request initialization.
140 // - It may require specifying regional endpoints when creating the service client as shown in:
141 // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
142 c, err := gkemulticloud.NewAzureClustersClient(ctx)
143 if err != nil {
144 // TODO: Handle error.
145 }
146 defer c.Close()
147
148 req := &gkemulticloudpb.DeleteAzureClientRequest{
149 // TODO: Fill request struct fields.
150 // See https://pkg.go.dev/cloud.google.com/go/gkemulticloud/apiv1/gkemulticloudpb#DeleteAzureClientRequest.
151 }
152 op, err := c.DeleteAzureClient(ctx, req)
153 if err != nil {
154 // TODO: Handle error.
155 }
156
157 err = op.Wait(ctx)
158 if err != nil {
159 // TODO: Handle error.
160 }
161 }
162
163 func ExampleAzureClustersClient_DeleteAzureCluster() {
164 ctx := context.Background()
165 // This snippet has been automatically generated and should be regarded as a code template only.
166 // It will require modifications to work:
167 // - It may require correct/in-range values for request initialization.
168 // - It may require specifying regional endpoints when creating the service client as shown in:
169 // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
170 c, err := gkemulticloud.NewAzureClustersClient(ctx)
171 if err != nil {
172 // TODO: Handle error.
173 }
174 defer c.Close()
175
176 req := &gkemulticloudpb.DeleteAzureClusterRequest{
177 // TODO: Fill request struct fields.
178 // See https://pkg.go.dev/cloud.google.com/go/gkemulticloud/apiv1/gkemulticloudpb#DeleteAzureClusterRequest.
179 }
180 op, err := c.DeleteAzureCluster(ctx, req)
181 if err != nil {
182 // TODO: Handle error.
183 }
184
185 err = op.Wait(ctx)
186 if err != nil {
187 // TODO: Handle error.
188 }
189 }
190
191 func ExampleAzureClustersClient_DeleteAzureNodePool() {
192 ctx := context.Background()
193 // This snippet has been automatically generated and should be regarded as a code template only.
194 // It will require modifications to work:
195 // - It may require correct/in-range values for request initialization.
196 // - It may require specifying regional endpoints when creating the service client as shown in:
197 // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
198 c, err := gkemulticloud.NewAzureClustersClient(ctx)
199 if err != nil {
200 // TODO: Handle error.
201 }
202 defer c.Close()
203
204 req := &gkemulticloudpb.DeleteAzureNodePoolRequest{
205 // TODO: Fill request struct fields.
206 // See https://pkg.go.dev/cloud.google.com/go/gkemulticloud/apiv1/gkemulticloudpb#DeleteAzureNodePoolRequest.
207 }
208 op, err := c.DeleteAzureNodePool(ctx, req)
209 if err != nil {
210 // TODO: Handle error.
211 }
212
213 err = op.Wait(ctx)
214 if err != nil {
215 // TODO: Handle error.
216 }
217 }
218
219 func ExampleAzureClustersClient_GenerateAzureAccessToken() {
220 ctx := context.Background()
221 // This snippet has been automatically generated and should be regarded as a code template only.
222 // It will require modifications to work:
223 // - It may require correct/in-range values for request initialization.
224 // - It may require specifying regional endpoints when creating the service client as shown in:
225 // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
226 c, err := gkemulticloud.NewAzureClustersClient(ctx)
227 if err != nil {
228 // TODO: Handle error.
229 }
230 defer c.Close()
231
232 req := &gkemulticloudpb.GenerateAzureAccessTokenRequest{
233 // TODO: Fill request struct fields.
234 // See https://pkg.go.dev/cloud.google.com/go/gkemulticloud/apiv1/gkemulticloudpb#GenerateAzureAccessTokenRequest.
235 }
236 resp, err := c.GenerateAzureAccessToken(ctx, req)
237 if err != nil {
238 // TODO: Handle error.
239 }
240 // TODO: Use resp.
241 _ = resp
242 }
243
244 func ExampleAzureClustersClient_GenerateAzureClusterAgentToken() {
245 ctx := context.Background()
246 // This snippet has been automatically generated and should be regarded as a code template only.
247 // It will require modifications to work:
248 // - It may require correct/in-range values for request initialization.
249 // - It may require specifying regional endpoints when creating the service client as shown in:
250 // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
251 c, err := gkemulticloud.NewAzureClustersClient(ctx)
252 if err != nil {
253 // TODO: Handle error.
254 }
255 defer c.Close()
256
257 req := &gkemulticloudpb.GenerateAzureClusterAgentTokenRequest{
258 // TODO: Fill request struct fields.
259 // See https://pkg.go.dev/cloud.google.com/go/gkemulticloud/apiv1/gkemulticloudpb#GenerateAzureClusterAgentTokenRequest.
260 }
261 resp, err := c.GenerateAzureClusterAgentToken(ctx, req)
262 if err != nil {
263 // TODO: Handle error.
264 }
265 // TODO: Use resp.
266 _ = resp
267 }
268
269 func ExampleAzureClustersClient_GetAzureClient() {
270 ctx := context.Background()
271 // This snippet has been automatically generated and should be regarded as a code template only.
272 // It will require modifications to work:
273 // - It may require correct/in-range values for request initialization.
274 // - It may require specifying regional endpoints when creating the service client as shown in:
275 // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
276 c, err := gkemulticloud.NewAzureClustersClient(ctx)
277 if err != nil {
278 // TODO: Handle error.
279 }
280 defer c.Close()
281
282 req := &gkemulticloudpb.GetAzureClientRequest{
283 // TODO: Fill request struct fields.
284 // See https://pkg.go.dev/cloud.google.com/go/gkemulticloud/apiv1/gkemulticloudpb#GetAzureClientRequest.
285 }
286 resp, err := c.GetAzureClient(ctx, req)
287 if err != nil {
288 // TODO: Handle error.
289 }
290 // TODO: Use resp.
291 _ = resp
292 }
293
294 func ExampleAzureClustersClient_GetAzureCluster() {
295 ctx := context.Background()
296 // This snippet has been automatically generated and should be regarded as a code template only.
297 // It will require modifications to work:
298 // - It may require correct/in-range values for request initialization.
299 // - It may require specifying regional endpoints when creating the service client as shown in:
300 // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
301 c, err := gkemulticloud.NewAzureClustersClient(ctx)
302 if err != nil {
303 // TODO: Handle error.
304 }
305 defer c.Close()
306
307 req := &gkemulticloudpb.GetAzureClusterRequest{
308 // TODO: Fill request struct fields.
309 // See https://pkg.go.dev/cloud.google.com/go/gkemulticloud/apiv1/gkemulticloudpb#GetAzureClusterRequest.
310 }
311 resp, err := c.GetAzureCluster(ctx, req)
312 if err != nil {
313 // TODO: Handle error.
314 }
315 // TODO: Use resp.
316 _ = resp
317 }
318
319 func ExampleAzureClustersClient_GetAzureJsonWebKeys() {
320 ctx := context.Background()
321 // This snippet has been automatically generated and should be regarded as a code template only.
322 // It will require modifications to work:
323 // - It may require correct/in-range values for request initialization.
324 // - It may require specifying regional endpoints when creating the service client as shown in:
325 // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
326 c, err := gkemulticloud.NewAzureClustersClient(ctx)
327 if err != nil {
328 // TODO: Handle error.
329 }
330 defer c.Close()
331
332 req := &gkemulticloudpb.GetAzureJsonWebKeysRequest{
333 // TODO: Fill request struct fields.
334 // See https://pkg.go.dev/cloud.google.com/go/gkemulticloud/apiv1/gkemulticloudpb#GetAzureJsonWebKeysRequest.
335 }
336 resp, err := c.GetAzureJsonWebKeys(ctx, req)
337 if err != nil {
338 // TODO: Handle error.
339 }
340 // TODO: Use resp.
341 _ = resp
342 }
343
344 func ExampleAzureClustersClient_GetAzureNodePool() {
345 ctx := context.Background()
346 // This snippet has been automatically generated and should be regarded as a code template only.
347 // It will require modifications to work:
348 // - It may require correct/in-range values for request initialization.
349 // - It may require specifying regional endpoints when creating the service client as shown in:
350 // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
351 c, err := gkemulticloud.NewAzureClustersClient(ctx)
352 if err != nil {
353 // TODO: Handle error.
354 }
355 defer c.Close()
356
357 req := &gkemulticloudpb.GetAzureNodePoolRequest{
358 // TODO: Fill request struct fields.
359 // See https://pkg.go.dev/cloud.google.com/go/gkemulticloud/apiv1/gkemulticloudpb#GetAzureNodePoolRequest.
360 }
361 resp, err := c.GetAzureNodePool(ctx, req)
362 if err != nil {
363 // TODO: Handle error.
364 }
365 // TODO: Use resp.
366 _ = resp
367 }
368
369 func ExampleAzureClustersClient_GetAzureOpenIdConfig() {
370 ctx := context.Background()
371 // This snippet has been automatically generated and should be regarded as a code template only.
372 // It will require modifications to work:
373 // - It may require correct/in-range values for request initialization.
374 // - It may require specifying regional endpoints when creating the service client as shown in:
375 // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
376 c, err := gkemulticloud.NewAzureClustersClient(ctx)
377 if err != nil {
378 // TODO: Handle error.
379 }
380 defer c.Close()
381
382 req := &gkemulticloudpb.GetAzureOpenIdConfigRequest{
383 // TODO: Fill request struct fields.
384 // See https://pkg.go.dev/cloud.google.com/go/gkemulticloud/apiv1/gkemulticloudpb#GetAzureOpenIdConfigRequest.
385 }
386 resp, err := c.GetAzureOpenIdConfig(ctx, req)
387 if err != nil {
388 // TODO: Handle error.
389 }
390 // TODO: Use resp.
391 _ = resp
392 }
393
394 func ExampleAzureClustersClient_GetAzureServerConfig() {
395 ctx := context.Background()
396 // This snippet has been automatically generated and should be regarded as a code template only.
397 // It will require modifications to work:
398 // - It may require correct/in-range values for request initialization.
399 // - It may require specifying regional endpoints when creating the service client as shown in:
400 // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
401 c, err := gkemulticloud.NewAzureClustersClient(ctx)
402 if err != nil {
403 // TODO: Handle error.
404 }
405 defer c.Close()
406
407 req := &gkemulticloudpb.GetAzureServerConfigRequest{
408 // TODO: Fill request struct fields.
409 // See https://pkg.go.dev/cloud.google.com/go/gkemulticloud/apiv1/gkemulticloudpb#GetAzureServerConfigRequest.
410 }
411 resp, err := c.GetAzureServerConfig(ctx, req)
412 if err != nil {
413 // TODO: Handle error.
414 }
415 // TODO: Use resp.
416 _ = resp
417 }
418
419 func ExampleAzureClustersClient_ListAzureClients() {
420 ctx := context.Background()
421 // This snippet has been automatically generated and should be regarded as a code template only.
422 // It will require modifications to work:
423 // - It may require correct/in-range values for request initialization.
424 // - It may require specifying regional endpoints when creating the service client as shown in:
425 // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
426 c, err := gkemulticloud.NewAzureClustersClient(ctx)
427 if err != nil {
428 // TODO: Handle error.
429 }
430 defer c.Close()
431
432 req := &gkemulticloudpb.ListAzureClientsRequest{
433 // TODO: Fill request struct fields.
434 // See https://pkg.go.dev/cloud.google.com/go/gkemulticloud/apiv1/gkemulticloudpb#ListAzureClientsRequest.
435 }
436 it := c.ListAzureClients(ctx, req)
437 for {
438 resp, err := it.Next()
439 if err == iterator.Done {
440 break
441 }
442 if err != nil {
443 // TODO: Handle error.
444 }
445 // TODO: Use resp.
446 _ = resp
447
448 // If you need to access the underlying RPC response,
449 // you can do so by casting the `Response` as below.
450 // Otherwise, remove this line. Only populated after
451 // first call to Next(). Not safe for concurrent access.
452 _ = it.Response.(*gkemulticloudpb.ListAzureClientsResponse)
453 }
454 }
455
456 func ExampleAzureClustersClient_ListAzureClusters() {
457 ctx := context.Background()
458 // This snippet has been automatically generated and should be regarded as a code template only.
459 // It will require modifications to work:
460 // - It may require correct/in-range values for request initialization.
461 // - It may require specifying regional endpoints when creating the service client as shown in:
462 // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
463 c, err := gkemulticloud.NewAzureClustersClient(ctx)
464 if err != nil {
465 // TODO: Handle error.
466 }
467 defer c.Close()
468
469 req := &gkemulticloudpb.ListAzureClustersRequest{
470 // TODO: Fill request struct fields.
471 // See https://pkg.go.dev/cloud.google.com/go/gkemulticloud/apiv1/gkemulticloudpb#ListAzureClustersRequest.
472 }
473 it := c.ListAzureClusters(ctx, req)
474 for {
475 resp, err := it.Next()
476 if err == iterator.Done {
477 break
478 }
479 if err != nil {
480 // TODO: Handle error.
481 }
482 // TODO: Use resp.
483 _ = resp
484
485 // If you need to access the underlying RPC response,
486 // you can do so by casting the `Response` as below.
487 // Otherwise, remove this line. Only populated after
488 // first call to Next(). Not safe for concurrent access.
489 _ = it.Response.(*gkemulticloudpb.ListAzureClustersResponse)
490 }
491 }
492
493 func ExampleAzureClustersClient_ListAzureNodePools() {
494 ctx := context.Background()
495 // This snippet has been automatically generated and should be regarded as a code template only.
496 // It will require modifications to work:
497 // - It may require correct/in-range values for request initialization.
498 // - It may require specifying regional endpoints when creating the service client as shown in:
499 // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
500 c, err := gkemulticloud.NewAzureClustersClient(ctx)
501 if err != nil {
502 // TODO: Handle error.
503 }
504 defer c.Close()
505
506 req := &gkemulticloudpb.ListAzureNodePoolsRequest{
507 // TODO: Fill request struct fields.
508 // See https://pkg.go.dev/cloud.google.com/go/gkemulticloud/apiv1/gkemulticloudpb#ListAzureNodePoolsRequest.
509 }
510 it := c.ListAzureNodePools(ctx, req)
511 for {
512 resp, err := it.Next()
513 if err == iterator.Done {
514 break
515 }
516 if err != nil {
517 // TODO: Handle error.
518 }
519 // TODO: Use resp.
520 _ = resp
521
522 // If you need to access the underlying RPC response,
523 // you can do so by casting the `Response` as below.
524 // Otherwise, remove this line. Only populated after
525 // first call to Next(). Not safe for concurrent access.
526 _ = it.Response.(*gkemulticloudpb.ListAzureNodePoolsResponse)
527 }
528 }
529
530 func ExampleAzureClustersClient_UpdateAzureCluster() {
531 ctx := context.Background()
532 // This snippet has been automatically generated and should be regarded as a code template only.
533 // It will require modifications to work:
534 // - It may require correct/in-range values for request initialization.
535 // - It may require specifying regional endpoints when creating the service client as shown in:
536 // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
537 c, err := gkemulticloud.NewAzureClustersClient(ctx)
538 if err != nil {
539 // TODO: Handle error.
540 }
541 defer c.Close()
542
543 req := &gkemulticloudpb.UpdateAzureClusterRequest{
544 // TODO: Fill request struct fields.
545 // See https://pkg.go.dev/cloud.google.com/go/gkemulticloud/apiv1/gkemulticloudpb#UpdateAzureClusterRequest.
546 }
547 op, err := c.UpdateAzureCluster(ctx, req)
548 if err != nil {
549 // TODO: Handle error.
550 }
551
552 resp, err := op.Wait(ctx)
553 if err != nil {
554 // TODO: Handle error.
555 }
556 // TODO: Use resp.
557 _ = resp
558 }
559
560 func ExampleAzureClustersClient_UpdateAzureNodePool() {
561 ctx := context.Background()
562 // This snippet has been automatically generated and should be regarded as a code template only.
563 // It will require modifications to work:
564 // - It may require correct/in-range values for request initialization.
565 // - It may require specifying regional endpoints when creating the service client as shown in:
566 // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
567 c, err := gkemulticloud.NewAzureClustersClient(ctx)
568 if err != nil {
569 // TODO: Handle error.
570 }
571 defer c.Close()
572
573 req := &gkemulticloudpb.UpdateAzureNodePoolRequest{
574 // TODO: Fill request struct fields.
575 // See https://pkg.go.dev/cloud.google.com/go/gkemulticloud/apiv1/gkemulticloudpb#UpdateAzureNodePoolRequest.
576 }
577 op, err := c.UpdateAzureNodePool(ctx, req)
578 if err != nil {
579 // TODO: Handle error.
580 }
581
582 resp, err := op.Wait(ctx)
583 if err != nil {
584 // TODO: Handle error.
585 }
586 // TODO: Use resp.
587 _ = resp
588 }
589
590 func ExampleAzureClustersClient_CancelOperation() {
591 ctx := context.Background()
592 // This snippet has been automatically generated and should be regarded as a code template only.
593 // It will require modifications to work:
594 // - It may require correct/in-range values for request initialization.
595 // - It may require specifying regional endpoints when creating the service client as shown in:
596 // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
597 c, err := gkemulticloud.NewAzureClustersClient(ctx)
598 if err != nil {
599 // TODO: Handle error.
600 }
601 defer c.Close()
602
603 req := &longrunningpb.CancelOperationRequest{
604 // TODO: Fill request struct fields.
605 // See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#CancelOperationRequest.
606 }
607 err = c.CancelOperation(ctx, req)
608 if err != nil {
609 // TODO: Handle error.
610 }
611 }
612
613 func ExampleAzureClustersClient_DeleteOperation() {
614 ctx := context.Background()
615 // This snippet has been automatically generated and should be regarded as a code template only.
616 // It will require modifications to work:
617 // - It may require correct/in-range values for request initialization.
618 // - It may require specifying regional endpoints when creating the service client as shown in:
619 // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
620 c, err := gkemulticloud.NewAzureClustersClient(ctx)
621 if err != nil {
622 // TODO: Handle error.
623 }
624 defer c.Close()
625
626 req := &longrunningpb.DeleteOperationRequest{
627 // TODO: Fill request struct fields.
628 // See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#DeleteOperationRequest.
629 }
630 err = c.DeleteOperation(ctx, req)
631 if err != nil {
632 // TODO: Handle error.
633 }
634 }
635
636 func ExampleAzureClustersClient_GetOperation() {
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 := gkemulticloud.NewAzureClustersClient(ctx)
644 if err != nil {
645 // TODO: Handle error.
646 }
647 defer c.Close()
648
649 req := &longrunningpb.GetOperationRequest{
650 // TODO: Fill request struct fields.
651 // See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#GetOperationRequest.
652 }
653 resp, err := c.GetOperation(ctx, req)
654 if err != nil {
655 // TODO: Handle error.
656 }
657 // TODO: Use resp.
658 _ = resp
659 }
660
661 func ExampleAzureClustersClient_ListOperations() {
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 := gkemulticloud.NewAzureClustersClient(ctx)
669 if err != nil {
670 // TODO: Handle error.
671 }
672 defer c.Close()
673
674 req := &longrunningpb.ListOperationsRequest{
675 // TODO: Fill request struct fields.
676 // See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#ListOperationsRequest.
677 }
678 it := c.ListOperations(ctx, req)
679 for {
680 resp, err := it.Next()
681 if err == iterator.Done {
682 break
683 }
684 if err != nil {
685 // TODO: Handle error.
686 }
687 // TODO: Use resp.
688 _ = resp
689
690 // If you need to access the underlying RPC response,
691 // you can do so by casting the `Response` as below.
692 // Otherwise, remove this line. Only populated after
693 // first call to Next(). Not safe for concurrent access.
694 _ = it.Response.(*longrunningpb.ListOperationsResponse)
695 }
696 }