google-cloud-document_ai-v1 1.2.0 → 1.4.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.
- checksums.yaml +4 -4
- data/README.md +31 -21
- data/lib/google/cloud/document_ai/v1/document_processor_service/client.rb +60 -23
- data/lib/google/cloud/document_ai/v1/document_processor_service/operations.rb +19 -15
- data/lib/google/cloud/document_ai/v1/document_processor_service/rest/client.rb +60 -23
- data/lib/google/cloud/document_ai/v1/document_processor_service/rest/operations.rb +50 -38
- data/lib/google/cloud/document_ai/v1/document_processor_service/rest/service_stub.rb +190 -134
- data/lib/google/cloud/document_ai/v1/version.rb +1 -1
- data/proto_docs/google/api/client.rb +39 -0
- data/proto_docs/google/cloud/documentai/v1/document.rb +28 -0
- data/proto_docs/google/cloud/documentai/v1/document_io.rb +4 -0
- data/proto_docs/google/cloud/documentai/v1/document_processor_service.rb +16 -0
- data/proto_docs/google/cloud/documentai/v1/processor.rb +4 -0
- data/proto_docs/google/longrunning/operations.rb +23 -14
- data/proto_docs/google/type/datetime.rb +4 -0
- metadata +6 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dec3f0db95cad200259cee64500d17614e7ae2a8b091e95f8d422e2152a4fee1
|
4
|
+
data.tar.gz: c6c7c3c1e246cc658126ef4422251598a6967b8b532e4d7bc4f372b84aaa6290
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 66f0d804bd07b34a6253e99352c65de2e8fbc0a5774c6c512fb04054f5047ad051385776d00542b23babf2cfbda5064d7997a8fc376999593c2caff6f0188004
|
7
|
+
data.tar.gz: 5efbb26b23bbf79a1c43c3e37b248049f3cb2f644c79b8150851b8c427521abfef9d195f7753cd42df6118213e35f49307d651cec2e12a42816b799f4f1bf89a
|
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
|
-
##
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
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/v1"
|
57
76
|
require "logger"
|
58
77
|
|
59
|
-
|
60
|
-
|
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::V1::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
|
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
|
@@ -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::V1::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::V1::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::V1::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::V1::Processor Processor} or
|
@@ -324,7 +351,6 @@ module Google
|
|
324
351
|
|
325
352
|
@document_processor_service_stub.call_rpc :process_document, request, options: options do |response, operation|
|
326
353
|
yield response, operation if block_given?
|
327
|
-
return response
|
328
354
|
end
|
329
355
|
rescue ::GRPC::BadStatus => e
|
330
356
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -444,7 +470,7 @@ module Google
|
|
444
470
|
@document_processor_service_stub.call_rpc :batch_process_documents, request, options: options do |response, operation|
|
445
471
|
response = ::Gapic::Operation.new response, @operations_client, options: options
|
446
472
|
yield response, operation if block_given?
|
447
|
-
|
473
|
+
throw :response, response
|
448
474
|
end
|
449
475
|
rescue ::GRPC::BadStatus => e
|
450
476
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -533,7 +559,6 @@ module Google
|
|
533
559
|
|
534
560
|
@document_processor_service_stub.call_rpc :fetch_processor_types, request, options: options do |response, operation|
|
535
561
|
yield response, operation if block_given?
|
536
|
-
return response
|
537
562
|
end
|
538
563
|
rescue ::GRPC::BadStatus => e
|
539
564
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -631,7 +656,7 @@ module Google
|
|
631
656
|
@document_processor_service_stub.call_rpc :list_processor_types, request, options: options do |response, operation|
|
632
657
|
response = ::Gapic::PagedEnumerable.new @document_processor_service_stub, :list_processor_types, request, response, operation, options
|
633
658
|
yield response, operation if block_given?
|
634
|
-
|
659
|
+
throw :response, response
|
635
660
|
end
|
636
661
|
rescue ::GRPC::BadStatus => e
|
637
662
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -717,7 +742,6 @@ module Google
|
|
717
742
|
|
718
743
|
@document_processor_service_stub.call_rpc :get_processor_type, request, options: options do |response, operation|
|
719
744
|
yield response, operation if block_given?
|
720
|
-
return response
|
721
745
|
end
|
722
746
|
rescue ::GRPC::BadStatus => e
|
723
747
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -816,7 +840,7 @@ module Google
|
|
816
840
|
@document_processor_service_stub.call_rpc :list_processors, request, options: options do |response, operation|
|
817
841
|
response = ::Gapic::PagedEnumerable.new @document_processor_service_stub, :list_processors, request, response, operation, options
|
818
842
|
yield response, operation if block_given?
|
819
|
-
|
843
|
+
throw :response, response
|
820
844
|
end
|
821
845
|
rescue ::GRPC::BadStatus => e
|
822
846
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -902,7 +926,6 @@ module Google
|
|
902
926
|
|
903
927
|
@document_processor_service_stub.call_rpc :get_processor, request, options: options do |response, operation|
|
904
928
|
yield response, operation if block_given?
|
905
|
-
return response
|
906
929
|
end
|
907
930
|
rescue ::GRPC::BadStatus => e
|
908
931
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -930,8 +953,12 @@ module Google
|
|
930
953
|
#
|
931
954
|
# @param custom_document_extraction_options [::Google::Cloud::DocumentAI::V1::TrainProcessorVersionRequest::CustomDocumentExtractionOptions, ::Hash]
|
932
955
|
# Options to control Custom Document Extraction (CDE) Processor.
|
956
|
+
#
|
957
|
+
# 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.
|
933
958
|
# @param foundation_model_tuning_options [::Google::Cloud::DocumentAI::V1::TrainProcessorVersionRequest::FoundationModelTuningOptions, ::Hash]
|
934
959
|
# Options to control foundation model tuning of a processor.
|
960
|
+
#
|
961
|
+
# 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.
|
935
962
|
# @param parent [::String]
|
936
963
|
# Required. The parent (project, location and processor) to create the new
|
937
964
|
# version for. Format:
|
@@ -1015,7 +1042,7 @@ module Google
|
|
1015
1042
|
@document_processor_service_stub.call_rpc :train_processor_version, request, options: options do |response, operation|
|
1016
1043
|
response = ::Gapic::Operation.new response, @operations_client, options: options
|
1017
1044
|
yield response, operation if block_given?
|
1018
|
-
|
1045
|
+
throw :response, response
|
1019
1046
|
end
|
1020
1047
|
rescue ::GRPC::BadStatus => e
|
1021
1048
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1101,7 +1128,6 @@ module Google
|
|
1101
1128
|
|
1102
1129
|
@document_processor_service_stub.call_rpc :get_processor_version, request, options: options do |response, operation|
|
1103
1130
|
yield response, operation if block_given?
|
1104
|
-
return response
|
1105
1131
|
end
|
1106
1132
|
rescue ::GRPC::BadStatus => e
|
1107
1133
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1201,7 +1227,7 @@ module Google
|
|
1201
1227
|
@document_processor_service_stub.call_rpc :list_processor_versions, request, options: options do |response, operation|
|
1202
1228
|
response = ::Gapic::PagedEnumerable.new @document_processor_service_stub, :list_processor_versions, request, response, operation, options
|
1203
1229
|
yield response, operation if block_given?
|
1204
|
-
|
1230
|
+
throw :response, response
|
1205
1231
|
end
|
1206
1232
|
rescue ::GRPC::BadStatus => e
|
1207
1233
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1296,7 +1322,7 @@ module Google
|
|
1296
1322
|
@document_processor_service_stub.call_rpc :delete_processor_version, request, options: options do |response, operation|
|
1297
1323
|
response = ::Gapic::Operation.new response, @operations_client, options: options
|
1298
1324
|
yield response, operation if block_given?
|
1299
|
-
|
1325
|
+
throw :response, response
|
1300
1326
|
end
|
1301
1327
|
rescue ::GRPC::BadStatus => e
|
1302
1328
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1390,7 +1416,7 @@ module Google
|
|
1390
1416
|
@document_processor_service_stub.call_rpc :deploy_processor_version, request, options: options do |response, operation|
|
1391
1417
|
response = ::Gapic::Operation.new response, @operations_client, options: options
|
1392
1418
|
yield response, operation if block_given?
|
1393
|
-
|
1419
|
+
throw :response, response
|
1394
1420
|
end
|
1395
1421
|
rescue ::GRPC::BadStatus => e
|
1396
1422
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1484,7 +1510,7 @@ module Google
|
|
1484
1510
|
@document_processor_service_stub.call_rpc :undeploy_processor_version, request, options: options do |response, operation|
|
1485
1511
|
response = ::Gapic::Operation.new response, @operations_client, options: options
|
1486
1512
|
yield response, operation if block_given?
|
1487
|
-
|
1513
|
+
throw :response, response
|
1488
1514
|
end
|
1489
1515
|
rescue ::GRPC::BadStatus => e
|
1490
1516
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1584,7 +1610,6 @@ module Google
|
|
1584
1610
|
|
1585
1611
|
@document_processor_service_stub.call_rpc :create_processor, request, options: options do |response, operation|
|
1586
1612
|
yield response, operation if block_given?
|
1587
|
-
return response
|
1588
1613
|
end
|
1589
1614
|
rescue ::GRPC::BadStatus => e
|
1590
1615
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1679,7 +1704,7 @@ module Google
|
|
1679
1704
|
@document_processor_service_stub.call_rpc :delete_processor, request, options: options do |response, operation|
|
1680
1705
|
response = ::Gapic::Operation.new response, @operations_client, options: options
|
1681
1706
|
yield response, operation if block_given?
|
1682
|
-
|
1707
|
+
throw :response, response
|
1683
1708
|
end
|
1684
1709
|
rescue ::GRPC::BadStatus => e
|
1685
1710
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1773,7 +1798,7 @@ module Google
|
|
1773
1798
|
@document_processor_service_stub.call_rpc :enable_processor, request, options: options do |response, operation|
|
1774
1799
|
response = ::Gapic::Operation.new response, @operations_client, options: options
|
1775
1800
|
yield response, operation if block_given?
|
1776
|
-
|
1801
|
+
throw :response, response
|
1777
1802
|
end
|
1778
1803
|
rescue ::GRPC::BadStatus => e
|
1779
1804
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1867,7 +1892,7 @@ module Google
|
|
1867
1892
|
@document_processor_service_stub.call_rpc :disable_processor, request, options: options do |response, operation|
|
1868
1893
|
response = ::Gapic::Operation.new response, @operations_client, options: options
|
1869
1894
|
yield response, operation if block_given?
|
1870
|
-
|
1895
|
+
throw :response, response
|
1871
1896
|
end
|
1872
1897
|
rescue ::GRPC::BadStatus => e
|
1873
1898
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1972,7 +1997,7 @@ module Google
|
|
1972
1997
|
@document_processor_service_stub.call_rpc :set_default_processor_version, request, options: options do |response, operation|
|
1973
1998
|
response = ::Gapic::Operation.new response, @operations_client, options: options
|
1974
1999
|
yield response, operation if block_given?
|
1975
|
-
|
2000
|
+
throw :response, response
|
1976
2001
|
end
|
1977
2002
|
rescue ::GRPC::BadStatus => e
|
1978
2003
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -2077,7 +2102,7 @@ module Google
|
|
2077
2102
|
@document_processor_service_stub.call_rpc :review_document, request, options: options do |response, operation|
|
2078
2103
|
response = ::Gapic::Operation.new response, @operations_client, options: options
|
2079
2104
|
yield response, operation if block_given?
|
2080
|
-
|
2105
|
+
throw :response, response
|
2081
2106
|
end
|
2082
2107
|
rescue ::GRPC::BadStatus => e
|
2083
2108
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -2178,7 +2203,7 @@ module Google
|
|
2178
2203
|
@document_processor_service_stub.call_rpc :evaluate_processor_version, request, options: options do |response, operation|
|
2179
2204
|
response = ::Gapic::Operation.new response, @operations_client, options: options
|
2180
2205
|
yield response, operation if block_given?
|
2181
|
-
|
2206
|
+
throw :response, response
|
2182
2207
|
end
|
2183
2208
|
rescue ::GRPC::BadStatus => e
|
2184
2209
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -2266,7 +2291,6 @@ module Google
|
|
2266
2291
|
|
2267
2292
|
@document_processor_service_stub.call_rpc :get_evaluation, request, options: options do |response, operation|
|
2268
2293
|
yield response, operation if block_given?
|
2269
|
-
return response
|
2270
2294
|
end
|
2271
2295
|
rescue ::GRPC::BadStatus => e
|
2272
2296
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -2367,7 +2391,7 @@ module Google
|
|
2367
2391
|
@document_processor_service_stub.call_rpc :list_evaluations, request, options: options do |response, operation|
|
2368
2392
|
response = ::Gapic::PagedEnumerable.new @document_processor_service_stub, :list_evaluations, request, response, operation, options
|
2369
2393
|
yield response, operation if block_given?
|
2370
|
-
|
2394
|
+
throw :response, response
|
2371
2395
|
end
|
2372
2396
|
rescue ::GRPC::BadStatus => e
|
2373
2397
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -2417,6 +2441,13 @@ module Google
|
|
2417
2441
|
# * (`GRPC::Core::Channel`) a gRPC channel with included credentials
|
2418
2442
|
# * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
|
2419
2443
|
# * (`nil`) indicating no credentials
|
2444
|
+
#
|
2445
|
+
# Warning: If you accept a credential configuration (JSON file or Hash) from an
|
2446
|
+
# external source for authentication to Google Cloud, you must validate it before
|
2447
|
+
# providing it to a Google API client library. Providing an unvalidated credential
|
2448
|
+
# configuration to Google APIs can compromise the security of your systems and data.
|
2449
|
+
# For more information, refer to [Validate credential configurations from external
|
2450
|
+
# sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
|
2420
2451
|
# @return [::Object]
|
2421
2452
|
# @!attribute [rw] scope
|
2422
2453
|
# The OAuth scopes
|
@@ -2456,6 +2487,11 @@ module Google
|
|
2456
2487
|
# default endpoint URL. The default value of nil uses the environment
|
2457
2488
|
# universe (usually the default "googleapis.com" universe).
|
2458
2489
|
# @return [::String,nil]
|
2490
|
+
# @!attribute [rw] logger
|
2491
|
+
# A custom logger to use for request/response debug logging, or the value
|
2492
|
+
# `:default` (the default) to construct a default logger, or `nil` to
|
2493
|
+
# explicitly disable logging.
|
2494
|
+
# @return [::Logger,:default,nil]
|
2459
2495
|
#
|
2460
2496
|
class Configuration
|
2461
2497
|
extend ::Gapic::Config
|
@@ -2480,6 +2516,7 @@ module Google
|
|
2480
2516
|
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
2481
2517
|
config_attr :quota_project, nil, ::String, nil
|
2482
2518
|
config_attr :universe_domain, nil, ::String, nil
|
2519
|
+
config_attr :logger, :default, ::Logger, nil, :default
|
2483
2520
|
|
2484
2521
|
# @private
|
2485
2522
|
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
|
-
|
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
|
-
|
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
|
425
|
-
# corresponding to
|
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
|
-
|
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
|