google-cloud-document_ai-v1beta3 0.1.1 → 0.6.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/LICENSE.md +188 -190
- data/README.md +66 -2
- data/lib/google/cloud/document_ai/v1beta3/document_processor_service/client.rb +38 -19
- data/lib/google/cloud/document_ai/v1beta3/document_processor_service/operations.rb +94 -9
- data/lib/google/cloud/document_ai/v1beta3/version.rb +1 -1
- data/lib/google/cloud/documentai/v1beta3/document_io_pb.rb +54 -0
- data/lib/google/cloud/documentai/v1beta3/document_pb.rb +1 -8
- data/lib/google/cloud/documentai/v1beta3/document_processor_service_pb.rb +44 -0
- data/proto_docs/google/api/field_behavior.rb +6 -0
- data/proto_docs/google/cloud/documentai/v1beta3/document.rb +7 -30
- data/proto_docs/google/cloud/documentai/v1beta3/document_io.rb +100 -0
- data/proto_docs/google/cloud/documentai/v1beta3/document_processor_service.rb +106 -0
- data/proto_docs/google/longrunning/operations.rb +17 -3
- data/proto_docs/google/protobuf/any.rb +5 -2
- data/proto_docs/google/protobuf/timestamp.rb +10 -1
- metadata +11 -7
@@ -63,7 +63,7 @@ module Google
|
|
63
63
|
parent_config = while namespace.any?
|
64
64
|
parent_name = namespace.join "::"
|
65
65
|
parent_const = const_get parent_name
|
66
|
-
break parent_const.configure if parent_const
|
66
|
+
break parent_const.configure if parent_const.respond_to? :configure
|
67
67
|
namespace.pop
|
68
68
|
end
|
69
69
|
default_config = Client::Configuration.new parent_config
|
@@ -71,25 +71,25 @@ module Google
|
|
71
71
|
default_config.rpcs.process_document.timeout = 120.0
|
72
72
|
default_config.rpcs.process_document.retry_policy = {
|
73
73
|
initial_delay: 0.1,
|
74
|
-
|
75
|
-
|
76
|
-
|
74
|
+
max_delay: 60.0,
|
75
|
+
multiplier: 1.3,
|
76
|
+
retry_codes: [4, 14]
|
77
77
|
}
|
78
78
|
|
79
79
|
default_config.rpcs.batch_process_documents.timeout = 120.0
|
80
80
|
default_config.rpcs.batch_process_documents.retry_policy = {
|
81
81
|
initial_delay: 0.1,
|
82
|
-
|
83
|
-
|
84
|
-
|
82
|
+
max_delay: 60.0,
|
83
|
+
multiplier: 1.3,
|
84
|
+
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
89
|
initial_delay: 0.1,
|
90
|
-
|
91
|
-
|
92
|
-
|
90
|
+
max_delay: 60.0,
|
91
|
+
multiplier: 1.3,
|
92
|
+
retry_codes: [4, 14]
|
93
93
|
}
|
94
94
|
|
95
95
|
default_config
|
@@ -153,7 +153,13 @@ module Google
|
|
153
153
|
|
154
154
|
# Create credentials
|
155
155
|
credentials = @config.credentials
|
156
|
-
|
156
|
+
# Use self-signed JWT if the scope and endpoint are unchanged from default,
|
157
|
+
# but only if the default endpoint does not have a region prefix.
|
158
|
+
enable_self_signed_jwt = @config.scope == Client.configure.scope &&
|
159
|
+
@config.endpoint == Client.configure.endpoint &&
|
160
|
+
!@config.endpoint.split(".").first.include?("-")
|
161
|
+
credentials ||= Credentials.default scope: @config.scope,
|
162
|
+
enable_self_signed_jwt: enable_self_signed_jwt
|
157
163
|
if credentials.is_a?(String) || credentials.is_a?(Hash)
|
158
164
|
credentials = Credentials.new credentials, scope: @config.scope
|
159
165
|
end
|
@@ -196,11 +202,15 @@ module Google
|
|
196
202
|
# @param options [::Gapic::CallOptions, ::Hash]
|
197
203
|
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
198
204
|
#
|
199
|
-
# @overload process_document(name: nil, document: nil, skip_human_review: nil)
|
205
|
+
# @overload process_document(inline_document: nil, raw_document: nil, name: nil, document: nil, skip_human_review: nil)
|
200
206
|
# Pass arguments to `process_document` via keyword arguments. Note that at
|
201
207
|
# least one keyword argument is required. To specify no parameters, or to keep all
|
202
208
|
# the default parameter values, pass an empty Hash as a request object (see above).
|
203
209
|
#
|
210
|
+
# @param inline_document [::Google::Cloud::DocumentAI::V1beta3::Document, ::Hash]
|
211
|
+
# An inline document proto.
|
212
|
+
# @param raw_document [::Google::Cloud::DocumentAI::V1beta3::RawDocument, ::Hash]
|
213
|
+
# A raw document content (bytes).
|
204
214
|
# @param name [::String]
|
205
215
|
# Required. The processor resource name.
|
206
216
|
# @param document [::Google::Cloud::DocumentAI::V1beta3::Document, ::Hash]
|
@@ -268,7 +278,7 @@ module Google
|
|
268
278
|
# @param options [::Gapic::CallOptions, ::Hash]
|
269
279
|
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
270
280
|
#
|
271
|
-
# @overload batch_process_documents(name: nil, input_configs: nil, output_config: nil)
|
281
|
+
# @overload batch_process_documents(name: nil, input_configs: nil, output_config: nil, input_documents: nil, document_output_config: nil, skip_human_review: nil)
|
272
282
|
# Pass arguments to `batch_process_documents` via keyword arguments. Note that at
|
273
283
|
# least one keyword argument is required. To specify no parameters, or to keep all
|
274
284
|
# the default parameter values, pass an empty Hash as a request object (see above).
|
@@ -279,6 +289,13 @@ module Google
|
|
279
289
|
# The input config for each single document in the batch process.
|
280
290
|
# @param output_config [::Google::Cloud::DocumentAI::V1beta3::BatchProcessRequest::BatchOutputConfig, ::Hash]
|
281
291
|
# The overall output config for batch process.
|
292
|
+
# @param input_documents [::Google::Cloud::DocumentAI::V1beta3::BatchDocumentsInputConfig, ::Hash]
|
293
|
+
# The input documents for batch process.
|
294
|
+
# @param document_output_config [::Google::Cloud::DocumentAI::V1beta3::DocumentOutputConfig, ::Hash]
|
295
|
+
# The overall output config for batch process.
|
296
|
+
# @param skip_human_review [::Boolean]
|
297
|
+
# Whether Human Review feature should be skipped for this request. Default to
|
298
|
+
# false.
|
282
299
|
#
|
283
300
|
# @yield [response, operation] Access the result along with the RPC operation
|
284
301
|
# @yieldparam response [::Gapic::Operation]
|
@@ -340,11 +357,13 @@ module Google
|
|
340
357
|
# @param options [::Gapic::CallOptions, ::Hash]
|
341
358
|
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
342
359
|
#
|
343
|
-
# @overload review_document(human_review_config: nil, document: nil)
|
360
|
+
# @overload review_document(inline_document: nil, human_review_config: nil, document: nil)
|
344
361
|
# Pass arguments to `review_document` via keyword arguments. Note that at
|
345
362
|
# least one keyword argument is required. To specify no parameters, or to keep all
|
346
363
|
# the default parameter values, pass an empty Hash as a request object (see above).
|
347
364
|
#
|
365
|
+
# @param inline_document [::Google::Cloud::DocumentAI::V1beta3::Document, ::Hash]
|
366
|
+
# An inline document proto.
|
348
367
|
# @param human_review_config [::String]
|
349
368
|
# Required. The resource name of the HumanReviewConfig that the document will be
|
350
369
|
# reviewed with.
|
@@ -489,7 +508,7 @@ module Google
|
|
489
508
|
config_attr :scope, nil, ::String, ::Array, nil
|
490
509
|
config_attr :lib_name, nil, ::String, nil
|
491
510
|
config_attr :lib_version, nil, ::String, nil
|
492
|
-
config_attr(:channel_args, { "grpc.service_config_disable_resolution"=>1 }, ::Hash, nil)
|
511
|
+
config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil)
|
493
512
|
config_attr :interceptors, nil, ::Array, nil
|
494
513
|
config_attr :timeout, nil, ::Numeric, nil
|
495
514
|
config_attr :metadata, nil, ::Hash, nil
|
@@ -510,7 +529,7 @@ module Google
|
|
510
529
|
def rpcs
|
511
530
|
@rpcs ||= begin
|
512
531
|
parent_rpcs = nil
|
513
|
-
parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config
|
532
|
+
parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
|
514
533
|
Rpcs.new parent_rpcs
|
515
534
|
end
|
516
535
|
end
|
@@ -551,11 +570,11 @@ module Google
|
|
551
570
|
|
552
571
|
# @private
|
553
572
|
def initialize parent_rpcs = nil
|
554
|
-
process_document_config = parent_rpcs
|
573
|
+
process_document_config = parent_rpcs.process_document if parent_rpcs.respond_to? :process_document
|
555
574
|
@process_document = ::Gapic::Config::Method.new process_document_config
|
556
|
-
batch_process_documents_config = parent_rpcs
|
575
|
+
batch_process_documents_config = parent_rpcs.batch_process_documents if parent_rpcs.respond_to? :batch_process_documents
|
557
576
|
@batch_process_documents = ::Gapic::Config::Method.new batch_process_documents_config
|
558
|
-
review_document_config = parent_rpcs
|
577
|
+
review_document_config = parent_rpcs.review_document if parent_rpcs.respond_to? :review_document
|
559
578
|
@review_document = ::Gapic::Config::Method.new review_document_config
|
560
579
|
|
561
580
|
yield self if block_given?
|
@@ -103,8 +103,13 @@ module Google
|
|
103
103
|
# Lists operations that match the specified filter in the request. If the
|
104
104
|
# server doesn't support this method, it returns `UNIMPLEMENTED`.
|
105
105
|
#
|
106
|
-
# NOTE: the `name` binding
|
107
|
-
# to use different resource name schemes, such as `users/*/operations`.
|
106
|
+
# NOTE: the `name` binding allows API services to override the binding
|
107
|
+
# to use different resource name schemes, such as `users/*/operations`. To
|
108
|
+
# override the binding, API services can add a binding such as
|
109
|
+
# `"/v1/{name=users/*}/operations"` to their service configuration.
|
110
|
+
# For backwards compatibility, the default name includes the operations
|
111
|
+
# collection id, however overriding users must ensure the name binding
|
112
|
+
# is the parent resource, without the operations collection id.
|
108
113
|
#
|
109
114
|
# @overload list_operations(request, options = nil)
|
110
115
|
# Pass arguments to `list_operations` via a request object, either of type
|
@@ -122,7 +127,7 @@ module Google
|
|
122
127
|
# the default parameter values, pass an empty Hash as a request object (see above).
|
123
128
|
#
|
124
129
|
# @param name [::String]
|
125
|
-
# The name of the operation
|
130
|
+
# The name of the operation's parent resource.
|
126
131
|
# @param filter [::String]
|
127
132
|
# The standard list filter.
|
128
133
|
# @param page_size [::Integer]
|
@@ -390,6 +395,79 @@ module Google
|
|
390
395
|
raise ::Google::Cloud::Error.from_error(e)
|
391
396
|
end
|
392
397
|
|
398
|
+
##
|
399
|
+
# Waits for the specified long-running operation until it is done or reaches
|
400
|
+
# at most a specified timeout, returning the latest state. If the operation
|
401
|
+
# is already done, the latest state is immediately returned. If the timeout
|
402
|
+
# specified is greater than the default HTTP/RPC timeout, the HTTP/RPC
|
403
|
+
# timeout is used. If the server does not support this method, it returns
|
404
|
+
# `google.rpc.Code.UNIMPLEMENTED`.
|
405
|
+
# Note that this method is on a best-effort basis. It may return the latest
|
406
|
+
# state before the specified timeout (including immediately), meaning even an
|
407
|
+
# immediate response is no guarantee that the operation is done.
|
408
|
+
#
|
409
|
+
# @overload wait_operation(request, options = nil)
|
410
|
+
# Pass arguments to `wait_operation` via a request object, either of type
|
411
|
+
# {::Google::Longrunning::WaitOperationRequest} or an equivalent Hash.
|
412
|
+
#
|
413
|
+
# @param request [::Google::Longrunning::WaitOperationRequest, ::Hash]
|
414
|
+
# A request object representing the call parameters. Required. To specify no
|
415
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
416
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
417
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
418
|
+
#
|
419
|
+
# @overload wait_operation(name: nil, timeout: nil)
|
420
|
+
# Pass arguments to `wait_operation` via keyword arguments. Note that at
|
421
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
422
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
423
|
+
#
|
424
|
+
# @param name [::String]
|
425
|
+
# The name of the operation resource to wait on.
|
426
|
+
# @param timeout [::Google::Protobuf::Duration, ::Hash]
|
427
|
+
# The maximum duration to wait before timing out. If left blank, the wait
|
428
|
+
# will be at most the time permitted by the underlying HTTP/RPC protocol.
|
429
|
+
# If RPC context deadline is also specified, the shorter one will be used.
|
430
|
+
#
|
431
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
432
|
+
# @yieldparam response [::Gapic::Operation]
|
433
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
434
|
+
#
|
435
|
+
# @return [::Gapic::Operation]
|
436
|
+
#
|
437
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
438
|
+
#
|
439
|
+
def wait_operation request, options = nil
|
440
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
441
|
+
|
442
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::WaitOperationRequest
|
443
|
+
|
444
|
+
# Converts hash and nil to an options object
|
445
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
446
|
+
|
447
|
+
# Customize the options with defaults
|
448
|
+
metadata = @config.rpcs.wait_operation.metadata.to_h
|
449
|
+
|
450
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
451
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
452
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
453
|
+
gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION
|
454
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
455
|
+
|
456
|
+
options.apply_defaults timeout: @config.rpcs.wait_operation.timeout,
|
457
|
+
metadata: metadata,
|
458
|
+
retry_policy: @config.rpcs.wait_operation.retry_policy
|
459
|
+
options.apply_defaults metadata: @config.metadata,
|
460
|
+
retry_policy: @config.retry_policy
|
461
|
+
|
462
|
+
@operations_stub.call_rpc :wait_operation, request, options: options do |response, operation|
|
463
|
+
response = ::Gapic::Operation.new response, @operations_client, options: options
|
464
|
+
yield response, operation if block_given?
|
465
|
+
return response
|
466
|
+
end
|
467
|
+
rescue ::GRPC::BadStatus => e
|
468
|
+
raise ::Google::Cloud::Error.from_error(e)
|
469
|
+
end
|
470
|
+
|
393
471
|
##
|
394
472
|
# Configuration class for the Operations API.
|
395
473
|
#
|
@@ -482,7 +560,7 @@ module Google
|
|
482
560
|
config_attr :scope, nil, ::String, ::Array, nil
|
483
561
|
config_attr :lib_name, nil, ::String, nil
|
484
562
|
config_attr :lib_version, nil, ::String, nil
|
485
|
-
config_attr(:channel_args, { "grpc.service_config_disable_resolution"=>1 }, ::Hash, nil)
|
563
|
+
config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil)
|
486
564
|
config_attr :interceptors, nil, ::Array, nil
|
487
565
|
config_attr :timeout, nil, ::Numeric, nil
|
488
566
|
config_attr :metadata, nil, ::Hash, nil
|
@@ -503,7 +581,7 @@ module Google
|
|
503
581
|
def rpcs
|
504
582
|
@rpcs ||= begin
|
505
583
|
parent_rpcs = nil
|
506
|
-
parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config
|
584
|
+
parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
|
507
585
|
Rpcs.new parent_rpcs
|
508
586
|
end
|
509
587
|
end
|
@@ -546,17 +624,24 @@ module Google
|
|
546
624
|
# @return [::Gapic::Config::Method]
|
547
625
|
#
|
548
626
|
attr_reader :cancel_operation
|
627
|
+
##
|
628
|
+
# RPC-specific configuration for `wait_operation`
|
629
|
+
# @return [::Gapic::Config::Method]
|
630
|
+
#
|
631
|
+
attr_reader :wait_operation
|
549
632
|
|
550
633
|
# @private
|
551
634
|
def initialize parent_rpcs = nil
|
552
|
-
list_operations_config = parent_rpcs
|
635
|
+
list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations
|
553
636
|
@list_operations = ::Gapic::Config::Method.new list_operations_config
|
554
|
-
get_operation_config = parent_rpcs
|
637
|
+
get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation
|
555
638
|
@get_operation = ::Gapic::Config::Method.new get_operation_config
|
556
|
-
delete_operation_config = parent_rpcs
|
639
|
+
delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation
|
557
640
|
@delete_operation = ::Gapic::Config::Method.new delete_operation_config
|
558
|
-
cancel_operation_config = parent_rpcs
|
641
|
+
cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation
|
559
642
|
@cancel_operation = ::Gapic::Config::Method.new cancel_operation_config
|
643
|
+
wait_operation_config = parent_rpcs.wait_operation if parent_rpcs.respond_to? :wait_operation
|
644
|
+
@wait_operation = ::Gapic::Config::Method.new wait_operation_config
|
560
645
|
|
561
646
|
yield self if block_given?
|
562
647
|
end
|
@@ -0,0 +1,54 @@
|
|
1
|
+
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
2
|
+
# source: google/cloud/documentai/v1beta3/document_io.proto
|
3
|
+
|
4
|
+
require 'google/protobuf'
|
5
|
+
|
6
|
+
require 'google/api/annotations_pb'
|
7
|
+
Google::Protobuf::DescriptorPool.generated_pool.build do
|
8
|
+
add_file("google/cloud/documentai/v1beta3/document_io.proto", :syntax => :proto3) do
|
9
|
+
add_message "google.cloud.documentai.v1beta3.RawDocument" do
|
10
|
+
optional :content, :bytes, 1
|
11
|
+
optional :mime_type, :string, 2
|
12
|
+
end
|
13
|
+
add_message "google.cloud.documentai.v1beta3.GcsDocument" do
|
14
|
+
optional :gcs_uri, :string, 1
|
15
|
+
optional :mime_type, :string, 2
|
16
|
+
end
|
17
|
+
add_message "google.cloud.documentai.v1beta3.GcsDocuments" do
|
18
|
+
repeated :documents, :message, 1, "google.cloud.documentai.v1beta3.GcsDocument"
|
19
|
+
end
|
20
|
+
add_message "google.cloud.documentai.v1beta3.GcsPrefix" do
|
21
|
+
optional :gcs_uri_prefix, :string, 1
|
22
|
+
end
|
23
|
+
add_message "google.cloud.documentai.v1beta3.BatchDocumentsInputConfig" do
|
24
|
+
oneof :source do
|
25
|
+
optional :gcs_prefix, :message, 1, "google.cloud.documentai.v1beta3.GcsPrefix"
|
26
|
+
optional :gcs_documents, :message, 2, "google.cloud.documentai.v1beta3.GcsDocuments"
|
27
|
+
end
|
28
|
+
end
|
29
|
+
add_message "google.cloud.documentai.v1beta3.DocumentOutputConfig" do
|
30
|
+
oneof :destination do
|
31
|
+
optional :gcs_output_config, :message, 1, "google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig"
|
32
|
+
end
|
33
|
+
end
|
34
|
+
add_message "google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig" do
|
35
|
+
optional :gcs_uri, :string, 1
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
module Google
|
41
|
+
module Cloud
|
42
|
+
module DocumentAI
|
43
|
+
module V1beta3
|
44
|
+
RawDocument = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.RawDocument").msgclass
|
45
|
+
GcsDocument = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.GcsDocument").msgclass
|
46
|
+
GcsDocuments = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.GcsDocuments").msgclass
|
47
|
+
GcsPrefix = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.GcsPrefix").msgclass
|
48
|
+
BatchDocumentsInputConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.BatchDocumentsInputConfig").msgclass
|
49
|
+
DocumentOutputConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.DocumentOutputConfig").msgclass
|
50
|
+
DocumentOutputConfig::GcsOutputConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig").msgclass
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
@@ -22,7 +22,6 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
|
|
22
22
|
repeated :pages, :message, 6, "google.cloud.documentai.v1beta3.Document.Page"
|
23
23
|
repeated :entities, :message, 7, "google.cloud.documentai.v1beta3.Document.Entity"
|
24
24
|
repeated :entity_relations, :message, 8, "google.cloud.documentai.v1beta3.Document.EntityRelation"
|
25
|
-
repeated :translations, :message, 12, "google.cloud.documentai.v1beta3.Document.Translation"
|
26
25
|
repeated :text_changes, :message, 14, "google.cloud.documentai.v1beta3.Document.TextChange"
|
27
26
|
optional :shard_info, :message, 9, "google.cloud.documentai.v1beta3.Document.ShardInfo"
|
28
27
|
optional :error, :message, 10, "google.rpc.Status"
|
@@ -176,6 +175,7 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
|
|
176
175
|
optional :date_value, :message, 3, "google.type.Date"
|
177
176
|
optional :datetime_value, :message, 4, "google.type.DateTime"
|
178
177
|
optional :address_value, :message, 5, "google.type.PostalAddress"
|
178
|
+
optional :boolean_value, :bool, 6
|
179
179
|
end
|
180
180
|
end
|
181
181
|
add_message "google.cloud.documentai.v1beta3.Document.EntityRelation" do
|
@@ -183,12 +183,6 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
|
|
183
183
|
optional :object_id, :string, 2
|
184
184
|
optional :relation, :string, 3
|
185
185
|
end
|
186
|
-
add_message "google.cloud.documentai.v1beta3.Document.Translation" do
|
187
|
-
optional :text_anchor, :message, 1, "google.cloud.documentai.v1beta3.Document.TextAnchor"
|
188
|
-
optional :language_code, :string, 2
|
189
|
-
optional :translated_text, :string, 3
|
190
|
-
repeated :provenance, :message, 4, "google.cloud.documentai.v1beta3.Document.Provenance"
|
191
|
-
end
|
192
186
|
add_message "google.cloud.documentai.v1beta3.Document.TextAnchor" do
|
193
187
|
repeated :text_segments, :message, 1, "google.cloud.documentai.v1beta3.Document.TextAnchor.TextSegment"
|
194
188
|
optional :content, :string, 2
|
@@ -285,7 +279,6 @@ module Google
|
|
285
279
|
Document::Entity = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Document.Entity").msgclass
|
286
280
|
Document::Entity::NormalizedValue = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Document.Entity.NormalizedValue").msgclass
|
287
281
|
Document::EntityRelation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Document.EntityRelation").msgclass
|
288
|
-
Document::Translation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Document.Translation").msgclass
|
289
282
|
Document::TextAnchor = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Document.TextAnchor").msgclass
|
290
283
|
Document::TextAnchor::TextSegment = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Document.TextAnchor.TextSegment").msgclass
|
291
284
|
Document::PageAnchor = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Document.PageAnchor").msgclass
|
@@ -8,6 +8,7 @@ require 'google/api/client_pb'
|
|
8
8
|
require 'google/api/field_behavior_pb'
|
9
9
|
require 'google/api/resource_pb'
|
10
10
|
require 'google/cloud/documentai/v1beta3/document_pb'
|
11
|
+
require 'google/cloud/documentai/v1beta3/document_io_pb'
|
11
12
|
require 'google/longrunning/operations_pb'
|
12
13
|
require 'google/protobuf/field_mask_pb'
|
13
14
|
require 'google/protobuf/timestamp_pb'
|
@@ -18,15 +19,35 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
|
|
18
19
|
optional :name, :string, 1
|
19
20
|
optional :document, :message, 2, "google.cloud.documentai.v1beta3.Document"
|
20
21
|
optional :skip_human_review, :bool, 3
|
22
|
+
oneof :source do
|
23
|
+
optional :inline_document, :message, 4, "google.cloud.documentai.v1beta3.Document"
|
24
|
+
optional :raw_document, :message, 5, "google.cloud.documentai.v1beta3.RawDocument"
|
25
|
+
end
|
26
|
+
end
|
27
|
+
add_message "google.cloud.documentai.v1beta3.HumanReviewStatus" do
|
28
|
+
optional :state, :enum, 1, "google.cloud.documentai.v1beta3.HumanReviewStatus.State"
|
29
|
+
optional :state_message, :string, 2
|
30
|
+
optional :human_review_operation, :string, 3
|
31
|
+
end
|
32
|
+
add_enum "google.cloud.documentai.v1beta3.HumanReviewStatus.State" do
|
33
|
+
value :STATE_UNSPECIFIED, 0
|
34
|
+
value :SKIPPED, 1
|
35
|
+
value :VALIDATION_PASSED, 2
|
36
|
+
value :IN_PROGRESS, 3
|
37
|
+
value :ERROR, 4
|
21
38
|
end
|
22
39
|
add_message "google.cloud.documentai.v1beta3.ProcessResponse" do
|
23
40
|
optional :document, :message, 1, "google.cloud.documentai.v1beta3.Document"
|
24
41
|
optional :human_review_operation, :string, 2
|
42
|
+
optional :human_review_status, :message, 3, "google.cloud.documentai.v1beta3.HumanReviewStatus"
|
25
43
|
end
|
26
44
|
add_message "google.cloud.documentai.v1beta3.BatchProcessRequest" do
|
27
45
|
optional :name, :string, 1
|
28
46
|
repeated :input_configs, :message, 2, "google.cloud.documentai.v1beta3.BatchProcessRequest.BatchInputConfig"
|
29
47
|
optional :output_config, :message, 3, "google.cloud.documentai.v1beta3.BatchProcessRequest.BatchOutputConfig"
|
48
|
+
optional :input_documents, :message, 5, "google.cloud.documentai.v1beta3.BatchDocumentsInputConfig"
|
49
|
+
optional :document_output_config, :message, 6, "google.cloud.documentai.v1beta3.DocumentOutputConfig"
|
50
|
+
optional :skip_human_review, :bool, 4
|
30
51
|
end
|
31
52
|
add_message "google.cloud.documentai.v1beta3.BatchProcessRequest.BatchInputConfig" do
|
32
53
|
optional :gcs_source, :string, 1
|
@@ -49,6 +70,7 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
|
|
49
70
|
optional :status, :message, 2, "google.rpc.Status"
|
50
71
|
optional :output_gcs_destination, :string, 3
|
51
72
|
optional :human_review_operation, :string, 4
|
73
|
+
optional :human_review_status, :message, 5, "google.cloud.documentai.v1beta3.HumanReviewStatus"
|
52
74
|
end
|
53
75
|
add_enum "google.cloud.documentai.v1beta3.BatchProcessMetadata.State" do
|
54
76
|
value :STATE_UNSPECIFIED, 0
|
@@ -62,6 +84,9 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
|
|
62
84
|
add_message "google.cloud.documentai.v1beta3.ReviewDocumentRequest" do
|
63
85
|
optional :human_review_config, :string, 1
|
64
86
|
optional :document, :message, 2, "google.cloud.documentai.v1beta3.Document"
|
87
|
+
oneof :source do
|
88
|
+
optional :inline_document, :message, 4, "google.cloud.documentai.v1beta3.Document"
|
89
|
+
end
|
65
90
|
end
|
66
91
|
add_message "google.cloud.documentai.v1beta3.ReviewDocumentResponse" do
|
67
92
|
optional :gcs_destination, :string, 1
|
@@ -71,6 +96,7 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
|
|
71
96
|
optional :state_message, :string, 2
|
72
97
|
optional :create_time, :message, 3, "google.protobuf.Timestamp"
|
73
98
|
optional :update_time, :message, 4, "google.protobuf.Timestamp"
|
99
|
+
optional :common_metadata, :message, 5, "google.cloud.documentai.v1beta3.CommonOperationMetadata"
|
74
100
|
end
|
75
101
|
add_enum "google.cloud.documentai.v1beta3.ReviewDocumentOperationMetadata.State" do
|
76
102
|
value :STATE_UNSPECIFIED, 0
|
@@ -80,6 +106,20 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
|
|
80
106
|
value :FAILED, 4
|
81
107
|
value :CANCELLED, 5
|
82
108
|
end
|
109
|
+
add_message "google.cloud.documentai.v1beta3.CommonOperationMetadata" do
|
110
|
+
optional :state, :enum, 1, "google.cloud.documentai.v1beta3.CommonOperationMetadata.State"
|
111
|
+
optional :state_message, :string, 2
|
112
|
+
optional :create_time, :message, 3, "google.protobuf.Timestamp"
|
113
|
+
optional :update_time, :message, 4, "google.protobuf.Timestamp"
|
114
|
+
end
|
115
|
+
add_enum "google.cloud.documentai.v1beta3.CommonOperationMetadata.State" do
|
116
|
+
value :STATE_UNSPECIFIED, 0
|
117
|
+
value :RUNNING, 1
|
118
|
+
value :CANCELLING, 2
|
119
|
+
value :SUCCEEDED, 3
|
120
|
+
value :FAILED, 4
|
121
|
+
value :CANCELLED, 5
|
122
|
+
end
|
83
123
|
end
|
84
124
|
end
|
85
125
|
|
@@ -88,6 +128,8 @@ module Google
|
|
88
128
|
module DocumentAI
|
89
129
|
module V1beta3
|
90
130
|
ProcessRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.ProcessRequest").msgclass
|
131
|
+
HumanReviewStatus = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.HumanReviewStatus").msgclass
|
132
|
+
HumanReviewStatus::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.HumanReviewStatus.State").enummodule
|
91
133
|
ProcessResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.ProcessResponse").msgclass
|
92
134
|
BatchProcessRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.BatchProcessRequest").msgclass
|
93
135
|
BatchProcessRequest::BatchInputConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.BatchProcessRequest.BatchInputConfig").msgclass
|
@@ -100,6 +142,8 @@ module Google
|
|
100
142
|
ReviewDocumentResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.ReviewDocumentResponse").msgclass
|
101
143
|
ReviewDocumentOperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.ReviewDocumentOperationMetadata").msgclass
|
102
144
|
ReviewDocumentOperationMetadata::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.ReviewDocumentOperationMetadata.State").enummodule
|
145
|
+
CommonOperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.CommonOperationMetadata").msgclass
|
146
|
+
CommonOperationMetadata::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.CommonOperationMetadata.State").enummodule
|
103
147
|
end
|
104
148
|
end
|
105
149
|
end
|