google-cloud-document_ai-v1beta3 0.37.0 → 0.39.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (24) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +31 -21
  3. data/lib/google/cloud/document_ai/v1beta3/document_processor_service/client.rb +68 -27
  4. data/lib/google/cloud/document_ai/v1beta3/document_processor_service/operations.rb +19 -15
  5. data/lib/google/cloud/document_ai/v1beta3/document_processor_service/rest/client.rb +68 -27
  6. data/lib/google/cloud/document_ai/v1beta3/document_processor_service/rest/operations.rb +50 -38
  7. data/lib/google/cloud/document_ai/v1beta3/document_processor_service/rest/service_stub.rb +198 -140
  8. data/lib/google/cloud/document_ai/v1beta3/document_service/client.rb +39 -8
  9. data/lib/google/cloud/document_ai/v1beta3/document_service/operations.rb +19 -15
  10. data/lib/google/cloud/document_ai/v1beta3/document_service/rest/client.rb +39 -8
  11. data/lib/google/cloud/document_ai/v1beta3/document_service/rest/operations.rb +50 -38
  12. data/lib/google/cloud/document_ai/v1beta3/document_service/rest/service_stub.rb +70 -44
  13. data/lib/google/cloud/document_ai/v1beta3/version.rb +1 -1
  14. data/lib/google/cloud/documentai/v1beta3/dataset_pb.rb +1 -1
  15. data/proto_docs/google/api/client.rb +39 -0
  16. data/proto_docs/google/cloud/documentai/v1beta3/dataset.rb +20 -0
  17. data/proto_docs/google/cloud/documentai/v1beta3/document.rb +34 -0
  18. data/proto_docs/google/cloud/documentai/v1beta3/document_io.rb +4 -0
  19. data/proto_docs/google/cloud/documentai/v1beta3/document_processor_service.rb +20 -0
  20. data/proto_docs/google/cloud/documentai/v1beta3/document_service.rb +4 -0
  21. data/proto_docs/google/cloud/documentai/v1beta3/processor.rb +4 -0
  22. data/proto_docs/google/longrunning/operations.rb +23 -14
  23. data/proto_docs/google/type/datetime.rb +4 -0
  24. metadata +6 -9
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f8de579b7a9ff1c66c2a433d059c8484f516b5f297a98f9e588ae2d944523435
4
- data.tar.gz: f0bd35e8ce2ebe2647d310822c3e0ffd77ccf56b0819df15dd41ea0722317c90
3
+ metadata.gz: d50a6a5de154cf67eca2835276279b8eafe835162d0c7809a18d77aad96d0cef
4
+ data.tar.gz: 1dd31929ec95c5f08cdc29caef3a2f672d5459a574e43fb49484c1525c97c167
5
5
  SHA512:
6
- metadata.gz: a96931556cff97b33657f0efd386d80ff1cb32918c7d21f9f5c9fec3f0eb217ce33a7e4b15ddfa312d7ceb928c66f0c0acc70b192c079a90c83239d2411771bf
7
- data.tar.gz: 75ff0f64f9b58bf6121efacd53b1e5d0302acf339da499dce6b4f21d59e31df2c2e7a2468868ebe8b77dd97e3e7d91cff91bf85dbda49706fef999595a41d8e0
6
+ metadata.gz: d20752d8d076782f6dd1cc94b2c9c7646484499c3c03eb10389e7d3baec48f654fc166605e7fd8f38a1ce020f7495e7b500ad4f3e06b52873aecbf79a20d131b
7
+ data.tar.gz: ebddd9d2a06be7723ace550a4ff82d2d8b076e4c06b17680fe40590e610c2de4230ea1962b7d4e7598d6934eb8424db87b0fb74cf35d6a4b537358bb19a68694
data/README.md CHANGED
@@ -43,40 +43,50 @@ for class and method documentation.
43
43
  See also the [Product Documentation](https://cloud.google.com/document-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/document_ai/v1beta3"
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::DocumentAI::V1beta3::DocumentProcessorService::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
@@ -76,17 +76,17 @@ module Google
76
76
 
77
77
  default_config.rpcs.process_document.timeout = 300.0
78
78
  default_config.rpcs.process_document.retry_policy = {
79
- initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
79
+ initial_delay: 1.0, max_delay: 90.0, multiplier: 9.0, retry_codes: [4, 14, 8]
80
80
  }
81
81
 
82
82
  default_config.rpcs.batch_process_documents.timeout = 120.0
83
83
  default_config.rpcs.batch_process_documents.retry_policy = {
84
- initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
84
+ initial_delay: 1.0, max_delay: 60.0, multiplier: 1.5, retry_codes: [4, 14]
85
85
  }
86
86
 
87
87
  default_config.rpcs.review_document.timeout = 120.0
88
88
  default_config.rpcs.review_document.retry_policy = {
89
- initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
89
+ initial_delay: 1.0, max_delay: 60.0, multiplier: 1.5, retry_codes: [4, 14]
90
90
  }
91
91
 
92
92
  default_config
@@ -183,14 +183,26 @@ module Google
183
183
  universe_domain: @config.universe_domain,
184
184
  channel_args: @config.channel_args,
185
185
  interceptors: @config.interceptors,
186
- channel_pool_config: @config.channel_pool
186
+ channel_pool_config: @config.channel_pool,
187
+ logger: @config.logger
187
188
  )
188
189
 
190
+ @document_processor_service_stub.stub_logger&.info do |entry|
191
+ entry.set_system_name
192
+ entry.set_service
193
+ entry.message = "Created client for #{entry.service}"
194
+ entry.set_credentials_fields credentials
195
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
196
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
197
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
198
+ end
199
+
189
200
  @location_client = Google::Cloud::Location::Locations::Client.new do |config|
190
201
  config.credentials = credentials
191
202
  config.quota_project = @quota_project_id
192
203
  config.endpoint = @document_processor_service_stub.endpoint
193
204
  config.universe_domain = @document_processor_service_stub.universe_domain
205
+ config.logger = @document_processor_service_stub.logger if config.respond_to? :logger=
194
206
  end
195
207
  end
196
208
 
@@ -208,6 +220,15 @@ module Google
208
220
  #
209
221
  attr_reader :location_client
210
222
 
223
+ ##
224
+ # The logger used for request/response debug logging.
225
+ #
226
+ # @return [Logger]
227
+ #
228
+ def logger
229
+ @document_processor_service_stub.logger
230
+ end
231
+
211
232
  # Service calls
212
233
 
213
234
  ##
@@ -230,10 +251,16 @@ module Google
230
251
  #
231
252
  # @param inline_document [::Google::Cloud::DocumentAI::V1beta3::Document, ::Hash]
232
253
  # An inline document proto.
254
+ #
255
+ # Note: The following fields are mutually exclusive: `inline_document`, `raw_document`, `gcs_document`. If a field in that set is populated, all other fields in the set will automatically be cleared.
233
256
  # @param raw_document [::Google::Cloud::DocumentAI::V1beta3::RawDocument, ::Hash]
234
257
  # A raw document content (bytes).
258
+ #
259
+ # Note: The following fields are mutually exclusive: `raw_document`, `inline_document`, `gcs_document`. If a field in that set is populated, all other fields in the set will automatically be cleared.
235
260
  # @param gcs_document [::Google::Cloud::DocumentAI::V1beta3::GcsDocument, ::Hash]
236
261
  # A raw document on Google Cloud Storage.
262
+ #
263
+ # Note: The following fields are mutually exclusive: `gcs_document`, `inline_document`, `raw_document`. If a field in that set is populated, all other fields in the set will automatically be cleared.
237
264
  # @param name [::String]
238
265
  # Required. The resource name of the
239
266
  # {::Google::Cloud::DocumentAI::V1beta3::Processor Processor} or
@@ -329,7 +356,6 @@ module Google
329
356
 
330
357
  @document_processor_service_stub.call_rpc :process_document, request, options: options do |response, operation|
331
358
  yield response, operation if block_given?
332
- return response
333
359
  end
334
360
  rescue ::GRPC::BadStatus => e
335
361
  raise ::Google::Cloud::Error.from_error(e)
@@ -453,7 +479,7 @@ module Google
453
479
  @document_processor_service_stub.call_rpc :batch_process_documents, request, options: options do |response, operation|
454
480
  response = ::Gapic::Operation.new response, @operations_client, options: options
455
481
  yield response, operation if block_given?
456
- return response
482
+ throw :response, response
457
483
  end
458
484
  rescue ::GRPC::BadStatus => e
459
485
  raise ::Google::Cloud::Error.from_error(e)
@@ -542,7 +568,6 @@ module Google
542
568
 
543
569
  @document_processor_service_stub.call_rpc :fetch_processor_types, request, options: options do |response, operation|
544
570
  yield response, operation if block_given?
545
- return response
546
571
  end
547
572
  rescue ::GRPC::BadStatus => e
548
573
  raise ::Google::Cloud::Error.from_error(e)
@@ -640,7 +665,7 @@ module Google
640
665
  @document_processor_service_stub.call_rpc :list_processor_types, request, options: options do |response, operation|
641
666
  response = ::Gapic::PagedEnumerable.new @document_processor_service_stub, :list_processor_types, request, response, operation, options
642
667
  yield response, operation if block_given?
643
- return response
668
+ throw :response, response
644
669
  end
645
670
  rescue ::GRPC::BadStatus => e
646
671
  raise ::Google::Cloud::Error.from_error(e)
@@ -726,7 +751,6 @@ module Google
726
751
 
727
752
  @document_processor_service_stub.call_rpc :get_processor_type, request, options: options do |response, operation|
728
753
  yield response, operation if block_given?
729
- return response
730
754
  end
731
755
  rescue ::GRPC::BadStatus => e
732
756
  raise ::Google::Cloud::Error.from_error(e)
@@ -825,7 +849,7 @@ module Google
825
849
  @document_processor_service_stub.call_rpc :list_processors, request, options: options do |response, operation|
826
850
  response = ::Gapic::PagedEnumerable.new @document_processor_service_stub, :list_processors, request, response, operation, options
827
851
  yield response, operation if block_given?
828
- return response
852
+ throw :response, response
829
853
  end
830
854
  rescue ::GRPC::BadStatus => e
831
855
  raise ::Google::Cloud::Error.from_error(e)
@@ -911,7 +935,6 @@ module Google
911
935
 
912
936
  @document_processor_service_stub.call_rpc :get_processor, request, options: options do |response, operation|
913
937
  yield response, operation if block_given?
914
- return response
915
938
  end
916
939
  rescue ::GRPC::BadStatus => e
917
940
  raise ::Google::Cloud::Error.from_error(e)
@@ -939,8 +962,12 @@ module Google
939
962
  #
940
963
  # @param custom_document_extraction_options [::Google::Cloud::DocumentAI::V1beta3::TrainProcessorVersionRequest::CustomDocumentExtractionOptions, ::Hash]
941
964
  # Options to control Custom Document Extraction (CDE) Processor.
965
+ #
966
+ # Note: The following fields are mutually exclusive: `custom_document_extraction_options`, `foundation_model_tuning_options`. If a field in that set is populated, all other fields in the set will automatically be cleared.
942
967
  # @param foundation_model_tuning_options [::Google::Cloud::DocumentAI::V1beta3::TrainProcessorVersionRequest::FoundationModelTuningOptions, ::Hash]
943
968
  # Options to control foundation model tuning of a processor.
969
+ #
970
+ # Note: The following fields are mutually exclusive: `foundation_model_tuning_options`, `custom_document_extraction_options`. If a field in that set is populated, all other fields in the set will automatically be cleared.
944
971
  # @param parent [::String]
945
972
  # Required. The parent (project, location and processor) to create the new
946
973
  # version for. Format:
@@ -1024,7 +1051,7 @@ module Google
1024
1051
  @document_processor_service_stub.call_rpc :train_processor_version, request, options: options do |response, operation|
1025
1052
  response = ::Gapic::Operation.new response, @operations_client, options: options
1026
1053
  yield response, operation if block_given?
1027
- return response
1054
+ throw :response, response
1028
1055
  end
1029
1056
  rescue ::GRPC::BadStatus => e
1030
1057
  raise ::Google::Cloud::Error.from_error(e)
@@ -1110,7 +1137,6 @@ module Google
1110
1137
 
1111
1138
  @document_processor_service_stub.call_rpc :get_processor_version, request, options: options do |response, operation|
1112
1139
  yield response, operation if block_given?
1113
- return response
1114
1140
  end
1115
1141
  rescue ::GRPC::BadStatus => e
1116
1142
  raise ::Google::Cloud::Error.from_error(e)
@@ -1210,7 +1236,7 @@ module Google
1210
1236
  @document_processor_service_stub.call_rpc :list_processor_versions, request, options: options do |response, operation|
1211
1237
  response = ::Gapic::PagedEnumerable.new @document_processor_service_stub, :list_processor_versions, request, response, operation, options
1212
1238
  yield response, operation if block_given?
1213
- return response
1239
+ throw :response, response
1214
1240
  end
1215
1241
  rescue ::GRPC::BadStatus => e
1216
1242
  raise ::Google::Cloud::Error.from_error(e)
@@ -1305,7 +1331,7 @@ module Google
1305
1331
  @document_processor_service_stub.call_rpc :delete_processor_version, request, options: options do |response, operation|
1306
1332
  response = ::Gapic::Operation.new response, @operations_client, options: options
1307
1333
  yield response, operation if block_given?
1308
- return response
1334
+ throw :response, response
1309
1335
  end
1310
1336
  rescue ::GRPC::BadStatus => e
1311
1337
  raise ::Google::Cloud::Error.from_error(e)
@@ -1399,7 +1425,7 @@ module Google
1399
1425
  @document_processor_service_stub.call_rpc :deploy_processor_version, request, options: options do |response, operation|
1400
1426
  response = ::Gapic::Operation.new response, @operations_client, options: options
1401
1427
  yield response, operation if block_given?
1402
- return response
1428
+ throw :response, response
1403
1429
  end
1404
1430
  rescue ::GRPC::BadStatus => e
1405
1431
  raise ::Google::Cloud::Error.from_error(e)
@@ -1493,7 +1519,7 @@ module Google
1493
1519
  @document_processor_service_stub.call_rpc :undeploy_processor_version, request, options: options do |response, operation|
1494
1520
  response = ::Gapic::Operation.new response, @operations_client, options: options
1495
1521
  yield response, operation if block_given?
1496
- return response
1522
+ throw :response, response
1497
1523
  end
1498
1524
  rescue ::GRPC::BadStatus => e
1499
1525
  raise ::Google::Cloud::Error.from_error(e)
@@ -1593,7 +1619,6 @@ module Google
1593
1619
 
1594
1620
  @document_processor_service_stub.call_rpc :create_processor, request, options: options do |response, operation|
1595
1621
  yield response, operation if block_given?
1596
- return response
1597
1622
  end
1598
1623
  rescue ::GRPC::BadStatus => e
1599
1624
  raise ::Google::Cloud::Error.from_error(e)
@@ -1688,7 +1713,7 @@ module Google
1688
1713
  @document_processor_service_stub.call_rpc :delete_processor, request, options: options do |response, operation|
1689
1714
  response = ::Gapic::Operation.new response, @operations_client, options: options
1690
1715
  yield response, operation if block_given?
1691
- return response
1716
+ throw :response, response
1692
1717
  end
1693
1718
  rescue ::GRPC::BadStatus => e
1694
1719
  raise ::Google::Cloud::Error.from_error(e)
@@ -1782,7 +1807,7 @@ module Google
1782
1807
  @document_processor_service_stub.call_rpc :enable_processor, request, options: options do |response, operation|
1783
1808
  response = ::Gapic::Operation.new response, @operations_client, options: options
1784
1809
  yield response, operation if block_given?
1785
- return response
1810
+ throw :response, response
1786
1811
  end
1787
1812
  rescue ::GRPC::BadStatus => e
1788
1813
  raise ::Google::Cloud::Error.from_error(e)
@@ -1876,7 +1901,7 @@ module Google
1876
1901
  @document_processor_service_stub.call_rpc :disable_processor, request, options: options do |response, operation|
1877
1902
  response = ::Gapic::Operation.new response, @operations_client, options: options
1878
1903
  yield response, operation if block_given?
1879
- return response
1904
+ throw :response, response
1880
1905
  end
1881
1906
  rescue ::GRPC::BadStatus => e
1882
1907
  raise ::Google::Cloud::Error.from_error(e)
@@ -1981,7 +2006,7 @@ module Google
1981
2006
  @document_processor_service_stub.call_rpc :set_default_processor_version, request, options: options do |response, operation|
1982
2007
  response = ::Gapic::Operation.new response, @operations_client, options: options
1983
2008
  yield response, operation if block_given?
1984
- return response
2009
+ throw :response, response
1985
2010
  end
1986
2011
  rescue ::GRPC::BadStatus => e
1987
2012
  raise ::Google::Cloud::Error.from_error(e)
@@ -2088,7 +2113,7 @@ module Google
2088
2113
  @document_processor_service_stub.call_rpc :review_document, request, options: options do |response, operation|
2089
2114
  response = ::Gapic::Operation.new response, @operations_client, options: options
2090
2115
  yield response, operation if block_given?
2091
- return response
2116
+ throw :response, response
2092
2117
  end
2093
2118
  rescue ::GRPC::BadStatus => e
2094
2119
  raise ::Google::Cloud::Error.from_error(e)
@@ -2189,7 +2214,7 @@ module Google
2189
2214
  @document_processor_service_stub.call_rpc :evaluate_processor_version, request, options: options do |response, operation|
2190
2215
  response = ::Gapic::Operation.new response, @operations_client, options: options
2191
2216
  yield response, operation if block_given?
2192
- return response
2217
+ throw :response, response
2193
2218
  end
2194
2219
  rescue ::GRPC::BadStatus => e
2195
2220
  raise ::Google::Cloud::Error.from_error(e)
@@ -2277,7 +2302,6 @@ module Google
2277
2302
 
2278
2303
  @document_processor_service_stub.call_rpc :get_evaluation, request, options: options do |response, operation|
2279
2304
  yield response, operation if block_given?
2280
- return response
2281
2305
  end
2282
2306
  rescue ::GRPC::BadStatus => e
2283
2307
  raise ::Google::Cloud::Error.from_error(e)
@@ -2378,7 +2402,7 @@ module Google
2378
2402
  @document_processor_service_stub.call_rpc :list_evaluations, request, options: options do |response, operation|
2379
2403
  response = ::Gapic::PagedEnumerable.new @document_processor_service_stub, :list_evaluations, request, response, operation, options
2380
2404
  yield response, operation if block_given?
2381
- return response
2405
+ throw :response, response
2382
2406
  end
2383
2407
  rescue ::GRPC::BadStatus => e
2384
2408
  raise ::Google::Cloud::Error.from_error(e)
@@ -2407,9 +2431,13 @@ module Google
2407
2431
  # and destination processor need to be in the same environment and region.
2408
2432
  # Note that ProcessorVersions with `model_type` `MODEL_TYPE_LLM` are not
2409
2433
  # supported.
2434
+ #
2435
+ # Note: The following fields are mutually exclusive: `processor_version_source`, `external_processor_version_source`. If a field in that set is populated, all other fields in the set will automatically be cleared.
2410
2436
  # @param external_processor_version_source [::Google::Cloud::DocumentAI::V1beta3::ImportProcessorVersionRequest::ExternalProcessorVersionSource, ::Hash]
2411
2437
  # The source processor version to import from. It can be from a different
2412
2438
  # environment and region than the destination processor.
2439
+ #
2440
+ # Note: The following fields are mutually exclusive: `external_processor_version_source`, `processor_version_source`. If a field in that set is populated, all other fields in the set will automatically be cleared.
2413
2441
  # @param parent [::String]
2414
2442
  # Required. The destination processor name to create the processor version
2415
2443
  # in. Format:
@@ -2482,7 +2510,7 @@ module Google
2482
2510
  @document_processor_service_stub.call_rpc :import_processor_version, request, options: options do |response, operation|
2483
2511
  response = ::Gapic::Operation.new response, @operations_client, options: options
2484
2512
  yield response, operation if block_given?
2485
- return response
2513
+ throw :response, response
2486
2514
  end
2487
2515
  rescue ::GRPC::BadStatus => e
2488
2516
  raise ::Google::Cloud::Error.from_error(e)
@@ -2532,6 +2560,13 @@ module Google
2532
2560
  # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
2533
2561
  # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
2534
2562
  # * (`nil`) indicating no credentials
2563
+ #
2564
+ # Warning: If you accept a credential configuration (JSON file or Hash) from an
2565
+ # external source for authentication to Google Cloud, you must validate it before
2566
+ # providing it to a Google API client library. Providing an unvalidated credential
2567
+ # configuration to Google APIs can compromise the security of your systems and data.
2568
+ # For more information, refer to [Validate credential configurations from external
2569
+ # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
2535
2570
  # @return [::Object]
2536
2571
  # @!attribute [rw] scope
2537
2572
  # The OAuth scopes
@@ -2571,6 +2606,11 @@ module Google
2571
2606
  # default endpoint URL. The default value of nil uses the environment
2572
2607
  # universe (usually the default "googleapis.com" universe).
2573
2608
  # @return [::String,nil]
2609
+ # @!attribute [rw] logger
2610
+ # A custom logger to use for request/response debug logging, or the value
2611
+ # `:default` (the default) to construct a default logger, or `nil` to
2612
+ # explicitly disable logging.
2613
+ # @return [::Logger,:default,nil]
2574
2614
  #
2575
2615
  class Configuration
2576
2616
  extend ::Gapic::Config
@@ -2595,6 +2635,7 @@ module Google
2595
2635
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
2596
2636
  config_attr :quota_project, nil, ::String, nil
2597
2637
  config_attr :universe_domain, nil, ::String, nil
2638
+ config_attr :logger, :default, ::Logger, nil, :default
2598
2639
 
2599
2640
  # @private
2600
2641
  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)
@@ -649,6 +640,13 @@ module Google
649
640
  # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
650
641
  # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
651
642
  # * (`nil`) indicating no credentials
643
+ #
644
+ # Warning: If you accept a credential configuration (JSON file or Hash) from an
645
+ # external source for authentication to Google Cloud, you must validate it before
646
+ # providing it to a Google API client library. Providing an unvalidated credential
647
+ # configuration to Google APIs can compromise the security of your systems and data.
648
+ # For more information, refer to [Validate credential configurations from external
649
+ # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
652
650
  # @return [::Object]
653
651
  # @!attribute [rw] scope
654
652
  # The OAuth scopes
@@ -688,6 +686,11 @@ module Google
688
686
  # default endpoint URL. The default value of nil uses the environment
689
687
  # universe (usually the default "googleapis.com" universe).
690
688
  # @return [::String,nil]
689
+ # @!attribute [rw] logger
690
+ # A custom logger to use for request/response debug logging, or the value
691
+ # `:default` (the default) to construct a default logger, or `nil` to
692
+ # explicitly disable logging.
693
+ # @return [::Logger,:default,nil]
691
694
  #
692
695
  class Configuration
693
696
  extend ::Gapic::Config
@@ -712,6 +715,7 @@ module Google
712
715
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
713
716
  config_attr :quota_project, nil, ::String, nil
714
717
  config_attr :universe_domain, nil, ::String, nil
718
+ config_attr :logger, :default, ::Logger, nil, :default
715
719
 
716
720
  # @private
717
721
  def initialize parent_config = nil