google-cloud-developer_connect-v1 0.2.0 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a053f4132c1e55aaa41fa087230c22349ee03f0d50ba0ef9cdfe1a2c1cd35c5e
4
- data.tar.gz: 201c2db9e6f24446314b92c84b206cddf9182a342f1f7858000fdc7020794cbf
3
+ metadata.gz: c075ad4682f2209586877844b8406f8dcb244e46612d89379af497404dea9a67
4
+ data.tar.gz: d863836aab7f83c73539ca0ddcf7a80ce1bafe3f8a916f112f3d0ea8bc658fbf
5
5
  SHA512:
6
- metadata.gz: 9a45f732f6bd69813bedde016c691ce27d9456d43d45591fc78251768dd9b7cf2b10620174367f1b6306a6df926680809d46dc08855c0c6ef172198d0800daba
7
- data.tar.gz: 805a301e8724b035cc2036abc29092f73eba97716a36339eb484fa66d9de89895d39e94c6f08834d163f47f11d559639aa7059954001793987f2df60be1e31e3
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
@@ -213,7 +213,7 @@ module Google
213
213
  wrap_lro_operation = ->(op_response) { ::Gapic::Operation.new op_response, @operations_client }
214
214
  response = ::Gapic::PagedEnumerable.new @operations_stub, :list_operations, request, response, operation, options, format_resource: wrap_lro_operation
215
215
  yield response, operation if block_given?
216
- return response
216
+ throw :response, response
217
217
  end
218
218
  rescue ::GRPC::BadStatus => e
219
219
  raise ::Google::Cloud::Error.from_error(e)
@@ -309,7 +309,7 @@ module Google
309
309
  @operations_stub.call_rpc :get_operation, request, options: options do |response, operation|
310
310
  response = ::Gapic::Operation.new response, @operations_client, options: options
311
311
  yield response, operation if block_given?
312
- return response
312
+ throw :response, response
313
313
  end
314
314
  rescue ::GRPC::BadStatus => e
315
315
  raise ::Google::Cloud::Error.from_error(e)
@@ -398,7 +398,6 @@ module Google
398
398
 
399
399
  @operations_stub.call_rpc :delete_operation, request, options: options do |response, operation|
400
400
  yield response, operation if block_given?
401
- return response
402
401
  end
403
402
  rescue ::GRPC::BadStatus => e
404
403
  raise ::Google::Cloud::Error.from_error(e)
@@ -494,7 +493,6 @@ module Google
494
493
 
495
494
  @operations_stub.call_rpc :cancel_operation, request, options: options do |response, operation|
496
495
  yield response, operation if block_given?
497
- return response
498
496
  end
499
497
  rescue ::GRPC::BadStatus => e
500
498
  raise ::Google::Cloud::Error.from_error(e)
@@ -592,7 +590,7 @@ module Google
592
590
  @operations_stub.call_rpc :wait_operation, request, options: options do |response, operation|
593
591
  response = ::Gapic::Operation.new response, @operations_client, options: options
594
592
  yield response, operation if block_given?
595
- return response
593
+ throw :response, response
596
594
  end
597
595
  rescue ::GRPC::BadStatus => e
598
596
  raise ::Google::Cloud::Error.from_error(e)
@@ -681,6 +679,11 @@ module Google
681
679
  # default endpoint URL. The default value of nil uses the environment
682
680
  # universe (usually the default "googleapis.com" universe).
683
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]
684
687
  #
685
688
  class Configuration
686
689
  extend ::Gapic::Config
@@ -705,6 +708,7 @@ module Google
705
708
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
706
709
  config_attr :quota_project, nil, ::String, nil
707
710
  config_attr :universe_domain, nil, ::String, nil
711
+ config_attr :logger, :default, ::Logger, nil, :default
708
712
 
709
713
  # @private
710
714
  def initialize parent_config = nil
@@ -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
@@ -196,7 +196,7 @@ module Google
196
196
  @operations_stub.list_operations request, options do |result, operation|
197
197
  result = ::Gapic::Rest::PagedEnumerable.new @operations_stub, :list_operations, "operations", request, result, options
198
198
  yield result, operation if block_given?
199
- return result
199
+ throw :response, result
200
200
  end
201
201
  rescue ::Gapic::Rest::Error => e
202
202
  raise ::Google::Cloud::Error.from_error(e)
@@ -285,7 +285,7 @@ module Google
285
285
  @operations_stub.get_operation request, options do |result, operation|
286
286
  result = ::Gapic::Operation.new result, @operations_client, options: options
287
287
  yield result, operation if block_given?
288
- return result
288
+ throw :response, result
289
289
  end
290
290
  rescue ::Gapic::Rest::Error => e
291
291
  raise ::Google::Cloud::Error.from_error(e)
@@ -367,7 +367,6 @@ module Google
367
367
 
368
368
  @operations_stub.delete_operation request, options do |result, operation|
369
369
  yield result, operation if block_given?
370
- return result
371
370
  end
372
371
  rescue ::Gapic::Rest::Error => e
373
372
  raise ::Google::Cloud::Error.from_error(e)
@@ -456,7 +455,6 @@ module Google
456
455
 
457
456
  @operations_stub.cancel_operation request, options do |result, operation|
458
457
  yield result, operation if block_given?
459
- return result
460
458
  end
461
459
  rescue ::Gapic::Rest::Error => e
462
460
  raise ::Google::Cloud::Error.from_error(e)
@@ -536,6 +534,11 @@ module Google
536
534
  # default endpoint URL. The default value of nil uses the environment
537
535
  # universe (usually the default "googleapis.com" universe).
538
536
  # @return [::String,nil]
537
+ # @!attribute [rw] logger
538
+ # A custom logger to use for request/response debug logging, or the value
539
+ # `:default` (the default) to construct a default logger, or `nil` to
540
+ # explicitly disable logging.
541
+ # @return [::Logger,:default,nil]
539
542
  #
540
543
  class Configuration
541
544
  extend ::Gapic::Config
@@ -557,6 +560,7 @@ module Google
557
560
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
558
561
  config_attr :quota_project, nil, ::String, nil
559
562
  config_attr :universe_domain, nil, ::String, nil
563
+ config_attr :logger, :default, ::Logger, nil, :default
560
564
 
561
565
  # @private
562
566
  def initialize parent_config = nil
@@ -676,16 +680,18 @@ module Google
676
680
 
677
681
  response = @client_stub.make_http_request(
678
682
  verb,
679
- uri: uri,
680
- body: body || "",
681
- params: query_string_params,
683
+ uri: uri,
684
+ body: body || "",
685
+ params: query_string_params,
686
+ method_name: "list_operations",
682
687
  options: options
683
688
  )
684
689
  operation = ::Gapic::Rest::TransportOperation.new response
685
690
  result = ::Google::Longrunning::ListOperationsResponse.decode_json response.body, ignore_unknown_fields: true
686
-
687
- yield result, operation if block_given?
688
- result
691
+ catch :response do
692
+ yield result, operation if block_given?
693
+ result
694
+ end
689
695
  end
690
696
 
691
697
  ##
@@ -714,16 +720,18 @@ module Google
714
720
 
715
721
  response = @client_stub.make_http_request(
716
722
  verb,
717
- uri: uri,
718
- body: body || "",
719
- params: query_string_params,
723
+ uri: uri,
724
+ body: body || "",
725
+ params: query_string_params,
726
+ method_name: "get_operation",
720
727
  options: options
721
728
  )
722
729
  operation = ::Gapic::Rest::TransportOperation.new response
723
730
  result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true
724
-
725
- yield result, operation if block_given?
726
- result
731
+ catch :response do
732
+ yield result, operation if block_given?
733
+ result
734
+ end
727
735
  end
728
736
 
729
737
  ##
@@ -752,16 +760,18 @@ module Google
752
760
 
753
761
  response = @client_stub.make_http_request(
754
762
  verb,
755
- uri: uri,
756
- body: body || "",
757
- params: query_string_params,
763
+ uri: uri,
764
+ body: body || "",
765
+ params: query_string_params,
766
+ method_name: "delete_operation",
758
767
  options: options
759
768
  )
760
769
  operation = ::Gapic::Rest::TransportOperation.new response
761
770
  result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true
762
-
763
- yield result, operation if block_given?
764
- result
771
+ catch :response do
772
+ yield result, operation if block_given?
773
+ result
774
+ end
765
775
  end
766
776
 
767
777
  ##
@@ -790,16 +800,18 @@ module Google
790
800
 
791
801
  response = @client_stub.make_http_request(
792
802
  verb,
793
- uri: uri,
794
- body: body || "",
795
- params: query_string_params,
803
+ uri: uri,
804
+ body: body || "",
805
+ params: query_string_params,
806
+ method_name: "cancel_operation",
796
807
  options: options
797
808
  )
798
809
  operation = ::Gapic::Rest::TransportOperation.new response
799
810
  result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true
800
-
801
- yield result, operation if block_given?
802
- result
811
+ catch :response do
812
+ yield result, operation if block_given?
813
+ result
814
+ end
803
815
  end
804
816
 
805
817
  ##
@@ -30,7 +30,8 @@ module Google
30
30
  # including transcoding, making the REST call, and deserialing the response.
31
31
  #
32
32
  class ServiceStub
33
- def initialize endpoint:, endpoint_template:, universe_domain:, credentials:
33
+ # @private
34
+ def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger:
34
35
  # These require statements are intentionally placed here to initialize
35
36
  # the REST modules only when it's required.
36
37
  require "gapic/rest"
@@ -40,7 +41,9 @@ module Google
40
41
  universe_domain: universe_domain,
41
42
  credentials: credentials,
42
43
  numeric_enums: true,
43
- raise_faraday_errors: false
44
+ service_name: self.class,
45
+ raise_faraday_errors: false,
46
+ logger: logger
44
47
  end
45
48
 
46
49
  ##
@@ -61,6 +64,15 @@ module Google
61
64
  @client_stub.endpoint
62
65
  end
63
66
 
67
+ ##
68
+ # The logger used for request/response debug logging.
69
+ #
70
+ # @return [Logger]
71
+ #
72
+ def logger stub: false
73
+ stub ? @client_stub.stub_logger : @client_stub.logger
74
+ end
75
+
64
76
  ##
65
77
  # Baseline implementation for the list_connections REST call
66
78
  #
@@ -87,16 +99,18 @@ module Google
87
99
 
88
100
  response = @client_stub.make_http_request(
89
101
  verb,
90
- uri: uri,
91
- body: body || "",
92
- params: query_string_params,
102
+ uri: uri,
103
+ body: body || "",
104
+ params: query_string_params,
105
+ method_name: "list_connections",
93
106
  options: options
94
107
  )
95
108
  operation = ::Gapic::Rest::TransportOperation.new response
96
109
  result = ::Google::Cloud::DeveloperConnect::V1::ListConnectionsResponse.decode_json response.body, ignore_unknown_fields: true
97
-
98
- yield result, operation if block_given?
99
- result
110
+ catch :response do
111
+ yield result, operation if block_given?
112
+ result
113
+ end
100
114
  end
101
115
 
102
116
  ##
@@ -125,16 +139,18 @@ module Google
125
139
 
126
140
  response = @client_stub.make_http_request(
127
141
  verb,
128
- uri: uri,
129
- body: body || "",
130
- params: query_string_params,
142
+ uri: uri,
143
+ body: body || "",
144
+ params: query_string_params,
145
+ method_name: "get_connection",
131
146
  options: options
132
147
  )
133
148
  operation = ::Gapic::Rest::TransportOperation.new response
134
149
  result = ::Google::Cloud::DeveloperConnect::V1::Connection.decode_json response.body, ignore_unknown_fields: true
135
-
136
- yield result, operation if block_given?
137
- result
150
+ catch :response do
151
+ yield result, operation if block_given?
152
+ result
153
+ end
138
154
  end
139
155
 
140
156
  ##
@@ -163,16 +179,18 @@ module Google
163
179
 
164
180
  response = @client_stub.make_http_request(
165
181
  verb,
166
- uri: uri,
167
- body: body || "",
168
- params: query_string_params,
182
+ uri: uri,
183
+ body: body || "",
184
+ params: query_string_params,
185
+ method_name: "create_connection",
169
186
  options: options
170
187
  )
171
188
  operation = ::Gapic::Rest::TransportOperation.new response
172
189
  result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true
173
-
174
- yield result, operation if block_given?
175
- result
190
+ catch :response do
191
+ yield result, operation if block_given?
192
+ result
193
+ end
176
194
  end
177
195
 
178
196
  ##
@@ -201,16 +219,18 @@ module Google
201
219
 
202
220
  response = @client_stub.make_http_request(
203
221
  verb,
204
- uri: uri,
205
- body: body || "",
206
- params: query_string_params,
222
+ uri: uri,
223
+ body: body || "",
224
+ params: query_string_params,
225
+ method_name: "update_connection",
207
226
  options: options
208
227
  )
209
228
  operation = ::Gapic::Rest::TransportOperation.new response
210
229
  result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true
211
-
212
- yield result, operation if block_given?
213
- result
230
+ catch :response do
231
+ yield result, operation if block_given?
232
+ result
233
+ end
214
234
  end
215
235
 
216
236
  ##
@@ -239,16 +259,18 @@ module Google
239
259
 
240
260
  response = @client_stub.make_http_request(
241
261
  verb,
242
- uri: uri,
243
- body: body || "",
244
- params: query_string_params,
262
+ uri: uri,
263
+ body: body || "",
264
+ params: query_string_params,
265
+ method_name: "delete_connection",
245
266
  options: options
246
267
  )
247
268
  operation = ::Gapic::Rest::TransportOperation.new response
248
269
  result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true
249
-
250
- yield result, operation if block_given?
251
- result
270
+ catch :response do
271
+ yield result, operation if block_given?
272
+ result
273
+ end
252
274
  end
253
275
 
254
276
  ##
@@ -277,16 +299,18 @@ module Google
277
299
 
278
300
  response = @client_stub.make_http_request(
279
301
  verb,
280
- uri: uri,
281
- body: body || "",
282
- params: query_string_params,
302
+ uri: uri,
303
+ body: body || "",
304
+ params: query_string_params,
305
+ method_name: "create_git_repository_link",
283
306
  options: options
284
307
  )
285
308
  operation = ::Gapic::Rest::TransportOperation.new response
286
309
  result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true
287
-
288
- yield result, operation if block_given?
289
- result
310
+ catch :response do
311
+ yield result, operation if block_given?
312
+ result
313
+ end
290
314
  end
291
315
 
292
316
  ##
@@ -315,16 +339,18 @@ module Google
315
339
 
316
340
  response = @client_stub.make_http_request(
317
341
  verb,
318
- uri: uri,
319
- body: body || "",
320
- params: query_string_params,
342
+ uri: uri,
343
+ body: body || "",
344
+ params: query_string_params,
345
+ method_name: "delete_git_repository_link",
321
346
  options: options
322
347
  )
323
348
  operation = ::Gapic::Rest::TransportOperation.new response
324
349
  result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true
325
-
326
- yield result, operation if block_given?
327
- result
350
+ catch :response do
351
+ yield result, operation if block_given?
352
+ result
353
+ end
328
354
  end
329
355
 
330
356
  ##
@@ -353,16 +379,18 @@ module Google
353
379
 
354
380
  response = @client_stub.make_http_request(
355
381
  verb,
356
- uri: uri,
357
- body: body || "",
358
- params: query_string_params,
382
+ uri: uri,
383
+ body: body || "",
384
+ params: query_string_params,
385
+ method_name: "list_git_repository_links",
359
386
  options: options
360
387
  )
361
388
  operation = ::Gapic::Rest::TransportOperation.new response
362
389
  result = ::Google::Cloud::DeveloperConnect::V1::ListGitRepositoryLinksResponse.decode_json response.body, ignore_unknown_fields: true
363
-
364
- yield result, operation if block_given?
365
- result
390
+ catch :response do
391
+ yield result, operation if block_given?
392
+ result
393
+ end
366
394
  end
367
395
 
368
396
  ##
@@ -391,16 +419,18 @@ module Google
391
419
 
392
420
  response = @client_stub.make_http_request(
393
421
  verb,
394
- uri: uri,
395
- body: body || "",
396
- params: query_string_params,
422
+ uri: uri,
423
+ body: body || "",
424
+ params: query_string_params,
425
+ method_name: "get_git_repository_link",
397
426
  options: options
398
427
  )
399
428
  operation = ::Gapic::Rest::TransportOperation.new response
400
429
  result = ::Google::Cloud::DeveloperConnect::V1::GitRepositoryLink.decode_json response.body, ignore_unknown_fields: true
401
-
402
- yield result, operation if block_given?
403
- result
430
+ catch :response do
431
+ yield result, operation if block_given?
432
+ result
433
+ end
404
434
  end
405
435
 
406
436
  ##
@@ -429,16 +459,18 @@ module Google
429
459
 
430
460
  response = @client_stub.make_http_request(
431
461
  verb,
432
- uri: uri,
433
- body: body || "",
434
- params: query_string_params,
462
+ uri: uri,
463
+ body: body || "",
464
+ params: query_string_params,
465
+ method_name: "fetch_read_write_token",
435
466
  options: options
436
467
  )
437
468
  operation = ::Gapic::Rest::TransportOperation.new response
438
469
  result = ::Google::Cloud::DeveloperConnect::V1::FetchReadWriteTokenResponse.decode_json response.body, ignore_unknown_fields: true
439
-
440
- yield result, operation if block_given?
441
- result
470
+ catch :response do
471
+ yield result, operation if block_given?
472
+ result
473
+ end
442
474
  end
443
475
 
444
476
  ##
@@ -467,16 +499,18 @@ module Google
467
499
 
468
500
  response = @client_stub.make_http_request(
469
501
  verb,
470
- uri: uri,
471
- body: body || "",
472
- params: query_string_params,
502
+ uri: uri,
503
+ body: body || "",
504
+ params: query_string_params,
505
+ method_name: "fetch_read_token",
473
506
  options: options
474
507
  )
475
508
  operation = ::Gapic::Rest::TransportOperation.new response
476
509
  result = ::Google::Cloud::DeveloperConnect::V1::FetchReadTokenResponse.decode_json response.body, ignore_unknown_fields: true
477
-
478
- yield result, operation if block_given?
479
- result
510
+ catch :response do
511
+ yield result, operation if block_given?
512
+ result
513
+ end
480
514
  end
481
515
 
482
516
  ##
@@ -505,16 +539,18 @@ module Google
505
539
 
506
540
  response = @client_stub.make_http_request(
507
541
  verb,
508
- uri: uri,
509
- body: body || "",
510
- params: query_string_params,
542
+ uri: uri,
543
+ body: body || "",
544
+ params: query_string_params,
545
+ method_name: "fetch_linkable_git_repositories",
511
546
  options: options
512
547
  )
513
548
  operation = ::Gapic::Rest::TransportOperation.new response
514
549
  result = ::Google::Cloud::DeveloperConnect::V1::FetchLinkableGitRepositoriesResponse.decode_json response.body, ignore_unknown_fields: true
515
-
516
- yield result, operation if block_given?
517
- result
550
+ catch :response do
551
+ yield result, operation if block_given?
552
+ result
553
+ end
518
554
  end
519
555
 
520
556
  ##
@@ -543,16 +579,18 @@ module Google
543
579
 
544
580
  response = @client_stub.make_http_request(
545
581
  verb,
546
- uri: uri,
547
- body: body || "",
548
- params: query_string_params,
582
+ uri: uri,
583
+ body: body || "",
584
+ params: query_string_params,
585
+ method_name: "fetch_git_hub_installations",
549
586
  options: options
550
587
  )
551
588
  operation = ::Gapic::Rest::TransportOperation.new response
552
589
  result = ::Google::Cloud::DeveloperConnect::V1::FetchGitHubInstallationsResponse.decode_json response.body, ignore_unknown_fields: true
553
-
554
- yield result, operation if block_given?
555
- result
590
+ catch :response do
591
+ yield result, operation if block_given?
592
+ result
593
+ end
556
594
  end
557
595
 
558
596
  ##
@@ -581,16 +619,18 @@ module Google
581
619
 
582
620
  response = @client_stub.make_http_request(
583
621
  verb,
584
- uri: uri,
585
- body: body || "",
586
- params: query_string_params,
622
+ uri: uri,
623
+ body: body || "",
624
+ params: query_string_params,
625
+ method_name: "fetch_git_refs",
587
626
  options: options
588
627
  )
589
628
  operation = ::Gapic::Rest::TransportOperation.new response
590
629
  result = ::Google::Cloud::DeveloperConnect::V1::FetchGitRefsResponse.decode_json response.body, ignore_unknown_fields: true
591
-
592
- yield result, operation if block_given?
593
- result
630
+ catch :response do
631
+ yield result, operation if block_given?
632
+ result
633
+ end
594
634
  end
595
635
 
596
636
  ##
@@ -21,7 +21,7 @@ module Google
21
21
  module Cloud
22
22
  module DeveloperConnect
23
23
  module V1
24
- VERSION = "0.2.0"
24
+ VERSION = "0.3.0"
25
25
  end
26
26
  end
27
27
  end
@@ -306,9 +306,28 @@ module Google
306
306
  # @!attribute [rw] common
307
307
  # @return [::Google::Api::CommonLanguageSettings]
308
308
  # Some settings.
309
+ # @!attribute [rw] renamed_services
310
+ # @return [::Google::Protobuf::Map{::String => ::String}]
311
+ # Map of service names to renamed services. Keys are the package relative
312
+ # service names and values are the name to be used for the service client
313
+ # and call options.
314
+ #
315
+ # publishing:
316
+ # go_settings:
317
+ # renamed_services:
318
+ # Publisher: TopicAdmin
309
319
  class GoSettings
310
320
  include ::Google::Protobuf::MessageExts
311
321
  extend ::Google::Protobuf::MessageExts::ClassMethods
322
+
323
+ # @!attribute [rw] key
324
+ # @return [::String]
325
+ # @!attribute [rw] value
326
+ # @return [::String]
327
+ class RenamedServicesEntry
328
+ include ::Google::Protobuf::MessageExts
329
+ extend ::Google::Protobuf::MessageExts::ClassMethods
330
+ end
312
331
  end
313
332
 
314
333
  # Describes the generator configuration for a method.
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google-cloud-developer_connect-v1
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Google LLC
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-12-04 00:00:00.000000000 Z
11
+ date: 2024-12-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gapic-common
@@ -16,7 +16,7 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: 0.21.1
19
+ version: 0.24.0
20
20
  - - "<"
21
21
  - !ruby/object:Gem::Version
22
22
  version: 2.a
@@ -26,7 +26,7 @@ dependencies:
26
26
  requirements:
27
27
  - - ">="
28
28
  - !ruby/object:Gem::Version
29
- version: 0.21.1
29
+ version: 0.24.0
30
30
  - - "<"
31
31
  - !ruby/object:Gem::Version
32
32
  version: 2.a
@@ -127,7 +127,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
127
127
  - !ruby/object:Gem::Version
128
128
  version: '0'
129
129
  requirements: []
130
- rubygems_version: 3.5.22
130
+ rubygems_version: 3.5.23
131
131
  signing_key:
132
132
  specification_version: 4
133
133
  summary: Connect third-party source code management to Google.