export type DeleteApiCasesTemplateGroupsCaseTemplateGroupIdArgs = {case_template_group_id: string, 'X-CSRF-Protection': boolean}; export type DeleteApiCasesTemplateGroupsCaseTemplateGroupIdOptions = {baseUrl: string, backendAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete the case template group (must be empty) * * DELETE /cases/template_groups/{case_template_group_id} */ export const deleteApiCasesTemplateGroupsCaseTemplateGroupId = async (args: DeleteApiCasesTemplateGroupsCaseTemplateGroupIdArgs, options: DeleteApiCasesTemplateGroupsCaseTemplateGroupIdOptions) => { const {baseUrl, fetch: fetchFn = fetch, backendAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args['X-CSRF-Protection'] != null) headers.set("X-CSRF-Protection", String(args['X-CSRF-Protection'])) if (backendAuth !== undefined) cookies.push("mtls-prd=" + encodeURIComponent(backendAuth)) const url = `${baseUrl.replace(/\/+$/, '')}/cases/template_groups/${encodeURIComponent(String(args.case_template_group_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 };