# Class DocumentServiceClient (2.97.0)

2.97.0 (latest) 2.95.0 2.92.0 2.91.0 2.89.0 2.87.0 2.86.0 2.85.0 2.84.0 2.82.0 2.80.0 2.79.0 2.78.0 2.77.0 2.76.0 2.74.0 2.72.0 2.71.0 2.68.0 2.67.0 2.66.0 2.64.0 2.63.0 2.62.0 2.61.0 2.60.0 2.59.0 2.58.0 2.57.0 2.56.0 2.55.0 2.53.0 2.52.0 2.51.0 2.50.0 2.49.0 2.48.0 2.47.0 2.46.0 2.45.0 2.44.0 2.43.0 2.41.0 2.40.0 2.39.0 2.38.0 2.37.0 2.36.0 2.35.0 2.34.0 2.33.0 2.32.0 2.31.0 2.28.0 2.27.0 2.26.0 2.25.0 2.24.0 2.23.0 2.22.0 2.21.0 2.20.0 2.19.0 2.18.0 2.17.0 2.16.0 2.15.0 2.13.0 2.12.0 2.11.0 2.10.0 2.9.0 2.8.0 2.7.5 2.6.2 2.5.1 2.4.3 2.3.1 2.2.1 2.1.9

> [!WARNING]
> **Beta**
>
>
> This library is covered by the [Pre-GA Offerings Terms](https://docs.cloud.google.com/terms/service-terms#1)
> of the Terms of Service. Pre-GA libraries might have limited support,
> and changes to pre-GA libraries might not be compatible with other pre-GA versions.
> For more information, see the
> [launch stage descriptions](https://docs.cloud.google.com/products#product-launch-stages).

|---|---|
| [GitHub Repository](https://github.com/googleapis/google-cloud-java/tree/main/java-document-ai/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta3/DocumentServiceClient.java) | [Product Reference](https://cloud.google.com/compute/docs/documentai/) |

Service Description: Service to call Cloud DocumentAI to manage document collection (dataset).

This class provides the ability to make remote calls to the backing service through method
calls that map to API methods. Sample code to get started:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (DocumentServiceClient documentServiceClient = DocumentServiceClient.create()) {
       DatasetName dataset = DatasetName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]");
       GetDocumentResponse response = documentServiceClient.getDocument(dataset);
     }
     
Note: close() needs to be called on the DocumentServiceClient object to clean up resources
such as threads. In the example above, try-with-resources is used, which automatically calls
close().

| Method | Description | Method Variants |
|---|---|---|
| UpdateDataset | Updates metadata associated with a dataset. Note that this method requires the `documentai.googleapis.com/datasets.update` 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. | Request object method variants only take one parameter, a request object, which must be constructed before the call. - updateDatasetAsync(UpdateDatasetRequest request) Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service. - updateDatasetAsync(Dataset dataset, FieldMask updateMask) Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. - updateDatasetOperationCallable() - updateDatasetCallable() |
| ImportDocuments | Import documents into a dataset. | Request object method variants only take one parameter, a request object, which must be constructed before the call. - importDocumentsAsync(ImportDocumentsRequest request) Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service. - importDocumentsAsync(DatasetName dataset) - importDocumentsAsync(String dataset) Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. - importDocumentsOperationCallable() - importDocumentsCallable() |
| GetDocument | Returns relevant fields present in the requested document. | Request object method variants only take one parameter, a request object, which must be constructed before the call. - getDocument(GetDocumentRequest request) "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. - getDocument(DatasetName dataset) - getDocument(String dataset) Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. - getDocumentCallable() |
| ListDocuments | Returns a list of documents present in the dataset. | Request object method variants only take one parameter, a request object, which must be constructed before the call. - listDocuments(ListDocumentsRequest request) "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. - listDocuments(DatasetName dataset) - listDocuments(String dataset) Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. - listDocumentsPagedCallable() - listDocumentsCallable() |
| BatchDeleteDocuments | Deletes a set of documents. | Request object method variants only take one parameter, a request object, which must be constructed before the call. - batchDeleteDocumentsAsync(BatchDeleteDocumentsRequest request) Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service. - batchDeleteDocumentsAsync(String dataset) Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. - batchDeleteDocumentsOperationCallable() - batchDeleteDocumentsCallable() |
| GetDatasetSchema | Gets the `DatasetSchema` of a `Dataset`. | Request object method variants only take one parameter, a request object, which must be constructed before the call. - getDatasetSchema(GetDatasetSchemaRequest request) "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. - getDatasetSchema(DatasetSchemaName name) - getDatasetSchema(String name) Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. - getDatasetSchemaCallable() |
| UpdateDatasetSchema | Updates a `DatasetSchema`. | Request object method variants only take one parameter, a request object, which must be constructed before the call. - updateDatasetSchema(UpdateDatasetSchemaRequest request) "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. - updateDatasetSchema(DatasetSchema datasetSchema, FieldMask updateMask) Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. - updateDatasetSchemaCallable() |
| ListLocations | Lists information about the supported locations for this service.This method can be called in two ways: \* \*\*List all public locations:\*\* Use the path `GET /v1/locations`.\* \*\*List project-visible locations:\*\* Use the path`GET /v1/projects/{project_id}/locations`. This may include publiclocations as well as private or other locations specifically visibleto the project. | Request object method variants only take one parameter, a request object, which must be constructed before the call. - listLocations(ListLocationsRequest request) Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. - listLocationsPagedCallable() - listLocationsCallable() |
| GetLocation | Gets information about a location. | Request object method variants only take one parameter, a request object, which must be constructed before the call. - getLocation(GetLocationRequest request) Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. - getLocationCallable() |
[Methods]

See the individual methods for example code.

Many parameters require resource names to be formatted in a particular way. To assist with
these names, this class includes a format method for each type of name, and additionally a parse
method to extract the individual identifiers contained within names that are returned.

This class can be customized by passing in a custom instance of DocumentServiceSettings to
create(). For example:

To customize credentials:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     DocumentServiceSettings documentServiceSettings =
         DocumentServiceSettings.newBuilder()
             .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
             .build();
     DocumentServiceClient documentServiceClient =
         DocumentServiceClient.create(documentServiceSettings);
     
To customize the endpoint:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     DocumentServiceSettings documentServiceSettings =
         DocumentServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
     DocumentServiceClient documentServiceClient =
         DocumentServiceClient.create(documentServiceSettings);
     
To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over
the wire:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     DocumentServiceSettings documentServiceSettings =
         DocumentServiceSettings.newHttpJsonBuilder().build();
     DocumentServiceClient documentServiceClient =
         DocumentServiceClient.create(documentServiceSettings);
     
Please refer to the GitHub repository's samples for more quickstart code snippets.

## Inheritance

[java.lang.Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html) \> DocumentServiceClient

## Static Methods

### create()

    public static final DocumentServiceClient create()

Constructs an instance of DocumentServiceClient with default settings.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-document-ai/latest/com.google.cloud.documentai.v1beta3.DocumentServiceClient` |   |

| **Exceptions** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html` |   |

### create(DocumentServiceSettings settings)

    public static final DocumentServiceClient create(DocumentServiceSettings settings)

Constructs an instance of DocumentServiceClient, using the given settings. The channels are
created based on the settings passed in, or defaults for any settings that are not set.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `settings` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-document-ai/latest/com.google.cloud.documentai.v1beta3.DocumentServiceSettings` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-document-ai/latest/com.google.cloud.documentai.v1beta3.DocumentServiceClient` |   |

| **Exceptions** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html` |   |

### create(DocumentServiceStub stub)

    public static final DocumentServiceClient create(DocumentServiceStub stub)

Constructs an instance of DocumentServiceClient, using the given stub for making calls. This is
for advanced usage - prefer using create(DocumentServiceSettings).

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `stub` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-document-ai/latest/com.google.cloud.documentai.v1beta3.stub.DocumentServiceStub` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-document-ai/latest/com.google.cloud.documentai.v1beta3.DocumentServiceClient` |   |

## Constructors

### DocumentServiceClient(DocumentServiceSettings settings)

    protected DocumentServiceClient(DocumentServiceSettings settings)

Constructs an instance of DocumentServiceClient, using the given settings. This is protected so
that it is easy to make a subclass, but otherwise, the static factory methods should be
preferred.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `settings` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-document-ai/latest/com.google.cloud.documentai.v1beta3.DocumentServiceSettings` |

### DocumentServiceClient(DocumentServiceStub stub)

    protected DocumentServiceClient(DocumentServiceStub stub)

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `stub` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-document-ai/latest/com.google.cloud.documentai.v1beta3.stub.DocumentServiceStub` |

## Methods

### awaitTermination(long duration, TimeUnit unit)

    public boolean awaitTermination(long duration, TimeUnit unit)

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `duration` | `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |
| `unit` | `https://docs.oracle.com/javase/8/docs/api/java/util/concurrent/TimeUnit.html` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |   |

| **Exceptions** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/InterruptedException.html` |   |

### batchDeleteDocumentsAsync(BatchDeleteDocumentsRequest request)

    public final OperationFuture<BatchDeleteDocumentsResponse,BatchDeleteDocumentsMetadata> batchDeleteDocumentsAsync(BatchDeleteDocumentsRequest request)

Deletes a set of documents.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (DocumentServiceClient documentServiceClient = DocumentServiceClient.create()) {
       BatchDeleteDocumentsRequest request =
           BatchDeleteDocumentsRequest.newBuilder()
               .setDataset("dataset1443214456")
               .setDatasetDocuments(BatchDatasetDocuments.newBuilder().build())
               .build();
       BatchDeleteDocumentsResponse response =
           documentServiceClient.batchDeleteDocumentsAsync(request).get();
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-document-ai/latest/com.google.cloud.documentai.v1beta3.BatchDeleteDocumentsRequest` The request object containing all of the parameters for the API call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.longrunning.OperationFuture.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-document-ai/latest/com.google.cloud.documentai.v1beta3.BatchDeleteDocumentsResponse,https://docs.cloud.google.com/java/docs/reference/google-cloud-document-ai/latest/com.google.cloud.documentai.v1beta3.BatchDeleteDocumentsMetadata>` |   |

### batchDeleteDocumentsAsync(String dataset)

    public final OperationFuture<BatchDeleteDocumentsResponse,BatchDeleteDocumentsMetadata> batchDeleteDocumentsAsync(String dataset)

Deletes a set of documents.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (DocumentServiceClient documentServiceClient = DocumentServiceClient.create()) {
       String dataset = "dataset1443214456";
       BatchDeleteDocumentsResponse response =
           documentServiceClient.batchDeleteDocumentsAsync(dataset).get();
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `dataset` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` Required. The dataset resource name. Format: projects/{project}/locations/{location}/processors/{processor}/dataset |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.longrunning.OperationFuture.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-document-ai/latest/com.google.cloud.documentai.v1beta3.BatchDeleteDocumentsResponse,https://docs.cloud.google.com/java/docs/reference/google-cloud-document-ai/latest/com.google.cloud.documentai.v1beta3.BatchDeleteDocumentsMetadata>` |   |

### batchDeleteDocumentsCallable()

    public final UnaryCallable<BatchDeleteDocumentsRequest,Operation> batchDeleteDocumentsCallable()

Deletes a set of documents.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (DocumentServiceClient documentServiceClient = DocumentServiceClient.create()) {
       BatchDeleteDocumentsRequest request =
           BatchDeleteDocumentsRequest.newBuilder()
               .setDataset("dataset1443214456")
               .setDatasetDocuments(BatchDatasetDocuments.newBuilder().build())
               .build();
       ApiFuture<Operation> future =
           documentServiceClient.batchDeleteDocumentsCallable().futureCall(request);
       // Do something.
       Operation response = future.get();
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.UnaryCallable.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-document-ai/latest/com.google.cloud.documentai.v1beta3.BatchDeleteDocumentsRequest,https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.longrunning.Operation.html>` |   |

### batchDeleteDocumentsOperationCallable()

    public final OperationCallable<BatchDeleteDocumentsRequest,BatchDeleteDocumentsResponse,BatchDeleteDocumentsMetadata> batchDeleteDocumentsOperationCallable()

Deletes a set of documents.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (DocumentServiceClient documentServiceClient = DocumentServiceClient.create()) {
       BatchDeleteDocumentsRequest request =
           BatchDeleteDocumentsRequest.newBuilder()
               .setDataset("dataset1443214456")
               .setDatasetDocuments(BatchDatasetDocuments.newBuilder().build())
               .build();
       OperationFuture<BatchDeleteDocumentsResponse, BatchDeleteDocumentsMetadata> future =
           documentServiceClient.batchDeleteDocumentsOperationCallable().futureCall(request);
       // Do something.
       BatchDeleteDocumentsResponse response = future.get();
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.OperationCallable.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-document-ai/latest/com.google.cloud.documentai.v1beta3.BatchDeleteDocumentsRequest,https://docs.cloud.google.com/java/docs/reference/google-cloud-document-ai/latest/com.google.cloud.documentai.v1beta3.BatchDeleteDocumentsResponse,https://docs.cloud.google.com/java/docs/reference/google-cloud-document-ai/latest/com.google.cloud.documentai.v1beta3.BatchDeleteDocumentsMetadata>` |   |

### close()

    public final void close()

### getDatasetSchema(DatasetSchemaName name)

    public final DatasetSchema getDatasetSchema(DatasetSchemaName name)

Gets the `DatasetSchema` of a `Dataset`.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (DocumentServiceClient documentServiceClient = DocumentServiceClient.create()) {
       DatasetSchemaName name = DatasetSchemaName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]");
       DatasetSchema response = documentServiceClient.getDatasetSchema(name);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `name` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-document-ai/latest/com.google.cloud.documentai.v1beta3.DatasetSchemaName` Required. The dataset schema resource name. Format: projects/{project}/locations/{location}/processors/{processor}/dataset/datasetSchema |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-document-ai/latest/com.google.cloud.documentai.v1beta3.DatasetSchema` |   |

### getDatasetSchema(GetDatasetSchemaRequest request)

    public final DatasetSchema getDatasetSchema(GetDatasetSchemaRequest request)

Gets the `DatasetSchema` of a `Dataset`.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (DocumentServiceClient documentServiceClient = DocumentServiceClient.create()) {
       GetDatasetSchemaRequest request =
           GetDatasetSchemaRequest.newBuilder()
               .setName(DatasetSchemaName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString())
               .setVisibleFieldsOnly(true)
               .build();
       DatasetSchema response = documentServiceClient.getDatasetSchema(request);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-document-ai/latest/com.google.cloud.documentai.v1beta3.GetDatasetSchemaRequest` The request object containing all of the parameters for the API call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-document-ai/latest/com.google.cloud.documentai.v1beta3.DatasetSchema` |   |

### getDatasetSchema(String name)

    public final DatasetSchema getDatasetSchema(String name)

Gets the `DatasetSchema` of a `Dataset`.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (DocumentServiceClient documentServiceClient = DocumentServiceClient.create()) {
       String name = DatasetSchemaName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString();
       DatasetSchema response = documentServiceClient.getDatasetSchema(name);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `name` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` Required. The dataset schema resource name. Format: projects/{project}/locations/{location}/processors/{processor}/dataset/datasetSchema |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-document-ai/latest/com.google.cloud.documentai.v1beta3.DatasetSchema` |   |

### getDatasetSchemaCallable()

    public final UnaryCallable<GetDatasetSchemaRequest,DatasetSchema> getDatasetSchemaCallable()

Gets the `DatasetSchema` of a `Dataset`.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (DocumentServiceClient documentServiceClient = DocumentServiceClient.create()) {
       GetDatasetSchemaRequest request =
           GetDatasetSchemaRequest.newBuilder()
               .setName(DatasetSchemaName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString())
               .setVisibleFieldsOnly(true)
               .build();
       ApiFuture<DatasetSchema> future =
           documentServiceClient.getDatasetSchemaCallable().futureCall(request);
       // Do something.
       DatasetSchema response = future.get();
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.UnaryCallable.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-document-ai/latest/com.google.cloud.documentai.v1beta3.GetDatasetSchemaRequest,https://docs.cloud.google.com/java/docs/reference/google-cloud-document-ai/latest/com.google.cloud.documentai.v1beta3.DatasetSchema>` |   |

### getDocument(DatasetName dataset)

    public final GetDocumentResponse getDocument(DatasetName dataset)

Returns relevant fields present in the requested document.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (DocumentServiceClient documentServiceClient = DocumentServiceClient.create()) {
       DatasetName dataset = DatasetName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]");
       GetDocumentResponse response = documentServiceClient.getDocument(dataset);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `dataset` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-document-ai/latest/com.google.cloud.documentai.v1beta3.DatasetName` Required. The resource name of the dataset that the document belongs to . Format: projects/{project}/locations/{location}/processors/{processor}/dataset |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-document-ai/latest/com.google.cloud.documentai.v1beta3.GetDocumentResponse` |   |

### getDocument(GetDocumentRequest request)

    public final GetDocumentResponse getDocument(GetDocumentRequest request)

Returns relevant fields present in the requested document.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (DocumentServiceClient documentServiceClient = DocumentServiceClient.create()) {
       GetDocumentRequest request =
           GetDocumentRequest.newBuilder()
               .setDataset(DatasetName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString())
               .setDocumentId(DocumentId.newBuilder().build())
               .setReadMask(FieldMask.newBuilder().build())
               .setPageRange(DocumentPageRange.newBuilder().build())
               .build();
       GetDocumentResponse response = documentServiceClient.getDocument(request);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-document-ai/latest/com.google.cloud.documentai.v1beta3.GetDocumentRequest` The request object containing all of the parameters for the API call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-document-ai/latest/com.google.cloud.documentai.v1beta3.GetDocumentResponse` |   |

### getDocument(String dataset)

    public final GetDocumentResponse getDocument(String dataset)

Returns relevant fields present in the requested document.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (DocumentServiceClient documentServiceClient = DocumentServiceClient.create()) {
       String dataset = DatasetName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString();
       GetDocumentResponse response = documentServiceClient.getDocument(dataset);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `dataset` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` Required. The resource name of the dataset that the document belongs to . Format: projects/{project}/locations/{location}/processors/{processor}/dataset |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-document-ai/latest/com.google.cloud.documentai.v1beta3.GetDocumentResponse` |   |

### getDocumentCallable()

    public final UnaryCallable<GetDocumentRequest,GetDocumentResponse> getDocumentCallable()

Returns relevant fields present in the requested document.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (DocumentServiceClient documentServiceClient = DocumentServiceClient.create()) {
       GetDocumentRequest request =
           GetDocumentRequest.newBuilder()
               .setDataset(DatasetName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString())
               .setDocumentId(DocumentId.newBuilder().build())
               .setReadMask(FieldMask.newBuilder().build())
               .setPageRange(DocumentPageRange.newBuilder().build())
               .build();
       ApiFuture<GetDocumentResponse> future =
           documentServiceClient.getDocumentCallable().futureCall(request);
       // Do something.
       GetDocumentResponse response = future.get();
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.UnaryCallable.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-document-ai/latest/com.google.cloud.documentai.v1beta3.GetDocumentRequest,https://docs.cloud.google.com/java/docs/reference/google-cloud-document-ai/latest/com.google.cloud.documentai.v1beta3.GetDocumentResponse>` |   |

### getHttpJsonOperationsClient()

    public final OperationsClient getHttpJsonOperationsClient()

> [!WARNING]
> **Beta**
>
> This feature is covered by the [Pre-GA Offerings Terms](https://docs.cloud.google.com/terms/service-terms#1) of the Terms of Service. Pre-GA libraries might have limited support, and changes to pre-GA libraries might not be compatible with other pre-GA versions. For more information, see the launch stage descriptions.

Returns the OperationsClient that can be used to query the status of a long-running operation
returned by another API method call.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.httpjson.longrunning.OperationsClient.html` |   |

### getLocation(GetLocationRequest request)

    public final Location getLocation(GetLocationRequest request)

Gets information about a location.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (DocumentServiceClient documentServiceClient = DocumentServiceClient.create()) {
       GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
       Location response = documentServiceClient.getLocation(request);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `request` | `com.google.cloud.location.GetLocationRequest` The request object containing all of the parameters for the API call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `com.google.cloud.location.Location` |   |

### getLocationCallable()

    public final UnaryCallable<GetLocationRequest,Location> getLocationCallable()

Gets information about a location.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (DocumentServiceClient documentServiceClient = DocumentServiceClient.create()) {
       GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
       ApiFuture<Location> future = documentServiceClient.getLocationCallable().futureCall(request);
       // Do something.
       Location response = future.get();
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.UnaryCallable.html<com.google.cloud.location.GetLocationRequest,com.google.cloud.location.Location>` |   |

### getOperationsClient()

    public final OperationsClient getOperationsClient()

Returns the OperationsClient that can be used to query the status of a long-running operation
returned by another API method call.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.longrunning.OperationsClient.html` |   |

### getSettings()

    public final DocumentServiceSettings getSettings()

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-document-ai/latest/com.google.cloud.documentai.v1beta3.DocumentServiceSettings` |   |

### getStub()

    public DocumentServiceStub getStub()

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-document-ai/latest/com.google.cloud.documentai.v1beta3.stub.DocumentServiceStub` |   |

### importDocumentsAsync(DatasetName dataset)

    public final OperationFuture<ImportDocumentsResponse,ImportDocumentsMetadata> importDocumentsAsync(DatasetName dataset)

Import documents into a dataset.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (DocumentServiceClient documentServiceClient = DocumentServiceClient.create()) {
       DatasetName dataset = DatasetName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]");
       ImportDocumentsResponse response = documentServiceClient.importDocumentsAsync(dataset).get();
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `dataset` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-document-ai/latest/com.google.cloud.documentai.v1beta3.DatasetName` Required. The dataset resource name. Format: projects/{project}/locations/{location}/processors/{processor}/dataset |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.longrunning.OperationFuture.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-document-ai/latest/com.google.cloud.documentai.v1beta3.ImportDocumentsResponse,https://docs.cloud.google.com/java/docs/reference/google-cloud-document-ai/latest/com.google.cloud.documentai.v1beta3.ImportDocumentsMetadata>` |   |

### importDocumentsAsync(ImportDocumentsRequest request)

    public final OperationFuture<ImportDocumentsResponse,ImportDocumentsMetadata> importDocumentsAsync(ImportDocumentsRequest request)

Import documents into a dataset.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (DocumentServiceClient documentServiceClient = DocumentServiceClient.create()) {
       ImportDocumentsRequest request =
           ImportDocumentsRequest.newBuilder()
               .setDataset(DatasetName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString())
               .addAllBatchDocumentsImportConfigs(
                   new ArrayList<ImportDocumentsRequest.BatchDocumentsImportConfig>())
               .build();
       ImportDocumentsResponse response = documentServiceClient.importDocumentsAsync(request).get();
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-document-ai/latest/com.google.cloud.documentai.v1beta3.ImportDocumentsRequest` The request object containing all of the parameters for the API call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.longrunning.OperationFuture.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-document-ai/latest/com.google.cloud.documentai.v1beta3.ImportDocumentsResponse,https://docs.cloud.google.com/java/docs/reference/google-cloud-document-ai/latest/com.google.cloud.documentai.v1beta3.ImportDocumentsMetadata>` |   |

### importDocumentsAsync(String dataset)

    public final OperationFuture<ImportDocumentsResponse,ImportDocumentsMetadata> importDocumentsAsync(String dataset)

Import documents into a dataset.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (DocumentServiceClient documentServiceClient = DocumentServiceClient.create()) {
       String dataset = DatasetName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString();
       ImportDocumentsResponse response = documentServiceClient.importDocumentsAsync(dataset).get();
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `dataset` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` Required. The dataset resource name. Format: projects/{project}/locations/{location}/processors/{processor}/dataset |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.longrunning.OperationFuture.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-document-ai/latest/com.google.cloud.documentai.v1beta3.ImportDocumentsResponse,https://docs.cloud.google.com/java/docs/reference/google-cloud-document-ai/latest/com.google.cloud.documentai.v1beta3.ImportDocumentsMetadata>` |   |

### importDocumentsCallable()

    public final UnaryCallable<ImportDocumentsRequest,Operation> importDocumentsCallable()

Import documents into a dataset.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (DocumentServiceClient documentServiceClient = DocumentServiceClient.create()) {
       ImportDocumentsRequest request =
           ImportDocumentsRequest.newBuilder()
               .setDataset(DatasetName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString())
               .addAllBatchDocumentsImportConfigs(
                   new ArrayList<ImportDocumentsRequest.BatchDocumentsImportConfig>())
               .build();
       ApiFuture<Operation> future =
           documentServiceClient.importDocumentsCallable().futureCall(request);
       // Do something.
       Operation response = future.get();
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.UnaryCallable.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-document-ai/latest/com.google.cloud.documentai.v1beta3.ImportDocumentsRequest,https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.longrunning.Operation.html>` |   |

### importDocumentsOperationCallable()

    public final OperationCallable<ImportDocumentsRequest,ImportDocumentsResponse,ImportDocumentsMetadata> importDocumentsOperationCallable()

Import documents into a dataset.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (DocumentServiceClient documentServiceClient = DocumentServiceClient.create()) {
       ImportDocumentsRequest request =
           ImportDocumentsRequest.newBuilder()
               .setDataset(DatasetName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString())
               .addAllBatchDocumentsImportConfigs(
                   new ArrayList<ImportDocumentsRequest.BatchDocumentsImportConfig>())
               .build();
       OperationFuture<ImportDocumentsResponse, ImportDocumentsMetadata> future =
           documentServiceClient.importDocumentsOperationCallable().futureCall(request);
       // Do something.
       ImportDocumentsResponse response = future.get();
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.OperationCallable.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-document-ai/latest/com.google.cloud.documentai.v1beta3.ImportDocumentsRequest,https://docs.cloud.google.com/java/docs/reference/google-cloud-document-ai/latest/com.google.cloud.documentai.v1beta3.ImportDocumentsResponse,https://docs.cloud.google.com/java/docs/reference/google-cloud-document-ai/latest/com.google.cloud.documentai.v1beta3.ImportDocumentsMetadata>` |   |

### isShutdown()

    public boolean isShutdown()

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |   |

### isTerminated()

    public boolean isTerminated()

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |   |

### listDocuments(DatasetName dataset)

    public final DocumentServiceClient.ListDocumentsPagedResponse listDocuments(DatasetName dataset)

Returns a list of documents present in the dataset.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (DocumentServiceClient documentServiceClient = DocumentServiceClient.create()) {
       DatasetName dataset = DatasetName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]");
       for (DocumentMetadata element : documentServiceClient.listDocuments(dataset).iterateAll()) {
         // doThingsWith(element);
       }
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `dataset` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-document-ai/latest/com.google.cloud.documentai.v1beta3.DatasetName` Required. The resource name of the dataset to be listed. Format: projects/{project}/locations/{location}/processors/{processor}/dataset |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-document-ai/latest/com.google.cloud.documentai.v1beta3.DocumentServiceClient.ListDocumentsPagedResponse` |   |

### listDocuments(ListDocumentsRequest request)

    public final DocumentServiceClient.ListDocumentsPagedResponse listDocuments(ListDocumentsRequest request)

Returns a list of documents present in the dataset.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (DocumentServiceClient documentServiceClient = DocumentServiceClient.create()) {
       ListDocumentsRequest request =
           ListDocumentsRequest.newBuilder()
               .setDataset(DatasetName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString())
               .setPageSize(883849137)
               .setPageToken("pageToken873572522")
               .setFilter("filter-1274492040")
               .setReturnTotalSize(true)
               .setSkip(3532159)
               .build();
       for (DocumentMetadata element : documentServiceClient.listDocuments(request).iterateAll()) {
         // doThingsWith(element);
       }
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-document-ai/latest/com.google.cloud.documentai.v1beta3.ListDocumentsRequest` The request object containing all of the parameters for the API call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-document-ai/latest/com.google.cloud.documentai.v1beta3.DocumentServiceClient.ListDocumentsPagedResponse` |   |

### listDocuments(String dataset)

    public final DocumentServiceClient.ListDocumentsPagedResponse listDocuments(String dataset)

Returns a list of documents present in the dataset.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (DocumentServiceClient documentServiceClient = DocumentServiceClient.create()) {
       String dataset = DatasetName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString();
       for (DocumentMetadata element : documentServiceClient.listDocuments(dataset).iterateAll()) {
         // doThingsWith(element);
       }
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `dataset` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` Required. The resource name of the dataset to be listed. Format: projects/{project}/locations/{location}/processors/{processor}/dataset |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-document-ai/latest/com.google.cloud.documentai.v1beta3.DocumentServiceClient.ListDocumentsPagedResponse` |   |

### listDocumentsCallable()

    public final UnaryCallable<ListDocumentsRequest,ListDocumentsResponse> listDocumentsCallable()

Returns a list of documents present in the dataset.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (DocumentServiceClient documentServiceClient = DocumentServiceClient.create()) {
       ListDocumentsRequest request =
           ListDocumentsRequest.newBuilder()
               .setDataset(DatasetName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString())
               .setPageSize(883849137)
               .setPageToken("pageToken873572522")
               .setFilter("filter-1274492040")
               .setReturnTotalSize(true)
               .setSkip(3532159)
               .build();
       while (true) {
         ListDocumentsResponse response =
             documentServiceClient.listDocumentsCallable().call(request);
         for (DocumentMetadata element : response.getDocumentMetadataList()) {
           // doThingsWith(element);
         }
         String nextPageToken = response.getNextPageToken();
         if (!Strings.isNullOrEmpty(nextPageToken)) {
           request = request.toBuilder().setPageToken(nextPageToken).build();
         } else {
           break;
         }
       }
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.UnaryCallable.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-document-ai/latest/com.google.cloud.documentai.v1beta3.ListDocumentsRequest,https://docs.cloud.google.com/java/docs/reference/google-cloud-document-ai/latest/com.google.cloud.documentai.v1beta3.ListDocumentsResponse>` |   |

### listDocumentsPagedCallable()

    public final UnaryCallable<ListDocumentsRequest,DocumentServiceClient.ListDocumentsPagedResponse> listDocumentsPagedCallable()

Returns a list of documents present in the dataset.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (DocumentServiceClient documentServiceClient = DocumentServiceClient.create()) {
       ListDocumentsRequest request =
           ListDocumentsRequest.newBuilder()
               .setDataset(DatasetName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString())
               .setPageSize(883849137)
               .setPageToken("pageToken873572522")
               .setFilter("filter-1274492040")
               .setReturnTotalSize(true)
               .setSkip(3532159)
               .build();
       ApiFuture<DocumentMetadata> future =
           documentServiceClient.listDocumentsPagedCallable().futureCall(request);
       // Do something.
       for (DocumentMetadata element : future.get().iterateAll()) {
         // doThingsWith(element);
       }
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.UnaryCallable.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-document-ai/latest/com.google.cloud.documentai.v1beta3.ListDocumentsRequest,https://docs.cloud.google.com/java/docs/reference/google-cloud-document-ai/latest/com.google.cloud.documentai.v1beta3.DocumentServiceClient.ListDocumentsPagedResponse>` |   |

### listLocations(ListLocationsRequest request)

    public final DocumentServiceClient.ListLocationsPagedResponse listLocations(ListLocationsRequest request)

Lists information about the supported locations for this service.This method can be called in
two ways:

\* \*\*List all public locations:\*\* Use the path `GET /v1/locations`.\*
\*\*List project-visible locations:\*\* Use the path`GET
/v1/projects/{project_id}/locations`. This may include publiclocations as well as private or
other locations specifically visibleto the project.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (DocumentServiceClient documentServiceClient = DocumentServiceClient.create()) {
       ListLocationsRequest request =
           ListLocationsRequest.newBuilder()
               .setName("name3373707")
               .setFilter("filter-1274492040")
               .setPageSize(883849137)
               .setPageToken("pageToken873572522")
               .build();
       for (Location element : documentServiceClient.listLocations(request).iterateAll()) {
         // doThingsWith(element);
       }
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `request` | `com.google.cloud.location.ListLocationsRequest` The request object containing all of the parameters for the API call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-document-ai/latest/com.google.cloud.documentai.v1beta3.DocumentServiceClient.ListLocationsPagedResponse` |   |

### listLocationsCallable()

    public final UnaryCallable<ListLocationsRequest,ListLocationsResponse> listLocationsCallable()

Lists information about the supported locations for this service.This method can be called in
two ways:

\* \*\*List all public locations:\*\* Use the path `GET /v1/locations`.\*
\*\*List project-visible locations:\*\* Use the path`GET
/v1/projects/{project_id}/locations`. This may include publiclocations as well as private or
other locations specifically visibleto the project.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (DocumentServiceClient documentServiceClient = DocumentServiceClient.create()) {
       ListLocationsRequest request =
           ListLocationsRequest.newBuilder()
               .setName("name3373707")
               .setFilter("filter-1274492040")
               .setPageSize(883849137)
               .setPageToken("pageToken873572522")
               .build();
       while (true) {
         ListLocationsResponse response =
             documentServiceClient.listLocationsCallable().call(request);
         for (Location element : response.getLocationsList()) {
           // doThingsWith(element);
         }
         String nextPageToken = response.getNextPageToken();
         if (!Strings.isNullOrEmpty(nextPageToken)) {
           request = request.toBuilder().setPageToken(nextPageToken).build();
         } else {
           break;
         }
       }
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.UnaryCallable.html<com.google.cloud.location.ListLocationsRequest,com.google.cloud.location.ListLocationsResponse>` |   |

### listLocationsPagedCallable()

    public final UnaryCallable<ListLocationsRequest,DocumentServiceClient.ListLocationsPagedResponse> listLocationsPagedCallable()

Lists information about the supported locations for this service.This method can be called in
two ways:

\* \*\*List all public locations:\*\* Use the path `GET /v1/locations`.\*
\*\*List project-visible locations:\*\* Use the path`GET
/v1/projects/{project_id}/locations`. This may include publiclocations as well as private or
other locations specifically visibleto the project.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (DocumentServiceClient documentServiceClient = DocumentServiceClient.create()) {
       ListLocationsRequest request =
           ListLocationsRequest.newBuilder()
               .setName("name3373707")
               .setFilter("filter-1274492040")
               .setPageSize(883849137)
               .setPageToken("pageToken873572522")
               .build();
       ApiFuture<Location> future =
           documentServiceClient.listLocationsPagedCallable().futureCall(request);
       // Do something.
       for (Location element : future.get().iterateAll()) {
         // doThingsWith(element);
       }
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.UnaryCallable.html<com.google.cloud.location.ListLocationsRequest,https://docs.cloud.google.com/java/docs/reference/google-cloud-document-ai/latest/com.google.cloud.documentai.v1beta3.DocumentServiceClient.ListLocationsPagedResponse>` |   |

### shutdown()

    public void shutdown()

### shutdownNow()

    public void shutdownNow()

### updateDatasetAsync(Dataset dataset, FieldMask updateMask)

    public final OperationFuture<Dataset,UpdateDatasetOperationMetadata> updateDatasetAsync(Dataset dataset, FieldMask updateMask)

Updates metadata associated with a dataset. Note that this method requires the
`documentai.googleapis.com/datasets.update` 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.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (DocumentServiceClient documentServiceClient = DocumentServiceClient.create()) {
       Dataset dataset = Dataset.newBuilder().build();
       FieldMask updateMask = FieldMask.newBuilder().build();
       Dataset response = documentServiceClient.updateDatasetAsync(dataset, updateMask).get();
     }
     
| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `dataset` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-document-ai/latest/com.google.cloud.documentai.v1beta3.Dataset` Required. The `name` field of the `Dataset` is used to identify the resource to be updated. |
| `updateMask` | `https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.FieldMask.html` The update mask applies to the resource. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.longrunning.OperationFuture.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-document-ai/latest/com.google.cloud.documentai.v1beta3.Dataset,https://docs.cloud.google.com/java/docs/reference/google-cloud-document-ai/latest/com.google.cloud.documentai.v1beta3.UpdateDatasetOperationMetadata>` |   |

### updateDatasetAsync(UpdateDatasetRequest request)

    public final OperationFuture<Dataset,UpdateDatasetOperationMetadata> updateDatasetAsync(UpdateDatasetRequest request)

Updates metadata associated with a dataset. Note that this method requires the
`documentai.googleapis.com/datasets.update` 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.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (DocumentServiceClient documentServiceClient = DocumentServiceClient.create()) {
       UpdateDatasetRequest request =
           UpdateDatasetRequest.newBuilder()
               .setDataset(Dataset.newBuilder().build())
               .setUpdateMask(FieldMask.newBuilder().build())
               .build();
       Dataset response = documentServiceClient.updateDatasetAsync(request).get();
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-document-ai/latest/com.google.cloud.documentai.v1beta3.UpdateDatasetRequest` The request object containing all of the parameters for the API call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.longrunning.OperationFuture.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-document-ai/latest/com.google.cloud.documentai.v1beta3.Dataset,https://docs.cloud.google.com/java/docs/reference/google-cloud-document-ai/latest/com.google.cloud.documentai.v1beta3.UpdateDatasetOperationMetadata>` |   |

### updateDatasetCallable()

    public final UnaryCallable<UpdateDatasetRequest,Operation> updateDatasetCallable()

Updates metadata associated with a dataset. Note that this method requires the
`documentai.googleapis.com/datasets.update` 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.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (DocumentServiceClient documentServiceClient = DocumentServiceClient.create()) {
       UpdateDatasetRequest request =
           UpdateDatasetRequest.newBuilder()
               .setDataset(Dataset.newBuilder().build())
               .setUpdateMask(FieldMask.newBuilder().build())
               .build();
       ApiFuture<Operation> future =
           documentServiceClient.updateDatasetCallable().futureCall(request);
       // Do something.
       Operation response = future.get();
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.UnaryCallable.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-document-ai/latest/com.google.cloud.documentai.v1beta3.UpdateDatasetRequest,https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.longrunning.Operation.html>` |   |

### updateDatasetOperationCallable()

    public final OperationCallable<UpdateDatasetRequest,Dataset,UpdateDatasetOperationMetadata> updateDatasetOperationCallable()

Updates metadata associated with a dataset. Note that this method requires the
`documentai.googleapis.com/datasets.update` 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.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (DocumentServiceClient documentServiceClient = DocumentServiceClient.create()) {
       UpdateDatasetRequest request =
           UpdateDatasetRequest.newBuilder()
               .setDataset(Dataset.newBuilder().build())
               .setUpdateMask(FieldMask.newBuilder().build())
               .build();
       OperationFuture<Dataset, UpdateDatasetOperationMetadata> future =
           documentServiceClient.updateDatasetOperationCallable().futureCall(request);
       // Do something.
       Dataset response = future.get();
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.OperationCallable.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-document-ai/latest/com.google.cloud.documentai.v1beta3.UpdateDatasetRequest,https://docs.cloud.google.com/java/docs/reference/google-cloud-document-ai/latest/com.google.cloud.documentai.v1beta3.Dataset,https://docs.cloud.google.com/java/docs/reference/google-cloud-document-ai/latest/com.google.cloud.documentai.v1beta3.UpdateDatasetOperationMetadata>` |   |

### updateDatasetSchema(DatasetSchema datasetSchema, FieldMask updateMask)

    public final DatasetSchema updateDatasetSchema(DatasetSchema datasetSchema, FieldMask updateMask)

Updates a `DatasetSchema`.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (DocumentServiceClient documentServiceClient = DocumentServiceClient.create()) {
       DatasetSchema datasetSchema = DatasetSchema.newBuilder().build();
       FieldMask updateMask = FieldMask.newBuilder().build();
       DatasetSchema response = documentServiceClient.updateDatasetSchema(datasetSchema, updateMask);
     }
     
| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `datasetSchema` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-document-ai/latest/com.google.cloud.documentai.v1beta3.DatasetSchema` Required. The name field of the `DatasetSchema` is used to identify the resource to be updated. |
| `updateMask` | `https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.FieldMask.html` The update mask applies to the resource. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-document-ai/latest/com.google.cloud.documentai.v1beta3.DatasetSchema` |   |

### updateDatasetSchema(UpdateDatasetSchemaRequest request)

    public final DatasetSchema updateDatasetSchema(UpdateDatasetSchemaRequest request)

Updates a `DatasetSchema`.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (DocumentServiceClient documentServiceClient = DocumentServiceClient.create()) {
       UpdateDatasetSchemaRequest request =
           UpdateDatasetSchemaRequest.newBuilder()
               .setDatasetSchema(DatasetSchema.newBuilder().build())
               .setUpdateMask(FieldMask.newBuilder().build())
               .build();
       DatasetSchema response = documentServiceClient.updateDatasetSchema(request);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-document-ai/latest/com.google.cloud.documentai.v1beta3.UpdateDatasetSchemaRequest` The request object containing all of the parameters for the API call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-document-ai/latest/com.google.cloud.documentai.v1beta3.DatasetSchema` |   |

### updateDatasetSchemaCallable()

    public final UnaryCallable<UpdateDatasetSchemaRequest,DatasetSchema> updateDatasetSchemaCallable()

Updates a `DatasetSchema`.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (DocumentServiceClient documentServiceClient = DocumentServiceClient.create()) {
       UpdateDatasetSchemaRequest request =
           UpdateDatasetSchemaRequest.newBuilder()
               .setDatasetSchema(DatasetSchema.newBuilder().build())
               .setUpdateMask(FieldMask.newBuilder().build())
               .build();
       ApiFuture<DatasetSchema> future =
           documentServiceClient.updateDatasetSchemaCallable().futureCall(request);
       // Do something.
       DatasetSchema response = future.get();
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.UnaryCallable.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-document-ai/latest/com.google.cloud.documentai.v1beta3.UpdateDatasetSchemaRequest,https://docs.cloud.google.com/java/docs/reference/google-cloud-document-ai/latest/com.google.cloud.documentai.v1beta3.DatasetSchema>` |   |