export type DeleteApiConsultsV0ConsultConsultIdArgs = {consult_id: string}; export type DeleteApiConsultsV0ConsultConsultIdOptions = {baseUrl?: string | undefined, apiKey?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete Consult * * DELETE /consults/v0/consult/{consult_id} */ export const deleteApiConsultsV0ConsultConsultId = async (args: DeleteApiConsultsV0ConsultConsultIdArgs, options?: DeleteApiConsultsV0ConsultConsultIdOptions) => { const {baseUrl = "https://api.truepill.com", fetch: fetchFn = fetch, apiKey} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('accept', "*/*") if (apiKey !== undefined) headers.set("Authorization", apiKey) const url = `${baseUrl.replace(/\/+$/, '')}/consults/v0/consult/${encodeURIComponent(String(args.consult_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 res.blob() };