UNPKG

@google-cloud/speech

Version:
732 lines 111 kB
import type * as gax from 'google-gax'; import type { Callback, CallOptions, Descriptors, ClientOptions, LROperation, PaginationCallback, LocationsClient, LocationProtos } from 'google-gax'; import { Transform } from 'stream'; import * as protos from '../../protos/protos'; /** * Enables speech transcription and resource management. * @class * @memberof v2 */ export declare class SpeechClient { private _terminated; private _opts; private _providedCustomServicePath; private _gaxModule; private _gaxGrpc; private _protos; private _defaults; private _universeDomain; private _servicePath; private _log; auth: gax.GoogleAuth; descriptors: Descriptors; warn: (code: string, message: string, warnType?: string) => void; innerApiCalls: { [name: string]: Function; }; locationsClient: LocationsClient; pathTemplates: { [name: string]: gax.PathTemplate; }; operationsClient: gax.OperationsClient; speechStub?: Promise<{ [name: string]: Function; }>; /** * Construct an instance of SpeechClient. * * @param {object} [options] - The configuration object. * The options accepted by the constructor are described in detail * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance). * The common options are: * @param {object} [options.credentials] - Credentials object. * @param {string} [options.credentials.client_email] * @param {string} [options.credentials.private_key] * @param {string} [options.email] - Account email address. Required when * using a .pem or .p12 keyFilename. * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or * .p12 key downloaded from the Google Developers Console. If you provide * a path to a JSON file, the projectId option below is not necessary. * NOTE: .pem and .p12 require you to specify options.email as well. * @param {number} [options.port] - The port on which to connect to * the remote host. * @param {string} [options.projectId] - The project ID from the Google * Developer's Console, e.g. 'grape-spaceship-123'. We will also check * the environment variable GCLOUD_PROJECT for your project ID. If your * app is running in an environment which supports * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, * your project ID will be detected automatically. * @param {string} [options.apiEndpoint] - The domain name of the * API remote host. * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. * Follows the structure of {@link gapicConfig}. * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. * For more information, please check the * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. * @param {gax} [gaxInstance]: 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 SpeechClient({fallback: true}, gax); * ``` */ constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback); /** * 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 {Promise} A promise that resolves to an authenticated service stub. */ initialize(): Promise<{ [name: string]: Function; }>; /** * The DNS address for this API service. * @deprecated Use the apiEndpoint method of the client instance. * @returns {string} The DNS address for this service. */ static get servicePath(): string; /** * The DNS address for this API service - same as servicePath. * @deprecated Use the apiEndpoint method of the client instance. * @returns {string} The DNS address for this service. */ static get apiEndpoint(): string; /** * The DNS address for this API service. * @returns {string} The DNS address for this service. */ get apiEndpoint(): string; get universeDomain(): string; /** * The port for this API service. * @returns {number} The default port for this service. */ static get port(): number; /** * The scopes needed to make gRPC calls for every method defined * in this service. * @returns {string[]} List of default scopes. */ static get scopes(): string[]; getProjectId(): Promise<string>; getProjectId(callback: Callback<string, undefined, undefined>): void; /** * Returns the requested * {@link protos.google.cloud.speech.v2.Recognizer|Recognizer}. Fails with * {@link protos.google.rpc.Code.NOT_FOUND|NOT_FOUND} if the requested Recognizer doesn't * exist. * * @param {Object} request * The request object that will be sent. * @param {string} request.name * Required. The name of the Recognizer to retrieve. The expected format is * `projects/{project}/locations/{location}/recognizers/{recognizer}`. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. * The first element of the array is an object representing {@link protos.google.cloud.speech.v2.Recognizer|Recognizer}. * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } * for more details and examples. * @example <caption>include:samples/generated/v2/speech.get_recognizer.js</caption> * region_tag:speech_v2_generated_Speech_GetRecognizer_async */ getRecognizer(request?: protos.google.cloud.speech.v2.IGetRecognizerRequest, options?: CallOptions): Promise<[ protos.google.cloud.speech.v2.IRecognizer, protos.google.cloud.speech.v2.IGetRecognizerRequest | undefined, {} | undefined ]>; getRecognizer(request: protos.google.cloud.speech.v2.IGetRecognizerRequest, options: CallOptions, callback: Callback<protos.google.cloud.speech.v2.IRecognizer, protos.google.cloud.speech.v2.IGetRecognizerRequest | null | undefined, {} | null | undefined>): void; getRecognizer(request: protos.google.cloud.speech.v2.IGetRecognizerRequest, callback: Callback<protos.google.cloud.speech.v2.IRecognizer, protos.google.cloud.speech.v2.IGetRecognizerRequest | null | undefined, {} | null | undefined>): void; /** * Performs synchronous Speech recognition: receive results after all audio * has been sent and processed. * * @param {Object} request * The request object that will be sent. * @param {string} request.recognizer * Required. The name of the Recognizer to use during recognition. The * expected format is * `projects/{project}/locations/{location}/recognizers/{recognizer}`. The * {recognizer} segment may be set to `_` to use an empty implicit Recognizer. * @param {google.cloud.speech.v2.RecognitionConfig} request.config * Features and audio metadata to use for the Automatic Speech Recognition. * This field in combination with the * {@link protos.google.cloud.speech.v2.RecognizeRequest.config_mask|config_mask} field * can be used to override parts of the * {@link protos.google.cloud.speech.v2.Recognizer.default_recognition_config|default_recognition_config} * of the Recognizer resource. * @param {google.protobuf.FieldMask} request.configMask * The list of fields in * {@link protos.google.cloud.speech.v2.RecognizeRequest.config|config} that override the * values in the * {@link protos.google.cloud.speech.v2.Recognizer.default_recognition_config|default_recognition_config} * of the recognizer during this recognition request. If no mask is provided, * all non-default valued fields in * {@link protos.google.cloud.speech.v2.RecognizeRequest.config|config} override the * values in the recognizer for this recognition request. If a mask is * provided, only the fields listed in the mask override the config in the * recognizer for this recognition request. If a wildcard (`*`) is provided, * {@link protos.google.cloud.speech.v2.RecognizeRequest.config|config} completely * overrides and replaces the config in the recognizer for this recognition * request. * @param {Buffer} request.content * The audio data bytes encoded as specified in * {@link protos.google.cloud.speech.v2.RecognitionConfig|RecognitionConfig}. As * with all bytes fields, proto buffers use a pure binary representation, * whereas JSON representations use base64. * @param {string} request.uri * URI that points to a file that contains audio data bytes as specified in * {@link protos.google.cloud.speech.v2.RecognitionConfig|RecognitionConfig}. The file * must not be compressed (for example, gzip). Currently, only Google Cloud * Storage URIs are supported, which must be specified in the following * format: `gs://bucket_name/object_name` (other URI formats return * {@link protos.google.rpc.Code.INVALID_ARGUMENT|INVALID_ARGUMENT}). For more * information, see [Request * URIs](https://cloud.google.com/storage/docs/reference-uris). * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. * The first element of the array is an object representing {@link protos.google.cloud.speech.v2.RecognizeResponse|RecognizeResponse}. * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } * for more details and examples. * @example <caption>include:samples/generated/v2/speech.recognize.js</caption> * region_tag:speech_v2_generated_Speech_Recognize_async */ recognize(request?: protos.google.cloud.speech.v2.IRecognizeRequest, options?: CallOptions): Promise<[ protos.google.cloud.speech.v2.IRecognizeResponse, protos.google.cloud.speech.v2.IRecognizeRequest | undefined, {} | undefined ]>; recognize(request: protos.google.cloud.speech.v2.IRecognizeRequest, options: CallOptions, callback: Callback<protos.google.cloud.speech.v2.IRecognizeResponse, protos.google.cloud.speech.v2.IRecognizeRequest | null | undefined, {} | null | undefined>): void; recognize(request: protos.google.cloud.speech.v2.IRecognizeRequest, callback: Callback<protos.google.cloud.speech.v2.IRecognizeResponse, protos.google.cloud.speech.v2.IRecognizeRequest | null | undefined, {} | null | undefined>): void; /** * Returns the requested {@link protos.google.cloud.speech.v2.Config|Config}. * * @param {Object} request * The request object that will be sent. * @param {string} request.name * Required. The name of the config to retrieve. There is exactly one config * resource per project per location. The expected format is * `projects/{project}/locations/{location}/config`. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. * The first element of the array is an object representing {@link protos.google.cloud.speech.v2.Config|Config}. * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } * for more details and examples. * @example <caption>include:samples/generated/v2/speech.get_config.js</caption> * region_tag:speech_v2_generated_Speech_GetConfig_async */ getConfig(request?: protos.google.cloud.speech.v2.IGetConfigRequest, options?: CallOptions): Promise<[ protos.google.cloud.speech.v2.IConfig, protos.google.cloud.speech.v2.IGetConfigRequest | undefined, {} | undefined ]>; getConfig(request: protos.google.cloud.speech.v2.IGetConfigRequest, options: CallOptions, callback: Callback<protos.google.cloud.speech.v2.IConfig, protos.google.cloud.speech.v2.IGetConfigRequest | null | undefined, {} | null | undefined>): void; getConfig(request: protos.google.cloud.speech.v2.IGetConfigRequest, callback: Callback<protos.google.cloud.speech.v2.IConfig, protos.google.cloud.speech.v2.IGetConfigRequest | null | undefined, {} | null | undefined>): void; /** * Updates the {@link protos.google.cloud.speech.v2.Config|Config}. * * @param {Object} request * The request object that will be sent. * @param {google.cloud.speech.v2.Config} request.config * Required. The config to update. * * The config's `name` field is used to identify the config to be updated. * The expected format is `projects/{project}/locations/{location}/config`. * @param {google.protobuf.FieldMask} request.updateMask * The list of fields to be updated. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. * The first element of the array is an object representing {@link protos.google.cloud.speech.v2.Config|Config}. * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } * for more details and examples. * @example <caption>include:samples/generated/v2/speech.update_config.js</caption> * region_tag:speech_v2_generated_Speech_UpdateConfig_async */ updateConfig(request?: protos.google.cloud.speech.v2.IUpdateConfigRequest, options?: CallOptions): Promise<[ protos.google.cloud.speech.v2.IConfig, protos.google.cloud.speech.v2.IUpdateConfigRequest | undefined, {} | undefined ]>; updateConfig(request: protos.google.cloud.speech.v2.IUpdateConfigRequest, options: CallOptions, callback: Callback<protos.google.cloud.speech.v2.IConfig, protos.google.cloud.speech.v2.IUpdateConfigRequest | null | undefined, {} | null | undefined>): void; updateConfig(request: protos.google.cloud.speech.v2.IUpdateConfigRequest, callback: Callback<protos.google.cloud.speech.v2.IConfig, protos.google.cloud.speech.v2.IUpdateConfigRequest | null | undefined, {} | null | undefined>): void; /** * Returns the requested * {@link protos.google.cloud.speech.v2.CustomClass|CustomClass}. * * @param {Object} request * The request object that will be sent. * @param {string} request.name * Required. The name of the CustomClass to retrieve. The expected format is * `projects/{project}/locations/{location}/customClasses/{custom_class}`. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. * The first element of the array is an object representing {@link protos.google.cloud.speech.v2.CustomClass|CustomClass}. * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } * for more details and examples. * @example <caption>include:samples/generated/v2/speech.get_custom_class.js</caption> * region_tag:speech_v2_generated_Speech_GetCustomClass_async */ getCustomClass(request?: protos.google.cloud.speech.v2.IGetCustomClassRequest, options?: CallOptions): Promise<[ protos.google.cloud.speech.v2.ICustomClass, protos.google.cloud.speech.v2.IGetCustomClassRequest | undefined, {} | undefined ]>; getCustomClass(request: protos.google.cloud.speech.v2.IGetCustomClassRequest, options: CallOptions, callback: Callback<protos.google.cloud.speech.v2.ICustomClass, protos.google.cloud.speech.v2.IGetCustomClassRequest | null | undefined, {} | null | undefined>): void; getCustomClass(request: protos.google.cloud.speech.v2.IGetCustomClassRequest, callback: Callback<protos.google.cloud.speech.v2.ICustomClass, protos.google.cloud.speech.v2.IGetCustomClassRequest | null | undefined, {} | null | undefined>): void; /** * Returns the requested * {@link protos.google.cloud.speech.v2.PhraseSet|PhraseSet}. * * @param {Object} request * The request object that will be sent. * @param {string} request.name * Required. The name of the PhraseSet to retrieve. The expected format is * `projects/{project}/locations/{location}/phraseSets/{phrase_set}`. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. * The first element of the array is an object representing {@link protos.google.cloud.speech.v2.PhraseSet|PhraseSet}. * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } * for more details and examples. * @example <caption>include:samples/generated/v2/speech.get_phrase_set.js</caption> * region_tag:speech_v2_generated_Speech_GetPhraseSet_async */ getPhraseSet(request?: protos.google.cloud.speech.v2.IGetPhraseSetRequest, options?: CallOptions): Promise<[ protos.google.cloud.speech.v2.IPhraseSet, protos.google.cloud.speech.v2.IGetPhraseSetRequest | undefined, {} | undefined ]>; getPhraseSet(request: protos.google.cloud.speech.v2.IGetPhraseSetRequest, options: CallOptions, callback: Callback<protos.google.cloud.speech.v2.IPhraseSet, protos.google.cloud.speech.v2.IGetPhraseSetRequest | null | undefined, {} | null | undefined>): void; getPhraseSet(request: protos.google.cloud.speech.v2.IGetPhraseSetRequest, callback: Callback<protos.google.cloud.speech.v2.IPhraseSet, protos.google.cloud.speech.v2.IGetPhraseSetRequest | null | undefined, {} | null | undefined>): void; /** * Performs bidirectional streaming speech recognition: receive results while * sending audio. This method is only available via the gRPC API (not REST). * * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Stream} * An object stream which is both readable and writable. It accepts objects * representing {@link protos.google.cloud.speech.v2.StreamingRecognizeRequest|StreamingRecognizeRequest} for write() method, and * will emit objects representing {@link protos.google.cloud.speech.v2.StreamingRecognizeResponse|StreamingRecognizeResponse} on 'data' event asynchronously. * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#bi-directional-streaming | documentation } * for more details and examples. * @example <caption>include:samples/generated/v2/speech.streaming_recognize.js</caption> * region_tag:speech_v2_generated_Speech_StreamingRecognize_async */ _streamingRecognize(options?: CallOptions): gax.CancellableStream; /** * Creates a {@link protos.google.cloud.speech.v2.Recognizer|Recognizer}. * * @param {Object} request * The request object that will be sent. * @param {google.cloud.speech.v2.Recognizer} request.recognizer * Required. The Recognizer to create. * @param {boolean} request.validateOnly * If set, validate the request and preview the Recognizer, but do not * actually create it. * @param {string} request.recognizerId * The ID to use for the Recognizer, which will become the final component of * the Recognizer's resource name. * * This value should be 4-63 characters, and valid characters * are /{@link protos.0-9|a-z}-/. * @param {string} request.parent * Required. The project and location where this Recognizer will be created. * The expected format is `projects/{project}/locations/{location}`. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } * for more details and examples. * @example <caption>include:samples/generated/v2/speech.create_recognizer.js</caption> * region_tag:speech_v2_generated_Speech_CreateRecognizer_async */ createRecognizer(request?: protos.google.cloud.speech.v2.ICreateRecognizerRequest, options?: CallOptions): Promise<[ LROperation<protos.google.cloud.speech.v2.IRecognizer, protos.google.cloud.speech.v2.IOperationMetadata>, protos.google.longrunning.IOperation | undefined, {} | undefined ]>; createRecognizer(request: protos.google.cloud.speech.v2.ICreateRecognizerRequest, options: CallOptions, callback: Callback<LROperation<protos.google.cloud.speech.v2.IRecognizer, protos.google.cloud.speech.v2.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void; createRecognizer(request: protos.google.cloud.speech.v2.ICreateRecognizerRequest, callback: Callback<LROperation<protos.google.cloud.speech.v2.IRecognizer, protos.google.cloud.speech.v2.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void; /** * Check the status of the long running operation returned by `createRecognizer()`. * @param {String} name * The operation name that will be passed. * @returns {Promise} - The promise which resolves to an object. * The decoded operation object has result and metadata field to get information from. * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } * for more details and examples. * @example <caption>include:samples/generated/v2/speech.create_recognizer.js</caption> * region_tag:speech_v2_generated_Speech_CreateRecognizer_async */ checkCreateRecognizerProgress(name: string): Promise<LROperation<protos.google.cloud.speech.v2.Recognizer, protos.google.cloud.speech.v2.OperationMetadata>>; /** * Updates the {@link protos.google.cloud.speech.v2.Recognizer|Recognizer}. * * @param {Object} request * The request object that will be sent. * @param {google.cloud.speech.v2.Recognizer} request.recognizer * Required. The Recognizer to update. * * The Recognizer's `name` field is used to identify the Recognizer to update. * Format: `projects/{project}/locations/{location}/recognizers/{recognizer}`. * @param {google.protobuf.FieldMask} request.updateMask * The list of fields to update. If empty, all non-default valued fields are * considered for update. Use `*` to update the entire Recognizer resource. * @param {boolean} request.validateOnly * If set, validate the request and preview the updated Recognizer, but do not * actually update it. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } * for more details and examples. * @example <caption>include:samples/generated/v2/speech.update_recognizer.js</caption> * region_tag:speech_v2_generated_Speech_UpdateRecognizer_async */ updateRecognizer(request?: protos.google.cloud.speech.v2.IUpdateRecognizerRequest, options?: CallOptions): Promise<[ LROperation<protos.google.cloud.speech.v2.IRecognizer, protos.google.cloud.speech.v2.IOperationMetadata>, protos.google.longrunning.IOperation | undefined, {} | undefined ]>; updateRecognizer(request: protos.google.cloud.speech.v2.IUpdateRecognizerRequest, options: CallOptions, callback: Callback<LROperation<protos.google.cloud.speech.v2.IRecognizer, protos.google.cloud.speech.v2.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void; updateRecognizer(request: protos.google.cloud.speech.v2.IUpdateRecognizerRequest, callback: Callback<LROperation<protos.google.cloud.speech.v2.IRecognizer, protos.google.cloud.speech.v2.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void; /** * Check the status of the long running operation returned by `updateRecognizer()`. * @param {String} name * The operation name that will be passed. * @returns {Promise} - The promise which resolves to an object. * The decoded operation object has result and metadata field to get information from. * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } * for more details and examples. * @example <caption>include:samples/generated/v2/speech.update_recognizer.js</caption> * region_tag:speech_v2_generated_Speech_UpdateRecognizer_async */ checkUpdateRecognizerProgress(name: string): Promise<LROperation<protos.google.cloud.speech.v2.Recognizer, protos.google.cloud.speech.v2.OperationMetadata>>; /** * Deletes the {@link protos.google.cloud.speech.v2.Recognizer|Recognizer}. * * @param {Object} request * The request object that will be sent. * @param {string} request.name * Required. The name of the Recognizer to delete. * Format: `projects/{project}/locations/{location}/recognizers/{recognizer}` * @param {boolean} request.validateOnly * If set, validate the request and preview the deleted Recognizer, but do not * actually delete it. * @param {boolean} request.allowMissing * If set to true, and the Recognizer is not found, the request will succeed * and be a no-op (no Operation is recorded in this case). * @param {string} request.etag * This checksum is computed by the server based on the value of other * fields. This may be sent on update, undelete, and delete requests to ensure * the client has an up-to-date value before proceeding. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } * for more details and examples. * @example <caption>include:samples/generated/v2/speech.delete_recognizer.js</caption> * region_tag:speech_v2_generated_Speech_DeleteRecognizer_async */ deleteRecognizer(request?: protos.google.cloud.speech.v2.IDeleteRecognizerRequest, options?: CallOptions): Promise<[ LROperation<protos.google.cloud.speech.v2.IRecognizer, protos.google.cloud.speech.v2.IOperationMetadata>, protos.google.longrunning.IOperation | undefined, {} | undefined ]>; deleteRecognizer(request: protos.google.cloud.speech.v2.IDeleteRecognizerRequest, options: CallOptions, callback: Callback<LROperation<protos.google.cloud.speech.v2.IRecognizer, protos.google.cloud.speech.v2.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void; deleteRecognizer(request: protos.google.cloud.speech.v2.IDeleteRecognizerRequest, callback: Callback<LROperation<protos.google.cloud.speech.v2.IRecognizer, protos.google.cloud.speech.v2.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void; /** * Check the status of the long running operation returned by `deleteRecognizer()`. * @param {String} name * The operation name that will be passed. * @returns {Promise} - The promise which resolves to an object. * The decoded operation object has result and metadata field to get information from. * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } * for more details and examples. * @example <caption>include:samples/generated/v2/speech.delete_recognizer.js</caption> * region_tag:speech_v2_generated_Speech_DeleteRecognizer_async */ checkDeleteRecognizerProgress(name: string): Promise<LROperation<protos.google.cloud.speech.v2.Recognizer, protos.google.cloud.speech.v2.OperationMetadata>>; /** * Undeletes the {@link protos.google.cloud.speech.v2.Recognizer|Recognizer}. * * @param {Object} request * The request object that will be sent. * @param {string} request.name * Required. The name of the Recognizer to undelete. * Format: `projects/{project}/locations/{location}/recognizers/{recognizer}` * @param {boolean} request.validateOnly * If set, validate the request and preview the undeleted Recognizer, but do * not actually undelete it. * @param {string} request.etag * This checksum is computed by the server based on the value of other * fields. This may be sent on update, undelete, and delete requests to ensure * the client has an up-to-date value before proceeding. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } * for more details and examples. * @example <caption>include:samples/generated/v2/speech.undelete_recognizer.js</caption> * region_tag:speech_v2_generated_Speech_UndeleteRecognizer_async */ undeleteRecognizer(request?: protos.google.cloud.speech.v2.IUndeleteRecognizerRequest, options?: CallOptions): Promise<[ LROperation<protos.google.cloud.speech.v2.IRecognizer, protos.google.cloud.speech.v2.IOperationMetadata>, protos.google.longrunning.IOperation | undefined, {} | undefined ]>; undeleteRecognizer(request: protos.google.cloud.speech.v2.IUndeleteRecognizerRequest, options: CallOptions, callback: Callback<LROperation<protos.google.cloud.speech.v2.IRecognizer, protos.google.cloud.speech.v2.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void; undeleteRecognizer(request: protos.google.cloud.speech.v2.IUndeleteRecognizerRequest, callback: Callback<LROperation<protos.google.cloud.speech.v2.IRecognizer, protos.google.cloud.speech.v2.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void; /** * Check the status of the long running operation returned by `undeleteRecognizer()`. * @param {String} name * The operation name that will be passed. * @returns {Promise} - The promise which resolves to an object. * The decoded operation object has result and metadata field to get information from. * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } * for more details and examples. * @example <caption>include:samples/generated/v2/speech.undelete_recognizer.js</caption> * region_tag:speech_v2_generated_Speech_UndeleteRecognizer_async */ checkUndeleteRecognizerProgress(name: string): Promise<LROperation<protos.google.cloud.speech.v2.Recognizer, protos.google.cloud.speech.v2.OperationMetadata>>; /** * Performs batch asynchronous speech recognition: send a request with N * audio files and receive a long running operation that can be polled to see * when the transcriptions are finished. * * @param {Object} request * The request object that will be sent. * @param {string} request.recognizer * Required. The name of the Recognizer to use during recognition. The * expected format is * `projects/{project}/locations/{location}/recognizers/{recognizer}`. The * {recognizer} segment may be set to `_` to use an empty implicit Recognizer. * @param {google.cloud.speech.v2.RecognitionConfig} request.config * Features and audio metadata to use for the Automatic Speech Recognition. * This field in combination with the * {@link protos.google.cloud.speech.v2.BatchRecognizeRequest.config_mask|config_mask} * field can be used to override parts of the * {@link protos.google.cloud.speech.v2.Recognizer.default_recognition_config|default_recognition_config} * of the Recognizer resource. * @param {google.protobuf.FieldMask} request.configMask * The list of fields in * {@link protos.google.cloud.speech.v2.BatchRecognizeRequest.config|config} that override * the values in the * {@link protos.google.cloud.speech.v2.Recognizer.default_recognition_config|default_recognition_config} * of the recognizer during this recognition request. If no mask is provided, * all given fields in * {@link protos.google.cloud.speech.v2.BatchRecognizeRequest.config|config} override the * values in the recognizer for this recognition request. If a mask is * provided, only the fields listed in the mask override the config in the * recognizer for this recognition request. If a wildcard (`*`) is provided, * {@link protos.google.cloud.speech.v2.BatchRecognizeRequest.config|config} completely * overrides and replaces the config in the recognizer for this recognition * request. * @param {number[]} request.files * Audio files with file metadata for ASR. * The maximum number of files allowed to be specified is 15. * @param {google.cloud.speech.v2.RecognitionOutputConfig} request.recognitionOutputConfig * Configuration options for where to output the transcripts of each file. * @param {google.cloud.speech.v2.BatchRecognizeRequest.ProcessingStrategy} request.processingStrategy * Processing strategy to use for this request. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } * for more details and examples. * @example <caption>include:samples/generated/v2/speech.batch_recognize.js</caption> * region_tag:speech_v2_generated_Speech_BatchRecognize_async */ batchRecognize(request?: protos.google.cloud.speech.v2.IBatchRecognizeRequest, options?: CallOptions): Promise<[ LROperation<protos.google.cloud.speech.v2.IBatchRecognizeResponse, protos.google.cloud.speech.v2.IOperationMetadata>, protos.google.longrunning.IOperation | undefined, {} | undefined ]>; batchRecognize(request: protos.google.cloud.speech.v2.IBatchRecognizeRequest, options: CallOptions, callback: Callback<LROperation<protos.google.cloud.speech.v2.IBatchRecognizeResponse, protos.google.cloud.speech.v2.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void; batchRecognize(request: protos.google.cloud.speech.v2.IBatchRecognizeRequest, callback: Callback<LROperation<protos.google.cloud.speech.v2.IBatchRecognizeResponse, protos.google.cloud.speech.v2.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void; /** * Check the status of the long running operation returned by `batchRecognize()`. * @param {String} name * The operation name that will be passed. * @returns {Promise} - The promise which resolves to an object. * The decoded operation object has result and metadata field to get information from. * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } * for more details and examples. * @example <caption>include:samples/generated/v2/speech.batch_recognize.js</caption> * region_tag:speech_v2_generated_Speech_BatchRecognize_async */ checkBatchRecognizeProgress(name: string): Promise<LROperation<protos.google.cloud.speech.v2.BatchRecognizeResponse, protos.google.cloud.speech.v2.OperationMetadata>>; /** * Creates a {@link protos.google.cloud.speech.v2.CustomClass|CustomClass}. * * @param {Object} request * The request object that will be sent. * @param {google.cloud.speech.v2.CustomClass} request.customClass * Required. The CustomClass to create. * @param {boolean} request.validateOnly * If set, validate the request and preview the CustomClass, but do not * actually create it. * @param {string} request.customClassId * The ID to use for the CustomClass, which will become the final component of * the CustomClass's resource name. * * This value should be 4-63 characters, and valid characters * are /{@link protos.0-9|a-z}-/. * @param {string} request.parent * Required. The project and location where this CustomClass will be created. * The expected format is `projects/{project}/locations/{location}`. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } * for more details and examples. * @example <caption>include:samples/generated/v2/speech.create_custom_class.js</caption> * region_tag:speech_v2_generated_Speech_CreateCustomClass_async */ createCustomClass(request?: protos.google.cloud.speech.v2.ICreateCustomClassRequest, options?: CallOptions): Promise<[ LROperation<protos.google.cloud.speech.v2.ICustomClass, protos.google.cloud.speech.v2.IOperationMetadata>, protos.google.longrunning.IOperation | undefined, {} | undefined ]>; createCustomClass(request: protos.google.cloud.speech.v2.ICreateCustomClassRequest, options: CallOptions, callback: Callback<LROperation<protos.google.cloud.speech.v2.ICustomClass, protos.google.cloud.speech.v2.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void; createCustomClass(request: protos.google.cloud.speech.v2.ICreateCustomClassRequest, callback: Callback<LROperation<protos.google.cloud.speech.v2.ICustomClass, protos.google.cloud.speech.v2.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void; /** * Check the status of the long running operation returned by `createCustomClass()`. * @param {String} name * The operation name that will be passed. * @returns {Promise} - The promise which resolves to an object. * The decoded operation object has result and metadata field to get information from. * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } * for more details and examples. * @example <caption>include:samples/generated/v2/speech.create_custom_class.js</caption> * region_tag:speech_v2_generated_Speech_CreateCustomClass_async */ checkCreateCustomClassProgress(name: string): Promise<LROperation<protos.google.cloud.speech.v2.CustomClass, protos.google.cloud.speech.v2.OperationMetadata>>; /** * Updates the {@link protos.google.cloud.speech.v2.CustomClass|CustomClass}. * * @param {Object} request * The request object that will be sent. * @param {google.cloud.speech.v2.CustomClass} request.customClass * Required. The CustomClass to update. * * The CustomClass's `name` field is used to identify the CustomClass to * update. Format: * `projects/{project}/locations/{location}/customClasses/{custom_class}`. * @param {google.protobuf.FieldMask} request.updateMask * The list of fields to be updated. If empty, all fields are considered for * update. * @param {boolean} request.validateOnly * If set, validate the request and preview the updated CustomClass, but do * not actually update it. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } * for more details and examples. * @example <caption>include:samples/generated/v2/speech.update_custom_class.js</caption> * region_tag:speech_v2_generated_Speech_UpdateCustomClass_async */ updateCustomClass(request?: protos.google.cloud.speech.v2.IUpdateCustomClassRequest, options?: CallOptions): Promise<[ LROperation<protos.google.cloud.speech.v2.ICustomClass, protos.google.cloud.speech.v2.IOperationMetadata>, protos.google.longrunning.IOperation | undefined, {} | undefined ]>; updateCustomClass(request: protos.google.cloud.speech.v2.IUpdateCustomClassRequest, options: CallOptions, callback: Callback<LROperation<protos.google.cloud.speech.v2.ICustomClass, protos.google.cloud.speech.v2.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void; updateCustomClass(request: protos.google.cloud.speech.v2.IUpdateCustomClassRequest, callback: Callback<LROperation<protos.google.cloud.speech.v2.ICustomClass, protos.google.cloud.speech.v2.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void; /** * Check the status of the long running operation returned by `updateCustomClass()`. * @param {String} name * The operation name that will be passed. * @returns {Promise} - The promise which resolves to an object. * The decoded operation object has result and metadata field to get information from. * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } * for more details and examples. * @example <caption>include:samples/generated/v2/speech.update_custom_class.js</caption> * region_tag:speech_v2_generated_Speech_UpdateCustomClass_async */ checkUpdateCustomClassProgress(name: string): Promise<LROperation<protos.google.cloud.speech.v2.CustomClass, protos.google.cloud.speech.v2.OperationMetadata>>; /** * Deletes the {@link protos.google.cloud.speech.v2.CustomClass|CustomClass}. * * @param {Object} request * The request object that will be sent. * @param {string} request.name * Required. The name of the CustomClass to delete. * Format: * `projects/{project}/locations/{location}/customClasses/{custom_class}` * @param {boolean} request.validateOnly * If set, validate the request and preview the deleted CustomClass, but do * not actually delete it. * @param {boolean} request.allowMissing * If set to true, and the CustomClass is not found, the request will succeed * and be a no-op (no Operation is recorded in this case). * @param {string} request.etag * This checksum is computed by the server based on the value of other * fields. This may be sent on update, undelete, and delete requests to ensure * the client has an up-to-date value before proceeding. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } * for more details and examples. * @example <caption>include:samples/generated/v2/speech.delete_custom_class.js</caption> * region_tag:speech_v2_generated_Speech_DeleteCustomClass_async */ deleteCustomClass(request?: protos.google.cloud.speech.v2.IDeleteCustomClassRequest, options?: CallOptions): Promise<[ LROperation<protos.google.cloud.speech.v2.ICustomClass, protos.google.cloud.speech.v2.IOperationMetadata>, protos.google.longrunning.IOperation | undefined, {} | undefined ]>; deleteCustomClass(request: protos.google.cloud.speech.v2.IDeleteCustomClassRequest, options: CallOptions, callback: Callback<LROperation<protos.google.cloud.speech.v2.ICustomClass, protos.google.cloud.speech.v2.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void; deleteCustomClass(request: protos.google.cloud.speech.v2.IDeleteCustomClassRequest, callback: Callback<LROperation<protos.google.cloud.speech.v2.ICustomClass, protos.google.cloud.speech.v2.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void; /** * Check the status of the long running operation returned by `deleteCustomClass()`. * @param {String} name * The operation name that will be passed. * @returns {Promise} - The promise which resolves to an object. * The decoded operation object has result and metadata field to get information from. * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } * for more details and examples. * @example <caption>include:samples/generated/v2/speech.delete_custom_class.js</caption> * region_tag:speech_v2_generated_Speech_DeleteCustomClass_async */ checkDeleteCustomClassProgress(name: string): Promise<LROperation<protos.google.cloud.speech.v2.CustomClass, protos.google.cloud.speech.v2.OperationMetadata>>; /** * Undelete