google-cloud-automl-v1beta1 0.11.1 → 0.13.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 (28) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +31 -21
  3. data/lib/google/cloud/automl/v1beta1/automl/client.rb +52 -25
  4. data/lib/google/cloud/automl/v1beta1/automl/operations.rb +19 -15
  5. data/lib/google/cloud/automl/v1beta1/automl/rest/client.rb +52 -25
  6. data/lib/google/cloud/automl/v1beta1/automl/rest/operations.rb +59 -45
  7. data/lib/google/cloud/automl/v1beta1/automl/rest/service_stub.rb +206 -146
  8. data/lib/google/cloud/automl/v1beta1/prediction_service/client.rb +35 -3
  9. data/lib/google/cloud/automl/v1beta1/prediction_service/operations.rb +19 -15
  10. data/lib/google/cloud/automl/v1beta1/prediction_service/rest/client.rb +35 -3
  11. data/lib/google/cloud/automl/v1beta1/prediction_service/rest/operations.rb +59 -45
  12. data/lib/google/cloud/automl/v1beta1/prediction_service/rest/service_stub.rb +30 -14
  13. data/lib/google/cloud/automl/v1beta1/version.rb +1 -1
  14. data/proto_docs/google/api/client.rb +39 -0
  15. data/proto_docs/google/cloud/automl/v1beta1/annotation_payload.rb +16 -0
  16. data/proto_docs/google/cloud/automl/v1beta1/data_items.rb +12 -0
  17. data/proto_docs/google/cloud/automl/v1beta1/data_stats.rb +12 -0
  18. data/proto_docs/google/cloud/automl/v1beta1/data_types.rb +6 -0
  19. data/proto_docs/google/cloud/automl/v1beta1/dataset.rb +18 -0
  20. data/proto_docs/google/cloud/automl/v1beta1/io.rb +20 -0
  21. data/proto_docs/google/cloud/automl/v1beta1/model.rb +18 -0
  22. data/proto_docs/google/cloud/automl/v1beta1/model_evaluation.rb +14 -0
  23. data/proto_docs/google/cloud/automl/v1beta1/operations.rb +26 -0
  24. data/proto_docs/google/cloud/automl/v1beta1/service.rb +4 -0
  25. data/proto_docs/google/cloud/automl/v1beta1/tables.rb +4 -0
  26. data/proto_docs/google/longrunning/operations.rb +23 -14
  27. data/proto_docs/google/protobuf/struct.rb +12 -0
  28. metadata +6 -9
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a1fcf3c9bd2553e6d59b69f8a1b237bd2f9b7c69bbbfa5d34339a49d300420a1
4
- data.tar.gz: fcdb4b58be3d090d2c17c2d4f0ae345e6ec75b007cd423049d9813c519a6c03a
3
+ metadata.gz: 3438d26efcc98928ecf792d58b611d04f3ff2eec1664330acd0b08ff97c92d0e
4
+ data.tar.gz: 8f97bb1601135990da8b0637030fee14dfe2be80aac88ea2a2e13da8f4eed4f8
5
5
  SHA512:
6
- metadata.gz: a1cea43c8d15010f5e2979c1178bd5df813a4d08a47e1c50f6ab2a56e7ba346b095425e50b1e6acdf3c9bf8b958b76c535fc894d06719fad169e63bb1f7d32ed
7
- data.tar.gz: e2a1cdf90a97fd2cba23f5d436262aefaed8d97846ff02cbd435f5173860ee7fb7a7482a678c6664e7faa277ac3e63ed6b04efea6dae7cd3206a57bc5d36e73b
6
+ metadata.gz: fb13b701f2cdb972dd2775c5dd06e92ed256adff4eca78f6e75002cb2edeb9e11b8e0b8fa2d0a3e29226d0bb48aeb9336b0225d1ed37de7ac36c7aac12e53d82
7
+ data.tar.gz: 9db6d2bf84ee6dc88a082d198c9ad7c3fdfb755eb144354a05359b4d79b4e5281217fe2eb1f9a2fbed4b58102e3b592d966ef7341b017f81494d24f0b81a5bbe
data/README.md CHANGED
@@ -43,40 +43,50 @@ for class and method documentation.
43
43
  See also the [Product Documentation](https://cloud.google.com/automl)
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/automl/v1beta1"
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::AutoML::V1beta1::PredictionService::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).
76
86
 
77
87
  ## Supported Ruby Versions
78
88
 
79
- This library is supported on Ruby 2.7+.
89
+ This library is supported on Ruby 3.0+.
80
90
 
81
91
  Google provides official support for Ruby versions that are actively supported
82
92
  by Ruby Core—that is, Ruby versions that are either in normal maintenance or
@@ -261,8 +261,19 @@ module Google
261
261
  universe_domain: @config.universe_domain,
262
262
  channel_args: @config.channel_args,
263
263
  interceptors: @config.interceptors,
264
- channel_pool_config: @config.channel_pool
264
+ channel_pool_config: @config.channel_pool,
265
+ logger: @config.logger
265
266
  )
267
+
268
+ @auto_ml_stub.stub_logger&.info do |entry|
269
+ entry.set_system_name
270
+ entry.set_service
271
+ entry.message = "Created client for #{entry.service}"
272
+ entry.set_credentials_fields credentials
273
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
274
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
275
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
276
+ end
266
277
  end
267
278
 
268
279
  ##
@@ -272,6 +283,15 @@ module Google
272
283
  #
273
284
  attr_reader :operations_client
274
285
 
286
+ ##
287
+ # The logger used for request/response debug logging.
288
+ #
289
+ # @return [Logger]
290
+ #
291
+ def logger
292
+ @auto_ml_stub.logger
293
+ end
294
+
275
295
  # Service calls
276
296
 
277
297
  ##
@@ -356,7 +376,6 @@ module Google
356
376
 
357
377
  @auto_ml_stub.call_rpc :create_dataset, request, options: options do |response, operation|
358
378
  yield response, operation if block_given?
359
- return response
360
379
  end
361
380
  rescue ::GRPC::BadStatus => e
362
381
  raise ::Google::Cloud::Error.from_error(e)
@@ -442,7 +461,6 @@ module Google
442
461
 
443
462
  @auto_ml_stub.call_rpc :get_dataset, request, options: options do |response, operation|
444
463
  yield response, operation if block_given?
445
- return response
446
464
  end
447
465
  rescue ::GRPC::BadStatus => e
448
466
  raise ::Google::Cloud::Error.from_error(e)
@@ -550,7 +568,7 @@ module Google
550
568
  @auto_ml_stub.call_rpc :list_datasets, request, options: options do |response, operation|
551
569
  response = ::Gapic::PagedEnumerable.new @auto_ml_stub, :list_datasets, request, response, operation, options
552
570
  yield response, operation if block_given?
553
- return response
571
+ throw :response, response
554
572
  end
555
573
  rescue ::GRPC::BadStatus => e
556
574
  raise ::Google::Cloud::Error.from_error(e)
@@ -638,7 +656,6 @@ module Google
638
656
 
639
657
  @auto_ml_stub.call_rpc :update_dataset, request, options: options do |response, operation|
640
658
  yield response, operation if block_given?
641
- return response
642
659
  end
643
660
  rescue ::GRPC::BadStatus => e
644
661
  raise ::Google::Cloud::Error.from_error(e)
@@ -736,7 +753,7 @@ module Google
736
753
  @auto_ml_stub.call_rpc :delete_dataset, request, options: options do |response, operation|
737
754
  response = ::Gapic::Operation.new response, @operations_client, options: options
738
755
  yield response, operation if block_given?
739
- return response
756
+ throw :response, response
740
757
  end
741
758
  rescue ::GRPC::BadStatus => e
742
759
  raise ::Google::Cloud::Error.from_error(e)
@@ -842,7 +859,7 @@ module Google
842
859
  @auto_ml_stub.call_rpc :import_data, request, options: options do |response, operation|
843
860
  response = ::Gapic::Operation.new response, @operations_client, options: options
844
861
  yield response, operation if block_given?
845
- return response
862
+ throw :response, response
846
863
  end
847
864
  rescue ::GRPC::BadStatus => e
848
865
  raise ::Google::Cloud::Error.from_error(e)
@@ -940,7 +957,7 @@ module Google
940
957
  @auto_ml_stub.call_rpc :export_data, request, options: options do |response, operation|
941
958
  response = ::Gapic::Operation.new response, @operations_client, options: options
942
959
  yield response, operation if block_given?
943
- return response
960
+ throw :response, response
944
961
  end
945
962
  rescue ::GRPC::BadStatus => e
946
963
  raise ::Google::Cloud::Error.from_error(e)
@@ -1026,7 +1043,6 @@ module Google
1026
1043
 
1027
1044
  @auto_ml_stub.call_rpc :get_annotation_spec, request, options: options do |response, operation|
1028
1045
  yield response, operation if block_given?
1029
- return response
1030
1046
  end
1031
1047
  rescue ::GRPC::BadStatus => e
1032
1048
  raise ::Google::Cloud::Error.from_error(e)
@@ -1114,7 +1130,6 @@ module Google
1114
1130
 
1115
1131
  @auto_ml_stub.call_rpc :get_table_spec, request, options: options do |response, operation|
1116
1132
  yield response, operation if block_given?
1117
- return response
1118
1133
  end
1119
1134
  rescue ::GRPC::BadStatus => e
1120
1135
  raise ::Google::Cloud::Error.from_error(e)
@@ -1217,7 +1232,7 @@ module Google
1217
1232
  @auto_ml_stub.call_rpc :list_table_specs, request, options: options do |response, operation|
1218
1233
  response = ::Gapic::PagedEnumerable.new @auto_ml_stub, :list_table_specs, request, response, operation, options
1219
1234
  yield response, operation if block_given?
1220
- return response
1235
+ throw :response, response
1221
1236
  end
1222
1237
  rescue ::GRPC::BadStatus => e
1223
1238
  raise ::Google::Cloud::Error.from_error(e)
@@ -1305,7 +1320,6 @@ module Google
1305
1320
 
1306
1321
  @auto_ml_stub.call_rpc :update_table_spec, request, options: options do |response, operation|
1307
1322
  yield response, operation if block_given?
1308
- return response
1309
1323
  end
1310
1324
  rescue ::GRPC::BadStatus => e
1311
1325
  raise ::Google::Cloud::Error.from_error(e)
@@ -1393,7 +1407,6 @@ module Google
1393
1407
 
1394
1408
  @auto_ml_stub.call_rpc :get_column_spec, request, options: options do |response, operation|
1395
1409
  yield response, operation if block_given?
1396
- return response
1397
1410
  end
1398
1411
  rescue ::GRPC::BadStatus => e
1399
1412
  raise ::Google::Cloud::Error.from_error(e)
@@ -1496,7 +1509,7 @@ module Google
1496
1509
  @auto_ml_stub.call_rpc :list_column_specs, request, options: options do |response, operation|
1497
1510
  response = ::Gapic::PagedEnumerable.new @auto_ml_stub, :list_column_specs, request, response, operation, options
1498
1511
  yield response, operation if block_given?
1499
- return response
1512
+ throw :response, response
1500
1513
  end
1501
1514
  rescue ::GRPC::BadStatus => e
1502
1515
  raise ::Google::Cloud::Error.from_error(e)
@@ -1584,7 +1597,6 @@ module Google
1584
1597
 
1585
1598
  @auto_ml_stub.call_rpc :update_column_spec, request, options: options do |response, operation|
1586
1599
  yield response, operation if block_given?
1587
- return response
1588
1600
  end
1589
1601
  rescue ::GRPC::BadStatus => e
1590
1602
  raise ::Google::Cloud::Error.from_error(e)
@@ -1684,7 +1696,7 @@ module Google
1684
1696
  @auto_ml_stub.call_rpc :create_model, request, options: options do |response, operation|
1685
1697
  response = ::Gapic::Operation.new response, @operations_client, options: options
1686
1698
  yield response, operation if block_given?
1687
- return response
1699
+ throw :response, response
1688
1700
  end
1689
1701
  rescue ::GRPC::BadStatus => e
1690
1702
  raise ::Google::Cloud::Error.from_error(e)
@@ -1770,7 +1782,6 @@ module Google
1770
1782
 
1771
1783
  @auto_ml_stub.call_rpc :get_model, request, options: options do |response, operation|
1772
1784
  yield response, operation if block_given?
1773
- return response
1774
1785
  end
1775
1786
  rescue ::GRPC::BadStatus => e
1776
1787
  raise ::Google::Cloud::Error.from_error(e)
@@ -1878,7 +1889,7 @@ module Google
1878
1889
  @auto_ml_stub.call_rpc :list_models, request, options: options do |response, operation|
1879
1890
  response = ::Gapic::PagedEnumerable.new @auto_ml_stub, :list_models, request, response, operation, options
1880
1891
  yield response, operation if block_given?
1881
- return response
1892
+ throw :response, response
1882
1893
  end
1883
1894
  rescue ::GRPC::BadStatus => e
1884
1895
  raise ::Google::Cloud::Error.from_error(e)
@@ -1976,7 +1987,7 @@ module Google
1976
1987
  @auto_ml_stub.call_rpc :delete_model, request, options: options do |response, operation|
1977
1988
  response = ::Gapic::Operation.new response, @operations_client, options: options
1978
1989
  yield response, operation if block_given?
1979
- return response
1990
+ throw :response, response
1980
1991
  end
1981
1992
  rescue ::GRPC::BadStatus => e
1982
1993
  raise ::Google::Cloud::Error.from_error(e)
@@ -2013,8 +2024,12 @@ module Google
2013
2024
  #
2014
2025
  # @param image_object_detection_model_deployment_metadata [::Google::Cloud::AutoML::V1beta1::ImageObjectDetectionModelDeploymentMetadata, ::Hash]
2015
2026
  # Model deployment metadata specific to Image Object Detection.
2027
+ #
2028
+ # Note: The following fields are mutually exclusive: `image_object_detection_model_deployment_metadata`, `image_classification_model_deployment_metadata`. If a field in that set is populated, all other fields in the set will automatically be cleared.
2016
2029
  # @param image_classification_model_deployment_metadata [::Google::Cloud::AutoML::V1beta1::ImageClassificationModelDeploymentMetadata, ::Hash]
2017
2030
  # Model deployment metadata specific to Image Classification.
2031
+ #
2032
+ # Note: The following fields are mutually exclusive: `image_classification_model_deployment_metadata`, `image_object_detection_model_deployment_metadata`. If a field in that set is populated, all other fields in the set will automatically be cleared.
2018
2033
  # @param name [::String]
2019
2034
  # Required. Resource name of the model to deploy.
2020
2035
  #
@@ -2085,7 +2100,7 @@ module Google
2085
2100
  @auto_ml_stub.call_rpc :deploy_model, request, options: options do |response, operation|
2086
2101
  response = ::Gapic::Operation.new response, @operations_client, options: options
2087
2102
  yield response, operation if block_given?
2088
- return response
2103
+ throw :response, response
2089
2104
  end
2090
2105
  rescue ::GRPC::BadStatus => e
2091
2106
  raise ::Google::Cloud::Error.from_error(e)
@@ -2185,7 +2200,7 @@ module Google
2185
2200
  @auto_ml_stub.call_rpc :undeploy_model, request, options: options do |response, operation|
2186
2201
  response = ::Gapic::Operation.new response, @operations_client, options: options
2187
2202
  yield response, operation if block_given?
2188
- return response
2203
+ throw :response, response
2189
2204
  end
2190
2205
  rescue ::GRPC::BadStatus => e
2191
2206
  raise ::Google::Cloud::Error.from_error(e)
@@ -2288,7 +2303,7 @@ module Google
2288
2303
  @auto_ml_stub.call_rpc :export_model, request, options: options do |response, operation|
2289
2304
  response = ::Gapic::Operation.new response, @operations_client, options: options
2290
2305
  yield response, operation if block_given?
2291
- return response
2306
+ throw :response, response
2292
2307
  end
2293
2308
  rescue ::GRPC::BadStatus => e
2294
2309
  raise ::Google::Cloud::Error.from_error(e)
@@ -2398,7 +2413,7 @@ module Google
2398
2413
  @auto_ml_stub.call_rpc :export_evaluated_examples, request, options: options do |response, operation|
2399
2414
  response = ::Gapic::Operation.new response, @operations_client, options: options
2400
2415
  yield response, operation if block_given?
2401
- return response
2416
+ throw :response, response
2402
2417
  end
2403
2418
  rescue ::GRPC::BadStatus => e
2404
2419
  raise ::Google::Cloud::Error.from_error(e)
@@ -2484,7 +2499,6 @@ module Google
2484
2499
 
2485
2500
  @auto_ml_stub.call_rpc :get_model_evaluation, request, options: options do |response, operation|
2486
2501
  yield response, operation if block_given?
2487
- return response
2488
2502
  end
2489
2503
  rescue ::GRPC::BadStatus => e
2490
2504
  raise ::Google::Cloud::Error.from_error(e)
@@ -2596,7 +2610,7 @@ module Google
2596
2610
  @auto_ml_stub.call_rpc :list_model_evaluations, request, options: options do |response, operation|
2597
2611
  response = ::Gapic::PagedEnumerable.new @auto_ml_stub, :list_model_evaluations, request, response, operation, options
2598
2612
  yield response, operation if block_given?
2599
- return response
2613
+ throw :response, response
2600
2614
  end
2601
2615
  rescue ::GRPC::BadStatus => e
2602
2616
  raise ::Google::Cloud::Error.from_error(e)
@@ -2646,6 +2660,13 @@ module Google
2646
2660
  # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
2647
2661
  # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
2648
2662
  # * (`nil`) indicating no credentials
2663
+ #
2664
+ # Warning: If you accept a credential configuration (JSON file or Hash) from an
2665
+ # external source for authentication to Google Cloud, you must validate it before
2666
+ # providing it to a Google API client library. Providing an unvalidated credential
2667
+ # configuration to Google APIs can compromise the security of your systems and data.
2668
+ # For more information, refer to [Validate credential configurations from external
2669
+ # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
2649
2670
  # @return [::Object]
2650
2671
  # @!attribute [rw] scope
2651
2672
  # The OAuth scopes
@@ -2685,6 +2706,11 @@ module Google
2685
2706
  # default endpoint URL. The default value of nil uses the environment
2686
2707
  # universe (usually the default "googleapis.com" universe).
2687
2708
  # @return [::String,nil]
2709
+ # @!attribute [rw] logger
2710
+ # A custom logger to use for request/response debug logging, or the value
2711
+ # `:default` (the default) to construct a default logger, or `nil` to
2712
+ # explicitly disable logging.
2713
+ # @return [::Logger,:default,nil]
2688
2714
  #
2689
2715
  class Configuration
2690
2716
  extend ::Gapic::Config
@@ -2709,6 +2735,7 @@ module Google
2709
2735
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
2710
2736
  config_attr :quota_project, nil, ::String, nil
2711
2737
  config_attr :universe_domain, nil, ::String, nil
2738
+ config_attr :logger, :default, ::Logger, nil, :default
2712
2739
 
2713
2740
  # @private
2714
2741
  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)
@@ -607,7 +598,7 @@ module Google
607
598
  @operations_stub.call_rpc :wait_operation, request, options: options do |response, operation|
608
599
  response = ::Gapic::Operation.new response, @operations_client, options: options
609
600
  yield response, operation if block_given?
610
- return response
601
+ throw :response, response
611
602
  end
612
603
  rescue ::GRPC::BadStatus => e
613
604
  raise ::Google::Cloud::Error.from_error(e)
@@ -657,6 +648,13 @@ module Google
657
648
  # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
658
649
  # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
659
650
  # * (`nil`) indicating no credentials
651
+ #
652
+ # Warning: If you accept a credential configuration (JSON file or Hash) from an
653
+ # external source for authentication to Google Cloud, you must validate it before
654
+ # providing it to a Google API client library. Providing an unvalidated credential
655
+ # configuration to Google APIs can compromise the security of your systems and data.
656
+ # For more information, refer to [Validate credential configurations from external
657
+ # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
660
658
  # @return [::Object]
661
659
  # @!attribute [rw] scope
662
660
  # The OAuth scopes
@@ -696,6 +694,11 @@ module Google
696
694
  # default endpoint URL. The default value of nil uses the environment
697
695
  # universe (usually the default "googleapis.com" universe).
698
696
  # @return [::String,nil]
697
+ # @!attribute [rw] logger
698
+ # A custom logger to use for request/response debug logging, or the value
699
+ # `:default` (the default) to construct a default logger, or `nil` to
700
+ # explicitly disable logging.
701
+ # @return [::Logger,:default,nil]
699
702
  #
700
703
  class Configuration
701
704
  extend ::Gapic::Config
@@ -720,6 +723,7 @@ module Google
720
723
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
721
724
  config_attr :quota_project, nil, ::String, nil
722
725
  config_attr :universe_domain, nil, ::String, nil
726
+ config_attr :logger, :default, ::Logger, nil, :default
723
727
 
724
728
  # @private
725
729
  def initialize parent_config = nil