google-cloud-document_ai-v1 0.12.0 → 0.14.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -30,7 +30,7 @@ module Google
30
30
  ##
31
31
  # REST client for the DocumentProcessorService service.
32
32
  #
33
- # Service to call Cloud DocumentAI to process documents according to the
33
+ # Service to call Document AI to process documents according to the
34
34
  # processor's definition. Processors are built using state-of-the-art Google
35
35
  # AI such as natural language, computer vision, and translation to extract
36
36
  # structured information from unstructured or semi-structured documents.
@@ -70,7 +70,7 @@ module Google
70
70
  end
71
71
  default_config = Client::Configuration.new parent_config
72
72
 
73
- default_config.rpcs.process_document.timeout = 120.0
73
+ default_config.rpcs.process_document.timeout = 300.0
74
74
  default_config.rpcs.process_document.retry_policy = {
75
75
  initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
76
76
  }
@@ -194,7 +194,7 @@ module Google
194
194
  # @param options [::Gapic::CallOptions, ::Hash]
195
195
  # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
196
196
  #
197
- # @overload process_document(inline_document: nil, raw_document: nil, name: nil, skip_human_review: nil, field_mask: nil)
197
+ # @overload process_document(inline_document: nil, raw_document: nil, gcs_document: nil, name: nil, skip_human_review: nil, field_mask: nil, process_options: nil)
198
198
  # Pass arguments to `process_document` via keyword arguments. Note that at
199
199
  # least one keyword argument is required. To specify no parameters, or to keep all
200
200
  # the default parameter values, pass an empty Hash as a request object (see above).
@@ -203,6 +203,8 @@ module Google
203
203
  # An inline document proto.
204
204
  # @param raw_document [::Google::Cloud::DocumentAI::V1::RawDocument, ::Hash]
205
205
  # A raw document content (bytes).
206
+ # @param gcs_document [::Google::Cloud::DocumentAI::V1::GcsDocument, ::Hash]
207
+ # A raw document on Google Cloud Storage.
206
208
  # @param name [::String]
207
209
  # Required. The resource name of the
208
210
  # {::Google::Cloud::DocumentAI::V1::Processor Processor} or
@@ -215,12 +217,15 @@ module Google
215
217
  # or
216
218
  # `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}`
217
219
  # @param skip_human_review [::Boolean]
218
- # Whether Human Review feature should be skipped for this request. Default to
219
- # false.
220
+ # Whether human review should be skipped for this request. Default to
221
+ # `false`.
220
222
  # @param field_mask [::Google::Protobuf::FieldMask, ::Hash]
221
- # Specifies which fields to include in ProcessResponse's document.
222
- # Only supports top level document and pages field so it must be in the form
223
- # of `{document_field_name}` or `pages.{page_field_name}`.
223
+ # Specifies which fields to include in the
224
+ # {::Google::Cloud::DocumentAI::V1::ProcessResponse#document ProcessResponse.document}
225
+ # output. Only supports top-level document and pages field, so it must be in
226
+ # the form of `{document_field_name}` or `pages.{page_field_name}`.
227
+ # @param process_options [::Google::Cloud::DocumentAI::V1::ProcessOptions, ::Hash]
228
+ # Inference-time options for the process API
224
229
  # @yield [result, operation] Access the result along with the TransportOperation object
225
230
  # @yieldparam result [::Google::Cloud::DocumentAI::V1::ProcessResponse]
226
231
  # @yieldparam operation [::Gapic::Rest::TransportOperation]
@@ -228,6 +233,22 @@ module Google
228
233
  # @return [::Google::Cloud::DocumentAI::V1::ProcessResponse]
229
234
  #
230
235
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
236
+ #
237
+ # @example Basic example
238
+ # require "google/cloud/document_ai/v1"
239
+ #
240
+ # # Create a client object. The client can be reused for multiple calls.
241
+ # client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Rest::Client.new
242
+ #
243
+ # # Create a request. To set request fields, pass in keyword arguments.
244
+ # request = Google::Cloud::DocumentAI::V1::ProcessRequest.new
245
+ #
246
+ # # Call the process_document method.
247
+ # result = client.process_document request
248
+ #
249
+ # # The returned object is of type Google::Cloud::DocumentAI::V1::ProcessResponse.
250
+ # p result
251
+ #
231
252
  def process_document request, options = nil
232
253
  raise ::ArgumentError, "request must be provided" if request.nil?
233
254
 
@@ -277,7 +298,7 @@ module Google
277
298
  # @param options [::Gapic::CallOptions, ::Hash]
278
299
  # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
279
300
  #
280
- # @overload batch_process_documents(name: nil, input_documents: nil, document_output_config: nil, skip_human_review: nil)
301
+ # @overload batch_process_documents(name: nil, input_documents: nil, document_output_config: nil, skip_human_review: nil, process_options: nil)
281
302
  # Pass arguments to `batch_process_documents` via keyword arguments. Note that at
282
303
  # least one keyword argument is required. To specify no parameters, or to keep all
283
304
  # the default parameter values, pass an empty Hash as a request object (see above).
@@ -290,12 +311,18 @@ module Google
290
311
  # or
291
312
  # `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}`
292
313
  # @param input_documents [::Google::Cloud::DocumentAI::V1::BatchDocumentsInputConfig, ::Hash]
293
- # The input documents for batch process.
314
+ # The input documents for the
315
+ # {::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Rest::Client#batch_process_documents BatchProcessDocuments}
316
+ # method.
294
317
  # @param document_output_config [::Google::Cloud::DocumentAI::V1::DocumentOutputConfig, ::Hash]
295
- # The overall output config for batch process.
318
+ # The output configuration for the
319
+ # {::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Rest::Client#batch_process_documents BatchProcessDocuments}
320
+ # method.
296
321
  # @param skip_human_review [::Boolean]
297
- # Whether Human Review feature should be skipped for this request. Default to
298
- # false.
322
+ # Whether human review should be skipped for this request. Default to
323
+ # `false`.
324
+ # @param process_options [::Google::Cloud::DocumentAI::V1::ProcessOptions, ::Hash]
325
+ # Inference-time options for the process API
299
326
  # @yield [result, operation] Access the result along with the TransportOperation object
300
327
  # @yieldparam result [::Gapic::Operation]
301
328
  # @yieldparam operation [::Gapic::Rest::TransportOperation]
@@ -303,6 +330,29 @@ module Google
303
330
  # @return [::Gapic::Operation]
304
331
  #
305
332
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
333
+ #
334
+ # @example Basic example
335
+ # require "google/cloud/document_ai/v1"
336
+ #
337
+ # # Create a client object. The client can be reused for multiple calls.
338
+ # client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Rest::Client.new
339
+ #
340
+ # # Create a request. To set request fields, pass in keyword arguments.
341
+ # request = Google::Cloud::DocumentAI::V1::BatchProcessRequest.new
342
+ #
343
+ # # Call the batch_process_documents method.
344
+ # result = client.batch_process_documents request
345
+ #
346
+ # # The returned object is of type Gapic::Operation. You can use it to
347
+ # # check the status of an operation, cancel it, or wait for results.
348
+ # # Here is how to wait for a response.
349
+ # result.wait_until_done! timeout: 60
350
+ # if result.response?
351
+ # p result.response
352
+ # else
353
+ # puts "No response received."
354
+ # end
355
+ #
306
356
  def batch_process_documents request, options = nil
307
357
  raise ::ArgumentError, "request must be provided" if request.nil?
308
358
 
@@ -340,8 +390,9 @@ module Google
340
390
  end
341
391
 
342
392
  ##
343
- # Fetches processor types. Note that we do not use ListProcessorTypes here
344
- # because it is not paginated.
393
+ # Fetches processor types. Note that we don't use
394
+ # {::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Rest::Client#list_processor_types ListProcessorTypes}
395
+ # here, because it isn't paginated.
345
396
  #
346
397
  # @overload fetch_processor_types(request, options = nil)
347
398
  # Pass arguments to `fetch_processor_types` via a request object, either of type
@@ -359,9 +410,8 @@ module Google
359
410
  # the default parameter values, pass an empty Hash as a request object (see above).
360
411
  #
361
412
  # @param parent [::String]
362
- # Required. The project of processor type to list.
363
- # The available processor types may depend on the allow-listing on projects.
364
- # Format: `projects/{project}/locations/{location}`
413
+ # Required. The location of processor types to list.
414
+ # Format: `projects/{project}/locations/{location}`.
365
415
  # @yield [result, operation] Access the result along with the TransportOperation object
366
416
  # @yieldparam result [::Google::Cloud::DocumentAI::V1::FetchProcessorTypesResponse]
367
417
  # @yieldparam operation [::Gapic::Rest::TransportOperation]
@@ -369,6 +419,22 @@ module Google
369
419
  # @return [::Google::Cloud::DocumentAI::V1::FetchProcessorTypesResponse]
370
420
  #
371
421
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
422
+ #
423
+ # @example Basic example
424
+ # require "google/cloud/document_ai/v1"
425
+ #
426
+ # # Create a client object. The client can be reused for multiple calls.
427
+ # client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Rest::Client.new
428
+ #
429
+ # # Create a request. To set request fields, pass in keyword arguments.
430
+ # request = Google::Cloud::DocumentAI::V1::FetchProcessorTypesRequest.new
431
+ #
432
+ # # Call the fetch_processor_types method.
433
+ # result = client.fetch_processor_types request
434
+ #
435
+ # # The returned object is of type Google::Cloud::DocumentAI::V1::FetchProcessorTypesResponse.
436
+ # p result
437
+ #
372
438
  def fetch_processor_types request, options = nil
373
439
  raise ::ArgumentError, "request must be provided" if request.nil?
374
440
 
@@ -423,13 +489,12 @@ module Google
423
489
  # the default parameter values, pass an empty Hash as a request object (see above).
424
490
  #
425
491
  # @param parent [::String]
426
- # Required. The location of processor type to list.
427
- # The available processor types may depend on the allow-listing on projects.
428
- # Format: `projects/{project}/locations/{location}`
492
+ # Required. The location of processor types to list.
493
+ # Format: `projects/{project}/locations/{location}`.
429
494
  # @param page_size [::Integer]
430
495
  # The maximum number of processor types to return.
431
- # If unspecified, at most 100 processor types will be returned.
432
- # The maximum value is 500; values above 500 will be coerced to 500.
496
+ # If unspecified, at most `100` processor types will be returned.
497
+ # The maximum value is `500`. Values above `500` will be coerced to `500`.
433
498
  # @param page_token [::String]
434
499
  # Used to retrieve the next page of results, empty if at the end of the list.
435
500
  # @yield [result, operation] Access the result along with the TransportOperation object
@@ -439,6 +504,26 @@ module Google
439
504
  # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::DocumentAI::V1::ProcessorType>]
440
505
  #
441
506
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
507
+ #
508
+ # @example Basic example
509
+ # require "google/cloud/document_ai/v1"
510
+ #
511
+ # # Create a client object. The client can be reused for multiple calls.
512
+ # client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Rest::Client.new
513
+ #
514
+ # # Create a request. To set request fields, pass in keyword arguments.
515
+ # request = Google::Cloud::DocumentAI::V1::ListProcessorTypesRequest.new
516
+ #
517
+ # # Call the list_processor_types method.
518
+ # result = client.list_processor_types request
519
+ #
520
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
521
+ # # over elements, and API calls will be issued to fetch pages as needed.
522
+ # result.each do |item|
523
+ # # Each element is of type ::Google::Cloud::DocumentAI::V1::ProcessorType.
524
+ # p item
525
+ # end
526
+ #
442
527
  def list_processor_types request, options = nil
443
528
  raise ::ArgumentError, "request must be provided" if request.nil?
444
529
 
@@ -502,6 +587,22 @@ module Google
502
587
  # @return [::Google::Cloud::DocumentAI::V1::ProcessorType]
503
588
  #
504
589
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
590
+ #
591
+ # @example Basic example
592
+ # require "google/cloud/document_ai/v1"
593
+ #
594
+ # # Create a client object. The client can be reused for multiple calls.
595
+ # client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Rest::Client.new
596
+ #
597
+ # # Create a request. To set request fields, pass in keyword arguments.
598
+ # request = Google::Cloud::DocumentAI::V1::GetProcessorTypeRequest.new
599
+ #
600
+ # # Call the get_processor_type method.
601
+ # result = client.get_processor_type request
602
+ #
603
+ # # The returned object is of type Google::Cloud::DocumentAI::V1::ProcessorType.
604
+ # p result
605
+ #
505
606
  def get_processor_type request, options = nil
506
607
  raise ::ArgumentError, "request must be provided" if request.nil?
507
608
 
@@ -560,8 +661,8 @@ module Google
560
661
  # Processors. Format: `projects/{project}/locations/{location}`
561
662
  # @param page_size [::Integer]
562
663
  # The maximum number of processors to return.
563
- # If unspecified, at most 50 processors will be returned.
564
- # The maximum value is 100; values above 100 will be coerced to 100.
664
+ # If unspecified, at most `50` processors will be returned.
665
+ # The maximum value is `100`. Values above `100` will be coerced to `100`.
565
666
  # @param page_token [::String]
566
667
  # We will return the processors sorted by creation time. The page token
567
668
  # will point to the next processor.
@@ -572,6 +673,26 @@ module Google
572
673
  # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::DocumentAI::V1::Processor>]
573
674
  #
574
675
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
676
+ #
677
+ # @example Basic example
678
+ # require "google/cloud/document_ai/v1"
679
+ #
680
+ # # Create a client object. The client can be reused for multiple calls.
681
+ # client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Rest::Client.new
682
+ #
683
+ # # Create a request. To set request fields, pass in keyword arguments.
684
+ # request = Google::Cloud::DocumentAI::V1::ListProcessorsRequest.new
685
+ #
686
+ # # Call the list_processors method.
687
+ # result = client.list_processors request
688
+ #
689
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
690
+ # # over elements, and API calls will be issued to fetch pages as needed.
691
+ # result.each do |item|
692
+ # # Each element is of type ::Google::Cloud::DocumentAI::V1::Processor.
693
+ # p item
694
+ # end
695
+ #
575
696
  def list_processors request, options = nil
576
697
  raise ::ArgumentError, "request must be provided" if request.nil?
577
698
 
@@ -635,6 +756,22 @@ module Google
635
756
  # @return [::Google::Cloud::DocumentAI::V1::Processor]
636
757
  #
637
758
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
759
+ #
760
+ # @example Basic example
761
+ # require "google/cloud/document_ai/v1"
762
+ #
763
+ # # Create a client object. The client can be reused for multiple calls.
764
+ # client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Rest::Client.new
765
+ #
766
+ # # Create a request. To set request fields, pass in keyword arguments.
767
+ # request = Google::Cloud::DocumentAI::V1::GetProcessorRequest.new
768
+ #
769
+ # # Call the get_processor method.
770
+ # result = client.get_processor request
771
+ #
772
+ # # The returned object is of type Google::Cloud::DocumentAI::V1::Processor.
773
+ # p result
774
+ #
638
775
  def get_processor request, options = nil
639
776
  raise ::ArgumentError, "request must be provided" if request.nil?
640
777
 
@@ -673,7 +810,7 @@ module Google
673
810
  ##
674
811
  # Trains a new processor version.
675
812
  # Operation metadata is returned as
676
- # cloud_documentai_core.TrainProcessorVersionMetadata.
813
+ # {::Google::Cloud::DocumentAI::V1::TrainProcessorVersionMetadata TrainProcessorVersionMetadata}.
677
814
  #
678
815
  # @overload train_processor_version(request, options = nil)
679
816
  # Pass arguments to `train_processor_version` via a request object, either of type
@@ -685,11 +822,13 @@ module Google
685
822
  # @param options [::Gapic::CallOptions, ::Hash]
686
823
  # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
687
824
  #
688
- # @overload train_processor_version(parent: nil, processor_version: nil, document_schema: nil, input_data: nil, base_processor_version: nil)
825
+ # @overload train_processor_version(custom_document_extraction_options: nil, parent: nil, processor_version: nil, document_schema: nil, input_data: nil, base_processor_version: nil)
689
826
  # Pass arguments to `train_processor_version` via keyword arguments. Note that at
690
827
  # least one keyword argument is required. To specify no parameters, or to keep all
691
828
  # the default parameter values, pass an empty Hash as a request object (see above).
692
829
  #
830
+ # @param custom_document_extraction_options [::Google::Cloud::DocumentAI::V1::TrainProcessorVersionRequest::CustomDocumentExtractionOptions, ::Hash]
831
+ # Options to control Custom Document Extraction (CDE) Processor.
693
832
  # @param parent [::String]
694
833
  # Required. The parent (project, location and processor) to create the new
695
834
  # version for. Format:
@@ -699,7 +838,8 @@ module Google
699
838
  # @param document_schema [::Google::Cloud::DocumentAI::V1::DocumentSchema, ::Hash]
700
839
  # Optional. The schema the processor version will be trained with.
701
840
  # @param input_data [::Google::Cloud::DocumentAI::V1::TrainProcessorVersionRequest::InputData, ::Hash]
702
- # Optional. The input data used to train the `ProcessorVersion`.
841
+ # Optional. The input data used to train the
842
+ # {::Google::Cloud::DocumentAI::V1::ProcessorVersion ProcessorVersion}.
703
843
  # @param base_processor_version [::String]
704
844
  # Optional. The processor version to use as a base for training. This
705
845
  # processor version must be a child of `parent`. Format:
@@ -711,6 +851,29 @@ module Google
711
851
  # @return [::Gapic::Operation]
712
852
  #
713
853
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
854
+ #
855
+ # @example Basic example
856
+ # require "google/cloud/document_ai/v1"
857
+ #
858
+ # # Create a client object. The client can be reused for multiple calls.
859
+ # client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Rest::Client.new
860
+ #
861
+ # # Create a request. To set request fields, pass in keyword arguments.
862
+ # request = Google::Cloud::DocumentAI::V1::TrainProcessorVersionRequest.new
863
+ #
864
+ # # Call the train_processor_version method.
865
+ # result = client.train_processor_version request
866
+ #
867
+ # # The returned object is of type Gapic::Operation. You can use it to
868
+ # # check the status of an operation, cancel it, or wait for results.
869
+ # # Here is how to wait for a response.
870
+ # result.wait_until_done! timeout: 60
871
+ # if result.response?
872
+ # p result.response
873
+ # else
874
+ # puts "No response received."
875
+ # end
876
+ #
714
877
  def train_processor_version request, options = nil
715
878
  raise ::ArgumentError, "request must be provided" if request.nil?
716
879
 
@@ -774,6 +937,22 @@ module Google
774
937
  # @return [::Google::Cloud::DocumentAI::V1::ProcessorVersion]
775
938
  #
776
939
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
940
+ #
941
+ # @example Basic example
942
+ # require "google/cloud/document_ai/v1"
943
+ #
944
+ # # Create a client object. The client can be reused for multiple calls.
945
+ # client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Rest::Client.new
946
+ #
947
+ # # Create a request. To set request fields, pass in keyword arguments.
948
+ # request = Google::Cloud::DocumentAI::V1::GetProcessorVersionRequest.new
949
+ #
950
+ # # Call the get_processor_version method.
951
+ # result = client.get_processor_version request
952
+ #
953
+ # # The returned object is of type Google::Cloud::DocumentAI::V1::ProcessorVersion.
954
+ # p result
955
+ #
777
956
  def get_processor_version request, options = nil
778
957
  raise ::ArgumentError, "request must be provided" if request.nil?
779
958
 
@@ -833,8 +1012,8 @@ module Google
833
1012
  # `projects/{project}/locations/{location}/processors/{processor}`
834
1013
  # @param page_size [::Integer]
835
1014
  # The maximum number of processor versions to return.
836
- # If unspecified, at most 10 processor versions will be returned.
837
- # The maximum value is 20; values above 20 will be coerced to 20.
1015
+ # If unspecified, at most `10` processor versions will be returned.
1016
+ # The maximum value is `20`. Values above `20` will be coerced to `20`.
838
1017
  # @param page_token [::String]
839
1018
  # We will return the processor versions sorted by creation time. The page
840
1019
  # token will point to the next processor version.
@@ -845,6 +1024,26 @@ module Google
845
1024
  # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::DocumentAI::V1::ProcessorVersion>]
846
1025
  #
847
1026
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
1027
+ #
1028
+ # @example Basic example
1029
+ # require "google/cloud/document_ai/v1"
1030
+ #
1031
+ # # Create a client object. The client can be reused for multiple calls.
1032
+ # client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Rest::Client.new
1033
+ #
1034
+ # # Create a request. To set request fields, pass in keyword arguments.
1035
+ # request = Google::Cloud::DocumentAI::V1::ListProcessorVersionsRequest.new
1036
+ #
1037
+ # # Call the list_processor_versions method.
1038
+ # result = client.list_processor_versions request
1039
+ #
1040
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
1041
+ # # over elements, and API calls will be issued to fetch pages as needed.
1042
+ # result.each do |item|
1043
+ # # Each element is of type ::Google::Cloud::DocumentAI::V1::ProcessorVersion.
1044
+ # p item
1045
+ # end
1046
+ #
848
1047
  def list_processor_versions request, options = nil
849
1048
  raise ::ArgumentError, "request must be provided" if request.nil?
850
1049
 
@@ -909,6 +1108,29 @@ module Google
909
1108
  # @return [::Gapic::Operation]
910
1109
  #
911
1110
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
1111
+ #
1112
+ # @example Basic example
1113
+ # require "google/cloud/document_ai/v1"
1114
+ #
1115
+ # # Create a client object. The client can be reused for multiple calls.
1116
+ # client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Rest::Client.new
1117
+ #
1118
+ # # Create a request. To set request fields, pass in keyword arguments.
1119
+ # request = Google::Cloud::DocumentAI::V1::DeleteProcessorVersionRequest.new
1120
+ #
1121
+ # # Call the delete_processor_version method.
1122
+ # result = client.delete_processor_version request
1123
+ #
1124
+ # # The returned object is of type Gapic::Operation. You can use it to
1125
+ # # check the status of an operation, cancel it, or wait for results.
1126
+ # # Here is how to wait for a response.
1127
+ # result.wait_until_done! timeout: 60
1128
+ # if result.response?
1129
+ # p result.response
1130
+ # else
1131
+ # puts "No response received."
1132
+ # end
1133
+ #
912
1134
  def delete_processor_version request, options = nil
913
1135
  raise ::ArgumentError, "request must be provided" if request.nil?
914
1136
 
@@ -972,6 +1194,29 @@ module Google
972
1194
  # @return [::Gapic::Operation]
973
1195
  #
974
1196
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
1197
+ #
1198
+ # @example Basic example
1199
+ # require "google/cloud/document_ai/v1"
1200
+ #
1201
+ # # Create a client object. The client can be reused for multiple calls.
1202
+ # client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Rest::Client.new
1203
+ #
1204
+ # # Create a request. To set request fields, pass in keyword arguments.
1205
+ # request = Google::Cloud::DocumentAI::V1::DeployProcessorVersionRequest.new
1206
+ #
1207
+ # # Call the deploy_processor_version method.
1208
+ # result = client.deploy_processor_version request
1209
+ #
1210
+ # # The returned object is of type Gapic::Operation. You can use it to
1211
+ # # check the status of an operation, cancel it, or wait for results.
1212
+ # # Here is how to wait for a response.
1213
+ # result.wait_until_done! timeout: 60
1214
+ # if result.response?
1215
+ # p result.response
1216
+ # else
1217
+ # puts "No response received."
1218
+ # end
1219
+ #
975
1220
  def deploy_processor_version request, options = nil
976
1221
  raise ::ArgumentError, "request must be provided" if request.nil?
977
1222
 
@@ -1035,6 +1280,29 @@ module Google
1035
1280
  # @return [::Gapic::Operation]
1036
1281
  #
1037
1282
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
1283
+ #
1284
+ # @example Basic example
1285
+ # require "google/cloud/document_ai/v1"
1286
+ #
1287
+ # # Create a client object. The client can be reused for multiple calls.
1288
+ # client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Rest::Client.new
1289
+ #
1290
+ # # Create a request. To set request fields, pass in keyword arguments.
1291
+ # request = Google::Cloud::DocumentAI::V1::UndeployProcessorVersionRequest.new
1292
+ #
1293
+ # # Call the undeploy_processor_version method.
1294
+ # result = client.undeploy_processor_version request
1295
+ #
1296
+ # # The returned object is of type Gapic::Operation. You can use it to
1297
+ # # check the status of an operation, cancel it, or wait for results.
1298
+ # # Here is how to wait for a response.
1299
+ # result.wait_until_done! timeout: 60
1300
+ # if result.response?
1301
+ # p result.response
1302
+ # else
1303
+ # puts "No response received."
1304
+ # end
1305
+ #
1038
1306
  def undeploy_processor_version request, options = nil
1039
1307
  raise ::ArgumentError, "request must be provided" if request.nil?
1040
1308
 
@@ -1072,8 +1340,9 @@ module Google
1072
1340
  end
1073
1341
 
1074
1342
  ##
1075
- # Creates a processor from the type processor that the user chose.
1076
- # The processor will be at "ENABLED" state by default after its creation.
1343
+ # Creates a processor from the
1344
+ # {::Google::Cloud::DocumentAI::V1::ProcessorType ProcessorType} provided. The
1345
+ # processor will be at `ENABLED` state by default after its creation.
1077
1346
  #
1078
1347
  # @overload create_processor(request, options = nil)
1079
1348
  # Pass arguments to `create_processor` via a request object, either of type
@@ -1094,9 +1363,11 @@ module Google
1094
1363
  # Required. The parent (project and location) under which to create the
1095
1364
  # processor. Format: `projects/{project}/locations/{location}`
1096
1365
  # @param processor [::Google::Cloud::DocumentAI::V1::Processor, ::Hash]
1097
- # Required. The processor to be created, requires [processor_type] and
1098
- # [display_name] to be set. Also, the processor is under CMEK if CMEK fields
1099
- # are set.
1366
+ # Required. The processor to be created, requires
1367
+ # {::Google::Cloud::DocumentAI::V1::Processor#type Processor.type} and
1368
+ # [Processor.display_name]][] to be set. Also, the
1369
+ # {::Google::Cloud::DocumentAI::V1::Processor#kms_key_name Processor.kms_key_name}
1370
+ # field must be set if the processor is under CMEK.
1100
1371
  # @yield [result, operation] Access the result along with the TransportOperation object
1101
1372
  # @yieldparam result [::Google::Cloud::DocumentAI::V1::Processor]
1102
1373
  # @yieldparam operation [::Gapic::Rest::TransportOperation]
@@ -1104,6 +1375,22 @@ module Google
1104
1375
  # @return [::Google::Cloud::DocumentAI::V1::Processor]
1105
1376
  #
1106
1377
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
1378
+ #
1379
+ # @example Basic example
1380
+ # require "google/cloud/document_ai/v1"
1381
+ #
1382
+ # # Create a client object. The client can be reused for multiple calls.
1383
+ # client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Rest::Client.new
1384
+ #
1385
+ # # Create a request. To set request fields, pass in keyword arguments.
1386
+ # request = Google::Cloud::DocumentAI::V1::CreateProcessorRequest.new
1387
+ #
1388
+ # # Call the create_processor method.
1389
+ # result = client.create_processor request
1390
+ #
1391
+ # # The returned object is of type Google::Cloud::DocumentAI::V1::Processor.
1392
+ # p result
1393
+ #
1107
1394
  def create_processor request, options = nil
1108
1395
  raise ::ArgumentError, "request must be provided" if request.nil?
1109
1396
 
@@ -1167,6 +1454,29 @@ module Google
1167
1454
  # @return [::Gapic::Operation]
1168
1455
  #
1169
1456
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
1457
+ #
1458
+ # @example Basic example
1459
+ # require "google/cloud/document_ai/v1"
1460
+ #
1461
+ # # Create a client object. The client can be reused for multiple calls.
1462
+ # client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Rest::Client.new
1463
+ #
1464
+ # # Create a request. To set request fields, pass in keyword arguments.
1465
+ # request = Google::Cloud::DocumentAI::V1::DeleteProcessorRequest.new
1466
+ #
1467
+ # # Call the delete_processor method.
1468
+ # result = client.delete_processor request
1469
+ #
1470
+ # # The returned object is of type Gapic::Operation. You can use it to
1471
+ # # check the status of an operation, cancel it, or wait for results.
1472
+ # # Here is how to wait for a response.
1473
+ # result.wait_until_done! timeout: 60
1474
+ # if result.response?
1475
+ # p result.response
1476
+ # else
1477
+ # puts "No response received."
1478
+ # end
1479
+ #
1170
1480
  def delete_processor request, options = nil
1171
1481
  raise ::ArgumentError, "request must be provided" if request.nil?
1172
1482
 
@@ -1230,6 +1540,29 @@ module Google
1230
1540
  # @return [::Gapic::Operation]
1231
1541
  #
1232
1542
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
1543
+ #
1544
+ # @example Basic example
1545
+ # require "google/cloud/document_ai/v1"
1546
+ #
1547
+ # # Create a client object. The client can be reused for multiple calls.
1548
+ # client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Rest::Client.new
1549
+ #
1550
+ # # Create a request. To set request fields, pass in keyword arguments.
1551
+ # request = Google::Cloud::DocumentAI::V1::EnableProcessorRequest.new
1552
+ #
1553
+ # # Call the enable_processor method.
1554
+ # result = client.enable_processor request
1555
+ #
1556
+ # # The returned object is of type Gapic::Operation. You can use it to
1557
+ # # check the status of an operation, cancel it, or wait for results.
1558
+ # # Here is how to wait for a response.
1559
+ # result.wait_until_done! timeout: 60
1560
+ # if result.response?
1561
+ # p result.response
1562
+ # else
1563
+ # puts "No response received."
1564
+ # end
1565
+ #
1233
1566
  def enable_processor request, options = nil
1234
1567
  raise ::ArgumentError, "request must be provided" if request.nil?
1235
1568
 
@@ -1293,6 +1626,29 @@ module Google
1293
1626
  # @return [::Gapic::Operation]
1294
1627
  #
1295
1628
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
1629
+ #
1630
+ # @example Basic example
1631
+ # require "google/cloud/document_ai/v1"
1632
+ #
1633
+ # # Create a client object. The client can be reused for multiple calls.
1634
+ # client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Rest::Client.new
1635
+ #
1636
+ # # Create a request. To set request fields, pass in keyword arguments.
1637
+ # request = Google::Cloud::DocumentAI::V1::DisableProcessorRequest.new
1638
+ #
1639
+ # # Call the disable_processor method.
1640
+ # result = client.disable_processor request
1641
+ #
1642
+ # # The returned object is of type Gapic::Operation. You can use it to
1643
+ # # check the status of an operation, cancel it, or wait for results.
1644
+ # # Here is how to wait for a response.
1645
+ # result.wait_until_done! timeout: 60
1646
+ # if result.response?
1647
+ # p result.response
1648
+ # else
1649
+ # puts "No response received."
1650
+ # end
1651
+ #
1296
1652
  def disable_processor request, options = nil
1297
1653
  raise ::ArgumentError, "request must be provided" if request.nil?
1298
1654
 
@@ -1367,6 +1723,29 @@ module Google
1367
1723
  # @return [::Gapic::Operation]
1368
1724
  #
1369
1725
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
1726
+ #
1727
+ # @example Basic example
1728
+ # require "google/cloud/document_ai/v1"
1729
+ #
1730
+ # # Create a client object. The client can be reused for multiple calls.
1731
+ # client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Rest::Client.new
1732
+ #
1733
+ # # Create a request. To set request fields, pass in keyword arguments.
1734
+ # request = Google::Cloud::DocumentAI::V1::SetDefaultProcessorVersionRequest.new
1735
+ #
1736
+ # # Call the set_default_processor_version method.
1737
+ # result = client.set_default_processor_version request
1738
+ #
1739
+ # # The returned object is of type Gapic::Operation. You can use it to
1740
+ # # check the status of an operation, cancel it, or wait for results.
1741
+ # # Here is how to wait for a response.
1742
+ # result.wait_until_done! timeout: 60
1743
+ # if result.response?
1744
+ # p result.response
1745
+ # else
1746
+ # puts "No response received."
1747
+ # end
1748
+ #
1370
1749
  def set_default_processor_version request, options = nil
1371
1750
  raise ::ArgumentError, "request must be provided" if request.nil?
1372
1751
 
@@ -1425,8 +1804,9 @@ module Google
1425
1804
  # @param inline_document [::Google::Cloud::DocumentAI::V1::Document, ::Hash]
1426
1805
  # An inline document proto.
1427
1806
  # @param human_review_config [::String]
1428
- # Required. The resource name of the HumanReviewConfig that the document will
1429
- # be reviewed with.
1807
+ # Required. The resource name of the
1808
+ # [HumanReviewConfig][google.cloud.documentai.v1.HumanReviewConfig] that the
1809
+ # document will be reviewed with.
1430
1810
  # @param enable_schema_validation [::Boolean]
1431
1811
  # Whether the validation should be performed on the ad-hoc review request.
1432
1812
  # @param priority [::Google::Cloud::DocumentAI::V1::ReviewDocumentRequest::Priority]
@@ -1440,6 +1820,29 @@ module Google
1440
1820
  # @return [::Gapic::Operation]
1441
1821
  #
1442
1822
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
1823
+ #
1824
+ # @example Basic example
1825
+ # require "google/cloud/document_ai/v1"
1826
+ #
1827
+ # # Create a client object. The client can be reused for multiple calls.
1828
+ # client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Rest::Client.new
1829
+ #
1830
+ # # Create a request. To set request fields, pass in keyword arguments.
1831
+ # request = Google::Cloud::DocumentAI::V1::ReviewDocumentRequest.new
1832
+ #
1833
+ # # Call the review_document method.
1834
+ # result = client.review_document request
1835
+ #
1836
+ # # The returned object is of type Gapic::Operation. You can use it to
1837
+ # # check the status of an operation, cancel it, or wait for results.
1838
+ # # Here is how to wait for a response.
1839
+ # result.wait_until_done! timeout: 60
1840
+ # if result.response?
1841
+ # p result.response
1842
+ # else
1843
+ # puts "No response received."
1844
+ # end
1845
+ #
1443
1846
  def review_document request, options = nil
1444
1847
  raise ::ArgumentError, "request must be provided" if request.nil?
1445
1848
 
@@ -1510,6 +1913,29 @@ module Google
1510
1913
  # @return [::Gapic::Operation]
1511
1914
  #
1512
1915
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
1916
+ #
1917
+ # @example Basic example
1918
+ # require "google/cloud/document_ai/v1"
1919
+ #
1920
+ # # Create a client object. The client can be reused for multiple calls.
1921
+ # client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Rest::Client.new
1922
+ #
1923
+ # # Create a request. To set request fields, pass in keyword arguments.
1924
+ # request = Google::Cloud::DocumentAI::V1::EvaluateProcessorVersionRequest.new
1925
+ #
1926
+ # # Call the evaluate_processor_version method.
1927
+ # result = client.evaluate_processor_version request
1928
+ #
1929
+ # # The returned object is of type Gapic::Operation. You can use it to
1930
+ # # check the status of an operation, cancel it, or wait for results.
1931
+ # # Here is how to wait for a response.
1932
+ # result.wait_until_done! timeout: 60
1933
+ # if result.response?
1934
+ # p result.response
1935
+ # else
1936
+ # puts "No response received."
1937
+ # end
1938
+ #
1513
1939
  def evaluate_processor_version request, options = nil
1514
1940
  raise ::ArgumentError, "request must be provided" if request.nil?
1515
1941
 
@@ -1575,6 +2001,22 @@ module Google
1575
2001
  # @return [::Google::Cloud::DocumentAI::V1::Evaluation]
1576
2002
  #
1577
2003
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
2004
+ #
2005
+ # @example Basic example
2006
+ # require "google/cloud/document_ai/v1"
2007
+ #
2008
+ # # Create a client object. The client can be reused for multiple calls.
2009
+ # client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Rest::Client.new
2010
+ #
2011
+ # # Create a request. To set request fields, pass in keyword arguments.
2012
+ # request = Google::Cloud::DocumentAI::V1::GetEvaluationRequest.new
2013
+ #
2014
+ # # Call the get_evaluation method.
2015
+ # result = client.get_evaluation request
2016
+ #
2017
+ # # The returned object is of type Google::Cloud::DocumentAI::V1::Evaluation.
2018
+ # p result
2019
+ #
1578
2020
  def get_evaluation request, options = nil
1579
2021
  raise ::ArgumentError, "request must be provided" if request.nil?
1580
2022
 
@@ -1635,8 +2077,8 @@ module Google
1635
2077
  # `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}`
1636
2078
  # @param page_size [::Integer]
1637
2079
  # The standard list page size.
1638
- # If unspecified, at most 5 evaluations will be returned.
1639
- # The maximum value is 100; values above 100 will be coerced to 100.
2080
+ # If unspecified, at most `5` evaluations are returned.
2081
+ # The maximum value is `100`. Values above `100` are coerced to `100`.
1640
2082
  # @param page_token [::String]
1641
2083
  # A page token, received from a previous `ListEvaluations` call.
1642
2084
  # Provide this to retrieve the subsequent page.
@@ -1647,6 +2089,26 @@ module Google
1647
2089
  # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::DocumentAI::V1::Evaluation>]
1648
2090
  #
1649
2091
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
2092
+ #
2093
+ # @example Basic example
2094
+ # require "google/cloud/document_ai/v1"
2095
+ #
2096
+ # # Create a client object. The client can be reused for multiple calls.
2097
+ # client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Rest::Client.new
2098
+ #
2099
+ # # Create a request. To set request fields, pass in keyword arguments.
2100
+ # request = Google::Cloud::DocumentAI::V1::ListEvaluationsRequest.new
2101
+ #
2102
+ # # Call the list_evaluations method.
2103
+ # result = client.list_evaluations request
2104
+ #
2105
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
2106
+ # # over elements, and API calls will be issued to fetch pages as needed.
2107
+ # result.each do |item|
2108
+ # # Each element is of type ::Google::Cloud::DocumentAI::V1::Evaluation.
2109
+ # p item
2110
+ # end
2111
+ #
1650
2112
  def list_evaluations request, options = nil
1651
2113
  raise ::ArgumentError, "request must be provided" if request.nil?
1652
2114