Class: Google::Apis::DocumentaiV1::DocumentService

Inherits:
Core::BaseService
  • Object
show all
Defined in:
lib/google/apis/documentai_v1/service.rb

Overview

Cloud Document AI API

Service to parse structured information from unstructured or semi-structured documents using state-of-the-art Google AI such as natural language, computer vision, translation, and AutoML.

Examples:

require 'google/apis/documentai_v1'

Documentai = Google::Apis::DocumentaiV1 # Alias the module
service = Documentai::DocumentService.new

See Also:

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeDocumentService

Returns a new instance of DocumentService.

[View source]

47
48
49
50
51
52
# File 'lib/google/apis/documentai_v1/service.rb', line 47

def initialize
  super('https://documentai.googleapis.com/', '',
        client_name: 'google-apis-documentai_v1',
        client_version: Google::Apis::DocumentaiV1::GEM_VERSION)
  @batch_path = 'batch'
end

Instance Attribute Details

#keyString

Returns API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.

Returns:

  • (String)

    API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.


40
41
42
# File 'lib/google/apis/documentai_v1/service.rb', line 40

def key
  @key
end

#quota_userString

Returns Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

Returns:

  • (String)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.


45
46
47
# File 'lib/google/apis/documentai_v1/service.rb', line 45

def quota_user
  @quota_user
end

Instance Method Details

#batch_project_location_processor_process(name, google_cloud_documentai_v1_batch_process_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DocumentaiV1::GoogleLongrunningOperation

LRO endpoint to batch process many documents. The output is written to Cloud Storage as JSON in the [Document] format.

Parameters:

  • name (String)

    Required. The resource name of Processor or ProcessorVersion. Format: projects/project/locations/location/processors/processor, or `projects/` project`/locations/`location`/processors/`processor`/processorVersions/` processorVersion

  • google_cloud_documentai_v1_batch_process_request_object (Google::Apis::DocumentaiV1::GoogleCloudDocumentaiV1BatchProcessRequest) (defaults to: nil)
  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required

[View source]

394
395
396
397
398
399
400
401
402
403
404
# File 'lib/google/apis/documentai_v1/service.rb', line 394

def batch_project_location_processor_process(name, google_cloud_documentai_v1_batch_process_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'v1/{+name}:batchProcess', options)
  command.request_representation = Google::Apis::DocumentaiV1::GoogleCloudDocumentaiV1BatchProcessRequest::Representation
  command.request_object = google_cloud_documentai_v1_batch_process_request_object
  command.response_representation = Google::Apis::DocumentaiV1::GoogleLongrunningOperation::Representation
  command.response_class = Google::Apis::DocumentaiV1::GoogleLongrunningOperation
  command.params['name'] = name unless name.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#batch_project_location_processor_processor_version_process(name, google_cloud_documentai_v1_batch_process_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DocumentaiV1::GoogleLongrunningOperation

LRO endpoint to batch process many documents. The output is written to Cloud Storage as JSON in the [Document] format.

Parameters:

  • name (String)

    Required. The resource name of Processor or ProcessorVersion. Format: projects/project/locations/location/processors/processor, or `projects/` project`/locations/`location`/processors/`processor`/processorVersions/` processorVersion

  • google_cloud_documentai_v1_batch_process_request_object (Google::Apis::DocumentaiV1::GoogleCloudDocumentaiV1BatchProcessRequest) (defaults to: nil)
  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required

[View source]

739
740
741
742
743
744
745
746
747
748
749
# File 'lib/google/apis/documentai_v1/service.rb', line 739

def batch_project_location_processor_processor_version_process(name, google_cloud_documentai_v1_batch_process_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'v1/{+name}:batchProcess', options)
  command.request_representation = Google::Apis::DocumentaiV1::GoogleCloudDocumentaiV1BatchProcessRequest::Representation
  command.request_object = google_cloud_documentai_v1_batch_process_request_object
  command.response_representation = Google::Apis::DocumentaiV1::GoogleLongrunningOperation::Representation
  command.response_class = Google::Apis::DocumentaiV1::GoogleLongrunningOperation
  command.params['name'] = name unless name.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#cancel_project_location_operation(name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DocumentaiV1::GoogleProtobufEmpty

Starts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed. If the server doesn't support this method, it returns google.rpc.Code.UNIMPLEMENTED. Clients can use Operations.GetOperation or other methods to check whether the cancellation succeeded or whether the operation completed despite cancellation. On successful cancellation, the operation is not deleted; instead, it becomes an operation with an Operation.error value with a google.rpc.Status.code of 1, corresponding to Code.CANCELLED.

Parameters:

  • name (String)

    The name of the operation resource to be cancelled.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required

[View source]

219
220
221
222
223
224
225
226
227
# File 'lib/google/apis/documentai_v1/service.rb', line 219

def cancel_project_location_operation(name, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'v1/{+name}:cancel', options)
  command.response_representation = Google::Apis::DocumentaiV1::GoogleProtobufEmpty::Representation
  command.response_class = Google::Apis::DocumentaiV1::GoogleProtobufEmpty
  command.params['name'] = name unless name.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#create_project_location_processor(parent, google_cloud_documentai_v1_processor_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DocumentaiV1::GoogleCloudDocumentaiV1Processor

Creates a processor from the ProcessorType provided. The processor will be at ENABLED state by default after its creation.

Parameters:

  • parent (String)

    Required. The parent (project and location) under which to create the processor. Format: projects/project/locations/location``

  • google_cloud_documentai_v1_processor_object (Google::Apis::DocumentaiV1::GoogleCloudDocumentaiV1Processor) (defaults to: nil)
  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required

[View source]

429
430
431
432
433
434
435
436
437
438
439
# File 'lib/google/apis/documentai_v1/service.rb', line 429

def create_project_location_processor(parent, google_cloud_documentai_v1_processor_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'v1/{+parent}/processors', options)
  command.request_representation = Google::Apis::DocumentaiV1::GoogleCloudDocumentaiV1Processor::Representation
  command.request_object = google_cloud_documentai_v1_processor_object
  command.response_representation = Google::Apis::DocumentaiV1::GoogleCloudDocumentaiV1Processor::Representation
  command.response_class = Google::Apis::DocumentaiV1::GoogleCloudDocumentaiV1Processor
  command.params['parent'] = parent unless parent.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#delete_operation(name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DocumentaiV1::GoogleProtobufEmpty

Deletes a long-running operation. This method indicates that the client is no longer interested in the operation result. It does not cancel the operation. If the server doesn't support this method, it returns google.rpc.Code. UNIMPLEMENTED.

Parameters:

  • name (String)

    The name of the operation resource to be deleted.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required

[View source]

77
78
79
80
81
82
83
84
85
# File 'lib/google/apis/documentai_v1/service.rb', line 77

def delete_operation(name, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:delete, 'v1/{+name}', options)
  command.response_representation = Google::Apis::DocumentaiV1::GoogleProtobufEmpty::Representation
  command.response_class = Google::Apis::DocumentaiV1::GoogleProtobufEmpty
  command.params['name'] = name unless name.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#delete_project_location_processor(name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DocumentaiV1::GoogleLongrunningOperation

Deletes the processor, unloads all deployed model artifacts if it was enabled and then deletes all artifacts associated with this processor.

Parameters:

  • name (String)

    Required. The processor resource name to be deleted.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required

[View source]

462
463
464
465
466
467
468
469
470
# File 'lib/google/apis/documentai_v1/service.rb', line 462

def delete_project_location_processor(name, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:delete, 'v1/{+name}', options)
  command.response_representation = Google::Apis::DocumentaiV1::GoogleLongrunningOperation::Representation
  command.response_class = Google::Apis::DocumentaiV1::GoogleLongrunningOperation
  command.params['name'] = name unless name.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#delete_project_location_processor_processor_version(name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DocumentaiV1::GoogleLongrunningOperation

Deletes the processor version, all artifacts under the processor version will be deleted.

Parameters:

  • name (String)

    Required. The processor version resource name to be deleted.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required

[View source]

772
773
774
775
776
777
778
779
780
# File 'lib/google/apis/documentai_v1/service.rb', line 772

def delete_project_location_processor_processor_version(name, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:delete, 'v1/{+name}', options)
  command.response_representation = Google::Apis::DocumentaiV1::GoogleLongrunningOperation::Representation
  command.response_class = Google::Apis::DocumentaiV1::GoogleLongrunningOperation
  command.params['name'] = name unless name.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#deploy_project_location_processor_processor_version(name, google_cloud_documentai_v1_deploy_processor_version_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DocumentaiV1::GoogleLongrunningOperation

Deploys the processor version.

Parameters:

  • name (String)

    Required. The processor version resource name to be deployed.

  • google_cloud_documentai_v1_deploy_processor_version_request_object (Google::Apis::DocumentaiV1::GoogleCloudDocumentaiV1DeployProcessorVersionRequest) (defaults to: nil)
  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required

[View source]

803
804
805
806
807
808
809
810
811
812
813
# File 'lib/google/apis/documentai_v1/service.rb', line 803

def deploy_project_location_processor_processor_version(name, google_cloud_documentai_v1_deploy_processor_version_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'v1/{+name}:deploy', options)
  command.request_representation = Google::Apis::DocumentaiV1::GoogleCloudDocumentaiV1DeployProcessorVersionRequest::Representation
  command.request_object = google_cloud_documentai_v1_deploy_processor_version_request_object
  command.response_representation = Google::Apis::DocumentaiV1::GoogleLongrunningOperation::Representation
  command.response_class = Google::Apis::DocumentaiV1::GoogleLongrunningOperation
  command.params['name'] = name unless name.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#disable_project_location_processor(name, google_cloud_documentai_v1_disable_processor_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DocumentaiV1::GoogleLongrunningOperation

Disables a processor

Parameters:

  • name (String)

    Required. The processor resource name to be disabled.

  • google_cloud_documentai_v1_disable_processor_request_object (Google::Apis::DocumentaiV1::GoogleCloudDocumentaiV1DisableProcessorRequest) (defaults to: nil)
  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required

[View source]

493
494
495
496
497
498
499
500
501
502
503
# File 'lib/google/apis/documentai_v1/service.rb', line 493

def disable_project_location_processor(name, google_cloud_documentai_v1_disable_processor_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'v1/{+name}:disable', options)
  command.request_representation = Google::Apis::DocumentaiV1::GoogleCloudDocumentaiV1DisableProcessorRequest::Representation
  command.request_object = google_cloud_documentai_v1_disable_processor_request_object
  command.response_representation = Google::Apis::DocumentaiV1::GoogleLongrunningOperation::Representation
  command.response_class = Google::Apis::DocumentaiV1::GoogleLongrunningOperation
  command.params['name'] = name unless name.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#enable_project_location_processor(name, google_cloud_documentai_v1_enable_processor_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DocumentaiV1::GoogleLongrunningOperation

Enables a processor

Parameters:

  • name (String)

    Required. The processor resource name to be enabled.

  • google_cloud_documentai_v1_enable_processor_request_object (Google::Apis::DocumentaiV1::GoogleCloudDocumentaiV1EnableProcessorRequest) (defaults to: nil)
  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required

[View source]

526
527
528
529
530
531
532
533
534
535
536
# File 'lib/google/apis/documentai_v1/service.rb', line 526

def enable_project_location_processor(name, google_cloud_documentai_v1_enable_processor_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'v1/{+name}:enable', options)
  command.request_representation = Google::Apis::DocumentaiV1::GoogleCloudDocumentaiV1EnableProcessorRequest::Representation
  command.request_object = google_cloud_documentai_v1_enable_processor_request_object
  command.response_representation = Google::Apis::DocumentaiV1::GoogleLongrunningOperation::Representation
  command.response_class = Google::Apis::DocumentaiV1::GoogleLongrunningOperation
  command.params['name'] = name unless name.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#evaluate_project_location_processor_processor_version_processor_version(processor_version, google_cloud_documentai_v1_evaluate_processor_version_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DocumentaiV1::GoogleLongrunningOperation

Evaluates a ProcessorVersion against annotated documents, producing an Evaluation.

Parameters:

  • processor_version (String)

    Required. The resource name of the ProcessorVersion to evaluate. projects/ project/locations/location/processors/processor/processorVersions/ processorVersion``

  • google_cloud_documentai_v1_evaluate_processor_version_request_object (Google::Apis::DocumentaiV1::GoogleCloudDocumentaiV1EvaluateProcessorVersionRequest) (defaults to: nil)
  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required

[View source]

839
840
841
842
843
844
845
846
847
848
849
# File 'lib/google/apis/documentai_v1/service.rb', line 839

def evaluate_project_location_processor_processor_version_processor_version(processor_version, google_cloud_documentai_v1_evaluate_processor_version_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'v1/{+processorVersion}:evaluateProcessorVersion', options)
  command.request_representation = Google::Apis::DocumentaiV1::GoogleCloudDocumentaiV1EvaluateProcessorVersionRequest::Representation
  command.request_object = google_cloud_documentai_v1_evaluate_processor_version_request_object
  command.response_representation = Google::Apis::DocumentaiV1::GoogleLongrunningOperation::Representation
  command.response_class = Google::Apis::DocumentaiV1::GoogleLongrunningOperation
  command.params['processorVersion'] = processor_version unless processor_version.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#fetch_project_location_processor_types(parent, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DocumentaiV1::GoogleCloudDocumentaiV1FetchProcessorTypesResponse

Fetches processor types. Note that we don't use ListProcessorTypes here, because it isn't paginated.

Parameters:

  • parent (String)

    Required. The location of processor types to list. Format: projects/project/ locations/location``.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required

[View source]

109
110
111
112
113
114
115
116
117
# File 'lib/google/apis/documentai_v1/service.rb', line 109

def fetch_project_location_processor_types(parent, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v1/{+parent}:fetchProcessorTypes', options)
  command.response_representation = Google::Apis::DocumentaiV1::GoogleCloudDocumentaiV1FetchProcessorTypesResponse::Representation
  command.response_class = Google::Apis::DocumentaiV1::GoogleCloudDocumentaiV1FetchProcessorTypesResponse
  command.params['parent'] = parent unless parent.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#get_project_location(name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DocumentaiV1::GoogleCloudLocationLocation

Gets information about a location.

Parameters:

  • name (String)

    Resource name for the location.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required

[View source]

139
140
141
142
143
144
145
146
147
# File 'lib/google/apis/documentai_v1/service.rb', line 139

def get_project_location(name, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v1/{+name}', options)
  command.response_representation = Google::Apis::DocumentaiV1::GoogleCloudLocationLocation::Representation
  command.response_class = Google::Apis::DocumentaiV1::GoogleCloudLocationLocation
  command.params['name'] = name unless name.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#get_project_location_operation(name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DocumentaiV1::GoogleLongrunningOperation

Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service.

Parameters:

  • name (String)

    The name of the operation resource.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required

[View source]

250
251
252
253
254
255
256
257
258
# File 'lib/google/apis/documentai_v1/service.rb', line 250

def get_project_location_operation(name, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v1/{+name}', options)
  command.response_representation = Google::Apis::DocumentaiV1::GoogleLongrunningOperation::Representation
  command.response_class = Google::Apis::DocumentaiV1::GoogleLongrunningOperation
  command.params['name'] = name unless name.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#get_project_location_processor(name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DocumentaiV1::GoogleCloudDocumentaiV1Processor

Gets a processor detail.

Parameters:

  • name (String)

    Required. The processor resource name.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required

[View source]

558
559
560
561
562
563
564
565
566
# File 'lib/google/apis/documentai_v1/service.rb', line 558

def get_project_location_processor(name, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v1/{+name}', options)
  command.response_representation = Google::Apis::DocumentaiV1::GoogleCloudDocumentaiV1Processor::Representation
  command.response_class = Google::Apis::DocumentaiV1::GoogleCloudDocumentaiV1Processor
  command.params['name'] = name unless name.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#get_project_location_processor_processor_version(name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DocumentaiV1::GoogleCloudDocumentaiV1ProcessorVersion

Gets a processor version detail.

Parameters:

  • name (String)

    Required. The processor resource name.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required

[View source]

871
872
873
874
875
876
877
878
879
# File 'lib/google/apis/documentai_v1/service.rb', line 871

def get_project_location_processor_processor_version(name, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v1/{+name}', options)
  command.response_representation = Google::Apis::DocumentaiV1::GoogleCloudDocumentaiV1ProcessorVersion::Representation
  command.response_class = Google::Apis::DocumentaiV1::GoogleCloudDocumentaiV1ProcessorVersion
  command.params['name'] = name unless name.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#get_project_location_processor_processor_version_evaluation(name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DocumentaiV1::GoogleCloudDocumentaiV1Evaluation

Retrieves a specific evaluation.

Parameters:

  • name (String)

    Required. The resource name of the Evaluation to get. projects/project/ locations/location/processors/processor/processorVersions/ processorVersion/evaluations/evaluation``

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required

[View source]

1049
1050
1051
1052
1053
1054
1055
1056
1057
# File 'lib/google/apis/documentai_v1/service.rb', line 1049

def get_project_location_processor_processor_version_evaluation(name, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v1/{+name}', options)
  command.response_representation = Google::Apis::DocumentaiV1::GoogleCloudDocumentaiV1Evaluation::Representation
  command.response_class = Google::Apis::DocumentaiV1::GoogleCloudDocumentaiV1Evaluation
  command.params['name'] = name unless name.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#get_project_location_processor_type(name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DocumentaiV1::GoogleCloudDocumentaiV1ProcessorType

Gets a processor type detail.

Parameters:

  • name (String)

    Required. The processor type resource name.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required

[View source]

320
321
322
323
324
325
326
327
328
# File 'lib/google/apis/documentai_v1/service.rb', line 320

def get_project_location_processor_type(name, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v1/{+name}', options)
  command.response_representation = Google::Apis::DocumentaiV1::GoogleCloudDocumentaiV1ProcessorType::Representation
  command.response_class = Google::Apis::DocumentaiV1::GoogleCloudDocumentaiV1ProcessorType
  command.params['name'] = name unless name.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#get_project_operation(name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DocumentaiV1::GoogleLongrunningOperation

Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service.

Parameters:

  • name (String)

    The name of the operation resource.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required

[View source]

1120
1121
1122
1123
1124
1125
1126
1127
1128
# File 'lib/google/apis/documentai_v1/service.rb', line 1120

def get_project_operation(name, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v1/{+name}', options)
  command.response_representation = Google::Apis::DocumentaiV1::GoogleLongrunningOperation::Representation
  command.response_class = Google::Apis::DocumentaiV1::GoogleLongrunningOperation
  command.params['name'] = name unless name.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#list_project_location_operations(name, filter: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DocumentaiV1::GoogleLongrunningListOperationsResponse

Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns UNIMPLEMENTED.

Parameters:

  • name (String)

    The name of the operation's parent resource.

  • filter (String) (defaults to: nil)

    The standard list filter.

  • page_size (Fixnum) (defaults to: nil)

    The standard list page size.

  • page_token (String) (defaults to: nil)

    The standard list page token.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required

[View source]

287
288
289
290
291
292
293
294
295
296
297
298
# File 'lib/google/apis/documentai_v1/service.rb', line 287

def list_project_location_operations(name, filter: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v1/{+name}', options)
  command.response_representation = Google::Apis::DocumentaiV1::GoogleLongrunningListOperationsResponse::Representation
  command.response_class = Google::Apis::DocumentaiV1::GoogleLongrunningListOperationsResponse
  command.params['name'] = name unless name.nil?
  command.query['filter'] = filter unless filter.nil?
  command.query['pageSize'] = page_size unless page_size.nil?
  command.query['pageToken'] = page_token unless page_token.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#list_project_location_processor_processor_version_evaluations(parent, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DocumentaiV1::GoogleCloudDocumentaiV1ListEvaluationsResponse

Retrieves a set of evaluations for a given processor version.

Parameters:

  • parent (String)

    Required. The resource name of the ProcessorVersion to list evaluations for. projects/project/locations/location/processors/processor/ processorVersions/processorVersion``

  • page_size (Fixnum) (defaults to: nil)

    The standard list page size. If unspecified, at most 5 evaluations are returned. The maximum value is 100. Values above 100 are coerced to 100.

  • page_token (String) (defaults to: nil)

    A page token, received from a previous ListEvaluations call. Provide this to retrieve the subsequent page.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required

[View source]

1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
# File 'lib/google/apis/documentai_v1/service.rb', line 1087

def list_project_location_processor_processor_version_evaluations(parent, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v1/{+parent}/evaluations', options)
  command.response_representation = Google::Apis::DocumentaiV1::GoogleCloudDocumentaiV1ListEvaluationsResponse::Representation
  command.response_class = Google::Apis::DocumentaiV1::GoogleCloudDocumentaiV1ListEvaluationsResponse
  command.params['parent'] = parent unless parent.nil?
  command.query['pageSize'] = page_size unless page_size.nil?
  command.query['pageToken'] = page_token unless page_token.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#list_project_location_processor_processor_versions(parent, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DocumentaiV1::GoogleCloudDocumentaiV1ListProcessorVersionsResponse

Lists all versions of a processor.

Parameters:

  • parent (String)

    Required. The parent (project, location and processor) to list all versions. Format: projects/project/locations/location/processors/processor``

  • page_size (Fixnum) (defaults to: nil)

    The maximum number of processor versions to return. If unspecified, at most 10 processor versions will be returned. The maximum value is 20. Values above 20 will be coerced to 20.

  • page_token (String) (defaults to: nil)

    We will return the processor versions sorted by creation time. The page token will point to the next processor version.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required

[View source]

909
910
911
912
913
914
915
916
917
918
919
# File 'lib/google/apis/documentai_v1/service.rb', line 909

def list_project_location_processor_processor_versions(parent, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v1/{+parent}/processorVersions', options)
  command.response_representation = Google::Apis::DocumentaiV1::GoogleCloudDocumentaiV1ListProcessorVersionsResponse::Representation
  command.response_class = Google::Apis::DocumentaiV1::GoogleCloudDocumentaiV1ListProcessorVersionsResponse
  command.params['parent'] = parent unless parent.nil?
  command.query['pageSize'] = page_size unless page_size.nil?
  command.query['pageToken'] = page_token unless page_token.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#list_project_location_processor_types(parent, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DocumentaiV1::GoogleCloudDocumentaiV1ListProcessorTypesResponse

Lists the processor types that exist.

Parameters:

  • parent (String)

    Required. The location of processor types to list. Format: projects/project/ locations/location``.

  • page_size (Fixnum) (defaults to: nil)

    The maximum number of processor types to return. If unspecified, at most 100 processor types will be returned. The maximum value is 500. Values above 500 will be coerced to 500.

  • page_token (String) (defaults to: nil)

    Used to retrieve the next page of results, empty if at the end of the list.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required

[View source]

357
358
359
360
361
362
363
364
365
366
367
# File 'lib/google/apis/documentai_v1/service.rb', line 357

def list_project_location_processor_types(parent, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v1/{+parent}/processorTypes', options)
  command.response_representation = Google::Apis::DocumentaiV1::GoogleCloudDocumentaiV1ListProcessorTypesResponse::Representation
  command.response_class = Google::Apis::DocumentaiV1::GoogleCloudDocumentaiV1ListProcessorTypesResponse
  command.params['parent'] = parent unless parent.nil?
  command.query['pageSize'] = page_size unless page_size.nil?
  command.query['pageToken'] = page_token unless page_token.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#list_project_location_processors(parent, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DocumentaiV1::GoogleCloudDocumentaiV1ListProcessorsResponse

Lists all processors which belong to this project.

Parameters:

  • parent (String)

    Required. The parent (project and location) which owns this collection of Processors. Format: projects/project/locations/location``

  • page_size (Fixnum) (defaults to: nil)

    The maximum number of processors to return. If unspecified, at most 50 processors will be returned. The maximum value is 100. Values above 100 will be coerced to 100.

  • page_token (String) (defaults to: nil)

    We will return the processors sorted by creation time. The page token will point to the next processor.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required

[View source]

596
597
598
599
600
601
602
603
604
605
606
# File 'lib/google/apis/documentai_v1/service.rb', line 596

def list_project_location_processors(parent, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v1/{+parent}/processors', options)
  command.response_representation = Google::Apis::DocumentaiV1::GoogleCloudDocumentaiV1ListProcessorsResponse::Representation
  command.response_class = Google::Apis::DocumentaiV1::GoogleCloudDocumentaiV1ListProcessorsResponse
  command.params['parent'] = parent unless parent.nil?
  command.query['pageSize'] = page_size unless page_size.nil?
  command.query['pageToken'] = page_token unless page_token.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#list_project_locations(name, filter: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DocumentaiV1::GoogleCloudLocationListLocationsResponse

Lists information about the supported locations for this service.

Parameters:

  • name (String)

    The resource that owns the locations collection, if applicable.

  • filter (String) (defaults to: nil)

    A filter to narrow down results to a preferred subset. The filtering language accepts strings like "displayName=tokyo", and is documented in more detail in AIP-160.

  • page_size (Fixnum) (defaults to: nil)

    The maximum number of results to return. If not set, the service selects a default.

  • page_token (String) (defaults to: nil)

    A page token received from the next_page_token field in the response. Send that page token to receive the subsequent page.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required

[View source]

179
180
181
182
183
184
185
186
187
188
189
190
# File 'lib/google/apis/documentai_v1/service.rb', line 179

def list_project_locations(name, filter: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v1/{+name}/locations', options)
  command.response_representation = Google::Apis::DocumentaiV1::GoogleCloudLocationListLocationsResponse::Representation
  command.response_class = Google::Apis::DocumentaiV1::GoogleCloudLocationListLocationsResponse
  command.params['name'] = name unless name.nil?
  command.query['filter'] = filter unless filter.nil?
  command.query['pageSize'] = page_size unless page_size.nil?
  command.query['pageToken'] = page_token unless page_token.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#process_project_location_processor(name, google_cloud_documentai_v1_process_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DocumentaiV1::GoogleCloudDocumentaiV1ProcessResponse

Processes a single document.

Parameters:

  • name (String)

    Required. The resource name of the Processor or ProcessorVersion to use for processing. If a Processor is specified, the server will use its default version. Format: projects/project/locations/location/processors/ processor, or `projects/`project`/locations/`location`/processors/`processor` /processorVersions/`processorVersion

  • google_cloud_documentai_v1_process_request_object (Google::Apis::DocumentaiV1::GoogleCloudDocumentaiV1ProcessRequest) (defaults to: nil)
  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required

[View source]

633
634
635
636
637
638
639
640
641
642
643
# File 'lib/google/apis/documentai_v1/service.rb', line 633

def process_project_location_processor(name, google_cloud_documentai_v1_process_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'v1/{+name}:process', options)
  command.request_representation = Google::Apis::DocumentaiV1::GoogleCloudDocumentaiV1ProcessRequest::Representation
  command.request_object = google_cloud_documentai_v1_process_request_object
  command.response_representation = Google::Apis::DocumentaiV1::GoogleCloudDocumentaiV1ProcessResponse::Representation
  command.response_class = Google::Apis::DocumentaiV1::GoogleCloudDocumentaiV1ProcessResponse
  command.params['name'] = name unless name.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#process_project_location_processor_processor_version(name, google_cloud_documentai_v1_process_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DocumentaiV1::GoogleCloudDocumentaiV1ProcessResponse

Processes a single document.

Parameters:

  • name (String)

    Required. The resource name of the Processor or ProcessorVersion to use for processing. If a Processor is specified, the server will use its default version. Format: projects/project/locations/location/processors/ processor, or `projects/`project`/locations/`location`/processors/`processor` /processorVersions/`processorVersion

  • google_cloud_documentai_v1_process_request_object (Google::Apis::DocumentaiV1::GoogleCloudDocumentaiV1ProcessRequest) (defaults to: nil)
  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required

[View source]

946
947
948
949
950
951
952
953
954
955
956
# File 'lib/google/apis/documentai_v1/service.rb', line 946

def process_project_location_processor_processor_version(name, google_cloud_documentai_v1_process_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'v1/{+name}:process', options)
  command.request_representation = Google::Apis::DocumentaiV1::GoogleCloudDocumentaiV1ProcessRequest::Representation
  command.request_object = google_cloud_documentai_v1_process_request_object
  command.response_representation = Google::Apis::DocumentaiV1::GoogleCloudDocumentaiV1ProcessResponse::Representation
  command.response_class = Google::Apis::DocumentaiV1::GoogleCloudDocumentaiV1ProcessResponse
  command.params['name'] = name unless name.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#review_project_location_processor_human_review_config_document(human_review_config, google_cloud_documentai_v1_review_document_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DocumentaiV1::GoogleLongrunningOperation

Send a document for Human Review. The input document should be processed by the specified processor.

Parameters:

  • human_review_config (String)

    Required. The resource name of the HumanReviewConfig that the document will be reviewed with.

  • google_cloud_documentai_v1_review_document_request_object (Google::Apis::DocumentaiV1::GoogleCloudDocumentaiV1ReviewDocumentRequest) (defaults to: nil)
  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required

[View source]

702
703
704
705
706
707
708
709
710
711
712
# File 'lib/google/apis/documentai_v1/service.rb', line 702

def review_project_location_processor_human_review_config_document(human_review_config, google_cloud_documentai_v1_review_document_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'v1/{+humanReviewConfig}:reviewDocument', options)
  command.request_representation = Google::Apis::DocumentaiV1::GoogleCloudDocumentaiV1ReviewDocumentRequest::Representation
  command.request_object = google_cloud_documentai_v1_review_document_request_object
  command.response_representation = Google::Apis::DocumentaiV1::GoogleLongrunningOperation::Representation
  command.response_class = Google::Apis::DocumentaiV1::GoogleLongrunningOperation
  command.params['humanReviewConfig'] = human_review_config unless human_review_config.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#set_project_location_processor_default_processor_version(processor, google_cloud_documentai_v1_set_default_processor_version_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DocumentaiV1::GoogleLongrunningOperation

Set the default (active) version of a Processor that will be used in ProcessDocument and BatchProcessDocuments.

Parameters:

  • processor (String)

    Required. The resource name of the Processor to change default version.

  • google_cloud_documentai_v1_set_default_processor_version_request_object (Google::Apis::DocumentaiV1::GoogleCloudDocumentaiV1SetDefaultProcessorVersionRequest) (defaults to: nil)
  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required

[View source]

667
668
669
670
671
672
673
674
675
676
677
# File 'lib/google/apis/documentai_v1/service.rb', line 667

def set_project_location_processor_default_processor_version(processor, google_cloud_documentai_v1_set_default_processor_version_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'v1/{+processor}:setDefaultProcessorVersion', options)
  command.request_representation = Google::Apis::DocumentaiV1::GoogleCloudDocumentaiV1SetDefaultProcessorVersionRequest::Representation
  command.request_object = google_cloud_documentai_v1_set_default_processor_version_request_object
  command.response_representation = Google::Apis::DocumentaiV1::GoogleLongrunningOperation::Representation
  command.response_class = Google::Apis::DocumentaiV1::GoogleLongrunningOperation
  command.params['processor'] = processor unless processor.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#train_project_location_processor_processor_version(parent, google_cloud_documentai_v1_train_processor_version_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DocumentaiV1::GoogleLongrunningOperation

Trains a new processor version. Operation metadata is returned as TrainProcessorVersionMetadata.

Parameters:

  • parent (String)

    Required. The parent (project, location and processor) to create the new version for. Format: projects/project/locations/location/processors/ processor``.

  • google_cloud_documentai_v1_train_processor_version_request_object (Google::Apis::DocumentaiV1::GoogleCloudDocumentaiV1TrainProcessorVersionRequest) (defaults to: nil)
  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required

[View source]

982
983
984
985
986
987
988
989
990
991
992
# File 'lib/google/apis/documentai_v1/service.rb', line 982

def train_project_location_processor_processor_version(parent, google_cloud_documentai_v1_train_processor_version_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'v1/{+parent}/processorVersions:train', options)
  command.request_representation = Google::Apis::DocumentaiV1::GoogleCloudDocumentaiV1TrainProcessorVersionRequest::Representation
  command.request_object = google_cloud_documentai_v1_train_processor_version_request_object
  command.response_representation = Google::Apis::DocumentaiV1::GoogleLongrunningOperation::Representation
  command.response_class = Google::Apis::DocumentaiV1::GoogleLongrunningOperation
  command.params['parent'] = parent unless parent.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#undeploy_project_location_processor_processor_version(name, google_cloud_documentai_v1_undeploy_processor_version_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DocumentaiV1::GoogleLongrunningOperation

Undeploys the processor version.

Parameters:

  • name (String)

    Required. The processor version resource name to be undeployed.

  • google_cloud_documentai_v1_undeploy_processor_version_request_object (Google::Apis::DocumentaiV1::GoogleCloudDocumentaiV1UndeployProcessorVersionRequest) (defaults to: nil)
  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required

[View source]

1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
# File 'lib/google/apis/documentai_v1/service.rb', line 1015

def undeploy_project_location_processor_processor_version(name, google_cloud_documentai_v1_undeploy_processor_version_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'v1/{+name}:undeploy', options)
  command.request_representation = Google::Apis::DocumentaiV1::GoogleCloudDocumentaiV1UndeployProcessorVersionRequest::Representation
  command.request_object = google_cloud_documentai_v1_undeploy_processor_version_request_object
  command.response_representation = Google::Apis::DocumentaiV1::GoogleLongrunningOperation::Representation
  command.response_class = Google::Apis::DocumentaiV1::GoogleLongrunningOperation
  command.params['name'] = name unless name.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end