Debian Codegraph @

datacatalog/apiv1beta1/data_catalog_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 datacatalog_test
18
19 import (
20 "context"
21
22 datacatalog "cloud.google.com/go/datacatalog/apiv1beta1"
23 datacatalogpb "cloud.google.com/go/datacatalog/apiv1beta1/datacatalogpb"
24 iampb "cloud.google.com/go/iam/apiv1/iampb"
25 "google.golang.org/api/iterator"
26 )
27
28 func ExampleNewClient() {
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 := datacatalog.NewClient(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 ExampleNewRESTClient() {
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 := datacatalog.NewRESTClient(ctx)
53 if err != nil {
54 // TODO: Handle error.
55 }
56 defer c.Close()
57
58 // TODO: Use client.
59 _ = c
60 }
61
62 func ExampleClient_CreateEntry() {
63 ctx := context.Background()
64 // This snippet has been automatically generated and should be regarded as a code template only.
65 // It will require modifications to work:
66 // - It may require correct/in-range values for request initialization.
67 // - It may require specifying regional endpoints when creating the service client as shown in:
68 // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
69 c, err := datacatalog.NewClient(ctx)
70 if err != nil {
71 // TODO: Handle error.
72 }
73 defer c.Close()
74
75 req := &datacatalogpb.CreateEntryRequest{
76 // TODO: Fill request struct fields.
77 // See https://pkg.go.dev/cloud.google.com/go/datacatalog/apiv1beta1/datacatalogpb#CreateEntryRequest.
78 }
79 resp, err := c.CreateEntry(ctx, req)
80 if err != nil {
81 // TODO: Handle error.
82 }
83 // TODO: Use resp.
84 _ = resp
85 }
86
87 func ExampleClient_CreateEntryGroup() {
88 ctx := context.Background()
89 // This snippet has been automatically generated and should be regarded as a code template only.
90 // It will require modifications to work:
91 // - It may require correct/in-range values for request initialization.
92 // - It may require specifying regional endpoints when creating the service client as shown in:
93 // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
94 c, err := datacatalog.NewClient(ctx)
95 if err != nil {
96 // TODO: Handle error.
97 }
98 defer c.Close()
99
100 req := &datacatalogpb.CreateEntryGroupRequest{
101 // TODO: Fill request struct fields.
102 // See https://pkg.go.dev/cloud.google.com/go/datacatalog/apiv1beta1/datacatalogpb#CreateEntryGroupRequest.
103 }
104 resp, err := c.CreateEntryGroup(ctx, req)
105 if err != nil {
106 // TODO: Handle error.
107 }
108 // TODO: Use resp.
109 _ = resp
110 }
111
112 func ExampleClient_CreateTag() {
113 ctx := context.Background()
114 // This snippet has been automatically generated and should be regarded as a code template only.
115 // It will require modifications to work:
116 // - It may require correct/in-range values for request initialization.
117 // - It may require specifying regional endpoints when creating the service client as shown in:
118 // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
119 c, err := datacatalog.NewClient(ctx)
120 if err != nil {
121 // TODO: Handle error.
122 }
123 defer c.Close()
124
125 req := &datacatalogpb.CreateTagRequest{
126 // TODO: Fill request struct fields.
127 // See https://pkg.go.dev/cloud.google.com/go/datacatalog/apiv1beta1/datacatalogpb#CreateTagRequest.
128 }
129 resp, err := c.CreateTag(ctx, req)
130 if err != nil {
131 // TODO: Handle error.
132 }
133 // TODO: Use resp.
134 _ = resp
135 }
136
137 func ExampleClient_CreateTagTemplate() {
138 ctx := context.Background()
139 // This snippet has been automatically generated and should be regarded as a code template only.
140 // It will require modifications to work:
141 // - It may require correct/in-range values for request initialization.
142 // - It may require specifying regional endpoints when creating the service client as shown in:
143 // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
144 c, err := datacatalog.NewClient(ctx)
145 if err != nil {
146 // TODO: Handle error.
147 }
148 defer c.Close()
149
150 req := &datacatalogpb.CreateTagTemplateRequest{
151 // TODO: Fill request struct fields.
152 // See https://pkg.go.dev/cloud.google.com/go/datacatalog/apiv1beta1/datacatalogpb#CreateTagTemplateRequest.
153 }
154 resp, err := c.CreateTagTemplate(ctx, req)
155 if err != nil {
156 // TODO: Handle error.
157 }
158 // TODO: Use resp.
159 _ = resp
160 }
161
162 func ExampleClient_CreateTagTemplateField() {
163 ctx := context.Background()
164 // This snippet has been automatically generated and should be regarded as a code template only.
165 // It will require modifications to work:
166 // - It may require correct/in-range values for request initialization.
167 // - It may require specifying regional endpoints when creating the service client as shown in:
168 // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
169 c, err := datacatalog.NewClient(ctx)
170 if err != nil {
171 // TODO: Handle error.
172 }
173 defer c.Close()
174
175 req := &datacatalogpb.CreateTagTemplateFieldRequest{
176 // TODO: Fill request struct fields.
177 // See https://pkg.go.dev/cloud.google.com/go/datacatalog/apiv1beta1/datacatalogpb#CreateTagTemplateFieldRequest.
178 }
179 resp, err := c.CreateTagTemplateField(ctx, req)
180 if err != nil {
181 // TODO: Handle error.
182 }
183 // TODO: Use resp.
184 _ = resp
185 }
186
187 func ExampleClient_DeleteEntry() {
188 ctx := context.Background()
189 // This snippet has been automatically generated and should be regarded as a code template only.
190 // It will require modifications to work:
191 // - It may require correct/in-range values for request initialization.
192 // - It may require specifying regional endpoints when creating the service client as shown in:
193 // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
194 c, err := datacatalog.NewClient(ctx)
195 if err != nil {
196 // TODO: Handle error.
197 }
198 defer c.Close()
199
200 req := &datacatalogpb.DeleteEntryRequest{
201 // TODO: Fill request struct fields.
202 // See https://pkg.go.dev/cloud.google.com/go/datacatalog/apiv1beta1/datacatalogpb#DeleteEntryRequest.
203 }
204 err = c.DeleteEntry(ctx, req)
205 if err != nil {
206 // TODO: Handle error.
207 }
208 }
209
210 func ExampleClient_DeleteEntryGroup() {
211 ctx := context.Background()
212 // This snippet has been automatically generated and should be regarded as a code template only.
213 // It will require modifications to work:
214 // - It may require correct/in-range values for request initialization.
215 // - It may require specifying regional endpoints when creating the service client as shown in:
216 // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
217 c, err := datacatalog.NewClient(ctx)
218 if err != nil {
219 // TODO: Handle error.
220 }
221 defer c.Close()
222
223 req := &datacatalogpb.DeleteEntryGroupRequest{
224 // TODO: Fill request struct fields.
225 // See https://pkg.go.dev/cloud.google.com/go/datacatalog/apiv1beta1/datacatalogpb#DeleteEntryGroupRequest.
226 }
227 err = c.DeleteEntryGroup(ctx, req)
228 if err != nil {
229 // TODO: Handle error.
230 }
231 }
232
233 func ExampleClient_DeleteTag() {
234 ctx := context.Background()
235 // This snippet has been automatically generated and should be regarded as a code template only.
236 // It will require modifications to work:
237 // - It may require correct/in-range values for request initialization.
238 // - It may require specifying regional endpoints when creating the service client as shown in:
239 // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
240 c, err := datacatalog.NewClient(ctx)
241 if err != nil {
242 // TODO: Handle error.
243 }
244 defer c.Close()
245
246 req := &datacatalogpb.DeleteTagRequest{
247 // TODO: Fill request struct fields.
248 // See https://pkg.go.dev/cloud.google.com/go/datacatalog/apiv1beta1/datacatalogpb#DeleteTagRequest.
249 }
250 err = c.DeleteTag(ctx, req)
251 if err != nil {
252 // TODO: Handle error.
253 }
254 }
255
256 func ExampleClient_DeleteTagTemplate() {
257 ctx := context.Background()
258 // This snippet has been automatically generated and should be regarded as a code template only.
259 // It will require modifications to work:
260 // - It may require correct/in-range values for request initialization.
261 // - It may require specifying regional endpoints when creating the service client as shown in:
262 // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
263 c, err := datacatalog.NewClient(ctx)
264 if err != nil {
265 // TODO: Handle error.
266 }
267 defer c.Close()
268
269 req := &datacatalogpb.DeleteTagTemplateRequest{
270 // TODO: Fill request struct fields.
271 // See https://pkg.go.dev/cloud.google.com/go/datacatalog/apiv1beta1/datacatalogpb#DeleteTagTemplateRequest.
272 }
273 err = c.DeleteTagTemplate(ctx, req)
274 if err != nil {
275 // TODO: Handle error.
276 }
277 }
278
279 func ExampleClient_DeleteTagTemplateField() {
280 ctx := context.Background()
281 // This snippet has been automatically generated and should be regarded as a code template only.
282 // It will require modifications to work:
283 // - It may require correct/in-range values for request initialization.
284 // - It may require specifying regional endpoints when creating the service client as shown in:
285 // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
286 c, err := datacatalog.NewClient(ctx)
287 if err != nil {
288 // TODO: Handle error.
289 }
290 defer c.Close()
291
292 req := &datacatalogpb.DeleteTagTemplateFieldRequest{
293 // TODO: Fill request struct fields.
294 // See https://pkg.go.dev/cloud.google.com/go/datacatalog/apiv1beta1/datacatalogpb#DeleteTagTemplateFieldRequest.
295 }
296 err = c.DeleteTagTemplateField(ctx, req)
297 if err != nil {
298 // TODO: Handle error.
299 }
300 }
301
302 func ExampleClient_GetEntry() {
303 ctx := context.Background()
304 // This snippet has been automatically generated and should be regarded as a code template only.
305 // It will require modifications to work:
306 // - It may require correct/in-range values for request initialization.
307 // - It may require specifying regional endpoints when creating the service client as shown in:
308 // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
309 c, err := datacatalog.NewClient(ctx)
310 if err != nil {
311 // TODO: Handle error.
312 }
313 defer c.Close()
314
315 req := &datacatalogpb.GetEntryRequest{
316 // TODO: Fill request struct fields.
317 // See https://pkg.go.dev/cloud.google.com/go/datacatalog/apiv1beta1/datacatalogpb#GetEntryRequest.
318 }
319 resp, err := c.GetEntry(ctx, req)
320 if err != nil {
321 // TODO: Handle error.
322 }
323 // TODO: Use resp.
324 _ = resp
325 }
326
327 func ExampleClient_GetEntryGroup() {
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 := datacatalog.NewClient(ctx)
335 if err != nil {
336 // TODO: Handle error.
337 }
338 defer c.Close()
339
340 req := &datacatalogpb.GetEntryGroupRequest{
341 // TODO: Fill request struct fields.
342 // See https://pkg.go.dev/cloud.google.com/go/datacatalog/apiv1beta1/datacatalogpb#GetEntryGroupRequest.
343 }
344 resp, err := c.GetEntryGroup(ctx, req)
345 if err != nil {
346 // TODO: Handle error.
347 }
348 // TODO: Use resp.
349 _ = resp
350 }
351
352 func ExampleClient_GetIamPolicy() {
353 ctx := context.Background()
354 // This snippet has been automatically generated and should be regarded as a code template only.
355 // It will require modifications to work:
356 // - It may require correct/in-range values for request initialization.
357 // - It may require specifying regional endpoints when creating the service client as shown in:
358 // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
359 c, err := datacatalog.NewClient(ctx)
360 if err != nil {
361 // TODO: Handle error.
362 }
363 defer c.Close()
364
365 req := &iampb.GetIamPolicyRequest{
366 // TODO: Fill request struct fields.
367 // See https://pkg.go.dev/cloud.google.com/go/iam/apiv1/iampb#GetIamPolicyRequest.
368 }
369 resp, err := c.GetIamPolicy(ctx, req)
370 if err != nil {
371 // TODO: Handle error.
372 }
373 // TODO: Use resp.
374 _ = resp
375 }
376
377 func ExampleClient_GetTagTemplate() {
378 ctx := context.Background()
379 // This snippet has been automatically generated and should be regarded as a code template only.
380 // It will require modifications to work:
381 // - It may require correct/in-range values for request initialization.
382 // - It may require specifying regional endpoints when creating the service client as shown in:
383 // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
384 c, err := datacatalog.NewClient(ctx)
385 if err != nil {
386 // TODO: Handle error.
387 }
388 defer c.Close()
389
390 req := &datacatalogpb.GetTagTemplateRequest{
391 // TODO: Fill request struct fields.
392 // See https://pkg.go.dev/cloud.google.com/go/datacatalog/apiv1beta1/datacatalogpb#GetTagTemplateRequest.
393 }
394 resp, err := c.GetTagTemplate(ctx, req)
395 if err != nil {
396 // TODO: Handle error.
397 }
398 // TODO: Use resp.
399 _ = resp
400 }
401
402 func ExampleClient_ListEntries() {
403 ctx := context.Background()
404 // This snippet has been automatically generated and should be regarded as a code template only.
405 // It will require modifications to work:
406 // - It may require correct/in-range values for request initialization.
407 // - It may require specifying regional endpoints when creating the service client as shown in:
408 // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
409 c, err := datacatalog.NewClient(ctx)
410 if err != nil {
411 // TODO: Handle error.
412 }
413 defer c.Close()
414
415 req := &datacatalogpb.ListEntriesRequest{
416 // TODO: Fill request struct fields.
417 // See https://pkg.go.dev/cloud.google.com/go/datacatalog/apiv1beta1/datacatalogpb#ListEntriesRequest.
418 }
419 it := c.ListEntries(ctx, req)
420 for {
421 resp, err := it.Next()
422 if err == iterator.Done {
423 break
424 }
425 if err != nil {
426 // TODO: Handle error.
427 }
428 // TODO: Use resp.
429 _ = resp
430
431 // If you need to access the underlying RPC response,
432 // you can do so by casting the `Response` as below.
433 // Otherwise, remove this line. Only populated after
434 // first call to Next(). Not safe for concurrent access.
435 _ = it.Response.(*datacatalogpb.ListEntriesResponse)
436 }
437 }
438
439 func ExampleClient_ListEntryGroups() {
440 ctx := context.Background()
441 // This snippet has been automatically generated and should be regarded as a code template only.
442 // It will require modifications to work:
443 // - It may require correct/in-range values for request initialization.
444 // - It may require specifying regional endpoints when creating the service client as shown in:
445 // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
446 c, err := datacatalog.NewClient(ctx)
447 if err != nil {
448 // TODO: Handle error.
449 }
450 defer c.Close()
451
452 req := &datacatalogpb.ListEntryGroupsRequest{
453 // TODO: Fill request struct fields.
454 // See https://pkg.go.dev/cloud.google.com/go/datacatalog/apiv1beta1/datacatalogpb#ListEntryGroupsRequest.
455 }
456 it := c.ListEntryGroups(ctx, req)
457 for {
458 resp, err := it.Next()
459 if err == iterator.Done {
460 break
461 }
462 if err != nil {
463 // TODO: Handle error.
464 }
465 // TODO: Use resp.
466 _ = resp
467
468 // If you need to access the underlying RPC response,
469 // you can do so by casting the `Response` as below.
470 // Otherwise, remove this line. Only populated after
471 // first call to Next(). Not safe for concurrent access.
472 _ = it.Response.(*datacatalogpb.ListEntryGroupsResponse)
473 }
474 }
475
476 func ExampleClient_ListTags() {
477 ctx := context.Background()
478 // This snippet has been automatically generated and should be regarded as a code template only.
479 // It will require modifications to work:
480 // - It may require correct/in-range values for request initialization.
481 // - It may require specifying regional endpoints when creating the service client as shown in:
482 // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
483 c, err := datacatalog.NewClient(ctx)
484 if err != nil {
485 // TODO: Handle error.
486 }
487 defer c.Close()
488
489 req := &datacatalogpb.ListTagsRequest{
490 // TODO: Fill request struct fields.
491 // See https://pkg.go.dev/cloud.google.com/go/datacatalog/apiv1beta1/datacatalogpb#ListTagsRequest.
492 }
493 it := c.ListTags(ctx, req)
494 for {
495 resp, err := it.Next()
496 if err == iterator.Done {
497 break
498 }
499 if err != nil {
500 // TODO: Handle error.
501 }
502 // TODO: Use resp.
503 _ = resp
504
505 // If you need to access the underlying RPC response,
506 // you can do so by casting the `Response` as below.
507 // Otherwise, remove this line. Only populated after
508 // first call to Next(). Not safe for concurrent access.
509 _ = it.Response.(*datacatalogpb.ListTagsResponse)
510 }
511 }
512
513 func ExampleClient_LookupEntry() {
514 ctx := context.Background()
515 // This snippet has been automatically generated and should be regarded as a code template only.
516 // It will require modifications to work:
517 // - It may require correct/in-range values for request initialization.
518 // - It may require specifying regional endpoints when creating the service client as shown in:
519 // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
520 c, err := datacatalog.NewClient(ctx)
521 if err != nil {
522 // TODO: Handle error.
523 }
524 defer c.Close()
525
526 req := &datacatalogpb.LookupEntryRequest{
527 // TODO: Fill request struct fields.
528 // See https://pkg.go.dev/cloud.google.com/go/datacatalog/apiv1beta1/datacatalogpb#LookupEntryRequest.
529 }
530 resp, err := c.LookupEntry(ctx, req)
531 if err != nil {
532 // TODO: Handle error.
533 }
534 // TODO: Use resp.
535 _ = resp
536 }
537
538 func ExampleClient_RenameTagTemplateField() {
539 ctx := context.Background()
540 // This snippet has been automatically generated and should be regarded as a code template only.
541 // It will require modifications to work:
542 // - It may require correct/in-range values for request initialization.
543 // - It may require specifying regional endpoints when creating the service client as shown in:
544 // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
545 c, err := datacatalog.NewClient(ctx)
546 if err != nil {
547 // TODO: Handle error.
548 }
549 defer c.Close()
550
551 req := &datacatalogpb.RenameTagTemplateFieldRequest{
552 // TODO: Fill request struct fields.
553 // See https://pkg.go.dev/cloud.google.com/go/datacatalog/apiv1beta1/datacatalogpb#RenameTagTemplateFieldRequest.
554 }
555 resp, err := c.RenameTagTemplateField(ctx, req)
556 if err != nil {
557 // TODO: Handle error.
558 }
559 // TODO: Use resp.
560 _ = resp
561 }
562
563 func ExampleClient_RenameTagTemplateFieldEnumValue() {
564 ctx := context.Background()
565 // This snippet has been automatically generated and should be regarded as a code template only.
566 // It will require modifications to work:
567 // - It may require correct/in-range values for request initialization.
568 // - It may require specifying regional endpoints when creating the service client as shown in:
569 // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
570 c, err := datacatalog.NewClient(ctx)
571 if err != nil {
572 // TODO: Handle error.
573 }
574 defer c.Close()
575
576 req := &datacatalogpb.RenameTagTemplateFieldEnumValueRequest{
577 // TODO: Fill request struct fields.
578 // See https://pkg.go.dev/cloud.google.com/go/datacatalog/apiv1beta1/datacatalogpb#RenameTagTemplateFieldEnumValueRequest.
579 }
580 resp, err := c.RenameTagTemplateFieldEnumValue(ctx, req)
581 if err != nil {
582 // TODO: Handle error.
583 }
584 // TODO: Use resp.
585 _ = resp
586 }
587
588 func ExampleClient_SearchCatalog() {
589 ctx := context.Background()
590 // This snippet has been automatically generated and should be regarded as a code template only.
591 // It will require modifications to work:
592 // - It may require correct/in-range values for request initialization.
593 // - It may require specifying regional endpoints when creating the service client as shown in:
594 // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
595 c, err := datacatalog.NewClient(ctx)
596 if err != nil {
597 // TODO: Handle error.
598 }
599 defer c.Close()
600
601 req := &datacatalogpb.SearchCatalogRequest{
602 // TODO: Fill request struct fields.
603 // See https://pkg.go.dev/cloud.google.com/go/datacatalog/apiv1beta1/datacatalogpb#SearchCatalogRequest.
604 }
605 it := c.SearchCatalog(ctx, req)
606 for {
607 resp, err := it.Next()
608 if err == iterator.Done {
609 break
610 }
611 if err != nil {
612 // TODO: Handle error.
613 }
614 // TODO: Use resp.
615 _ = resp
616
617 // If you need to access the underlying RPC response,
618 // you can do so by casting the `Response` as below.
619 // Otherwise, remove this line. Only populated after
620 // first call to Next(). Not safe for concurrent access.
621 _ = it.Response.(*datacatalogpb.SearchCatalogResponse)
622 }
623 }
624
625 func ExampleClient_SetIamPolicy() {
626 ctx := context.Background()
627 // This snippet has been automatically generated and should be regarded as a code template only.
628 // It will require modifications to work:
629 // - It may require correct/in-range values for request initialization.
630 // - It may require specifying regional endpoints when creating the service client as shown in:
631 // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
632 c, err := datacatalog.NewClient(ctx)
633 if err != nil {
634 // TODO: Handle error.
635 }
636 defer c.Close()
637
638 req := &iampb.SetIamPolicyRequest{
639 // TODO: Fill request struct fields.
640 // See https://pkg.go.dev/cloud.google.com/go/iam/apiv1/iampb#SetIamPolicyRequest.
641 }
642 resp, err := c.SetIamPolicy(ctx, req)
643 if err != nil {
644 // TODO: Handle error.
645 }
646 // TODO: Use resp.
647 _ = resp
648 }
649
650 func ExampleClient_TestIamPermissions() {
651 ctx := context.Background()
652 // This snippet has been automatically generated and should be regarded as a code template only.
653 // It will require modifications to work:
654 // - It may require correct/in-range values for request initialization.
655 // - It may require specifying regional endpoints when creating the service client as shown in:
656 // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
657 c, err := datacatalog.NewClient(ctx)
658 if err != nil {
659 // TODO: Handle error.
660 }
661 defer c.Close()
662
663 req := &iampb.TestIamPermissionsRequest{
664 // TODO: Fill request struct fields.
665 // See https://pkg.go.dev/cloud.google.com/go/iam/apiv1/iampb#TestIamPermissionsRequest.
666 }
667 resp, err := c.TestIamPermissions(ctx, req)
668 if err != nil {
669 // TODO: Handle error.
670 }
671 // TODO: Use resp.
672 _ = resp
673 }
674
675 func ExampleClient_UpdateEntry() {
676 ctx := context.Background()
677 // This snippet has been automatically generated and should be regarded as a code template only.
678 // It will require modifications to work:
679 // - It may require correct/in-range values for request initialization.
680 // - It may require specifying regional endpoints when creating the service client as shown in:
681 // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
682 c, err := datacatalog.NewClient(ctx)
683 if err != nil {
684 // TODO: Handle error.
685 }
686 defer c.Close()
687
688 req := &datacatalogpb.UpdateEntryRequest{
689 // TODO: Fill request struct fields.
690 // See https://pkg.go.dev/cloud.google.com/go/datacatalog/apiv1beta1/datacatalogpb#UpdateEntryRequest.
691 }
692 resp, err := c.UpdateEntry(ctx, req)
693 if err != nil {
694 // TODO: Handle error.
695 }
696 // TODO: Use resp.
697 _ = resp
698 }
699
700 func ExampleClient_UpdateEntryGroup() {
701 ctx := context.Background()
702 // This snippet has been automatically generated and should be regarded as a code template only.
703 // It will require modifications to work:
704 // - It may require correct/in-range values for request initialization.
705 // - It may require specifying regional endpoints when creating the service client as shown in:
706 // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
707 c, err := datacatalog.NewClient(ctx)
708 if err != nil {
709 // TODO: Handle error.
710 }
711 defer c.Close()
712
713 req := &datacatalogpb.UpdateEntryGroupRequest{
714 // TODO: Fill request struct fields.
715 // See https://pkg.go.dev/cloud.google.com/go/datacatalog/apiv1beta1/datacatalogpb#UpdateEntryGroupRequest.
716 }
717 resp, err := c.UpdateEntryGroup(ctx, req)
718 if err != nil {
719 // TODO: Handle error.
720 }
721 // TODO: Use resp.
722 _ = resp
723 }
724
725 func ExampleClient_UpdateTag() {
726 ctx := context.Background()
727 // This snippet has been automatically generated and should be regarded as a code template only.
728 // It will require modifications to work:
729 // - It may require correct/in-range values for request initialization.
730 // - It may require specifying regional endpoints when creating the service client as shown in:
731 // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
732 c, err := datacatalog.NewClient(ctx)
733 if err != nil {
734 // TODO: Handle error.
735 }
736 defer c.Close()
737
738 req := &datacatalogpb.UpdateTagRequest{
739 // TODO: Fill request struct fields.
740 // See https://pkg.go.dev/cloud.google.com/go/datacatalog/apiv1beta1/datacatalogpb#UpdateTagRequest.
741 }
742 resp, err := c.UpdateTag(ctx, req)
743 if err != nil {
744 // TODO: Handle error.
745 }
746 // TODO: Use resp.
747 _ = resp
748 }
749
750 func ExampleClient_UpdateTagTemplate() {
751 ctx := context.Background()
752 // This snippet has been automatically generated and should be regarded as a code template only.
753 // It will require modifications to work:
754 // - It may require correct/in-range values for request initialization.
755 // - It may require specifying regional endpoints when creating the service client as shown in:
756 // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
757 c, err := datacatalog.NewClient(ctx)
758 if err != nil {
759 // TODO: Handle error.
760 }
761 defer c.Close()
762
763 req := &datacatalogpb.UpdateTagTemplateRequest{
764 // TODO: Fill request struct fields.
765 // See https://pkg.go.dev/cloud.google.com/go/datacatalog/apiv1beta1/datacatalogpb#UpdateTagTemplateRequest.
766 }
767 resp, err := c.UpdateTagTemplate(ctx, req)
768 if err != nil {
769 // TODO: Handle error.
770 }
771 // TODO: Use resp.
772 _ = resp
773 }
774
775 func ExampleClient_UpdateTagTemplateField() {
776 ctx := context.Background()
777 // This snippet has been automatically generated and should be regarded as a code template only.
778 // It will require modifications to work:
779 // - It may require correct/in-range values for request initialization.
780 // - It may require specifying regional endpoints when creating the service client as shown in:
781 // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
782 c, err := datacatalog.NewClient(ctx)
783 if err != nil {
784 // TODO: Handle error.
785 }
786 defer c.Close()
787
788 req := &datacatalogpb.UpdateTagTemplateFieldRequest{
789 // TODO: Fill request struct fields.
790 // See https://pkg.go.dev/cloud.google.com/go/datacatalog/apiv1beta1/datacatalogpb#UpdateTagTemplateFieldRequest.
791 }
792 resp, err := c.UpdateTagTemplateField(ctx, req)
793 if err != nil {
794 // TODO: Handle error.
795 }
796 // TODO: Use resp.
797 _ = resp
798 }