google-cloud-service_directory-v1beta1 0.15.1 → 0.16.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -170,15 +170,27 @@ module Google
170
170
  endpoint: @config.endpoint,
171
171
  endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
172
172
  universe_domain: @config.universe_domain,
173
- credentials: credentials
173
+ credentials: credentials,
174
+ logger: @config.logger
174
175
  )
175
176
 
177
+ @registration_service_stub.logger(stub: true)&.info do |entry|
178
+ entry.set_system_name
179
+ entry.set_service
180
+ entry.message = "Created client for #{entry.service}"
181
+ entry.set_credentials_fields credentials
182
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
183
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
184
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
185
+ end
186
+
176
187
  @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config|
177
188
  config.credentials = credentials
178
189
  config.quota_project = @quota_project_id
179
190
  config.endpoint = @registration_service_stub.endpoint
180
191
  config.universe_domain = @registration_service_stub.universe_domain
181
192
  config.bindings_override = @config.bindings_override
193
+ config.logger = @registration_service_stub.logger if config.respond_to? :logger=
182
194
  end
183
195
  end
184
196
 
@@ -189,6 +201,15 @@ module Google
189
201
  #
190
202
  attr_reader :location_client
191
203
 
204
+ ##
205
+ # The logger used for request/response debug logging.
206
+ #
207
+ # @return [Logger]
208
+ #
209
+ def logger
210
+ @registration_service_stub.logger
211
+ end
212
+
192
213
  # Service calls
193
214
 
194
215
  ##
@@ -275,7 +296,6 @@ module Google
275
296
 
276
297
  @registration_service_stub.create_namespace request, options do |result, operation|
277
298
  yield result, operation if block_given?
278
- return result
279
299
  end
280
300
  rescue ::Gapic::Rest::Error => e
281
301
  raise ::Google::Cloud::Error.from_error(e)
@@ -407,7 +427,7 @@ module Google
407
427
  @registration_service_stub.list_namespaces request, options do |result, operation|
408
428
  result = ::Gapic::Rest::PagedEnumerable.new @registration_service_stub, :list_namespaces, "namespaces", request, result, options
409
429
  yield result, operation if block_given?
410
- return result
430
+ throw :response, result
411
431
  end
412
432
  rescue ::Gapic::Rest::Error => e
413
433
  raise ::Google::Cloud::Error.from_error(e)
@@ -486,7 +506,6 @@ module Google
486
506
 
487
507
  @registration_service_stub.get_namespace request, options do |result, operation|
488
508
  yield result, operation if block_given?
489
- return result
490
509
  end
491
510
  rescue ::Gapic::Rest::Error => e
492
511
  raise ::Google::Cloud::Error.from_error(e)
@@ -567,7 +586,6 @@ module Google
567
586
 
568
587
  @registration_service_stub.update_namespace request, options do |result, operation|
569
588
  yield result, operation if block_given?
570
- return result
571
589
  end
572
590
  rescue ::Gapic::Rest::Error => e
573
591
  raise ::Google::Cloud::Error.from_error(e)
@@ -647,7 +665,6 @@ module Google
647
665
 
648
666
  @registration_service_stub.delete_namespace request, options do |result, operation|
649
667
  yield result, operation if block_given?
650
- return result
651
668
  end
652
669
  rescue ::Gapic::Rest::Error => e
653
670
  raise ::Google::Cloud::Error.from_error(e)
@@ -736,7 +753,6 @@ module Google
736
753
 
737
754
  @registration_service_stub.create_service request, options do |result, operation|
738
755
  yield result, operation if block_given?
739
- return result
740
756
  end
741
757
  rescue ::Gapic::Rest::Error => e
742
758
  raise ::Google::Cloud::Error.from_error(e)
@@ -871,7 +887,7 @@ module Google
871
887
  @registration_service_stub.list_services request, options do |result, operation|
872
888
  result = ::Gapic::Rest::PagedEnumerable.new @registration_service_stub, :list_services, "services", request, result, options
873
889
  yield result, operation if block_given?
874
- return result
890
+ throw :response, result
875
891
  end
876
892
  rescue ::Gapic::Rest::Error => e
877
893
  raise ::Google::Cloud::Error.from_error(e)
@@ -950,7 +966,6 @@ module Google
950
966
 
951
967
  @registration_service_stub.get_service request, options do |result, operation|
952
968
  yield result, operation if block_given?
953
- return result
954
969
  end
955
970
  rescue ::Gapic::Rest::Error => e
956
971
  raise ::Google::Cloud::Error.from_error(e)
@@ -1031,7 +1046,6 @@ module Google
1031
1046
 
1032
1047
  @registration_service_stub.update_service request, options do |result, operation|
1033
1048
  yield result, operation if block_given?
1034
- return result
1035
1049
  end
1036
1050
  rescue ::Gapic::Rest::Error => e
1037
1051
  raise ::Google::Cloud::Error.from_error(e)
@@ -1111,7 +1125,6 @@ module Google
1111
1125
 
1112
1126
  @registration_service_stub.delete_service request, options do |result, operation|
1113
1127
  yield result, operation if block_given?
1114
- return result
1115
1128
  end
1116
1129
  rescue ::Gapic::Rest::Error => e
1117
1130
  raise ::Google::Cloud::Error.from_error(e)
@@ -1200,7 +1213,6 @@ module Google
1200
1213
 
1201
1214
  @registration_service_stub.create_endpoint request, options do |result, operation|
1202
1215
  yield result, operation if block_given?
1203
- return result
1204
1216
  end
1205
1217
  rescue ::Gapic::Rest::Error => e
1206
1218
  raise ::Google::Cloud::Error.from_error(e)
@@ -1337,7 +1349,7 @@ module Google
1337
1349
  @registration_service_stub.list_endpoints request, options do |result, operation|
1338
1350
  result = ::Gapic::Rest::PagedEnumerable.new @registration_service_stub, :list_endpoints, "endpoints", request, result, options
1339
1351
  yield result, operation if block_given?
1340
- return result
1352
+ throw :response, result
1341
1353
  end
1342
1354
  rescue ::Gapic::Rest::Error => e
1343
1355
  raise ::Google::Cloud::Error.from_error(e)
@@ -1416,7 +1428,6 @@ module Google
1416
1428
 
1417
1429
  @registration_service_stub.get_endpoint request, options do |result, operation|
1418
1430
  yield result, operation if block_given?
1419
- return result
1420
1431
  end
1421
1432
  rescue ::Gapic::Rest::Error => e
1422
1433
  raise ::Google::Cloud::Error.from_error(e)
@@ -1497,7 +1508,6 @@ module Google
1497
1508
 
1498
1509
  @registration_service_stub.update_endpoint request, options do |result, operation|
1499
1510
  yield result, operation if block_given?
1500
- return result
1501
1511
  end
1502
1512
  rescue ::Gapic::Rest::Error => e
1503
1513
  raise ::Google::Cloud::Error.from_error(e)
@@ -1576,7 +1586,6 @@ module Google
1576
1586
 
1577
1587
  @registration_service_stub.delete_endpoint request, options do |result, operation|
1578
1588
  yield result, operation if block_given?
1579
- return result
1580
1589
  end
1581
1590
  rescue ::Gapic::Rest::Error => e
1582
1591
  raise ::Google::Cloud::Error.from_error(e)
@@ -1659,7 +1668,6 @@ module Google
1659
1668
 
1660
1669
  @registration_service_stub.get_iam_policy request, options do |result, operation|
1661
1670
  yield result, operation if block_given?
1662
- return result
1663
1671
  end
1664
1672
  rescue ::Gapic::Rest::Error => e
1665
1673
  raise ::Google::Cloud::Error.from_error(e)
@@ -1750,7 +1758,6 @@ module Google
1750
1758
 
1751
1759
  @registration_service_stub.set_iam_policy request, options do |result, operation|
1752
1760
  yield result, operation if block_given?
1753
- return result
1754
1761
  end
1755
1762
  rescue ::Gapic::Rest::Error => e
1756
1763
  raise ::Google::Cloud::Error.from_error(e)
@@ -1836,7 +1843,6 @@ module Google
1836
1843
 
1837
1844
  @registration_service_stub.test_iam_permissions request, options do |result, operation|
1838
1845
  yield result, operation if block_given?
1839
- return result
1840
1846
  end
1841
1847
  rescue ::Gapic::Rest::Error => e
1842
1848
  raise ::Google::Cloud::Error.from_error(e)
@@ -1916,6 +1922,11 @@ module Google
1916
1922
  # default endpoint URL. The default value of nil uses the environment
1917
1923
  # universe (usually the default "googleapis.com" universe).
1918
1924
  # @return [::String,nil]
1925
+ # @!attribute [rw] logger
1926
+ # A custom logger to use for request/response debug logging, or the value
1927
+ # `:default` (the default) to construct a default logger, or `nil` to
1928
+ # explicitly disable logging.
1929
+ # @return [::Logger,:default,nil]
1919
1930
  #
1920
1931
  class Configuration
1921
1932
  extend ::Gapic::Config
@@ -1944,6 +1955,7 @@ module Google
1944
1955
  # by the host service.
1945
1956
  # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}]
1946
1957
  config_attr :bindings_override, {}, ::Hash, nil
1958
+ config_attr :logger, :default, ::Logger, nil, :default
1947
1959
 
1948
1960
  # @private
1949
1961
  def initialize parent_config = nil