google-cloud-vision-v1p3beta1 0.13.1 → 0.14.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -267,8 +267,19 @@ module Google
267
267
  universe_domain: @config.universe_domain,
268
268
  channel_args: @config.channel_args,
269
269
  interceptors: @config.interceptors,
270
- channel_pool_config: @config.channel_pool
270
+ channel_pool_config: @config.channel_pool,
271
+ logger: @config.logger
271
272
  )
273
+
274
+ @product_search_stub.stub_logger&.info do |entry|
275
+ entry.set_system_name
276
+ entry.set_service
277
+ entry.message = "Created client for #{entry.service}"
278
+ entry.set_credentials_fields credentials
279
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
280
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
281
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
282
+ end
272
283
  end
273
284
 
274
285
  ##
@@ -278,6 +289,15 @@ module Google
278
289
  #
279
290
  attr_reader :operations_client
280
291
 
292
+ ##
293
+ # The logger used for request/response debug logging.
294
+ #
295
+ # @return [Logger]
296
+ #
297
+ def logger
298
+ @product_search_stub.logger
299
+ end
300
+
281
301
  # Service calls
282
302
 
283
303
  ##
@@ -374,7 +394,6 @@ module Google
374
394
 
375
395
  @product_search_stub.call_rpc :create_product_set, request, options: options do |response, operation|
376
396
  yield response, operation if block_given?
377
- return response
378
397
  end
379
398
  rescue ::GRPC::BadStatus => e
380
399
  raise ::Google::Cloud::Error.from_error(e)
@@ -476,7 +495,7 @@ module Google
476
495
  @product_search_stub.call_rpc :list_product_sets, request, options: options do |response, operation|
477
496
  response = ::Gapic::PagedEnumerable.new @product_search_stub, :list_product_sets, request, response, operation, options
478
497
  yield response, operation if block_given?
479
- return response
498
+ throw :response, response
480
499
  end
481
500
  rescue ::GRPC::BadStatus => e
482
501
  raise ::Google::Cloud::Error.from_error(e)
@@ -569,7 +588,6 @@ module Google
569
588
 
570
589
  @product_search_stub.call_rpc :get_product_set, request, options: options do |response, operation|
571
590
  yield response, operation if block_given?
572
- return response
573
591
  end
574
592
  rescue ::GRPC::BadStatus => e
575
593
  raise ::Google::Cloud::Error.from_error(e)
@@ -667,7 +685,6 @@ module Google
667
685
 
668
686
  @product_search_stub.call_rpc :update_product_set, request, options: options do |response, operation|
669
687
  yield response, operation if block_given?
670
- return response
671
688
  end
672
689
  rescue ::GRPC::BadStatus => e
673
690
  raise ::Google::Cloud::Error.from_error(e)
@@ -763,7 +780,6 @@ module Google
763
780
 
764
781
  @product_search_stub.call_rpc :delete_product_set, request, options: options do |response, operation|
765
782
  yield response, operation if block_given?
766
- return response
767
783
  end
768
784
  rescue ::GRPC::BadStatus => e
769
785
  raise ::Google::Cloud::Error.from_error(e)
@@ -866,7 +882,6 @@ module Google
866
882
 
867
883
  @product_search_stub.call_rpc :create_product, request, options: options do |response, operation|
868
884
  yield response, operation if block_given?
869
- return response
870
885
  end
871
886
  rescue ::GRPC::BadStatus => e
872
887
  raise ::Google::Cloud::Error.from_error(e)
@@ -968,7 +983,7 @@ module Google
968
983
  @product_search_stub.call_rpc :list_products, request, options: options do |response, operation|
969
984
  response = ::Gapic::PagedEnumerable.new @product_search_stub, :list_products, request, response, operation, options
970
985
  yield response, operation if block_given?
971
- return response
986
+ throw :response, response
972
987
  end
973
988
  rescue ::GRPC::BadStatus => e
974
989
  raise ::Google::Cloud::Error.from_error(e)
@@ -1061,7 +1076,6 @@ module Google
1061
1076
 
1062
1077
  @product_search_stub.call_rpc :get_product, request, options: options do |response, operation|
1063
1078
  yield response, operation if block_given?
1064
- return response
1065
1079
  end
1066
1080
  rescue ::GRPC::BadStatus => e
1067
1081
  raise ::Google::Cloud::Error.from_error(e)
@@ -1167,7 +1181,6 @@ module Google
1167
1181
 
1168
1182
  @product_search_stub.call_rpc :update_product, request, options: options do |response, operation|
1169
1183
  yield response, operation if block_given?
1170
- return response
1171
1184
  end
1172
1185
  rescue ::GRPC::BadStatus => e
1173
1186
  raise ::Google::Cloud::Error.from_error(e)
@@ -1264,7 +1277,6 @@ module Google
1264
1277
 
1265
1278
  @product_search_stub.call_rpc :delete_product, request, options: options do |response, operation|
1266
1279
  yield response, operation if block_given?
1267
- return response
1268
1280
  end
1269
1281
  rescue ::GRPC::BadStatus => e
1270
1282
  raise ::Google::Cloud::Error.from_error(e)
@@ -1379,7 +1391,6 @@ module Google
1379
1391
 
1380
1392
  @product_search_stub.call_rpc :create_reference_image, request, options: options do |response, operation|
1381
1393
  yield response, operation if block_given?
1382
- return response
1383
1394
  end
1384
1395
  rescue ::GRPC::BadStatus => e
1385
1396
  raise ::Google::Cloud::Error.from_error(e)
@@ -1479,7 +1490,6 @@ module Google
1479
1490
 
1480
1491
  @product_search_stub.call_rpc :delete_reference_image, request, options: options do |response, operation|
1481
1492
  yield response, operation if block_given?
1482
- return response
1483
1493
  end
1484
1494
  rescue ::GRPC::BadStatus => e
1485
1495
  raise ::Google::Cloud::Error.from_error(e)
@@ -1586,7 +1596,7 @@ module Google
1586
1596
  @product_search_stub.call_rpc :list_reference_images, request, options: options do |response, operation|
1587
1597
  response = ::Gapic::PagedEnumerable.new @product_search_stub, :list_reference_images, request, response, operation, options
1588
1598
  yield response, operation if block_given?
1589
- return response
1599
+ throw :response, response
1590
1600
  end
1591
1601
  rescue ::GRPC::BadStatus => e
1592
1602
  raise ::Google::Cloud::Error.from_error(e)
@@ -1680,7 +1690,6 @@ module Google
1680
1690
 
1681
1691
  @product_search_stub.call_rpc :get_reference_image, request, options: options do |response, operation|
1682
1692
  yield response, operation if block_given?
1683
- return response
1684
1693
  end
1685
1694
  rescue ::GRPC::BadStatus => e
1686
1695
  raise ::Google::Cloud::Error.from_error(e)
@@ -1781,7 +1790,6 @@ module Google
1781
1790
 
1782
1791
  @product_search_stub.call_rpc :add_product_to_product_set, request, options: options do |response, operation|
1783
1792
  yield response, operation if block_given?
1784
- return response
1785
1793
  end
1786
1794
  rescue ::GRPC::BadStatus => e
1787
1795
  raise ::Google::Cloud::Error.from_error(e)
@@ -1879,7 +1887,6 @@ module Google
1879
1887
 
1880
1888
  @product_search_stub.call_rpc :remove_product_from_product_set, request, options: options do |response, operation|
1881
1889
  yield response, operation if block_given?
1882
- return response
1883
1890
  end
1884
1891
  rescue ::GRPC::BadStatus => e
1885
1892
  raise ::Google::Cloud::Error.from_error(e)
@@ -1983,7 +1990,7 @@ module Google
1983
1990
  @product_search_stub.call_rpc :list_products_in_product_set, request, options: options do |response, operation|
1984
1991
  response = ::Gapic::PagedEnumerable.new @product_search_stub, :list_products_in_product_set, request, response, operation, options
1985
1992
  yield response, operation if block_given?
1986
- return response
1993
+ throw :response, response
1987
1994
  end
1988
1995
  rescue ::GRPC::BadStatus => e
1989
1996
  raise ::Google::Cloud::Error.from_error(e)
@@ -2091,7 +2098,7 @@ module Google
2091
2098
  @product_search_stub.call_rpc :import_product_sets, request, options: options do |response, operation|
2092
2099
  response = ::Gapic::Operation.new response, @operations_client, options: options
2093
2100
  yield response, operation if block_given?
2094
- return response
2101
+ throw :response, response
2095
2102
  end
2096
2103
  rescue ::GRPC::BadStatus => e
2097
2104
  raise ::Google::Cloud::Error.from_error(e)
@@ -2180,6 +2187,11 @@ module Google
2180
2187
  # default endpoint URL. The default value of nil uses the environment
2181
2188
  # universe (usually the default "googleapis.com" universe).
2182
2189
  # @return [::String,nil]
2190
+ # @!attribute [rw] logger
2191
+ # A custom logger to use for request/response debug logging, or the value
2192
+ # `:default` (the default) to construct a default logger, or `nil` to
2193
+ # explicitly disable logging.
2194
+ # @return [::Logger,:default,nil]
2183
2195
  #
2184
2196
  class Configuration
2185
2197
  extend ::Gapic::Config
@@ -2204,6 +2216,7 @@ module Google
2204
2216
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
2205
2217
  config_attr :quota_project, nil, ::String, nil
2206
2218
  config_attr :universe_domain, nil, ::String, nil
2219
+ config_attr :logger, :default, ::Logger, nil, :default
2207
2220
 
2208
2221
  # @private
2209
2222
  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
@@ -260,8 +260,19 @@ module Google
260
260
  endpoint: @config.endpoint,
261
261
  endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
262
262
  universe_domain: @config.universe_domain,
263
- credentials: credentials
263
+ credentials: credentials,
264
+ logger: @config.logger
264
265
  )
266
+
267
+ @product_search_stub.logger(stub: true)&.info do |entry|
268
+ entry.set_system_name
269
+ entry.set_service
270
+ entry.message = "Created client for #{entry.service}"
271
+ entry.set_credentials_fields credentials
272
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
273
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
274
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
275
+ end
265
276
  end
266
277
 
267
278
  ##
@@ -271,6 +282,15 @@ module Google
271
282
  #
272
283
  attr_reader :operations_client
273
284
 
285
+ ##
286
+ # The logger used for request/response debug logging.
287
+ #
288
+ # @return [Logger]
289
+ #
290
+ def logger
291
+ @product_search_stub.logger
292
+ end
293
+
274
294
  # Service calls
275
295
 
276
296
  ##
@@ -360,7 +380,6 @@ module Google
360
380
 
361
381
  @product_search_stub.create_product_set request, options do |result, operation|
362
382
  yield result, operation if block_given?
363
- return result
364
383
  end
365
384
  rescue ::Gapic::Rest::Error => e
366
385
  raise ::Google::Cloud::Error.from_error(e)
@@ -455,7 +474,7 @@ module Google
455
474
  @product_search_stub.list_product_sets request, options do |result, operation|
456
475
  result = ::Gapic::Rest::PagedEnumerable.new @product_search_stub, :list_product_sets, "product_sets", request, result, options
457
476
  yield result, operation if block_given?
458
- return result
477
+ throw :response, result
459
478
  end
460
479
  rescue ::Gapic::Rest::Error => e
461
480
  raise ::Google::Cloud::Error.from_error(e)
@@ -541,7 +560,6 @@ module Google
541
560
 
542
561
  @product_search_stub.get_product_set request, options do |result, operation|
543
562
  yield result, operation if block_given?
544
- return result
545
563
  end
546
564
  rescue ::Gapic::Rest::Error => e
547
565
  raise ::Google::Cloud::Error.from_error(e)
@@ -632,7 +650,6 @@ module Google
632
650
 
633
651
  @product_search_stub.update_product_set request, options do |result, operation|
634
652
  yield result, operation if block_given?
635
- return result
636
653
  end
637
654
  rescue ::Gapic::Rest::Error => e
638
655
  raise ::Google::Cloud::Error.from_error(e)
@@ -721,7 +738,6 @@ module Google
721
738
 
722
739
  @product_search_stub.delete_product_set request, options do |result, operation|
723
740
  yield result, operation if block_given?
724
- return result
725
741
  end
726
742
  rescue ::Gapic::Rest::Error => e
727
743
  raise ::Google::Cloud::Error.from_error(e)
@@ -817,7 +833,6 @@ module Google
817
833
 
818
834
  @product_search_stub.create_product request, options do |result, operation|
819
835
  yield result, operation if block_given?
820
- return result
821
836
  end
822
837
  rescue ::Gapic::Rest::Error => e
823
838
  raise ::Google::Cloud::Error.from_error(e)
@@ -912,7 +927,7 @@ module Google
912
927
  @product_search_stub.list_products request, options do |result, operation|
913
928
  result = ::Gapic::Rest::PagedEnumerable.new @product_search_stub, :list_products, "products", request, result, options
914
929
  yield result, operation if block_given?
915
- return result
930
+ throw :response, result
916
931
  end
917
932
  rescue ::Gapic::Rest::Error => e
918
933
  raise ::Google::Cloud::Error.from_error(e)
@@ -998,7 +1013,6 @@ module Google
998
1013
 
999
1014
  @product_search_stub.get_product request, options do |result, operation|
1000
1015
  yield result, operation if block_given?
1001
- return result
1002
1016
  end
1003
1017
  rescue ::Gapic::Rest::Error => e
1004
1018
  raise ::Google::Cloud::Error.from_error(e)
@@ -1097,7 +1111,6 @@ module Google
1097
1111
 
1098
1112
  @product_search_stub.update_product request, options do |result, operation|
1099
1113
  yield result, operation if block_given?
1100
- return result
1101
1114
  end
1102
1115
  rescue ::Gapic::Rest::Error => e
1103
1116
  raise ::Google::Cloud::Error.from_error(e)
@@ -1187,7 +1200,6 @@ module Google
1187
1200
 
1188
1201
  @product_search_stub.delete_product request, options do |result, operation|
1189
1202
  yield result, operation if block_given?
1190
- return result
1191
1203
  end
1192
1204
  rescue ::Gapic::Rest::Error => e
1193
1205
  raise ::Google::Cloud::Error.from_error(e)
@@ -1295,7 +1307,6 @@ module Google
1295
1307
 
1296
1308
  @product_search_stub.create_reference_image request, options do |result, operation|
1297
1309
  yield result, operation if block_given?
1298
- return result
1299
1310
  end
1300
1311
  rescue ::Gapic::Rest::Error => e
1301
1312
  raise ::Google::Cloud::Error.from_error(e)
@@ -1388,7 +1399,6 @@ module Google
1388
1399
 
1389
1400
  @product_search_stub.delete_reference_image request, options do |result, operation|
1390
1401
  yield result, operation if block_given?
1391
- return result
1392
1402
  end
1393
1403
  rescue ::Gapic::Rest::Error => e
1394
1404
  raise ::Google::Cloud::Error.from_error(e)
@@ -1488,7 +1498,7 @@ module Google
1488
1498
  @product_search_stub.list_reference_images request, options do |result, operation|
1489
1499
  result = ::Gapic::Rest::PagedEnumerable.new @product_search_stub, :list_reference_images, "reference_images", request, result, options
1490
1500
  yield result, operation if block_given?
1491
- return result
1501
+ throw :response, result
1492
1502
  end
1493
1503
  rescue ::Gapic::Rest::Error => e
1494
1504
  raise ::Google::Cloud::Error.from_error(e)
@@ -1575,7 +1585,6 @@ module Google
1575
1585
 
1576
1586
  @product_search_stub.get_reference_image request, options do |result, operation|
1577
1587
  yield result, operation if block_given?
1578
- return result
1579
1588
  end
1580
1589
  rescue ::Gapic::Rest::Error => e
1581
1590
  raise ::Google::Cloud::Error.from_error(e)
@@ -1669,7 +1678,6 @@ module Google
1669
1678
 
1670
1679
  @product_search_stub.add_product_to_product_set request, options do |result, operation|
1671
1680
  yield result, operation if block_given?
1672
- return result
1673
1681
  end
1674
1682
  rescue ::Gapic::Rest::Error => e
1675
1683
  raise ::Google::Cloud::Error.from_error(e)
@@ -1760,7 +1768,6 @@ module Google
1760
1768
 
1761
1769
  @product_search_stub.remove_product_from_product_set request, options do |result, operation|
1762
1770
  yield result, operation if block_given?
1763
- return result
1764
1771
  end
1765
1772
  rescue ::Gapic::Rest::Error => e
1766
1773
  raise ::Google::Cloud::Error.from_error(e)
@@ -1857,7 +1864,7 @@ module Google
1857
1864
  @product_search_stub.list_products_in_product_set request, options do |result, operation|
1858
1865
  result = ::Gapic::Rest::PagedEnumerable.new @product_search_stub, :list_products_in_product_set, "products", request, result, options
1859
1866
  yield result, operation if block_given?
1860
- return result
1867
+ throw :response, result
1861
1868
  end
1862
1869
  rescue ::Gapic::Rest::Error => e
1863
1870
  raise ::Google::Cloud::Error.from_error(e)
@@ -1958,7 +1965,7 @@ module Google
1958
1965
  @product_search_stub.import_product_sets request, options do |result, operation|
1959
1966
  result = ::Gapic::Operation.new result, @operations_client, options: options
1960
1967
  yield result, operation if block_given?
1961
- return result
1968
+ throw :response, result
1962
1969
  end
1963
1970
  rescue ::Gapic::Rest::Error => e
1964
1971
  raise ::Google::Cloud::Error.from_error(e)
@@ -2038,6 +2045,11 @@ module Google
2038
2045
  # default endpoint URL. The default value of nil uses the environment
2039
2046
  # universe (usually the default "googleapis.com" universe).
2040
2047
  # @return [::String,nil]
2048
+ # @!attribute [rw] logger
2049
+ # A custom logger to use for request/response debug logging, or the value
2050
+ # `:default` (the default) to construct a default logger, or `nil` to
2051
+ # explicitly disable logging.
2052
+ # @return [::Logger,:default,nil]
2041
2053
  #
2042
2054
  class Configuration
2043
2055
  extend ::Gapic::Config
@@ -2059,6 +2071,7 @@ module Google
2059
2071
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
2060
2072
  config_attr :quota_project, nil, ::String, nil
2061
2073
  config_attr :universe_domain, nil, ::String, nil
2074
+ config_attr :logger, :default, ::Logger, nil, :default
2062
2075
 
2063
2076
  # @private
2064
2077
  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
  ##