Debian Codegraph @

oracledatabase/apiv1/oracle_database_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 oracledatabase_test
18
19 import (
20 "context"
21
22 longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
23 oracledatabase "cloud.google.com/go/oracledatabase/apiv1"
24 oracledatabasepb "cloud.google.com/go/oracledatabase/apiv1/oracledatabasepb"
25 "google.golang.org/api/iterator"
26 locationpb "google.golang.org/genproto/googleapis/cloud/location"
27 )
28
29 func ExampleNewClient() {
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 := oracledatabase.NewClient(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 ExampleNewRESTClient() {
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 := oracledatabase.NewRESTClient(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 ExampleClient_CreateAutonomousDatabase() {
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 := oracledatabase.NewClient(ctx)
71 if err != nil {
72 // TODO: Handle error.
73 }
74 defer c.Close()
75
76 req := &oracledatabasepb.CreateAutonomousDatabaseRequest{
77 // TODO: Fill request struct fields.
78 // See https://pkg.go.dev/cloud.google.com/go/oracledatabase/apiv1/oracledatabasepb#CreateAutonomousDatabaseRequest.
79 }
80 op, err := c.CreateAutonomousDatabase(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 ExampleClient_CreateCloudExadataInfrastructure() {
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 := oracledatabase.NewClient(ctx)
101 if err != nil {
102 // TODO: Handle error.
103 }
104 defer c.Close()
105
106 req := &oracledatabasepb.CreateCloudExadataInfrastructureRequest{
107 // TODO: Fill request struct fields.
108 // See https://pkg.go.dev/cloud.google.com/go/oracledatabase/apiv1/oracledatabasepb#CreateCloudExadataInfrastructureRequest.
109 }
110 op, err := c.CreateCloudExadataInfrastructure(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 ExampleClient_CreateCloudVmCluster() {
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 := oracledatabase.NewClient(ctx)
131 if err != nil {
132 // TODO: Handle error.
133 }
134 defer c.Close()
135
136 req := &oracledatabasepb.CreateCloudVmClusterRequest{
137 // TODO: Fill request struct fields.
138 // See https://pkg.go.dev/cloud.google.com/go/oracledatabase/apiv1/oracledatabasepb#CreateCloudVmClusterRequest.
139 }
140 op, err := c.CreateCloudVmCluster(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 ExampleClient_DeleteAutonomousDatabase() {
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 := oracledatabase.NewClient(ctx)
161 if err != nil {
162 // TODO: Handle error.
163 }
164 defer c.Close()
165
166 req := &oracledatabasepb.DeleteAutonomousDatabaseRequest{
167 // TODO: Fill request struct fields.
168 // See https://pkg.go.dev/cloud.google.com/go/oracledatabase/apiv1/oracledatabasepb#DeleteAutonomousDatabaseRequest.
169 }
170 op, err := c.DeleteAutonomousDatabase(ctx, req)
171 if err != nil {
172 // TODO: Handle error.
173 }
174
175 err = op.Wait(ctx)
176 if err != nil {
177 // TODO: Handle error.
178 }
179 }
180
181 func ExampleClient_DeleteCloudExadataInfrastructure() {
182 ctx := context.Background()
183 // This snippet has been automatically generated and should be regarded as a code template only.
184 // It will require modifications to work:
185 // - It may require correct/in-range values for request initialization.
186 // - It may require specifying regional endpoints when creating the service client as shown in:
187 // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
188 c, err := oracledatabase.NewClient(ctx)
189 if err != nil {
190 // TODO: Handle error.
191 }
192 defer c.Close()
193
194 req := &oracledatabasepb.DeleteCloudExadataInfrastructureRequest{
195 // TODO: Fill request struct fields.
196 // See https://pkg.go.dev/cloud.google.com/go/oracledatabase/apiv1/oracledatabasepb#DeleteCloudExadataInfrastructureRequest.
197 }
198 op, err := c.DeleteCloudExadataInfrastructure(ctx, req)
199 if err != nil {
200 // TODO: Handle error.
201 }
202
203 err = op.Wait(ctx)
204 if err != nil {
205 // TODO: Handle error.
206 }
207 }
208
209 func ExampleClient_DeleteCloudVmCluster() {
210 ctx := context.Background()
211 // This snippet has been automatically generated and should be regarded as a code template only.
212 // It will require modifications to work:
213 // - It may require correct/in-range values for request initialization.
214 // - It may require specifying regional endpoints when creating the service client as shown in:
215 // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
216 c, err := oracledatabase.NewClient(ctx)
217 if err != nil {
218 // TODO: Handle error.
219 }
220 defer c.Close()
221
222 req := &oracledatabasepb.DeleteCloudVmClusterRequest{
223 // TODO: Fill request struct fields.
224 // See https://pkg.go.dev/cloud.google.com/go/oracledatabase/apiv1/oracledatabasepb#DeleteCloudVmClusterRequest.
225 }
226 op, err := c.DeleteCloudVmCluster(ctx, req)
227 if err != nil {
228 // TODO: Handle error.
229 }
230
231 err = op.Wait(ctx)
232 if err != nil {
233 // TODO: Handle error.
234 }
235 }
236
237 func ExampleClient_GenerateAutonomousDatabaseWallet() {
238 ctx := context.Background()
239 // This snippet has been automatically generated and should be regarded as a code template only.
240 // It will require modifications to work:
241 // - It may require correct/in-range values for request initialization.
242 // - It may require specifying regional endpoints when creating the service client as shown in:
243 // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
244 c, err := oracledatabase.NewClient(ctx)
245 if err != nil {
246 // TODO: Handle error.
247 }
248 defer c.Close()
249
250 req := &oracledatabasepb.GenerateAutonomousDatabaseWalletRequest{
251 // TODO: Fill request struct fields.
252 // See https://pkg.go.dev/cloud.google.com/go/oracledatabase/apiv1/oracledatabasepb#GenerateAutonomousDatabaseWalletRequest.
253 }
254 resp, err := c.GenerateAutonomousDatabaseWallet(ctx, req)
255 if err != nil {
256 // TODO: Handle error.
257 }
258 // TODO: Use resp.
259 _ = resp
260 }
261
262 func ExampleClient_GetAutonomousDatabase() {
263 ctx := context.Background()
264 // This snippet has been automatically generated and should be regarded as a code template only.
265 // It will require modifications to work:
266 // - It may require correct/in-range values for request initialization.
267 // - It may require specifying regional endpoints when creating the service client as shown in:
268 // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
269 c, err := oracledatabase.NewClient(ctx)
270 if err != nil {
271 // TODO: Handle error.
272 }
273 defer c.Close()
274
275 req := &oracledatabasepb.GetAutonomousDatabaseRequest{
276 // TODO: Fill request struct fields.
277 // See https://pkg.go.dev/cloud.google.com/go/oracledatabase/apiv1/oracledatabasepb#GetAutonomousDatabaseRequest.
278 }
279 resp, err := c.GetAutonomousDatabase(ctx, req)
280 if err != nil {
281 // TODO: Handle error.
282 }
283 // TODO: Use resp.
284 _ = resp
285 }
286
287 func ExampleClient_GetCloudExadataInfrastructure() {
288 ctx := context.Background()
289 // This snippet has been automatically generated and should be regarded as a code template only.
290 // It will require modifications to work:
291 // - It may require correct/in-range values for request initialization.
292 // - It may require specifying regional endpoints when creating the service client as shown in:
293 // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
294 c, err := oracledatabase.NewClient(ctx)
295 if err != nil {
296 // TODO: Handle error.
297 }
298 defer c.Close()
299
300 req := &oracledatabasepb.GetCloudExadataInfrastructureRequest{
301 // TODO: Fill request struct fields.
302 // See https://pkg.go.dev/cloud.google.com/go/oracledatabase/apiv1/oracledatabasepb#GetCloudExadataInfrastructureRequest.
303 }
304 resp, err := c.GetCloudExadataInfrastructure(ctx, req)
305 if err != nil {
306 // TODO: Handle error.
307 }
308 // TODO: Use resp.
309 _ = resp
310 }
311
312 func ExampleClient_GetCloudVmCluster() {
313 ctx := context.Background()
314 // This snippet has been automatically generated and should be regarded as a code template only.
315 // It will require modifications to work:
316 // - It may require correct/in-range values for request initialization.
317 // - It may require specifying regional endpoints when creating the service client as shown in:
318 // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
319 c, err := oracledatabase.NewClient(ctx)
320 if err != nil {
321 // TODO: Handle error.
322 }
323 defer c.Close()
324
325 req := &oracledatabasepb.GetCloudVmClusterRequest{
326 // TODO: Fill request struct fields.
327 // See https://pkg.go.dev/cloud.google.com/go/oracledatabase/apiv1/oracledatabasepb#GetCloudVmClusterRequest.
328 }
329 resp, err := c.GetCloudVmCluster(ctx, req)
330 if err != nil {
331 // TODO: Handle error.
332 }
333 // TODO: Use resp.
334 _ = resp
335 }
336
337 func ExampleClient_ListAutonomousDatabaseBackups() {
338 ctx := context.Background()
339 // This snippet has been automatically generated and should be regarded as a code template only.
340 // It will require modifications to work:
341 // - It may require correct/in-range values for request initialization.
342 // - It may require specifying regional endpoints when creating the service client as shown in:
343 // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
344 c, err := oracledatabase.NewClient(ctx)
345 if err != nil {
346 // TODO: Handle error.
347 }
348 defer c.Close()
349
350 req := &oracledatabasepb.ListAutonomousDatabaseBackupsRequest{
351 // TODO: Fill request struct fields.
352 // See https://pkg.go.dev/cloud.google.com/go/oracledatabase/apiv1/oracledatabasepb#ListAutonomousDatabaseBackupsRequest.
353 }
354 it := c.ListAutonomousDatabaseBackups(ctx, req)
355 for {
356 resp, err := it.Next()
357 if err == iterator.Done {
358 break
359 }
360 if err != nil {
361 // TODO: Handle error.
362 }
363 // TODO: Use resp.
364 _ = resp
365
366 // If you need to access the underlying RPC response,
367 // you can do so by casting the `Response` as below.
368 // Otherwise, remove this line. Only populated after
369 // first call to Next(). Not safe for concurrent access.
370 _ = it.Response.(*oracledatabasepb.ListAutonomousDatabaseBackupsResponse)
371 }
372 }
373
374 func ExampleClient_ListAutonomousDatabaseCharacterSets() {
375 ctx := context.Background()
376 // This snippet has been automatically generated and should be regarded as a code template only.
377 // It will require modifications to work:
378 // - It may require correct/in-range values for request initialization.
379 // - It may require specifying regional endpoints when creating the service client as shown in:
380 // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
381 c, err := oracledatabase.NewClient(ctx)
382 if err != nil {
383 // TODO: Handle error.
384 }
385 defer c.Close()
386
387 req := &oracledatabasepb.ListAutonomousDatabaseCharacterSetsRequest{
388 // TODO: Fill request struct fields.
389 // See https://pkg.go.dev/cloud.google.com/go/oracledatabase/apiv1/oracledatabasepb#ListAutonomousDatabaseCharacterSetsRequest.
390 }
391 it := c.ListAutonomousDatabaseCharacterSets(ctx, req)
392 for {
393 resp, err := it.Next()
394 if err == iterator.Done {
395 break
396 }
397 if err != nil {
398 // TODO: Handle error.
399 }
400 // TODO: Use resp.
401 _ = resp
402
403 // If you need to access the underlying RPC response,
404 // you can do so by casting the `Response` as below.
405 // Otherwise, remove this line. Only populated after
406 // first call to Next(). Not safe for concurrent access.
407 _ = it.Response.(*oracledatabasepb.ListAutonomousDatabaseCharacterSetsResponse)
408 }
409 }
410
411 func ExampleClient_ListAutonomousDatabases() {
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 := oracledatabase.NewClient(ctx)
419 if err != nil {
420 // TODO: Handle error.
421 }
422 defer c.Close()
423
424 req := &oracledatabasepb.ListAutonomousDatabasesRequest{
425 // TODO: Fill request struct fields.
426 // See https://pkg.go.dev/cloud.google.com/go/oracledatabase/apiv1/oracledatabasepb#ListAutonomousDatabasesRequest.
427 }
428 it := c.ListAutonomousDatabases(ctx, req)
429 for {
430 resp, err := it.Next()
431 if err == iterator.Done {
432 break
433 }
434 if err != nil {
435 // TODO: Handle error.
436 }
437 // TODO: Use resp.
438 _ = resp
439
440 // If you need to access the underlying RPC response,
441 // you can do so by casting the `Response` as below.
442 // Otherwise, remove this line. Only populated after
443 // first call to Next(). Not safe for concurrent access.
444 _ = it.Response.(*oracledatabasepb.ListAutonomousDatabasesResponse)
445 }
446 }
447
448 func ExampleClient_ListAutonomousDbVersions() {
449 ctx := context.Background()
450 // This snippet has been automatically generated and should be regarded as a code template only.
451 // It will require modifications to work:
452 // - It may require correct/in-range values for request initialization.
453 // - It may require specifying regional endpoints when creating the service client as shown in:
454 // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
455 c, err := oracledatabase.NewClient(ctx)
456 if err != nil {
457 // TODO: Handle error.
458 }
459 defer c.Close()
460
461 req := &oracledatabasepb.ListAutonomousDbVersionsRequest{
462 // TODO: Fill request struct fields.
463 // See https://pkg.go.dev/cloud.google.com/go/oracledatabase/apiv1/oracledatabasepb#ListAutonomousDbVersionsRequest.
464 }
465 it := c.ListAutonomousDbVersions(ctx, req)
466 for {
467 resp, err := it.Next()
468 if err == iterator.Done {
469 break
470 }
471 if err != nil {
472 // TODO: Handle error.
473 }
474 // TODO: Use resp.
475 _ = resp
476
477 // If you need to access the underlying RPC response,
478 // you can do so by casting the `Response` as below.
479 // Otherwise, remove this line. Only populated after
480 // first call to Next(). Not safe for concurrent access.
481 _ = it.Response.(*oracledatabasepb.ListAutonomousDbVersionsResponse)
482 }
483 }
484
485 func ExampleClient_ListCloudExadataInfrastructures() {
486 ctx := context.Background()
487 // This snippet has been automatically generated and should be regarded as a code template only.
488 // It will require modifications to work:
489 // - It may require correct/in-range values for request initialization.
490 // - It may require specifying regional endpoints when creating the service client as shown in:
491 // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
492 c, err := oracledatabase.NewClient(ctx)
493 if err != nil {
494 // TODO: Handle error.
495 }
496 defer c.Close()
497
498 req := &oracledatabasepb.ListCloudExadataInfrastructuresRequest{
499 // TODO: Fill request struct fields.
500 // See https://pkg.go.dev/cloud.google.com/go/oracledatabase/apiv1/oracledatabasepb#ListCloudExadataInfrastructuresRequest.
501 }
502 it := c.ListCloudExadataInfrastructures(ctx, req)
503 for {
504 resp, err := it.Next()
505 if err == iterator.Done {
506 break
507 }
508 if err != nil {
509 // TODO: Handle error.
510 }
511 // TODO: Use resp.
512 _ = resp
513
514 // If you need to access the underlying RPC response,
515 // you can do so by casting the `Response` as below.
516 // Otherwise, remove this line. Only populated after
517 // first call to Next(). Not safe for concurrent access.
518 _ = it.Response.(*oracledatabasepb.ListCloudExadataInfrastructuresResponse)
519 }
520 }
521
522 func ExampleClient_ListCloudVmClusters() {
523 ctx := context.Background()
524 // This snippet has been automatically generated and should be regarded as a code template only.
525 // It will require modifications to work:
526 // - It may require correct/in-range values for request initialization.
527 // - It may require specifying regional endpoints when creating the service client as shown in:
528 // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
529 c, err := oracledatabase.NewClient(ctx)
530 if err != nil {
531 // TODO: Handle error.
532 }
533 defer c.Close()
534
535 req := &oracledatabasepb.ListCloudVmClustersRequest{
536 // TODO: Fill request struct fields.
537 // See https://pkg.go.dev/cloud.google.com/go/oracledatabase/apiv1/oracledatabasepb#ListCloudVmClustersRequest.
538 }
539 it := c.ListCloudVmClusters(ctx, req)
540 for {
541 resp, err := it.Next()
542 if err == iterator.Done {
543 break
544 }
545 if err != nil {
546 // TODO: Handle error.
547 }
548 // TODO: Use resp.
549 _ = resp
550
551 // If you need to access the underlying RPC response,
552 // you can do so by casting the `Response` as below.
553 // Otherwise, remove this line. Only populated after
554 // first call to Next(). Not safe for concurrent access.
555 _ = it.Response.(*oracledatabasepb.ListCloudVmClustersResponse)
556 }
557 }
558
559 func ExampleClient_ListDbNodes() {
560 ctx := context.Background()
561 // This snippet has been automatically generated and should be regarded as a code template only.
562 // It will require modifications to work:
563 // - It may require correct/in-range values for request initialization.
564 // - It may require specifying regional endpoints when creating the service client as shown in:
565 // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
566 c, err := oracledatabase.NewClient(ctx)
567 if err != nil {
568 // TODO: Handle error.
569 }
570 defer c.Close()
571
572 req := &oracledatabasepb.ListDbNodesRequest{
573 // TODO: Fill request struct fields.
574 // See https://pkg.go.dev/cloud.google.com/go/oracledatabase/apiv1/oracledatabasepb#ListDbNodesRequest.
575 }
576 it := c.ListDbNodes(ctx, req)
577 for {
578 resp, err := it.Next()
579 if err == iterator.Done {
580 break
581 }
582 if err != nil {
583 // TODO: Handle error.
584 }
585 // TODO: Use resp.
586 _ = resp
587
588 // If you need to access the underlying RPC response,
589 // you can do so by casting the `Response` as below.
590 // Otherwise, remove this line. Only populated after
591 // first call to Next(). Not safe for concurrent access.
592 _ = it.Response.(*oracledatabasepb.ListDbNodesResponse)
593 }
594 }
595
596 func ExampleClient_ListDbServers() {
597 ctx := context.Background()
598 // This snippet has been automatically generated and should be regarded as a code template only.
599 // It will require modifications to work:
600 // - It may require correct/in-range values for request initialization.
601 // - It may require specifying regional endpoints when creating the service client as shown in:
602 // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
603 c, err := oracledatabase.NewClient(ctx)
604 if err != nil {
605 // TODO: Handle error.
606 }
607 defer c.Close()
608
609 req := &oracledatabasepb.ListDbServersRequest{
610 // TODO: Fill request struct fields.
611 // See https://pkg.go.dev/cloud.google.com/go/oracledatabase/apiv1/oracledatabasepb#ListDbServersRequest.
612 }
613 it := c.ListDbServers(ctx, req)
614 for {
615 resp, err := it.Next()
616 if err == iterator.Done {
617 break
618 }
619 if err != nil {
620 // TODO: Handle error.
621 }
622 // TODO: Use resp.
623 _ = resp
624
625 // If you need to access the underlying RPC response,
626 // you can do so by casting the `Response` as below.
627 // Otherwise, remove this line. Only populated after
628 // first call to Next(). Not safe for concurrent access.
629 _ = it.Response.(*oracledatabasepb.ListDbServersResponse)
630 }
631 }
632
633 func ExampleClient_ListDbSystemShapes() {
634 ctx := context.Background()
635 // This snippet has been automatically generated and should be regarded as a code template only.
636 // It will require modifications to work:
637 // - It may require correct/in-range values for request initialization.
638 // - It may require specifying regional endpoints when creating the service client as shown in:
639 // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
640 c, err := oracledatabase.NewClient(ctx)
641 if err != nil {
642 // TODO: Handle error.
643 }
644 defer c.Close()
645
646 req := &oracledatabasepb.ListDbSystemShapesRequest{
647 // TODO: Fill request struct fields.
648 // See https://pkg.go.dev/cloud.google.com/go/oracledatabase/apiv1/oracledatabasepb#ListDbSystemShapesRequest.
649 }
650 it := c.ListDbSystemShapes(ctx, req)
651 for {
652 resp, err := it.Next()
653 if err == iterator.Done {
654 break
655 }
656 if err != nil {
657 // TODO: Handle error.
658 }
659 // TODO: Use resp.
660 _ = resp
661
662 // If you need to access the underlying RPC response,
663 // you can do so by casting the `Response` as below.
664 // Otherwise, remove this line. Only populated after
665 // first call to Next(). Not safe for concurrent access.
666 _ = it.Response.(*oracledatabasepb.ListDbSystemShapesResponse)
667 }
668 }
669
670 func ExampleClient_ListEntitlements() {
671 ctx := context.Background()
672 // This snippet has been automatically generated and should be regarded as a code template only.
673 // It will require modifications to work:
674 // - It may require correct/in-range values for request initialization.
675 // - It may require specifying regional endpoints when creating the service client as shown in:
676 // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
677 c, err := oracledatabase.NewClient(ctx)
678 if err != nil {
679 // TODO: Handle error.
680 }
681 defer c.Close()
682
683 req := &oracledatabasepb.ListEntitlementsRequest{
684 // TODO: Fill request struct fields.
685 // See https://pkg.go.dev/cloud.google.com/go/oracledatabase/apiv1/oracledatabasepb#ListEntitlementsRequest.
686 }
687 it := c.ListEntitlements(ctx, req)
688 for {
689 resp, err := it.Next()
690 if err == iterator.Done {
691 break
692 }
693 if err != nil {
694 // TODO: Handle error.
695 }
696 // TODO: Use resp.
697 _ = resp
698
699 // If you need to access the underlying RPC response,
700 // you can do so by casting the `Response` as below.
701 // Otherwise, remove this line. Only populated after
702 // first call to Next(). Not safe for concurrent access.
703 _ = it.Response.(*oracledatabasepb.ListEntitlementsResponse)
704 }
705 }
706
707 func ExampleClient_ListGiVersions() {
708 ctx := context.Background()
709 // This snippet has been automatically generated and should be regarded as a code template only.
710 // It will require modifications to work:
711 // - It may require correct/in-range values for request initialization.
712 // - It may require specifying regional endpoints when creating the service client as shown in:
713 // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
714 c, err := oracledatabase.NewClient(ctx)
715 if err != nil {
716 // TODO: Handle error.
717 }
718 defer c.Close()
719
720 req := &oracledatabasepb.ListGiVersionsRequest{
721 // TODO: Fill request struct fields.
722 // See https://pkg.go.dev/cloud.google.com/go/oracledatabase/apiv1/oracledatabasepb#ListGiVersionsRequest.
723 }
724 it := c.ListGiVersions(ctx, req)
725 for {
726 resp, err := it.Next()
727 if err == iterator.Done {
728 break
729 }
730 if err != nil {
731 // TODO: Handle error.
732 }
733 // TODO: Use resp.
734 _ = resp
735
736 // If you need to access the underlying RPC response,
737 // you can do so by casting the `Response` as below.
738 // Otherwise, remove this line. Only populated after
739 // first call to Next(). Not safe for concurrent access.
740 _ = it.Response.(*oracledatabasepb.ListGiVersionsResponse)
741 }
742 }
743
744 func ExampleClient_RestartAutonomousDatabase() {
745 ctx := context.Background()
746 // This snippet has been automatically generated and should be regarded as a code template only.
747 // It will require modifications to work:
748 // - It may require correct/in-range values for request initialization.
749 // - It may require specifying regional endpoints when creating the service client as shown in:
750 // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
751 c, err := oracledatabase.NewClient(ctx)
752 if err != nil {
753 // TODO: Handle error.
754 }
755 defer c.Close()
756
757 req := &oracledatabasepb.RestartAutonomousDatabaseRequest{
758 // TODO: Fill request struct fields.
759 // See https://pkg.go.dev/cloud.google.com/go/oracledatabase/apiv1/oracledatabasepb#RestartAutonomousDatabaseRequest.
760 }
761 op, err := c.RestartAutonomousDatabase(ctx, req)
762 if err != nil {
763 // TODO: Handle error.
764 }
765
766 resp, err := op.Wait(ctx)
767 if err != nil {
768 // TODO: Handle error.
769 }
770 // TODO: Use resp.
771 _ = resp
772 }
773
774 func ExampleClient_RestoreAutonomousDatabase() {
775 ctx := context.Background()
776 // This snippet has been automatically generated and should be regarded as a code template only.
777 // It will require modifications to work:
778 // - It may require correct/in-range values for request initialization.
779 // - It may require specifying regional endpoints when creating the service client as shown in:
780 // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
781 c, err := oracledatabase.NewClient(ctx)
782 if err != nil {
783 // TODO: Handle error.
784 }
785 defer c.Close()
786
787 req := &oracledatabasepb.RestoreAutonomousDatabaseRequest{
788 // TODO: Fill request struct fields.
789 // See https://pkg.go.dev/cloud.google.com/go/oracledatabase/apiv1/oracledatabasepb#RestoreAutonomousDatabaseRequest.
790 }
791 op, err := c.RestoreAutonomousDatabase(ctx, req)
792 if err != nil {
793 // TODO: Handle error.
794 }
795
796 resp, err := op.Wait(ctx)
797 if err != nil {
798 // TODO: Handle error.
799 }
800 // TODO: Use resp.
801 _ = resp
802 }
803
804 func ExampleClient_StartAutonomousDatabase() {
805 ctx := context.Background()
806 // This snippet has been automatically generated and should be regarded as a code template only.
807 // It will require modifications to work:
808 // - It may require correct/in-range values for request initialization.
809 // - It may require specifying regional endpoints when creating the service client as shown in:
810 // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
811 c, err := oracledatabase.NewClient(ctx)
812 if err != nil {
813 // TODO: Handle error.
814 }
815 defer c.Close()
816
817 req := &oracledatabasepb.StartAutonomousDatabaseRequest{
818 // TODO: Fill request struct fields.
819 // See https://pkg.go.dev/cloud.google.com/go/oracledatabase/apiv1/oracledatabasepb#StartAutonomousDatabaseRequest.
820 }
821 op, err := c.StartAutonomousDatabase(ctx, req)
822 if err != nil {
823 // TODO: Handle error.
824 }
825
826 resp, err := op.Wait(ctx)
827 if err != nil {
828 // TODO: Handle error.
829 }
830 // TODO: Use resp.
831 _ = resp
832 }
833
834 func ExampleClient_StopAutonomousDatabase() {
835 ctx := context.Background()
836 // This snippet has been automatically generated and should be regarded as a code template only.
837 // It will require modifications to work:
838 // - It may require correct/in-range values for request initialization.
839 // - It may require specifying regional endpoints when creating the service client as shown in:
840 // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
841 c, err := oracledatabase.NewClient(ctx)
842 if err != nil {
843 // TODO: Handle error.
844 }
845 defer c.Close()
846
847 req := &oracledatabasepb.StopAutonomousDatabaseRequest{
848 // TODO: Fill request struct fields.
849 // See https://pkg.go.dev/cloud.google.com/go/oracledatabase/apiv1/oracledatabasepb#StopAutonomousDatabaseRequest.
850 }
851 op, err := c.StopAutonomousDatabase(ctx, req)
852 if err != nil {
853 // TODO: Handle error.
854 }
855
856 resp, err := op.Wait(ctx)
857 if err != nil {
858 // TODO: Handle error.
859 }
860 // TODO: Use resp.
861 _ = resp
862 }
863
864 func ExampleClient_GetLocation() {
865 ctx := context.Background()
866 // This snippet has been automatically generated and should be regarded as a code template only.
867 // It will require modifications to work:
868 // - It may require correct/in-range values for request initialization.
869 // - It may require specifying regional endpoints when creating the service client as shown in:
870 // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
871 c, err := oracledatabase.NewClient(ctx)
872 if err != nil {
873 // TODO: Handle error.
874 }
875 defer c.Close()
876
877 req := &locationpb.GetLocationRequest{
878 // TODO: Fill request struct fields.
879 // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/location#GetLocationRequest.
880 }
881 resp, err := c.GetLocation(ctx, req)
882 if err != nil {
883 // TODO: Handle error.
884 }
885 // TODO: Use resp.
886 _ = resp
887 }
888
889 func ExampleClient_ListLocations() {
890 ctx := context.Background()
891 // This snippet has been automatically generated and should be regarded as a code template only.
892 // It will require modifications to work:
893 // - It may require correct/in-range values for request initialization.
894 // - It may require specifying regional endpoints when creating the service client as shown in:
895 // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
896 c, err := oracledatabase.NewClient(ctx)
897 if err != nil {
898 // TODO: Handle error.
899 }
900 defer c.Close()
901
902 req := &locationpb.ListLocationsRequest{
903 // TODO: Fill request struct fields.
904 // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/location#ListLocationsRequest.
905 }
906 it := c.ListLocations(ctx, req)
907 for {
908 resp, err := it.Next()
909 if err == iterator.Done {
910 break
911 }
912 if err != nil {
913 // TODO: Handle error.
914 }
915 // TODO: Use resp.
916 _ = resp
917
918 // If you need to access the underlying RPC response,
919 // you can do so by casting the `Response` as below.
920 // Otherwise, remove this line. Only populated after
921 // first call to Next(). Not safe for concurrent access.
922 _ = it.Response.(*locationpb.ListLocationsResponse)
923 }
924 }
925
926 func ExampleClient_CancelOperation() {
927 ctx := context.Background()
928 // This snippet has been automatically generated and should be regarded as a code template only.
929 // It will require modifications to work:
930 // - It may require correct/in-range values for request initialization.
931 // - It may require specifying regional endpoints when creating the service client as shown in:
932 // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
933 c, err := oracledatabase.NewClient(ctx)
934 if err != nil {
935 // TODO: Handle error.
936 }
937 defer c.Close()
938
939 req := &longrunningpb.CancelOperationRequest{
940 // TODO: Fill request struct fields.
941 // See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#CancelOperationRequest.
942 }
943 err = c.CancelOperation(ctx, req)
944 if err != nil {
945 // TODO: Handle error.
946 }
947 }
948
949 func ExampleClient_DeleteOperation() {
950 ctx := context.Background()
951 // This snippet has been automatically generated and should be regarded as a code template only.
952 // It will require modifications to work:
953 // - It may require correct/in-range values for request initialization.
954 // - It may require specifying regional endpoints when creating the service client as shown in:
955 // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
956 c, err := oracledatabase.NewClient(ctx)
957 if err != nil {
958 // TODO: Handle error.
959 }
960 defer c.Close()
961
962 req := &longrunningpb.DeleteOperationRequest{
963 // TODO: Fill request struct fields.
964 // See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#DeleteOperationRequest.
965 }
966 err = c.DeleteOperation(ctx, req)
967 if err != nil {
968 // TODO: Handle error.
969 }
970 }
971
972 func ExampleClient_GetOperation() {
973 ctx := context.Background()
974 // This snippet has been automatically generated and should be regarded as a code template only.
975 // It will require modifications to work:
976 // - It may require correct/in-range values for request initialization.
977 // - It may require specifying regional endpoints when creating the service client as shown in:
978 // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
979 c, err := oracledatabase.NewClient(ctx)
980 if err != nil {
981 // TODO: Handle error.
982 }
983 defer c.Close()
984
985 req := &longrunningpb.GetOperationRequest{
986 // TODO: Fill request struct fields.
987 // See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#GetOperationRequest.
988 }
989 resp, err := c.GetOperation(ctx, req)
990 if err != nil {
991 // TODO: Handle error.
992 }
993 // TODO: Use resp.
994 _ = resp
995 }
996
997 func ExampleClient_ListOperations() {
998 ctx := context.Background()
999 // This snippet has been automatically generated and should be regarded as a code template only.
1000 // It will require modifications to work:
1001 // - It may require correct/in-range values for request initialization.
1002 // - It may require specifying regional endpoints when creating the service client as shown in:
1003 // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
1004 c, err := oracledatabase.NewClient(ctx)
1005 if err != nil {
1006 // TODO: Handle error.
1007 }
1008 defer c.Close()
1009
1010 req := &longrunningpb.ListOperationsRequest{
1011 // TODO: Fill request struct fields.
1012 // See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#ListOperationsRequest.
1013 }
1014 it := c.ListOperations(ctx, req)
1015 for {
1016 resp, err := it.Next()
1017 if err == iterator.Done {
1018 break
1019 }
1020 if err != nil {
1021 // TODO: Handle error.
1022 }
1023 // TODO: Use resp.
1024 _ = resp
1025
1026 // If you need to access the underlying RPC response,
1027 // you can do so by casting the `Response` as below.
1028 // Otherwise, remove this line. Only populated after
1029 // first call to Next(). Not safe for concurrent access.
1030 _ = it.Response.(*longrunningpb.ListOperationsResponse)
1031 }
1032 }