Skip to main content

processors

Creates, updates, deletes, gets or lists a processors resource.

Overview

Nameprocessors
TypeResource
Idgoogle.documentai.processors

Fields

The following fields are returned by SELECT queries:

Successful response

NameDatatypeDescription
namestringOutput only. Immutable. The resource name of the processor. Format: projects/{project}/locations/{location}/processors/{processor}
createTimestring (google-datetime)Output only. The time the processor was created.
defaultProcessorVersionstringThe default processor version.
displayNamestringThe display name of the processor.
kmsKeyNamestringThe KMS key used for encryption and decryption in CMEK scenarios.
processEndpointstringOutput only. Immutable. The http endpoint that can be called to invoke processing.
processorVersionAliasesarrayOutput only. The processor version aliases.
satisfiesPzibooleanOutput only. Reserved for future use.
satisfiesPzsbooleanOutput only. Reserved for future use.
statestringOutput only. The state of the processor.
typestringThe processor type, such as: OCR_PROCESSOR, INVOICE_PROCESSOR. To get a list of processor types, see FetchProcessorTypes.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
projects_locations_processors_getselectprojectsId, locationsId, processorsIdGets a processor detail.
projects_locations_processors_listselectprojectsId, locationsIdpageSize, pageTokenLists all processors which belong to this project.
projects_locations_processors_createinsertprojectsId, locationsIdCreates 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.
projects_locations_processors_deletedeleteprojectsId, locationsId, processorsIdDeletes the processor, unloads all deployed model artifacts if it was enabled and then deletes all artifacts associated with this processor.
projects_locations_processors_processexecprojectsId, locationsId, processorsIdProcesses a single document.
projects_locations_processors_batch_processexecprojectsId, locationsId, processorsIdLRO endpoint to batch process many documents. The output is written to Cloud Storage as JSON in the [Document] format.
projects_locations_processors_enableexecprojectsId, locationsId, processorsIdEnables a processor
projects_locations_processors_disableexecprojectsId, locationsId, processorsIdDisables a processor
projects_locations_processors_set_default_processor_versionexecprojectsId, locationsId, processorsIdSet the default (active) version of a Processor that will be used in ProcessDocument and BatchProcessDocuments.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
locationsIdstring
processorsIdstring
projectsIdstring
pageSizeinteger (int32)
pageTokenstring

SELECT examples

Gets a processor detail.

SELECT
name,
createTime,
defaultProcessorVersion,
displayName,
kmsKeyName,
processEndpoint,
processorVersionAliases,
satisfiesPzi,
satisfiesPzs,
state,
type
FROM google.documentai.processors
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND processorsId = '{{ processorsId }}' -- required;

INSERT examples

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.

INSERT INTO google.documentai.processors (
data__type,
data__displayName,
data__defaultProcessorVersion,
data__kmsKeyName,
projectsId,
locationsId
)
SELECT
'{{ type }}',
'{{ displayName }}',
'{{ defaultProcessorVersion }}',
'{{ kmsKeyName }}',
'{{ projectsId }}',
'{{ locationsId }}'
RETURNING
name,
createTime,
defaultProcessorVersion,
displayName,
kmsKeyName,
processEndpoint,
processorVersionAliases,
satisfiesPzi,
satisfiesPzs,
state,
type
;

DELETE examples

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

DELETE FROM google.documentai.processors
WHERE projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND processorsId = '{{ processorsId }}' --required;

Lifecycle Methods

Processes a single document.

EXEC google.documentai.processors.projects_locations_processors_process 
@projectsId='{{ projectsId }}' --required,
@locationsId='{{ locationsId }}' --required,
@processorsId='{{ processorsId }}' --required
@@json=
'{
"inlineDocument": "{{ inlineDocument }}",
"rawDocument": "{{ rawDocument }}",
"gcsDocument": "{{ gcsDocument }}",
"skipHumanReview": {{ skipHumanReview }},
"fieldMask": "{{ fieldMask }}",
"processOptions": "{{ processOptions }}",
"labels": "{{ labels }}",
"imagelessMode": {{ imagelessMode }}
}';