google-cloud-build-v1 1.2.0 → 1.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: 848ed0fd961f4766b1cb715a51b17178dc2c227ad121c8b0b1deafa1858762ca
4
- data.tar.gz: bf05bbecb74185c9968c4dccd3b239886ad6fd72278dfffbab774bd81f392db0
3
+ metadata.gz: e76aed5f95be255f4c5299de708ab7f8bafa743341fee9820dcd6147d02babac
4
+ data.tar.gz: bf929fe884f2b65fd3f7af4f2529e0a01b59435c753bc3e761b87356cae6f65f
5
5
  SHA512:
6
- metadata.gz: 167c26175e708b6fe2888880a9be7cb601932aee6625c148e5ac2d93e2f4e12277ec795557e295550584f7455c367aa5c276f2f827bc29c5aee25a44e9c9a0cf
7
- data.tar.gz: 07a709dc0c55886648ca6512e4c2fc668ebdfbb12a81addb1a5b86f99cc1ad1a20047fb6e741207437be314f74eff8e8f0b1bf7f938063b0006b9e960e36279f
6
+ metadata.gz: b2083aebc26902838a7f74f858d681863e53a24542fa4a052585808f1b191b933394b327cae368d5f53b443d7c97e42cfa335d56f4ebf88ce9063778c296ed18
7
+ data.tar.gz: a2f223c96af44851a74387f1c7740c9963815fcbaec5d3447e20329cc20733cf4531096e6e4755d8007616dd3df33b4d54348f2fd3ccf0ccfb947d38257fd079
data/README.md CHANGED
@@ -43,33 +43,43 @@ for class and method documentation.
43
43
  See also the [Product Documentation](https://cloud.google.com/build/docs)
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/build/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::Build::V1::CloudBuild::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).
@@ -224,8 +224,19 @@ module Google
224
224
  universe_domain: @config.universe_domain,
225
225
  channel_args: @config.channel_args,
226
226
  interceptors: @config.interceptors,
227
- channel_pool_config: @config.channel_pool
227
+ channel_pool_config: @config.channel_pool,
228
+ logger: @config.logger
228
229
  )
230
+
231
+ @cloud_build_stub.stub_logger&.info do |entry|
232
+ entry.set_system_name
233
+ entry.set_service
234
+ entry.message = "Created client for #{entry.service}"
235
+ entry.set_credentials_fields credentials
236
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
237
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
238
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
239
+ end
229
240
  end
230
241
 
231
242
  ##
@@ -235,6 +246,15 @@ module Google
235
246
  #
236
247
  attr_reader :operations_client
237
248
 
249
+ ##
250
+ # The logger used for request/response debug logging.
251
+ #
252
+ # @return [Logger]
253
+ #
254
+ def logger
255
+ @cloud_build_stub.logger
256
+ end
257
+
238
258
  # Service calls
239
259
 
240
260
  ##
@@ -337,7 +357,7 @@ module Google
337
357
  @cloud_build_stub.call_rpc :create_build, request, options: options do |response, operation|
338
358
  response = ::Gapic::Operation.new response, @operations_client, options: options
339
359
  yield response, operation if block_given?
340
- return response
360
+ throw :response, response
341
361
  end
342
362
  rescue ::GRPC::BadStatus => e
343
363
  raise ::Google::Cloud::Error.from_error(e)
@@ -434,7 +454,6 @@ module Google
434
454
 
435
455
  @cloud_build_stub.call_rpc :get_build, request, options: options do |response, operation|
436
456
  yield response, operation if block_given?
437
- return response
438
457
  end
439
458
  rescue ::GRPC::BadStatus => e
440
459
  raise ::Google::Cloud::Error.from_error(e)
@@ -548,7 +567,7 @@ module Google
548
567
  @cloud_build_stub.call_rpc :list_builds, request, options: options do |response, operation|
549
568
  response = ::Gapic::PagedEnumerable.new @cloud_build_stub, :list_builds, request, response, operation, options
550
569
  yield response, operation if block_given?
551
- return response
570
+ throw :response, response
552
571
  end
553
572
  rescue ::GRPC::BadStatus => e
554
573
  raise ::Google::Cloud::Error.from_error(e)
@@ -642,7 +661,6 @@ module Google
642
661
 
643
662
  @cloud_build_stub.call_rpc :cancel_build, request, options: options do |response, operation|
644
663
  yield response, operation if block_given?
645
- return response
646
664
  end
647
665
  rescue ::GRPC::BadStatus => e
648
666
  raise ::Google::Cloud::Error.from_error(e)
@@ -770,7 +788,7 @@ module Google
770
788
  @cloud_build_stub.call_rpc :retry_build, request, options: options do |response, operation|
771
789
  response = ::Gapic::Operation.new response, @operations_client, options: options
772
790
  yield response, operation if block_given?
773
- return response
791
+ throw :response, response
774
792
  end
775
793
  rescue ::GRPC::BadStatus => e
776
794
  raise ::Google::Cloud::Error.from_error(e)
@@ -875,7 +893,7 @@ module Google
875
893
  @cloud_build_stub.call_rpc :approve_build, request, options: options do |response, operation|
876
894
  response = ::Gapic::Operation.new response, @operations_client, options: options
877
895
  yield response, operation if block_given?
878
- return response
896
+ throw :response, response
879
897
  end
880
898
  rescue ::GRPC::BadStatus => e
881
899
  raise ::Google::Cloud::Error.from_error(e)
@@ -971,7 +989,6 @@ module Google
971
989
 
972
990
  @cloud_build_stub.call_rpc :create_build_trigger, request, options: options do |response, operation|
973
991
  yield response, operation if block_given?
974
- return response
975
992
  end
976
993
  rescue ::GRPC::BadStatus => e
977
994
  raise ::Google::Cloud::Error.from_error(e)
@@ -1067,7 +1084,6 @@ module Google
1067
1084
 
1068
1085
  @cloud_build_stub.call_rpc :get_build_trigger, request, options: options do |response, operation|
1069
1086
  yield response, operation if block_given?
1070
- return response
1071
1087
  end
1072
1088
  rescue ::GRPC::BadStatus => e
1073
1089
  raise ::Google::Cloud::Error.from_error(e)
@@ -1170,7 +1186,7 @@ module Google
1170
1186
  @cloud_build_stub.call_rpc :list_build_triggers, request, options: options do |response, operation|
1171
1187
  response = ::Gapic::PagedEnumerable.new @cloud_build_stub, :list_build_triggers, request, response, operation, options
1172
1188
  yield response, operation if block_given?
1173
- return response
1189
+ throw :response, response
1174
1190
  end
1175
1191
  rescue ::GRPC::BadStatus => e
1176
1192
  raise ::Google::Cloud::Error.from_error(e)
@@ -1266,7 +1282,6 @@ module Google
1266
1282
 
1267
1283
  @cloud_build_stub.call_rpc :delete_build_trigger, request, options: options do |response, operation|
1268
1284
  yield response, operation if block_given?
1269
- return response
1270
1285
  end
1271
1286
  rescue ::GRPC::BadStatus => e
1272
1287
  raise ::Google::Cloud::Error.from_error(e)
@@ -1365,7 +1380,6 @@ module Google
1365
1380
 
1366
1381
  @cloud_build_stub.call_rpc :update_build_trigger, request, options: options do |response, operation|
1367
1382
  yield response, operation if block_given?
1368
- return response
1369
1383
  end
1370
1384
  rescue ::GRPC::BadStatus => e
1371
1385
  raise ::Google::Cloud::Error.from_error(e)
@@ -1476,7 +1490,7 @@ module Google
1476
1490
  @cloud_build_stub.call_rpc :run_build_trigger, request, options: options do |response, operation|
1477
1491
  response = ::Gapic::Operation.new response, @operations_client, options: options
1478
1492
  yield response, operation if block_given?
1479
- return response
1493
+ throw :response, response
1480
1494
  end
1481
1495
  rescue ::GRPC::BadStatus => e
1482
1496
  raise ::Google::Cloud::Error.from_error(e)
@@ -1575,7 +1589,6 @@ module Google
1575
1589
 
1576
1590
  @cloud_build_stub.call_rpc :receive_trigger_webhook, request, options: options do |response, operation|
1577
1591
  yield response, operation if block_given?
1578
- return response
1579
1592
  end
1580
1593
  rescue ::GRPC::BadStatus => e
1581
1594
  raise ::Google::Cloud::Error.from_error(e)
@@ -1684,7 +1697,7 @@ module Google
1684
1697
  @cloud_build_stub.call_rpc :create_worker_pool, request, options: options do |response, operation|
1685
1698
  response = ::Gapic::Operation.new response, @operations_client, options: options
1686
1699
  yield response, operation if block_given?
1687
- return response
1700
+ throw :response, response
1688
1701
  end
1689
1702
  rescue ::GRPC::BadStatus => e
1690
1703
  raise ::Google::Cloud::Error.from_error(e)
@@ -1774,7 +1787,6 @@ module Google
1774
1787
 
1775
1788
  @cloud_build_stub.call_rpc :get_worker_pool, request, options: options do |response, operation|
1776
1789
  yield response, operation if block_given?
1777
- return response
1778
1790
  end
1779
1791
  rescue ::GRPC::BadStatus => e
1780
1792
  raise ::Google::Cloud::Error.from_error(e)
@@ -1882,7 +1894,7 @@ module Google
1882
1894
  @cloud_build_stub.call_rpc :delete_worker_pool, request, options: options do |response, operation|
1883
1895
  response = ::Gapic::Operation.new response, @operations_client, options: options
1884
1896
  yield response, operation if block_given?
1885
- return response
1897
+ throw :response, response
1886
1898
  end
1887
1899
  rescue ::GRPC::BadStatus => e
1888
1900
  raise ::Google::Cloud::Error.from_error(e)
@@ -1987,7 +1999,7 @@ module Google
1987
1999
  @cloud_build_stub.call_rpc :update_worker_pool, request, options: options do |response, operation|
1988
2000
  response = ::Gapic::Operation.new response, @operations_client, options: options
1989
2001
  yield response, operation if block_given?
1990
- return response
2002
+ throw :response, response
1991
2003
  end
1992
2004
  rescue ::GRPC::BadStatus => e
1993
2005
  raise ::Google::Cloud::Error.from_error(e)
@@ -2088,7 +2100,7 @@ module Google
2088
2100
  @cloud_build_stub.call_rpc :list_worker_pools, request, options: options do |response, operation|
2089
2101
  response = ::Gapic::PagedEnumerable.new @cloud_build_stub, :list_worker_pools, request, response, operation, options
2090
2102
  yield response, operation if block_given?
2091
- return response
2103
+ throw :response, response
2092
2104
  end
2093
2105
  rescue ::GRPC::BadStatus => e
2094
2106
  raise ::Google::Cloud::Error.from_error(e)
@@ -2177,6 +2189,11 @@ module Google
2177
2189
  # default endpoint URL. The default value of nil uses the environment
2178
2190
  # universe (usually the default "googleapis.com" universe).
2179
2191
  # @return [::String,nil]
2192
+ # @!attribute [rw] logger
2193
+ # A custom logger to use for request/response debug logging, or the value
2194
+ # `:default` (the default) to construct a default logger, or `nil` to
2195
+ # explicitly disable logging.
2196
+ # @return [::Logger,:default,nil]
2180
2197
  #
2181
2198
  class Configuration
2182
2199
  extend ::Gapic::Config
@@ -2201,6 +2218,7 @@ module Google
2201
2218
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
2202
2219
  config_attr :quota_project, nil, ::String, nil
2203
2220
  config_attr :universe_domain, nil, ::String, nil
2221
+ config_attr :logger, :default, ::Logger, nil, :default
2204
2222
 
2205
2223
  # @private
2206
2224
  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
@@ -217,8 +217,19 @@ module Google
217
217
  endpoint: @config.endpoint,
218
218
  endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
219
219
  universe_domain: @config.universe_domain,
220
- credentials: credentials
220
+ credentials: credentials,
221
+ logger: @config.logger
221
222
  )
223
+
224
+ @cloud_build_stub.logger(stub: true)&.info do |entry|
225
+ entry.set_system_name
226
+ entry.set_service
227
+ entry.message = "Created client for #{entry.service}"
228
+ entry.set_credentials_fields credentials
229
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
230
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
231
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
232
+ end
222
233
  end
223
234
 
224
235
  ##
@@ -228,6 +239,15 @@ module Google
228
239
  #
229
240
  attr_reader :operations_client
230
241
 
242
+ ##
243
+ # The logger used for request/response debug logging.
244
+ #
245
+ # @return [Logger]
246
+ #
247
+ def logger
248
+ @cloud_build_stub.logger
249
+ end
250
+
231
251
  # Service calls
232
252
 
233
253
  ##
@@ -320,7 +340,7 @@ module Google
320
340
  @cloud_build_stub.create_build request, options do |result, operation|
321
341
  result = ::Gapic::Operation.new result, @operations_client, options: options
322
342
  yield result, operation if block_given?
323
- return result
343
+ throw :response, result
324
344
  end
325
345
  rescue ::Gapic::Rest::Error => e
326
346
  raise ::Google::Cloud::Error.from_error(e)
@@ -407,7 +427,6 @@ module Google
407
427
 
408
428
  @cloud_build_stub.get_build request, options do |result, operation|
409
429
  yield result, operation if block_given?
410
- return result
411
430
  end
412
431
  rescue ::Gapic::Rest::Error => e
413
432
  raise ::Google::Cloud::Error.from_error(e)
@@ -511,7 +530,7 @@ module Google
511
530
  @cloud_build_stub.list_builds request, options do |result, operation|
512
531
  result = ::Gapic::Rest::PagedEnumerable.new @cloud_build_stub, :list_builds, "builds", request, result, options
513
532
  yield result, operation if block_given?
514
- return result
533
+ throw :response, result
515
534
  end
516
535
  rescue ::Gapic::Rest::Error => e
517
536
  raise ::Google::Cloud::Error.from_error(e)
@@ -595,7 +614,6 @@ module Google
595
614
 
596
615
  @cloud_build_stub.cancel_build request, options do |result, operation|
597
616
  yield result, operation if block_given?
598
- return result
599
617
  end
600
618
  rescue ::Gapic::Rest::Error => e
601
619
  raise ::Google::Cloud::Error.from_error(e)
@@ -713,7 +731,7 @@ module Google
713
731
  @cloud_build_stub.retry_build request, options do |result, operation|
714
732
  result = ::Gapic::Operation.new result, @operations_client, options: options
715
733
  yield result, operation if block_given?
716
- return result
734
+ throw :response, result
717
735
  end
718
736
  rescue ::Gapic::Rest::Error => e
719
737
  raise ::Google::Cloud::Error.from_error(e)
@@ -808,7 +826,7 @@ module Google
808
826
  @cloud_build_stub.approve_build request, options do |result, operation|
809
827
  result = ::Gapic::Operation.new result, @operations_client, options: options
810
828
  yield result, operation if block_given?
811
- return result
829
+ throw :response, result
812
830
  end
813
831
  rescue ::Gapic::Rest::Error => e
814
832
  raise ::Google::Cloud::Error.from_error(e)
@@ -894,7 +912,6 @@ module Google
894
912
 
895
913
  @cloud_build_stub.create_build_trigger request, options do |result, operation|
896
914
  yield result, operation if block_given?
897
- return result
898
915
  end
899
916
  rescue ::Gapic::Rest::Error => e
900
917
  raise ::Google::Cloud::Error.from_error(e)
@@ -980,7 +997,6 @@ module Google
980
997
 
981
998
  @cloud_build_stub.get_build_trigger request, options do |result, operation|
982
999
  yield result, operation if block_given?
983
- return result
984
1000
  end
985
1001
  rescue ::Gapic::Rest::Error => e
986
1002
  raise ::Google::Cloud::Error.from_error(e)
@@ -1073,7 +1089,7 @@ module Google
1073
1089
  @cloud_build_stub.list_build_triggers request, options do |result, operation|
1074
1090
  result = ::Gapic::Rest::PagedEnumerable.new @cloud_build_stub, :list_build_triggers, "triggers", request, result, options
1075
1091
  yield result, operation if block_given?
1076
- return result
1092
+ throw :response, result
1077
1093
  end
1078
1094
  rescue ::Gapic::Rest::Error => e
1079
1095
  raise ::Google::Cloud::Error.from_error(e)
@@ -1159,7 +1175,6 @@ module Google
1159
1175
 
1160
1176
  @cloud_build_stub.delete_build_trigger request, options do |result, operation|
1161
1177
  yield result, operation if block_given?
1162
- return result
1163
1178
  end
1164
1179
  rescue ::Gapic::Rest::Error => e
1165
1180
  raise ::Google::Cloud::Error.from_error(e)
@@ -1248,7 +1263,6 @@ module Google
1248
1263
 
1249
1264
  @cloud_build_stub.update_build_trigger request, options do |result, operation|
1250
1265
  yield result, operation if block_given?
1251
- return result
1252
1266
  end
1253
1267
  rescue ::Gapic::Rest::Error => e
1254
1268
  raise ::Google::Cloud::Error.from_error(e)
@@ -1349,7 +1363,7 @@ module Google
1349
1363
  @cloud_build_stub.run_build_trigger request, options do |result, operation|
1350
1364
  result = ::Gapic::Operation.new result, @operations_client, options: options
1351
1365
  yield result, operation if block_given?
1352
- return result
1366
+ throw :response, result
1353
1367
  end
1354
1368
  rescue ::Gapic::Rest::Error => e
1355
1369
  raise ::Google::Cloud::Error.from_error(e)
@@ -1438,7 +1452,6 @@ module Google
1438
1452
 
1439
1453
  @cloud_build_stub.receive_trigger_webhook request, options do |result, operation|
1440
1454
  yield result, operation if block_given?
1441
- return result
1442
1455
  end
1443
1456
  rescue ::Gapic::Rest::Error => e
1444
1457
  raise ::Google::Cloud::Error.from_error(e)
@@ -1537,7 +1550,7 @@ module Google
1537
1550
  @cloud_build_stub.create_worker_pool request, options do |result, operation|
1538
1551
  result = ::Gapic::Operation.new result, @operations_client, options: options
1539
1552
  yield result, operation if block_given?
1540
- return result
1553
+ throw :response, result
1541
1554
  end
1542
1555
  rescue ::Gapic::Rest::Error => e
1543
1556
  raise ::Google::Cloud::Error.from_error(e)
@@ -1617,7 +1630,6 @@ module Google
1617
1630
 
1618
1631
  @cloud_build_stub.get_worker_pool request, options do |result, operation|
1619
1632
  yield result, operation if block_given?
1620
- return result
1621
1633
  end
1622
1634
  rescue ::Gapic::Rest::Error => e
1623
1635
  raise ::Google::Cloud::Error.from_error(e)
@@ -1715,7 +1727,7 @@ module Google
1715
1727
  @cloud_build_stub.delete_worker_pool request, options do |result, operation|
1716
1728
  result = ::Gapic::Operation.new result, @operations_client, options: options
1717
1729
  yield result, operation if block_given?
1718
- return result
1730
+ throw :response, result
1719
1731
  end
1720
1732
  rescue ::Gapic::Rest::Error => e
1721
1733
  raise ::Google::Cloud::Error.from_error(e)
@@ -1810,7 +1822,7 @@ module Google
1810
1822
  @cloud_build_stub.update_worker_pool request, options do |result, operation|
1811
1823
  result = ::Gapic::Operation.new result, @operations_client, options: options
1812
1824
  yield result, operation if block_given?
1813
- return result
1825
+ throw :response, result
1814
1826
  end
1815
1827
  rescue ::Gapic::Rest::Error => e
1816
1828
  raise ::Google::Cloud::Error.from_error(e)
@@ -1901,7 +1913,7 @@ module Google
1901
1913
  @cloud_build_stub.list_worker_pools request, options do |result, operation|
1902
1914
  result = ::Gapic::Rest::PagedEnumerable.new @cloud_build_stub, :list_worker_pools, "worker_pools", request, result, options
1903
1915
  yield result, operation if block_given?
1904
- return result
1916
+ throw :response, result
1905
1917
  end
1906
1918
  rescue ::Gapic::Rest::Error => e
1907
1919
  raise ::Google::Cloud::Error.from_error(e)
@@ -1981,6 +1993,11 @@ module Google
1981
1993
  # default endpoint URL. The default value of nil uses the environment
1982
1994
  # universe (usually the default "googleapis.com" universe).
1983
1995
  # @return [::String,nil]
1996
+ # @!attribute [rw] logger
1997
+ # A custom logger to use for request/response debug logging, or the value
1998
+ # `:default` (the default) to construct a default logger, or `nil` to
1999
+ # explicitly disable logging.
2000
+ # @return [::Logger,:default,nil]
1984
2001
  #
1985
2002
  class Configuration
1986
2003
  extend ::Gapic::Config
@@ -2002,6 +2019,7 @@ module Google
2002
2019
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
2003
2020
  config_attr :quota_project, nil, ::String, nil
2004
2021
  config_attr :universe_domain, nil, ::String, nil
2022
+ config_attr :logger, :default, ::Logger, nil, :default
2005
2023
 
2006
2024
  # @private
2007
2025
  def initialize parent_config = nil