google-cloud-vision_ai-v1 0.2.0 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (32) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +30 -20
  3. data/lib/google/cloud/vision_ai/v1/app_platform/client.rb +50 -27
  4. data/lib/google/cloud/vision_ai/v1/app_platform/operations.rb +12 -15
  5. data/lib/google/cloud/vision_ai/v1/app_platform/rest/client.rb +46 -27
  6. data/lib/google/cloud/vision_ai/v1/app_platform/rest/operations.rb +43 -38
  7. data/lib/google/cloud/vision_ai/v1/app_platform/rest/service_stub.rb +222 -158
  8. data/lib/google/cloud/vision_ai/v1/health_check_service/client.rb +29 -2
  9. data/lib/google/cloud/vision_ai/v1/health_check_service/rest/client.rb +29 -2
  10. data/lib/google/cloud/vision_ai/v1/health_check_service/rest/service_stub.rb +22 -8
  11. data/lib/google/cloud/vision_ai/v1/live_video_analytics/client.rb +43 -19
  12. data/lib/google/cloud/vision_ai/v1/live_video_analytics/operations.rb +12 -15
  13. data/lib/google/cloud/vision_ai/v1/live_video_analytics/rest/client.rb +40 -19
  14. data/lib/google/cloud/vision_ai/v1/live_video_analytics/rest/operations.rb +43 -38
  15. data/lib/google/cloud/vision_ai/v1/live_video_analytics/rest/service_stub.rb +158 -110
  16. data/lib/google/cloud/vision_ai/v1/streaming_service/client.rb +29 -7
  17. data/lib/google/cloud/vision_ai/v1/streaming_service/rest/client.rb +29 -4
  18. data/lib/google/cloud/vision_ai/v1/streaming_service/rest/service_stub.rb +38 -20
  19. data/lib/google/cloud/vision_ai/v1/streams_service/client.rb +47 -24
  20. data/lib/google/cloud/vision_ai/v1/streams_service/operations.rb +12 -15
  21. data/lib/google/cloud/vision_ai/v1/streams_service/rest/client.rb +43 -24
  22. data/lib/google/cloud/vision_ai/v1/streams_service/rest/operations.rb +43 -38
  23. data/lib/google/cloud/vision_ai/v1/streams_service/rest/service_stub.rb +198 -140
  24. data/lib/google/cloud/vision_ai/v1/version.rb +1 -1
  25. data/lib/google/cloud/vision_ai/v1/warehouse/client.rb +60 -64
  26. data/lib/google/cloud/vision_ai/v1/warehouse/operations.rb +12 -15
  27. data/lib/google/cloud/vision_ai/v1/warehouse/rest/client.rb +59 -63
  28. data/lib/google/cloud/vision_ai/v1/warehouse/rest/operations.rb +43 -38
  29. data/lib/google/cloud/vision_ai/v1/warehouse/rest/service_stub.rb +510 -374
  30. data/proto_docs/google/api/client.rb +39 -0
  31. data/proto_docs/google/longrunning/operations.rb +19 -14
  32. metadata +5 -5
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a47e6abb0e98d91829f4cf5ae11c17c939d75bc97d398b3005078a3cd75023d3
4
- data.tar.gz: 49c2608a295ebce6a4161e4b279489212e1a13a5ce9a0dec1774e8972f23b0bc
3
+ metadata.gz: 1f0b75a98e1ea83ae1c884d171c811e97f6475a35f199f158d7402a2dd003831
4
+ data.tar.gz: fc07e9fc7a237532436a98b8efc63b0f775c6b116dff4a9b2d1fadc918f416cb
5
5
  SHA512:
6
- metadata.gz: b8f89c080ec0fc300eb0adc2a030f9f4693d48d9cee23bb7839aa8bfc22143f498454b2e9e5ed1c17136d43c62fa0e57488d422d53449fd6a26230aed3828407
7
- data.tar.gz: a178380b0073bf6426b9ec4d6a9a9428d466b488d6bbd200eac115329ccb19fb64e58646189c6b9472891ed2fd02f73d590f9a12d2d39db102d928b03f8d5eae
6
+ metadata.gz: cea4dcaab4ff4ef8c3098f7361849017a225d53dd2ff7472c0a224c12bbabefd0f2eac37444abd8627194038bd86893bf9a1e835414ec085650500b4a7ea9c8f
7
+ data.tar.gz: 790b2c8576a6b9c53b54768ee4cfdf27ba0eee5288becf66c1d143174edbc19ed6fe377d6ef802564bec62e9540d113218b3cbe47849aa9fbdde0900053766a3
data/README.md CHANGED
@@ -43,33 +43,43 @@ for class and method documentation.
43
43
  See also the [Product Documentation](https://cloud.google.com/vision-ai/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/vision_ai/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::VisionAI::V1::LiveVideoAnalytics::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).
@@ -166,14 +166,26 @@ module Google
166
166
  universe_domain: @config.universe_domain,
167
167
  channel_args: @config.channel_args,
168
168
  interceptors: @config.interceptors,
169
- channel_pool_config: @config.channel_pool
169
+ channel_pool_config: @config.channel_pool,
170
+ logger: @config.logger
170
171
  )
171
172
 
173
+ @app_platform_stub.stub_logger&.info do |entry|
174
+ entry.set_system_name
175
+ entry.set_service
176
+ entry.message = "Created client for #{entry.service}"
177
+ entry.set_credentials_fields credentials
178
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
179
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
180
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
181
+ end
182
+
172
183
  @location_client = Google::Cloud::Location::Locations::Client.new do |config|
173
184
  config.credentials = credentials
174
185
  config.quota_project = @quota_project_id
175
186
  config.endpoint = @app_platform_stub.endpoint
176
187
  config.universe_domain = @app_platform_stub.universe_domain
188
+ config.logger = @app_platform_stub.logger if config.respond_to? :logger=
177
189
  end
178
190
 
179
191
  @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config|
@@ -181,6 +193,7 @@ module Google
181
193
  config.quota_project = @quota_project_id
182
194
  config.endpoint = @app_platform_stub.endpoint
183
195
  config.universe_domain = @app_platform_stub.universe_domain
196
+ config.logger = @app_platform_stub.logger if config.respond_to? :logger=
184
197
  end
185
198
  end
186
199
 
@@ -205,6 +218,15 @@ module Google
205
218
  #
206
219
  attr_reader :iam_policy_client
207
220
 
221
+ ##
222
+ # The logger used for request/response debug logging.
223
+ #
224
+ # @return [Logger]
225
+ #
226
+ def logger
227
+ @app_platform_stub.logger
228
+ end
229
+
208
230
  # Service calls
209
231
 
210
232
  ##
@@ -301,7 +323,7 @@ module Google
301
323
  @app_platform_stub.call_rpc :list_applications, request, options: options do |response, operation|
302
324
  response = ::Gapic::PagedEnumerable.new @app_platform_stub, :list_applications, request, response, operation, options
303
325
  yield response, operation if block_given?
304
- return response
326
+ throw :response, response
305
327
  end
306
328
  rescue ::GRPC::BadStatus => e
307
329
  raise ::Google::Cloud::Error.from_error(e)
@@ -387,7 +409,6 @@ module Google
387
409
 
388
410
  @app_platform_stub.call_rpc :get_application, request, options: options do |response, operation|
389
411
  yield response, operation if block_given?
390
- return response
391
412
  end
392
413
  rescue ::GRPC::BadStatus => e
393
414
  raise ::Google::Cloud::Error.from_error(e)
@@ -499,7 +520,7 @@ module Google
499
520
  @app_platform_stub.call_rpc :create_application, request, options: options do |response, operation|
500
521
  response = ::Gapic::Operation.new response, @operations_client, options: options
501
522
  yield response, operation if block_given?
502
- return response
523
+ throw :response, response
503
524
  end
504
525
  rescue ::GRPC::BadStatus => e
505
526
  raise ::Google::Cloud::Error.from_error(e)
@@ -613,7 +634,7 @@ module Google
613
634
  @app_platform_stub.call_rpc :update_application, request, options: options do |response, operation|
614
635
  response = ::Gapic::Operation.new response, @operations_client, options: options
615
636
  yield response, operation if block_given?
616
- return response
637
+ throw :response, response
617
638
  end
618
639
  rescue ::GRPC::BadStatus => e
619
640
  raise ::Google::Cloud::Error.from_error(e)
@@ -725,7 +746,7 @@ module Google
725
746
  @app_platform_stub.call_rpc :delete_application, request, options: options do |response, operation|
726
747
  response = ::Gapic::Operation.new response, @operations_client, options: options
727
748
  yield response, operation if block_given?
728
- return response
749
+ throw :response, response
729
750
  end
730
751
  rescue ::GRPC::BadStatus => e
731
752
  raise ::Google::Cloud::Error.from_error(e)
@@ -841,7 +862,7 @@ module Google
841
862
  @app_platform_stub.call_rpc :deploy_application, request, options: options do |response, operation|
842
863
  response = ::Gapic::Operation.new response, @operations_client, options: options
843
864
  yield response, operation if block_given?
844
- return response
865
+ throw :response, response
845
866
  end
846
867
  rescue ::GRPC::BadStatus => e
847
868
  raise ::Google::Cloud::Error.from_error(e)
@@ -951,7 +972,7 @@ module Google
951
972
  @app_platform_stub.call_rpc :undeploy_application, request, options: options do |response, operation|
952
973
  response = ::Gapic::Operation.new response, @operations_client, options: options
953
974
  yield response, operation if block_given?
954
- return response
975
+ throw :response, response
955
976
  end
956
977
  rescue ::GRPC::BadStatus => e
957
978
  raise ::Google::Cloud::Error.from_error(e)
@@ -1067,7 +1088,7 @@ module Google
1067
1088
  @app_platform_stub.call_rpc :add_application_stream_input, request, options: options do |response, operation|
1068
1089
  response = ::Gapic::Operation.new response, @operations_client, options: options
1069
1090
  yield response, operation if block_given?
1070
- return response
1091
+ throw :response, response
1071
1092
  end
1072
1093
  rescue ::GRPC::BadStatus => e
1073
1094
  raise ::Google::Cloud::Error.from_error(e)
@@ -1181,7 +1202,7 @@ module Google
1181
1202
  @app_platform_stub.call_rpc :remove_application_stream_input, request, options: options do |response, operation|
1182
1203
  response = ::Gapic::Operation.new response, @operations_client, options: options
1183
1204
  yield response, operation if block_given?
1184
- return response
1205
+ throw :response, response
1185
1206
  end
1186
1207
  rescue ::GRPC::BadStatus => e
1187
1208
  raise ::Google::Cloud::Error.from_error(e)
@@ -1299,7 +1320,7 @@ module Google
1299
1320
  @app_platform_stub.call_rpc :update_application_stream_input, request, options: options do |response, operation|
1300
1321
  response = ::Gapic::Operation.new response, @operations_client, options: options
1301
1322
  yield response, operation if block_given?
1302
- return response
1323
+ throw :response, response
1303
1324
  end
1304
1325
  rescue ::GRPC::BadStatus => e
1305
1326
  raise ::Google::Cloud::Error.from_error(e)
@@ -1399,7 +1420,7 @@ module Google
1399
1420
  @app_platform_stub.call_rpc :list_instances, request, options: options do |response, operation|
1400
1421
  response = ::Gapic::PagedEnumerable.new @app_platform_stub, :list_instances, request, response, operation, options
1401
1422
  yield response, operation if block_given?
1402
- return response
1423
+ throw :response, response
1403
1424
  end
1404
1425
  rescue ::GRPC::BadStatus => e
1405
1426
  raise ::Google::Cloud::Error.from_error(e)
@@ -1485,7 +1506,6 @@ module Google
1485
1506
 
1486
1507
  @app_platform_stub.call_rpc :get_instance, request, options: options do |response, operation|
1487
1508
  yield response, operation if block_given?
1488
- return response
1489
1509
  end
1490
1510
  rescue ::GRPC::BadStatus => e
1491
1511
  raise ::Google::Cloud::Error.from_error(e)
@@ -1600,7 +1620,7 @@ module Google
1600
1620
  @app_platform_stub.call_rpc :create_application_instances, request, options: options do |response, operation|
1601
1621
  response = ::Gapic::Operation.new response, @operations_client, options: options
1602
1622
  yield response, operation if block_given?
1603
- return response
1623
+ throw :response, response
1604
1624
  end
1605
1625
  rescue ::GRPC::BadStatus => e
1606
1626
  raise ::Google::Cloud::Error.from_error(e)
@@ -1714,7 +1734,7 @@ module Google
1714
1734
  @app_platform_stub.call_rpc :delete_application_instances, request, options: options do |response, operation|
1715
1735
  response = ::Gapic::Operation.new response, @operations_client, options: options
1716
1736
  yield response, operation if block_given?
1717
- return response
1737
+ throw :response, response
1718
1738
  end
1719
1739
  rescue ::GRPC::BadStatus => e
1720
1740
  raise ::Google::Cloud::Error.from_error(e)
@@ -1831,7 +1851,7 @@ module Google
1831
1851
  @app_platform_stub.call_rpc :update_application_instances, request, options: options do |response, operation|
1832
1852
  response = ::Gapic::Operation.new response, @operations_client, options: options
1833
1853
  yield response, operation if block_given?
1834
- return response
1854
+ throw :response, response
1835
1855
  end
1836
1856
  rescue ::GRPC::BadStatus => e
1837
1857
  raise ::Google::Cloud::Error.from_error(e)
@@ -1931,7 +1951,7 @@ module Google
1931
1951
  @app_platform_stub.call_rpc :list_drafts, request, options: options do |response, operation|
1932
1952
  response = ::Gapic::PagedEnumerable.new @app_platform_stub, :list_drafts, request, response, operation, options
1933
1953
  yield response, operation if block_given?
1934
- return response
1954
+ throw :response, response
1935
1955
  end
1936
1956
  rescue ::GRPC::BadStatus => e
1937
1957
  raise ::Google::Cloud::Error.from_error(e)
@@ -2017,7 +2037,6 @@ module Google
2017
2037
 
2018
2038
  @app_platform_stub.call_rpc :get_draft, request, options: options do |response, operation|
2019
2039
  yield response, operation if block_given?
2020
- return response
2021
2040
  end
2022
2041
  rescue ::GRPC::BadStatus => e
2023
2042
  raise ::Google::Cloud::Error.from_error(e)
@@ -2129,7 +2148,7 @@ module Google
2129
2148
  @app_platform_stub.call_rpc :create_draft, request, options: options do |response, operation|
2130
2149
  response = ::Gapic::Operation.new response, @operations_client, options: options
2131
2150
  yield response, operation if block_given?
2132
- return response
2151
+ throw :response, response
2133
2152
  end
2134
2153
  rescue ::GRPC::BadStatus => e
2135
2154
  raise ::Google::Cloud::Error.from_error(e)
@@ -2246,7 +2265,7 @@ module Google
2246
2265
  @app_platform_stub.call_rpc :update_draft, request, options: options do |response, operation|
2247
2266
  response = ::Gapic::Operation.new response, @operations_client, options: options
2248
2267
  yield response, operation if block_given?
2249
- return response
2268
+ throw :response, response
2250
2269
  end
2251
2270
  rescue ::GRPC::BadStatus => e
2252
2271
  raise ::Google::Cloud::Error.from_error(e)
@@ -2354,7 +2373,7 @@ module Google
2354
2373
  @app_platform_stub.call_rpc :delete_draft, request, options: options do |response, operation|
2355
2374
  response = ::Gapic::Operation.new response, @operations_client, options: options
2356
2375
  yield response, operation if block_given?
2357
- return response
2376
+ throw :response, response
2358
2377
  end
2359
2378
  rescue ::GRPC::BadStatus => e
2360
2379
  raise ::Google::Cloud::Error.from_error(e)
@@ -2454,7 +2473,7 @@ module Google
2454
2473
  @app_platform_stub.call_rpc :list_processors, request, options: options do |response, operation|
2455
2474
  response = ::Gapic::PagedEnumerable.new @app_platform_stub, :list_processors, request, response, operation, options
2456
2475
  yield response, operation if block_given?
2457
- return response
2476
+ throw :response, response
2458
2477
  end
2459
2478
  rescue ::GRPC::BadStatus => e
2460
2479
  raise ::Google::Cloud::Error.from_error(e)
@@ -2541,7 +2560,6 @@ module Google
2541
2560
 
2542
2561
  @app_platform_stub.call_rpc :list_prebuilt_processors, request, options: options do |response, operation|
2543
2562
  yield response, operation if block_given?
2544
- return response
2545
2563
  end
2546
2564
  rescue ::GRPC::BadStatus => e
2547
2565
  raise ::Google::Cloud::Error.from_error(e)
@@ -2627,7 +2645,6 @@ module Google
2627
2645
 
2628
2646
  @app_platform_stub.call_rpc :get_processor, request, options: options do |response, operation|
2629
2647
  yield response, operation if block_given?
2630
- return response
2631
2648
  end
2632
2649
  rescue ::GRPC::BadStatus => e
2633
2650
  raise ::Google::Cloud::Error.from_error(e)
@@ -2739,7 +2756,7 @@ module Google
2739
2756
  @app_platform_stub.call_rpc :create_processor, request, options: options do |response, operation|
2740
2757
  response = ::Gapic::Operation.new response, @operations_client, options: options
2741
2758
  yield response, operation if block_given?
2742
- return response
2759
+ throw :response, response
2743
2760
  end
2744
2761
  rescue ::GRPC::BadStatus => e
2745
2762
  raise ::Google::Cloud::Error.from_error(e)
@@ -2853,7 +2870,7 @@ module Google
2853
2870
  @app_platform_stub.call_rpc :update_processor, request, options: options do |response, operation|
2854
2871
  response = ::Gapic::Operation.new response, @operations_client, options: options
2855
2872
  yield response, operation if block_given?
2856
- return response
2873
+ throw :response, response
2857
2874
  end
2858
2875
  rescue ::GRPC::BadStatus => e
2859
2876
  raise ::Google::Cloud::Error.from_error(e)
@@ -2961,7 +2978,7 @@ module Google
2961
2978
  @app_platform_stub.call_rpc :delete_processor, request, options: options do |response, operation|
2962
2979
  response = ::Gapic::Operation.new response, @operations_client, options: options
2963
2980
  yield response, operation if block_given?
2964
- return response
2981
+ throw :response, response
2965
2982
  end
2966
2983
  rescue ::GRPC::BadStatus => e
2967
2984
  raise ::Google::Cloud::Error.from_error(e)
@@ -3050,6 +3067,11 @@ module Google
3050
3067
  # default endpoint URL. The default value of nil uses the environment
3051
3068
  # universe (usually the default "googleapis.com" universe).
3052
3069
  # @return [::String,nil]
3070
+ # @!attribute [rw] logger
3071
+ # A custom logger to use for request/response debug logging, or the value
3072
+ # `:default` (the default) to construct a default logger, or `nil` to
3073
+ # explicitly disable logging.
3074
+ # @return [::Logger,:default,nil]
3053
3075
  #
3054
3076
  class Configuration
3055
3077
  extend ::Gapic::Config
@@ -3074,6 +3096,7 @@ module Google
3074
3096
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
3075
3097
  config_attr :quota_project, nil, ::String, nil
3076
3098
  config_attr :universe_domain, nil, ::String, nil
3099
+ config_attr :logger, :default, ::Logger, nil, :default
3077
3100
 
3078
3101
  # @private
3079
3102
  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