google-cloud-network_services-v1 1.0.0 → 1.1.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: 8db373e9861cc8f10bedd75c10cabd309e3a8063aecfe0b11ddae796cef12272
4
- data.tar.gz: f043464f218b6bc0a64e648c19b3b12b5e5f2f421fa52c13d18d0e14b8cc1e30
3
+ metadata.gz: 536050129599ba0de47a0fd0d6c151ac1932727043aa263dc65a62779f4d20bd
4
+ data.tar.gz: 97609f13c3dfaf3dd24e6c3c3b72c14554a3c90eb86ebecd4ccfb4e6697151bc
5
5
  SHA512:
6
- metadata.gz: da67d2949b799043244264792b5085f5e9961bf80ef55934b462dcd4f237198f9a35a494445853f95b634e6f160e83dd293b126c89d8a9c0be426ee386f9cd79
7
- data.tar.gz: 6a5a1b8cf75f469d0ffb47bc6c1d7dba3897a52042c4802ac723d6108d84d16f0aee9563e5a92e23c78b9cf137b211a777d9e635985ae98048818b378e191e68
6
+ metadata.gz: 0a08a8308c155c8ce831bd094b703ce42ff0a1499df0a1188a04f79cf996e52636f5ed06b41fd64b4a84df96359f029e4ea18ee0cd48a4da37f3a80c27a0eba3
7
+ data.tar.gz: d01d5f7a45fb088b05614fe92d329c0c892f5502561796191c1ba2180858ba9842605fda98ea209141e361dea572d8a7d27bb9e3e256dbe45393238df48ffdc3
data/README.md CHANGED
@@ -43,33 +43,43 @@ for class and method documentation.
43
43
  See also the [Product Documentation](https://cloud.google.com/products/networking)
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/network_services/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::NetworkServices::V1::DepService::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).
@@ -168,14 +168,26 @@ module Google
168
168
  universe_domain: @config.universe_domain,
169
169
  channel_args: @config.channel_args,
170
170
  interceptors: @config.interceptors,
171
- channel_pool_config: @config.channel_pool
171
+ channel_pool_config: @config.channel_pool,
172
+ logger: @config.logger
172
173
  )
173
174
 
175
+ @dep_service_stub.stub_logger&.info do |entry|
176
+ entry.set_system_name
177
+ entry.set_service
178
+ entry.message = "Created client for #{entry.service}"
179
+ entry.set_credentials_fields credentials
180
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
181
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
182
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
183
+ end
184
+
174
185
  @location_client = Google::Cloud::Location::Locations::Client.new do |config|
175
186
  config.credentials = credentials
176
187
  config.quota_project = @quota_project_id
177
188
  config.endpoint = @dep_service_stub.endpoint
178
189
  config.universe_domain = @dep_service_stub.universe_domain
190
+ config.logger = @dep_service_stub.logger if config.respond_to? :logger=
179
191
  end
180
192
 
181
193
  @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config|
@@ -183,6 +195,7 @@ module Google
183
195
  config.quota_project = @quota_project_id
184
196
  config.endpoint = @dep_service_stub.endpoint
185
197
  config.universe_domain = @dep_service_stub.universe_domain
198
+ config.logger = @dep_service_stub.logger if config.respond_to? :logger=
186
199
  end
187
200
  end
188
201
 
@@ -207,6 +220,15 @@ module Google
207
220
  #
208
221
  attr_reader :iam_policy_client
209
222
 
223
+ ##
224
+ # The logger used for request/response debug logging.
225
+ #
226
+ # @return [Logger]
227
+ #
228
+ def logger
229
+ @dep_service_stub.logger
230
+ end
231
+
210
232
  # Service calls
211
233
 
212
234
  ##
@@ -305,7 +327,7 @@ module Google
305
327
  @dep_service_stub.call_rpc :list_lb_traffic_extensions, request, options: options do |response, operation|
306
328
  response = ::Gapic::PagedEnumerable.new @dep_service_stub, :list_lb_traffic_extensions, request, response, operation, options
307
329
  yield response, operation if block_given?
308
- return response
330
+ throw :response, response
309
331
  end
310
332
  rescue ::GRPC::BadStatus => e
311
333
  raise ::Google::Cloud::Error.from_error(e)
@@ -393,7 +415,6 @@ module Google
393
415
 
394
416
  @dep_service_stub.call_rpc :get_lb_traffic_extension, request, options: options do |response, operation|
395
417
  yield response, operation if block_given?
396
- return response
397
418
  end
398
419
  rescue ::GRPC::BadStatus => e
399
420
  raise ::Google::Cloud::Error.from_error(e)
@@ -508,7 +529,7 @@ module Google
508
529
  @dep_service_stub.call_rpc :create_lb_traffic_extension, request, options: options do |response, operation|
509
530
  response = ::Gapic::Operation.new response, @operations_client, options: options
510
531
  yield response, operation if block_given?
511
- return response
532
+ throw :response, response
512
533
  end
513
534
  rescue ::GRPC::BadStatus => e
514
535
  raise ::Google::Cloud::Error.from_error(e)
@@ -622,7 +643,7 @@ module Google
622
643
  @dep_service_stub.call_rpc :update_lb_traffic_extension, request, options: options do |response, operation|
623
644
  response = ::Gapic::Operation.new response, @operations_client, options: options
624
645
  yield response, operation if block_given?
625
- return response
646
+ throw :response, response
626
647
  end
627
648
  rescue ::GRPC::BadStatus => e
628
649
  raise ::Google::Cloud::Error.from_error(e)
@@ -732,7 +753,7 @@ module Google
732
753
  @dep_service_stub.call_rpc :delete_lb_traffic_extension, request, options: options do |response, operation|
733
754
  response = ::Gapic::Operation.new response, @operations_client, options: options
734
755
  yield response, operation if block_given?
735
- return response
756
+ throw :response, response
736
757
  end
737
758
  rescue ::GRPC::BadStatus => e
738
759
  raise ::Google::Cloud::Error.from_error(e)
@@ -834,7 +855,7 @@ module Google
834
855
  @dep_service_stub.call_rpc :list_lb_route_extensions, request, options: options do |response, operation|
835
856
  response = ::Gapic::PagedEnumerable.new @dep_service_stub, :list_lb_route_extensions, request, response, operation, options
836
857
  yield response, operation if block_given?
837
- return response
858
+ throw :response, response
838
859
  end
839
860
  rescue ::GRPC::BadStatus => e
840
861
  raise ::Google::Cloud::Error.from_error(e)
@@ -922,7 +943,6 @@ module Google
922
943
 
923
944
  @dep_service_stub.call_rpc :get_lb_route_extension, request, options: options do |response, operation|
924
945
  yield response, operation if block_given?
925
- return response
926
946
  end
927
947
  rescue ::GRPC::BadStatus => e
928
948
  raise ::Google::Cloud::Error.from_error(e)
@@ -1036,7 +1056,7 @@ module Google
1036
1056
  @dep_service_stub.call_rpc :create_lb_route_extension, request, options: options do |response, operation|
1037
1057
  response = ::Gapic::Operation.new response, @operations_client, options: options
1038
1058
  yield response, operation if block_given?
1039
- return response
1059
+ throw :response, response
1040
1060
  end
1041
1061
  rescue ::GRPC::BadStatus => e
1042
1062
  raise ::Google::Cloud::Error.from_error(e)
@@ -1150,7 +1170,7 @@ module Google
1150
1170
  @dep_service_stub.call_rpc :update_lb_route_extension, request, options: options do |response, operation|
1151
1171
  response = ::Gapic::Operation.new response, @operations_client, options: options
1152
1172
  yield response, operation if block_given?
1153
- return response
1173
+ throw :response, response
1154
1174
  end
1155
1175
  rescue ::GRPC::BadStatus => e
1156
1176
  raise ::Google::Cloud::Error.from_error(e)
@@ -1260,7 +1280,7 @@ module Google
1260
1280
  @dep_service_stub.call_rpc :delete_lb_route_extension, request, options: options do |response, operation|
1261
1281
  response = ::Gapic::Operation.new response, @operations_client, options: options
1262
1282
  yield response, operation if block_given?
1263
- return response
1283
+ throw :response, response
1264
1284
  end
1265
1285
  rescue ::GRPC::BadStatus => e
1266
1286
  raise ::Google::Cloud::Error.from_error(e)
@@ -1349,6 +1369,11 @@ module Google
1349
1369
  # default endpoint URL. The default value of nil uses the environment
1350
1370
  # universe (usually the default "googleapis.com" universe).
1351
1371
  # @return [::String,nil]
1372
+ # @!attribute [rw] logger
1373
+ # A custom logger to use for request/response debug logging, or the value
1374
+ # `:default` (the default) to construct a default logger, or `nil` to
1375
+ # explicitly disable logging.
1376
+ # @return [::Logger,:default,nil]
1352
1377
  #
1353
1378
  class Configuration
1354
1379
  extend ::Gapic::Config
@@ -1373,6 +1398,7 @@ module Google
1373
1398
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
1374
1399
  config_attr :quota_project, nil, ::String, nil
1375
1400
  config_attr :universe_domain, nil, ::String, nil
1401
+ config_attr :logger, :default, ::Logger, nil, :default
1376
1402
 
1377
1403
  # @private
1378
1404
  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
@@ -161,15 +161,27 @@ module Google
161
161
  endpoint: @config.endpoint,
162
162
  endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
163
163
  universe_domain: @config.universe_domain,
164
- credentials: credentials
164
+ credentials: credentials,
165
+ logger: @config.logger
165
166
  )
166
167
 
168
+ @dep_service_stub.logger(stub: true)&.info do |entry|
169
+ entry.set_system_name
170
+ entry.set_service
171
+ entry.message = "Created client for #{entry.service}"
172
+ entry.set_credentials_fields credentials
173
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
174
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
175
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
176
+ end
177
+
167
178
  @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config|
168
179
  config.credentials = credentials
169
180
  config.quota_project = @quota_project_id
170
181
  config.endpoint = @dep_service_stub.endpoint
171
182
  config.universe_domain = @dep_service_stub.universe_domain
172
183
  config.bindings_override = @config.bindings_override
184
+ config.logger = @dep_service_stub.logger if config.respond_to? :logger=
173
185
  end
174
186
 
175
187
  @iam_policy_client = Google::Iam::V1::IAMPolicy::Rest::Client.new do |config|
@@ -178,6 +190,7 @@ module Google
178
190
  config.endpoint = @dep_service_stub.endpoint
179
191
  config.universe_domain = @dep_service_stub.universe_domain
180
192
  config.bindings_override = @config.bindings_override
193
+ config.logger = @dep_service_stub.logger if config.respond_to? :logger=
181
194
  end
182
195
  end
183
196
 
@@ -202,6 +215,15 @@ module Google
202
215
  #
203
216
  attr_reader :iam_policy_client
204
217
 
218
+ ##
219
+ # The logger used for request/response debug logging.
220
+ #
221
+ # @return [Logger]
222
+ #
223
+ def logger
224
+ @dep_service_stub.logger
225
+ end
226
+
205
227
  # Service calls
206
228
 
207
229
  ##
@@ -292,7 +314,6 @@ module Google
292
314
 
293
315
  @dep_service_stub.list_lb_traffic_extensions request, options do |result, operation|
294
316
  yield result, operation if block_given?
295
- return result
296
317
  end
297
318
  rescue ::Gapic::Rest::Error => e
298
319
  raise ::Google::Cloud::Error.from_error(e)
@@ -373,7 +394,6 @@ module Google
373
394
 
374
395
  @dep_service_stub.get_lb_traffic_extension request, options do |result, operation|
375
396
  yield result, operation if block_given?
376
- return result
377
397
  end
378
398
  rescue ::Gapic::Rest::Error => e
379
399
  raise ::Google::Cloud::Error.from_error(e)
@@ -481,7 +501,7 @@ module Google
481
501
  @dep_service_stub.create_lb_traffic_extension request, options do |result, operation|
482
502
  result = ::Gapic::Operation.new result, @operations_client, options: options
483
503
  yield result, operation if block_given?
484
- return result
504
+ throw :response, result
485
505
  end
486
506
  rescue ::Gapic::Rest::Error => e
487
507
  raise ::Google::Cloud::Error.from_error(e)
@@ -588,7 +608,7 @@ module Google
588
608
  @dep_service_stub.update_lb_traffic_extension request, options do |result, operation|
589
609
  result = ::Gapic::Operation.new result, @operations_client, options: options
590
610
  yield result, operation if block_given?
591
- return result
611
+ throw :response, result
592
612
  end
593
613
  rescue ::Gapic::Rest::Error => e
594
614
  raise ::Google::Cloud::Error.from_error(e)
@@ -691,7 +711,7 @@ module Google
691
711
  @dep_service_stub.delete_lb_traffic_extension request, options do |result, operation|
692
712
  result = ::Gapic::Operation.new result, @operations_client, options: options
693
713
  yield result, operation if block_given?
694
- return result
714
+ throw :response, result
695
715
  end
696
716
  rescue ::Gapic::Rest::Error => e
697
717
  raise ::Google::Cloud::Error.from_error(e)
@@ -785,7 +805,6 @@ module Google
785
805
 
786
806
  @dep_service_stub.list_lb_route_extensions request, options do |result, operation|
787
807
  yield result, operation if block_given?
788
- return result
789
808
  end
790
809
  rescue ::Gapic::Rest::Error => e
791
810
  raise ::Google::Cloud::Error.from_error(e)
@@ -866,7 +885,6 @@ module Google
866
885
 
867
886
  @dep_service_stub.get_lb_route_extension request, options do |result, operation|
868
887
  yield result, operation if block_given?
869
- return result
870
888
  end
871
889
  rescue ::Gapic::Rest::Error => e
872
890
  raise ::Google::Cloud::Error.from_error(e)
@@ -973,7 +991,7 @@ module Google
973
991
  @dep_service_stub.create_lb_route_extension request, options do |result, operation|
974
992
  result = ::Gapic::Operation.new result, @operations_client, options: options
975
993
  yield result, operation if block_given?
976
- return result
994
+ throw :response, result
977
995
  end
978
996
  rescue ::Gapic::Rest::Error => e
979
997
  raise ::Google::Cloud::Error.from_error(e)
@@ -1080,7 +1098,7 @@ module Google
1080
1098
  @dep_service_stub.update_lb_route_extension request, options do |result, operation|
1081
1099
  result = ::Gapic::Operation.new result, @operations_client, options: options
1082
1100
  yield result, operation if block_given?
1083
- return result
1101
+ throw :response, result
1084
1102
  end
1085
1103
  rescue ::Gapic::Rest::Error => e
1086
1104
  raise ::Google::Cloud::Error.from_error(e)
@@ -1183,7 +1201,7 @@ module Google
1183
1201
  @dep_service_stub.delete_lb_route_extension request, options do |result, operation|
1184
1202
  result = ::Gapic::Operation.new result, @operations_client, options: options
1185
1203
  yield result, operation if block_given?
1186
- return result
1204
+ throw :response, result
1187
1205
  end
1188
1206
  rescue ::Gapic::Rest::Error => e
1189
1207
  raise ::Google::Cloud::Error.from_error(e)
@@ -1263,6 +1281,11 @@ module Google
1263
1281
  # default endpoint URL. The default value of nil uses the environment
1264
1282
  # universe (usually the default "googleapis.com" universe).
1265
1283
  # @return [::String,nil]
1284
+ # @!attribute [rw] logger
1285
+ # A custom logger to use for request/response debug logging, or the value
1286
+ # `:default` (the default) to construct a default logger, or `nil` to
1287
+ # explicitly disable logging.
1288
+ # @return [::Logger,:default,nil]
1266
1289
  #
1267
1290
  class Configuration
1268
1291
  extend ::Gapic::Config
@@ -1291,6 +1314,7 @@ module Google
1291
1314
  # by the host service.
1292
1315
  # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}]
1293
1316
  config_attr :bindings_override, {}, ::Hash, nil
1317
+ config_attr :logger, :default, ::Logger, nil, :default
1294
1318
 
1295
1319
  # @private
1296
1320
  def initialize parent_config = nil
@@ -115,14 +115,6 @@ module Google
115
115
  # Lists operations that match the specified filter in the request. If the
116
116
  # server doesn't support this method, it returns `UNIMPLEMENTED`.
117
117
  #
118
- # NOTE: the `name` binding allows API services to override the binding
119
- # to use different resource name schemes, such as `users/*/operations`. To
120
- # override the binding, API services can add a binding such as
121
- # `"/v1/{name=users/*}/operations"` to their service configuration.
122
- # For backwards compatibility, the default name includes the operations
123
- # collection id, however overriding users must ensure the name binding
124
- # is the parent resource, without the operations collection id.
125
- #
126
118
  # @overload list_operations(request, options = nil)
127
119
  # Pass arguments to `list_operations` via a request object, either of type
128
120
  # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash.
@@ -204,7 +196,7 @@ module Google
204
196
  @operations_stub.list_operations request, options do |result, operation|
205
197
  result = ::Gapic::Rest::PagedEnumerable.new @operations_stub, :list_operations, "operations", request, result, options
206
198
  yield result, operation if block_given?
207
- return result
199
+ throw :response, result
208
200
  end
209
201
  rescue ::Gapic::Rest::Error => e
210
202
  raise ::Google::Cloud::Error.from_error(e)
@@ -293,7 +285,7 @@ module Google
293
285
  @operations_stub.get_operation request, options do |result, operation|
294
286
  result = ::Gapic::Operation.new result, @operations_client, options: options
295
287
  yield result, operation if block_given?
296
- return result
288
+ throw :response, result
297
289
  end
298
290
  rescue ::Gapic::Rest::Error => e
299
291
  raise ::Google::Cloud::Error.from_error(e)
@@ -375,7 +367,6 @@ module Google
375
367
 
376
368
  @operations_stub.delete_operation request, options do |result, operation|
377
369
  yield result, operation if block_given?
378
- return result
379
370
  end
380
371
  rescue ::Gapic::Rest::Error => e
381
372
  raise ::Google::Cloud::Error.from_error(e)
@@ -390,8 +381,9 @@ module Google
390
381
  # other methods to check whether the cancellation succeeded or whether the
391
382
  # operation completed despite cancellation. On successful cancellation,
392
383
  # the operation is not deleted; instead, it becomes an operation with
393
- # an {::Google::Longrunning::Operation#error Operation.error} value with a {::Google::Rpc::Status#code google.rpc.Status.code} of 1,
394
- # corresponding to `Code.CANCELLED`.
384
+ # an {::Google::Longrunning::Operation#error Operation.error} value with a
385
+ # {::Google::Rpc::Status#code google.rpc.Status.code} of `1`, corresponding to
386
+ # `Code.CANCELLED`.
395
387
  #
396
388
  # @overload cancel_operation(request, options = nil)
397
389
  # Pass arguments to `cancel_operation` via a request object, either of type
@@ -463,7 +455,6 @@ module Google
463
455
 
464
456
  @operations_stub.cancel_operation request, options do |result, operation|
465
457
  yield result, operation if block_given?
466
- return result
467
458
  end
468
459
  rescue ::Gapic::Rest::Error => e
469
460
  raise ::Google::Cloud::Error.from_error(e)
@@ -543,6 +534,11 @@ module Google
543
534
  # default endpoint URL. The default value of nil uses the environment
544
535
  # universe (usually the default "googleapis.com" universe).
545
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]
546
542
  #
547
543
  class Configuration
548
544
  extend ::Gapic::Config
@@ -564,6 +560,7 @@ module Google
564
560
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
565
561
  config_attr :quota_project, nil, ::String, nil
566
562
  config_attr :universe_domain, nil, ::String, nil
563
+ config_attr :logger, :default, ::Logger, nil, :default
567
564
 
568
565
  # @private
569
566
  def initialize parent_config = nil
@@ -683,16 +680,18 @@ module Google
683
680
 
684
681
  response = @client_stub.make_http_request(
685
682
  verb,
686
- uri: uri,
687
- body: body || "",
688
- params: query_string_params,
683
+ uri: uri,
684
+ body: body || "",
685
+ params: query_string_params,
686
+ method_name: "list_operations",
689
687
  options: options
690
688
  )
691
689
  operation = ::Gapic::Rest::TransportOperation.new response
692
690
  result = ::Google::Longrunning::ListOperationsResponse.decode_json response.body, ignore_unknown_fields: true
693
-
694
- yield result, operation if block_given?
695
- result
691
+ catch :response do
692
+ yield result, operation if block_given?
693
+ result
694
+ end
696
695
  end
697
696
 
698
697
  ##
@@ -721,16 +720,18 @@ module Google
721
720
 
722
721
  response = @client_stub.make_http_request(
723
722
  verb,
724
- uri: uri,
725
- body: body || "",
726
- params: query_string_params,
723
+ uri: uri,
724
+ body: body || "",
725
+ params: query_string_params,
726
+ method_name: "get_operation",
727
727
  options: options
728
728
  )
729
729
  operation = ::Gapic::Rest::TransportOperation.new response
730
730
  result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true
731
-
732
- yield result, operation if block_given?
733
- result
731
+ catch :response do
732
+ yield result, operation if block_given?
733
+ result
734
+ end
734
735
  end
735
736
 
736
737
  ##
@@ -759,16 +760,18 @@ module Google
759
760
 
760
761
  response = @client_stub.make_http_request(
761
762
  verb,
762
- uri: uri,
763
- body: body || "",
764
- params: query_string_params,
763
+ uri: uri,
764
+ body: body || "",
765
+ params: query_string_params,
766
+ method_name: "delete_operation",
765
767
  options: options
766
768
  )
767
769
  operation = ::Gapic::Rest::TransportOperation.new response
768
770
  result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true
769
-
770
- yield result, operation if block_given?
771
- result
771
+ catch :response do
772
+ yield result, operation if block_given?
773
+ result
774
+ end
772
775
  end
773
776
 
774
777
  ##
@@ -797,16 +800,18 @@ module Google
797
800
 
798
801
  response = @client_stub.make_http_request(
799
802
  verb,
800
- uri: uri,
801
- body: body || "",
802
- params: query_string_params,
803
+ uri: uri,
804
+ body: body || "",
805
+ params: query_string_params,
806
+ method_name: "cancel_operation",
803
807
  options: options
804
808
  )
805
809
  operation = ::Gapic::Rest::TransportOperation.new response
806
810
  result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true
807
-
808
- yield result, operation if block_given?
809
- result
811
+ catch :response do
812
+ yield result, operation if block_given?
813
+ result
814
+ end
810
815
  end
811
816
 
812
817
  ##