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 or ProcessorVersion to use for processing. If a Processor is specified, the server will use its default version. Format: |
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 |
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 |
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 |
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 or ProcessorVersion. Format: |
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 |
BatchProcessDocuments(NoAwaitTag, std::string const &, Options)
LRO endpoint to batch process many documents.
Specifying the NoAwaitTag
immediately returns the [google::longrunning::Operation
] that corresponds to the Long Running Operation that has been started. No polling for operation status occurs.
Parameters | |
---|---|
Name | Description |
|
NoAwaitTag
|
name |
std::string const &
|
opts |
Options
|
Returns | |
---|---|
Type | Description |
StatusOr< google::longrunning::Operation > |
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 |
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 |
BatchProcessDocuments(NoAwaitTag, google::cloud::documentai::v1::BatchProcessRequest const &, Options)
LRO endpoint to batch process many documents.
Specifying the NoAwaitTag
immediately returns the [google::longrunning::Operation
] that corresponds to the Long Running Operation that has been started. No polling for operation status occurs.
Parameters | |
---|---|
Name | Description |
|
NoAwaitTag
|
request |
google::cloud::documentai::v1::BatchProcessRequest const &
|
opts |
Options
|
Returns | |
---|---|
Type | Description |
StatusOr< google::longrunning::Operation > |
BatchProcessDocuments(google::longrunning::Operation const &, Options)
LRO endpoint to batch process many documents.
This method accepts a google::longrunning::Operation
that corresponds to a previously started Long Running Operation (LRO) and polls the status of the LRO in the background.
Parameters | |
---|---|
Name | Description |
operation |
google::longrunning::Operation const &
|
opts |
Options
|
Returns | |
---|---|
Type | Description |
future< StatusOr< google::cloud::documentai::v1::BatchProcessResponse > > |
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: |
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 |
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 |
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 |
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: |
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 |
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 |
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 |
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 |
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 |
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 |
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: |
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 |
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 |
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 |
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 |
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 |
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 |
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: |
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 |
TrainProcessorVersion(NoAwaitTag, std::string const &, google::cloud::documentai::v1::ProcessorVersion const &, Options)
Trains a new processor version.
Specifying the NoAwaitTag
immediately returns the [google::longrunning::Operation
] that corresponds to the Long Running Operation that has been started. No polling for operation status occurs.
Parameters | |
---|---|
Name | Description |
|
NoAwaitTag
|
parent |
std::string const &
|
processor_version |
google::cloud::documentai::v1::ProcessorVersion const &
|
opts |
Options
|
Returns | |
---|---|
Type | Description |
StatusOr< google::longrunning::Operation > |
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 |
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 |
TrainProcessorVersion(NoAwaitTag, google::cloud::documentai::v1::TrainProcessorVersionRequest const &, Options)
Trains a new processor version.
Specifying the NoAwaitTag
immediately returns the [google::longrunning::Operation
] that corresponds to the Long Running Operation that has been started. No polling for operation status occurs.
Parameters | |
---|---|
Name | Description |
|
NoAwaitTag
|
request |
google::cloud::documentai::v1::TrainProcessorVersionRequest const &
|
opts |
Options
|
Returns | |
---|---|
Type | Description |
StatusOr< google::longrunning::Operation > |
TrainProcessorVersion(google::longrunning::Operation const &, Options)
Trains a new processor version.
This method accepts a google::longrunning::Operation
that corresponds to a previously started Long Running Operation (LRO) and polls the status of the LRO in the background.
Parameters | |
---|---|
Name | Description |
operation |
google::longrunning::Operation const &
|
opts |
Options
|
Returns | |
---|---|
Type | Description |
future< StatusOr< google::cloud::documentai::v1::TrainProcessorVersionResponse > > |
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 |
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 |
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 |
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: |
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 |
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 |
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 |
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 |
DeleteProcessorVersion(NoAwaitTag, std::string const &, Options)
Deletes the processor version, all artifacts under the processor version will be deleted.
Specifying the NoAwaitTag
immediately returns the [google::longrunning::Operation
] that corresponds to the Long Running Operation that has been started. No polling for operation status occurs.
Parameters | |
---|---|
Name | Description |
|
NoAwaitTag
|
name |
std::string const &
|
opts |
Options
|
Returns | |
---|---|
Type | Description |
StatusOr< google::longrunning::Operation > |
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 |
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 |
DeleteProcessorVersion(NoAwaitTag, google::cloud::documentai::v1::DeleteProcessorVersionRequest const &, Options)
Deletes the processor version, all artifacts under the processor version will be deleted.
Specifying the NoAwaitTag
immediately returns the [google::longrunning::Operation
] that corresponds to the Long Running Operation that has been started. No polling for operation status occurs.
Parameters | |
---|---|
Name | Description |
|
NoAwaitTag
|
request |
google::cloud::documentai::v1::DeleteProcessorVersionRequest const &
|
opts |
Options
|
Returns | |
---|---|
Type | Description |
StatusOr< google::longrunning::Operation > |
DeleteProcessorVersion(google::longrunning::Operation const &, Options)
Deletes the processor version, all artifacts under the processor version will be deleted.
This method accepts a google::longrunning::Operation
that corresponds to a previously started Long Running Operation (LRO) and polls the status of the LRO in the background.
Parameters | |
---|---|
Name | Description |
operation |
google::longrunning::Operation const &
|
opts |
Options
|
Returns | |
---|---|
Type | Description |
future< StatusOr< google::cloud::documentai::v1::DeleteProcessorVersionMetadata > > |
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 |
DeployProcessorVersion(NoAwaitTag, std::string const &, Options)
Deploys the processor version.
Specifying the NoAwaitTag
immediately returns the [google::longrunning::Operation
] that corresponds to the Long Running Operation that has been started. No polling for operation status occurs.
Parameters | |
---|---|
Name | Description |
|
NoAwaitTag
|
name |
std::string const &
|
opts |
Options
|
Returns | |
---|---|
Type | Description |
StatusOr< google::longrunning::Operation > |
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 |
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 |
DeployProcessorVersion(NoAwaitTag, google::cloud::documentai::v1::DeployProcessorVersionRequest const &, Options)
Deploys the processor version.
Specifying the NoAwaitTag
immediately returns the [google::longrunning::Operation
] that corresponds to the Long Running Operation that has been started. No polling for operation status occurs.
Parameters | |
---|---|
Name | Description |
|
NoAwaitTag
|
request |
google::cloud::documentai::v1::DeployProcessorVersionRequest const &
|
opts |
Options
|
Returns | |
---|---|
Type | Description |
StatusOr< google::longrunning::Operation > |
DeployProcessorVersion(google::longrunning::Operation const &, Options)
Deploys the processor version.
This method accepts a google::longrunning::Operation
that corresponds to a previously started Long Running Operation (LRO) and polls the status of the LRO in the background.
Parameters | |
---|---|
Name | Description |
operation |
google::longrunning::Operation const &
|
opts |
Options
|
Returns | |
---|---|
Type | Description |
future< StatusOr< google::cloud::documentai::v1::DeployProcessorVersionResponse > > |
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 |
UndeployProcessorVersion(NoAwaitTag, std::string const &, Options)
Undeploys the processor version.
Specifying the NoAwaitTag
immediately returns the [google::longrunning::Operation
] that corresponds to the Long Running Operation that has been started. No polling for operation status occurs.
Parameters | |
---|---|
Name | Description |
|
NoAwaitTag
|
name |
std::string const &
|
opts |
Options
|
Returns | |
---|---|
Type | Description |
StatusOr< google::longrunning::Operation > |
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 |
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 |
UndeployProcessorVersion(NoAwaitTag, google::cloud::documentai::v1::UndeployProcessorVersionRequest const &, Options)
Undeploys the processor version.
Specifying the NoAwaitTag
immediately returns the [google::longrunning::Operation
] that corresponds to the Long Running Operation that has been started. No polling for operation status occurs.
Parameters | |
---|---|
Name | Description |
|
NoAwaitTag
|
request |
google::cloud::documentai::v1::UndeployProcessorVersionRequest const &
|
opts |
Options
|
Returns | |
---|---|
Type | Description |
StatusOr< google::longrunning::Operation > |
UndeployProcessorVersion(google::longrunning::Operation const &, Options)
Undeploys the processor version.
This method accepts a google::longrunning::Operation
that corresponds to a previously started Long Running Operation (LRO) and polls the status of the LRO in the background.
Parameters | |
---|---|
Name | Description |
operation |
google::longrunning::Operation const &
|
opts |
Options
|
Returns | |
---|---|
Type | Description |
future< StatusOr< google::cloud::documentai::v1::UndeployProcessorVersionResponse > > |
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. 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.
Parameters | |
---|---|
Name | Description |
parent |
std::string const &
Required. The parent (project and location) under which to create the processor. Format: |
processor |
google::cloud::documentai::v1::Processor const &
Required. The processor to be created, requires Processor.type and Processor.display_name to be set. Also, the 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 |
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. 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.
Parameters | |
---|---|
Name | Description |
request |
google::cloud::documentai::v1::CreateProcessorRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
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 |
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 |
DeleteProcessor(NoAwaitTag, 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.
Specifying the NoAwaitTag
immediately returns the [google::longrunning::Operation
] that corresponds to the Long Running Operation that has been started. No polling for operation status occurs.
Parameters | |
---|---|
Name | Description |
|
NoAwaitTag
|
name |
std::string const &
|
opts |
Options
|
Returns | |
---|---|
Type | Description |
StatusOr< google::longrunning::Operation > |
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 |
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 |
DeleteProcessor(NoAwaitTag, 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.
Specifying the NoAwaitTag
immediately returns the [google::longrunning::Operation
] that corresponds to the Long Running Operation that has been started. No polling for operation status occurs.
Parameters | |
---|---|
Name | Description |
|
NoAwaitTag
|
request |
google::cloud::documentai::v1::DeleteProcessorRequest const &
|
opts |
Options
|
Returns | |
---|---|
Type | Description |
StatusOr< google::longrunning::Operation > |
DeleteProcessor(google::longrunning::Operation const &, Options)
Deletes the processor, unloads all deployed model artifacts if it was enabled and then deletes all artifacts associated with this processor.
This method accepts a google::longrunning::Operation
that corresponds to a previously started Long Running Operation (LRO) and polls the status of the LRO in the background.
Parameters | |
---|---|
Name | Description |
operation |
google::longrunning::Operation const &
|
opts |
Options
|
Returns | |
---|---|
Type | Description |
future< StatusOr< google::cloud::documentai::v1::DeleteProcessorMetadata > > |
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 |
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 |
EnableProcessor(NoAwaitTag, google::cloud::documentai::v1::EnableProcessorRequest const &, Options)
Enables a processor.
Specifying the NoAwaitTag
immediately returns the [google::longrunning::Operation
] that corresponds to the Long Running Operation that has been started. No polling for operation status occurs.
Parameters | |
---|---|
Name | Description |
|
NoAwaitTag
|
request |
google::cloud::documentai::v1::EnableProcessorRequest const &
|
opts |
Options
|
Returns | |
---|---|
Type | Description |
StatusOr< google::longrunning::Operation > |
EnableProcessor(google::longrunning::Operation const &, Options)
Enables a processor.
This method accepts a google::longrunning::Operation
that corresponds to a previously started Long Running Operation (LRO) and polls the status of the LRO in the background.
Parameters | |
---|---|
Name | Description |
operation |
google::longrunning::Operation const &
|
opts |
Options
|
Returns | |
---|---|
Type | Description |
future< StatusOr< google::cloud::documentai::v1::EnableProcessorResponse > > |
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 |
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 |
DisableProcessor(NoAwaitTag, google::cloud::documentai::v1::DisableProcessorRequest const &, Options)
Disables a processor.
Specifying the NoAwaitTag
immediately returns the [google::longrunning::Operation
] that corresponds to the Long Running Operation that has been started. No polling for operation status occurs.
Parameters | |
---|---|
Name | Description |
|
NoAwaitTag
|
request |
google::cloud::documentai::v1::DisableProcessorRequest const &
|
opts |
Options
|
Returns | |
---|---|
Type | Description |
StatusOr< google::longrunning::Operation > |
DisableProcessor(google::longrunning::Operation const &, Options)
Disables a processor.
This method accepts a google::longrunning::Operation
that corresponds to a previously started Long Running Operation (LRO) and polls the status of the LRO in the background.
Parameters | |
---|---|
Name | Description |
operation |
google::longrunning::Operation const &
|
opts |
Options
|
Returns | |
---|---|
Type | Description |
future< StatusOr< google::cloud::documentai::v1::DisableProcessorResponse > > |
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 |
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 |
SetDefaultProcessorVersion(NoAwaitTag, google::cloud::documentai::v1::SetDefaultProcessorVersionRequest const &, Options)
Set the default (active) version of a Processor that will be used in ProcessDocument and BatchProcessDocuments.
Specifying the NoAwaitTag
immediately returns the [google::longrunning::Operation
] that corresponds to the Long Running Operation that has been started. No polling for operation status occurs.
Parameters | |
---|---|
Name | Description |
|
NoAwaitTag
|
request |
google::cloud::documentai::v1::SetDefaultProcessorVersionRequest const &
|
opts |
Options
|
Returns | |
---|---|
Type | Description |
StatusOr< google::longrunning::Operation > |
SetDefaultProcessorVersion(google::longrunning::Operation const &, Options)
Set the default (active) version of a Processor that will be used in ProcessDocument and BatchProcessDocuments.
This method accepts a google::longrunning::Operation
that corresponds to a previously started Long Running Operation (LRO) and polls the status of the LRO in the background.
Parameters | |
---|---|
Name | Description |
operation |
google::longrunning::Operation const &
|
opts |
Options
|
Returns | |
---|---|
Type | Description |
future< StatusOr< google::cloud::documentai::v1::SetDefaultProcessorVersionResponse > > |
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 |
ReviewDocument(NoAwaitTag, std::string const &, Options)
Send a document for Human Review.
Specifying the NoAwaitTag
immediately returns the [google::longrunning::Operation
] that corresponds to the Long Running Operation that has been started. No polling for operation status occurs.
Parameters | |
---|---|
Name | Description |
|
NoAwaitTag
|
human_review_config |
std::string const &
|
opts |
Options
|
Returns | |
---|---|
Type | Description |
StatusOr< google::longrunning::Operation > |
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 |
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 |
ReviewDocument(NoAwaitTag, google::cloud::documentai::v1::ReviewDocumentRequest const &, Options)
Send a document for Human Review.
Specifying the NoAwaitTag
immediately returns the [google::longrunning::Operation
] that corresponds to the Long Running Operation that has been started. No polling for operation status occurs.
Parameters | |
---|---|
Name | Description |
|
NoAwaitTag
|
request |
google::cloud::documentai::v1::ReviewDocumentRequest const &
|
opts |
Options
|
Returns | |
---|---|
Type | Description |
StatusOr< google::longrunning::Operation > |
ReviewDocument(google::longrunning::Operation const &, Options)
Send a document for Human Review.
This method accepts a google::longrunning::Operation
that corresponds to a previously started Long Running Operation (LRO) and polls the status of the LRO in the background.
Parameters | |
---|---|
Name | Description |
operation |
google::longrunning::Operation const &
|
opts |
Options
|
Returns | |
---|---|
Type | Description |
future< StatusOr< google::cloud::documentai::v1::ReviewDocumentResponse > > |
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 to evaluate. |
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 |
EvaluateProcessorVersion(NoAwaitTag, std::string const &, Options)
Evaluates a ProcessorVersion against annotated documents, producing an Evaluation.
Specifying the NoAwaitTag
immediately returns the [google::longrunning::Operation
] that corresponds to the Long Running Operation that has been started. No polling for operation status occurs.
Parameters | |
---|---|
Name | Description |
|
NoAwaitTag
|
processor_version |
std::string const &
|
opts |
Options
|
Returns | |
---|---|
Type | Description |
StatusOr< google::longrunning::Operation > |
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 |
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 |
EvaluateProcessorVersion(NoAwaitTag, google::cloud::documentai::v1::EvaluateProcessorVersionRequest const &, Options)
Evaluates a ProcessorVersion against annotated documents, producing an Evaluation.
Specifying the NoAwaitTag
immediately returns the [google::longrunning::Operation
] that corresponds to the Long Running Operation that has been started. No polling for operation status occurs.
Parameters | |
---|---|
Name | Description |
|
NoAwaitTag
|
request |
google::cloud::documentai::v1::EvaluateProcessorVersionRequest const &
|
opts |
Options
|
Returns | |
---|---|
Type | Description |
StatusOr< google::longrunning::Operation > |
EvaluateProcessorVersion(google::longrunning::Operation const &, Options)
Evaluates a ProcessorVersion against annotated documents, producing an Evaluation.
This method accepts a google::longrunning::Operation
that corresponds to a previously started Long Running Operation (LRO) and polls the status of the LRO in the background.
Parameters | |
---|---|
Name | Description |
operation |
google::longrunning::Operation const &
|
opts |
Options
|
Returns | |
---|---|
Type | Description |
future< StatusOr< google::cloud::documentai::v1::EvaluateProcessorVersionResponse > > |
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. |
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 |
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 |
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 |
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 to list evaluations for. |
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 |
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 |
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 |
ListLocations(google::cloud::location::ListLocationsRequest, Options)
Lists information about the supported locations for this service.
Parameters | |
---|---|
Name | Description |
request |
google::cloud::location::ListLocationsRequest
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StreamRange< google::cloud::location::Location > |
a StreamRange to iterate of the results. See the documentation of this type for details. In brief, this class has |
GetLocation(google::cloud::location::GetLocationRequest const &, Options)
Gets information about a location.
Parameters | |
---|---|
Name | Description |
request |
google::cloud::location::GetLocationRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::cloud::location::Location > |
the result of the RPC. The response message type (google.cloud.location.Location) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
ListOperations(std::string const &, std::string const &, Options)
Lists operations that match the specified filter in the request.
If the server doesn't support this method, it returns UNIMPLEMENTED
.
NOTE: the name
binding allows API services to override the binding to use different resource name schemes, such as users/*/operations
. To override the binding, API services can add a binding such as "/v1/{name=users/*}/operations"
to their service configuration. For backwards compatibility, the default name includes the operations collection id, however overriding users must ensure the name binding is the parent resource, without the operations collection id.
Parameters | |
---|---|
Name | Description |
name |
std::string const &
The name of the operation's parent resource. |
filter |
std::string const &
The standard list filter. |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StreamRange< google::longrunning::Operation > |
a StreamRange to iterate of the results. See the documentation of this type for details. In brief, this class has |
ListOperations(google::longrunning::ListOperationsRequest, Options)
Lists operations that match the specified filter in the request.
If the server doesn't support this method, it returns UNIMPLEMENTED
.
NOTE: the name
binding allows API services to override the binding to use different resource name schemes, such as users/*/operations
. To override the binding, API services can add a binding such as "/v1/{name=users/*}/operations"
to their service configuration. For backwards compatibility, the default name includes the operations collection id, however overriding users must ensure the name binding is the parent resource, without the operations collection id.
Parameters | |
---|---|
Name | Description |
request |
google::longrunning::ListOperationsRequest
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StreamRange< google::longrunning::Operation > |
a StreamRange to iterate of the results. See the documentation of this type for details. In brief, this class has |
GetOperation(std::string const &, Options)
Gets the latest state of a long-running operation.
Clients can use this method to poll the operation result at intervals as recommended by the API service.
Parameters | |
---|---|
Name | Description |
name |
std::string const &
The name of the operation resource. |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::longrunning::Operation > |
the result of the RPC. The response message type (google.longrunning.Operation) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
GetOperation(google::longrunning::GetOperationRequest const &, Options)
Gets the latest state of a long-running operation.
Clients can use this method to poll the operation result at intervals as recommended by the API service.
Parameters | |
---|---|
Name | Description |
request |
google::longrunning::GetOperationRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::longrunning::Operation > |
the result of the RPC. The response message type (google.longrunning.Operation) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
CancelOperation(std::string const &, Options)
Starts asynchronous cancellation on a long-running operation.
The server makes a best effort to cancel the operation, but success is not guaranteed. If the server doesn't support this method, it returns google.rpc.Code.UNIMPLEMENTED
. Clients can use Operations.GetOperation or other methods to check whether the cancellation succeeded or whether the operation completed despite cancellation. On successful cancellation, the operation is not deleted; instead, it becomes an operation with an Operation.error value with a google.rpc.Status.code of 1, corresponding to Code.CANCELLED
.
Parameters | |
---|---|
Name | Description |
name |
std::string const &
The name of the operation resource to be cancelled. |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
Status |
a |
CancelOperation(google::longrunning::CancelOperationRequest const &, Options)
Starts asynchronous cancellation on a long-running operation.
The server makes a best effort to cancel the operation, but success is not guaranteed. If the server doesn't support this method, it returns google.rpc.Code.UNIMPLEMENTED
. Clients can use Operations.GetOperation or other methods to check whether the cancellation succeeded or whether the operation completed despite cancellation. On successful cancellation, the operation is not deleted; instead, it becomes an operation with an Operation.error value with a google.rpc.Status.code of 1, corresponding to Code.CANCELLED
.
Parameters | |
---|---|
Name | Description |
request |
google::longrunning::CancelOperationRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
Status |
a |