Enables speech transcription and resource management. v2
Package
@google-cloud/speechConstructors
(constructor)(opts, gaxInstance)
constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback);
Construct an instance of SpeechClient.
Parameters | |
---|---|
Name | Description |
opts |
ClientOptions
|
gaxInstance |
typeof gax | typeof gax.fallback
: loaded instance of |
Properties
apiEndpoint
static get apiEndpoint(): string;
The DNS address for this API service - same as servicePath(), exists for compatibility reasons.
auth
auth: gax.GoogleAuth;
descriptors
descriptors: Descriptors;
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.
speechStub
speechStub?: Promise<{
[name: string]: Function;
}>;
warn
warn: (code: string, message: string, warnType?: string) => void;
Methods
_streamingRecognize(options)
_streamingRecognize(options?: CallOptions): gax.CancellableStream;
Performs bidirectional streaming speech recognition: receive results while sending audio. This method is only available via the gRPC API (not REST).
Parameter | |
---|---|
Name | Description |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
gax.CancellableStream | {Stream} An object stream which is both readable and writable. It accepts objects representing for write() method, and will emit objects representing on 'data' event asynchronously. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#bi-directional-streaming) for more details and examples. |
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. Streaming recognition should start with an initial request having
* a `recognizer`. Subsequent requests carry the audio data to be recognized.
* The initial request with configuration can be omitted if the Recognizer
* being used has a
* default_recognition_config google.cloud.speech.v2.Recognizer.default_recognition_config.
*/
// const recognizer = 'abc123'
/**
* StreamingRecognitionConfig to be used in this recognition attempt.
* If provided, it will override the default RecognitionConfig stored in the
* Recognizer.
*/
// const streamingConfig = {}
/**
* Inline audio bytes to be Recognized.
* Maximum size for this field is 15 KB per request.
*/
// const audio = 'Buffer.from('string')'
// Imports the Speech library
const {SpeechClient} = require('@google-cloud/speech').v2;
// Instantiates a client
const speechClient = new SpeechClient();
async function callStreamingRecognize() {
// Construct request
const request = {
recognizer,
};
// Run request
const stream = await speechClient.streamingRecognize();
stream.on('data', (response) => { console.log(response) });
stream.on('error', (err) => { throw(err) });
stream.on('end', () => { /* API call completed */ });
stream.write(request);
stream.end();
}
callStreamingRecognize();
batchRecognize(request, options)
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
]>;
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.
Parameters | |
---|---|
Name | Description |
request |
protos.google.cloud.speech.v2.IBatchRecognizeRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
Promise<[
LROperation<protos.google.cloud.speech.v2.IBatchRecognizeResponse, protos.google.cloud.speech.v2.IOperationMetadata>,
protos.google.longrunning.IOperation | undefined,
{} | undefined
]> | {Promise} - The promise which resolves to an array. The first element of the array is an object representing a long running operation. Its |
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. Resource name of the recognizer to be used for ASR.
*/
// const recognizer = 'abc123'
/**
* Features and audio metadata to use for the Automatic Speech Recognition.
* This field in combination with the
* config_mask google.cloud.speech.v2.BatchRecognizeRequest.config_mask
* field can be used to override parts of the
* default_recognition_config google.cloud.speech.v2.Recognizer.default_recognition_config
* of the Recognizer resource.
*/
// const config = {}
/**
* The list of fields in
* config google.cloud.speech.v2.BatchRecognizeRequest.config that override
* the values in the
* default_recognition_config google.cloud.speech.v2.Recognizer.default_recognition_config
* of the recognizer during this recognition request. If no mask is provided,
* all given fields in
* config google.cloud.speech.v2.BatchRecognizeRequest.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,
* config google.cloud.speech.v2.BatchRecognizeRequest.config completely
* overrides and replaces the config in the recognizer for this recognition
* request.
*/
// const configMask = {}
/**
* Audio files with file metadata for ASR.
* The maximum number of files allowed to be specified is 5.
*/
// const files = 1234
/**
* Configuration options for where to output the transcripts of each file.
*/
// const recognitionOutputConfig = {}
// Imports the Speech library
const {SpeechClient} = require('@google-cloud/speech').v2;
// Instantiates a client
const speechClient = new SpeechClient();
async function callBatchRecognize() {
// Construct request
const request = {
recognizer,
};
// Run request
const [operation] = await speechClient.batchRecognize(request);
const [response] = await operation.promise();
console.log(response);
}
callBatchRecognize();
batchRecognize(request, options, callback)
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;
Parameters | |
---|---|
Name | Description |
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>
|
Returns | |
---|---|
Type | Description |
void |
batchRecognize(request, callback)
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;
Parameters | |
---|---|
Name | Description |
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>
|
Returns | |
---|---|
Type | Description |
void |
cancelOperation(request, options, callback)
cancelOperation(request: protos.google.longrunning.CancelOperationRequest, options?: gax.CallOptions | Callback<protos.google.protobuf.Empty, protos.google.longrunning.CancelOperationRequest, {} | undefined | null>, callback?: Callback<protos.google.longrunning.CancelOperationRequest, protos.google.protobuf.Empty, {} | undefined | null>): Promise<protos.google.protobuf.Empty>;
Starts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed. If the server doesn't support this method, it returns google.rpc.Code.UNIMPLEMENTED
. Clients can use or other methods to check whether the cancellation succeeded or whether the operation completed despite cancellation. On successful cancellation, the operation is not deleted; instead, it becomes an operation with an value with a of 1, corresponding to Code.CANCELLED
.
Parameters | |
---|---|
Name | Description |
request |
protos.google.longrunning.CancelOperationRequest
The request object that will be sent. |
options |
gax.CallOptions | Callback<protos.google.protobuf.Empty, protos.google.longrunning.CancelOperationRequest, {} | undefined | null>
Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details. |
callback |
Callback<protos.google.longrunning.CancelOperationRequest, protos.google.protobuf.Empty, {} | undefined | null>
The function which will be called with the result of the API call. {Promise} - The promise which resolves when API call finishes. The promise has a method named "cancel" which cancels the ongoing API call. |
Returns | |
---|---|
Type | Description |
Promise<protos.google.protobuf.Empty> |
const client = longrunning.operationsClient();
await client.cancelOperation({name: ''});
checkBatchRecognizeProgress(name)
checkBatchRecognizeProgress(name: string): Promise<LROperation<protos.google.cloud.speech.v2.BatchRecognizeResponse, protos.google.cloud.speech.v2.OperationMetadata>>;
Check the status of the long running operation returned by batchRecognize()
.
Parameter | |
---|---|
Name | Description |
name |
string
The operation name that will be passed. |
Returns | |
---|---|
Type | Description |
Promise<LROperation<protos.google.cloud.speech.v2.BatchRecognizeResponse, protos.google.cloud.speech.v2.OperationMetadata>> | {Promise} - The promise which resolves to an object. The decoded operation object has result and metadata field to get information from. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) for more details and examples. |
/**
* 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. Resource name of the recognizer to be used for ASR.
*/
// const recognizer = 'abc123'
/**
* Features and audio metadata to use for the Automatic Speech Recognition.
* This field in combination with the
* config_mask google.cloud.speech.v2.BatchRecognizeRequest.config_mask
* field can be used to override parts of the
* default_recognition_config google.cloud.speech.v2.Recognizer.default_recognition_config
* of the Recognizer resource.
*/
// const config = {}
/**
* The list of fields in
* config google.cloud.speech.v2.BatchRecognizeRequest.config that override
* the values in the
* default_recognition_config google.cloud.speech.v2.Recognizer.default_recognition_config
* of the recognizer during this recognition request. If no mask is provided,
* all given fields in
* config google.cloud.speech.v2.BatchRecognizeRequest.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,
* config google.cloud.speech.v2.BatchRecognizeRequest.config completely
* overrides and replaces the config in the recognizer for this recognition
* request.
*/
// const configMask = {}
/**
* Audio files with file metadata for ASR.
* The maximum number of files allowed to be specified is 5.
*/
// const files = 1234
/**
* Configuration options for where to output the transcripts of each file.
*/
// const recognitionOutputConfig = {}
// Imports the Speech library
const {SpeechClient} = require('@google-cloud/speech').v2;
// Instantiates a client
const speechClient = new SpeechClient();
async function callBatchRecognize() {
// Construct request
const request = {
recognizer,
};
// Run request
const [operation] = await speechClient.batchRecognize(request);
const [response] = await operation.promise();
console.log(response);
}
callBatchRecognize();
checkCreateCustomClassProgress(name)
checkCreateCustomClassProgress(name: string): Promise<LROperation<protos.google.cloud.speech.v2.CustomClass, protos.google.cloud.speech.v2.OperationMetadata>>;
Check the status of the long running operation returned by createCustomClass()
.
Parameter | |
---|---|
Name | Description |
name |
string
The operation name that will be passed. |
Returns | |
---|---|
Type | Description |
Promise<LROperation<protos.google.cloud.speech.v2.CustomClass, protos.google.cloud.speech.v2.OperationMetadata>> | {Promise} - The promise which resolves to an object. The decoded operation object has result and metadata field to get information from. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) for more details and examples. |
/**
* 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 CustomClass to create.
*/
// const customClass = {}
/**
* If set, validate the request and preview the CustomClass, but do not
* actually create it.
*/
// const validateOnly = true
/**
* 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 /[a-z][0-9]-/.
*/
// const customClassId = 'abc123'
/**
* Required. The project and location where this CustomClass will be created.
* The expected format is `projects/{project}/locations/{location}`.
*/
// const parent = 'abc123'
// Imports the Speech library
const {SpeechClient} = require('@google-cloud/speech').v2;
// Instantiates a client
const speechClient = new SpeechClient();
async function callCreateCustomClass() {
// Construct request
const request = {
customClass,
parent,
};
// Run request
const [operation] = await speechClient.createCustomClass(request);
const [response] = await operation.promise();
console.log(response);
}
callCreateCustomClass();
checkCreatePhraseSetProgress(name)
checkCreatePhraseSetProgress(name: string): Promise<LROperation<protos.google.cloud.speech.v2.PhraseSet, protos.google.cloud.speech.v2.OperationMetadata>>;
Check the status of the long running operation returned by createPhraseSet()
.
Parameter | |
---|---|
Name | Description |
name |
string
The operation name that will be passed. |
Returns | |
---|---|
Type | Description |
Promise<LROperation<protos.google.cloud.speech.v2.PhraseSet, protos.google.cloud.speech.v2.OperationMetadata>> | {Promise} - The promise which resolves to an object. The decoded operation object has result and metadata field to get information from. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) for more details and examples. |
/**
* 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 PhraseSet to create.
*/
// const phraseSet = {}
/**
* If set, validate the request and preview the PhraseSet, but do not
* actually create it.
*/
// const validateOnly = true
/**
* The ID to use for the PhraseSet, which will become the final component of
* the PhraseSet's resource name.
* This value should be 4-63 characters, and valid characters
* are /[a-z][0-9]-/.
*/
// const phraseSetId = 'abc123'
/**
* Required. The project and location where this PhraseSet will be created.
* The expected format is `projects/{project}/locations/{location}`.
*/
// const parent = 'abc123'
// Imports the Speech library
const {SpeechClient} = require('@google-cloud/speech').v2;
// Instantiates a client
const speechClient = new SpeechClient();
async function callCreatePhraseSet() {
// Construct request
const request = {
phraseSet,
parent,
};
// Run request
const [operation] = await speechClient.createPhraseSet(request);
const [response] = await operation.promise();
console.log(response);
}
callCreatePhraseSet();
checkCreateRecognizerProgress(name)
checkCreateRecognizerProgress(name: string): Promise<LROperation<protos.google.cloud.speech.v2.Recognizer, protos.google.cloud.speech.v2.OperationMetadata>>;
Check the status of the long running operation returned by createRecognizer()
.
Parameter | |
---|---|
Name | Description |
name |
string
The operation name that will be passed. |
Returns | |
---|---|
Type | Description |
Promise<LROperation<protos.google.cloud.speech.v2.Recognizer, protos.google.cloud.speech.v2.OperationMetadata>> | {Promise} - The promise which resolves to an object. The decoded operation object has result and metadata field to get information from. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) for more details and examples. |
/**
* 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 Recognizer to create.
*/
// const recognizer = {}
/**
* If set, validate the request and preview the Recognizer, but do not
* actually create it.
*/
// const validateOnly = true
/**
* 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 /[a-z][0-9]-/.
*/
// const recognizerId = 'abc123'
/**
* Required. The project and location where this Recognizer will be created.
* The expected format is `projects/{project}/locations/{location}`.
*/
// const parent = 'abc123'
// Imports the Speech library
const {SpeechClient} = require('@google-cloud/speech').v2;
// Instantiates a client
const speechClient = new SpeechClient();
async function callCreateRecognizer() {
// Construct request
const request = {
recognizer,
parent,
};
// Run request
const [operation] = await speechClient.createRecognizer(request);
const [response] = await operation.promise();
console.log(response);
}
callCreateRecognizer();
checkDeleteCustomClassProgress(name)
checkDeleteCustomClassProgress(name: string): Promise<LROperation<protos.google.cloud.speech.v2.CustomClass, protos.google.cloud.speech.v2.OperationMetadata>>;
Check the status of the long running operation returned by deleteCustomClass()
.
Parameter | |
---|---|
Name | Description |
name |
string
The operation name that will be passed. |
Returns | |
---|---|
Type | Description |
Promise<LROperation<protos.google.cloud.speech.v2.CustomClass, protos.google.cloud.speech.v2.OperationMetadata>> | {Promise} - The promise which resolves to an object. The decoded operation object has result and metadata field to get information from. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) for more details and examples. |
/**
* 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 of the CustomClass to delete.
* Format:
* `projects/{project}/locations/{location}/customClasses/{custom_class}`
*/
// const name = 'abc123'
/**
* If set, validate the request and preview the deleted CustomClass, but do
* not actually delete it.
*/
// const validateOnly = true
/**
* 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).
*/
// const allowMissing = true
/**
* 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.
*/
// const etag = 'abc123'
// Imports the Speech library
const {SpeechClient} = require('@google-cloud/speech').v2;
// Instantiates a client
const speechClient = new SpeechClient();
async function callDeleteCustomClass() {
// Construct request
const request = {
name,
};
// Run request
const [operation] = await speechClient.deleteCustomClass(request);
const [response] = await operation.promise();
console.log(response);
}
callDeleteCustomClass();
checkDeletePhraseSetProgress(name)
checkDeletePhraseSetProgress(name: string): Promise<LROperation<protos.google.cloud.speech.v2.PhraseSet, protos.google.cloud.speech.v2.OperationMetadata>>;
Check the status of the long running operation returned by deletePhraseSet()
.
Parameter | |
---|---|
Name | Description |
name |
string
The operation name that will be passed. |
Returns | |
---|---|
Type | Description |
Promise<LROperation<protos.google.cloud.speech.v2.PhraseSet, protos.google.cloud.speech.v2.OperationMetadata>> | {Promise} - The promise which resolves to an object. The decoded operation object has result and metadata field to get information from. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) for more details and examples. |
/**
* 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 of the PhraseSet to delete.
* Format: `projects/{project}/locations/{location}/phraseSets/{phrase_set}`
*/
// const name = 'abc123'
/**
* If set, validate the request and preview the deleted PhraseSet, but do not
* actually delete it.
*/
// const validateOnly = true
/**
* If set to true, and the PhraseSet is not found, the request will succeed
* and be a no-op (no Operation is recorded in this case).
*/
// const allowMissing = true
/**
* 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.
*/
// const etag = 'abc123'
// Imports the Speech library
const {SpeechClient} = require('@google-cloud/speech').v2;
// Instantiates a client
const speechClient = new SpeechClient();
async function callDeletePhraseSet() {
// Construct request
const request = {
name,
};
// Run request
const [operation] = await speechClient.deletePhraseSet(request);
const [response] = await operation.promise();
console.log(response);
}
callDeletePhraseSet();
checkDeleteRecognizerProgress(name)
checkDeleteRecognizerProgress(name: string): Promise<LROperation<protos.google.cloud.speech.v2.Recognizer, protos.google.cloud.speech.v2.OperationMetadata>>;
Check the status of the long running operation returned by deleteRecognizer()
.
Parameter | |
---|---|
Name | Description |
name |
string
The operation name that will be passed. |
Returns | |
---|---|
Type | Description |
Promise<LROperation<protos.google.cloud.speech.v2.Recognizer, protos.google.cloud.speech.v2.OperationMetadata>> | {Promise} - The promise which resolves to an object. The decoded operation object has result and metadata field to get information from. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) for more details and examples. |
/**
* 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 of the Recognizer to delete.
* Format: `projects/{project}/locations/{location}/recognizers/{recognizer}`
*/
// const name = 'abc123'
/**
* If set, validate the request and preview the deleted Recognizer, but do not
* actually delete it.
*/
// const validateOnly = true
/**
* 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).
*/
// const allowMissing = true
/**
* 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.
*/
// const etag = 'abc123'
// Imports the Speech library
const {SpeechClient} = require('@google-cloud/speech').v2;
// Instantiates a client
const speechClient = new SpeechClient();
async function callDeleteRecognizer() {
// Construct request
const request = {
name,
};
// Run request
const [operation] = await speechClient.deleteRecognizer(request);
const [response] = await operation.promise();
console.log(response);
}
callDeleteRecognizer();
checkUndeleteCustomClassProgress(name)
checkUndeleteCustomClassProgress(name: string): Promise<LROperation<protos.google.cloud.speech.v2.CustomClass, protos.google.cloud.speech.v2.OperationMetadata>>;
Check the status of the long running operation returned by undeleteCustomClass()
.
Parameter | |
---|---|
Name | Description |
name |
string
The operation name that will be passed. |
Returns | |
---|---|
Type | Description |
Promise<LROperation<protos.google.cloud.speech.v2.CustomClass, protos.google.cloud.speech.v2.OperationMetadata>> | {Promise} - The promise which resolves to an object. The decoded operation object has result and metadata field to get information from. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) for more details and examples. |
/**
* 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 of the CustomClass to undelete.
* Format:
* `projects/{project}/locations/{location}/customClasses/{custom_class}`
*/
// const name = 'abc123'
/**
* If set, validate the request and preview the undeleted CustomClass, but do
* not actually undelete it.
*/
// const validateOnly = true
/**
* 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.
*/
// const etag = 'abc123'
// Imports the Speech library
const {SpeechClient} = require('@google-cloud/speech').v2;
// Instantiates a client
const speechClient = new SpeechClient();
async function callUndeleteCustomClass() {
// Construct request
const request = {
name,
};
// Run request
const [operation] = await speechClient.undeleteCustomClass(request);
const [response] = await operation.promise();
console.log(response);
}
callUndeleteCustomClass();
checkUndeletePhraseSetProgress(name)
checkUndeletePhraseSetProgress(name: string): Promise<LROperation<protos.google.cloud.speech.v2.PhraseSet, protos.google.cloud.speech.v2.OperationMetadata>>;
Check the status of the long running operation returned by undeletePhraseSet()
.
Parameter | |
---|---|
Name | Description |
name |
string
The operation name that will be passed. |
Returns | |
---|---|
Type | Description |
Promise<LROperation<protos.google.cloud.speech.v2.PhraseSet, protos.google.cloud.speech.v2.OperationMetadata>> | {Promise} - The promise which resolves to an object. The decoded operation object has result and metadata field to get information from. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) for more details and examples. |
/**
* 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 of the PhraseSet to undelete.
* Format: `projects/{project}/locations/{location}/phraseSets/{phrase_set}`
*/
// const name = 'abc123'
/**
* If set, validate the request and preview the undeleted PhraseSet, but do
* not actually undelete it.
*/
// const validateOnly = true
/**
* 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.
*/
// const etag = 'abc123'
// Imports the Speech library
const {SpeechClient} = require('@google-cloud/speech').v2;
// Instantiates a client
const speechClient = new SpeechClient();
async function callUndeletePhraseSet() {
// Construct request
const request = {
name,
};
// Run request
const [operation] = await speechClient.undeletePhraseSet(request);
const [response] = await operation.promise();
console.log(response);
}
callUndeletePhraseSet();
checkUndeleteRecognizerProgress(name)
checkUndeleteRecognizerProgress(name: string): Promise<LROperation<protos.google.cloud.speech.v2.Recognizer, protos.google.cloud.speech.v2.OperationMetadata>>;
Check the status of the long running operation returned by undeleteRecognizer()
.
Parameter | |
---|---|
Name | Description |
name |
string
The operation name that will be passed. |
Returns | |
---|---|
Type | Description |
Promise<LROperation<protos.google.cloud.speech.v2.Recognizer, protos.google.cloud.speech.v2.OperationMetadata>> | {Promise} - The promise which resolves to an object. The decoded operation object has result and metadata field to get information from. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) for more details and examples. |
/**
* 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 of the Recognizer to undelete.
* Format: `projects/{project}/locations/{location}/recognizers/{recognizer}`
*/
// const name = 'abc123'
/**
* If set, validate the request and preview the undeleted Recognizer, but do
* not actually undelete it.
*/
// const validateOnly = true
/**
* 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.
*/
// const etag = 'abc123'
// Imports the Speech library
const {SpeechClient} = require('@google-cloud/speech').v2;
// Instantiates a client
const speechClient = new SpeechClient();
async function callUndeleteRecognizer() {
// Construct request
const request = {
name,
};
// Run request
const [operation] = await speechClient.undeleteRecognizer(request);
const [response] = await operation.promise();
console.log(response);
}
callUndeleteRecognizer();
checkUpdateCustomClassProgress(name)
checkUpdateCustomClassProgress(name: string): Promise<LROperation<protos.google.cloud.speech.v2.CustomClass, protos.google.cloud.speech.v2.OperationMetadata>>;
Check the status of the long running operation returned by updateCustomClass()
.
Parameter | |
---|---|
Name | Description |
name |
string
The operation name that will be passed. |
Returns | |
---|---|
Type | Description |
Promise<LROperation<protos.google.cloud.speech.v2.CustomClass, protos.google.cloud.speech.v2.OperationMetadata>> | {Promise} - The promise which resolves to an object. The decoded operation object has result and metadata field to get information from. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) for more details and examples. |
/**
* 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 CustomClass to update.
* The CustomClass's `name` field is used to identify the CustomClass to
* update. Format:
* `projects/{project}/locations/{location}/customClasses/{custom_class}`.
*/
// const customClass = {}
/**
* The list of fields to be updated. If empty, all fields are considered for
* update.
*/
// const updateMask = {}
/**
* If set, validate the request and preview the updated CustomClass, but do
* not actually update it.
*/
// const validateOnly = true
// Imports the Speech library
const {SpeechClient} = require('@google-cloud/speech').v2;
// Instantiates a client
const speechClient = new SpeechClient();
async function callUpdateCustomClass() {
// Construct request
const request = {
customClass,
};
// Run request
const [operation] = await speechClient.updateCustomClass(request);
const [response] = await operation.promise();
console.log(response);
}
callUpdateCustomClass();
checkUpdatePhraseSetProgress(name)
checkUpdatePhraseSetProgress(name: string): Promise<LROperation<protos.google.cloud.speech.v2.PhraseSet, protos.google.cloud.speech.v2.OperationMetadata>>;
Check the status of the long running operation returned by updatePhraseSet()
.
Parameter | |
---|---|
Name | Description |
name |
string
The operation name that will be passed. |
Returns | |
---|---|
Type | Description |
Promise<LROperation<protos.google.cloud.speech.v2.PhraseSet, protos.google.cloud.speech.v2.OperationMetadata>> | {Promise} - The promise which resolves to an object. The decoded operation object has result and metadata field to get information from. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) for more details and examples. |
/**
* 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 PhraseSet to update.
* The PhraseSet's `name` field is used to identify the PhraseSet to update.
* Format: `projects/{project}/locations/{location}/phraseSets/{phrase_set}`.
*/
// const phraseSet = {}
/**
* The list of fields to update. If empty, all non-default valued fields are
* considered for update. Use `*` to update the entire PhraseSet resource.
*/
// const updateMask = {}
/**
* If set, validate the request and preview the updated PhraseSet, but do not
* actually update it.
*/
// const validateOnly = true
// Imports the Speech library
const {SpeechClient} = require('@google-cloud/speech').v2;
// Instantiates a client
const speechClient = new SpeechClient();
async function callUpdatePhraseSet() {
// Construct request
const request = {
phraseSet,
};
// Run request
const [operation] = await speechClient.updatePhraseSet(request);
const [response] = await operation.promise();
console.log(response);
}
callUpdatePhraseSet();
checkUpdateRecognizerProgress(name)
checkUpdateRecognizerProgress(name: string): Promise<LROperation<protos.google.cloud.speech.v2.Recognizer, protos.google.cloud.speech.v2.OperationMetadata>>;
Check the status of the long running operation returned by updateRecognizer()
.
Parameter | |
---|---|
Name | Description |
name |
string
The operation name that will be passed. |
Returns | |
---|---|
Type | Description |
Promise<LROperation<protos.google.cloud.speech.v2.Recognizer, protos.google.cloud.speech.v2.OperationMetadata>> | {Promise} - The promise which resolves to an object. The decoded operation object has result and metadata field to get information from. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) for more details and examples. |
/**
* 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 Recognizer to update.
* The Recognizer's `name` field is used to identify the Recognizer to update.
* Format: `projects/{project}/locations/{location}/recognizers/{recognizer}`.
*/
// const recognizer = {}
/**
* The list of fields to update. If empty, all non-default valued fields are
* considered for update. Use `*` to update the entire Recognizer resource.
*/
// const updateMask = {}
/**
* If set, validate the request and preview the updated Recognizer, but do not
* actually update it.
*/
// const validateOnly = true
// Imports the Speech library
const {SpeechClient} = require('@google-cloud/speech').v2;
// Instantiates a client
const speechClient = new SpeechClient();
async function callUpdateRecognizer() {
// Construct request
const request = {
recognizer,
};
// Run request
const [operation] = await speechClient.updateRecognizer(request);
const [response] = await operation.promise();
console.log(response);
}
callUpdateRecognizer();
close()
close(): Promise<void>;
Terminate the gRPC channel and close the client.
The client will no longer be usable and all future behavior is undefined.
Returns | |
---|---|
Type | Description |
Promise<void> | {Promise} A promise that resolves when the client is closed. |
configPath(project, location)
configPath(project: string, location: string): string;
Return a fully-qualified config resource name string.
Parameters | |
---|---|
Name | Description |
project |
string
|
location |
string
|
Returns | |
---|---|
Type | Description |
string | {string} Resource name string. |
createCustomClass(request, options)
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
]>;
Creates a .
Parameters | |
---|---|
Name | Description |
request |
protos.google.cloud.speech.v2.ICreateCustomClassRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
Promise<[
LROperation<protos.google.cloud.speech.v2.ICustomClass, protos.google.cloud.speech.v2.IOperationMetadata>,
protos.google.longrunning.IOperation | undefined,
{} | undefined
]> | {Promise} - The promise which resolves to an array. The first element of the array is an object representing a long running operation. Its |
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. The CustomClass to create.
*/
// const customClass = {}
/**
* If set, validate the request and preview the CustomClass, but do not
* actually create it.
*/
// const validateOnly = true
/**
* 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 /[a-z][0-9]-/.
*/
// const customClassId = 'abc123'
/**
* Required. The project and location where this CustomClass will be created.
* The expected format is `projects/{project}/locations/{location}`.
*/
// const parent = 'abc123'
// Imports the Speech library
const {SpeechClient} = require('@google-cloud/speech').v2;
// Instantiates a client
const speechClient = new SpeechClient();
async function callCreateCustomClass() {
// Construct request
const request = {
customClass,
parent,
};
// Run request
const [operation] = await speechClient.createCustomClass(request);
const [response] = await operation.promise();
console.log(response);
}
callCreateCustomClass();
createCustomClass(request, options, callback)
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;
Parameters | |
---|---|
Name | Description |
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>
|
Returns | |
---|---|
Type | Description |
void |
createCustomClass(request, callback)
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;
Parameters | |
---|---|
Name | Description |
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>
|
Returns | |
---|---|
Type | Description |
void |
createPhraseSet(request, options)
createPhraseSet(request?: protos.google.cloud.speech.v2.ICreatePhraseSetRequest, options?: CallOptions): Promise<[
LROperation<protos.google.cloud.speech.v2.IPhraseSet, protos.google.cloud.speech.v2.IOperationMetadata>,
protos.google.longrunning.IOperation | undefined,
{} | undefined
]>;
Creates a .
Parameters | |
---|---|
Name | Description |
request |
protos.google.cloud.speech.v2.ICreatePhraseSetRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
Promise<[
LROperation<protos.google.cloud.speech.v2.IPhraseSet, protos.google.cloud.speech.v2.IOperationMetadata>,
protos.google.longrunning.IOperation | undefined,
{} | undefined
]> | {Promise} - The promise which resolves to an array. The first element of the array is an object representing a long running operation. Its |
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. The PhraseSet to create.
*/
// const phraseSet = {}
/**
* If set, validate the request and preview the PhraseSet, but do not
* actually create it.
*/
// const validateOnly = true
/**
* The ID to use for the PhraseSet, which will become the final component of
* the PhraseSet's resource name.
* This value should be 4-63 characters, and valid characters
* are /[a-z][0-9]-/.
*/
// const phraseSetId = 'abc123'
/**
* Required. The project and location where this PhraseSet will be created.
* The expected format is `projects/{project}/locations/{location}`.
*/
// const parent = 'abc123'
// Imports the Speech library
const {SpeechClient} = require('@google-cloud/speech').v2;
// Instantiates a client
const speechClient = new SpeechClient();
async function callCreatePhraseSet() {
// Construct request
const request = {
phraseSet,
parent,
};
// Run request
const [operation] = await speechClient.createPhraseSet(request);
const [response] = await operation.promise();
console.log(response);
}
callCreatePhraseSet();
createPhraseSet(request, options, callback)
createPhraseSet(request: protos.google.cloud.speech.v2.ICreatePhraseSetRequest, options: CallOptions, callback: Callback<LROperation<protos.google.cloud.speech.v2.IPhraseSet, protos.google.cloud.speech.v2.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
protos.google.cloud.speech.v2.ICreatePhraseSetRequest
|
options |
CallOptions
|
callback |
Callback<LROperation<protos.google.cloud.speech.v2.IPhraseSet, protos.google.cloud.speech.v2.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
createPhraseSet(request, callback)
createPhraseSet(request: protos.google.cloud.speech.v2.ICreatePhraseSetRequest, callback: Callback<LROperation<protos.google.cloud.speech.v2.IPhraseSet, protos.google.cloud.speech.v2.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
protos.google.cloud.speech.v2.ICreatePhraseSetRequest
|
callback |
Callback<LROperation<protos.google.cloud.speech.v2.IPhraseSet, protos.google.cloud.speech.v2.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
createRecognizer(request, options)
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
]>;
Creates a .
Parameters | |
---|---|
Name | Description |
request |
protos.google.cloud.speech.v2.ICreateRecognizerRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
Promise<[
LROperation<protos.google.cloud.speech.v2.IRecognizer, protos.google.cloud.speech.v2.IOperationMetadata>,
protos.google.longrunning.IOperation | undefined,
{} | undefined
]> | {Promise} - The promise which resolves to an array. The first element of the array is an object representing a long running operation. Its |
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. The Recognizer to create.
*/
// const recognizer = {}
/**
* If set, validate the request and preview the Recognizer, but do not
* actually create it.
*/
// const validateOnly = true
/**
* 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 /[a-z][0-9]-/.
*/
// const recognizerId = 'abc123'
/**
* Required. The project and location where this Recognizer will be created.
* The expected format is `projects/{project}/locations/{location}`.
*/
// const parent = 'abc123'
// Imports the Speech library
const {SpeechClient} = require('@google-cloud/speech').v2;
// Instantiates a client
const speechClient = new SpeechClient();
async function callCreateRecognizer() {
// Construct request
const request = {
recognizer,
parent,
};
// Run request
const [operation] = await speechClient.createRecognizer(request);
const [response] = await operation.promise();
console.log(response);
}
callCreateRecognizer();
createRecognizer(request, options, callback)
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;
Parameters | |
---|---|
Name | Description |
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>
|
Returns | |
---|---|
Type | Description |
void |
createRecognizer(request, callback)
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;
Parameters | |
---|---|
Name | Description |
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>
|
Returns | |
---|---|
Type | Description |
void |
cryptoKeyPath(project, location, keyRing, cryptoKey)
cryptoKeyPath(project: string, location: string, keyRing: string, cryptoKey: string): string;
Return a fully-qualified cryptoKey resource name string.
Parameters | |
---|---|
Name | Description |
project |
string
|
location |
string
|
keyRing |
string
|
cryptoKey |
string
|
Returns | |
---|---|
Type | Description |
string | {string} Resource name string. |
cryptoKeyVersionPath(project, location, keyRing, cryptoKey, cryptoKeyVersion)
cryptoKeyVersionPath(project: string, location: string, keyRing: string, cryptoKey: string, cryptoKeyVersion: string): string;
Return a fully-qualified cryptoKeyVersion resource name string.
Parameters | |
---|---|
Name | Description |
project |
string
|
location |
string
|
keyRing |
string
|
cryptoKey |
string
|
cryptoKeyVersion |
string
|
Returns | |
---|---|
Type | Description |
string | {string} Resource name string. |
customClassPath(project, location, customClass)
customClassPath(project: string, location: string, customClass: string): string;
Return a fully-qualified customClass resource name string.
Parameters | |
---|---|
Name | Description |
project |
string
|
location |
string
|
customClass |
string
|
Returns | |
---|---|
Type | Description |
string | {string} Resource name string. |
deleteCustomClass(request, options)
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
]>;
Deletes the .
Parameters | |
---|---|
Name | Description |
request |
protos.google.cloud.speech.v2.IDeleteCustomClassRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
Promise<[
LROperation<protos.google.cloud.speech.v2.ICustomClass, protos.google.cloud.speech.v2.IOperationMetadata>,
protos.google.longrunning.IOperation | undefined,
{} | undefined
]> | {Promise} - The promise which resolves to an array. The first element of the array is an object representing a long running operation. Its |
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. The name of the CustomClass to delete.
* Format:
* `projects/{project}/locations/{location}/customClasses/{custom_class}`
*/
// const name = 'abc123'
/**
* If set, validate the request and preview the deleted CustomClass, but do
* not actually delete it.
*/
// const validateOnly = true
/**
* 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).
*/
// const allowMissing = true
/**
* 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.
*/
// const etag = 'abc123'
// Imports the Speech library
const {SpeechClient} = require('@google-cloud/speech').v2;
// Instantiates a client
const speechClient = new SpeechClient();
async function callDeleteCustomClass() {
// Construct request
const request = {
name,
};
// Run request
const [operation] = await speechClient.deleteCustomClass(request);
const [response] = await operation.promise();
console.log(response);
}
callDeleteCustomClass();
deleteCustomClass(request, options, callback)
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;
Parameters | |
---|---|
Name | Description |
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>
|
Returns | |
---|---|
Type | Description |
void |
deleteCustomClass(request, callback)
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;
Parameters | |
---|---|
Name | Description |
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>
|
Returns | |
---|---|
Type | Description |
void |
deleteOperation(request, options, callback)
deleteOperation(request: protos.google.longrunning.DeleteOperationRequest, options?: gax.CallOptions | Callback<protos.google.protobuf.Empty, protos.google.longrunning.DeleteOperationRequest, {} | null | undefined>, callback?: Callback<protos.google.protobuf.Empty, protos.google.longrunning.DeleteOperationRequest, {} | null | undefined>): Promise<protos.google.protobuf.Empty>;
Deletes a long-running operation. This method indicates that the client is no longer interested in the operation result. It does not cancel the operation. If the server doesn't support this method, it returns google.rpc.Code.UNIMPLEMENTED
.
Parameters | |
---|---|
Name | Description |
request |
protos.google.longrunning.DeleteOperationRequest
The request object that will be sent. |
options |
gax.CallOptions | Callback<protos.google.protobuf.Empty, protos.google.longrunning.DeleteOperationRequest, {} | null | undefined>
Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details. |
callback |
Callback<protos.google.protobuf.Empty, protos.google.longrunning.DeleteOperationRequest, {} | null | undefined>
The function which will be called with the result of the API call. {Promise} - The promise which resolves when API call finishes. The promise has a method named "cancel" which cancels the ongoing API call. |
Returns | |
---|---|
Type | Description |
Promise<protos.google.protobuf.Empty> |
const client = longrunning.operationsClient();
await client.deleteOperation({name: ''});
deletePhraseSet(request, options)
deletePhraseSet(request?: protos.google.cloud.speech.v2.IDeletePhraseSetRequest, options?: CallOptions): Promise<[
LROperation<protos.google.cloud.speech.v2.IPhraseSet, protos.google.cloud.speech.v2.IOperationMetadata>,
protos.google.longrunning.IOperation | undefined,
{} | undefined
]>;
Deletes the .
Parameters | |
---|---|
Name | Description |
request |
protos.google.cloud.speech.v2.IDeletePhraseSetRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
Promise<[
LROperation<protos.google.cloud.speech.v2.IPhraseSet, protos.google.cloud.speech.v2.IOperationMetadata>,
protos.google.longrunning.IOperation | undefined,
{} | undefined
]> | {Promise} - The promise which resolves to an array. The first element of the array is an object representing a long running operation. Its |
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. The name of the PhraseSet to delete.
* Format: `projects/{project}/locations/{location}/phraseSets/{phrase_set}`
*/
// const name = 'abc123'
/**
* If set, validate the request and preview the deleted PhraseSet, but do not
* actually delete it.
*/
// const validateOnly = true
/**
* If set to true, and the PhraseSet is not found, the request will succeed
* and be a no-op (no Operation is recorded in this case).
*/
// const allowMissing = true
/**
* 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.
*/
// const etag = 'abc123'
// Imports the Speech library
const {SpeechClient} = require('@google-cloud/speech').v2;
// Instantiates a client
const speechClient = new SpeechClient();
async function callDeletePhraseSet() {
// Construct request
const request = {
name,
};
// Run request
const [operation] = await speechClient.deletePhraseSet(request);
const [response] = await operation.promise();
console.log(response);
}
callDeletePhraseSet();
deletePhraseSet(request, options, callback)
deletePhraseSet(request: protos.google.cloud.speech.v2.IDeletePhraseSetRequest, options: CallOptions, callback: Callback<LROperation<protos.google.cloud.speech.v2.IPhraseSet, protos.google.cloud.speech.v2.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
protos.google.cloud.speech.v2.IDeletePhraseSetRequest
|
options |
CallOptions
|
callback |
Callback<LROperation<protos.google.cloud.speech.v2.IPhraseSet, protos.google.cloud.speech.v2.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
deletePhraseSet(request, callback)
deletePhraseSet(request: protos.google.cloud.speech.v2.IDeletePhraseSetRequest, callback: Callback<LROperation<protos.google.cloud.speech.v2.IPhraseSet, protos.google.cloud.speech.v2.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
protos.google.cloud.speech.v2.IDeletePhraseSetRequest
|
callback |
Callback<LROperation<protos.google.cloud.speech.v2.IPhraseSet, protos.google.cloud.speech.v2.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
deleteRecognizer(request, options)
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
]>;
Deletes the .
Parameters | |
---|---|
Name | Description |
request |
protos.google.cloud.speech.v2.IDeleteRecognizerRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
Promise<[
LROperation<protos.google.cloud.speech.v2.IRecognizer, protos.google.cloud.speech.v2.IOperationMetadata>,
protos.google.longrunning.IOperation | undefined,
{} | undefined
]> | {Promise} - The promise which resolves to an array. The first element of the array is an object representing a long running operation. Its |
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. The name of the Recognizer to delete.
* Format: `projects/{project}/locations/{location}/recognizers/{recognizer}`
*/
// const name = 'abc123'
/**
* If set, validate the request and preview the deleted Recognizer, but do not
* actually delete it.
*/
// const validateOnly = true
/**
* 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).
*/
// const allowMissing = true
/**
* 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.
*/
// const etag = 'abc123'
// Imports the Speech library
const {SpeechClient} = require('@google-cloud/speech').v2;
// Instantiates a client
const speechClient = new SpeechClient();
async function callDeleteRecognizer() {
// Construct request
const request = {
name,
};
// Run request
const [operation] = await speechClient.deleteRecognizer(request);
const [response] = await operation.promise();
console.log(response);
}
callDeleteRecognizer();
deleteRecognizer(request, options, callback)
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;
Parameters | |
---|---|
Name | Description |
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>
|
Returns | |
---|---|
Type | Description |
void |
deleteRecognizer(request, callback)
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;
Parameters | |
---|---|
Name | Description |
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>
|
Returns | |
---|---|
Type | Description |
void |
getConfig(request, options)
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
]>;
Returns the requested .
Parameters | |
---|---|
Name | Description |
request |
protos.google.cloud.speech.v2.IGetConfigRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
Promise<[
protos.google.cloud.speech.v2.IConfig,
protos.google.cloud.speech.v2.IGetConfigRequest | undefined,
{} | undefined
]> | {Promise} - The promise which resolves to an array. The first element of the array is an object representing . Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) for more details and examples. |
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. The name of the config to retrieve. There is exactly one config
* resource per project per location. The expected format is
* `projects/{project}/locations/{location}/config`.
*/
// const name = 'abc123'
// Imports the Speech library
const {SpeechClient} = require('@google-cloud/speech').v2;
// Instantiates a client
const speechClient = new SpeechClient();
async function callGetConfig() {
// Construct request
const request = {
name,
};
// Run request
const response = await speechClient.getConfig(request);
console.log(response);
}
callGetConfig();
getConfig(request, options, callback)
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;
Parameters | |
---|---|
Name | Description |
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>
|
Returns | |
---|---|
Type | Description |
void |
getConfig(request, callback)
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;
Parameters | |
---|---|
Name | Description |
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>
|
Returns | |
---|---|
Type | Description |
void |
getCustomClass(request, options)
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
]>;
Returns the requested .
Parameters | |
---|---|
Name | Description |
request |
protos.google.cloud.speech.v2.IGetCustomClassRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
Promise<[
protos.google.cloud.speech.v2.ICustomClass,
protos.google.cloud.speech.v2.IGetCustomClassRequest | undefined,
{} | undefined
]> | {Promise} - The promise which resolves to an array. The first element of the array is an object representing . Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) for more details and examples. |
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. The name of the CustomClass to retrieve. The expected format is
* `projects/{project}/locations/{location}/customClasses/{custom_class}`.
*/
// const name = 'abc123'
// Imports the Speech library
const {SpeechClient} = require('@google-cloud/speech').v2;
// Instantiates a client
const speechClient = new SpeechClient();
async function callGetCustomClass() {
// Construct request
const request = {
name,
};
// Run request
const response = await speechClient.getCustomClass(request);
console.log(response);
}
callGetCustomClass();
getCustomClass(request, options, callback)
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;
Parameters | |
---|---|
Name | Description |
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>
|
Returns | |
---|---|
Type | Description |
void |
getCustomClass(request, callback)
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;
Parameters | |
---|---|
Name | Description |
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>
|
Returns | |
---|---|
Type | Description |
void |
getLocation(request, options, callback)
getLocation(request: LocationProtos.google.cloud.location.IGetLocationRequest, options?: gax.CallOptions | Callback<LocationProtos.google.cloud.location.ILocation, LocationProtos.google.cloud.location.IGetLocationRequest | null | undefined, {} | null | undefined>, callback?: Callback<LocationProtos.google.cloud.location.ILocation, LocationProtos.google.cloud.location.IGetLocationRequest | null | undefined, {} | null | undefined>): Promise<LocationProtos.google.cloud.location.ILocation>;
Gets information about a location.
Parameters | |
---|---|
Name | Description |
request |
LocationProtos.google.cloud.location.IGetLocationRequest
The request object that will be sent. |
options |
gax.CallOptions | Callback<LocationProtos.google.cloud.location.ILocation, LocationProtos.google.cloud.location.IGetLocationRequest | null | undefined, {} | null | undefined>
Call options. See CallOptions for more details. |
callback |
Callback<LocationProtos.google.cloud.location.ILocation, LocationProtos.google.cloud.location.IGetLocationRequest | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
Promise<LocationProtos.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](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) for more details and examples. |
const [response] = await client.getLocation(request);
getOperation(request, options, callback)
getOperation(request: protos.google.longrunning.GetOperationRequest, options?: gax.CallOptions | Callback<protos.google.longrunning.Operation, protos.google.longrunning.GetOperationRequest, {} | null | undefined>, callback?: Callback<protos.google.longrunning.Operation, protos.google.longrunning.GetOperationRequest, {} | null | undefined>): Promise<[protos.google.longrunning.Operation]>;
Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service.
Parameters | |
---|---|
Name | Description |
request |
protos.google.longrunning.GetOperationRequest
The request object that will be sent. |
options |
gax.CallOptions | Callback<protos.google.longrunning.Operation, protos.google.longrunning.GetOperationRequest, {} | null | undefined>
Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details. |
callback |
Callback<protos.google.longrunning.Operation, protos.google.longrunning.GetOperationRequest, {} | null | undefined>
The function which will be called with the result of the API call. The second parameter to the callback is an object representing . {Promise} - The promise which resolves to an array. The first element of the array is an object representing . The promise has a method named "cancel" which cancels the ongoing API call. |
Returns | |
---|---|
Type | Description |
Promise<[protos.google.longrunning.Operation]> |
const client = longrunning.operationsClient();
const name = '';
const [response] = await client.getOperation({name});
// doThingsWith(response)
getPhraseSet(request, options)
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
]>;
Returns the requested .
Parameters | |
---|---|
Name | Description |
request |
protos.google.cloud.speech.v2.IGetPhraseSetRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
Promise<[
protos.google.cloud.speech.v2.IPhraseSet,
protos.google.cloud.speech.v2.IGetPhraseSetRequest | undefined,
{} | undefined
]> | {Promise} - The promise which resolves to an array. The first element of the array is an object representing . Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) for more details and examples. |
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. The name of the PhraseSet to retrieve. The expected format is
* `projects/{project}/locations/{location}/phraseSets/{phrase_set}`.
*/
// const name = 'abc123'
// Imports the Speech library
const {SpeechClient} = require('@google-cloud/speech').v2;
// Instantiates a client
const speechClient = new SpeechClient();
async function callGetPhraseSet() {
// Construct request
const request = {
name,
};
// Run request
const response = await speechClient.getPhraseSet(request);
console.log(response);
}
callGetPhraseSet();
getPhraseSet(request, options, callback)
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;
Parameters | |
---|---|
Name | Description |
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>
|
Returns | |
---|---|
Type | Description |
void |
getPhraseSet(request, callback)
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;
Parameters | |
---|---|
Name | Description |
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>
|
Returns | |
---|---|
Type | Description |
void |
getProjectId()
getProjectId(): Promise<string>;
Returns | |
---|---|
Type | Description |
Promise<string> |
getProjectId(callback)
getProjectId(callback: Callback<string, undefined, undefined>): void;
Parameter | |
---|---|
Name | Description |
callback |
Callback<string, undefined, undefined>
|
Returns | |
---|---|
Type | Description |
void |
getRecognizer(request, options)
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
]>;
Returns the requested . Fails with if the requested Recognizer doesn't exist.
Parameters | |
---|---|
Name | Description |
request |
protos.google.cloud.speech.v2.IGetRecognizerRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
Promise<[
protos.google.cloud.speech.v2.IRecognizer,
protos.google.cloud.speech.v2.IGetRecognizerRequest | undefined,
{} | undefined
]> | {Promise} - The promise which resolves to an array. The first element of the array is an object representing . Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) for more details and examples. |
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. The name of the Recognizer to retrieve. The expected format is
* `projects/{project}/locations/{location}/recognizers/{recognizer}`.
*/
// const name = 'abc123'
// Imports the Speech library
const {SpeechClient} = require('@google-cloud/speech').v2;
// Instantiates a client
const speechClient = new SpeechClient();
async function callGetRecognizer() {
// Construct request
const request = {
name,
};
// Run request
const response = await speechClient.getRecognizer(request);
console.log(response);
}
callGetRecognizer();
getRecognizer(request, options, callback)
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;
Parameters | |
---|---|
Name | Description |
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>
|
Returns | |
---|---|
Type | Description |
void |
getRecognizer(request, callback)
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;
Parameters | |
---|---|
Name | Description |
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>
|
Returns | |
---|---|
Type | Description |
void |
initialize()
initialize(): Promise<{
[name: string]: Function;
}>;
Initialize the client. Performs asynchronous operations (such as authentication) and prepares the client. This function will be called automatically when any class method is called for the first time, but if you need to initialize it before calling an actual method, feel free to call initialize() directly.
You can await on this method if you want to make sure the client is initialized.
Returns | |
---|---|
Type | Description |
Promise<{
[name: string]: Function;
}> | {Promise} A promise that resolves to an authenticated service stub. |
listCustomClasses(request, options)
listCustomClasses(request?: protos.google.cloud.speech.v2.IListCustomClassesRequest, options?: CallOptions): Promise<[
protos.google.cloud.speech.v2.ICustomClass[],
protos.google.cloud.speech.v2.IListCustomClassesRequest | null,
protos.google.cloud.speech.v2.IListCustomClassesResponse
]>;
Lists CustomClasses.
Parameters | |
---|---|
Name | Description |
request |
protos.google.cloud.speech.v2.IListCustomClassesRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
Promise<[
protos.google.cloud.speech.v2.ICustomClass[],
protos.google.cloud.speech.v2.IListCustomClassesRequest | null,
protos.google.cloud.speech.v2.IListCustomClassesResponse
]> | {Promise} - The promise which resolves to an array. The first element of the array is Array of . The client library will perform auto-pagination by default: it will call the API as many times as needed and will merge results from all the pages into this array. Note that it can affect your quota. We recommend using |
listCustomClasses(request, options, callback)
listCustomClasses(request: protos.google.cloud.speech.v2.IListCustomClassesRequest, options: CallOptions, callback: PaginationCallback<protos.google.cloud.speech.v2.IListCustomClassesRequest, protos.google.cloud.speech.v2.IListCustomClassesResponse | null | undefined, protos.google.cloud.speech.v2.ICustomClass>): void;
Parameters | |
---|---|
Name | Description |
request |
protos.google.cloud.speech.v2.IListCustomClassesRequest
|
options |
CallOptions
|
callback |
PaginationCallback<protos.google.cloud.speech.v2.IListCustomClassesRequest, protos.google.cloud.speech.v2.IListCustomClassesResponse | null | undefined, protos.google.cloud.speech.v2.ICustomClass>
|
Returns | |
---|---|
Type | Description |
void |
listCustomClasses(request, callback)
listCustomClasses(request: protos.google.cloud.speech.v2.IListCustomClassesRequest, callback: PaginationCallback<protos.google.cloud.speech.v2.IListCustomClassesRequest, protos.google.cloud.speech.v2.IListCustomClassesResponse | null | undefined, protos.google.cloud.speech.v2.ICustomClass>): void;
Parameters | |
---|---|
Name | Description |
request |
protos.google.cloud.speech.v2.IListCustomClassesRequest
|
callback |
PaginationCallback<protos.google.cloud.speech.v2.IListCustomClassesRequest, protos.google.cloud.speech.v2.IListCustomClassesResponse | null | undefined, protos.google.cloud.speech.v2.ICustomClass>
|
Returns | |
---|---|
Type | Description |
void |
listCustomClassesAsync(request, options)
listCustomClassesAsync(request?: protos.google.cloud.speech.v2.IListCustomClassesRequest, options?: CallOptions): AsyncIterable<protos.google.cloud.speech.v2.ICustomClass>;
Equivalent to listCustomClasses
, but returns an iterable object.
for
-await
-of
syntax is used with the iterable to get response elements on-demand.
Parameters | |
---|---|
Name | Description |
request |
protos.google.cloud.speech.v2.IListCustomClassesRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
AsyncIterable<protos.google.cloud.speech.v2.ICustomClass> | {Object} An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). 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](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) for more details and examples. |
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. The project and location of CustomClass resources to list. The
* expected format is `projects/{project}/locations/{location}`.
*/
// const parent = 'abc123'
/**
* Number of results per requests. A valid page_size ranges from 0 to 20
* inclusive. If the page_size is zero or unspecified, a page size of 5 will
* be chosen. If the page size exceeds 20, it will be coerced down to 20. Note
* that a call might return fewer results than the requested page size.
*/
// const pageSize = 1234
/**
* A page token, received from a previous
* ListCustomClasses google.cloud.speech.v2.Speech.ListCustomClasses call.
* Provide this to retrieve the subsequent page.
* When paginating, all other parameters provided to
* ListCustomClasses google.cloud.speech.v2.Speech.ListCustomClasses must
* match the call that provided the page token.
*/
// const pageToken = 'abc123'
/**
* Whether, or not, to show resources that have been deleted.
*/
// const showDeleted = true
// Imports the Speech library
const {SpeechClient} = require('@google-cloud/speech').v2;
// Instantiates a client
const speechClient = new SpeechClient();
async function callListCustomClasses() {
// Construct request
const request = {
parent,
};
// Run request
const iterable = await speechClient.listCustomClassesAsync(request);
for await (const response of iterable) {
console.log(response);
}
}
callListCustomClasses();
listCustomClassesStream(request, options)
listCustomClassesStream(request?: protos.google.cloud.speech.v2.IListCustomClassesRequest, options?: CallOptions): Transform;
Equivalent to method.name.toCamelCase()
, but returns a NodeJS Stream object.
Parameters | |
---|---|
Name | Description |
request |
protos.google.cloud.speech.v2.IListCustomClassesRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
Transform | {Stream} An object stream which emits an object representing on 'data' event. The client library will perform auto-pagination by default: it will call the API as many times as needed. Note that it can affect your quota. We recommend using |
listLocationsAsync(request, options)
listLocationsAsync(request: LocationProtos.google.cloud.location.IListLocationsRequest, options?: CallOptions): AsyncIterable<LocationProtos.google.cloud.location.ILocation>;
Lists information about the supported locations for this service. Returns an iterable object.
for
-await
-of
syntax is used with the iterable to get response elements on-demand.
Parameters | |
---|---|
Name | Description |
request |
LocationProtos.google.cloud.location.IListLocationsRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
AsyncIterable<LocationProtos.google.cloud.location.ILocation> | {Object} An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). 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](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) for more details and examples. |
const iterable = client.listLocationsAsync(request);
for await (const response of iterable) {
// process response
}
listOperationsAsync(request, options)
listOperationsAsync(request: protos.google.longrunning.ListOperationsRequest, options?: gax.CallOptions): AsyncIterable<protos.google.longrunning.ListOperationsResponse>;
Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns UNIMPLEMENTED
. Returns an iterable object.
For-await-of syntax is used with the iterable to recursively get response element on-demand.
Parameters | |
---|---|
Name | Description |
request |
protos.google.longrunning.ListOperationsRequest
The request object that will be sent. |
options |
gax.CallOptions
Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details. |
Returns | |
---|---|
Type | Description |
AsyncIterable<protos.google.longrunning.ListOperationsResponse> | {Object} An iterable Object that conforms to iteration protocols. |
const client = longrunning.operationsClient();
for await (const response of client.listOperationsAsync(request));
// doThingsWith(response)
listPhraseSets(request, options)
listPhraseSets(request?: protos.google.cloud.speech.v2.IListPhraseSetsRequest, options?: CallOptions): Promise<[
protos.google.cloud.speech.v2.IPhraseSet[],
protos.google.cloud.speech.v2.IListPhraseSetsRequest | null,
protos.google.cloud.speech.v2.IListPhraseSetsResponse
]>;
Lists PhraseSets.
Parameters | |
---|---|
Name | Description |
request |
protos.google.cloud.speech.v2.IListPhraseSetsRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
Promise<[
protos.google.cloud.speech.v2.IPhraseSet[],
protos.google.cloud.speech.v2.IListPhraseSetsRequest | null,
protos.google.cloud.speech.v2.IListPhraseSetsResponse
]> | {Promise} - The promise which resolves to an array. The first element of the array is Array of . The client library will perform auto-pagination by default: it will call the API as many times as needed and will merge results from all the pages into this array. Note that it can affect your quota. We recommend using |
listPhraseSets(request, options, callback)
listPhraseSets(request: protos.google.cloud.speech.v2.IListPhraseSetsRequest, options: CallOptions, callback: PaginationCallback<protos.google.cloud.speech.v2.IListPhraseSetsRequest, protos.google.cloud.speech.v2.IListPhraseSetsResponse | null | undefined, protos.google.cloud.speech.v2.IPhraseSet>): void;
Parameters | |
---|---|
Name | Description |
request |
protos.google.cloud.speech.v2.IListPhraseSetsRequest
|
options |
CallOptions
|
callback |
PaginationCallback<protos.google.cloud.speech.v2.IListPhraseSetsRequest, protos.google.cloud.speech.v2.IListPhraseSetsResponse | null | undefined, protos.google.cloud.speech.v2.IPhraseSet>
|
Returns | |
---|---|
Type | Description |
void |
listPhraseSets(request, callback)
listPhraseSets(request: protos.google.cloud.speech.v2.IListPhraseSetsRequest, callback: PaginationCallback<protos.google.cloud.speech.v2.IListPhraseSetsRequest, protos.google.cloud.speech.v2.IListPhraseSetsResponse | null | undefined, protos.google.cloud.speech.v2.IPhraseSet>): void;
Parameters | |
---|---|
Name | Description |
request |
protos.google.cloud.speech.v2.IListPhraseSetsRequest
|
callback |
PaginationCallback<protos.google.cloud.speech.v2.IListPhraseSetsRequest, protos.google.cloud.speech.v2.IListPhraseSetsResponse | null | undefined, protos.google.cloud.speech.v2.IPhraseSet>
|
Returns | |
---|---|
Type | Description |
void |
listPhraseSetsAsync(request, options)
listPhraseSetsAsync(request?: protos.google.cloud.speech.v2.IListPhraseSetsRequest, options?: CallOptions): AsyncIterable<protos.google.cloud.speech.v2.IPhraseSet>;
Equivalent to listPhraseSets
, but returns an iterable object.
for
-await
-of
syntax is used with the iterable to get response elements on-demand.
Parameters | |
---|---|
Name | Description |
request |
protos.google.cloud.speech.v2.IListPhraseSetsRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
AsyncIterable<protos.google.cloud.speech.v2.IPhraseSet> | {Object} An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). 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](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) for more details and examples. |
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. The project and location of PhraseSet resources to list. The
* expected format is `projects/{project}/locations/{location}`.
*/
// const parent = 'abc123'
/**
* The maximum number of PhraseSets to return. The service may return fewer
* than this value. If unspecified, at most 20 PhraseSets will be returned.
* The maximum value is 20; values above 20 will be coerced to 20.
*/
// const pageSize = 1234
/**
* A page token, received from a previous
* ListPhraseSets google.cloud.speech.v2.Speech.ListPhraseSets call.
* Provide this to retrieve the subsequent page.
* When paginating, all other parameters provided to
* ListPhraseSets google.cloud.speech.v2.Speech.ListPhraseSets must match
* the call that provided the page token.
*/
// const pageToken = 'abc123'
/**
* Whether, or not, to show resources that have been deleted.
*/
// const showDeleted = true
// Imports the Speech library
const {SpeechClient} = require('@google-cloud/speech').v2;
// Instantiates a client
const speechClient = new SpeechClient();
async function callListPhraseSets() {
// Construct request
const request = {
parent,
};
// Run request
const iterable = await speechClient.listPhraseSetsAsync(request);
for await (const response of iterable) {
console.log(response);
}
}
callListPhraseSets();
listPhraseSetsStream(request, options)
listPhraseSetsStream(request?: protos.google.cloud.speech.v2.IListPhraseSetsRequest, options?: CallOptions): Transform;
Equivalent to method.name.toCamelCase()
, but returns a NodeJS Stream object.
Parameters | |
---|---|
Name | Description |
request |
protos.google.cloud.speech.v2.IListPhraseSetsRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
Transform | {Stream} An object stream which emits an object representing on 'data' event. The client library will perform auto-pagination by default: it will call the API as many times as needed. Note that it can affect your quota. We recommend using |
listRecognizers(request, options)
listRecognizers(request?: protos.google.cloud.speech.v2.IListRecognizersRequest, options?: CallOptions): Promise<[
protos.google.cloud.speech.v2.IRecognizer[],
protos.google.cloud.speech.v2.IListRecognizersRequest | null,
protos.google.cloud.speech.v2.IListRecognizersResponse
]>;
Lists Recognizers.
Parameters | |
---|---|
Name | Description |
request |
protos.google.cloud.speech.v2.IListRecognizersRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
Promise<[
protos.google.cloud.speech.v2.IRecognizer[],
protos.google.cloud.speech.v2.IListRecognizersRequest | null,
protos.google.cloud.speech.v2.IListRecognizersResponse
]> | {Promise} - The promise which resolves to an array. The first element of the array is Array of . The client library will perform auto-pagination by default: it will call the API as many times as needed and will merge results from all the pages into this array. Note that it can affect your quota. We recommend using |
listRecognizers(request, options, callback)
listRecognizers(request: protos.google.cloud.speech.v2.IListRecognizersRequest, options: CallOptions, callback: PaginationCallback<protos.google.cloud.speech.v2.IListRecognizersRequest, protos.google.cloud.speech.v2.IListRecognizersResponse | null | undefined, protos.google.cloud.speech.v2.IRecognizer>): void;
Parameters | |
---|---|
Name | Description |
request |
protos.google.cloud.speech.v2.IListRecognizersRequest
|
options |
CallOptions
|
callback |
PaginationCallback<protos.google.cloud.speech.v2.IListRecognizersRequest, protos.google.cloud.speech.v2.IListRecognizersResponse | null | undefined, protos.google.cloud.speech.v2.IRecognizer>
|
Returns | |
---|---|
Type | Description |
void |
listRecognizers(request, callback)
listRecognizers(request: protos.google.cloud.speech.v2.IListRecognizersRequest, callback: PaginationCallback<protos.google.cloud.speech.v2.IListRecognizersRequest, protos.google.cloud.speech.v2.IListRecognizersResponse | null | undefined, protos.google.cloud.speech.v2.IRecognizer>): void;
Parameters | |
---|---|
Name | Description |
request |
protos.google.cloud.speech.v2.IListRecognizersRequest
|
callback |
PaginationCallback<protos.google.cloud.speech.v2.IListRecognizersRequest, protos.google.cloud.speech.v2.IListRecognizersResponse | null | undefined, protos.google.cloud.speech.v2.IRecognizer>
|
Returns | |
---|---|
Type | Description |
void |
listRecognizersAsync(request, options)
listRecognizersAsync(request?: protos.google.cloud.speech.v2.IListRecognizersRequest, options?: CallOptions): AsyncIterable<protos.google.cloud.speech.v2.IRecognizer>;
Equivalent to listRecognizers
, but returns an iterable object.
for
-await
-of
syntax is used with the iterable to get response elements on-demand.
Parameters | |
---|---|
Name | Description |
request |
protos.google.cloud.speech.v2.IListRecognizersRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
AsyncIterable<protos.google.cloud.speech.v2.IRecognizer> | {Object} An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). 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](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) for more details and examples. |
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. The project and location of Recognizers to list. The expected
* format is `projects/{project}/locations/{location}`.
*/
// const parent = 'abc123'
/**
* The maximum number of Recognizers to return. The service may return fewer
* than this value. If unspecified, at most 20 Recognizers will be returned.
* The maximum value is 20; values above 20 will be coerced to 20.
*/
// const pageSize = 1234
/**
* A page token, received from a previous
* ListRecognizers google.cloud.speech.v2.Speech.ListRecognizers call.
* Provide this to retrieve the subsequent page.
* When paginating, all other parameters provided to
* ListRecognizers google.cloud.speech.v2.Speech.ListRecognizers must match
* the call that provided the page token.
*/
// const pageToken = 'abc123'
/**
* Whether, or not, to show resources that have been deleted.
*/
// const showDeleted = true
// Imports the Speech library
const {SpeechClient} = require('@google-cloud/speech').v2;
// Instantiates a client
const speechClient = new SpeechClient();
async function callListRecognizers() {
// Construct request
const request = {
parent,
};
// Run request
const iterable = await speechClient.listRecognizersAsync(request);
for await (const response of iterable) {
console.log(response);
}
}
callListRecognizers();
listRecognizersStream(request, options)
listRecognizersStream(request?: protos.google.cloud.speech.v2.IListRecognizersRequest, options?: CallOptions): Transform;
Equivalent to method.name.toCamelCase()
, but returns a NodeJS Stream object.
Parameters | |
---|---|
Name | Description |
request |
protos.google.cloud.speech.v2.IListRecognizersRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
Transform | {Stream} An object stream which emits an object representing on 'data' event. The client library will perform auto-pagination by default: it will call the API as many times as needed. Note that it can affect your quota. We recommend using |
locationPath(project, location)
locationPath(project: string, location: string): string;
Return a fully-qualified location resource name string.
Parameters | |
---|---|
Name | Description |
project |
string
|
location |
string
|
Returns | |
---|---|
Type | Description |
string | {string} Resource name string. |
matchCryptoKeyFromCryptoKeyName(cryptoKeyName)
matchCryptoKeyFromCryptoKeyName(cryptoKeyName: string): string | number;
Parse the crypto_key from CryptoKey resource.
Parameter | |
---|---|
Name | Description |
cryptoKeyName |
string
A fully-qualified path representing CryptoKey resource. |
Returns | |
---|---|
Type | Description |
string | number | {string} A string representing the crypto_key. |
matchCryptoKeyFromCryptoKeyVersionName(cryptoKeyVersionName)
matchCryptoKeyFromCryptoKeyVersionName(cryptoKeyVersionName: string): string | number;
Parse the crypto_key from CryptoKeyVersion resource.
Parameter | |
---|---|
Name | Description |
cryptoKeyVersionName |
string
A fully-qualified path representing CryptoKeyVersion resource. |
Returns | |
---|---|
Type | Description |
string | number | {string} A string representing the crypto_key. |
matchCryptoKeyVersionFromCryptoKeyVersionName(cryptoKeyVersionName)
matchCryptoKeyVersionFromCryptoKeyVersionName(cryptoKeyVersionName: string): string | number;
Parse the crypto_key_version from CryptoKeyVersion resource.
Parameter | |
---|---|
Name | Description |
cryptoKeyVersionName |
string
A fully-qualified path representing CryptoKeyVersion resource. |
Returns | |
---|---|
Type | Description |
string | number | {string} A string representing the crypto_key_version. |
matchCustomClassFromCustomClassName(customClassName)
matchCustomClassFromCustomClassName(customClassName: string): string | number;
Parse the custom_class from CustomClass resource.
Parameter | |
---|---|
Name | Description |
customClassName |
string
A fully-qualified path representing CustomClass resource. |
Returns | |
---|---|
Type | Description |
string | number | {string} A string representing the custom_class. |
matchKeyRingFromCryptoKeyName(cryptoKeyName)
matchKeyRingFromCryptoKeyName(cryptoKeyName: string): string | number;
Parse the key_ring from CryptoKey resource.
Parameter | |
---|---|
Name | Description |
cryptoKeyName |
string
A fully-qualified path representing CryptoKey resource. |
Returns | |
---|---|
Type | Description |
string | number | {string} A string representing the key_ring. |
matchKeyRingFromCryptoKeyVersionName(cryptoKeyVersionName)
matchKeyRingFromCryptoKeyVersionName(cryptoKeyVersionName: string): string | number;
Parse the key_ring from CryptoKeyVersion resource.
Parameter | |
---|---|
Name | Description |
cryptoKeyVersionName |
string
A fully-qualified path representing CryptoKeyVersion resource. |
Returns | |
---|---|
Type | Description |
string | number | {string} A string representing the key_ring. |
matchLocationFromConfigName(configName)
matchLocationFromConfigName(configName: string): string | number;
Parse the location from Config resource.
Parameter | |
---|---|
Name | Description |
configName |
string
A fully-qualified path representing Config resource. |
Returns | |
---|---|
Type | Description |
string | number | {string} A string representing the location. |
matchLocationFromCryptoKeyName(cryptoKeyName)
matchLocationFromCryptoKeyName(cryptoKeyName: string): string | number;
Parse the location from CryptoKey resource.
Parameter | |
---|---|
Name | Description |
cryptoKeyName |
string
A fully-qualified path representing CryptoKey resource. |
Returns | |
---|---|
Type | Description |
string | number | {string} A string representing the location. |
matchLocationFromCryptoKeyVersionName(cryptoKeyVersionName)
matchLocationFromCryptoKeyVersionName(cryptoKeyVersionName: string): string | number;
Parse the location from CryptoKeyVersion resource.
Parameter | |
---|---|
Name | Description |
cryptoKeyVersionName |
string
A fully-qualified path representing CryptoKeyVersion resource. |
Returns | |
---|---|
Type | Description |
string | number | {string} A string representing the location. |
matchLocationFromCustomClassName(customClassName)
matchLocationFromCustomClassName(customClassName: string): string | number;
Parse the location from CustomClass resource.
Parameter | |
---|---|
Name | Description |
customClassName |
string
A fully-qualified path representing CustomClass resource. |
Returns | |
---|---|
Type | Description |
string | number | {string} A string representing the location. |
matchLocationFromLocationName(locationName)
matchLocationFromLocationName(locationName: string): string | number;
Parse the location from Location resource.
Parameter | |
---|---|
Name | Description |
locationName |
string
A fully-qualified path representing Location resource. |
Returns | |
---|---|
Type | Description |
string | number | {string} A string representing the location. |
matchLocationFromPhraseSetName(phraseSetName)
matchLocationFromPhraseSetName(phraseSetName: string): string | number;
Parse the location from PhraseSet resource.
Parameter | |
---|---|
Name | Description |
phraseSetName |
string
A fully-qualified path representing PhraseSet resource. |
Returns | |
---|---|
Type | Description |
string | number | {string} A string representing the location. |
matchLocationFromRecognizerName(recognizerName)
matchLocationFromRecognizerName(recognizerName: string): string | number;
Parse the location from Recognizer resource.
Parameter | |
---|---|
Name | Description |
recognizerName |
string
A fully-qualified path representing Recognizer resource. |
Returns | |
---|---|
Type | Description |
string | number | {string} A string representing the location. |
matchPhraseSetFromPhraseSetName(phraseSetName)
matchPhraseSetFromPhraseSetName(phraseSetName: string): string | number;
Parse the phrase_set from PhraseSet resource.
Parameter | |
---|---|
Name | Description |
phraseSetName |
string
A fully-qualified path representing PhraseSet resource. |
Returns | |
---|---|
Type | Description |
string | number | {string} A string representing the phrase_set. |
matchProjectFromConfigName(configName)
matchProjectFromConfigName(configName: string): string | number;
Parse the project from Config resource.
Parameter | |
---|---|
Name | Description |
configName |
string
A fully-qualified path representing Config resource. |
Returns | |
---|---|
Type | Description |
string | number | {string} A string representing the project. |
matchProjectFromCryptoKeyName(cryptoKeyName)
matchProjectFromCryptoKeyName(cryptoKeyName: string): string | number;
Parse the project from CryptoKey resource.
Parameter | |
---|---|
Name | Description |
cryptoKeyName |
string
A fully-qualified path representing CryptoKey resource. |
Returns | |
---|---|
Type | Description |
string | number | {string} A string representing the project. |
matchProjectFromCryptoKeyVersionName(cryptoKeyVersionName)
matchProjectFromCryptoKeyVersionName(cryptoKeyVersionName: string): string | number;
Parse the project from CryptoKeyVersion resource.
Parameter | |
---|---|
Name | Description |
cryptoKeyVersionName |
string
A fully-qualified path representing CryptoKeyVersion resource. |
Returns | |
---|---|
Type | Description |
string | number | {string} A string representing the project. |
matchProjectFromCustomClassName(customClassName)
matchProjectFromCustomClassName(customClassName: string): string | number;
Parse the project from CustomClass resource.
Parameter | |
---|---|
Name | Description |
customClassName |
string
A fully-qualified path representing CustomClass resource. |
Returns | |
---|---|
Type | Description |
string | number | {string} A string representing the project. |
matchProjectFromLocationName(locationName)
matchProjectFromLocationName(locationName: string): string | number;
Parse the project from Location resource.
Parameter | |
---|---|
Name | Description |
locationName |
string
A fully-qualified path representing Location resource. |
Returns | |
---|---|
Type | Description |
string | number | {string} A string representing the project. |
matchProjectFromPhraseSetName(phraseSetName)
matchProjectFromPhraseSetName(phraseSetName: string): string | number;
Parse the project from PhraseSet resource.
Parameter | |
---|---|
Name | Description |
phraseSetName |
string
A fully-qualified path representing PhraseSet resource. |
Returns | |
---|---|
Type | Description |
string | number | {string} A string representing the project. |
matchProjectFromProjectName(projectName)
matchProjectFromProjectName(projectName: string): string | number;
Parse the project from Project resource.
Parameter | |
---|---|
Name | Description |
projectName |
string
A fully-qualified path representing Project resource. |
Returns | |
---|---|
Type | Description |
string | number | {string} A string representing the project. |
matchProjectFromRecognizerName(recognizerName)
matchProjectFromRecognizerName(recognizerName: string): string | number;
Parse the project from Recognizer resource.
Parameter | |
---|---|
Name | Description |
recognizerName |
string
A fully-qualified path representing Recognizer resource. |
Returns | |
---|---|
Type | Description |
string | number | {string} A string representing the project. |
matchRecognizerFromRecognizerName(recognizerName)
matchRecognizerFromRecognizerName(recognizerName: string): string | number;
Parse the recognizer from Recognizer resource.
Parameter | |
---|---|
Name | Description |
recognizerName |
string
A fully-qualified path representing Recognizer resource. |
Returns | |
---|---|
Type | Description |
string | number | {string} A string representing the recognizer. |
phraseSetPath(project, location, phraseSet)
phraseSetPath(project: string, location: string, phraseSet: string): string;
Return a fully-qualified phraseSet resource name string.
Parameters | |
---|---|
Name | Description |
project |
string
|
location |
string
|
phraseSet |
string
|
Returns | |
---|---|
Type | Description |
string | {string} Resource name string. |
projectPath(project)
projectPath(project: string): string;
Return a fully-qualified project resource name string.
Parameter | |
---|---|
Name | Description |
project |
string
|
Returns | |
---|---|
Type | Description |
string | {string} Resource name string. |
recognize(request, options)
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
]>;
Performs synchronous Speech recognition: receive results after all audio has been sent and processed.
Parameters | |
---|---|
Name | Description |
request |
protos.google.cloud.speech.v2.IRecognizeRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
Promise<[
protos.google.cloud.speech.v2.IRecognizeResponse,
protos.google.cloud.speech.v2.IRecognizeRequest | undefined,
{} | undefined
]> | {Promise} - The promise which resolves to an array. The first element of the array is an object representing . Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) for more details and examples. |
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. The name of the Recognizer to use during recognition. The
* expected format is
* `projects/{project}/locations/{location}/recognizers/{recognizer}`.
*/
// const recognizer = 'abc123'
/**
* Features and audio metadata to use for the Automatic Speech Recognition.
* This field in combination with the
* config_mask google.cloud.speech.v2.RecognizeRequest.config_mask field
* can be used to override parts of the
* default_recognition_config google.cloud.speech.v2.Recognizer.default_recognition_config
* of the Recognizer resource.
*/
// const config = {}
/**
* The list of fields in
* config google.cloud.speech.v2.RecognizeRequest.config that override the
* values in the
* default_recognition_config google.cloud.speech.v2.Recognizer.default_recognition_config
* of the recognizer during this recognition request. If no mask is provided,
* all non-default valued fields in
* config google.cloud.speech.v2.RecognizeRequest.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,
* config google.cloud.speech.v2.RecognizeRequest.config completely
* overrides and replaces the config in the recognizer for this recognition
* request.
*/
// const configMask = {}
/**
* The audio data bytes encoded as specified in
* RecognitionConfig google.cloud.speech.v2.RecognitionConfig. As
* with all bytes fields, proto buffers use a pure binary representation,
* whereas JSON representations use base64.
*/
// const content = 'Buffer.from('string')'
/**
* URI that points to a file that contains audio data bytes as specified in
* RecognitionConfig google.cloud.speech.v2.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
* INVALID_ARGUMENT google.rpc.Code.INVALID_ARGUMENT). For more
* information, see Request
* URIs (https://cloud.google.com/storage/docs/reference-uris).
*/
// const uri = 'abc123'
// Imports the Speech library
const {SpeechClient} = require('@google-cloud/speech').v2;
// Instantiates a client
const speechClient = new SpeechClient();
async function callRecognize() {
// Construct request
const request = {
recognizer,
};
// Run request
const response = await speechClient.recognize(request);
console.log(response);
}
callRecognize();
recognize(request, options, callback)
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;
Parameters | |
---|---|
Name | Description |
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>
|
Returns | |
---|---|
Type | Description |
void |
recognize(request, callback)
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;
Parameters | |
---|---|
Name | Description |
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>
|
Returns | |
---|---|
Type | Description |
void |
recognizerPath(project, location, recognizer)
recognizerPath(project: string, location: string, recognizer: string): string;
Return a fully-qualified recognizer resource name string.
Parameters | |
---|---|
Name | Description |
project |
string
|
location |
string
|
recognizer |
string
|
Returns | |
---|---|
Type | Description |
string | {string} Resource name string. |
undeleteCustomClass(request, options)
undeleteCustomClass(request?: protos.google.cloud.speech.v2.IUndeleteCustomClassRequest, options?: CallOptions): Promise<[
LROperation<protos.google.cloud.speech.v2.ICustomClass, protos.google.cloud.speech.v2.IOperationMetadata>,
protos.google.longrunning.IOperation | undefined,
{} | undefined
]>;
Undeletes the .
Parameters | |
---|---|
Name | Description |
request |
protos.google.cloud.speech.v2.IUndeleteCustomClassRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
Promise<[
LROperation<protos.google.cloud.speech.v2.ICustomClass, protos.google.cloud.speech.v2.IOperationMetadata>,
protos.google.longrunning.IOperation | undefined,
{} | undefined
]> | {Promise} - The promise which resolves to an array. The first element of the array is an object representing a long running operation. Its |
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. The name of the CustomClass to undelete.
* Format:
* `projects/{project}/locations/{location}/customClasses/{custom_class}`
*/
// const name = 'abc123'
/**
* If set, validate the request and preview the undeleted CustomClass, but do
* not actually undelete it.
*/
// const validateOnly = true
/**
* 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.
*/
// const etag = 'abc123'
// Imports the Speech library
const {SpeechClient} = require('@google-cloud/speech').v2;
// Instantiates a client
const speechClient = new SpeechClient();
async function callUndeleteCustomClass() {
// Construct request
const request = {
name,
};
// Run request
const [operation] = await speechClient.undeleteCustomClass(request);
const [response] = await operation.promise();
console.log(response);
}
callUndeleteCustomClass();
undeleteCustomClass(request, options, callback)
undeleteCustomClass(request: protos.google.cloud.speech.v2.IUndeleteCustomClassRequest, 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;
Parameters | |
---|---|
Name | Description |
request |
protos.google.cloud.speech.v2.IUndeleteCustomClassRequest
|
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>
|
Returns | |
---|---|
Type | Description |
void |
undeleteCustomClass(request, callback)
undeleteCustomClass(request: protos.google.cloud.speech.v2.IUndeleteCustomClassRequest, callback: Callback<LROperation<protos.google.cloud.speech.v2.ICustomClass, protos.google.cloud.speech.v2.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
protos.google.cloud.speech.v2.IUndeleteCustomClassRequest
|
callback |
Callback<LROperation<protos.google.cloud.speech.v2.ICustomClass, protos.google.cloud.speech.v2.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
undeletePhraseSet(request, options)
undeletePhraseSet(request?: protos.google.cloud.speech.v2.IUndeletePhraseSetRequest, options?: CallOptions): Promise<[
LROperation<protos.google.cloud.speech.v2.IPhraseSet, protos.google.cloud.speech.v2.IOperationMetadata>,
protos.google.longrunning.IOperation | undefined,
{} | undefined
]>;
Undeletes the .
Parameters | |
---|---|
Name | Description |
request |
protos.google.cloud.speech.v2.IUndeletePhraseSetRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
Promise<[
LROperation<protos.google.cloud.speech.v2.IPhraseSet, protos.google.cloud.speech.v2.IOperationMetadata>,
protos.google.longrunning.IOperation | undefined,
{} | undefined
]> | {Promise} - The promise which resolves to an array. The first element of the array is an object representing a long running operation. Its |
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. The name of the PhraseSet to undelete.
* Format: `projects/{project}/locations/{location}/phraseSets/{phrase_set}`
*/
// const name = 'abc123'
/**
* If set, validate the request and preview the undeleted PhraseSet, but do
* not actually undelete it.
*/
// const validateOnly = true
/**
* 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.
*/
// const etag = 'abc123'
// Imports the Speech library
const {SpeechClient} = require('@google-cloud/speech').v2;
// Instantiates a client
const speechClient = new SpeechClient();
async function callUndeletePhraseSet() {
// Construct request
const request = {
name,
};
// Run request
const [operation] = await speechClient.undeletePhraseSet(request);
const [response] = await operation.promise();
console.log(response);
}
callUndeletePhraseSet();
undeletePhraseSet(request, options, callback)
undeletePhraseSet(request: protos.google.cloud.speech.v2.IUndeletePhraseSetRequest, options: CallOptions, callback: Callback<LROperation<protos.google.cloud.speech.v2.IPhraseSet, protos.google.cloud.speech.v2.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
protos.google.cloud.speech.v2.IUndeletePhraseSetRequest
|
options |
CallOptions
|
callback |
Callback<LROperation<protos.google.cloud.speech.v2.IPhraseSet, protos.google.cloud.speech.v2.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
undeletePhraseSet(request, callback)
undeletePhraseSet(request: protos.google.cloud.speech.v2.IUndeletePhraseSetRequest, callback: Callback<LROperation<protos.google.cloud.speech.v2.IPhraseSet, protos.google.cloud.speech.v2.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
protos.google.cloud.speech.v2.IUndeletePhraseSetRequest
|
callback |
Callback<LROperation<protos.google.cloud.speech.v2.IPhraseSet, protos.google.cloud.speech.v2.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
undeleteRecognizer(request, options)
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
]>;
Undeletes the .
Parameters | |
---|---|
Name | Description |
request |
protos.google.cloud.speech.v2.IUndeleteRecognizerRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
Promise<[
LROperation<protos.google.cloud.speech.v2.IRecognizer, protos.google.cloud.speech.v2.IOperationMetadata>,
protos.google.longrunning.IOperation | undefined,
{} | undefined
]> | {Promise} - The promise which resolves to an array. The first element of the array is an object representing a long running operation. Its |
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. The name of the Recognizer to undelete.
* Format: `projects/{project}/locations/{location}/recognizers/{recognizer}`
*/
// const name = 'abc123'
/**
* If set, validate the request and preview the undeleted Recognizer, but do
* not actually undelete it.
*/
// const validateOnly = true
/**
* 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.
*/
// const etag = 'abc123'
// Imports the Speech library
const {SpeechClient} = require('@google-cloud/speech').v2;
// Instantiates a client
const speechClient = new SpeechClient();
async function callUndeleteRecognizer() {
// Construct request
const request = {
name,
};
// Run request
const [operation] = await speechClient.undeleteRecognizer(request);
const [response] = await operation.promise();
console.log(response);
}
callUndeleteRecognizer();
undeleteRecognizer(request, options, callback)
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;
Parameters | |
---|---|
Name | Description |
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>
|
Returns | |
---|---|
Type | Description |
void |
undeleteRecognizer(request, callback)
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;
Parameters | |
---|---|
Name | Description |
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>
|
Returns | |
---|---|
Type | Description |
void |
updateConfig(request, options)
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
]>;
Updates the .
Parameters | |
---|---|
Name | Description |
request |
protos.google.cloud.speech.v2.IUpdateConfigRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
Promise<[
protos.google.cloud.speech.v2.IConfig,
protos.google.cloud.speech.v2.IUpdateConfigRequest | undefined,
{} | undefined
]> | {Promise} - The promise which resolves to an array. The first element of the array is an object representing . Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) for more details and examples. |
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. The 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`.
*/
// const config = {}
/**
* The list of fields to be updated.
*/
// const updateMask = {}
// Imports the Speech library
const {SpeechClient} = require('@google-cloud/speech').v2;
// Instantiates a client
const speechClient = new SpeechClient();
async function callUpdateConfig() {
// Construct request
const request = {
config,
};
// Run request
const response = await speechClient.updateConfig(request);
console.log(response);
}
callUpdateConfig();
updateConfig(request, options, callback)
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;
Parameters | |
---|---|
Name | Description |
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>
|
Returns | |
---|---|
Type | Description |
void |
updateConfig(request, callback)
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;
Parameters | |
---|---|
Name | Description |
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>
|
Returns | |
---|---|
Type | Description |
void |
updateCustomClass(request, options)
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
]>;
Updates the .
Parameters | |
---|---|
Name | Description |
request |
protos.google.cloud.speech.v2.IUpdateCustomClassRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
Promise<[
LROperation<protos.google.cloud.speech.v2.ICustomClass, protos.google.cloud.speech.v2.IOperationMetadata>,
protos.google.longrunning.IOperation | undefined,
{} | undefined
]> | {Promise} - The promise which resolves to an array. The first element of the array is an object representing a long running operation. Its |
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. The CustomClass to update.
* The CustomClass's `name` field is used to identify the CustomClass to
* update. Format:
* `projects/{project}/locations/{location}/customClasses/{custom_class}`.
*/
// const customClass = {}
/**
* The list of fields to be updated. If empty, all fields are considered for
* update.
*/
// const updateMask = {}
/**
* If set, validate the request and preview the updated CustomClass, but do
* not actually update it.
*/
// const validateOnly = true
// Imports the Speech library
const {SpeechClient} = require('@google-cloud/speech').v2;
// Instantiates a client
const speechClient = new SpeechClient();
async function callUpdateCustomClass() {
// Construct request
const request = {
customClass,
};
// Run request
const [operation] = await speechClient.updateCustomClass(request);
const [response] = await operation.promise();
console.log(response);
}
callUpdateCustomClass();
updateCustomClass(request, options, callback)
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;
Parameters | |
---|---|
Name | Description |
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>
|
Returns | |
---|---|
Type | Description |
void |
updateCustomClass(request, callback)
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;
Parameters | |
---|---|
Name | Description |
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>
|
Returns | |
---|---|
Type | Description |
void |
updatePhraseSet(request, options)
updatePhraseSet(request?: protos.google.cloud.speech.v2.IUpdatePhraseSetRequest, options?: CallOptions): Promise<[
LROperation<protos.google.cloud.speech.v2.IPhraseSet, protos.google.cloud.speech.v2.IOperationMetadata>,
protos.google.longrunning.IOperation | undefined,
{} | undefined
]>;
Updates the .
Parameters | |
---|---|
Name | Description |
request |
protos.google.cloud.speech.v2.IUpdatePhraseSetRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
Promise<[
LROperation<protos.google.cloud.speech.v2.IPhraseSet, protos.google.cloud.speech.v2.IOperationMetadata>,
protos.google.longrunning.IOperation | undefined,
{} | undefined
]> | {Promise} - The promise which resolves to an array. The first element of the array is an object representing a long running operation. Its |
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. The PhraseSet to update.
* The PhraseSet's `name` field is used to identify the PhraseSet to update.
* Format: `projects/{project}/locations/{location}/phraseSets/{phrase_set}`.
*/
// const phraseSet = {}
/**
* The list of fields to update. If empty, all non-default valued fields are
* considered for update. Use `*` to update the entire PhraseSet resource.
*/
// const updateMask = {}
/**
* If set, validate the request and preview the updated PhraseSet, but do not
* actually update it.
*/
// const validateOnly = true
// Imports the Speech library
const {SpeechClient} = require('@google-cloud/speech').v2;
// Instantiates a client
const speechClient = new SpeechClient();
async function callUpdatePhraseSet() {
// Construct request
const request = {
phraseSet,
};
// Run request
const [operation] = await speechClient.updatePhraseSet(request);
const [response] = await operation.promise();
console.log(response);
}
callUpdatePhraseSet();
updatePhraseSet(request, options, callback)
updatePhraseSet(request: protos.google.cloud.speech.v2.IUpdatePhraseSetRequest, options: CallOptions, callback: Callback<LROperation<protos.google.cloud.speech.v2.IPhraseSet, protos.google.cloud.speech.v2.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
protos.google.cloud.speech.v2.IUpdatePhraseSetRequest
|
options |
CallOptions
|
callback |
Callback<LROperation<protos.google.cloud.speech.v2.IPhraseSet, protos.google.cloud.speech.v2.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
updatePhraseSet(request, callback)
updatePhraseSet(request: protos.google.cloud.speech.v2.IUpdatePhraseSetRequest, callback: Callback<LROperation<protos.google.cloud.speech.v2.IPhraseSet, protos.google.cloud.speech.v2.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
protos.google.cloud.speech.v2.IUpdatePhraseSetRequest
|
callback |
Callback<LROperation<protos.google.cloud.speech.v2.IPhraseSet, protos.google.cloud.speech.v2.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
updateRecognizer(request, options)
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
]>;
Updates the .
Parameters | |
---|---|
Name | Description |
request |
protos.google.cloud.speech.v2.IUpdateRecognizerRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
Promise<[
LROperation<protos.google.cloud.speech.v2.IRecognizer, protos.google.cloud.speech.v2.IOperationMetadata>,
protos.google.longrunning.IOperation | undefined,
{} | undefined
]> | {Promise} - The promise which resolves to an array. The first element of the array is an object representing a long running operation. Its |
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. The Recognizer to update.
* The Recognizer's `name` field is used to identify the Recognizer to update.
* Format: `projects/{project}/locations/{location}/recognizers/{recognizer}`.
*/
// const recognizer = {}
/**
* The list of fields to update. If empty, all non-default valued fields are
* considered for update. Use `*` to update the entire Recognizer resource.
*/
// const updateMask = {}
/**
* If set, validate the request and preview the updated Recognizer, but do not
* actually update it.
*/
// const validateOnly = true
// Imports the Speech library
const {SpeechClient} = require('@google-cloud/speech').v2;
// Instantiates a client
const speechClient = new SpeechClient();
async function callUpdateRecognizer() {
// Construct request
const request = {
recognizer,
};
// Run request
const [operation] = await speechClient.updateRecognizer(request);
const [response] = await operation.promise();
console.log(response);
}
callUpdateRecognizer();
updateRecognizer(request, options, callback)
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;
Parameters | |
---|---|
Name | Description |
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>
|
Returns | |
---|---|
Type | Description |
void |
updateRecognizer(request, callback)
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;
Parameters | |
---|---|
Name | Description |
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>
|
Returns | |
---|---|
Type | Description |
void |