google-cloud-document_ai-v1 0.12.0 → 0.14.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f71dc8e586257fef847d5bf87318e19f2c03f0d44b751c3417225a6e48798abe
4
- data.tar.gz: 271d8d1c30e6e1aacd4613491f1b4e687cb74eadd456762677673c7e53d2a10e
3
+ metadata.gz: 568828243ade46dc62adee351810bd529e24d24354d2017c5feda6a94bfbedde
4
+ data.tar.gz: 12ab881d48c3149f5381fb80db6bbd22209feadf74a73745b49432944ccafff9
5
5
  SHA512:
6
- metadata.gz: 4faa7fafc3252a8d8af6e8b419f284b471217f832b11aba45e8cced7d745559d18c0b1e2fbf4ba35d88cd516835c58a52c55f2e652d3c39359c09a3f62f9abad
7
- data.tar.gz: 9d9d3cdf093d0e0c2daebf7383b27c421f92de17c9de510a40aeb8ef88adb2818cb3059ec6c4be1eb90f603818daa3549168fbe1f6eb4f696f6aaff55505cc91
6
+ metadata.gz: 633c11b7fd264391bf2c0e5cc0f1e0a22f3c5aa6906600431ece6f45147c622db25960592813807d11c03e6edfd049eac0f742fd90900b04beccf87b8814f234
7
+ data.tar.gz: 46ce93d1e2f69c3dda3a052e0c515f8dcdc168086f94c2415093dbfefa9f0653df0fb90d7c5fa13527f029ce682bef51840cb3beed5252cd2316e24094c3477b
@@ -28,7 +28,7 @@ module Google
28
28
  ##
29
29
  # Client for the DocumentProcessorService service.
30
30
  #
31
- # Service to call Cloud DocumentAI to process documents according to the
31
+ # Service to call Document AI to process documents according to the
32
32
  # processor's definition. Processors are built using state-of-the-art Google
33
33
  # AI such as natural language, computer vision, and translation to extract
34
34
  # structured information from unstructured or semi-structured documents.
@@ -68,7 +68,7 @@ module Google
68
68
  end
69
69
  default_config = Client::Configuration.new parent_config
70
70
 
71
- default_config.rpcs.process_document.timeout = 120.0
71
+ default_config.rpcs.process_document.timeout = 300.0
72
72
  default_config.rpcs.process_document.retry_policy = {
73
73
  initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
74
74
  }
@@ -169,7 +169,8 @@ module Google
169
169
  credentials: credentials,
170
170
  endpoint: @config.endpoint,
171
171
  channel_args: @config.channel_args,
172
- interceptors: @config.interceptors
172
+ interceptors: @config.interceptors,
173
+ channel_pool_config: @config.channel_pool
173
174
  )
174
175
  end
175
176
 
@@ -202,7 +203,7 @@ module Google
202
203
  # @param options [::Gapic::CallOptions, ::Hash]
203
204
  # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
204
205
  #
205
- # @overload process_document(inline_document: nil, raw_document: nil, name: nil, skip_human_review: nil, field_mask: nil)
206
+ # @overload process_document(inline_document: nil, raw_document: nil, gcs_document: nil, name: nil, skip_human_review: nil, field_mask: nil, process_options: nil)
206
207
  # Pass arguments to `process_document` via keyword arguments. Note that at
207
208
  # least one keyword argument is required. To specify no parameters, or to keep all
208
209
  # the default parameter values, pass an empty Hash as a request object (see above).
@@ -211,6 +212,8 @@ module Google
211
212
  # An inline document proto.
212
213
  # @param raw_document [::Google::Cloud::DocumentAI::V1::RawDocument, ::Hash]
213
214
  # A raw document content (bytes).
215
+ # @param gcs_document [::Google::Cloud::DocumentAI::V1::GcsDocument, ::Hash]
216
+ # A raw document on Google Cloud Storage.
214
217
  # @param name [::String]
215
218
  # Required. The resource name of the
216
219
  # {::Google::Cloud::DocumentAI::V1::Processor Processor} or
@@ -223,12 +226,15 @@ module Google
223
226
  # or
224
227
  # `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}`
225
228
  # @param skip_human_review [::Boolean]
226
- # Whether Human Review feature should be skipped for this request. Default to
227
- # false.
229
+ # Whether human review should be skipped for this request. Default to
230
+ # `false`.
228
231
  # @param field_mask [::Google::Protobuf::FieldMask, ::Hash]
229
- # Specifies which fields to include in ProcessResponse's document.
230
- # Only supports top level document and pages field so it must be in the form
231
- # of `{document_field_name}` or `pages.{page_field_name}`.
232
+ # Specifies which fields to include in the
233
+ # {::Google::Cloud::DocumentAI::V1::ProcessResponse#document ProcessResponse.document}
234
+ # output. Only supports top-level document and pages field, so it must be in
235
+ # the form of `{document_field_name}` or `pages.{page_field_name}`.
236
+ # @param process_options [::Google::Cloud::DocumentAI::V1::ProcessOptions, ::Hash]
237
+ # Inference-time options for the process API
232
238
  #
233
239
  # @yield [response, operation] Access the result along with the RPC operation
234
240
  # @yieldparam response [::Google::Cloud::DocumentAI::V1::ProcessResponse]
@@ -308,7 +314,7 @@ module Google
308
314
  # @param options [::Gapic::CallOptions, ::Hash]
309
315
  # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
310
316
  #
311
- # @overload batch_process_documents(name: nil, input_documents: nil, document_output_config: nil, skip_human_review: nil)
317
+ # @overload batch_process_documents(name: nil, input_documents: nil, document_output_config: nil, skip_human_review: nil, process_options: nil)
312
318
  # Pass arguments to `batch_process_documents` via keyword arguments. Note that at
313
319
  # least one keyword argument is required. To specify no parameters, or to keep all
314
320
  # the default parameter values, pass an empty Hash as a request object (see above).
@@ -321,12 +327,18 @@ module Google
321
327
  # or
322
328
  # `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}`
323
329
  # @param input_documents [::Google::Cloud::DocumentAI::V1::BatchDocumentsInputConfig, ::Hash]
324
- # The input documents for batch process.
330
+ # The input documents for the
331
+ # {::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client#batch_process_documents BatchProcessDocuments}
332
+ # method.
325
333
  # @param document_output_config [::Google::Cloud::DocumentAI::V1::DocumentOutputConfig, ::Hash]
326
- # The overall output config for batch process.
334
+ # The output configuration for the
335
+ # {::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client#batch_process_documents BatchProcessDocuments}
336
+ # method.
327
337
  # @param skip_human_review [::Boolean]
328
- # Whether Human Review feature should be skipped for this request. Default to
329
- # false.
338
+ # Whether human review should be skipped for this request. Default to
339
+ # `false`.
340
+ # @param process_options [::Google::Cloud::DocumentAI::V1::ProcessOptions, ::Hash]
341
+ # Inference-time options for the process API
330
342
  #
331
343
  # @yield [response, operation] Access the result along with the RPC operation
332
344
  # @yieldparam response [::Gapic::Operation]
@@ -401,8 +413,9 @@ module Google
401
413
  end
402
414
 
403
415
  ##
404
- # Fetches processor types. Note that we do not use ListProcessorTypes here
405
- # because it is not paginated.
416
+ # Fetches processor types. Note that we don't use
417
+ # {::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client#list_processor_types ListProcessorTypes}
418
+ # here, because it isn't paginated.
406
419
  #
407
420
  # @overload fetch_processor_types(request, options = nil)
408
421
  # Pass arguments to `fetch_processor_types` via a request object, either of type
@@ -420,9 +433,8 @@ module Google
420
433
  # the default parameter values, pass an empty Hash as a request object (see above).
421
434
  #
422
435
  # @param parent [::String]
423
- # Required. The project of processor type to list.
424
- # The available processor types may depend on the allow-listing on projects.
425
- # Format: `projects/{project}/locations/{location}`
436
+ # Required. The location of processor types to list.
437
+ # Format: `projects/{project}/locations/{location}`.
426
438
  #
427
439
  # @yield [response, operation] Access the result along with the RPC operation
428
440
  # @yieldparam response [::Google::Cloud::DocumentAI::V1::FetchProcessorTypesResponse]
@@ -507,13 +519,12 @@ module Google
507
519
  # the default parameter values, pass an empty Hash as a request object (see above).
508
520
  #
509
521
  # @param parent [::String]
510
- # Required. The location of processor type to list.
511
- # The available processor types may depend on the allow-listing on projects.
512
- # Format: `projects/{project}/locations/{location}`
522
+ # Required. The location of processor types to list.
523
+ # Format: `projects/{project}/locations/{location}`.
513
524
  # @param page_size [::Integer]
514
525
  # The maximum number of processor types to return.
515
- # If unspecified, at most 100 processor types will be returned.
516
- # The maximum value is 500; values above 500 will be coerced to 500.
526
+ # If unspecified, at most `100` processor types will be returned.
527
+ # The maximum value is `500`. Values above `500` will be coerced to `500`.
517
528
  # @param page_token [::String]
518
529
  # Used to retrieve the next page of results, empty if at the end of the list.
519
530
  #
@@ -694,8 +705,8 @@ module Google
694
705
  # Processors. Format: `projects/{project}/locations/{location}`
695
706
  # @param page_size [::Integer]
696
707
  # The maximum number of processors to return.
697
- # If unspecified, at most 50 processors will be returned.
698
- # The maximum value is 100; values above 100 will be coerced to 100.
708
+ # If unspecified, at most `50` processors will be returned.
709
+ # The maximum value is `100`. Values above `100` will be coerced to `100`.
699
710
  # @param page_token [::String]
700
711
  # We will return the processors sorted by creation time. The page token
701
712
  # will point to the next processor.
@@ -857,7 +868,7 @@ module Google
857
868
  ##
858
869
  # Trains a new processor version.
859
870
  # Operation metadata is returned as
860
- # cloud_documentai_core.TrainProcessorVersionMetadata.
871
+ # {::Google::Cloud::DocumentAI::V1::TrainProcessorVersionMetadata TrainProcessorVersionMetadata}.
861
872
  #
862
873
  # @overload train_processor_version(request, options = nil)
863
874
  # Pass arguments to `train_processor_version` via a request object, either of type
@@ -869,11 +880,13 @@ module Google
869
880
  # @param options [::Gapic::CallOptions, ::Hash]
870
881
  # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
871
882
  #
872
- # @overload train_processor_version(parent: nil, processor_version: nil, document_schema: nil, input_data: nil, base_processor_version: nil)
883
+ # @overload train_processor_version(custom_document_extraction_options: nil, parent: nil, processor_version: nil, document_schema: nil, input_data: nil, base_processor_version: nil)
873
884
  # Pass arguments to `train_processor_version` via keyword arguments. Note that at
874
885
  # least one keyword argument is required. To specify no parameters, or to keep all
875
886
  # the default parameter values, pass an empty Hash as a request object (see above).
876
887
  #
888
+ # @param custom_document_extraction_options [::Google::Cloud::DocumentAI::V1::TrainProcessorVersionRequest::CustomDocumentExtractionOptions, ::Hash]
889
+ # Options to control Custom Document Extraction (CDE) Processor.
877
890
  # @param parent [::String]
878
891
  # Required. The parent (project, location and processor) to create the new
879
892
  # version for. Format:
@@ -883,7 +896,8 @@ module Google
883
896
  # @param document_schema [::Google::Cloud::DocumentAI::V1::DocumentSchema, ::Hash]
884
897
  # Optional. The schema the processor version will be trained with.
885
898
  # @param input_data [::Google::Cloud::DocumentAI::V1::TrainProcessorVersionRequest::InputData, ::Hash]
886
- # Optional. The input data used to train the `ProcessorVersion`.
899
+ # Optional. The input data used to train the
900
+ # {::Google::Cloud::DocumentAI::V1::ProcessorVersion ProcessorVersion}.
887
901
  # @param base_processor_version [::String]
888
902
  # Optional. The processor version to use as a base for training. This
889
903
  # processor version must be a child of `parent`. Format:
@@ -1070,8 +1084,8 @@ module Google
1070
1084
  # `projects/{project}/locations/{location}/processors/{processor}`
1071
1085
  # @param page_size [::Integer]
1072
1086
  # The maximum number of processor versions to return.
1073
- # If unspecified, at most 10 processor versions will be returned.
1074
- # The maximum value is 20; values above 20 will be coerced to 20.
1087
+ # If unspecified, at most `10` processor versions will be returned.
1088
+ # The maximum value is `20`. Values above `20` will be coerced to `20`.
1075
1089
  # @param page_token [::String]
1076
1090
  # We will return the processor versions sorted by creation time. The page
1077
1091
  # token will point to the next processor version.
@@ -1426,8 +1440,9 @@ module Google
1426
1440
  end
1427
1441
 
1428
1442
  ##
1429
- # Creates a processor from the type processor that the user chose.
1430
- # The processor will be at "ENABLED" state by default after its creation.
1443
+ # Creates a processor from the
1444
+ # {::Google::Cloud::DocumentAI::V1::ProcessorType ProcessorType} provided. The
1445
+ # processor will be at `ENABLED` state by default after its creation.
1431
1446
  #
1432
1447
  # @overload create_processor(request, options = nil)
1433
1448
  # Pass arguments to `create_processor` via a request object, either of type
@@ -1448,9 +1463,11 @@ module Google
1448
1463
  # Required. The parent (project and location) under which to create the
1449
1464
  # processor. Format: `projects/{project}/locations/{location}`
1450
1465
  # @param processor [::Google::Cloud::DocumentAI::V1::Processor, ::Hash]
1451
- # Required. The processor to be created, requires [processor_type] and
1452
- # [display_name] to be set. Also, the processor is under CMEK if CMEK fields
1453
- # are set.
1466
+ # Required. The processor to be created, requires
1467
+ # {::Google::Cloud::DocumentAI::V1::Processor#type Processor.type} and
1468
+ # [Processor.display_name]][] to be set. Also, the
1469
+ # {::Google::Cloud::DocumentAI::V1::Processor#kms_key_name Processor.kms_key_name}
1470
+ # field must be set if the processor is under CMEK.
1454
1471
  #
1455
1472
  # @yield [response, operation] Access the result along with the RPC operation
1456
1473
  # @yieldparam response [::Google::Cloud::DocumentAI::V1::Processor]
@@ -1922,8 +1939,9 @@ module Google
1922
1939
  # @param inline_document [::Google::Cloud::DocumentAI::V1::Document, ::Hash]
1923
1940
  # An inline document proto.
1924
1941
  # @param human_review_config [::String]
1925
- # Required. The resource name of the HumanReviewConfig that the document will
1926
- # be reviewed with.
1942
+ # Required. The resource name of the
1943
+ # [HumanReviewConfig][google.cloud.documentai.v1.HumanReviewConfig] that the
1944
+ # document will be reviewed with.
1927
1945
  # @param enable_schema_validation [::Boolean]
1928
1946
  # Whether the validation should be performed on the ad-hoc review request.
1929
1947
  # @param priority [::Google::Cloud::DocumentAI::V1::ReviewDocumentRequest::Priority]
@@ -2215,8 +2233,8 @@ module Google
2215
2233
  # `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}`
2216
2234
  # @param page_size [::Integer]
2217
2235
  # The standard list page size.
2218
- # If unspecified, at most 5 evaluations will be returned.
2219
- # The maximum value is 100; values above 100 will be coerced to 100.
2236
+ # If unspecified, at most `5` evaluations are returned.
2237
+ # The maximum value is `100`. Values above `100` are coerced to `100`.
2220
2238
  # @param page_token [::String]
2221
2239
  # A page token, received from a previous `ListEvaluations` call.
2222
2240
  # Provide this to retrieve the subsequent page.
@@ -2409,6 +2427,14 @@ module Google
2409
2427
  end
2410
2428
  end
2411
2429
 
2430
+ ##
2431
+ # Configuration for the channel pool
2432
+ # @return [::Gapic::ServiceStub::ChannelPool::Configuration]
2433
+ #
2434
+ def channel_pool
2435
+ @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new
2436
+ end
2437
+
2412
2438
  ##
2413
2439
  # Configuration RPC class for the DocumentProcessorService API.
2414
2440
  #
@@ -93,7 +93,8 @@ module Google
93
93
  credentials: credentials,
94
94
  endpoint: @config.endpoint,
95
95
  channel_args: @config.channel_args,
96
- interceptors: @config.interceptors
96
+ interceptors: @config.interceptors,
97
+ channel_pool_config: @config.channel_pool
97
98
  )
98
99
 
99
100
  # Used by an LRO wrapper for some methods of this service
@@ -701,6 +702,14 @@ module Google
701
702
  end
702
703
  end
703
704
 
705
+ ##
706
+ # Configuration for the channel pool
707
+ # @return [::Gapic::ServiceStub::ChannelPool::Configuration]
708
+ #
709
+ def channel_pool
710
+ @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new
711
+ end
712
+
704
713
  ##
705
714
  # Configuration RPC class for the Operations API.
706
715
  #