google-cloud-data_catalog-v1 1.2.0 → 1.3.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -165,14 +165,26 @@ module Google
165
165
  universe_domain: @config.universe_domain,
166
166
  channel_args: @config.channel_args,
167
167
  interceptors: @config.interceptors,
168
- channel_pool_config: @config.channel_pool
168
+ channel_pool_config: @config.channel_pool,
169
+ logger: @config.logger
169
170
  )
170
171
 
172
+ @policy_tag_manager_stub.stub_logger&.info do |entry|
173
+ entry.set_system_name
174
+ entry.set_service
175
+ entry.message = "Created client for #{entry.service}"
176
+ entry.set_credentials_fields credentials
177
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
178
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
179
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
180
+ end
181
+
171
182
  @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config|
172
183
  config.credentials = credentials
173
184
  config.quota_project = @quota_project_id
174
185
  config.endpoint = @policy_tag_manager_stub.endpoint
175
186
  config.universe_domain = @policy_tag_manager_stub.universe_domain
187
+ config.logger = @policy_tag_manager_stub.logger if config.respond_to? :logger=
176
188
  end
177
189
  end
178
190
 
@@ -183,6 +195,15 @@ module Google
183
195
  #
184
196
  attr_reader :iam_policy_client
185
197
 
198
+ ##
199
+ # The logger used for request/response debug logging.
200
+ #
201
+ # @return [Logger]
202
+ #
203
+ def logger
204
+ @policy_tag_manager_stub.logger
205
+ end
206
+
186
207
  # Service calls
187
208
 
188
209
  ##
@@ -269,7 +290,6 @@ module Google
269
290
 
270
291
  @policy_tag_manager_stub.call_rpc :create_taxonomy, request, options: options do |response, operation|
271
292
  yield response, operation if block_given?
272
- return response
273
293
  end
274
294
  rescue ::GRPC::BadStatus => e
275
295
  raise ::Google::Cloud::Error.from_error(e)
@@ -359,7 +379,6 @@ module Google
359
379
 
360
380
  @policy_tag_manager_stub.call_rpc :delete_taxonomy, request, options: options do |response, operation|
361
381
  yield response, operation if block_given?
362
- return response
363
382
  end
364
383
  rescue ::GRPC::BadStatus => e
365
384
  raise ::Google::Cloud::Error.from_error(e)
@@ -453,7 +472,6 @@ module Google
453
472
 
454
473
  @policy_tag_manager_stub.call_rpc :update_taxonomy, request, options: options do |response, operation|
455
474
  yield response, operation if block_given?
456
- return response
457
475
  end
458
476
  rescue ::GRPC::BadStatus => e
459
477
  raise ::Google::Cloud::Error.from_error(e)
@@ -556,7 +574,7 @@ module Google
556
574
  @policy_tag_manager_stub.call_rpc :list_taxonomies, request, options: options do |response, operation|
557
575
  response = ::Gapic::PagedEnumerable.new @policy_tag_manager_stub, :list_taxonomies, request, response, operation, options
558
576
  yield response, operation if block_given?
559
- return response
577
+ throw :response, response
560
578
  end
561
579
  rescue ::GRPC::BadStatus => e
562
580
  raise ::Google::Cloud::Error.from_error(e)
@@ -642,7 +660,6 @@ module Google
642
660
 
643
661
  @policy_tag_manager_stub.call_rpc :get_taxonomy, request, options: options do |response, operation|
644
662
  yield response, operation if block_given?
645
- return response
646
663
  end
647
664
  rescue ::GRPC::BadStatus => e
648
665
  raise ::Google::Cloud::Error.from_error(e)
@@ -730,7 +747,6 @@ module Google
730
747
 
731
748
  @policy_tag_manager_stub.call_rpc :create_policy_tag, request, options: options do |response, operation|
732
749
  yield response, operation if block_given?
733
- return response
734
750
  end
735
751
  rescue ::GRPC::BadStatus => e
736
752
  raise ::Google::Cloud::Error.from_error(e)
@@ -823,7 +839,6 @@ module Google
823
839
 
824
840
  @policy_tag_manager_stub.call_rpc :delete_policy_tag, request, options: options do |response, operation|
825
841
  yield response, operation if block_given?
826
- return response
827
842
  end
828
843
  rescue ::GRPC::BadStatus => e
829
844
  raise ::Google::Cloud::Error.from_error(e)
@@ -918,7 +933,6 @@ module Google
918
933
 
919
934
  @policy_tag_manager_stub.call_rpc :update_policy_tag, request, options: options do |response, operation|
920
935
  yield response, operation if block_given?
921
- return response
922
936
  end
923
937
  rescue ::GRPC::BadStatus => e
924
938
  raise ::Google::Cloud::Error.from_error(e)
@@ -1018,7 +1032,7 @@ module Google
1018
1032
  @policy_tag_manager_stub.call_rpc :list_policy_tags, request, options: options do |response, operation|
1019
1033
  response = ::Gapic::PagedEnumerable.new @policy_tag_manager_stub, :list_policy_tags, request, response, operation, options
1020
1034
  yield response, operation if block_given?
1021
- return response
1035
+ throw :response, response
1022
1036
  end
1023
1037
  rescue ::GRPC::BadStatus => e
1024
1038
  raise ::Google::Cloud::Error.from_error(e)
@@ -1104,7 +1118,6 @@ module Google
1104
1118
 
1105
1119
  @policy_tag_manager_stub.call_rpc :get_policy_tag, request, options: options do |response, operation|
1106
1120
  yield response, operation if block_given?
1107
- return response
1108
1121
  end
1109
1122
  rescue ::GRPC::BadStatus => e
1110
1123
  raise ::Google::Cloud::Error.from_error(e)
@@ -1194,7 +1207,6 @@ module Google
1194
1207
 
1195
1208
  @policy_tag_manager_stub.call_rpc :get_iam_policy, request, options: options do |response, operation|
1196
1209
  yield response, operation if block_given?
1197
- return response
1198
1210
  end
1199
1211
  rescue ::GRPC::BadStatus => e
1200
1212
  raise ::Google::Cloud::Error.from_error(e)
@@ -1292,7 +1304,6 @@ module Google
1292
1304
 
1293
1305
  @policy_tag_manager_stub.call_rpc :set_iam_policy, request, options: options do |response, operation|
1294
1306
  yield response, operation if block_given?
1295
- return response
1296
1307
  end
1297
1308
  rescue ::GRPC::BadStatus => e
1298
1309
  raise ::Google::Cloud::Error.from_error(e)
@@ -1385,7 +1396,6 @@ module Google
1385
1396
 
1386
1397
  @policy_tag_manager_stub.call_rpc :test_iam_permissions, request, options: options do |response, operation|
1387
1398
  yield response, operation if block_given?
1388
- return response
1389
1399
  end
1390
1400
  rescue ::GRPC::BadStatus => e
1391
1401
  raise ::Google::Cloud::Error.from_error(e)
@@ -1474,6 +1484,11 @@ module Google
1474
1484
  # default endpoint URL. The default value of nil uses the environment
1475
1485
  # universe (usually the default "googleapis.com" universe).
1476
1486
  # @return [::String,nil]
1487
+ # @!attribute [rw] logger
1488
+ # A custom logger to use for request/response debug logging, or the value
1489
+ # `:default` (the default) to construct a default logger, or `nil` to
1490
+ # explicitly disable logging.
1491
+ # @return [::Logger,:default,nil]
1477
1492
  #
1478
1493
  class Configuration
1479
1494
  extend ::Gapic::Config
@@ -1498,6 +1513,7 @@ module Google
1498
1513
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
1499
1514
  config_attr :quota_project, nil, ::String, nil
1500
1515
  config_attr :universe_domain, nil, ::String, nil
1516
+ config_attr :logger, :default, ::Logger, nil, :default
1501
1517
 
1502
1518
  # @private
1503
1519
  def initialize parent_config = nil
@@ -158,14 +158,26 @@ module Google
158
158
  endpoint: @config.endpoint,
159
159
  endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
160
160
  universe_domain: @config.universe_domain,
161
- credentials: credentials
161
+ credentials: credentials,
162
+ logger: @config.logger
162
163
  )
163
164
 
165
+ @policy_tag_manager_stub.logger(stub: true)&.info do |entry|
166
+ entry.set_system_name
167
+ entry.set_service
168
+ entry.message = "Created client for #{entry.service}"
169
+ entry.set_credentials_fields credentials
170
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
171
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
172
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
173
+ end
174
+
164
175
  @iam_policy_client = Google::Iam::V1::IAMPolicy::Rest::Client.new do |config|
165
176
  config.credentials = credentials
166
177
  config.quota_project = @quota_project_id
167
178
  config.endpoint = @policy_tag_manager_stub.endpoint
168
179
  config.universe_domain = @policy_tag_manager_stub.universe_domain
180
+ config.logger = @policy_tag_manager_stub.logger if config.respond_to? :logger=
169
181
  end
170
182
  end
171
183
 
@@ -176,6 +188,15 @@ module Google
176
188
  #
177
189
  attr_reader :iam_policy_client
178
190
 
191
+ ##
192
+ # The logger used for request/response debug logging.
193
+ #
194
+ # @return [Logger]
195
+ #
196
+ def logger
197
+ @policy_tag_manager_stub.logger
198
+ end
199
+
179
200
  # Service calls
180
201
 
181
202
  ##
@@ -255,7 +276,6 @@ module Google
255
276
 
256
277
  @policy_tag_manager_stub.create_taxonomy request, options do |result, operation|
257
278
  yield result, operation if block_given?
258
- return result
259
279
  end
260
280
  rescue ::Gapic::Rest::Error => e
261
281
  raise ::Google::Cloud::Error.from_error(e)
@@ -338,7 +358,6 @@ module Google
338
358
 
339
359
  @policy_tag_manager_stub.delete_taxonomy request, options do |result, operation|
340
360
  yield result, operation if block_given?
341
- return result
342
361
  end
343
362
  rescue ::Gapic::Rest::Error => e
344
363
  raise ::Google::Cloud::Error.from_error(e)
@@ -425,7 +444,6 @@ module Google
425
444
 
426
445
  @policy_tag_manager_stub.update_taxonomy request, options do |result, operation|
427
446
  yield result, operation if block_given?
428
- return result
429
447
  end
430
448
  rescue ::Gapic::Rest::Error => e
431
449
  raise ::Google::Cloud::Error.from_error(e)
@@ -521,7 +539,7 @@ module Google
521
539
  @policy_tag_manager_stub.list_taxonomies request, options do |result, operation|
522
540
  result = ::Gapic::Rest::PagedEnumerable.new @policy_tag_manager_stub, :list_taxonomies, "taxonomies", request, result, options
523
541
  yield result, operation if block_given?
524
- return result
542
+ throw :response, result
525
543
  end
526
544
  rescue ::Gapic::Rest::Error => e
527
545
  raise ::Google::Cloud::Error.from_error(e)
@@ -600,7 +618,6 @@ module Google
600
618
 
601
619
  @policy_tag_manager_stub.get_taxonomy request, options do |result, operation|
602
620
  yield result, operation if block_given?
603
- return result
604
621
  end
605
622
  rescue ::Gapic::Rest::Error => e
606
623
  raise ::Google::Cloud::Error.from_error(e)
@@ -681,7 +698,6 @@ module Google
681
698
 
682
699
  @policy_tag_manager_stub.create_policy_tag request, options do |result, operation|
683
700
  yield result, operation if block_given?
684
- return result
685
701
  end
686
702
  rescue ::Gapic::Rest::Error => e
687
703
  raise ::Google::Cloud::Error.from_error(e)
@@ -767,7 +783,6 @@ module Google
767
783
 
768
784
  @policy_tag_manager_stub.delete_policy_tag request, options do |result, operation|
769
785
  yield result, operation if block_given?
770
- return result
771
786
  end
772
787
  rescue ::Gapic::Rest::Error => e
773
788
  raise ::Google::Cloud::Error.from_error(e)
@@ -855,7 +870,6 @@ module Google
855
870
 
856
871
  @policy_tag_manager_stub.update_policy_tag request, options do |result, operation|
857
872
  yield result, operation if block_given?
858
- return result
859
873
  end
860
874
  rescue ::Gapic::Rest::Error => e
861
875
  raise ::Google::Cloud::Error.from_error(e)
@@ -948,7 +962,7 @@ module Google
948
962
  @policy_tag_manager_stub.list_policy_tags request, options do |result, operation|
949
963
  result = ::Gapic::Rest::PagedEnumerable.new @policy_tag_manager_stub, :list_policy_tags, "policy_tags", request, result, options
950
964
  yield result, operation if block_given?
951
- return result
965
+ throw :response, result
952
966
  end
953
967
  rescue ::Gapic::Rest::Error => e
954
968
  raise ::Google::Cloud::Error.from_error(e)
@@ -1027,7 +1041,6 @@ module Google
1027
1041
 
1028
1042
  @policy_tag_manager_stub.get_policy_tag request, options do |result, operation|
1029
1043
  yield result, operation if block_given?
1030
- return result
1031
1044
  end
1032
1045
  rescue ::Gapic::Rest::Error => e
1033
1046
  raise ::Google::Cloud::Error.from_error(e)
@@ -1110,7 +1123,6 @@ module Google
1110
1123
 
1111
1124
  @policy_tag_manager_stub.get_iam_policy request, options do |result, operation|
1112
1125
  yield result, operation if block_given?
1113
- return result
1114
1126
  end
1115
1127
  rescue ::Gapic::Rest::Error => e
1116
1128
  raise ::Google::Cloud::Error.from_error(e)
@@ -1201,7 +1213,6 @@ module Google
1201
1213
 
1202
1214
  @policy_tag_manager_stub.set_iam_policy request, options do |result, operation|
1203
1215
  yield result, operation if block_given?
1204
- return result
1205
1216
  end
1206
1217
  rescue ::Gapic::Rest::Error => e
1207
1218
  raise ::Google::Cloud::Error.from_error(e)
@@ -1287,7 +1298,6 @@ module Google
1287
1298
 
1288
1299
  @policy_tag_manager_stub.test_iam_permissions request, options do |result, operation|
1289
1300
  yield result, operation if block_given?
1290
- return result
1291
1301
  end
1292
1302
  rescue ::Gapic::Rest::Error => e
1293
1303
  raise ::Google::Cloud::Error.from_error(e)
@@ -1367,6 +1377,11 @@ module Google
1367
1377
  # default endpoint URL. The default value of nil uses the environment
1368
1378
  # universe (usually the default "googleapis.com" universe).
1369
1379
  # @return [::String,nil]
1380
+ # @!attribute [rw] logger
1381
+ # A custom logger to use for request/response debug logging, or the value
1382
+ # `:default` (the default) to construct a default logger, or `nil` to
1383
+ # explicitly disable logging.
1384
+ # @return [::Logger,:default,nil]
1370
1385
  #
1371
1386
  class Configuration
1372
1387
  extend ::Gapic::Config
@@ -1388,6 +1403,7 @@ module Google
1388
1403
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
1389
1404
  config_attr :quota_project, nil, ::String, nil
1390
1405
  config_attr :universe_domain, nil, ::String, nil
1406
+ config_attr :logger, :default, ::Logger, nil, :default
1391
1407
 
1392
1408
  # @private
1393
1409
  def initialize parent_config = nil