export type DeleteApiV1VoicesVoiceIdReferencesRefIdArgs = {voice_id: string, ref_id: number}; export type DeleteApiV1VoicesVoiceIdReferencesRefIdOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * Delete Voice Reference * * DELETE /v1/voices/{voice_id}/references/{ref_id} */ export const deleteApiV1VoicesVoiceIdReferencesRefId = async (args: DeleteApiV1VoicesVoiceIdReferencesRefIdArgs, options: DeleteApiV1VoicesVoiceIdReferencesRefIdOptions) => { 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))}/references/${encodeURIComponent(String(args.ref_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 };