export type DeleteApiApiV1AttachmentsIdArgs = {id: string}; export type DeleteApiApiV1AttachmentsIdOptions = {baseUrl: string, TeamhoodAPIKey?: string | undefined, fetch?: typeof fetch | undefined}; /** * Deletes an attachment by unique identifier. * Supports both uploaded files and external source attachments. * * DELETE /api/v1/attachments/{id} */ export const deleteApiApiV1AttachmentsId = async (args: DeleteApiApiV1AttachmentsIdArgs, options: DeleteApiApiV1AttachmentsIdOptions) => { const {baseUrl, fetch: fetchFn = fetch, TeamhoodAPIKey} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (TeamhoodAPIKey !== undefined) headers.set("X-ApiKey", TeamhoodAPIKey) const url = `${baseUrl.replace(/\/+$/, '')}/api/v1/attachments/${encodeURIComponent(String(args.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 };