# Document AI V1 API - Class Google::Cloud::DocumentAI::V1::DocumentProcessorService::Rest::Client (v1.12.1)

1.12.1 (latest) 1.12.0 1.11.0 1.10.2 1.9.0 1.8.0 1.7.0 1.6.1 1.5.1 1.4.0 1.3.0 1.2.0 1.1.1 1.0.0 0.23.1 0.22.0 0.21.1 0.20.0 0.19.0 0.18.0 0.17.2 0.16.2 0.15.0 0.14.0 0.13.0 0.12.0 0.11.0 0.10.0 0.9.0 0.8.0 0.7.0 0.6.0 0.5.0 0.4.0 0.3.0 0.2.4 Reference documentation and code samples for the Document AI V1 API class Google::Cloud::DocumentAI::V1::DocumentProcessorService::Rest::Client.

REST client for the DocumentProcessorService service.


<br />

Service to call Document AI to process documents according to the
processor's definition. Processors are built using state-of-the-art Google
AI such as natural language, computer vision, and translation to extract
structured information from unstructured or semi-structured documents.

## Inherits

- Object

## Includes

- [Google::Cloud::DocumentAI::V1::DocumentProcessorService::Paths](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-document_ai-v1/latest/Google-Cloud-DocumentAI-V1-DocumentProcessorService-Paths)

## Methods

### .configure

    def self.configure() { |config| ... } -> Client::Configuration

Configure the DocumentProcessorService Client class.


<br />

See [Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-document_ai-v1/latest/Google-Cloud-DocumentAI-V1-DocumentProcessorService-Rest-Client-Configuration "Google::Cloud::DocumentAI::V1::DocumentProcessorService::Rest::Client::Configuration (class)")
for a description of the configuration fields.
**Yields**

- (config) --- Configure the Client client.
**Yield Parameter**

- **config** ([Client::Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-document_ai-v1/latest/Google-Cloud-DocumentAI-V1-DocumentProcessorService-Rest-Client-Configuration))
**Returns**

- ([Client::Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-document_ai-v1/latest/Google-Cloud-DocumentAI-V1-DocumentProcessorService-Rest-Client-Configuration))
**Example**

```ruby
# Modify the configuration for all DocumentProcessorService clients
::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Rest::Client.configure do |config|
  config.timeout = 10.0
end
```

### #batch_process_documents

    def batch_process_documents(request, options = nil) -> ::Gapic::Operation
    def batch_process_documents(name: nil, input_documents: nil, document_output_config: nil, skip_human_review: nil, process_options: nil, labels: nil) -> ::Gapic::Operation

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

    def batch_process_documents(request, options = nil) -> ::Gapic::Operation

Pass arguments to `batch_process_documents` via a request object, either of type [BatchProcessRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-document_ai-v1/latest/Google-Cloud-DocumentAI-V1-BatchProcessRequest "Google::Cloud::DocumentAI::V1::BatchProcessRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::DocumentAI::V1::BatchProcessRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-document_ai-v1/latest/Google-Cloud-DocumentAI-V1-BatchProcessRequest), ::Hash) --- A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- **options** (::Gapic::CallOptions, ::Hash) --- Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

    def batch_process_documents(name: nil, input_documents: nil, document_output_config: nil, skip_human_review: nil, process_options: nil, labels: nil) -> ::Gapic::Operation

Pass arguments to `batch_process_documents` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). **Parameters**

- **name** (::String) --- Required. The resource name of [Processor](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-document_ai-v1/latest/Google-Cloud-DocumentAI-V1-Processor "Google::Cloud::DocumentAI::V1::Processor (class)") or [ProcessorVersion](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-document_ai-v1/latest/Google-Cloud-DocumentAI-V1-ProcessorVersion "Google::Cloud::DocumentAI::V1::ProcessorVersion (class)"). Format: `projects/{project}/locations/{location}/processors/{processor}`, or `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}`
- **input_documents** ([::Google::Cloud::DocumentAI::V1::BatchDocumentsInputConfig](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-document_ai-v1/latest/Google-Cloud-DocumentAI-V1-BatchDocumentsInputConfig), ::Hash) --- The input documents for the [BatchProcessDocuments](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-document_ai-v1/latest/Google-Cloud-DocumentAI-V1-DocumentProcessorService-Rest-Client#Google__Cloud__DocumentAI__V1__DocumentProcessorService__Rest__Client_batch_process_documents_instance_ "Google::Cloud::DocumentAI::V1::DocumentProcessorService::Rest::Client#batch_process_documents (method)") method.
- **document_output_config** ([::Google::Cloud::DocumentAI::V1::DocumentOutputConfig](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-document_ai-v1/latest/Google-Cloud-DocumentAI-V1-DocumentOutputConfig), ::Hash) --- The output configuration for the [BatchProcessDocuments](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-document_ai-v1/latest/Google-Cloud-DocumentAI-V1-DocumentProcessorService-Rest-Client#Google__Cloud__DocumentAI__V1__DocumentProcessorService__Rest__Client_batch_process_documents_instance_ "Google::Cloud::DocumentAI::V1::DocumentProcessorService::Rest::Client#batch_process_documents (method)") method.
- **skip_human_review** (::Boolean) --- Whether human review should be skipped for this request. Default to `false`.
- **process_options** ([::Google::Cloud::DocumentAI::V1::ProcessOptions](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-document_ai-v1/latest/Google-Cloud-DocumentAI-V1-ProcessOptions), ::Hash) --- Inference-time options for the process API
- **labels** (::Hash{::String =\> ::String}) --- Optional. The labels with user-defined metadata for the request.


  Label keys and values can be no longer than 63 characters
  (Unicode codepoints) and can only contain lowercase letters, numeric
  characters, underscores, and dashes. International characters are allowed.
  Label values are optional. Label keys must start with a letter.
**Yields**

- (result, operation) --- Access the result along with the TransportOperation object
**Yield Parameters**

- **result** (::Gapic::Operation)
- **operation** (::Gapic::Rest::TransportOperation)
**Returns**

- (::Gapic::Operation)
**Raises**

- (::Google::Cloud::Error) --- if the REST call is aborted.
**Example**

Basic example

```ruby
require "google/cloud/document_ai/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::DocumentAI::V1::BatchProcessRequest.new

# Call the batch_process_documents method.
result = client.batch_process_documents request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end
```

### #configure

    def configure() { |config| ... } -> Client::Configuration

Configure the DocumentProcessorService Client instance.


The configuration is set to the derived mode, meaning that values can be changed,
but structural changes (adding new fields, etc.) are not allowed. Structural changes
should be made on [Client.configure](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-document_ai-v1/latest/Google-Cloud-DocumentAI-V1-DocumentProcessorService-Rest-Client#Google__Cloud__DocumentAI__V1__DocumentProcessorService__Rest__Client_configure_class_ "Google::Cloud::DocumentAI::V1::DocumentProcessorService::Rest::Client.configure (method)").

<br />

See [Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-document_ai-v1/latest/Google-Cloud-DocumentAI-V1-DocumentProcessorService-Rest-Client-Configuration "Google::Cloud::DocumentAI::V1::DocumentProcessorService::Rest::Client::Configuration (class)")
for a description of the configuration fields.
**Yields**

- (config) --- Configure the Client client.
**Yield Parameter**

- **config** ([Client::Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-document_ai-v1/latest/Google-Cloud-DocumentAI-V1-DocumentProcessorService-Rest-Client-Configuration))
**Returns**

- ([Client::Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-document_ai-v1/latest/Google-Cloud-DocumentAI-V1-DocumentProcessorService-Rest-Client-Configuration))

### #create_processor

    def create_processor(request, options = nil) -> ::Google::Cloud::DocumentAI::V1::Processor
    def create_processor(parent: nil, processor: nil) -> ::Google::Cloud::DocumentAI::V1::Processor

Creates a processor from the
[ProcessorType](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-document_ai-v1/latest/Google-Cloud-DocumentAI-V1-ProcessorType "Google::Cloud::DocumentAI::V1::ProcessorType (class)") provided. The
processor will be at `ENABLED` state by default after its creation. Note
that this method requires the `documentai.processors.create` permission on
the project, which is highly privileged. A user or service account with
this permission can create new processors that can interact with any gcs
bucket in your project.
**Overloads**

    def create_processor(request, options = nil) -> ::Google::Cloud::DocumentAI::V1::Processor

Pass arguments to `create_processor` via a request object, either of type [CreateProcessorRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-document_ai-v1/latest/Google-Cloud-DocumentAI-V1-CreateProcessorRequest "Google::Cloud::DocumentAI::V1::CreateProcessorRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::DocumentAI::V1::CreateProcessorRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-document_ai-v1/latest/Google-Cloud-DocumentAI-V1-CreateProcessorRequest), ::Hash) --- A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- **options** (::Gapic::CallOptions, ::Hash) --- Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

    def create_processor(parent: nil, processor: nil) -> ::Google::Cloud::DocumentAI::V1::Processor

Pass arguments to `create_processor` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). **Parameters**

- **parent** (::String) --- Required. The parent (project and location) under which to create the processor. Format: `projects/{project}/locations/{location}`
- **processor** ([::Google::Cloud::DocumentAI::V1::Processor](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-document_ai-v1/latest/Google-Cloud-DocumentAI-V1-Processor), ::Hash) --- Required. The processor to be created, requires [Processor.type](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-document_ai-v1/latest/Google-Cloud-DocumentAI-V1-Processor#Google__Cloud__DocumentAI__V1__Processor_type_instance_ "Google::Cloud::DocumentAI::V1::Processor#type (method)") and [Processor.display_name](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-document_ai-v1/latest/Google-Cloud-DocumentAI-V1-Processor#Google__Cloud__DocumentAI__V1__Processor_display_name_instance_ "Google::Cloud::DocumentAI::V1::Processor#display_name (method)") to be set. Also, the [Processor.kms_key_name](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-document_ai-v1/latest/Google-Cloud-DocumentAI-V1-Processor#Google__Cloud__DocumentAI__V1__Processor_kms_key_name_instance_ "Google::Cloud::DocumentAI::V1::Processor#kms_key_name (method)") field must be set if the processor is under CMEK.
**Yields**

- (result, operation) --- Access the result along with the TransportOperation object
**Yield Parameters**

- **result** ([::Google::Cloud::DocumentAI::V1::Processor](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-document_ai-v1/latest/Google-Cloud-DocumentAI-V1-Processor))
- **operation** (::Gapic::Rest::TransportOperation)
**Returns**

- ([::Google::Cloud::DocumentAI::V1::Processor](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-document_ai-v1/latest/Google-Cloud-DocumentAI-V1-Processor))
**Raises**

- (::Google::Cloud::Error) --- if the REST call is aborted.
**Example**

Basic example

```ruby
require "google/cloud/document_ai/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::DocumentAI::V1::CreateProcessorRequest.new

# Call the create_processor method.
result = client.create_processor request

# The returned object is of type Google::Cloud::DocumentAI::V1::Processor.
p result
```

### #delete_processor

    def delete_processor(request, options = nil) -> ::Gapic::Operation
    def delete_processor(name: nil) -> ::Gapic::Operation

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

    def delete_processor(request, options = nil) -> ::Gapic::Operation

Pass arguments to `delete_processor` via a request object, either of type [Google::Cloud::DocumentAI::V1::DeleteProcessorRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-document_ai-v1/latest/Google-Cloud-DocumentAI-V1-DeleteProcessorRequest "Google::Cloud::DocumentAI::V1::DeleteProcessorRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::DocumentAI::V1::DeleteProcessorRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-document_ai-v1/latest/Google-Cloud-DocumentAI-V1-DeleteProcessorRequest), ::Hash) --- A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- **options** (::Gapic::CallOptions, ::Hash) --- Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

    def delete_processor(name: nil) -> ::Gapic::Operation

Pass arguments to `delete_processor` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). **Parameter**

- **name** (::String) --- Required. The processor resource name to be deleted.
**Yields**

- (result, operation) --- Access the result along with the TransportOperation object
**Yield Parameters**

- **result** (::Gapic::Operation)
- **operation** (::Gapic::Rest::TransportOperation)
**Returns**

- (::Gapic::Operation)
**Raises**

- (::Google::Cloud::Error) --- if the REST call is aborted.
**Example**

Basic example

```ruby
require "google/cloud/document_ai/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::DocumentAI::V1::DeleteProcessorRequest.new

# Call the delete_processor method.
result = client.delete_processor request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end
```

### #delete_processor_version

    def delete_processor_version(request, options = nil) -> ::Gapic::Operation
    def delete_processor_version(name: nil) -> ::Gapic::Operation

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

    def delete_processor_version(request, options = nil) -> ::Gapic::Operation

Pass arguments to `delete_processor_version` via a request object, either of type [Google::Cloud::DocumentAI::V1::DeleteProcessorVersionRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-document_ai-v1/latest/Google-Cloud-DocumentAI-V1-DeleteProcessorVersionRequest "Google::Cloud::DocumentAI::V1::DeleteProcessorVersionRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::DocumentAI::V1::DeleteProcessorVersionRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-document_ai-v1/latest/Google-Cloud-DocumentAI-V1-DeleteProcessorVersionRequest), ::Hash) --- A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- **options** (::Gapic::CallOptions, ::Hash) --- Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

    def delete_processor_version(name: nil) -> ::Gapic::Operation

Pass arguments to `delete_processor_version` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). **Parameter**

- **name** (::String) --- Required. The processor version resource name to be deleted.
**Yields**

- (result, operation) --- Access the result along with the TransportOperation object
**Yield Parameters**

- **result** (::Gapic::Operation)
- **operation** (::Gapic::Rest::TransportOperation)
**Returns**

- (::Gapic::Operation)
**Raises**

- (::Google::Cloud::Error) --- if the REST call is aborted.
**Example**

Basic example

```ruby
require "google/cloud/document_ai/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::DocumentAI::V1::DeleteProcessorVersionRequest.new

# Call the delete_processor_version method.
result = client.delete_processor_version request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end
```

### #deploy_processor_version

    def deploy_processor_version(request, options = nil) -> ::Gapic::Operation
    def deploy_processor_version(name: nil) -> ::Gapic::Operation

Deploys the processor version.
**Overloads**

    def deploy_processor_version(request, options = nil) -> ::Gapic::Operation

Pass arguments to `deploy_processor_version` via a request object, either of type [Google::Cloud::DocumentAI::V1::DeployProcessorVersionRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-document_ai-v1/latest/Google-Cloud-DocumentAI-V1-DeployProcessorVersionRequest "Google::Cloud::DocumentAI::V1::DeployProcessorVersionRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::DocumentAI::V1::DeployProcessorVersionRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-document_ai-v1/latest/Google-Cloud-DocumentAI-V1-DeployProcessorVersionRequest), ::Hash) --- A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- **options** (::Gapic::CallOptions, ::Hash) --- Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

    def deploy_processor_version(name: nil) -> ::Gapic::Operation

Pass arguments to `deploy_processor_version` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). **Parameter**

- **name** (::String) --- Required. The processor version resource name to be deployed.
**Yields**

- (result, operation) --- Access the result along with the TransportOperation object
**Yield Parameters**

- **result** (::Gapic::Operation)
- **operation** (::Gapic::Rest::TransportOperation)
**Returns**

- (::Gapic::Operation)
**Raises**

- (::Google::Cloud::Error) --- if the REST call is aborted.
**Example**

Basic example

```ruby
require "google/cloud/document_ai/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::DocumentAI::V1::DeployProcessorVersionRequest.new

# Call the deploy_processor_version method.
result = client.deploy_processor_version request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end
```

### #disable_processor

    def disable_processor(request, options = nil) -> ::Gapic::Operation
    def disable_processor(name: nil) -> ::Gapic::Operation

Disables a processor
**Overloads**

    def disable_processor(request, options = nil) -> ::Gapic::Operation

Pass arguments to `disable_processor` via a request object, either of type [Google::Cloud::DocumentAI::V1::DisableProcessorRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-document_ai-v1/latest/Google-Cloud-DocumentAI-V1-DisableProcessorRequest "Google::Cloud::DocumentAI::V1::DisableProcessorRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::DocumentAI::V1::DisableProcessorRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-document_ai-v1/latest/Google-Cloud-DocumentAI-V1-DisableProcessorRequest), ::Hash) --- A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- **options** (::Gapic::CallOptions, ::Hash) --- Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

    def disable_processor(name: nil) -> ::Gapic::Operation

Pass arguments to `disable_processor` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). **Parameter**

- **name** (::String) --- Required. The processor resource name to be disabled.
**Yields**

- (result, operation) --- Access the result along with the TransportOperation object
**Yield Parameters**

- **result** (::Gapic::Operation)
- **operation** (::Gapic::Rest::TransportOperation)
**Returns**

- (::Gapic::Operation)
**Raises**

- (::Google::Cloud::Error) --- if the REST call is aborted.
**Example**

Basic example

```ruby
require "google/cloud/document_ai/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::DocumentAI::V1::DisableProcessorRequest.new

# Call the disable_processor method.
result = client.disable_processor request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end
```

### #enable_processor

    def enable_processor(request, options = nil) -> ::Gapic::Operation
    def enable_processor(name: nil) -> ::Gapic::Operation

Enables a processor
**Overloads**

    def enable_processor(request, options = nil) -> ::Gapic::Operation

Pass arguments to `enable_processor` via a request object, either of type [EnableProcessorRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-document_ai-v1/latest/Google-Cloud-DocumentAI-V1-EnableProcessorRequest "Google::Cloud::DocumentAI::V1::EnableProcessorRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::DocumentAI::V1::EnableProcessorRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-document_ai-v1/latest/Google-Cloud-DocumentAI-V1-EnableProcessorRequest), ::Hash) --- A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- **options** (::Gapic::CallOptions, ::Hash) --- Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

    def enable_processor(name: nil) -> ::Gapic::Operation

Pass arguments to `enable_processor` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). **Parameter**

- **name** (::String) --- Required. The processor resource name to be enabled.
**Yields**

- (result, operation) --- Access the result along with the TransportOperation object
**Yield Parameters**

- **result** (::Gapic::Operation)
- **operation** (::Gapic::Rest::TransportOperation)
**Returns**

- (::Gapic::Operation)
**Raises**

- (::Google::Cloud::Error) --- if the REST call is aborted.
**Example**

Basic example

```ruby
require "google/cloud/document_ai/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::DocumentAI::V1::EnableProcessorRequest.new

# Call the enable_processor method.
result = client.enable_processor request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end
```

### #evaluate_processor_version

    def evaluate_processor_version(request, options = nil) -> ::Gapic::Operation
    def evaluate_processor_version(processor_version: nil, evaluation_documents: nil) -> ::Gapic::Operation

Evaluates a ProcessorVersion against annotated documents, producing an
Evaluation.
**Overloads**

    def evaluate_processor_version(request, options = nil) -> ::Gapic::Operation

Pass arguments to `evaluate_processor_version` via a request object, either of type [EvaluateProcessorVersionRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-document_ai-v1/latest/Google-Cloud-DocumentAI-V1-EvaluateProcessorVersionRequest "Google::Cloud::DocumentAI::V1::EvaluateProcessorVersionRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::DocumentAI::V1::EvaluateProcessorVersionRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-document_ai-v1/latest/Google-Cloud-DocumentAI-V1-EvaluateProcessorVersionRequest), ::Hash) --- A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- **options** (::Gapic::CallOptions, ::Hash) --- Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

    def evaluate_processor_version(processor_version: nil, evaluation_documents: nil) -> ::Gapic::Operation

Pass arguments to `evaluate_processor_version` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). **Parameters**

- **processor_version** (::String) --- Required. The resource name of the [ProcessorVersion](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-document_ai-v1/latest/Google-Cloud-DocumentAI-V1-ProcessorVersion "Google::Cloud::DocumentAI::V1::ProcessorVersion (class)") to evaluate. `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}`
- **evaluation_documents** ([::Google::Cloud::DocumentAI::V1::BatchDocumentsInputConfig](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-document_ai-v1/latest/Google-Cloud-DocumentAI-V1-BatchDocumentsInputConfig), ::Hash) --- Optional. The documents used in the evaluation. If unspecified, use the processor's dataset as evaluation input.
**Yields**

- (result, operation) --- Access the result along with the TransportOperation object
**Yield Parameters**

- **result** (::Gapic::Operation)
- **operation** (::Gapic::Rest::TransportOperation)
**Returns**

- (::Gapic::Operation)
**Raises**

- (::Google::Cloud::Error) --- if the REST call is aborted.
**Example**

Basic example

```ruby
require "google/cloud/document_ai/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::DocumentAI::V1::EvaluateProcessorVersionRequest.new

# Call the evaluate_processor_version method.
result = client.evaluate_processor_version request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end
```

### #fetch_processor_types

    def fetch_processor_types(request, options = nil) -> ::Google::Cloud::DocumentAI::V1::FetchProcessorTypesResponse
    def fetch_processor_types(parent: nil) -> ::Google::Cloud::DocumentAI::V1::FetchProcessorTypesResponse

Fetches processor types. Note that we don't use
[ListProcessorTypes](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-document_ai-v1/latest/Google-Cloud-DocumentAI-V1-DocumentProcessorService-Rest-Client#Google__Cloud__DocumentAI__V1__DocumentProcessorService__Rest__Client_list_processor_types_instance_ "Google::Cloud::DocumentAI::V1::DocumentProcessorService::Rest::Client#list_processor_types (method)")
here, because it isn't paginated.
**Overloads**

    def fetch_processor_types(request, options = nil) -> ::Google::Cloud::DocumentAI::V1::FetchProcessorTypesResponse

Pass arguments to `fetch_processor_types` via a request object, either of type [FetchProcessorTypesRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-document_ai-v1/latest/Google-Cloud-DocumentAI-V1-FetchProcessorTypesRequest "Google::Cloud::DocumentAI::V1::FetchProcessorTypesRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::DocumentAI::V1::FetchProcessorTypesRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-document_ai-v1/latest/Google-Cloud-DocumentAI-V1-FetchProcessorTypesRequest), ::Hash) --- A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- **options** (::Gapic::CallOptions, ::Hash) --- Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

    def fetch_processor_types(parent: nil) -> ::Google::Cloud::DocumentAI::V1::FetchProcessorTypesResponse

Pass arguments to `fetch_processor_types` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). **Parameter**

- **parent** (::String) --- Required. The location of processor types to list. Format: `projects/{project}/locations/{location}`.
**Yields**

- (result, operation) --- Access the result along with the TransportOperation object
**Yield Parameters**

- **result** ([::Google::Cloud::DocumentAI::V1::FetchProcessorTypesResponse](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-document_ai-v1/latest/Google-Cloud-DocumentAI-V1-FetchProcessorTypesResponse))
- **operation** (::Gapic::Rest::TransportOperation)
**Returns**

- ([::Google::Cloud::DocumentAI::V1::FetchProcessorTypesResponse](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-document_ai-v1/latest/Google-Cloud-DocumentAI-V1-FetchProcessorTypesResponse))
**Raises**

- (::Google::Cloud::Error) --- if the REST call is aborted.
**Example**

Basic example

```ruby
require "google/cloud/document_ai/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::DocumentAI::V1::FetchProcessorTypesRequest.new

# Call the fetch_processor_types method.
result = client.fetch_processor_types request

# The returned object is of type Google::Cloud::DocumentAI::V1::FetchProcessorTypesResponse.
p result
```

### #get_evaluation

    def get_evaluation(request, options = nil) -> ::Google::Cloud::DocumentAI::V1::Evaluation
    def get_evaluation(name: nil) -> ::Google::Cloud::DocumentAI::V1::Evaluation

Retrieves a specific evaluation.
**Overloads**

    def get_evaluation(request, options = nil) -> ::Google::Cloud::DocumentAI::V1::Evaluation

Pass arguments to `get_evaluation` via a request object, either of type [GetEvaluationRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-document_ai-v1/latest/Google-Cloud-DocumentAI-V1-GetEvaluationRequest "Google::Cloud::DocumentAI::V1::GetEvaluationRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::DocumentAI::V1::GetEvaluationRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-document_ai-v1/latest/Google-Cloud-DocumentAI-V1-GetEvaluationRequest), ::Hash) --- A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- **options** (::Gapic::CallOptions, ::Hash) --- Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

    def get_evaluation(name: nil) -> ::Google::Cloud::DocumentAI::V1::Evaluation

Pass arguments to `get_evaluation` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). **Parameter**

- **name** (::String) --- Required. The resource name of the [Evaluation](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-document_ai-v1/latest/Google-Cloud-DocumentAI-V1-Evaluation "Google::Cloud::DocumentAI::V1::Evaluation (class)") to get. `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}/evaluations/{evaluation}`
**Yields**

- (result, operation) --- Access the result along with the TransportOperation object
**Yield Parameters**

- **result** ([::Google::Cloud::DocumentAI::V1::Evaluation](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-document_ai-v1/latest/Google-Cloud-DocumentAI-V1-Evaluation))
- **operation** (::Gapic::Rest::TransportOperation)
**Returns**

- ([::Google::Cloud::DocumentAI::V1::Evaluation](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-document_ai-v1/latest/Google-Cloud-DocumentAI-V1-Evaluation))
**Raises**

- (::Google::Cloud::Error) --- if the REST call is aborted.
**Example**

Basic example

```ruby
require "google/cloud/document_ai/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::DocumentAI::V1::GetEvaluationRequest.new

# Call the get_evaluation method.
result = client.get_evaluation request

# The returned object is of type Google::Cloud::DocumentAI::V1::Evaluation.
p result
```

### #get_processor

    def get_processor(request, options = nil) -> ::Google::Cloud::DocumentAI::V1::Processor
    def get_processor(name: nil) -> ::Google::Cloud::DocumentAI::V1::Processor

Gets a processor detail.
**Overloads**

    def get_processor(request, options = nil) -> ::Google::Cloud::DocumentAI::V1::Processor

Pass arguments to `get_processor` via a request object, either of type [GetProcessorRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-document_ai-v1/latest/Google-Cloud-DocumentAI-V1-GetProcessorRequest "Google::Cloud::DocumentAI::V1::GetProcessorRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::DocumentAI::V1::GetProcessorRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-document_ai-v1/latest/Google-Cloud-DocumentAI-V1-GetProcessorRequest), ::Hash) --- A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- **options** (::Gapic::CallOptions, ::Hash) --- Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

    def get_processor(name: nil) -> ::Google::Cloud::DocumentAI::V1::Processor

Pass arguments to `get_processor` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). **Parameter**

- **name** (::String) --- Required. The processor resource name.
**Yields**

- (result, operation) --- Access the result along with the TransportOperation object
**Yield Parameters**

- **result** ([::Google::Cloud::DocumentAI::V1::Processor](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-document_ai-v1/latest/Google-Cloud-DocumentAI-V1-Processor))
- **operation** (::Gapic::Rest::TransportOperation)
**Returns**

- ([::Google::Cloud::DocumentAI::V1::Processor](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-document_ai-v1/latest/Google-Cloud-DocumentAI-V1-Processor))
**Raises**

- (::Google::Cloud::Error) --- if the REST call is aborted.
**Example**

Basic example

```ruby
require "google/cloud/document_ai/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::DocumentAI::V1::GetProcessorRequest.new

# Call the get_processor method.
result = client.get_processor request

# The returned object is of type Google::Cloud::DocumentAI::V1::Processor.
p result
```

### #get_processor_type

    def get_processor_type(request, options = nil) -> ::Google::Cloud::DocumentAI::V1::ProcessorType
    def get_processor_type(name: nil) -> ::Google::Cloud::DocumentAI::V1::ProcessorType

Gets a processor type detail.
**Overloads**

    def get_processor_type(request, options = nil) -> ::Google::Cloud::DocumentAI::V1::ProcessorType

Pass arguments to `get_processor_type` via a request object, either of type [GetProcessorTypeRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-document_ai-v1/latest/Google-Cloud-DocumentAI-V1-GetProcessorTypeRequest "Google::Cloud::DocumentAI::V1::GetProcessorTypeRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::DocumentAI::V1::GetProcessorTypeRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-document_ai-v1/latest/Google-Cloud-DocumentAI-V1-GetProcessorTypeRequest), ::Hash) --- A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- **options** (::Gapic::CallOptions, ::Hash) --- Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

    def get_processor_type(name: nil) -> ::Google::Cloud::DocumentAI::V1::ProcessorType

Pass arguments to `get_processor_type` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). **Parameter**

- **name** (::String) --- Required. The processor type resource name.
**Yields**

- (result, operation) --- Access the result along with the TransportOperation object
**Yield Parameters**

- **result** ([::Google::Cloud::DocumentAI::V1::ProcessorType](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-document_ai-v1/latest/Google-Cloud-DocumentAI-V1-ProcessorType))
- **operation** (::Gapic::Rest::TransportOperation)
**Returns**

- ([::Google::Cloud::DocumentAI::V1::ProcessorType](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-document_ai-v1/latest/Google-Cloud-DocumentAI-V1-ProcessorType))
**Raises**

- (::Google::Cloud::Error) --- if the REST call is aborted.
**Example**

Basic example

```ruby
require "google/cloud/document_ai/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::DocumentAI::V1::GetProcessorTypeRequest.new

# Call the get_processor_type method.
result = client.get_processor_type request

# The returned object is of type Google::Cloud::DocumentAI::V1::ProcessorType.
p result
```

### #get_processor_version

    def get_processor_version(request, options = nil) -> ::Google::Cloud::DocumentAI::V1::ProcessorVersion
    def get_processor_version(name: nil) -> ::Google::Cloud::DocumentAI::V1::ProcessorVersion

Gets a processor version detail.
**Overloads**

    def get_processor_version(request, options = nil) -> ::Google::Cloud::DocumentAI::V1::ProcessorVersion

Pass arguments to `get_processor_version` via a request object, either of type [GetProcessorVersionRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-document_ai-v1/latest/Google-Cloud-DocumentAI-V1-GetProcessorVersionRequest "Google::Cloud::DocumentAI::V1::GetProcessorVersionRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::DocumentAI::V1::GetProcessorVersionRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-document_ai-v1/latest/Google-Cloud-DocumentAI-V1-GetProcessorVersionRequest), ::Hash) --- A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- **options** (::Gapic::CallOptions, ::Hash) --- Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

    def get_processor_version(name: nil) -> ::Google::Cloud::DocumentAI::V1::ProcessorVersion

Pass arguments to `get_processor_version` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). **Parameter**

- **name** (::String) --- Required. The processor resource name.
**Yields**

- (result, operation) --- Access the result along with the TransportOperation object
**Yield Parameters**

- **result** ([::Google::Cloud::DocumentAI::V1::ProcessorVersion](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-document_ai-v1/latest/Google-Cloud-DocumentAI-V1-ProcessorVersion))
- **operation** (::Gapic::Rest::TransportOperation)
**Returns**

- ([::Google::Cloud::DocumentAI::V1::ProcessorVersion](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-document_ai-v1/latest/Google-Cloud-DocumentAI-V1-ProcessorVersion))
**Raises**

- (::Google::Cloud::Error) --- if the REST call is aborted.
**Example**

Basic example

```ruby
require "google/cloud/document_ai/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::DocumentAI::V1::GetProcessorVersionRequest.new

# Call the get_processor_version method.
result = client.get_processor_version request

# The returned object is of type Google::Cloud::DocumentAI::V1::ProcessorVersion.
p result
```

### #initialize

    def initialize() { |config| ... } -> Client

Create a new DocumentProcessorService REST client object.
**Yields**

- (config) --- Configure the DocumentProcessorService client.
**Yield Parameter**

- **config** ([Client::Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-document_ai-v1/latest/Google-Cloud-DocumentAI-V1-DocumentProcessorService-Rest-Client-Configuration))
**Returns**

- ([Client](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-document_ai-v1/latest/Google-Cloud-DocumentAI-V1-DocumentProcessorService-Rest-Client)) --- a new instance of Client
**Example**

```ruby
# Create a client using the default configuration
client = ::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Rest::Client.new

# Create a client using a custom configuration
client = ::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Rest::Client.new do |config|
  config.timeout = 10.0
end
```

### #list_evaluations

    def list_evaluations(request, options = nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::DocumentAI::V1::Evaluation>
    def list_evaluations(parent: nil, page_size: nil, page_token: nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::DocumentAI::V1::Evaluation>

Retrieves a set of evaluations for a given processor version.
**Overloads**

    def list_evaluations(request, options = nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::DocumentAI::V1::Evaluation>

Pass arguments to `list_evaluations` via a request object, either of type [ListEvaluationsRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-document_ai-v1/latest/Google-Cloud-DocumentAI-V1-ListEvaluationsRequest "Google::Cloud::DocumentAI::V1::ListEvaluationsRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::DocumentAI::V1::ListEvaluationsRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-document_ai-v1/latest/Google-Cloud-DocumentAI-V1-ListEvaluationsRequest), ::Hash) --- A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- **options** (::Gapic::CallOptions, ::Hash) --- Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

    def list_evaluations(parent: nil, page_size: nil, page_token: nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::DocumentAI::V1::Evaluation>

Pass arguments to `list_evaluations` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). **Parameters**

- **parent** (::String) --- Required. The resource name of the [ProcessorVersion](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-document_ai-v1/latest/Google-Cloud-DocumentAI-V1-ProcessorVersion "Google::Cloud::DocumentAI::V1::ProcessorVersion (class)") to list evaluations for. `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}`
- **page_size** (::Integer) --- 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) --- A page token, received from a previous `ListEvaluations` call. Provide this to retrieve the subsequent page.
**Yields**

- (result, operation) --- Access the result along with the TransportOperation object
**Yield Parameters**

- **result** (::Gapic::Rest::PagedEnumerable\<[::Google::Cloud::DocumentAI::V1::Evaluation](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-document_ai-v1/latest/Google-Cloud-DocumentAI-V1-Evaluation)\>)
- **operation** (::Gapic::Rest::TransportOperation)
**Returns**

- (::Gapic::Rest::PagedEnumerable\<[::Google::Cloud::DocumentAI::V1::Evaluation](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-document_ai-v1/latest/Google-Cloud-DocumentAI-V1-Evaluation)\>)
**Raises**

- (::Google::Cloud::Error) --- if the REST call is aborted.
**Example**

Basic example

```ruby
require "google/cloud/document_ai/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::DocumentAI::V1::ListEvaluationsRequest.new

# Call the list_evaluations method.
result = client.list_evaluations request

# The returned object is of type Gapic::PagedEnumerable. You can iterate
# over elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Google::Cloud::DocumentAI::V1::Evaluation.
  p item
end
```

### #list_processor_types

    def list_processor_types(request, options = nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::DocumentAI::V1::ProcessorType>
    def list_processor_types(parent: nil, page_size: nil, page_token: nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::DocumentAI::V1::ProcessorType>

Lists the processor types that exist.
**Overloads**

    def list_processor_types(request, options = nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::DocumentAI::V1::ProcessorType>

Pass arguments to `list_processor_types` via a request object, either of type [ListProcessorTypesRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-document_ai-v1/latest/Google-Cloud-DocumentAI-V1-ListProcessorTypesRequest "Google::Cloud::DocumentAI::V1::ListProcessorTypesRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::DocumentAI::V1::ListProcessorTypesRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-document_ai-v1/latest/Google-Cloud-DocumentAI-V1-ListProcessorTypesRequest), ::Hash) --- A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- **options** (::Gapic::CallOptions, ::Hash) --- Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

    def list_processor_types(parent: nil, page_size: nil, page_token: nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::DocumentAI::V1::ProcessorType>

Pass arguments to `list_processor_types` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). **Parameters**

- **parent** (::String) --- Required. The location of processor types to list. Format: `projects/{project}/locations/{location}`.
- **page_size** (::Integer) --- 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) --- Used to retrieve the next page of results, empty if at the end of the list.
**Yields**

- (result, operation) --- Access the result along with the TransportOperation object
**Yield Parameters**

- **result** (::Gapic::Rest::PagedEnumerable\<[::Google::Cloud::DocumentAI::V1::ProcessorType](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-document_ai-v1/latest/Google-Cloud-DocumentAI-V1-ProcessorType)\>)
- **operation** (::Gapic::Rest::TransportOperation)
**Returns**

- (::Gapic::Rest::PagedEnumerable\<[::Google::Cloud::DocumentAI::V1::ProcessorType](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-document_ai-v1/latest/Google-Cloud-DocumentAI-V1-ProcessorType)\>)
**Raises**

- (::Google::Cloud::Error) --- if the REST call is aborted.
**Example**

Basic example

```ruby
require "google/cloud/document_ai/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::DocumentAI::V1::ListProcessorTypesRequest.new

# Call the list_processor_types method.
result = client.list_processor_types request

# The returned object is of type Gapic::PagedEnumerable. You can iterate
# over elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Google::Cloud::DocumentAI::V1::ProcessorType.
  p item
end
```

### #list_processor_versions

    def list_processor_versions(request, options = nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::DocumentAI::V1::ProcessorVersion>
    def list_processor_versions(parent: nil, page_size: nil, page_token: nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::DocumentAI::V1::ProcessorVersion>

Lists all versions of a processor.
**Overloads**

    def list_processor_versions(request, options = nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::DocumentAI::V1::ProcessorVersion>

Pass arguments to `list_processor_versions` via a request object, either of type [ListProcessorVersionsRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-document_ai-v1/latest/Google-Cloud-DocumentAI-V1-ListProcessorVersionsRequest "Google::Cloud::DocumentAI::V1::ListProcessorVersionsRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::DocumentAI::V1::ListProcessorVersionsRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-document_ai-v1/latest/Google-Cloud-DocumentAI-V1-ListProcessorVersionsRequest), ::Hash) --- A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- **options** (::Gapic::CallOptions, ::Hash) --- Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

    def list_processor_versions(parent: nil, page_size: nil, page_token: nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::DocumentAI::V1::ProcessorVersion>

Pass arguments to `list_processor_versions` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). **Parameters**

- **parent** (::String) --- Required. The parent (project, location and processor) to list all versions. Format: `projects/{project}/locations/{location}/processors/{processor}`
- **page_size** (::Integer) --- 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) --- We will return the processor versions sorted by creation time. The page token will point to the next processor version.
**Yields**

- (result, operation) --- Access the result along with the TransportOperation object
**Yield Parameters**

- **result** (::Gapic::Rest::PagedEnumerable\<[::Google::Cloud::DocumentAI::V1::ProcessorVersion](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-document_ai-v1/latest/Google-Cloud-DocumentAI-V1-ProcessorVersion)\>)
- **operation** (::Gapic::Rest::TransportOperation)
**Returns**

- (::Gapic::Rest::PagedEnumerable\<[::Google::Cloud::DocumentAI::V1::ProcessorVersion](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-document_ai-v1/latest/Google-Cloud-DocumentAI-V1-ProcessorVersion)\>)
**Raises**

- (::Google::Cloud::Error) --- if the REST call is aborted.
**Example**

Basic example

```ruby
require "google/cloud/document_ai/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::DocumentAI::V1::ListProcessorVersionsRequest.new

# Call the list_processor_versions method.
result = client.list_processor_versions request

# The returned object is of type Gapic::PagedEnumerable. You can iterate
# over elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Google::Cloud::DocumentAI::V1::ProcessorVersion.
  p item
end
```

### #list_processors

    def list_processors(request, options = nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::DocumentAI::V1::Processor>
    def list_processors(parent: nil, page_size: nil, page_token: nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::DocumentAI::V1::Processor>

Lists all processors which belong to this project.
**Overloads**

    def list_processors(request, options = nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::DocumentAI::V1::Processor>

Pass arguments to `list_processors` via a request object, either of type [ListProcessorsRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-document_ai-v1/latest/Google-Cloud-DocumentAI-V1-ListProcessorsRequest "Google::Cloud::DocumentAI::V1::ListProcessorsRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::DocumentAI::V1::ListProcessorsRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-document_ai-v1/latest/Google-Cloud-DocumentAI-V1-ListProcessorsRequest), ::Hash) --- A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- **options** (::Gapic::CallOptions, ::Hash) --- Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

    def list_processors(parent: nil, page_size: nil, page_token: nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::DocumentAI::V1::Processor>

Pass arguments to `list_processors` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). **Parameters**

- **parent** (::String) --- Required. The parent (project and location) which owns this collection of Processors. Format: `projects/{project}/locations/{location}`
- **page_size** (::Integer) --- 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) --- We will return the processors sorted by creation time. The page token will point to the next processor.
**Yields**

- (result, operation) --- Access the result along with the TransportOperation object
**Yield Parameters**

- **result** (::Gapic::Rest::PagedEnumerable\<[::Google::Cloud::DocumentAI::V1::Processor](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-document_ai-v1/latest/Google-Cloud-DocumentAI-V1-Processor)\>)
- **operation** (::Gapic::Rest::TransportOperation)
**Returns**

- (::Gapic::Rest::PagedEnumerable\<[::Google::Cloud::DocumentAI::V1::Processor](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-document_ai-v1/latest/Google-Cloud-DocumentAI-V1-Processor)\>)
**Raises**

- (::Google::Cloud::Error) --- if the REST call is aborted.
**Example**

Basic example

```ruby
require "google/cloud/document_ai/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::DocumentAI::V1::ListProcessorsRequest.new

# Call the list_processors method.
result = client.list_processors request

# The returned object is of type Gapic::PagedEnumerable. You can iterate
# over elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Google::Cloud::DocumentAI::V1::Processor.
  p item
end
```

### #location_client

    def location_client() -> Google::Cloud::Location::Locations::Rest::Client

Get the associated client for mix-in of the Locations.
**Returns**

- (Google::Cloud::Location::Locations::Rest::Client)

### #logger

    def logger() -> Logger

The logger used for request/response debug logging.
**Returns**

- (Logger)

### #operations_client

    def operations_client() -> ::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Rest::Operations

Get the associated client for long-running operations.
**Returns**

- ([::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Rest::Operations](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-document_ai-v1/latest/Google-Cloud-DocumentAI-V1-DocumentProcessorService-Rest-Operations))

### #process_document

    def process_document(request, options = nil) -> ::Google::Cloud::DocumentAI::V1::ProcessResponse
    def process_document(inline_document: nil, raw_document: nil, gcs_document: nil, name: nil, skip_human_review: nil, field_mask: nil, process_options: nil, labels: nil, imageless_mode: nil) -> ::Google::Cloud::DocumentAI::V1::ProcessResponse

Processes a single document.
**Overloads**

    def process_document(request, options = nil) -> ::Google::Cloud::DocumentAI::V1::ProcessResponse

Pass arguments to `process_document` via a request object, either of type [ProcessRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-document_ai-v1/latest/Google-Cloud-DocumentAI-V1-ProcessRequest "Google::Cloud::DocumentAI::V1::ProcessRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::DocumentAI::V1::ProcessRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-document_ai-v1/latest/Google-Cloud-DocumentAI-V1-ProcessRequest), ::Hash) --- A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- **options** (::Gapic::CallOptions, ::Hash) --- Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

    def process_document(inline_document: nil, raw_document: nil, gcs_document: nil, name: nil, skip_human_review: nil, field_mask: nil, process_options: nil, labels: nil, imageless_mode: nil) -> ::Google::Cloud::DocumentAI::V1::ProcessResponse

Pass arguments to `process_document` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). **Parameters**

- **inline_document** ([::Google::Cloud::DocumentAI::V1::Document](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-document_ai-v1/latest/Google-Cloud-DocumentAI-V1-Document), ::Hash) --- An inline document proto.


  Note: The following parameters are mutually exclusive: `inline_document`, `raw_document`, `gcs_document`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one.
- **raw_document** ([::Google::Cloud::DocumentAI::V1::RawDocument](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-document_ai-v1/latest/Google-Cloud-DocumentAI-V1-RawDocument), ::Hash) --- A raw document content (bytes).


  Note: The following parameters are mutually exclusive: `raw_document`, `inline_document`, `gcs_document`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one.
- **gcs_document** ([::Google::Cloud::DocumentAI::V1::GcsDocument](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-document_ai-v1/latest/Google-Cloud-DocumentAI-V1-GcsDocument), ::Hash) --- A raw document on Google Cloud Storage.


  Note: The following parameters are mutually exclusive: `gcs_document`, `inline_document`, `raw_document`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one.
- **name** (::String) --- Required. The resource name of the [Processor](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-document_ai-v1/latest/Google-Cloud-DocumentAI-V1-Processor "Google::Cloud::DocumentAI::V1::Processor (class)") or [ProcessorVersion](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-document_ai-v1/latest/Google-Cloud-DocumentAI-V1-ProcessorVersion "Google::Cloud::DocumentAI::V1::ProcessorVersion (class)") to use for processing. If a [Processor](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-document_ai-v1/latest/Google-Cloud-DocumentAI-V1-Processor "Google::Cloud::DocumentAI::V1::Processor (class)") is specified, the server will use its \[default version\]\[google.cloud.documentai.v1.Processor.default_processor_version\]. Format: `projects/{project}/locations/{location}/processors/{processor}`, or `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}`
- **skip_human_review** (::Boolean) --- Whether human review should be skipped for this request. Default to `false`.
- **field_mask** ([::Google::Protobuf::FieldMask](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-document_ai-v1/latest/Google-Protobuf-FieldMask), ::Hash) --- Specifies which fields to include in the [ProcessResponse.document](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-document_ai-v1/latest/Google-Cloud-DocumentAI-V1-ProcessResponse#Google__Cloud__DocumentAI__V1__ProcessResponse_document_instance_ "Google::Cloud::DocumentAI::V1::ProcessResponse#document (method)") output. Only supports top-level document and pages field, so it must be in the form of `{document_field_name}` or `pages.{page_field_name}`.
- **process_options** ([::Google::Cloud::DocumentAI::V1::ProcessOptions](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-document_ai-v1/latest/Google-Cloud-DocumentAI-V1-ProcessOptions), ::Hash) --- Inference-time options for the process API
- **labels** (::Hash{::String =\> ::String}) --- Optional. The labels with user-defined metadata for the request.


  Label keys and values can be no longer than 63 characters
  (Unicode codepoints) and can only contain lowercase letters, numeric
  characters, underscores, and dashes. International characters are allowed.
  Label values are optional. Label keys must start with a letter.
- **imageless_mode** (::Boolean) --- Optional. Option to remove images from the document.
**Yields**

- (result, operation) --- Access the result along with the TransportOperation object
**Yield Parameters**

- **result** ([::Google::Cloud::DocumentAI::V1::ProcessResponse](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-document_ai-v1/latest/Google-Cloud-DocumentAI-V1-ProcessResponse))
- **operation** (::Gapic::Rest::TransportOperation)
**Returns**

- ([::Google::Cloud::DocumentAI::V1::ProcessResponse](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-document_ai-v1/latest/Google-Cloud-DocumentAI-V1-ProcessResponse))
**Raises**

- (::Google::Cloud::Error) --- if the REST call is aborted.
**Example**

Basic example

```ruby
require "google/cloud/document_ai/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::DocumentAI::V1::ProcessRequest.new

# Call the process_document method.
result = client.process_document request

# The returned object is of type Google::Cloud::DocumentAI::V1::ProcessResponse.
p result
```

### #review_document

    def review_document(request, options = nil) -> ::Gapic::Operation
    def review_document(inline_document: nil, human_review_config: nil, enable_schema_validation: nil, priority: nil, document_schema: nil) -> ::Gapic::Operation

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

    def review_document(request, options = nil) -> ::Gapic::Operation

Pass arguments to `review_document` via a request object, either of type [ReviewDocumentRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-document_ai-v1/latest/Google-Cloud-DocumentAI-V1-ReviewDocumentRequest "Google::Cloud::DocumentAI::V1::ReviewDocumentRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::DocumentAI::V1::ReviewDocumentRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-document_ai-v1/latest/Google-Cloud-DocumentAI-V1-ReviewDocumentRequest), ::Hash) --- A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- **options** (::Gapic::CallOptions, ::Hash) --- Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

    def review_document(inline_document: nil, human_review_config: nil, enable_schema_validation: nil, priority: nil, document_schema: nil) -> ::Gapic::Operation

Pass arguments to `review_document` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). **Parameters**

- **inline_document** ([::Google::Cloud::DocumentAI::V1::Document](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-document_ai-v1/latest/Google-Cloud-DocumentAI-V1-Document), ::Hash) --- An inline document proto.
- **human_review_config** (::String) --- Required. The resource name of the \[HumanReviewConfig\]\[google.cloud.documentai.v1.HumanReviewConfig\] that the document will be reviewed with.
- **enable_schema_validation** (::Boolean) --- Whether the validation should be performed on the ad-hoc review request.
- **priority** ([::Google::Cloud::DocumentAI::V1::ReviewDocumentRequest::Priority](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-document_ai-v1/latest/Google-Cloud-DocumentAI-V1-ReviewDocumentRequest-Priority)) --- The priority of the human review task.
- **document_schema** ([::Google::Cloud::DocumentAI::V1::DocumentSchema](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-document_ai-v1/latest/Google-Cloud-DocumentAI-V1-DocumentSchema), ::Hash) --- The document schema of the human review task.
**Yields**

- (result, operation) --- Access the result along with the TransportOperation object
**Yield Parameters**

- **result** (::Gapic::Operation)
- **operation** (::Gapic::Rest::TransportOperation)
**Returns**

- (::Gapic::Operation)
**Raises**

- (::Google::Cloud::Error) --- if the REST call is aborted.
**Example**

Basic example

```ruby
require "google/cloud/document_ai/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::DocumentAI::V1::ReviewDocumentRequest.new

# Call the review_document method.
result = client.review_document request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end
```

### #set_default_processor_version

    def set_default_processor_version(request, options = nil) -> ::Gapic::Operation
    def set_default_processor_version(processor: nil, default_processor_version: nil) -> ::Gapic::Operation

Set the default (active) version of a
[Processor](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-document_ai-v1/latest/Google-Cloud-DocumentAI-V1-Processor "Google::Cloud::DocumentAI::V1::Processor (class)") that will be used in
[ProcessDocument](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-document_ai-v1/latest/Google-Cloud-DocumentAI-V1-DocumentProcessorService-Rest-Client#Google__Cloud__DocumentAI__V1__DocumentProcessorService__Rest__Client_process_document_instance_ "Google::Cloud::DocumentAI::V1::DocumentProcessorService::Rest::Client#process_document (method)")
and
[BatchProcessDocuments](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-document_ai-v1/latest/Google-Cloud-DocumentAI-V1-DocumentProcessorService-Rest-Client#Google__Cloud__DocumentAI__V1__DocumentProcessorService__Rest__Client_batch_process_documents_instance_ "Google::Cloud::DocumentAI::V1::DocumentProcessorService::Rest::Client#batch_process_documents (method)").
**Overloads**

    def set_default_processor_version(request, options = nil) -> ::Gapic::Operation

Pass arguments to `set_default_processor_version` via a request object, either of type [SetDefaultProcessorVersionRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-document_ai-v1/latest/Google-Cloud-DocumentAI-V1-SetDefaultProcessorVersionRequest "Google::Cloud::DocumentAI::V1::SetDefaultProcessorVersionRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::DocumentAI::V1::SetDefaultProcessorVersionRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-document_ai-v1/latest/Google-Cloud-DocumentAI-V1-SetDefaultProcessorVersionRequest), ::Hash) --- A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- **options** (::Gapic::CallOptions, ::Hash) --- Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

    def set_default_processor_version(processor: nil, default_processor_version: nil) -> ::Gapic::Operation

Pass arguments to `set_default_processor_version` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). **Parameters**

- **processor** (::String) --- Required. The resource name of the [Processor](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-document_ai-v1/latest/Google-Cloud-DocumentAI-V1-Processor "Google::Cloud::DocumentAI::V1::Processor (class)") to change default version.
- **default_processor_version** (::String) --- Required. The resource name of child [ProcessorVersion](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-document_ai-v1/latest/Google-Cloud-DocumentAI-V1-ProcessorVersion "Google::Cloud::DocumentAI::V1::ProcessorVersion (class)") to use as default. Format: `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{version}`
**Yields**

- (result, operation) --- Access the result along with the TransportOperation object
**Yield Parameters**

- **result** (::Gapic::Operation)
- **operation** (::Gapic::Rest::TransportOperation)
**Returns**

- (::Gapic::Operation)
**Raises**

- (::Google::Cloud::Error) --- if the REST call is aborted.
**Example**

Basic example

```ruby
require "google/cloud/document_ai/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::DocumentAI::V1::SetDefaultProcessorVersionRequest.new

# Call the set_default_processor_version method.
result = client.set_default_processor_version request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end
```

### #train_processor_version

    def train_processor_version(request, options = nil) -> ::Gapic::Operation
    def train_processor_version(custom_document_extraction_options: nil, foundation_model_tuning_options: nil, parent: nil, processor_version: nil, document_schema: nil, input_data: nil, base_processor_version: nil) -> ::Gapic::Operation

Trains a new processor version.
Operation metadata is returned as
[TrainProcessorVersionMetadata](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-document_ai-v1/latest/Google-Cloud-DocumentAI-V1-TrainProcessorVersionMetadata "Google::Cloud::DocumentAI::V1::TrainProcessorVersionMetadata (class)").
**Overloads**

    def train_processor_version(request, options = nil) -> ::Gapic::Operation

Pass arguments to `train_processor_version` via a request object, either of type [TrainProcessorVersionRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-document_ai-v1/latest/Google-Cloud-DocumentAI-V1-TrainProcessorVersionRequest "Google::Cloud::DocumentAI::V1::TrainProcessorVersionRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::DocumentAI::V1::TrainProcessorVersionRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-document_ai-v1/latest/Google-Cloud-DocumentAI-V1-TrainProcessorVersionRequest), ::Hash) --- A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- **options** (::Gapic::CallOptions, ::Hash) --- Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

    def train_processor_version(custom_document_extraction_options: nil, foundation_model_tuning_options: nil, parent: nil, processor_version: nil, document_schema: nil, input_data: nil, base_processor_version: nil) -> ::Gapic::Operation

Pass arguments to `train_processor_version` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). **Parameters**

- **custom_document_extraction_options** ([::Google::Cloud::DocumentAI::V1::TrainProcessorVersionRequest::CustomDocumentExtractionOptions](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-document_ai-v1/latest/Google-Cloud-DocumentAI-V1-TrainProcessorVersionRequest-CustomDocumentExtractionOptions), ::Hash) --- Options to control Custom Document Extraction (CDE) Processor.


  Note: The following parameters are mutually exclusive: `custom_document_extraction_options`, `foundation_model_tuning_options`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one.
- **foundation_model_tuning_options** ([::Google::Cloud::DocumentAI::V1::TrainProcessorVersionRequest::FoundationModelTuningOptions](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-document_ai-v1/latest/Google-Cloud-DocumentAI-V1-TrainProcessorVersionRequest-FoundationModelTuningOptions), ::Hash) --- Options to control foundation model tuning of a processor.


  Note: The following parameters are mutually exclusive: `foundation_model_tuning_options`, `custom_document_extraction_options`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one.
- **parent** (::String) --- Required. The parent (project, location and processor) to create the new version for. Format: `projects/{project}/locations/{location}/processors/{processor}`.
- **processor_version** ([::Google::Cloud::DocumentAI::V1::ProcessorVersion](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-document_ai-v1/latest/Google-Cloud-DocumentAI-V1-ProcessorVersion), ::Hash) --- Required. The processor version to be created.
- **document_schema** ([::Google::Cloud::DocumentAI::V1::DocumentSchema](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-document_ai-v1/latest/Google-Cloud-DocumentAI-V1-DocumentSchema), ::Hash) --- Optional. The schema the processor version will be trained with.
- **input_data** ([::Google::Cloud::DocumentAI::V1::TrainProcessorVersionRequest::InputData](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-document_ai-v1/latest/Google-Cloud-DocumentAI-V1-TrainProcessorVersionRequest-InputData), ::Hash) --- Optional. The input data used to train the [ProcessorVersion](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-document_ai-v1/latest/Google-Cloud-DocumentAI-V1-ProcessorVersion "Google::Cloud::DocumentAI::V1::ProcessorVersion (class)").
- **base_processor_version** (::String) --- Optional. The processor version to use as a base for training. This processor version must be a child of `parent`. Format: `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}`.
**Yields**

- (result, operation) --- Access the result along with the TransportOperation object
**Yield Parameters**

- **result** (::Gapic::Operation)
- **operation** (::Gapic::Rest::TransportOperation)
**Returns**

- (::Gapic::Operation)
**Raises**

- (::Google::Cloud::Error) --- if the REST call is aborted.
**Example**

Basic example

```ruby
require "google/cloud/document_ai/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::DocumentAI::V1::TrainProcessorVersionRequest.new

# Call the train_processor_version method.
result = client.train_processor_version request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end
```

### #undeploy_processor_version

    def undeploy_processor_version(request, options = nil) -> ::Gapic::Operation
    def undeploy_processor_version(name: nil) -> ::Gapic::Operation

Undeploys the processor version.
**Overloads**

    def undeploy_processor_version(request, options = nil) -> ::Gapic::Operation

Pass arguments to `undeploy_processor_version` via a request object, either of type [UndeployProcessorVersionRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-document_ai-v1/latest/Google-Cloud-DocumentAI-V1-UndeployProcessorVersionRequest "Google::Cloud::DocumentAI::V1::UndeployProcessorVersionRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::DocumentAI::V1::UndeployProcessorVersionRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-document_ai-v1/latest/Google-Cloud-DocumentAI-V1-UndeployProcessorVersionRequest), ::Hash) --- A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- **options** (::Gapic::CallOptions, ::Hash) --- Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

    def undeploy_processor_version(name: nil) -> ::Gapic::Operation

Pass arguments to `undeploy_processor_version` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). **Parameter**

- **name** (::String) --- Required. The processor version resource name to be undeployed.
**Yields**

- (result, operation) --- Access the result along with the TransportOperation object
**Yield Parameters**

- **result** (::Gapic::Operation)
- **operation** (::Gapic::Rest::TransportOperation)
**Returns**

- (::Gapic::Operation)
**Raises**

- (::Google::Cloud::Error) --- if the REST call is aborted.
**Example**

Basic example

```ruby
require "google/cloud/document_ai/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::DocumentAI::V1::UndeployProcessorVersionRequest.new

# Call the undeploy_processor_version method.
result = client.undeploy_processor_version request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end
```

### #universe_domain

    def universe_domain() -> String

The effective universe domain
**Returns**

- (String)