google-cloud-security_center-v2 0.4.1 → 0.5.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: c9be62dfe061d4dce319ba199686956add51390cb806f25efbf2dbbcc8e9f4fa
4
- data.tar.gz: 7d061959bf3fb5228fac20d00cbde1630162c042edc565dca2349f7cc8af32de
3
+ metadata.gz: 3a115417aff870cad3b24e41abfb92c7f4f02a727f600452b88b4b9ccf4fe3c4
4
+ data.tar.gz: fe64881d43745704ebcbde182cff312f6dade0ee7a6fc803fa69e2654ff45eb9
5
5
  SHA512:
6
- metadata.gz: dfd27f57bc95defebf853d1aa62adaead8096bb754c4d433f25603b365949d3219c7a3282954533f5a84aaf3553acc6929ceca4b9a4f5fd42eebb13c5e00f3b7
7
- data.tar.gz: d3ac9d3eccaa76dd2c1bbb7a94f15c5bbe6b910fac644aa9b6e18b9fa70f9672eceeade8ef88802e2464eac06625e9e84f6f183ece85ab865a65fbada04372f4
6
+ metadata.gz: 1967baa8c7e49337a2caba730492d348aa911651732adeeacb62a9177ffd7621b601ddece74863c4750f626b815d6d67913e75b4cfdb76ea967bdaf9be83ade0
7
+ data.tar.gz: 4462280cf7ea1c27511baf82f99eb3955ec0ff7b298694f361904fd694ec23f48a948674690c6f3cd5ba8fb59042da381e93dcbe66e7cc58372c6c46c3644cb6
data/README.md CHANGED
@@ -43,33 +43,43 @@ for class and method documentation.
43
43
  See also the [Product Documentation](https://cloud.google.com/security-command-center)
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/security_center/v2"
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::SecurityCenter::V2::SecurityCenter::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).
@@ -164,8 +164,19 @@ module Google
164
164
  universe_domain: @config.universe_domain,
165
165
  channel_args: @config.channel_args,
166
166
  interceptors: @config.interceptors,
167
- channel_pool_config: @config.channel_pool
167
+ channel_pool_config: @config.channel_pool,
168
+ logger: @config.logger
168
169
  )
170
+
171
+ @security_center_stub.stub_logger&.info do |entry|
172
+ entry.set_system_name
173
+ entry.set_service
174
+ entry.message = "Created client for #{entry.service}"
175
+ entry.set_credentials_fields credentials
176
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
177
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
178
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
179
+ end
169
180
  end
170
181
 
171
182
  ##
@@ -175,6 +186,15 @@ module Google
175
186
  #
176
187
  attr_reader :operations_client
177
188
 
189
+ ##
190
+ # The logger used for request/response debug logging.
191
+ #
192
+ # @return [Logger]
193
+ #
194
+ def logger
195
+ @security_center_stub.logger
196
+ end
197
+
178
198
  # Service calls
179
199
 
180
200
  ##
@@ -262,7 +282,6 @@ module Google
262
282
 
263
283
  @security_center_stub.call_rpc :batch_create_resource_value_configs, request, options: options do |response, operation|
264
284
  yield response, operation if block_given?
265
- return response
266
285
  end
267
286
  rescue ::GRPC::BadStatus => e
268
287
  raise ::Google::Cloud::Error.from_error(e)
@@ -393,7 +412,7 @@ module Google
393
412
  @security_center_stub.call_rpc :bulk_mute_findings, request, options: options do |response, operation|
394
413
  response = ::Gapic::Operation.new response, @operations_client, options: options
395
414
  yield response, operation if block_given?
396
- return response
415
+ throw :response, response
397
416
  end
398
417
  rescue ::GRPC::BadStatus => e
399
418
  raise ::Google::Cloud::Error.from_error(e)
@@ -489,7 +508,6 @@ module Google
489
508
 
490
509
  @security_center_stub.call_rpc :create_big_query_export, request, options: options do |response, operation|
491
510
  yield response, operation if block_given?
492
- return response
493
511
  end
494
512
  rescue ::GRPC::BadStatus => e
495
513
  raise ::Google::Cloud::Error.from_error(e)
@@ -588,7 +606,6 @@ module Google
588
606
 
589
607
  @security_center_stub.call_rpc :create_finding, request, options: options do |response, operation|
590
608
  yield response, operation if block_given?
591
- return response
592
609
  end
593
610
  rescue ::GRPC::BadStatus => e
594
611
  raise ::Google::Cloud::Error.from_error(e)
@@ -699,7 +716,6 @@ module Google
699
716
 
700
717
  @security_center_stub.call_rpc :create_mute_config, request, options: options do |response, operation|
701
718
  yield response, operation if block_given?
702
- return response
703
719
  end
704
720
  rescue ::GRPC::BadStatus => e
705
721
  raise ::Google::Cloud::Error.from_error(e)
@@ -797,7 +813,6 @@ module Google
797
813
 
798
814
  @security_center_stub.call_rpc :create_notification_config, request, options: options do |response, operation|
799
815
  yield response, operation if block_given?
800
- return response
801
816
  end
802
817
  rescue ::GRPC::BadStatus => e
803
818
  raise ::Google::Cloud::Error.from_error(e)
@@ -887,7 +902,6 @@ module Google
887
902
 
888
903
  @security_center_stub.call_rpc :create_source, request, options: options do |response, operation|
889
904
  yield response, operation if block_given?
890
- return response
891
905
  end
892
906
  rescue ::GRPC::BadStatus => e
893
907
  raise ::Google::Cloud::Error.from_error(e)
@@ -979,7 +993,6 @@ module Google
979
993
 
980
994
  @security_center_stub.call_rpc :delete_big_query_export, request, options: options do |response, operation|
981
995
  yield response, operation if block_given?
982
- return response
983
996
  end
984
997
  rescue ::GRPC::BadStatus => e
985
998
  raise ::Google::Cloud::Error.from_error(e)
@@ -1090,7 +1103,6 @@ module Google
1090
1103
 
1091
1104
  @security_center_stub.call_rpc :delete_mute_config, request, options: options do |response, operation|
1092
1105
  yield response, operation if block_given?
1093
- return response
1094
1106
  end
1095
1107
  rescue ::GRPC::BadStatus => e
1096
1108
  raise ::Google::Cloud::Error.from_error(e)
@@ -1184,7 +1196,6 @@ module Google
1184
1196
 
1185
1197
  @security_center_stub.call_rpc :delete_notification_config, request, options: options do |response, operation|
1186
1198
  yield response, operation if block_given?
1187
- return response
1188
1199
  end
1189
1200
  rescue ::GRPC::BadStatus => e
1190
1201
  raise ::Google::Cloud::Error.from_error(e)
@@ -1270,7 +1281,6 @@ module Google
1270
1281
 
1271
1282
  @security_center_stub.call_rpc :delete_resource_value_config, request, options: options do |response, operation|
1272
1283
  yield response, operation if block_given?
1273
- return response
1274
1284
  end
1275
1285
  rescue ::GRPC::BadStatus => e
1276
1286
  raise ::Google::Cloud::Error.from_error(e)
@@ -1362,7 +1372,6 @@ module Google
1362
1372
 
1363
1373
  @security_center_stub.call_rpc :get_big_query_export, request, options: options do |response, operation|
1364
1374
  yield response, operation if block_given?
1365
- return response
1366
1375
  end
1367
1376
  rescue ::GRPC::BadStatus => e
1368
1377
  raise ::Google::Cloud::Error.from_error(e)
@@ -1453,7 +1462,6 @@ module Google
1453
1462
 
1454
1463
  @security_center_stub.call_rpc :get_simulation, request, options: options do |response, operation|
1455
1464
  yield response, operation if block_given?
1456
- return response
1457
1465
  end
1458
1466
  rescue ::GRPC::BadStatus => e
1459
1467
  raise ::Google::Cloud::Error.from_error(e)
@@ -1542,7 +1550,6 @@ module Google
1542
1550
 
1543
1551
  @security_center_stub.call_rpc :get_valued_resource, request, options: options do |response, operation|
1544
1552
  yield response, operation if block_given?
1545
- return response
1546
1553
  end
1547
1554
  rescue ::GRPC::BadStatus => e
1548
1555
  raise ::Google::Cloud::Error.from_error(e)
@@ -1632,7 +1639,6 @@ module Google
1632
1639
 
1633
1640
  @security_center_stub.call_rpc :get_iam_policy, request, options: options do |response, operation|
1634
1641
  yield response, operation if block_given?
1635
- return response
1636
1642
  end
1637
1643
  rescue ::GRPC::BadStatus => e
1638
1644
  raise ::Google::Cloud::Error.from_error(e)
@@ -1743,7 +1749,6 @@ module Google
1743
1749
 
1744
1750
  @security_center_stub.call_rpc :get_mute_config, request, options: options do |response, operation|
1745
1751
  yield response, operation if block_given?
1746
- return response
1747
1752
  end
1748
1753
  rescue ::GRPC::BadStatus => e
1749
1754
  raise ::Google::Cloud::Error.from_error(e)
@@ -1837,7 +1842,6 @@ module Google
1837
1842
 
1838
1843
  @security_center_stub.call_rpc :get_notification_config, request, options: options do |response, operation|
1839
1844
  yield response, operation if block_given?
1840
- return response
1841
1845
  end
1842
1846
  rescue ::GRPC::BadStatus => e
1843
1847
  raise ::Google::Cloud::Error.from_error(e)
@@ -1924,7 +1928,6 @@ module Google
1924
1928
 
1925
1929
  @security_center_stub.call_rpc :get_resource_value_config, request, options: options do |response, operation|
1926
1930
  yield response, operation if block_given?
1927
- return response
1928
1931
  end
1929
1932
  rescue ::GRPC::BadStatus => e
1930
1933
  raise ::Google::Cloud::Error.from_error(e)
@@ -2011,7 +2014,6 @@ module Google
2011
2014
 
2012
2015
  @security_center_stub.call_rpc :get_source, request, options: options do |response, operation|
2013
2016
  yield response, operation if block_given?
2014
- return response
2015
2017
  end
2016
2018
  rescue ::GRPC::BadStatus => e
2017
2019
  raise ::Google::Cloud::Error.from_error(e)
@@ -2194,7 +2196,7 @@ module Google
2194
2196
  @security_center_stub.call_rpc :group_findings, request, options: options do |response, operation|
2195
2197
  response = ::Gapic::PagedEnumerable.new @security_center_stub, :group_findings, request, response, operation, options
2196
2198
  yield response, operation if block_given?
2197
- return response
2199
+ throw :response, response
2198
2200
  end
2199
2201
  rescue ::GRPC::BadStatus => e
2200
2202
  raise ::Google::Cloud::Error.from_error(e)
@@ -2304,7 +2306,7 @@ module Google
2304
2306
  @security_center_stub.call_rpc :list_attack_paths, request, options: options do |response, operation|
2305
2307
  response = ::Gapic::PagedEnumerable.new @security_center_stub, :list_attack_paths, request, response, operation, options
2306
2308
  yield response, operation if block_given?
2307
- return response
2309
+ throw :response, response
2308
2310
  end
2309
2311
  rescue ::GRPC::BadStatus => e
2310
2312
  raise ::Google::Cloud::Error.from_error(e)
@@ -2412,7 +2414,7 @@ module Google
2412
2414
  @security_center_stub.call_rpc :list_big_query_exports, request, options: options do |response, operation|
2413
2415
  response = ::Gapic::PagedEnumerable.new @security_center_stub, :list_big_query_exports, request, response, operation, options
2414
2416
  yield response, operation if block_given?
2415
- return response
2417
+ throw :response, response
2416
2418
  end
2417
2419
  rescue ::GRPC::BadStatus => e
2418
2420
  raise ::Google::Cloud::Error.from_error(e)
@@ -2608,7 +2610,7 @@ module Google
2608
2610
  @security_center_stub.call_rpc :list_findings, request, options: options do |response, operation|
2609
2611
  response = ::Gapic::PagedEnumerable.new @security_center_stub, :list_findings, request, response, operation, options
2610
2612
  yield response, operation if block_given?
2611
- return response
2613
+ throw :response, response
2612
2614
  end
2613
2615
  rescue ::GRPC::BadStatus => e
2614
2616
  raise ::Google::Cloud::Error.from_error(e)
@@ -2731,7 +2733,7 @@ module Google
2731
2733
  @security_center_stub.call_rpc :list_mute_configs, request, options: options do |response, operation|
2732
2734
  response = ::Gapic::PagedEnumerable.new @security_center_stub, :list_mute_configs, request, response, operation, options
2733
2735
  yield response, operation if block_given?
2734
- return response
2736
+ throw :response, response
2735
2737
  end
2736
2738
  rescue ::GRPC::BadStatus => e
2737
2739
  raise ::Google::Cloud::Error.from_error(e)
@@ -2833,7 +2835,7 @@ module Google
2833
2835
  @security_center_stub.call_rpc :list_notification_configs, request, options: options do |response, operation|
2834
2836
  response = ::Gapic::PagedEnumerable.new @security_center_stub, :list_notification_configs, request, response, operation, options
2835
2837
  yield response, operation if block_given?
2836
- return response
2838
+ throw :response, response
2837
2839
  end
2838
2840
  rescue ::GRPC::BadStatus => e
2839
2841
  raise ::Google::Cloud::Error.from_error(e)
@@ -2940,7 +2942,7 @@ module Google
2940
2942
  @security_center_stub.call_rpc :list_resource_value_configs, request, options: options do |response, operation|
2941
2943
  response = ::Gapic::PagedEnumerable.new @security_center_stub, :list_resource_value_configs, request, response, operation, options
2942
2944
  yield response, operation if block_given?
2943
- return response
2945
+ throw :response, response
2944
2946
  end
2945
2947
  rescue ::GRPC::BadStatus => e
2946
2948
  raise ::Google::Cloud::Error.from_error(e)
@@ -3040,7 +3042,7 @@ module Google
3040
3042
  @security_center_stub.call_rpc :list_sources, request, options: options do |response, operation|
3041
3043
  response = ::Gapic::PagedEnumerable.new @security_center_stub, :list_sources, request, response, operation, options
3042
3044
  yield response, operation if block_given?
3043
- return response
3045
+ throw :response, response
3044
3046
  end
3045
3047
  rescue ::GRPC::BadStatus => e
3046
3048
  raise ::Google::Cloud::Error.from_error(e)
@@ -3166,7 +3168,7 @@ module Google
3166
3168
  @security_center_stub.call_rpc :list_valued_resources, request, options: options do |response, operation|
3167
3169
  response = ::Gapic::PagedEnumerable.new @security_center_stub, :list_valued_resources, request, response, operation, options
3168
3170
  yield response, operation if block_given?
3169
- return response
3171
+ throw :response, response
3170
3172
  end
3171
3173
  rescue ::GRPC::BadStatus => e
3172
3174
  raise ::Google::Cloud::Error.from_error(e)
@@ -3269,7 +3271,6 @@ module Google
3269
3271
 
3270
3272
  @security_center_stub.call_rpc :set_finding_state, request, options: options do |response, operation|
3271
3273
  yield response, operation if block_given?
3272
- return response
3273
3274
  end
3274
3275
  rescue ::GRPC::BadStatus => e
3275
3276
  raise ::Google::Cloud::Error.from_error(e)
@@ -3367,7 +3368,6 @@ module Google
3367
3368
 
3368
3369
  @security_center_stub.call_rpc :set_iam_policy, request, options: options do |response, operation|
3369
3370
  yield response, operation if block_given?
3370
- return response
3371
3371
  end
3372
3372
  rescue ::GRPC::BadStatus => e
3373
3373
  raise ::Google::Cloud::Error.from_error(e)
@@ -3470,7 +3470,6 @@ module Google
3470
3470
 
3471
3471
  @security_center_stub.call_rpc :set_mute, request, options: options do |response, operation|
3472
3472
  yield response, operation if block_given?
3473
- return response
3474
3473
  end
3475
3474
  rescue ::GRPC::BadStatus => e
3476
3475
  raise ::Google::Cloud::Error.from_error(e)
@@ -3562,7 +3561,6 @@ module Google
3562
3561
 
3563
3562
  @security_center_stub.call_rpc :test_iam_permissions, request, options: options do |response, operation|
3564
3563
  yield response, operation if block_given?
3565
- return response
3566
3564
  end
3567
3565
  rescue ::GRPC::BadStatus => e
3568
3566
  raise ::Google::Cloud::Error.from_error(e)
@@ -3651,7 +3649,6 @@ module Google
3651
3649
 
3652
3650
  @security_center_stub.call_rpc :update_big_query_export, request, options: options do |response, operation|
3653
3651
  yield response, operation if block_given?
3654
- return response
3655
3652
  end
3656
3653
  rescue ::GRPC::BadStatus => e
3657
3654
  raise ::Google::Cloud::Error.from_error(e)
@@ -3742,7 +3739,6 @@ module Google
3742
3739
 
3743
3740
  @security_center_stub.call_rpc :update_external_system, request, options: options do |response, operation|
3744
3741
  yield response, operation if block_given?
3745
- return response
3746
3742
  end
3747
3743
  rescue ::GRPC::BadStatus => e
3748
3744
  raise ::Google::Cloud::Error.from_error(e)
@@ -3843,7 +3839,6 @@ module Google
3843
3839
 
3844
3840
  @security_center_stub.call_rpc :update_finding, request, options: options do |response, operation|
3845
3841
  yield response, operation if block_given?
3846
- return response
3847
3842
  end
3848
3843
  rescue ::GRPC::BadStatus => e
3849
3844
  raise ::Google::Cloud::Error.from_error(e)
@@ -3948,7 +3943,6 @@ module Google
3948
3943
 
3949
3944
  @security_center_stub.call_rpc :update_mute_config, request, options: options do |response, operation|
3950
3945
  yield response, operation if block_given?
3951
- return response
3952
3946
  end
3953
3947
  rescue ::GRPC::BadStatus => e
3954
3948
  raise ::Google::Cloud::Error.from_error(e)
@@ -4039,7 +4033,6 @@ module Google
4039
4033
 
4040
4034
  @security_center_stub.call_rpc :update_notification_config, request, options: options do |response, operation|
4041
4035
  yield response, operation if block_given?
4042
- return response
4043
4036
  end
4044
4037
  rescue ::GRPC::BadStatus => e
4045
4038
  raise ::Google::Cloud::Error.from_error(e)
@@ -4132,7 +4125,6 @@ module Google
4132
4125
 
4133
4126
  @security_center_stub.call_rpc :update_resource_value_config, request, options: options do |response, operation|
4134
4127
  yield response, operation if block_given?
4135
- return response
4136
4128
  end
4137
4129
  rescue ::GRPC::BadStatus => e
4138
4130
  raise ::Google::Cloud::Error.from_error(e)
@@ -4226,7 +4218,6 @@ module Google
4226
4218
 
4227
4219
  @security_center_stub.call_rpc :update_security_marks, request, options: options do |response, operation|
4228
4220
  yield response, operation if block_given?
4229
- return response
4230
4221
  end
4231
4222
  rescue ::GRPC::BadStatus => e
4232
4223
  raise ::Google::Cloud::Error.from_error(e)
@@ -4316,7 +4307,6 @@ module Google
4316
4307
 
4317
4308
  @security_center_stub.call_rpc :update_source, request, options: options do |response, operation|
4318
4309
  yield response, operation if block_given?
4319
- return response
4320
4310
  end
4321
4311
  rescue ::GRPC::BadStatus => e
4322
4312
  raise ::Google::Cloud::Error.from_error(e)
@@ -4405,6 +4395,11 @@ module Google
4405
4395
  # default endpoint URL. The default value of nil uses the environment
4406
4396
  # universe (usually the default "googleapis.com" universe).
4407
4397
  # @return [::String,nil]
4398
+ # @!attribute [rw] logger
4399
+ # A custom logger to use for request/response debug logging, or the value
4400
+ # `:default` (the default) to construct a default logger, or `nil` to
4401
+ # explicitly disable logging.
4402
+ # @return [::Logger,:default,nil]
4408
4403
  #
4409
4404
  class Configuration
4410
4405
  extend ::Gapic::Config
@@ -4429,6 +4424,7 @@ module Google
4429
4424
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
4430
4425
  config_attr :quota_project, nil, ::String, nil
4431
4426
  config_attr :universe_domain, nil, ::String, nil
4427
+ config_attr :logger, :default, ::Logger, nil, :default
4432
4428
 
4433
4429
  # @private
4434
4430
  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