@ -1,4 +1,4 @@
/ / Copyright 2022 Google LLC
/ / Copyright 2023 Google LLC
/ /
/ / Licensed under the Apache License , Version 2.0 ( the "License" ) ;
/ / you may not use this file except in compliance with the License.
@ -28,6 +28,7 @@ import "google/cloud/documentai/v1beta3/operation_metadata.proto";
import "google/cloud/documentai/v1beta3/processor.proto" ;
import "google/cloud/documentai/v1beta3/processor_type.proto" ;
import "google/longrunning/operations.proto" ;
import "google/protobuf/empty.proto" ;
import "google/protobuf/field_mask.proto" ;
import "google/protobuf/timestamp.proto" ;
import "google/rpc/status.proto" ;
@ -48,7 +49,7 @@ option (google.api.resource_definition) = {
pattern : "projects/{project}/locations/{location}"
} ;
/ / Service to call Cloud Document AI to process documents according to the
/ / 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.
@ -89,8 +90,9 @@ service DocumentProcessorService {
} ;
}
/ / Fetches processor types. Note that we do not use ListProcessorTypes here
/ / because it is not paginated.
/ / Fetches processor types. Note that we don ' t use
/ / [ ListProcessorTypes ] [ google.cloud.documentai.v1beta3.DocumentProcessorService.ListProcessorTypes ]
/ / here , because it isn ' t paginated.
rpc FetchProcessorTypes ( FetchProcessorTypesRequest )
returns ( FetchProcessorTypesResponse ) {
option ( google.api.http ) = {
@ -134,7 +136,7 @@ service DocumentProcessorService {
/ / Trains a new processor version.
/ / Operation metadata is returned as
/ / cloud_documentai_core.TrainProcessorVersionMetadata .
/ / [ TrainProcessorVersionMetadata ] [ google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata ] .
rpc TrainProcessorVersion ( TrainProcessorVersionRequest )
returns ( google.longrunning.Operation ) {
option ( google.api.http ) = {
@ -208,8 +210,9 @@ service DocumentProcessorService {
} ;
}
/ / Creates a processor from the type processor that the user chose.
/ / The processor will be at "ENABLED" state by default after its creation.
/ / Creates a processor from the
/ / [ ProcessorType ] [ google.cloud.documentai.v1beta3.ProcessorType ] provided.
/ / The processor will be at ` ENABLED ` state by default after its creation.
rpc CreateProcessor ( CreateProcessorRequest ) returns ( Processor ) {
option ( google.api.http ) = {
post : "/v1beta3/{parent=projects/*/locations/*}/processors"
@ -339,12 +342,14 @@ service DocumentProcessorService {
/ / Options for Process API
message ProcessOptions {
/ / Only applicable to "Document OCR Processor" . Returns error if set on other
/ / Only applicable to ` OCR_PROCESSOR ` . Returns error if set on other
/ / processor types.
OcrConfig ocr_config = 1 ;
}
/ / Request message for the process document method.
/ / Request message for the
/ / [ ProcessDocument ] [ google.cloud.documentai.v1beta3.DocumentProcessorService.ProcessDocument ]
/ / method.
message ProcessRequest {
/ / The document payload.
oneof source {
@ -370,16 +375,20 @@ message ProcessRequest {
( google.api.resource_reference ) = { type : "*" }
] ;
/ / The document payload , the [ content ] and [ mime_type ] fields must be set.
/ / The document payload , the
/ / [ content ] [ google.cloud.documentai.v1beta3.Document.content ] and
/ / [ mime_type ] [ google.cloud.documentai.v1beta3.Document.mime_type ] fields must
/ / be set.
Document document = 2 [ deprecated = true ] ;
/ / Whether Human Review feature should be skipped for this request. Default to
/ / false .
/ / Whether human review should be skipped for this request. Default to
/ / ` false ` .
bool skip_human_review = 3 ;
/ / Specifies which fields to include in ProcessResponse ' s document.
/ / Only supports top level document and pages field so it must be in the form
/ / of ` { document_field_name } ` or ` pages. { page_field_name } ` .
/ / Specifies which fields to include in the
/ / [ ProcessResponse.document ] [ google.cloud.documentai.v1beta3.ProcessResponse.document ]
/ / output. Only supports top - level document and pages field , so it must be in
/ / the form of ` { document_field_name } ` or ` pages. { page_field_name } ` .
google.protobuf.FieldMask field_mask = 6 ;
/ / Inference - time options for the process API
@ -394,7 +403,7 @@ message HumanReviewStatus {
STATE_UNSPECIFIED = 0 ;
/ / Human review is skipped for the document. This can happen because human
/ / review is no t enabled on the processor or the processing request has
/ / review isn ' t enabled on the processor or the processing request has
/ / been set to skip this document.
SKIPPED = 1 ;
@ -405,7 +414,8 @@ message HumanReviewStatus {
IN_PROGRESS = 3 ;
/ / Some error happened during triggering human review , see the
/ / [ state_message ] for details.
/ / [ state_message ] [ google.cloud.documentai.v1beta3.HumanReviewStatus.state_message ]
/ / for details.
ERROR = 4 ;
}
@ -416,29 +426,34 @@ message HumanReviewStatus {
string state_message = 2 ;
/ / The name of the operation triggered by the processed document. This field
/ / is populated only when the [ state ] is [ HUMAN_REVIEW_IN_PROGRESS ] . It has
/ / the same response type and metadata as the long running operation returned
/ / by [ ReviewDocument ] method.
/ / is populated only when the
/ / [ state ] [ google.cloud.documentai.v1beta3.HumanReviewStatus.state ] is
/ / ` HUMAN_REVIEW_IN_PROGRESS ` . It has the same response type and metadata as
/ / the long - running operation returned by
/ / [ ReviewDocument ] [ google.cloud.documentai.v1beta3.DocumentProcessorService.ReviewDocument ] .
string human_review_operation = 3 ;
}
/ / Response message for the process document method.
/ / Response message for the
/ / [ ProcessDocument ] [ google.cloud.documentai.v1beta3.DocumentProcessorService.ProcessDocument ]
/ / method.
message ProcessResponse {
/ / The document payload , will populate fields based on the processor ' s
/ / behavior.
Document document = 1 ;
/ / The name of the operation triggered by the processed document. If the human
/ / review process is no t triggered , this field w ill be empty. It has the same
/ / response type and metadata as the long running operation returned by
/ / ReviewDocument method .
/ / review process isn ' t triggered , this field is empty. It has the same
/ / response type and metadata as the long - running operation returned by
/ / [ ReviewDocument ] [ google.cloud.documentai.v1beta3.DocumentProcessorService.ReviewDocument ] .
string human_review_operation = 2 [ deprecated = true ] ;
/ / The status of human review on the processed document.
HumanReviewStatus human_review_status = 3 ;
}
/ / Request message for batch process document method.
/ / Request message for
/ / [ BatchProcessDocuments ] [ google.cloud.documentai.v1beta3.DocumentProcessorService.BatchProcessDocuments ] .
message BatchProcessRequest {
/ / The message for input config in batch process.
message BatchInputConfig {
@ -447,13 +462,19 @@ message BatchProcessRequest {
/ / The Cloud Storage location as the source of the document.
string gcs_source = 1 ;
/ / Mimetype of the input. If the input is a raw document , the supported
/ / mimetypes are application / pdf , image / tiff , and image / gif.
/ / If the input is a [ Document ] proto , the type should be application / json.
/ / An IANA published [ media type ( MIME
/ / type ) ] ( https : / / www.iana.org / assignments / media - types / media - types.xhtml ) of
/ / the input. If the input is a raw document , refer to [ supported file
/ / types ] ( https : / / cloud.google.com / document - ai / docs / file - types ) for the list
/ / of media types. If the input is a
/ / [ Document ] [ google.cloud.documentai.v1beta3.Document ] , the type should be
/ / ` application / json ` .
string mime_type = 2 ;
}
/ / The message for output config in batch process.
/ / The output configuration in the
/ / [ BatchProcessDocuments ] [ google.cloud.documentai.v1beta3.DocumentProcessorService.BatchProcessDocuments ]
/ / method.
message BatchOutputConfig {
option deprecated = true ;
@ -478,44 +499,52 @@ message BatchProcessRequest {
/ / The overall output config for batch process.
BatchOutputConfig output_config = 3 [ deprecated = true ] ;
/ / The input documents for batch process.
/ / The input documents for the
/ / [ BatchProcessDocuments ] [ google.cloud.documentai.v1beta3.DocumentProcessorService.BatchProcessDocuments ]
/ / method.
BatchDocumentsInputConfig input_documents = 5 ;
/ / The overall output config for batch process.
/ / The output configuration for the
/ / [ BatchProcessDocuments ] [ google.cloud.documentai.v1beta3.DocumentProcessorService.BatchProcessDocuments ]
/ / method.
DocumentOutputConfig document_output_config = 6 ;
/ / Whether Human Review feature should be skipped for this request. Default to
/ / false .
/ / Whether human review should be skipped for this request. Default to
/ / ` false ` .
bool skip_human_review = 4 ;
/ / Inference - time options for the process API
ProcessOptions process_options = 7 ;
}
/ / Response message for batch process document method.
/ / Response message for
/ / [ BatchProcessDocuments ] [ google.cloud.documentai.v1beta3.DocumentProcessorService.BatchProcessDocuments ] .
message BatchProcessResponse { }
/ / The long running operation metadata for batch process method.
/ / The long - running operation metadata for
/ / [ BatchProcessDocuments ] [ google.cloud.documentai.v1beta3.DocumentProcessorService.BatchProcessDocuments ] .
message BatchProcessMetadata {
/ / The status of a each individual document in the batch process.
message IndividualProcessStatus {
/ / The source of the document , same as the [ input_gcs_source ] field in the
/ / request when the batch process started. The batch process is started by
/ / take snapshot of that document , since a user can move or change that
/ / document during the process.
/ / The source of the document , same as the
/ / [ input_gcs_source ] [ google.cloud.documentai.v1beta3.BatchProcessMetadata.IndividualProcessStatus.input_gcs_source ]
/ / field in the request when the batch process started.
string input_gcs_source = 1 ;
/ / The status processing the document.
google.rpc.Status status = 2 ;
/ / The output_gcs_destination ( in the request as ` output_gcs_destination ` )
/ / The Cloud Storage output destination ( in the request as
/ / [ DocumentOutputConfig.GcsOutputConfig.gcs_uri ] [ google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig.gcs_uri ] )
/ / of the processed document if it was successful , otherwise empty.
string output_gcs_destination = 3 ;
/ / The name of the operation triggered by the processed document. If the
/ / human review process is not triggered , this field will be empty. It has
/ / the same response type and metadata as the long running operation
/ / returned by ReviewDocument method.
/ / human review process isn ' t triggered , this field will be empty. It has
/ / the same response type and metadata as the long - running operation
/ / returned by the
/ / [ ReviewDocument ] [ google.cloud.documentai.v1beta3.DocumentProcessorService.ReviewDocument ]
/ / method.
string human_review_operation = 4 [ deprecated = true ] ;
/ / The status of human review on the processed document.
@ -563,11 +592,13 @@ message BatchProcessMetadata {
repeated IndividualProcessStatus individual_process_statuses = 5 ;
}
/ / Request message for fetch processor types.
/ / Request message for the
/ / [ FetchProcessorTypes ] [ google.cloud.documentai.v1beta3.DocumentProcessorService.FetchProcessorTypes ]
/ / method. Some processor types may require the project be added to an
/ / allowlist.
message FetchProcessorTypesRequest {
/ / Required. The project of processor type to list.
/ / The available processor types may depend on the allow - listing on projects.
/ / Format : ` projects / { project } / locations / { location } `
/ / Required. The location of processor types to list.
/ / Format : ` projects / { project } / locations / { location } ` .
string parent = 1 [
( google.api.field_behavior ) = REQUIRED ,
( google.api.resource_reference ) = {
@ -576,17 +607,21 @@ message FetchProcessorTypesRequest {
] ;
}
/ / Response message for fetch processor types.
/ / Response message for the
/ / [ FetchProcessorTypes ] [ google.cloud.documentai.v1beta3.DocumentProcessorService.FetchProcessorTypes ]
/ / method.
message FetchProcessorTypesResponse {
/ / The list of processor types.
repeated ProcessorType processor_types = 1 ;
}
/ / Request message for list processor types.
/ / Request message for the
/ / [ ListProcessorTypes ] [ google.cloud.documentai.v1beta3.DocumentProcessorService.ListProcessorTypes ]
/ / method. Some processor types may require the project be added to an
/ / allowlist.
message ListProcessorTypesRequest {
/ / Required. The location of processor type to list.
/ / The available processor types may depend on the allow - listing on projects.
/ / Format : ` projects / { project } / locations / { location } `
/ / Required. The location of processor types to list.
/ / Format : ` projects / { project } / locations / { location } ` .
string parent = 1 [
( google.api.field_behavior ) = REQUIRED ,
( google.api.resource_reference ) = {
@ -595,15 +630,17 @@ message ListProcessorTypesRequest {
] ;
/ / The maximum number of processor types to return.
/ / If unspecified , at most 100 processor types will be returned.
/ / The maximum value is 500 ; v alues above 500 will be coerced to 500 .
/ / If unspecified , at most ` 100 ` processor types will be returned.
/ / The maximum value is ` 500 ` . V alues above ` 500 ` will be coerced to ` 500 ` .
int32 page_size = 2 ;
/ / Used to retrieve the next page of results , empty if at the end of the list.
string page_token = 3 ;
}
/ / Response message for list processor types.
/ / Response message for the
/ / [ ListProcessorTypes ] [ google.cloud.documentai.v1beta3.DocumentProcessorService.ListProcessorTypes ]
/ / method.
message ListProcessorTypesResponse {
/ / The processor types.
repeated ProcessorType processor_types = 1 ;
@ -624,8 +661,8 @@ message ListProcessorsRequest {
] ;
/ / The maximum number of processors to return.
/ / If unspecified , at most 50 processors will be returned.
/ / The maximum value is 100 ; v alues above 100 will be coerced to 100 .
/ / If unspecified , at most ` 50 ` processors will be returned.
/ / The maximum value is ` 100 ` . V alues above ` 100 ` will be coerced to ` 100 ` .
int32 page_size = 2 ;
/ / We will return the processors sorted by creation time. The page token
@ -633,7 +670,9 @@ message ListProcessorsRequest {
string page_token = 3 ;
}
/ / Response message for list processors.
/ / Response message for the
/ / [ ListProcessors ] [ google.cloud.documentai.v1beta3.DocumentProcessorService.ListProcessors ]
/ / method.
message ListProcessorsResponse {
/ / The list of processors.
repeated Processor processors = 1 ;
@ -642,7 +681,9 @@ message ListProcessorsResponse {
string next_page_token = 2 ;
}
/ / Request message for get processor.
/ / Request message for the
/ / [ GetProcessorType ] [ google.cloud.documentai.v1beta3.DocumentProcessorService.GetProcessorType ]
/ / method.
message GetProcessorTypeRequest {
/ / Required. The processor type resource name.
string name = 1 [
@ -653,7 +694,9 @@ message GetProcessorTypeRequest {
] ;
}
/ / Request message for get processor.
/ / Request message for the
/ / [ GetProcessor ] [ google.cloud.documentai.v1beta3.DocumentProcessorService.GetProcessor ]
/ / method.
message GetProcessorRequest {
/ / Required. The processor resource name.
string name = 1 [
@ -664,7 +707,9 @@ message GetProcessorRequest {
] ;
}
/ / Request message for get processor version.
/ / Request message for the
/ / [ GetProcessorVersion ] [ google.cloud.documentai.v1beta3.DocumentProcessorService.GetProcessorVersion ]
/ / method.
message GetProcessorVersionRequest {
/ / Required. The processor resource name.
string name = 1 [
@ -688,8 +733,8 @@ message ListProcessorVersionsRequest {
] ;
/ / The maximum number of processor versions to return.
/ / If unspecified , at most 10 processor versions will be returned.
/ / The maximum value is 20 ; v alues above 20 will be coerced to 20 .
/ / If unspecified , at most ` 10 ` processor versions will be returned.
/ / The maximum value is ` 20 ` . V alues above ` 20 ` will be coerced to ` 20 ` .
int32 page_size = 2 ;
/ / We will return the processor versions sorted by creation time. The page
@ -697,7 +742,9 @@ message ListProcessorVersionsRequest {
string page_token = 3 ;
}
/ / Response message for list processors.
/ / Response message for the
/ / [ ListProcessorVersions ] [ google.cloud.documentai.v1beta3.DocumentProcessorService.ListProcessorVersions ]
/ / method.
message ListProcessorVersionsResponse {
/ / The list of processors.
repeated ProcessorVersion processor_versions = 1 ;
@ -706,7 +753,9 @@ message ListProcessorVersionsResponse {
string next_page_token = 2 ;
}
/ / Request message for the delete processor version method.
/ / Request message for the
/ / [ DeleteProcessorVersion ] [ google.cloud.documentai.v1beta3.DocumentProcessorService.DeleteProcessorVersion ]
/ / method.
message DeleteProcessorVersionRequest {
/ / Required. The processor version resource name to be deleted.
string name = 1 [
@ -717,13 +766,17 @@ message DeleteProcessorVersionRequest {
] ;
}
/ / The long running operation metadata for delete processor version method.
/ / The long - running operation metadata for the
/ / [ DeleteProcessorVersion ] [ google.cloud.documentai.v1beta3.DocumentProcessorService.DeleteProcessorVersion ]
/ / method.
message DeleteProcessorVersionMetadata {
/ / The basic metadata of the long running operation.
/ / The basic metadata of the long - running operation.
CommonOperationMetadata common_metadata = 1 ;
}
/ / Request message for the deploy processor version method.
/ / Request message for the
/ / [ DeployProcessorVersion ] [ google.cloud.documentai.v1beta3.DocumentProcessorService.DeployProcessorVersion ]
/ / method.
message DeployProcessorVersionRequest {
/ / Required. The processor version resource name to be deployed.
string name = 1 [
@ -734,16 +787,22 @@ message DeployProcessorVersionRequest {
] ;
}
/ / Response message for the deploy processor version method.
/ / Response message for the
/ / [ DeployProcessorVersion ] [ google.cloud.documentai.v1beta3.DocumentProcessorService.DeployProcessorVersion ]
/ / method.
message DeployProcessorVersionResponse { }
/ / The long running operation metadata for deploy processor version method.
/ / The long - running operation metadata for the
/ / [ DeployProcessorVersion ] [ google.cloud.documentai.v1beta3.DocumentProcessorService.DeployProcessorVersion ]
/ / method.
message DeployProcessorVersionMetadata {
/ / The basic metadata of the long running operation.
/ / The basic metadata of the long - running operation.
CommonOperationMetadata common_metadata = 1 ;
}
/ / Request message for the undeploy processor version method.
/ / Request message for the
/ / [ UndeployProcessorVersion ] [ google.cloud.documentai.v1beta3.DocumentProcessorService.UndeployProcessorVersion ]
/ / method.
message UndeployProcessorVersionRequest {
/ / Required. The processor version resource name to be undeployed.
string name = 1 [
@ -754,19 +813,24 @@ message UndeployProcessorVersionRequest {
] ;
}
/ / Response message for the undeploy processor version method.
/ / Response message for the
/ / [ UndeployProcessorVersion ] [ google.cloud.documentai.v1beta3.DocumentProcessorService.UndeployProcessorVersion ]
/ / method.
message UndeployProcessorVersionResponse { }
/ / The long running operation metadata for the undeploy processor version
/ / The long - running operation metadata for the
/ / [ UndeployProcessorVersion ] [ google.cloud.documentai.v1beta3.DocumentProcessorService.UndeployProcessorVersion ]
/ / method.
message UndeployProcessorVersionMetadata {
/ / The basic metadata of the long running operation.
/ / The basic metadata of the long - running operation.
CommonOperationMetadata common_metadata = 1 ;
}
/ / Request message for create a processor. Notice this request is sent to
/ / a regionalized backend service , and if the processor type is not available
/ / on that region , the creation will fail.
/ / Request message for the
/ / [ CreateProcessor ] [ google.cloud.documentai.v1beta3.DocumentProcessorService.CreateProcessor ]
/ / method. Notice this request is sent to a regionalized backend service. If the
/ / [ ProcessorType ] [ google.cloud.documentai.v1beta3.ProcessorType ] isn ' t
/ / available in that region , the creation fails.
message CreateProcessorRequest {
/ / Required. The parent ( project and location ) under which to create the
/ / processor. Format : ` projects / { project } / locations / { location } `
@ -777,13 +841,17 @@ message CreateProcessorRequest {
}
] ;
/ / Required. The processor to be created , requires [ processor_type ] and
/ / [ display_name ] to be set. Also , the processor is under CMEK if CMEK fields
/ / are set.
/ / Required. The processor to be created , requires
/ / [ Processor.type ] [ google.cloud.documentai.v1beta3.Processor.type ] and
/ / [ Processor.display_name ] ] [ ] to be set. Also , the
/ / [ Processor.kms_key_name ] [ google.cloud.documentai.v1beta3.Processor.kms_key_name ]
/ / field must be set if the processor is under CMEK.
Processor processor = 2 [ ( google.api.field_behavior ) = REQUIRED ] ;
}
/ / Request message for the delete processor method.
/ / Request message for the
/ / [ DeleteProcessor ] [ google.cloud.documentai.v1beta3.DocumentProcessorService.DeleteProcessor ]
/ / method.
message DeleteProcessorRequest {
/ / Required. The processor resource name to be deleted.
string name = 1 [
@ -794,13 +862,17 @@ message DeleteProcessorRequest {
] ;
}
/ / The long running operation metadata for delete processor method.
/ / The long - running operation metadata for the
/ / [ DeleteProcessor ] [ google.cloud.documentai.v1beta3.DocumentProcessorService.DeleteProcessor ]
/ / method.
message DeleteProcessorMetadata {
/ / The basic metadata of the long running operation.
/ / The basic metadata of the long - running operation.
CommonOperationMetadata common_metadata = 5 ;
}
/ / Request message for the enable processor method.
/ / Request message for the
/ / [ EnableProcessor ] [ google.cloud.documentai.v1beta3.DocumentProcessorService.EnableProcessor ]
/ / method.
message EnableProcessorRequest {
/ / Required. The processor resource name to be enabled.
string name = 1 [
@ -811,17 +883,22 @@ message EnableProcessorRequest {
] ;
}
/ / Response message for the enable processor method.
/ / Intentionally empty proto for adding fields in future.
/ / Response message for the
/ / [ EnableProcessor ] [ google.cloud.documentai.v1beta3.DocumentProcessorService.EnableProcessor ]
/ / method. Intentionally empty proto for adding fields in future.
message EnableProcessorResponse { }
/ / The long running operation metadata for enable processor method.
/ / The long - running operation metadata for the
/ / [ EnableProcessor ] [ google.cloud.documentai.v1beta3.DocumentProcessorService.EnableProcessor ]
/ / method.
message EnableProcessorMetadata {
/ / The basic metadata of the long running operation.
/ / The basic metadata of the long - running operation.
CommonOperationMetadata common_metadata = 5 ;
}
/ / Request message for the disable processor method.
/ / Request message for the
/ / [ DisableProcessor ] [ google.cloud.documentai.v1beta3.DocumentProcessorService.DisableProcessor ]
/ / method.
message DisableProcessorRequest {
/ / Required. The processor resource name to be disabled.
string name = 1 [
@ -832,17 +909,22 @@ message DisableProcessorRequest {
] ;
}
/ / Response message for the disable processor method.
/ / Intentionally empty proto for adding fields in future.
/ / Response message for the
/ / [ DisableProcessor ] [ google.cloud.documentai.v1beta3.DocumentProcessorService.DisableProcessor ]
/ / method. Intentionally empty proto for adding fields in future.
message DisableProcessorResponse { }
/ / The long running operation metadata for disable processor method.
/ / The long - running operation metadata for the
/ / [ DisableProcessor ] [ google.cloud.documentai.v1beta3.DocumentProcessorService.DisableProcessor ]
/ / method.
message DisableProcessorMetadata {
/ / The basic metadata of the long running operation.
/ / The basic metadata of the long - running operation.
CommonOperationMetadata common_metadata = 5 ;
}
/ / Request message for the set default processor version method.
/ / Request message for the
/ / [ SetDefaultProcessorVersion ] [ google.cloud.documentai.v1beta3.DocumentProcessorService.SetDefaultProcessorVersion ]
/ / method.
message SetDefaultProcessorVersionRequest {
/ / Required. The resource name of the
/ / [ Processor ] [ google.cloud.documentai.v1beta3.Processor ] to change default
@ -866,19 +948,25 @@ message SetDefaultProcessorVersionRequest {
] ;
}
/ / Response message for set default processor version method.
/ / Response message for the
/ / [ SetDefaultProcessorVersion ] [ google.cloud.documentai.v1beta3.DocumentProcessorService.SetDefaultProcessorVersion ]
/ / method.
message SetDefaultProcessorVersionResponse { }
/ / The long running operation metadata for set default processor version
/ / The long - running operation metadata for the
/ / [ SetDefaultProcessorVersion ] [ google.cloud.documentai.v1beta3.DocumentProcessorService.SetDefaultProcessorVersion ]
/ / method.
message SetDefaultProcessorVersionMetadata {
/ / The basic metadata of the long running operation.
/ / The basic metadata of the long - running operation.
CommonOperationMetadata common_metadata = 1 ;
}
/ / Request message for the create processor version method.
/ / Request message for the
/ / [ TrainProcessorVersion ] [ google.cloud.documentai.v1beta3.DocumentProcessorService.TrainProcessorVersion ]
/ / method.
message TrainProcessorVersionRequest {
/ / The input data used to train a new ` ProcessorVersion ` .
/ / The input data used to train a new
/ / [ ProcessorVersion ] [ google.cloud.documentai.v1beta3.ProcessorVersion ] .
message InputData {
/ / The documents used for training the new version.
BatchDocumentsInputConfig training_documents = 3 ;
@ -887,6 +975,28 @@ message TrainProcessorVersionRequest {
BatchDocumentsInputConfig test_documents = 4 ;
}
/ / Options to control the training of the Custom Document Extraction ( CDE )
/ / Processor.
message CustomDocumentExtractionOptions {
/ / Training Method for CDE. TRAINING_METHOD_UNSPECIFIED will fallback to
/ / MODEL_BASED.
enum TrainingMethod {
TRAINING_METHOD_UNSPECIFIED = 0 ;
MODEL_BASED = 1 ;
TEMPLATE_BASED = 2 ;
}
/ / Training method to use for CDE training.
TrainingMethod training_method = 3 ;
}
oneof processor_flags {
/ / Options to control Custom Document Extraction ( CDE ) Processor.
CustomDocumentExtractionOptions custom_document_extraction_options = 5 ;
}
/ / Required. The parent ( project , location and processor ) to create the new
/ / version for. Format :
/ / ` projects / { project } / locations / { location } / processors / { processor } ` .
@ -904,7 +1014,8 @@ message TrainProcessorVersionRequest {
/ / Optional. The schema the processor version will be trained with.
DocumentSchema document_schema = 10 [ ( google.api.field_behavior ) = OPTIONAL ] ;
/ / Optional. The input data used to train the ` ProcessorVersion ` .
/ / Optional. The input data used to train the
/ / [ ProcessorVersion ] [ google.cloud.documentai.v1beta3.ProcessorVersion ] .
InputData input_data = 4 [ ( google.api.field_behavior ) = OPTIONAL ] ;
/ / Optional. The processor version to use as a base for training. This
@ -913,7 +1024,8 @@ message TrainProcessorVersionRequest {
string base_processor_version = 8 [ ( google.api.field_behavior ) = OPTIONAL ] ;
}
/ / The response for the TrainProcessorVersion method.
/ / The response for
/ / [ TrainProcessorVersion ] [ google.cloud.documentai.v1beta3.DocumentProcessorService.TrainProcessorVersion ] .
message TrainProcessorVersionResponse {
/ / The resource name of the processor version produced by training.
string processor_version = 1 ;
@ -941,7 +1053,7 @@ message TrainProcessorVersionMetadata {
repeated google.rpc.Status dataset_errors = 2 ;
}
/ / The basic metadata of the long running operation.
/ / The basic metadata of the long - running operation.
CommonOperationMetadata common_metadata = 1 ;
/ / The training dataset validation information.
@ -951,7 +1063,9 @@ message TrainProcessorVersionMetadata {
DatasetValidation test_dataset_validation = 3 ;
}
/ / Request message for review document method.
/ / Request message for the
/ / [ ReviewDocument ] [ google.cloud.documentai.v1beta3.DocumentProcessorService.ReviewDocument ]
/ / method.
message ReviewDocumentRequest {
/ / The priority level of the human review task.
enum Priority {
@ -969,8 +1083,9 @@ message ReviewDocumentRequest {
Document inline_document = 4 ;
}
/ / Required. The resource name of the HumanReviewConfig that the document will
/ / be reviewed with.
/ / Required. The resource name of the
/ / [ HumanReviewConfig ] [ google.cloud.documentai.v1beta3.HumanReviewConfig ] that
/ / the document will be reviewed with.
string human_review_config = 1 [
( google.api.field_behavior ) = REQUIRED ,
( google.api.resource_reference ) = {
@ -991,7 +1106,9 @@ message ReviewDocumentRequest {
DocumentSchema document_schema = 6 ;
}
/ / Response message for review document method.
/ / Response message for the
/ / [ ReviewDocument ] [ google.cloud.documentai.v1beta3.DocumentProcessorService.ReviewDocument ]
/ / method.
message ReviewDocumentResponse {
/ / Possible states of the review operation.
enum State {
@ -1016,9 +1133,11 @@ message ReviewDocumentResponse {
string rejection_reason = 3 ;
}
/ / The long running operation metadata for review document method.
/ / The long - running operation metadata for the
/ / [ ReviewDocument ] [ google.cloud.documentai.v1beta3.DocumentProcessorService.ReviewDocument ]
/ / method.
message ReviewDocumentOperationMetadata {
/ / State of the longrunning operation.
/ / State of the long - running operation.
enum State {
/ / Unspecified state.
STATE_UNSPECIFIED = 0 ;
@ -1052,14 +1171,16 @@ message ReviewDocumentOperationMetadata {
/ / The last update time of the operation.
google.protobuf.Timestamp update_time = 4 ;
/ / The basic metadata of the long running operation.
/ / The basic metadata of the long - running operation.
CommonOperationMetadata common_metadata = 5 ;
/ / The Crowd Compute question ID.
string question_id = 6 ;
}
/ / Evaluates the given ProcessorVersion against the supplied documents.
/ / Evaluates the given
/ / [ ProcessorVersion ] [ google.cloud.documentai.v1beta3.ProcessorVersion ] against
/ / the supplied documents.
message EvaluateProcessorVersionRequest {
/ / Required. The resource name of the
/ / [ ProcessorVersion ] [ google.cloud.documentai.v1beta3.ProcessorVersion ] to
@ -1078,13 +1199,17 @@ message EvaluateProcessorVersionRequest {
[ ( google.api.field_behavior ) = OPTIONAL ] ;
}
/ / Metadata of the EvaluateProcessorVersion method.
/ / Metadata of the
/ / [ EvaluateProcessorVersion ] [ google.cloud.documentai.v1beta3.DocumentProcessorService.EvaluateProcessorVersion ]
/ / method.
message EvaluateProcessorVersionMetadata {
/ / The basic metadata of the long running operation.
/ / The basic metadata of the long - running operation.
CommonOperationMetadata common_metadata = 1 ;
}
/ / Metadata of the EvaluateProcessorVersion method.
/ / Response of the
/ / [ EvaluateProcessorVersion ] [ google.cloud.documentai.v1beta3.DocumentProcessorService.EvaluateProcessorVersion ]
/ / method.
message EvaluateProcessorVersionResponse {
/ / The resource name of the created evaluation.
string evaluation = 2 ;
@ -1103,7 +1228,8 @@ message GetEvaluationRequest {
] ;
}
/ / Retrieves a list of evaluations for a given ProcessorVersion.
/ / Retrieves a list of evaluations for a given
/ / [ ProcessorVersion ] [ google.cloud.documentai.v1beta3.ProcessorVersion ] .
message ListEvaluationsRequest {
/ / Required. The resource name of the
/ / [ ProcessorVersion ] [ google.cloud.documentai.v1beta3.ProcessorVersion ] to
@ -1117,8 +1243,8 @@ message ListEvaluationsRequest {
] ;
/ / The standard list page size.
/ / If unspecified , at most 5 evaluations will b e returned.
/ / The maximum value is 100 ; values above 100 will be coerced to 100 .
/ / If unspecified , at most ` 5 ` evaluations ar e returned.
/ / The maximum value is ` 100 ` . Values above ` 100 ` are coerced to ` 100 ` .
int32 page_size = 2 ;
/ / A page token , received from a previous ` ListEvaluations ` call.
@ -1126,7 +1252,7 @@ message ListEvaluationsRequest {
string page_token = 3 ;
}
/ / The response from ListEvaluations.
/ / The response from ` ListEvaluations ` .
message ListEvaluationsResponse {
/ / The evaluations requested.
repeated Evaluation evaluations = 1 ;
@ -1136,19 +1262,27 @@ message ListEvaluationsResponse {
string next_page_token = 2 ;
}
/ / The request message for the ImportProcessorVersion method.
/ / This method requires Document AI Service Agent of the destination project in
/ / the source project ' s IAM with [ Document AI Editor
/ / role ] ( https : / / cloud.google.com / document - ai / docs / access - control / iam - roles ) .
/ / The request message for the
/ / [ ImportProcessorVersion ] [ google.cloud.documentai.v1beta3.DocumentProcessorService.ImportProcessorVersion ]
/ / method. Requirements :
/ /
/ / The destination project is specified as part of the ` parent ` field.
/ / The source project is specified as part of ` source ` field.
/ / - The source processor version and destination processor
/ / must be in the same location.
/ / - The Document AI [ Service
/ / Agent ] ( https : / / cloud.google.com / iam / docs / service - agents ) of the destination
/ / project must have [ Document AI Editor
/ / role ] ( https : / / cloud.google.com / document - ai / docs / access - control / iam - roles ) on
/ / the source project.
/ /
/ / The Service Agent for Document AI can be found in
/ / https : / / cloud.google.com / iam / docs / service - agents.
/ / The destination project is specified as part of the
/ / [ parent ] [ google.cloud.documentai.v1beta3.ImportProcessorVersionRequest.parent ]
/ / field. The source project is specified as part of the
/ / [ source ] [ google.cloud.documentai.v1beta3.ImportProcessorVersionRequest.processor_version_source ]
/ / field.
message ImportProcessorVersionRequest {
oneof source {
/ / The source processor version to import from.
/ / The source processor version to import from. The source processor version
/ / and destination processor need to be in the same environment and region.
string processor_version_source = 2 [ ( google.api.resource_reference ) = {
type : "documentai.googleapis.com/ProcessorVersion"
} ] ;
@ -1165,7 +1299,9 @@ message ImportProcessorVersionRequest {
] ;
}
/ / The response message for the ImportProcessorVersion method.
/ / The response message for the
/ / [ ImportProcessorVersion ] [ google.cloud.documentai.v1beta3.DocumentProcessorService.ImportProcessorVersion ]
/ / method.
message ImportProcessorVersionResponse {
/ / The destination processor version name.
string processor_version = 1 [ ( google.api.resource_reference ) = {
@ -1173,9 +1309,10 @@ message ImportProcessorVersionResponse {
} ] ;
}
/ / The long running operation metadata for the ImportProcessorVersion
/ / The long - running operation metadata for the
/ / [ ImportProcessorVersion ] [ google.cloud.documentai.v1beta3.DocumentProcessorService.ImportProcessorVersion ]
/ / method.
message ImportProcessorVersionMetadata {
/ / The basic metadata for the long running operation.
/ / The basic metadata for the long - running operation.
CommonOperationMetadata common_metadata = 1 ;
}