@novo-learning/novo-sdk
Version:
SDK for the Novolanguage Speech Analysis API
1,311 lines (1,208 loc) • 48.6 kB
text/typescript
/* tslint:disable */
/* eslint-disable */
/**
* Pronunciation API
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 1.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { Configuration } from './configuration';
import globalAxios, { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios';
// Some imports not used depending on template conditions
// @ts-ignore
import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from './common';
// @ts-ignore
import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from './base';
/**
*
* @export
* @interface AddConfusionDtoV1
*/
export interface AddConfusionDtoV1 {
/**
*
* @type {string}
* @memberof AddConfusionDtoV1
*/
'key': string;
/**
*
* @type {string}
* @memberof AddConfusionDtoV1
*/
'description': string;
/**
*
* @type {Array<Array<string>>}
* @memberof AddConfusionDtoV1
*/
'confusion': Array<Array<string>>;
}
/**
*
* @export
* @interface ConfusionRuleDtoV1
*/
export interface ConfusionRuleDtoV1 {
/**
*
* @type {string}
* @memberof ConfusionRuleDtoV1
*/
'key': string;
/**
*
* @type {string}
* @memberof ConfusionRuleDtoV1
*/
'language': ConfusionRuleDtoV1LanguageEnum;
/**
*
* @type {string}
* @memberof ConfusionRuleDtoV1
*/
'description': string;
/**
*
* @type {Array<Array<string>>}
* @memberof ConfusionRuleDtoV1
*/
'confusion': Array<Array<string>>;
}
export const ConfusionRuleDtoV1LanguageEnum = {
ar_idn: 'ar-idn',
de: 'de',
en: 'en',
nl: 'nl',
zh: 'zh',
fr: 'fr',
es: 'es'
} as const;
export type ConfusionRuleDtoV1LanguageEnum = typeof ConfusionRuleDtoV1LanguageEnum[keyof typeof ConfusionRuleDtoV1LanguageEnum];
/**
*
* @export
* @interface MetadataDtoV1
*/
export interface MetadataDtoV1 {
/**
*
* @type {string}
* @memberof MetadataDtoV1
*/
'word': string;
/**
*
* @type {object}
* @memberof MetadataDtoV1
*/
'metadata': object;
}
/**
*
* @export
* @interface MetadataRequestDtoV1
*/
export interface MetadataRequestDtoV1 {
/**
* The phrase for which metadata is requested
* @type {string}
* @memberof MetadataRequestDtoV1
*/
'phrase': string;
/**
* language of the phrase
* @type {string}
* @memberof MetadataRequestDtoV1
*/
'targetLanguage': MetadataRequestDtoV1TargetLanguageEnum;
/**
*
* @type {string}
* @memberof MetadataRequestDtoV1
*/
'secret'?: string;
/**
*
* @type {object}
* @memberof MetadataRequestDtoV1
*/
'userData'?: object;
}
export const MetadataRequestDtoV1TargetLanguageEnum = {
ar_idn: 'ar-idn',
de: 'de',
en: 'en',
nl: 'nl',
zh: 'zh',
fr: 'fr',
es: 'es'
} as const;
export type MetadataRequestDtoV1TargetLanguageEnum = typeof MetadataRequestDtoV1TargetLanguageEnum[keyof typeof MetadataRequestDtoV1TargetLanguageEnum];
/**
*
* @export
* @interface PhrasePronunciationDtoV1
*/
export interface PhrasePronunciationDtoV1 {
/**
* language of the phrase
* @type {string}
* @memberof PhrasePronunciationDtoV1
*/
'language': PhrasePronunciationDtoV1LanguageEnum;
/**
* input phrase
* @type {string}
* @memberof PhrasePronunciationDtoV1
*/
'phrase': string;
/**
* tokenized g2p output for each detected token (word) in the phrase
* @type {Array<TokenPronunciationDtoV1>}
* @memberof PhrasePronunciationDtoV1
*/
'tokens': Array<TokenPronunciationDtoV1>;
}
export const PhrasePronunciationDtoV1LanguageEnum = {
ar_idn: 'ar-idn',
de: 'de',
en: 'en',
nl: 'nl',
zh: 'zh',
fr: 'fr',
es: 'es'
} as const;
export type PhrasePronunciationDtoV1LanguageEnum = typeof PhrasePronunciationDtoV1LanguageEnum[keyof typeof PhrasePronunciationDtoV1LanguageEnum];
/**
*
* @export
* @interface PhrasePronunciationDtoV2
*/
export interface PhrasePronunciationDtoV2 {
/**
* language of the phrase
* @type {string}
* @memberof PhrasePronunciationDtoV2
*/
'language': PhrasePronunciationDtoV2LanguageEnum;
/**
* input phrase
* @type {string}
* @memberof PhrasePronunciationDtoV2
*/
'phrase': string;
/**
* tokenized g2p output for each detected token (word) in the phrase
* @type {Array<TokenPronunciationDtoV2>}
* @memberof PhrasePronunciationDtoV2
*/
'tokens': Array<TokenPronunciationDtoV2>;
}
export const PhrasePronunciationDtoV2LanguageEnum = {
ar_idn: 'ar-idn',
de: 'de',
en: 'en',
nl: 'nl',
zh: 'zh',
fr: 'fr',
es: 'es'
} as const;
export type PhrasePronunciationDtoV2LanguageEnum = typeof PhrasePronunciationDtoV2LanguageEnum[keyof typeof PhrasePronunciationDtoV2LanguageEnum];
/**
*
* @export
* @interface PronunciationDtoV1
*/
export interface PronunciationDtoV1 {
/**
* the word the phonemeList is based on
* @type {string}
* @memberof PronunciationDtoV1
*/
'word': string;
/**
* list of phonemeLists of correct pronunciations
* @type {Array<Array<string>>}
* @memberof PronunciationDtoV1
*/
'correctPronunciations': Array<Array<string>>;
/**
* list of phonemeLists of incorrect pronunciations
* @type {Array<Array<string>>}
* @memberof PronunciationDtoV1
*/
'incorrectPronunciations': Array<Array<string>>;
/**
* optional liaison phoneme to connect this pronunciation with previous
* @type {string}
* @memberof PronunciationDtoV1
*/
'liaisonPhoneme'?: string;
/**
* description of prosody targets
* @type {ProsodyTargetDtoV1}
* @memberof PronunciationDtoV1
*/
'prosody'?: ProsodyTargetDtoV1;
/**
* indication whether the word is followed by punctuation
* @type {string}
* @memberof PronunciationDtoV1
*/
'punctuation'?: string;
}
/**
*
* @export
* @interface PronunciationDtoV2
*/
export interface PronunciationDtoV2 {
/**
* the word the phonemeList is based on
* @type {string}
* @memberof PronunciationDtoV2
*/
'word': string;
/**
* list of phonemeLists of correct pronunciations
* @type {Array<PronunciationDtoV2CorrectPronunciations>}
* @memberof PronunciationDtoV2
*/
'correctPronunciations': Array<PronunciationDtoV2CorrectPronunciations>;
/**
* list of phonemeLists of incorrect pronunciations
* @type {Array<PronunciationDtoV2CorrectPronunciations>}
* @memberof PronunciationDtoV2
*/
'incorrectPronunciations': Array<PronunciationDtoV2CorrectPronunciations>;
/**
* optional liaison phoneme to connect this pronunciation with previous
* @type {string}
* @memberof PronunciationDtoV2
*/
'liaisonPhoneme'?: string;
/**
* description of prosody targets
* @type {ProsodyTargetDtoV2}
* @memberof PronunciationDtoV2
*/
'prosody'?: ProsodyTargetDtoV2;
}
/**
*
* @export
* @interface PronunciationDtoV2CorrectPronunciations
*/
export interface PronunciationDtoV2CorrectPronunciations {
/**
*
* @type {Array<PronunciationDtoV2Phonemes>}
* @memberof PronunciationDtoV2CorrectPronunciations
*/
'phonemes': Array<PronunciationDtoV2Phonemes>;
}
/**
*
* @export
* @interface PronunciationDtoV2Phonemes
*/
export interface PronunciationDtoV2Phonemes {
/**
* representation of a sound
* @type {string}
* @memberof PronunciationDtoV2Phonemes
*/
'phoneme': string;
/**
*
* @type {Array<string>}
* @memberof PronunciationDtoV2Phonemes
*/
'duration'?: Array<PronunciationDtoV2PhonemesDurationEnum>;
}
export const PronunciationDtoV2PhonemesDurationEnum = {
short: 'short',
normal: 'normal',
long: 'long',
superlong: 'superlong'
} as const;
export type PronunciationDtoV2PhonemesDurationEnum = typeof PronunciationDtoV2PhonemesDurationEnum[keyof typeof PronunciationDtoV2PhonemesDurationEnum];
/**
*
* @export
* @interface PronunciationMetadataRequestDtoV1
*/
export interface PronunciationMetadataRequestDtoV1 {
/**
* language of the phrase
* @type {string}
* @memberof PronunciationMetadataRequestDtoV1
*/
'language': PronunciationMetadataRequestDtoV1LanguageEnum;
/**
*
* @type {Array<WordPronunciationDtoV1>}
* @memberof PronunciationMetadataRequestDtoV1
*/
'words': Array<WordPronunciationDtoV1>;
/**
*
* @type {string}
* @memberof PronunciationMetadataRequestDtoV1
*/
'secret'?: string;
/**
*
* @type {object}
* @memberof PronunciationMetadataRequestDtoV1
*/
'userData'?: object;
}
export const PronunciationMetadataRequestDtoV1LanguageEnum = {
ar_idn: 'ar-idn',
de: 'de',
en: 'en',
nl: 'nl',
zh: 'zh',
fr: 'fr',
es: 'es'
} as const;
export type PronunciationMetadataRequestDtoV1LanguageEnum = typeof PronunciationMetadataRequestDtoV1LanguageEnum[keyof typeof PronunciationMetadataRequestDtoV1LanguageEnum];
/**
*
* @export
* @interface PronunciationRequestDtoV1
*/
export interface PronunciationRequestDtoV1 {
/**
* language of the phrase
* @type {string}
* @memberof PronunciationRequestDtoV1
*/
'targetLanguage': PronunciationRequestDtoV1TargetLanguageEnum;
/**
* the phrase, written as is, verbatim, with special characters
* @type {string}
* @memberof PronunciationRequestDtoV1
*/
'phrase': string;
/**
* key of a confusion rule to apply or a custom confusion list. A confusion list is a list of a list of phonemes which are commonly confused when pronunciating a word
* @type {string | object}
* @memberof PronunciationRequestDtoV1
*/
'confusion'?: string | object;
}
export const PronunciationRequestDtoV1TargetLanguageEnum = {
ar_idn: 'ar-idn',
de: 'de',
en: 'en',
nl: 'nl',
zh: 'zh',
fr: 'fr',
es: 'es'
} as const;
export type PronunciationRequestDtoV1TargetLanguageEnum = typeof PronunciationRequestDtoV1TargetLanguageEnum[keyof typeof PronunciationRequestDtoV1TargetLanguageEnum];
/**
*
* @export
* @interface PronunciationRequestDtoV2
*/
export interface PronunciationRequestDtoV2 {
/**
* language of the phrase
* @type {string}
* @memberof PronunciationRequestDtoV2
*/
'targetLanguage': PronunciationRequestDtoV2TargetLanguageEnum;
/**
* the phrase, written as is, verbatim, with special characters
* @type {string}
* @memberof PronunciationRequestDtoV2
*/
'phrase': string;
/**
* key of a confusion rule to apply or a custom confusion list. A confusion list is a list of a list of phonemes which are commonly confused when pronunciating a word
* @type {string | object}
* @memberof PronunciationRequestDtoV2
*/
'confusion'?: string | object;
}
export const PronunciationRequestDtoV2TargetLanguageEnum = {
ar_idn: 'ar-idn',
de: 'de',
en: 'en',
nl: 'nl',
zh: 'zh',
fr: 'fr',
es: 'es'
} as const;
export type PronunciationRequestDtoV2TargetLanguageEnum = typeof PronunciationRequestDtoV2TargetLanguageEnum[keyof typeof PronunciationRequestDtoV2TargetLanguageEnum];
/**
*
* @export
* @interface ProsodyTargetDtoV1
*/
export interface ProsodyTargetDtoV1 {
/**
* indication whether a pause is necessary, optional, or prohibited
* @type {string}
* @memberof ProsodyTargetDtoV1
*/
'pause'?: ProsodyTargetDtoV1PauseEnum;
/**
* intonation slope target: falling, rising, or flat
* @type {string}
* @memberof ProsodyTargetDtoV1
*/
'intonation'?: ProsodyTargetDtoV1IntonationEnum;
/**
* indication of the syllable that carries word stress
* @type {number}
* @memberof ProsodyTargetDtoV1
*/
'stress'?: number;
}
export const ProsodyTargetDtoV1PauseEnum = {
prohibited: 'prohibited',
optional: 'optional',
mandatory: 'mandatory'
} as const;
export type ProsodyTargetDtoV1PauseEnum = typeof ProsodyTargetDtoV1PauseEnum[keyof typeof ProsodyTargetDtoV1PauseEnum];
export const ProsodyTargetDtoV1IntonationEnum = {
falling: 'falling',
rising: 'rising',
flat: 'flat'
} as const;
export type ProsodyTargetDtoV1IntonationEnum = typeof ProsodyTargetDtoV1IntonationEnum[keyof typeof ProsodyTargetDtoV1IntonationEnum];
/**
*
* @export
* @interface ProsodyTargetDtoV2
*/
export interface ProsodyTargetDtoV2 {
/**
* indication whether a pause is necessary, optional, or prohibited
* @type {string}
* @memberof ProsodyTargetDtoV2
*/
'pause'?: ProsodyTargetDtoV2PauseEnum;
/**
* intonation slope target: falling, rising, or flat
* @type {string}
* @memberof ProsodyTargetDtoV2
*/
'intonation'?: ProsodyTargetDtoV2IntonationEnum;
/**
* indication of the syllable that carries word stress
* @type {number}
* @memberof ProsodyTargetDtoV2
*/
'stress'?: number;
}
export const ProsodyTargetDtoV2PauseEnum = {
prohibited: 'prohibited',
optional: 'optional',
mandatory: 'mandatory'
} as const;
export type ProsodyTargetDtoV2PauseEnum = typeof ProsodyTargetDtoV2PauseEnum[keyof typeof ProsodyTargetDtoV2PauseEnum];
export const ProsodyTargetDtoV2IntonationEnum = {
falling: 'falling',
rising: 'rising',
flat: 'flat'
} as const;
export type ProsodyTargetDtoV2IntonationEnum = typeof ProsodyTargetDtoV2IntonationEnum[keyof typeof ProsodyTargetDtoV2IntonationEnum];
/**
*
* @export
* @interface TokenPronunciationDtoV1
*/
export interface TokenPronunciationDtoV1 {
/**
* a single token detected from the input
* @type {string}
* @memberof TokenPronunciationDtoV1
*/
'token': string;
/**
* the expanded token, e.g. numbers are written as multiple words
* @type {string}
* @memberof TokenPronunciationDtoV1
*/
'expanded': string;
/**
* map of words and their pronunciation
* @type {Array<PronunciationDtoV1>}
* @memberof TokenPronunciationDtoV1
*/
'words': Array<PronunciationDtoV1>;
}
/**
*
* @export
* @interface TokenPronunciationDtoV2
*/
export interface TokenPronunciationDtoV2 {
/**
* a single token detected from the input
* @type {string}
* @memberof TokenPronunciationDtoV2
*/
'token': string;
/**
* the expanded token, e.g. numbers are written as multiple words
* @type {string}
* @memberof TokenPronunciationDtoV2
*/
'expanded': string;
/**
* map of words and their pronunciation
* @type {Array<PronunciationDtoV2>}
* @memberof TokenPronunciationDtoV2
*/
'words': Array<PronunciationDtoV2>;
}
/**
*
* @export
* @interface UpdateConfusionDtoV1
*/
export interface UpdateConfusionDtoV1 {
/**
*
* @type {string}
* @memberof UpdateConfusionDtoV1
*/
'description'?: string;
/**
*
* @type {Array<Array<string>>}
* @memberof UpdateConfusionDtoV1
*/
'confusion'?: Array<Array<string>>;
}
/**
*
* @export
* @interface WordPronunciationDtoV1
*/
export interface WordPronunciationDtoV1 {
/**
* A word
* @type {string}
* @memberof WordPronunciationDtoV1
*/
'word': string;
/**
* The closest correct pronunciation of the word
* @type {Array<PronunciationDtoV2CorrectPronunciations>}
* @memberof WordPronunciationDtoV1
*/
'pronunciation': Array<PronunciationDtoV2CorrectPronunciations>;
}
/**
* ConfusionApi - axios parameter creator
* @export
*/
export const ConfusionApiAxiosParamCreator = function (configuration?: Configuration) {
return {
/**
* Add a confusion rule for a language
* @param {string} lang
* @param {AddConfusionDtoV1} addConfusionDtoV1
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
addConfusionsV1: async (lang: string, addConfusionDtoV1: AddConfusionDtoV1, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
// verify required parameter 'lang' is not null or undefined
assertParamExists('addConfusionsV1', 'lang', lang)
// verify required parameter 'addConfusionDtoV1' is not null or undefined
assertParamExists('addConfusionsV1', 'addConfusionDtoV1', addConfusionDtoV1)
const localVarPath = `/v1/confusions/{lang}`
.replace(`{${"lang"}}`, encodeURIComponent(String(lang)));
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;
localVarHeaderParameter['Content-Type'] = 'application/json';
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
localVarRequestOptions.data = serializeDataIfNeeded(addConfusionDtoV1, localVarRequestOptions, configuration)
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
* Delete a confusion rule identified by a key for a language
* @param {string} lang
* @param {string} key
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
deleteConfusionsV1: async (lang: string, key: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
// verify required parameter 'lang' is not null or undefined
assertParamExists('deleteConfusionsV1', 'lang', lang)
// verify required parameter 'key' is not null or undefined
assertParamExists('deleteConfusionsV1', 'key', key)
const localVarPath = `/v1/confusions/{lang}/{key}`
.replace(`{${"lang"}}`, encodeURIComponent(String(lang)))
.replace(`{${"key"}}`, encodeURIComponent(String(key)));
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'DELETE', ...baseOptions, ...options};
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
* Get a list of confusions defined for a language
* @param {string} lang
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getConfusionsV1: async (lang: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
// verify required parameter 'lang' is not null or undefined
assertParamExists('getConfusionsV1', 'lang', lang)
const localVarPath = `/v1/confusions/{lang}`
.replace(`{${"lang"}}`, encodeURIComponent(String(lang)));
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
* Update a confusion rule identified by a key for a language
* @param {string} lang
* @param {string} key
* @param {UpdateConfusionDtoV1} updateConfusionDtoV1
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
updateConfusionsV1: async (lang: string, key: string, updateConfusionDtoV1: UpdateConfusionDtoV1, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
// verify required parameter 'lang' is not null or undefined
assertParamExists('updateConfusionsV1', 'lang', lang)
// verify required parameter 'key' is not null or undefined
assertParamExists('updateConfusionsV1', 'key', key)
// verify required parameter 'updateConfusionDtoV1' is not null or undefined
assertParamExists('updateConfusionsV1', 'updateConfusionDtoV1', updateConfusionDtoV1)
const localVarPath = `/v1/confusions/{lang}/{key}`
.replace(`{${"lang"}}`, encodeURIComponent(String(lang)))
.replace(`{${"key"}}`, encodeURIComponent(String(key)));
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'PATCH', ...baseOptions, ...options};
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;
localVarHeaderParameter['Content-Type'] = 'application/json';
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
localVarRequestOptions.data = serializeDataIfNeeded(updateConfusionDtoV1, localVarRequestOptions, configuration)
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
}
};
/**
* ConfusionApi - functional programming interface
* @export
*/
export const ConfusionApiFp = function(configuration?: Configuration) {
const localVarAxiosParamCreator = ConfusionApiAxiosParamCreator(configuration)
return {
/**
* Add a confusion rule for a language
* @param {string} lang
* @param {AddConfusionDtoV1} addConfusionDtoV1
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async addConfusionsV1(lang: string, addConfusionDtoV1: AddConfusionDtoV1, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ConfusionRuleDtoV1>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.addConfusionsV1(lang, addConfusionDtoV1, options);
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
},
/**
* Delete a confusion rule identified by a key for a language
* @param {string} lang
* @param {string} key
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async deleteConfusionsV1(lang: string, key: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.deleteConfusionsV1(lang, key, options);
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
},
/**
* Get a list of confusions defined for a language
* @param {string} lang
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async getConfusionsV1(lang: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<Array<ConfusionRuleDtoV1>>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.getConfusionsV1(lang, options);
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
},
/**
* Update a confusion rule identified by a key for a language
* @param {string} lang
* @param {string} key
* @param {UpdateConfusionDtoV1} updateConfusionDtoV1
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async updateConfusionsV1(lang: string, key: string, updateConfusionDtoV1: UpdateConfusionDtoV1, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ConfusionRuleDtoV1>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.updateConfusionsV1(lang, key, updateConfusionDtoV1, options);
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
},
}
};
/**
* ConfusionApi - factory interface
* @export
*/
export const ConfusionApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
const localVarFp = ConfusionApiFp(configuration)
return {
/**
* Add a confusion rule for a language
* @param {string} lang
* @param {AddConfusionDtoV1} addConfusionDtoV1
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
addConfusionsV1(lang: string, addConfusionDtoV1: AddConfusionDtoV1, options?: any): AxiosPromise<ConfusionRuleDtoV1> {
return localVarFp.addConfusionsV1(lang, addConfusionDtoV1, options).then((request) => request(axios, basePath));
},
/**
* Delete a confusion rule identified by a key for a language
* @param {string} lang
* @param {string} key
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
deleteConfusionsV1(lang: string, key: string, options?: any): AxiosPromise<void> {
return localVarFp.deleteConfusionsV1(lang, key, options).then((request) => request(axios, basePath));
},
/**
* Get a list of confusions defined for a language
* @param {string} lang
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getConfusionsV1(lang: string, options?: any): AxiosPromise<Array<ConfusionRuleDtoV1>> {
return localVarFp.getConfusionsV1(lang, options).then((request) => request(axios, basePath));
},
/**
* Update a confusion rule identified by a key for a language
* @param {string} lang
* @param {string} key
* @param {UpdateConfusionDtoV1} updateConfusionDtoV1
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
updateConfusionsV1(lang: string, key: string, updateConfusionDtoV1: UpdateConfusionDtoV1, options?: any): AxiosPromise<ConfusionRuleDtoV1> {
return localVarFp.updateConfusionsV1(lang, key, updateConfusionDtoV1, options).then((request) => request(axios, basePath));
},
};
};
/**
* ConfusionApi - object-oriented interface
* @export
* @class ConfusionApi
* @extends {BaseAPI}
*/
export class ConfusionApi extends BaseAPI {
/**
* Add a confusion rule for a language
* @param {string} lang
* @param {AddConfusionDtoV1} addConfusionDtoV1
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof ConfusionApi
*/
public addConfusionsV1(lang: string, addConfusionDtoV1: AddConfusionDtoV1, options?: AxiosRequestConfig) {
return ConfusionApiFp(this.configuration).addConfusionsV1(lang, addConfusionDtoV1, options).then((request) => request(this.axios, this.basePath));
}
/**
* Delete a confusion rule identified by a key for a language
* @param {string} lang
* @param {string} key
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof ConfusionApi
*/
public deleteConfusionsV1(lang: string, key: string, options?: AxiosRequestConfig) {
return ConfusionApiFp(this.configuration).deleteConfusionsV1(lang, key, options).then((request) => request(this.axios, this.basePath));
}
/**
* Get a list of confusions defined for a language
* @param {string} lang
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof ConfusionApi
*/
public getConfusionsV1(lang: string, options?: AxiosRequestConfig) {
return ConfusionApiFp(this.configuration).getConfusionsV1(lang, options).then((request) => request(this.axios, this.basePath));
}
/**
* Update a confusion rule identified by a key for a language
* @param {string} lang
* @param {string} key
* @param {UpdateConfusionDtoV1} updateConfusionDtoV1
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof ConfusionApi
*/
public updateConfusionsV1(lang: string, key: string, updateConfusionDtoV1: UpdateConfusionDtoV1, options?: AxiosRequestConfig) {
return ConfusionApiFp(this.configuration).updateConfusionsV1(lang, key, updateConfusionDtoV1, options).then((request) => request(this.axios, this.basePath));
}
}
/**
* MetadataApi - axios parameter creator
* @export
*/
export const MetadataApiAxiosParamCreator = function (configuration?: Configuration) {
return {
/**
* Get metadata for a list of words
* @param {MetadataRequestDtoV1} metadataRequestDtoV1
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getMetadataV1: async (metadataRequestDtoV1: MetadataRequestDtoV1, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
// verify required parameter 'metadataRequestDtoV1' is not null or undefined
assertParamExists('getMetadataV1', 'metadataRequestDtoV1', metadataRequestDtoV1)
const localVarPath = `/v1/metadata`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;
localVarHeaderParameter['Content-Type'] = 'application/json';
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
localVarRequestOptions.data = serializeDataIfNeeded(metadataRequestDtoV1, localVarRequestOptions, configuration)
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
* Get pronunciation metadata for a list of words
* @param {PronunciationMetadataRequestDtoV1} pronunciationMetadataRequestDtoV1
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getPronunciationMetadataV1: async (pronunciationMetadataRequestDtoV1: PronunciationMetadataRequestDtoV1, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
// verify required parameter 'pronunciationMetadataRequestDtoV1' is not null or undefined
assertParamExists('getPronunciationMetadataV1', 'pronunciationMetadataRequestDtoV1', pronunciationMetadataRequestDtoV1)
const localVarPath = `/v1/metadata/pronunciation`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;
localVarHeaderParameter['Content-Type'] = 'application/json';
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
localVarRequestOptions.data = serializeDataIfNeeded(pronunciationMetadataRequestDtoV1, localVarRequestOptions, configuration)
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
}
};
/**
* MetadataApi - functional programming interface
* @export
*/
export const MetadataApiFp = function(configuration?: Configuration) {
const localVarAxiosParamCreator = MetadataApiAxiosParamCreator(configuration)
return {
/**
* Get metadata for a list of words
* @param {MetadataRequestDtoV1} metadataRequestDtoV1
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async getMetadataV1(metadataRequestDtoV1: MetadataRequestDtoV1, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<Array<MetadataDtoV1>>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.getMetadataV1(metadataRequestDtoV1, options);
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
},
/**
* Get pronunciation metadata for a list of words
* @param {PronunciationMetadataRequestDtoV1} pronunciationMetadataRequestDtoV1
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async getPronunciationMetadataV1(pronunciationMetadataRequestDtoV1: PronunciationMetadataRequestDtoV1, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<Array<MetadataDtoV1>>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.getPronunciationMetadataV1(pronunciationMetadataRequestDtoV1, options);
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
},
}
};
/**
* MetadataApi - factory interface
* @export
*/
export const MetadataApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
const localVarFp = MetadataApiFp(configuration)
return {
/**
* Get metadata for a list of words
* @param {MetadataRequestDtoV1} metadataRequestDtoV1
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getMetadataV1(metadataRequestDtoV1: MetadataRequestDtoV1, options?: any): AxiosPromise<Array<MetadataDtoV1>> {
return localVarFp.getMetadataV1(metadataRequestDtoV1, options).then((request) => request(axios, basePath));
},
/**
* Get pronunciation metadata for a list of words
* @param {PronunciationMetadataRequestDtoV1} pronunciationMetadataRequestDtoV1
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getPronunciationMetadataV1(pronunciationMetadataRequestDtoV1: PronunciationMetadataRequestDtoV1, options?: any): AxiosPromise<Array<MetadataDtoV1>> {
return localVarFp.getPronunciationMetadataV1(pronunciationMetadataRequestDtoV1, options).then((request) => request(axios, basePath));
},
};
};
/**
* MetadataApi - object-oriented interface
* @export
* @class MetadataApi
* @extends {BaseAPI}
*/
export class MetadataApi extends BaseAPI {
/**
* Get metadata for a list of words
* @param {MetadataRequestDtoV1} metadataRequestDtoV1
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof MetadataApi
*/
public getMetadataV1(metadataRequestDtoV1: MetadataRequestDtoV1, options?: AxiosRequestConfig) {
return MetadataApiFp(this.configuration).getMetadataV1(metadataRequestDtoV1, options).then((request) => request(this.axios, this.basePath));
}
/**
* Get pronunciation metadata for a list of words
* @param {PronunciationMetadataRequestDtoV1} pronunciationMetadataRequestDtoV1
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof MetadataApi
*/
public getPronunciationMetadataV1(pronunciationMetadataRequestDtoV1: PronunciationMetadataRequestDtoV1, options?: AxiosRequestConfig) {
return MetadataApiFp(this.configuration).getPronunciationMetadataV1(pronunciationMetadataRequestDtoV1, options).then((request) => request(this.axios, this.basePath));
}
}
/**
* PronunciationApi - axios parameter creator
* @export
*/
export const PronunciationApiAxiosParamCreator = function (configuration?: Configuration) {
return {
/**
* Operation accepts a language and a phrase, which is separated by whitespaces, special characters need not be escaped
* @summary Get pronunciation for a phrase
* @param {PronunciationRequestDtoV1} pronunciationRequestDtoV1
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getPronunciationsV1: async (pronunciationRequestDtoV1: PronunciationRequestDtoV1, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
// verify required parameter 'pronunciationRequestDtoV1' is not null or undefined
assertParamExists('getPronunciationsV1', 'pronunciationRequestDtoV1', pronunciationRequestDtoV1)
const localVarPath = `/v1/pronunciations/g2p`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;
localVarHeaderParameter['Content-Type'] = 'application/json';
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
localVarRequestOptions.data = serializeDataIfNeeded(pronunciationRequestDtoV1, localVarRequestOptions, configuration)
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
* Operation accepts a language and a phrase, which is separated by whitespaces, special characters need not be escaped
* @summary Get pronunciation for a phrase
* @param {PronunciationRequestDtoV2} pronunciationRequestDtoV2
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getPronunciationsV2: async (pronunciationRequestDtoV2: PronunciationRequestDtoV2, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
// verify required parameter 'pronunciationRequestDtoV2' is not null or undefined
assertParamExists('getPronunciationsV2', 'pronunciationRequestDtoV2', pronunciationRequestDtoV2)
const localVarPath = `/v2/pronunciations/g2p`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;
localVarHeaderParameter['Content-Type'] = 'application/json';
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
localVarRequestOptions.data = serializeDataIfNeeded(pronunciationRequestDtoV2, localVarRequestOptions, configuration)
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
}
};
/**
* PronunciationApi - functional programming interface
* @export
*/
export const PronunciationApiFp = function(configuration?: Configuration) {
const localVarAxiosParamCreator = PronunciationApiAxiosParamCreator(configuration)
return {
/**
* Operation accepts a language and a phrase, which is separated by whitespaces, special characters need not be escaped
* @summary Get pronunciation for a phrase
* @param {PronunciationRequestDtoV1} pronunciationRequestDtoV1
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async getPronunciationsV1(pronunciationRequestDtoV1: PronunciationRequestDtoV1, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<PhrasePronunciationDtoV1>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.getPronunciationsV1(pronunciationRequestDtoV1, options);
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
},
/**
* Operation accepts a language and a phrase, which is separated by whitespaces, special characters need not be escaped
* @summary Get pronunciation for a phrase
* @param {PronunciationRequestDtoV2} pronunciationRequestDtoV2
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async getPronunciationsV2(pronunciationRequestDtoV2: PronunciationRequestDtoV2, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<PhrasePronunciationDtoV2>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.getPronunciationsV2(pronunciationRequestDtoV2, options);
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
},
}
};
/**
* PronunciationApi - factory interface
* @export
*/
export const PronunciationApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
const localVarFp = PronunciationApiFp(configuration)
return {
/**
* Operation accepts a language and a phrase, which is separated by whitespaces, special characters need not be escaped
* @summary Get pronunciation for a phrase
* @param {PronunciationRequestDtoV1} pronunciationRequestDtoV1
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getPronunciationsV1(pronunciationRequestDtoV1: PronunciationRequestDtoV1, options?: any): AxiosPromise<PhrasePronunciationDtoV1> {
return localVarFp.getPronunciationsV1(pronunciationRequestDtoV1, options).then((request) => request(axios, basePath));
},
/**
* Operation accepts a language and a phrase, which is separated by whitespaces, special characters need not be escaped
* @summary Get pronunciation for a phrase
* @param {PronunciationRequestDtoV2} pronunciationRequestDtoV2
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getPronunciationsV2(pronunciationRequestDtoV2: PronunciationRequestDtoV2, options?: any): AxiosPromise<PhrasePronunciationDtoV2> {
return localVarFp.getPronunciationsV2(pronunciationRequestDtoV2, options).then((request) => request(axios, basePath));
},
};
};
/**
* PronunciationApi - object-oriented interface
* @export
* @class PronunciationApi
* @extends {BaseAPI}
*/
export class PronunciationApi extends BaseAPI {
/**
* Operation accepts a language and a phrase, which is separated by whitespaces, special characters need not be escaped
* @summary Get pronunciation for a phrase
* @param {PronunciationRequestDtoV1} pronunciationRequestDtoV1
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof PronunciationApi
*/
public getPronunciationsV1(pronunciationRequestDtoV1: PronunciationRequestDtoV1, options?: AxiosRequestConfig) {
return PronunciationApiFp(this.configuration).getPronunciationsV1(pronunciationRequestDtoV1, options).then((request) => request(this.axios, this.basePath));
}
/**
* Operation accepts a language and a phrase, which is separated by whitespaces, special characters need not be escaped
* @summary Get pronunciation for a phrase
* @param {PronunciationRequestDtoV2} pronunciationRequestDtoV2
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof PronunciationApi
*/
public getPronunciationsV2(pronunciationRequestDtoV2: PronunciationRequestDtoV2, options?: AxiosRequestConfig) {
return PronunciationApiFp(this.configuration).getPronunciationsV2(pronunciationRequestDtoV2, options).then((request) => request(this.axios, this.basePath));
}
}