google-cloud-developer_connect-v1 0.1.1 → 0.3.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: cbec352947632d4090122a0f4bf9b79c7b0997a666104a47a47ef3184020c09f
4
- data.tar.gz: 840519fb0d6ee9cca3235b2b3022631e06fb99e71d6341c3a2a24692473d3eb3
3
+ metadata.gz: c075ad4682f2209586877844b8406f8dcb244e46612d89379af497404dea9a67
4
+ data.tar.gz: d863836aab7f83c73539ca0ddcf7a80ce1bafe3f8a916f112f3d0ea8bc658fbf
5
5
  SHA512:
6
- metadata.gz: a5616bd19a1382301c3dde00a16fb510f5e558d110b1077c348029aaba72ce9cb41d667251f62540c785d933d03aec8d344205222c39ba30c67fed4346b9b5a5
7
- data.tar.gz: d5d9e1462c007681abc00812a33646815997e4db9cfa7133ca6c6fe99f73ec136201ee4dc4339d86587d6d4aff1bd56c17ffa3cc9fd772ec566e266acbe857ac
6
+ metadata.gz: 29083e56d874227f2c2b0adc7ffcba53f300996527bf329e0dcf93820b01c21a27ce30b6710f5b622df47b2ce185c31f79403ac4fc44f65ae391e1aab6aa79ea
7
+ data.tar.gz: 4700dd2ba113fef994c13a7505701a10dc7a45d9f4686e83b68799a236c3a9d16d710689ad8d3cd45b90d263090bd40ba47b94a3204d3363eab33cd80401dd8a
data/README.md CHANGED
@@ -43,33 +43,43 @@ for class and method documentation.
43
43
  See also the [Product Documentation](https://cloud.google.com/developer-connect/docs/overview)
44
44
  for general usage information.
45
45
 
46
- ## Enabling Logging
47
-
48
- To enable logging for this library, set the logger for the underlying [gRPC](https://github.com/grpc/grpc/tree/master/src/ruby) library.
49
- The logger that you set may be a Ruby stdlib [`Logger`](https://ruby-doc.org/current/stdlibs/logger/Logger.html) as shown below,
50
- or a [`Google::Cloud::Logging::Logger`](https://cloud.google.com/ruby/docs/reference/google-cloud-logging/latest)
51
- that will write logs to [Cloud Logging](https://cloud.google.com/logging/). See [grpc/logconfig.rb](https://github.com/grpc/grpc/blob/master/src/ruby/lib/grpc/logconfig.rb)
52
- and the gRPC [spec_helper.rb](https://github.com/grpc/grpc/blob/master/src/ruby/spec/spec_helper.rb) for additional information.
53
-
54
- Configuring a Ruby stdlib logger:
46
+ ## Debug Logging
47
+
48
+ This library comes with opt-in Debug Logging that can help you troubleshoot
49
+ your application's integration with the API. When logging is activated, key
50
+ events such as requests and responses, along with data payloads and metadata
51
+ such as headers and client configuration, are logged to the standard error
52
+ stream.
53
+
54
+ **WARNING:** Client Library Debug Logging includes your data payloads in
55
+ plaintext, which could include sensitive data such as PII for yourself or your
56
+ customers, private keys, or other security data that could be compromising if
57
+ leaked. Always practice good data hygiene with your application logs, and follow
58
+ the principle of least access. Google also recommends that Client Library Debug
59
+ Logging be enabled only temporarily during active debugging, and not used
60
+ permanently in production.
61
+
62
+ To enable logging, set the environment variable `GOOGLE_SDK_RUBY_LOGGING_GEMS`
63
+ to the value `all`. Alternatively, you can set the value to a comma-delimited
64
+ list of client library gem names. This will select the default logging behavior,
65
+ which writes logs to the standard error stream. On a local workstation, this may
66
+ result in logs appearing on the console. When running on a Google Cloud hosting
67
+ service such as [Google Cloud Run](https://cloud.google.com/run), this generally
68
+ results in logs appearing alongside your application logs in the
69
+ [Google Cloud Logging](https://cloud.google.com/logging/) service.
70
+
71
+ You can customize logging by modifying the `logger` configuration when
72
+ constructing a client object. For example:
55
73
 
56
74
  ```ruby
75
+ require "google/cloud/developer_connect/v1"
57
76
  require "logger"
58
77
 
59
- module MyLogger
60
- LOGGER = Logger.new $stderr, level: Logger::WARN
61
- def logger
62
- LOGGER
63
- end
64
- end
65
-
66
- # Define a gRPC module-level logger method before grpc/logconfig.rb loads.
67
- module GRPC
68
- extend MyLogger
78
+ client = ::Google::Cloud::DeveloperConnect::V1::DeveloperConnect::Client.new do |config|
79
+ config.logger = Logger.new "my-app.log"
69
80
  end
70
81
  ```
71
82
 
72
-
73
83
  ## Google Cloud Samples
74
84
 
75
85
  To browse ready to use code samples check [Google Cloud Samples](https://cloud.google.com/docs/samples).
@@ -225,14 +225,26 @@ module Google
225
225
  universe_domain: @config.universe_domain,
226
226
  channel_args: @config.channel_args,
227
227
  interceptors: @config.interceptors,
228
- channel_pool_config: @config.channel_pool
228
+ channel_pool_config: @config.channel_pool,
229
+ logger: @config.logger
229
230
  )
230
231
 
232
+ @developer_connect_stub.stub_logger&.info do |entry|
233
+ entry.set_system_name
234
+ entry.set_service
235
+ entry.message = "Created client for #{entry.service}"
236
+ entry.set_credentials_fields credentials
237
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
238
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
239
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
240
+ end
241
+
231
242
  @location_client = Google::Cloud::Location::Locations::Client.new do |config|
232
243
  config.credentials = credentials
233
244
  config.quota_project = @quota_project_id
234
245
  config.endpoint = @developer_connect_stub.endpoint
235
246
  config.universe_domain = @developer_connect_stub.universe_domain
247
+ config.logger = @developer_connect_stub.logger if config.respond_to? :logger=
236
248
  end
237
249
  end
238
250
 
@@ -250,6 +262,15 @@ module Google
250
262
  #
251
263
  attr_reader :location_client
252
264
 
265
+ ##
266
+ # The logger used for request/response debug logging.
267
+ #
268
+ # @return [Logger]
269
+ #
270
+ def logger
271
+ @developer_connect_stub.logger
272
+ end
273
+
253
274
  # Service calls
254
275
 
255
276
  ##
@@ -346,7 +367,7 @@ module Google
346
367
  @developer_connect_stub.call_rpc :list_connections, request, options: options do |response, operation|
347
368
  response = ::Gapic::PagedEnumerable.new @developer_connect_stub, :list_connections, request, response, operation, options
348
369
  yield response, operation if block_given?
349
- return response
370
+ throw :response, response
350
371
  end
351
372
  rescue ::GRPC::BadStatus => e
352
373
  raise ::Google::Cloud::Error.from_error(e)
@@ -432,7 +453,6 @@ module Google
432
453
 
433
454
  @developer_connect_stub.call_rpc :get_connection, request, options: options do |response, operation|
434
455
  yield response, operation if block_given?
435
- return response
436
456
  end
437
457
  rescue ::GRPC::BadStatus => e
438
458
  raise ::Google::Cloud::Error.from_error(e)
@@ -548,7 +568,7 @@ module Google
548
568
  @developer_connect_stub.call_rpc :create_connection, request, options: options do |response, operation|
549
569
  response = ::Gapic::Operation.new response, @operations_client, options: options
550
570
  yield response, operation if block_given?
551
- return response
571
+ throw :response, response
552
572
  end
553
573
  rescue ::GRPC::BadStatus => e
554
574
  raise ::Google::Cloud::Error.from_error(e)
@@ -670,7 +690,7 @@ module Google
670
690
  @developer_connect_stub.call_rpc :update_connection, request, options: options do |response, operation|
671
691
  response = ::Gapic::Operation.new response, @operations_client, options: options
672
692
  yield response, operation if block_given?
673
- return response
693
+ throw :response, response
674
694
  end
675
695
  rescue ::GRPC::BadStatus => e
676
696
  raise ::Google::Cloud::Error.from_error(e)
@@ -784,7 +804,7 @@ module Google
784
804
  @developer_connect_stub.call_rpc :delete_connection, request, options: options do |response, operation|
785
805
  response = ::Gapic::Operation.new response, @operations_client, options: options
786
806
  yield response, operation if block_given?
787
- return response
807
+ throw :response, response
788
808
  end
789
809
  rescue ::GRPC::BadStatus => e
790
810
  raise ::Google::Cloud::Error.from_error(e)
@@ -905,7 +925,7 @@ module Google
905
925
  @developer_connect_stub.call_rpc :create_git_repository_link, request, options: options do |response, operation|
906
926
  response = ::Gapic::Operation.new response, @operations_client, options: options
907
927
  yield response, operation if block_given?
908
- return response
928
+ throw :response, response
909
929
  end
910
930
  rescue ::GRPC::BadStatus => e
911
931
  raise ::Google::Cloud::Error.from_error(e)
@@ -1019,7 +1039,7 @@ module Google
1019
1039
  @developer_connect_stub.call_rpc :delete_git_repository_link, request, options: options do |response, operation|
1020
1040
  response = ::Gapic::Operation.new response, @operations_client, options: options
1021
1041
  yield response, operation if block_given?
1022
- return response
1042
+ throw :response, response
1023
1043
  end
1024
1044
  rescue ::GRPC::BadStatus => e
1025
1045
  raise ::Google::Cloud::Error.from_error(e)
@@ -1119,7 +1139,7 @@ module Google
1119
1139
  @developer_connect_stub.call_rpc :list_git_repository_links, request, options: options do |response, operation|
1120
1140
  response = ::Gapic::PagedEnumerable.new @developer_connect_stub, :list_git_repository_links, request, response, operation, options
1121
1141
  yield response, operation if block_given?
1122
- return response
1142
+ throw :response, response
1123
1143
  end
1124
1144
  rescue ::GRPC::BadStatus => e
1125
1145
  raise ::Google::Cloud::Error.from_error(e)
@@ -1205,7 +1225,6 @@ module Google
1205
1225
 
1206
1226
  @developer_connect_stub.call_rpc :get_git_repository_link, request, options: options do |response, operation|
1207
1227
  yield response, operation if block_given?
1208
- return response
1209
1228
  end
1210
1229
  rescue ::GRPC::BadStatus => e
1211
1230
  raise ::Google::Cloud::Error.from_error(e)
@@ -1292,7 +1311,6 @@ module Google
1292
1311
 
1293
1312
  @developer_connect_stub.call_rpc :fetch_read_write_token, request, options: options do |response, operation|
1294
1313
  yield response, operation if block_given?
1295
- return response
1296
1314
  end
1297
1315
  rescue ::GRPC::BadStatus => e
1298
1316
  raise ::Google::Cloud::Error.from_error(e)
@@ -1379,7 +1397,6 @@ module Google
1379
1397
 
1380
1398
  @developer_connect_stub.call_rpc :fetch_read_token, request, options: options do |response, operation|
1381
1399
  yield response, operation if block_given?
1382
- return response
1383
1400
  end
1384
1401
  rescue ::GRPC::BadStatus => e
1385
1402
  raise ::Google::Cloud::Error.from_error(e)
@@ -1476,7 +1493,7 @@ module Google
1476
1493
  @developer_connect_stub.call_rpc :fetch_linkable_git_repositories, request, options: options do |response, operation|
1477
1494
  response = ::Gapic::PagedEnumerable.new @developer_connect_stub, :fetch_linkable_git_repositories, request, response, operation, options
1478
1495
  yield response, operation if block_given?
1479
- return response
1496
+ throw :response, response
1480
1497
  end
1481
1498
  rescue ::GRPC::BadStatus => e
1482
1499
  raise ::Google::Cloud::Error.from_error(e)
@@ -1566,7 +1583,6 @@ module Google
1566
1583
 
1567
1584
  @developer_connect_stub.call_rpc :fetch_git_hub_installations, request, options: options do |response, operation|
1568
1585
  yield response, operation if block_given?
1569
- return response
1570
1586
  end
1571
1587
  rescue ::GRPC::BadStatus => e
1572
1588
  raise ::Google::Cloud::Error.from_error(e)
@@ -1659,7 +1675,6 @@ module Google
1659
1675
 
1660
1676
  @developer_connect_stub.call_rpc :fetch_git_refs, request, options: options do |response, operation|
1661
1677
  yield response, operation if block_given?
1662
- return response
1663
1678
  end
1664
1679
  rescue ::GRPC::BadStatus => e
1665
1680
  raise ::Google::Cloud::Error.from_error(e)
@@ -1748,6 +1763,11 @@ module Google
1748
1763
  # default endpoint URL. The default value of nil uses the environment
1749
1764
  # universe (usually the default "googleapis.com" universe).
1750
1765
  # @return [::String,nil]
1766
+ # @!attribute [rw] logger
1767
+ # A custom logger to use for request/response debug logging, or the value
1768
+ # `:default` (the default) to construct a default logger, or `nil` to
1769
+ # explicitly disable logging.
1770
+ # @return [::Logger,:default,nil]
1751
1771
  #
1752
1772
  class Configuration
1753
1773
  extend ::Gapic::Config
@@ -1772,6 +1792,7 @@ module Google
1772
1792
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
1773
1793
  config_attr :quota_project, nil, ::String, nil
1774
1794
  config_attr :universe_domain, nil, ::String, nil
1795
+ config_attr :logger, :default, ::Logger, nil, :default
1775
1796
 
1776
1797
  # @private
1777
1798
  def initialize parent_config = nil
@@ -124,14 +124,6 @@ module Google
124
124
  # Lists operations that match the specified filter in the request. If the
125
125
  # server doesn't support this method, it returns `UNIMPLEMENTED`.
126
126
  #
127
- # NOTE: the `name` binding allows API services to override the binding
128
- # to use different resource name schemes, such as `users/*/operations`. To
129
- # override the binding, API services can add a binding such as
130
- # `"/v1/{name=users/*}/operations"` to their service configuration.
131
- # For backwards compatibility, the default name includes the operations
132
- # collection id, however overriding users must ensure the name binding
133
- # is the parent resource, without the operations collection id.
134
- #
135
127
  # @overload list_operations(request, options = nil)
136
128
  # Pass arguments to `list_operations` via a request object, either of type
137
129
  # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash.
@@ -221,7 +213,7 @@ module Google
221
213
  wrap_lro_operation = ->(op_response) { ::Gapic::Operation.new op_response, @operations_client }
222
214
  response = ::Gapic::PagedEnumerable.new @operations_stub, :list_operations, request, response, operation, options, format_resource: wrap_lro_operation
223
215
  yield response, operation if block_given?
224
- return response
216
+ throw :response, response
225
217
  end
226
218
  rescue ::GRPC::BadStatus => e
227
219
  raise ::Google::Cloud::Error.from_error(e)
@@ -317,7 +309,7 @@ module Google
317
309
  @operations_stub.call_rpc :get_operation, request, options: options do |response, operation|
318
310
  response = ::Gapic::Operation.new response, @operations_client, options: options
319
311
  yield response, operation if block_given?
320
- return response
312
+ throw :response, response
321
313
  end
322
314
  rescue ::GRPC::BadStatus => e
323
315
  raise ::Google::Cloud::Error.from_error(e)
@@ -406,7 +398,6 @@ module Google
406
398
 
407
399
  @operations_stub.call_rpc :delete_operation, request, options: options do |response, operation|
408
400
  yield response, operation if block_given?
409
- return response
410
401
  end
411
402
  rescue ::GRPC::BadStatus => e
412
403
  raise ::Google::Cloud::Error.from_error(e)
@@ -421,8 +412,9 @@ module Google
421
412
  # other methods to check whether the cancellation succeeded or whether the
422
413
  # operation completed despite cancellation. On successful cancellation,
423
414
  # the operation is not deleted; instead, it becomes an operation with
424
- # an {::Google::Longrunning::Operation#error Operation.error} value with a {::Google::Rpc::Status#code google.rpc.Status.code} of 1,
425
- # corresponding to `Code.CANCELLED`.
415
+ # an {::Google::Longrunning::Operation#error Operation.error} value with a
416
+ # {::Google::Rpc::Status#code google.rpc.Status.code} of `1`, corresponding to
417
+ # `Code.CANCELLED`.
426
418
  #
427
419
  # @overload cancel_operation(request, options = nil)
428
420
  # Pass arguments to `cancel_operation` via a request object, either of type
@@ -501,7 +493,6 @@ module Google
501
493
 
502
494
  @operations_stub.call_rpc :cancel_operation, request, options: options do |response, operation|
503
495
  yield response, operation if block_given?
504
- return response
505
496
  end
506
497
  rescue ::GRPC::BadStatus => e
507
498
  raise ::Google::Cloud::Error.from_error(e)
@@ -599,7 +590,7 @@ module Google
599
590
  @operations_stub.call_rpc :wait_operation, request, options: options do |response, operation|
600
591
  response = ::Gapic::Operation.new response, @operations_client, options: options
601
592
  yield response, operation if block_given?
602
- return response
593
+ throw :response, response
603
594
  end
604
595
  rescue ::GRPC::BadStatus => e
605
596
  raise ::Google::Cloud::Error.from_error(e)
@@ -688,6 +679,11 @@ module Google
688
679
  # default endpoint URL. The default value of nil uses the environment
689
680
  # universe (usually the default "googleapis.com" universe).
690
681
  # @return [::String,nil]
682
+ # @!attribute [rw] logger
683
+ # A custom logger to use for request/response debug logging, or the value
684
+ # `:default` (the default) to construct a default logger, or `nil` to
685
+ # explicitly disable logging.
686
+ # @return [::Logger,:default,nil]
691
687
  #
692
688
  class Configuration
693
689
  extend ::Gapic::Config
@@ -712,6 +708,7 @@ module Google
712
708
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
713
709
  config_attr :quota_project, nil, ::String, nil
714
710
  config_attr :universe_domain, nil, ::String, nil
711
+ config_attr :logger, :default, ::Logger, nil, :default
715
712
 
716
713
  # @private
717
714
  def initialize parent_config = nil
@@ -43,6 +43,27 @@ module Google
43
43
  "projects/#{project}/locations/#{location}/connections/#{connection}"
44
44
  end
45
45
 
46
+ ##
47
+ # Create a fully-qualified CryptoKey resource string.
48
+ #
49
+ # The resource will be in the following format:
50
+ #
51
+ # `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}`
52
+ #
53
+ # @param project [String]
54
+ # @param location [String]
55
+ # @param key_ring [String]
56
+ # @param crypto_key [String]
57
+ #
58
+ # @return [::String]
59
+ def crypto_key_path project:, location:, key_ring:, crypto_key:
60
+ raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
61
+ raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
62
+ raise ::ArgumentError, "key_ring cannot contain /" if key_ring.to_s.include? "/"
63
+
64
+ "projects/#{project}/locations/#{location}/keyRings/#{key_ring}/cryptoKeys/#{crypto_key}"
65
+ end
66
+
46
67
  ##
47
68
  # Create a fully-qualified GitRepositoryLink resource string.
48
69
  #
@@ -100,6 +121,27 @@ module Google
100
121
  "projects/#{project}/secrets/#{secret}/versions/#{secret_version}"
101
122
  end
102
123
 
124
+ ##
125
+ # Create a fully-qualified Service resource string.
126
+ #
127
+ # The resource will be in the following format:
128
+ #
129
+ # `projects/{project}/locations/{location}/namespaces/{namespace}/services/{service}`
130
+ #
131
+ # @param project [String]
132
+ # @param location [String]
133
+ # @param namespace [String]
134
+ # @param service [String]
135
+ #
136
+ # @return [::String]
137
+ def service_path project:, location:, namespace:, service:
138
+ raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
139
+ raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
140
+ raise ::ArgumentError, "namespace cannot contain /" if namespace.to_s.include? "/"
141
+
142
+ "projects/#{project}/locations/#{location}/namespaces/#{namespace}/services/#{service}"
143
+ end
144
+
103
145
  extend self
104
146
  end
105
147
  end
@@ -218,15 +218,27 @@ module Google
218
218
  endpoint: @config.endpoint,
219
219
  endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
220
220
  universe_domain: @config.universe_domain,
221
- credentials: credentials
221
+ credentials: credentials,
222
+ logger: @config.logger
222
223
  )
223
224
 
225
+ @developer_connect_stub.logger(stub: true)&.info do |entry|
226
+ entry.set_system_name
227
+ entry.set_service
228
+ entry.message = "Created client for #{entry.service}"
229
+ entry.set_credentials_fields credentials
230
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
231
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
232
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
233
+ end
234
+
224
235
  @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config|
225
236
  config.credentials = credentials
226
237
  config.quota_project = @quota_project_id
227
238
  config.endpoint = @developer_connect_stub.endpoint
228
239
  config.universe_domain = @developer_connect_stub.universe_domain
229
240
  config.bindings_override = @config.bindings_override
241
+ config.logger = @developer_connect_stub.logger if config.respond_to? :logger=
230
242
  end
231
243
  end
232
244
 
@@ -244,6 +256,15 @@ module Google
244
256
  #
245
257
  attr_reader :location_client
246
258
 
259
+ ##
260
+ # The logger used for request/response debug logging.
261
+ #
262
+ # @return [Logger]
263
+ #
264
+ def logger
265
+ @developer_connect_stub.logger
266
+ end
267
+
247
268
  # Service calls
248
269
 
249
270
  ##
@@ -332,7 +353,6 @@ module Google
332
353
 
333
354
  @developer_connect_stub.list_connections request, options do |result, operation|
334
355
  yield result, operation if block_given?
335
- return result
336
356
  end
337
357
  rescue ::Gapic::Rest::Error => e
338
358
  raise ::Google::Cloud::Error.from_error(e)
@@ -411,7 +431,6 @@ module Google
411
431
 
412
432
  @developer_connect_stub.get_connection request, options do |result, operation|
413
433
  yield result, operation if block_given?
414
- return result
415
434
  end
416
435
  rescue ::Gapic::Rest::Error => e
417
436
  raise ::Google::Cloud::Error.from_error(e)
@@ -520,7 +539,7 @@ module Google
520
539
  @developer_connect_stub.create_connection request, options do |result, operation|
521
540
  result = ::Gapic::Operation.new result, @operations_client, options: options
522
541
  yield result, operation if block_given?
523
- return result
542
+ throw :response, result
524
543
  end
525
544
  rescue ::Gapic::Rest::Error => e
526
545
  raise ::Google::Cloud::Error.from_error(e)
@@ -635,7 +654,7 @@ module Google
635
654
  @developer_connect_stub.update_connection request, options do |result, operation|
636
655
  result = ::Gapic::Operation.new result, @operations_client, options: options
637
656
  yield result, operation if block_given?
638
- return result
657
+ throw :response, result
639
658
  end
640
659
  rescue ::Gapic::Rest::Error => e
641
660
  raise ::Google::Cloud::Error.from_error(e)
@@ -742,7 +761,7 @@ module Google
742
761
  @developer_connect_stub.delete_connection request, options do |result, operation|
743
762
  result = ::Gapic::Operation.new result, @operations_client, options: options
744
763
  yield result, operation if block_given?
745
- return result
764
+ throw :response, result
746
765
  end
747
766
  rescue ::Gapic::Rest::Error => e
748
767
  raise ::Google::Cloud::Error.from_error(e)
@@ -856,7 +875,7 @@ module Google
856
875
  @developer_connect_stub.create_git_repository_link request, options do |result, operation|
857
876
  result = ::Gapic::Operation.new result, @operations_client, options: options
858
877
  yield result, operation if block_given?
859
- return result
878
+ throw :response, result
860
879
  end
861
880
  rescue ::Gapic::Rest::Error => e
862
881
  raise ::Google::Cloud::Error.from_error(e)
@@ -963,7 +982,7 @@ module Google
963
982
  @developer_connect_stub.delete_git_repository_link request, options do |result, operation|
964
983
  result = ::Gapic::Operation.new result, @operations_client, options: options
965
984
  yield result, operation if block_given?
966
- return result
985
+ throw :response, result
967
986
  end
968
987
  rescue ::Gapic::Rest::Error => e
969
988
  raise ::Google::Cloud::Error.from_error(e)
@@ -1055,7 +1074,6 @@ module Google
1055
1074
 
1056
1075
  @developer_connect_stub.list_git_repository_links request, options do |result, operation|
1057
1076
  yield result, operation if block_given?
1058
- return result
1059
1077
  end
1060
1078
  rescue ::Gapic::Rest::Error => e
1061
1079
  raise ::Google::Cloud::Error.from_error(e)
@@ -1134,7 +1152,6 @@ module Google
1134
1152
 
1135
1153
  @developer_connect_stub.get_git_repository_link request, options do |result, operation|
1136
1154
  yield result, operation if block_given?
1137
- return result
1138
1155
  end
1139
1156
  rescue ::Gapic::Rest::Error => e
1140
1157
  raise ::Google::Cloud::Error.from_error(e)
@@ -1214,7 +1231,6 @@ module Google
1214
1231
 
1215
1232
  @developer_connect_stub.fetch_read_write_token request, options do |result, operation|
1216
1233
  yield result, operation if block_given?
1217
- return result
1218
1234
  end
1219
1235
  rescue ::Gapic::Rest::Error => e
1220
1236
  raise ::Google::Cloud::Error.from_error(e)
@@ -1294,7 +1310,6 @@ module Google
1294
1310
 
1295
1311
  @developer_connect_stub.fetch_read_token request, options do |result, operation|
1296
1312
  yield result, operation if block_given?
1297
- return result
1298
1313
  end
1299
1314
  rescue ::Gapic::Rest::Error => e
1300
1315
  raise ::Google::Cloud::Error.from_error(e)
@@ -1384,7 +1399,7 @@ module Google
1384
1399
  @developer_connect_stub.fetch_linkable_git_repositories request, options do |result, operation|
1385
1400
  result = ::Gapic::Rest::PagedEnumerable.new @developer_connect_stub, :fetch_linkable_git_repositories, "linkable_git_repositories", request, result, options
1386
1401
  yield result, operation if block_given?
1387
- return result
1402
+ throw :response, result
1388
1403
  end
1389
1404
  rescue ::Gapic::Rest::Error => e
1390
1405
  raise ::Google::Cloud::Error.from_error(e)
@@ -1467,7 +1482,6 @@ module Google
1467
1482
 
1468
1483
  @developer_connect_stub.fetch_git_hub_installations request, options do |result, operation|
1469
1484
  yield result, operation if block_given?
1470
- return result
1471
1485
  end
1472
1486
  rescue ::Gapic::Rest::Error => e
1473
1487
  raise ::Google::Cloud::Error.from_error(e)
@@ -1554,7 +1568,7 @@ module Google
1554
1568
  @developer_connect_stub.fetch_git_refs request, options do |result, operation|
1555
1569
  result = ::Gapic::Rest::PagedEnumerable.new @developer_connect_stub, :fetch_git_refs, "ref_names", request, result, options
1556
1570
  yield result, operation if block_given?
1557
- return result
1571
+ throw :response, result
1558
1572
  end
1559
1573
  rescue ::Gapic::Rest::Error => e
1560
1574
  raise ::Google::Cloud::Error.from_error(e)
@@ -1634,6 +1648,11 @@ module Google
1634
1648
  # default endpoint URL. The default value of nil uses the environment
1635
1649
  # universe (usually the default "googleapis.com" universe).
1636
1650
  # @return [::String,nil]
1651
+ # @!attribute [rw] logger
1652
+ # A custom logger to use for request/response debug logging, or the value
1653
+ # `:default` (the default) to construct a default logger, or `nil` to
1654
+ # explicitly disable logging.
1655
+ # @return [::Logger,:default,nil]
1637
1656
  #
1638
1657
  class Configuration
1639
1658
  extend ::Gapic::Config
@@ -1662,6 +1681,7 @@ module Google
1662
1681
  # by the host service.
1663
1682
  # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}]
1664
1683
  config_attr :bindings_override, {}, ::Hash, nil
1684
+ config_attr :logger, :default, ::Logger, nil, :default
1665
1685
 
1666
1686
  # @private
1667
1687
  def initialize parent_config = nil