Debian Codegraph @

datacatalog/apiv1/data_catalog_client.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
18
19 import (
20 "bytes"
21 "context"
22 "fmt"
23 "log/slog"
24 "math"
25 "net/http"
26 "net/url"
27 "time"
28
29 datacatalogpb "cloud.google.com/go/datacatalog/apiv1/datacatalogpb"
30 iampb "cloud.google.com/go/iam/apiv1/iampb"
31 "cloud.google.com/go/longrunning"
32 lroauto "cloud.google.com/go/longrunning/autogen"
33 longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
34 gax "github.com/googleapis/gax-go/v2"
35 "google.golang.org/api/iterator"
36 "google.golang.org/api/option"
37 "google.golang.org/api/option/internaloption"
38 gtransport "google.golang.org/api/transport/grpc"
39 httptransport "google.golang.org/api/transport/http"
40 "google.golang.org/grpc"
41 "google.golang.org/grpc/codes"
42 "google.golang.org/protobuf/encoding/protojson"
43 "google.golang.org/protobuf/proto"
44 )
45
46 var newClientHook clientHook
47
48 // CallOptions contains the retry settings for each method of Client.
49 type CallOptions struct {
50 SearchCatalog []gax.CallOption
51 CreateEntryGroup []gax.CallOption
52 GetEntryGroup []gax.CallOption
53 UpdateEntryGroup []gax.CallOption
54 DeleteEntryGroup []gax.CallOption
55 ListEntryGroups []gax.CallOption
56 CreateEntry []gax.CallOption
57 UpdateEntry []gax.CallOption
58 DeleteEntry []gax.CallOption
59 GetEntry []gax.CallOption
60 LookupEntry []gax.CallOption
61 ListEntries []gax.CallOption
62 ModifyEntryOverview []gax.CallOption
63 ModifyEntryContacts []gax.CallOption
64 CreateTagTemplate []gax.CallOption
65 GetTagTemplate []gax.CallOption
66 UpdateTagTemplate []gax.CallOption
67 DeleteTagTemplate []gax.CallOption
68 CreateTagTemplateField []gax.CallOption
69 UpdateTagTemplateField []gax.CallOption
70 RenameTagTemplateField []gax.CallOption
71 RenameTagTemplateFieldEnumValue []gax.CallOption
72 DeleteTagTemplateField []gax.CallOption
73 CreateTag []gax.CallOption
74 UpdateTag []gax.CallOption
75 DeleteTag []gax.CallOption
76 ListTags []gax.CallOption
77 ReconcileTags []gax.CallOption
78 StarEntry []gax.CallOption
79 UnstarEntry []gax.CallOption
80 SetIamPolicy []gax.CallOption
81 GetIamPolicy []gax.CallOption
82 TestIamPermissions []gax.CallOption
83 ImportEntries []gax.CallOption
84 SetConfig []gax.CallOption
85 RetrieveConfig []gax.CallOption
86 RetrieveEffectiveConfig []gax.CallOption
87 CancelOperation []gax.CallOption
88 DeleteOperation []gax.CallOption
89 GetOperation []gax.CallOption
90 ListOperations []gax.CallOption
91 }
92
93 func defaultGRPCClientOptions() []option.ClientOption {
94 return []option.ClientOption{
95 internaloption.WithDefaultEndpoint("datacatalog.googleapis.com:443"),
96 internaloption.WithDefaultEndpointTemplate("datacatalog.UNIVERSE_DOMAIN:443"),
97 internaloption.WithDefaultMTLSEndpoint("datacatalog.mtls.googleapis.com:443"),
98 internaloption.WithDefaultUniverseDomain("googleapis.com"),
99 internaloption.WithDefaultAudience("https://datacatalog.googleapis.com/"),
100 internaloption.WithDefaultScopes(DefaultAuthScopes()...),
101 internaloption.EnableJwtWithScope(),
102 internaloption.EnableNewAuthLibrary(),
103 option.WithGRPCDialOption(grpc.WithDefaultCallOptions(
104 grpc.MaxCallRecvMsgSize(math.MaxInt32))),
105 }
106 }
107
108 func defaultCallOptions() *CallOptions {
109 return &CallOptions{
110 SearchCatalog: []gax.CallOption{
111 gax.WithTimeout(60000 * time.Millisecond),
112 gax.WithRetry(func() gax.Retryer {
113 return gax.OnCodes([]codes.Code{
114 codes.Unavailable,
115 codes.ResourceExhausted,
116 codes.Internal,
117 }, gax.Backoff{
118 Initial: 100 * time.Millisecond,
119 Max: 60000 * time.Millisecond,
120 Multiplier: 1.30,
121 })
122 }),
123 },
124 CreateEntryGroup: []gax.CallOption{
125 gax.WithTimeout(60000 * time.Millisecond),
126 gax.WithRetry(func() gax.Retryer {
127 return gax.OnCodes([]codes.Code{
128 codes.Unavailable,
129 codes.ResourceExhausted,
130 codes.Internal,
131 }, gax.Backoff{
132 Initial: 100 * time.Millisecond,
133 Max: 60000 * time.Millisecond,
134 Multiplier: 1.30,
135 })
136 }),
137 },
138 GetEntryGroup: []gax.CallOption{
139 gax.WithTimeout(60000 * time.Millisecond),
140 gax.WithRetry(func() gax.Retryer {
141 return gax.OnCodes([]codes.Code{
142 codes.Unavailable,
143 codes.ResourceExhausted,
144 codes.Internal,
145 }, gax.Backoff{
146 Initial: 100 * time.Millisecond,
147 Max: 60000 * time.Millisecond,
148 Multiplier: 1.30,
149 })
150 }),
151 },
152 UpdateEntryGroup: []gax.CallOption{
153 gax.WithTimeout(60000 * time.Millisecond),
154 gax.WithRetry(func() gax.Retryer {
155 return gax.OnCodes([]codes.Code{
156 codes.Unavailable,
157 codes.ResourceExhausted,
158 codes.Internal,
159 }, gax.Backoff{
160 Initial: 100 * time.Millisecond,
161 Max: 60000 * time.Millisecond,
162 Multiplier: 1.30,
163 })
164 }),
165 },
166 DeleteEntryGroup: []gax.CallOption{
167 gax.WithTimeout(60000 * time.Millisecond),
168 gax.WithRetry(func() gax.Retryer {
169 return gax.OnCodes([]codes.Code{
170 codes.Unavailable,
171 codes.ResourceExhausted,
172 codes.Internal,
173 }, gax.Backoff{
174 Initial: 100 * time.Millisecond,
175 Max: 60000 * time.Millisecond,
176 Multiplier: 1.30,
177 })
178 }),
179 },
180 ListEntryGroups: []gax.CallOption{
181 gax.WithTimeout(60000 * time.Millisecond),
182 gax.WithRetry(func() gax.Retryer {
183 return gax.OnCodes([]codes.Code{
184 codes.Unavailable,
185 codes.ResourceExhausted,
186 codes.Internal,
187 }, gax.Backoff{
188 Initial: 100 * time.Millisecond,
189 Max: 60000 * time.Millisecond,
190 Multiplier: 1.30,
191 })
192 }),
193 },
194 CreateEntry: []gax.CallOption{
195 gax.WithTimeout(60000 * time.Millisecond),
196 gax.WithRetry(func() gax.Retryer {
197 return gax.OnCodes([]codes.Code{
198 codes.Unavailable,
199 codes.ResourceExhausted,
200 codes.Internal,
201 }, gax.Backoff{
202 Initial: 100 * time.Millisecond,
203 Max: 60000 * time.Millisecond,
204 Multiplier: 1.30,
205 })
206 }),
207 },
208 UpdateEntry: []gax.CallOption{
209 gax.WithTimeout(60000 * time.Millisecond),
210 gax.WithRetry(func() gax.Retryer {
211 return gax.OnCodes([]codes.Code{
212 codes.Unavailable,
213 codes.ResourceExhausted,
214 codes.Internal,
215 }, gax.Backoff{
216 Initial: 100 * time.Millisecond,
217 Max: 60000 * time.Millisecond,
218 Multiplier: 1.30,
219 })
220 }),
221 },
222 DeleteEntry: []gax.CallOption{
223 gax.WithTimeout(60000 * time.Millisecond),
224 gax.WithRetry(func() gax.Retryer {
225 return gax.OnCodes([]codes.Code{
226 codes.Unavailable,
227 codes.ResourceExhausted,
228 codes.Internal,
229 }, gax.Backoff{
230 Initial: 100 * time.Millisecond,
231 Max: 60000 * time.Millisecond,
232 Multiplier: 1.30,
233 })
234 }),
235 },
236 GetEntry: []gax.CallOption{
237 gax.WithTimeout(60000 * time.Millisecond),
238 gax.WithRetry(func() gax.Retryer {
239 return gax.OnCodes([]codes.Code{
240 codes.Unavailable,
241 codes.ResourceExhausted,
242 codes.Internal,
243 }, gax.Backoff{
244 Initial: 100 * time.Millisecond,
245 Max: 60000 * time.Millisecond,
246 Multiplier: 1.30,
247 })
248 }),
249 },
250 LookupEntry: []gax.CallOption{
251 gax.WithTimeout(60000 * time.Millisecond),
252 gax.WithRetry(func() gax.Retryer {
253 return gax.OnCodes([]codes.Code{
254 codes.Unavailable,
255 codes.ResourceExhausted,
256 codes.Internal,
257 }, gax.Backoff{
258 Initial: 100 * time.Millisecond,
259 Max: 60000 * time.Millisecond,
260 Multiplier: 1.30,
261 })
262 }),
263 },
264 ListEntries: []gax.CallOption{
265 gax.WithTimeout(60000 * time.Millisecond),
266 gax.WithRetry(func() gax.Retryer {
267 return gax.OnCodes([]codes.Code{
268 codes.Unavailable,
269 codes.ResourceExhausted,
270 codes.Internal,
271 }, gax.Backoff{
272 Initial: 100 * time.Millisecond,
273 Max: 60000 * time.Millisecond,
274 Multiplier: 1.30,
275 })
276 }),
277 },
278 ModifyEntryOverview: []gax.CallOption{
279 gax.WithTimeout(60000 * time.Millisecond),
280 gax.WithRetry(func() gax.Retryer {
281 return gax.OnCodes([]codes.Code{
282 codes.Unavailable,
283 codes.ResourceExhausted,
284 codes.Internal,
285 }, gax.Backoff{
286 Initial: 100 * time.Millisecond,
287 Max: 60000 * time.Millisecond,
288 Multiplier: 1.30,
289 })
290 }),
291 },
292 ModifyEntryContacts: []gax.CallOption{
293 gax.WithTimeout(60000 * time.Millisecond),
294 gax.WithRetry(func() gax.Retryer {
295 return gax.OnCodes([]codes.Code{
296 codes.Unavailable,
297 codes.ResourceExhausted,
298 codes.Internal,
299 }, gax.Backoff{
300 Initial: 100 * time.Millisecond,
301 Max: 60000 * time.Millisecond,
302 Multiplier: 1.30,
303 })
304 }),
305 },
306 CreateTagTemplate: []gax.CallOption{
307 gax.WithTimeout(60000 * time.Millisecond),
308 gax.WithRetry(func() gax.Retryer {
309 return gax.OnCodes([]codes.Code{
310 codes.Unavailable,
311 codes.ResourceExhausted,
312 codes.Internal,
313 }, gax.Backoff{
314 Initial: 100 * time.Millisecond,
315 Max: 60000 * time.Millisecond,
316 Multiplier: 1.30,
317 })
318 }),
319 },
320 GetTagTemplate: []gax.CallOption{
321 gax.WithTimeout(60000 * time.Millisecond),
322 gax.WithRetry(func() gax.Retryer {
323 return gax.OnCodes([]codes.Code{
324 codes.Unavailable,
325 codes.ResourceExhausted,
326 codes.Internal,
327 }, gax.Backoff{
328 Initial: 100 * time.Millisecond,
329 Max: 60000 * time.Millisecond,
330 Multiplier: 1.30,
331 })
332 }),
333 },
334 UpdateTagTemplate: []gax.CallOption{
335 gax.WithTimeout(60000 * time.Millisecond),
336 gax.WithRetry(func() gax.Retryer {
337 return gax.OnCodes([]codes.Code{
338 codes.Unavailable,
339 codes.ResourceExhausted,
340 codes.Internal,
341 }, gax.Backoff{
342 Initial: 100 * time.Millisecond,
343 Max: 60000 * time.Millisecond,
344 Multiplier: 1.30,
345 })
346 }),
347 },
348 DeleteTagTemplate: []gax.CallOption{
349 gax.WithTimeout(60000 * time.Millisecond),
350 gax.WithRetry(func() gax.Retryer {
351 return gax.OnCodes([]codes.Code{
352 codes.Unavailable,
353 codes.ResourceExhausted,
354 codes.Internal,
355 }, gax.Backoff{
356 Initial: 100 * time.Millisecond,
357 Max: 60000 * time.Millisecond,
358 Multiplier: 1.30,
359 })
360 }),
361 },
362 CreateTagTemplateField: []gax.CallOption{
363 gax.WithTimeout(60000 * time.Millisecond),
364 gax.WithRetry(func() gax.Retryer {
365 return gax.OnCodes([]codes.Code{
366 codes.Unavailable,
367 codes.ResourceExhausted,
368 codes.Internal,
369 }, gax.Backoff{
370 Initial: 100 * time.Millisecond,
371 Max: 60000 * time.Millisecond,
372 Multiplier: 1.30,
373 })
374 }),
375 },
376 UpdateTagTemplateField: []gax.CallOption{
377 gax.WithTimeout(60000 * time.Millisecond),
378 gax.WithRetry(func() gax.Retryer {
379 return gax.OnCodes([]codes.Code{
380 codes.Unavailable,
381 codes.ResourceExhausted,
382 codes.Internal,
383 }, gax.Backoff{
384 Initial: 100 * time.Millisecond,
385 Max: 60000 * time.Millisecond,
386 Multiplier: 1.30,
387 })
388 }),
389 },
390 RenameTagTemplateField: []gax.CallOption{
391 gax.WithTimeout(60000 * time.Millisecond),
392 gax.WithRetry(func() gax.Retryer {
393 return gax.OnCodes([]codes.Code{
394 codes.Unavailable,
395 codes.ResourceExhausted,
396 codes.Internal,
397 }, gax.Backoff{
398 Initial: 100 * time.Millisecond,
399 Max: 60000 * time.Millisecond,
400 Multiplier: 1.30,
401 })
402 }),
403 },
404 RenameTagTemplateFieldEnumValue: []gax.CallOption{
405 gax.WithTimeout(60000 * time.Millisecond),
406 gax.WithRetry(func() gax.Retryer {
407 return gax.OnCodes([]codes.Code{
408 codes.Unavailable,
409 codes.ResourceExhausted,
410 codes.Internal,
411 }, gax.Backoff{
412 Initial: 100 * time.Millisecond,
413 Max: 60000 * time.Millisecond,
414 Multiplier: 1.30,
415 })
416 }),
417 },
418 DeleteTagTemplateField: []gax.CallOption{
419 gax.WithTimeout(60000 * time.Millisecond),
420 gax.WithRetry(func() gax.Retryer {
421 return gax.OnCodes([]codes.Code{
422 codes.Unavailable,
423 codes.ResourceExhausted,
424 codes.Internal,
425 }, gax.Backoff{
426 Initial: 100 * time.Millisecond,
427 Max: 60000 * time.Millisecond,
428 Multiplier: 1.30,
429 })
430 }),
431 },
432 CreateTag: []gax.CallOption{
433 gax.WithTimeout(60000 * time.Millisecond),
434 gax.WithRetry(func() gax.Retryer {
435 return gax.OnCodes([]codes.Code{
436 codes.Unavailable,
437 codes.ResourceExhausted,
438 codes.Internal,
439 }, gax.Backoff{
440 Initial: 100 * time.Millisecond,
441 Max: 60000 * time.Millisecond,
442 Multiplier: 1.30,
443 })
444 }),
445 },
446 UpdateTag: []gax.CallOption{
447 gax.WithTimeout(60000 * time.Millisecond),
448 gax.WithRetry(func() gax.Retryer {
449 return gax.OnCodes([]codes.Code{
450 codes.Unavailable,
451 codes.ResourceExhausted,
452 codes.Internal,
453 }, gax.Backoff{
454 Initial: 100 * time.Millisecond,
455 Max: 60000 * time.Millisecond,
456 Multiplier: 1.30,
457 })
458 }),
459 },
460 DeleteTag: []gax.CallOption{
461 gax.WithTimeout(60000 * time.Millisecond),
462 gax.WithRetry(func() gax.Retryer {
463 return gax.OnCodes([]codes.Code{
464 codes.Unavailable,
465 codes.ResourceExhausted,
466 codes.Internal,
467 }, gax.Backoff{
468 Initial: 100 * time.Millisecond,
469 Max: 60000 * time.Millisecond,
470 Multiplier: 1.30,
471 })
472 }),
473 },
474 ListTags: []gax.CallOption{
475 gax.WithTimeout(60000 * time.Millisecond),
476 gax.WithRetry(func() gax.Retryer {
477 return gax.OnCodes([]codes.Code{
478 codes.Unavailable,
479 codes.ResourceExhausted,
480 codes.Internal,
481 }, gax.Backoff{
482 Initial: 100 * time.Millisecond,
483 Max: 60000 * time.Millisecond,
484 Multiplier: 1.30,
485 })
486 }),
487 },
488 ReconcileTags: []gax.CallOption{
489 gax.WithTimeout(60000 * time.Millisecond),
490 gax.WithRetry(func() gax.Retryer {
491 return gax.OnCodes([]codes.Code{
492 codes.Unavailable,
493 codes.ResourceExhausted,
494 codes.Internal,
495 }, gax.Backoff{
496 Initial: 100 * time.Millisecond,
497 Max: 60000 * time.Millisecond,
498 Multiplier: 1.30,
499 })
500 }),
501 },
502 StarEntry: []gax.CallOption{
503 gax.WithTimeout(60000 * time.Millisecond),
504 gax.WithRetry(func() gax.Retryer {
505 return gax.OnCodes([]codes.Code{
506 codes.Unavailable,
507 codes.ResourceExhausted,
508 codes.Internal,
509 }, gax.Backoff{
510 Initial: 100 * time.Millisecond,
511 Max: 60000 * time.Millisecond,
512 Multiplier: 1.30,
513 })
514 }),
515 },
516 UnstarEntry: []gax.CallOption{
517 gax.WithTimeout(60000 * time.Millisecond),
518 gax.WithRetry(func() gax.Retryer {
519 return gax.OnCodes([]codes.Code{
520 codes.Unavailable,
521 codes.ResourceExhausted,
522 codes.Internal,
523 }, gax.Backoff{
524 Initial: 100 * time.Millisecond,
525 Max: 60000 * time.Millisecond,
526 Multiplier: 1.30,
527 })
528 }),
529 },
530 SetIamPolicy: []gax.CallOption{
531 gax.WithTimeout(60000 * time.Millisecond),
532 gax.WithRetry(func() gax.Retryer {
533 return gax.OnCodes([]codes.Code{
534 codes.Unavailable,
535 codes.ResourceExhausted,
536 codes.Internal,
537 }, gax.Backoff{
538 Initial: 100 * time.Millisecond,
539 Max: 60000 * time.Millisecond,
540 Multiplier: 1.30,
541 })
542 }),
543 },
544 GetIamPolicy: []gax.CallOption{
545 gax.WithTimeout(60000 * time.Millisecond),
546 gax.WithRetry(func() gax.Retryer {
547 return gax.OnCodes([]codes.Code{
548 codes.Unavailable,
549 codes.ResourceExhausted,
550 codes.Internal,
551 }, gax.Backoff{
552 Initial: 100 * time.Millisecond,
553 Max: 60000 * time.Millisecond,
554 Multiplier: 1.30,
555 })
556 }),
557 },
558 TestIamPermissions: []gax.CallOption{
559 gax.WithTimeout(60000 * time.Millisecond),
560 gax.WithRetry(func() gax.Retryer {
561 return gax.OnCodes([]codes.Code{
562 codes.Unavailable,
563 codes.ResourceExhausted,
564 codes.Internal,
565 }, gax.Backoff{
566 Initial: 100 * time.Millisecond,
567 Max: 60000 * time.Millisecond,
568 Multiplier: 1.30,
569 })
570 }),
571 },
572 ImportEntries: []gax.CallOption{
573 gax.WithTimeout(60000 * time.Millisecond),
574 gax.WithRetry(func() gax.Retryer {
575 return gax.OnCodes([]codes.Code{
576 codes.Unavailable,
577 codes.ResourceExhausted,
578 codes.Internal,
579 }, gax.Backoff{
580 Initial: 100 * time.Millisecond,
581 Max: 60000 * time.Millisecond,
582 Multiplier: 1.30,
583 })
584 }),
585 },
586 SetConfig: []gax.CallOption{
587 gax.WithTimeout(60000 * time.Millisecond),
588 gax.WithRetry(func() gax.Retryer {
589 return gax.OnCodes([]codes.Code{
590 codes.Unavailable,
591 codes.ResourceExhausted,
592 codes.Internal,
593 }, gax.Backoff{
594 Initial: 100 * time.Millisecond,
595 Max: 60000 * time.Millisecond,
596 Multiplier: 1.30,
597 })
598 }),
599 },
600 RetrieveConfig: []gax.CallOption{
601 gax.WithTimeout(60000 * time.Millisecond),
602 gax.WithRetry(func() gax.Retryer {
603 return gax.OnCodes([]codes.Code{
604 codes.Unavailable,
605 codes.ResourceExhausted,
606 codes.Internal,
607 }, gax.Backoff{
608 Initial: 100 * time.Millisecond,
609 Max: 60000 * time.Millisecond,
610 Multiplier: 1.30,
611 })
612 }),
613 },
614 RetrieveEffectiveConfig: []gax.CallOption{
615 gax.WithTimeout(60000 * time.Millisecond),
616 gax.WithRetry(func() gax.Retryer {
617 return gax.OnCodes([]codes.Code{
618 codes.Unavailable,
619 codes.ResourceExhausted,
620 codes.Internal,
621 }, gax.Backoff{
622 Initial: 100 * time.Millisecond,
623 Max: 60000 * time.Millisecond,
624 Multiplier: 1.30,
625 })
626 }),
627 },
628 CancelOperation: []gax.CallOption{},
629 DeleteOperation: []gax.CallOption{},
630 GetOperation: []gax.CallOption{},
631 ListOperations: []gax.CallOption{},
632 }
633 }
634
635 func defaultRESTCallOptions() *CallOptions {
636 return &CallOptions{
637 SearchCatalog: []gax.CallOption{
638 gax.WithTimeout(60000 * time.Millisecond),
639 gax.WithRetry(func() gax.Retryer {
640 return gax.OnHTTPCodes(gax.Backoff{
641 Initial: 100 * time.Millisecond,
642 Max: 60000 * time.Millisecond,
643 Multiplier: 1.30,
644 },
645 http.StatusServiceUnavailable,
646 http.StatusTooManyRequests,
647 http.StatusInternalServerError)
648 }),
649 },
650 CreateEntryGroup: []gax.CallOption{
651 gax.WithTimeout(60000 * time.Millisecond),
652 gax.WithRetry(func() gax.Retryer {
653 return gax.OnHTTPCodes(gax.Backoff{
654 Initial: 100 * time.Millisecond,
655 Max: 60000 * time.Millisecond,
656 Multiplier: 1.30,
657 },
658 http.StatusServiceUnavailable,
659 http.StatusTooManyRequests,
660 http.StatusInternalServerError)
661 }),
662 },
663 GetEntryGroup: []gax.CallOption{
664 gax.WithTimeout(60000 * time.Millisecond),
665 gax.WithRetry(func() gax.Retryer {
666 return gax.OnHTTPCodes(gax.Backoff{
667 Initial: 100 * time.Millisecond,
668 Max: 60000 * time.Millisecond,
669 Multiplier: 1.30,
670 },
671 http.StatusServiceUnavailable,
672 http.StatusTooManyRequests,
673 http.StatusInternalServerError)
674 }),
675 },
676 UpdateEntryGroup: []gax.CallOption{
677 gax.WithTimeout(60000 * time.Millisecond),
678 gax.WithRetry(func() gax.Retryer {
679 return gax.OnHTTPCodes(gax.Backoff{
680 Initial: 100 * time.Millisecond,
681 Max: 60000 * time.Millisecond,
682 Multiplier: 1.30,
683 },
684 http.StatusServiceUnavailable,
685 http.StatusTooManyRequests,
686 http.StatusInternalServerError)
687 }),
688 },
689 DeleteEntryGroup: []gax.CallOption{
690 gax.WithTimeout(60000 * time.Millisecond),
691 gax.WithRetry(func() gax.Retryer {
692 return gax.OnHTTPCodes(gax.Backoff{
693 Initial: 100 * time.Millisecond,
694 Max: 60000 * time.Millisecond,
695 Multiplier: 1.30,
696 },
697 http.StatusServiceUnavailable,
698 http.StatusTooManyRequests,
699 http.StatusInternalServerError)
700 }),
701 },
702 ListEntryGroups: []gax.CallOption{
703 gax.WithTimeout(60000 * time.Millisecond),
704 gax.WithRetry(func() gax.Retryer {
705 return gax.OnHTTPCodes(gax.Backoff{
706 Initial: 100 * time.Millisecond,
707 Max: 60000 * time.Millisecond,
708 Multiplier: 1.30,
709 },
710 http.StatusServiceUnavailable,
711 http.StatusTooManyRequests,
712 http.StatusInternalServerError)
713 }),
714 },
715 CreateEntry: []gax.CallOption{
716 gax.WithTimeout(60000 * time.Millisecond),
717 gax.WithRetry(func() gax.Retryer {
718 return gax.OnHTTPCodes(gax.Backoff{
719 Initial: 100 * time.Millisecond,
720 Max: 60000 * time.Millisecond,
721 Multiplier: 1.30,
722 },
723 http.StatusServiceUnavailable,
724 http.StatusTooManyRequests,
725 http.StatusInternalServerError)
726 }),
727 },
728 UpdateEntry: []gax.CallOption{
729 gax.WithTimeout(60000 * time.Millisecond),
730 gax.WithRetry(func() gax.Retryer {
731 return gax.OnHTTPCodes(gax.Backoff{
732 Initial: 100 * time.Millisecond,
733 Max: 60000 * time.Millisecond,
734 Multiplier: 1.30,
735 },
736 http.StatusServiceUnavailable,
737 http.StatusTooManyRequests,
738 http.StatusInternalServerError)
739 }),
740 },
741 DeleteEntry: []gax.CallOption{
742 gax.WithTimeout(60000 * time.Millisecond),
743 gax.WithRetry(func() gax.Retryer {
744 return gax.OnHTTPCodes(gax.Backoff{
745 Initial: 100 * time.Millisecond,
746 Max: 60000 * time.Millisecond,
747 Multiplier: 1.30,
748 },
749 http.StatusServiceUnavailable,
750 http.StatusTooManyRequests,
751 http.StatusInternalServerError)
752 }),
753 },
754 GetEntry: []gax.CallOption{
755 gax.WithTimeout(60000 * time.Millisecond),
756 gax.WithRetry(func() gax.Retryer {
757 return gax.OnHTTPCodes(gax.Backoff{
758 Initial: 100 * time.Millisecond,
759 Max: 60000 * time.Millisecond,
760 Multiplier: 1.30,
761 },
762 http.StatusServiceUnavailable,
763 http.StatusTooManyRequests,
764 http.StatusInternalServerError)
765 }),
766 },
767 LookupEntry: []gax.CallOption{
768 gax.WithTimeout(60000 * time.Millisecond),
769 gax.WithRetry(func() gax.Retryer {
770 return gax.OnHTTPCodes(gax.Backoff{
771 Initial: 100 * time.Millisecond,
772 Max: 60000 * time.Millisecond,
773 Multiplier: 1.30,
774 },
775 http.StatusServiceUnavailable,
776 http.StatusTooManyRequests,
777 http.StatusInternalServerError)
778 }),
779 },
780 ListEntries: []gax.CallOption{
781 gax.WithTimeout(60000 * time.Millisecond),
782 gax.WithRetry(func() gax.Retryer {
783 return gax.OnHTTPCodes(gax.Backoff{
784 Initial: 100 * time.Millisecond,
785 Max: 60000 * time.Millisecond,
786 Multiplier: 1.30,
787 },
788 http.StatusServiceUnavailable,
789 http.StatusTooManyRequests,
790 http.StatusInternalServerError)
791 }),
792 },
793 ModifyEntryOverview: []gax.CallOption{
794 gax.WithTimeout(60000 * time.Millisecond),
795 gax.WithRetry(func() gax.Retryer {
796 return gax.OnHTTPCodes(gax.Backoff{
797 Initial: 100 * time.Millisecond,
798 Max: 60000 * time.Millisecond,
799 Multiplier: 1.30,
800 },
801 http.StatusServiceUnavailable,
802 http.StatusTooManyRequests,
803 http.StatusInternalServerError)
804 }),
805 },
806 ModifyEntryContacts: []gax.CallOption{
807 gax.WithTimeout(60000 * time.Millisecond),
808 gax.WithRetry(func() gax.Retryer {
809 return gax.OnHTTPCodes(gax.Backoff{
810 Initial: 100 * time.Millisecond,
811 Max: 60000 * time.Millisecond,
812 Multiplier: 1.30,
813 },
814 http.StatusServiceUnavailable,
815 http.StatusTooManyRequests,
816 http.StatusInternalServerError)
817 }),
818 },
819 CreateTagTemplate: []gax.CallOption{
820 gax.WithTimeout(60000 * time.Millisecond),
821 gax.WithRetry(func() gax.Retryer {
822 return gax.OnHTTPCodes(gax.Backoff{
823 Initial: 100 * time.Millisecond,
824 Max: 60000 * time.Millisecond,
825 Multiplier: 1.30,
826 },
827 http.StatusServiceUnavailable,
828 http.StatusTooManyRequests,
829 http.StatusInternalServerError)
830 }),
831 },
832 GetTagTemplate: []gax.CallOption{
833 gax.WithTimeout(60000 * time.Millisecond),
834 gax.WithRetry(func() gax.Retryer {
835 return gax.OnHTTPCodes(gax.Backoff{
836 Initial: 100 * time.Millisecond,
837 Max: 60000 * time.Millisecond,
838 Multiplier: 1.30,
839 },
840 http.StatusServiceUnavailable,
841 http.StatusTooManyRequests,
842 http.StatusInternalServerError)
843 }),
844 },
845 UpdateTagTemplate: []gax.CallOption{
846 gax.WithTimeout(60000 * time.Millisecond),
847 gax.WithRetry(func() gax.Retryer {
848 return gax.OnHTTPCodes(gax.Backoff{
849 Initial: 100 * time.Millisecond,
850 Max: 60000 * time.Millisecond,
851 Multiplier: 1.30,
852 },
853 http.StatusServiceUnavailable,
854 http.StatusTooManyRequests,
855 http.StatusInternalServerError)
856 }),
857 },
858 DeleteTagTemplate: []gax.CallOption{
859 gax.WithTimeout(60000 * time.Millisecond),
860 gax.WithRetry(func() gax.Retryer {
861 return gax.OnHTTPCodes(gax.Backoff{
862 Initial: 100 * time.Millisecond,
863 Max: 60000 * time.Millisecond,
864 Multiplier: 1.30,
865 },
866 http.StatusServiceUnavailable,
867 http.StatusTooManyRequests,
868 http.StatusInternalServerError)
869 }),
870 },
871 CreateTagTemplateField: []gax.CallOption{
872 gax.WithTimeout(60000 * time.Millisecond),
873 gax.WithRetry(func() gax.Retryer {
874 return gax.OnHTTPCodes(gax.Backoff{
875 Initial: 100 * time.Millisecond,
876 Max: 60000 * time.Millisecond,
877 Multiplier: 1.30,
878 },
879 http.StatusServiceUnavailable,
880 http.StatusTooManyRequests,
881 http.StatusInternalServerError)
882 }),
883 },
884 UpdateTagTemplateField: []gax.CallOption{
885 gax.WithTimeout(60000 * time.Millisecond),
886 gax.WithRetry(func() gax.Retryer {
887 return gax.OnHTTPCodes(gax.Backoff{
888 Initial: 100 * time.Millisecond,
889 Max: 60000 * time.Millisecond,
890 Multiplier: 1.30,
891 },
892 http.StatusServiceUnavailable,
893 http.StatusTooManyRequests,
894 http.StatusInternalServerError)
895 }),
896 },
897 RenameTagTemplateField: []gax.CallOption{
898 gax.WithTimeout(60000 * time.Millisecond),
899 gax.WithRetry(func() gax.Retryer {
900 return gax.OnHTTPCodes(gax.Backoff{
901 Initial: 100 * time.Millisecond,
902 Max: 60000 * time.Millisecond,
903 Multiplier: 1.30,
904 },
905 http.StatusServiceUnavailable,
906 http.StatusTooManyRequests,
907 http.StatusInternalServerError)
908 }),
909 },
910 RenameTagTemplateFieldEnumValue: []gax.CallOption{
911 gax.WithTimeout(60000 * time.Millisecond),
912 gax.WithRetry(func() gax.Retryer {
913 return gax.OnHTTPCodes(gax.Backoff{
914 Initial: 100 * time.Millisecond,
915 Max: 60000 * time.Millisecond,
916 Multiplier: 1.30,
917 },
918 http.StatusServiceUnavailable,
919 http.StatusTooManyRequests,
920 http.StatusInternalServerError)
921 }),
922 },
923 DeleteTagTemplateField: []gax.CallOption{
924 gax.WithTimeout(60000 * time.Millisecond),
925 gax.WithRetry(func() gax.Retryer {
926 return gax.OnHTTPCodes(gax.Backoff{
927 Initial: 100 * time.Millisecond,
928 Max: 60000 * time.Millisecond,
929 Multiplier: 1.30,
930 },
931 http.StatusServiceUnavailable,
932 http.StatusTooManyRequests,
933 http.StatusInternalServerError)
934 }),
935 },
936 CreateTag: []gax.CallOption{
937 gax.WithTimeout(60000 * time.Millisecond),
938 gax.WithRetry(func() gax.Retryer {
939 return gax.OnHTTPCodes(gax.Backoff{
940 Initial: 100 * time.Millisecond,
941 Max: 60000 * time.Millisecond,
942 Multiplier: 1.30,
943 },
944 http.StatusServiceUnavailable,
945 http.StatusTooManyRequests,
946 http.StatusInternalServerError)
947 }),
948 },
949 UpdateTag: []gax.CallOption{
950 gax.WithTimeout(60000 * time.Millisecond),
951 gax.WithRetry(func() gax.Retryer {
952 return gax.OnHTTPCodes(gax.Backoff{
953 Initial: 100 * time.Millisecond,
954 Max: 60000 * time.Millisecond,
955 Multiplier: 1.30,
956 },
957 http.StatusServiceUnavailable,
958 http.StatusTooManyRequests,
959 http.StatusInternalServerError)
960 }),
961 },
962 DeleteTag: []gax.CallOption{
963 gax.WithTimeout(60000 * time.Millisecond),
964 gax.WithRetry(func() gax.Retryer {
965 return gax.OnHTTPCodes(gax.Backoff{
966 Initial: 100 * time.Millisecond,
967 Max: 60000 * time.Millisecond,
968 Multiplier: 1.30,
969 },
970 http.StatusServiceUnavailable,
971 http.StatusTooManyRequests,
972 http.StatusInternalServerError)
973 }),
974 },
975 ListTags: []gax.CallOption{
976 gax.WithTimeout(60000 * time.Millisecond),
977 gax.WithRetry(func() gax.Retryer {
978 return gax.OnHTTPCodes(gax.Backoff{
979 Initial: 100 * time.Millisecond,
980 Max: 60000 * time.Millisecond,
981 Multiplier: 1.30,
982 },
983 http.StatusServiceUnavailable,
984 http.StatusTooManyRequests,
985 http.StatusInternalServerError)
986 }),
987 },
988 ReconcileTags: []gax.CallOption{
989 gax.WithTimeout(60000 * time.Millisecond),
990 gax.WithRetry(func() gax.Retryer {
991 return gax.OnHTTPCodes(gax.Backoff{
992 Initial: 100 * time.Millisecond,
993 Max: 60000 * time.Millisecond,
994 Multiplier: 1.30,
995 },
996 http.StatusServiceUnavailable,
997 http.StatusTooManyRequests,
998 http.StatusInternalServerError)
999 }),
1000 },
1001 StarEntry: []gax.CallOption{
1002 gax.WithTimeout(60000 * time.Millisecond),
1003 gax.WithRetry(func() gax.Retryer {
1004 return gax.OnHTTPCodes(gax.Backoff{
1005 Initial: 100 * time.Millisecond,
1006 Max: 60000 * time.Millisecond,
1007 Multiplier: 1.30,
1008 },
1009 http.StatusServiceUnavailable,
1010 http.StatusTooManyRequests,
1011 http.StatusInternalServerError)
1012 }),
1013 },
1014 UnstarEntry: []gax.CallOption{
1015 gax.WithTimeout(60000 * time.Millisecond),
1016 gax.WithRetry(func() gax.Retryer {
1017 return gax.OnHTTPCodes(gax.Backoff{
1018 Initial: 100 * time.Millisecond,
1019 Max: 60000 * time.Millisecond,
1020 Multiplier: 1.30,
1021 },
1022 http.StatusServiceUnavailable,
1023 http.StatusTooManyRequests,
1024 http.StatusInternalServerError)
1025 }),
1026 },
1027 SetIamPolicy: []gax.CallOption{
1028 gax.WithTimeout(60000 * time.Millisecond),
1029 gax.WithRetry(func() gax.Retryer {
1030 return gax.OnHTTPCodes(gax.Backoff{
1031 Initial: 100 * time.Millisecond,
1032 Max: 60000 * time.Millisecond,
1033 Multiplier: 1.30,
1034 },
1035 http.StatusServiceUnavailable,
1036 http.StatusTooManyRequests,
1037 http.StatusInternalServerError)
1038 }),
1039 },
1040 GetIamPolicy: []gax.CallOption{
1041 gax.WithTimeout(60000 * time.Millisecond),
1042 gax.WithRetry(func() gax.Retryer {
1043 return gax.OnHTTPCodes(gax.Backoff{
1044 Initial: 100 * time.Millisecond,
1045 Max: 60000 * time.Millisecond,
1046 Multiplier: 1.30,
1047 },
1048 http.StatusServiceUnavailable,
1049 http.StatusTooManyRequests,
1050 http.StatusInternalServerError)
1051 }),
1052 },
1053 TestIamPermissions: []gax.CallOption{
1054 gax.WithTimeout(60000 * time.Millisecond),
1055 gax.WithRetry(func() gax.Retryer {
1056 return gax.OnHTTPCodes(gax.Backoff{
1057 Initial: 100 * time.Millisecond,
1058 Max: 60000 * time.Millisecond,
1059 Multiplier: 1.30,
1060 },
1061 http.StatusServiceUnavailable,
1062 http.StatusTooManyRequests,
1063 http.StatusInternalServerError)
1064 }),
1065 },
1066 ImportEntries: []gax.CallOption{
1067 gax.WithTimeout(60000 * time.Millisecond),
1068 gax.WithRetry(func() gax.Retryer {
1069 return gax.OnHTTPCodes(gax.Backoff{
1070 Initial: 100 * time.Millisecond,
1071 Max: 60000 * time.Millisecond,
1072 Multiplier: 1.30,
1073 },
1074 http.StatusServiceUnavailable,
1075 http.StatusTooManyRequests,
1076 http.StatusInternalServerError)
1077 }),
1078 },
1079 SetConfig: []gax.CallOption{
1080 gax.WithTimeout(60000 * time.Millisecond),
1081 gax.WithRetry(func() gax.Retryer {
1082 return gax.OnHTTPCodes(gax.Backoff{
1083 Initial: 100 * time.Millisecond,
1084 Max: 60000 * time.Millisecond,
1085 Multiplier: 1.30,
1086 },
1087 http.StatusServiceUnavailable,
1088 http.StatusTooManyRequests,
1089 http.StatusInternalServerError)
1090 }),
1091 },
1092 RetrieveConfig: []gax.CallOption{
1093 gax.WithTimeout(60000 * time.Millisecond),
1094 gax.WithRetry(func() gax.Retryer {
1095 return gax.OnHTTPCodes(gax.Backoff{
1096 Initial: 100 * time.Millisecond,
1097 Max: 60000 * time.Millisecond,
1098 Multiplier: 1.30,
1099 },
1100 http.StatusServiceUnavailable,
1101 http.StatusTooManyRequests,
1102 http.StatusInternalServerError)
1103 }),
1104 },
1105 RetrieveEffectiveConfig: []gax.CallOption{
1106 gax.WithTimeout(60000 * time.Millisecond),
1107 gax.WithRetry(func() gax.Retryer {
1108 return gax.OnHTTPCodes(gax.Backoff{
1109 Initial: 100 * time.Millisecond,
1110 Max: 60000 * time.Millisecond,
1111 Multiplier: 1.30,
1112 },
1113 http.StatusServiceUnavailable,
1114 http.StatusTooManyRequests,
1115 http.StatusInternalServerError)
1116 }),
1117 },
1118 CancelOperation: []gax.CallOption{},
1119 DeleteOperation: []gax.CallOption{},
1120 GetOperation: []gax.CallOption{},
1121 ListOperations: []gax.CallOption{},
1122 }
1123 }
1124
1125 // internalClient is an interface that defines the methods available from Google Cloud Data Catalog API.
1126 type internalClient interface {
1127 Close() error
1128 setGoogleClientInfo(...string)
1129 Connection() *grpc.ClientConn
1130 SearchCatalog(context.Context, *datacatalogpb.SearchCatalogRequest, ...gax.CallOption) *SearchCatalogResultIterator
1131 CreateEntryGroup(context.Context, *datacatalogpb.CreateEntryGroupRequest, ...gax.CallOption) (*datacatalogpb.EntryGroup, error)
1132 GetEntryGroup(context.Context, *datacatalogpb.GetEntryGroupRequest, ...gax.CallOption) (*datacatalogpb.EntryGroup, error)
1133 UpdateEntryGroup(context.Context, *datacatalogpb.UpdateEntryGroupRequest, ...gax.CallOption) (*datacatalogpb.EntryGroup, error)
1134 DeleteEntryGroup(context.Context, *datacatalogpb.DeleteEntryGroupRequest, ...gax.CallOption) error
1135 ListEntryGroups(context.Context, *datacatalogpb.ListEntryGroupsRequest, ...gax.CallOption) *EntryGroupIterator
1136 CreateEntry(context.Context, *datacatalogpb.CreateEntryRequest, ...gax.CallOption) (*datacatalogpb.Entry, error)
1137 UpdateEntry(context.Context, *datacatalogpb.UpdateEntryRequest, ...gax.CallOption) (*datacatalogpb.Entry, error)
1138 DeleteEntry(context.Context, *datacatalogpb.DeleteEntryRequest, ...gax.CallOption) error
1139 GetEntry(context.Context, *datacatalogpb.GetEntryRequest, ...gax.CallOption) (*datacatalogpb.Entry, error)
1140 LookupEntry(context.Context, *datacatalogpb.LookupEntryRequest, ...gax.CallOption) (*datacatalogpb.Entry, error)
1141 ListEntries(context.Context, *datacatalogpb.ListEntriesRequest, ...gax.CallOption) *EntryIterator
1142 ModifyEntryOverview(context.Context, *datacatalogpb.ModifyEntryOverviewRequest, ...gax.CallOption) (*datacatalogpb.EntryOverview, error)
1143 ModifyEntryContacts(context.Context, *datacatalogpb.ModifyEntryContactsRequest, ...gax.CallOption) (*datacatalogpb.Contacts, error)
1144 CreateTagTemplate(context.Context, *datacatalogpb.CreateTagTemplateRequest, ...gax.CallOption) (*datacatalogpb.TagTemplate, error)
1145 GetTagTemplate(context.Context, *datacatalogpb.GetTagTemplateRequest, ...gax.CallOption) (*datacatalogpb.TagTemplate, error)
1146 UpdateTagTemplate(context.Context, *datacatalogpb.UpdateTagTemplateRequest, ...gax.CallOption) (*datacatalogpb.TagTemplate, error)
1147 DeleteTagTemplate(context.Context, *datacatalogpb.DeleteTagTemplateRequest, ...gax.CallOption) error
1148 CreateTagTemplateField(context.Context, *datacatalogpb.CreateTagTemplateFieldRequest, ...gax.CallOption) (*datacatalogpb.TagTemplateField, error)
1149 UpdateTagTemplateField(context.Context, *datacatalogpb.UpdateTagTemplateFieldRequest, ...gax.CallOption) (*datacatalogpb.TagTemplateField, error)
1150 RenameTagTemplateField(context.Context, *datacatalogpb.RenameTagTemplateFieldRequest, ...gax.CallOption) (*datacatalogpb.TagTemplateField, error)
1151 RenameTagTemplateFieldEnumValue(context.Context, *datacatalogpb.RenameTagTemplateFieldEnumValueRequest, ...gax.CallOption) (*datacatalogpb.TagTemplateField, error)
1152 DeleteTagTemplateField(context.Context, *datacatalogpb.DeleteTagTemplateFieldRequest, ...gax.CallOption) error
1153 CreateTag(context.Context, *datacatalogpb.CreateTagRequest, ...gax.CallOption) (*datacatalogpb.Tag, error)
1154 UpdateTag(context.Context, *datacatalogpb.UpdateTagRequest, ...gax.CallOption) (*datacatalogpb.Tag, error)
1155 DeleteTag(context.Context, *datacatalogpb.DeleteTagRequest, ...gax.CallOption) error
1156 ListTags(context.Context, *datacatalogpb.ListTagsRequest, ...gax.CallOption) *TagIterator
1157 ReconcileTags(context.Context, *datacatalogpb.ReconcileTagsRequest, ...gax.CallOption) (*ReconcileTagsOperation, error)
1158 ReconcileTagsOperation(name string) *ReconcileTagsOperation
1159 StarEntry(context.Context, *datacatalogpb.StarEntryRequest, ...gax.CallOption) (*datacatalogpb.StarEntryResponse, error)
1160 UnstarEntry(context.Context, *datacatalogpb.UnstarEntryRequest, ...gax.CallOption) (*datacatalogpb.UnstarEntryResponse, error)
1161 SetIamPolicy(context.Context, *iampb.SetIamPolicyRequest, ...gax.CallOption) (*iampb.Policy, error)
1162 GetIamPolicy(context.Context, *iampb.GetIamPolicyRequest, ...gax.CallOption) (*iampb.Policy, error)
1163 TestIamPermissions(context.Context, *iampb.TestIamPermissionsRequest, ...gax.CallOption) (*iampb.TestIamPermissionsResponse, error)
1164 ImportEntries(context.Context, *datacatalogpb.ImportEntriesRequest, ...gax.CallOption) (*ImportEntriesOperation, error)
1165 ImportEntriesOperation(name string) *ImportEntriesOperation
1166 SetConfig(context.Context, *datacatalogpb.SetConfigRequest, ...gax.CallOption) (*datacatalogpb.MigrationConfig, error)
1167 RetrieveConfig(context.Context, *datacatalogpb.RetrieveConfigRequest, ...gax.CallOption) (*datacatalogpb.OrganizationConfig, error)
1168 RetrieveEffectiveConfig(context.Context, *datacatalogpb.RetrieveEffectiveConfigRequest, ...gax.CallOption) (*datacatalogpb.MigrationConfig, error)
1169 CancelOperation(context.Context, *longrunningpb.CancelOperationRequest, ...gax.CallOption) error
1170 DeleteOperation(context.Context, *longrunningpb.DeleteOperationRequest, ...gax.CallOption) error
1171 GetOperation(context.Context, *longrunningpb.GetOperationRequest, ...gax.CallOption) (*longrunningpb.Operation, error)
1172 ListOperations(context.Context, *longrunningpb.ListOperationsRequest, ...gax.CallOption) *OperationIterator
1173 }
1174
1175 // Client is a client for interacting with Google Cloud Data Catalog API.
1176 // Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
1177 //
1178 // Deprecated: Please use Dataplex Catalog instead.
1179 //
1180 // Data Catalog API service allows you to discover, understand, and manage
1181 // your data.
1182 //
1183 // Deprecated: DataCatalog may be removed in a future version.
1184 type Client struct {
1185 // The internal transport-dependent client.
1186 internalClient internalClient
1187
1188 // The call options for this service.
1189 CallOptions *CallOptions
1190
1191 // LROClient is used internally to handle long-running operations.
1192 // It is exposed so that its CallOptions can be modified if required.
1193 // Users should not Close this client.
1194 LROClient *lroauto.OperationsClient
1195 }
1196
1197 // Wrapper methods routed to the internal client.
1198
1199 // Close closes the connection to the API service. The user should invoke this when
1200 // the client is no longer required.
1201 func (c *Client) Close() error {
1202 return c.internalClient.Close()
1203 }
1204
1205 // setGoogleClientInfo sets the name and version of the application in
1206 // the `x-goog-api-client` header passed on each request. Intended for
1207 // use by Google-written clients.
1208 func (c *Client) setGoogleClientInfo(keyval ...string) {
1209 c.internalClient.setGoogleClientInfo(keyval...)
1210 }
1211
1212 // Connection returns a connection to the API service.
1213 //
1214 // Deprecated: Connections are now pooled so this method does not always
1215 // return the same resource.
1216 func (c *Client) Connection() *grpc.ClientConn {
1217 return c.internalClient.Connection()
1218 }
1219
1220 // SearchCatalog searches Data Catalog for multiple resources like entries and tags that
1221 // match a query.
1222 //
1223 // This is a [Custom Method]
1224 // (https://cloud.google.com/apis/design/custom_methods (at https://cloud.google.com/apis/design/custom_methods)) that doesn’t return
1225 // all information on a resource, only its ID and high level fields. To get
1226 // more information, you can subsequently call specific get methods.
1227 //
1228 // Note: Data Catalog search queries don’t guarantee full recall. Results
1229 // that match your query might not be returned, even in subsequent
1230 // result pages. Additionally, returned (and not returned) results can vary
1231 // if you repeat search queries.
1232 //
1233 // For more information, see [Data Catalog search syntax]
1234 // (https://cloud.google.com/data-catalog/docs/how-to/search-reference (at https://cloud.google.com/data-catalog/docs/how-to/search-reference)).
1235 //
1236 // Deprecated: SearchCatalog may be removed in a future version.
1237 func (c *Client) SearchCatalog(ctx context.Context, req *datacatalogpb.SearchCatalogRequest, opts ...gax.CallOption) *SearchCatalogResultIterator {
1238 return c.internalClient.SearchCatalog(ctx, req, opts...)
1239 }
1240
1241 // CreateEntryGroup creates an entry group.
1242 //
1243 // An entry group contains logically related entries together with Cloud
1244 // Identity and Access Management (at /data-catalog/docs/concepts/iam) policies.
1245 // These policies specify users who can create, edit, and view entries
1246 // within entry groups.
1247 //
1248 // Data Catalog automatically creates entry groups with names that start with
1249 // the @ symbol for the following resources:
1250 //
1251 // BigQuery entries (@bigquery)
1252 //
1253 // Pub/Sub topics (@pubsub)
1254 //
1255 // Dataproc Metastore services (@dataproc_metastore_{SERVICE_NAME_HASH})
1256 //
1257 // You can create your own entry groups for Cloud Storage fileset entries
1258 // and custom entries together with the corresponding IAM policies.
1259 // User-created entry groups can’t contain the @ symbol, it is reserved
1260 // for automatically created groups.
1261 //
1262 // Entry groups, like entries, can be searched.
1263 //
1264 // A maximum of 10,000 entry groups may be created per organization across all
1265 // locations.
1266 //
1267 // You must enable the Data Catalog API in the project identified by
1268 // the parent parameter. For more information, see Data Catalog resource
1269 // project (at https://cloud.google.com/data-catalog/docs/concepts/resource-project).
1270 //
1271 // Deprecated: CreateEntryGroup may be removed in a future version.
1272 func (c *Client) CreateEntryGroup(ctx context.Context, req *datacatalogpb.CreateEntryGroupRequest, opts ...gax.CallOption) (*datacatalogpb.EntryGroup, error) {
1273 return c.internalClient.CreateEntryGroup(ctx, req, opts...)
1274 }
1275
1276 // GetEntryGroup gets an entry group.
1277 //
1278 // Deprecated: GetEntryGroup may be removed in a future version.
1279 func (c *Client) GetEntryGroup(ctx context.Context, req *datacatalogpb.GetEntryGroupRequest, opts ...gax.CallOption) (*datacatalogpb.EntryGroup, error) {
1280 return c.internalClient.GetEntryGroup(ctx, req, opts...)
1281 }
1282
1283 // UpdateEntryGroup updates an entry group.
1284 //
1285 // You must enable the Data Catalog API in the project identified by
1286 // the entry_group.name parameter. For more information, see Data Catalog
1287 // resource
1288 // project (at https://cloud.google.com/data-catalog/docs/concepts/resource-project).
1289 //
1290 // Deprecated: UpdateEntryGroup may be removed in a future version.
1291 func (c *Client) UpdateEntryGroup(ctx context.Context, req *datacatalogpb.UpdateEntryGroupRequest, opts ...gax.CallOption) (*datacatalogpb.EntryGroup, error) {
1292 return c.internalClient.UpdateEntryGroup(ctx, req, opts...)
1293 }
1294
1295 // DeleteEntryGroup deletes an entry group.
1296 //
1297 // You must enable the Data Catalog API in the project
1298 // identified by the name parameter. For more information, see Data Catalog
1299 // resource
1300 // project (at https://cloud.google.com/data-catalog/docs/concepts/resource-project).
1301 //
1302 // Deprecated: DeleteEntryGroup may be removed in a future version.
1303 func (c *Client) DeleteEntryGroup(ctx context.Context, req *datacatalogpb.DeleteEntryGroupRequest, opts ...gax.CallOption) error {
1304 return c.internalClient.DeleteEntryGroup(ctx, req, opts...)
1305 }
1306
1307 // ListEntryGroups lists entry groups.
1308 //
1309 // Deprecated: ListEntryGroups may be removed in a future version.
1310 func (c *Client) ListEntryGroups(ctx context.Context, req *datacatalogpb.ListEntryGroupsRequest, opts ...gax.CallOption) *EntryGroupIterator {
1311 return c.internalClient.ListEntryGroups(ctx, req, opts...)
1312 }
1313
1314 // CreateEntry creates an entry.
1315 //
1316 // You can create entries only with ‘FILESET’, ‘CLUSTER’, ‘DATA_STREAM’,
1317 // or custom types. Data Catalog automatically creates entries with other
1318 // types during metadata ingestion from integrated systems.
1319 //
1320 // You must enable the Data Catalog API in the project identified by
1321 // the parent parameter. For more information, see Data Catalog resource
1322 // project (at https://cloud.google.com/data-catalog/docs/concepts/resource-project).
1323 //
1324 // An entry group can have a maximum of 100,000 entries.
1325 //
1326 // Deprecated: CreateEntry may be removed in a future version.
1327 func (c *Client) CreateEntry(ctx context.Context, req *datacatalogpb.CreateEntryRequest, opts ...gax.CallOption) (*datacatalogpb.Entry, error) {
1328 return c.internalClient.CreateEntry(ctx, req, opts...)
1329 }
1330
1331 // UpdateEntry updates an existing entry.
1332 //
1333 // You must enable the Data Catalog API in the project identified by
1334 // the entry.name parameter. For more information, see Data Catalog
1335 // resource
1336 // project (at https://cloud.google.com/data-catalog/docs/concepts/resource-project).
1337 //
1338 // Deprecated: UpdateEntry may be removed in a future version.
1339 func (c *Client) UpdateEntry(ctx context.Context, req *datacatalogpb.UpdateEntryRequest, opts ...gax.CallOption) (*datacatalogpb.Entry, error) {
1340 return c.internalClient.UpdateEntry(ctx, req, opts...)
1341 }
1342
1343 // DeleteEntry deletes an existing entry.
1344 //
1345 // You can delete only the entries created by the
1346 // CreateEntry
1347 // method.
1348 //
1349 // You must enable the Data Catalog API in the project identified by
1350 // the name parameter. For more information, see Data Catalog
1351 // resource
1352 // project (at https://cloud.google.com/data-catalog/docs/concepts/resource-project).
1353 //
1354 // Deprecated: DeleteEntry may be removed in a future version.
1355 func (c *Client) DeleteEntry(ctx context.Context, req *datacatalogpb.DeleteEntryRequest, opts ...gax.CallOption) error {
1356 return c.internalClient.DeleteEntry(ctx, req, opts...)
1357 }
1358
1359 // GetEntry gets an entry.
1360 //
1361 // Deprecated: GetEntry may be removed in a future version.
1362 func (c *Client) GetEntry(ctx context.Context, req *datacatalogpb.GetEntryRequest, opts ...gax.CallOption) (*datacatalogpb.Entry, error) {
1363 return c.internalClient.GetEntry(ctx, req, opts...)
1364 }
1365
1366 // LookupEntry gets an entry by its target resource name.
1367 //
1368 // The resource name comes from the source Google Cloud Platform service.
1369 //
1370 // Deprecated: LookupEntry may be removed in a future version.
1371 func (c *Client) LookupEntry(ctx context.Context, req *datacatalogpb.LookupEntryRequest, opts ...gax.CallOption) (*datacatalogpb.Entry, error) {
1372 return c.internalClient.LookupEntry(ctx, req, opts...)
1373 }
1374
1375 // ListEntries lists entries.
1376 //
1377 // Note: Currently, this method can list only custom entries.
1378 // To get a list of both custom and automatically created entries, use
1379 // SearchCatalog.
1380 //
1381 // Deprecated: ListEntries may be removed in a future version.
1382 func (c *Client) ListEntries(ctx context.Context, req *datacatalogpb.ListEntriesRequest, opts ...gax.CallOption) *EntryIterator {
1383 return c.internalClient.ListEntries(ctx, req, opts...)
1384 }
1385
1386 // ModifyEntryOverview modifies entry overview, part of the business context of an
1387 // Entry.
1388 //
1389 // To call this method, you must have the datacatalog.entries.updateOverview
1390 // IAM permission on the corresponding project.
1391 //
1392 // Deprecated: ModifyEntryOverview may be removed in a future version.
1393 func (c *Client) ModifyEntryOverview(ctx context.Context, req *datacatalogpb.ModifyEntryOverviewRequest, opts ...gax.CallOption) (*datacatalogpb.EntryOverview, error) {
1394 return c.internalClient.ModifyEntryOverview(ctx, req, opts...)
1395 }
1396
1397 // ModifyEntryContacts modifies contacts, part of the business context of an
1398 // Entry.
1399 //
1400 // To call this method, you must have the datacatalog.entries.updateContacts
1401 // IAM permission on the corresponding project.
1402 //
1403 // Deprecated: ModifyEntryContacts may be removed in a future version.
1404 func (c *Client) ModifyEntryContacts(ctx context.Context, req *datacatalogpb.ModifyEntryContactsRequest, opts ...gax.CallOption) (*datacatalogpb.Contacts, error) {
1405 return c.internalClient.ModifyEntryContacts(ctx, req, opts...)
1406 }
1407
1408 // CreateTagTemplate creates a tag template.
1409 //
1410 // You must enable the Data Catalog API in the project identified by the
1411 // parent parameter.
1412 // For more information, see [Data Catalog resource project]
1413 // (https://cloud.google.com/data-catalog/docs/concepts/resource-project (at https://cloud.google.com/data-catalog/docs/concepts/resource-project)).
1414 //
1415 // Deprecated: CreateTagTemplate may be removed in a future version.
1416 func (c *Client) CreateTagTemplate(ctx context.Context, req *datacatalogpb.CreateTagTemplateRequest, opts ...gax.CallOption) (*datacatalogpb.TagTemplate, error) {
1417 return c.internalClient.CreateTagTemplate(ctx, req, opts...)
1418 }
1419
1420 // GetTagTemplate gets a tag template.
1421 //
1422 // Deprecated: GetTagTemplate may be removed in a future version.
1423 func (c *Client) GetTagTemplate(ctx context.Context, req *datacatalogpb.GetTagTemplateRequest, opts ...gax.CallOption) (*datacatalogpb.TagTemplate, error) {
1424 return c.internalClient.GetTagTemplate(ctx, req, opts...)
1425 }
1426
1427 // UpdateTagTemplate updates a tag template.
1428 //
1429 // You can’t update template fields with this method. These fields are
1430 // separate resources with their own create, update, and delete methods.
1431 //
1432 // You must enable the Data Catalog API in the project identified by
1433 // the tag_template.name parameter. For more information, see Data Catalog
1434 // resource
1435 // project (at https://cloud.google.com/data-catalog/docs/concepts/resource-project).
1436 //
1437 // Deprecated: UpdateTagTemplate may be removed in a future version.
1438 func (c *Client) UpdateTagTemplate(ctx context.Context, req *datacatalogpb.UpdateTagTemplateRequest, opts ...gax.CallOption) (*datacatalogpb.TagTemplate, error) {
1439 return c.internalClient.UpdateTagTemplate(ctx, req, opts...)
1440 }
1441
1442 // DeleteTagTemplate deletes a tag template and all tags that use it.
1443 //
1444 // You must enable the Data Catalog API in the project identified by
1445 // the name parameter. For more information, see Data Catalog resource
1446 // project (at https://cloud.google.com/data-catalog/docs/concepts/resource-project).
1447 //
1448 // Deprecated: DeleteTagTemplate may be removed in a future version.
1449 func (c *Client) DeleteTagTemplate(ctx context.Context, req *datacatalogpb.DeleteTagTemplateRequest, opts ...gax.CallOption) error {
1450 return c.internalClient.DeleteTagTemplate(ctx, req, opts...)
1451 }
1452
1453 // CreateTagTemplateField creates a field in a tag template.
1454 //
1455 // You must enable the Data Catalog API in the project identified by
1456 // the parent parameter. For more information, see Data Catalog resource
1457 // project (at https://cloud.google.com/data-catalog/docs/concepts/resource-project).
1458 //
1459 // Deprecated: CreateTagTemplateField may be removed in a future version.
1460 func (c *Client) CreateTagTemplateField(ctx context.Context, req *datacatalogpb.CreateTagTemplateFieldRequest, opts ...gax.CallOption) (*datacatalogpb.TagTemplateField, error) {
1461 return c.internalClient.CreateTagTemplateField(ctx, req, opts...)
1462 }
1463
1464 // UpdateTagTemplateField updates a field in a tag template.
1465 //
1466 // You can’t update the field type with this method.
1467 //
1468 // You must enable the Data Catalog API in the project
1469 // identified by the name parameter. For more information, see Data Catalog
1470 // resource
1471 // project (at https://cloud.google.com/data-catalog/docs/concepts/resource-project).
1472 //
1473 // Deprecated: UpdateTagTemplateField may be removed in a future version.
1474 func (c *Client) UpdateTagTemplateField(ctx context.Context, req *datacatalogpb.UpdateTagTemplateFieldRequest, opts ...gax.CallOption) (*datacatalogpb.TagTemplateField, error) {
1475 return c.internalClient.UpdateTagTemplateField(ctx, req, opts...)
1476 }
1477
1478 // RenameTagTemplateField renames a field in a tag template.
1479 //
1480 // You must enable the Data Catalog API in the project identified by the
1481 // name parameter. For more information, see [Data Catalog resource project]
1482 // (https://cloud.google.com/data-catalog/docs/concepts/resource-project (at https://cloud.google.com/data-catalog/docs/concepts/resource-project)).
1483 //
1484 // Deprecated: RenameTagTemplateField may be removed in a future version.
1485 func (c *Client) RenameTagTemplateField(ctx context.Context, req *datacatalogpb.RenameTagTemplateFieldRequest, opts ...gax.CallOption) (*datacatalogpb.TagTemplateField, error) {
1486 return c.internalClient.RenameTagTemplateField(ctx, req, opts...)
1487 }
1488
1489 // RenameTagTemplateFieldEnumValue renames an enum value in a tag template.
1490 //
1491 // Within a single enum field, enum values must be unique.
1492 //
1493 // Deprecated: RenameTagTemplateFieldEnumValue may be removed in a future version.
1494 func (c *Client) RenameTagTemplateFieldEnumValue(ctx context.Context, req *datacatalogpb.RenameTagTemplateFieldEnumValueRequest, opts ...gax.CallOption) (*datacatalogpb.TagTemplateField, error) {
1495 return c.internalClient.RenameTagTemplateFieldEnumValue(ctx, req, opts...)
1496 }
1497
1498 // DeleteTagTemplateField deletes a field in a tag template and all uses of this field from the tags
1499 // based on this template.
1500 //
1501 // You must enable the Data Catalog API in the project identified by
1502 // the name parameter. For more information, see Data Catalog resource
1503 // project (at https://cloud.google.com/data-catalog/docs/concepts/resource-project).
1504 //
1505 // Deprecated: DeleteTagTemplateField may be removed in a future version.
1506 func (c *Client) DeleteTagTemplateField(ctx context.Context, req *datacatalogpb.DeleteTagTemplateFieldRequest, opts ...gax.CallOption) error {
1507 return c.internalClient.DeleteTagTemplateField(ctx, req, opts...)
1508 }
1509
1510 // CreateTag creates a tag and assigns it to:
1511 //
1512 // An Entry if the method name is
1513 // projects.locations.entryGroups.entries.tags.create.
1514 //
1515 // Or EntryGroupif the method
1516 // name is projects.locations.entryGroups.tags.create.
1517 //
1518 // Note: The project identified by the parent parameter for the [tag]
1519 // (https://cloud.google.com/data-catalog/docs/reference/rest/v1/projects.locations.entryGroups.entries.tags/create#path-parameters (at https://cloud.google.com/data-catalog/docs/reference/rest/v1/projects.locations.entryGroups.entries.tags/create#path-parameters))
1520 // and the [tag template]
1521 // (https://cloud.google.com/data-catalog/docs/reference/rest/v1/projects.locations.tagTemplates/create#path-parameters (at https://cloud.google.com/data-catalog/docs/reference/rest/v1/projects.locations.tagTemplates/create#path-parameters))
1522 // used to create the tag must be in the same organization.
1523 //
1524 // Deprecated: CreateTag may be removed in a future version.
1525 func (c *Client) CreateTag(ctx context.Context, req *datacatalogpb.CreateTagRequest, opts ...gax.CallOption) (*datacatalogpb.Tag, error) {
1526 return c.internalClient.CreateTag(ctx, req, opts...)
1527 }
1528
1529 // UpdateTag updates an existing tag.
1530 //
1531 // Deprecated: UpdateTag may be removed in a future version.
1532 func (c *Client) UpdateTag(ctx context.Context, req *datacatalogpb.UpdateTagRequest, opts ...gax.CallOption) (*datacatalogpb.Tag, error) {
1533 return c.internalClient.UpdateTag(ctx, req, opts...)
1534 }
1535
1536 // DeleteTag deletes a tag.
1537 //
1538 // Deprecated: DeleteTag may be removed in a future version.
1539 func (c *Client) DeleteTag(ctx context.Context, req *datacatalogpb.DeleteTagRequest, opts ...gax.CallOption) error {
1540 return c.internalClient.DeleteTag(ctx, req, opts...)
1541 }
1542
1543 // ListTags lists tags assigned to an Entry.
1544 // The columns in the response are
1545 // lowercased.
1546 //
1547 // Deprecated: ListTags may be removed in a future version.
1548 func (c *Client) ListTags(ctx context.Context, req *datacatalogpb.ListTagsRequest, opts ...gax.CallOption) *TagIterator {
1549 return c.internalClient.ListTags(ctx, req, opts...)
1550 }
1551
1552 // ReconcileTags ReconcileTags creates or updates a list of tags on the entry.
1553 // If the
1554 // ReconcileTagsRequest.force_delete_missing
1555 // parameter is set, the operation deletes tags not included in the input tag
1556 // list.
1557 //
1558 // ReconcileTags returns a [long-running operation]
1559 // [google.longrunning.Operation] resource that can be queried with
1560 // Operations.GetOperation
1561 // to return [ReconcileTagsMetadata]
1562 // [google.cloud.datacatalog.v1.ReconcileTagsMetadata] and
1563 // a [ReconcileTagsResponse]
1564 // [google.cloud.datacatalog.v1.ReconcileTagsResponse] message.
1565 //
1566 // Deprecated: ReconcileTags may be removed in a future version.
1567 func (c *Client) ReconcileTags(ctx context.Context, req *datacatalogpb.ReconcileTagsRequest, opts ...gax.CallOption) (*ReconcileTagsOperation, error) {
1568 return c.internalClient.ReconcileTags(ctx, req, opts...)
1569 }
1570
1571 // ReconcileTagsOperation returns a new ReconcileTagsOperation from a given name.
1572 // The name must be that of a previously created ReconcileTagsOperation, possibly from a different process.
1573 func (c *Client) ReconcileTagsOperation(name string) *ReconcileTagsOperation {
1574 return c.internalClient.ReconcileTagsOperation(name)
1575 }
1576
1577 // StarEntry marks an Entry as starred by
1578 // the current user. Starring information is private to each user.
1579 //
1580 // Deprecated: StarEntry may be removed in a future version.
1581 func (c *Client) StarEntry(ctx context.Context, req *datacatalogpb.StarEntryRequest, opts ...gax.CallOption) (*datacatalogpb.StarEntryResponse, error) {
1582 return c.internalClient.StarEntry(ctx, req, opts...)
1583 }
1584
1585 // UnstarEntry marks an Entry as NOT starred by
1586 // the current user. Starring information is private to each user.
1587 //
1588 // Deprecated: UnstarEntry may be removed in a future version.
1589 func (c *Client) UnstarEntry(ctx context.Context, req *datacatalogpb.UnstarEntryRequest, opts ...gax.CallOption) (*datacatalogpb.UnstarEntryResponse, error) {
1590 return c.internalClient.UnstarEntry(ctx, req, opts...)
1591 }
1592
1593 // SetIamPolicy sets an access control policy for a resource. Replaces any existing
1594 // policy.
1595 //
1596 // Supported resources are:
1597 //
1598 // Tag templates
1599 //
1600 // Entry groups
1601 //
1602 // Note: This method sets policies only within Data Catalog and can’t be
1603 // used to manage policies in BigQuery, Pub/Sub, Dataproc Metastore, and any
1604 // external Google Cloud Platform resources synced with the Data Catalog.
1605 //
1606 // To call this method, you must have the following Google IAM permissions:
1607 //
1608 // datacatalog.tagTemplates.setIamPolicy to set policies on tag
1609 // templates.
1610 //
1611 // datacatalog.entryGroups.setIamPolicy to set policies on entry groups.
1612 //
1613 // Deprecated: SetIamPolicy may be removed in a future version.
1614 func (c *Client) SetIamPolicy(ctx context.Context, req *iampb.SetIamPolicyRequest, opts ...gax.CallOption) (*iampb.Policy, error) {
1615 return c.internalClient.SetIamPolicy(ctx, req, opts...)
1616 }
1617
1618 // GetIamPolicy gets the access control policy for a resource.
1619 //
1620 // May return:
1621 //
1622 // ANOT_FOUND error if the resource doesn’t exist or you don’t have the
1623 // permission to view it.
1624 //
1625 // An empty policy if the resource exists but doesn’t have a set policy.
1626 //
1627 // Supported resources are:
1628 //
1629 // Tag templates
1630 //
1631 // Entry groups
1632 //
1633 // Note: This method doesn’t get policies from Google Cloud Platform
1634 // resources ingested into Data Catalog.
1635 //
1636 // To call this method, you must have the following Google IAM permissions:
1637 //
1638 // datacatalog.tagTemplates.getIamPolicy to get policies on tag
1639 // templates.
1640 //
1641 // datacatalog.entryGroups.getIamPolicy to get policies on entry groups.
1642 //
1643 // Deprecated: GetIamPolicy may be removed in a future version.
1644 func (c *Client) GetIamPolicy(ctx context.Context, req *iampb.GetIamPolicyRequest, opts ...gax.CallOption) (*iampb.Policy, error) {
1645 return c.internalClient.GetIamPolicy(ctx, req, opts...)
1646 }
1647
1648 // TestIamPermissions gets your permissions on a resource.
1649 //
1650 // Returns an empty set of permissions if the resource doesn’t exist.
1651 //
1652 // Supported resources are:
1653 //
1654 // Tag templates
1655 //
1656 // Entry groups
1657 //
1658 // Note: This method gets policies only within Data Catalog and can’t be
1659 // used to get policies from BigQuery, Pub/Sub, Dataproc Metastore, and any
1660 // external Google Cloud Platform resources ingested into Data Catalog.
1661 //
1662 // No Google IAM permissions are required to call this method.
1663 //
1664 // Deprecated: TestIamPermissions may be removed in a future version.
1665 func (c *Client) TestIamPermissions(ctx context.Context, req *iampb.TestIamPermissionsRequest, opts ...gax.CallOption) (*iampb.TestIamPermissionsResponse, error) {
1666 return c.internalClient.TestIamPermissions(ctx, req, opts...)
1667 }
1668
1669 // ImportEntries imports entries from a source, such as data previously dumped into a
1670 // Cloud Storage bucket, into Data Catalog. Import of entries
1671 // is a sync operation that reconciles the state of the third-party system
1672 // with the Data Catalog.
1673 //
1674 // ImportEntries accepts source data snapshots of a third-party system.
1675 // Snapshot should be delivered as a .wire or base65-encoded .txt file
1676 // containing a sequence of Protocol Buffer messages of
1677 // DumpItem type.
1678 //
1679 // ImportEntries returns a [long-running operation]
1680 // [google.longrunning.Operation] resource that can be queried with
1681 // Operations.GetOperation
1682 // to return
1683 // ImportEntriesMetadata
1684 // and an
1685 // ImportEntriesResponse
1686 // message.
1687 //
1688 // Deprecated: ImportEntries may be removed in a future version.
1689 func (c *Client) ImportEntries(ctx context.Context, req *datacatalogpb.ImportEntriesRequest, opts ...gax.CallOption) (*ImportEntriesOperation, error) {
1690 return c.internalClient.ImportEntries(ctx, req, opts...)
1691 }
1692
1693 // ImportEntriesOperation returns a new ImportEntriesOperation from a given name.
1694 // The name must be that of a previously created ImportEntriesOperation, possibly from a different process.
1695 func (c *Client) ImportEntriesOperation(name string) *ImportEntriesOperation {
1696 return c.internalClient.ImportEntriesOperation(name)
1697 }
1698
1699 // SetConfig sets the configuration related to the migration to Dataplex for an
1700 // organization or project.
1701 //
1702 // Deprecated: SetConfig may be removed in a future version.
1703 func (c *Client) SetConfig(ctx context.Context, req *datacatalogpb.SetConfigRequest, opts ...gax.CallOption) (*datacatalogpb.MigrationConfig, error) {
1704 return c.internalClient.SetConfig(ctx, req, opts...)
1705 }
1706
1707 // RetrieveConfig retrieves the configuration related to the migration from Data Catalog to
1708 // Dataplex for a specific organization, including all the projects under it
1709 // which have a separate configuration set.
1710 //
1711 // Deprecated: RetrieveConfig may be removed in a future version.
1712 func (c *Client) RetrieveConfig(ctx context.Context, req *datacatalogpb.RetrieveConfigRequest, opts ...gax.CallOption) (*datacatalogpb.OrganizationConfig, error) {
1713 return c.internalClient.RetrieveConfig(ctx, req, opts...)
1714 }
1715
1716 // RetrieveEffectiveConfig retrieves the effective configuration related to the migration from Data
1717 // Catalog to Dataplex for a specific organization or project. If there is no
1718 // specific configuration set for the resource, the setting is checked
1719 // hierarchicahlly through the ancestors of the resource, starting from the
1720 // resource itself.
1721 //
1722 // Deprecated: RetrieveEffectiveConfig may be removed in a future version.
1723 func (c *Client) RetrieveEffectiveConfig(ctx context.Context, req *datacatalogpb.RetrieveEffectiveConfigRequest, opts ...gax.CallOption) (*datacatalogpb.MigrationConfig, error) {
1724 return c.internalClient.RetrieveEffectiveConfig(ctx, req, opts...)
1725 }
1726
1727 // CancelOperation is a utility method from google.longrunning.Operations.
1728 func (c *Client) CancelOperation(ctx context.Context, req *longrunningpb.CancelOperationRequest, opts ...gax.CallOption) error {
1729 return c.internalClient.CancelOperation(ctx, req, opts...)
1730 }
1731
1732 // DeleteOperation is a utility method from google.longrunning.Operations.
1733 func (c *Client) DeleteOperation(ctx context.Context, req *longrunningpb.DeleteOperationRequest, opts ...gax.CallOption) error {
1734 return c.internalClient.DeleteOperation(ctx, req, opts...)
1735 }
1736
1737 // GetOperation is a utility method from google.longrunning.Operations.
1738 func (c *Client) GetOperation(ctx context.Context, req *longrunningpb.GetOperationRequest, opts ...gax.CallOption) (*longrunningpb.Operation, error) {
1739 return c.internalClient.GetOperation(ctx, req, opts...)
1740 }
1741
1742 // ListOperations is a utility method from google.longrunning.Operations.
1743 func (c *Client) ListOperations(ctx context.Context, req *longrunningpb.ListOperationsRequest, opts ...gax.CallOption) *OperationIterator {
1744 return c.internalClient.ListOperations(ctx, req, opts...)
1745 }
1746
1747 // gRPCClient is a client for interacting with Google Cloud Data Catalog API over gRPC transport.
1748 //
1749 // Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
1750 type gRPCClient struct {
1751 // Connection pool of gRPC connections to the service.
1752 connPool gtransport.ConnPool
1753
1754 // Points back to the CallOptions field of the containing Client
1755 CallOptions **CallOptions
1756
1757 // The gRPC API client.
1758 client datacatalogpb.DataCatalogClient
1759
1760 // LROClient is used internally to handle long-running operations.
1761 // It is exposed so that its CallOptions can be modified if required.
1762 // Users should not Close this client.
1763 LROClient **lroauto.OperationsClient
1764
1765 operationsClient longrunningpb.OperationsClient
1766
1767 // The x-goog-* metadata to be sent with each request.
1768 xGoogHeaders []string
1769
1770 logger *slog.Logger
1771 }
1772
1773 // NewClient creates a new data catalog client based on gRPC.
1774 // The returned client must be Closed when it is done being used to clean up its underlying connections.
1775 //
1776 // Deprecated: Please use Dataplex Catalog instead.
1777 //
1778 // Data Catalog API service allows you to discover, understand, and manage
1779 // your data.
1780 //
1781 // Deprecated: DataCatalog may be removed in a future version.
1782 func NewClient(ctx context.Context, opts ...option.ClientOption) (*Client, error) {
1783 clientOpts := defaultGRPCClientOptions()
1784 if newClientHook != nil {
1785 hookOpts, err := newClientHook(ctx, clientHookParams{})
1786 if err != nil {
1787 return nil, err
1788 }
1789 clientOpts = append(clientOpts, hookOpts...)
1790 }
1791
1792 connPool, err := gtransport.DialPool(ctx, append(clientOpts, opts...)...)
1793 if err != nil {
1794 return nil, err
1795 }
1796 client := Client{CallOptions: defaultCallOptions()}
1797
1798 c := &gRPCClient{
1799 connPool: connPool,
1800 client: datacatalogpb.NewDataCatalogClient(connPool),
1801 CallOptions: &client.CallOptions,
1802 logger: internaloption.GetLogger(opts),
1803 operationsClient: longrunningpb.NewOperationsClient(connPool),
1804 }
1805 c.setGoogleClientInfo()
1806
1807 client.internalClient = c
1808
1809 client.LROClient, err = lroauto.NewOperationsClient(ctx, gtransport.WithConnPool(connPool))
1810 if err != nil {
1811 // This error "should not happen", since we are just reusing old connection pool
1812 // and never actually need to dial.
1813 // If this does happen, we could leak connp. However, we cannot close conn:
1814 // If the user invoked the constructor with option.WithGRPCConn,
1815 // we would close a connection that's still in use.
1816 // TODO: investigate error conditions.
1817 return nil, err
1818 }
1819 c.LROClient = &client.LROClient
1820 return &client, nil
1821 }
1822
1823 // Connection returns a connection to the API service.
1824 //
1825 // Deprecated: Connections are now pooled so this method does not always
1826 // return the same resource.
1827 func (c *gRPCClient) Connection() *grpc.ClientConn {
1828 return c.connPool.Conn()
1829 }
1830
1831 // setGoogleClientInfo sets the name and version of the application in
1832 // the `x-goog-api-client` header passed on each request. Intended for
1833 // use by Google-written clients.
1834 func (c *gRPCClient) setGoogleClientInfo(keyval ...string) {
1835 kv := append([]string{"gl-go", gax.GoVersion}, keyval...)
1836 kv = append(kv, "gapic", getVersionClient(), "gax", gax.Version, "grpc", grpc.Version, "pb", protoVersion)
1837 c.xGoogHeaders = []string{
1838 "x-goog-api-client", gax.XGoogHeader(kv...),
1839 }
1840 }
1841
1842 // Close closes the connection to the API service. The user should invoke this when
1843 // the client is no longer required.
1844 func (c *gRPCClient) Close() error {
1845 return c.connPool.Close()
1846 }
1847
1848 // Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
1849 type restClient struct {
1850 // The http endpoint to connect to.
1851 endpoint string
1852
1853 // The http client.
1854 httpClient *http.Client
1855
1856 // LROClient is used internally to handle long-running operations.
1857 // It is exposed so that its CallOptions can be modified if required.
1858 // Users should not Close this client.
1859 LROClient **lroauto.OperationsClient
1860
1861 // The x-goog-* headers to be sent with each request.
1862 xGoogHeaders []string
1863
1864 // Points back to the CallOptions field of the containing Client
1865 CallOptions **CallOptions
1866
1867 logger *slog.Logger
1868 }
1869
1870 // NewRESTClient creates a new data catalog rest client.
1871 //
1872 // Deprecated: Please use Dataplex Catalog instead.
1873 //
1874 // Data Catalog API service allows you to discover, understand, and manage
1875 // your data.
1876 //
1877 // Deprecated: DataCatalog may be removed in a future version.
1878 func NewRESTClient(ctx context.Context, opts ...option.ClientOption) (*Client, error) {
1879 clientOpts := append(defaultRESTClientOptions(), opts...)
1880 httpClient, endpoint, err := httptransport.NewClient(ctx, clientOpts...)
1881 if err != nil {
1882 return nil, err
1883 }
1884
1885 callOpts := defaultRESTCallOptions()
1886 c := &restClient{
1887 endpoint: endpoint,
1888 httpClient: httpClient,
1889 CallOptions: &callOpts,
1890 logger: internaloption.GetLogger(opts),
1891 }
1892 c.setGoogleClientInfo()
1893
1894 lroOpts := []option.ClientOption{
1895 option.WithHTTPClient(httpClient),
1896 option.WithEndpoint(endpoint),
1897 }
1898 opClient, err := lroauto.NewOperationsRESTClient(ctx, lroOpts...)
1899 if err != nil {
1900 return nil, err
1901 }
1902 c.LROClient = &opClient
1903
1904 return &Client{internalClient: c, CallOptions: callOpts}, nil
1905 }
1906
1907 func defaultRESTClientOptions() []option.ClientOption {
1908 return []option.ClientOption{
1909 internaloption.WithDefaultEndpoint("https://datacatalog.googleapis.com"),
1910 internaloption.WithDefaultEndpointTemplate("https://datacatalog.UNIVERSE_DOMAIN"),
1911 internaloption.WithDefaultMTLSEndpoint("https://datacatalog.mtls.googleapis.com"),
1912 internaloption.WithDefaultUniverseDomain("googleapis.com"),
1913 internaloption.WithDefaultAudience("https://datacatalog.googleapis.com/"),
1914 internaloption.WithDefaultScopes(DefaultAuthScopes()...),
1915 internaloption.EnableNewAuthLibrary(),
1916 }
1917 }
1918
1919 // setGoogleClientInfo sets the name and version of the application in
1920 // the `x-goog-api-client` header passed on each request. Intended for
1921 // use by Google-written clients.
1922 func (c *restClient) setGoogleClientInfo(keyval ...string) {
1923 kv := append([]string{"gl-go", gax.GoVersion}, keyval...)
1924 kv = append(kv, "gapic", getVersionClient(), "gax", gax.Version, "rest", "UNKNOWN", "pb", protoVersion)
1925 c.xGoogHeaders = []string{
1926 "x-goog-api-client", gax.XGoogHeader(kv...),
1927 }
1928 }
1929
1930 // Close closes the connection to the API service. The user should invoke this when
1931 // the client is no longer required.
1932 func (c *restClient) Close() error {
1933 // Replace httpClient with nil to force cleanup.
1934 c.httpClient = nil
1935 return nil
1936 }
1937
1938 // Connection returns a connection to the API service.
1939 //
1940 // Deprecated: This method always returns nil.
1941 func (c *restClient) Connection() *grpc.ClientConn {
1942 return nil
1943 }
1944 func (c *gRPCClient) SearchCatalog(ctx context.Context, req *datacatalogpb.SearchCatalogRequest, opts ...gax.CallOption) *SearchCatalogResultIterator {
1945 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, c.xGoogHeaders...)
1946 opts = append((*c.CallOptions).SearchCatalog[0:len((*c.CallOptions).SearchCatalog):len((*c.CallOptions).SearchCatalog)], opts...)
1947 it := &SearchCatalogResultIterator{}
1948 req = proto.Clone(req).(*datacatalogpb.SearchCatalogRequest)
1949 it.InternalFetch = func(pageSize int, pageToken string) ([]*datacatalogpb.SearchCatalogResult, string, error) {
1950 resp := &datacatalogpb.SearchCatalogResponse{}
1951 if pageToken != "" {
1952 req.PageToken = pageToken
1953 }
1954 if pageSize > math.MaxInt32 {
1955 req.PageSize = math.MaxInt32
1956 } else if pageSize != 0 {
1957 req.PageSize = int32(pageSize)
1958 }
1959 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
1960 var err error
1961 resp, err = executeRPC(ctx, c.client.SearchCatalog, req, settings.GRPC, c.logger, "SearchCatalog")
1962 return err
1963 }, opts...)
1964 if err != nil {
1965 return nil, "", err
1966 }
1967
1968 it.Response = resp
1969 return resp.GetResults(), resp.GetNextPageToken(), nil
1970 }
1971 fetch := func(pageSize int, pageToken string) (string, error) {
1972 items, nextPageToken, err := it.InternalFetch(pageSize, pageToken)
1973 if err != nil {
1974 return "", err
1975 }
1976 it.items = append(it.items, items...)
1977 return nextPageToken, nil
1978 }
1979
1980 it.pageInfo, it.nextFunc = iterator.NewPageInfo(fetch, it.bufLen, it.takeBuf)
1981 it.pageInfo.MaxSize = int(req.GetPageSize())
1982 it.pageInfo.Token = req.GetPageToken()
1983
1984 return it
1985 }
1986
1987 func (c *gRPCClient) CreateEntryGroup(ctx context.Context, req *datacatalogpb.CreateEntryGroupRequest, opts ...gax.CallOption) (*datacatalogpb.EntryGroup, error) {
1988 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))}
1989
1990 hds = append(c.xGoogHeaders, hds...)
1991 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
1992 opts = append((*c.CallOptions).CreateEntryGroup[0:len((*c.CallOptions).CreateEntryGroup):len((*c.CallOptions).CreateEntryGroup)], opts...)
1993 var resp *datacatalogpb.EntryGroup
1994 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
1995 var err error
1996 resp, err = executeRPC(ctx, c.client.CreateEntryGroup, req, settings.GRPC, c.logger, "CreateEntryGroup")
1997 return err
1998 }, opts...)
1999 if err != nil {
2000 return nil, err
2001 }
2002 return resp, nil
2003 }
2004
2005 func (c *gRPCClient) GetEntryGroup(ctx context.Context, req *datacatalogpb.GetEntryGroupRequest, opts ...gax.CallOption) (*datacatalogpb.EntryGroup, error) {
2006 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
2007
2008 hds = append(c.xGoogHeaders, hds...)
2009 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
2010 opts = append((*c.CallOptions).GetEntryGroup[0:len((*c.CallOptions).GetEntryGroup):len((*c.CallOptions).GetEntryGroup)], opts...)
2011 var resp *datacatalogpb.EntryGroup
2012 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
2013 var err error
2014 resp, err = executeRPC(ctx, c.client.GetEntryGroup, req, settings.GRPC, c.logger, "GetEntryGroup")
2015 return err
2016 }, opts...)
2017 if err != nil {
2018 return nil, err
2019 }
2020 return resp, nil
2021 }
2022
2023 func (c *gRPCClient) UpdateEntryGroup(ctx context.Context, req *datacatalogpb.UpdateEntryGroupRequest, opts ...gax.CallOption) (*datacatalogpb.EntryGroup, error) {
2024 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "entry_group.name", url.QueryEscape(req.GetEntryGroup().GetName()))}
2025
2026 hds = append(c.xGoogHeaders, hds...)
2027 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
2028 opts = append((*c.CallOptions).UpdateEntryGroup[0:len((*c.CallOptions).UpdateEntryGroup):len((*c.CallOptions).UpdateEntryGroup)], opts...)
2029 var resp *datacatalogpb.EntryGroup
2030 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
2031 var err error
2032 resp, err = executeRPC(ctx, c.client.UpdateEntryGroup, req, settings.GRPC, c.logger, "UpdateEntryGroup")
2033 return err
2034 }, opts...)
2035 if err != nil {
2036 return nil, err
2037 }
2038 return resp, nil
2039 }
2040
2041 func (c *gRPCClient) DeleteEntryGroup(ctx context.Context, req *datacatalogpb.DeleteEntryGroupRequest, opts ...gax.CallOption) error {
2042 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
2043
2044 hds = append(c.xGoogHeaders, hds...)
2045 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
2046 opts = append((*c.CallOptions).DeleteEntryGroup[0:len((*c.CallOptions).DeleteEntryGroup):len((*c.CallOptions).DeleteEntryGroup)], opts...)
2047 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
2048 var err error
2049 _, err = executeRPC(ctx, c.client.DeleteEntryGroup, req, settings.GRPC, c.logger, "DeleteEntryGroup")
2050 return err
2051 }, opts...)
2052 return err
2053 }
2054
2055 func (c *gRPCClient) ListEntryGroups(ctx context.Context, req *datacatalogpb.ListEntryGroupsRequest, opts ...gax.CallOption) *EntryGroupIterator {
2056 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))}
2057
2058 hds = append(c.xGoogHeaders, hds...)
2059 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
2060 opts = append((*c.CallOptions).ListEntryGroups[0:len((*c.CallOptions).ListEntryGroups):len((*c.CallOptions).ListEntryGroups)], opts...)
2061 it := &EntryGroupIterator{}
2062 req = proto.Clone(req).(*datacatalogpb.ListEntryGroupsRequest)
2063 it.InternalFetch = func(pageSize int, pageToken string) ([]*datacatalogpb.EntryGroup, string, error) {
2064 resp := &datacatalogpb.ListEntryGroupsResponse{}
2065 if pageToken != "" {
2066 req.PageToken = pageToken
2067 }
2068 if pageSize > math.MaxInt32 {
2069 req.PageSize = math.MaxInt32
2070 } else if pageSize != 0 {
2071 req.PageSize = int32(pageSize)
2072 }
2073 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
2074 var err error
2075 resp, err = executeRPC(ctx, c.client.ListEntryGroups, req, settings.GRPC, c.logger, "ListEntryGroups")
2076 return err
2077 }, opts...)
2078 if err != nil {
2079 return nil, "", err
2080 }
2081
2082 it.Response = resp
2083 return resp.GetEntryGroups(), resp.GetNextPageToken(), nil
2084 }
2085 fetch := func(pageSize int, pageToken string) (string, error) {
2086 items, nextPageToken, err := it.InternalFetch(pageSize, pageToken)
2087 if err != nil {
2088 return "", err
2089 }
2090 it.items = append(it.items, items...)
2091 return nextPageToken, nil
2092 }
2093
2094 it.pageInfo, it.nextFunc = iterator.NewPageInfo(fetch, it.bufLen, it.takeBuf)
2095 it.pageInfo.MaxSize = int(req.GetPageSize())
2096 it.pageInfo.Token = req.GetPageToken()
2097
2098 return it
2099 }
2100
2101 func (c *gRPCClient) CreateEntry(ctx context.Context, req *datacatalogpb.CreateEntryRequest, opts ...gax.CallOption) (*datacatalogpb.Entry, error) {
2102 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))}
2103
2104 hds = append(c.xGoogHeaders, hds...)
2105 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
2106 opts = append((*c.CallOptions).CreateEntry[0:len((*c.CallOptions).CreateEntry):len((*c.CallOptions).CreateEntry)], opts...)
2107 var resp *datacatalogpb.Entry
2108 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
2109 var err error
2110 resp, err = executeRPC(ctx, c.client.CreateEntry, req, settings.GRPC, c.logger, "CreateEntry")
2111 return err
2112 }, opts...)
2113 if err != nil {
2114 return nil, err
2115 }
2116 return resp, nil
2117 }
2118
2119 func (c *gRPCClient) UpdateEntry(ctx context.Context, req *datacatalogpb.UpdateEntryRequest, opts ...gax.CallOption) (*datacatalogpb.Entry, error) {
2120 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "entry.name", url.QueryEscape(req.GetEntry().GetName()))}
2121
2122 hds = append(c.xGoogHeaders, hds...)
2123 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
2124 opts = append((*c.CallOptions).UpdateEntry[0:len((*c.CallOptions).UpdateEntry):len((*c.CallOptions).UpdateEntry)], opts...)
2125 var resp *datacatalogpb.Entry
2126 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
2127 var err error
2128 resp, err = executeRPC(ctx, c.client.UpdateEntry, req, settings.GRPC, c.logger, "UpdateEntry")
2129 return err
2130 }, opts...)
2131 if err != nil {
2132 return nil, err
2133 }
2134 return resp, nil
2135 }
2136
2137 func (c *gRPCClient) DeleteEntry(ctx context.Context, req *datacatalogpb.DeleteEntryRequest, opts ...gax.CallOption) error {
2138 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
2139
2140 hds = append(c.xGoogHeaders, hds...)
2141 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
2142 opts = append((*c.CallOptions).DeleteEntry[0:len((*c.CallOptions).DeleteEntry):len((*c.CallOptions).DeleteEntry)], opts...)
2143 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
2144 var err error
2145 _, err = executeRPC(ctx, c.client.DeleteEntry, req, settings.GRPC, c.logger, "DeleteEntry")
2146 return err
2147 }, opts...)
2148 return err
2149 }
2150
2151 func (c *gRPCClient) GetEntry(ctx context.Context, req *datacatalogpb.GetEntryRequest, opts ...gax.CallOption) (*datacatalogpb.Entry, error) {
2152 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
2153
2154 hds = append(c.xGoogHeaders, hds...)
2155 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
2156 opts = append((*c.CallOptions).GetEntry[0:len((*c.CallOptions).GetEntry):len((*c.CallOptions).GetEntry)], opts...)
2157 var resp *datacatalogpb.Entry
2158 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
2159 var err error
2160 resp, err = executeRPC(ctx, c.client.GetEntry, req, settings.GRPC, c.logger, "GetEntry")
2161 return err
2162 }, opts...)
2163 if err != nil {
2164 return nil, err
2165 }
2166 return resp, nil
2167 }
2168
2169 func (c *gRPCClient) LookupEntry(ctx context.Context, req *datacatalogpb.LookupEntryRequest, opts ...gax.CallOption) (*datacatalogpb.Entry, error) {
2170 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, c.xGoogHeaders...)
2171 opts = append((*c.CallOptions).LookupEntry[0:len((*c.CallOptions).LookupEntry):len((*c.CallOptions).LookupEntry)], opts...)
2172 var resp *datacatalogpb.Entry
2173 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
2174 var err error
2175 resp, err = executeRPC(ctx, c.client.LookupEntry, req, settings.GRPC, c.logger, "LookupEntry")
2176 return err
2177 }, opts...)
2178 if err != nil {
2179 return nil, err
2180 }
2181 return resp, nil
2182 }
2183
2184 func (c *gRPCClient) ListEntries(ctx context.Context, req *datacatalogpb.ListEntriesRequest, opts ...gax.CallOption) *EntryIterator {
2185 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))}
2186
2187 hds = append(c.xGoogHeaders, hds...)
2188 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
2189 opts = append((*c.CallOptions).ListEntries[0:len((*c.CallOptions).ListEntries):len((*c.CallOptions).ListEntries)], opts...)
2190 it := &EntryIterator{}
2191 req = proto.Clone(req).(*datacatalogpb.ListEntriesRequest)
2192 it.InternalFetch = func(pageSize int, pageToken string) ([]*datacatalogpb.Entry, string, error) {
2193 resp := &datacatalogpb.ListEntriesResponse{}
2194 if pageToken != "" {
2195 req.PageToken = pageToken
2196 }
2197 if pageSize > math.MaxInt32 {
2198 req.PageSize = math.MaxInt32
2199 } else if pageSize != 0 {
2200 req.PageSize = int32(pageSize)
2201 }
2202 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
2203 var err error
2204 resp, err = executeRPC(ctx, c.client.ListEntries, req, settings.GRPC, c.logger, "ListEntries")
2205 return err
2206 }, opts...)
2207 if err != nil {
2208 return nil, "", err
2209 }
2210
2211 it.Response = resp
2212 return resp.GetEntries(), resp.GetNextPageToken(), nil
2213 }
2214 fetch := func(pageSize int, pageToken string) (string, error) {
2215 items, nextPageToken, err := it.InternalFetch(pageSize, pageToken)
2216 if err != nil {
2217 return "", err
2218 }
2219 it.items = append(it.items, items...)
2220 return nextPageToken, nil
2221 }
2222
2223 it.pageInfo, it.nextFunc = iterator.NewPageInfo(fetch, it.bufLen, it.takeBuf)
2224 it.pageInfo.MaxSize = int(req.GetPageSize())
2225 it.pageInfo.Token = req.GetPageToken()
2226
2227 return it
2228 }
2229
2230 func (c *gRPCClient) ModifyEntryOverview(ctx context.Context, req *datacatalogpb.ModifyEntryOverviewRequest, opts ...gax.CallOption) (*datacatalogpb.EntryOverview, error) {
2231 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
2232
2233 hds = append(c.xGoogHeaders, hds...)
2234 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
2235 opts = append((*c.CallOptions).ModifyEntryOverview[0:len((*c.CallOptions).ModifyEntryOverview):len((*c.CallOptions).ModifyEntryOverview)], opts...)
2236 var resp *datacatalogpb.EntryOverview
2237 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
2238 var err error
2239 resp, err = executeRPC(ctx, c.client.ModifyEntryOverview, req, settings.GRPC, c.logger, "ModifyEntryOverview")
2240 return err
2241 }, opts...)
2242 if err != nil {
2243 return nil, err
2244 }
2245 return resp, nil
2246 }
2247
2248 func (c *gRPCClient) ModifyEntryContacts(ctx context.Context, req *datacatalogpb.ModifyEntryContactsRequest, opts ...gax.CallOption) (*datacatalogpb.Contacts, error) {
2249 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
2250
2251 hds = append(c.xGoogHeaders, hds...)
2252 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
2253 opts = append((*c.CallOptions).ModifyEntryContacts[0:len((*c.CallOptions).ModifyEntryContacts):len((*c.CallOptions).ModifyEntryContacts)], opts...)
2254 var resp *datacatalogpb.Contacts
2255 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
2256 var err error
2257 resp, err = executeRPC(ctx, c.client.ModifyEntryContacts, req, settings.GRPC, c.logger, "ModifyEntryContacts")
2258 return err
2259 }, opts...)
2260 if err != nil {
2261 return nil, err
2262 }
2263 return resp, nil
2264 }
2265
2266 func (c *gRPCClient) CreateTagTemplate(ctx context.Context, req *datacatalogpb.CreateTagTemplateRequest, opts ...gax.CallOption) (*datacatalogpb.TagTemplate, error) {
2267 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))}
2268
2269 hds = append(c.xGoogHeaders, hds...)
2270 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
2271 opts = append((*c.CallOptions).CreateTagTemplate[0:len((*c.CallOptions).CreateTagTemplate):len((*c.CallOptions).CreateTagTemplate)], opts...)
2272 var resp *datacatalogpb.TagTemplate
2273 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
2274 var err error
2275 resp, err = executeRPC(ctx, c.client.CreateTagTemplate, req, settings.GRPC, c.logger, "CreateTagTemplate")
2276 return err
2277 }, opts...)
2278 if err != nil {
2279 return nil, err
2280 }
2281 return resp, nil
2282 }
2283
2284 func (c *gRPCClient) GetTagTemplate(ctx context.Context, req *datacatalogpb.GetTagTemplateRequest, opts ...gax.CallOption) (*datacatalogpb.TagTemplate, error) {
2285 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
2286
2287 hds = append(c.xGoogHeaders, hds...)
2288 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
2289 opts = append((*c.CallOptions).GetTagTemplate[0:len((*c.CallOptions).GetTagTemplate):len((*c.CallOptions).GetTagTemplate)], opts...)
2290 var resp *datacatalogpb.TagTemplate
2291 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
2292 var err error
2293 resp, err = executeRPC(ctx, c.client.GetTagTemplate, req, settings.GRPC, c.logger, "GetTagTemplate")
2294 return err
2295 }, opts...)
2296 if err != nil {
2297 return nil, err
2298 }
2299 return resp, nil
2300 }
2301
2302 func (c *gRPCClient) UpdateTagTemplate(ctx context.Context, req *datacatalogpb.UpdateTagTemplateRequest, opts ...gax.CallOption) (*datacatalogpb.TagTemplate, error) {
2303 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "tag_template.name", url.QueryEscape(req.GetTagTemplate().GetName()))}
2304
2305 hds = append(c.xGoogHeaders, hds...)
2306 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
2307 opts = append((*c.CallOptions).UpdateTagTemplate[0:len((*c.CallOptions).UpdateTagTemplate):len((*c.CallOptions).UpdateTagTemplate)], opts...)
2308 var resp *datacatalogpb.TagTemplate
2309 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
2310 var err error
2311 resp, err = executeRPC(ctx, c.client.UpdateTagTemplate, req, settings.GRPC, c.logger, "UpdateTagTemplate")
2312 return err
2313 }, opts...)
2314 if err != nil {
2315 return nil, err
2316 }
2317 return resp, nil
2318 }
2319
2320 func (c *gRPCClient) DeleteTagTemplate(ctx context.Context, req *datacatalogpb.DeleteTagTemplateRequest, opts ...gax.CallOption) error {
2321 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
2322
2323 hds = append(c.xGoogHeaders, hds...)
2324 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
2325 opts = append((*c.CallOptions).DeleteTagTemplate[0:len((*c.CallOptions).DeleteTagTemplate):len((*c.CallOptions).DeleteTagTemplate)], opts...)
2326 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
2327 var err error
2328 _, err = executeRPC(ctx, c.client.DeleteTagTemplate, req, settings.GRPC, c.logger, "DeleteTagTemplate")
2329 return err
2330 }, opts...)
2331 return err
2332 }
2333
2334 func (c *gRPCClient) CreateTagTemplateField(ctx context.Context, req *datacatalogpb.CreateTagTemplateFieldRequest, opts ...gax.CallOption) (*datacatalogpb.TagTemplateField, error) {
2335 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))}
2336
2337 hds = append(c.xGoogHeaders, hds...)
2338 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
2339 opts = append((*c.CallOptions).CreateTagTemplateField[0:len((*c.CallOptions).CreateTagTemplateField):len((*c.CallOptions).CreateTagTemplateField)], opts...)
2340 var resp *datacatalogpb.TagTemplateField
2341 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
2342 var err error
2343 resp, err = executeRPC(ctx, c.client.CreateTagTemplateField, req, settings.GRPC, c.logger, "CreateTagTemplateField")
2344 return err
2345 }, opts...)
2346 if err != nil {
2347 return nil, err
2348 }
2349 return resp, nil
2350 }
2351
2352 func (c *gRPCClient) UpdateTagTemplateField(ctx context.Context, req *datacatalogpb.UpdateTagTemplateFieldRequest, opts ...gax.CallOption) (*datacatalogpb.TagTemplateField, error) {
2353 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
2354
2355 hds = append(c.xGoogHeaders, hds...)
2356 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
2357 opts = append((*c.CallOptions).UpdateTagTemplateField[0:len((*c.CallOptions).UpdateTagTemplateField):len((*c.CallOptions).UpdateTagTemplateField)], opts...)
2358 var resp *datacatalogpb.TagTemplateField
2359 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
2360 var err error
2361 resp, err = executeRPC(ctx, c.client.UpdateTagTemplateField, req, settings.GRPC, c.logger, "UpdateTagTemplateField")
2362 return err
2363 }, opts...)
2364 if err != nil {
2365 return nil, err
2366 }
2367 return resp, nil
2368 }
2369
2370 func (c *gRPCClient) RenameTagTemplateField(ctx context.Context, req *datacatalogpb.RenameTagTemplateFieldRequest, opts ...gax.CallOption) (*datacatalogpb.TagTemplateField, error) {
2371 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
2372
2373 hds = append(c.xGoogHeaders, hds...)
2374 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
2375 opts = append((*c.CallOptions).RenameTagTemplateField[0:len((*c.CallOptions).RenameTagTemplateField):len((*c.CallOptions).RenameTagTemplateField)], opts...)
2376 var resp *datacatalogpb.TagTemplateField
2377 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
2378 var err error
2379 resp, err = executeRPC(ctx, c.client.RenameTagTemplateField, req, settings.GRPC, c.logger, "RenameTagTemplateField")
2380 return err
2381 }, opts...)
2382 if err != nil {
2383 return nil, err
2384 }
2385 return resp, nil
2386 }
2387
2388 func (c *gRPCClient) RenameTagTemplateFieldEnumValue(ctx context.Context, req *datacatalogpb.RenameTagTemplateFieldEnumValueRequest, opts ...gax.CallOption) (*datacatalogpb.TagTemplateField, error) {
2389 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
2390
2391 hds = append(c.xGoogHeaders, hds...)
2392 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
2393 opts = append((*c.CallOptions).RenameTagTemplateFieldEnumValue[0:len((*c.CallOptions).RenameTagTemplateFieldEnumValue):len((*c.CallOptions).RenameTagTemplateFieldEnumValue)], opts...)
2394 var resp *datacatalogpb.TagTemplateField
2395 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
2396 var err error
2397 resp, err = executeRPC(ctx, c.client.RenameTagTemplateFieldEnumValue, req, settings.GRPC, c.logger, "RenameTagTemplateFieldEnumValue")
2398 return err
2399 }, opts...)
2400 if err != nil {
2401 return nil, err
2402 }
2403 return resp, nil
2404 }
2405
2406 func (c *gRPCClient) DeleteTagTemplateField(ctx context.Context, req *datacatalogpb.DeleteTagTemplateFieldRequest, opts ...gax.CallOption) error {
2407 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
2408
2409 hds = append(c.xGoogHeaders, hds...)
2410 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
2411 opts = append((*c.CallOptions).DeleteTagTemplateField[0:len((*c.CallOptions).DeleteTagTemplateField):len((*c.CallOptions).DeleteTagTemplateField)], opts...)
2412 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
2413 var err error
2414 _, err = executeRPC(ctx, c.client.DeleteTagTemplateField, req, settings.GRPC, c.logger, "DeleteTagTemplateField")
2415 return err
2416 }, opts...)
2417 return err
2418 }
2419
2420 func (c *gRPCClient) CreateTag(ctx context.Context, req *datacatalogpb.CreateTagRequest, opts ...gax.CallOption) (*datacatalogpb.Tag, error) {
2421 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))}
2422
2423 hds = append(c.xGoogHeaders, hds...)
2424 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
2425 opts = append((*c.CallOptions).CreateTag[0:len((*c.CallOptions).CreateTag):len((*c.CallOptions).CreateTag)], opts...)
2426 var resp *datacatalogpb.Tag
2427 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
2428 var err error
2429 resp, err = executeRPC(ctx, c.client.CreateTag, req, settings.GRPC, c.logger, "CreateTag")
2430 return err
2431 }, opts...)
2432 if err != nil {
2433 return nil, err
2434 }
2435 return resp, nil
2436 }
2437
2438 func (c *gRPCClient) UpdateTag(ctx context.Context, req *datacatalogpb.UpdateTagRequest, opts ...gax.CallOption) (*datacatalogpb.Tag, error) {
2439 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "tag.name", url.QueryEscape(req.GetTag().GetName()))}
2440
2441 hds = append(c.xGoogHeaders, hds...)
2442 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
2443 opts = append((*c.CallOptions).UpdateTag[0:len((*c.CallOptions).UpdateTag):len((*c.CallOptions).UpdateTag)], opts...)
2444 var resp *datacatalogpb.Tag
2445 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
2446 var err error
2447 resp, err = executeRPC(ctx, c.client.UpdateTag, req, settings.GRPC, c.logger, "UpdateTag")
2448 return err
2449 }, opts...)
2450 if err != nil {
2451 return nil, err
2452 }
2453 return resp, nil
2454 }
2455
2456 func (c *gRPCClient) DeleteTag(ctx context.Context, req *datacatalogpb.DeleteTagRequest, opts ...gax.CallOption) error {
2457 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
2458
2459 hds = append(c.xGoogHeaders, hds...)
2460 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
2461 opts = append((*c.CallOptions).DeleteTag[0:len((*c.CallOptions).DeleteTag):len((*c.CallOptions).DeleteTag)], opts...)
2462 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
2463 var err error
2464 _, err = executeRPC(ctx, c.client.DeleteTag, req, settings.GRPC, c.logger, "DeleteTag")
2465 return err
2466 }, opts...)
2467 return err
2468 }
2469
2470 func (c *gRPCClient) ListTags(ctx context.Context, req *datacatalogpb.ListTagsRequest, opts ...gax.CallOption) *TagIterator {
2471 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))}
2472
2473 hds = append(c.xGoogHeaders, hds...)
2474 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
2475 opts = append((*c.CallOptions).ListTags[0:len((*c.CallOptions).ListTags):len((*c.CallOptions).ListTags)], opts...)
2476 it := &TagIterator{}
2477 req = proto.Clone(req).(*datacatalogpb.ListTagsRequest)
2478 it.InternalFetch = func(pageSize int, pageToken string) ([]*datacatalogpb.Tag, string, error) {
2479 resp := &datacatalogpb.ListTagsResponse{}
2480 if pageToken != "" {
2481 req.PageToken = pageToken
2482 }
2483 if pageSize > math.MaxInt32 {
2484 req.PageSize = math.MaxInt32
2485 } else if pageSize != 0 {
2486 req.PageSize = int32(pageSize)
2487 }
2488 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
2489 var err error
2490 resp, err = executeRPC(ctx, c.client.ListTags, req, settings.GRPC, c.logger, "ListTags")
2491 return err
2492 }, opts...)
2493 if err != nil {
2494 return nil, "", err
2495 }
2496
2497 it.Response = resp
2498 return resp.GetTags(), resp.GetNextPageToken(), nil
2499 }
2500 fetch := func(pageSize int, pageToken string) (string, error) {
2501 items, nextPageToken, err := it.InternalFetch(pageSize, pageToken)
2502 if err != nil {
2503 return "", err
2504 }
2505 it.items = append(it.items, items...)
2506 return nextPageToken, nil
2507 }
2508
2509 it.pageInfo, it.nextFunc = iterator.NewPageInfo(fetch, it.bufLen, it.takeBuf)
2510 it.pageInfo.MaxSize = int(req.GetPageSize())
2511 it.pageInfo.Token = req.GetPageToken()
2512
2513 return it
2514 }
2515
2516 func (c *gRPCClient) ReconcileTags(ctx context.Context, req *datacatalogpb.ReconcileTagsRequest, opts ...gax.CallOption) (*ReconcileTagsOperation, error) {
2517 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))}
2518
2519 hds = append(c.xGoogHeaders, hds...)
2520 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
2521 opts = append((*c.CallOptions).ReconcileTags[0:len((*c.CallOptions).ReconcileTags):len((*c.CallOptions).ReconcileTags)], opts...)
2522 var resp *longrunningpb.Operation
2523 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
2524 var err error
2525 resp, err = executeRPC(ctx, c.client.ReconcileTags, req, settings.GRPC, c.logger, "ReconcileTags")
2526 return err
2527 }, opts...)
2528 if err != nil {
2529 return nil, err
2530 }
2531 return &ReconcileTagsOperation{
2532 lro: longrunning.InternalNewOperation(*c.LROClient, resp),
2533 }, nil
2534 }
2535
2536 func (c *gRPCClient) StarEntry(ctx context.Context, req *datacatalogpb.StarEntryRequest, opts ...gax.CallOption) (*datacatalogpb.StarEntryResponse, error) {
2537 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
2538
2539 hds = append(c.xGoogHeaders, hds...)
2540 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
2541 opts = append((*c.CallOptions).StarEntry[0:len((*c.CallOptions).StarEntry):len((*c.CallOptions).StarEntry)], opts...)
2542 var resp *datacatalogpb.StarEntryResponse
2543 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
2544 var err error
2545 resp, err = executeRPC(ctx, c.client.StarEntry, req, settings.GRPC, c.logger, "StarEntry")
2546 return err
2547 }, opts...)
2548 if err != nil {
2549 return nil, err
2550 }
2551 return resp, nil
2552 }
2553
2554 func (c *gRPCClient) UnstarEntry(ctx context.Context, req *datacatalogpb.UnstarEntryRequest, opts ...gax.CallOption) (*datacatalogpb.UnstarEntryResponse, error) {
2555 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
2556
2557 hds = append(c.xGoogHeaders, hds...)
2558 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
2559 opts = append((*c.CallOptions).UnstarEntry[0:len((*c.CallOptions).UnstarEntry):len((*c.CallOptions).UnstarEntry)], opts...)
2560 var resp *datacatalogpb.UnstarEntryResponse
2561 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
2562 var err error
2563 resp, err = executeRPC(ctx, c.client.UnstarEntry, req, settings.GRPC, c.logger, "UnstarEntry")
2564 return err
2565 }, opts...)
2566 if err != nil {
2567 return nil, err
2568 }
2569 return resp, nil
2570 }
2571
2572 func (c *gRPCClient) SetIamPolicy(ctx context.Context, req *iampb.SetIamPolicyRequest, opts ...gax.CallOption) (*iampb.Policy, error) {
2573 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "resource", url.QueryEscape(req.GetResource()))}
2574
2575 hds = append(c.xGoogHeaders, hds...)
2576 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
2577 opts = append((*c.CallOptions).SetIamPolicy[0:len((*c.CallOptions).SetIamPolicy):len((*c.CallOptions).SetIamPolicy)], opts...)
2578 var resp *iampb.Policy
2579 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
2580 var err error
2581 resp, err = executeRPC(ctx, c.client.SetIamPolicy, req, settings.GRPC, c.logger, "SetIamPolicy")
2582 return err
2583 }, opts...)
2584 if err != nil {
2585 return nil, err
2586 }
2587 return resp, nil
2588 }
2589
2590 func (c *gRPCClient) GetIamPolicy(ctx context.Context, req *iampb.GetIamPolicyRequest, opts ...gax.CallOption) (*iampb.Policy, error) {
2591 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "resource", url.QueryEscape(req.GetResource()))}
2592
2593 hds = append(c.xGoogHeaders, hds...)
2594 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
2595 opts = append((*c.CallOptions).GetIamPolicy[0:len((*c.CallOptions).GetIamPolicy):len((*c.CallOptions).GetIamPolicy)], opts...)
2596 var resp *iampb.Policy
2597 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
2598 var err error
2599 resp, err = executeRPC(ctx, c.client.GetIamPolicy, req, settings.GRPC, c.logger, "GetIamPolicy")
2600 return err
2601 }, opts...)
2602 if err != nil {
2603 return nil, err
2604 }
2605 return resp, nil
2606 }
2607
2608 func (c *gRPCClient) TestIamPermissions(ctx context.Context, req *iampb.TestIamPermissionsRequest, opts ...gax.CallOption) (*iampb.TestIamPermissionsResponse, error) {
2609 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "resource", url.QueryEscape(req.GetResource()))}
2610
2611 hds = append(c.xGoogHeaders, hds...)
2612 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
2613 opts = append((*c.CallOptions).TestIamPermissions[0:len((*c.CallOptions).TestIamPermissions):len((*c.CallOptions).TestIamPermissions)], opts...)
2614 var resp *iampb.TestIamPermissionsResponse
2615 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
2616 var err error
2617 resp, err = executeRPC(ctx, c.client.TestIamPermissions, req, settings.GRPC, c.logger, "TestIamPermissions")
2618 return err
2619 }, opts...)
2620 if err != nil {
2621 return nil, err
2622 }
2623 return resp, nil
2624 }
2625
2626 func (c *gRPCClient) ImportEntries(ctx context.Context, req *datacatalogpb.ImportEntriesRequest, opts ...gax.CallOption) (*ImportEntriesOperation, error) {
2627 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))}
2628
2629 hds = append(c.xGoogHeaders, hds...)
2630 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
2631 opts = append((*c.CallOptions).ImportEntries[0:len((*c.CallOptions).ImportEntries):len((*c.CallOptions).ImportEntries)], opts...)
2632 var resp *longrunningpb.Operation
2633 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
2634 var err error
2635 resp, err = executeRPC(ctx, c.client.ImportEntries, req, settings.GRPC, c.logger, "ImportEntries")
2636 return err
2637 }, opts...)
2638 if err != nil {
2639 return nil, err
2640 }
2641 return &ImportEntriesOperation{
2642 lro: longrunning.InternalNewOperation(*c.LROClient, resp),
2643 }, nil
2644 }
2645
2646 func (c *gRPCClient) SetConfig(ctx context.Context, req *datacatalogpb.SetConfigRequest, opts ...gax.CallOption) (*datacatalogpb.MigrationConfig, error) {
2647 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
2648
2649 hds = append(c.xGoogHeaders, hds...)
2650 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
2651 opts = append((*c.CallOptions).SetConfig[0:len((*c.CallOptions).SetConfig):len((*c.CallOptions).SetConfig)], opts...)
2652 var resp *datacatalogpb.MigrationConfig
2653 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
2654 var err error
2655 resp, err = executeRPC(ctx, c.client.SetConfig, req, settings.GRPC, c.logger, "SetConfig")
2656 return err
2657 }, opts...)
2658 if err != nil {
2659 return nil, err
2660 }
2661 return resp, nil
2662 }
2663
2664 func (c *gRPCClient) RetrieveConfig(ctx context.Context, req *datacatalogpb.RetrieveConfigRequest, opts ...gax.CallOption) (*datacatalogpb.OrganizationConfig, error) {
2665 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
2666
2667 hds = append(c.xGoogHeaders, hds...)
2668 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
2669 opts = append((*c.CallOptions).RetrieveConfig[0:len((*c.CallOptions).RetrieveConfig):len((*c.CallOptions).RetrieveConfig)], opts...)
2670 var resp *datacatalogpb.OrganizationConfig
2671 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
2672 var err error
2673 resp, err = executeRPC(ctx, c.client.RetrieveConfig, req, settings.GRPC, c.logger, "RetrieveConfig")
2674 return err
2675 }, opts...)
2676 if err != nil {
2677 return nil, err
2678 }
2679 return resp, nil
2680 }
2681
2682 func (c *gRPCClient) RetrieveEffectiveConfig(ctx context.Context, req *datacatalogpb.RetrieveEffectiveConfigRequest, opts ...gax.CallOption) (*datacatalogpb.MigrationConfig, error) {
2683 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
2684
2685 hds = append(c.xGoogHeaders, hds...)
2686 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
2687 opts = append((*c.CallOptions).RetrieveEffectiveConfig[0:len((*c.CallOptions).RetrieveEffectiveConfig):len((*c.CallOptions).RetrieveEffectiveConfig)], opts...)
2688 var resp *datacatalogpb.MigrationConfig
2689 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
2690 var err error
2691 resp, err = executeRPC(ctx, c.client.RetrieveEffectiveConfig, req, settings.GRPC, c.logger, "RetrieveEffectiveConfig")
2692 return err
2693 }, opts...)
2694 if err != nil {
2695 return nil, err
2696 }
2697 return resp, nil
2698 }
2699
2700 func (c *gRPCClient) CancelOperation(ctx context.Context, req *longrunningpb.CancelOperationRequest, opts ...gax.CallOption) error {
2701 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
2702
2703 hds = append(c.xGoogHeaders, hds...)
2704 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
2705 opts = append((*c.CallOptions).CancelOperation[0:len((*c.CallOptions).CancelOperation):len((*c.CallOptions).CancelOperation)], opts...)
2706 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
2707 var err error
2708 _, err = executeRPC(ctx, c.operationsClient.CancelOperation, req, settings.GRPC, c.logger, "CancelOperation")
2709 return err
2710 }, opts...)
2711 return err
2712 }
2713
2714 func (c *gRPCClient) DeleteOperation(ctx context.Context, req *longrunningpb.DeleteOperationRequest, opts ...gax.CallOption) error {
2715 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
2716
2717 hds = append(c.xGoogHeaders, hds...)
2718 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
2719 opts = append((*c.CallOptions).DeleteOperation[0:len((*c.CallOptions).DeleteOperation):len((*c.CallOptions).DeleteOperation)], opts...)
2720 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
2721 var err error
2722 _, err = executeRPC(ctx, c.operationsClient.DeleteOperation, req, settings.GRPC, c.logger, "DeleteOperation")
2723 return err
2724 }, opts...)
2725 return err
2726 }
2727
2728 func (c *gRPCClient) GetOperation(ctx context.Context, req *longrunningpb.GetOperationRequest, opts ...gax.CallOption) (*longrunningpb.Operation, error) {
2729 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
2730
2731 hds = append(c.xGoogHeaders, hds...)
2732 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
2733 opts = append((*c.CallOptions).GetOperation[0:len((*c.CallOptions).GetOperation):len((*c.CallOptions).GetOperation)], opts...)
2734 var resp *longrunningpb.Operation
2735 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
2736 var err error
2737 resp, err = executeRPC(ctx, c.operationsClient.GetOperation, req, settings.GRPC, c.logger, "GetOperation")
2738 return err
2739 }, opts...)
2740 if err != nil {
2741 return nil, err
2742 }
2743 return resp, nil
2744 }
2745
2746 func (c *gRPCClient) ListOperations(ctx context.Context, req *longrunningpb.ListOperationsRequest, opts ...gax.CallOption) *OperationIterator {
2747 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
2748
2749 hds = append(c.xGoogHeaders, hds...)
2750 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
2751 opts = append((*c.CallOptions).ListOperations[0:len((*c.CallOptions).ListOperations):len((*c.CallOptions).ListOperations)], opts...)
2752 it := &OperationIterator{}
2753 req = proto.Clone(req).(*longrunningpb.ListOperationsRequest)
2754 it.InternalFetch = func(pageSize int, pageToken string) ([]*longrunningpb.Operation, string, error) {
2755 resp := &longrunningpb.ListOperationsResponse{}
2756 if pageToken != "" {
2757 req.PageToken = pageToken
2758 }
2759 if pageSize > math.MaxInt32 {
2760 req.PageSize = math.MaxInt32
2761 } else if pageSize != 0 {
2762 req.PageSize = int32(pageSize)
2763 }
2764 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
2765 var err error
2766 resp, err = executeRPC(ctx, c.operationsClient.ListOperations, req, settings.GRPC, c.logger, "ListOperations")
2767 return err
2768 }, opts...)
2769 if err != nil {
2770 return nil, "", err
2771 }
2772
2773 it.Response = resp
2774 return resp.GetOperations(), resp.GetNextPageToken(), nil
2775 }
2776 fetch := func(pageSize int, pageToken string) (string, error) {
2777 items, nextPageToken, err := it.InternalFetch(pageSize, pageToken)
2778 if err != nil {
2779 return "", err
2780 }
2781 it.items = append(it.items, items...)
2782 return nextPageToken, nil
2783 }
2784
2785 it.pageInfo, it.nextFunc = iterator.NewPageInfo(fetch, it.bufLen, it.takeBuf)
2786 it.pageInfo.MaxSize = int(req.GetPageSize())
2787 it.pageInfo.Token = req.GetPageToken()
2788
2789 return it
2790 }
2791
2792 // SearchCatalog searches Data Catalog for multiple resources like entries and tags that
2793 // match a query.
2794 //
2795 // This is a [Custom Method]
2796 // (https://cloud.google.com/apis/design/custom_methods (at https://cloud.google.com/apis/design/custom_methods)) that doesn’t return
2797 // all information on a resource, only its ID and high level fields. To get
2798 // more information, you can subsequently call specific get methods.
2799 //
2800 // Note: Data Catalog search queries don’t guarantee full recall. Results
2801 // that match your query might not be returned, even in subsequent
2802 // result pages. Additionally, returned (and not returned) results can vary
2803 // if you repeat search queries.
2804 //
2805 // For more information, see [Data Catalog search syntax]
2806 // (https://cloud.google.com/data-catalog/docs/how-to/search-reference (at https://cloud.google.com/data-catalog/docs/how-to/search-reference)).
2807 //
2808 // Deprecated: SearchCatalog may be removed in a future version.
2809 func (c *restClient) SearchCatalog(ctx context.Context, req *datacatalogpb.SearchCatalogRequest, opts ...gax.CallOption) *SearchCatalogResultIterator {
2810 it := &SearchCatalogResultIterator{}
2811 req = proto.Clone(req).(*datacatalogpb.SearchCatalogRequest)
2812 m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true}
2813 unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
2814 it.InternalFetch = func(pageSize int, pageToken string) ([]*datacatalogpb.SearchCatalogResult, string, error) {
2815 resp := &datacatalogpb.SearchCatalogResponse{}
2816 if pageToken != "" {
2817 req.PageToken = pageToken
2818 }
2819 if pageSize > math.MaxInt32 {
2820 req.PageSize = math.MaxInt32
2821 } else if pageSize != 0 {
2822 req.PageSize = int32(pageSize)
2823 }
2824 jsonReq, err := m.Marshal(req)
2825 if err != nil {
2826 return nil, "", err
2827 }
2828
2829 baseUrl, err := url.Parse(c.endpoint)
2830 if err != nil {
2831 return nil, "", err
2832 }
2833 baseUrl.Path += fmt.Sprintf("/v1/catalog:search")
2834
2835 // Build HTTP headers from client and context metadata.
2836 hds := append(c.xGoogHeaders, "Content-Type", "application/json")
2837 headers := gax.BuildHeaders(ctx, hds...)
2838 e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
2839 if settings.Path != "" {
2840 baseUrl.Path = settings.Path
2841 }
2842 httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq))
2843 if err != nil {
2844 return err
2845 }
2846 httpReq.Header = headers
2847
2848 buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, jsonReq, "SearchCatalog")
2849 if err != nil {
2850 return err
2851 }
2852 if err := unm.Unmarshal(buf, resp); err != nil {
2853 return err
2854 }
2855
2856 return nil
2857 }, opts...)
2858 if e != nil {
2859 return nil, "", e
2860 }
2861 it.Response = resp
2862 return resp.GetResults(), resp.GetNextPageToken(), nil
2863 }
2864
2865 fetch := func(pageSize int, pageToken string) (string, error) {
2866 items, nextPageToken, err := it.InternalFetch(pageSize, pageToken)
2867 if err != nil {
2868 return "", err
2869 }
2870 it.items = append(it.items, items...)
2871 return nextPageToken, nil
2872 }
2873
2874 it.pageInfo, it.nextFunc = iterator.NewPageInfo(fetch, it.bufLen, it.takeBuf)
2875 it.pageInfo.MaxSize = int(req.GetPageSize())
2876 it.pageInfo.Token = req.GetPageToken()
2877
2878 return it
2879 }
2880
2881 // CreateEntryGroup creates an entry group.
2882 //
2883 // An entry group contains logically related entries together with Cloud
2884 // Identity and Access Management (at /data-catalog/docs/concepts/iam) policies.
2885 // These policies specify users who can create, edit, and view entries
2886 // within entry groups.
2887 //
2888 // Data Catalog automatically creates entry groups with names that start with
2889 // the @ symbol for the following resources:
2890 //
2891 // BigQuery entries (@bigquery)
2892 //
2893 // Pub/Sub topics (@pubsub)
2894 //
2895 // Dataproc Metastore services (@dataproc_metastore_{SERVICE_NAME_HASH})
2896 //
2897 // You can create your own entry groups for Cloud Storage fileset entries
2898 // and custom entries together with the corresponding IAM policies.
2899 // User-created entry groups can’t contain the @ symbol, it is reserved
2900 // for automatically created groups.
2901 //
2902 // Entry groups, like entries, can be searched.
2903 //
2904 // A maximum of 10,000 entry groups may be created per organization across all
2905 // locations.
2906 //
2907 // You must enable the Data Catalog API in the project identified by
2908 // the parent parameter. For more information, see Data Catalog resource
2909 // project (at https://cloud.google.com/data-catalog/docs/concepts/resource-project).
2910 //
2911 // Deprecated: CreateEntryGroup may be removed in a future version.
2912 func (c *restClient) CreateEntryGroup(ctx context.Context, req *datacatalogpb.CreateEntryGroupRequest, opts ...gax.CallOption) (*datacatalogpb.EntryGroup, error) {
2913 m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true}
2914 body := req.GetEntryGroup()
2915 jsonReq, err := m.Marshal(body)
2916 if err != nil {
2917 return nil, err
2918 }
2919
2920 baseUrl, err := url.Parse(c.endpoint)
2921 if err != nil {
2922 return nil, err
2923 }
2924 baseUrl.Path += fmt.Sprintf("/v1/%v/entryGroups", req.GetParent())
2925
2926 params := url.Values{}
2927 params.Add("entryGroupId", fmt.Sprintf("%v", req.GetEntryGroupId()))
2928
2929 baseUrl.RawQuery = params.Encode()
2930
2931 // Build HTTP headers from client and context metadata.
2932 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))}
2933
2934 hds = append(c.xGoogHeaders, hds...)
2935 hds = append(hds, "Content-Type", "application/json")
2936 headers := gax.BuildHeaders(ctx, hds...)
2937 opts = append((*c.CallOptions).CreateEntryGroup[0:len((*c.CallOptions).CreateEntryGroup):len((*c.CallOptions).CreateEntryGroup)], opts...)
2938 unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
2939 resp := &datacatalogpb.EntryGroup{}
2940 e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
2941 if settings.Path != "" {
2942 baseUrl.Path = settings.Path
2943 }
2944 httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq))
2945 if err != nil {
2946 return err
2947 }
2948 httpReq = httpReq.WithContext(ctx)
2949 httpReq.Header = headers
2950
2951 buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, jsonReq, "CreateEntryGroup")
2952 if err != nil {
2953 return err
2954 }
2955
2956 if err := unm.Unmarshal(buf, resp); err != nil {
2957 return err
2958 }
2959
2960 return nil
2961 }, opts...)
2962 if e != nil {
2963 return nil, e
2964 }
2965 return resp, nil
2966 }
2967
2968 // GetEntryGroup gets an entry group.
2969 //
2970 // Deprecated: GetEntryGroup may be removed in a future version.
2971 func (c *restClient) GetEntryGroup(ctx context.Context, req *datacatalogpb.GetEntryGroupRequest, opts ...gax.CallOption) (*datacatalogpb.EntryGroup, error) {
2972 baseUrl, err := url.Parse(c.endpoint)
2973 if err != nil {
2974 return nil, err
2975 }
2976 baseUrl.Path += fmt.Sprintf("/v1/%v", req.GetName())
2977
2978 params := url.Values{}
2979 if req.GetReadMask() != nil {
2980 field, err := protojson.Marshal(req.GetReadMask())
2981 if err != nil {
2982 return nil, err
2983 }
2984 params.Add("readMask", string(field[1:len(field)-1]))
2985 }
2986
2987 baseUrl.RawQuery = params.Encode()
2988
2989 // Build HTTP headers from client and context metadata.
2990 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
2991
2992 hds = append(c.xGoogHeaders, hds...)
2993 hds = append(hds, "Content-Type", "application/json")
2994 headers := gax.BuildHeaders(ctx, hds...)
2995 opts = append((*c.CallOptions).GetEntryGroup[0:len((*c.CallOptions).GetEntryGroup):len((*c.CallOptions).GetEntryGroup)], opts...)
2996 unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
2997 resp := &datacatalogpb.EntryGroup{}
2998 e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
2999 if settings.Path != "" {
3000 baseUrl.Path = settings.Path
3001 }
3002 httpReq, err := http.NewRequest("GET", baseUrl.String(), nil)
3003 if err != nil {
3004 return err
3005 }
3006 httpReq = httpReq.WithContext(ctx)
3007 httpReq.Header = headers
3008
3009 buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, nil, "GetEntryGroup")
3010 if err != nil {
3011 return err
3012 }
3013
3014 if err := unm.Unmarshal(buf, resp); err != nil {
3015 return err
3016 }
3017
3018 return nil
3019 }, opts...)
3020 if e != nil {
3021 return nil, e
3022 }
3023 return resp, nil
3024 }
3025
3026 // UpdateEntryGroup updates an entry group.
3027 //
3028 // You must enable the Data Catalog API in the project identified by
3029 // the entry_group.name parameter. For more information, see Data Catalog
3030 // resource
3031 // project (at https://cloud.google.com/data-catalog/docs/concepts/resource-project).
3032 //
3033 // Deprecated: UpdateEntryGroup may be removed in a future version.
3034 func (c *restClient) UpdateEntryGroup(ctx context.Context, req *datacatalogpb.UpdateEntryGroupRequest, opts ...gax.CallOption) (*datacatalogpb.EntryGroup, error) {
3035 m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true}
3036 body := req.GetEntryGroup()
3037 jsonReq, err := m.Marshal(body)
3038 if err != nil {
3039 return nil, err
3040 }
3041
3042 baseUrl, err := url.Parse(c.endpoint)
3043 if err != nil {
3044 return nil, err
3045 }
3046 baseUrl.Path += fmt.Sprintf("/v1/%v", req.GetEntryGroup().GetName())
3047
3048 params := url.Values{}
3049 if req.GetUpdateMask() != nil {
3050 field, err := protojson.Marshal(req.GetUpdateMask())
3051 if err != nil {
3052 return nil, err
3053 }
3054 params.Add("updateMask", string(field[1:len(field)-1]))
3055 }
3056
3057 baseUrl.RawQuery = params.Encode()
3058
3059 // Build HTTP headers from client and context metadata.
3060 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "entry_group.name", url.QueryEscape(req.GetEntryGroup().GetName()))}
3061
3062 hds = append(c.xGoogHeaders, hds...)
3063 hds = append(hds, "Content-Type", "application/json")
3064 headers := gax.BuildHeaders(ctx, hds...)
3065 opts = append((*c.CallOptions).UpdateEntryGroup[0:len((*c.CallOptions).UpdateEntryGroup):len((*c.CallOptions).UpdateEntryGroup)], opts...)
3066 unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
3067 resp := &datacatalogpb.EntryGroup{}
3068 e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
3069 if settings.Path != "" {
3070 baseUrl.Path = settings.Path
3071 }
3072 httpReq, err := http.NewRequest("PATCH", baseUrl.String(), bytes.NewReader(jsonReq))
3073 if err != nil {
3074 return err
3075 }
3076 httpReq = httpReq.WithContext(ctx)
3077 httpReq.Header = headers
3078
3079 buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, jsonReq, "UpdateEntryGroup")
3080 if err != nil {
3081 return err
3082 }
3083
3084 if err := unm.Unmarshal(buf, resp); err != nil {
3085 return err
3086 }
3087
3088 return nil
3089 }, opts...)
3090 if e != nil {
3091 return nil, e
3092 }
3093 return resp, nil
3094 }
3095
3096 // DeleteEntryGroup deletes an entry group.
3097 //
3098 // You must enable the Data Catalog API in the project
3099 // identified by the name parameter. For more information, see Data Catalog
3100 // resource
3101 // project (at https://cloud.google.com/data-catalog/docs/concepts/resource-project).
3102 //
3103 // Deprecated: DeleteEntryGroup may be removed in a future version.
3104 func (c *restClient) DeleteEntryGroup(ctx context.Context, req *datacatalogpb.DeleteEntryGroupRequest, opts ...gax.CallOption) error {
3105 baseUrl, err := url.Parse(c.endpoint)
3106 if err != nil {
3107 return err
3108 }
3109 baseUrl.Path += fmt.Sprintf("/v1/%v", req.GetName())
3110
3111 params := url.Values{}
3112 if req.GetForce() {
3113 params.Add("force", fmt.Sprintf("%v", req.GetForce()))
3114 }
3115
3116 baseUrl.RawQuery = params.Encode()
3117
3118 // Build HTTP headers from client and context metadata.
3119 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
3120
3121 hds = append(c.xGoogHeaders, hds...)
3122 hds = append(hds, "Content-Type", "application/json")
3123 headers := gax.BuildHeaders(ctx, hds...)
3124 return gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
3125 if settings.Path != "" {
3126 baseUrl.Path = settings.Path
3127 }
3128 httpReq, err := http.NewRequest("DELETE", baseUrl.String(), nil)
3129 if err != nil {
3130 return err
3131 }
3132 httpReq = httpReq.WithContext(ctx)
3133 httpReq.Header = headers
3134
3135 _, err = executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, nil, "DeleteEntryGroup")
3136 return err
3137 }, opts...)
3138 }
3139
3140 // ListEntryGroups lists entry groups.
3141 //
3142 // Deprecated: ListEntryGroups may be removed in a future version.
3143 func (c *restClient) ListEntryGroups(ctx context.Context, req *datacatalogpb.ListEntryGroupsRequest, opts ...gax.CallOption) *EntryGroupIterator {
3144 it := &EntryGroupIterator{}
3145 req = proto.Clone(req).(*datacatalogpb.ListEntryGroupsRequest)
3146 unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
3147 it.InternalFetch = func(pageSize int, pageToken string) ([]*datacatalogpb.EntryGroup, string, error) {
3148 resp := &datacatalogpb.ListEntryGroupsResponse{}
3149 if pageToken != "" {
3150 req.PageToken = pageToken
3151 }
3152 if pageSize > math.MaxInt32 {
3153 req.PageSize = math.MaxInt32
3154 } else if pageSize != 0 {
3155 req.PageSize = int32(pageSize)
3156 }
3157 baseUrl, err := url.Parse(c.endpoint)
3158 if err != nil {
3159 return nil, "", err
3160 }
3161 baseUrl.Path += fmt.Sprintf("/v1/%v/entryGroups", req.GetParent())
3162
3163 params := url.Values{}
3164 if req.GetPageSize() != 0 {
3165 params.Add("pageSize", fmt.Sprintf("%v", req.GetPageSize()))
3166 }
3167 if req.GetPageToken() != "" {
3168 params.Add("pageToken", fmt.Sprintf("%v", req.GetPageToken()))
3169 }
3170
3171 baseUrl.RawQuery = params.Encode()
3172
3173 // Build HTTP headers from client and context metadata.
3174 hds := append(c.xGoogHeaders, "Content-Type", "application/json")
3175 headers := gax.BuildHeaders(ctx, hds...)
3176 e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
3177 if settings.Path != "" {
3178 baseUrl.Path = settings.Path
3179 }
3180 httpReq, err := http.NewRequest("GET", baseUrl.String(), nil)
3181 if err != nil {
3182 return err
3183 }
3184 httpReq.Header = headers
3185
3186 buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, nil, "ListEntryGroups")
3187 if err != nil {
3188 return err
3189 }
3190 if err := unm.Unmarshal(buf, resp); err != nil {
3191 return err
3192 }
3193
3194 return nil
3195 }, opts...)
3196 if e != nil {
3197 return nil, "", e
3198 }
3199 it.Response = resp
3200 return resp.GetEntryGroups(), resp.GetNextPageToken(), nil
3201 }
3202
3203 fetch := func(pageSize int, pageToken string) (string, error) {
3204 items, nextPageToken, err := it.InternalFetch(pageSize, pageToken)
3205 if err != nil {
3206 return "", err
3207 }
3208 it.items = append(it.items, items...)
3209 return nextPageToken, nil
3210 }
3211
3212 it.pageInfo, it.nextFunc = iterator.NewPageInfo(fetch, it.bufLen, it.takeBuf)
3213 it.pageInfo.MaxSize = int(req.GetPageSize())
3214 it.pageInfo.Token = req.GetPageToken()
3215
3216 return it
3217 }
3218
3219 // CreateEntry creates an entry.
3220 //
3221 // You can create entries only with ‘FILESET’, ‘CLUSTER’, ‘DATA_STREAM’,
3222 // or custom types. Data Catalog automatically creates entries with other
3223 // types during metadata ingestion from integrated systems.
3224 //
3225 // You must enable the Data Catalog API in the project identified by
3226 // the parent parameter. For more information, see Data Catalog resource
3227 // project (at https://cloud.google.com/data-catalog/docs/concepts/resource-project).
3228 //
3229 // An entry group can have a maximum of 100,000 entries.
3230 //
3231 // Deprecated: CreateEntry may be removed in a future version.
3232 func (c *restClient) CreateEntry(ctx context.Context, req *datacatalogpb.CreateEntryRequest, opts ...gax.CallOption) (*datacatalogpb.Entry, error) {
3233 m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true}
3234 body := req.GetEntry()
3235 jsonReq, err := m.Marshal(body)
3236 if err != nil {
3237 return nil, err
3238 }
3239
3240 baseUrl, err := url.Parse(c.endpoint)
3241 if err != nil {
3242 return nil, err
3243 }
3244 baseUrl.Path += fmt.Sprintf("/v1/%v/entries", req.GetParent())
3245
3246 params := url.Values{}
3247 params.Add("entryId", fmt.Sprintf("%v", req.GetEntryId()))
3248
3249 baseUrl.RawQuery = params.Encode()
3250
3251 // Build HTTP headers from client and context metadata.
3252 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))}
3253
3254 hds = append(c.xGoogHeaders, hds...)
3255 hds = append(hds, "Content-Type", "application/json")
3256 headers := gax.BuildHeaders(ctx, hds...)
3257 opts = append((*c.CallOptions).CreateEntry[0:len((*c.CallOptions).CreateEntry):len((*c.CallOptions).CreateEntry)], opts...)
3258 unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
3259 resp := &datacatalogpb.Entry{}
3260 e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
3261 if settings.Path != "" {
3262 baseUrl.Path = settings.Path
3263 }
3264 httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq))
3265 if err != nil {
3266 return err
3267 }
3268 httpReq = httpReq.WithContext(ctx)
3269 httpReq.Header = headers
3270
3271 buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, jsonReq, "CreateEntry")
3272 if err != nil {
3273 return err
3274 }
3275
3276 if err := unm.Unmarshal(buf, resp); err != nil {
3277 return err
3278 }
3279
3280 return nil
3281 }, opts...)
3282 if e != nil {
3283 return nil, e
3284 }
3285 return resp, nil
3286 }
3287
3288 // UpdateEntry updates an existing entry.
3289 //
3290 // You must enable the Data Catalog API in the project identified by
3291 // the entry.name parameter. For more information, see Data Catalog
3292 // resource
3293 // project (at https://cloud.google.com/data-catalog/docs/concepts/resource-project).
3294 //
3295 // Deprecated: UpdateEntry may be removed in a future version.
3296 func (c *restClient) UpdateEntry(ctx context.Context, req *datacatalogpb.UpdateEntryRequest, opts ...gax.CallOption) (*datacatalogpb.Entry, error) {
3297 m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true}
3298 body := req.GetEntry()
3299 jsonReq, err := m.Marshal(body)
3300 if err != nil {
3301 return nil, err
3302 }
3303
3304 baseUrl, err := url.Parse(c.endpoint)
3305 if err != nil {
3306 return nil, err
3307 }
3308 baseUrl.Path += fmt.Sprintf("/v1/%v", req.GetEntry().GetName())
3309
3310 params := url.Values{}
3311 if req.GetUpdateMask() != nil {
3312 field, err := protojson.Marshal(req.GetUpdateMask())
3313 if err != nil {
3314 return nil, err
3315 }
3316 params.Add("updateMask", string(field[1:len(field)-1]))
3317 }
3318
3319 baseUrl.RawQuery = params.Encode()
3320
3321 // Build HTTP headers from client and context metadata.
3322 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "entry.name", url.QueryEscape(req.GetEntry().GetName()))}
3323
3324 hds = append(c.xGoogHeaders, hds...)
3325 hds = append(hds, "Content-Type", "application/json")
3326 headers := gax.BuildHeaders(ctx, hds...)
3327 opts = append((*c.CallOptions).UpdateEntry[0:len((*c.CallOptions).UpdateEntry):len((*c.CallOptions).UpdateEntry)], opts...)
3328 unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
3329 resp := &datacatalogpb.Entry{}
3330 e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
3331 if settings.Path != "" {
3332 baseUrl.Path = settings.Path
3333 }
3334 httpReq, err := http.NewRequest("PATCH", baseUrl.String(), bytes.NewReader(jsonReq))
3335 if err != nil {
3336 return err
3337 }
3338 httpReq = httpReq.WithContext(ctx)
3339 httpReq.Header = headers
3340
3341 buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, jsonReq, "UpdateEntry")
3342 if err != nil {
3343 return err
3344 }
3345
3346 if err := unm.Unmarshal(buf, resp); err != nil {
3347 return err
3348 }
3349
3350 return nil
3351 }, opts...)
3352 if e != nil {
3353 return nil, e
3354 }
3355 return resp, nil
3356 }
3357
3358 // DeleteEntry deletes an existing entry.
3359 //
3360 // You can delete only the entries created by the
3361 // CreateEntry
3362 // method.
3363 //
3364 // You must enable the Data Catalog API in the project identified by
3365 // the name parameter. For more information, see Data Catalog
3366 // resource
3367 // project (at https://cloud.google.com/data-catalog/docs/concepts/resource-project).
3368 //
3369 // Deprecated: DeleteEntry may be removed in a future version.
3370 func (c *restClient) DeleteEntry(ctx context.Context, req *datacatalogpb.DeleteEntryRequest, opts ...gax.CallOption) error {
3371 baseUrl, err := url.Parse(c.endpoint)
3372 if err != nil {
3373 return err
3374 }
3375 baseUrl.Path += fmt.Sprintf("/v1/%v", req.GetName())
3376
3377 // Build HTTP headers from client and context metadata.
3378 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
3379
3380 hds = append(c.xGoogHeaders, hds...)
3381 hds = append(hds, "Content-Type", "application/json")
3382 headers := gax.BuildHeaders(ctx, hds...)
3383 return gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
3384 if settings.Path != "" {
3385 baseUrl.Path = settings.Path
3386 }
3387 httpReq, err := http.NewRequest("DELETE", baseUrl.String(), nil)
3388 if err != nil {
3389 return err
3390 }
3391 httpReq = httpReq.WithContext(ctx)
3392 httpReq.Header = headers
3393
3394 _, err = executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, nil, "DeleteEntry")
3395 return err
3396 }, opts...)
3397 }
3398
3399 // GetEntry gets an entry.
3400 //
3401 // Deprecated: GetEntry may be removed in a future version.
3402 func (c *restClient) GetEntry(ctx context.Context, req *datacatalogpb.GetEntryRequest, opts ...gax.CallOption) (*datacatalogpb.Entry, error) {
3403 baseUrl, err := url.Parse(c.endpoint)
3404 if err != nil {
3405 return nil, err
3406 }
3407 baseUrl.Path += fmt.Sprintf("/v1/%v", req.GetName())
3408
3409 // Build HTTP headers from client and context metadata.
3410 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
3411
3412 hds = append(c.xGoogHeaders, hds...)
3413 hds = append(hds, "Content-Type", "application/json")
3414 headers := gax.BuildHeaders(ctx, hds...)
3415 opts = append((*c.CallOptions).GetEntry[0:len((*c.CallOptions).GetEntry):len((*c.CallOptions).GetEntry)], opts...)
3416 unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
3417 resp := &datacatalogpb.Entry{}
3418 e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
3419 if settings.Path != "" {
3420 baseUrl.Path = settings.Path
3421 }
3422 httpReq, err := http.NewRequest("GET", baseUrl.String(), nil)
3423 if err != nil {
3424 return err
3425 }
3426 httpReq = httpReq.WithContext(ctx)
3427 httpReq.Header = headers
3428
3429 buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, nil, "GetEntry")
3430 if err != nil {
3431 return err
3432 }
3433
3434 if err := unm.Unmarshal(buf, resp); err != nil {
3435 return err
3436 }
3437
3438 return nil
3439 }, opts...)
3440 if e != nil {
3441 return nil, e
3442 }
3443 return resp, nil
3444 }
3445
3446 // LookupEntry gets an entry by its target resource name.
3447 //
3448 // The resource name comes from the source Google Cloud Platform service.
3449 //
3450 // Deprecated: LookupEntry may be removed in a future version.
3451 func (c *restClient) LookupEntry(ctx context.Context, req *datacatalogpb.LookupEntryRequest, opts ...gax.CallOption) (*datacatalogpb.Entry, error) {
3452 baseUrl, err := url.Parse(c.endpoint)
3453 if err != nil {
3454 return nil, err
3455 }
3456 baseUrl.Path += fmt.Sprintf("/v1/entries:lookup")
3457
3458 params := url.Values{}
3459 if req.GetFullyQualifiedName() != "" {
3460 params.Add("fullyQualifiedName", fmt.Sprintf("%v", req.GetFullyQualifiedName()))
3461 }
3462 if req.GetLinkedResource() != "" {
3463 params.Add("linkedResource", fmt.Sprintf("%v", req.GetLinkedResource()))
3464 }
3465 if req.GetLocation() != "" {
3466 params.Add("location", fmt.Sprintf("%v", req.GetLocation()))
3467 }
3468 if req.GetProject() != "" {
3469 params.Add("project", fmt.Sprintf("%v", req.GetProject()))
3470 }
3471 if req.GetSqlResource() != "" {
3472 params.Add("sqlResource", fmt.Sprintf("%v", req.GetSqlResource()))
3473 }
3474
3475 baseUrl.RawQuery = params.Encode()
3476
3477 // Build HTTP headers from client and context metadata.
3478 hds := append(c.xGoogHeaders, "Content-Type", "application/json")
3479 headers := gax.BuildHeaders(ctx, hds...)
3480 opts = append((*c.CallOptions).LookupEntry[0:len((*c.CallOptions).LookupEntry):len((*c.CallOptions).LookupEntry)], opts...)
3481 unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
3482 resp := &datacatalogpb.Entry{}
3483 e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
3484 if settings.Path != "" {
3485 baseUrl.Path = settings.Path
3486 }
3487 httpReq, err := http.NewRequest("GET", baseUrl.String(), nil)
3488 if err != nil {
3489 return err
3490 }
3491 httpReq = httpReq.WithContext(ctx)
3492 httpReq.Header = headers
3493
3494 buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, nil, "LookupEntry")
3495 if err != nil {
3496 return err
3497 }
3498
3499 if err := unm.Unmarshal(buf, resp); err != nil {
3500 return err
3501 }
3502
3503 return nil
3504 }, opts...)
3505 if e != nil {
3506 return nil, e
3507 }
3508 return resp, nil
3509 }
3510
3511 // ListEntries lists entries.
3512 //
3513 // Note: Currently, this method can list only custom entries.
3514 // To get a list of both custom and automatically created entries, use
3515 // SearchCatalog.
3516 //
3517 // Deprecated: ListEntries may be removed in a future version.
3518 func (c *restClient) ListEntries(ctx context.Context, req *datacatalogpb.ListEntriesRequest, opts ...gax.CallOption) *EntryIterator {
3519 it := &EntryIterator{}
3520 req = proto.Clone(req).(*datacatalogpb.ListEntriesRequest)
3521 unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
3522 it.InternalFetch = func(pageSize int, pageToken string) ([]*datacatalogpb.Entry, string, error) {
3523 resp := &datacatalogpb.ListEntriesResponse{}
3524 if pageToken != "" {
3525 req.PageToken = pageToken
3526 }
3527 if pageSize > math.MaxInt32 {
3528 req.PageSize = math.MaxInt32
3529 } else if pageSize != 0 {
3530 req.PageSize = int32(pageSize)
3531 }
3532 baseUrl, err := url.Parse(c.endpoint)
3533 if err != nil {
3534 return nil, "", err
3535 }
3536 baseUrl.Path += fmt.Sprintf("/v1/%v/entries", req.GetParent())
3537
3538 params := url.Values{}
3539 if req.GetPageSize() != 0 {
3540 params.Add("pageSize", fmt.Sprintf("%v", req.GetPageSize()))
3541 }
3542 if req.GetPageToken() != "" {
3543 params.Add("pageToken", fmt.Sprintf("%v", req.GetPageToken()))
3544 }
3545 if req.GetReadMask() != nil {
3546 field, err := protojson.Marshal(req.GetReadMask())
3547 if err != nil {
3548 return nil, "", err
3549 }
3550 params.Add("readMask", string(field[1:len(field)-1]))
3551 }
3552
3553 baseUrl.RawQuery = params.Encode()
3554
3555 // Build HTTP headers from client and context metadata.
3556 hds := append(c.xGoogHeaders, "Content-Type", "application/json")
3557 headers := gax.BuildHeaders(ctx, hds...)
3558 e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
3559 if settings.Path != "" {
3560 baseUrl.Path = settings.Path
3561 }
3562 httpReq, err := http.NewRequest("GET", baseUrl.String(), nil)
3563 if err != nil {
3564 return err
3565 }
3566 httpReq.Header = headers
3567
3568 buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, nil, "ListEntries")
3569 if err != nil {
3570 return err
3571 }
3572 if err := unm.Unmarshal(buf, resp); err != nil {
3573 return err
3574 }
3575
3576 return nil
3577 }, opts...)
3578 if e != nil {
3579 return nil, "", e
3580 }
3581 it.Response = resp
3582 return resp.GetEntries(), resp.GetNextPageToken(), nil
3583 }
3584
3585 fetch := func(pageSize int, pageToken string) (string, error) {
3586 items, nextPageToken, err := it.InternalFetch(pageSize, pageToken)
3587 if err != nil {
3588 return "", err
3589 }
3590 it.items = append(it.items, items...)
3591 return nextPageToken, nil
3592 }
3593
3594 it.pageInfo, it.nextFunc = iterator.NewPageInfo(fetch, it.bufLen, it.takeBuf)
3595 it.pageInfo.MaxSize = int(req.GetPageSize())
3596 it.pageInfo.Token = req.GetPageToken()
3597
3598 return it
3599 }
3600
3601 // ModifyEntryOverview modifies entry overview, part of the business context of an
3602 // Entry.
3603 //
3604 // To call this method, you must have the datacatalog.entries.updateOverview
3605 // IAM permission on the corresponding project.
3606 //
3607 // Deprecated: ModifyEntryOverview may be removed in a future version.
3608 func (c *restClient) ModifyEntryOverview(ctx context.Context, req *datacatalogpb.ModifyEntryOverviewRequest, opts ...gax.CallOption) (*datacatalogpb.EntryOverview, error) {
3609 m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true}
3610 jsonReq, err := m.Marshal(req)
3611 if err != nil {
3612 return nil, err
3613 }
3614
3615 baseUrl, err := url.Parse(c.endpoint)
3616 if err != nil {
3617 return nil, err
3618 }
3619 baseUrl.Path += fmt.Sprintf("/v1/%v:modifyEntryOverview", req.GetName())
3620
3621 // Build HTTP headers from client and context metadata.
3622 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
3623
3624 hds = append(c.xGoogHeaders, hds...)
3625 hds = append(hds, "Content-Type", "application/json")
3626 headers := gax.BuildHeaders(ctx, hds...)
3627 opts = append((*c.CallOptions).ModifyEntryOverview[0:len((*c.CallOptions).ModifyEntryOverview):len((*c.CallOptions).ModifyEntryOverview)], opts...)
3628 unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
3629 resp := &datacatalogpb.EntryOverview{}
3630 e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
3631 if settings.Path != "" {
3632 baseUrl.Path = settings.Path
3633 }
3634 httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq))
3635 if err != nil {
3636 return err
3637 }
3638 httpReq = httpReq.WithContext(ctx)
3639 httpReq.Header = headers
3640
3641 buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, jsonReq, "ModifyEntryOverview")
3642 if err != nil {
3643 return err
3644 }
3645
3646 if err := unm.Unmarshal(buf, resp); err != nil {
3647 return err
3648 }
3649
3650 return nil
3651 }, opts...)
3652 if e != nil {
3653 return nil, e
3654 }
3655 return resp, nil
3656 }
3657
3658 // ModifyEntryContacts modifies contacts, part of the business context of an
3659 // Entry.
3660 //
3661 // To call this method, you must have the datacatalog.entries.updateContacts
3662 // IAM permission on the corresponding project.
3663 //
3664 // Deprecated: ModifyEntryContacts may be removed in a future version.
3665 func (c *restClient) ModifyEntryContacts(ctx context.Context, req *datacatalogpb.ModifyEntryContactsRequest, opts ...gax.CallOption) (*datacatalogpb.Contacts, error) {
3666 m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true}
3667 jsonReq, err := m.Marshal(req)
3668 if err != nil {
3669 return nil, err
3670 }
3671
3672 baseUrl, err := url.Parse(c.endpoint)
3673 if err != nil {
3674 return nil, err
3675 }
3676 baseUrl.Path += fmt.Sprintf("/v1/%v:modifyEntryContacts", req.GetName())
3677
3678 // Build HTTP headers from client and context metadata.
3679 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
3680
3681 hds = append(c.xGoogHeaders, hds...)
3682 hds = append(hds, "Content-Type", "application/json")
3683 headers := gax.BuildHeaders(ctx, hds...)
3684 opts = append((*c.CallOptions).ModifyEntryContacts[0:len((*c.CallOptions).ModifyEntryContacts):len((*c.CallOptions).ModifyEntryContacts)], opts...)
3685 unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
3686 resp := &datacatalogpb.Contacts{}
3687 e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
3688 if settings.Path != "" {
3689 baseUrl.Path = settings.Path
3690 }
3691 httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq))
3692 if err != nil {
3693 return err
3694 }
3695 httpReq = httpReq.WithContext(ctx)
3696 httpReq.Header = headers
3697
3698 buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, jsonReq, "ModifyEntryContacts")
3699 if err != nil {
3700 return err
3701 }
3702
3703 if err := unm.Unmarshal(buf, resp); err != nil {
3704 return err
3705 }
3706
3707 return nil
3708 }, opts...)
3709 if e != nil {
3710 return nil, e
3711 }
3712 return resp, nil
3713 }
3714
3715 // CreateTagTemplate creates a tag template.
3716 //
3717 // You must enable the Data Catalog API in the project identified by the
3718 // parent parameter.
3719 // For more information, see [Data Catalog resource project]
3720 // (https://cloud.google.com/data-catalog/docs/concepts/resource-project (at https://cloud.google.com/data-catalog/docs/concepts/resource-project)).
3721 //
3722 // Deprecated: CreateTagTemplate may be removed in a future version.
3723 func (c *restClient) CreateTagTemplate(ctx context.Context, req *datacatalogpb.CreateTagTemplateRequest, opts ...gax.CallOption) (*datacatalogpb.TagTemplate, error) {
3724 m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true}
3725 body := req.GetTagTemplate()
3726 jsonReq, err := m.Marshal(body)
3727 if err != nil {
3728 return nil, err
3729 }
3730
3731 baseUrl, err := url.Parse(c.endpoint)
3732 if err != nil {
3733 return nil, err
3734 }
3735 baseUrl.Path += fmt.Sprintf("/v1/%v/tagTemplates", req.GetParent())
3736
3737 params := url.Values{}
3738 params.Add("tagTemplateId", fmt.Sprintf("%v", req.GetTagTemplateId()))
3739
3740 baseUrl.RawQuery = params.Encode()
3741
3742 // Build HTTP headers from client and context metadata.
3743 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))}
3744
3745 hds = append(c.xGoogHeaders, hds...)
3746 hds = append(hds, "Content-Type", "application/json")
3747 headers := gax.BuildHeaders(ctx, hds...)
3748 opts = append((*c.CallOptions).CreateTagTemplate[0:len((*c.CallOptions).CreateTagTemplate):len((*c.CallOptions).CreateTagTemplate)], opts...)
3749 unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
3750 resp := &datacatalogpb.TagTemplate{}
3751 e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
3752 if settings.Path != "" {
3753 baseUrl.Path = settings.Path
3754 }
3755 httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq))
3756 if err != nil {
3757 return err
3758 }
3759 httpReq = httpReq.WithContext(ctx)
3760 httpReq.Header = headers
3761
3762 buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, jsonReq, "CreateTagTemplate")
3763 if err != nil {
3764 return err
3765 }
3766
3767 if err := unm.Unmarshal(buf, resp); err != nil {
3768 return err
3769 }
3770
3771 return nil
3772 }, opts...)
3773 if e != nil {
3774 return nil, e
3775 }
3776 return resp, nil
3777 }
3778
3779 // GetTagTemplate gets a tag template.
3780 //
3781 // Deprecated: GetTagTemplate may be removed in a future version.
3782 func (c *restClient) GetTagTemplate(ctx context.Context, req *datacatalogpb.GetTagTemplateRequest, opts ...gax.CallOption) (*datacatalogpb.TagTemplate, error) {
3783 baseUrl, err := url.Parse(c.endpoint)
3784 if err != nil {
3785 return nil, err
3786 }
3787 baseUrl.Path += fmt.Sprintf("/v1/%v", req.GetName())
3788
3789 // Build HTTP headers from client and context metadata.
3790 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
3791
3792 hds = append(c.xGoogHeaders, hds...)
3793 hds = append(hds, "Content-Type", "application/json")
3794 headers := gax.BuildHeaders(ctx, hds...)
3795 opts = append((*c.CallOptions).GetTagTemplate[0:len((*c.CallOptions).GetTagTemplate):len((*c.CallOptions).GetTagTemplate)], opts...)
3796 unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
3797 resp := &datacatalogpb.TagTemplate{}
3798 e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
3799 if settings.Path != "" {
3800 baseUrl.Path = settings.Path
3801 }
3802 httpReq, err := http.NewRequest("GET", baseUrl.String(), nil)
3803 if err != nil {
3804 return err
3805 }
3806 httpReq = httpReq.WithContext(ctx)
3807 httpReq.Header = headers
3808
3809 buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, nil, "GetTagTemplate")
3810 if err != nil {
3811 return err
3812 }
3813
3814 if err := unm.Unmarshal(buf, resp); err != nil {
3815 return err
3816 }
3817
3818 return nil
3819 }, opts...)
3820 if e != nil {
3821 return nil, e
3822 }
3823 return resp, nil
3824 }
3825
3826 // UpdateTagTemplate updates a tag template.
3827 //
3828 // You can’t update template fields with this method. These fields are
3829 // separate resources with their own create, update, and delete methods.
3830 //
3831 // You must enable the Data Catalog API in the project identified by
3832 // the tag_template.name parameter. For more information, see Data Catalog
3833 // resource
3834 // project (at https://cloud.google.com/data-catalog/docs/concepts/resource-project).
3835 //
3836 // Deprecated: UpdateTagTemplate may be removed in a future version.
3837 func (c *restClient) UpdateTagTemplate(ctx context.Context, req *datacatalogpb.UpdateTagTemplateRequest, opts ...gax.CallOption) (*datacatalogpb.TagTemplate, error) {
3838 m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true}
3839 body := req.GetTagTemplate()
3840 jsonReq, err := m.Marshal(body)
3841 if err != nil {
3842 return nil, err
3843 }
3844
3845 baseUrl, err := url.Parse(c.endpoint)
3846 if err != nil {
3847 return nil, err
3848 }
3849 baseUrl.Path += fmt.Sprintf("/v1/%v", req.GetTagTemplate().GetName())
3850
3851 params := url.Values{}
3852 if req.GetUpdateMask() != nil {
3853 field, err := protojson.Marshal(req.GetUpdateMask())
3854 if err != nil {
3855 return nil, err
3856 }
3857 params.Add("updateMask", string(field[1:len(field)-1]))
3858 }
3859
3860 baseUrl.RawQuery = params.Encode()
3861
3862 // Build HTTP headers from client and context metadata.
3863 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "tag_template.name", url.QueryEscape(req.GetTagTemplate().GetName()))}
3864
3865 hds = append(c.xGoogHeaders, hds...)
3866 hds = append(hds, "Content-Type", "application/json")
3867 headers := gax.BuildHeaders(ctx, hds...)
3868 opts = append((*c.CallOptions).UpdateTagTemplate[0:len((*c.CallOptions).UpdateTagTemplate):len((*c.CallOptions).UpdateTagTemplate)], opts...)
3869 unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
3870 resp := &datacatalogpb.TagTemplate{}
3871 e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
3872 if settings.Path != "" {
3873 baseUrl.Path = settings.Path
3874 }
3875 httpReq, err := http.NewRequest("PATCH", baseUrl.String(), bytes.NewReader(jsonReq))
3876 if err != nil {
3877 return err
3878 }
3879 httpReq = httpReq.WithContext(ctx)
3880 httpReq.Header = headers
3881
3882 buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, jsonReq, "UpdateTagTemplate")
3883 if err != nil {
3884 return err
3885 }
3886
3887 if err := unm.Unmarshal(buf, resp); err != nil {
3888 return err
3889 }
3890
3891 return nil
3892 }, opts...)
3893 if e != nil {
3894 return nil, e
3895 }
3896 return resp, nil
3897 }
3898
3899 // DeleteTagTemplate deletes a tag template and all tags that use it.
3900 //
3901 // You must enable the Data Catalog API in the project identified by
3902 // the name parameter. For more information, see Data Catalog resource
3903 // project (at https://cloud.google.com/data-catalog/docs/concepts/resource-project).
3904 //
3905 // Deprecated: DeleteTagTemplate may be removed in a future version.
3906 func (c *restClient) DeleteTagTemplate(ctx context.Context, req *datacatalogpb.DeleteTagTemplateRequest, opts ...gax.CallOption) error {
3907 baseUrl, err := url.Parse(c.endpoint)
3908 if err != nil {
3909 return err
3910 }
3911 baseUrl.Path += fmt.Sprintf("/v1/%v", req.GetName())
3912
3913 params := url.Values{}
3914 params.Add("force", fmt.Sprintf("%v", req.GetForce()))
3915
3916 baseUrl.RawQuery = params.Encode()
3917
3918 // Build HTTP headers from client and context metadata.
3919 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
3920
3921 hds = append(c.xGoogHeaders, hds...)
3922 hds = append(hds, "Content-Type", "application/json")
3923 headers := gax.BuildHeaders(ctx, hds...)
3924 return gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
3925 if settings.Path != "" {
3926 baseUrl.Path = settings.Path
3927 }
3928 httpReq, err := http.NewRequest("DELETE", baseUrl.String(), nil)
3929 if err != nil {
3930 return err
3931 }
3932 httpReq = httpReq.WithContext(ctx)
3933 httpReq.Header = headers
3934
3935 _, err = executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, nil, "DeleteTagTemplate")
3936 return err
3937 }, opts...)
3938 }
3939
3940 // CreateTagTemplateField creates a field in a tag template.
3941 //
3942 // You must enable the Data Catalog API in the project identified by
3943 // the parent parameter. For more information, see Data Catalog resource
3944 // project (at https://cloud.google.com/data-catalog/docs/concepts/resource-project).
3945 //
3946 // Deprecated: CreateTagTemplateField may be removed in a future version.
3947 func (c *restClient) CreateTagTemplateField(ctx context.Context, req *datacatalogpb.CreateTagTemplateFieldRequest, opts ...gax.CallOption) (*datacatalogpb.TagTemplateField, error) {
3948 m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true}
3949 body := req.GetTagTemplateField()
3950 jsonReq, err := m.Marshal(body)
3951 if err != nil {
3952 return nil, err
3953 }
3954
3955 baseUrl, err := url.Parse(c.endpoint)
3956 if err != nil {
3957 return nil, err
3958 }
3959 baseUrl.Path += fmt.Sprintf("/v1/%v/fields", req.GetParent())
3960
3961 params := url.Values{}
3962 params.Add("tagTemplateFieldId", fmt.Sprintf("%v", req.GetTagTemplateFieldId()))
3963
3964 baseUrl.RawQuery = params.Encode()
3965
3966 // Build HTTP headers from client and context metadata.
3967 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))}
3968
3969 hds = append(c.xGoogHeaders, hds...)
3970 hds = append(hds, "Content-Type", "application/json")
3971 headers := gax.BuildHeaders(ctx, hds...)
3972 opts = append((*c.CallOptions).CreateTagTemplateField[0:len((*c.CallOptions).CreateTagTemplateField):len((*c.CallOptions).CreateTagTemplateField)], opts...)
3973 unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
3974 resp := &datacatalogpb.TagTemplateField{}
3975 e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
3976 if settings.Path != "" {
3977 baseUrl.Path = settings.Path
3978 }
3979 httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq))
3980 if err != nil {
3981 return err
3982 }
3983 httpReq = httpReq.WithContext(ctx)
3984 httpReq.Header = headers
3985
3986 buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, jsonReq, "CreateTagTemplateField")
3987 if err != nil {
3988 return err
3989 }
3990
3991 if err := unm.Unmarshal(buf, resp); err != nil {
3992 return err
3993 }
3994
3995 return nil
3996 }, opts...)
3997 if e != nil {
3998 return nil, e
3999 }
4000 return resp, nil
4001 }
4002
4003 // UpdateTagTemplateField updates a field in a tag template.
4004 //
4005 // You can’t update the field type with this method.
4006 //
4007 // You must enable the Data Catalog API in the project
4008 // identified by the name parameter. For more information, see Data Catalog
4009 // resource
4010 // project (at https://cloud.google.com/data-catalog/docs/concepts/resource-project).
4011 //
4012 // Deprecated: UpdateTagTemplateField may be removed in a future version.
4013 func (c *restClient) UpdateTagTemplateField(ctx context.Context, req *datacatalogpb.UpdateTagTemplateFieldRequest, opts ...gax.CallOption) (*datacatalogpb.TagTemplateField, error) {
4014 m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true}
4015 body := req.GetTagTemplateField()
4016 jsonReq, err := m.Marshal(body)
4017 if err != nil {
4018 return nil, err
4019 }
4020
4021 baseUrl, err := url.Parse(c.endpoint)
4022 if err != nil {
4023 return nil, err
4024 }
4025 baseUrl.Path += fmt.Sprintf("/v1/%v", req.GetName())
4026
4027 params := url.Values{}
4028 if req.GetUpdateMask() != nil {
4029 field, err := protojson.Marshal(req.GetUpdateMask())
4030 if err != nil {
4031 return nil, err
4032 }
4033 params.Add("updateMask", string(field[1:len(field)-1]))
4034 }
4035
4036 baseUrl.RawQuery = params.Encode()
4037
4038 // Build HTTP headers from client and context metadata.
4039 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
4040
4041 hds = append(c.xGoogHeaders, hds...)
4042 hds = append(hds, "Content-Type", "application/json")
4043 headers := gax.BuildHeaders(ctx, hds...)
4044 opts = append((*c.CallOptions).UpdateTagTemplateField[0:len((*c.CallOptions).UpdateTagTemplateField):len((*c.CallOptions).UpdateTagTemplateField)], opts...)
4045 unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
4046 resp := &datacatalogpb.TagTemplateField{}
4047 e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
4048 if settings.Path != "" {
4049 baseUrl.Path = settings.Path
4050 }
4051 httpReq, err := http.NewRequest("PATCH", baseUrl.String(), bytes.NewReader(jsonReq))
4052 if err != nil {
4053 return err
4054 }
4055 httpReq = httpReq.WithContext(ctx)
4056 httpReq.Header = headers
4057
4058 buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, jsonReq, "UpdateTagTemplateField")
4059 if err != nil {
4060 return err
4061 }
4062
4063 if err := unm.Unmarshal(buf, resp); err != nil {
4064 return err
4065 }
4066
4067 return nil
4068 }, opts...)
4069 if e != nil {
4070 return nil, e
4071 }
4072 return resp, nil
4073 }
4074
4075 // RenameTagTemplateField renames a field in a tag template.
4076 //
4077 // You must enable the Data Catalog API in the project identified by the
4078 // name parameter. For more information, see [Data Catalog resource project]
4079 // (https://cloud.google.com/data-catalog/docs/concepts/resource-project (at https://cloud.google.com/data-catalog/docs/concepts/resource-project)).
4080 //
4081 // Deprecated: RenameTagTemplateField may be removed in a future version.
4082 func (c *restClient) RenameTagTemplateField(ctx context.Context, req *datacatalogpb.RenameTagTemplateFieldRequest, opts ...gax.CallOption) (*datacatalogpb.TagTemplateField, error) {
4083 m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true}
4084 jsonReq, err := m.Marshal(req)
4085 if err != nil {
4086 return nil, err
4087 }
4088
4089 baseUrl, err := url.Parse(c.endpoint)
4090 if err != nil {
4091 return nil, err
4092 }
4093 baseUrl.Path += fmt.Sprintf("/v1/%v:rename", req.GetName())
4094
4095 // Build HTTP headers from client and context metadata.
4096 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
4097
4098 hds = append(c.xGoogHeaders, hds...)
4099 hds = append(hds, "Content-Type", "application/json")
4100 headers := gax.BuildHeaders(ctx, hds...)
4101 opts = append((*c.CallOptions).RenameTagTemplateField[0:len((*c.CallOptions).RenameTagTemplateField):len((*c.CallOptions).RenameTagTemplateField)], opts...)
4102 unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
4103 resp := &datacatalogpb.TagTemplateField{}
4104 e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
4105 if settings.Path != "" {
4106 baseUrl.Path = settings.Path
4107 }
4108 httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq))
4109 if err != nil {
4110 return err
4111 }
4112 httpReq = httpReq.WithContext(ctx)
4113 httpReq.Header = headers
4114
4115 buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, jsonReq, "RenameTagTemplateField")
4116 if err != nil {
4117 return err
4118 }
4119
4120 if err := unm.Unmarshal(buf, resp); err != nil {
4121 return err
4122 }
4123
4124 return nil
4125 }, opts...)
4126 if e != nil {
4127 return nil, e
4128 }
4129 return resp, nil
4130 }
4131
4132 // RenameTagTemplateFieldEnumValue renames an enum value in a tag template.
4133 //
4134 // Within a single enum field, enum values must be unique.
4135 //
4136 // Deprecated: RenameTagTemplateFieldEnumValue may be removed in a future version.
4137 func (c *restClient) RenameTagTemplateFieldEnumValue(ctx context.Context, req *datacatalogpb.RenameTagTemplateFieldEnumValueRequest, opts ...gax.CallOption) (*datacatalogpb.TagTemplateField, error) {
4138 m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true}
4139 jsonReq, err := m.Marshal(req)
4140 if err != nil {
4141 return nil, err
4142 }
4143
4144 baseUrl, err := url.Parse(c.endpoint)
4145 if err != nil {
4146 return nil, err
4147 }
4148 baseUrl.Path += fmt.Sprintf("/v1/%v:rename", req.GetName())
4149
4150 // Build HTTP headers from client and context metadata.
4151 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
4152
4153 hds = append(c.xGoogHeaders, hds...)
4154 hds = append(hds, "Content-Type", "application/json")
4155 headers := gax.BuildHeaders(ctx, hds...)
4156 opts = append((*c.CallOptions).RenameTagTemplateFieldEnumValue[0:len((*c.CallOptions).RenameTagTemplateFieldEnumValue):len((*c.CallOptions).RenameTagTemplateFieldEnumValue)], opts...)
4157 unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
4158 resp := &datacatalogpb.TagTemplateField{}
4159 e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
4160 if settings.Path != "" {
4161 baseUrl.Path = settings.Path
4162 }
4163 httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq))
4164 if err != nil {
4165 return err
4166 }
4167 httpReq = httpReq.WithContext(ctx)
4168 httpReq.Header = headers
4169
4170 buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, jsonReq, "RenameTagTemplateFieldEnumValue")
4171 if err != nil {
4172 return err
4173 }
4174
4175 if err := unm.Unmarshal(buf, resp); err != nil {
4176 return err
4177 }
4178
4179 return nil
4180 }, opts...)
4181 if e != nil {
4182 return nil, e
4183 }
4184 return resp, nil
4185 }
4186
4187 // DeleteTagTemplateField deletes a field in a tag template and all uses of this field from the tags
4188 // based on this template.
4189 //
4190 // You must enable the Data Catalog API in the project identified by
4191 // the name parameter. For more information, see Data Catalog resource
4192 // project (at https://cloud.google.com/data-catalog/docs/concepts/resource-project).
4193 //
4194 // Deprecated: DeleteTagTemplateField may be removed in a future version.
4195 func (c *restClient) DeleteTagTemplateField(ctx context.Context, req *datacatalogpb.DeleteTagTemplateFieldRequest, opts ...gax.CallOption) error {
4196 baseUrl, err := url.Parse(c.endpoint)
4197 if err != nil {
4198 return err
4199 }
4200 baseUrl.Path += fmt.Sprintf("/v1/%v", req.GetName())
4201
4202 params := url.Values{}
4203 params.Add("force", fmt.Sprintf("%v", req.GetForce()))
4204
4205 baseUrl.RawQuery = params.Encode()
4206
4207 // Build HTTP headers from client and context metadata.
4208 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
4209
4210 hds = append(c.xGoogHeaders, hds...)
4211 hds = append(hds, "Content-Type", "application/json")
4212 headers := gax.BuildHeaders(ctx, hds...)
4213 return gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
4214 if settings.Path != "" {
4215 baseUrl.Path = settings.Path
4216 }
4217 httpReq, err := http.NewRequest("DELETE", baseUrl.String(), nil)
4218 if err != nil {
4219 return err
4220 }
4221 httpReq = httpReq.WithContext(ctx)
4222 httpReq.Header = headers
4223
4224 _, err = executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, nil, "DeleteTagTemplateField")
4225 return err
4226 }, opts...)
4227 }
4228
4229 // CreateTag creates a tag and assigns it to:
4230 //
4231 // An Entry if the method name is
4232 // projects.locations.entryGroups.entries.tags.create.
4233 //
4234 // Or EntryGroupif the method
4235 // name is projects.locations.entryGroups.tags.create.
4236 //
4237 // Note: The project identified by the parent parameter for the [tag]
4238 // (https://cloud.google.com/data-catalog/docs/reference/rest/v1/projects.locations.entryGroups.entries.tags/create#path-parameters (at https://cloud.google.com/data-catalog/docs/reference/rest/v1/projects.locations.entryGroups.entries.tags/create#path-parameters))
4239 // and the [tag template]
4240 // (https://cloud.google.com/data-catalog/docs/reference/rest/v1/projects.locations.tagTemplates/create#path-parameters (at https://cloud.google.com/data-catalog/docs/reference/rest/v1/projects.locations.tagTemplates/create#path-parameters))
4241 // used to create the tag must be in the same organization.
4242 //
4243 // Deprecated: CreateTag may be removed in a future version.
4244 func (c *restClient) CreateTag(ctx context.Context, req *datacatalogpb.CreateTagRequest, opts ...gax.CallOption) (*datacatalogpb.Tag, error) {
4245 m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true}
4246 body := req.GetTag()
4247 jsonReq, err := m.Marshal(body)
4248 if err != nil {
4249 return nil, err
4250 }
4251
4252 baseUrl, err := url.Parse(c.endpoint)
4253 if err != nil {
4254 return nil, err
4255 }
4256 baseUrl.Path += fmt.Sprintf("/v1/%v/tags", req.GetParent())
4257
4258 // Build HTTP headers from client and context metadata.
4259 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))}
4260
4261 hds = append(c.xGoogHeaders, hds...)
4262 hds = append(hds, "Content-Type", "application/json")
4263 headers := gax.BuildHeaders(ctx, hds...)
4264 opts = append((*c.CallOptions).CreateTag[0:len((*c.CallOptions).CreateTag):len((*c.CallOptions).CreateTag)], opts...)
4265 unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
4266 resp := &datacatalogpb.Tag{}
4267 e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
4268 if settings.Path != "" {
4269 baseUrl.Path = settings.Path
4270 }
4271 httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq))
4272 if err != nil {
4273 return err
4274 }
4275 httpReq = httpReq.WithContext(ctx)
4276 httpReq.Header = headers
4277
4278 buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, jsonReq, "CreateTag")
4279 if err != nil {
4280 return err
4281 }
4282
4283 if err := unm.Unmarshal(buf, resp); err != nil {
4284 return err
4285 }
4286
4287 return nil
4288 }, opts...)
4289 if e != nil {
4290 return nil, e
4291 }
4292 return resp, nil
4293 }
4294
4295 // UpdateTag updates an existing tag.
4296 //
4297 // Deprecated: UpdateTag may be removed in a future version.
4298 func (c *restClient) UpdateTag(ctx context.Context, req *datacatalogpb.UpdateTagRequest, opts ...gax.CallOption) (*datacatalogpb.Tag, error) {
4299 m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true}
4300 body := req.GetTag()
4301 jsonReq, err := m.Marshal(body)
4302 if err != nil {
4303 return nil, err
4304 }
4305
4306 baseUrl, err := url.Parse(c.endpoint)
4307 if err != nil {
4308 return nil, err
4309 }
4310 baseUrl.Path += fmt.Sprintf("/v1/%v", req.GetTag().GetName())
4311
4312 params := url.Values{}
4313 if req.GetUpdateMask() != nil {
4314 field, err := protojson.Marshal(req.GetUpdateMask())
4315 if err != nil {
4316 return nil, err
4317 }
4318 params.Add("updateMask", string(field[1:len(field)-1]))
4319 }
4320
4321 baseUrl.RawQuery = params.Encode()
4322
4323 // Build HTTP headers from client and context metadata.
4324 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "tag.name", url.QueryEscape(req.GetTag().GetName()))}
4325
4326 hds = append(c.xGoogHeaders, hds...)
4327 hds = append(hds, "Content-Type", "application/json")
4328 headers := gax.BuildHeaders(ctx, hds...)
4329 opts = append((*c.CallOptions).UpdateTag[0:len((*c.CallOptions).UpdateTag):len((*c.CallOptions).UpdateTag)], opts...)
4330 unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
4331 resp := &datacatalogpb.Tag{}
4332 e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
4333 if settings.Path != "" {
4334 baseUrl.Path = settings.Path
4335 }
4336 httpReq, err := http.NewRequest("PATCH", baseUrl.String(), bytes.NewReader(jsonReq))
4337 if err != nil {
4338 return err
4339 }
4340 httpReq = httpReq.WithContext(ctx)
4341 httpReq.Header = headers
4342
4343 buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, jsonReq, "UpdateTag")
4344 if err != nil {
4345 return err
4346 }
4347
4348 if err := unm.Unmarshal(buf, resp); err != nil {
4349 return err
4350 }
4351
4352 return nil
4353 }, opts...)
4354 if e != nil {
4355 return nil, e
4356 }
4357 return resp, nil
4358 }
4359
4360 // DeleteTag deletes a tag.
4361 //
4362 // Deprecated: DeleteTag may be removed in a future version.
4363 func (c *restClient) DeleteTag(ctx context.Context, req *datacatalogpb.DeleteTagRequest, opts ...gax.CallOption) error {
4364 baseUrl, err := url.Parse(c.endpoint)
4365 if err != nil {
4366 return err
4367 }
4368 baseUrl.Path += fmt.Sprintf("/v1/%v", req.GetName())
4369
4370 // Build HTTP headers from client and context metadata.
4371 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
4372
4373 hds = append(c.xGoogHeaders, hds...)
4374 hds = append(hds, "Content-Type", "application/json")
4375 headers := gax.BuildHeaders(ctx, hds...)
4376 return gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
4377 if settings.Path != "" {
4378 baseUrl.Path = settings.Path
4379 }
4380 httpReq, err := http.NewRequest("DELETE", baseUrl.String(), nil)
4381 if err != nil {
4382 return err
4383 }
4384 httpReq = httpReq.WithContext(ctx)
4385 httpReq.Header = headers
4386
4387 _, err = executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, nil, "DeleteTag")
4388 return err
4389 }, opts...)
4390 }
4391
4392 // ListTags lists tags assigned to an Entry.
4393 // The columns in the response are
4394 // lowercased.
4395 //
4396 // Deprecated: ListTags may be removed in a future version.
4397 func (c *restClient) ListTags(ctx context.Context, req *datacatalogpb.ListTagsRequest, opts ...gax.CallOption) *TagIterator {
4398 it := &TagIterator{}
4399 req = proto.Clone(req).(*datacatalogpb.ListTagsRequest)
4400 unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
4401 it.InternalFetch = func(pageSize int, pageToken string) ([]*datacatalogpb.Tag, string, error) {
4402 resp := &datacatalogpb.ListTagsResponse{}
4403 if pageToken != "" {
4404 req.PageToken = pageToken
4405 }
4406 if pageSize > math.MaxInt32 {
4407 req.PageSize = math.MaxInt32
4408 } else if pageSize != 0 {
4409 req.PageSize = int32(pageSize)
4410 }
4411 baseUrl, err := url.Parse(c.endpoint)
4412 if err != nil {
4413 return nil, "", err
4414 }
4415 baseUrl.Path += fmt.Sprintf("/v1/%v/tags", req.GetParent())
4416
4417 params := url.Values{}
4418 if req.GetPageSize() != 0 {
4419 params.Add("pageSize", fmt.Sprintf("%v", req.GetPageSize()))
4420 }
4421 if req.GetPageToken() != "" {
4422 params.Add("pageToken", fmt.Sprintf("%v", req.GetPageToken()))
4423 }
4424
4425 baseUrl.RawQuery = params.Encode()
4426
4427 // Build HTTP headers from client and context metadata.
4428 hds := append(c.xGoogHeaders, "Content-Type", "application/json")
4429 headers := gax.BuildHeaders(ctx, hds...)
4430 e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
4431 if settings.Path != "" {
4432 baseUrl.Path = settings.Path
4433 }
4434 httpReq, err := http.NewRequest("GET", baseUrl.String(), nil)
4435 if err != nil {
4436 return err
4437 }
4438 httpReq.Header = headers
4439
4440 buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, nil, "ListTags")
4441 if err != nil {
4442 return err
4443 }
4444 if err := unm.Unmarshal(buf, resp); err != nil {
4445 return err
4446 }
4447
4448 return nil
4449 }, opts...)
4450 if e != nil {
4451 return nil, "", e
4452 }
4453 it.Response = resp
4454 return resp.GetTags(), resp.GetNextPageToken(), nil
4455 }
4456
4457 fetch := func(pageSize int, pageToken string) (string, error) {
4458 items, nextPageToken, err := it.InternalFetch(pageSize, pageToken)
4459 if err != nil {
4460 return "", err
4461 }
4462 it.items = append(it.items, items...)
4463 return nextPageToken, nil
4464 }
4465
4466 it.pageInfo, it.nextFunc = iterator.NewPageInfo(fetch, it.bufLen, it.takeBuf)
4467 it.pageInfo.MaxSize = int(req.GetPageSize())
4468 it.pageInfo.Token = req.GetPageToken()
4469
4470 return it
4471 }
4472
4473 // ReconcileTags ReconcileTags creates or updates a list of tags on the entry.
4474 // If the
4475 // ReconcileTagsRequest.force_delete_missing
4476 // parameter is set, the operation deletes tags not included in the input tag
4477 // list.
4478 //
4479 // ReconcileTags returns a [long-running operation]
4480 // [google.longrunning.Operation] resource that can be queried with
4481 // Operations.GetOperation
4482 // to return [ReconcileTagsMetadata]
4483 // [google.cloud.datacatalog.v1.ReconcileTagsMetadata] and
4484 // a [ReconcileTagsResponse]
4485 // [google.cloud.datacatalog.v1.ReconcileTagsResponse] message.
4486 //
4487 // Deprecated: ReconcileTags may be removed in a future version.
4488 func (c *restClient) ReconcileTags(ctx context.Context, req *datacatalogpb.ReconcileTagsRequest, opts ...gax.CallOption) (*ReconcileTagsOperation, error) {
4489 m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true}
4490 jsonReq, err := m.Marshal(req)
4491 if err != nil {
4492 return nil, err
4493 }
4494
4495 baseUrl, err := url.Parse(c.endpoint)
4496 if err != nil {
4497 return nil, err
4498 }
4499 baseUrl.Path += fmt.Sprintf("/v1/%v/tags:reconcile", req.GetParent())
4500
4501 // Build HTTP headers from client and context metadata.
4502 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))}
4503
4504 hds = append(c.xGoogHeaders, hds...)
4505 hds = append(hds, "Content-Type", "application/json")
4506 headers := gax.BuildHeaders(ctx, hds...)
4507 unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
4508 resp := &longrunningpb.Operation{}
4509 e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
4510 if settings.Path != "" {
4511 baseUrl.Path = settings.Path
4512 }
4513 httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq))
4514 if err != nil {
4515 return err
4516 }
4517 httpReq = httpReq.WithContext(ctx)
4518 httpReq.Header = headers
4519
4520 buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, jsonReq, "ReconcileTags")
4521 if err != nil {
4522 return err
4523 }
4524 if err := unm.Unmarshal(buf, resp); err != nil {
4525 return err
4526 }
4527
4528 return nil
4529 }, opts...)
4530 if e != nil {
4531 return nil, e
4532 }
4533
4534 override := fmt.Sprintf("/v1/%s", resp.GetName())
4535 return &ReconcileTagsOperation{
4536 lro: longrunning.InternalNewOperation(*c.LROClient, resp),
4537 pollPath: override,
4538 }, nil
4539 }
4540
4541 // StarEntry marks an Entry as starred by
4542 // the current user. Starring information is private to each user.
4543 //
4544 // Deprecated: StarEntry may be removed in a future version.
4545 func (c *restClient) StarEntry(ctx context.Context, req *datacatalogpb.StarEntryRequest, opts ...gax.CallOption) (*datacatalogpb.StarEntryResponse, error) {
4546 m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true}
4547 jsonReq, err := m.Marshal(req)
4548 if err != nil {
4549 return nil, err
4550 }
4551
4552 baseUrl, err := url.Parse(c.endpoint)
4553 if err != nil {
4554 return nil, err
4555 }
4556 baseUrl.Path += fmt.Sprintf("/v1/%v:star", req.GetName())
4557
4558 // Build HTTP headers from client and context metadata.
4559 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
4560
4561 hds = append(c.xGoogHeaders, hds...)
4562 hds = append(hds, "Content-Type", "application/json")
4563 headers := gax.BuildHeaders(ctx, hds...)
4564 opts = append((*c.CallOptions).StarEntry[0:len((*c.CallOptions).StarEntry):len((*c.CallOptions).StarEntry)], opts...)
4565 unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
4566 resp := &datacatalogpb.StarEntryResponse{}
4567 e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
4568 if settings.Path != "" {
4569 baseUrl.Path = settings.Path
4570 }
4571 httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq))
4572 if err != nil {
4573 return err
4574 }
4575 httpReq = httpReq.WithContext(ctx)
4576 httpReq.Header = headers
4577
4578 buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, jsonReq, "StarEntry")
4579 if err != nil {
4580 return err
4581 }
4582
4583 if err := unm.Unmarshal(buf, resp); err != nil {
4584 return err
4585 }
4586
4587 return nil
4588 }, opts...)
4589 if e != nil {
4590 return nil, e
4591 }
4592 return resp, nil
4593 }
4594
4595 // UnstarEntry marks an Entry as NOT starred by
4596 // the current user. Starring information is private to each user.
4597 //
4598 // Deprecated: UnstarEntry may be removed in a future version.
4599 func (c *restClient) UnstarEntry(ctx context.Context, req *datacatalogpb.UnstarEntryRequest, opts ...gax.CallOption) (*datacatalogpb.UnstarEntryResponse, error) {
4600 m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true}
4601 jsonReq, err := m.Marshal(req)
4602 if err != nil {
4603 return nil, err
4604 }
4605
4606 baseUrl, err := url.Parse(c.endpoint)
4607 if err != nil {
4608 return nil, err
4609 }
4610 baseUrl.Path += fmt.Sprintf("/v1/%v:unstar", req.GetName())
4611
4612 // Build HTTP headers from client and context metadata.
4613 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
4614
4615 hds = append(c.xGoogHeaders, hds...)
4616 hds = append(hds, "Content-Type", "application/json")
4617 headers := gax.BuildHeaders(ctx, hds...)
4618 opts = append((*c.CallOptions).UnstarEntry[0:len((*c.CallOptions).UnstarEntry):len((*c.CallOptions).UnstarEntry)], opts...)
4619 unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
4620 resp := &datacatalogpb.UnstarEntryResponse{}
4621 e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
4622 if settings.Path != "" {
4623 baseUrl.Path = settings.Path
4624 }
4625 httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq))
4626 if err != nil {
4627 return err
4628 }
4629 httpReq = httpReq.WithContext(ctx)
4630 httpReq.Header = headers
4631
4632 buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, jsonReq, "UnstarEntry")
4633 if err != nil {
4634 return err
4635 }
4636
4637 if err := unm.Unmarshal(buf, resp); err != nil {
4638 return err
4639 }
4640
4641 return nil
4642 }, opts...)
4643 if e != nil {
4644 return nil, e
4645 }
4646 return resp, nil
4647 }
4648
4649 // SetIamPolicy sets an access control policy for a resource. Replaces any existing
4650 // policy.
4651 //
4652 // Supported resources are:
4653 //
4654 // Tag templates
4655 //
4656 // Entry groups
4657 //
4658 // Note: This method sets policies only within Data Catalog and can’t be
4659 // used to manage policies in BigQuery, Pub/Sub, Dataproc Metastore, and any
4660 // external Google Cloud Platform resources synced with the Data Catalog.
4661 //
4662 // To call this method, you must have the following Google IAM permissions:
4663 //
4664 // datacatalog.tagTemplates.setIamPolicy to set policies on tag
4665 // templates.
4666 //
4667 // datacatalog.entryGroups.setIamPolicy to set policies on entry groups.
4668 //
4669 // Deprecated: SetIamPolicy may be removed in a future version.
4670 func (c *restClient) SetIamPolicy(ctx context.Context, req *iampb.SetIamPolicyRequest, opts ...gax.CallOption) (*iampb.Policy, error) {
4671 m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true}
4672 jsonReq, err := m.Marshal(req)
4673 if err != nil {
4674 return nil, err
4675 }
4676
4677 baseUrl, err := url.Parse(c.endpoint)
4678 if err != nil {
4679 return nil, err
4680 }
4681 baseUrl.Path += fmt.Sprintf("/v1/%v:setIamPolicy", req.GetResource())
4682
4683 // Build HTTP headers from client and context metadata.
4684 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "resource", url.QueryEscape(req.GetResource()))}
4685
4686 hds = append(c.xGoogHeaders, hds...)
4687 hds = append(hds, "Content-Type", "application/json")
4688 headers := gax.BuildHeaders(ctx, hds...)
4689 opts = append((*c.CallOptions).SetIamPolicy[0:len((*c.CallOptions).SetIamPolicy):len((*c.CallOptions).SetIamPolicy)], opts...)
4690 unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
4691 resp := &iampb.Policy{}
4692 e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
4693 if settings.Path != "" {
4694 baseUrl.Path = settings.Path
4695 }
4696 httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq))
4697 if err != nil {
4698 return err
4699 }
4700 httpReq = httpReq.WithContext(ctx)
4701 httpReq.Header = headers
4702
4703 buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, jsonReq, "SetIamPolicy")
4704 if err != nil {
4705 return err
4706 }
4707
4708 if err := unm.Unmarshal(buf, resp); err != nil {
4709 return err
4710 }
4711
4712 return nil
4713 }, opts...)
4714 if e != nil {
4715 return nil, e
4716 }
4717 return resp, nil
4718 }
4719
4720 // GetIamPolicy gets the access control policy for a resource.
4721 //
4722 // May return:
4723 //
4724 // ANOT_FOUND error if the resource doesn’t exist or you don’t have the
4725 // permission to view it.
4726 //
4727 // An empty policy if the resource exists but doesn’t have a set policy.
4728 //
4729 // Supported resources are:
4730 //
4731 // Tag templates
4732 //
4733 // Entry groups
4734 //
4735 // Note: This method doesn’t get policies from Google Cloud Platform
4736 // resources ingested into Data Catalog.
4737 //
4738 // To call this method, you must have the following Google IAM permissions:
4739 //
4740 // datacatalog.tagTemplates.getIamPolicy to get policies on tag
4741 // templates.
4742 //
4743 // datacatalog.entryGroups.getIamPolicy to get policies on entry groups.
4744 //
4745 // Deprecated: GetIamPolicy may be removed in a future version.
4746 func (c *restClient) GetIamPolicy(ctx context.Context, req *iampb.GetIamPolicyRequest, opts ...gax.CallOption) (*iampb.Policy, error) {
4747 m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true}
4748 jsonReq, err := m.Marshal(req)
4749 if err != nil {
4750 return nil, err
4751 }
4752
4753 baseUrl, err := url.Parse(c.endpoint)
4754 if err != nil {
4755 return nil, err
4756 }
4757 baseUrl.Path += fmt.Sprintf("/v1/%v:getIamPolicy", req.GetResource())
4758
4759 // Build HTTP headers from client and context metadata.
4760 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "resource", url.QueryEscape(req.GetResource()))}
4761
4762 hds = append(c.xGoogHeaders, hds...)
4763 hds = append(hds, "Content-Type", "application/json")
4764 headers := gax.BuildHeaders(ctx, hds...)
4765 opts = append((*c.CallOptions).GetIamPolicy[0:len((*c.CallOptions).GetIamPolicy):len((*c.CallOptions).GetIamPolicy)], opts...)
4766 unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
4767 resp := &iampb.Policy{}
4768 e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
4769 if settings.Path != "" {
4770 baseUrl.Path = settings.Path
4771 }
4772 httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq))
4773 if err != nil {
4774 return err
4775 }
4776 httpReq = httpReq.WithContext(ctx)
4777 httpReq.Header = headers
4778
4779 buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, jsonReq, "GetIamPolicy")
4780 if err != nil {
4781 return err
4782 }
4783
4784 if err := unm.Unmarshal(buf, resp); err != nil {
4785 return err
4786 }
4787
4788 return nil
4789 }, opts...)
4790 if e != nil {
4791 return nil, e
4792 }
4793 return resp, nil
4794 }
4795
4796 // TestIamPermissions gets your permissions on a resource.
4797 //
4798 // Returns an empty set of permissions if the resource doesn’t exist.
4799 //
4800 // Supported resources are:
4801 //
4802 // Tag templates
4803 //
4804 // Entry groups
4805 //
4806 // Note: This method gets policies only within Data Catalog and can’t be
4807 // used to get policies from BigQuery, Pub/Sub, Dataproc Metastore, and any
4808 // external Google Cloud Platform resources ingested into Data Catalog.
4809 //
4810 // No Google IAM permissions are required to call this method.
4811 //
4812 // Deprecated: TestIamPermissions may be removed in a future version.
4813 func (c *restClient) TestIamPermissions(ctx context.Context, req *iampb.TestIamPermissionsRequest, opts ...gax.CallOption) (*iampb.TestIamPermissionsResponse, error) {
4814 m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true}
4815 jsonReq, err := m.Marshal(req)
4816 if err != nil {
4817 return nil, err
4818 }
4819
4820 baseUrl, err := url.Parse(c.endpoint)
4821 if err != nil {
4822 return nil, err
4823 }
4824 baseUrl.Path += fmt.Sprintf("/v1/%v:testIamPermissions", req.GetResource())
4825
4826 // Build HTTP headers from client and context metadata.
4827 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "resource", url.QueryEscape(req.GetResource()))}
4828
4829 hds = append(c.xGoogHeaders, hds...)
4830 hds = append(hds, "Content-Type", "application/json")
4831 headers := gax.BuildHeaders(ctx, hds...)
4832 opts = append((*c.CallOptions).TestIamPermissions[0:len((*c.CallOptions).TestIamPermissions):len((*c.CallOptions).TestIamPermissions)], opts...)
4833 unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
4834 resp := &iampb.TestIamPermissionsResponse{}
4835 e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
4836 if settings.Path != "" {
4837 baseUrl.Path = settings.Path
4838 }
4839 httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq))
4840 if err != nil {
4841 return err
4842 }
4843 httpReq = httpReq.WithContext(ctx)
4844 httpReq.Header = headers
4845
4846 buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, jsonReq, "TestIamPermissions")
4847 if err != nil {
4848 return err
4849 }
4850
4851 if err := unm.Unmarshal(buf, resp); err != nil {
4852 return err
4853 }
4854
4855 return nil
4856 }, opts...)
4857 if e != nil {
4858 return nil, e
4859 }
4860 return resp, nil
4861 }
4862
4863 // ImportEntries imports entries from a source, such as data previously dumped into a
4864 // Cloud Storage bucket, into Data Catalog. Import of entries
4865 // is a sync operation that reconciles the state of the third-party system
4866 // with the Data Catalog.
4867 //
4868 // ImportEntries accepts source data snapshots of a third-party system.
4869 // Snapshot should be delivered as a .wire or base65-encoded .txt file
4870 // containing a sequence of Protocol Buffer messages of
4871 // DumpItem type.
4872 //
4873 // ImportEntries returns a [long-running operation]
4874 // [google.longrunning.Operation] resource that can be queried with
4875 // Operations.GetOperation
4876 // to return
4877 // ImportEntriesMetadata
4878 // and an
4879 // ImportEntriesResponse
4880 // message.
4881 //
4882 // Deprecated: ImportEntries may be removed in a future version.
4883 func (c *restClient) ImportEntries(ctx context.Context, req *datacatalogpb.ImportEntriesRequest, opts ...gax.CallOption) (*ImportEntriesOperation, error) {
4884 m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true}
4885 jsonReq, err := m.Marshal(req)
4886 if err != nil {
4887 return nil, err
4888 }
4889
4890 baseUrl, err := url.Parse(c.endpoint)
4891 if err != nil {
4892 return nil, err
4893 }
4894 baseUrl.Path += fmt.Sprintf("/v1/%v/entries:import", req.GetParent())
4895
4896 // Build HTTP headers from client and context metadata.
4897 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))}
4898
4899 hds = append(c.xGoogHeaders, hds...)
4900 hds = append(hds, "Content-Type", "application/json")
4901 headers := gax.BuildHeaders(ctx, hds...)
4902 unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
4903 resp := &longrunningpb.Operation{}
4904 e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
4905 if settings.Path != "" {
4906 baseUrl.Path = settings.Path
4907 }
4908 httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq))
4909 if err != nil {
4910 return err
4911 }
4912 httpReq = httpReq.WithContext(ctx)
4913 httpReq.Header = headers
4914
4915 buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, jsonReq, "ImportEntries")
4916 if err != nil {
4917 return err
4918 }
4919 if err := unm.Unmarshal(buf, resp); err != nil {
4920 return err
4921 }
4922
4923 return nil
4924 }, opts...)
4925 if e != nil {
4926 return nil, e
4927 }
4928
4929 override := fmt.Sprintf("/v1/%s", resp.GetName())
4930 return &ImportEntriesOperation{
4931 lro: longrunning.InternalNewOperation(*c.LROClient, resp),
4932 pollPath: override,
4933 }, nil
4934 }
4935
4936 // SetConfig sets the configuration related to the migration to Dataplex for an
4937 // organization or project.
4938 //
4939 // Deprecated: SetConfig may be removed in a future version.
4940 func (c *restClient) SetConfig(ctx context.Context, req *datacatalogpb.SetConfigRequest, opts ...gax.CallOption) (*datacatalogpb.MigrationConfig, error) {
4941 m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true}
4942 jsonReq, err := m.Marshal(req)
4943 if err != nil {
4944 return nil, err
4945 }
4946
4947 baseUrl, err := url.Parse(c.endpoint)
4948 if err != nil {
4949 return nil, err
4950 }
4951 baseUrl.Path += fmt.Sprintf("/v1/%v:setConfig", req.GetName())
4952
4953 // Build HTTP headers from client and context metadata.
4954 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
4955
4956 hds = append(c.xGoogHeaders, hds...)
4957 hds = append(hds, "Content-Type", "application/json")
4958 headers := gax.BuildHeaders(ctx, hds...)
4959 opts = append((*c.CallOptions).SetConfig[0:len((*c.CallOptions).SetConfig):len((*c.CallOptions).SetConfig)], opts...)
4960 unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
4961 resp := &datacatalogpb.MigrationConfig{}
4962 e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
4963 if settings.Path != "" {
4964 baseUrl.Path = settings.Path
4965 }
4966 httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq))
4967 if err != nil {
4968 return err
4969 }
4970 httpReq = httpReq.WithContext(ctx)
4971 httpReq.Header = headers
4972
4973 buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, jsonReq, "SetConfig")
4974 if err != nil {
4975 return err
4976 }
4977
4978 if err := unm.Unmarshal(buf, resp); err != nil {
4979 return err
4980 }
4981
4982 return nil
4983 }, opts...)
4984 if e != nil {
4985 return nil, e
4986 }
4987 return resp, nil
4988 }
4989
4990 // RetrieveConfig retrieves the configuration related to the migration from Data Catalog to
4991 // Dataplex for a specific organization, including all the projects under it
4992 // which have a separate configuration set.
4993 //
4994 // Deprecated: RetrieveConfig may be removed in a future version.
4995 func (c *restClient) RetrieveConfig(ctx context.Context, req *datacatalogpb.RetrieveConfigRequest, opts ...gax.CallOption) (*datacatalogpb.OrganizationConfig, error) {
4996 baseUrl, err := url.Parse(c.endpoint)
4997 if err != nil {
4998 return nil, err
4999 }
5000 baseUrl.Path += fmt.Sprintf("/v1/%v:retrieveConfig", req.GetName())
5001
5002 // Build HTTP headers from client and context metadata.
5003 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
5004
5005 hds = append(c.xGoogHeaders, hds...)
5006 hds = append(hds, "Content-Type", "application/json")
5007 headers := gax.BuildHeaders(ctx, hds...)
5008 opts = append((*c.CallOptions).RetrieveConfig[0:len((*c.CallOptions).RetrieveConfig):len((*c.CallOptions).RetrieveConfig)], opts...)
5009 unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
5010 resp := &datacatalogpb.OrganizationConfig{}
5011 e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
5012 if settings.Path != "" {
5013 baseUrl.Path = settings.Path
5014 }
5015 httpReq, err := http.NewRequest("GET", baseUrl.String(), nil)
5016 if err != nil {
5017 return err
5018 }
5019 httpReq = httpReq.WithContext(ctx)
5020 httpReq.Header = headers
5021
5022 buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, nil, "RetrieveConfig")
5023 if err != nil {
5024 return err
5025 }
5026
5027 if err := unm.Unmarshal(buf, resp); err != nil {
5028 return err
5029 }
5030
5031 return nil
5032 }, opts...)
5033 if e != nil {
5034 return nil, e
5035 }
5036 return resp, nil
5037 }
5038
5039 // RetrieveEffectiveConfig retrieves the effective configuration related to the migration from Data
5040 // Catalog to Dataplex for a specific organization or project. If there is no
5041 // specific configuration set for the resource, the setting is checked
5042 // hierarchicahlly through the ancestors of the resource, starting from the
5043 // resource itself.
5044 //
5045 // Deprecated: RetrieveEffectiveConfig may be removed in a future version.
5046 func (c *restClient) RetrieveEffectiveConfig(ctx context.Context, req *datacatalogpb.RetrieveEffectiveConfigRequest, opts ...gax.CallOption) (*datacatalogpb.MigrationConfig, error) {
5047 baseUrl, err := url.Parse(c.endpoint)
5048 if err != nil {
5049 return nil, err
5050 }
5051 baseUrl.Path += fmt.Sprintf("/v1/%v:retrieveEffectiveConfig", req.GetName())
5052
5053 // Build HTTP headers from client and context metadata.
5054 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
5055
5056 hds = append(c.xGoogHeaders, hds...)
5057 hds = append(hds, "Content-Type", "application/json")
5058 headers := gax.BuildHeaders(ctx, hds...)
5059 opts = append((*c.CallOptions).RetrieveEffectiveConfig[0:len((*c.CallOptions).RetrieveEffectiveConfig):len((*c.CallOptions).RetrieveEffectiveConfig)], opts...)
5060 unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
5061 resp := &datacatalogpb.MigrationConfig{}
5062 e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
5063 if settings.Path != "" {
5064 baseUrl.Path = settings.Path
5065 }
5066 httpReq, err := http.NewRequest("GET", baseUrl.String(), nil)
5067 if err != nil {
5068 return err
5069 }
5070 httpReq = httpReq.WithContext(ctx)
5071 httpReq.Header = headers
5072
5073 buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, nil, "RetrieveEffectiveConfig")
5074 if err != nil {
5075 return err
5076 }
5077
5078 if err := unm.Unmarshal(buf, resp); err != nil {
5079 return err
5080 }
5081
5082 return nil
5083 }, opts...)
5084 if e != nil {
5085 return nil, e
5086 }
5087 return resp, nil
5088 }
5089
5090 // CancelOperation is a utility method from google.longrunning.Operations.
5091 func (c *restClient) CancelOperation(ctx context.Context, req *longrunningpb.CancelOperationRequest, opts ...gax.CallOption) error {
5092 baseUrl, err := url.Parse(c.endpoint)
5093 if err != nil {
5094 return err
5095 }
5096 baseUrl.Path += fmt.Sprintf("/v1/%v:cancel", req.GetName())
5097
5098 // Build HTTP headers from client and context metadata.
5099 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
5100
5101 hds = append(c.xGoogHeaders, hds...)
5102 hds = append(hds, "Content-Type", "application/json")
5103 headers := gax.BuildHeaders(ctx, hds...)
5104 return gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
5105 if settings.Path != "" {
5106 baseUrl.Path = settings.Path
5107 }
5108 httpReq, err := http.NewRequest("POST", baseUrl.String(), nil)
5109 if err != nil {
5110 return err
5111 }
5112 httpReq = httpReq.WithContext(ctx)
5113 httpReq.Header = headers
5114
5115 _, err = executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, nil, "CancelOperation")
5116 return err
5117 }, opts...)
5118 }
5119
5120 // DeleteOperation is a utility method from google.longrunning.Operations.
5121 func (c *restClient) DeleteOperation(ctx context.Context, req *longrunningpb.DeleteOperationRequest, opts ...gax.CallOption) error {
5122 baseUrl, err := url.Parse(c.endpoint)
5123 if err != nil {
5124 return err
5125 }
5126 baseUrl.Path += fmt.Sprintf("/v1/%v", req.GetName())
5127
5128 // Build HTTP headers from client and context metadata.
5129 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
5130
5131 hds = append(c.xGoogHeaders, hds...)
5132 hds = append(hds, "Content-Type", "application/json")
5133 headers := gax.BuildHeaders(ctx, hds...)
5134 return gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
5135 if settings.Path != "" {
5136 baseUrl.Path = settings.Path
5137 }
5138 httpReq, err := http.NewRequest("DELETE", baseUrl.String(), nil)
5139 if err != nil {
5140 return err
5141 }
5142 httpReq = httpReq.WithContext(ctx)
5143 httpReq.Header = headers
5144
5145 _, err = executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, nil, "DeleteOperation")
5146 return err
5147 }, opts...)
5148 }
5149
5150 // GetOperation is a utility method from google.longrunning.Operations.
5151 func (c *restClient) GetOperation(ctx context.Context, req *longrunningpb.GetOperationRequest, opts ...gax.CallOption) (*longrunningpb.Operation, error) {
5152 baseUrl, err := url.Parse(c.endpoint)
5153 if err != nil {
5154 return nil, err
5155 }
5156 baseUrl.Path += fmt.Sprintf("/v1/%v", req.GetName())
5157
5158 // Build HTTP headers from client and context metadata.
5159 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
5160
5161 hds = append(c.xGoogHeaders, hds...)
5162 hds = append(hds, "Content-Type", "application/json")
5163 headers := gax.BuildHeaders(ctx, hds...)
5164 opts = append((*c.CallOptions).GetOperation[0:len((*c.CallOptions).GetOperation):len((*c.CallOptions).GetOperation)], opts...)
5165 unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
5166 resp := &longrunningpb.Operation{}
5167 e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
5168 if settings.Path != "" {
5169 baseUrl.Path = settings.Path
5170 }
5171 httpReq, err := http.NewRequest("GET", baseUrl.String(), nil)
5172 if err != nil {
5173 return err
5174 }
5175 httpReq = httpReq.WithContext(ctx)
5176 httpReq.Header = headers
5177
5178 buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, nil, "GetOperation")
5179 if err != nil {
5180 return err
5181 }
5182
5183 if err := unm.Unmarshal(buf, resp); err != nil {
5184 return err
5185 }
5186
5187 return nil
5188 }, opts...)
5189 if e != nil {
5190 return nil, e
5191 }
5192 return resp, nil
5193 }
5194
5195 // ListOperations is a utility method from google.longrunning.Operations.
5196 func (c *restClient) ListOperations(ctx context.Context, req *longrunningpb.ListOperationsRequest, opts ...gax.CallOption) *OperationIterator {
5197 it := &OperationIterator{}
5198 req = proto.Clone(req).(*longrunningpb.ListOperationsRequest)
5199 unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
5200 it.InternalFetch = func(pageSize int, pageToken string) ([]*longrunningpb.Operation, string, error) {
5201 resp := &longrunningpb.ListOperationsResponse{}
5202 if pageToken != "" {
5203 req.PageToken = pageToken
5204 }
5205 if pageSize > math.MaxInt32 {
5206 req.PageSize = math.MaxInt32
5207 } else if pageSize != 0 {
5208 req.PageSize = int32(pageSize)
5209 }
5210 baseUrl, err := url.Parse(c.endpoint)
5211 if err != nil {
5212 return nil, "", err
5213 }
5214 baseUrl.Path += fmt.Sprintf("/v1/%v/operations", req.GetName())
5215
5216 params := url.Values{}
5217 if req.GetFilter() != "" {
5218 params.Add("filter", fmt.Sprintf("%v", req.GetFilter()))
5219 }
5220 if req.GetPageSize() != 0 {
5221 params.Add("pageSize", fmt.Sprintf("%v", req.GetPageSize()))
5222 }
5223 if req.GetPageToken() != "" {
5224 params.Add("pageToken", fmt.Sprintf("%v", req.GetPageToken()))
5225 }
5226
5227 baseUrl.RawQuery = params.Encode()
5228
5229 // Build HTTP headers from client and context metadata.
5230 hds := append(c.xGoogHeaders, "Content-Type", "application/json")
5231 headers := gax.BuildHeaders(ctx, hds...)
5232 e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
5233 if settings.Path != "" {
5234 baseUrl.Path = settings.Path
5235 }
5236 httpReq, err := http.NewRequest("GET", baseUrl.String(), nil)
5237 if err != nil {
5238 return err
5239 }
5240 httpReq.Header = headers
5241
5242 buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, nil, "ListOperations")
5243 if err != nil {
5244 return err
5245 }
5246 if err := unm.Unmarshal(buf, resp); err != nil {
5247 return err
5248 }
5249
5250 return nil
5251 }, opts...)
5252 if e != nil {
5253 return nil, "", e
5254 }
5255 it.Response = resp
5256 return resp.GetOperations(), resp.GetNextPageToken(), nil
5257 }
5258
5259 fetch := func(pageSize int, pageToken string) (string, error) {
5260 items, nextPageToken, err := it.InternalFetch(pageSize, pageToken)
5261 if err != nil {
5262 return "", err
5263 }
5264 it.items = append(it.items, items...)
5265 return nextPageToken, nil
5266 }
5267
5268 it.pageInfo, it.nextFunc = iterator.NewPageInfo(fetch, it.bufLen, it.takeBuf)
5269 it.pageInfo.MaxSize = int(req.GetPageSize())
5270 it.pageInfo.Token = req.GetPageToken()
5271
5272 return it
5273 }
5274
5275 // ImportEntriesOperation returns a new ImportEntriesOperation from a given name.
5276 // The name must be that of a previously created ImportEntriesOperation, possibly from a different process.
5277 func (c *gRPCClient) ImportEntriesOperation(name string) *ImportEntriesOperation {
5278 return &ImportEntriesOperation{
5279 lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}),
5280 }
5281 }
5282
5283 // ImportEntriesOperation returns a new ImportEntriesOperation from a given name.
5284 // The name must be that of a previously created ImportEntriesOperation, possibly from a different process.
5285 func (c *restClient) ImportEntriesOperation(name string) *ImportEntriesOperation {
5286 override := fmt.Sprintf("/v1/%s", name)
5287 return &ImportEntriesOperation{
5288 lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}),
5289 pollPath: override,
5290 }
5291 }
5292
5293 // ReconcileTagsOperation returns a new ReconcileTagsOperation from a given name.
5294 // The name must be that of a previously created ReconcileTagsOperation, possibly from a different process.
5295 func (c *gRPCClient) ReconcileTagsOperation(name string) *ReconcileTagsOperation {
5296 return &ReconcileTagsOperation{
5297 lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}),
5298 }
5299 }
5300
5301 // ReconcileTagsOperation returns a new ReconcileTagsOperation from a given name.
5302 // The name must be that of a previously created ReconcileTagsOperation, possibly from a different process.
5303 func (c *restClient) ReconcileTagsOperation(name string) *ReconcileTagsOperation {
5304 override := fmt.Sprintf("/v1/%s", name)
5305 return &ReconcileTagsOperation{
5306 lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}),
5307 pollPath: override,
5308 }
5309 }