Class DocumentProcessorServiceClient (2.18.0)

Service to call Document AI to process documents according to the processor's definition.

Processors are built using state-of-the-art Google AI such as natural language, computer vision, and translation to extract structured information from unstructured or semi-structured documents.

Equality

Instances of this class created via copy-construction or copy-assignment always compare equal. Instances created with equal std::shared_ptr<*Connection> objects compare equal. Objects that compare equal share the same underlying resources.

Performance

Creating a new instance of this class is a relatively expensive operation, new objects establish new connections to the service. In contrast, copy-construction, move-construction, and the corresponding assignment operations are relatively efficient as the copies share all underlying resources.

Thread Safety

Concurrent access to different instances of this class, even if they compare equal, is guaranteed to work. Two or more threads operating on the same instance of this class is not guaranteed to work. Since copy-construction and move-construction is a relatively efficient operation, consider using such a copy when using this class from multiple threads.

Constructors

DocumentProcessorServiceClient(DocumentProcessorServiceClient const &)

Copy and move support

Parameter
Name Description
DocumentProcessorServiceClient const &

DocumentProcessorServiceClient(DocumentProcessorServiceClient &&)

Copy and move support

Parameter
Name Description
DocumentProcessorServiceClient &&

DocumentProcessorServiceClient(std::shared_ptr< DocumentProcessorServiceConnection >, Options)

Parameters
Name Description
connection std::shared_ptr< DocumentProcessorServiceConnection >
opts Options

Operators

operator=(DocumentProcessorServiceClient const &)

Copy and move support

Parameter
Name Description
DocumentProcessorServiceClient const &
Returns
Type Description
DocumentProcessorServiceClient &

operator=(DocumentProcessorServiceClient &&)

Copy and move support

Parameter
Name Description
DocumentProcessorServiceClient &&
Returns
Type Description
DocumentProcessorServiceClient &

Functions

ProcessDocument(std::string const &, Options)

Processes a single document.

Parameters
Name Description
name std::string const &

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}

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StatusOr< google::cloud::documentai::v1::ProcessResponse >

the result of the RPC. The response message type (google.cloud.documentai.v1.ProcessResponse) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the StatusOr contains the error details.

ProcessDocument(google::cloud::documentai::v1::ProcessRequest const &, Options)

Processes a single document.

Parameters
Name Description
request google::cloud::documentai::v1::ProcessRequest const &

Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.cloud.documentai.v1.ProcessRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StatusOr< google::cloud::documentai::v1::ProcessResponse >

the result of the RPC. The response message type (google.cloud.documentai.v1.ProcessResponse) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the StatusOr contains the error details.

BatchProcessDocuments(std::string const &, Options)

LRO endpoint to batch process many documents.

The output is written to Cloud Storage as JSON in the [Document] format.

Parameters
Name Description
name std::string const &

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}

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
future< StatusOr< google::cloud::documentai::v1::BatchProcessResponse > >

A future that becomes satisfied when the LRO (Long Running Operation) completes or the polling policy in effect for this call is exhausted. The future is satisfied with an error if the LRO completes with an error or the polling policy is exhausted. In this case the StatusOr returned by the future contains the error. If the LRO completes successfully the value of the future contains the LRO's result. For this RPC the result is a google.cloud.documentai.v1.BatchProcessResponse proto message. The C++ class representing this message is created by Protobuf, using the Protobuf mapping rules.

BatchProcessDocuments(google::cloud::documentai::v1::BatchProcessRequest const &, Options)

LRO endpoint to batch process many documents.

The output is written to Cloud Storage as JSON in the [Document] format.

Parameters
Name Description
request google::cloud::documentai::v1::BatchProcessRequest const &

Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.cloud.documentai.v1.BatchProcessRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
future< StatusOr< google::cloud::documentai::v1::BatchProcessResponse > >

A future that becomes satisfied when the LRO (Long Running Operation) completes or the polling policy in effect for this call is exhausted. The future is satisfied with an error if the LRO completes with an error or the polling policy is exhausted. In this case the StatusOr returned by the future contains the error. If the LRO completes successfully the value of the future contains the LRO's result. For this RPC the result is a google.cloud.documentai.v1.BatchProcessResponse proto message. The C++ class representing this message is created by Protobuf, using the Protobuf mapping rules.

FetchProcessorTypes(std::string const &, Options)

Fetches processor types.

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

Parameters
Name Description
parent std::string const &

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

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StatusOr< google::cloud::documentai::v1::FetchProcessorTypesResponse >

the result of the RPC. The response message type (google.cloud.documentai.v1.FetchProcessorTypesResponse) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the StatusOr contains the error details.

FetchProcessorTypes(google::cloud::documentai::v1::FetchProcessorTypesRequest const &, Options)

Fetches processor types.

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

Parameters
Name Description
request google::cloud::documentai::v1::FetchProcessorTypesRequest const &

Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.cloud.documentai.v1.FetchProcessorTypesRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StatusOr< google::cloud::documentai::v1::FetchProcessorTypesResponse >

the result of the RPC. The response message type (google.cloud.documentai.v1.FetchProcessorTypesResponse) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the StatusOr contains the error details.

ListProcessorTypes(std::string const &, Options)

Lists the processor types that exist.

Parameters
Name Description
parent std::string const &

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

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StreamRange< google::cloud::documentai::v1::ProcessorType >

a StreamRange to iterate of the results. See the documentation of this type for details. In brief, this class has begin() and end() member functions returning a iterator class meeting the input iterator requirements. The value type for this iterator is a StatusOr as the iteration may fail even after some values are retrieved successfully, for example, if there is a network disconnect. An empty set of results does not indicate an error, it indicates that there are no resources meeting the request criteria. On a successful iteration the StatusOr<T> contains elements of type google.cloud.documentai.v1.ProcessorType, or rather, the C++ class generated by Protobuf from that type. Please consult the Protobuf documentation for details on the Protobuf mapping rules.

ListProcessorTypes(google::cloud::documentai::v1::ListProcessorTypesRequest, Options)

Lists the processor types that exist.

Parameters
Name Description
request google::cloud::documentai::v1::ListProcessorTypesRequest

Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.cloud.documentai.v1.ListProcessorTypesRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StreamRange< google::cloud::documentai::v1::ProcessorType >

a StreamRange to iterate of the results. See the documentation of this type for details. In brief, this class has begin() and end() member functions returning a iterator class meeting the input iterator requirements. The value type for this iterator is a StatusOr as the iteration may fail even after some values are retrieved successfully, for example, if there is a network disconnect. An empty set of results does not indicate an error, it indicates that there are no resources meeting the request criteria. On a successful iteration the StatusOr<T> contains elements of type google.cloud.documentai.v1.ProcessorType, or rather, the C++ class generated by Protobuf from that type. Please consult the Protobuf documentation for details on the Protobuf mapping rules.

GetProcessorType(std::string const &, Options)

Gets a processor type detail.

Parameters
Name Description
name std::string const &

Required. The processor type resource name.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StatusOr< google::cloud::documentai::v1::ProcessorType >

the result of the RPC. The response message type (google.cloud.documentai.v1.ProcessorType) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the StatusOr contains the error details.

GetProcessorType(google::cloud::documentai::v1::GetProcessorTypeRequest const &, Options)

Gets a processor type detail.

Parameters
Name Description
request google::cloud::documentai::v1::GetProcessorTypeRequest const &

Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.cloud.documentai.v1.GetProcessorTypeRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StatusOr< google::cloud::documentai::v1::ProcessorType >

the result of the RPC. The response message type (google.cloud.documentai.v1.ProcessorType) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the StatusOr contains the error details.

ListProcessors(std::string const &, Options)

Lists all processors which belong to this project.

Parameters
Name Description
parent std::string const &

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

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StreamRange< google::cloud::documentai::v1::Processor >

a StreamRange to iterate of the results. See the documentation of this type for details. In brief, this class has begin() and end() member functions returning a iterator class meeting the input iterator requirements. The value type for this iterator is a StatusOr as the iteration may fail even after some values are retrieved successfully, for example, if there is a network disconnect. An empty set of results does not indicate an error, it indicates that there are no resources meeting the request criteria. On a successful iteration the StatusOr<T> contains elements of type google.cloud.documentai.v1.Processor, or rather, the C++ class generated by Protobuf from that type. Please consult the Protobuf documentation for details on the Protobuf mapping rules.

ListProcessors(google::cloud::documentai::v1::ListProcessorsRequest, Options)

Lists all processors which belong to this project.

Parameters
Name Description
request google::cloud::documentai::v1::ListProcessorsRequest

Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.cloud.documentai.v1.ListProcessorsRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StreamRange< google::cloud::documentai::v1::Processor >

a StreamRange to iterate of the results. See the documentation of this type for details. In brief, this class has begin() and end() member functions returning a iterator class meeting the input iterator requirements. The value type for this iterator is a StatusOr as the iteration may fail even after some values are retrieved successfully, for example, if there is a network disconnect. An empty set of results does not indicate an error, it indicates that there are no resources meeting the request criteria. On a successful iteration the StatusOr<T> contains elements of type google.cloud.documentai.v1.Processor, or rather, the C++ class generated by Protobuf from that type. Please consult the Protobuf documentation for details on the Protobuf mapping rules.

GetProcessor(std::string const &, Options)

Gets a processor detail.

Parameters
Name Description
name std::string const &

Required. The processor resource name.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StatusOr< google::cloud::documentai::v1::Processor >

the result of the RPC. The response message type (google.cloud.documentai.v1.Processor) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the StatusOr contains the error details.

GetProcessor(google::cloud::documentai::v1::GetProcessorRequest const &, Options)

Gets a processor detail.

Parameters
Name Description
request google::cloud::documentai::v1::GetProcessorRequest const &

Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.cloud.documentai.v1.GetProcessorRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StatusOr< google::cloud::documentai::v1::Processor >

the result of the RPC. The response message type (google.cloud.documentai.v1.Processor) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the StatusOr contains the error details.

TrainProcessorVersion(std::string const &, google::cloud::documentai::v1::ProcessorVersion const &, Options)

Trains a new processor version.

Operation metadata is returned as TrainProcessorVersionMetadata.

Parameters
Name Description
parent std::string const &

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

processor_version google::cloud::documentai::v1::ProcessorVersion const &

Required. The processor version to be created.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
future< StatusOr< google::cloud::documentai::v1::TrainProcessorVersionResponse > >

A future that becomes satisfied when the LRO (Long Running Operation) completes or the polling policy in effect for this call is exhausted. The future is satisfied with an error if the LRO completes with an error or the polling policy is exhausted. In this case the StatusOr returned by the future contains the error. If the LRO completes successfully the value of the future contains the LRO's result. For this RPC the result is a google.cloud.documentai.v1.TrainProcessorVersionResponse proto message. The C++ class representing this message is created by Protobuf, using the Protobuf mapping rules.

TrainProcessorVersion(google::cloud::documentai::v1::TrainProcessorVersionRequest const &, Options)

Trains a new processor version.

Operation metadata is returned as TrainProcessorVersionMetadata.

Parameters
Name Description
request google::cloud::documentai::v1::TrainProcessorVersionRequest const &

Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.cloud.documentai.v1.TrainProcessorVersionRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
future< StatusOr< google::cloud::documentai::v1::TrainProcessorVersionResponse > >

A future that becomes satisfied when the LRO (Long Running Operation) completes or the polling policy in effect for this call is exhausted. The future is satisfied with an error if the LRO completes with an error or the polling policy is exhausted. In this case the StatusOr returned by the future contains the error. If the LRO completes successfully the value of the future contains the LRO's result. For this RPC the result is a google.cloud.documentai.v1.TrainProcessorVersionResponse proto message. The C++ class representing this message is created by Protobuf, using the Protobuf mapping rules.

GetProcessorVersion(std::string const &, Options)

Gets a processor version detail.

Parameters
Name Description
name std::string const &

Required. The processor resource name.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StatusOr< google::cloud::documentai::v1::ProcessorVersion >

the result of the RPC. The response message type (google.cloud.documentai.v1.ProcessorVersion) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the StatusOr contains the error details.

GetProcessorVersion(google::cloud::documentai::v1::GetProcessorVersionRequest const &, Options)

Gets a processor version detail.

Parameters
Name Description
request google::cloud::documentai::v1::GetProcessorVersionRequest const &

Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.cloud.documentai.v1.GetProcessorVersionRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StatusOr< google::cloud::documentai::v1::ProcessorVersion >

the result of the RPC. The response message type (google.cloud.documentai.v1.ProcessorVersion) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the StatusOr contains the error details.

ListProcessorVersions(std::string const &, Options)

Lists all versions of a processor.

Parameters
Name Description
parent std::string const &

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

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StreamRange< google::cloud::documentai::v1::ProcessorVersion >

a StreamRange to iterate of the results. See the documentation of this type for details. In brief, this class has begin() and end() member functions returning a iterator class meeting the input iterator requirements. The value type for this iterator is a StatusOr as the iteration may fail even after some values are retrieved successfully, for example, if there is a network disconnect. An empty set of results does not indicate an error, it indicates that there are no resources meeting the request criteria. On a successful iteration the StatusOr<T> contains elements of type google.cloud.documentai.v1.ProcessorVersion, or rather, the C++ class generated by Protobuf from that type. Please consult the Protobuf documentation for details on the Protobuf mapping rules.

ListProcessorVersions(google::cloud::documentai::v1::ListProcessorVersionsRequest, Options)

Lists all versions of a processor.

Parameters
Name Description
request google::cloud::documentai::v1::ListProcessorVersionsRequest

Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.cloud.documentai.v1.ListProcessorVersionsRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StreamRange< google::cloud::documentai::v1::ProcessorVersion >

a StreamRange to iterate of the results. See the documentation of this type for details. In brief, this class has begin() and end() member functions returning a iterator class meeting the input iterator requirements. The value type for this iterator is a StatusOr as the iteration may fail even after some values are retrieved successfully, for example, if there is a network disconnect. An empty set of results does not indicate an error, it indicates that there are no resources meeting the request criteria. On a successful iteration the StatusOr<T> contains elements of type google.cloud.documentai.v1.ProcessorVersion, or rather, the C++ class generated by Protobuf from that type. Please consult the Protobuf documentation for details on the Protobuf mapping rules.

DeleteProcessorVersion(std::string const &, Options)

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

Parameters
Name Description
name std::string const &

Required. The processor version resource name to be deleted.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
future< StatusOr< google::cloud::documentai::v1::DeleteProcessorVersionMetadata > >

A future that becomes satisfied when the LRO (Long Running Operation) completes or the polling policy in effect for this call is exhausted. The future is satisfied with an error if the LRO completes with an error or the polling policy is exhausted. In this case the StatusOr returned by the future contains the error. If the LRO completes successfully the value of the future contains the LRO's result. For this RPC the result is a google.cloud.documentai.v1.DeleteProcessorVersionMetadata proto message. The C++ class representing this message is created by Protobuf, using the Protobuf mapping rules.

DeleteProcessorVersion(google::cloud::documentai::v1::DeleteProcessorVersionRequest const &, Options)

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

Parameters
Name Description
request google::cloud::documentai::v1::DeleteProcessorVersionRequest const &

Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.cloud.documentai.v1.DeleteProcessorVersionRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
future< StatusOr< google::cloud::documentai::v1::DeleteProcessorVersionMetadata > >

A future that becomes satisfied when the LRO (Long Running Operation) completes or the polling policy in effect for this call is exhausted. The future is satisfied with an error if the LRO completes with an error or the polling policy is exhausted. In this case the StatusOr returned by the future contains the error. If the LRO completes successfully the value of the future contains the LRO's result. For this RPC the result is a google.cloud.documentai.v1.DeleteProcessorVersionMetadata proto message. The C++ class representing this message is created by Protobuf, using the Protobuf mapping rules.

DeployProcessorVersion(std::string const &, Options)

Deploys the processor version.

Parameters
Name Description
name std::string const &

Required. The processor version resource name to be deployed.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
future< StatusOr< google::cloud::documentai::v1::DeployProcessorVersionResponse > >

A future that becomes satisfied when the LRO (Long Running Operation) completes or the polling policy in effect for this call is exhausted. The future is satisfied with an error if the LRO completes with an error or the polling policy is exhausted. In this case the StatusOr returned by the future contains the error. If the LRO completes successfully the value of the future contains the LRO's result. For this RPC the result is a google.cloud.documentai.v1.DeployProcessorVersionResponse proto message. The C++ class representing this message is created by Protobuf, using the Protobuf mapping rules.

DeployProcessorVersion(google::cloud::documentai::v1::DeployProcessorVersionRequest const &, Options)

Deploys the processor version.

Parameters
Name Description
request google::cloud::documentai::v1::DeployProcessorVersionRequest const &

Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.cloud.documentai.v1.DeployProcessorVersionRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
future< StatusOr< google::cloud::documentai::v1::DeployProcessorVersionResponse > >

A future that becomes satisfied when the LRO (Long Running Operation) completes or the polling policy in effect for this call is exhausted. The future is satisfied with an error if the LRO completes with an error or the polling policy is exhausted. In this case the StatusOr returned by the future contains the error. If the LRO completes successfully the value of the future contains the LRO's result. For this RPC the result is a google.cloud.documentai.v1.DeployProcessorVersionResponse proto message. The C++ class representing this message is created by Protobuf, using the Protobuf mapping rules.

UndeployProcessorVersion(std::string const &, Options)

Undeploys the processor version.

Parameters
Name Description
name std::string const &

Required. The processor version resource name to be undeployed.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
future< StatusOr< google::cloud::documentai::v1::UndeployProcessorVersionResponse > >

A future that becomes satisfied when the LRO (Long Running Operation) completes or the polling policy in effect for this call is exhausted. The future is satisfied with an error if the LRO completes with an error or the polling policy is exhausted. In this case the StatusOr returned by the future contains the error. If the LRO completes successfully the value of the future contains the LRO's result. For this RPC the result is a google.cloud.documentai.v1.UndeployProcessorVersionResponse proto message. The C++ class representing this message is created by Protobuf, using the Protobuf mapping rules.

UndeployProcessorVersion(google::cloud::documentai::v1::UndeployProcessorVersionRequest const &, Options)

Undeploys the processor version.

Parameters
Name Description
request google::cloud::documentai::v1::UndeployProcessorVersionRequest const &

Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.cloud.documentai.v1.UndeployProcessorVersionRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
future< StatusOr< google::cloud::documentai::v1::UndeployProcessorVersionResponse > >

A future that becomes satisfied when the LRO (Long Running Operation) completes or the polling policy in effect for this call is exhausted. The future is satisfied with an error if the LRO completes with an error or the polling policy is exhausted. In this case the StatusOr returned by the future contains the error. If the LRO completes successfully the value of the future contains the LRO's result. For this RPC the result is a google.cloud.documentai.v1.UndeployProcessorVersionResponse proto message. The C++ class representing this message is created by Protobuf, using the Protobuf mapping rules.

CreateProcessor(std::string const &, google::cloud::documentai::v1::Processor const &, Options)

Creates a processor from the ProcessorType provided.

The processor will be at ENABLED state by default after its creation.

Parameters
Name Description
parent std::string const &

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

processor google::cloud::documentai::v1::Processor const &

Required. The processor to be created, requires [Processor.type][google.cloud.documentai.v1.Processor.type] and [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.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StatusOr< google::cloud::documentai::v1::Processor >

the result of the RPC. The response message type (google.cloud.documentai.v1.Processor) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the StatusOr contains the error details.

CreateProcessor(google::cloud::documentai::v1::CreateProcessorRequest const &, Options)

Creates a processor from the ProcessorType provided.

The processor will be at ENABLED state by default after its creation.

Parameters
Name Description
request google::cloud::documentai::v1::CreateProcessorRequest const &

Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.cloud.documentai.v1.CreateProcessorRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StatusOr< google::cloud::documentai::v1::Processor >

the result of the RPC. The response message type (google.cloud.documentai.v1.Processor) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the StatusOr contains the error details.

DeleteProcessor(std::string const &, Options)

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

Parameters
Name Description
name std::string const &

Required. The processor resource name to be deleted.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
future< StatusOr< google::cloud::documentai::v1::DeleteProcessorMetadata > >

A future that becomes satisfied when the LRO (Long Running Operation) completes or the polling policy in effect for this call is exhausted. The future is satisfied with an error if the LRO completes with an error or the polling policy is exhausted. In this case the StatusOr returned by the future contains the error. If the LRO completes successfully the value of the future contains the LRO's result. For this RPC the result is a google.cloud.documentai.v1.DeleteProcessorMetadata proto message. The C++ class representing this message is created by Protobuf, using the Protobuf mapping rules.

DeleteProcessor(google::cloud::documentai::v1::DeleteProcessorRequest const &, Options)

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

Parameters
Name Description
request google::cloud::documentai::v1::DeleteProcessorRequest const &

Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.cloud.documentai.v1.DeleteProcessorRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
future< StatusOr< google::cloud::documentai::v1::DeleteProcessorMetadata > >

A future that becomes satisfied when the LRO (Long Running Operation) completes or the polling policy in effect for this call is exhausted. The future is satisfied with an error if the LRO completes with an error or the polling policy is exhausted. In this case the StatusOr returned by the future contains the error. If the LRO completes successfully the value of the future contains the LRO's result. For this RPC the result is a google.cloud.documentai.v1.DeleteProcessorMetadata proto message. The C++ class representing this message is created by Protobuf, using the Protobuf mapping rules.

EnableProcessor(google::cloud::documentai::v1::EnableProcessorRequest const &, Options)

Enables a processor.

Parameters
Name Description
request google::cloud::documentai::v1::EnableProcessorRequest const &

Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.cloud.documentai.v1.EnableProcessorRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
future< StatusOr< google::cloud::documentai::v1::EnableProcessorResponse > >

A future that becomes satisfied when the LRO (Long Running Operation) completes or the polling policy in effect for this call is exhausted. The future is satisfied with an error if the LRO completes with an error or the polling policy is exhausted. In this case the StatusOr returned by the future contains the error. If the LRO completes successfully the value of the future contains the LRO's result. For this RPC the result is a google.cloud.documentai.v1.EnableProcessorResponse proto message. The C++ class representing this message is created by Protobuf, using the Protobuf mapping rules.

DisableProcessor(google::cloud::documentai::v1::DisableProcessorRequest const &, Options)

Disables a processor.

Parameters
Name Description
request google::cloud::documentai::v1::DisableProcessorRequest const &

Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.cloud.documentai.v1.DisableProcessorRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
future< StatusOr< google::cloud::documentai::v1::DisableProcessorResponse > >

A future that becomes satisfied when the LRO (Long Running Operation) completes or the polling policy in effect for this call is exhausted. The future is satisfied with an error if the LRO completes with an error or the polling policy is exhausted. In this case the StatusOr returned by the future contains the error. If the LRO completes successfully the value of the future contains the LRO's result. For this RPC the result is a google.cloud.documentai.v1.DisableProcessorResponse proto message. The C++ class representing this message is created by Protobuf, using the Protobuf mapping rules.

SetDefaultProcessorVersion(google::cloud::documentai::v1::SetDefaultProcessorVersionRequest const &, Options)

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

Parameters
Name Description
request google::cloud::documentai::v1::SetDefaultProcessorVersionRequest const &

Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.cloud.documentai.v1.SetDefaultProcessorVersionRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
future< StatusOr< google::cloud::documentai::v1::SetDefaultProcessorVersionResponse > >

A future that becomes satisfied when the LRO (Long Running Operation) completes or the polling policy in effect for this call is exhausted. The future is satisfied with an error if the LRO completes with an error or the polling policy is exhausted. In this case the StatusOr returned by the future contains the error. If the LRO completes successfully the value of the future contains the LRO's result. For this RPC the result is a google.cloud.documentai.v1.SetDefaultProcessorVersionResponse proto message. The C++ class representing this message is created by Protobuf, using the Protobuf mapping rules.

ReviewDocument(std::string const &, Options)

Send a document for Human Review.

The input document should be processed by the specified processor.

Parameters
Name Description
human_review_config std::string const &

Required. The resource name of the [HumanReviewConfig][google.cloud.documentai.v1.HumanReviewConfig] that the document will be reviewed with.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
future< StatusOr< google::cloud::documentai::v1::ReviewDocumentResponse > >

A future that becomes satisfied when the LRO (Long Running Operation) completes or the polling policy in effect for this call is exhausted. The future is satisfied with an error if the LRO completes with an error or the polling policy is exhausted. In this case the StatusOr returned by the future contains the error. If the LRO completes successfully the value of the future contains the LRO's result. For this RPC the result is a google.cloud.documentai.v1.ReviewDocumentResponse proto message. The C++ class representing this message is created by Protobuf, using the Protobuf mapping rules.

ReviewDocument(google::cloud::documentai::v1::ReviewDocumentRequest const &, Options)

Send a document for Human Review.

The input document should be processed by the specified processor.

Parameters
Name Description
request google::cloud::documentai::v1::ReviewDocumentRequest const &

Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.cloud.documentai.v1.ReviewDocumentRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
future< StatusOr< google::cloud::documentai::v1::ReviewDocumentResponse > >

A future that becomes satisfied when the LRO (Long Running Operation) completes or the polling policy in effect for this call is exhausted. The future is satisfied with an error if the LRO completes with an error or the polling policy is exhausted. In this case the StatusOr returned by the future contains the error. If the LRO completes successfully the value of the future contains the LRO's result. For this RPC the result is a google.cloud.documentai.v1.ReviewDocumentResponse proto message. The C++ class representing this message is created by Protobuf, using the Protobuf mapping rules.

EvaluateProcessorVersion(std::string const &, Options)

Evaluates a ProcessorVersion against annotated documents, producing an Evaluation.

Parameters
Name Description
processor_version std::string const &

Required. The resource name of the [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion] to evaluate. projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
future< StatusOr< google::cloud::documentai::v1::EvaluateProcessorVersionResponse > >

A future that becomes satisfied when the LRO (Long Running Operation) completes or the polling policy in effect for this call is exhausted. The future is satisfied with an error if the LRO completes with an error or the polling policy is exhausted. In this case the StatusOr returned by the future contains the error. If the LRO completes successfully the value of the future contains the LRO's result. For this RPC the result is a google.cloud.documentai.v1.EvaluateProcessorVersionResponse proto message. The C++ class representing this message is created by Protobuf, using the Protobuf mapping rules.

EvaluateProcessorVersion(google::cloud::documentai::v1::EvaluateProcessorVersionRequest const &, Options)

Evaluates a ProcessorVersion against annotated documents, producing an Evaluation.

Parameters
Name Description
request google::cloud::documentai::v1::EvaluateProcessorVersionRequest const &

Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.cloud.documentai.v1.EvaluateProcessorVersionRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
future< StatusOr< google::cloud::documentai::v1::EvaluateProcessorVersionResponse > >

A future that becomes satisfied when the LRO (Long Running Operation) completes or the polling policy in effect for this call is exhausted. The future is satisfied with an error if the LRO completes with an error or the polling policy is exhausted. In this case the StatusOr returned by the future contains the error. If the LRO completes successfully the value of the future contains the LRO's result. For this RPC the result is a google.cloud.documentai.v1.EvaluateProcessorVersionResponse proto message. The C++ class representing this message is created by Protobuf, using the Protobuf mapping rules.

GetEvaluation(std::string const &, Options)

Retrieves a specific evaluation.

Parameters
Name Description
name std::string const &

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

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StatusOr< google::cloud::documentai::v1::Evaluation >

the result of the RPC. The response message type (google.cloud.documentai.v1.Evaluation) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the StatusOr contains the error details.

GetEvaluation(google::cloud::documentai::v1::GetEvaluationRequest const &, Options)

Retrieves a specific evaluation.

Parameters
Name Description
request google::cloud::documentai::v1::GetEvaluationRequest const &

Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.cloud.documentai.v1.GetEvaluationRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StatusOr< google::cloud::documentai::v1::Evaluation >

the result of the RPC. The response message type (google.cloud.documentai.v1.Evaluation) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the StatusOr contains the error details.

ListEvaluations(std::string const &, Options)

Retrieves a set of evaluations for a given processor version.

Parameters
Name Description
parent std::string const &

Required. The resource name of the [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion] to list evaluations for. projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StreamRange< google::cloud::documentai::v1::Evaluation >

a StreamRange to iterate of the results. See the documentation of this type for details. In brief, this class has begin() and end() member functions returning a iterator class meeting the input iterator requirements. The value type for this iterator is a StatusOr as the iteration may fail even after some values are retrieved successfully, for example, if there is a network disconnect. An empty set of results does not indicate an error, it indicates that there are no resources meeting the request criteria. On a successful iteration the StatusOr<T> contains elements of type google.cloud.documentai.v1.Evaluation, or rather, the C++ class generated by Protobuf from that type. Please consult the Protobuf documentation for details on the Protobuf mapping rules.

ListEvaluations(google::cloud::documentai::v1::ListEvaluationsRequest, Options)

Retrieves a set of evaluations for a given processor version.

Parameters
Name Description
request google::cloud::documentai::v1::ListEvaluationsRequest

Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.cloud.documentai.v1.ListEvaluationsRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StreamRange< google::cloud::documentai::v1::Evaluation >

a StreamRange to iterate of the results. See the documentation of this type for details. In brief, this class has begin() and end() member functions returning a iterator class meeting the input iterator requirements. The value type for this iterator is a StatusOr as the iteration may fail even after some values are retrieved successfully, for example, if there is a network disconnect. An empty set of results does not indicate an error, it indicates that there are no resources meeting the request criteria. On a successful iteration the StatusOr<T> contains elements of type google.cloud.documentai.v1.Evaluation, or rather, the C++ class generated by Protobuf from that type. Please consult the Protobuf documentation for details on the Protobuf mapping rules.