google-cloud-data_catalog-v1beta1 0.5.2 → 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -161,14 +161,26 @@ module Google
161
161
  universe_domain: @config.universe_domain,
162
162
  channel_args: @config.channel_args,
163
163
  interceptors: @config.interceptors,
164
- channel_pool_config: @config.channel_pool
164
+ channel_pool_config: @config.channel_pool,
165
+ logger: @config.logger
165
166
  )
166
167
 
168
+ @policy_tag_manager_stub.stub_logger&.info do |entry|
169
+ entry.set_system_name
170
+ entry.set_service
171
+ entry.message = "Created client for #{entry.service}"
172
+ entry.set_credentials_fields credentials
173
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
174
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
175
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
176
+ end
177
+
167
178
  @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config|
168
179
  config.credentials = credentials
169
180
  config.quota_project = @quota_project_id
170
181
  config.endpoint = @policy_tag_manager_stub.endpoint
171
182
  config.universe_domain = @policy_tag_manager_stub.universe_domain
183
+ config.logger = @policy_tag_manager_stub.logger if config.respond_to? :logger=
172
184
  end
173
185
  end
174
186
 
@@ -179,6 +191,15 @@ module Google
179
191
  #
180
192
  attr_reader :iam_policy_client
181
193
 
194
+ ##
195
+ # The logger used for request/response debug logging.
196
+ #
197
+ # @return [Logger]
198
+ #
199
+ def logger
200
+ @policy_tag_manager_stub.logger
201
+ end
202
+
182
203
  # Service calls
183
204
 
184
205
  ##
@@ -263,7 +284,6 @@ module Google
263
284
 
264
285
  @policy_tag_manager_stub.call_rpc :create_taxonomy, request, options: options do |response, operation|
265
286
  yield response, operation if block_given?
266
- return response
267
287
  end
268
288
  rescue ::GRPC::BadStatus => e
269
289
  raise ::Google::Cloud::Error.from_error(e)
@@ -351,7 +371,6 @@ module Google
351
371
 
352
372
  @policy_tag_manager_stub.call_rpc :delete_taxonomy, request, options: options do |response, operation|
353
373
  yield response, operation if block_given?
354
- return response
355
374
  end
356
375
  rescue ::GRPC::BadStatus => e
357
376
  raise ::Google::Cloud::Error.from_error(e)
@@ -443,7 +462,6 @@ module Google
443
462
 
444
463
  @policy_tag_manager_stub.call_rpc :update_taxonomy, request, options: options do |response, operation|
445
464
  yield response, operation if block_given?
446
- return response
447
465
  end
448
466
  rescue ::GRPC::BadStatus => e
449
467
  raise ::Google::Cloud::Error.from_error(e)
@@ -544,7 +562,7 @@ module Google
544
562
  @policy_tag_manager_stub.call_rpc :list_taxonomies, request, options: options do |response, operation|
545
563
  response = ::Gapic::PagedEnumerable.new @policy_tag_manager_stub, :list_taxonomies, request, response, operation, options
546
564
  yield response, operation if block_given?
547
- return response
565
+ throw :response, response
548
566
  end
549
567
  rescue ::GRPC::BadStatus => e
550
568
  raise ::Google::Cloud::Error.from_error(e)
@@ -630,7 +648,6 @@ module Google
630
648
 
631
649
  @policy_tag_manager_stub.call_rpc :get_taxonomy, request, options: options do |response, operation|
632
650
  yield response, operation if block_given?
633
- return response
634
651
  end
635
652
  rescue ::GRPC::BadStatus => e
636
653
  raise ::Google::Cloud::Error.from_error(e)
@@ -718,7 +735,6 @@ module Google
718
735
 
719
736
  @policy_tag_manager_stub.call_rpc :create_policy_tag, request, options: options do |response, operation|
720
737
  yield response, operation if block_given?
721
- return response
722
738
  end
723
739
  rescue ::GRPC::BadStatus => e
724
740
  raise ::Google::Cloud::Error.from_error(e)
@@ -805,7 +821,6 @@ module Google
805
821
 
806
822
  @policy_tag_manager_stub.call_rpc :delete_policy_tag, request, options: options do |response, operation|
807
823
  yield response, operation if block_given?
808
- return response
809
824
  end
810
825
  rescue ::GRPC::BadStatus => e
811
826
  raise ::Google::Cloud::Error.from_error(e)
@@ -900,7 +915,6 @@ module Google
900
915
 
901
916
  @policy_tag_manager_stub.call_rpc :update_policy_tag, request, options: options do |response, operation|
902
917
  yield response, operation if block_given?
903
- return response
904
918
  end
905
919
  rescue ::GRPC::BadStatus => e
906
920
  raise ::Google::Cloud::Error.from_error(e)
@@ -997,7 +1011,7 @@ module Google
997
1011
  @policy_tag_manager_stub.call_rpc :list_policy_tags, request, options: options do |response, operation|
998
1012
  response = ::Gapic::PagedEnumerable.new @policy_tag_manager_stub, :list_policy_tags, request, response, operation, options
999
1013
  yield response, operation if block_given?
1000
- return response
1014
+ throw :response, response
1001
1015
  end
1002
1016
  rescue ::GRPC::BadStatus => e
1003
1017
  raise ::Google::Cloud::Error.from_error(e)
@@ -1083,7 +1097,6 @@ module Google
1083
1097
 
1084
1098
  @policy_tag_manager_stub.call_rpc :get_policy_tag, request, options: options do |response, operation|
1085
1099
  yield response, operation if block_given?
1086
- return response
1087
1100
  end
1088
1101
  rescue ::GRPC::BadStatus => e
1089
1102
  raise ::Google::Cloud::Error.from_error(e)
@@ -1173,7 +1186,6 @@ module Google
1173
1186
 
1174
1187
  @policy_tag_manager_stub.call_rpc :get_iam_policy, request, options: options do |response, operation|
1175
1188
  yield response, operation if block_given?
1176
- return response
1177
1189
  end
1178
1190
  rescue ::GRPC::BadStatus => e
1179
1191
  raise ::Google::Cloud::Error.from_error(e)
@@ -1271,7 +1283,6 @@ module Google
1271
1283
 
1272
1284
  @policy_tag_manager_stub.call_rpc :set_iam_policy, request, options: options do |response, operation|
1273
1285
  yield response, operation if block_given?
1274
- return response
1275
1286
  end
1276
1287
  rescue ::GRPC::BadStatus => e
1277
1288
  raise ::Google::Cloud::Error.from_error(e)
@@ -1364,7 +1375,6 @@ module Google
1364
1375
 
1365
1376
  @policy_tag_manager_stub.call_rpc :test_iam_permissions, request, options: options do |response, operation|
1366
1377
  yield response, operation if block_given?
1367
- return response
1368
1378
  end
1369
1379
  rescue ::GRPC::BadStatus => e
1370
1380
  raise ::Google::Cloud::Error.from_error(e)
@@ -1453,6 +1463,11 @@ module Google
1453
1463
  # default endpoint URL. The default value of nil uses the environment
1454
1464
  # universe (usually the default "googleapis.com" universe).
1455
1465
  # @return [::String,nil]
1466
+ # @!attribute [rw] logger
1467
+ # A custom logger to use for request/response debug logging, or the value
1468
+ # `:default` (the default) to construct a default logger, or `nil` to
1469
+ # explicitly disable logging.
1470
+ # @return [::Logger,:default,nil]
1456
1471
  #
1457
1472
  class Configuration
1458
1473
  extend ::Gapic::Config
@@ -1477,6 +1492,7 @@ module Google
1477
1492
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
1478
1493
  config_attr :quota_project, nil, ::String, nil
1479
1494
  config_attr :universe_domain, nil, ::String, nil
1495
+ config_attr :logger, :default, ::Logger, nil, :default
1480
1496
 
1481
1497
  # @private
1482
1498
  def initialize parent_config = nil
@@ -154,14 +154,26 @@ module Google
154
154
  endpoint: @config.endpoint,
155
155
  endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
156
156
  universe_domain: @config.universe_domain,
157
- credentials: credentials
157
+ credentials: credentials,
158
+ logger: @config.logger
158
159
  )
159
160
 
161
+ @policy_tag_manager_stub.logger(stub: true)&.info do |entry|
162
+ entry.set_system_name
163
+ entry.set_service
164
+ entry.message = "Created client for #{entry.service}"
165
+ entry.set_credentials_fields credentials
166
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
167
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
168
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
169
+ end
170
+
160
171
  @iam_policy_client = Google::Iam::V1::IAMPolicy::Rest::Client.new do |config|
161
172
  config.credentials = credentials
162
173
  config.quota_project = @quota_project_id
163
174
  config.endpoint = @policy_tag_manager_stub.endpoint
164
175
  config.universe_domain = @policy_tag_manager_stub.universe_domain
176
+ config.logger = @policy_tag_manager_stub.logger if config.respond_to? :logger=
165
177
  end
166
178
  end
167
179
 
@@ -172,6 +184,15 @@ module Google
172
184
  #
173
185
  attr_reader :iam_policy_client
174
186
 
187
+ ##
188
+ # The logger used for request/response debug logging.
189
+ #
190
+ # @return [Logger]
191
+ #
192
+ def logger
193
+ @policy_tag_manager_stub.logger
194
+ end
195
+
175
196
  # Service calls
176
197
 
177
198
  ##
@@ -249,7 +270,6 @@ module Google
249
270
 
250
271
  @policy_tag_manager_stub.create_taxonomy request, options do |result, operation|
251
272
  yield result, operation if block_given?
252
- return result
253
273
  end
254
274
  rescue ::Gapic::Rest::Error => e
255
275
  raise ::Google::Cloud::Error.from_error(e)
@@ -330,7 +350,6 @@ module Google
330
350
 
331
351
  @policy_tag_manager_stub.delete_taxonomy request, options do |result, operation|
332
352
  yield result, operation if block_given?
333
- return result
334
353
  end
335
354
  rescue ::Gapic::Rest::Error => e
336
355
  raise ::Google::Cloud::Error.from_error(e)
@@ -415,7 +434,6 @@ module Google
415
434
 
416
435
  @policy_tag_manager_stub.update_taxonomy request, options do |result, operation|
417
436
  yield result, operation if block_given?
418
- return result
419
437
  end
420
438
  rescue ::Gapic::Rest::Error => e
421
439
  raise ::Google::Cloud::Error.from_error(e)
@@ -509,7 +527,7 @@ module Google
509
527
  @policy_tag_manager_stub.list_taxonomies request, options do |result, operation|
510
528
  result = ::Gapic::Rest::PagedEnumerable.new @policy_tag_manager_stub, :list_taxonomies, "taxonomies", request, result, options
511
529
  yield result, operation if block_given?
512
- return result
530
+ throw :response, result
513
531
  end
514
532
  rescue ::Gapic::Rest::Error => e
515
533
  raise ::Google::Cloud::Error.from_error(e)
@@ -588,7 +606,6 @@ module Google
588
606
 
589
607
  @policy_tag_manager_stub.get_taxonomy request, options do |result, operation|
590
608
  yield result, operation if block_given?
591
- return result
592
609
  end
593
610
  rescue ::Gapic::Rest::Error => e
594
611
  raise ::Google::Cloud::Error.from_error(e)
@@ -669,7 +686,6 @@ module Google
669
686
 
670
687
  @policy_tag_manager_stub.create_policy_tag request, options do |result, operation|
671
688
  yield result, operation if block_given?
672
- return result
673
689
  end
674
690
  rescue ::Gapic::Rest::Error => e
675
691
  raise ::Google::Cloud::Error.from_error(e)
@@ -749,7 +765,6 @@ module Google
749
765
 
750
766
  @policy_tag_manager_stub.delete_policy_tag request, options do |result, operation|
751
767
  yield result, operation if block_given?
752
- return result
753
768
  end
754
769
  rescue ::Gapic::Rest::Error => e
755
770
  raise ::Google::Cloud::Error.from_error(e)
@@ -837,7 +852,6 @@ module Google
837
852
 
838
853
  @policy_tag_manager_stub.update_policy_tag request, options do |result, operation|
839
854
  yield result, operation if block_given?
840
- return result
841
855
  end
842
856
  rescue ::Gapic::Rest::Error => e
843
857
  raise ::Google::Cloud::Error.from_error(e)
@@ -927,7 +941,7 @@ module Google
927
941
  @policy_tag_manager_stub.list_policy_tags request, options do |result, operation|
928
942
  result = ::Gapic::Rest::PagedEnumerable.new @policy_tag_manager_stub, :list_policy_tags, "policy_tags", request, result, options
929
943
  yield result, operation if block_given?
930
- return result
944
+ throw :response, result
931
945
  end
932
946
  rescue ::Gapic::Rest::Error => e
933
947
  raise ::Google::Cloud::Error.from_error(e)
@@ -1006,7 +1020,6 @@ module Google
1006
1020
 
1007
1021
  @policy_tag_manager_stub.get_policy_tag request, options do |result, operation|
1008
1022
  yield result, operation if block_given?
1009
- return result
1010
1023
  end
1011
1024
  rescue ::Gapic::Rest::Error => e
1012
1025
  raise ::Google::Cloud::Error.from_error(e)
@@ -1089,7 +1102,6 @@ module Google
1089
1102
 
1090
1103
  @policy_tag_manager_stub.get_iam_policy request, options do |result, operation|
1091
1104
  yield result, operation if block_given?
1092
- return result
1093
1105
  end
1094
1106
  rescue ::Gapic::Rest::Error => e
1095
1107
  raise ::Google::Cloud::Error.from_error(e)
@@ -1180,7 +1192,6 @@ module Google
1180
1192
 
1181
1193
  @policy_tag_manager_stub.set_iam_policy request, options do |result, operation|
1182
1194
  yield result, operation if block_given?
1183
- return result
1184
1195
  end
1185
1196
  rescue ::Gapic::Rest::Error => e
1186
1197
  raise ::Google::Cloud::Error.from_error(e)
@@ -1266,7 +1277,6 @@ module Google
1266
1277
 
1267
1278
  @policy_tag_manager_stub.test_iam_permissions request, options do |result, operation|
1268
1279
  yield result, operation if block_given?
1269
- return result
1270
1280
  end
1271
1281
  rescue ::Gapic::Rest::Error => e
1272
1282
  raise ::Google::Cloud::Error.from_error(e)
@@ -1346,6 +1356,11 @@ module Google
1346
1356
  # default endpoint URL. The default value of nil uses the environment
1347
1357
  # universe (usually the default "googleapis.com" universe).
1348
1358
  # @return [::String,nil]
1359
+ # @!attribute [rw] logger
1360
+ # A custom logger to use for request/response debug logging, or the value
1361
+ # `:default` (the default) to construct a default logger, or `nil` to
1362
+ # explicitly disable logging.
1363
+ # @return [::Logger,:default,nil]
1349
1364
  #
1350
1365
  class Configuration
1351
1366
  extend ::Gapic::Config
@@ -1367,6 +1382,7 @@ module Google
1367
1382
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
1368
1383
  config_attr :quota_project, nil, ::String, nil
1369
1384
  config_attr :universe_domain, nil, ::String, nil
1385
+ config_attr :logger, :default, ::Logger, nil, :default
1370
1386
 
1371
1387
  # @private
1372
1388
  def initialize parent_config = nil