Service to call Cloud DocumentAI to manage document collection (dataset). v1beta3
Package
@google-cloud/documentaiConstructors
(constructor)(opts, gaxInstance)
constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback);
Construct an instance of DocumentServiceClient.
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;
documentServiceStub
documentServiceStub?: 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
batchDeleteDocuments(request, options)
batchDeleteDocuments(request?: protos.google.cloud.documentai.v1beta3.IBatchDeleteDocumentsRequest, options?: CallOptions): Promise<[
LROperation<protos.google.cloud.documentai.v1beta3.IBatchDeleteDocumentsResponse, protos.google.cloud.documentai.v1beta3.IBatchDeleteDocumentsMetadata>,
protos.google.longrunning.IOperation | undefined,
{} | undefined
]>;
Deletes a set of documents.
Parameters | |
---|---|
Name | Description |
request |
IBatchDeleteDocumentsRequest
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.IBatchDeleteDocumentsResponse, protos.google.cloud.documentai.v1beta3.IBatchDeleteDocumentsMetadata>,
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 dataset resource name.
* Format:
* projects/{project}/locations/{location}/processors/{processor}/dataset
*/
// const dataset = 'abc123'
/**
* Required. Dataset documents input. If given `filter`, all documents
* satisfying the filter will be deleted. If given documentIds, a maximum of
* 50 documents can be deleted in a batch. The request will be rejected if
* more than 50 document_ids are provided.
*/
// const datasetDocuments = {}
// Imports the Documentai library
const {DocumentServiceClient} = require('@google-cloud/documentai').v1beta3;
// Instantiates a client
const documentaiClient = new DocumentServiceClient();
async function callBatchDeleteDocuments() {
// Construct request
const request = {
dataset,
datasetDocuments,
};
// Run request
const [operation] = await documentaiClient.batchDeleteDocuments(request);
const [response] = await operation.promise();
console.log(response);
}
callBatchDeleteDocuments();
batchDeleteDocuments(request, options, callback)
batchDeleteDocuments(request: protos.google.cloud.documentai.v1beta3.IBatchDeleteDocumentsRequest, options: CallOptions, callback: Callback<LROperation<protos.google.cloud.documentai.v1beta3.IBatchDeleteDocumentsResponse, protos.google.cloud.documentai.v1beta3.IBatchDeleteDocumentsMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
IBatchDeleteDocumentsRequest
|
options |
CallOptions
|
callback |
Callback<LROperation<protos.google.cloud.documentai.v1beta3.IBatchDeleteDocumentsResponse, protos.google.cloud.documentai.v1beta3.IBatchDeleteDocumentsMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
batchDeleteDocuments(request, callback)
batchDeleteDocuments(request: protos.google.cloud.documentai.v1beta3.IBatchDeleteDocumentsRequest, callback: Callback<LROperation<protos.google.cloud.documentai.v1beta3.IBatchDeleteDocumentsResponse, protos.google.cloud.documentai.v1beta3.IBatchDeleteDocumentsMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
IBatchDeleteDocumentsRequest
|
callback |
Callback<LROperation<protos.google.cloud.documentai.v1beta3.IBatchDeleteDocumentsResponse, protos.google.cloud.documentai.v1beta3.IBatchDeleteDocumentsMetadata>, 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: ''});
checkBatchDeleteDocumentsProgress(name)
checkBatchDeleteDocumentsProgress(name: string): Promise<LROperation<protos.google.cloud.documentai.v1beta3.BatchDeleteDocumentsResponse, protos.google.cloud.documentai.v1beta3.BatchDeleteDocumentsMetadata>>;
Check the status of the long running operation returned by batchDeleteDocuments()
.
Parameter | |
---|---|
Name | Description |
name |
string
The operation name that will be passed. |
Returns | |
---|---|
Type | Description |
Promise<LROperation<protos.google.cloud.documentai.v1beta3.BatchDeleteDocumentsResponse, protos.google.cloud.documentai.v1beta3.BatchDeleteDocumentsMetadata>> | {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 dataset resource name.
* Format:
* projects/{project}/locations/{location}/processors/{processor}/dataset
*/
// const dataset = 'abc123'
/**
* Required. Dataset documents input. If given `filter`, all documents
* satisfying the filter will be deleted. If given documentIds, a maximum of
* 50 documents can be deleted in a batch. The request will be rejected if
* more than 50 document_ids are provided.
*/
// const datasetDocuments = {}
// Imports the Documentai library
const {DocumentServiceClient} = require('@google-cloud/documentai').v1beta3;
// Instantiates a client
const documentaiClient = new DocumentServiceClient();
async function callBatchDeleteDocuments() {
// Construct request
const request = {
dataset,
datasetDocuments,
};
// Run request
const [operation] = await documentaiClient.batchDeleteDocuments(request);
const [response] = await operation.promise();
console.log(response);
}
callBatchDeleteDocuments();
checkImportDocumentsProgress(name)
checkImportDocumentsProgress(name: string): Promise<LROperation<protos.google.cloud.documentai.v1beta3.ImportDocumentsResponse, protos.google.cloud.documentai.v1beta3.ImportDocumentsMetadata>>;
Check the status of the long running operation returned by importDocuments()
.
Parameter | |
---|---|
Name | Description |
name |
string
The operation name that will be passed. |
Returns | |
---|---|
Type | Description |
Promise<LROperation<protos.google.cloud.documentai.v1beta3.ImportDocumentsResponse, protos.google.cloud.documentai.v1beta3.ImportDocumentsMetadata>> | {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 dataset resource name.
* Format:
* projects/{project}/locations/{location}/processors/{processor}/dataset
*/
// const dataset = 'abc123'
/**
* Required. The Cloud Storage uri containing raw documents that must be
* imported.
*/
// const batchDocumentsImportConfigs = [1,2,3,4]
// Imports the Documentai library
const {DocumentServiceClient} = require('@google-cloud/documentai').v1beta3;
// Instantiates a client
const documentaiClient = new DocumentServiceClient();
async function callImportDocuments() {
// Construct request
const request = {
dataset,
batchDocumentsImportConfigs,
};
// Run request
const [operation] = await documentaiClient.importDocuments(request);
const [response] = await operation.promise();
console.log(response);
}
callImportDocuments();
checkUpdateDatasetProgress(name)
checkUpdateDatasetProgress(name: string): Promise<LROperation<protos.google.cloud.documentai.v1beta3.Dataset, protos.google.cloud.documentai.v1beta3.UpdateDatasetOperationMetadata>>;
Check the status of the long running operation returned by updateDataset()
.
Parameter | |
---|---|
Name | Description |
name |
string
The operation name that will be passed. |
Returns | |
---|---|
Type | Description |
Promise<LROperation<protos.google.cloud.documentai.v1beta3.Dataset, protos.google.cloud.documentai.v1beta3.UpdateDatasetOperationMetadata>> | {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 `name` field of the `Dataset` is used to identify the
* resource to be updated.
*/
// const dataset = {}
/**
* The update mask applies to the resource.
*/
// const updateMask = {}
// Imports the Documentai library
const {DocumentServiceClient} = require('@google-cloud/documentai').v1beta3;
// Instantiates a client
const documentaiClient = new DocumentServiceClient();
async function callUpdateDataset() {
// Construct request
const request = {
dataset,
};
// Run request
const [operation] = await documentaiClient.updateDataset(request);
const [response] = await operation.promise();
console.log(response);
}
callUpdateDataset();
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. |
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: ''});
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. |
getDatasetSchema(request, options)
getDatasetSchema(request?: protos.google.cloud.documentai.v1beta3.IGetDatasetSchemaRequest, options?: CallOptions): Promise<[
protos.google.cloud.documentai.v1beta3.IDatasetSchema,
(protos.google.cloud.documentai.v1beta3.IGetDatasetSchemaRequest | undefined),
{} | undefined
]>;
Gets the DatasetSchema
of a Dataset
.
Parameters | |
---|---|
Name | Description |
request |
IGetDatasetSchemaRequest
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.IDatasetSchema,
(protos.google.cloud.documentai.v1beta3.IGetDatasetSchemaRequest | undefined),
{} | undefined
]> | {Promise} - The promise which resolves to an array. The first element of the array is an object representing DatasetSchema. 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 dataset schema resource name.
* Format:
* projects/{project}/locations/{location}/processors/{processor}/dataset/datasetSchema
*/
// const name = 'abc123'
/**
* If set, only returns the visible fields of the schema.
*/
// const visibleFieldsOnly = true
// Imports the Documentai library
const {DocumentServiceClient} = require('@google-cloud/documentai').v1beta3;
// Instantiates a client
const documentaiClient = new DocumentServiceClient();
async function callGetDatasetSchema() {
// Construct request
const request = {
name,
};
// Run request
const response = await documentaiClient.getDatasetSchema(request);
console.log(response);
}
callGetDatasetSchema();
getDatasetSchema(request, options, callback)
getDatasetSchema(request: protos.google.cloud.documentai.v1beta3.IGetDatasetSchemaRequest, options: CallOptions, callback: Callback<protos.google.cloud.documentai.v1beta3.IDatasetSchema, protos.google.cloud.documentai.v1beta3.IGetDatasetSchemaRequest | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
IGetDatasetSchemaRequest
|
options |
CallOptions
|
callback |
Callback<protos.google.cloud.documentai.v1beta3.IDatasetSchema, protos.google.cloud.documentai.v1beta3.IGetDatasetSchemaRequest | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
getDatasetSchema(request, callback)
getDatasetSchema(request: protos.google.cloud.documentai.v1beta3.IGetDatasetSchemaRequest, callback: Callback<protos.google.cloud.documentai.v1beta3.IDatasetSchema, protos.google.cloud.documentai.v1beta3.IGetDatasetSchemaRequest | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
IGetDatasetSchemaRequest
|
callback |
Callback<protos.google.cloud.documentai.v1beta3.IDatasetSchema, protos.google.cloud.documentai.v1beta3.IGetDatasetSchemaRequest | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
getDocument(request, options)
getDocument(request?: protos.google.cloud.documentai.v1beta3.IGetDocumentRequest, options?: CallOptions): Promise<[
protos.google.cloud.documentai.v1beta3.IGetDocumentResponse,
protos.google.cloud.documentai.v1beta3.IGetDocumentRequest | undefined,
{} | undefined
]>;
Returns relevant fields present in the requested document.
Parameters | |
---|---|
Name | Description |
request |
IGetDocumentRequest
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.IGetDocumentResponse,
protos.google.cloud.documentai.v1beta3.IGetDocumentRequest | undefined,
{} | undefined
]> | {Promise} - The promise which resolves to an array. The first element of the array is an object representing GetDocumentResponse. 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 dataset that the document belongs to .
* Format:
* projects/{project}/locations/{location}/processors/{processor}/dataset
*/
// const dataset = 'abc123'
/**
* Required. Document identifier.
*/
// const documentId = {}
/**
* If set, only fields listed here will be returned. Otherwise, all fields
* will be returned by default.
*/
// const readMask = {}
/**
* List of pages for which the fields specified in the `read_mask` must
* be served.
*/
// const pageRange = {}
// Imports the Documentai library
const {DocumentServiceClient} = require('@google-cloud/documentai').v1beta3;
// Instantiates a client
const documentaiClient = new DocumentServiceClient();
async function callGetDocument() {
// Construct request
const request = {
dataset,
documentId,
};
// Run request
const response = await documentaiClient.getDocument(request);
console.log(response);
}
callGetDocument();
getDocument(request, options, callback)
getDocument(request: protos.google.cloud.documentai.v1beta3.IGetDocumentRequest, options: CallOptions, callback: Callback<protos.google.cloud.documentai.v1beta3.IGetDocumentResponse, protos.google.cloud.documentai.v1beta3.IGetDocumentRequest | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
IGetDocumentRequest
|
options |
CallOptions
|
callback |
Callback<protos.google.cloud.documentai.v1beta3.IGetDocumentResponse, protos.google.cloud.documentai.v1beta3.IGetDocumentRequest | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
getDocument(request, callback)
getDocument(request: protos.google.cloud.documentai.v1beta3.IGetDocumentRequest, callback: Callback<protos.google.cloud.documentai.v1beta3.IGetDocumentResponse, protos.google.cloud.documentai.v1beta3.IGetDocumentRequest | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
IGetDocumentRequest
|
callback |
Callback<protos.google.cloud.documentai.v1beta3.IGetDocumentResponse, protos.google.cloud.documentai.v1beta3.IGetDocumentRequest | 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)
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 |
importDocuments(request, options)
importDocuments(request?: protos.google.cloud.documentai.v1beta3.IImportDocumentsRequest, options?: CallOptions): Promise<[
LROperation<protos.google.cloud.documentai.v1beta3.IImportDocumentsResponse, protos.google.cloud.documentai.v1beta3.IImportDocumentsMetadata>,
protos.google.longrunning.IOperation | undefined,
{} | undefined
]>;
Import documents into a dataset.
Parameters | |
---|---|
Name | Description |
request |
IImportDocumentsRequest
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.IImportDocumentsResponse, protos.google.cloud.documentai.v1beta3.IImportDocumentsMetadata>,
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 dataset resource name.
* Format:
* projects/{project}/locations/{location}/processors/{processor}/dataset
*/
// const dataset = 'abc123'
/**
* Required. The Cloud Storage uri containing raw documents that must be
* imported.
*/
// const batchDocumentsImportConfigs = [1,2,3,4]
// Imports the Documentai library
const {DocumentServiceClient} = require('@google-cloud/documentai').v1beta3;
// Instantiates a client
const documentaiClient = new DocumentServiceClient();
async function callImportDocuments() {
// Construct request
const request = {
dataset,
batchDocumentsImportConfigs,
};
// Run request
const [operation] = await documentaiClient.importDocuments(request);
const [response] = await operation.promise();
console.log(response);
}
callImportDocuments();
importDocuments(request, options, callback)
importDocuments(request: protos.google.cloud.documentai.v1beta3.IImportDocumentsRequest, options: CallOptions, callback: Callback<LROperation<protos.google.cloud.documentai.v1beta3.IImportDocumentsResponse, protos.google.cloud.documentai.v1beta3.IImportDocumentsMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
IImportDocumentsRequest
|
options |
CallOptions
|
callback |
Callback<LROperation<protos.google.cloud.documentai.v1beta3.IImportDocumentsResponse, protos.google.cloud.documentai.v1beta3.IImportDocumentsMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
importDocuments(request, callback)
importDocuments(request: protos.google.cloud.documentai.v1beta3.IImportDocumentsRequest, callback: Callback<LROperation<protos.google.cloud.documentai.v1beta3.IImportDocumentsResponse, protos.google.cloud.documentai.v1beta3.IImportDocumentsMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
IImportDocumentsRequest
|
callback |
Callback<LROperation<protos.google.cloud.documentai.v1beta3.IImportDocumentsResponse, protos.google.cloud.documentai.v1beta3.IImportDocumentsMetadata>, 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. |
listDocuments(request, options)
listDocuments(request?: protos.google.cloud.documentai.v1beta3.IListDocumentsRequest, options?: CallOptions): Promise<[
protos.google.cloud.documentai.v1beta3.IDocumentMetadata[],
protos.google.cloud.documentai.v1beta3.IListDocumentsRequest | null,
protos.google.cloud.documentai.v1beta3.IListDocumentsResponse
]>;
Returns a list of documents present in the dataset.
Parameters | |
---|---|
Name | Description |
request |
IListDocumentsRequest
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.IDocumentMetadata[],
protos.google.cloud.documentai.v1beta3.IListDocumentsRequest | null,
protos.google.cloud.documentai.v1beta3.IListDocumentsResponse
]> | {Promise} - The promise which resolves to an array. The first element of the array is Array of DocumentMetadata. 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 |
listDocuments(request, options, callback)
listDocuments(request: protos.google.cloud.documentai.v1beta3.IListDocumentsRequest, options: CallOptions, callback: PaginationCallback<protos.google.cloud.documentai.v1beta3.IListDocumentsRequest, protos.google.cloud.documentai.v1beta3.IListDocumentsResponse | null | undefined, protos.google.cloud.documentai.v1beta3.IDocumentMetadata>): void;
Parameters | |
---|---|
Name | Description |
request |
IListDocumentsRequest
|
options |
CallOptions
|
callback |
PaginationCallback<protos.google.cloud.documentai.v1beta3.IListDocumentsRequest, protos.google.cloud.documentai.v1beta3.IListDocumentsResponse | null | undefined, protos.google.cloud.documentai.v1beta3.IDocumentMetadata>
|
Returns | |
---|---|
Type | Description |
void |
listDocuments(request, callback)
listDocuments(request: protos.google.cloud.documentai.v1beta3.IListDocumentsRequest, callback: PaginationCallback<protos.google.cloud.documentai.v1beta3.IListDocumentsRequest, protos.google.cloud.documentai.v1beta3.IListDocumentsResponse | null | undefined, protos.google.cloud.documentai.v1beta3.IDocumentMetadata>): void;
Parameters | |
---|---|
Name | Description |
request |
IListDocumentsRequest
|
callback |
PaginationCallback<protos.google.cloud.documentai.v1beta3.IListDocumentsRequest, protos.google.cloud.documentai.v1beta3.IListDocumentsResponse | null | undefined, protos.google.cloud.documentai.v1beta3.IDocumentMetadata>
|
Returns | |
---|---|
Type | Description |
void |
listDocumentsAsync(request, options)
listDocumentsAsync(request?: protos.google.cloud.documentai.v1beta3.IListDocumentsRequest, options?: CallOptions): AsyncIterable<protos.google.cloud.documentai.v1beta3.IDocumentMetadata>;
Equivalent to listDocuments
, but returns an iterable object.
for
-await
-of
syntax is used with the iterable to get response elements on-demand.
Parameters | |
---|---|
Name | Description |
request |
IListDocumentsRequest
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.IDocumentMetadata> | {Object} An iterable Object that allows async iteration. When you iterate the returned iterable, each element will be an object representing DocumentMetadata. 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 dataset to be listed.
* Format:
* projects/{project}/locations/{location}/processors/{processor}/dataset
*/
// const dataset = 'abc123'
/**
* The maximum number of documents to return. The service may return
* fewer than this value.
* If unspecified, at most 20 documents will be returned.
* The maximum value is 100; values above 100 will be coerced to 100.
*/
// const pageSize = 1234
/**
* A page token, received from a previous `ListDocuments` call.
* Provide this to retrieve the subsequent page.
* When paginating, all other parameters provided to `ListDocuments`
* must match the call that provided the page token.
*/
// const pageToken = 'abc123'
/**
* Optional. Query to filter the documents based on
* https://google.aip.dev/160.
* ## Currently support query strings are:
* `SplitType=DATASET_SPLIT_TEST|DATASET_SPLIT_TRAIN|DATASET_SPLIT_UNASSIGNED`
* - `LabelingState=DOCUMENT_LABELED|DOCUMENT_UNLABELED|DOCUMENT_AUTO_LABELED`
* - `DisplayName=\"file_name.pdf\"`
* - `EntityType=abc/def`
* - `TagName=\"auto-labeling-running\"|\"sampled\"`
* Note:
* - Only `AND`, `=` and `!=` are supported.
* e.g. `DisplayName=file_name AND EntityType!=abc` IS supported.
* - Wildcard `*` is supported only in `DisplayName` filter
* - No duplicate filter keys are allowed,
* e.g. `EntityType=a AND EntityType=b` is NOT supported.
* - String match is case sensitive (for filter `DisplayName` & `EntityType`).
*/
// const filter = 'abc123'
/**
* Optional. Controls if the request requires a total size of matched
* documents. See
* ListDocumentsResponse.total_size google.cloud.documentai.v1beta3.ListDocumentsResponse.total_size.
* Enabling this flag may adversely impact performance.
* Defaults to false.
*/
// const returnTotalSize = true
/**
* Optional. Number of results to skip beginning from the `page_token` if
* provided. https://google.aip.dev/158#skipping-results. It must be a
* non-negative integer. Negative values will be rejected. Note that this is
* not the number of pages to skip. If this value causes the cursor to move
* past the end of results,
* ListDocumentsResponse.document_metadata google.cloud.documentai.v1beta3.ListDocumentsResponse.document_metadata
* and
* ListDocumentsResponse.next_page_token google.cloud.documentai.v1beta3.ListDocumentsResponse.next_page_token
* will be empty.
*/
// const skip = 1234
// Imports the Documentai library
const {DocumentServiceClient} = require('@google-cloud/documentai').v1beta3;
// Instantiates a client
const documentaiClient = new DocumentServiceClient();
async function callListDocuments() {
// Construct request
const request = {
dataset,
};
// Run request
const iterable = documentaiClient.listDocumentsAsync(request);
for await (const response of iterable) {
console.log(response);
}
}
callListDocuments();
listDocumentsStream(request, options)
listDocumentsStream(request?: protos.google.cloud.documentai.v1beta3.IListDocumentsRequest, options?: CallOptions): Transform;
Equivalent to method.name.toCamelCase()
, but returns a NodeJS Stream object.
Parameters | |
---|---|
Name | Description |
request |
IListDocumentsRequest
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 DocumentMetadata 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)
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. |
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. |
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. |
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. |
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. |
updateDataset(request, options)
updateDataset(request?: protos.google.cloud.documentai.v1beta3.IUpdateDatasetRequest, options?: CallOptions): Promise<[
LROperation<protos.google.cloud.documentai.v1beta3.IDataset, protos.google.cloud.documentai.v1beta3.IUpdateDatasetOperationMetadata>,
protos.google.longrunning.IOperation | undefined,
{} | undefined
]>;
Updates metadata associated with a dataset.
Parameters | |
---|---|
Name | Description |
request |
IUpdateDatasetRequest
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.IDataset, protos.google.cloud.documentai.v1beta3.IUpdateDatasetOperationMetadata>,
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 `name` field of the `Dataset` is used to identify the
* resource to be updated.
*/
// const dataset = {}
/**
* The update mask applies to the resource.
*/
// const updateMask = {}
// Imports the Documentai library
const {DocumentServiceClient} = require('@google-cloud/documentai').v1beta3;
// Instantiates a client
const documentaiClient = new DocumentServiceClient();
async function callUpdateDataset() {
// Construct request
const request = {
dataset,
};
// Run request
const [operation] = await documentaiClient.updateDataset(request);
const [response] = await operation.promise();
console.log(response);
}
callUpdateDataset();
updateDataset(request, options, callback)
updateDataset(request: protos.google.cloud.documentai.v1beta3.IUpdateDatasetRequest, options: CallOptions, callback: Callback<LROperation<protos.google.cloud.documentai.v1beta3.IDataset, protos.google.cloud.documentai.v1beta3.IUpdateDatasetOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
IUpdateDatasetRequest
|
options |
CallOptions
|
callback |
Callback<LROperation<protos.google.cloud.documentai.v1beta3.IDataset, protos.google.cloud.documentai.v1beta3.IUpdateDatasetOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
updateDataset(request, callback)
updateDataset(request: protos.google.cloud.documentai.v1beta3.IUpdateDatasetRequest, callback: Callback<LROperation<protos.google.cloud.documentai.v1beta3.IDataset, protos.google.cloud.documentai.v1beta3.IUpdateDatasetOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
IUpdateDatasetRequest
|
callback |
Callback<LROperation<protos.google.cloud.documentai.v1beta3.IDataset, protos.google.cloud.documentai.v1beta3.IUpdateDatasetOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
updateDatasetSchema(request, options)
updateDatasetSchema(request?: protos.google.cloud.documentai.v1beta3.IUpdateDatasetSchemaRequest, options?: CallOptions): Promise<[
protos.google.cloud.documentai.v1beta3.IDatasetSchema,
(protos.google.cloud.documentai.v1beta3.IUpdateDatasetSchemaRequest | undefined),
{} | undefined
]>;
Updates a DatasetSchema
.
Parameters | |
---|---|
Name | Description |
request |
IUpdateDatasetSchemaRequest
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.IDatasetSchema,
(protos.google.cloud.documentai.v1beta3.IUpdateDatasetSchemaRequest | undefined),
{} | undefined
]> | {Promise} - The promise which resolves to an array. The first element of the array is an object representing DatasetSchema. 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 name field of the `DatasetSchema` is used to identify the
* resource to be updated.
*/
// const datasetSchema = {}
/**
* The update mask applies to the resource.
*/
// const updateMask = {}
// Imports the Documentai library
const {DocumentServiceClient} = require('@google-cloud/documentai').v1beta3;
// Instantiates a client
const documentaiClient = new DocumentServiceClient();
async function callUpdateDatasetSchema() {
// Construct request
const request = {
datasetSchema,
};
// Run request
const response = await documentaiClient.updateDatasetSchema(request);
console.log(response);
}
callUpdateDatasetSchema();
updateDatasetSchema(request, options, callback)
updateDatasetSchema(request: protos.google.cloud.documentai.v1beta3.IUpdateDatasetSchemaRequest, options: CallOptions, callback: Callback<protos.google.cloud.documentai.v1beta3.IDatasetSchema, protos.google.cloud.documentai.v1beta3.IUpdateDatasetSchemaRequest | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
IUpdateDatasetSchemaRequest
|
options |
CallOptions
|
callback |
Callback<protos.google.cloud.documentai.v1beta3.IDatasetSchema, protos.google.cloud.documentai.v1beta3.IUpdateDatasetSchemaRequest | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
updateDatasetSchema(request, callback)
updateDatasetSchema(request: protos.google.cloud.documentai.v1beta3.IUpdateDatasetSchemaRequest, callback: Callback<protos.google.cloud.documentai.v1beta3.IDatasetSchema, protos.google.cloud.documentai.v1beta3.IUpdateDatasetSchemaRequest | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
IUpdateDatasetSchemaRequest
|
callback |
Callback<protos.google.cloud.documentai.v1beta3.IDatasetSchema, protos.google.cloud.documentai.v1beta3.IUpdateDatasetSchemaRequest | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |