google-cloud-document_ai-v1beta3 0.9.2 → 0.11.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.yardopts +1 -1
- data/AUTHENTICATION.md +7 -25
- data/README.md +1 -1
- data/lib/google/cloud/document_ai/v1beta3/document_processor_service/client.rb +222 -27
- data/lib/google/cloud/document_ai/v1beta3/document_processor_service/operations.rb +115 -12
- data/lib/google/cloud/document_ai/v1beta3/version.rb +1 -1
- data/lib/google/cloud/documentai/v1beta3/document_io_pb.rb +1 -1
- data/lib/google/cloud/documentai/v1beta3/document_pb.rb +9 -3
- data/lib/google/cloud/documentai/v1beta3/document_processor_service_pb.rb +3 -2
- data/lib/google/cloud/documentai/v1beta3/document_processor_service_services_pb.rb +1 -1
- data/lib/google/cloud/documentai/v1beta3/geometry_pb.rb +1 -1
- data/lib/google/cloud/documentai/v1beta3/operation_metadata_pb.rb +2 -2
- data/lib/google/cloud/documentai/v1beta3/processor_pb.rb +2 -2
- data/lib/google/cloud/documentai/v1beta3/processor_type_pb.rb +2 -2
- data/proto_docs/google/api/resource.rb +10 -71
- data/proto_docs/google/cloud/documentai/v1beta3/document.rb +174 -91
- data/proto_docs/google/cloud/documentai/v1beta3/document_processor_service.rb +3 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e10c45db6849956a79a1b0c83d137746c5007bbc64104dd134dae12682a31503
|
4
|
+
data.tar.gz: 82db138a621be98e50bb58490aad1cdc42c614fff43d4b0b888849987d649e46
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 50f2f7f98cc9c98ba705359484ddb6c47a2dd15f0b5e5b704da4398e4d1e15187308dae5eaa96ffb716aa33d1a8766b0ff4b64983302926c46eed24736a446f8
|
7
|
+
data.tar.gz: b8f65426674274bc75c64dffabc850e9f3bb04c45db701a13074eb2c3e37596978d625eac912886a5ab1921106d3813408fe15fb99f6178386cd7403b8975f67
|
data/.yardopts
CHANGED
data/AUTHENTICATION.md
CHANGED
@@ -120,15 +120,6 @@ To configure your system for this, simply:
|
|
120
120
|
**NOTE:** This is _not_ recommended for running in production. The Cloud SDK
|
121
121
|
*should* only be used during development.
|
122
122
|
|
123
|
-
[gce-how-to]: https://cloud.google.com/compute/docs/authentication#using
|
124
|
-
[dev-console]: https://console.cloud.google.com/project
|
125
|
-
|
126
|
-
[enable-apis]: https://raw.githubusercontent.com/GoogleCloudPlatform/gcloud-common/master/authentication/enable-apis.png
|
127
|
-
|
128
|
-
[create-new-service-account]: https://raw.githubusercontent.com/GoogleCloudPlatform/gcloud-common/master/authentication/create-new-service-account.png
|
129
|
-
[create-new-service-account-existing-keys]: https://raw.githubusercontent.com/GoogleCloudPlatform/gcloud-common/master/authentication/create-new-service-account-existing-keys.png
|
130
|
-
[reuse-service-account]: https://raw.githubusercontent.com/GoogleCloudPlatform/gcloud-common/master/authentication/reuse-service-account.png
|
131
|
-
|
132
123
|
## Creating a Service Account
|
133
124
|
|
134
125
|
Google Cloud requires **Service Account Credentials** to
|
@@ -139,31 +130,22 @@ If you are not running this client within
|
|
139
130
|
[Google Cloud Platform environments](#google-cloud-platform-environments), you
|
140
131
|
need a Google Developers service account.
|
141
132
|
|
142
|
-
1. Visit the [Google
|
133
|
+
1. Visit the [Google Cloud Console](https://console.cloud.google.com/project).
|
143
134
|
2. Create a new project or click on an existing project.
|
144
|
-
3. Activate the
|
135
|
+
3. Activate the menu in the upper left and select **APIs & Services**. From
|
145
136
|
here, you will enable the APIs that your application requires.
|
146
137
|
|
147
|
-
![Enable the APIs that your application requires][enable-apis]
|
148
|
-
|
149
138
|
*Note: You may need to enable billing in order to use these services.*
|
150
139
|
|
151
140
|
4. Select **Credentials** from the side navigation.
|
152
141
|
|
153
|
-
|
154
|
-
|
155
|
-
![Create a new service account][create-new-service-account]
|
156
|
-
|
157
|
-
![Create a new service account With Existing Keys][create-new-service-account-existing-keys]
|
158
|
-
|
159
|
-
Find the "Add credentials" drop down and select "Service account" to be
|
160
|
-
guided through downloading a new JSON key file.
|
142
|
+
Find the "Create credentials" drop down near the top of the page, and select
|
143
|
+
"Service account" to be guided through downloading a new JSON key file.
|
161
144
|
|
162
145
|
If you want to re-use an existing service account, you can easily generate a
|
163
|
-
new key file. Just select the account you wish to re-use,
|
164
|
-
|
165
|
-
|
166
|
-
![Re-use an existing service account][reuse-service-account]
|
146
|
+
new key file. Just select the account you wish to re-use, click the pencil
|
147
|
+
tool on the right side to edit the service account, select the **Keys** tab,
|
148
|
+
and then select **Add Key**.
|
167
149
|
|
168
150
|
The key file you download will be used by this library to authenticate API
|
169
151
|
requests and should be stored in a secure location.
|
data/README.md
CHANGED
@@ -37,7 +37,7 @@ request = ::Google::Cloud::DocumentAI::V1beta3::ProcessRequest.new # (request fi
|
|
37
37
|
response = client.process_document request
|
38
38
|
```
|
39
39
|
|
40
|
-
View the [Client Library Documentation](https://
|
40
|
+
View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-document_ai-v1beta3/latest)
|
41
41
|
for class and method documentation.
|
42
42
|
|
43
43
|
See also the [Product Documentation](https://cloud.google.com/document-ai/)
|
@@ -153,6 +153,7 @@ module Google
|
|
153
153
|
|
154
154
|
@operations_client = Operations.new do |config|
|
155
155
|
config.credentials = credentials
|
156
|
+
config.quota_project = @quota_project_id
|
156
157
|
config.endpoint = @config.endpoint
|
157
158
|
end
|
158
159
|
|
@@ -212,6 +213,21 @@ module Google
|
|
212
213
|
#
|
213
214
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
214
215
|
#
|
216
|
+
# @example Basic example
|
217
|
+
# require "google/cloud/document_ai/v1beta3"
|
218
|
+
#
|
219
|
+
# # Create a client object. The client can be reused for multiple calls.
|
220
|
+
# client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new
|
221
|
+
#
|
222
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
223
|
+
# request = Google::Cloud::DocumentAI::V1beta3::ProcessRequest.new
|
224
|
+
#
|
225
|
+
# # Call the process_document method.
|
226
|
+
# result = client.process_document request
|
227
|
+
#
|
228
|
+
# # The returned object is of type Google::Cloud::DocumentAI::V1beta3::ProcessResponse.
|
229
|
+
# p result
|
230
|
+
#
|
215
231
|
def process_document request, options = nil
|
216
232
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
217
233
|
|
@@ -229,9 +245,11 @@ module Google
|
|
229
245
|
gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION
|
230
246
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
231
247
|
|
232
|
-
header_params = {
|
233
|
-
|
234
|
-
|
248
|
+
header_params = {}
|
249
|
+
if request.name
|
250
|
+
header_params["name"] = request.name
|
251
|
+
end
|
252
|
+
|
235
253
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
236
254
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
237
255
|
|
@@ -292,6 +310,28 @@ module Google
|
|
292
310
|
#
|
293
311
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
294
312
|
#
|
313
|
+
# @example Basic example
|
314
|
+
# require "google/cloud/document_ai/v1beta3"
|
315
|
+
#
|
316
|
+
# # Create a client object. The client can be reused for multiple calls.
|
317
|
+
# client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new
|
318
|
+
#
|
319
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
320
|
+
# request = Google::Cloud::DocumentAI::V1beta3::BatchProcessRequest.new
|
321
|
+
#
|
322
|
+
# # Call the batch_process_documents method.
|
323
|
+
# result = client.batch_process_documents request
|
324
|
+
#
|
325
|
+
# # The returned object is of type Gapic::Operation. You can use this
|
326
|
+
# # object to check the status of an operation, cancel it, or wait
|
327
|
+
# # for results. Here is how to block until completion:
|
328
|
+
# result.wait_until_done! timeout: 60
|
329
|
+
# if result.response?
|
330
|
+
# p result.response
|
331
|
+
# else
|
332
|
+
# puts "Error!"
|
333
|
+
# end
|
334
|
+
#
|
295
335
|
def batch_process_documents request, options = nil
|
296
336
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
297
337
|
|
@@ -309,9 +349,11 @@ module Google
|
|
309
349
|
gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION
|
310
350
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
311
351
|
|
312
|
-
header_params = {
|
313
|
-
|
314
|
-
|
352
|
+
header_params = {}
|
353
|
+
if request.name
|
354
|
+
header_params["name"] = request.name
|
355
|
+
end
|
356
|
+
|
315
357
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
316
358
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
317
359
|
|
@@ -362,6 +404,21 @@ module Google
|
|
362
404
|
#
|
363
405
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
364
406
|
#
|
407
|
+
# @example Basic example
|
408
|
+
# require "google/cloud/document_ai/v1beta3"
|
409
|
+
#
|
410
|
+
# # Create a client object. The client can be reused for multiple calls.
|
411
|
+
# client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new
|
412
|
+
#
|
413
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
414
|
+
# request = Google::Cloud::DocumentAI::V1beta3::FetchProcessorTypesRequest.new
|
415
|
+
#
|
416
|
+
# # Call the fetch_processor_types method.
|
417
|
+
# result = client.fetch_processor_types request
|
418
|
+
#
|
419
|
+
# # The returned object is of type Google::Cloud::DocumentAI::V1beta3::FetchProcessorTypesResponse.
|
420
|
+
# p result
|
421
|
+
#
|
365
422
|
def fetch_processor_types request, options = nil
|
366
423
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
367
424
|
|
@@ -379,9 +436,11 @@ module Google
|
|
379
436
|
gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION
|
380
437
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
381
438
|
|
382
|
-
header_params = {
|
383
|
-
|
384
|
-
|
439
|
+
header_params = {}
|
440
|
+
if request.parent
|
441
|
+
header_params["parent"] = request.parent
|
442
|
+
end
|
443
|
+
|
385
444
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
386
445
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
387
446
|
|
@@ -438,6 +497,27 @@ module Google
|
|
438
497
|
#
|
439
498
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
440
499
|
#
|
500
|
+
# @example Basic example
|
501
|
+
# require "google/cloud/document_ai/v1beta3"
|
502
|
+
#
|
503
|
+
# # Create a client object. The client can be reused for multiple calls.
|
504
|
+
# client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new
|
505
|
+
#
|
506
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
507
|
+
# request = Google::Cloud::DocumentAI::V1beta3::ListProcessorsRequest.new
|
508
|
+
#
|
509
|
+
# # Call the list_processors method.
|
510
|
+
# result = client.list_processors request
|
511
|
+
#
|
512
|
+
# # The returned object is of type Gapic::PagedEnumerable. You can
|
513
|
+
# # iterate over all elements by calling #each, and the enumerable
|
514
|
+
# # will lazily make API calls to fetch subsequent pages. Other
|
515
|
+
# # methods are also available for managing paging directly.
|
516
|
+
# result.each do |response|
|
517
|
+
# # Each element is of type ::Google::Cloud::DocumentAI::V1beta3::Processor.
|
518
|
+
# p response
|
519
|
+
# end
|
520
|
+
#
|
441
521
|
def list_processors request, options = nil
|
442
522
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
443
523
|
|
@@ -455,9 +535,11 @@ module Google
|
|
455
535
|
gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION
|
456
536
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
457
537
|
|
458
|
-
header_params = {
|
459
|
-
|
460
|
-
|
538
|
+
header_params = {}
|
539
|
+
if request.parent
|
540
|
+
header_params["parent"] = request.parent
|
541
|
+
end
|
542
|
+
|
461
543
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
462
544
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
463
545
|
|
@@ -512,6 +594,21 @@ module Google
|
|
512
594
|
#
|
513
595
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
514
596
|
#
|
597
|
+
# @example Basic example
|
598
|
+
# require "google/cloud/document_ai/v1beta3"
|
599
|
+
#
|
600
|
+
# # Create a client object. The client can be reused for multiple calls.
|
601
|
+
# client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new
|
602
|
+
#
|
603
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
604
|
+
# request = Google::Cloud::DocumentAI::V1beta3::CreateProcessorRequest.new
|
605
|
+
#
|
606
|
+
# # Call the create_processor method.
|
607
|
+
# result = client.create_processor request
|
608
|
+
#
|
609
|
+
# # The returned object is of type Google::Cloud::DocumentAI::V1beta3::Processor.
|
610
|
+
# p result
|
611
|
+
#
|
515
612
|
def create_processor request, options = nil
|
516
613
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
517
614
|
|
@@ -529,9 +626,11 @@ module Google
|
|
529
626
|
gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION
|
530
627
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
531
628
|
|
532
|
-
header_params = {
|
533
|
-
|
534
|
-
|
629
|
+
header_params = {}
|
630
|
+
if request.parent
|
631
|
+
header_params["parent"] = request.parent
|
632
|
+
end
|
633
|
+
|
535
634
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
536
635
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
537
636
|
|
@@ -581,6 +680,28 @@ module Google
|
|
581
680
|
#
|
582
681
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
583
682
|
#
|
683
|
+
# @example Basic example
|
684
|
+
# require "google/cloud/document_ai/v1beta3"
|
685
|
+
#
|
686
|
+
# # Create a client object. The client can be reused for multiple calls.
|
687
|
+
# client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new
|
688
|
+
#
|
689
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
690
|
+
# request = Google::Cloud::DocumentAI::V1beta3::DeleteProcessorRequest.new
|
691
|
+
#
|
692
|
+
# # Call the delete_processor method.
|
693
|
+
# result = client.delete_processor request
|
694
|
+
#
|
695
|
+
# # The returned object is of type Gapic::Operation. You can use this
|
696
|
+
# # object to check the status of an operation, cancel it, or wait
|
697
|
+
# # for results. Here is how to block until completion:
|
698
|
+
# result.wait_until_done! timeout: 60
|
699
|
+
# if result.response?
|
700
|
+
# p result.response
|
701
|
+
# else
|
702
|
+
# puts "Error!"
|
703
|
+
# end
|
704
|
+
#
|
584
705
|
def delete_processor request, options = nil
|
585
706
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
586
707
|
|
@@ -598,9 +719,11 @@ module Google
|
|
598
719
|
gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION
|
599
720
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
600
721
|
|
601
|
-
header_params = {
|
602
|
-
|
603
|
-
|
722
|
+
header_params = {}
|
723
|
+
if request.name
|
724
|
+
header_params["name"] = request.name
|
725
|
+
end
|
726
|
+
|
604
727
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
605
728
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
606
729
|
|
@@ -650,6 +773,28 @@ module Google
|
|
650
773
|
#
|
651
774
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
652
775
|
#
|
776
|
+
# @example Basic example
|
777
|
+
# require "google/cloud/document_ai/v1beta3"
|
778
|
+
#
|
779
|
+
# # Create a client object. The client can be reused for multiple calls.
|
780
|
+
# client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new
|
781
|
+
#
|
782
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
783
|
+
# request = Google::Cloud::DocumentAI::V1beta3::EnableProcessorRequest.new
|
784
|
+
#
|
785
|
+
# # Call the enable_processor method.
|
786
|
+
# result = client.enable_processor request
|
787
|
+
#
|
788
|
+
# # The returned object is of type Gapic::Operation. You can use this
|
789
|
+
# # object to check the status of an operation, cancel it, or wait
|
790
|
+
# # for results. Here is how to block until completion:
|
791
|
+
# result.wait_until_done! timeout: 60
|
792
|
+
# if result.response?
|
793
|
+
# p result.response
|
794
|
+
# else
|
795
|
+
# puts "Error!"
|
796
|
+
# end
|
797
|
+
#
|
653
798
|
def enable_processor request, options = nil
|
654
799
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
655
800
|
|
@@ -667,9 +812,11 @@ module Google
|
|
667
812
|
gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION
|
668
813
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
669
814
|
|
670
|
-
header_params = {
|
671
|
-
|
672
|
-
|
815
|
+
header_params = {}
|
816
|
+
if request.name
|
817
|
+
header_params["name"] = request.name
|
818
|
+
end
|
819
|
+
|
673
820
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
674
821
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
675
822
|
|
@@ -719,6 +866,28 @@ module Google
|
|
719
866
|
#
|
720
867
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
721
868
|
#
|
869
|
+
# @example Basic example
|
870
|
+
# require "google/cloud/document_ai/v1beta3"
|
871
|
+
#
|
872
|
+
# # Create a client object. The client can be reused for multiple calls.
|
873
|
+
# client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new
|
874
|
+
#
|
875
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
876
|
+
# request = Google::Cloud::DocumentAI::V1beta3::DisableProcessorRequest.new
|
877
|
+
#
|
878
|
+
# # Call the disable_processor method.
|
879
|
+
# result = client.disable_processor request
|
880
|
+
#
|
881
|
+
# # The returned object is of type Gapic::Operation. You can use this
|
882
|
+
# # object to check the status of an operation, cancel it, or wait
|
883
|
+
# # for results. Here is how to block until completion:
|
884
|
+
# result.wait_until_done! timeout: 60
|
885
|
+
# if result.response?
|
886
|
+
# p result.response
|
887
|
+
# else
|
888
|
+
# puts "Error!"
|
889
|
+
# end
|
890
|
+
#
|
722
891
|
def disable_processor request, options = nil
|
723
892
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
724
893
|
|
@@ -736,9 +905,11 @@ module Google
|
|
736
905
|
gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION
|
737
906
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
738
907
|
|
739
|
-
header_params = {
|
740
|
-
|
741
|
-
|
908
|
+
header_params = {}
|
909
|
+
if request.name
|
910
|
+
header_params["name"] = request.name
|
911
|
+
end
|
912
|
+
|
742
913
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
743
914
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
744
915
|
|
@@ -798,6 +969,28 @@ module Google
|
|
798
969
|
#
|
799
970
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
800
971
|
#
|
972
|
+
# @example Basic example
|
973
|
+
# require "google/cloud/document_ai/v1beta3"
|
974
|
+
#
|
975
|
+
# # Create a client object. The client can be reused for multiple calls.
|
976
|
+
# client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new
|
977
|
+
#
|
978
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
979
|
+
# request = Google::Cloud::DocumentAI::V1beta3::ReviewDocumentRequest.new
|
980
|
+
#
|
981
|
+
# # Call the review_document method.
|
982
|
+
# result = client.review_document request
|
983
|
+
#
|
984
|
+
# # The returned object is of type Gapic::Operation. You can use this
|
985
|
+
# # object to check the status of an operation, cancel it, or wait
|
986
|
+
# # for results. Here is how to block until completion:
|
987
|
+
# result.wait_until_done! timeout: 60
|
988
|
+
# if result.response?
|
989
|
+
# p result.response
|
990
|
+
# else
|
991
|
+
# puts "Error!"
|
992
|
+
# end
|
993
|
+
#
|
801
994
|
def review_document request, options = nil
|
802
995
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
803
996
|
|
@@ -815,9 +1008,11 @@ module Google
|
|
815
1008
|
gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION
|
816
1009
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
817
1010
|
|
818
|
-
header_params = {
|
819
|
-
|
820
|
-
|
1011
|
+
header_params = {}
|
1012
|
+
if request.human_review_config
|
1013
|
+
header_params["human_review_config"] = request.human_review_config
|
1014
|
+
end
|
1015
|
+
|
821
1016
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
822
1017
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
823
1018
|
|
@@ -143,6 +143,27 @@ module Google
|
|
143
143
|
#
|
144
144
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
145
145
|
#
|
146
|
+
# @example Basic example
|
147
|
+
# require "google/longrunning"
|
148
|
+
#
|
149
|
+
# # Create a client object. The client can be reused for multiple calls.
|
150
|
+
# client = Google::Longrunning::Operations::Client.new
|
151
|
+
#
|
152
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
153
|
+
# request = Google::Longrunning::ListOperationsRequest.new
|
154
|
+
#
|
155
|
+
# # Call the list_operations method.
|
156
|
+
# result = client.list_operations request
|
157
|
+
#
|
158
|
+
# # The returned object is of type Gapic::PagedEnumerable. You can
|
159
|
+
# # iterate over all elements by calling #each, and the enumerable
|
160
|
+
# # will lazily make API calls to fetch subsequent pages. Other
|
161
|
+
# # methods are also available for managing paging directly.
|
162
|
+
# result.each do |response|
|
163
|
+
# # Each element is of type ::Google::Longrunning::Operation.
|
164
|
+
# p response
|
165
|
+
# end
|
166
|
+
#
|
146
167
|
def list_operations request, options = nil
|
147
168
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
148
169
|
|
@@ -160,9 +181,11 @@ module Google
|
|
160
181
|
gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION
|
161
182
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
162
183
|
|
163
|
-
header_params = {
|
164
|
-
|
165
|
-
|
184
|
+
header_params = {}
|
185
|
+
if request.name
|
186
|
+
header_params["name"] = request.name
|
187
|
+
end
|
188
|
+
|
166
189
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
167
190
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
168
191
|
|
@@ -215,6 +238,28 @@ module Google
|
|
215
238
|
#
|
216
239
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
217
240
|
#
|
241
|
+
# @example Basic example
|
242
|
+
# require "google/longrunning"
|
243
|
+
#
|
244
|
+
# # Create a client object. The client can be reused for multiple calls.
|
245
|
+
# client = Google::Longrunning::Operations::Client.new
|
246
|
+
#
|
247
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
248
|
+
# request = Google::Longrunning::GetOperationRequest.new
|
249
|
+
#
|
250
|
+
# # Call the get_operation method.
|
251
|
+
# result = client.get_operation request
|
252
|
+
#
|
253
|
+
# # The returned object is of type Gapic::Operation. You can use this
|
254
|
+
# # object to check the status of an operation, cancel it, or wait
|
255
|
+
# # for results. Here is how to block until completion:
|
256
|
+
# result.wait_until_done! timeout: 60
|
257
|
+
# if result.response?
|
258
|
+
# p result.response
|
259
|
+
# else
|
260
|
+
# puts "Error!"
|
261
|
+
# end
|
262
|
+
#
|
218
263
|
def get_operation request, options = nil
|
219
264
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
220
265
|
|
@@ -232,9 +277,11 @@ module Google
|
|
232
277
|
gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION
|
233
278
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
234
279
|
|
235
|
-
header_params = {
|
236
|
-
|
237
|
-
|
280
|
+
header_params = {}
|
281
|
+
if request.name
|
282
|
+
header_params["name"] = request.name
|
283
|
+
end
|
284
|
+
|
238
285
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
239
286
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
240
287
|
|
@@ -287,6 +334,21 @@ module Google
|
|
287
334
|
#
|
288
335
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
289
336
|
#
|
337
|
+
# @example Basic example
|
338
|
+
# require "google/longrunning"
|
339
|
+
#
|
340
|
+
# # Create a client object. The client can be reused for multiple calls.
|
341
|
+
# client = Google::Longrunning::Operations::Client.new
|
342
|
+
#
|
343
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
344
|
+
# request = Google::Longrunning::DeleteOperationRequest.new
|
345
|
+
#
|
346
|
+
# # Call the delete_operation method.
|
347
|
+
# result = client.delete_operation request
|
348
|
+
#
|
349
|
+
# # The returned object is of type Google::Protobuf::Empty.
|
350
|
+
# p result
|
351
|
+
#
|
290
352
|
def delete_operation request, options = nil
|
291
353
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
292
354
|
|
@@ -304,9 +366,11 @@ module Google
|
|
304
366
|
gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION
|
305
367
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
306
368
|
|
307
|
-
header_params = {
|
308
|
-
|
309
|
-
|
369
|
+
header_params = {}
|
370
|
+
if request.name
|
371
|
+
header_params["name"] = request.name
|
372
|
+
end
|
373
|
+
|
310
374
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
311
375
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
312
376
|
|
@@ -364,6 +428,21 @@ module Google
|
|
364
428
|
#
|
365
429
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
366
430
|
#
|
431
|
+
# @example Basic example
|
432
|
+
# require "google/longrunning"
|
433
|
+
#
|
434
|
+
# # Create a client object. The client can be reused for multiple calls.
|
435
|
+
# client = Google::Longrunning::Operations::Client.new
|
436
|
+
#
|
437
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
438
|
+
# request = Google::Longrunning::CancelOperationRequest.new
|
439
|
+
#
|
440
|
+
# # Call the cancel_operation method.
|
441
|
+
# result = client.cancel_operation request
|
442
|
+
#
|
443
|
+
# # The returned object is of type Google::Protobuf::Empty.
|
444
|
+
# p result
|
445
|
+
#
|
367
446
|
def cancel_operation request, options = nil
|
368
447
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
369
448
|
|
@@ -381,9 +460,11 @@ module Google
|
|
381
460
|
gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION
|
382
461
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
383
462
|
|
384
|
-
header_params = {
|
385
|
-
|
386
|
-
|
463
|
+
header_params = {}
|
464
|
+
if request.name
|
465
|
+
header_params["name"] = request.name
|
466
|
+
end
|
467
|
+
|
387
468
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
388
469
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
389
470
|
|
@@ -444,6 +525,28 @@ module Google
|
|
444
525
|
#
|
445
526
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
446
527
|
#
|
528
|
+
# @example Basic example
|
529
|
+
# require "google/longrunning"
|
530
|
+
#
|
531
|
+
# # Create a client object. The client can be reused for multiple calls.
|
532
|
+
# client = Google::Longrunning::Operations::Client.new
|
533
|
+
#
|
534
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
535
|
+
# request = Google::Longrunning::WaitOperationRequest.new
|
536
|
+
#
|
537
|
+
# # Call the wait_operation method.
|
538
|
+
# result = client.wait_operation request
|
539
|
+
#
|
540
|
+
# # The returned object is of type Gapic::Operation. You can use this
|
541
|
+
# # object to check the status of an operation, cancel it, or wait
|
542
|
+
# # for results. Here is how to block until completion:
|
543
|
+
# result.wait_until_done! timeout: 60
|
544
|
+
# if result.response?
|
545
|
+
# p result.response
|
546
|
+
# else
|
547
|
+
# puts "Error!"
|
548
|
+
# end
|
549
|
+
#
|
447
550
|
def wait_operation request, options = nil
|
448
551
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
449
552
|
|
@@ -1,9 +1,9 @@
|
|
1
1
|
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
2
2
|
# source: google/cloud/documentai/v1beta3/document_io.proto
|
3
3
|
|
4
|
+
require 'google/api/annotations_pb'
|
4
5
|
require 'google/protobuf'
|
5
6
|
|
6
|
-
require 'google/api/annotations_pb'
|
7
7
|
Google::Protobuf::DescriptorPool.generated_pool.build do
|
8
8
|
add_file("google/cloud/documentai/v1beta3/document_io.proto", :syntax => :proto3) do
|
9
9
|
add_message "google.cloud.documentai.v1beta3.RawDocument" do
|