export type DeleteApiV1VoicesVoiceIdArgs = {voice_id: string}; export type DeleteApiV1VoicesVoiceIdOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * Delete Voice * * DELETE /v1/voices/{voice_id} */ export const deleteApiV1VoicesVoiceId = async (args: DeleteApiV1VoicesVoiceIdArgs, options: DeleteApiV1VoicesVoiceIdOptions) => { const {baseUrl, fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() const url = `${baseUrl.replace(/\/+$/, '')}/v1/voices/${encodeURIComponent(String(args.voice_id))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "DELETE", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };