From c959ce981e5935edccca6fa12c646fbecb6397d0 Mon Sep 17 00:00:00 2001 From: Mathieu Virbel Date: Tue, 29 Aug 2023 11:19:46 +0200 Subject: [PATCH] www: update openapi --- www/app/api/.openapi-generator/FILES | 1 + www/app/api/apis/DefaultApi.ts | 68 ++++++++++++++++++++++++++ www/app/api/models/AudioWaveform.ts | 66 +++++++++++++++++++++++++ www/app/api/models/CreateTranscript.ts | 20 ++++++++ www/app/api/models/GetTranscript.ts | 18 +++++++ www/app/api/models/index.ts | 1 + 6 files changed, 174 insertions(+) create mode 100644 www/app/api/models/AudioWaveform.ts diff --git a/www/app/api/.openapi-generator/FILES b/www/app/api/.openapi-generator/FILES index 91888ece..16763a8d 100644 --- a/www/app/api/.openapi-generator/FILES +++ b/www/app/api/.openapi-generator/FILES @@ -1,6 +1,7 @@ apis/DefaultApi.ts apis/index.ts index.ts +models/AudioWaveform.ts models/CreateTranscript.ts models/DeletionStatus.ts models/GetTranscript.ts diff --git a/www/app/api/apis/DefaultApi.ts b/www/app/api/apis/DefaultApi.ts index 7fdc25da..33aee151 100644 --- a/www/app/api/apis/DefaultApi.ts +++ b/www/app/api/apis/DefaultApi.ts @@ -14,6 +14,7 @@ import * as runtime from "../runtime"; import type { + AudioWaveform, CreateTranscript, DeletionStatus, GetTranscript, @@ -23,6 +24,8 @@ import type { UpdateTranscript, } from "../models"; import { + AudioWaveformFromJSON, + AudioWaveformToJSON, CreateTranscriptFromJSON, CreateTranscriptToJSON, DeletionStatusFromJSON, @@ -59,6 +62,10 @@ export interface V1TranscriptGetAudioMp3Request { transcriptId: any; } +export interface V1TranscriptGetAudioWaveformRequest { + transcriptId: any; +} + export interface V1TranscriptGetTopicsRequest { transcriptId: any; } @@ -390,6 +397,67 @@ export class DefaultApi extends runtime.BaseAPI { return await response.value(); } + /** + * Transcript Get Audio Waveform + */ + async v1TranscriptGetAudioWaveformRaw( + requestParameters: V1TranscriptGetAudioWaveformRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise> { + if ( + requestParameters.transcriptId === null || + requestParameters.transcriptId === undefined + ) { + throw new runtime.RequiredError( + "transcriptId", + "Required parameter requestParameters.transcriptId was null or undefined when calling v1TranscriptGetAudioWaveform.", + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken( + "OAuth2AuthorizationCodeBearer", + [], + ); + } + + const response = await this.request( + { + path: `/v1/transcripts/{transcript_id}/audio/waveform`.replace( + `{${"transcript_id"}}`, + encodeURIComponent(String(requestParameters.transcriptId)), + ), + method: "GET", + headers: headerParameters, + query: queryParameters, + }, + initOverrides, + ); + + return new runtime.JSONApiResponse(response, (jsonValue) => + AudioWaveformFromJSON(jsonValue), + ); + } + + /** + * Transcript Get Audio Waveform + */ + async v1TranscriptGetAudioWaveform( + requestParameters: V1TranscriptGetAudioWaveformRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise { + const response = await this.v1TranscriptGetAudioWaveformRaw( + requestParameters, + initOverrides, + ); + return await response.value(); + } + /** * Transcript Get Topics */ diff --git a/www/app/api/models/AudioWaveform.ts b/www/app/api/models/AudioWaveform.ts new file mode 100644 index 00000000..0cc5da1f --- /dev/null +++ b/www/app/api/models/AudioWaveform.ts @@ -0,0 +1,66 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * FastAPI + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.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 { exists, mapValues } from "../runtime"; +/** + * + * @export + * @interface AudioWaveform + */ +export interface AudioWaveform { + /** + * + * @type {any} + * @memberof AudioWaveform + */ + data: any | null; +} + +/** + * Check if a given object implements the AudioWaveform interface. + */ +export function instanceOfAudioWaveform(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "data" in value; + + return isInstance; +} + +export function AudioWaveformFromJSON(json: any): AudioWaveform { + return AudioWaveformFromJSONTyped(json, false); +} + +export function AudioWaveformFromJSONTyped( + json: any, + ignoreDiscriminator: boolean, +): AudioWaveform { + if (json === undefined || json === null) { + return json; + } + return { + data: json["data"], + }; +} + +export function AudioWaveformToJSON(value?: AudioWaveform | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + data: value.data, + }; +} diff --git a/www/app/api/models/CreateTranscript.ts b/www/app/api/models/CreateTranscript.ts index 6e49a9c6..365e5761 100644 --- a/www/app/api/models/CreateTranscript.ts +++ b/www/app/api/models/CreateTranscript.ts @@ -25,6 +25,18 @@ export interface CreateTranscript { * @memberof CreateTranscript */ name: any | null; + /** + * + * @type {any} + * @memberof CreateTranscript + */ + sourceLanguage?: any | null; + /** + * + * @type {any} + * @memberof CreateTranscript + */ + targetLanguage?: any | null; } /** @@ -50,6 +62,12 @@ export function CreateTranscriptFromJSONTyped( } return { name: json["name"], + sourceLanguage: !exists(json, "source_language") + ? undefined + : json["source_language"], + targetLanguage: !exists(json, "target_language") + ? undefined + : json["target_language"], }; } @@ -62,5 +80,7 @@ export function CreateTranscriptToJSON(value?: CreateTranscript | null): any { } return { name: value.name, + source_language: value.sourceLanguage, + target_language: value.targetLanguage, }; } diff --git a/www/app/api/models/GetTranscript.ts b/www/app/api/models/GetTranscript.ts index 5f242956..4020617f 100644 --- a/www/app/api/models/GetTranscript.ts +++ b/www/app/api/models/GetTranscript.ts @@ -61,6 +61,18 @@ export interface GetTranscript { * @memberof GetTranscript */ createdAt: any | null; + /** + * + * @type {any} + * @memberof GetTranscript + */ + sourceLanguage: any | null; + /** + * + * @type {any} + * @memberof GetTranscript + */ + targetLanguage: any | null; } /** @@ -75,6 +87,8 @@ export function instanceOfGetTranscript(value: object): boolean { isInstance = isInstance && "duration" in value; isInstance = isInstance && "summary" in value; isInstance = isInstance && "createdAt" in value; + isInstance = isInstance && "sourceLanguage" in value; + isInstance = isInstance && "targetLanguage" in value; return isInstance; } @@ -98,6 +112,8 @@ export function GetTranscriptFromJSONTyped( duration: json["duration"], summary: json["summary"], createdAt: json["created_at"], + sourceLanguage: json["source_language"], + targetLanguage: json["target_language"], }; } @@ -116,5 +132,7 @@ export function GetTranscriptToJSON(value?: GetTranscript | null): any { duration: value.duration, summary: value.summary, created_at: value.createdAt, + source_language: value.sourceLanguage, + target_language: value.targetLanguage, }; } diff --git a/www/app/api/models/index.ts b/www/app/api/models/index.ts index d872c782..99874641 100644 --- a/www/app/api/models/index.ts +++ b/www/app/api/models/index.ts @@ -1,5 +1,6 @@ /* tslint:disable */ /* eslint-disable */ +export * from "./AudioWaveform"; export * from "./CreateTranscript"; export * from "./DeletionStatus"; export * from "./GetTranscript";