Send feedback
Class v1.DocumentProcessorServiceClient (2.10.0)
Stay organized with collections
Save and categorize content based on your preferences.
Version 2.10.0 keyboard_arrow_down
Service to call Cloud DocumentAI 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. v1
Package
@google-cloud/documentai!
Constructors
(constructor)(opts)
constructor ( opts ?: ClientOptions );
Construct an instance of DocumentProcessorServiceClient.
Parameter
Name Description opts
ClientOptions
Properties
apiEndpoint
static get apiEndpoint () : string ;
The DNS address for this API service - same as servicePath(), exists for compatibility reasons.
Property Value
auth
Property Value
Type Description gax.GoogleAuth
descriptors
descriptors : Descriptors ;
Property Value
Type Description Descriptors
documentProcessorServiceStub
documentProcessorServiceStub ?: Promise <{
[ name : string ] : Function ;
}>;
Property Value
Type Description Promise <{
[name: string]: Function ;
}>
innerApiCalls
innerApiCalls : {
[ name : string ] : Function ;
};
Property Value
Type Description {
[name: string]: Function ;
}
operationsClient
operationsClient : gax . OperationsClient ;
Property Value
Type Description gax.OperationsClient
pathTemplates
pathTemplates : {
[ name : string ] : gax . PathTemplate ;
};
Property Value
Type Description {
[name: string]: gax.PathTemplate ;
}
port
static get port () : number ;
The port for this API service.
Property Value
scopes
static get scopes () : string [];
The scopes needed to make gRPC calls for every method defined in this service.
Property Value
servicePath
static get servicePath () : string ;
The DNS address for this API service.
Property Value
Methods
batchProcessDocuments(request, options)
batchProcessDocuments ( request : protos . google . cloud . documentai . v1 . IBatchProcessRequest , options ?: CallOptions ) : Promise <[ LROperation<protos . google . cloud . documentai . v1 . IBatchProcessResponse , protos . google . cloud . documentai . v1 . IBatchProcessMetadata >, protos . google . longrunning . IOperation | undefined , {} | undefined ]>;
Parameters
Name Description request
protos.google.cloud.documentai.v1.IBatchProcessRequest
options
CallOptions
Returns
Type Description Promise <[LROperation <protos.google.cloud.documentai.v1.IBatchProcessResponse , protos.google.cloud.documentai.v1.IBatchProcessMetadata >, protos.google.longrunning.IOperation | undefined, {} | undefined]>
batchProcessDocuments(request, options, callback)
batchProcessDocuments ( request : protos . google . cloud . documentai . v1 . IBatchProcessRequest , options : CallOptions , callback : Callback<LROperation<protos . google . cloud . documentai . v1 . IBatchProcessResponse , protos . google . cloud . documentai . v1 . IBatchProcessMetadata >, protos . google . longrunning . IOperation | null | undefined , {} | null | undefined >) : void ;
Parameters
Name Description request
protos.google.cloud.documentai.v1.IBatchProcessRequest
options
CallOptions
callback
Callback <LROperation <protos.google.cloud.documentai.v1.IBatchProcessResponse , protos.google.cloud.documentai.v1.IBatchProcessMetadata >, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
batchProcessDocuments(request, callback)
batchProcessDocuments ( request : protos . google . cloud . documentai . v1 . IBatchProcessRequest , callback : Callback<LROperation<protos . google . cloud . documentai . v1 . IBatchProcessResponse , protos . google . cloud . documentai . v1 . IBatchProcessMetadata >, protos . google . longrunning . IOperation | null | undefined , {} | null | undefined >) : void ;
Parameters
Name Description request
protos.google.cloud.documentai.v1.IBatchProcessRequest
callback
Callback <LROperation <protos.google.cloud.documentai.v1.IBatchProcessResponse , protos.google.cloud.documentai.v1.IBatchProcessMetadata >, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
checkBatchProcessDocumentsProgress(name)
checkBatchProcessDocumentsProgress ( name : string ) : Promise<LROperation<protos . google . cloud . documentai . v1 . BatchProcessResponse , protos . google . cloud . documentai . v1 . BatchProcessMetadata >>;
Check the status of the long running operation returned by batchProcessDocuments()
.
Parameter
Name Description name
string
The operation name that will be passed.
Returns
Type Description Promise <LROperation <protos.google.cloud.documentai.v1.BatchProcessResponse , protos.google.cloud.documentai.v1.BatchProcessMetadata >>{Promise} - The promise which resolves to an object. The decoded operation object has result and metadata field to get information from. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) for more details and examples.
checkReviewDocumentProgress(name)
checkReviewDocumentProgress ( name : string ) : Promise<LROperation<protos . google . cloud . documentai . v1 . ReviewDocumentResponse , protos . google . cloud . documentai . v1 . ReviewDocumentOperationMetadata >>;
Check the status of the long running operation returned by reviewDocument()
.
Parameter
Name Description name
string
The operation name that will be passed.
Returns
Type Description Promise <LROperation <protos.google.cloud.documentai.v1.ReviewDocumentResponse , protos.google.cloud.documentai.v1.ReviewDocumentOperationMetadata >>{Promise} - The promise which resolves to an object. The decoded operation object has result and metadata field to get information from. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) for more details and examples.
close()
Terminate the gRPC channel and close the client.
The client will no longer be usable and all future behavior is undefined.
Returns
Type Description Promise <void>{Promise} A promise that resolves when the client is closed.
getProjectId()
getProjectId () : Promise<string> ;
Returns
Type Description Promise <string>
getProjectId(callback)
getProjectId ( callback : Callback<string , undefined , undefined >) : void ;
Parameter
Name Description callback
Callback <string, undefined, undefined>
Returns
humanReviewConfigPath(project, location, processor)
humanReviewConfigPath ( project : string , location : string , processor : string ) : string ;
Return a fully-qualified humanReviewConfig resource name string.
Parameters
Name Description project
string
location
string
processor
string
Returns
Type Description string {string} Resource name string.
initialize()
initialize () : Promise <{
[ name : string ] : Function ;
}>;
Initialize the client. Performs asynchronous operations (such as authentication) and prepares the client. This function will be called automatically when any class method is called for the first time, but if you need to initialize it before calling an actual method, feel free to call initialize() directly.
You can await on this method if you want to make sure the client is initialized.
Returns
Type Description Promise <{
[name: string]: Function ;
}>{Promise} A promise that resolves to an authenticated service stub.
matchLocationFromHumanReviewConfigName(humanReviewConfigName)
matchLocationFromHumanReviewConfigName ( humanReviewConfigName : string ) : string | number ;
Parse the location from HumanReviewConfig resource.
Parameter
Name Description humanReviewConfigName
string
A fully-qualified path representing HumanReviewConfig resource.
Returns
Type Description string | number {string} A string representing the location.
matchLocationFromProcessorName(processorName)
matchLocationFromProcessorName ( processorName : string ) : string | number ;
Parse the location from Processor resource.
Parameter
Name Description processorName
string
A fully-qualified path representing Processor resource.
Returns
Type Description string | number {string} A string representing the location.
matchProcessorFromHumanReviewConfigName(humanReviewConfigName)
matchProcessorFromHumanReviewConfigName ( humanReviewConfigName : string ) : string | number ;
Parse the processor from HumanReviewConfig resource.
Parameter
Name Description humanReviewConfigName
string
A fully-qualified path representing HumanReviewConfig resource.
Returns
Type Description string | number {string} A string representing the processor.
matchProcessorFromProcessorName(processorName)
matchProcessorFromProcessorName ( processorName : string ) : string | number ;
Parse the processor from Processor resource.
Parameter
Name Description processorName
string
A fully-qualified path representing Processor resource.
Returns
Type Description string | number {string} A string representing the processor.
matchProjectFromHumanReviewConfigName(humanReviewConfigName)
matchProjectFromHumanReviewConfigName ( humanReviewConfigName : string ) : string | number ;
Parse the project from HumanReviewConfig resource.
Parameter
Name Description humanReviewConfigName
string
A fully-qualified path representing HumanReviewConfig resource.
Returns
Type Description string | number {string} A string representing the project.
matchProjectFromProcessorName(processorName)
matchProjectFromProcessorName ( processorName : string ) : string | number ;
Parse the project from Processor resource.
Parameter
Name Description processorName
string
A fully-qualified path representing Processor resource.
Returns
Type Description string | number {string} A string representing the project.
processDocument(request, options)
processDocument ( request : protos . google . cloud . documentai . v1 . IProcessRequest , options ?: CallOptions ) : Promise <[ protos . google . cloud . documentai . v1 . IProcessResponse , protos . google . cloud . documentai . v1 . IProcessRequest | undefined , {} | undefined ]>;
Parameters
Name Description request
protos.google.cloud.documentai.v1.IProcessRequest
options
CallOptions
Returns
Type Description Promise <[protos.google.cloud.documentai.v1.IProcessResponse , protos.google.cloud.documentai.v1.IProcessRequest | undefined, {} | undefined]>
processDocument(request, options, callback)
processDocument ( request : protos . google . cloud . documentai . v1 . IProcessRequest , options : CallOptions , callback : Callback<protos . google . cloud . documentai . v1 . IProcessResponse , protos . google . cloud . documentai . v1 . IProcessRequest | null | undefined , {} | null | undefined >) : void ;
Parameters
Name Description request
protos.google.cloud.documentai.v1.IProcessRequest
options
CallOptions
callback
Callback <protos.google.cloud.documentai.v1.IProcessResponse , protos.google.cloud.documentai.v1.IProcessRequest | null | undefined, {} | null | undefined>
Returns
processDocument(request, callback)
processDocument ( request : protos . google . cloud . documentai . v1 . IProcessRequest , callback : Callback<protos . google . cloud . documentai . v1 . IProcessResponse , protos . google . cloud . documentai . v1 . IProcessRequest | null | undefined , {} | null | undefined >) : void ;
Parameters
Name Description request
protos.google.cloud.documentai.v1.IProcessRequest
callback
Callback <protos.google.cloud.documentai.v1.IProcessResponse , protos.google.cloud.documentai.v1.IProcessRequest | null | undefined, {} | null | undefined>
Returns
processorPath(project, location, processor)
processorPath ( project : string , location : string , processor : string ) : string ;
Return a fully-qualified processor resource name string.
Parameters
Name Description project
string
location
string
processor
string
Returns
Type Description string {string} Resource name string.
reviewDocument(request, options)
reviewDocument ( request : protos . google . cloud . documentai . v1 . IReviewDocumentRequest , options ?: CallOptions ) : Promise <[ LROperation<protos . google . cloud . documentai . v1 . IReviewDocumentResponse , protos . google . cloud . documentai . v1 . IReviewDocumentOperationMetadata >, protos . google . longrunning . IOperation | undefined , {} | undefined ]>;
Parameters
Name Description request
protos.google.cloud.documentai.v1.IReviewDocumentRequest
options
CallOptions
Returns
Type Description Promise <[LROperation <protos.google.cloud.documentai.v1.IReviewDocumentResponse , protos.google.cloud.documentai.v1.IReviewDocumentOperationMetadata >, protos.google.longrunning.IOperation | undefined, {} | undefined]>
reviewDocument(request, options, callback)
reviewDocument ( request : protos . google . cloud . documentai . v1 . IReviewDocumentRequest , options : CallOptions , callback : Callback<LROperation<protos . google . cloud . documentai . v1 . IReviewDocumentResponse , protos . google . cloud . documentai . v1 . IReviewDocumentOperationMetadata >, protos . google . longrunning . IOperation | null | undefined , {} | null | undefined >) : void ;
Parameters
Name Description request
protos.google.cloud.documentai.v1.IReviewDocumentRequest
options
CallOptions
callback
Callback <LROperation <protos.google.cloud.documentai.v1.IReviewDocumentResponse , protos.google.cloud.documentai.v1.IReviewDocumentOperationMetadata >, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
reviewDocument(request, callback)
reviewDocument ( request : protos . google . cloud . documentai . v1 . IReviewDocumentRequest , callback : Callback<LROperation<protos . google . cloud . documentai . v1 . IReviewDocumentResponse , protos . google . cloud . documentai . v1 . IReviewDocumentOperationMetadata >, protos . google . longrunning . IOperation | null | undefined , {} | null | undefined >) : void ;
Parameters
Name Description request
protos.google.cloud.documentai.v1.IReviewDocumentRequest
callback
Callback <LROperation <protos.google.cloud.documentai.v1.IReviewDocumentResponse , protos.google.cloud.documentai.v1.IReviewDocumentOperationMetadata >, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
Send feedback
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License , and code samples are licensed under the Apache 2.0 License . For details, see the Google Developers Site Policies . Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-11-21 UTC.
Need to tell us more?
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-11-21 UTC."],[],[]]