google-cloud-document_ai-v1beta3 0.9.0 → 0.9.4
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/.yardopts +1 -1
- data/AUTHENTICATION.md +15 -33
- data/README.md +1 -1
- data/lib/google/cloud/document_ai/v1beta3/document_processor_service/client.rb +282 -85
- data/lib/google/cloud/document_ai/v1beta3/document_processor_service/operations.rb +149 -37
- 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 +2 -2
- data/lib/google/cloud/documentai/v1beta3/document_processor_service_pb.rb +2 -2
- 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/field_behavior.rb +7 -1
- data/proto_docs/google/api/resource.rb +10 -71
- data/proto_docs/google/type/color.rb +16 -11
- data/proto_docs/google/type/date.rb +14 -11
- data/proto_docs/google/type/datetime.rb +9 -1
- data/proto_docs/google/type/money.rb +1 -1
- metadata +5 -5
@@ -44,13 +44,12 @@ module Google
|
|
44
44
|
# See {::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client::Configuration}
|
45
45
|
# for a description of the configuration fields.
|
46
46
|
#
|
47
|
-
#
|
47
|
+
# @example
|
48
48
|
#
|
49
|
-
#
|
50
|
-
#
|
51
|
-
#
|
52
|
-
#
|
53
|
-
# end
|
49
|
+
# # Modify the configuration for all DocumentProcessorService clients
|
50
|
+
# ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.configure do |config|
|
51
|
+
# config.timeout = 10.0
|
52
|
+
# end
|
54
53
|
#
|
55
54
|
# @yield [config] Configure the Client client.
|
56
55
|
# @yieldparam config [Client::Configuration]
|
@@ -70,26 +69,17 @@ module Google
|
|
70
69
|
|
71
70
|
default_config.rpcs.process_document.timeout = 120.0
|
72
71
|
default_config.rpcs.process_document.retry_policy = {
|
73
|
-
initial_delay: 0.1,
|
74
|
-
max_delay: 60.0,
|
75
|
-
multiplier: 1.3,
|
76
|
-
retry_codes: [4, 14]
|
72
|
+
initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
|
77
73
|
}
|
78
74
|
|
79
75
|
default_config.rpcs.batch_process_documents.timeout = 120.0
|
80
76
|
default_config.rpcs.batch_process_documents.retry_policy = {
|
81
|
-
initial_delay: 0.1,
|
82
|
-
max_delay: 60.0,
|
83
|
-
multiplier: 1.3,
|
84
|
-
retry_codes: [4, 14]
|
77
|
+
initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
|
85
78
|
}
|
86
79
|
|
87
80
|
default_config.rpcs.review_document.timeout = 120.0
|
88
81
|
default_config.rpcs.review_document.retry_policy = {
|
89
|
-
initial_delay: 0.1,
|
90
|
-
max_delay: 60.0,
|
91
|
-
multiplier: 1.3,
|
92
|
-
retry_codes: [4, 14]
|
82
|
+
initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
|
93
83
|
}
|
94
84
|
|
95
85
|
default_config
|
@@ -121,19 +111,15 @@ module Google
|
|
121
111
|
##
|
122
112
|
# Create a new DocumentProcessorService client object.
|
123
113
|
#
|
124
|
-
#
|
125
|
-
#
|
126
|
-
# To create a new DocumentProcessorService client with the default
|
127
|
-
# configuration:
|
128
|
-
#
|
129
|
-
# client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new
|
114
|
+
# @example
|
130
115
|
#
|
131
|
-
#
|
132
|
-
#
|
116
|
+
# # Create a client using the default configuration
|
117
|
+
# client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new
|
133
118
|
#
|
134
|
-
#
|
135
|
-
#
|
136
|
-
#
|
119
|
+
# # Create a client using a custom configuration
|
120
|
+
# client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new do |config|
|
121
|
+
# config.timeout = 10.0
|
122
|
+
# end
|
137
123
|
#
|
138
124
|
# @yield [config] Configure the DocumentProcessorService client.
|
139
125
|
# @yieldparam config [Client::Configuration]
|
@@ -153,14 +139,13 @@ module Google
|
|
153
139
|
|
154
140
|
# Create credentials
|
155
141
|
credentials = @config.credentials
|
156
|
-
# Use self-signed JWT if the
|
142
|
+
# Use self-signed JWT if the endpoint is unchanged from default,
|
157
143
|
# but only if the default endpoint does not have a region prefix.
|
158
|
-
enable_self_signed_jwt = @config.
|
159
|
-
@config.endpoint == Client.configure.endpoint &&
|
144
|
+
enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
|
160
145
|
!@config.endpoint.split(".").first.include?("-")
|
161
146
|
credentials ||= Credentials.default scope: @config.scope,
|
162
147
|
enable_self_signed_jwt: enable_self_signed_jwt
|
163
|
-
if credentials.is_a?(String) || credentials.is_a?(Hash)
|
148
|
+
if credentials.is_a?(::String) || credentials.is_a?(::Hash)
|
164
149
|
credentials = Credentials.new credentials, scope: @config.scope
|
165
150
|
end
|
166
151
|
@quota_project_id = @config.quota_project
|
@@ -168,6 +153,7 @@ module Google
|
|
168
153
|
|
169
154
|
@operations_client = Operations.new do |config|
|
170
155
|
config.credentials = credentials
|
156
|
+
config.quota_project = @quota_project_id
|
171
157
|
config.endpoint = @config.endpoint
|
172
158
|
end
|
173
159
|
|
@@ -227,6 +213,21 @@ module Google
|
|
227
213
|
#
|
228
214
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
229
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
|
+
#
|
230
231
|
def process_document request, options = nil
|
231
232
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
232
233
|
|
@@ -244,16 +245,20 @@ module Google
|
|
244
245
|
gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION
|
245
246
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
246
247
|
|
247
|
-
header_params = {
|
248
|
-
|
249
|
-
|
248
|
+
header_params = {}
|
249
|
+
if request.name
|
250
|
+
header_params["name"] = request.name
|
251
|
+
end
|
252
|
+
|
250
253
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
251
254
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
252
255
|
|
253
256
|
options.apply_defaults timeout: @config.rpcs.process_document.timeout,
|
254
257
|
metadata: metadata,
|
255
258
|
retry_policy: @config.rpcs.process_document.retry_policy
|
256
|
-
|
259
|
+
|
260
|
+
options.apply_defaults timeout: @config.timeout,
|
261
|
+
metadata: @config.metadata,
|
257
262
|
retry_policy: @config.retry_policy
|
258
263
|
|
259
264
|
@document_processor_service_stub.call_rpc :process_document, request, options: options do |response, operation|
|
@@ -305,6 +310,28 @@ module Google
|
|
305
310
|
#
|
306
311
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
307
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
|
+
#
|
308
335
|
def batch_process_documents request, options = nil
|
309
336
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
310
337
|
|
@@ -322,16 +349,20 @@ module Google
|
|
322
349
|
gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION
|
323
350
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
324
351
|
|
325
|
-
header_params = {
|
326
|
-
|
327
|
-
|
352
|
+
header_params = {}
|
353
|
+
if request.name
|
354
|
+
header_params["name"] = request.name
|
355
|
+
end
|
356
|
+
|
328
357
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
329
358
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
330
359
|
|
331
360
|
options.apply_defaults timeout: @config.rpcs.batch_process_documents.timeout,
|
332
361
|
metadata: metadata,
|
333
362
|
retry_policy: @config.rpcs.batch_process_documents.retry_policy
|
334
|
-
|
363
|
+
|
364
|
+
options.apply_defaults timeout: @config.timeout,
|
365
|
+
metadata: @config.metadata,
|
335
366
|
retry_policy: @config.retry_policy
|
336
367
|
|
337
368
|
@document_processor_service_stub.call_rpc :batch_process_documents, request, options: options do |response, operation|
|
@@ -373,6 +404,21 @@ module Google
|
|
373
404
|
#
|
374
405
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
375
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
|
+
#
|
376
422
|
def fetch_processor_types request, options = nil
|
377
423
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
378
424
|
|
@@ -390,16 +436,20 @@ module Google
|
|
390
436
|
gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION
|
391
437
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
392
438
|
|
393
|
-
header_params = {
|
394
|
-
|
395
|
-
|
439
|
+
header_params = {}
|
440
|
+
if request.parent
|
441
|
+
header_params["parent"] = request.parent
|
442
|
+
end
|
443
|
+
|
396
444
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
397
445
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
398
446
|
|
399
447
|
options.apply_defaults timeout: @config.rpcs.fetch_processor_types.timeout,
|
400
448
|
metadata: metadata,
|
401
449
|
retry_policy: @config.rpcs.fetch_processor_types.retry_policy
|
402
|
-
|
450
|
+
|
451
|
+
options.apply_defaults timeout: @config.timeout,
|
452
|
+
metadata: @config.metadata,
|
403
453
|
retry_policy: @config.retry_policy
|
404
454
|
|
405
455
|
@document_processor_service_stub.call_rpc :fetch_processor_types, request, options: options do |response, operation|
|
@@ -447,6 +497,27 @@ module Google
|
|
447
497
|
#
|
448
498
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
449
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
|
+
#
|
450
521
|
def list_processors request, options = nil
|
451
522
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
452
523
|
|
@@ -464,16 +535,20 @@ module Google
|
|
464
535
|
gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION
|
465
536
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
466
537
|
|
467
|
-
header_params = {
|
468
|
-
|
469
|
-
|
538
|
+
header_params = {}
|
539
|
+
if request.parent
|
540
|
+
header_params["parent"] = request.parent
|
541
|
+
end
|
542
|
+
|
470
543
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
471
544
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
472
545
|
|
473
546
|
options.apply_defaults timeout: @config.rpcs.list_processors.timeout,
|
474
547
|
metadata: metadata,
|
475
548
|
retry_policy: @config.rpcs.list_processors.retry_policy
|
476
|
-
|
549
|
+
|
550
|
+
options.apply_defaults timeout: @config.timeout,
|
551
|
+
metadata: @config.metadata,
|
477
552
|
retry_policy: @config.retry_policy
|
478
553
|
|
479
554
|
@document_processor_service_stub.call_rpc :list_processors, request, options: options do |response, operation|
|
@@ -519,6 +594,21 @@ module Google
|
|
519
594
|
#
|
520
595
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
521
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
|
+
#
|
522
612
|
def create_processor request, options = nil
|
523
613
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
524
614
|
|
@@ -536,16 +626,20 @@ module Google
|
|
536
626
|
gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION
|
537
627
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
538
628
|
|
539
|
-
header_params = {
|
540
|
-
|
541
|
-
|
629
|
+
header_params = {}
|
630
|
+
if request.parent
|
631
|
+
header_params["parent"] = request.parent
|
632
|
+
end
|
633
|
+
|
542
634
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
543
635
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
544
636
|
|
545
637
|
options.apply_defaults timeout: @config.rpcs.create_processor.timeout,
|
546
638
|
metadata: metadata,
|
547
639
|
retry_policy: @config.rpcs.create_processor.retry_policy
|
548
|
-
|
640
|
+
|
641
|
+
options.apply_defaults timeout: @config.timeout,
|
642
|
+
metadata: @config.metadata,
|
549
643
|
retry_policy: @config.retry_policy
|
550
644
|
|
551
645
|
@document_processor_service_stub.call_rpc :create_processor, request, options: options do |response, operation|
|
@@ -586,6 +680,28 @@ module Google
|
|
586
680
|
#
|
587
681
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
588
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
|
+
#
|
589
705
|
def delete_processor request, options = nil
|
590
706
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
591
707
|
|
@@ -603,16 +719,20 @@ module Google
|
|
603
719
|
gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION
|
604
720
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
605
721
|
|
606
|
-
header_params = {
|
607
|
-
|
608
|
-
|
722
|
+
header_params = {}
|
723
|
+
if request.name
|
724
|
+
header_params["name"] = request.name
|
725
|
+
end
|
726
|
+
|
609
727
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
610
728
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
611
729
|
|
612
730
|
options.apply_defaults timeout: @config.rpcs.delete_processor.timeout,
|
613
731
|
metadata: metadata,
|
614
732
|
retry_policy: @config.rpcs.delete_processor.retry_policy
|
615
|
-
|
733
|
+
|
734
|
+
options.apply_defaults timeout: @config.timeout,
|
735
|
+
metadata: @config.metadata,
|
616
736
|
retry_policy: @config.retry_policy
|
617
737
|
|
618
738
|
@document_processor_service_stub.call_rpc :delete_processor, request, options: options do |response, operation|
|
@@ -653,6 +773,28 @@ module Google
|
|
653
773
|
#
|
654
774
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
655
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
|
+
#
|
656
798
|
def enable_processor request, options = nil
|
657
799
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
658
800
|
|
@@ -670,16 +812,20 @@ module Google
|
|
670
812
|
gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION
|
671
813
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
672
814
|
|
673
|
-
header_params = {
|
674
|
-
|
675
|
-
|
815
|
+
header_params = {}
|
816
|
+
if request.name
|
817
|
+
header_params["name"] = request.name
|
818
|
+
end
|
819
|
+
|
676
820
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
677
821
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
678
822
|
|
679
823
|
options.apply_defaults timeout: @config.rpcs.enable_processor.timeout,
|
680
824
|
metadata: metadata,
|
681
825
|
retry_policy: @config.rpcs.enable_processor.retry_policy
|
682
|
-
|
826
|
+
|
827
|
+
options.apply_defaults timeout: @config.timeout,
|
828
|
+
metadata: @config.metadata,
|
683
829
|
retry_policy: @config.retry_policy
|
684
830
|
|
685
831
|
@document_processor_service_stub.call_rpc :enable_processor, request, options: options do |response, operation|
|
@@ -720,6 +866,28 @@ module Google
|
|
720
866
|
#
|
721
867
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
722
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
|
+
#
|
723
891
|
def disable_processor request, options = nil
|
724
892
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
725
893
|
|
@@ -737,16 +905,20 @@ module Google
|
|
737
905
|
gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION
|
738
906
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
739
907
|
|
740
|
-
header_params = {
|
741
|
-
|
742
|
-
|
908
|
+
header_params = {}
|
909
|
+
if request.name
|
910
|
+
header_params["name"] = request.name
|
911
|
+
end
|
912
|
+
|
743
913
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
744
914
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
745
915
|
|
746
916
|
options.apply_defaults timeout: @config.rpcs.disable_processor.timeout,
|
747
917
|
metadata: metadata,
|
748
918
|
retry_policy: @config.rpcs.disable_processor.retry_policy
|
749
|
-
|
919
|
+
|
920
|
+
options.apply_defaults timeout: @config.timeout,
|
921
|
+
metadata: @config.metadata,
|
750
922
|
retry_policy: @config.retry_policy
|
751
923
|
|
752
924
|
@document_processor_service_stub.call_rpc :disable_processor, request, options: options do |response, operation|
|
@@ -797,6 +969,28 @@ module Google
|
|
797
969
|
#
|
798
970
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
799
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
|
+
#
|
800
994
|
def review_document request, options = nil
|
801
995
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
802
996
|
|
@@ -814,16 +1008,20 @@ module Google
|
|
814
1008
|
gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION
|
815
1009
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
816
1010
|
|
817
|
-
header_params = {
|
818
|
-
|
819
|
-
|
1011
|
+
header_params = {}
|
1012
|
+
if request.human_review_config
|
1013
|
+
header_params["human_review_config"] = request.human_review_config
|
1014
|
+
end
|
1015
|
+
|
820
1016
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
821
1017
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
822
1018
|
|
823
1019
|
options.apply_defaults timeout: @config.rpcs.review_document.timeout,
|
824
1020
|
metadata: metadata,
|
825
1021
|
retry_policy: @config.rpcs.review_document.retry_policy
|
826
|
-
|
1022
|
+
|
1023
|
+
options.apply_defaults timeout: @config.timeout,
|
1024
|
+
metadata: @config.metadata,
|
827
1025
|
retry_policy: @config.retry_policy
|
828
1026
|
|
829
1027
|
@document_processor_service_stub.call_rpc :review_document, request, options: options do |response, operation|
|
@@ -848,22 +1046,21 @@ module Google
|
|
848
1046
|
# Configuration can be applied globally to all clients, or to a single client
|
849
1047
|
# on construction.
|
850
1048
|
#
|
851
|
-
#
|
852
|
-
#
|
853
|
-
#
|
854
|
-
# to 20 seconds,
|
855
|
-
#
|
856
|
-
#
|
857
|
-
#
|
858
|
-
#
|
859
|
-
#
|
860
|
-
#
|
861
|
-
#
|
862
|
-
#
|
863
|
-
#
|
864
|
-
#
|
865
|
-
#
|
866
|
-
# end
|
1049
|
+
# @example
|
1050
|
+
#
|
1051
|
+
# # Modify the global config, setting the timeout for
|
1052
|
+
# # process_document to 20 seconds,
|
1053
|
+
# # and all remaining timeouts to 10 seconds.
|
1054
|
+
# ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.configure do |config|
|
1055
|
+
# config.timeout = 10.0
|
1056
|
+
# config.rpcs.process_document.timeout = 20.0
|
1057
|
+
# end
|
1058
|
+
#
|
1059
|
+
# # Apply the above configuration only to a new client.
|
1060
|
+
# client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new do |config|
|
1061
|
+
# config.timeout = 10.0
|
1062
|
+
# config.rpcs.process_document.timeout = 20.0
|
1063
|
+
# end
|
867
1064
|
#
|
868
1065
|
# @!attribute [rw] endpoint
|
869
1066
|
# The hostname or hostname:port of the service endpoint.
|