Class v1beta3.DocumentServiceClient (8.6.0)

Service to call Cloud DocumentAI to manage document collection (dataset). v1beta3

Package

@google-cloud/documentai

Constructors

(constructor)(opts, gaxInstance)

constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback);

Construct an instance of DocumentServiceClient.

Parameters
NameDescription
opts ClientOptions
gaxInstance typeof gax | typeof fallback

: loaded instance of google-gax. Useful if you need to avoid loading the default gRPC version and want to use the fallback HTTP implementation. Load only fallback version and pass it to the constructor: ``` const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC const client = new DocumentServiceClient({fallback: true}, gax); ```

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
NameDescription
request IBatchDeleteDocumentsRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
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 promise() method returns a promise you can await for. Please see the documentation for more details and examples.

Example

  /**
   * 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
NameDescription
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
TypeDescription
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
NameDescription
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
TypeDescription
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
NameDescription
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
TypeDescription
Promise<protos.google.protobuf.Empty>
Example

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
NameDescription
name string

The operation name that will be passed.

Returns
TypeDescription
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.

Example

  /**
   * 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
NameDescription
name string

The operation name that will be passed.

Returns
TypeDescription
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.

Example

  /**
   * 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
NameDescription
name string

The operation name that will be passed.

Returns
TypeDescription
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.

Example

  /**
   * 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
TypeDescription
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
NameDescription
project string
location string
processor string
Returns
TypeDescription
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
NameDescription
project string
location string
processor string
Returns
TypeDescription
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
NameDescription
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
TypeDescription
Promise<protos.google.protobuf.Empty>
Example

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
NameDescription
project string
location string
processor string
processorVersion string
evaluation string
Returns
TypeDescription
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
NameDescription
request IGetDatasetSchemaRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
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.

Example

  /**
   * 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
NameDescription
request IGetDatasetSchemaRequest
options CallOptions
callback Callback<protos.google.cloud.documentai.v1beta3.IDatasetSchema, protos.google.cloud.documentai.v1beta3.IGetDatasetSchemaRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
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
NameDescription
request IGetDatasetSchemaRequest
callback Callback<protos.google.cloud.documentai.v1beta3.IDatasetSchema, protos.google.cloud.documentai.v1beta3.IGetDatasetSchemaRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
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
NameDescription
request IGetDocumentRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
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.

Example

  /**
   * 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
NameDescription
request IGetDocumentRequest
options CallOptions
callback Callback<protos.google.cloud.documentai.v1beta3.IGetDocumentResponse, protos.google.cloud.documentai.v1beta3.IGetDocumentRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
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
NameDescription
request IGetDocumentRequest
callback Callback<protos.google.cloud.documentai.v1beta3.IGetDocumentResponse, protos.google.cloud.documentai.v1beta3.IGetDocumentRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
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
NameDescription
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
TypeDescription
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.

Example

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
NameDescription
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
TypeDescription
Promise<[protos.google.longrunning.Operation]>
Example

const client = longrunning.operationsClient();
const name = '';
const [response] = await client.getOperation({name});
// doThingsWith(response)

getProjectId()

getProjectId(): Promise<string>;
Returns
TypeDescription
Promise<string>

getProjectId(callback)

getProjectId(callback: Callback<string, undefined, undefined>): void;
Parameter
NameDescription
callback Callback<string, undefined, undefined>
Returns
TypeDescription
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
NameDescription
request IImportDocumentsRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
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 promise() method returns a promise you can await for. Please see the documentation for more details and examples.

Example

  /**
   * 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
NameDescription
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
TypeDescription
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
NameDescription
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
TypeDescription
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
TypeDescription
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
NameDescription
request IListDocumentsRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
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 listDocumentsAsync() method described below for async iteration which you can stop as needed. Please see the documentation for more details and examples.

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
NameDescription
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
TypeDescription
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
NameDescription
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
TypeDescription
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
NameDescription
request IListDocumentsRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
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.

Example

  /**
   * 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
NameDescription
request IListDocumentsRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
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 listDocumentsAsync() method described below for async iteration which you can stop as needed. Please see the documentation for more details and examples.

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
NameDescription
request LocationProtos.google.cloud.location.IListLocationsRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
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.

Example

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
NameDescription
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
TypeDescription
AsyncIterable<protos.google.longrunning.ListOperationsResponse>

{Object} An iterable Object that conforms to iteration protocols.

Example

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
NameDescription
evaluationName string

A fully-qualified path representing Evaluation resource.

Returns
TypeDescription
string | number

{string} A string representing the evaluation.

matchLocationFromDatasetName(datasetName)

matchLocationFromDatasetName(datasetName: string): string | number;

Parse the location from Dataset resource.

Parameter
NameDescription
datasetName string

A fully-qualified path representing Dataset resource.

Returns
TypeDescription
string | number

{string} A string representing the location.

matchLocationFromDatasetSchemaName(datasetSchemaName)

matchLocationFromDatasetSchemaName(datasetSchemaName: string): string | number;

Parse the location from DatasetSchema resource.

Parameter
NameDescription
datasetSchemaName string

A fully-qualified path representing DatasetSchema resource.

Returns
TypeDescription
string | number

{string} A string representing the location.

matchLocationFromEvaluationName(evaluationName)

matchLocationFromEvaluationName(evaluationName: string): string | number;

Parse the location from Evaluation resource.

Parameter
NameDescription
evaluationName string

A fully-qualified path representing Evaluation resource.

Returns
TypeDescription
string | number

{string} A string representing the location.

matchLocationFromProcessorName(processorName)

matchLocationFromProcessorName(processorName: string): string | number;

Parse the location from Processor resource.

Parameter
NameDescription
processorName string

A fully-qualified path representing Processor resource.

Returns
TypeDescription
string | number

{string} A string representing the location.

matchLocationFromProcessorTypeName(processorTypeName)

matchLocationFromProcessorTypeName(processorTypeName: string): string | number;

Parse the location from ProcessorType resource.

Parameter
NameDescription
processorTypeName string

A fully-qualified path representing ProcessorType resource.

Returns
TypeDescription
string | number

{string} A string representing the location.

matchLocationFromProcessorVersionName(processorVersionName)

matchLocationFromProcessorVersionName(processorVersionName: string): string | number;

Parse the location from ProcessorVersion resource.

Parameter
NameDescription
processorVersionName string

A fully-qualified path representing ProcessorVersion resource.

Returns
TypeDescription
string | number

{string} A string representing the location.

matchProcessorFromDatasetName(datasetName)

matchProcessorFromDatasetName(datasetName: string): string | number;

Parse the processor from Dataset resource.

Parameter
NameDescription
datasetName string

A fully-qualified path representing Dataset resource.

Returns
TypeDescription
string | number

{string} A string representing the processor.

matchProcessorFromDatasetSchemaName(datasetSchemaName)

matchProcessorFromDatasetSchemaName(datasetSchemaName: string): string | number;

Parse the processor from DatasetSchema resource.

Parameter
NameDescription
datasetSchemaName string

A fully-qualified path representing DatasetSchema resource.

Returns
TypeDescription
string | number

{string} A string representing the processor.

matchProcessorFromEvaluationName(evaluationName)

matchProcessorFromEvaluationName(evaluationName: string): string | number;

Parse the processor from Evaluation resource.

Parameter
NameDescription
evaluationName string

A fully-qualified path representing Evaluation resource.

Returns
TypeDescription
string | number

{string} A string representing the processor.

matchProcessorFromProcessorName(processorName)

matchProcessorFromProcessorName(processorName: string): string | number;

Parse the processor from Processor resource.

Parameter
NameDescription
processorName string

A fully-qualified path representing Processor resource.

Returns
TypeDescription
string | number

{string} A string representing the processor.

matchProcessorFromProcessorVersionName(processorVersionName)

matchProcessorFromProcessorVersionName(processorVersionName: string): string | number;

Parse the processor from ProcessorVersion resource.

Parameter
NameDescription
processorVersionName string

A fully-qualified path representing ProcessorVersion resource.

Returns
TypeDescription
string | number

{string} A string representing the processor.

matchProcessorTypeFromProcessorTypeName(processorTypeName)

matchProcessorTypeFromProcessorTypeName(processorTypeName: string): string | number;

Parse the processor_type from ProcessorType resource.

Parameter
NameDescription
processorTypeName string

A fully-qualified path representing ProcessorType resource.

Returns
TypeDescription
string | number

{string} A string representing the processor_type.

matchProcessorVersionFromEvaluationName(evaluationName)

matchProcessorVersionFromEvaluationName(evaluationName: string): string | number;

Parse the processor_version from Evaluation resource.

Parameter
NameDescription
evaluationName string

A fully-qualified path representing Evaluation resource.

Returns
TypeDescription
string | number

{string} A string representing the processor_version.

matchProcessorVersionFromProcessorVersionName(processorVersionName)

matchProcessorVersionFromProcessorVersionName(processorVersionName: string): string | number;

Parse the processor_version from ProcessorVersion resource.

Parameter
NameDescription
processorVersionName string

A fully-qualified path representing ProcessorVersion resource.

Returns
TypeDescription
string | number

{string} A string representing the processor_version.

matchProjectFromDatasetName(datasetName)

matchProjectFromDatasetName(datasetName: string): string | number;

Parse the project from Dataset resource.

Parameter
NameDescription
datasetName string

A fully-qualified path representing Dataset resource.

Returns
TypeDescription
string | number

{string} A string representing the project.

matchProjectFromDatasetSchemaName(datasetSchemaName)

matchProjectFromDatasetSchemaName(datasetSchemaName: string): string | number;

Parse the project from DatasetSchema resource.

Parameter
NameDescription
datasetSchemaName string

A fully-qualified path representing DatasetSchema resource.

Returns
TypeDescription
string | number

{string} A string representing the project.

matchProjectFromEvaluationName(evaluationName)

matchProjectFromEvaluationName(evaluationName: string): string | number;

Parse the project from Evaluation resource.

Parameter
NameDescription
evaluationName string

A fully-qualified path representing Evaluation resource.

Returns
TypeDescription
string | number

{string} A string representing the project.

matchProjectFromProcessorName(processorName)

matchProjectFromProcessorName(processorName: string): string | number;

Parse the project from Processor resource.

Parameter
NameDescription
processorName string

A fully-qualified path representing Processor resource.

Returns
TypeDescription
string | number

{string} A string representing the project.

matchProjectFromProcessorTypeName(processorTypeName)

matchProjectFromProcessorTypeName(processorTypeName: string): string | number;

Parse the project from ProcessorType resource.

Parameter
NameDescription
processorTypeName string

A fully-qualified path representing ProcessorType resource.

Returns
TypeDescription
string | number

{string} A string representing the project.

matchProjectFromProcessorVersionName(processorVersionName)

matchProjectFromProcessorVersionName(processorVersionName: string): string | number;

Parse the project from ProcessorVersion resource.

Parameter
NameDescription
processorVersionName string

A fully-qualified path representing ProcessorVersion resource.

Returns
TypeDescription
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
NameDescription
project string
location string
processor string
Returns
TypeDescription
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
NameDescription
project string
location string
processorType string
Returns
TypeDescription
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
NameDescription
project string
location string
processor string
processorVersion string
Returns
TypeDescription
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
NameDescription
request IUpdateDatasetRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
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 promise() method returns a promise you can await for. Please see the documentation for more details and examples.

Example

  /**
   * 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
NameDescription
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
TypeDescription
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
NameDescription
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
TypeDescription
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
NameDescription
request IUpdateDatasetSchemaRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
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.

Example

  /**
   * 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
NameDescription
request IUpdateDatasetSchemaRequest
options CallOptions
callback Callback<protos.google.cloud.documentai.v1beta3.IDatasetSchema, protos.google.cloud.documentai.v1beta3.IUpdateDatasetSchemaRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
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
NameDescription
request IUpdateDatasetSchemaRequest
callback Callback<protos.google.cloud.documentai.v1beta3.IDatasetSchema, protos.google.cloud.documentai.v1beta3.IUpdateDatasetSchemaRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void