export type DeleteApiMfV1ModelModelIDArgs = {modelID: number}; export type DeleteApiMfV1ModelModelIDOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete a Model in the given Model ID * * DELETE /mf/v1/model/{modelID} */ export const deleteApiMfV1ModelModelID = async (args: DeleteApiMfV1ModelModelIDArgs, options?: DeleteApiMfV1ModelModelIDOptions) => { const {baseUrl = "http://gateway.mlss.mf", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() const url = `${baseUrl.replace(/\/+$/, '')}/mf/v1/model/${encodeURIComponent(String(args.modelID))}${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 };