export type DeleteApiMfV1ImageImageIdArgs = {image_id: number}; export type DeleteApiMfV1ImageImageIdOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete the Image in given image id * * DELETE /mf/v1/image/{image_id} */ export const deleteApiMfV1ImageImageId = async (args: DeleteApiMfV1ImageImageIdArgs, options?: DeleteApiMfV1ImageImageIdOptions) => { const {baseUrl = "http://gateway.mlss.mf", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() const url = `${baseUrl.replace(/\/+$/, '')}/mf/v1/image/${encodeURIComponent(String(args.image_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 };