@ondewo/s2t-client-angular
Version:
ONDEWO Speech 2 Text (S2T) Client library for Angular
1,217 lines (1,214 loc) • 411 kB
JavaScript
import * as i0 from '@angular/core';
import { InjectionToken, Optional, Inject, Injectable } from '@angular/core';
import { uint8ArrayToBase64, GrpcMetadata, GrpcCallType } from '@ngx-grpc/common';
import * as i1 from '@ngx-grpc/core';
import { throwStatusErrors, takeMessages, GRPC_CLIENT_FACTORY } from '@ngx-grpc/core';
import { BinaryReader, BinaryWriter } from 'google-protobuf';
import * as googleProtobuf000 from '@ngx-grpc/well-known-types';
/* tslint:disable */
/* eslint-disable */
// @ts-nocheck
//
// THIS IS A GENERATED FILE
// DO NOT MODIFY IT! YOUR CHANGES WILL BE LOST
/**
* Specific GrpcClientSettings for Speech2Text.
* Use it only if your default settings are not set or the service requires other settings.
*/
const GRPC_SPEECH2_TEXT_CLIENT_SETTINGS = new InjectionToken('GRPC_SPEECH2_TEXT_CLIENT_SETTINGS');
/* tslint:disable */
/* eslint-disable */
// @ts-nocheck
//
// THIS IS A GENERATED FILE
// DO NOT MODIFY IT! YOUR CHANGES WILL BE LOST
var Decoding;
(function (Decoding) {
Decoding[Decoding["DEFAULT"] = 0] = "DEFAULT";
Decoding[Decoding["GREEDY"] = 1] = "GREEDY";
Decoding[Decoding["BEAM_SEARCH_WITH_LM"] = 2] = "BEAM_SEARCH_WITH_LM";
Decoding[Decoding["BEAM_SEARCH"] = 3] = "BEAM_SEARCH";
})(Decoding || (Decoding = {}));
var InferenceBackend;
(function (InferenceBackend) {
InferenceBackend[InferenceBackend["INFERENCE_BACKEND_UNKNOWN"] = 0] = "INFERENCE_BACKEND_UNKNOWN";
InferenceBackend[InferenceBackend["INFERENCE_BACKEND_PYTORCH"] = 1] = "INFERENCE_BACKEND_PYTORCH";
InferenceBackend[InferenceBackend["INFERENCE_BACKEND_FLAX"] = 2] = "INFERENCE_BACKEND_FLAX";
InferenceBackend[InferenceBackend["INFERENCE_BACKEND_CLOUD_SERVICE_AMAZON"] = 3] = "INFERENCE_BACKEND_CLOUD_SERVICE_AMAZON";
InferenceBackend[InferenceBackend["INFERENCE_BACKEND_CLOUD_SERVICE_DEEPGRAM"] = 4] = "INFERENCE_BACKEND_CLOUD_SERVICE_DEEPGRAM";
InferenceBackend[InferenceBackend["INFERENCE_BACKEND_CLOUD_SERVICE_GOOGLE"] = 5] = "INFERENCE_BACKEND_CLOUD_SERVICE_GOOGLE";
InferenceBackend[InferenceBackend["INFERENCE_BACKEND_CLOUD_SERVICE_MICROSOFT"] = 6] = "INFERENCE_BACKEND_CLOUD_SERVICE_MICROSOFT";
})(InferenceBackend || (InferenceBackend = {}));
/**
* Message implementation for ondewo.s2t.TranscribeRequestConfig
*/
class TranscribeRequestConfig {
static { this.id = 'ondewo.s2t.TranscribeRequestConfig'; }
/**
* Deserialize binary data to message
* @param instance message instance
*/
static deserializeBinary(bytes) {
const instance = new TranscribeRequestConfig();
TranscribeRequestConfig.deserializeBinaryFromReader(instance, new BinaryReader(bytes));
return instance;
}
/**
* Check all the properties and set default protobuf values if necessary
* @param _instance message instance
*/
static refineValues(_instance) {
_instance.s2tPipelineId = _instance.s2tPipelineId || '';
_instance.decoding = _instance.decoding || 0;
_instance.language = _instance.language || '';
_instance.task = _instance.task || '';
_instance.s2tServiceConfig = _instance.s2tServiceConfig || undefined;
_instance.s2tCloudProviderConfig =
_instance.s2tCloudProviderConfig || undefined;
}
/**
* Deserializes / reads binary message into message instance using provided binary reader
* @param _instance message instance
* @param _reader binary reader instance
*/
static deserializeBinaryFromReader(_instance, _reader) {
while (_reader.nextField()) {
if (_reader.isEndGroup())
break;
switch (_reader.getFieldNumber()) {
case 1:
_instance.s2tPipelineId = _reader.readString();
break;
case 2:
_instance.decoding = _reader.readEnum();
break;
case 3:
_instance.languageModelName = _reader.readString();
break;
case 4:
_instance.postProcessing = new PostProcessingOptions();
_reader.readMessage(_instance.postProcessing, PostProcessingOptions.deserializeBinaryFromReader);
break;
case 5:
_instance.utteranceDetection = new UtteranceDetectionOptions();
_reader.readMessage(_instance.utteranceDetection, UtteranceDetectionOptions.deserializeBinaryFromReader);
break;
case 6:
_instance.pyannote = new Pyannote();
_reader.readMessage(_instance.pyannote, Pyannote.deserializeBinaryFromReader);
break;
case 8:
_instance.returnOptions = new TranscriptionReturnOptions();
_reader.readMessage(_instance.returnOptions, TranscriptionReturnOptions.deserializeBinaryFromReader);
break;
case 9:
_instance.language = _reader.readString();
break;
case 10:
_instance.task = _reader.readString();
break;
case 11:
_instance.s2tServiceConfig = new googleProtobuf000.Struct();
_reader.readMessage(_instance.s2tServiceConfig, googleProtobuf000.Struct.deserializeBinaryFromReader);
break;
case 12:
_instance.s2tCloudProviderConfig = new S2tCloudProviderConfig();
_reader.readMessage(_instance.s2tCloudProviderConfig, S2tCloudProviderConfig.deserializeBinaryFromReader);
break;
default:
_reader.skipField();
}
}
TranscribeRequestConfig.refineValues(_instance);
}
/**
* Serializes a message to binary format using provided binary reader
* @param _instance message instance
* @param _writer binary writer instance
*/
static serializeBinaryToWriter(_instance, _writer) {
if (_instance.s2tPipelineId) {
_writer.writeString(1, _instance.s2tPipelineId);
}
if (_instance.decoding) {
_writer.writeEnum(2, _instance.decoding);
}
if (_instance.languageModelName || _instance.languageModelName === '') {
_writer.writeString(3, _instance.languageModelName);
}
if (_instance.postProcessing) {
_writer.writeMessage(4, _instance.postProcessing, PostProcessingOptions.serializeBinaryToWriter);
}
if (_instance.utteranceDetection) {
_writer.writeMessage(5, _instance.utteranceDetection, UtteranceDetectionOptions.serializeBinaryToWriter);
}
if (_instance.pyannote) {
_writer.writeMessage(6, _instance.pyannote, Pyannote.serializeBinaryToWriter);
}
if (_instance.returnOptions) {
_writer.writeMessage(8, _instance.returnOptions, TranscriptionReturnOptions.serializeBinaryToWriter);
}
if (_instance.language) {
_writer.writeString(9, _instance.language);
}
if (_instance.task) {
_writer.writeString(10, _instance.task);
}
if (_instance.s2tServiceConfig) {
_writer.writeMessage(11, _instance.s2tServiceConfig, googleProtobuf000.Struct.serializeBinaryToWriter);
}
if (_instance.s2tCloudProviderConfig) {
_writer.writeMessage(12, _instance.s2tCloudProviderConfig, S2tCloudProviderConfig.serializeBinaryToWriter);
}
}
/**
* Message constructor. Initializes the properties and applies default Protobuf values if necessary
* @param _value initial values object or instance of TranscribeRequestConfig to deeply clone from
*/
constructor(_value) {
this._oneofLanguageModelName = TranscribeRequestConfig.OneofLanguageModelNameCase.none;
this._oneofPostProcessing = TranscribeRequestConfig.OneofPostProcessingCase.none;
this._oneofUtteranceDetection = TranscribeRequestConfig.OneofUtteranceDetectionCase.none;
this._voiceActivityDetection = TranscribeRequestConfig.VoiceActivityDetectionCase.none;
this._oneofReturnOptions = TranscribeRequestConfig.OneofReturnOptionsCase.none;
_value = _value || {};
this.s2tPipelineId = _value.s2tPipelineId;
this.decoding = _value.decoding;
this.languageModelName = _value.languageModelName;
this.postProcessing = _value.postProcessing
? new PostProcessingOptions(_value.postProcessing)
: undefined;
this.utteranceDetection = _value.utteranceDetection
? new UtteranceDetectionOptions(_value.utteranceDetection)
: undefined;
this.pyannote = _value.pyannote ? new Pyannote(_value.pyannote) : undefined;
this.returnOptions = _value.returnOptions
? new TranscriptionReturnOptions(_value.returnOptions)
: undefined;
this.language = _value.language;
this.task = _value.task;
this.s2tServiceConfig = _value.s2tServiceConfig
? new googleProtobuf000.Struct(_value.s2tServiceConfig)
: undefined;
this.s2tCloudProviderConfig = _value.s2tCloudProviderConfig
? new S2tCloudProviderConfig(_value.s2tCloudProviderConfig)
: undefined;
TranscribeRequestConfig.refineValues(this);
}
get s2tPipelineId() {
return this._s2tPipelineId;
}
set s2tPipelineId(value) {
this._s2tPipelineId = value;
}
get decoding() {
return this._decoding;
}
set decoding(value) {
this._decoding = value;
}
get languageModelName() {
return this._languageModelName;
}
set languageModelName(value) {
if (value !== undefined && value !== null) {
this._oneofLanguageModelName =
TranscribeRequestConfig.OneofLanguageModelNameCase.languageModelName;
}
this._languageModelName = value;
}
get postProcessing() {
return this._postProcessing;
}
set postProcessing(value) {
if (value !== undefined && value !== null) {
this._oneofPostProcessing =
TranscribeRequestConfig.OneofPostProcessingCase.postProcessing;
}
this._postProcessing = value;
}
get utteranceDetection() {
return this._utteranceDetection;
}
set utteranceDetection(value) {
if (value !== undefined && value !== null) {
this._oneofUtteranceDetection =
TranscribeRequestConfig.OneofUtteranceDetectionCase.utteranceDetection;
}
this._utteranceDetection = value;
}
get pyannote() {
return this._pyannote;
}
set pyannote(value) {
if (value !== undefined && value !== null) {
this._voiceActivityDetection =
TranscribeRequestConfig.VoiceActivityDetectionCase.pyannote;
}
this._pyannote = value;
}
get returnOptions() {
return this._returnOptions;
}
set returnOptions(value) {
if (value !== undefined && value !== null) {
this._oneofReturnOptions =
TranscribeRequestConfig.OneofReturnOptionsCase.returnOptions;
}
this._returnOptions = value;
}
get language() {
return this._language;
}
set language(value) {
this._language = value;
}
get task() {
return this._task;
}
set task(value) {
this._task = value;
}
get s2tServiceConfig() {
return this._s2tServiceConfig;
}
set s2tServiceConfig(value) {
this._s2tServiceConfig = value;
}
get s2tCloudProviderConfig() {
return this._s2tCloudProviderConfig;
}
set s2tCloudProviderConfig(value) {
this._s2tCloudProviderConfig = value;
}
get oneofLanguageModelName() {
return this._oneofLanguageModelName;
}
get oneofPostProcessing() {
return this._oneofPostProcessing;
}
get oneofUtteranceDetection() {
return this._oneofUtteranceDetection;
}
get voiceActivityDetection() {
return this._voiceActivityDetection;
}
get oneofReturnOptions() {
return this._oneofReturnOptions;
}
/**
* Serialize message to binary data
* @param instance message instance
*/
serializeBinary() {
const writer = new BinaryWriter();
TranscribeRequestConfig.serializeBinaryToWriter(this, writer);
return writer.getResultBuffer();
}
/**
* Cast message to standard JavaScript object (all non-primitive values are deeply cloned)
*/
toObject() {
return {
s2tPipelineId: this.s2tPipelineId,
decoding: this.decoding,
languageModelName: this.languageModelName,
postProcessing: this.postProcessing
? this.postProcessing.toObject()
: undefined,
utteranceDetection: this.utteranceDetection
? this.utteranceDetection.toObject()
: undefined,
pyannote: this.pyannote ? this.pyannote.toObject() : undefined,
returnOptions: this.returnOptions
? this.returnOptions.toObject()
: undefined,
language: this.language,
task: this.task,
s2tServiceConfig: this.s2tServiceConfig
? this.s2tServiceConfig.toObject()
: undefined,
s2tCloudProviderConfig: this.s2tCloudProviderConfig
? this.s2tCloudProviderConfig.toObject()
: undefined
};
}
/**
* Convenience method to support JSON.stringify(message), replicates the structure of toObject()
*/
toJSON() {
return this.toObject();
}
/**
* Cast message to JSON using protobuf JSON notation: https://developers.google.com/protocol-buffers/docs/proto3#json
* Attention: output differs from toObject() e.g. enums are represented as names and not as numbers, Timestamp is an ISO Date string format etc.
* If the message itself or some of descendant messages is google.protobuf.Any, you MUST provide a message pool as options. If not, the messagePool is not required
*/
toProtobufJSON(
// @ts-ignore
options) {
return {
s2tPipelineId: this.s2tPipelineId,
decoding: Decoding[this.decoding === null || this.decoding === undefined
? 0
: this.decoding],
languageModelName: this.languageModelName === null || this.languageModelName === undefined
? null
: this.languageModelName,
postProcessing: this.postProcessing
? this.postProcessing.toProtobufJSON(options)
: null,
utteranceDetection: this.utteranceDetection
? this.utteranceDetection.toProtobufJSON(options)
: null,
pyannote: this.pyannote ? this.pyannote.toProtobufJSON(options) : null,
returnOptions: this.returnOptions
? this.returnOptions.toProtobufJSON(options)
: null,
language: this.language,
task: this.task,
s2tServiceConfig: this.s2tServiceConfig
? this.s2tServiceConfig.toProtobufJSON(options)
: null,
s2tCloudProviderConfig: this.s2tCloudProviderConfig
? this.s2tCloudProviderConfig.toProtobufJSON(options)
: null
};
}
}
(function (TranscribeRequestConfig) {
let OneofLanguageModelNameCase;
(function (OneofLanguageModelNameCase) {
OneofLanguageModelNameCase[OneofLanguageModelNameCase["none"] = 0] = "none";
OneofLanguageModelNameCase[OneofLanguageModelNameCase["languageModelName"] = 1] = "languageModelName";
})(OneofLanguageModelNameCase = TranscribeRequestConfig.OneofLanguageModelNameCase || (TranscribeRequestConfig.OneofLanguageModelNameCase = {}));
let OneofPostProcessingCase;
(function (OneofPostProcessingCase) {
OneofPostProcessingCase[OneofPostProcessingCase["none"] = 0] = "none";
OneofPostProcessingCase[OneofPostProcessingCase["postProcessing"] = 1] = "postProcessing";
})(OneofPostProcessingCase = TranscribeRequestConfig.OneofPostProcessingCase || (TranscribeRequestConfig.OneofPostProcessingCase = {}));
let OneofUtteranceDetectionCase;
(function (OneofUtteranceDetectionCase) {
OneofUtteranceDetectionCase[OneofUtteranceDetectionCase["none"] = 0] = "none";
OneofUtteranceDetectionCase[OneofUtteranceDetectionCase["utteranceDetection"] = 1] = "utteranceDetection";
})(OneofUtteranceDetectionCase = TranscribeRequestConfig.OneofUtteranceDetectionCase || (TranscribeRequestConfig.OneofUtteranceDetectionCase = {}));
let VoiceActivityDetectionCase;
(function (VoiceActivityDetectionCase) {
VoiceActivityDetectionCase[VoiceActivityDetectionCase["none"] = 0] = "none";
VoiceActivityDetectionCase[VoiceActivityDetectionCase["pyannote"] = 1] = "pyannote";
})(VoiceActivityDetectionCase = TranscribeRequestConfig.VoiceActivityDetectionCase || (TranscribeRequestConfig.VoiceActivityDetectionCase = {}));
let OneofReturnOptionsCase;
(function (OneofReturnOptionsCase) {
OneofReturnOptionsCase[OneofReturnOptionsCase["none"] = 0] = "none";
OneofReturnOptionsCase[OneofReturnOptionsCase["returnOptions"] = 1] = "returnOptions";
})(OneofReturnOptionsCase = TranscribeRequestConfig.OneofReturnOptionsCase || (TranscribeRequestConfig.OneofReturnOptionsCase = {}));
})(TranscribeRequestConfig || (TranscribeRequestConfig = {}));
/**
* Message implementation for ondewo.s2t.S2tCloudProviderConfig
*/
class S2tCloudProviderConfig {
static { this.id = 'ondewo.s2t.S2tCloudProviderConfig'; }
/**
* Deserialize binary data to message
* @param instance message instance
*/
static deserializeBinary(bytes) {
const instance = new S2tCloudProviderConfig();
S2tCloudProviderConfig.deserializeBinaryFromReader(instance, new BinaryReader(bytes));
return instance;
}
/**
* Check all the properties and set default protobuf values if necessary
* @param _instance message instance
*/
static refineValues(_instance) {
_instance.s2tCloudProviderConfigAmazon =
_instance.s2tCloudProviderConfigAmazon || undefined;
_instance.s2tCloudProviderConfigDeepgram =
_instance.s2tCloudProviderConfigDeepgram || undefined;
_instance.s2tCloudProviderConfigGoogle =
_instance.s2tCloudProviderConfigGoogle || undefined;
_instance.s2tCloudProviderConfigMicrosoft =
_instance.s2tCloudProviderConfigMicrosoft || undefined;
}
/**
* Deserializes / reads binary message into message instance using provided binary reader
* @param _instance message instance
* @param _reader binary reader instance
*/
static deserializeBinaryFromReader(_instance, _reader) {
while (_reader.nextField()) {
if (_reader.isEndGroup())
break;
switch (_reader.getFieldNumber()) {
case 1:
_instance.s2tCloudProviderConfigAmazon = new S2tCloudProviderConfigAmazon();
_reader.readMessage(_instance.s2tCloudProviderConfigAmazon, S2tCloudProviderConfigAmazon.deserializeBinaryFromReader);
break;
case 2:
_instance.s2tCloudProviderConfigDeepgram = new S2tCloudProviderConfigDeepgram();
_reader.readMessage(_instance.s2tCloudProviderConfigDeepgram, S2tCloudProviderConfigDeepgram.deserializeBinaryFromReader);
break;
case 3:
_instance.s2tCloudProviderConfigGoogle = new S2tCloudProviderConfigGoogle();
_reader.readMessage(_instance.s2tCloudProviderConfigGoogle, S2tCloudProviderConfigGoogle.deserializeBinaryFromReader);
break;
case 4:
_instance.s2tCloudProviderConfigMicrosoft = new S2tCloudProviderConfigMicrosoft();
_reader.readMessage(_instance.s2tCloudProviderConfigMicrosoft, S2tCloudProviderConfigMicrosoft.deserializeBinaryFromReader);
break;
default:
_reader.skipField();
}
}
S2tCloudProviderConfig.refineValues(_instance);
}
/**
* Serializes a message to binary format using provided binary reader
* @param _instance message instance
* @param _writer binary writer instance
*/
static serializeBinaryToWriter(_instance, _writer) {
if (_instance.s2tCloudProviderConfigAmazon) {
_writer.writeMessage(1, _instance.s2tCloudProviderConfigAmazon, S2tCloudProviderConfigAmazon.serializeBinaryToWriter);
}
if (_instance.s2tCloudProviderConfigDeepgram) {
_writer.writeMessage(2, _instance.s2tCloudProviderConfigDeepgram, S2tCloudProviderConfigDeepgram.serializeBinaryToWriter);
}
if (_instance.s2tCloudProviderConfigGoogle) {
_writer.writeMessage(3, _instance.s2tCloudProviderConfigGoogle, S2tCloudProviderConfigGoogle.serializeBinaryToWriter);
}
if (_instance.s2tCloudProviderConfigMicrosoft) {
_writer.writeMessage(4, _instance.s2tCloudProviderConfigMicrosoft, S2tCloudProviderConfigMicrosoft.serializeBinaryToWriter);
}
}
/**
* Message constructor. Initializes the properties and applies default Protobuf values if necessary
* @param _value initial values object or instance of S2tCloudProviderConfig to deeply clone from
*/
constructor(_value) {
_value = _value || {};
this.s2tCloudProviderConfigAmazon = _value.s2tCloudProviderConfigAmazon
? new S2tCloudProviderConfigAmazon(_value.s2tCloudProviderConfigAmazon)
: undefined;
this.s2tCloudProviderConfigDeepgram = _value.s2tCloudProviderConfigDeepgram
? new S2tCloudProviderConfigDeepgram(_value.s2tCloudProviderConfigDeepgram)
: undefined;
this.s2tCloudProviderConfigGoogle = _value.s2tCloudProviderConfigGoogle
? new S2tCloudProviderConfigGoogle(_value.s2tCloudProviderConfigGoogle)
: undefined;
this.s2tCloudProviderConfigMicrosoft = _value.s2tCloudProviderConfigMicrosoft
? new S2tCloudProviderConfigMicrosoft(_value.s2tCloudProviderConfigMicrosoft)
: undefined;
S2tCloudProviderConfig.refineValues(this);
}
get s2tCloudProviderConfigAmazon() {
return this._s2tCloudProviderConfigAmazon;
}
set s2tCloudProviderConfigAmazon(value) {
this._s2tCloudProviderConfigAmazon = value;
}
get s2tCloudProviderConfigDeepgram() {
return this._s2tCloudProviderConfigDeepgram;
}
set s2tCloudProviderConfigDeepgram(value) {
this._s2tCloudProviderConfigDeepgram = value;
}
get s2tCloudProviderConfigGoogle() {
return this._s2tCloudProviderConfigGoogle;
}
set s2tCloudProviderConfigGoogle(value) {
this._s2tCloudProviderConfigGoogle = value;
}
get s2tCloudProviderConfigMicrosoft() {
return this._s2tCloudProviderConfigMicrosoft;
}
set s2tCloudProviderConfigMicrosoft(value) {
this._s2tCloudProviderConfigMicrosoft = value;
}
/**
* Serialize message to binary data
* @param instance message instance
*/
serializeBinary() {
const writer = new BinaryWriter();
S2tCloudProviderConfig.serializeBinaryToWriter(this, writer);
return writer.getResultBuffer();
}
/**
* Cast message to standard JavaScript object (all non-primitive values are deeply cloned)
*/
toObject() {
return {
s2tCloudProviderConfigAmazon: this.s2tCloudProviderConfigAmazon
? this.s2tCloudProviderConfigAmazon.toObject()
: undefined,
s2tCloudProviderConfigDeepgram: this.s2tCloudProviderConfigDeepgram
? this.s2tCloudProviderConfigDeepgram.toObject()
: undefined,
s2tCloudProviderConfigGoogle: this.s2tCloudProviderConfigGoogle
? this.s2tCloudProviderConfigGoogle.toObject()
: undefined,
s2tCloudProviderConfigMicrosoft: this.s2tCloudProviderConfigMicrosoft
? this.s2tCloudProviderConfigMicrosoft.toObject()
: undefined
};
}
/**
* Convenience method to support JSON.stringify(message), replicates the structure of toObject()
*/
toJSON() {
return this.toObject();
}
/**
* Cast message to JSON using protobuf JSON notation: https://developers.google.com/protocol-buffers/docs/proto3#json
* Attention: output differs from toObject() e.g. enums are represented as names and not as numbers, Timestamp is an ISO Date string format etc.
* If the message itself or some of descendant messages is google.protobuf.Any, you MUST provide a message pool as options. If not, the messagePool is not required
*/
toProtobufJSON(
// @ts-ignore
options) {
return {
s2tCloudProviderConfigAmazon: this.s2tCloudProviderConfigAmazon
? this.s2tCloudProviderConfigAmazon.toProtobufJSON(options)
: null,
s2tCloudProviderConfigDeepgram: this.s2tCloudProviderConfigDeepgram
? this.s2tCloudProviderConfigDeepgram.toProtobufJSON(options)
: null,
s2tCloudProviderConfigGoogle: this.s2tCloudProviderConfigGoogle
? this.s2tCloudProviderConfigGoogle.toProtobufJSON(options)
: null,
s2tCloudProviderConfigMicrosoft: this.s2tCloudProviderConfigMicrosoft
? this.s2tCloudProviderConfigMicrosoft.toProtobufJSON(options)
: null
};
}
}
/**
* Message implementation for ondewo.s2t.S2tCloudProviderConfigAmazon
*/
class S2tCloudProviderConfigAmazon {
static { this.id = 'ondewo.s2t.S2tCloudProviderConfigAmazon'; }
/**
* Deserialize binary data to message
* @param instance message instance
*/
static deserializeBinary(bytes) {
const instance = new S2tCloudProviderConfigAmazon();
S2tCloudProviderConfigAmazon.deserializeBinaryFromReader(instance, new BinaryReader(bytes));
return instance;
}
/**
* Check all the properties and set default protobuf values if necessary
* @param _instance message instance
*/
static refineValues(_instance) {
_instance.enablePartialResultsStabilization =
_instance.enablePartialResultsStabilization || false;
_instance.partialResultsStability = _instance.partialResultsStability || '';
_instance.languageModelName = _instance.languageModelName || '';
_instance.vocabularyName = _instance.vocabularyName || '';
}
/**
* Deserializes / reads binary message into message instance using provided binary reader
* @param _instance message instance
* @param _reader binary reader instance
*/
static deserializeBinaryFromReader(_instance, _reader) {
while (_reader.nextField()) {
if (_reader.isEndGroup())
break;
switch (_reader.getFieldNumber()) {
case 1:
_instance.enablePartialResultsStabilization = _reader.readBool();
break;
case 2:
_instance.partialResultsStability = _reader.readString();
break;
case 3:
_instance.languageModelName = _reader.readString();
break;
case 4:
_instance.vocabularyName = _reader.readString();
break;
default:
_reader.skipField();
}
}
S2tCloudProviderConfigAmazon.refineValues(_instance);
}
/**
* Serializes a message to binary format using provided binary reader
* @param _instance message instance
* @param _writer binary writer instance
*/
static serializeBinaryToWriter(_instance, _writer) {
if (_instance.enablePartialResultsStabilization) {
_writer.writeBool(1, _instance.enablePartialResultsStabilization);
}
if (_instance.partialResultsStability) {
_writer.writeString(2, _instance.partialResultsStability);
}
if (_instance.languageModelName) {
_writer.writeString(3, _instance.languageModelName);
}
if (_instance.vocabularyName) {
_writer.writeString(4, _instance.vocabularyName);
}
}
/**
* Message constructor. Initializes the properties and applies default Protobuf values if necessary
* @param _value initial values object or instance of S2tCloudProviderConfigAmazon to deeply clone from
*/
constructor(_value) {
_value = _value || {};
this.enablePartialResultsStabilization =
_value.enablePartialResultsStabilization;
this.partialResultsStability = _value.partialResultsStability;
this.languageModelName = _value.languageModelName;
this.vocabularyName = _value.vocabularyName;
S2tCloudProviderConfigAmazon.refineValues(this);
}
get enablePartialResultsStabilization() {
return this._enablePartialResultsStabilization;
}
set enablePartialResultsStabilization(value) {
this._enablePartialResultsStabilization = value;
}
get partialResultsStability() {
return this._partialResultsStability;
}
set partialResultsStability(value) {
this._partialResultsStability = value;
}
get languageModelName() {
return this._languageModelName;
}
set languageModelName(value) {
this._languageModelName = value;
}
get vocabularyName() {
return this._vocabularyName;
}
set vocabularyName(value) {
this._vocabularyName = value;
}
/**
* Serialize message to binary data
* @param instance message instance
*/
serializeBinary() {
const writer = new BinaryWriter();
S2tCloudProviderConfigAmazon.serializeBinaryToWriter(this, writer);
return writer.getResultBuffer();
}
/**
* Cast message to standard JavaScript object (all non-primitive values are deeply cloned)
*/
toObject() {
return {
enablePartialResultsStabilization: this.enablePartialResultsStabilization,
partialResultsStability: this.partialResultsStability,
languageModelName: this.languageModelName,
vocabularyName: this.vocabularyName
};
}
/**
* Convenience method to support JSON.stringify(message), replicates the structure of toObject()
*/
toJSON() {
return this.toObject();
}
/**
* Cast message to JSON using protobuf JSON notation: https://developers.google.com/protocol-buffers/docs/proto3#json
* Attention: output differs from toObject() e.g. enums are represented as names and not as numbers, Timestamp is an ISO Date string format etc.
* If the message itself or some of descendant messages is google.protobuf.Any, you MUST provide a message pool as options. If not, the messagePool is not required
*/
toProtobufJSON(
// @ts-ignore
options) {
return {
enablePartialResultsStabilization: this.enablePartialResultsStabilization,
partialResultsStability: this.partialResultsStability,
languageModelName: this.languageModelName,
vocabularyName: this.vocabularyName
};
}
}
/**
* Message implementation for ondewo.s2t.S2tCloudProviderConfigDeepgram
*/
class S2tCloudProviderConfigDeepgram {
static { this.id = 'ondewo.s2t.S2tCloudProviderConfigDeepgram'; }
/**
* Deserialize binary data to message
* @param instance message instance
*/
static deserializeBinary(bytes) {
const instance = new S2tCloudProviderConfigDeepgram();
S2tCloudProviderConfigDeepgram.deserializeBinaryFromReader(instance, new BinaryReader(bytes));
return instance;
}
/**
* Check all the properties and set default protobuf values if necessary
* @param _instance message instance
*/
static refineValues(_instance) {
_instance.punctuate = _instance.punctuate || false;
_instance.smartFormat = _instance.smartFormat || false;
_instance.numerals = _instance.numerals || false;
_instance.measurements = _instance.measurements || false;
_instance.dictation = _instance.dictation || false;
}
/**
* Deserializes / reads binary message into message instance using provided binary reader
* @param _instance message instance
* @param _reader binary reader instance
*/
static deserializeBinaryFromReader(_instance, _reader) {
while (_reader.nextField()) {
if (_reader.isEndGroup())
break;
switch (_reader.getFieldNumber()) {
case 1:
_instance.punctuate = _reader.readBool();
break;
case 2:
_instance.smartFormat = _reader.readBool();
break;
case 3:
_instance.numerals = _reader.readBool();
break;
case 4:
_instance.measurements = _reader.readBool();
break;
case 5:
_instance.dictation = _reader.readBool();
break;
default:
_reader.skipField();
}
}
S2tCloudProviderConfigDeepgram.refineValues(_instance);
}
/**
* Serializes a message to binary format using provided binary reader
* @param _instance message instance
* @param _writer binary writer instance
*/
static serializeBinaryToWriter(_instance, _writer) {
if (_instance.punctuate) {
_writer.writeBool(1, _instance.punctuate);
}
if (_instance.smartFormat) {
_writer.writeBool(2, _instance.smartFormat);
}
if (_instance.numerals) {
_writer.writeBool(3, _instance.numerals);
}
if (_instance.measurements) {
_writer.writeBool(4, _instance.measurements);
}
if (_instance.dictation) {
_writer.writeBool(5, _instance.dictation);
}
}
/**
* Message constructor. Initializes the properties and applies default Protobuf values if necessary
* @param _value initial values object or instance of S2tCloudProviderConfigDeepgram to deeply clone from
*/
constructor(_value) {
_value = _value || {};
this.punctuate = _value.punctuate;
this.smartFormat = _value.smartFormat;
this.numerals = _value.numerals;
this.measurements = _value.measurements;
this.dictation = _value.dictation;
S2tCloudProviderConfigDeepgram.refineValues(this);
}
get punctuate() {
return this._punctuate;
}
set punctuate(value) {
this._punctuate = value;
}
get smartFormat() {
return this._smartFormat;
}
set smartFormat(value) {
this._smartFormat = value;
}
get numerals() {
return this._numerals;
}
set numerals(value) {
this._numerals = value;
}
get measurements() {
return this._measurements;
}
set measurements(value) {
this._measurements = value;
}
get dictation() {
return this._dictation;
}
set dictation(value) {
this._dictation = value;
}
/**
* Serialize message to binary data
* @param instance message instance
*/
serializeBinary() {
const writer = new BinaryWriter();
S2tCloudProviderConfigDeepgram.serializeBinaryToWriter(this, writer);
return writer.getResultBuffer();
}
/**
* Cast message to standard JavaScript object (all non-primitive values are deeply cloned)
*/
toObject() {
return {
punctuate: this.punctuate,
smartFormat: this.smartFormat,
numerals: this.numerals,
measurements: this.measurements,
dictation: this.dictation
};
}
/**
* Convenience method to support JSON.stringify(message), replicates the structure of toObject()
*/
toJSON() {
return this.toObject();
}
/**
* Cast message to JSON using protobuf JSON notation: https://developers.google.com/protocol-buffers/docs/proto3#json
* Attention: output differs from toObject() e.g. enums are represented as names and not as numbers, Timestamp is an ISO Date string format etc.
* If the message itself or some of descendant messages is google.protobuf.Any, you MUST provide a message pool as options. If not, the messagePool is not required
*/
toProtobufJSON(
// @ts-ignore
options) {
return {
punctuate: this.punctuate,
smartFormat: this.smartFormat,
numerals: this.numerals,
measurements: this.measurements,
dictation: this.dictation
};
}
}
/**
* Message implementation for ondewo.s2t.S2tCloudProviderConfigGoogle
*/
class S2tCloudProviderConfigGoogle {
static { this.id = 'ondewo.s2t.S2tCloudProviderConfigGoogle'; }
/**
* Deserialize binary data to message
* @param instance message instance
*/
static deserializeBinary(bytes) {
const instance = new S2tCloudProviderConfigGoogle();
S2tCloudProviderConfigGoogle.deserializeBinaryFromReader(instance, new BinaryReader(bytes));
return instance;
}
/**
* Check all the properties and set default protobuf values if necessary
* @param _instance message instance
*/
static refineValues(_instance) {
_instance.enableAutomaticPunctuation =
_instance.enableAutomaticPunctuation || false;
_instance.enableWordTimeOffsets = _instance.enableWordTimeOffsets || false;
_instance.enableWordConfidence = _instance.enableWordConfidence || false;
_instance.transcriptNormalization =
_instance.transcriptNormalization || false;
_instance.maxAlternatives = _instance.maxAlternatives || 0;
}
/**
* Deserializes / reads binary message into message instance using provided binary reader
* @param _instance message instance
* @param _reader binary reader instance
*/
static deserializeBinaryFromReader(_instance, _reader) {
while (_reader.nextField()) {
if (_reader.isEndGroup())
break;
switch (_reader.getFieldNumber()) {
case 1:
_instance.enableAutomaticPunctuation = _reader.readBool();
break;
case 2:
_instance.enableWordTimeOffsets = _reader.readBool();
break;
case 3:
_instance.enableWordConfidence = _reader.readBool();
break;
case 4:
_instance.transcriptNormalization = _reader.readBool();
break;
case 5:
_instance.maxAlternatives = _reader.readInt32();
break;
default:
_reader.skipField();
}
}
S2tCloudProviderConfigGoogle.refineValues(_instance);
}
/**
* Serializes a message to binary format using provided binary reader
* @param _instance message instance
* @param _writer binary writer instance
*/
static serializeBinaryToWriter(_instance, _writer) {
if (_instance.enableAutomaticPunctuation) {
_writer.writeBool(1, _instance.enableAutomaticPunctuation);
}
if (_instance.enableWordTimeOffsets) {
_writer.writeBool(2, _instance.enableWordTimeOffsets);
}
if (_instance.enableWordConfidence) {
_writer.writeBool(3, _instance.enableWordConfidence);
}
if (_instance.transcriptNormalization) {
_writer.writeBool(4, _instance.transcriptNormalization);
}
if (_instance.maxAlternatives) {
_writer.writeInt32(5, _instance.maxAlternatives);
}
}
/**
* Message constructor. Initializes the properties and applies default Protobuf values if necessary
* @param _value initial values object or instance of S2tCloudProviderConfigGoogle to deeply clone from
*/
constructor(_value) {
_value = _value || {};
this.enableAutomaticPunctuation = _value.enableAutomaticPunctuation;
this.enableWordTimeOffsets = _value.enableWordTimeOffsets;
this.enableWordConfidence = _value.enableWordConfidence;
this.transcriptNormalization = _value.transcriptNormalization;
this.maxAlternatives = _value.maxAlternatives;
S2tCloudProviderConfigGoogle.refineValues(this);
}
get enableAutomaticPunctuation() {
return this._enableAutomaticPunctuation;
}
set enableAutomaticPunctuation(value) {
this._enableAutomaticPunctuation = value;
}
get enableWordTimeOffsets() {
return this._enableWordTimeOffsets;
}
set enableWordTimeOffsets(value) {
this._enableWordTimeOffsets = value;
}
get enableWordConfidence() {
return this._enableWordConfidence;
}
set enableWordConfidence(value) {
this._enableWordConfidence = value;
}
get transcriptNormalization() {
return this._transcriptNormalization;
}
set transcriptNormalization(value) {
this._transcriptNormalization = value;
}
get maxAlternatives() {
return this._maxAlternatives;
}
set maxAlternatives(value) {
this._maxAlternatives = value;
}
/**
* Serialize message to binary data
* @param instance message instance
*/
serializeBinary() {
const writer = new BinaryWriter();
S2tCloudProviderConfigGoogle.serializeBinaryToWriter(this, writer);
return writer.getResultBuffer();
}
/**
* Cast message to standard JavaScript object (all non-primitive values are deeply cloned)
*/
toObject() {
return {
enableAutomaticPunctuation: this.enableAutomaticPunctuation,
enableWordTimeOffsets: this.enableWordTimeOffsets,
enableWordConfidence: this.enableWordConfidence,
transcriptNormalization: this.transcriptNormalization,
maxAlternatives: this.maxAlternatives
};
}
/**
* Convenience method to support JSON.stringify(message), replicates the structure of toObject()
*/
toJSON() {
return this.toObject();
}
/**
* Cast message to JSON using protobuf JSON notation: https://developers.google.com/protocol-buffers/docs/proto3#json
* Attention: output differs from toObject() e.g. enums are represented as names and not as numbers, Timestamp is an ISO Date string format etc.
* If the message itself or some of descendant messages is google.protobuf.Any, you MUST provide a message pool as options. If not, the messagePool is not required
*/
toProtobufJSON(
// @ts-ignore
options) {
return {
enableAutomaticPunctuation: this.enableAutomaticPunctuation,
enableWordTimeOffsets: this.enableWordTimeOffsets,
enableWordConfidence: this.enableWordConfidence,
transcriptNormalization: this.transcriptNormalization,
maxAlternatives: this.maxAlternatives
};
}
}
/**
* Message implementation for ondewo.s2t.S2tCloudProviderConfigMicrosoft
*/
class S2tCloudProviderConfigMicrosoft {
static { this.id = 'ondewo.s2t.S2tCloudProviderConfigMicrosoft'; }
/**
* Deserialize binary data to message
* @param instance message instance
*/
static deserializeBinary(bytes) {
const instance = new S2tCloudProviderConfigMicrosoft();
S2tCloudProviderConfigMicrosoft.deserializeBinaryFromReader(instance, new BinaryReader(bytes));
return instance;
}
/**
* Check all the properties and set default protobuf values if necessary
* @param _instance message instance
*/
static refineValues(_instance) {
_instance.useFastTranscriptionApi =
_instance.useFastTranscriptionApi || false;
_instance.useDetailedOutputFormat =
_instance.useDetailedOutputFormat || false;
}
/**
* Deserializes / reads binary message into message instance using provided binary reader
* @param _instance message instance
* @param _reader binary reader instance
*/
static deserializeBinaryFromReader(_instance, _reader) {
while (_reader.nextField()) {
if (_reader.isEndGroup())
break;
switch (_reader.getFieldNumber()) {
case 1:
_instance.useFastTranscriptionApi = _reader.readBool();
break;
case 2:
_instance.useDetailedOutputFormat = _reader.readBool();
break;
default:
_reader.skipField();
}
}
S2tCloudProviderConfigMicrosoft.refineValues(_instance);
}
/**
* Serializes a message to binary format using provided binary reader
* @param _instance message instance
* @param _writer binary writer instance
*/
static serializeBinaryToWriter(_instance, _writer) {
if (_instance.useFastTranscriptionApi) {
_writer.writeBool(1, _instance.useFastTranscriptionApi);
}
if (_instance.useDetailedOutputFormat) {
_writer.writeBool(2, _instance.useDetailedOutputFormat);
}
}
/**
* Message constructor. Initializes the properties and applies default Protobuf values if necessary
* @param _value initial values object or instance of S2tCloudProviderConfigMicrosoft to deeply clone from
*/
constructor(_value) {
_value = _value || {};
this.useFastTranscriptionApi = _value.useFastTranscriptionApi;
this.useDetailedOutputFormat = _value.useDetailedOutputFormat;
S2tCloudProviderConfigMicrosoft.refineValues(this);
}
get useFastTranscriptionApi() {
return this._useFastTranscriptionApi;
}
set useFastTranscriptionApi(value) {
this._useFastTranscriptionApi = value;
}
get useDetailedOutputFormat() {
return this._useDetailedOutputFormat;
}
set useDetailedOutputFormat(value) {
this._useDetailedOutputFormat = value;
}
/**
* Serialize message to binary data
* @param instance message instance
*/
serializeBinary() {
const writer = new BinaryWriter();
S2tCloudProviderConfigMicrosoft.serializeBinaryToWriter(this, writer);
return writer.getResultBuffer();
}
/**
* Cast message to standard JavaScript object (all non-primitive values are deeply cloned)
*/
toObject() {
return {
useFastTranscriptionApi: this.useFastTranscriptionApi,
useDetailedOutputFormat: this.useDetailedOutputFormat
};
}
/**
* Convenience method to support JSON.stringify(message), replicates the structure of toObject()
*/
toJSON() {
return this.toObject();
}
/**
* Cast message to JSON using protobuf JSON notation: https://developers.google.com/protocol-buffers/docs/proto3#json
* Attention: output differs from toObject() e.g. enums are represented as names and not as numbers, Timestamp is an ISO Date string format etc.
* If the message itself or some of descendant messages is google.protobuf.Any, you MUST provide a message pool as options. If not, the messagePool is not required
*/
toProtobufJSON(
// @ts-ignore
options) {
return {
useFastTranscriptionApi: this.useFastTranscriptionApi,
useDetailedOutputFormat: this.useDetailedOutputFormat
};
}
}
/**
* Message implementation for ondewo.s2t.TranscriptionReturnOptions
*/
class TranscriptionReturnOptions {
static { this.id = 'ondewo.s2t.TranscriptionReturnOptions'; }
/**
* Deserialize binary data to message
* @param instance message instance
*/
static deserializeBinary(bytes) {
const instance = new TranscriptionReturnOptions();
TranscriptionReturnOptions.deserializeBinaryFromReader(instance, new BinaryReader(bytes));
return instance;
}
/**
* Check all the properties and set default protobuf values if necessary
* @param _instance message instance
*/
static refineValues(_instance) {
_instance.returnStartOfSpeech = _instance.returnStartOfSpeech || false;
_instance.returnAudio = _instance.returnAudio || false;
_instance.returnConfidenceScore = _instance.returnConfidenceScore || false;
_instance.returnAlternativeTranscriptions =
_instance.returnAlternativeTranscriptions || false;
_instance.returnAlternativeTranscriptionsNr =
_instance.returnAlternativeTranscriptionsNr || 0;