export type DeleteApiApiV1AdminEmailLetterheadsLetterheadIdArgs = {letterhead_id: number, authorization?: (string | null) | undefined, 'X-API-Key'?: (string | null) | undefined}; export type DeleteApiApiV1AdminEmailLetterheadsLetterheadIdOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * Delete Letterhead * * DELETE /api/v1/admin/email-letterheads/{letterhead_id} */ export const deleteApiApiV1AdminEmailLetterheadsLetterheadId = async (args: DeleteApiApiV1AdminEmailLetterheadsLetterheadIdArgs, options: DeleteApiApiV1AdminEmailLetterheadsLetterheadIdOptions) => { const {baseUrl, fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.authorization != null) headers.set("authorization", String(args.authorization)) if (args['X-API-Key'] != null) headers.set("X-API-Key", String(args['X-API-Key'])) const url = `${baseUrl.replace(/\/+$/, '')}/api/v1/admin/email-letterheads/${encodeURIComponent(String(args.letterhead_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 };