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. v1beta3
Package
@google-cloud/documentaiConstructors
(constructor)(opts, gaxInstance)
constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback);
Construct an instance of DocumentProcessorServiceClient.
Parameters | |
---|---|
Name | Description |
opts |
ClientOptions
|
gaxInstance |
typeof gax | typeof fallback
: loaded instance of |
Properties
apiEndpoint
get apiEndpoint(): string;
The DNS address for this API service.
apiEndpoint
static get apiEndpoint(): string;
The DNS address for this API service - same as servicePath.
auth
auth: gax.GoogleAuth;
descriptors
descriptors: Descriptors;
documentProcessorServiceStub
documentProcessorServiceStub?: Promise<{
[name: string]: Function;
}>;
innerApiCalls
innerApiCalls: {
[name: string]: Function;
};
locationsClient
locationsClient: LocationsClient;
operationsClient
operationsClient: gax.OperationsClient;
pathTemplates
pathTemplates: {
[name: string]: gax.PathTemplate;
};
port
static get port(): number;
The port for this API service.
scopes
static get scopes(): string[];
The scopes needed to make gRPC calls for every method defined in this service.
servicePath
static get servicePath(): string;
The DNS address for this API service.
universeDomain
get universeDomain(): string;
warn
warn: (code: string, message: string, warnType?: string) => void;
Methods
batchProcessDocuments(request, options)
batchProcessDocuments(request?: protos.google.cloud.documentai.v1beta3.IBatchProcessRequest, options?: CallOptions): Promise<[
LROperation<protos.google.cloud.documentai.v1beta3.IBatchProcessResponse, protos.google.cloud.documentai.v1beta3.IBatchProcessMetadata>,
protos.google.longrunning.IOperation | undefined,
{} | undefined
]>;
LRO endpoint to batch process many documents. The output is written to Cloud Storage as JSON in the [Document] format.
Parameters | |
---|---|
Name | Description |
request |
IBatchProcessRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
Promise<[
LROperation<protos.google.cloud.documentai.v1beta3.IBatchProcessResponse, protos.google.cloud.documentai.v1beta3.IBatchProcessMetadata>,
protos.google.longrunning.IOperation | undefined,
{} | undefined
]> | {Promise} - The promise which resolves to an array. The first element of the array is an object representing a long running operation. Its |
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. The resource name of
* Processor google.cloud.documentai.v1beta3.Processor or
* ProcessorVersion google.cloud.documentai.v1beta3.ProcessorVersion.
* Format: `projects/{project}/locations/{location}/processors/{processor}`,
* or
* `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}`
*/
// const name = 'abc123'
/**
* The input config for each single document in the batch process.
*/
// const inputConfigs = [1,2,3,4]
/**
* The overall output config for batch process.
*/
// const outputConfig = {}
/**
* The input documents for the
* BatchProcessDocuments google.cloud.documentai.v1beta3.DocumentProcessorService.BatchProcessDocuments
* method.
*/
// const inputDocuments = {}
/**
* The output configuration for the
* BatchProcessDocuments google.cloud.documentai.v1beta3.DocumentProcessorService.BatchProcessDocuments
* method.
*/
// const documentOutputConfig = {}
/**
* Whether human review should be skipped for this request. Default to
* `false`.
*/
// const skipHumanReview = true
/**
* Inference-time options for the process API
*/
// const processOptions = {}
/**
* Optional. The labels with user-defined metadata for the request.
* Label keys and values can be no longer than 63 characters
* (Unicode codepoints) and can only contain lowercase letters, numeric
* characters, underscores, and dashes. International characters are allowed.
* Label values are optional. Label keys must start with a letter.
*/
// const labels = [1,2,3,4]
// Imports the Documentai library
const {DocumentProcessorServiceClient} = require('@google-cloud/documentai').v1beta3;
// Instantiates a client
const documentaiClient = new DocumentProcessorServiceClient();
async function callBatchProcessDocuments() {
// Construct request
const request = {
name,
};
// Run request
const [operation] = await documentaiClient.batchProcessDocuments(request);
const [response] = await operation.promise();
console.log(response);
}
callBatchProcessDocuments();
batchProcessDocuments(request, options, callback)
batchProcessDocuments(request: protos.google.cloud.documentai.v1beta3.IBatchProcessRequest, options: CallOptions, callback: Callback<LROperation<protos.google.cloud.documentai.v1beta3.IBatchProcessResponse, protos.google.cloud.documentai.v1beta3.IBatchProcessMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
IBatchProcessRequest
|
options |
CallOptions
|
callback |
Callback<LROperation<protos.google.cloud.documentai.v1beta3.IBatchProcessResponse, protos.google.cloud.documentai.v1beta3.IBatchProcessMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
batchProcessDocuments(request, callback)
batchProcessDocuments(request: protos.google.cloud.documentai.v1beta3.IBatchProcessRequest, callback: Callback<LROperation<protos.google.cloud.documentai.v1beta3.IBatchProcessResponse, protos.google.cloud.documentai.v1beta3.IBatchProcessMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
IBatchProcessRequest
|
callback |
Callback<LROperation<protos.google.cloud.documentai.v1beta3.IBatchProcessResponse, protos.google.cloud.documentai.v1beta3.IBatchProcessMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
cancelOperation(request, options, callback)
cancelOperation(request: protos.google.longrunning.CancelOperationRequest, options?: gax.CallOptions | Callback<protos.google.protobuf.Empty, protos.google.longrunning.CancelOperationRequest, {} | undefined | null>, callback?: Callback<protos.google.longrunning.CancelOperationRequest, protos.google.protobuf.Empty, {} | undefined | null>): Promise<protos.google.protobuf.Empty>;
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 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 value with a of 1, corresponding to Code.CANCELLED
.
Parameters | |
---|---|
Name | Description |
request |
CancelOperationRequest
The request object that will be sent. |
options |
CallOptions | Callback<protos.google.protobuf.Empty, protos.google.longrunning.CancelOperationRequest, {} | undefined | null>
Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details. |
callback |
Callback<protos.google.longrunning.CancelOperationRequest, protos.google.protobuf.Empty, {} | undefined | null>
The function which will be called with the result of the API call. {Promise} - The promise which resolves when API call finishes. The promise has a method named "cancel" which cancels the ongoing API call. |
Returns | |
---|---|
Type | Description |
Promise<protos.google.protobuf.Empty> |
const client = longrunning.operationsClient();
await client.cancelOperation({name: ''});
checkBatchProcessDocumentsProgress(name)
checkBatchProcessDocumentsProgress(name: string): Promise<LROperation<protos.google.cloud.documentai.v1beta3.BatchProcessResponse, protos.google.cloud.documentai.v1beta3.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.v1beta3.BatchProcessResponse, protos.google.cloud.documentai.v1beta3.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 for more details and examples. |
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. The resource name of
* Processor google.cloud.documentai.v1beta3.Processor or
* ProcessorVersion google.cloud.documentai.v1beta3.ProcessorVersion.
* Format: `projects/{project}/locations/{location}/processors/{processor}`,
* or
* `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}`
*/
// const name = 'abc123'
/**
* The input config for each single document in the batch process.
*/
// const inputConfigs = [1,2,3,4]
/**
* The overall output config for batch process.
*/
// const outputConfig = {}
/**
* The input documents for the
* BatchProcessDocuments google.cloud.documentai.v1beta3.DocumentProcessorService.BatchProcessDocuments
* method.
*/
// const inputDocuments = {}
/**
* The output configuration for the
* BatchProcessDocuments google.cloud.documentai.v1beta3.DocumentProcessorService.BatchProcessDocuments
* method.
*/
// const documentOutputConfig = {}
/**
* Whether human review should be skipped for this request. Default to
* `false`.
*/
// const skipHumanReview = true
/**
* Inference-time options for the process API
*/
// const processOptions = {}
/**
* Optional. The labels with user-defined metadata for the request.
* Label keys and values can be no longer than 63 characters
* (Unicode codepoints) and can only contain lowercase letters, numeric
* characters, underscores, and dashes. International characters are allowed.
* Label values are optional. Label keys must start with a letter.
*/
// const labels = [1,2,3,4]
// Imports the Documentai library
const {DocumentProcessorServiceClient} = require('@google-cloud/documentai').v1beta3;
// Instantiates a client
const documentaiClient = new DocumentProcessorServiceClient();
async function callBatchProcessDocuments() {
// Construct request
const request = {
name,
};
// Run request
const [operation] = await documentaiClient.batchProcessDocuments(request);
const [response] = await operation.promise();
console.log(response);
}
callBatchProcessDocuments();
checkDeleteProcessorProgress(name)
checkDeleteProcessorProgress(name: string): Promise<LROperation<protos.google.protobuf.Empty, protos.google.cloud.documentai.v1beta3.DeleteProcessorMetadata>>;
Check the status of the long running operation returned by deleteProcessor()
.
Parameter | |
---|---|
Name | Description |
name |
string
The operation name that will be passed. |
Returns | |
---|---|
Type | Description |
Promise<LROperation<protos.google.protobuf.Empty, protos.google.cloud.documentai.v1beta3.DeleteProcessorMetadata>> | {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 for more details and examples. |
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. The processor resource name to be deleted.
*/
// const name = 'abc123'
// Imports the Documentai library
const {DocumentProcessorServiceClient} = require('@google-cloud/documentai').v1beta3;
// Instantiates a client
const documentaiClient = new DocumentProcessorServiceClient();
async function callDeleteProcessor() {
// Construct request
const request = {
name,
};
// Run request
const [operation] = await documentaiClient.deleteProcessor(request);
const [response] = await operation.promise();
console.log(response);
}
callDeleteProcessor();
checkDeleteProcessorVersionProgress(name)
checkDeleteProcessorVersionProgress(name: string): Promise<LROperation<protos.google.protobuf.Empty, protos.google.cloud.documentai.v1beta3.DeleteProcessorVersionMetadata>>;
Check the status of the long running operation returned by deleteProcessorVersion()
.
Parameter | |
---|---|
Name | Description |
name |
string
The operation name that will be passed. |
Returns | |
---|---|
Type | Description |
Promise<LROperation<protos.google.protobuf.Empty, protos.google.cloud.documentai.v1beta3.DeleteProcessorVersionMetadata>> | {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 for more details and examples. |
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. The processor version resource name to be deleted.
*/
// const name = 'abc123'
// Imports the Documentai library
const {DocumentProcessorServiceClient} = require('@google-cloud/documentai').v1beta3;
// Instantiates a client
const documentaiClient = new DocumentProcessorServiceClient();
async function callDeleteProcessorVersion() {
// Construct request
const request = {
name,
};
// Run request
const [operation] = await documentaiClient.deleteProcessorVersion(request);
const [response] = await operation.promise();
console.log(response);
}
callDeleteProcessorVersion();
checkDeployProcessorVersionProgress(name)
checkDeployProcessorVersionProgress(name: string): Promise<LROperation<protos.google.cloud.documentai.v1beta3.DeployProcessorVersionResponse, protos.google.cloud.documentai.v1beta3.DeployProcessorVersionMetadata>>;
Check the status of the long running operation returned by deployProcessorVersion()
.
Parameter | |
---|---|
Name | Description |
name |
string
The operation name that will be passed. |
Returns | |
---|---|
Type | Description |
Promise<LROperation<protos.google.cloud.documentai.v1beta3.DeployProcessorVersionResponse, protos.google.cloud.documentai.v1beta3.DeployProcessorVersionMetadata>> | {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 for more details and examples. |
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. The processor version resource name to be deployed.
*/
// const name = 'abc123'
// Imports the Documentai library
const {DocumentProcessorServiceClient} = require('@google-cloud/documentai').v1beta3;
// Instantiates a client
const documentaiClient = new DocumentProcessorServiceClient();
async function callDeployProcessorVersion() {
// Construct request
const request = {
name,
};
// Run request
const [operation] = await documentaiClient.deployProcessorVersion(request);
const [response] = await operation.promise();
console.log(response);
}
callDeployProcessorVersion();
checkDisableProcessorProgress(name)
checkDisableProcessorProgress(name: string): Promise<LROperation<protos.google.cloud.documentai.v1beta3.DisableProcessorResponse, protos.google.cloud.documentai.v1beta3.DisableProcessorMetadata>>;
Check the status of the long running operation returned by disableProcessor()
.
Parameter | |
---|---|
Name | Description |
name |
string
The operation name that will be passed. |
Returns | |
---|---|
Type | Description |
Promise<LROperation<protos.google.cloud.documentai.v1beta3.DisableProcessorResponse, protos.google.cloud.documentai.v1beta3.DisableProcessorMetadata>> | {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 for more details and examples. |
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. The processor resource name to be disabled.
*/
// const name = 'abc123'
// Imports the Documentai library
const {DocumentProcessorServiceClient} = require('@google-cloud/documentai').v1beta3;
// Instantiates a client
const documentaiClient = new DocumentProcessorServiceClient();
async function callDisableProcessor() {
// Construct request
const request = {
name,
};
// Run request
const [operation] = await documentaiClient.disableProcessor(request);
const [response] = await operation.promise();
console.log(response);
}
callDisableProcessor();
checkEnableProcessorProgress(name)
checkEnableProcessorProgress(name: string): Promise<LROperation<protos.google.cloud.documentai.v1beta3.EnableProcessorResponse, protos.google.cloud.documentai.v1beta3.EnableProcessorMetadata>>;
Check the status of the long running operation returned by enableProcessor()
.
Parameter | |
---|---|
Name | Description |
name |
string
The operation name that will be passed. |
Returns | |
---|---|
Type | Description |
Promise<LROperation<protos.google.cloud.documentai.v1beta3.EnableProcessorResponse, protos.google.cloud.documentai.v1beta3.EnableProcessorMetadata>> | {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 for more details and examples. |
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. The processor resource name to be enabled.
*/
// const name = 'abc123'
// Imports the Documentai library
const {DocumentProcessorServiceClient} = require('@google-cloud/documentai').v1beta3;
// Instantiates a client
const documentaiClient = new DocumentProcessorServiceClient();
async function callEnableProcessor() {
// Construct request
const request = {
name,
};
// Run request
const [operation] = await documentaiClient.enableProcessor(request);
const [response] = await operation.promise();
console.log(response);
}
callEnableProcessor();
checkEvaluateProcessorVersionProgress(name)
checkEvaluateProcessorVersionProgress(name: string): Promise<LROperation<protos.google.cloud.documentai.v1beta3.EvaluateProcessorVersionResponse, protos.google.cloud.documentai.v1beta3.EvaluateProcessorVersionMetadata>>;
Check the status of the long running operation returned by evaluateProcessorVersion()
.
Parameter | |
---|---|
Name | Description |
name |
string
The operation name that will be passed. |
Returns | |
---|---|
Type | Description |
Promise<LROperation<protos.google.cloud.documentai.v1beta3.EvaluateProcessorVersionResponse, protos.google.cloud.documentai.v1beta3.EvaluateProcessorVersionMetadata>> | {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 for more details and examples. |
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. The resource name of the
* ProcessorVersion google.cloud.documentai.v1beta3.ProcessorVersion to
* evaluate.
* `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}`
*/
// const processorVersion = 'abc123'
/**
* Optional. The documents used in the evaluation. If unspecified, use the
* processor's dataset as evaluation input.
*/
// const evaluationDocuments = {}
// Imports the Documentai library
const {DocumentProcessorServiceClient} = require('@google-cloud/documentai').v1beta3;
// Instantiates a client
const documentaiClient = new DocumentProcessorServiceClient();
async function callEvaluateProcessorVersion() {
// Construct request
const request = {
processorVersion,
};
// Run request
const [operation] = await documentaiClient.evaluateProcessorVersion(request);
const [response] = await operation.promise();
console.log(response);
}
callEvaluateProcessorVersion();
checkImportProcessorVersionProgress(name)
checkImportProcessorVersionProgress(name: string): Promise<LROperation<protos.google.cloud.documentai.v1beta3.ImportProcessorVersionResponse, protos.google.cloud.documentai.v1beta3.ImportProcessorVersionMetadata>>;
Check the status of the long running operation returned by importProcessorVersion()
.
Parameter | |
---|---|
Name | Description |
name |
string
The operation name that will be passed. |
Returns | |
---|---|
Type | Description |
Promise<LROperation<protos.google.cloud.documentai.v1beta3.ImportProcessorVersionResponse, protos.google.cloud.documentai.v1beta3.ImportProcessorVersionMetadata>> | {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 for more details and examples. |
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* The source processor version to import from. The source processor version
* and destination processor need to be in the same environment and region.
* Note that ProcessorVersions with `model_type` `MODEL_TYPE_LLM` are not
* supported.
*/
// const processorVersionSource = 'abc123'
/**
* The source processor version to import from. It can be from a different
* environment and region than the destination processor.
*/
// const externalProcessorVersionSource = {}
/**
* Required. The destination processor name to create the processor version
* in. Format:
* `projects/{project}/locations/{location}/processors/{processor}`
*/
// const parent = 'abc123'
// Imports the Documentai library
const {DocumentProcessorServiceClient} = require('@google-cloud/documentai').v1beta3;
// Instantiates a client
const documentaiClient = new DocumentProcessorServiceClient();
async function callImportProcessorVersion() {
// Construct request
const request = {
parent,
};
// Run request
const [operation] = await documentaiClient.importProcessorVersion(request);
const [response] = await operation.promise();
console.log(response);
}
callImportProcessorVersion();
checkReviewDocumentProgress(name)
checkReviewDocumentProgress(name: string): Promise<LROperation<protos.google.cloud.documentai.v1beta3.ReviewDocumentResponse, protos.google.cloud.documentai.v1beta3.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.v1beta3.ReviewDocumentResponse, protos.google.cloud.documentai.v1beta3.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 for more details and examples. |
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* An inline document proto.
*/
// const inlineDocument = {}
/**
* Required. The resource name of the
* HumanReviewConfig google.cloud.documentai.v1beta3.HumanReviewConfig that
* the document will be reviewed with.
*/
// const humanReviewConfig = 'abc123'
/**
* The document that needs human review.
*/
// const document = {}
/**
* Whether the validation should be performed on the ad-hoc review request.
*/
// const enableSchemaValidation = true
/**
* The priority of the human review task.
*/
// const priority = {}
/**
* The document schema of the human review task.
*/
// const documentSchema = {}
// Imports the Documentai library
const {DocumentProcessorServiceClient} = require('@google-cloud/documentai').v1beta3;
// Instantiates a client
const documentaiClient = new DocumentProcessorServiceClient();
async function callReviewDocument() {
// Construct request
const request = {
humanReviewConfig,
};
// Run request
const [operation] = await documentaiClient.reviewDocument(request);
const [response] = await operation.promise();
console.log(response);
}
callReviewDocument();
checkSetDefaultProcessorVersionProgress(name)
checkSetDefaultProcessorVersionProgress(name: string): Promise<LROperation<protos.google.cloud.documentai.v1beta3.SetDefaultProcessorVersionResponse, protos.google.cloud.documentai.v1beta3.SetDefaultProcessorVersionMetadata>>;
Check the status of the long running operation returned by setDefaultProcessorVersion()
.
Parameter | |
---|---|
Name | Description |
name |
string
The operation name that will be passed. |
Returns | |
---|---|
Type | Description |
Promise<LROperation<protos.google.cloud.documentai.v1beta3.SetDefaultProcessorVersionResponse, protos.google.cloud.documentai.v1beta3.SetDefaultProcessorVersionMetadata>> | {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 for more details and examples. |
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. The resource name of the
* Processor google.cloud.documentai.v1beta3.Processor to change default
* version.
*/
// const processor = 'abc123'
/**
* Required. The resource name of child
* ProcessorVersion google.cloud.documentai.v1beta3.ProcessorVersion to use
* as default. Format:
* `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{version}`
*/
// const defaultProcessorVersion = 'abc123'
// Imports the Documentai library
const {DocumentProcessorServiceClient} = require('@google-cloud/documentai').v1beta3;
// Instantiates a client
const documentaiClient = new DocumentProcessorServiceClient();
async function callSetDefaultProcessorVersion() {
// Construct request
const request = {
processor,
defaultProcessorVersion,
};
// Run request
const [operation] = await documentaiClient.setDefaultProcessorVersion(request);
const [response] = await operation.promise();
console.log(response);
}
callSetDefaultProcessorVersion();
checkTrainProcessorVersionProgress(name)
checkTrainProcessorVersionProgress(name: string): Promise<LROperation<protos.google.cloud.documentai.v1beta3.TrainProcessorVersionResponse, protos.google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata>>;
Check the status of the long running operation returned by trainProcessorVersion()
.
Parameter | |
---|---|
Name | Description |
name |
string
The operation name that will be passed. |
Returns | |
---|---|
Type | Description |
Promise<LROperation<protos.google.cloud.documentai.v1beta3.TrainProcessorVersionResponse, protos.google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata>> | {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 for more details and examples. |
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Options to control Custom Document Extraction (CDE) Processor.
*/
// const customDocumentExtractionOptions = {}
/**
* Options to control foundation model tuning of a processor.
*/
// const foundationModelTuningOptions = {}
/**
* Required. The parent (project, location and processor) to create the new
* version for. Format:
* `projects/{project}/locations/{location}/processors/{processor}`.
*/
// const parent = 'abc123'
/**
* Required. The processor version to be created.
*/
// const processorVersion = {}
/**
* Optional. The schema the processor version will be trained with.
*/
// const documentSchema = {}
/**
* Optional. The input data used to train the
* ProcessorVersion google.cloud.documentai.v1beta3.ProcessorVersion.
*/
// const inputData = {}
/**
* Optional. The processor version to use as a base for training. This
* processor version must be a child of `parent`. Format:
* `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}`.
*/
// const baseProcessorVersion = 'abc123'
// Imports the Documentai library
const {DocumentProcessorServiceClient} = require('@google-cloud/documentai').v1beta3;
// Instantiates a client
const documentaiClient = new DocumentProcessorServiceClient();
async function callTrainProcessorVersion() {
// Construct request
const request = {
parent,
processorVersion,
};
// Run request
const [operation] = await documentaiClient.trainProcessorVersion(request);
const [response] = await operation.promise();
console.log(response);
}
callTrainProcessorVersion();
checkUndeployProcessorVersionProgress(name)
checkUndeployProcessorVersionProgress(name: string): Promise<LROperation<protos.google.cloud.documentai.v1beta3.UndeployProcessorVersionResponse, protos.google.cloud.documentai.v1beta3.UndeployProcessorVersionMetadata>>;
Check the status of the long running operation returned by undeployProcessorVersion()
.
Parameter | |
---|---|
Name | Description |
name |
string
The operation name that will be passed. |
Returns | |
---|---|
Type | Description |
Promise<LROperation<protos.google.cloud.documentai.v1beta3.UndeployProcessorVersionResponse, protos.google.cloud.documentai.v1beta3.UndeployProcessorVersionMetadata>> | {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 for more details and examples. |
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. The processor version resource name to be undeployed.
*/
// const name = 'abc123'
// Imports the Documentai library
const {DocumentProcessorServiceClient} = require('@google-cloud/documentai').v1beta3;
// Instantiates a client
const documentaiClient = new DocumentProcessorServiceClient();
async function callUndeployProcessorVersion() {
// Construct request
const request = {
name,
};
// Run request
const [operation] = await documentaiClient.undeployProcessorVersion(request);
const [response] = await operation.promise();
console.log(response);
}
callUndeployProcessorVersion();
close()
close(): Promise<void>;
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. |
createProcessor(request, options)
createProcessor(request?: protos.google.cloud.documentai.v1beta3.ICreateProcessorRequest, options?: CallOptions): Promise<[
protos.google.cloud.documentai.v1beta3.IProcessor,
(protos.google.cloud.documentai.v1beta3.ICreateProcessorRequest | undefined),
{} | undefined
]>;
Creates a processor from the provided. The processor will be at ENABLED
state by default after its creation.
Parameters | |
---|---|
Name | Description |
request |
ICreateProcessorRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
Promise<[
protos.google.cloud.documentai.v1beta3.IProcessor,
(protos.google.cloud.documentai.v1beta3.ICreateProcessorRequest | undefined),
{} | undefined
]> | {Promise} - The promise which resolves to an array. The first element of the array is an object representing . Please see the documentation for more details and examples. |
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. The parent (project and location) under which to create the
* processor. Format: `projects/{project}/locations/{location}`
*/
// const parent = 'abc123'
/**
* Required. The processor to be created, requires
* Processor.type google.cloud.documentai.v1beta3.Processor.type and
* Processor.display_name google.cloud.documentai.v1beta3.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.
*/
// const processor = {}
// Imports the Documentai library
const {DocumentProcessorServiceClient} = require('@google-cloud/documentai').v1beta3;
// Instantiates a client
const documentaiClient = new DocumentProcessorServiceClient();
async function callCreateProcessor() {
// Construct request
const request = {
parent,
processor,
};
// Run request
const response = await documentaiClient.createProcessor(request);
console.log(response);
}
callCreateProcessor();
createProcessor(request, options, callback)
createProcessor(request: protos.google.cloud.documentai.v1beta3.ICreateProcessorRequest, options: CallOptions, callback: Callback<protos.google.cloud.documentai.v1beta3.IProcessor, protos.google.cloud.documentai.v1beta3.ICreateProcessorRequest | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
ICreateProcessorRequest
|
options |
CallOptions
|
callback |
Callback<protos.google.cloud.documentai.v1beta3.IProcessor, protos.google.cloud.documentai.v1beta3.ICreateProcessorRequest | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
createProcessor(request, callback)
createProcessor(request: protos.google.cloud.documentai.v1beta3.ICreateProcessorRequest, callback: Callback<protos.google.cloud.documentai.v1beta3.IProcessor, protos.google.cloud.documentai.v1beta3.ICreateProcessorRequest | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
ICreateProcessorRequest
|
callback |
Callback<protos.google.cloud.documentai.v1beta3.IProcessor, protos.google.cloud.documentai.v1beta3.ICreateProcessorRequest | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
datasetPath(project, location, processor)
datasetPath(project: string, location: string, processor: string): string;
Return a fully-qualified dataset resource name string.
Parameters | |
---|---|
Name | Description |
project |
string
|
location |
string
|
processor |
string
|
Returns | |
---|---|
Type | Description |
string | {string} Resource name string. |
datasetSchemaPath(project, location, processor)
datasetSchemaPath(project: string, location: string, processor: string): string;
Return a fully-qualified datasetSchema resource name string.
Parameters | |
---|---|
Name | Description |
project |
string
|
location |
string
|
processor |
string
|
Returns | |
---|---|
Type | Description |
string | {string} Resource name string. |
deleteOperation(request, options, callback)
deleteOperation(request: protos.google.longrunning.DeleteOperationRequest, options?: gax.CallOptions | Callback<protos.google.protobuf.Empty, protos.google.longrunning.DeleteOperationRequest, {} | null | undefined>, callback?: Callback<protos.google.protobuf.Empty, protos.google.longrunning.DeleteOperationRequest, {} | null | undefined>): Promise<protos.google.protobuf.Empty>;
Deletes a long-running operation. This method indicates that the client is no longer interested in the operation result. It does not cancel the operation. If the server doesn't support this method, it returns google.rpc.Code.UNIMPLEMENTED
.
Parameters | |
---|---|
Name | Description |
request |
DeleteOperationRequest
The request object that will be sent. |
options |
CallOptions | Callback<protos.google.protobuf.Empty, protos.google.longrunning.DeleteOperationRequest, {} | null | undefined>
Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details. |
callback |
Callback<protos.google.protobuf.Empty, protos.google.longrunning.DeleteOperationRequest, {} | null | undefined>
The function which will be called with the result of the API call. {Promise} - The promise which resolves when API call finishes. The promise has a method named "cancel" which cancels the ongoing API call. |
Returns | |
---|---|
Type | Description |
Promise<protos.google.protobuf.Empty> |
const client = longrunning.operationsClient();
await client.deleteOperation({name: ''});
deleteProcessor(request, options)
deleteProcessor(request?: protos.google.cloud.documentai.v1beta3.IDeleteProcessorRequest, options?: CallOptions): Promise<[
LROperation<protos.google.protobuf.IEmpty, protos.google.cloud.documentai.v1beta3.IDeleteProcessorMetadata>,
protos.google.longrunning.IOperation | undefined,
{} | undefined
]>;
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 |
IDeleteProcessorRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
Promise<[
LROperation<protos.google.protobuf.IEmpty, protos.google.cloud.documentai.v1beta3.IDeleteProcessorMetadata>,
protos.google.longrunning.IOperation | undefined,
{} | undefined
]> | {Promise} - The promise which resolves to an array. The first element of the array is an object representing a long running operation. Its |
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. The processor resource name to be deleted.
*/
// const name = 'abc123'
// Imports the Documentai library
const {DocumentProcessorServiceClient} = require('@google-cloud/documentai').v1beta3;
// Instantiates a client
const documentaiClient = new DocumentProcessorServiceClient();
async function callDeleteProcessor() {
// Construct request
const request = {
name,
};
// Run request
const [operation] = await documentaiClient.deleteProcessor(request);
const [response] = await operation.promise();
console.log(response);
}
callDeleteProcessor();
deleteProcessor(request, options, callback)
deleteProcessor(request: protos.google.cloud.documentai.v1beta3.IDeleteProcessorRequest, options: CallOptions, callback: Callback<LROperation<protos.google.protobuf.IEmpty, protos.google.cloud.documentai.v1beta3.IDeleteProcessorMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
IDeleteProcessorRequest
|
options |
CallOptions
|
callback |
Callback<LROperation<protos.google.protobuf.IEmpty, protos.google.cloud.documentai.v1beta3.IDeleteProcessorMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
deleteProcessor(request, callback)
deleteProcessor(request: protos.google.cloud.documentai.v1beta3.IDeleteProcessorRequest, callback: Callback<LROperation<protos.google.protobuf.IEmpty, protos.google.cloud.documentai.v1beta3.IDeleteProcessorMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
IDeleteProcessorRequest
|
callback |
Callback<LROperation<protos.google.protobuf.IEmpty, protos.google.cloud.documentai.v1beta3.IDeleteProcessorMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
deleteProcessorVersion(request, options)
deleteProcessorVersion(request?: protos.google.cloud.documentai.v1beta3.IDeleteProcessorVersionRequest, options?: CallOptions): Promise<[
LROperation<protos.google.protobuf.IEmpty, protos.google.cloud.documentai.v1beta3.IDeleteProcessorVersionMetadata>,
protos.google.longrunning.IOperation | undefined,
{} | undefined
]>;
Deletes the processor version, all artifacts under the processor version will be deleted.
Parameters | |
---|---|
Name | Description |
request |
IDeleteProcessorVersionRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
Promise<[
LROperation<protos.google.protobuf.IEmpty, protos.google.cloud.documentai.v1beta3.IDeleteProcessorVersionMetadata>,
protos.google.longrunning.IOperation | undefined,
{} | undefined
]> | {Promise} - The promise which resolves to an array. The first element of the array is an object representing a long running operation. Its |
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. The processor version resource name to be deleted.
*/
// const name = 'abc123'
// Imports the Documentai library
const {DocumentProcessorServiceClient} = require('@google-cloud/documentai').v1beta3;
// Instantiates a client
const documentaiClient = new DocumentProcessorServiceClient();
async function callDeleteProcessorVersion() {
// Construct request
const request = {
name,
};
// Run request
const [operation] = await documentaiClient.deleteProcessorVersion(request);
const [response] = await operation.promise();
console.log(response);
}
callDeleteProcessorVersion();
deleteProcessorVersion(request, options, callback)
deleteProcessorVersion(request: protos.google.cloud.documentai.v1beta3.IDeleteProcessorVersionRequest, options: CallOptions, callback: Callback<LROperation<protos.google.protobuf.IEmpty, protos.google.cloud.documentai.v1beta3.IDeleteProcessorVersionMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
IDeleteProcessorVersionRequest
|
options |
CallOptions
|
callback |
Callback<LROperation<protos.google.protobuf.IEmpty, protos.google.cloud.documentai.v1beta3.IDeleteProcessorVersionMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
deleteProcessorVersion(request, callback)
deleteProcessorVersion(request: protos.google.cloud.documentai.v1beta3.IDeleteProcessorVersionRequest, callback: Callback<LROperation<protos.google.protobuf.IEmpty, protos.google.cloud.documentai.v1beta3.IDeleteProcessorVersionMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
IDeleteProcessorVersionRequest
|
callback |
Callback<LROperation<protos.google.protobuf.IEmpty, protos.google.cloud.documentai.v1beta3.IDeleteProcessorVersionMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
deployProcessorVersion(request, options)
deployProcessorVersion(request?: protos.google.cloud.documentai.v1beta3.IDeployProcessorVersionRequest, options?: CallOptions): Promise<[
LROperation<protos.google.cloud.documentai.v1beta3.IDeployProcessorVersionResponse, protos.google.cloud.documentai.v1beta3.IDeployProcessorVersionMetadata>,
protos.google.longrunning.IOperation | undefined,
{} | undefined
]>;
Deploys the processor version.
Parameters | |
---|---|
Name | Description |
request |
IDeployProcessorVersionRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
Promise<[
LROperation<protos.google.cloud.documentai.v1beta3.IDeployProcessorVersionResponse, protos.google.cloud.documentai.v1beta3.IDeployProcessorVersionMetadata>,
protos.google.longrunning.IOperation | undefined,
{} | undefined
]> | {Promise} - The promise which resolves to an array. The first element of the array is an object representing a long running operation. Its |
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. The processor version resource name to be deployed.
*/
// const name = 'abc123'
// Imports the Documentai library
const {DocumentProcessorServiceClient} = require('@google-cloud/documentai').v1beta3;
// Instantiates a client
const documentaiClient = new DocumentProcessorServiceClient();
async function callDeployProcessorVersion() {
// Construct request
const request = {
name,
};
// Run request
const [operation] = await documentaiClient.deployProcessorVersion(request);
const [response] = await operation.promise();
console.log(response);
}
callDeployProcessorVersion();
deployProcessorVersion(request, options, callback)
deployProcessorVersion(request: protos.google.cloud.documentai.v1beta3.IDeployProcessorVersionRequest, options: CallOptions, callback: Callback<LROperation<protos.google.cloud.documentai.v1beta3.IDeployProcessorVersionResponse, protos.google.cloud.documentai.v1beta3.IDeployProcessorVersionMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
IDeployProcessorVersionRequest
|
options |
CallOptions
|
callback |
Callback<LROperation<protos.google.cloud.documentai.v1beta3.IDeployProcessorVersionResponse, protos.google.cloud.documentai.v1beta3.IDeployProcessorVersionMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
deployProcessorVersion(request, callback)
deployProcessorVersion(request: protos.google.cloud.documentai.v1beta3.IDeployProcessorVersionRequest, callback: Callback<LROperation<protos.google.cloud.documentai.v1beta3.IDeployProcessorVersionResponse, protos.google.cloud.documentai.v1beta3.IDeployProcessorVersionMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
IDeployProcessorVersionRequest
|
callback |
Callback<LROperation<protos.google.cloud.documentai.v1beta3.IDeployProcessorVersionResponse, protos.google.cloud.documentai.v1beta3.IDeployProcessorVersionMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
disableProcessor(request, options)
disableProcessor(request?: protos.google.cloud.documentai.v1beta3.IDisableProcessorRequest, options?: CallOptions): Promise<[
LROperation<protos.google.cloud.documentai.v1beta3.IDisableProcessorResponse, protos.google.cloud.documentai.v1beta3.IDisableProcessorMetadata>,
protos.google.longrunning.IOperation | undefined,
{} | undefined
]>;
Disables a processor
Parameters | |
---|---|
Name | Description |
request |
IDisableProcessorRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
Promise<[
LROperation<protos.google.cloud.documentai.v1beta3.IDisableProcessorResponse, protos.google.cloud.documentai.v1beta3.IDisableProcessorMetadata>,
protos.google.longrunning.IOperation | undefined,
{} | undefined
]> | {Promise} - The promise which resolves to an array. The first element of the array is an object representing a long running operation. Its |
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. The processor resource name to be disabled.
*/
// const name = 'abc123'
// Imports the Documentai library
const {DocumentProcessorServiceClient} = require('@google-cloud/documentai').v1beta3;
// Instantiates a client
const documentaiClient = new DocumentProcessorServiceClient();
async function callDisableProcessor() {
// Construct request
const request = {
name,
};
// Run request
const [operation] = await documentaiClient.disableProcessor(request);
const [response] = await operation.promise();
console.log(response);
}
callDisableProcessor();
disableProcessor(request, options, callback)
disableProcessor(request: protos.google.cloud.documentai.v1beta3.IDisableProcessorRequest, options: CallOptions, callback: Callback<LROperation<protos.google.cloud.documentai.v1beta3.IDisableProcessorResponse, protos.google.cloud.documentai.v1beta3.IDisableProcessorMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
IDisableProcessorRequest
|
options |
CallOptions
|
callback |
Callback<LROperation<protos.google.cloud.documentai.v1beta3.IDisableProcessorResponse, protos.google.cloud.documentai.v1beta3.IDisableProcessorMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
disableProcessor(request, callback)
disableProcessor(request: protos.google.cloud.documentai.v1beta3.IDisableProcessorRequest, callback: Callback<LROperation<protos.google.cloud.documentai.v1beta3.IDisableProcessorResponse, protos.google.cloud.documentai.v1beta3.IDisableProcessorMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
IDisableProcessorRequest
|
callback |
Callback<LROperation<protos.google.cloud.documentai.v1beta3.IDisableProcessorResponse, protos.google.cloud.documentai.v1beta3.IDisableProcessorMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
enableProcessor(request, options)
enableProcessor(request?: protos.google.cloud.documentai.v1beta3.IEnableProcessorRequest, options?: CallOptions): Promise<[
LROperation<protos.google.cloud.documentai.v1beta3.IEnableProcessorResponse, protos.google.cloud.documentai.v1beta3.IEnableProcessorMetadata>,
protos.google.longrunning.IOperation | undefined,
{} | undefined
]>;
Enables a processor
Parameters | |
---|---|
Name | Description |
request |
IEnableProcessorRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
Promise<[
LROperation<protos.google.cloud.documentai.v1beta3.IEnableProcessorResponse, protos.google.cloud.documentai.v1beta3.IEnableProcessorMetadata>,
protos.google.longrunning.IOperation | undefined,
{} | undefined
]> | {Promise} - The promise which resolves to an array. The first element of the array is an object representing a long running operation. Its |
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. The processor resource name to be enabled.
*/
// const name = 'abc123'
// Imports the Documentai library
const {DocumentProcessorServiceClient} = require('@google-cloud/documentai').v1beta3;
// Instantiates a client
const documentaiClient = new DocumentProcessorServiceClient();
async function callEnableProcessor() {
// Construct request
const request = {
name,
};
// Run request
const [operation] = await documentaiClient.enableProcessor(request);
const [response] = await operation.promise();
console.log(response);
}
callEnableProcessor();
enableProcessor(request, options, callback)
enableProcessor(request: protos.google.cloud.documentai.v1beta3.IEnableProcessorRequest, options: CallOptions, callback: Callback<LROperation<protos.google.cloud.documentai.v1beta3.IEnableProcessorResponse, protos.google.cloud.documentai.v1beta3.IEnableProcessorMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
IEnableProcessorRequest
|
options |
CallOptions
|
callback |
Callback<LROperation<protos.google.cloud.documentai.v1beta3.IEnableProcessorResponse, protos.google.cloud.documentai.v1beta3.IEnableProcessorMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
enableProcessor(request, callback)
enableProcessor(request: protos.google.cloud.documentai.v1beta3.IEnableProcessorRequest, callback: Callback<LROperation<protos.google.cloud.documentai.v1beta3.IEnableProcessorResponse, protos.google.cloud.documentai.v1beta3.IEnableProcessorMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
IEnableProcessorRequest
|
callback |
Callback<LROperation<protos.google.cloud.documentai.v1beta3.IEnableProcessorResponse, protos.google.cloud.documentai.v1beta3.IEnableProcessorMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
evaluateProcessorVersion(request, options)
evaluateProcessorVersion(request?: protos.google.cloud.documentai.v1beta3.IEvaluateProcessorVersionRequest, options?: CallOptions): Promise<[
LROperation<protos.google.cloud.documentai.v1beta3.IEvaluateProcessorVersionResponse, protos.google.cloud.documentai.v1beta3.IEvaluateProcessorVersionMetadata>,
protos.google.longrunning.IOperation | undefined,
{} | undefined
]>;
Evaluates a ProcessorVersion against annotated documents, producing an Evaluation.
Parameters | |
---|---|
Name | Description |
request |
IEvaluateProcessorVersionRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
Promise<[
LROperation<protos.google.cloud.documentai.v1beta3.IEvaluateProcessorVersionResponse, protos.google.cloud.documentai.v1beta3.IEvaluateProcessorVersionMetadata>,
protos.google.longrunning.IOperation | undefined,
{} | undefined
]> | {Promise} - The promise which resolves to an array. The first element of the array is an object representing a long running operation. Its |
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. The resource name of the
* ProcessorVersion google.cloud.documentai.v1beta3.ProcessorVersion to
* evaluate.
* `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}`
*/
// const processorVersion = 'abc123'
/**
* Optional. The documents used in the evaluation. If unspecified, use the
* processor's dataset as evaluation input.
*/
// const evaluationDocuments = {}
// Imports the Documentai library
const {DocumentProcessorServiceClient} = require('@google-cloud/documentai').v1beta3;
// Instantiates a client
const documentaiClient = new DocumentProcessorServiceClient();
async function callEvaluateProcessorVersion() {
// Construct request
const request = {
processorVersion,
};
// Run request
const [operation] = await documentaiClient.evaluateProcessorVersion(request);
const [response] = await operation.promise();
console.log(response);
}
callEvaluateProcessorVersion();
evaluateProcessorVersion(request, options, callback)
evaluateProcessorVersion(request: protos.google.cloud.documentai.v1beta3.IEvaluateProcessorVersionRequest, options: CallOptions, callback: Callback<LROperation<protos.google.cloud.documentai.v1beta3.IEvaluateProcessorVersionResponse, protos.google.cloud.documentai.v1beta3.IEvaluateProcessorVersionMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
IEvaluateProcessorVersionRequest
|
options |
CallOptions
|
callback |
Callback<LROperation<protos.google.cloud.documentai.v1beta3.IEvaluateProcessorVersionResponse, protos.google.cloud.documentai.v1beta3.IEvaluateProcessorVersionMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
evaluateProcessorVersion(request, callback)
evaluateProcessorVersion(request: protos.google.cloud.documentai.v1beta3.IEvaluateProcessorVersionRequest, callback: Callback<LROperation<protos.google.cloud.documentai.v1beta3.IEvaluateProcessorVersionResponse, protos.google.cloud.documentai.v1beta3.IEvaluateProcessorVersionMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
IEvaluateProcessorVersionRequest
|
callback |
Callback<LROperation<protos.google.cloud.documentai.v1beta3.IEvaluateProcessorVersionResponse, protos.google.cloud.documentai.v1beta3.IEvaluateProcessorVersionMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
evaluationPath(project, location, processor, processorVersion, evaluation)
evaluationPath(project: string, location: string, processor: string, processorVersion: string, evaluation: string): string;
Return a fully-qualified evaluation resource name string.
Parameters | |
---|---|
Name | Description |
project |
string
|
location |
string
|
processor |
string
|
processorVersion |
string
|
evaluation |
string
|
Returns | |
---|---|
Type | Description |
string | {string} Resource name string. |
fetchProcessorTypes(request, options)
fetchProcessorTypes(request?: protos.google.cloud.documentai.v1beta3.IFetchProcessorTypesRequest, options?: CallOptions): Promise<[
protos.google.cloud.documentai.v1beta3.IFetchProcessorTypesResponse,
(protos.google.cloud.documentai.v1beta3.IFetchProcessorTypesRequest | undefined),
{} | undefined
]>;
Fetches processor types. Note that we don't use here, because it isn't paginated.
Parameters | |
---|---|
Name | Description |
request |
IFetchProcessorTypesRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
Promise<[
protos.google.cloud.documentai.v1beta3.IFetchProcessorTypesResponse,
(protos.google.cloud.documentai.v1beta3.IFetchProcessorTypesRequest | undefined),
{} | undefined
]> | {Promise} - The promise which resolves to an array. The first element of the array is an object representing FetchProcessorTypesResponse. Please see the documentation for more details and examples. |
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. The location of processor types to list.
* Format: `projects/{project}/locations/{location}`.
*/
// const parent = 'abc123'
// Imports the Documentai library
const {DocumentProcessorServiceClient} = require('@google-cloud/documentai').v1beta3;
// Instantiates a client
const documentaiClient = new DocumentProcessorServiceClient();
async function callFetchProcessorTypes() {
// Construct request
const request = {
parent,
};
// Run request
const response = await documentaiClient.fetchProcessorTypes(request);
console.log(response);
}
callFetchProcessorTypes();
fetchProcessorTypes(request, options, callback)
fetchProcessorTypes(request: protos.google.cloud.documentai.v1beta3.IFetchProcessorTypesRequest, options: CallOptions, callback: Callback<protos.google.cloud.documentai.v1beta3.IFetchProcessorTypesResponse, protos.google.cloud.documentai.v1beta3.IFetchProcessorTypesRequest | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
IFetchProcessorTypesRequest
|
options |
CallOptions
|
callback |
Callback<protos.google.cloud.documentai.v1beta3.IFetchProcessorTypesResponse, protos.google.cloud.documentai.v1beta3.IFetchProcessorTypesRequest | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
fetchProcessorTypes(request, callback)
fetchProcessorTypes(request: protos.google.cloud.documentai.v1beta3.IFetchProcessorTypesRequest, callback: Callback<protos.google.cloud.documentai.v1beta3.IFetchProcessorTypesResponse, protos.google.cloud.documentai.v1beta3.IFetchProcessorTypesRequest | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
IFetchProcessorTypesRequest
|
callback |
Callback<protos.google.cloud.documentai.v1beta3.IFetchProcessorTypesResponse, protos.google.cloud.documentai.v1beta3.IFetchProcessorTypesRequest | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
getEvaluation(request, options)
getEvaluation(request?: protos.google.cloud.documentai.v1beta3.IGetEvaluationRequest, options?: CallOptions): Promise<[
protos.google.cloud.documentai.v1beta3.IEvaluation,
protos.google.cloud.documentai.v1beta3.IGetEvaluationRequest | undefined,
{} | undefined
]>;
Retrieves a specific evaluation.
Parameters | |
---|---|
Name | Description |
request |
IGetEvaluationRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
Promise<[
protos.google.cloud.documentai.v1beta3.IEvaluation,
protos.google.cloud.documentai.v1beta3.IGetEvaluationRequest | undefined,
{} | undefined
]> | {Promise} - The promise which resolves to an array. The first element of the array is an object representing . Please see the documentation for more details and examples. |
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. The resource name of the
* Evaluation google.cloud.documentai.v1beta3.Evaluation to get.
* `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}/evaluations/{evaluation}`
*/
// const name = 'abc123'
// Imports the Documentai library
const {DocumentProcessorServiceClient} = require('@google-cloud/documentai').v1beta3;
// Instantiates a client
const documentaiClient = new DocumentProcessorServiceClient();
async function callGetEvaluation() {
// Construct request
const request = {
name,
};
// Run request
const response = await documentaiClient.getEvaluation(request);
console.log(response);
}
callGetEvaluation();
getEvaluation(request, options, callback)
getEvaluation(request: protos.google.cloud.documentai.v1beta3.IGetEvaluationRequest, options: CallOptions, callback: Callback<protos.google.cloud.documentai.v1beta3.IEvaluation, protos.google.cloud.documentai.v1beta3.IGetEvaluationRequest | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
IGetEvaluationRequest
|
options |
CallOptions
|
callback |
Callback<protos.google.cloud.documentai.v1beta3.IEvaluation, protos.google.cloud.documentai.v1beta3.IGetEvaluationRequest | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
getEvaluation(request, callback)
getEvaluation(request: protos.google.cloud.documentai.v1beta3.IGetEvaluationRequest, callback: Callback<protos.google.cloud.documentai.v1beta3.IEvaluation, protos.google.cloud.documentai.v1beta3.IGetEvaluationRequest | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
IGetEvaluationRequest
|
callback |
Callback<protos.google.cloud.documentai.v1beta3.IEvaluation, protos.google.cloud.documentai.v1beta3.IGetEvaluationRequest | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
getLocation(request, options, callback)
getLocation(request: LocationProtos.google.cloud.location.IGetLocationRequest, options?: gax.CallOptions | Callback<LocationProtos.google.cloud.location.ILocation, LocationProtos.google.cloud.location.IGetLocationRequest | null | undefined, {} | null | undefined>, callback?: Callback<LocationProtos.google.cloud.location.ILocation, LocationProtos.google.cloud.location.IGetLocationRequest | null | undefined, {} | null | undefined>): Promise<LocationProtos.google.cloud.location.ILocation>;
Gets information about a location.
Parameters | |
---|---|
Name | Description |
request |
LocationProtos.google.cloud.location.IGetLocationRequest
The request object that will be sent. |
options |
CallOptions | Callback<google.cloud.location.ILocation, google.cloud.location.IGetLocationRequest | null | undefined, {} | null | undefined>
Call options. See CallOptions for more details. |
callback |
Callback<google.cloud.location.ILocation, google.cloud.location.IGetLocationRequest | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
Promise<google.cloud.location.ILocation> | {Promise} - The promise which resolves to an array. The first element of the array is an object representing . Please see the documentation for more details and examples. |
const [response] = await client.getLocation(request);
getOperation(request, options, callback)
getOperation(request: protos.google.longrunning.GetOperationRequest, options?: gax.CallOptions | Callback<protos.google.longrunning.Operation, protos.google.longrunning.GetOperationRequest, {} | null | undefined>, callback?: Callback<protos.google.longrunning.Operation, protos.google.longrunning.GetOperationRequest, {} | null | undefined>): Promise<[protos.google.longrunning.Operation]>;
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 |
GetOperationRequest
The request object that will be sent. |
options |
CallOptions | Callback<protos.google.longrunning.Operation, protos.google.longrunning.GetOperationRequest, {} | null | undefined>
Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details. |
callback |
Callback<protos.google.longrunning.Operation, protos.google.longrunning.GetOperationRequest, {} | null | undefined>
The function which will be called with the result of the API call. The second parameter to the callback is an object representing . {Promise} - The promise which resolves to an array. The first element of the array is an object representing . The promise has a method named "cancel" which cancels the ongoing API call. |
Returns | |
---|---|
Type | Description |
Promise<[protos.google.longrunning.Operation]> |
const client = longrunning.operationsClient();
const name = '';
const [response] = await client.getOperation({name});
// doThingsWith(response)
getProcessor(request, options)
getProcessor(request?: protos.google.cloud.documentai.v1beta3.IGetProcessorRequest, options?: CallOptions): Promise<[
protos.google.cloud.documentai.v1beta3.IProcessor,
protos.google.cloud.documentai.v1beta3.IGetProcessorRequest | undefined,
{} | undefined
]>;
Gets a processor detail.
Parameters | |
---|---|
Name | Description |
request |
IGetProcessorRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
Promise<[
protos.google.cloud.documentai.v1beta3.IProcessor,
protos.google.cloud.documentai.v1beta3.IGetProcessorRequest | undefined,
{} | undefined
]> | {Promise} - The promise which resolves to an array. The first element of the array is an object representing . Please see the documentation for more details and examples. |
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. The processor resource name.
*/
// const name = 'abc123'
// Imports the Documentai library
const {DocumentProcessorServiceClient} = require('@google-cloud/documentai').v1beta3;
// Instantiates a client
const documentaiClient = new DocumentProcessorServiceClient();
async function callGetProcessor() {
// Construct request
const request = {
name,
};
// Run request
const response = await documentaiClient.getProcessor(request);
console.log(response);
}
callGetProcessor();
getProcessor(request, options, callback)
getProcessor(request: protos.google.cloud.documentai.v1beta3.IGetProcessorRequest, options: CallOptions, callback: Callback<protos.google.cloud.documentai.v1beta3.IProcessor, protos.google.cloud.documentai.v1beta3.IGetProcessorRequest | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
IGetProcessorRequest
|
options |
CallOptions
|
callback |
Callback<protos.google.cloud.documentai.v1beta3.IProcessor, protos.google.cloud.documentai.v1beta3.IGetProcessorRequest | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
getProcessor(request, callback)
getProcessor(request: protos.google.cloud.documentai.v1beta3.IGetProcessorRequest, callback: Callback<protos.google.cloud.documentai.v1beta3.IProcessor, protos.google.cloud.documentai.v1beta3.IGetProcessorRequest | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
IGetProcessorRequest
|
callback |
Callback<protos.google.cloud.documentai.v1beta3.IProcessor, protos.google.cloud.documentai.v1beta3.IGetProcessorRequest | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
getProcessorType(request, options)
getProcessorType(request?: protos.google.cloud.documentai.v1beta3.IGetProcessorTypeRequest, options?: CallOptions): Promise<[
protos.google.cloud.documentai.v1beta3.IProcessorType,
(protos.google.cloud.documentai.v1beta3.IGetProcessorTypeRequest | undefined),
{} | undefined
]>;
Gets a processor type detail.
Parameters | |
---|---|
Name | Description |
request |
IGetProcessorTypeRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
Promise<[
protos.google.cloud.documentai.v1beta3.IProcessorType,
(protos.google.cloud.documentai.v1beta3.IGetProcessorTypeRequest | undefined),
{} | undefined
]> | {Promise} - The promise which resolves to an array. The first element of the array is an object representing . Please see the documentation for more details and examples. |
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. The processor type resource name.
*/
// const name = 'abc123'
// Imports the Documentai library
const {DocumentProcessorServiceClient} = require('@google-cloud/documentai').v1beta3;
// Instantiates a client
const documentaiClient = new DocumentProcessorServiceClient();
async function callGetProcessorType() {
// Construct request
const request = {
name,
};
// Run request
const response = await documentaiClient.getProcessorType(request);
console.log(response);
}
callGetProcessorType();
getProcessorType(request, options, callback)
getProcessorType(request: protos.google.cloud.documentai.v1beta3.IGetProcessorTypeRequest, options: CallOptions, callback: Callback<protos.google.cloud.documentai.v1beta3.IProcessorType, protos.google.cloud.documentai.v1beta3.IGetProcessorTypeRequest | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
IGetProcessorTypeRequest
|
options |
CallOptions
|
callback |
Callback<protos.google.cloud.documentai.v1beta3.IProcessorType, protos.google.cloud.documentai.v1beta3.IGetProcessorTypeRequest | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
getProcessorType(request, callback)
getProcessorType(request: protos.google.cloud.documentai.v1beta3.IGetProcessorTypeRequest, callback: Callback<protos.google.cloud.documentai.v1beta3.IProcessorType, protos.google.cloud.documentai.v1beta3.IGetProcessorTypeRequest | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
IGetProcessorTypeRequest
|
callback |
Callback<protos.google.cloud.documentai.v1beta3.IProcessorType, protos.google.cloud.documentai.v1beta3.IGetProcessorTypeRequest | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
getProcessorVersion(request, options)
getProcessorVersion(request?: protos.google.cloud.documentai.v1beta3.IGetProcessorVersionRequest, options?: CallOptions): Promise<[
protos.google.cloud.documentai.v1beta3.IProcessorVersion,
(protos.google.cloud.documentai.v1beta3.IGetProcessorVersionRequest | undefined),
{} | undefined
]>;
Gets a processor version detail.
Parameters | |
---|---|
Name | Description |
request |
IGetProcessorVersionRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
Promise<[
protos.google.cloud.documentai.v1beta3.IProcessorVersion,
(protos.google.cloud.documentai.v1beta3.IGetProcessorVersionRequest | undefined),
{} | undefined
]> | {Promise} - The promise which resolves to an array. The first element of the array is an object representing . Please see the documentation for more details and examples. |
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. The processor resource name.
*/
// const name = 'abc123'
// Imports the Documentai library
const {DocumentProcessorServiceClient} = require('@google-cloud/documentai').v1beta3;
// Instantiates a client
const documentaiClient = new DocumentProcessorServiceClient();
async function callGetProcessorVersion() {
// Construct request
const request = {
name,
};
// Run request
const response = await documentaiClient.getProcessorVersion(request);
console.log(response);
}
callGetProcessorVersion();
getProcessorVersion(request, options, callback)
getProcessorVersion(request: protos.google.cloud.documentai.v1beta3.IGetProcessorVersionRequest, options: CallOptions, callback: Callback<protos.google.cloud.documentai.v1beta3.IProcessorVersion, protos.google.cloud.documentai.v1beta3.IGetProcessorVersionRequest | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
IGetProcessorVersionRequest
|
options |
CallOptions
|
callback |
Callback<protos.google.cloud.documentai.v1beta3.IProcessorVersion, protos.google.cloud.documentai.v1beta3.IGetProcessorVersionRequest | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
getProcessorVersion(request, callback)
getProcessorVersion(request: protos.google.cloud.documentai.v1beta3.IGetProcessorVersionRequest, callback: Callback<protos.google.cloud.documentai.v1beta3.IProcessorVersion, protos.google.cloud.documentai.v1beta3.IGetProcessorVersionRequest | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
IGetProcessorVersionRequest
|
callback |
Callback<protos.google.cloud.documentai.v1beta3.IProcessorVersion, protos.google.cloud.documentai.v1beta3.IGetProcessorVersionRequest | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
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 | |
---|---|
Type | Description |
void |
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. |
importProcessorVersion(request, options)
importProcessorVersion(request?: protos.google.cloud.documentai.v1beta3.IImportProcessorVersionRequest, options?: CallOptions): Promise<[
LROperation<protos.google.cloud.documentai.v1beta3.IImportProcessorVersionResponse, protos.google.cloud.documentai.v1beta3.IImportProcessorVersionMetadata>,
protos.google.longrunning.IOperation | undefined,
{} | undefined
]>;
Imports a processor version from source processor version.
Parameters | |
---|---|
Name | Description |
request |
IImportProcessorVersionRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
Promise<[
LROperation<protos.google.cloud.documentai.v1beta3.IImportProcessorVersionResponse, protos.google.cloud.documentai.v1beta3.IImportProcessorVersionMetadata>,
protos.google.longrunning.IOperation | undefined,
{} | undefined
]> | {Promise} - The promise which resolves to an array. The first element of the array is an object representing a long running operation. Its |
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* The source processor version to import from. The source processor version
* and destination processor need to be in the same environment and region.
* Note that ProcessorVersions with `model_type` `MODEL_TYPE_LLM` are not
* supported.
*/
// const processorVersionSource = 'abc123'
/**
* The source processor version to import from. It can be from a different
* environment and region than the destination processor.
*/
// const externalProcessorVersionSource = {}
/**
* Required. The destination processor name to create the processor version
* in. Format:
* `projects/{project}/locations/{location}/processors/{processor}`
*/
// const parent = 'abc123'
// Imports the Documentai library
const {DocumentProcessorServiceClient} = require('@google-cloud/documentai').v1beta3;
// Instantiates a client
const documentaiClient = new DocumentProcessorServiceClient();
async function callImportProcessorVersion() {
// Construct request
const request = {
parent,
};
// Run request
const [operation] = await documentaiClient.importProcessorVersion(request);
const [response] = await operation.promise();
console.log(response);
}
callImportProcessorVersion();
importProcessorVersion(request, options, callback)
importProcessorVersion(request: protos.google.cloud.documentai.v1beta3.IImportProcessorVersionRequest, options: CallOptions, callback: Callback<LROperation<protos.google.cloud.documentai.v1beta3.IImportProcessorVersionResponse, protos.google.cloud.documentai.v1beta3.IImportProcessorVersionMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
IImportProcessorVersionRequest
|
options |
CallOptions
|
callback |
Callback<LROperation<protos.google.cloud.documentai.v1beta3.IImportProcessorVersionResponse, protos.google.cloud.documentai.v1beta3.IImportProcessorVersionMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
importProcessorVersion(request, callback)
importProcessorVersion(request: protos.google.cloud.documentai.v1beta3.IImportProcessorVersionRequest, callback: Callback<LROperation<protos.google.cloud.documentai.v1beta3.IImportProcessorVersionResponse, protos.google.cloud.documentai.v1beta3.IImportProcessorVersionMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
IImportProcessorVersionRequest
|
callback |
Callback<LROperation<protos.google.cloud.documentai.v1beta3.IImportProcessorVersionResponse, protos.google.cloud.documentai.v1beta3.IImportProcessorVersionMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
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. |
listEvaluations(request, options)
listEvaluations(request?: protos.google.cloud.documentai.v1beta3.IListEvaluationsRequest, options?: CallOptions): Promise<[
protos.google.cloud.documentai.v1beta3.IEvaluation[],
protos.google.cloud.documentai.v1beta3.IListEvaluationsRequest | null,
protos.google.cloud.documentai.v1beta3.IListEvaluationsResponse
]>;
Retrieves a set of evaluations for a given processor version.
Parameters | |
---|---|
Name | Description |
request |
IListEvaluationsRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
Promise<[
protos.google.cloud.documentai.v1beta3.IEvaluation[],
protos.google.cloud.documentai.v1beta3.IListEvaluationsRequest | null,
protos.google.cloud.documentai.v1beta3.IListEvaluationsResponse
]> | {Promise} - The promise which resolves to an array. The first element of the array is Array of . The client library will perform auto-pagination by default: it will call the API as many times as needed and will merge results from all the pages into this array. Note that it can affect your quota. We recommend using |
listEvaluations(request, options, callback)
listEvaluations(request: protos.google.cloud.documentai.v1beta3.IListEvaluationsRequest, options: CallOptions, callback: PaginationCallback<protos.google.cloud.documentai.v1beta3.IListEvaluationsRequest, protos.google.cloud.documentai.v1beta3.IListEvaluationsResponse | null | undefined, protos.google.cloud.documentai.v1beta3.IEvaluation>): void;
Parameters | |
---|---|
Name | Description |
request |
IListEvaluationsRequest
|
options |
CallOptions
|
callback |
PaginationCallback<protos.google.cloud.documentai.v1beta3.IListEvaluationsRequest, protos.google.cloud.documentai.v1beta3.IListEvaluationsResponse | null | undefined, protos.google.cloud.documentai.v1beta3.IEvaluation>
|
Returns | |
---|---|
Type | Description |
void |
listEvaluations(request, callback)
listEvaluations(request: protos.google.cloud.documentai.v1beta3.IListEvaluationsRequest, callback: PaginationCallback<protos.google.cloud.documentai.v1beta3.IListEvaluationsRequest, protos.google.cloud.documentai.v1beta3.IListEvaluationsResponse | null | undefined, protos.google.cloud.documentai.v1beta3.IEvaluation>): void;
Parameters | |
---|---|
Name | Description |
request |
IListEvaluationsRequest
|
callback |
PaginationCallback<protos.google.cloud.documentai.v1beta3.IListEvaluationsRequest, protos.google.cloud.documentai.v1beta3.IListEvaluationsResponse | null | undefined, protos.google.cloud.documentai.v1beta3.IEvaluation>
|
Returns | |
---|---|
Type | Description |
void |
listEvaluationsAsync(request, options)
listEvaluationsAsync(request?: protos.google.cloud.documentai.v1beta3.IListEvaluationsRequest, options?: CallOptions): AsyncIterable<protos.google.cloud.documentai.v1beta3.IEvaluation>;
Equivalent to listEvaluations
, but returns an iterable object.
for
-await
-of
syntax is used with the iterable to get response elements on-demand.
Parameters | |
---|---|
Name | Description |
request |
IListEvaluationsRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
AsyncIterable<protos.google.cloud.documentai.v1beta3.IEvaluation> | {Object} An iterable Object that allows async iteration. When you iterate the returned iterable, each element will be an object representing . The API will be called under the hood as needed, once per the page, so you can stop the iteration when you don't need more results. Please see the documentation for more details and examples. |
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. The resource name of the
* ProcessorVersion google.cloud.documentai.v1beta3.ProcessorVersion to
* list evaluations for.
* `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}`
*/
// const parent = 'abc123'
/**
* The standard list page size.
* If unspecified, at most `5` evaluations are returned.
* The maximum value is `100`. Values above `100` are coerced to `100`.
*/
// const pageSize = 1234
/**
* A page token, received from a previous `ListEvaluations` call.
* Provide this to retrieve the subsequent page.
*/
// const pageToken = 'abc123'
// Imports the Documentai library
const {DocumentProcessorServiceClient} = require('@google-cloud/documentai').v1beta3;
// Instantiates a client
const documentaiClient = new DocumentProcessorServiceClient();
async function callListEvaluations() {
// Construct request
const request = {
parent,
};
// Run request
const iterable = documentaiClient.listEvaluationsAsync(request);
for await (const response of iterable) {
console.log(response);
}
}
callListEvaluations();
listEvaluationsStream(request, options)
listEvaluationsStream(request?: protos.google.cloud.documentai.v1beta3.IListEvaluationsRequest, options?: CallOptions): Transform;
Equivalent to method.name.toCamelCase()
, but returns a NodeJS Stream object.
Parameters | |
---|---|
Name | Description |
request |
IListEvaluationsRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
Transform | {Stream} An object stream which emits an object representing on 'data' event. The client library will perform auto-pagination by default: it will call the API as many times as needed. Note that it can affect your quota. We recommend using |
listLocationsAsync(request, options)
listLocationsAsync(request: LocationProtos.google.cloud.location.IListLocationsRequest, options?: CallOptions): AsyncIterable<LocationProtos.google.cloud.location.ILocation>;
Lists information about the supported locations for this service. Returns an iterable object.
for
-await
-of
syntax is used with the iterable to get response elements on-demand.
Parameters | |
---|---|
Name | Description |
request |
LocationProtos.google.cloud.location.IListLocationsRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
AsyncIterable<google.cloud.location.ILocation> | {Object} An iterable Object that allows async iteration. When you iterate the returned iterable, each element will be an object representing . The API will be called under the hood as needed, once per the page, so you can stop the iteration when you don't need more results. Please see the documentation for more details and examples. |
const iterable = client.listLocationsAsync(request);
for await (const response of iterable) {
// process response
}
listOperationsAsync(request, options)
listOperationsAsync(request: protos.google.longrunning.ListOperationsRequest, options?: gax.CallOptions): AsyncIterable<protos.google.longrunning.ListOperationsResponse>;
Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns UNIMPLEMENTED
. Returns an iterable object.
For-await-of syntax is used with the iterable to recursively get response element on-demand.
Parameters | |
---|---|
Name | Description |
request |
ListOperationsRequest
The request object that will be sent. |
options |
CallOptions
Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details. |
Returns | |
---|---|
Type | Description |
AsyncIterable<protos.google.longrunning.ListOperationsResponse> | {Object} An iterable Object that conforms to iteration protocols. |
const client = longrunning.operationsClient();
for await (const response of client.listOperationsAsync(request));
// doThingsWith(response)
listProcessors(request, options)
listProcessors(request?: protos.google.cloud.documentai.v1beta3.IListProcessorsRequest, options?: CallOptions): Promise<[
protos.google.cloud.documentai.v1beta3.IProcessor[],
protos.google.cloud.documentai.v1beta3.IListProcessorsRequest | null,
protos.google.cloud.documentai.v1beta3.IListProcessorsResponse
]>;
Lists all processors which belong to this project.
Parameters | |
---|---|
Name | Description |
request |
IListProcessorsRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
Promise<[
protos.google.cloud.documentai.v1beta3.IProcessor[],
protos.google.cloud.documentai.v1beta3.IListProcessorsRequest | null,
protos.google.cloud.documentai.v1beta3.IListProcessorsResponse
]> | {Promise} - The promise which resolves to an array. The first element of the array is Array of . The client library will perform auto-pagination by default: it will call the API as many times as needed and will merge results from all the pages into this array. Note that it can affect your quota. We recommend using |
listProcessors(request, options, callback)
listProcessors(request: protos.google.cloud.documentai.v1beta3.IListProcessorsRequest, options: CallOptions, callback: PaginationCallback<protos.google.cloud.documentai.v1beta3.IListProcessorsRequest, protos.google.cloud.documentai.v1beta3.IListProcessorsResponse | null | undefined, protos.google.cloud.documentai.v1beta3.IProcessor>): void;
Parameters | |
---|---|
Name | Description |
request |
IListProcessorsRequest
|
options |
CallOptions
|
callback |
PaginationCallback<protos.google.cloud.documentai.v1beta3.IListProcessorsRequest, protos.google.cloud.documentai.v1beta3.IListProcessorsResponse | null | undefined, protos.google.cloud.documentai.v1beta3.IProcessor>
|
Returns | |
---|---|
Type | Description |
void |
listProcessors(request, callback)
listProcessors(request: protos.google.cloud.documentai.v1beta3.IListProcessorsRequest, callback: PaginationCallback<protos.google.cloud.documentai.v1beta3.IListProcessorsRequest, protos.google.cloud.documentai.v1beta3.IListProcessorsResponse | null | undefined, protos.google.cloud.documentai.v1beta3.IProcessor>): void;
Parameters | |
---|---|
Name | Description |
request |
IListProcessorsRequest
|
callback |
PaginationCallback<protos.google.cloud.documentai.v1beta3.IListProcessorsRequest, protos.google.cloud.documentai.v1beta3.IListProcessorsResponse | null | undefined, protos.google.cloud.documentai.v1beta3.IProcessor>
|
Returns | |
---|---|
Type | Description |
void |
listProcessorsAsync(request, options)
listProcessorsAsync(request?: protos.google.cloud.documentai.v1beta3.IListProcessorsRequest, options?: CallOptions): AsyncIterable<protos.google.cloud.documentai.v1beta3.IProcessor>;
Equivalent to listProcessors
, but returns an iterable object.
for
-await
-of
syntax is used with the iterable to get response elements on-demand.
Parameters | |
---|---|
Name | Description |
request |
IListProcessorsRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
AsyncIterable<protos.google.cloud.documentai.v1beta3.IProcessor> | {Object} An iterable Object that allows async iteration. When you iterate the returned iterable, each element will be an object representing . The API will be called under the hood as needed, once per the page, so you can stop the iteration when you don't need more results. Please see the documentation for more details and examples. |
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. The parent (project and location) which owns this collection of
* Processors. Format: `projects/{project}/locations/{location}`
*/
// const parent = 'abc123'
/**
* The maximum number of processors to return.
* If unspecified, at most `50` processors will be returned.
* The maximum value is `100`. Values above `100` will be coerced to `100`.
*/
// const pageSize = 1234
/**
* We will return the processors sorted by creation time. The page token
* will point to the next processor.
*/
// const pageToken = 'abc123'
// Imports the Documentai library
const {DocumentProcessorServiceClient} = require('@google-cloud/documentai').v1beta3;
// Instantiates a client
const documentaiClient = new DocumentProcessorServiceClient();
async function callListProcessors() {
// Construct request
const request = {
parent,
};
// Run request
const iterable = documentaiClient.listProcessorsAsync(request);
for await (const response of iterable) {
console.log(response);
}
}
callListProcessors();
listProcessorsStream(request, options)
listProcessorsStream(request?: protos.google.cloud.documentai.v1beta3.IListProcessorsRequest, options?: CallOptions): Transform;
Equivalent to method.name.toCamelCase()
, but returns a NodeJS Stream object.
Parameters | |
---|---|
Name | Description |
request |
IListProcessorsRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
Transform | {Stream} An object stream which emits an object representing on 'data' event. The client library will perform auto-pagination by default: it will call the API as many times as needed. Note that it can affect your quota. We recommend using |
listProcessorTypes(request, options)
listProcessorTypes(request?: protos.google.cloud.documentai.v1beta3.IListProcessorTypesRequest, options?: CallOptions): Promise<[
protos.google.cloud.documentai.v1beta3.IProcessorType[],
protos.google.cloud.documentai.v1beta3.IListProcessorTypesRequest | null,
protos.google.cloud.documentai.v1beta3.IListProcessorTypesResponse
]>;
Lists the processor types that exist.
Parameters | |
---|---|
Name | Description |
request |
IListProcessorTypesRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
Promise<[
protos.google.cloud.documentai.v1beta3.IProcessorType[],
protos.google.cloud.documentai.v1beta3.IListProcessorTypesRequest | null,
protos.google.cloud.documentai.v1beta3.IListProcessorTypesResponse
]> | {Promise} - The promise which resolves to an array. The first element of the array is Array of . The client library will perform auto-pagination by default: it will call the API as many times as needed and will merge results from all the pages into this array. Note that it can affect your quota. We recommend using |
listProcessorTypes(request, options, callback)
listProcessorTypes(request: protos.google.cloud.documentai.v1beta3.IListProcessorTypesRequest, options: CallOptions, callback: PaginationCallback<protos.google.cloud.documentai.v1beta3.IListProcessorTypesRequest, protos.google.cloud.documentai.v1beta3.IListProcessorTypesResponse | null | undefined, protos.google.cloud.documentai.v1beta3.IProcessorType>): void;
Parameters | |
---|---|
Name | Description |
request |
IListProcessorTypesRequest
|
options |
CallOptions
|
callback |
PaginationCallback<protos.google.cloud.documentai.v1beta3.IListProcessorTypesRequest, protos.google.cloud.documentai.v1beta3.IListProcessorTypesResponse | null | undefined, protos.google.cloud.documentai.v1beta3.IProcessorType>
|
Returns | |
---|---|
Type | Description |
void |
listProcessorTypes(request, callback)
listProcessorTypes(request: protos.google.cloud.documentai.v1beta3.IListProcessorTypesRequest, callback: PaginationCallback<protos.google.cloud.documentai.v1beta3.IListProcessorTypesRequest, protos.google.cloud.documentai.v1beta3.IListProcessorTypesResponse | null | undefined, protos.google.cloud.documentai.v1beta3.IProcessorType>): void;
Parameters | |
---|---|
Name | Description |
request |
IListProcessorTypesRequest
|
callback |
PaginationCallback<protos.google.cloud.documentai.v1beta3.IListProcessorTypesRequest, protos.google.cloud.documentai.v1beta3.IListProcessorTypesResponse | null | undefined, protos.google.cloud.documentai.v1beta3.IProcessorType>
|
Returns | |
---|---|
Type | Description |
void |
listProcessorTypesAsync(request, options)
listProcessorTypesAsync(request?: protos.google.cloud.documentai.v1beta3.IListProcessorTypesRequest, options?: CallOptions): AsyncIterable<protos.google.cloud.documentai.v1beta3.IProcessorType>;
Equivalent to listProcessorTypes
, but returns an iterable object.
for
-await
-of
syntax is used with the iterable to get response elements on-demand.
Parameters | |
---|---|
Name | Description |
request |
IListProcessorTypesRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
AsyncIterable<protos.google.cloud.documentai.v1beta3.IProcessorType> | {Object} An iterable Object that allows async iteration. When you iterate the returned iterable, each element will be an object representing . The API will be called under the hood as needed, once per the page, so you can stop the iteration when you don't need more results. Please see the documentation for more details and examples. |
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. The location of processor types to list.
* Format: `projects/{project}/locations/{location}`.
*/
// const parent = 'abc123'
/**
* The maximum number of processor types to return.
* If unspecified, at most `100` processor types will be returned.
* The maximum value is `500`. Values above `500` will be coerced to `500`.
*/
// const pageSize = 1234
/**
* Used to retrieve the next page of results, empty if at the end of the list.
*/
// const pageToken = 'abc123'
// Imports the Documentai library
const {DocumentProcessorServiceClient} = require('@google-cloud/documentai').v1beta3;
// Instantiates a client
const documentaiClient = new DocumentProcessorServiceClient();
async function callListProcessorTypes() {
// Construct request
const request = {
parent,
};
// Run request
const iterable = documentaiClient.listProcessorTypesAsync(request);
for await (const response of iterable) {
console.log(response);
}
}
callListProcessorTypes();
listProcessorTypesStream(request, options)
listProcessorTypesStream(request?: protos.google.cloud.documentai.v1beta3.IListProcessorTypesRequest, options?: CallOptions): Transform;
Equivalent to method.name.toCamelCase()
, but returns a NodeJS Stream object.
Parameters | |
---|---|
Name | Description |
request |
IListProcessorTypesRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
Transform | {Stream} An object stream which emits an object representing on 'data' event. The client library will perform auto-pagination by default: it will call the API as many times as needed. Note that it can affect your quota. We recommend using |
listProcessorVersions(request, options)
listProcessorVersions(request?: protos.google.cloud.documentai.v1beta3.IListProcessorVersionsRequest, options?: CallOptions): Promise<[
protos.google.cloud.documentai.v1beta3.IProcessorVersion[],
protos.google.cloud.documentai.v1beta3.IListProcessorVersionsRequest | null,
protos.google.cloud.documentai.v1beta3.IListProcessorVersionsResponse
]>;
Lists all versions of a processor.
Parameters | |
---|---|
Name | Description |
request |
IListProcessorVersionsRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
Promise<[
protos.google.cloud.documentai.v1beta3.IProcessorVersion[],
protos.google.cloud.documentai.v1beta3.IListProcessorVersionsRequest | null,
protos.google.cloud.documentai.v1beta3.IListProcessorVersionsResponse
]> | {Promise} - The promise which resolves to an array. The first element of the array is Array of . The client library will perform auto-pagination by default: it will call the API as many times as needed and will merge results from all the pages into this array. Note that it can affect your quota. We recommend using |
listProcessorVersions(request, options, callback)
listProcessorVersions(request: protos.google.cloud.documentai.v1beta3.IListProcessorVersionsRequest, options: CallOptions, callback: PaginationCallback<protos.google.cloud.documentai.v1beta3.IListProcessorVersionsRequest, protos.google.cloud.documentai.v1beta3.IListProcessorVersionsResponse | null | undefined, protos.google.cloud.documentai.v1beta3.IProcessorVersion>): void;
Parameters | |
---|---|
Name | Description |
request |
IListProcessorVersionsRequest
|
options |
CallOptions
|
callback |
PaginationCallback<protos.google.cloud.documentai.v1beta3.IListProcessorVersionsRequest, protos.google.cloud.documentai.v1beta3.IListProcessorVersionsResponse | null | undefined, protos.google.cloud.documentai.v1beta3.IProcessorVersion>
|
Returns | |
---|---|
Type | Description |
void |
listProcessorVersions(request, callback)
listProcessorVersions(request: protos.google.cloud.documentai.v1beta3.IListProcessorVersionsRequest, callback: PaginationCallback<protos.google.cloud.documentai.v1beta3.IListProcessorVersionsRequest, protos.google.cloud.documentai.v1beta3.IListProcessorVersionsResponse | null | undefined, protos.google.cloud.documentai.v1beta3.IProcessorVersion>): void;
Parameters | |
---|---|
Name | Description |
request |
IListProcessorVersionsRequest
|
callback |
PaginationCallback<protos.google.cloud.documentai.v1beta3.IListProcessorVersionsRequest, protos.google.cloud.documentai.v1beta3.IListProcessorVersionsResponse | null | undefined, protos.google.cloud.documentai.v1beta3.IProcessorVersion>
|
Returns | |
---|---|
Type | Description |
void |
listProcessorVersionsAsync(request, options)
listProcessorVersionsAsync(request?: protos.google.cloud.documentai.v1beta3.IListProcessorVersionsRequest, options?: CallOptions): AsyncIterable<protos.google.cloud.documentai.v1beta3.IProcessorVersion>;
Equivalent to listProcessorVersions
, but returns an iterable object.
for
-await
-of
syntax is used with the iterable to get response elements on-demand.
Parameters | |
---|---|
Name | Description |
request |
IListProcessorVersionsRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
AsyncIterable<protos.google.cloud.documentai.v1beta3.IProcessorVersion> | {Object} An iterable Object that allows async iteration. When you iterate the returned iterable, each element will be an object representing . The API will be called under the hood as needed, once per the page, so you can stop the iteration when you don't need more results. Please see the documentation for more details and examples. |
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. The parent (project, location and processor) to list all
* versions. Format:
* `projects/{project}/locations/{location}/processors/{processor}`
*/
// const parent = 'abc123'
/**
* The maximum number of processor versions to return.
* If unspecified, at most `10` processor versions will be returned.
* The maximum value is `20`. Values above `20` will be coerced to `20`.
*/
// const pageSize = 1234
/**
* We will return the processor versions sorted by creation time. The page
* token will point to the next processor version.
*/
// const pageToken = 'abc123'
// Imports the Documentai library
const {DocumentProcessorServiceClient} = require('@google-cloud/documentai').v1beta3;
// Instantiates a client
const documentaiClient = new DocumentProcessorServiceClient();
async function callListProcessorVersions() {
// Construct request
const request = {
parent,
};
// Run request
const iterable = documentaiClient.listProcessorVersionsAsync(request);
for await (const response of iterable) {
console.log(response);
}
}
callListProcessorVersions();
listProcessorVersionsStream(request, options)
listProcessorVersionsStream(request?: protos.google.cloud.documentai.v1beta3.IListProcessorVersionsRequest, options?: CallOptions): Transform;
Equivalent to method.name.toCamelCase()
, but returns a NodeJS Stream object.
Parameters | |
---|---|
Name | Description |
request |
IListProcessorVersionsRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
Transform | {Stream} An object stream which emits an object representing on 'data' event. The client library will perform auto-pagination by default: it will call the API as many times as needed. Note that it can affect your quota. We recommend using |
locationPath(project, location)
locationPath(project: string, location: string): string;
Return a fully-qualified location resource name string.
Parameters | |
---|---|
Name | Description |
project |
string
|
location |
string
|
Returns | |
---|---|
Type | Description |
string | {string} Resource name string. |
matchEvaluationFromEvaluationName(evaluationName)
matchEvaluationFromEvaluationName(evaluationName: string): string | number;
Parse the evaluation from Evaluation resource.
Parameter | |
---|---|
Name | Description |
evaluationName |
string
A fully-qualified path representing Evaluation resource. |
Returns | |
---|---|
Type | Description |
string | number | {string} A string representing the evaluation. |
matchLocationFromDatasetName(datasetName)
matchLocationFromDatasetName(datasetName: string): string | number;
Parse the location from Dataset resource.
Parameter | |
---|---|
Name | Description |
datasetName |
string
A fully-qualified path representing Dataset resource. |
Returns | |
---|---|
Type | Description |
string | number | {string} A string representing the location. |
matchLocationFromDatasetSchemaName(datasetSchemaName)
matchLocationFromDatasetSchemaName(datasetSchemaName: string): string | number;
Parse the location from DatasetSchema resource.
Parameter | |
---|---|
Name | Description |
datasetSchemaName |
string
A fully-qualified path representing DatasetSchema resource. |
Returns | |
---|---|
Type | Description |
string | number | {string} A string representing the location. |
matchLocationFromEvaluationName(evaluationName)
matchLocationFromEvaluationName(evaluationName: string): string | number;
Parse the location from Evaluation resource.
Parameter | |
---|---|
Name | Description |
evaluationName |
string
A fully-qualified path representing Evaluation resource. |
Returns | |
---|---|
Type | Description |
string | number | {string} A string representing the location. |
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. |
matchLocationFromLocationName(locationName)
matchLocationFromLocationName(locationName: string): string | number;
Parse the location from Location resource.
Parameter | |
---|---|
Name | Description |
locationName |
string
A fully-qualified path representing Location 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. |
matchLocationFromProcessorTypeName(processorTypeName)
matchLocationFromProcessorTypeName(processorTypeName: string): string | number;
Parse the location from ProcessorType resource.
Parameter | |
---|---|
Name | Description |
processorTypeName |
string
A fully-qualified path representing ProcessorType resource. |
Returns | |
---|---|
Type | Description |
string | number | {string} A string representing the location. |
matchLocationFromProcessorVersionName(processorVersionName)
matchLocationFromProcessorVersionName(processorVersionName: string): string | number;
Parse the location from ProcessorVersion resource.
Parameter | |
---|---|
Name | Description |
processorVersionName |
string
A fully-qualified path representing ProcessorVersion resource. |
Returns | |
---|---|
Type | Description |
string | number | {string} A string representing the location. |
matchProcessorFromDatasetName(datasetName)
matchProcessorFromDatasetName(datasetName: string): string | number;
Parse the processor from Dataset resource.
Parameter | |
---|---|
Name | Description |
datasetName |
string
A fully-qualified path representing Dataset resource. |
Returns | |
---|---|
Type | Description |
string | number | {string} A string representing the processor. |
matchProcessorFromDatasetSchemaName(datasetSchemaName)
matchProcessorFromDatasetSchemaName(datasetSchemaName: string): string | number;
Parse the processor from DatasetSchema resource.
Parameter | |
---|---|
Name | Description |
datasetSchemaName |
string
A fully-qualified path representing DatasetSchema resource. |
Returns | |
---|---|
Type | Description |
string | number | {string} A string representing the processor. |
matchProcessorFromEvaluationName(evaluationName)
matchProcessorFromEvaluationName(evaluationName: string): string | number;
Parse the processor from Evaluation resource.
Parameter | |
---|---|
Name | Description |
evaluationName |
string
A fully-qualified path representing Evaluation resource. |
Returns | |
---|---|
Type | Description |
string | number | {string} A string representing the processor. |
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. |
matchProcessorFromProcessorVersionName(processorVersionName)
matchProcessorFromProcessorVersionName(processorVersionName: string): string | number;
Parse the processor from ProcessorVersion resource.
Parameter | |
---|---|
Name | Description |
processorVersionName |
string
A fully-qualified path representing ProcessorVersion resource. |
Returns | |
---|---|
Type | Description |
string | number | {string} A string representing the processor. |
matchProcessorTypeFromProcessorTypeName(processorTypeName)
matchProcessorTypeFromProcessorTypeName(processorTypeName: string): string | number;
Parse the processor_type from ProcessorType resource.
Parameter | |
---|---|
Name | Description |
processorTypeName |
string
A fully-qualified path representing ProcessorType resource. |
Returns | |
---|---|
Type | Description |
string | number | {string} A string representing the processor_type. |
matchProcessorVersionFromEvaluationName(evaluationName)
matchProcessorVersionFromEvaluationName(evaluationName: string): string | number;
Parse the processor_version from Evaluation resource.
Parameter | |
---|---|
Name | Description |
evaluationName |
string
A fully-qualified path representing Evaluation resource. |
Returns | |
---|---|
Type | Description |
string | number | {string} A string representing the processor_version. |
matchProcessorVersionFromProcessorVersionName(processorVersionName)
matchProcessorVersionFromProcessorVersionName(processorVersionName: string): string | number;
Parse the processor_version from ProcessorVersion resource.
Parameter | |
---|---|
Name | Description |
processorVersionName |
string
A fully-qualified path representing ProcessorVersion resource. |
Returns | |
---|---|
Type | Description |
string | number | {string} A string representing the processor_version. |
matchProjectFromDatasetName(datasetName)
matchProjectFromDatasetName(datasetName: string): string | number;
Parse the project from Dataset resource.
Parameter | |
---|---|
Name | Description |
datasetName |
string
A fully-qualified path representing Dataset resource. |
Returns | |
---|---|
Type | Description |
string | number | {string} A string representing the project. |
matchProjectFromDatasetSchemaName(datasetSchemaName)
matchProjectFromDatasetSchemaName(datasetSchemaName: string): string | number;
Parse the project from DatasetSchema resource.
Parameter | |
---|---|
Name | Description |
datasetSchemaName |
string
A fully-qualified path representing DatasetSchema resource. |
Returns | |
---|---|
Type | Description |
string | number | {string} A string representing the project. |
matchProjectFromEvaluationName(evaluationName)
matchProjectFromEvaluationName(evaluationName: string): string | number;
Parse the project from Evaluation resource.
Parameter | |
---|---|
Name | Description |
evaluationName |
string
A fully-qualified path representing Evaluation resource. |
Returns | |
---|---|
Type | Description |
string | number | {string} A string representing the project. |
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. |
matchProjectFromLocationName(locationName)
matchProjectFromLocationName(locationName: string): string | number;
Parse the project from Location resource.
Parameter | |
---|---|
Name | Description |
locationName |
string
A fully-qualified path representing Location 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. |
matchProjectFromProcessorTypeName(processorTypeName)
matchProjectFromProcessorTypeName(processorTypeName: string): string | number;
Parse the project from ProcessorType resource.
Parameter | |
---|---|
Name | Description |
processorTypeName |
string
A fully-qualified path representing ProcessorType resource. |
Returns | |
---|---|
Type | Description |
string | number | {string} A string representing the project. |
matchProjectFromProcessorVersionName(processorVersionName)
matchProjectFromProcessorVersionName(processorVersionName: string): string | number;
Parse the project from ProcessorVersion resource.
Parameter | |
---|---|
Name | Description |
processorVersionName |
string
A fully-qualified path representing ProcessorVersion resource. |
Returns | |
---|---|
Type | Description |
string | number | {string} A string representing the project. |
matchProjectFromProjectName(projectName)
matchProjectFromProjectName(projectName: string): string | number;
Parse the project from Project resource.
Parameter | |
---|---|
Name | Description |
projectName |
string
A fully-qualified path representing Project resource. |
Returns | |
---|---|
Type | Description |
string | number | {string} A string representing the project. |
processDocument(request, options)
processDocument(request?: protos.google.cloud.documentai.v1beta3.IProcessRequest, options?: CallOptions): Promise<[
protos.google.cloud.documentai.v1beta3.IProcessResponse,
protos.google.cloud.documentai.v1beta3.IProcessRequest | undefined,
{} | undefined
]>;
Processes a single document.
Parameters | |
---|---|
Name | Description |
request |
IProcessRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
Promise<[
protos.google.cloud.documentai.v1beta3.IProcessResponse,
protos.google.cloud.documentai.v1beta3.IProcessRequest | undefined,
{} | undefined
]> | {Promise} - The promise which resolves to an array. The first element of the array is an object representing ProcessResponse. Please see the documentation for more details and examples. |
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* An inline document proto.
*/
// const inlineDocument = {}
/**
* A raw document content (bytes).
*/
// const rawDocument = {}
/**
* A raw document on Google Cloud Storage.
*/
// const gcsDocument = {}
/**
* Required. The resource name of the
* Processor google.cloud.documentai.v1beta3.Processor or
* ProcessorVersion google.cloud.documentai.v1beta3.ProcessorVersion
* to use for processing. If a
* Processor google.cloud.documentai.v1beta3.Processor is specified, the
* server will use its default
* version google.cloud.documentai.v1beta3.Processor.default_processor_version.
* Format: `projects/{project}/locations/{location}/processors/{processor}`,
* or
* `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}`
*/
// const name = 'abc123'
/**
* 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.
*/
// const document = {}
/**
* Whether human review should be skipped for this request. Default to
* `false`.
*/
// const skipHumanReview = true
/**
* 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}`.
*/
// const fieldMask = {}
/**
* Inference-time options for the process API
*/
// const processOptions = {}
/**
* Optional. The labels with user-defined metadata for the request.
* Label keys and values can be no longer than 63 characters
* (Unicode codepoints) and can only contain lowercase letters, numeric
* characters, underscores, and dashes. International characters are allowed.
* Label values are optional. Label keys must start with a letter.
*/
// const labels = [1,2,3,4]
// Imports the Documentai library
const {DocumentProcessorServiceClient} = require('@google-cloud/documentai').v1beta3;
// Instantiates a client
const documentaiClient = new DocumentProcessorServiceClient();
async function callProcessDocument() {
// Construct request
const request = {
name,
};
// Run request
const response = await documentaiClient.processDocument(request);
console.log(response);
}
callProcessDocument();
processDocument(request, options, callback)
processDocument(request: protos.google.cloud.documentai.v1beta3.IProcessRequest, options: CallOptions, callback: Callback<protos.google.cloud.documentai.v1beta3.IProcessResponse, protos.google.cloud.documentai.v1beta3.IProcessRequest | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
IProcessRequest
|
options |
CallOptions
|
callback |
Callback<protos.google.cloud.documentai.v1beta3.IProcessResponse, protos.google.cloud.documentai.v1beta3.IProcessRequest | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
processDocument(request, callback)
processDocument(request: protos.google.cloud.documentai.v1beta3.IProcessRequest, callback: Callback<protos.google.cloud.documentai.v1beta3.IProcessResponse, protos.google.cloud.documentai.v1beta3.IProcessRequest | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
IProcessRequest
|
callback |
Callback<protos.google.cloud.documentai.v1beta3.IProcessResponse, protos.google.cloud.documentai.v1beta3.IProcessRequest | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
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. |
processorTypePath(project, location, processorType)
processorTypePath(project: string, location: string, processorType: string): string;
Return a fully-qualified processorType resource name string.
Parameters | |
---|---|
Name | Description |
project |
string
|
location |
string
|
processorType |
string
|
Returns | |
---|---|
Type | Description |
string | {string} Resource name string. |
processorVersionPath(project, location, processor, processorVersion)
processorVersionPath(project: string, location: string, processor: string, processorVersion: string): string;
Return a fully-qualified processorVersion resource name string.
Parameters | |
---|---|
Name | Description |
project |
string
|
location |
string
|
processor |
string
|
processorVersion |
string
|
Returns | |
---|---|
Type | Description |
string | {string} Resource name string. |
projectPath(project)
projectPath(project: string): string;
Return a fully-qualified project resource name string.
Parameter | |
---|---|
Name | Description |
project |
string
|
Returns | |
---|---|
Type | Description |
string | {string} Resource name string. |
reviewDocument(request, options)
reviewDocument(request?: protos.google.cloud.documentai.v1beta3.IReviewDocumentRequest, options?: CallOptions): Promise<[
LROperation<protos.google.cloud.documentai.v1beta3.IReviewDocumentResponse, protos.google.cloud.documentai.v1beta3.IReviewDocumentOperationMetadata>,
protos.google.longrunning.IOperation | undefined,
{} | undefined
]>;
Send a document for Human Review. The input document should be processed by the specified processor.
Parameters | |
---|---|
Name | Description |
request |
IReviewDocumentRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
Promise<[
LROperation<protos.google.cloud.documentai.v1beta3.IReviewDocumentResponse, protos.google.cloud.documentai.v1beta3.IReviewDocumentOperationMetadata>,
protos.google.longrunning.IOperation | undefined,
{} | undefined
]> | {Promise} - The promise which resolves to an array. The first element of the array is an object representing a long running operation. Its |
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* An inline document proto.
*/
// const inlineDocument = {}
/**
* Required. The resource name of the
* HumanReviewConfig google.cloud.documentai.v1beta3.HumanReviewConfig that
* the document will be reviewed with.
*/
// const humanReviewConfig = 'abc123'
/**
* The document that needs human review.
*/
// const document = {}
/**
* Whether the validation should be performed on the ad-hoc review request.
*/
// const enableSchemaValidation = true
/**
* The priority of the human review task.
*/
// const priority = {}
/**
* The document schema of the human review task.
*/
// const documentSchema = {}
// Imports the Documentai library
const {DocumentProcessorServiceClient} = require('@google-cloud/documentai').v1beta3;
// Instantiates a client
const documentaiClient = new DocumentProcessorServiceClient();
async function callReviewDocument() {
// Construct request
const request = {
humanReviewConfig,
};
// Run request
const [operation] = await documentaiClient.reviewDocument(request);
const [response] = await operation.promise();
console.log(response);
}
callReviewDocument();
reviewDocument(request, options, callback)
reviewDocument(request: protos.google.cloud.documentai.v1beta3.IReviewDocumentRequest, options: CallOptions, callback: Callback<LROperation<protos.google.cloud.documentai.v1beta3.IReviewDocumentResponse, protos.google.cloud.documentai.v1beta3.IReviewDocumentOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
IReviewDocumentRequest
|
options |
CallOptions
|
callback |
Callback<LROperation<protos.google.cloud.documentai.v1beta3.IReviewDocumentResponse, protos.google.cloud.documentai.v1beta3.IReviewDocumentOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
reviewDocument(request, callback)
reviewDocument(request: protos.google.cloud.documentai.v1beta3.IReviewDocumentRequest, callback: Callback<LROperation<protos.google.cloud.documentai.v1beta3.IReviewDocumentResponse, protos.google.cloud.documentai.v1beta3.IReviewDocumentOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
IReviewDocumentRequest
|
callback |
Callback<LROperation<protos.google.cloud.documentai.v1beta3.IReviewDocumentResponse, protos.google.cloud.documentai.v1beta3.IReviewDocumentOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
setDefaultProcessorVersion(request, options)
setDefaultProcessorVersion(request?: protos.google.cloud.documentai.v1beta3.ISetDefaultProcessorVersionRequest, options?: CallOptions): Promise<[
LROperation<protos.google.cloud.documentai.v1beta3.ISetDefaultProcessorVersionResponse, protos.google.cloud.documentai.v1beta3.ISetDefaultProcessorVersionMetadata>,
protos.google.longrunning.IOperation | undefined,
{} | undefined
]>;
Set the default (active) version of a that will be used in and .
Parameters | |
---|---|
Name | Description |
request |
ISetDefaultProcessorVersionRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
Promise<[
LROperation<protos.google.cloud.documentai.v1beta3.ISetDefaultProcessorVersionResponse, protos.google.cloud.documentai.v1beta3.ISetDefaultProcessorVersionMetadata>,
protos.google.longrunning.IOperation | undefined,
{} | undefined
]> | {Promise} - The promise which resolves to an array. The first element of the array is an object representing a long running operation. Its |
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. The resource name of the
* Processor google.cloud.documentai.v1beta3.Processor to change default
* version.
*/
// const processor = 'abc123'
/**
* Required. The resource name of child
* ProcessorVersion google.cloud.documentai.v1beta3.ProcessorVersion to use
* as default. Format:
* `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{version}`
*/
// const defaultProcessorVersion = 'abc123'
// Imports the Documentai library
const {DocumentProcessorServiceClient} = require('@google-cloud/documentai').v1beta3;
// Instantiates a client
const documentaiClient = new DocumentProcessorServiceClient();
async function callSetDefaultProcessorVersion() {
// Construct request
const request = {
processor,
defaultProcessorVersion,
};
// Run request
const [operation] = await documentaiClient.setDefaultProcessorVersion(request);
const [response] = await operation.promise();
console.log(response);
}
callSetDefaultProcessorVersion();
setDefaultProcessorVersion(request, options, callback)
setDefaultProcessorVersion(request: protos.google.cloud.documentai.v1beta3.ISetDefaultProcessorVersionRequest, options: CallOptions, callback: Callback<LROperation<protos.google.cloud.documentai.v1beta3.ISetDefaultProcessorVersionResponse, protos.google.cloud.documentai.v1beta3.ISetDefaultProcessorVersionMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
ISetDefaultProcessorVersionRequest
|
options |
CallOptions
|
callback |
Callback<LROperation<protos.google.cloud.documentai.v1beta3.ISetDefaultProcessorVersionResponse, protos.google.cloud.documentai.v1beta3.ISetDefaultProcessorVersionMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
setDefaultProcessorVersion(request, callback)
setDefaultProcessorVersion(request: protos.google.cloud.documentai.v1beta3.ISetDefaultProcessorVersionRequest, callback: Callback<LROperation<protos.google.cloud.documentai.v1beta3.ISetDefaultProcessorVersionResponse, protos.google.cloud.documentai.v1beta3.ISetDefaultProcessorVersionMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
ISetDefaultProcessorVersionRequest
|
callback |
Callback<LROperation<protos.google.cloud.documentai.v1beta3.ISetDefaultProcessorVersionResponse, protos.google.cloud.documentai.v1beta3.ISetDefaultProcessorVersionMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
trainProcessorVersion(request, options)
trainProcessorVersion(request?: protos.google.cloud.documentai.v1beta3.ITrainProcessorVersionRequest, options?: CallOptions): Promise<[
LROperation<protos.google.cloud.documentai.v1beta3.ITrainProcessorVersionResponse, protos.google.cloud.documentai.v1beta3.ITrainProcessorVersionMetadata>,
protos.google.longrunning.IOperation | undefined,
{} | undefined
]>;
Trains a new processor version. Operation metadata is returned as .
Parameters | |
---|---|
Name | Description |
request |
ITrainProcessorVersionRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
Promise<[
LROperation<protos.google.cloud.documentai.v1beta3.ITrainProcessorVersionResponse, protos.google.cloud.documentai.v1beta3.ITrainProcessorVersionMetadata>,
protos.google.longrunning.IOperation | undefined,
{} | undefined
]> | {Promise} - The promise which resolves to an array. The first element of the array is an object representing a long running operation. Its |
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Options to control Custom Document Extraction (CDE) Processor.
*/
// const customDocumentExtractionOptions = {}
/**
* Options to control foundation model tuning of a processor.
*/
// const foundationModelTuningOptions = {}
/**
* Required. The parent (project, location and processor) to create the new
* version for. Format:
* `projects/{project}/locations/{location}/processors/{processor}`.
*/
// const parent = 'abc123'
/**
* Required. The processor version to be created.
*/
// const processorVersion = {}
/**
* Optional. The schema the processor version will be trained with.
*/
// const documentSchema = {}
/**
* Optional. The input data used to train the
* ProcessorVersion google.cloud.documentai.v1beta3.ProcessorVersion.
*/
// const inputData = {}
/**
* Optional. The processor version to use as a base for training. This
* processor version must be a child of `parent`. Format:
* `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}`.
*/
// const baseProcessorVersion = 'abc123'
// Imports the Documentai library
const {DocumentProcessorServiceClient} = require('@google-cloud/documentai').v1beta3;
// Instantiates a client
const documentaiClient = new DocumentProcessorServiceClient();
async function callTrainProcessorVersion() {
// Construct request
const request = {
parent,
processorVersion,
};
// Run request
const [operation] = await documentaiClient.trainProcessorVersion(request);
const [response] = await operation.promise();
console.log(response);
}
callTrainProcessorVersion();
trainProcessorVersion(request, options, callback)
trainProcessorVersion(request: protos.google.cloud.documentai.v1beta3.ITrainProcessorVersionRequest, options: CallOptions, callback: Callback<LROperation<protos.google.cloud.documentai.v1beta3.ITrainProcessorVersionResponse, protos.google.cloud.documentai.v1beta3.ITrainProcessorVersionMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
ITrainProcessorVersionRequest
|
options |
CallOptions
|
callback |
Callback<LROperation<protos.google.cloud.documentai.v1beta3.ITrainProcessorVersionResponse, protos.google.cloud.documentai.v1beta3.ITrainProcessorVersionMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
trainProcessorVersion(request, callback)
trainProcessorVersion(request: protos.google.cloud.documentai.v1beta3.ITrainProcessorVersionRequest, callback: Callback<LROperation<protos.google.cloud.documentai.v1beta3.ITrainProcessorVersionResponse, protos.google.cloud.documentai.v1beta3.ITrainProcessorVersionMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
ITrainProcessorVersionRequest
|
callback |
Callback<LROperation<protos.google.cloud.documentai.v1beta3.ITrainProcessorVersionResponse, protos.google.cloud.documentai.v1beta3.ITrainProcessorVersionMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
undeployProcessorVersion(request, options)
undeployProcessorVersion(request?: protos.google.cloud.documentai.v1beta3.IUndeployProcessorVersionRequest, options?: CallOptions): Promise<[
LROperation<protos.google.cloud.documentai.v1beta3.IUndeployProcessorVersionResponse, protos.google.cloud.documentai.v1beta3.IUndeployProcessorVersionMetadata>,
protos.google.longrunning.IOperation | undefined,
{} | undefined
]>;
Undeploys the processor version.
Parameters | |
---|---|
Name | Description |
request |
IUndeployProcessorVersionRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
Promise<[
LROperation<protos.google.cloud.documentai.v1beta3.IUndeployProcessorVersionResponse, protos.google.cloud.documentai.v1beta3.IUndeployProcessorVersionMetadata>,
protos.google.longrunning.IOperation | undefined,
{} | undefined
]> | {Promise} - The promise which resolves to an array. The first element of the array is an object representing a long running operation. Its |
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. The processor version resource name to be undeployed.
*/
// const name = 'abc123'
// Imports the Documentai library
const {DocumentProcessorServiceClient} = require('@google-cloud/documentai').v1beta3;
// Instantiates a client
const documentaiClient = new DocumentProcessorServiceClient();
async function callUndeployProcessorVersion() {
// Construct request
const request = {
name,
};
// Run request
const [operation] = await documentaiClient.undeployProcessorVersion(request);
const [response] = await operation.promise();
console.log(response);
}
callUndeployProcessorVersion();
undeployProcessorVersion(request, options, callback)
undeployProcessorVersion(request: protos.google.cloud.documentai.v1beta3.IUndeployProcessorVersionRequest, options: CallOptions, callback: Callback<LROperation<protos.google.cloud.documentai.v1beta3.IUndeployProcessorVersionResponse, protos.google.cloud.documentai.v1beta3.IUndeployProcessorVersionMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
IUndeployProcessorVersionRequest
|
options |
CallOptions
|
callback |
Callback<LROperation<protos.google.cloud.documentai.v1beta3.IUndeployProcessorVersionResponse, protos.google.cloud.documentai.v1beta3.IUndeployProcessorVersionMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
undeployProcessorVersion(request, callback)
undeployProcessorVersion(request: protos.google.cloud.documentai.v1beta3.IUndeployProcessorVersionRequest, callback: Callback<LROperation<protos.google.cloud.documentai.v1beta3.IUndeployProcessorVersionResponse, protos.google.cloud.documentai.v1beta3.IUndeployProcessorVersionMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
IUndeployProcessorVersionRequest
|
callback |
Callback<LROperation<protos.google.cloud.documentai.v1beta3.IUndeployProcessorVersionResponse, protos.google.cloud.documentai.v1beta3.IUndeployProcessorVersionMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |