@Generated(value="by gapic-generator-java") public class DocumentProcessorServiceClient extends Object implements com.google.api.gax.core.BackgroundResource
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 (DocumentProcessorServiceClient documentProcessorServiceClient =
DocumentProcessorServiceClient.create()) {
ResourceName name = ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]");
ProcessResponse response = documentProcessorServiceClient.processDocument(name);
}
Note: close() needs to be called on the DocumentProcessorServiceClient 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 |
|---|---|---|
ProcessDocument |
Processes a single document. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
BatchProcessDocuments |
LRO endpoint to batch process many documents. The output is written to Cloud Storage as JSON in the [Document] format. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
FetchProcessorTypes |
Fetches processor types. Note that we don't use [ListProcessorTypes][google.cloud.documentai.v1.DocumentProcessorService.ListProcessorTypes] here, because it isn't paginated. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
ListProcessorTypes |
Lists the processor types that exist. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
GetProcessorType |
Gets a processor type detail. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
ListProcessors |
Lists all processors which belong to this project. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
GetProcessor |
Gets a processor detail. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
TrainProcessorVersion |
Trains a new processor version. Operation metadata is returned as [TrainProcessorVersionMetadata][google.cloud.documentai.v1.TrainProcessorVersionMetadata]. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
GetProcessorVersion |
Gets a processor version detail. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
ListProcessorVersions |
Lists all versions of a processor. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
DeleteProcessorVersion |
Deletes the processor version, all artifacts under the processor version will be deleted. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
DeployProcessorVersion |
Deploys the processor version. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
UndeployProcessorVersion |
Undeploys the processor version. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
CreateProcessor |
Creates a processor from the [ProcessorType][google.cloud.documentai.v1.ProcessorType] 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. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
DeleteProcessor |
Deletes the processor, unloads all deployed model artifacts if it was enabled and then deletes all artifacts associated with this processor. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
EnableProcessor |
Enables a processor |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
DisableProcessor |
Disables a processor |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
SetDefaultProcessorVersion |
Set the default (active) version of a [Processor][google.cloud.documentai.v1.Processor] that will be used in [ProcessDocument][google.cloud.documentai.v1.DocumentProcessorService.ProcessDocument] and [BatchProcessDocuments][google.cloud.documentai.v1.DocumentProcessorService.BatchProcessDocuments]. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
ReviewDocument |
Send a document for Human Review. The input document should be processed by the specified processor. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
EvaluateProcessorVersion |
Evaluates a ProcessorVersion against annotated documents, producing an Evaluation. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
GetEvaluation |
Retrieves a specific evaluation. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
ListEvaluations |
Retrieves a set of evaluations for a given processor version. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
ListLocations |
Lists information about the supported locations for this service. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
GetLocation |
Gets information about a location. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
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 DocumentProcessorServiceSettings 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
DocumentProcessorServiceSettings documentProcessorServiceSettings =
DocumentProcessorServiceSettings.newBuilder()
.setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
.build();
DocumentProcessorServiceClient documentProcessorServiceClient =
DocumentProcessorServiceClient.create(documentProcessorServiceSettings);
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
DocumentProcessorServiceSettings documentProcessorServiceSettings =
DocumentProcessorServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
DocumentProcessorServiceClient documentProcessorServiceClient =
DocumentProcessorServiceClient.create(documentProcessorServiceSettings);
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
DocumentProcessorServiceSettings documentProcessorServiceSettings =
DocumentProcessorServiceSettings.newHttpJsonBuilder().build();
DocumentProcessorServiceClient documentProcessorServiceClient =
DocumentProcessorServiceClient.create(documentProcessorServiceSettings);
Please refer to the GitHub repository's samples for more quickstart code snippets.
| Modifier | Constructor and Description |
|---|---|
protected |
DocumentProcessorServiceClient(DocumentProcessorServiceSettings settings)
Constructs an instance of DocumentProcessorServiceClient, using the given settings.
|
protected |
DocumentProcessorServiceClient(DocumentProcessorServiceStub stub) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
awaitTermination(long duration,
TimeUnit unit) |
com.google.api.gax.longrunning.OperationFuture<BatchProcessResponse,BatchProcessMetadata> |
batchProcessDocumentsAsync(BatchProcessRequest request)
LRO endpoint to batch process many documents.
|
com.google.api.gax.longrunning.OperationFuture<BatchProcessResponse,BatchProcessMetadata> |
batchProcessDocumentsAsync(com.google.api.resourcenames.ResourceName name)
LRO endpoint to batch process many documents.
|
com.google.api.gax.longrunning.OperationFuture<BatchProcessResponse,BatchProcessMetadata> |
batchProcessDocumentsAsync(String name)
LRO endpoint to batch process many documents.
|
com.google.api.gax.rpc.UnaryCallable<BatchProcessRequest,com.google.longrunning.Operation> |
batchProcessDocumentsCallable()
LRO endpoint to batch process many documents.
|
com.google.api.gax.rpc.OperationCallable<BatchProcessRequest,BatchProcessResponse,BatchProcessMetadata> |
batchProcessDocumentsOperationCallable()
LRO endpoint to batch process many documents.
|
void |
close() |
static DocumentProcessorServiceClient |
create()
Constructs an instance of DocumentProcessorServiceClient with default settings.
|
static DocumentProcessorServiceClient |
create(DocumentProcessorServiceSettings settings)
Constructs an instance of DocumentProcessorServiceClient, using the given settings.
|
static DocumentProcessorServiceClient |
create(DocumentProcessorServiceStub stub)
Constructs an instance of DocumentProcessorServiceClient, using the given stub for making
calls.
|
Processor |
createProcessor(CreateProcessorRequest request)
Creates a processor from the [ProcessorType][google.cloud.documentai.v1.ProcessorType]
provided.
|
Processor |
createProcessor(LocationName parent,
Processor processor)
Creates a processor from the [ProcessorType][google.cloud.documentai.v1.ProcessorType]
provided.
|
Processor |
createProcessor(String parent,
Processor processor)
Creates a processor from the [ProcessorType][google.cloud.documentai.v1.ProcessorType]
provided.
|
com.google.api.gax.rpc.UnaryCallable<CreateProcessorRequest,Processor> |
createProcessorCallable()
Creates a processor from the [ProcessorType][google.cloud.documentai.v1.ProcessorType]
provided.
|
com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,DeleteProcessorMetadata> |
deleteProcessorAsync(DeleteProcessorRequest request)
Deletes the processor, unloads all deployed model artifacts if it was enabled and then deletes
all artifacts associated with this processor.
|
com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,DeleteProcessorMetadata> |
deleteProcessorAsync(ProcessorName name)
Deletes the processor, unloads all deployed model artifacts if it was enabled and then deletes
all artifacts associated with this processor.
|
com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,DeleteProcessorMetadata> |
deleteProcessorAsync(String name)
Deletes the processor, unloads all deployed model artifacts if it was enabled and then deletes
all artifacts associated with this processor.
|
com.google.api.gax.rpc.UnaryCallable<DeleteProcessorRequest,com.google.longrunning.Operation> |
deleteProcessorCallable()
Deletes the processor, unloads all deployed model artifacts if it was enabled and then deletes
all artifacts associated with this processor.
|
com.google.api.gax.rpc.OperationCallable<DeleteProcessorRequest,com.google.protobuf.Empty,DeleteProcessorMetadata> |
deleteProcessorOperationCallable()
Deletes the processor, unloads all deployed model artifacts if it was enabled and then deletes
all artifacts associated with this processor.
|
com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,DeleteProcessorVersionMetadata> |
deleteProcessorVersionAsync(DeleteProcessorVersionRequest request)
Deletes the processor version, all artifacts under the processor version will be deleted.
|
com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,DeleteProcessorVersionMetadata> |
deleteProcessorVersionAsync(ProcessorVersionName name)
Deletes the processor version, all artifacts under the processor version will be deleted.
|
com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,DeleteProcessorVersionMetadata> |
deleteProcessorVersionAsync(String name)
Deletes the processor version, all artifacts under the processor version will be deleted.
|
com.google.api.gax.rpc.UnaryCallable<DeleteProcessorVersionRequest,com.google.longrunning.Operation> |
deleteProcessorVersionCallable()
Deletes the processor version, all artifacts under the processor version will be deleted.
|
com.google.api.gax.rpc.OperationCallable<DeleteProcessorVersionRequest,com.google.protobuf.Empty,DeleteProcessorVersionMetadata> |
deleteProcessorVersionOperationCallable()
Deletes the processor version, all artifacts under the processor version will be deleted.
|
com.google.api.gax.longrunning.OperationFuture<DeployProcessorVersionResponse,DeployProcessorVersionMetadata> |
deployProcessorVersionAsync(DeployProcessorVersionRequest request)
Deploys the processor version.
|
com.google.api.gax.longrunning.OperationFuture<DeployProcessorVersionResponse,DeployProcessorVersionMetadata> |
deployProcessorVersionAsync(ProcessorVersionName name)
Deploys the processor version.
|
com.google.api.gax.longrunning.OperationFuture<DeployProcessorVersionResponse,DeployProcessorVersionMetadata> |
deployProcessorVersionAsync(String name)
Deploys the processor version.
|
com.google.api.gax.rpc.UnaryCallable<DeployProcessorVersionRequest,com.google.longrunning.Operation> |
deployProcessorVersionCallable()
Deploys the processor version.
|
com.google.api.gax.rpc.OperationCallable<DeployProcessorVersionRequest,DeployProcessorVersionResponse,DeployProcessorVersionMetadata> |
deployProcessorVersionOperationCallable()
Deploys the processor version.
|
com.google.api.gax.longrunning.OperationFuture<DisableProcessorResponse,DisableProcessorMetadata> |
disableProcessorAsync(DisableProcessorRequest request)
Disables a processor
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 (DocumentProcessorServiceClient documentProcessorServiceClient =
DocumentProcessorServiceClient.create()) {
DisableProcessorRequest request =
DisableProcessorRequest.newBuilder()
.setName(ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString())
.build();
DisableProcessorResponse response =
documentProcessorServiceClient.disableProcessorAsync(request).get();
}
|
com.google.api.gax.rpc.UnaryCallable<DisableProcessorRequest,com.google.longrunning.Operation> |
disableProcessorCallable()
Disables a processor
Sample code:
{@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 (DocumentProcessorServiceClient documentProcessorServiceClient =
DocumentProcessorServiceClient.create()) {
DisableProcessorRequest request =
DisableProcessorRequest.newBuilder()
.setName(ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString())
.build();
ApiFuture
|
com.google.api.gax.rpc.OperationCallable<DisableProcessorRequest,DisableProcessorResponse,DisableProcessorMetadata> |
disableProcessorOperationCallable()
Disables a processor
Sample code:
{@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 (DocumentProcessorServiceClient documentProcessorServiceClient =
DocumentProcessorServiceClient.create()) {
DisableProcessorRequest request =
DisableProcessorRequest.newBuilder()
.setName(ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString())
.build();
OperationFuture
|
com.google.api.gax.longrunning.OperationFuture<EnableProcessorResponse,EnableProcessorMetadata> |
enableProcessorAsync(EnableProcessorRequest request)
Enables a processor
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 (DocumentProcessorServiceClient documentProcessorServiceClient =
DocumentProcessorServiceClient.create()) {
EnableProcessorRequest request =
EnableProcessorRequest.newBuilder()
.setName(ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString())
.build();
EnableProcessorResponse response =
documentProcessorServiceClient.enableProcessorAsync(request).get();
}
|
com.google.api.gax.rpc.UnaryCallable<EnableProcessorRequest,com.google.longrunning.Operation> |
enableProcessorCallable()
Enables a processor
Sample code:
{@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 (DocumentProcessorServiceClient documentProcessorServiceClient =
DocumentProcessorServiceClient.create()) {
EnableProcessorRequest request =
EnableProcessorRequest.newBuilder()
.setName(ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString())
.build();
ApiFuture
|
com.google.api.gax.rpc.OperationCallable<EnableProcessorRequest,EnableProcessorResponse,EnableProcessorMetadata> |
enableProcessorOperationCallable()
Enables a processor
Sample code:
{@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 (DocumentProcessorServiceClient documentProcessorServiceClient =
DocumentProcessorServiceClient.create()) {
EnableProcessorRequest request =
EnableProcessorRequest.newBuilder()
.setName(ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString())
.build();
OperationFuture
|
com.google.api.gax.longrunning.OperationFuture<EvaluateProcessorVersionResponse,EvaluateProcessorVersionMetadata> |
evaluateProcessorVersionAsync(EvaluateProcessorVersionRequest request)
Evaluates a ProcessorVersion against annotated documents, producing an Evaluation.
|
com.google.api.gax.longrunning.OperationFuture<EvaluateProcessorVersionResponse,EvaluateProcessorVersionMetadata> |
evaluateProcessorVersionAsync(ProcessorVersionName processorVersion)
Evaluates a ProcessorVersion against annotated documents, producing an Evaluation.
|
com.google.api.gax.longrunning.OperationFuture<EvaluateProcessorVersionResponse,EvaluateProcessorVersionMetadata> |
evaluateProcessorVersionAsync(String processorVersion)
Evaluates a ProcessorVersion against annotated documents, producing an Evaluation.
|
com.google.api.gax.rpc.UnaryCallable<EvaluateProcessorVersionRequest,com.google.longrunning.Operation> |
evaluateProcessorVersionCallable()
Evaluates a ProcessorVersion against annotated documents, producing an Evaluation.
|
com.google.api.gax.rpc.OperationCallable<EvaluateProcessorVersionRequest,EvaluateProcessorVersionResponse,EvaluateProcessorVersionMetadata> |
evaluateProcessorVersionOperationCallable()
Evaluates a ProcessorVersion against annotated documents, producing an Evaluation.
|
FetchProcessorTypesResponse |
fetchProcessorTypes(FetchProcessorTypesRequest request)
Fetches processor types.
|
FetchProcessorTypesResponse |
fetchProcessorTypes(LocationName parent)
Fetches processor types.
|
FetchProcessorTypesResponse |
fetchProcessorTypes(String parent)
Fetches processor types.
|
com.google.api.gax.rpc.UnaryCallable<FetchProcessorTypesRequest,FetchProcessorTypesResponse> |
fetchProcessorTypesCallable()
Fetches processor types.
|
Evaluation |
getEvaluation(EvaluationName name)
Retrieves a specific evaluation.
|
Evaluation |
getEvaluation(GetEvaluationRequest request)
Retrieves a specific evaluation.
|
Evaluation |
getEvaluation(String name)
Retrieves a specific evaluation.
|
com.google.api.gax.rpc.UnaryCallable<GetEvaluationRequest,Evaluation> |
getEvaluationCallable()
Retrieves a specific evaluation.
|
com.google.api.gax.httpjson.longrunning.OperationsClient |
getHttpJsonOperationsClient()
Returns the OperationsClient that can be used to query the status of a long-running operation
returned by another API method call.
|
com.google.cloud.location.Location |
getLocation(com.google.cloud.location.GetLocationRequest request)
Gets information about a location.
|
com.google.api.gax.rpc.UnaryCallable<com.google.cloud.location.GetLocationRequest,com.google.cloud.location.Location> |
getLocationCallable()
Gets information about a location.
|
com.google.longrunning.OperationsClient |
getOperationsClient()
Returns the OperationsClient that can be used to query the status of a long-running operation
returned by another API method call.
|
Processor |
getProcessor(GetProcessorRequest request)
Gets a processor detail.
|
Processor |
getProcessor(ProcessorName name)
Gets a processor detail.
|
Processor |
getProcessor(String name)
Gets a processor detail.
|
com.google.api.gax.rpc.UnaryCallable<GetProcessorRequest,Processor> |
getProcessorCallable()
Gets a processor detail.
|
ProcessorType |
getProcessorType(GetProcessorTypeRequest request)
Gets a processor type detail.
|
ProcessorType |
getProcessorType(ProcessorTypeName name)
Gets a processor type detail.
|
ProcessorType |
getProcessorType(String name)
Gets a processor type detail.
|
com.google.api.gax.rpc.UnaryCallable<GetProcessorTypeRequest,ProcessorType> |
getProcessorTypeCallable()
Gets a processor type detail.
|
ProcessorVersion |
getProcessorVersion(GetProcessorVersionRequest request)
Gets a processor version detail.
|
ProcessorVersion |
getProcessorVersion(ProcessorVersionName name)
Gets a processor version detail.
|
ProcessorVersion |
getProcessorVersion(String name)
Gets a processor version detail.
|
com.google.api.gax.rpc.UnaryCallable<GetProcessorVersionRequest,ProcessorVersion> |
getProcessorVersionCallable()
Gets a processor version detail.
|
DocumentProcessorServiceSettings |
getSettings() |
DocumentProcessorServiceStub |
getStub() |
boolean |
isShutdown() |
boolean |
isTerminated() |
DocumentProcessorServiceClient.ListEvaluationsPagedResponse |
listEvaluations(ListEvaluationsRequest request)
Retrieves a set of evaluations for a given processor version.
|
DocumentProcessorServiceClient.ListEvaluationsPagedResponse |
listEvaluations(ProcessorVersionName parent)
Retrieves a set of evaluations for a given processor version.
|
DocumentProcessorServiceClient.ListEvaluationsPagedResponse |
listEvaluations(String parent)
Retrieves a set of evaluations for a given processor version.
|
com.google.api.gax.rpc.UnaryCallable<ListEvaluationsRequest,ListEvaluationsResponse> |
listEvaluationsCallable()
Retrieves a set of evaluations for a given processor version.
|
com.google.api.gax.rpc.UnaryCallable<ListEvaluationsRequest,DocumentProcessorServiceClient.ListEvaluationsPagedResponse> |
listEvaluationsPagedCallable()
Retrieves a set of evaluations for a given processor version.
|
DocumentProcessorServiceClient.ListLocationsPagedResponse |
listLocations(com.google.cloud.location.ListLocationsRequest request)
Lists information about the supported locations for this service.
|
com.google.api.gax.rpc.UnaryCallable<com.google.cloud.location.ListLocationsRequest,com.google.cloud.location.ListLocationsResponse> |
listLocationsCallable()
Lists information about the supported locations for this service.
|
com.google.api.gax.rpc.UnaryCallable<com.google.cloud.location.ListLocationsRequest,DocumentProcessorServiceClient.ListLocationsPagedResponse> |
listLocationsPagedCallable()
Lists information about the supported locations for this service.
|
DocumentProcessorServiceClient.ListProcessorsPagedResponse |
listProcessors(ListProcessorsRequest request)
Lists all processors which belong to this project.
|
DocumentProcessorServiceClient.ListProcessorsPagedResponse |
listProcessors(LocationName parent)
Lists all processors which belong to this project.
|
DocumentProcessorServiceClient.ListProcessorsPagedResponse |
listProcessors(String parent)
Lists all processors which belong to this project.
|
com.google.api.gax.rpc.UnaryCallable<ListProcessorsRequest,ListProcessorsResponse> |
listProcessorsCallable()
Lists all processors which belong to this project.
|
com.google.api.gax.rpc.UnaryCallable<ListProcessorsRequest,DocumentProcessorServiceClient.ListProcessorsPagedResponse> |
listProcessorsPagedCallable()
Lists all processors which belong to this project.
|
DocumentProcessorServiceClient.ListProcessorTypesPagedResponse |
listProcessorTypes(ListProcessorTypesRequest request)
Lists the processor types that exist.
|
DocumentProcessorServiceClient.ListProcessorTypesPagedResponse |
listProcessorTypes(LocationName parent)
Lists the processor types that exist.
|
DocumentProcessorServiceClient.ListProcessorTypesPagedResponse |
listProcessorTypes(String parent)
Lists the processor types that exist.
|
com.google.api.gax.rpc.UnaryCallable<ListProcessorTypesRequest,ListProcessorTypesResponse> |
listProcessorTypesCallable()
Lists the processor types that exist.
|
com.google.api.gax.rpc.UnaryCallable<ListProcessorTypesRequest,DocumentProcessorServiceClient.ListProcessorTypesPagedResponse> |
listProcessorTypesPagedCallable()
Lists the processor types that exist.
|
DocumentProcessorServiceClient.ListProcessorVersionsPagedResponse |
listProcessorVersions(ListProcessorVersionsRequest request)
Lists all versions of a processor.
|
DocumentProcessorServiceClient.ListProcessorVersionsPagedResponse |
listProcessorVersions(ProcessorName parent)
Lists all versions of a processor.
|
DocumentProcessorServiceClient.ListProcessorVersionsPagedResponse |
listProcessorVersions(String parent)
Lists all versions of a processor.
|
com.google.api.gax.rpc.UnaryCallable<ListProcessorVersionsRequest,ListProcessorVersionsResponse> |
listProcessorVersionsCallable()
Lists all versions of a processor.
|
com.google.api.gax.rpc.UnaryCallable<ListProcessorVersionsRequest,DocumentProcessorServiceClient.ListProcessorVersionsPagedResponse> |
listProcessorVersionsPagedCallable()
Lists all versions of a processor.
|
ProcessResponse |
processDocument(ProcessRequest request)
Processes a single document.
|
ProcessResponse |
processDocument(com.google.api.resourcenames.ResourceName name)
Processes a single document.
|
ProcessResponse |
processDocument(String name)
Processes a single document.
|
com.google.api.gax.rpc.UnaryCallable<ProcessRequest,ProcessResponse> |
processDocumentCallable()
Processes a single document.
|
com.google.api.gax.longrunning.OperationFuture<ReviewDocumentResponse,ReviewDocumentOperationMetadata> |
reviewDocumentAsync(HumanReviewConfigName humanReviewConfig)
Send a document for Human Review.
|
com.google.api.gax.longrunning.OperationFuture<ReviewDocumentResponse,ReviewDocumentOperationMetadata> |
reviewDocumentAsync(ReviewDocumentRequest request)
Send a document for Human Review.
|
com.google.api.gax.longrunning.OperationFuture<ReviewDocumentResponse,ReviewDocumentOperationMetadata> |
reviewDocumentAsync(String humanReviewConfig)
Send a document for Human Review.
|
com.google.api.gax.rpc.UnaryCallable<ReviewDocumentRequest,com.google.longrunning.Operation> |
reviewDocumentCallable()
Send a document for Human Review.
|
com.google.api.gax.rpc.OperationCallable<ReviewDocumentRequest,ReviewDocumentResponse,ReviewDocumentOperationMetadata> |
reviewDocumentOperationCallable()
Send a document for Human Review.
|
com.google.api.gax.longrunning.OperationFuture<SetDefaultProcessorVersionResponse,SetDefaultProcessorVersionMetadata> |
setDefaultProcessorVersionAsync(SetDefaultProcessorVersionRequest request)
Set the default (active) version of a [Processor][google.cloud.documentai.v1.Processor] that
will be used in
[ProcessDocument][google.cloud.documentai.v1.DocumentProcessorService.ProcessDocument] and
[BatchProcessDocuments][google.cloud.documentai.v1.DocumentProcessorService.BatchProcessDocuments].
|
com.google.api.gax.rpc.UnaryCallable<SetDefaultProcessorVersionRequest,com.google.longrunning.Operation> |
setDefaultProcessorVersionCallable()
Set the default (active) version of a [Processor][google.cloud.documentai.v1.Processor] that
will be used in
[ProcessDocument][google.cloud.documentai.v1.DocumentProcessorService.ProcessDocument] and
[BatchProcessDocuments][google.cloud.documentai.v1.DocumentProcessorService.BatchProcessDocuments].
|
com.google.api.gax.rpc.OperationCallable<SetDefaultProcessorVersionRequest,SetDefaultProcessorVersionResponse,SetDefaultProcessorVersionMetadata> |
setDefaultProcessorVersionOperationCallable()
Set the default (active) version of a [Processor][google.cloud.documentai.v1.Processor] that
will be used in
[ProcessDocument][google.cloud.documentai.v1.DocumentProcessorService.ProcessDocument] and
[BatchProcessDocuments][google.cloud.documentai.v1.DocumentProcessorService.BatchProcessDocuments].
|
void |
shutdown() |
void |
shutdownNow() |
com.google.api.gax.longrunning.OperationFuture<TrainProcessorVersionResponse,TrainProcessorVersionMetadata> |
trainProcessorVersionAsync(ProcessorName parent,
ProcessorVersion processorVersion)
Trains a new processor version.
|
com.google.api.gax.longrunning.OperationFuture<TrainProcessorVersionResponse,TrainProcessorVersionMetadata> |
trainProcessorVersionAsync(String parent,
ProcessorVersion processorVersion)
Trains a new processor version.
|
com.google.api.gax.longrunning.OperationFuture<TrainProcessorVersionResponse,TrainProcessorVersionMetadata> |
trainProcessorVersionAsync(TrainProcessorVersionRequest request)
Trains a new processor version.
|
com.google.api.gax.rpc.UnaryCallable<TrainProcessorVersionRequest,com.google.longrunning.Operation> |
trainProcessorVersionCallable()
Trains a new processor version.
|
com.google.api.gax.rpc.OperationCallable<TrainProcessorVersionRequest,TrainProcessorVersionResponse,TrainProcessorVersionMetadata> |
trainProcessorVersionOperationCallable()
Trains a new processor version.
|
com.google.api.gax.longrunning.OperationFuture<UndeployProcessorVersionResponse,UndeployProcessorVersionMetadata> |
undeployProcessorVersionAsync(ProcessorVersionName name)
Undeploys the processor version.
|
com.google.api.gax.longrunning.OperationFuture<UndeployProcessorVersionResponse,UndeployProcessorVersionMetadata> |
undeployProcessorVersionAsync(String name)
Undeploys the processor version.
|
com.google.api.gax.longrunning.OperationFuture<UndeployProcessorVersionResponse,UndeployProcessorVersionMetadata> |
undeployProcessorVersionAsync(UndeployProcessorVersionRequest request)
Undeploys the processor version.
|
com.google.api.gax.rpc.UnaryCallable<UndeployProcessorVersionRequest,com.google.longrunning.Operation> |
undeployProcessorVersionCallable()
Undeploys the processor version.
|
com.google.api.gax.rpc.OperationCallable<UndeployProcessorVersionRequest,UndeployProcessorVersionResponse,UndeployProcessorVersionMetadata> |
undeployProcessorVersionOperationCallable()
Undeploys the processor version.
|
protected DocumentProcessorServiceClient(DocumentProcessorServiceSettings settings) throws IOException
IOExceptionprotected DocumentProcessorServiceClient(DocumentProcessorServiceStub stub)
public static final DocumentProcessorServiceClient create() throws IOException
IOExceptionpublic static final DocumentProcessorServiceClient create(DocumentProcessorServiceSettings settings) throws IOException
IOExceptionpublic static final DocumentProcessorServiceClient create(DocumentProcessorServiceStub stub)
public final DocumentProcessorServiceSettings getSettings()
public DocumentProcessorServiceStub getStub()
public final com.google.longrunning.OperationsClient getOperationsClient()
@BetaApi public final com.google.api.gax.httpjson.longrunning.OperationsClient getHttpJsonOperationsClient()
public final ProcessResponse processDocument(com.google.api.resourcenames.ResourceName name)
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 (DocumentProcessorServiceClient documentProcessorServiceClient =
DocumentProcessorServiceClient.create()) {
ResourceName name = ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]");
ProcessResponse response = documentProcessorServiceClient.processDocument(name);
}
name - Required. The resource name of the
[Processor][google.cloud.documentai.v1.Processor] or
[ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion] to use for processing. If a
[Processor][google.cloud.documentai.v1.Processor] 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}`com.google.api.gax.rpc.ApiException - if the remote call failspublic final ProcessResponse processDocument(String name)
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 (DocumentProcessorServiceClient documentProcessorServiceClient =
DocumentProcessorServiceClient.create()) {
String name =
EvaluationName.of(
"[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]", "[EVALUATION]")
.toString();
ProcessResponse response = documentProcessorServiceClient.processDocument(name);
}
name - Required. The resource name of the
[Processor][google.cloud.documentai.v1.Processor] or
[ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion] to use for processing. If a
[Processor][google.cloud.documentai.v1.Processor] 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}`com.google.api.gax.rpc.ApiException - if the remote call failspublic final ProcessResponse processDocument(ProcessRequest request)
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 (DocumentProcessorServiceClient documentProcessorServiceClient =
DocumentProcessorServiceClient.create()) {
ProcessRequest request =
ProcessRequest.newBuilder()
.setName(ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString())
.setSkipHumanReview(true)
.setFieldMask(FieldMask.newBuilder().build())
.setProcessOptions(ProcessOptions.newBuilder().build())
.putAllLabels(new HashMap<String, String>())
.setImagelessMode(true)
.build();
ProcessResponse response = documentProcessorServiceClient.processDocument(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<ProcessRequest,ProcessResponse> processDocumentCallable()
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 (DocumentProcessorServiceClient documentProcessorServiceClient =
DocumentProcessorServiceClient.create()) {
ProcessRequest request =
ProcessRequest.newBuilder()
.setName(ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString())
.setSkipHumanReview(true)
.setFieldMask(FieldMask.newBuilder().build())
.setProcessOptions(ProcessOptions.newBuilder().build())
.putAllLabels(new HashMap<String, String>())
.setImagelessMode(true)
.build();
ApiFuture<ProcessResponse> future =
documentProcessorServiceClient.processDocumentCallable().futureCall(request);
// Do something.
ProcessResponse response = future.get();
}
public final com.google.api.gax.longrunning.OperationFuture<BatchProcessResponse,BatchProcessMetadata> batchProcessDocumentsAsync(com.google.api.resourcenames.ResourceName name)
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 (DocumentProcessorServiceClient documentProcessorServiceClient =
DocumentProcessorServiceClient.create()) {
ResourceName name = ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]");
BatchProcessResponse response =
documentProcessorServiceClient.batchProcessDocumentsAsync(name).get();
}
name - Required. The resource name of [Processor][google.cloud.documentai.v1.Processor] or
[ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion]. Format:
`projects/{project}/locations/{location}/processors/{processor}`, or
`projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}`com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<BatchProcessResponse,BatchProcessMetadata> batchProcessDocumentsAsync(String name)
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 (DocumentProcessorServiceClient documentProcessorServiceClient =
DocumentProcessorServiceClient.create()) {
String name =
EvaluationName.of(
"[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]", "[EVALUATION]")
.toString();
BatchProcessResponse response =
documentProcessorServiceClient.batchProcessDocumentsAsync(name).get();
}
name - Required. The resource name of [Processor][google.cloud.documentai.v1.Processor] or
[ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion]. Format:
`projects/{project}/locations/{location}/processors/{processor}`, or
`projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}`com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<BatchProcessResponse,BatchProcessMetadata> batchProcessDocumentsAsync(BatchProcessRequest request)
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 (DocumentProcessorServiceClient documentProcessorServiceClient =
DocumentProcessorServiceClient.create()) {
BatchProcessRequest request =
BatchProcessRequest.newBuilder()
.setName(ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString())
.setInputDocuments(BatchDocumentsInputConfig.newBuilder().build())
.setDocumentOutputConfig(DocumentOutputConfig.newBuilder().build())
.setSkipHumanReview(true)
.setProcessOptions(ProcessOptions.newBuilder().build())
.putAllLabels(new HashMap<String, String>())
.build();
BatchProcessResponse response =
documentProcessorServiceClient.batchProcessDocumentsAsync(request).get();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<BatchProcessRequest,BatchProcessResponse,BatchProcessMetadata> batchProcessDocumentsOperationCallable()
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 (DocumentProcessorServiceClient documentProcessorServiceClient =
DocumentProcessorServiceClient.create()) {
BatchProcessRequest request =
BatchProcessRequest.newBuilder()
.setName(ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString())
.setInputDocuments(BatchDocumentsInputConfig.newBuilder().build())
.setDocumentOutputConfig(DocumentOutputConfig.newBuilder().build())
.setSkipHumanReview(true)
.setProcessOptions(ProcessOptions.newBuilder().build())
.putAllLabels(new HashMap<String, String>())
.build();
OperationFuture<BatchProcessResponse, BatchProcessMetadata> future =
documentProcessorServiceClient
.batchProcessDocumentsOperationCallable()
.futureCall(request);
// Do something.
BatchProcessResponse response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<BatchProcessRequest,com.google.longrunning.Operation> batchProcessDocumentsCallable()
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 (DocumentProcessorServiceClient documentProcessorServiceClient =
DocumentProcessorServiceClient.create()) {
BatchProcessRequest request =
BatchProcessRequest.newBuilder()
.setName(ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString())
.setInputDocuments(BatchDocumentsInputConfig.newBuilder().build())
.setDocumentOutputConfig(DocumentOutputConfig.newBuilder().build())
.setSkipHumanReview(true)
.setProcessOptions(ProcessOptions.newBuilder().build())
.putAllLabels(new HashMap<String, String>())
.build();
ApiFuture<Operation> future =
documentProcessorServiceClient.batchProcessDocumentsCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final FetchProcessorTypesResponse fetchProcessorTypes(LocationName parent)
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 (DocumentProcessorServiceClient documentProcessorServiceClient =
DocumentProcessorServiceClient.create()) {
LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
FetchProcessorTypesResponse response =
documentProcessorServiceClient.fetchProcessorTypes(parent);
}
parent - Required. The location of processor types to list. Format:
`projects/{project}/locations/{location}`.com.google.api.gax.rpc.ApiException - if the remote call failspublic final FetchProcessorTypesResponse fetchProcessorTypes(String parent)
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 (DocumentProcessorServiceClient documentProcessorServiceClient =
DocumentProcessorServiceClient.create()) {
String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
FetchProcessorTypesResponse response =
documentProcessorServiceClient.fetchProcessorTypes(parent);
}
parent - Required. The location of processor types to list. Format:
`projects/{project}/locations/{location}`.com.google.api.gax.rpc.ApiException - if the remote call failspublic final FetchProcessorTypesResponse fetchProcessorTypes(FetchProcessorTypesRequest request)
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 (DocumentProcessorServiceClient documentProcessorServiceClient =
DocumentProcessorServiceClient.create()) {
FetchProcessorTypesRequest request =
FetchProcessorTypesRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.build();
FetchProcessorTypesResponse response =
documentProcessorServiceClient.fetchProcessorTypes(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<FetchProcessorTypesRequest,FetchProcessorTypesResponse> fetchProcessorTypesCallable()
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 (DocumentProcessorServiceClient documentProcessorServiceClient =
DocumentProcessorServiceClient.create()) {
FetchProcessorTypesRequest request =
FetchProcessorTypesRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.build();
ApiFuture<FetchProcessorTypesResponse> future =
documentProcessorServiceClient.fetchProcessorTypesCallable().futureCall(request);
// Do something.
FetchProcessorTypesResponse response = future.get();
}
public final DocumentProcessorServiceClient.ListProcessorTypesPagedResponse listProcessorTypes(LocationName parent)
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 (DocumentProcessorServiceClient documentProcessorServiceClient =
DocumentProcessorServiceClient.create()) {
LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
for (ProcessorType element :
documentProcessorServiceClient.listProcessorTypes(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent - Required. The location of processor types to list. Format:
`projects/{project}/locations/{location}`.com.google.api.gax.rpc.ApiException - if the remote call failspublic final DocumentProcessorServiceClient.ListProcessorTypesPagedResponse listProcessorTypes(String parent)
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 (DocumentProcessorServiceClient documentProcessorServiceClient =
DocumentProcessorServiceClient.create()) {
String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
for (ProcessorType element :
documentProcessorServiceClient.listProcessorTypes(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent - Required. The location of processor types to list. Format:
`projects/{project}/locations/{location}`.com.google.api.gax.rpc.ApiException - if the remote call failspublic final DocumentProcessorServiceClient.ListProcessorTypesPagedResponse listProcessorTypes(ListProcessorTypesRequest request)
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 (DocumentProcessorServiceClient documentProcessorServiceClient =
DocumentProcessorServiceClient.create()) {
ListProcessorTypesRequest request =
ListProcessorTypesRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
for (ProcessorType element :
documentProcessorServiceClient.listProcessorTypes(request).iterateAll()) {
// doThingsWith(element);
}
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<ListProcessorTypesRequest,DocumentProcessorServiceClient.ListProcessorTypesPagedResponse> listProcessorTypesPagedCallable()
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 (DocumentProcessorServiceClient documentProcessorServiceClient =
DocumentProcessorServiceClient.create()) {
ListProcessorTypesRequest request =
ListProcessorTypesRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
ApiFuture<ProcessorType> future =
documentProcessorServiceClient.listProcessorTypesPagedCallable().futureCall(request);
// Do something.
for (ProcessorType element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
public final com.google.api.gax.rpc.UnaryCallable<ListProcessorTypesRequest,ListProcessorTypesResponse> listProcessorTypesCallable()
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 (DocumentProcessorServiceClient documentProcessorServiceClient =
DocumentProcessorServiceClient.create()) {
ListProcessorTypesRequest request =
ListProcessorTypesRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
while (true) {
ListProcessorTypesResponse response =
documentProcessorServiceClient.listProcessorTypesCallable().call(request);
for (ProcessorType element : response.getProcessorTypesList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
public final ProcessorType getProcessorType(ProcessorTypeName name)
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 (DocumentProcessorServiceClient documentProcessorServiceClient =
DocumentProcessorServiceClient.create()) {
ProcessorTypeName name = ProcessorTypeName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR_TYPE]");
ProcessorType response = documentProcessorServiceClient.getProcessorType(name);
}
name - Required. The processor type resource name.com.google.api.gax.rpc.ApiException - if the remote call failspublic final ProcessorType getProcessorType(String name)
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 (DocumentProcessorServiceClient documentProcessorServiceClient =
DocumentProcessorServiceClient.create()) {
String name = ProcessorTypeName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR_TYPE]").toString();
ProcessorType response = documentProcessorServiceClient.getProcessorType(name);
}
name - Required. The processor type resource name.com.google.api.gax.rpc.ApiException - if the remote call failspublic final ProcessorType getProcessorType(GetProcessorTypeRequest request)
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 (DocumentProcessorServiceClient documentProcessorServiceClient =
DocumentProcessorServiceClient.create()) {
GetProcessorTypeRequest request =
GetProcessorTypeRequest.newBuilder()
.setName(
ProcessorTypeName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR_TYPE]").toString())
.build();
ProcessorType response = documentProcessorServiceClient.getProcessorType(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<GetProcessorTypeRequest,ProcessorType> getProcessorTypeCallable()
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 (DocumentProcessorServiceClient documentProcessorServiceClient =
DocumentProcessorServiceClient.create()) {
GetProcessorTypeRequest request =
GetProcessorTypeRequest.newBuilder()
.setName(
ProcessorTypeName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR_TYPE]").toString())
.build();
ApiFuture<ProcessorType> future =
documentProcessorServiceClient.getProcessorTypeCallable().futureCall(request);
// Do something.
ProcessorType response = future.get();
}
public final DocumentProcessorServiceClient.ListProcessorsPagedResponse listProcessors(LocationName parent)
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 (DocumentProcessorServiceClient documentProcessorServiceClient =
DocumentProcessorServiceClient.create()) {
LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
for (Processor element : documentProcessorServiceClient.listProcessors(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent - Required. The parent (project and location) which owns this collection of
Processors. Format: `projects/{project}/locations/{location}`com.google.api.gax.rpc.ApiException - if the remote call failspublic final DocumentProcessorServiceClient.ListProcessorsPagedResponse listProcessors(String parent)
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 (DocumentProcessorServiceClient documentProcessorServiceClient =
DocumentProcessorServiceClient.create()) {
String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
for (Processor element : documentProcessorServiceClient.listProcessors(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent - Required. The parent (project and location) which owns this collection of
Processors. Format: `projects/{project}/locations/{location}`com.google.api.gax.rpc.ApiException - if the remote call failspublic final DocumentProcessorServiceClient.ListProcessorsPagedResponse listProcessors(ListProcessorsRequest request)
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 (DocumentProcessorServiceClient documentProcessorServiceClient =
DocumentProcessorServiceClient.create()) {
ListProcessorsRequest request =
ListProcessorsRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
for (Processor element :
documentProcessorServiceClient.listProcessors(request).iterateAll()) {
// doThingsWith(element);
}
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<ListProcessorsRequest,DocumentProcessorServiceClient.ListProcessorsPagedResponse> listProcessorsPagedCallable()
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 (DocumentProcessorServiceClient documentProcessorServiceClient =
DocumentProcessorServiceClient.create()) {
ListProcessorsRequest request =
ListProcessorsRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
ApiFuture<Processor> future =
documentProcessorServiceClient.listProcessorsPagedCallable().futureCall(request);
// Do something.
for (Processor element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
public final com.google.api.gax.rpc.UnaryCallable<ListProcessorsRequest,ListProcessorsResponse> listProcessorsCallable()
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 (DocumentProcessorServiceClient documentProcessorServiceClient =
DocumentProcessorServiceClient.create()) {
ListProcessorsRequest request =
ListProcessorsRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
while (true) {
ListProcessorsResponse response =
documentProcessorServiceClient.listProcessorsCallable().call(request);
for (Processor element : response.getProcessorsList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
public final Processor getProcessor(ProcessorName name)
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 (DocumentProcessorServiceClient documentProcessorServiceClient =
DocumentProcessorServiceClient.create()) {
ProcessorName name = ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]");
Processor response = documentProcessorServiceClient.getProcessor(name);
}
name - Required. The processor resource name.com.google.api.gax.rpc.ApiException - if the remote call failspublic final Processor getProcessor(String name)
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 (DocumentProcessorServiceClient documentProcessorServiceClient =
DocumentProcessorServiceClient.create()) {
String name = ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString();
Processor response = documentProcessorServiceClient.getProcessor(name);
}
name - Required. The processor resource name.com.google.api.gax.rpc.ApiException - if the remote call failspublic final Processor getProcessor(GetProcessorRequest request)
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 (DocumentProcessorServiceClient documentProcessorServiceClient =
DocumentProcessorServiceClient.create()) {
GetProcessorRequest request =
GetProcessorRequest.newBuilder()
.setName(ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString())
.build();
Processor response = documentProcessorServiceClient.getProcessor(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<GetProcessorRequest,Processor> getProcessorCallable()
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 (DocumentProcessorServiceClient documentProcessorServiceClient =
DocumentProcessorServiceClient.create()) {
GetProcessorRequest request =
GetProcessorRequest.newBuilder()
.setName(ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString())
.build();
ApiFuture<Processor> future =
documentProcessorServiceClient.getProcessorCallable().futureCall(request);
// Do something.
Processor response = future.get();
}
public final com.google.api.gax.longrunning.OperationFuture<TrainProcessorVersionResponse,TrainProcessorVersionMetadata> trainProcessorVersionAsync(ProcessorName parent, ProcessorVersion processorVersion)
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 (DocumentProcessorServiceClient documentProcessorServiceClient =
DocumentProcessorServiceClient.create()) {
ProcessorName parent = ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]");
ProcessorVersion processorVersion = ProcessorVersion.newBuilder().build();
TrainProcessorVersionResponse response =
documentProcessorServiceClient.trainProcessorVersionAsync(parent, processorVersion).get();
}
parent - Required. The parent (project, location and processor) to create the new version
for. Format: `projects/{project}/locations/{location}/processors/{processor}`.processorVersion - Required. The processor version to be created.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<TrainProcessorVersionResponse,TrainProcessorVersionMetadata> trainProcessorVersionAsync(String parent, ProcessorVersion processorVersion)
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 (DocumentProcessorServiceClient documentProcessorServiceClient =
DocumentProcessorServiceClient.create()) {
String parent = ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString();
ProcessorVersion processorVersion = ProcessorVersion.newBuilder().build();
TrainProcessorVersionResponse response =
documentProcessorServiceClient.trainProcessorVersionAsync(parent, processorVersion).get();
}
parent - Required. The parent (project, location and processor) to create the new version
for. Format: `projects/{project}/locations/{location}/processors/{processor}`.processorVersion - Required. The processor version to be created.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<TrainProcessorVersionResponse,TrainProcessorVersionMetadata> trainProcessorVersionAsync(TrainProcessorVersionRequest request)
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 (DocumentProcessorServiceClient documentProcessorServiceClient =
DocumentProcessorServiceClient.create()) {
TrainProcessorVersionRequest request =
TrainProcessorVersionRequest.newBuilder()
.setParent(ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString())
.setProcessorVersion(ProcessorVersion.newBuilder().build())
.setDocumentSchema(DocumentSchema.newBuilder().build())
.setInputData(TrainProcessorVersionRequest.InputData.newBuilder().build())
.setBaseProcessorVersion("baseProcessorVersion337709271")
.build();
TrainProcessorVersionResponse response =
documentProcessorServiceClient.trainProcessorVersionAsync(request).get();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<TrainProcessorVersionRequest,TrainProcessorVersionResponse,TrainProcessorVersionMetadata> trainProcessorVersionOperationCallable()
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 (DocumentProcessorServiceClient documentProcessorServiceClient =
DocumentProcessorServiceClient.create()) {
TrainProcessorVersionRequest request =
TrainProcessorVersionRequest.newBuilder()
.setParent(ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString())
.setProcessorVersion(ProcessorVersion.newBuilder().build())
.setDocumentSchema(DocumentSchema.newBuilder().build())
.setInputData(TrainProcessorVersionRequest.InputData.newBuilder().build())
.setBaseProcessorVersion("baseProcessorVersion337709271")
.build();
OperationFuture<TrainProcessorVersionResponse, TrainProcessorVersionMetadata> future =
documentProcessorServiceClient
.trainProcessorVersionOperationCallable()
.futureCall(request);
// Do something.
TrainProcessorVersionResponse response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<TrainProcessorVersionRequest,com.google.longrunning.Operation> trainProcessorVersionCallable()
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 (DocumentProcessorServiceClient documentProcessorServiceClient =
DocumentProcessorServiceClient.create()) {
TrainProcessorVersionRequest request =
TrainProcessorVersionRequest.newBuilder()
.setParent(ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString())
.setProcessorVersion(ProcessorVersion.newBuilder().build())
.setDocumentSchema(DocumentSchema.newBuilder().build())
.setInputData(TrainProcessorVersionRequest.InputData.newBuilder().build())
.setBaseProcessorVersion("baseProcessorVersion337709271")
.build();
ApiFuture<Operation> future =
documentProcessorServiceClient.trainProcessorVersionCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final ProcessorVersion getProcessorVersion(ProcessorVersionName name)
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 (DocumentProcessorServiceClient documentProcessorServiceClient =
DocumentProcessorServiceClient.create()) {
ProcessorVersionName name =
ProcessorVersionName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]");
ProcessorVersion response = documentProcessorServiceClient.getProcessorVersion(name);
}
name - Required. The processor resource name.com.google.api.gax.rpc.ApiException - if the remote call failspublic final ProcessorVersion getProcessorVersion(String name)
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 (DocumentProcessorServiceClient documentProcessorServiceClient =
DocumentProcessorServiceClient.create()) {
String name =
ProcessorVersionName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]")
.toString();
ProcessorVersion response = documentProcessorServiceClient.getProcessorVersion(name);
}
name - Required. The processor resource name.com.google.api.gax.rpc.ApiException - if the remote call failspublic final ProcessorVersion getProcessorVersion(GetProcessorVersionRequest request)
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 (DocumentProcessorServiceClient documentProcessorServiceClient =
DocumentProcessorServiceClient.create()) {
GetProcessorVersionRequest request =
GetProcessorVersionRequest.newBuilder()
.setName(
ProcessorVersionName.of(
"[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]")
.toString())
.build();
ProcessorVersion response = documentProcessorServiceClient.getProcessorVersion(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<GetProcessorVersionRequest,ProcessorVersion> getProcessorVersionCallable()
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 (DocumentProcessorServiceClient documentProcessorServiceClient =
DocumentProcessorServiceClient.create()) {
GetProcessorVersionRequest request =
GetProcessorVersionRequest.newBuilder()
.setName(
ProcessorVersionName.of(
"[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]")
.toString())
.build();
ApiFuture<ProcessorVersion> future =
documentProcessorServiceClient.getProcessorVersionCallable().futureCall(request);
// Do something.
ProcessorVersion response = future.get();
}
public final DocumentProcessorServiceClient.ListProcessorVersionsPagedResponse listProcessorVersions(ProcessorName parent)
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 (DocumentProcessorServiceClient documentProcessorServiceClient =
DocumentProcessorServiceClient.create()) {
ProcessorName parent = ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]");
for (ProcessorVersion element :
documentProcessorServiceClient.listProcessorVersions(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent - Required. The parent (project, location and processor) to list all versions.
Format: `projects/{project}/locations/{location}/processors/{processor}`com.google.api.gax.rpc.ApiException - if the remote call failspublic final DocumentProcessorServiceClient.ListProcessorVersionsPagedResponse listProcessorVersions(String parent)
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 (DocumentProcessorServiceClient documentProcessorServiceClient =
DocumentProcessorServiceClient.create()) {
String parent = ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString();
for (ProcessorVersion element :
documentProcessorServiceClient.listProcessorVersions(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent - Required. The parent (project, location and processor) to list all versions.
Format: `projects/{project}/locations/{location}/processors/{processor}`com.google.api.gax.rpc.ApiException - if the remote call failspublic final DocumentProcessorServiceClient.ListProcessorVersionsPagedResponse listProcessorVersions(ListProcessorVersionsRequest request)
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 (DocumentProcessorServiceClient documentProcessorServiceClient =
DocumentProcessorServiceClient.create()) {
ListProcessorVersionsRequest request =
ListProcessorVersionsRequest.newBuilder()
.setParent(ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
for (ProcessorVersion element :
documentProcessorServiceClient.listProcessorVersions(request).iterateAll()) {
// doThingsWith(element);
}
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<ListProcessorVersionsRequest,DocumentProcessorServiceClient.ListProcessorVersionsPagedResponse> listProcessorVersionsPagedCallable()
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 (DocumentProcessorServiceClient documentProcessorServiceClient =
DocumentProcessorServiceClient.create()) {
ListProcessorVersionsRequest request =
ListProcessorVersionsRequest.newBuilder()
.setParent(ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
ApiFuture<ProcessorVersion> future =
documentProcessorServiceClient.listProcessorVersionsPagedCallable().futureCall(request);
// Do something.
for (ProcessorVersion element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
public final com.google.api.gax.rpc.UnaryCallable<ListProcessorVersionsRequest,ListProcessorVersionsResponse> listProcessorVersionsCallable()
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 (DocumentProcessorServiceClient documentProcessorServiceClient =
DocumentProcessorServiceClient.create()) {
ListProcessorVersionsRequest request =
ListProcessorVersionsRequest.newBuilder()
.setParent(ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
while (true) {
ListProcessorVersionsResponse response =
documentProcessorServiceClient.listProcessorVersionsCallable().call(request);
for (ProcessorVersion element : response.getProcessorVersionsList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
public final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,DeleteProcessorVersionMetadata> deleteProcessorVersionAsync(ProcessorVersionName name)
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 (DocumentProcessorServiceClient documentProcessorServiceClient =
DocumentProcessorServiceClient.create()) {
ProcessorVersionName name =
ProcessorVersionName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]");
documentProcessorServiceClient.deleteProcessorVersionAsync(name).get();
}
name - Required. The processor version resource name to be deleted.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,DeleteProcessorVersionMetadata> deleteProcessorVersionAsync(String name)
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 (DocumentProcessorServiceClient documentProcessorServiceClient =
DocumentProcessorServiceClient.create()) {
String name =
ProcessorVersionName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]")
.toString();
documentProcessorServiceClient.deleteProcessorVersionAsync(name).get();
}
name - Required. The processor version resource name to be deleted.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,DeleteProcessorVersionMetadata> deleteProcessorVersionAsync(DeleteProcessorVersionRequest request)
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 (DocumentProcessorServiceClient documentProcessorServiceClient =
DocumentProcessorServiceClient.create()) {
DeleteProcessorVersionRequest request =
DeleteProcessorVersionRequest.newBuilder()
.setName(
ProcessorVersionName.of(
"[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]")
.toString())
.build();
documentProcessorServiceClient.deleteProcessorVersionAsync(request).get();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<DeleteProcessorVersionRequest,com.google.protobuf.Empty,DeleteProcessorVersionMetadata> deleteProcessorVersionOperationCallable()
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 (DocumentProcessorServiceClient documentProcessorServiceClient =
DocumentProcessorServiceClient.create()) {
DeleteProcessorVersionRequest request =
DeleteProcessorVersionRequest.newBuilder()
.setName(
ProcessorVersionName.of(
"[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]")
.toString())
.build();
OperationFuture<Empty, DeleteProcessorVersionMetadata> future =
documentProcessorServiceClient
.deleteProcessorVersionOperationCallable()
.futureCall(request);
// Do something.
future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<DeleteProcessorVersionRequest,com.google.longrunning.Operation> deleteProcessorVersionCallable()
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 (DocumentProcessorServiceClient documentProcessorServiceClient =
DocumentProcessorServiceClient.create()) {
DeleteProcessorVersionRequest request =
DeleteProcessorVersionRequest.newBuilder()
.setName(
ProcessorVersionName.of(
"[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]")
.toString())
.build();
ApiFuture<Operation> future =
documentProcessorServiceClient.deleteProcessorVersionCallable().futureCall(request);
// Do something.
future.get();
}
public final com.google.api.gax.longrunning.OperationFuture<DeployProcessorVersionResponse,DeployProcessorVersionMetadata> deployProcessorVersionAsync(ProcessorVersionName name)
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 (DocumentProcessorServiceClient documentProcessorServiceClient =
DocumentProcessorServiceClient.create()) {
ProcessorVersionName name =
ProcessorVersionName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]");
DeployProcessorVersionResponse response =
documentProcessorServiceClient.deployProcessorVersionAsync(name).get();
}
name - Required. The processor version resource name to be deployed.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<DeployProcessorVersionResponse,DeployProcessorVersionMetadata> deployProcessorVersionAsync(String name)
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 (DocumentProcessorServiceClient documentProcessorServiceClient =
DocumentProcessorServiceClient.create()) {
String name =
ProcessorVersionName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]")
.toString();
DeployProcessorVersionResponse response =
documentProcessorServiceClient.deployProcessorVersionAsync(name).get();
}
name - Required. The processor version resource name to be deployed.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<DeployProcessorVersionResponse,DeployProcessorVersionMetadata> deployProcessorVersionAsync(DeployProcessorVersionRequest request)
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 (DocumentProcessorServiceClient documentProcessorServiceClient =
DocumentProcessorServiceClient.create()) {
DeployProcessorVersionRequest request =
DeployProcessorVersionRequest.newBuilder()
.setName(
ProcessorVersionName.of(
"[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]")
.toString())
.build();
DeployProcessorVersionResponse response =
documentProcessorServiceClient.deployProcessorVersionAsync(request).get();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<DeployProcessorVersionRequest,DeployProcessorVersionResponse,DeployProcessorVersionMetadata> deployProcessorVersionOperationCallable()
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 (DocumentProcessorServiceClient documentProcessorServiceClient =
DocumentProcessorServiceClient.create()) {
DeployProcessorVersionRequest request =
DeployProcessorVersionRequest.newBuilder()
.setName(
ProcessorVersionName.of(
"[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]")
.toString())
.build();
OperationFuture<DeployProcessorVersionResponse, DeployProcessorVersionMetadata> future =
documentProcessorServiceClient
.deployProcessorVersionOperationCallable()
.futureCall(request);
// Do something.
DeployProcessorVersionResponse response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<DeployProcessorVersionRequest,com.google.longrunning.Operation> deployProcessorVersionCallable()
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 (DocumentProcessorServiceClient documentProcessorServiceClient =
DocumentProcessorServiceClient.create()) {
DeployProcessorVersionRequest request =
DeployProcessorVersionRequest.newBuilder()
.setName(
ProcessorVersionName.of(
"[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]")
.toString())
.build();
ApiFuture<Operation> future =
documentProcessorServiceClient.deployProcessorVersionCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.longrunning.OperationFuture<UndeployProcessorVersionResponse,UndeployProcessorVersionMetadata> undeployProcessorVersionAsync(ProcessorVersionName name)
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 (DocumentProcessorServiceClient documentProcessorServiceClient =
DocumentProcessorServiceClient.create()) {
ProcessorVersionName name =
ProcessorVersionName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]");
UndeployProcessorVersionResponse response =
documentProcessorServiceClient.undeployProcessorVersionAsync(name).get();
}
name - Required. The processor version resource name to be undeployed.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<UndeployProcessorVersionResponse,UndeployProcessorVersionMetadata> undeployProcessorVersionAsync(String name)
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 (DocumentProcessorServiceClient documentProcessorServiceClient =
DocumentProcessorServiceClient.create()) {
String name =
ProcessorVersionName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]")
.toString();
UndeployProcessorVersionResponse response =
documentProcessorServiceClient.undeployProcessorVersionAsync(name).get();
}
name - Required. The processor version resource name to be undeployed.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<UndeployProcessorVersionResponse,UndeployProcessorVersionMetadata> undeployProcessorVersionAsync(UndeployProcessorVersionRequest request)
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 (DocumentProcessorServiceClient documentProcessorServiceClient =
DocumentProcessorServiceClient.create()) {
UndeployProcessorVersionRequest request =
UndeployProcessorVersionRequest.newBuilder()
.setName(
ProcessorVersionName.of(
"[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]")
.toString())
.build();
UndeployProcessorVersionResponse response =
documentProcessorServiceClient.undeployProcessorVersionAsync(request).get();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<UndeployProcessorVersionRequest,UndeployProcessorVersionResponse,UndeployProcessorVersionMetadata> undeployProcessorVersionOperationCallable()
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 (DocumentProcessorServiceClient documentProcessorServiceClient =
DocumentProcessorServiceClient.create()) {
UndeployProcessorVersionRequest request =
UndeployProcessorVersionRequest.newBuilder()
.setName(
ProcessorVersionName.of(
"[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]")
.toString())
.build();
OperationFuture<UndeployProcessorVersionResponse, UndeployProcessorVersionMetadata> future =
documentProcessorServiceClient
.undeployProcessorVersionOperationCallable()
.futureCall(request);
// Do something.
UndeployProcessorVersionResponse response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<UndeployProcessorVersionRequest,com.google.longrunning.Operation> undeployProcessorVersionCallable()
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 (DocumentProcessorServiceClient documentProcessorServiceClient =
DocumentProcessorServiceClient.create()) {
UndeployProcessorVersionRequest request =
UndeployProcessorVersionRequest.newBuilder()
.setName(
ProcessorVersionName.of(
"[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]")
.toString())
.build();
ApiFuture<Operation> future =
documentProcessorServiceClient.undeployProcessorVersionCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final Processor createProcessor(LocationName parent, Processor processor)
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 (DocumentProcessorServiceClient documentProcessorServiceClient =
DocumentProcessorServiceClient.create()) {
LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
Processor processor = Processor.newBuilder().build();
Processor response = documentProcessorServiceClient.createProcessor(parent, processor);
}
parent - Required. The parent (project and location) under which to create the processor.
Format: `projects/{project}/locations/{location}`processor - Required. The processor to be created, requires
[Processor.type][google.cloud.documentai.v1.Processor.type] and
[Processor.display_name][google.cloud.documentai.v1.Processor.display_name] to be set.
Also, the [Processor.kms_key_name][google.cloud.documentai.v1.Processor.kms_key_name] field
must be set if the processor is under CMEK.com.google.api.gax.rpc.ApiException - if the remote call failspublic final Processor createProcessor(String parent, Processor processor)
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 (DocumentProcessorServiceClient documentProcessorServiceClient =
DocumentProcessorServiceClient.create()) {
String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
Processor processor = Processor.newBuilder().build();
Processor response = documentProcessorServiceClient.createProcessor(parent, processor);
}
parent - Required. The parent (project and location) under which to create the processor.
Format: `projects/{project}/locations/{location}`processor - Required. The processor to be created, requires
[Processor.type][google.cloud.documentai.v1.Processor.type] and
[Processor.display_name][google.cloud.documentai.v1.Processor.display_name] to be set.
Also, the [Processor.kms_key_name][google.cloud.documentai.v1.Processor.kms_key_name] field
must be set if the processor is under CMEK.com.google.api.gax.rpc.ApiException - if the remote call failspublic final Processor createProcessor(CreateProcessorRequest request)
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 (DocumentProcessorServiceClient documentProcessorServiceClient =
DocumentProcessorServiceClient.create()) {
CreateProcessorRequest request =
CreateProcessorRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setProcessor(Processor.newBuilder().build())
.build();
Processor response = documentProcessorServiceClient.createProcessor(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<CreateProcessorRequest,Processor> createProcessorCallable()
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 (DocumentProcessorServiceClient documentProcessorServiceClient =
DocumentProcessorServiceClient.create()) {
CreateProcessorRequest request =
CreateProcessorRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setProcessor(Processor.newBuilder().build())
.build();
ApiFuture<Processor> future =
documentProcessorServiceClient.createProcessorCallable().futureCall(request);
// Do something.
Processor response = future.get();
}
public final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,DeleteProcessorMetadata> deleteProcessorAsync(ProcessorName name)
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 (DocumentProcessorServiceClient documentProcessorServiceClient =
DocumentProcessorServiceClient.create()) {
ProcessorName name = ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]");
documentProcessorServiceClient.deleteProcessorAsync(name).get();
}
name - Required. The processor resource name to be deleted.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,DeleteProcessorMetadata> deleteProcessorAsync(String name)
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 (DocumentProcessorServiceClient documentProcessorServiceClient =
DocumentProcessorServiceClient.create()) {
String name = ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString();
documentProcessorServiceClient.deleteProcessorAsync(name).get();
}
name - Required. The processor resource name to be deleted.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,DeleteProcessorMetadata> deleteProcessorAsync(DeleteProcessorRequest request)
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 (DocumentProcessorServiceClient documentProcessorServiceClient =
DocumentProcessorServiceClient.create()) {
DeleteProcessorRequest request =
DeleteProcessorRequest.newBuilder()
.setName(ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString())
.build();
documentProcessorServiceClient.deleteProcessorAsync(request).get();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<DeleteProcessorRequest,com.google.protobuf.Empty,DeleteProcessorMetadata> deleteProcessorOperationCallable()
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 (DocumentProcessorServiceClient documentProcessorServiceClient =
DocumentProcessorServiceClient.create()) {
DeleteProcessorRequest request =
DeleteProcessorRequest.newBuilder()
.setName(ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString())
.build();
OperationFuture<Empty, DeleteProcessorMetadata> future =
documentProcessorServiceClient.deleteProcessorOperationCallable().futureCall(request);
// Do something.
future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<DeleteProcessorRequest,com.google.longrunning.Operation> deleteProcessorCallable()
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 (DocumentProcessorServiceClient documentProcessorServiceClient =
DocumentProcessorServiceClient.create()) {
DeleteProcessorRequest request =
DeleteProcessorRequest.newBuilder()
.setName(ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString())
.build();
ApiFuture<Operation> future =
documentProcessorServiceClient.deleteProcessorCallable().futureCall(request);
// Do something.
future.get();
}
public final com.google.api.gax.longrunning.OperationFuture<EnableProcessorResponse,EnableProcessorMetadata> enableProcessorAsync(EnableProcessorRequest request)
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 (DocumentProcessorServiceClient documentProcessorServiceClient =
DocumentProcessorServiceClient.create()) {
EnableProcessorRequest request =
EnableProcessorRequest.newBuilder()
.setName(ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString())
.build();
EnableProcessorResponse response =
documentProcessorServiceClient.enableProcessorAsync(request).get();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<EnableProcessorRequest,EnableProcessorResponse,EnableProcessorMetadata> enableProcessorOperationCallable()
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 (DocumentProcessorServiceClient documentProcessorServiceClient =
DocumentProcessorServiceClient.create()) {
EnableProcessorRequest request =
EnableProcessorRequest.newBuilder()
.setName(ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString())
.build();
OperationFuture<EnableProcessorResponse, EnableProcessorMetadata> future =
documentProcessorServiceClient.enableProcessorOperationCallable().futureCall(request);
// Do something.
EnableProcessorResponse response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<EnableProcessorRequest,com.google.longrunning.Operation> enableProcessorCallable()
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 (DocumentProcessorServiceClient documentProcessorServiceClient =
DocumentProcessorServiceClient.create()) {
EnableProcessorRequest request =
EnableProcessorRequest.newBuilder()
.setName(ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString())
.build();
ApiFuture<Operation> future =
documentProcessorServiceClient.enableProcessorCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.longrunning.OperationFuture<DisableProcessorResponse,DisableProcessorMetadata> disableProcessorAsync(DisableProcessorRequest request)
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 (DocumentProcessorServiceClient documentProcessorServiceClient =
DocumentProcessorServiceClient.create()) {
DisableProcessorRequest request =
DisableProcessorRequest.newBuilder()
.setName(ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString())
.build();
DisableProcessorResponse response =
documentProcessorServiceClient.disableProcessorAsync(request).get();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<DisableProcessorRequest,DisableProcessorResponse,DisableProcessorMetadata> disableProcessorOperationCallable()
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 (DocumentProcessorServiceClient documentProcessorServiceClient =
DocumentProcessorServiceClient.create()) {
DisableProcessorRequest request =
DisableProcessorRequest.newBuilder()
.setName(ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString())
.build();
OperationFuture<DisableProcessorResponse, DisableProcessorMetadata> future =
documentProcessorServiceClient.disableProcessorOperationCallable().futureCall(request);
// Do something.
DisableProcessorResponse response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<DisableProcessorRequest,com.google.longrunning.Operation> disableProcessorCallable()
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 (DocumentProcessorServiceClient documentProcessorServiceClient =
DocumentProcessorServiceClient.create()) {
DisableProcessorRequest request =
DisableProcessorRequest.newBuilder()
.setName(ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString())
.build();
ApiFuture<Operation> future =
documentProcessorServiceClient.disableProcessorCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.longrunning.OperationFuture<SetDefaultProcessorVersionResponse,SetDefaultProcessorVersionMetadata> setDefaultProcessorVersionAsync(SetDefaultProcessorVersionRequest request)
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 (DocumentProcessorServiceClient documentProcessorServiceClient =
DocumentProcessorServiceClient.create()) {
SetDefaultProcessorVersionRequest request =
SetDefaultProcessorVersionRequest.newBuilder()
.setProcessor(ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString())
.setDefaultProcessorVersion(
ProcessorVersionName.of(
"[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]")
.toString())
.build();
SetDefaultProcessorVersionResponse response =
documentProcessorServiceClient.setDefaultProcessorVersionAsync(request).get();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<SetDefaultProcessorVersionRequest,SetDefaultProcessorVersionResponse,SetDefaultProcessorVersionMetadata> setDefaultProcessorVersionOperationCallable()
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 (DocumentProcessorServiceClient documentProcessorServiceClient =
DocumentProcessorServiceClient.create()) {
SetDefaultProcessorVersionRequest request =
SetDefaultProcessorVersionRequest.newBuilder()
.setProcessor(ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString())
.setDefaultProcessorVersion(
ProcessorVersionName.of(
"[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]")
.toString())
.build();
OperationFuture<SetDefaultProcessorVersionResponse, SetDefaultProcessorVersionMetadata>
future =
documentProcessorServiceClient
.setDefaultProcessorVersionOperationCallable()
.futureCall(request);
// Do something.
SetDefaultProcessorVersionResponse response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<SetDefaultProcessorVersionRequest,com.google.longrunning.Operation> setDefaultProcessorVersionCallable()
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 (DocumentProcessorServiceClient documentProcessorServiceClient =
DocumentProcessorServiceClient.create()) {
SetDefaultProcessorVersionRequest request =
SetDefaultProcessorVersionRequest.newBuilder()
.setProcessor(ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString())
.setDefaultProcessorVersion(
ProcessorVersionName.of(
"[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]")
.toString())
.build();
ApiFuture<Operation> future =
documentProcessorServiceClient.setDefaultProcessorVersionCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.longrunning.OperationFuture<ReviewDocumentResponse,ReviewDocumentOperationMetadata> reviewDocumentAsync(HumanReviewConfigName humanReviewConfig)
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 (DocumentProcessorServiceClient documentProcessorServiceClient =
DocumentProcessorServiceClient.create()) {
HumanReviewConfigName humanReviewConfig =
HumanReviewConfigName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]");
ReviewDocumentResponse response =
documentProcessorServiceClient.reviewDocumentAsync(humanReviewConfig).get();
}
humanReviewConfig - Required. The resource name of the
[HumanReviewConfig][google.cloud.documentai.v1.HumanReviewConfig] that the document will be
reviewed with.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<ReviewDocumentResponse,ReviewDocumentOperationMetadata> reviewDocumentAsync(String humanReviewConfig)
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 (DocumentProcessorServiceClient documentProcessorServiceClient =
DocumentProcessorServiceClient.create()) {
String humanReviewConfig =
HumanReviewConfigName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString();
ReviewDocumentResponse response =
documentProcessorServiceClient.reviewDocumentAsync(humanReviewConfig).get();
}
humanReviewConfig - Required. The resource name of the
[HumanReviewConfig][google.cloud.documentai.v1.HumanReviewConfig] that the document will be
reviewed with.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<ReviewDocumentResponse,ReviewDocumentOperationMetadata> reviewDocumentAsync(ReviewDocumentRequest request)
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 (DocumentProcessorServiceClient documentProcessorServiceClient =
DocumentProcessorServiceClient.create()) {
ReviewDocumentRequest request =
ReviewDocumentRequest.newBuilder()
.setHumanReviewConfig(
HumanReviewConfigName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString())
.setEnableSchemaValidation(true)
.setDocumentSchema(DocumentSchema.newBuilder().build())
.build();
ReviewDocumentResponse response =
documentProcessorServiceClient.reviewDocumentAsync(request).get();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<ReviewDocumentRequest,ReviewDocumentResponse,ReviewDocumentOperationMetadata> reviewDocumentOperationCallable()
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 (DocumentProcessorServiceClient documentProcessorServiceClient =
DocumentProcessorServiceClient.create()) {
ReviewDocumentRequest request =
ReviewDocumentRequest.newBuilder()
.setHumanReviewConfig(
HumanReviewConfigName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString())
.setEnableSchemaValidation(true)
.setDocumentSchema(DocumentSchema.newBuilder().build())
.build();
OperationFuture<ReviewDocumentResponse, ReviewDocumentOperationMetadata> future =
documentProcessorServiceClient.reviewDocumentOperationCallable().futureCall(request);
// Do something.
ReviewDocumentResponse response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<ReviewDocumentRequest,com.google.longrunning.Operation> reviewDocumentCallable()
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 (DocumentProcessorServiceClient documentProcessorServiceClient =
DocumentProcessorServiceClient.create()) {
ReviewDocumentRequest request =
ReviewDocumentRequest.newBuilder()
.setHumanReviewConfig(
HumanReviewConfigName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString())
.setEnableSchemaValidation(true)
.setDocumentSchema(DocumentSchema.newBuilder().build())
.build();
ApiFuture<Operation> future =
documentProcessorServiceClient.reviewDocumentCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.longrunning.OperationFuture<EvaluateProcessorVersionResponse,EvaluateProcessorVersionMetadata> evaluateProcessorVersionAsync(ProcessorVersionName processorVersion)
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 (DocumentProcessorServiceClient documentProcessorServiceClient =
DocumentProcessorServiceClient.create()) {
ProcessorVersionName processorVersion =
ProcessorVersionName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]");
EvaluateProcessorVersionResponse response =
documentProcessorServiceClient.evaluateProcessorVersionAsync(processorVersion).get();
}
processorVersion - Required. The resource name of the
[ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion] to evaluate.
`projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}`com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<EvaluateProcessorVersionResponse,EvaluateProcessorVersionMetadata> evaluateProcessorVersionAsync(String processorVersion)
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 (DocumentProcessorServiceClient documentProcessorServiceClient =
DocumentProcessorServiceClient.create()) {
String processorVersion =
ProcessorVersionName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]")
.toString();
EvaluateProcessorVersionResponse response =
documentProcessorServiceClient.evaluateProcessorVersionAsync(processorVersion).get();
}
processorVersion - Required. The resource name of the
[ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion] to evaluate.
`projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}`com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<EvaluateProcessorVersionResponse,EvaluateProcessorVersionMetadata> evaluateProcessorVersionAsync(EvaluateProcessorVersionRequest request)
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 (DocumentProcessorServiceClient documentProcessorServiceClient =
DocumentProcessorServiceClient.create()) {
EvaluateProcessorVersionRequest request =
EvaluateProcessorVersionRequest.newBuilder()
.setProcessorVersion(
ProcessorVersionName.of(
"[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]")
.toString())
.setEvaluationDocuments(BatchDocumentsInputConfig.newBuilder().build())
.build();
EvaluateProcessorVersionResponse response =
documentProcessorServiceClient.evaluateProcessorVersionAsync(request).get();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<EvaluateProcessorVersionRequest,EvaluateProcessorVersionResponse,EvaluateProcessorVersionMetadata> evaluateProcessorVersionOperationCallable()
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 (DocumentProcessorServiceClient documentProcessorServiceClient =
DocumentProcessorServiceClient.create()) {
EvaluateProcessorVersionRequest request =
EvaluateProcessorVersionRequest.newBuilder()
.setProcessorVersion(
ProcessorVersionName.of(
"[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]")
.toString())
.setEvaluationDocuments(BatchDocumentsInputConfig.newBuilder().build())
.build();
OperationFuture<EvaluateProcessorVersionResponse, EvaluateProcessorVersionMetadata> future =
documentProcessorServiceClient
.evaluateProcessorVersionOperationCallable()
.futureCall(request);
// Do something.
EvaluateProcessorVersionResponse response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<EvaluateProcessorVersionRequest,com.google.longrunning.Operation> evaluateProcessorVersionCallable()
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 (DocumentProcessorServiceClient documentProcessorServiceClient =
DocumentProcessorServiceClient.create()) {
EvaluateProcessorVersionRequest request =
EvaluateProcessorVersionRequest.newBuilder()
.setProcessorVersion(
ProcessorVersionName.of(
"[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]")
.toString())
.setEvaluationDocuments(BatchDocumentsInputConfig.newBuilder().build())
.build();
ApiFuture<Operation> future =
documentProcessorServiceClient.evaluateProcessorVersionCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final Evaluation getEvaluation(EvaluationName name)
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 (DocumentProcessorServiceClient documentProcessorServiceClient =
DocumentProcessorServiceClient.create()) {
EvaluationName name =
EvaluationName.of(
"[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]", "[EVALUATION]");
Evaluation response = documentProcessorServiceClient.getEvaluation(name);
}
name - Required. The resource name of the
[Evaluation][google.cloud.documentai.v1.Evaluation] to get.
`projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}/evaluations/{evaluation}`com.google.api.gax.rpc.ApiException - if the remote call failspublic final Evaluation getEvaluation(String name)
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 (DocumentProcessorServiceClient documentProcessorServiceClient =
DocumentProcessorServiceClient.create()) {
String name =
EvaluationName.of(
"[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]", "[EVALUATION]")
.toString();
Evaluation response = documentProcessorServiceClient.getEvaluation(name);
}
name - Required. The resource name of the
[Evaluation][google.cloud.documentai.v1.Evaluation] to get.
`projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}/evaluations/{evaluation}`com.google.api.gax.rpc.ApiException - if the remote call failspublic final Evaluation getEvaluation(GetEvaluationRequest request)
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 (DocumentProcessorServiceClient documentProcessorServiceClient =
DocumentProcessorServiceClient.create()) {
GetEvaluationRequest request =
GetEvaluationRequest.newBuilder()
.setName(
EvaluationName.of(
"[PROJECT]",
"[LOCATION]",
"[PROCESSOR]",
"[PROCESSOR_VERSION]",
"[EVALUATION]")
.toString())
.build();
Evaluation response = documentProcessorServiceClient.getEvaluation(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<GetEvaluationRequest,Evaluation> getEvaluationCallable()
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 (DocumentProcessorServiceClient documentProcessorServiceClient =
DocumentProcessorServiceClient.create()) {
GetEvaluationRequest request =
GetEvaluationRequest.newBuilder()
.setName(
EvaluationName.of(
"[PROJECT]",
"[LOCATION]",
"[PROCESSOR]",
"[PROCESSOR_VERSION]",
"[EVALUATION]")
.toString())
.build();
ApiFuture<Evaluation> future =
documentProcessorServiceClient.getEvaluationCallable().futureCall(request);
// Do something.
Evaluation response = future.get();
}
public final DocumentProcessorServiceClient.ListEvaluationsPagedResponse listEvaluations(ProcessorVersionName parent)
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 (DocumentProcessorServiceClient documentProcessorServiceClient =
DocumentProcessorServiceClient.create()) {
ProcessorVersionName parent =
ProcessorVersionName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]");
for (Evaluation element :
documentProcessorServiceClient.listEvaluations(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent - Required. The resource name of the
[ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion] to list evaluations for.
`projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}`com.google.api.gax.rpc.ApiException - if the remote call failspublic final DocumentProcessorServiceClient.ListEvaluationsPagedResponse listEvaluations(String parent)
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 (DocumentProcessorServiceClient documentProcessorServiceClient =
DocumentProcessorServiceClient.create()) {
String parent =
ProcessorVersionName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]")
.toString();
for (Evaluation element :
documentProcessorServiceClient.listEvaluations(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent - Required. The resource name of the
[ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion] to list evaluations for.
`projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}`com.google.api.gax.rpc.ApiException - if the remote call failspublic final DocumentProcessorServiceClient.ListEvaluationsPagedResponse listEvaluations(ListEvaluationsRequest request)
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 (DocumentProcessorServiceClient documentProcessorServiceClient =
DocumentProcessorServiceClient.create()) {
ListEvaluationsRequest request =
ListEvaluationsRequest.newBuilder()
.setParent(
ProcessorVersionName.of(
"[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]")
.toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
for (Evaluation element :
documentProcessorServiceClient.listEvaluations(request).iterateAll()) {
// doThingsWith(element);
}
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<ListEvaluationsRequest,DocumentProcessorServiceClient.ListEvaluationsPagedResponse> listEvaluationsPagedCallable()
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 (DocumentProcessorServiceClient documentProcessorServiceClient =
DocumentProcessorServiceClient.create()) {
ListEvaluationsRequest request =
ListEvaluationsRequest.newBuilder()
.setParent(
ProcessorVersionName.of(
"[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]")
.toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
ApiFuture<Evaluation> future =
documentProcessorServiceClient.listEvaluationsPagedCallable().futureCall(request);
// Do something.
for (Evaluation element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
public final com.google.api.gax.rpc.UnaryCallable<ListEvaluationsRequest,ListEvaluationsResponse> listEvaluationsCallable()
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 (DocumentProcessorServiceClient documentProcessorServiceClient =
DocumentProcessorServiceClient.create()) {
ListEvaluationsRequest request =
ListEvaluationsRequest.newBuilder()
.setParent(
ProcessorVersionName.of(
"[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]")
.toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
while (true) {
ListEvaluationsResponse response =
documentProcessorServiceClient.listEvaluationsCallable().call(request);
for (Evaluation element : response.getEvaluationsList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
public final DocumentProcessorServiceClient.ListLocationsPagedResponse listLocations(com.google.cloud.location.ListLocationsRequest request)
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 (DocumentProcessorServiceClient documentProcessorServiceClient =
DocumentProcessorServiceClient.create()) {
ListLocationsRequest request =
ListLocationsRequest.newBuilder()
.setName("name3373707")
.setFilter("filter-1274492040")
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
for (Location element : documentProcessorServiceClient.listLocations(request).iterateAll()) {
// doThingsWith(element);
}
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<com.google.cloud.location.ListLocationsRequest,DocumentProcessorServiceClient.ListLocationsPagedResponse> listLocationsPagedCallable()
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 (DocumentProcessorServiceClient documentProcessorServiceClient =
DocumentProcessorServiceClient.create()) {
ListLocationsRequest request =
ListLocationsRequest.newBuilder()
.setName("name3373707")
.setFilter("filter-1274492040")
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
ApiFuture<Location> future =
documentProcessorServiceClient.listLocationsPagedCallable().futureCall(request);
// Do something.
for (Location element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
public final com.google.api.gax.rpc.UnaryCallable<com.google.cloud.location.ListLocationsRequest,com.google.cloud.location.ListLocationsResponse> listLocationsCallable()
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 (DocumentProcessorServiceClient documentProcessorServiceClient =
DocumentProcessorServiceClient.create()) {
ListLocationsRequest request =
ListLocationsRequest.newBuilder()
.setName("name3373707")
.setFilter("filter-1274492040")
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
while (true) {
ListLocationsResponse response =
documentProcessorServiceClient.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;
}
}
}
public final com.google.cloud.location.Location getLocation(com.google.cloud.location.GetLocationRequest request)
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 (DocumentProcessorServiceClient documentProcessorServiceClient =
DocumentProcessorServiceClient.create()) {
GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
Location response = documentProcessorServiceClient.getLocation(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<com.google.cloud.location.GetLocationRequest,com.google.cloud.location.Location> getLocationCallable()
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 (DocumentProcessorServiceClient documentProcessorServiceClient =
DocumentProcessorServiceClient.create()) {
GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
ApiFuture<Location> future =
documentProcessorServiceClient.getLocationCallable().futureCall(request);
// Do something.
Location response = future.get();
}
public final void close()
close in interface AutoCloseablepublic void shutdown()
shutdown in interface com.google.api.gax.core.BackgroundResourcepublic boolean isShutdown()
isShutdown in interface com.google.api.gax.core.BackgroundResourcepublic boolean isTerminated()
isTerminated in interface com.google.api.gax.core.BackgroundResourcepublic void shutdownNow()
shutdownNow in interface com.google.api.gax.core.BackgroundResourcepublic boolean awaitTermination(long duration,
TimeUnit unit)
throws InterruptedException
awaitTermination in interface com.google.api.gax.core.BackgroundResourceInterruptedExceptionCopyright © 2024 Google LLC. All rights reserved.