google-cloud-data_catalog-v1 0.8.0 → 0.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (26) hide show
  1. checksums.yaml +4 -4
  2. data/lib/google/cloud/data_catalog/v1/data_catalog/client.rb +702 -147
  3. data/lib/google/cloud/data_catalog/v1/policy_tag_manager/client.rb +341 -90
  4. data/lib/google/cloud/data_catalog/v1/policy_tag_manager_serialization/client.rb +98 -48
  5. data/lib/google/cloud/data_catalog/v1/version.rb +1 -1
  6. data/lib/google/cloud/datacatalog/v1/bigquery_pb.rb +1 -1
  7. data/lib/google/cloud/datacatalog/v1/common_pb.rb +1 -0
  8. data/lib/google/cloud/datacatalog/v1/data_source_pb.rb +1 -1
  9. data/lib/google/cloud/datacatalog/v1/datacatalog_pb.rb +2 -2
  10. data/lib/google/cloud/datacatalog/v1/datacatalog_services_pb.rb +7 -3
  11. data/lib/google/cloud/datacatalog/v1/gcs_fileset_spec_pb.rb +2 -2
  12. data/lib/google/cloud/datacatalog/v1/policytagmanager_pb.rb +2 -2
  13. data/lib/google/cloud/datacatalog/v1/policytagmanager_services_pb.rb +1 -1
  14. data/lib/google/cloud/datacatalog/v1/policytagmanagerserialization_pb.rb +2 -2
  15. data/lib/google/cloud/datacatalog/v1/policytagmanagerserialization_services_pb.rb +1 -1
  16. data/lib/google/cloud/datacatalog/v1/schema_pb.rb +1 -1
  17. data/lib/google/cloud/datacatalog/v1/search_pb.rb +4 -2
  18. data/lib/google/cloud/datacatalog/v1/table_spec_pb.rb +3 -2
  19. data/lib/google/cloud/datacatalog/v1/tags_pb.rb +2 -2
  20. data/lib/google/cloud/datacatalog/v1/timestamps_pb.rb +2 -2
  21. data/lib/google/cloud/datacatalog/v1/usage_pb.rb +1 -1
  22. data/proto_docs/google/cloud/datacatalog/v1/datacatalog.rb +11 -4
  23. data/proto_docs/google/cloud/datacatalog/v1/policytagmanager.rb +2 -4
  24. data/proto_docs/google/cloud/datacatalog/v1/search.rb +7 -0
  25. data/proto_docs/google/cloud/datacatalog/v1/table_spec.rb +3 -0
  26. metadata +4 -4
@@ -46,13 +46,12 @@ module Google
46
46
  # See {::Google::Cloud::DataCatalog::V1::PolicyTagManager::Client::Configuration}
47
47
  # for a description of the configuration fields.
48
48
  #
49
- # ## Example
49
+ # @example
50
50
  #
51
- # To modify the configuration for all PolicyTagManager clients:
52
- #
53
- # ::Google::Cloud::DataCatalog::V1::PolicyTagManager::Client.configure do |config|
54
- # config.timeout = 10.0
55
- # end
51
+ # # Modify the configuration for all PolicyTagManager clients
52
+ # ::Google::Cloud::DataCatalog::V1::PolicyTagManager::Client.configure do |config|
53
+ # config.timeout = 10.0
54
+ # end
56
55
  #
57
56
  # @yield [config] Configure the Client client.
58
57
  # @yieldparam config [Client::Configuration]
@@ -101,19 +100,15 @@ module Google
101
100
  ##
102
101
  # Create a new PolicyTagManager client object.
103
102
  #
104
- # ## Examples
105
- #
106
- # To create a new PolicyTagManager client with the default
107
- # configuration:
103
+ # @example
108
104
  #
109
- # client = ::Google::Cloud::DataCatalog::V1::PolicyTagManager::Client.new
105
+ # # Create a client using the default configuration
106
+ # client = ::Google::Cloud::DataCatalog::V1::PolicyTagManager::Client.new
110
107
  #
111
- # To create a new PolicyTagManager client with a custom
112
- # configuration:
113
- #
114
- # client = ::Google::Cloud::DataCatalog::V1::PolicyTagManager::Client.new do |config|
115
- # config.timeout = 10.0
116
- # end
108
+ # # Create a client using a custom configuration
109
+ # client = ::Google::Cloud::DataCatalog::V1::PolicyTagManager::Client.new do |config|
110
+ # config.timeout = 10.0
111
+ # end
117
112
  #
118
113
  # @yield [config] Configure the PolicyTagManager client.
119
114
  # @yieldparam config [Client::Configuration]
@@ -133,10 +128,9 @@ module Google
133
128
 
134
129
  # Create credentials
135
130
  credentials = @config.credentials
136
- # Use self-signed JWT if the scope and endpoint are unchanged from default,
131
+ # Use self-signed JWT if the endpoint is unchanged from default,
137
132
  # but only if the default endpoint does not have a region prefix.
138
- enable_self_signed_jwt = @config.scope == Client.configure.scope &&
139
- @config.endpoint == Client.configure.endpoint &&
133
+ enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
140
134
  !@config.endpoint.split(".").first.include?("-")
141
135
  credentials ||= Credentials.default scope: @config.scope,
142
136
  enable_self_signed_jwt: enable_self_signed_jwt
@@ -190,6 +184,21 @@ module Google
190
184
  #
191
185
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
192
186
  #
187
+ # @example Basic example
188
+ # require "google/cloud/data_catalog/v1"
189
+ #
190
+ # # Create a client object. The client can be reused for multiple calls.
191
+ # client = Google::Cloud::DataCatalog::V1::PolicyTagManager::Client.new
192
+ #
193
+ # # Create a request. To set request fields, pass in keyword arguments.
194
+ # request = Google::Cloud::DataCatalog::V1::CreateTaxonomyRequest.new
195
+ #
196
+ # # Call the create_taxonomy method.
197
+ # result = client.create_taxonomy request
198
+ #
199
+ # # The returned object is of type Google::Cloud::DataCatalog::V1::Taxonomy.
200
+ # p result
201
+ #
193
202
  def create_taxonomy request, options = nil
194
203
  raise ::ArgumentError, "request must be provided" if request.nil?
195
204
 
@@ -207,16 +216,20 @@ module Google
207
216
  gapic_version: ::Google::Cloud::DataCatalog::V1::VERSION
208
217
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
209
218
 
210
- header_params = {
211
- "parent" => request.parent
212
- }
219
+ header_params = {}
220
+ if request.parent
221
+ header_params["parent"] = request.parent
222
+ end
223
+
213
224
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
214
225
  metadata[:"x-goog-request-params"] ||= request_params_header
215
226
 
216
227
  options.apply_defaults timeout: @config.rpcs.create_taxonomy.timeout,
217
228
  metadata: metadata,
218
229
  retry_policy: @config.rpcs.create_taxonomy.retry_policy
219
- options.apply_defaults metadata: @config.metadata,
230
+
231
+ options.apply_defaults timeout: @config.timeout,
232
+ metadata: @config.metadata,
220
233
  retry_policy: @config.retry_policy
221
234
 
222
235
  @policy_tag_manager_stub.call_rpc :create_taxonomy, request, options: options do |response, operation|
@@ -260,6 +273,21 @@ module Google
260
273
  #
261
274
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
262
275
  #
276
+ # @example Basic example
277
+ # require "google/cloud/data_catalog/v1"
278
+ #
279
+ # # Create a client object. The client can be reused for multiple calls.
280
+ # client = Google::Cloud::DataCatalog::V1::PolicyTagManager::Client.new
281
+ #
282
+ # # Create a request. To set request fields, pass in keyword arguments.
283
+ # request = Google::Cloud::DataCatalog::V1::DeleteTaxonomyRequest.new
284
+ #
285
+ # # Call the delete_taxonomy method.
286
+ # result = client.delete_taxonomy request
287
+ #
288
+ # # The returned object is of type Google::Protobuf::Empty.
289
+ # p result
290
+ #
263
291
  def delete_taxonomy request, options = nil
264
292
  raise ::ArgumentError, "request must be provided" if request.nil?
265
293
 
@@ -277,16 +305,20 @@ module Google
277
305
  gapic_version: ::Google::Cloud::DataCatalog::V1::VERSION
278
306
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
279
307
 
280
- header_params = {
281
- "name" => request.name
282
- }
308
+ header_params = {}
309
+ if request.name
310
+ header_params["name"] = request.name
311
+ end
312
+
283
313
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
284
314
  metadata[:"x-goog-request-params"] ||= request_params_header
285
315
 
286
316
  options.apply_defaults timeout: @config.rpcs.delete_taxonomy.timeout,
287
317
  metadata: metadata,
288
318
  retry_policy: @config.rpcs.delete_taxonomy.retry_policy
289
- options.apply_defaults metadata: @config.metadata,
319
+
320
+ options.apply_defaults timeout: @config.timeout,
321
+ metadata: @config.metadata,
290
322
  retry_policy: @config.retry_policy
291
323
 
292
324
  @policy_tag_manager_stub.call_rpc :delete_taxonomy, request, options: options do |response, operation|
@@ -334,6 +366,21 @@ module Google
334
366
  #
335
367
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
336
368
  #
369
+ # @example Basic example
370
+ # require "google/cloud/data_catalog/v1"
371
+ #
372
+ # # Create a client object. The client can be reused for multiple calls.
373
+ # client = Google::Cloud::DataCatalog::V1::PolicyTagManager::Client.new
374
+ #
375
+ # # Create a request. To set request fields, pass in keyword arguments.
376
+ # request = Google::Cloud::DataCatalog::V1::UpdateTaxonomyRequest.new
377
+ #
378
+ # # Call the update_taxonomy method.
379
+ # result = client.update_taxonomy request
380
+ #
381
+ # # The returned object is of type Google::Cloud::DataCatalog::V1::Taxonomy.
382
+ # p result
383
+ #
337
384
  def update_taxonomy request, options = nil
338
385
  raise ::ArgumentError, "request must be provided" if request.nil?
339
386
 
@@ -351,16 +398,20 @@ module Google
351
398
  gapic_version: ::Google::Cloud::DataCatalog::V1::VERSION
352
399
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
353
400
 
354
- header_params = {
355
- "taxonomy.name" => request.taxonomy.name
356
- }
401
+ header_params = {}
402
+ if request.taxonomy&.name
403
+ header_params["taxonomy.name"] = request.taxonomy.name
404
+ end
405
+
357
406
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
358
407
  metadata[:"x-goog-request-params"] ||= request_params_header
359
408
 
360
409
  options.apply_defaults timeout: @config.rpcs.update_taxonomy.timeout,
361
410
  metadata: metadata,
362
411
  retry_policy: @config.rpcs.update_taxonomy.retry_policy
363
- options.apply_defaults metadata: @config.metadata,
412
+
413
+ options.apply_defaults timeout: @config.timeout,
414
+ metadata: @config.metadata,
364
415
  retry_policy: @config.retry_policy
365
416
 
366
417
  @policy_tag_manager_stub.call_rpc :update_taxonomy, request, options: options do |response, operation|
@@ -409,6 +460,27 @@ module Google
409
460
  #
410
461
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
411
462
  #
463
+ # @example Basic example
464
+ # require "google/cloud/data_catalog/v1"
465
+ #
466
+ # # Create a client object. The client can be reused for multiple calls.
467
+ # client = Google::Cloud::DataCatalog::V1::PolicyTagManager::Client.new
468
+ #
469
+ # # Create a request. To set request fields, pass in keyword arguments.
470
+ # request = Google::Cloud::DataCatalog::V1::ListTaxonomiesRequest.new
471
+ #
472
+ # # Call the list_taxonomies method.
473
+ # result = client.list_taxonomies request
474
+ #
475
+ # # The returned object is of type Gapic::PagedEnumerable. You can
476
+ # # iterate over all elements by calling #each, and the enumerable
477
+ # # will lazily make API calls to fetch subsequent pages. Other
478
+ # # methods are also available for managing paging directly.
479
+ # result.each do |response|
480
+ # # Each element is of type ::Google::Cloud::DataCatalog::V1::Taxonomy.
481
+ # p response
482
+ # end
483
+ #
412
484
  def list_taxonomies request, options = nil
413
485
  raise ::ArgumentError, "request must be provided" if request.nil?
414
486
 
@@ -426,16 +498,20 @@ module Google
426
498
  gapic_version: ::Google::Cloud::DataCatalog::V1::VERSION
427
499
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
428
500
 
429
- header_params = {
430
- "parent" => request.parent
431
- }
501
+ header_params = {}
502
+ if request.parent
503
+ header_params["parent"] = request.parent
504
+ end
505
+
432
506
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
433
507
  metadata[:"x-goog-request-params"] ||= request_params_header
434
508
 
435
509
  options.apply_defaults timeout: @config.rpcs.list_taxonomies.timeout,
436
510
  metadata: metadata,
437
511
  retry_policy: @config.rpcs.list_taxonomies.retry_policy
438
- options.apply_defaults metadata: @config.metadata,
512
+
513
+ options.apply_defaults timeout: @config.timeout,
514
+ metadata: @config.metadata,
439
515
  retry_policy: @config.retry_policy
440
516
 
441
517
  @policy_tag_manager_stub.call_rpc :list_taxonomies, request, options: options do |response, operation|
@@ -476,6 +552,21 @@ module Google
476
552
  #
477
553
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
478
554
  #
555
+ # @example Basic example
556
+ # require "google/cloud/data_catalog/v1"
557
+ #
558
+ # # Create a client object. The client can be reused for multiple calls.
559
+ # client = Google::Cloud::DataCatalog::V1::PolicyTagManager::Client.new
560
+ #
561
+ # # Create a request. To set request fields, pass in keyword arguments.
562
+ # request = Google::Cloud::DataCatalog::V1::GetTaxonomyRequest.new
563
+ #
564
+ # # Call the get_taxonomy method.
565
+ # result = client.get_taxonomy request
566
+ #
567
+ # # The returned object is of type Google::Cloud::DataCatalog::V1::Taxonomy.
568
+ # p result
569
+ #
479
570
  def get_taxonomy request, options = nil
480
571
  raise ::ArgumentError, "request must be provided" if request.nil?
481
572
 
@@ -493,16 +584,20 @@ module Google
493
584
  gapic_version: ::Google::Cloud::DataCatalog::V1::VERSION
494
585
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
495
586
 
496
- header_params = {
497
- "name" => request.name
498
- }
587
+ header_params = {}
588
+ if request.name
589
+ header_params["name"] = request.name
590
+ end
591
+
499
592
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
500
593
  metadata[:"x-goog-request-params"] ||= request_params_header
501
594
 
502
595
  options.apply_defaults timeout: @config.rpcs.get_taxonomy.timeout,
503
596
  metadata: metadata,
504
597
  retry_policy: @config.rpcs.get_taxonomy.retry_policy
505
- options.apply_defaults metadata: @config.metadata,
598
+
599
+ options.apply_defaults timeout: @config.timeout,
600
+ metadata: @config.metadata,
506
601
  retry_policy: @config.retry_policy
507
602
 
508
603
  @policy_tag_manager_stub.call_rpc :get_taxonomy, request, options: options do |response, operation|
@@ -532,8 +627,7 @@ module Google
532
627
  # the default parameter values, pass an empty Hash as a request object (see above).
533
628
  #
534
629
  # @param parent [::String]
535
- # Required. Resource name of the taxonomy that the policy tag will belong to.<br /><br
536
- # />
630
+ # Required. Resource name of the taxonomy that the policy tag will belong to.
537
631
  # @param policy_tag [::Google::Cloud::DataCatalog::V1::PolicyTag, ::Hash]
538
632
  # The policy tag to create.
539
633
  #
@@ -545,6 +639,21 @@ module Google
545
639
  #
546
640
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
547
641
  #
642
+ # @example Basic example
643
+ # require "google/cloud/data_catalog/v1"
644
+ #
645
+ # # Create a client object. The client can be reused for multiple calls.
646
+ # client = Google::Cloud::DataCatalog::V1::PolicyTagManager::Client.new
647
+ #
648
+ # # Create a request. To set request fields, pass in keyword arguments.
649
+ # request = Google::Cloud::DataCatalog::V1::CreatePolicyTagRequest.new
650
+ #
651
+ # # Call the create_policy_tag method.
652
+ # result = client.create_policy_tag request
653
+ #
654
+ # # The returned object is of type Google::Cloud::DataCatalog::V1::PolicyTag.
655
+ # p result
656
+ #
548
657
  def create_policy_tag request, options = nil
549
658
  raise ::ArgumentError, "request must be provided" if request.nil?
550
659
 
@@ -562,16 +671,20 @@ module Google
562
671
  gapic_version: ::Google::Cloud::DataCatalog::V1::VERSION
563
672
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
564
673
 
565
- header_params = {
566
- "parent" => request.parent
567
- }
674
+ header_params = {}
675
+ if request.parent
676
+ header_params["parent"] = request.parent
677
+ end
678
+
568
679
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
569
680
  metadata[:"x-goog-request-params"] ||= request_params_header
570
681
 
571
682
  options.apply_defaults timeout: @config.rpcs.create_policy_tag.timeout,
572
683
  metadata: metadata,
573
684
  retry_policy: @config.rpcs.create_policy_tag.retry_policy
574
- options.apply_defaults metadata: @config.metadata,
685
+
686
+ options.apply_defaults timeout: @config.timeout,
687
+ metadata: @config.metadata,
575
688
  retry_policy: @config.retry_policy
576
689
 
577
690
  @policy_tag_manager_stub.call_rpc :create_policy_tag, request, options: options do |response, operation|
@@ -618,6 +731,21 @@ module Google
618
731
  #
619
732
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
620
733
  #
734
+ # @example Basic example
735
+ # require "google/cloud/data_catalog/v1"
736
+ #
737
+ # # Create a client object. The client can be reused for multiple calls.
738
+ # client = Google::Cloud::DataCatalog::V1::PolicyTagManager::Client.new
739
+ #
740
+ # # Create a request. To set request fields, pass in keyword arguments.
741
+ # request = Google::Cloud::DataCatalog::V1::DeletePolicyTagRequest.new
742
+ #
743
+ # # Call the delete_policy_tag method.
744
+ # result = client.delete_policy_tag request
745
+ #
746
+ # # The returned object is of type Google::Protobuf::Empty.
747
+ # p result
748
+ #
621
749
  def delete_policy_tag request, options = nil
622
750
  raise ::ArgumentError, "request must be provided" if request.nil?
623
751
 
@@ -635,16 +763,20 @@ module Google
635
763
  gapic_version: ::Google::Cloud::DataCatalog::V1::VERSION
636
764
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
637
765
 
638
- header_params = {
639
- "name" => request.name
640
- }
766
+ header_params = {}
767
+ if request.name
768
+ header_params["name"] = request.name
769
+ end
770
+
641
771
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
642
772
  metadata[:"x-goog-request-params"] ||= request_params_header
643
773
 
644
774
  options.apply_defaults timeout: @config.rpcs.delete_policy_tag.timeout,
645
775
  metadata: metadata,
646
776
  retry_policy: @config.rpcs.delete_policy_tag.retry_policy
647
- options.apply_defaults metadata: @config.metadata,
777
+
778
+ options.apply_defaults timeout: @config.timeout,
779
+ metadata: @config.metadata,
648
780
  retry_policy: @config.retry_policy
649
781
 
650
782
  @policy_tag_manager_stub.call_rpc :delete_policy_tag, request, options: options do |response, operation|
@@ -693,6 +825,21 @@ module Google
693
825
  #
694
826
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
695
827
  #
828
+ # @example Basic example
829
+ # require "google/cloud/data_catalog/v1"
830
+ #
831
+ # # Create a client object. The client can be reused for multiple calls.
832
+ # client = Google::Cloud::DataCatalog::V1::PolicyTagManager::Client.new
833
+ #
834
+ # # Create a request. To set request fields, pass in keyword arguments.
835
+ # request = Google::Cloud::DataCatalog::V1::UpdatePolicyTagRequest.new
836
+ #
837
+ # # Call the update_policy_tag method.
838
+ # result = client.update_policy_tag request
839
+ #
840
+ # # The returned object is of type Google::Cloud::DataCatalog::V1::PolicyTag.
841
+ # p result
842
+ #
696
843
  def update_policy_tag request, options = nil
697
844
  raise ::ArgumentError, "request must be provided" if request.nil?
698
845
 
@@ -710,16 +857,20 @@ module Google
710
857
  gapic_version: ::Google::Cloud::DataCatalog::V1::VERSION
711
858
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
712
859
 
713
- header_params = {
714
- "policy_tag.name" => request.policy_tag.name
715
- }
860
+ header_params = {}
861
+ if request.policy_tag&.name
862
+ header_params["policy_tag.name"] = request.policy_tag.name
863
+ end
864
+
716
865
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
717
866
  metadata[:"x-goog-request-params"] ||= request_params_header
718
867
 
719
868
  options.apply_defaults timeout: @config.rpcs.update_policy_tag.timeout,
720
869
  metadata: metadata,
721
870
  retry_policy: @config.rpcs.update_policy_tag.retry_policy
722
- options.apply_defaults metadata: @config.metadata,
871
+
872
+ options.apply_defaults timeout: @config.timeout,
873
+ metadata: @config.metadata,
723
874
  retry_policy: @config.retry_policy
724
875
 
725
876
  @policy_tag_manager_stub.call_rpc :update_policy_tag, request, options: options do |response, operation|
@@ -768,6 +919,27 @@ module Google
768
919
  #
769
920
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
770
921
  #
922
+ # @example Basic example
923
+ # require "google/cloud/data_catalog/v1"
924
+ #
925
+ # # Create a client object. The client can be reused for multiple calls.
926
+ # client = Google::Cloud::DataCatalog::V1::PolicyTagManager::Client.new
927
+ #
928
+ # # Create a request. To set request fields, pass in keyword arguments.
929
+ # request = Google::Cloud::DataCatalog::V1::ListPolicyTagsRequest.new
930
+ #
931
+ # # Call the list_policy_tags method.
932
+ # result = client.list_policy_tags request
933
+ #
934
+ # # The returned object is of type Gapic::PagedEnumerable. You can
935
+ # # iterate over all elements by calling #each, and the enumerable
936
+ # # will lazily make API calls to fetch subsequent pages. Other
937
+ # # methods are also available for managing paging directly.
938
+ # result.each do |response|
939
+ # # Each element is of type ::Google::Cloud::DataCatalog::V1::PolicyTag.
940
+ # p response
941
+ # end
942
+ #
771
943
  def list_policy_tags request, options = nil
772
944
  raise ::ArgumentError, "request must be provided" if request.nil?
773
945
 
@@ -785,16 +957,20 @@ module Google
785
957
  gapic_version: ::Google::Cloud::DataCatalog::V1::VERSION
786
958
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
787
959
 
788
- header_params = {
789
- "parent" => request.parent
790
- }
960
+ header_params = {}
961
+ if request.parent
962
+ header_params["parent"] = request.parent
963
+ end
964
+
791
965
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
792
966
  metadata[:"x-goog-request-params"] ||= request_params_header
793
967
 
794
968
  options.apply_defaults timeout: @config.rpcs.list_policy_tags.timeout,
795
969
  metadata: metadata,
796
970
  retry_policy: @config.rpcs.list_policy_tags.retry_policy
797
- options.apply_defaults metadata: @config.metadata,
971
+
972
+ options.apply_defaults timeout: @config.timeout,
973
+ metadata: @config.metadata,
798
974
  retry_policy: @config.retry_policy
799
975
 
800
976
  @policy_tag_manager_stub.call_rpc :list_policy_tags, request, options: options do |response, operation|
@@ -835,6 +1011,21 @@ module Google
835
1011
  #
836
1012
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
837
1013
  #
1014
+ # @example Basic example
1015
+ # require "google/cloud/data_catalog/v1"
1016
+ #
1017
+ # # Create a client object. The client can be reused for multiple calls.
1018
+ # client = Google::Cloud::DataCatalog::V1::PolicyTagManager::Client.new
1019
+ #
1020
+ # # Create a request. To set request fields, pass in keyword arguments.
1021
+ # request = Google::Cloud::DataCatalog::V1::GetPolicyTagRequest.new
1022
+ #
1023
+ # # Call the get_policy_tag method.
1024
+ # result = client.get_policy_tag request
1025
+ #
1026
+ # # The returned object is of type Google::Cloud::DataCatalog::V1::PolicyTag.
1027
+ # p result
1028
+ #
838
1029
  def get_policy_tag request, options = nil
839
1030
  raise ::ArgumentError, "request must be provided" if request.nil?
840
1031
 
@@ -852,16 +1043,20 @@ module Google
852
1043
  gapic_version: ::Google::Cloud::DataCatalog::V1::VERSION
853
1044
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
854
1045
 
855
- header_params = {
856
- "name" => request.name
857
- }
1046
+ header_params = {}
1047
+ if request.name
1048
+ header_params["name"] = request.name
1049
+ end
1050
+
858
1051
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
859
1052
  metadata[:"x-goog-request-params"] ||= request_params_header
860
1053
 
861
1054
  options.apply_defaults timeout: @config.rpcs.get_policy_tag.timeout,
862
1055
  metadata: metadata,
863
1056
  retry_policy: @config.rpcs.get_policy_tag.retry_policy
864
- options.apply_defaults metadata: @config.metadata,
1057
+
1058
+ options.apply_defaults timeout: @config.timeout,
1059
+ metadata: @config.metadata,
865
1060
  retry_policy: @config.retry_policy
866
1061
 
867
1062
  @policy_tag_manager_stub.call_rpc :get_policy_tag, request, options: options do |response, operation|
@@ -905,6 +1100,21 @@ module Google
905
1100
  #
906
1101
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
907
1102
  #
1103
+ # @example Basic example
1104
+ # require "google/cloud/data_catalog/v1"
1105
+ #
1106
+ # # Create a client object. The client can be reused for multiple calls.
1107
+ # client = Google::Cloud::DataCatalog::V1::PolicyTagManager::Client.new
1108
+ #
1109
+ # # Create a request. To set request fields, pass in keyword arguments.
1110
+ # request = Google::Iam::V1::GetIamPolicyRequest.new
1111
+ #
1112
+ # # Call the get_iam_policy method.
1113
+ # result = client.get_iam_policy request
1114
+ #
1115
+ # # The returned object is of type Google::Iam::V1::Policy.
1116
+ # p result
1117
+ #
908
1118
  def get_iam_policy request, options = nil
909
1119
  raise ::ArgumentError, "request must be provided" if request.nil?
910
1120
 
@@ -922,16 +1132,20 @@ module Google
922
1132
  gapic_version: ::Google::Cloud::DataCatalog::V1::VERSION
923
1133
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
924
1134
 
925
- header_params = {
926
- "resource" => request.resource
927
- }
1135
+ header_params = {}
1136
+ if request.resource
1137
+ header_params["resource"] = request.resource
1138
+ end
1139
+
928
1140
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
929
1141
  metadata[:"x-goog-request-params"] ||= request_params_header
930
1142
 
931
1143
  options.apply_defaults timeout: @config.rpcs.get_iam_policy.timeout,
932
1144
  metadata: metadata,
933
1145
  retry_policy: @config.rpcs.get_iam_policy.retry_policy
934
- options.apply_defaults metadata: @config.metadata,
1146
+
1147
+ options.apply_defaults timeout: @config.timeout,
1148
+ metadata: @config.metadata,
935
1149
  retry_policy: @config.retry_policy
936
1150
 
937
1151
  @policy_tag_manager_stub.call_rpc :get_iam_policy, request, options: options do |response, operation|
@@ -977,6 +1191,21 @@ module Google
977
1191
  #
978
1192
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
979
1193
  #
1194
+ # @example Basic example
1195
+ # require "google/cloud/data_catalog/v1"
1196
+ #
1197
+ # # Create a client object. The client can be reused for multiple calls.
1198
+ # client = Google::Cloud::DataCatalog::V1::PolicyTagManager::Client.new
1199
+ #
1200
+ # # Create a request. To set request fields, pass in keyword arguments.
1201
+ # request = Google::Iam::V1::SetIamPolicyRequest.new
1202
+ #
1203
+ # # Call the set_iam_policy method.
1204
+ # result = client.set_iam_policy request
1205
+ #
1206
+ # # The returned object is of type Google::Iam::V1::Policy.
1207
+ # p result
1208
+ #
980
1209
  def set_iam_policy request, options = nil
981
1210
  raise ::ArgumentError, "request must be provided" if request.nil?
982
1211
 
@@ -994,16 +1223,20 @@ module Google
994
1223
  gapic_version: ::Google::Cloud::DataCatalog::V1::VERSION
995
1224
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
996
1225
 
997
- header_params = {
998
- "resource" => request.resource
999
- }
1226
+ header_params = {}
1227
+ if request.resource
1228
+ header_params["resource"] = request.resource
1229
+ end
1230
+
1000
1231
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1001
1232
  metadata[:"x-goog-request-params"] ||= request_params_header
1002
1233
 
1003
1234
  options.apply_defaults timeout: @config.rpcs.set_iam_policy.timeout,
1004
1235
  metadata: metadata,
1005
1236
  retry_policy: @config.rpcs.set_iam_policy.retry_policy
1006
- options.apply_defaults metadata: @config.metadata,
1237
+
1238
+ options.apply_defaults timeout: @config.timeout,
1239
+ metadata: @config.metadata,
1007
1240
  retry_policy: @config.retry_policy
1008
1241
 
1009
1242
  @policy_tag_manager_stub.call_rpc :set_iam_policy, request, options: options do |response, operation|
@@ -1050,6 +1283,21 @@ module Google
1050
1283
  #
1051
1284
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1052
1285
  #
1286
+ # @example Basic example
1287
+ # require "google/cloud/data_catalog/v1"
1288
+ #
1289
+ # # Create a client object. The client can be reused for multiple calls.
1290
+ # client = Google::Cloud::DataCatalog::V1::PolicyTagManager::Client.new
1291
+ #
1292
+ # # Create a request. To set request fields, pass in keyword arguments.
1293
+ # request = Google::Iam::V1::TestIamPermissionsRequest.new
1294
+ #
1295
+ # # Call the test_iam_permissions method.
1296
+ # result = client.test_iam_permissions request
1297
+ #
1298
+ # # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse.
1299
+ # p result
1300
+ #
1053
1301
  def test_iam_permissions request, options = nil
1054
1302
  raise ::ArgumentError, "request must be provided" if request.nil?
1055
1303
 
@@ -1067,16 +1315,20 @@ module Google
1067
1315
  gapic_version: ::Google::Cloud::DataCatalog::V1::VERSION
1068
1316
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1069
1317
 
1070
- header_params = {
1071
- "resource" => request.resource
1072
- }
1318
+ header_params = {}
1319
+ if request.resource
1320
+ header_params["resource"] = request.resource
1321
+ end
1322
+
1073
1323
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1074
1324
  metadata[:"x-goog-request-params"] ||= request_params_header
1075
1325
 
1076
1326
  options.apply_defaults timeout: @config.rpcs.test_iam_permissions.timeout,
1077
1327
  metadata: metadata,
1078
1328
  retry_policy: @config.rpcs.test_iam_permissions.retry_policy
1079
- options.apply_defaults metadata: @config.metadata,
1329
+
1330
+ options.apply_defaults timeout: @config.timeout,
1331
+ metadata: @config.metadata,
1080
1332
  retry_policy: @config.retry_policy
1081
1333
 
1082
1334
  @policy_tag_manager_stub.call_rpc :test_iam_permissions, request, options: options do |response, operation|
@@ -1100,22 +1352,21 @@ module Google
1100
1352
  # Configuration can be applied globally to all clients, or to a single client
1101
1353
  # on construction.
1102
1354
  #
1103
- # # Examples
1104
- #
1105
- # To modify the global config, setting the timeout for create_taxonomy
1106
- # to 20 seconds, and all remaining timeouts to 10 seconds:
1107
- #
1108
- # ::Google::Cloud::DataCatalog::V1::PolicyTagManager::Client.configure do |config|
1109
- # config.timeout = 10.0
1110
- # config.rpcs.create_taxonomy.timeout = 20.0
1111
- # end
1112
- #
1113
- # To apply the above configuration only to a new client:
1114
- #
1115
- # client = ::Google::Cloud::DataCatalog::V1::PolicyTagManager::Client.new do |config|
1116
- # config.timeout = 10.0
1117
- # config.rpcs.create_taxonomy.timeout = 20.0
1118
- # end
1355
+ # @example
1356
+ #
1357
+ # # Modify the global config, setting the timeout for
1358
+ # # create_taxonomy to 20 seconds,
1359
+ # # and all remaining timeouts to 10 seconds.
1360
+ # ::Google::Cloud::DataCatalog::V1::PolicyTagManager::Client.configure do |config|
1361
+ # config.timeout = 10.0
1362
+ # config.rpcs.create_taxonomy.timeout = 20.0
1363
+ # end
1364
+ #
1365
+ # # Apply the above configuration only to a new client.
1366
+ # client = ::Google::Cloud::DataCatalog::V1::PolicyTagManager::Client.new do |config|
1367
+ # config.timeout = 10.0
1368
+ # config.rpcs.create_taxonomy.timeout = 20.0
1369
+ # end
1119
1370
  #
1120
1371
  # @!attribute [rw] endpoint
1121
1372
  # The hostname or hostname:port of the service endpoint.