UNPKG

@novo-learning/novo-sdk

Version:

SDK for the Novolanguage Speech Analysis API

1,545 lines (1,481 loc) 46 kB
/* tslint:disable */ /* eslint-disable */ /** * Data API * The data API stores speech data and analysis results * * 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 AlignmentEntryDtoV1 */ export interface AlignmentEntryDtoV1 { /** * A deletion * @type {string} * @memberof AlignmentEntryDtoV1 */ deleted?: string; /** * An insertion * @type {string} * @memberof AlignmentEntryDtoV1 */ inserted?: string; } /** * * @export * @interface AsrRecognizedPhoneDtoV1 */ export interface AsrRecognizedPhoneDtoV1 { /** * The phone * @type {string} * @memberof AsrRecognizedPhoneDtoV1 */ phone: string; /** * The confidence of this phone * @type {ConfidenceDtoV1} * @memberof AsrRecognizedPhoneDtoV1 */ confidence?: ConfidenceDtoV1; } /** * * @export * @interface AttemptResponseDtoV1 */ export interface AttemptResponseDtoV1 { /** * Id of the attempt * @type {string} * @memberof AttemptResponseDtoV1 */ id: string; /** * Id of the user who made the attempt * @type {string} * @memberof AttemptResponseDtoV1 */ userId: string; /** * Id of the group to which the user who made the attempt belongs * @type {string} * @memberof AttemptResponseDtoV1 */ groupId?: string; /** * The analyzed result * @type {ExerciseResultDtoV1} * @memberof AttemptResponseDtoV1 */ exerciseResult: ExerciseResultDtoV1; /** * Identifier of the exercise * @type {string} * @memberof AttemptResponseDtoV1 */ exerciseId?: string; /** * The timestamp in UTC at which the attempt was made in ISO8601 format: YYYY-MM-DDThhmmss.sssZ * @type {string} * @memberof AttemptResponseDtoV1 */ dateTime: string; /** * Identifier for the audio of the attempt * @type {string} * @memberof AttemptResponseDtoV1 */ audioKey?: string; /** * If timeout message was sent * @type {boolean} * @memberof AttemptResponseDtoV1 */ timeout?: boolean; /** * The duration of the recording in milliseconds * @type {number} * @memberof AttemptResponseDtoV1 */ duration?: number; /** * Dictionary with meta data about the exercise, like an identifier for the goal of the exercise * @type {object} * @memberof AttemptResponseDtoV1 */ metadata?: object; } /** * * @export * @interface AttemptSummaryDto */ export interface AttemptSummaryDto { /** * The identifier of the attempt * @type {string} * @memberof AttemptSummaryDto */ id?: string; /** * The audio key needed to retrieve the recording * @type {string} * @memberof AttemptSummaryDto */ audioKey?: string; } /** * * @export * @interface AttemptsFilterDtoV1 */ export interface AttemptsFilterDtoV1 { /** * * @type {string} * @memberof AttemptsFilterDtoV1 */ publisherId?: string; /** * * @type {string} * @memberof AttemptsFilterDtoV1 */ groupId?: string; /** * * @type {string} * @memberof AttemptsFilterDtoV1 */ userId?: string; /** * * @type {boolean} * @memberof AttemptsFilterDtoV1 */ expired?: boolean; } /** * * @export * @interface ConfidenceDtoV1 */ export interface ConfidenceDtoV1 { /** * Likelihood-ratio * @type {number} * @memberof ConfidenceDtoV1 */ llr: number; /** * Probability * @type {number} * @memberof ConfidenceDtoV1 */ prob: number; } /** * * @export * @interface CreateAttemptDtoV1 */ export interface CreateAttemptDtoV1 { /** * Identifier used for retrieval of this attempt * @type {string} * @memberof CreateAttemptDtoV1 */ attemptId?: string; /** * The language * @type {string} * @memberof CreateAttemptDtoV1 */ language?: CreateAttemptDtoV1LanguageEnum; /** * The analyzed result * @type {ExerciseResultDtoV1} * @memberof CreateAttemptDtoV1 */ exerciseResult: ExerciseResultDtoV1; /** * Identifier of the exercise * @type {string} * @memberof CreateAttemptDtoV1 */ exerciseId?: string; /** * Identifier for the audio of the attempt; should start with publisherId_userId othewise this will be prepended * @type {string} * @memberof CreateAttemptDtoV1 */ audioKey?: string; /** * Indicates if a timeout was triggered * @type {boolean} * @memberof CreateAttemptDtoV1 */ timeout?: boolean; /** * * @type {number} * @memberof CreateAttemptDtoV1 */ duration?: number; /** * Dictionary with meta data about the exercise, like an identifier for the goal of the exercise * @type {object} * @memberof CreateAttemptDtoV1 */ metadata?: object; } export const CreateAttemptDtoV1LanguageEnum = { ar_idn: 'ar-idn', de: 'de', en: 'en', nl: 'nl', zh: 'zh', fr: 'fr', es: 'es', } as const; export type CreateAttemptDtoV1LanguageEnum = typeof CreateAttemptDtoV1LanguageEnum[keyof typeof CreateAttemptDtoV1LanguageEnum]; /** * * @export * @interface ExerciseResultDtoV1 */ export interface ExerciseResultDtoV1 { /** * The confidence score of the recognition result * @type {ConfidenceDtoV1} * @memberof ExerciseResultDtoV1 */ confidence?: ConfidenceDtoV1; /** * Has the exercise been completed correctly? * @type {boolean} * @memberof ExerciseResultDtoV1 */ correct?: boolean; /** * Has the exercise been completed correctly? * @type {object} * @memberof ExerciseResultDtoV1 */ correctness?: object; /** * The score * @type {ScoreDtoV1} * @memberof ExerciseResultDtoV1 */ score?: ScoreDtoV1; /** * The recognized words * @type {Array<WordRecognitionDtoV1>} * @memberof ExerciseResultDtoV1 */ recognized?: Array<WordRecognitionDtoV1>; /** * The recognized phrases * @type {Array<PhraseRecognitionDtoV1>} * @memberof ExerciseResultDtoV1 */ phrases?: Array<PhraseRecognitionDtoV1>; /** * Insertion, deletions and substitutions between the recognized and correct target * @type {Array<AlignmentEntryDtoV1>} * @memberof ExerciseResultDtoV1 */ alignment?: Array<AlignmentEntryDtoV1>; /** * The word features * @type {Array<WordFeatureDtoV1>} * @memberof ExerciseResultDtoV1 */ wordFeatures?: Array<WordFeatureDtoV1>; /** * A summary of the stored attempt * @type {AttemptSummaryDto} * @memberof ExerciseResultDtoV1 */ attempt?: AttemptSummaryDto; /** * Indicates if speech has been detected in the audio * @type {boolean} * @memberof ExerciseResultDtoV1 */ speechDetected?: boolean; /** * Identifier of the exercise * @type {string} * @memberof ExerciseResultDtoV1 */ exerciseId?: string; /** * The prompt or recognised choice * @type {string} * @memberof ExerciseResultDtoV1 */ phrase?: string; /** * The timestamp in UTC at which the attempt was made in ISO8601 format: YYYY-MM-DDThhmmss.sssZ * @type {string} * @memberof ExerciseResultDtoV1 */ respondedAt?: string; } /** * * @export * @interface FileUploadResultDtoV1 */ export interface FileUploadResultDtoV1 { /** * File id * @type {string} * @memberof FileUploadResultDtoV1 */ id: string; } /** * * @export * @interface InlineObject2 */ export interface InlineObject2 { /** * * @type {string} * @memberof InlineObject2 */ publisherId: string; /** * * @type {number} * @memberof InlineObject2 */ offset?: number; /** * * @type {number} * @memberof InlineObject2 */ limit?: number; /** * * @type {object} * @memberof InlineObject2 */ filter?: object; } /** * * @export * @interface LetterAlignmentDtoV1 */ export interface LetterAlignmentDtoV1 { /** * A letter in a word * @type {string} * @memberof LetterAlignmentDtoV1 */ letter: string; /** * The phones in a pronunciation corresponding to the letter * @type {Array<string>} * @memberof LetterAlignmentDtoV1 */ phones: Array<string>; /** * Is the letter pronounced correctly? * @type {boolean} * @memberof LetterAlignmentDtoV1 */ correct: boolean; } /** * * @export * @interface PhoneRecognitionDtoV1 */ export interface PhoneRecognitionDtoV1 { /** * The interval in the audio for this word * @type {TimingDtoV1} * @memberof PhoneRecognitionDtoV1 */ timing?: TimingDtoV1; /** * The target phone recognition result * @type {AsrRecognizedPhoneDtoV1} * @memberof PhoneRecognitionDtoV1 */ target?: AsrRecognizedPhoneDtoV1; /** * The recognized phone * @type {AsrRecognizedPhoneDtoV1} * @memberof PhoneRecognitionDtoV1 */ recognized: AsrRecognizedPhoneDtoV1; /** * Is the phone correctly uttered? * @type {boolean} * @memberof PhoneRecognitionDtoV1 */ correct?: boolean; /** * Is the phone correctly uttered? * @type {object} * @memberof PhoneRecognitionDtoV1 */ correctness?: object; } /** * * @export * @interface PhraseRecognitionDtoV1 */ export interface PhraseRecognitionDtoV1 { /** * The interval in the audio for this phrase * @type {TimingDtoV1} * @memberof PhraseRecognitionDtoV1 */ timing?: TimingDtoV1; /** * The recognized text * @type {string} * @memberof PhraseRecognitionDtoV1 */ phrase: string; /** * Does the utterence match the text? * @type {boolean} * @memberof PhraseRecognitionDtoV1 */ correct?: boolean; /** * Is the pronunciation correct? * @type {object} * @memberof PhraseRecognitionDtoV1 */ correctness?: object; /** * The recognized words * @type {Array<WordRecognitionDtoV1>} * @memberof PhraseRecognitionDtoV1 */ words: Array<WordRecognitionDtoV1>; } /** * * @export * @interface ScoreDtoV1 */ export interface ScoreDtoV1 { /** * The accuracy * @type {number} * @memberof ScoreDtoV1 */ accuracy?: number; /** * The fluency * @type {number} * @memberof ScoreDtoV1 */ fluency?: number; /** * The velocity * @type {number} * @memberof ScoreDtoV1 */ velocity?: number; } /** * * @export * @interface TimingDtoV1 */ export interface TimingDtoV1 { /** * Position in milliseconds within the audio stream where the word begins * @type {number} * @memberof TimingDtoV1 */ begin: number; /** * Position in milliseconds within the audio stream where the word ends * @type {number} * @memberof TimingDtoV1 */ end: number; } /** * * @export * @interface UpdateAttemptDtoV1 */ export interface UpdateAttemptDtoV1 { /** * The analyzed result * @type {ExerciseResultDtoV1} * @memberof UpdateAttemptDtoV1 */ exerciseResult: ExerciseResultDtoV1; /** * Identifier of the exercise * @type {string} * @memberof UpdateAttemptDtoV1 */ exerciseId?: string; /** * Identifier for the audio of the attempt * @type {string} * @memberof UpdateAttemptDtoV1 */ audioKey?: string; /** * Indicates if a timeout was triggered * @type {boolean} * @memberof UpdateAttemptDtoV1 */ timeout?: boolean; /** * * @type {number} * @memberof UpdateAttemptDtoV1 */ duration?: number; } /** * * @export * @interface WordFeatureDtoV1 */ export interface WordFeatureDtoV1 { /** * Identifier for the word feature * @type {string} * @memberof WordFeatureDtoV1 */ id: string; /** * Category identifier for the word feature * @type {string} * @memberof WordFeatureDtoV1 */ categoryId?: string; /** * Have the phones on which the word feature focusses been uttered correctly? * @type {boolean} * @memberof WordFeatureDtoV1 */ correct: boolean; /** * For each letter of the word whether it is used in the evaluation of the word feature * @type {Array<WordFeatureLetterDtoV1>} * @memberof WordFeatureDtoV1 */ letters?: Array<WordFeatureLetterDtoV1>; } /** * * @export * @interface WordFeatureLetterDtoV1 */ export interface WordFeatureLetterDtoV1 { /** * Letter of a word * @type {string} * @memberof WordFeatureLetterDtoV1 */ letter: string; /** * Indicates if the letter is used in the evaluation of the word feature * @type {boolean} * @memberof WordFeatureLetterDtoV1 */ part: boolean; } /** * * @export * @interface WordRecognitionDtoV1 */ export interface WordRecognitionDtoV1 { /** * The interval in the audio for this word * @type {TimingDtoV1} * @memberof WordRecognitionDtoV1 */ timing?: TimingDtoV1; /** * The recognized text * @type {string} * @memberof WordRecognitionDtoV1 */ word: string; /** * Does the utterence match the text? * @type {boolean} * @memberof WordRecognitionDtoV1 */ correct?: boolean; /** * Is the word pronounced correctly? * @type {object} * @memberof WordRecognitionDtoV1 */ correctness?: object; /** * The confidence of this phone * @type {ConfidenceDtoV1} * @memberof WordRecognitionDtoV1 */ confidence?: ConfidenceDtoV1; /** * The score * @type {ScoreDtoV1} * @memberof WordRecognitionDtoV1 */ score?: ScoreDtoV1; /** * The recognized phonemes * @type {Array<PhoneRecognitionDtoV1>} * @memberof WordRecognitionDtoV1 */ phones?: Array<PhoneRecognitionDtoV1>; /** * Insertion, deletions and substitutions between the recognized and closest correct target * @type {Array<AlignmentEntryDtoV1>} * @memberof WordRecognitionDtoV1 */ alignment?: Array<AlignmentEntryDtoV1>; /** * The token in the prompt which corresponds to this word * @type {string} * @memberof WordRecognitionDtoV1 */ promptToken?: string; /** * The alignment between letters and phones * @type {Array<LetterAlignmentDtoV1>} * @memberof WordRecognitionDtoV1 */ letterAlignment?: Array<LetterAlignmentDtoV1>; /** * Evaluation of the word features * @type {Array<WordFeatureDtoV1>} * @memberof WordRecognitionDtoV1 */ wordFeatures?: Array<WordFeatureDtoV1>; } /** * AttemptsApi - axios parameter creator * @export */ export const AttemptsApiAxiosParamCreator = function (configuration?: Configuration) { return { /** * Create an attempt * @param {string} [attempt] * @param {any} [audio] * @param {*} [options] Override http request option. * @throws {RequiredError} */ createAttempt: async (attempt?: string, audio?: any, options: AxiosRequestConfig = {}): Promise<RequestArgs> => { const localVarPath = `/v1/attempts`; // 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; const localVarFormParams = new ((configuration && configuration.formDataCtor) || FormData)(); if (attempt !== undefined) { localVarFormParams.append('attempt', attempt as any); } if (audio !== undefined) { localVarFormParams.append( 'audio', audio as any, 'audio', ); /*added by postprocessor, see https://maximorlov.com/send-a-file-with-axios-in-nodejs/ */ } localVarHeaderParameter['Content-Type'] = 'multipart/form-data'; setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers, ...localVarFormParams.getHeaders() /*added by postprocessor, see https://github.com/OpenAPITools/openapi-generator/issues/8002/ */, }; localVarRequestOptions.data = localVarFormParams; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Delete many attempts * @param {AttemptsFilterDtoV1} attemptsFilterDtoV1 * @param {*} [options] Override http request option. * @throws {RequiredError} */ deleteAttempts: async ( attemptsFilterDtoV1: AttemptsFilterDtoV1, options: AxiosRequestConfig = {}, ): Promise<RequestArgs> => { // verify required parameter 'attemptsFilterDtoV1' is not null or undefined assertParamExists('deleteAttempts', 'attemptsFilterDtoV1', attemptsFilterDtoV1); const localVarPath = `/v1/attempts/delete`; // 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(attemptsFilterDtoV1, localVarRequestOptions, configuration); return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Download many attempts for analysis * @param {InlineObject2} inlineObject2 * @param {*} [options] Override http request option. * @throws {RequiredError} */ downloadAttempts: async (inlineObject2: InlineObject2, options: AxiosRequestConfig = {}): Promise<RequestArgs> => { // verify required parameter 'inlineObject2' is not null or undefined assertParamExists('downloadAttempts', 'inlineObject2', inlineObject2); const localVarPath = `/v1/attempts/download`; // 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(inlineObject2, localVarRequestOptions, configuration); return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Get an attempt * @param {string} id * @param {*} [options] Override http request option. * @throws {RequiredError} */ getAttempt: async (id: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => { // verify required parameter 'id' is not null or undefined assertParamExists('getAttempt', 'id', id); const localVarPath = `/v1/attempts/{id}`.replace(`{${'id'}}`, encodeURIComponent(String(id))); // 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, }; }, /** * Get a list of attempts * @param {string} [publisherId] * @param {string} [groupId] * @param {string} [userId] * @param {boolean} [expired] Filter on being expired * @param {*} [options] Override http request option. * @throws {RequiredError} */ getAttempts: async ( publisherId?: string, groupId?: string, userId?: string, expired?: boolean, options: AxiosRequestConfig = {}, ): Promise<RequestArgs> => { const localVarPath = `/v1/attempts`; // 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; if (publisherId !== undefined) { localVarQueryParameter['publisherId'] = publisherId; } if (groupId !== undefined) { localVarQueryParameter['groupId'] = groupId; } if (userId !== undefined) { localVarQueryParameter['userId'] = userId; } if (expired !== undefined) { localVarQueryParameter['expired'] = expired; } setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers }; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Remove an attempt * @param {string} id * @param {*} [options] Override http request option. * @throws {RequiredError} */ removeAttempt: async (id: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => { // verify required parameter 'id' is not null or undefined assertParamExists('removeAttempt', 'id', id); const localVarPath = `/v1/attempts/{id}`.replace(`{${'id'}}`, encodeURIComponent(String(id))); // 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, }; }, /** * Update an attempt * @param {string} id * @param {UpdateAttemptDtoV1} updateAttemptDtoV1 * @param {*} [options] Override http request option. * @throws {RequiredError} */ updateAttempt: async ( id: string, updateAttemptDtoV1: UpdateAttemptDtoV1, options: AxiosRequestConfig = {}, ): Promise<RequestArgs> => { // verify required parameter 'id' is not null or undefined assertParamExists('updateAttempt', 'id', id); // verify required parameter 'updateAttemptDtoV1' is not null or undefined assertParamExists('updateAttempt', 'updateAttemptDtoV1', updateAttemptDtoV1); const localVarPath = `/v1/attempts/{id}`.replace(`{${'id'}}`, encodeURIComponent(String(id))); // 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(updateAttemptDtoV1, localVarRequestOptions, configuration); return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, }; }; /** * AttemptsApi - functional programming interface * @export */ export const AttemptsApiFp = function (configuration?: Configuration) { const localVarAxiosParamCreator = AttemptsApiAxiosParamCreator(configuration); return { /** * Create an attempt * @param {string} [attempt] * @param {any} [audio] * @param {*} [options] Override http request option. * @throws {RequiredError} */ async createAttempt( attempt?: string, audio?: any, options?: AxiosRequestConfig, ): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<AttemptResponseDtoV1>> { const localVarAxiosArgs = await localVarAxiosParamCreator.createAttempt(attempt, audio, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * Delete many attempts * @param {AttemptsFilterDtoV1} attemptsFilterDtoV1 * @param {*} [options] Override http request option. * @throws {RequiredError} */ async deleteAttempts( attemptsFilterDtoV1: AttemptsFilterDtoV1, options?: AxiosRequestConfig, ): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>> { const localVarAxiosArgs = await localVarAxiosParamCreator.deleteAttempts(attemptsFilterDtoV1, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * Download many attempts for analysis * @param {InlineObject2} inlineObject2 * @param {*} [options] Override http request option. * @throws {RequiredError} */ async downloadAttempts( inlineObject2: InlineObject2, options?: AxiosRequestConfig, ): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<Array<AttemptResponseDtoV1>>> { const localVarAxiosArgs = await localVarAxiosParamCreator.downloadAttempts(inlineObject2, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * Get an attempt * @param {string} id * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getAttempt( id: string, options?: AxiosRequestConfig, ): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<AttemptResponseDtoV1>> { const localVarAxiosArgs = await localVarAxiosParamCreator.getAttempt(id, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * Get a list of attempts * @param {string} [publisherId] * @param {string} [groupId] * @param {string} [userId] * @param {boolean} [expired] Filter on being expired * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getAttempts( publisherId?: string, groupId?: string, userId?: string, expired?: boolean, options?: AxiosRequestConfig, ): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<Array<AttemptResponseDtoV1>>> { const localVarAxiosArgs = await localVarAxiosParamCreator.getAttempts( publisherId, groupId, userId, expired, options, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * Remove an attempt * @param {string} id * @param {*} [options] Override http request option. * @throws {RequiredError} */ async removeAttempt( id: string, options?: AxiosRequestConfig, ): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>> { const localVarAxiosArgs = await localVarAxiosParamCreator.removeAttempt(id, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * Update an attempt * @param {string} id * @param {UpdateAttemptDtoV1} updateAttemptDtoV1 * @param {*} [options] Override http request option. * @throws {RequiredError} */ async updateAttempt( id: string, updateAttemptDtoV1: UpdateAttemptDtoV1, options?: AxiosRequestConfig, ): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<AttemptResponseDtoV1>> { const localVarAxiosArgs = await localVarAxiosParamCreator.updateAttempt(id, updateAttemptDtoV1, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, }; }; /** * AttemptsApi - factory interface * @export */ export const AttemptsApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { const localVarFp = AttemptsApiFp(configuration); return { /** * Create an attempt * @param {string} [attempt] * @param {any} [audio] * @param {*} [options] Override http request option. * @throws {RequiredError} */ createAttempt(attempt?: string, audio?: any, options?: any): AxiosPromise<AttemptResponseDtoV1> { return localVarFp.createAttempt(attempt, audio, options).then((request) => request(axios, basePath)); }, /** * Delete many attempts * @param {AttemptsFilterDtoV1} attemptsFilterDtoV1 * @param {*} [options] Override http request option. * @throws {RequiredError} */ deleteAttempts(attemptsFilterDtoV1: AttemptsFilterDtoV1, options?: any): AxiosPromise<void> { return localVarFp.deleteAttempts(attemptsFilterDtoV1, options).then((request) => request(axios, basePath)); }, /** * Download many attempts for analysis * @param {InlineObject2} inlineObject2 * @param {*} [options] Override http request option. * @throws {RequiredError} */ downloadAttempts(inlineObject2: InlineObject2, options?: any): AxiosPromise<Array<AttemptResponseDtoV1>> { return localVarFp.downloadAttempts(inlineObject2, options).then((request) => request(axios, basePath)); }, /** * Get an attempt * @param {string} id * @param {*} [options] Override http request option. * @throws {RequiredError} */ getAttempt(id: string, options?: any): AxiosPromise<AttemptResponseDtoV1> { return localVarFp.getAttempt(id, options).then((request) => request(axios, basePath)); }, /** * Get a list of attempts * @param {string} [publisherId] * @param {string} [groupId] * @param {string} [userId] * @param {boolean} [expired] Filter on being expired * @param {*} [options] Override http request option. * @throws {RequiredError} */ getAttempts( publisherId?: string, groupId?: string, userId?: string, expired?: boolean, options?: any, ): AxiosPromise<Array<AttemptResponseDtoV1>> { return localVarFp .getAttempts(publisherId, groupId, userId, expired, options) .then((request) => request(axios, basePath)); }, /** * Remove an attempt * @param {string} id * @param {*} [options] Override http request option. * @throws {RequiredError} */ removeAttempt(id: string, options?: any): AxiosPromise<void> { return localVarFp.removeAttempt(id, options).then((request) => request(axios, basePath)); }, /** * Update an attempt * @param {string} id * @param {UpdateAttemptDtoV1} updateAttemptDtoV1 * @param {*} [options] Override http request option. * @throws {RequiredError} */ updateAttempt( id: string, updateAttemptDtoV1: UpdateAttemptDtoV1, options?: any, ): AxiosPromise<AttemptResponseDtoV1> { return localVarFp.updateAttempt(id, updateAttemptDtoV1, options).then((request) => request(axios, basePath)); }, }; }; /** * AttemptsApi - object-oriented interface * @export * @class AttemptsApi * @extends {BaseAPI} */ export class AttemptsApi extends BaseAPI { /** * Create an attempt * @param {string} [attempt] * @param {any} [audio] * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof AttemptsApi */ public createAttempt(attempt?: string, audio?: any, options?: AxiosRequestConfig) { return AttemptsApiFp(this.configuration) .createAttempt(attempt, audio, options) .then((request) => request(this.axios, this.basePath)); } /** * Delete many attempts * @param {AttemptsFilterDtoV1} attemptsFilterDtoV1 * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof AttemptsApi */ public deleteAttempts(attemptsFilterDtoV1: AttemptsFilterDtoV1, options?: AxiosRequestConfig) { return AttemptsApiFp(this.configuration) .deleteAttempts(attemptsFilterDtoV1, options) .then((request) => request(this.axios, this.basePath)); } /** * Download many attempts for analysis * @param {InlineObject2} inlineObject2 * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof AttemptsApi */ public downloadAttempts(inlineObject2: InlineObject2, options?: AxiosRequestConfig) { return AttemptsApiFp(this.configuration) .downloadAttempts(inlineObject2, options) .then((request) => request(this.axios, this.basePath)); } /** * Get an attempt * @param {string} id * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof AttemptsApi */ public getAttempt(id: string, options?: AxiosRequestConfig) { return AttemptsApiFp(this.configuration) .getAttempt(id, options) .then((request) => request(this.axios, this.basePath)); } /** * Get a list of attempts * @param {string} [publisherId] * @param {string} [groupId] * @param {string} [userId] * @param {boolean} [expired] Filter on being expired * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof AttemptsApi */ public getAttempts( publisherId?: string, groupId?: string, userId?: string, expired?: boolean, options?: AxiosRequestConfig, ) { return AttemptsApiFp(this.configuration) .getAttempts(publisherId, groupId, userId, expired, options) .then((request) => request(this.axios, this.basePath)); } /** * Remove an attempt * @param {string} id * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof AttemptsApi */ public removeAttempt(id: string, options?: AxiosRequestConfig) { return AttemptsApiFp(this.configuration) .removeAttempt(id, options) .then((request) => request(this.axios, this.basePath)); } /** * Update an attempt * @param {string} id * @param {UpdateAttemptDtoV1} updateAttemptDtoV1 * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof AttemptsApi */ public updateAttempt(id: string, updateAttemptDtoV1: UpdateAttemptDtoV1, options?: AxiosRequestConfig) { return AttemptsApiFp(this.configuration) .updateAttempt(id, updateAttemptDtoV1, options) .then((request) => request(this.axios, this.basePath)); } } /** * FilesApi - axios parameter creator * @export */ export const FilesApiAxiosParamCreator = function (configuration?: Configuration) { return { /** * Delete a file * @param {string} id * @param {*} [options] Override http request option. * @throws {RequiredError} */ deleteFile: async (id: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => { // verify required parameter 'id' is not null or undefined assertParamExists('deleteFile', 'id', id); const localVarPath = `/v1/files/{id}`.replace(`{${'id'}}`, encodeURIComponent(String(id))); // 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, }; }, /** * Download a file * @param {string} id * @param {*} [options] Override http request option. * @throws {RequiredError} */ downloadFile: async (id: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => { // verify required parameter 'id' is not null or undefined assertParamExists('downloadFile', 'id', id); const localVarPath = `/v1/files/{id}`.replace(`{${'id'}}`, encodeURIComponent(String(id))); // 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, }; }, /** * Upload a file (audio) to secure storage * @param {any} [file] * @param {*} [options] Override http request option. * @throws {RequiredError} */ uploadFile: async (file?: any, options: AxiosRequestConfig = {}): Promise<RequestArgs> => { const localVarPath = `/v1/files`; // 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; const localVarFormParams = new ((configuration && configuration.formDataCtor) || FormData)(); if (file !== undefined) { localVarFormParams.append('file', file as any); } localVarHeaderParameter['Content-Type'] = 'multipart/form-data'; setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers }; localVarRequestOptions.data = localVarFormParams; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, }; }; /** * FilesApi - functional programming interface * @export */ export const FilesApiFp = function (configuration?: Configuration) { const localVarAxiosParamCreator = FilesApiAxiosParamCreator(configuration); return { /** * Delete a file * @param {string} id * @param {*} [options] Override http request option. * @throws {RequiredError} */ async deleteFile( id: string, options?: AxiosRequestConfig, ): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>> { const localVarAxiosArgs = await localVarAxiosParamCreator.deleteFile(id, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * Download a file * @param {string} id * @param {*} [options] Override http request option. * @throws {RequiredError} */ async downloadFile( id: string, options?: AxiosRequestConfig, ): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<object>> { const localVarAxiosArgs = await localVarAxiosParamCreator.downloadFile(id, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * Upload a file (audio) to secure storage * @param {any} [file] * @param {*} [options] Override http request option. * @throws {RequiredError} */ async uploadFile( file?: any, options?: AxiosRequestConfig, ): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<FileUploadResultDtoV1>> { const localVarAxiosArgs = await localVarAxiosParamCreator.uploadFile(file, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, }; }; /** * FilesApi - factory interface * @export */ export const FilesApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { const localVarFp = FilesApiFp(configuration); return { /** * Delete a file * @param {string} id * @param {*} [options] Override http request option. * @throws {RequiredError} */ deleteFile(id: string, options?: any): AxiosPromise<void> { return localVarFp.deleteFile(id, options).then((request) => request(axios, basePath)); }, /** * Download a file * @param {string} id * @param {*} [options] Override http request option. * @throws {RequiredError} */ downloadFile(id: string, options?: any): AxiosPromise<object> { return localVarFp.downloadFile(id, options).then((request) => request(axios, basePath)); }, /** * Upload a file (audio) to secure storage * @param {any} [file] * @param {*} [options] Override http request option. * @throws {RequiredError} */ uploadFile(file?: any, options?: any): AxiosPromise<FileUploadResultDtoV1> { return localVarFp.uploadFile(file, options).then((request) => request(axios, basePath)); }, }; }; /** * FilesApi - object-oriented interface * @export * @class FilesApi * @extends {BaseAPI} */ export class FilesApi extends BaseAPI { /** * Delete a file * @param {string} id * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof FilesApi */ public deleteFile(id: string, options?: AxiosRequestConfig) { return FilesApiFp(this.configuration) .deleteFile(id, options) .then((request) => request(this.axios, this.basePath)); } /** * Download a file * @param {string} id * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof FilesApi */ public downloadFile(id: string, options?: AxiosRequestConfig) { return FilesApiFp(this.configuration) .downloadFile(id, options) .then((request) => request(this.axios, this.basePath)); } /** * Upload a file (audio) to secure storage * @param {any} [file] * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof FilesApi */ public uploadFile(file?: any, options?: AxiosRequestConfig) { return FilesApiFp(this.configuration) .uploadFile(file, options) .then((request) => request(this.axios, this.basePath)); } }