export type CreateApiApiV1AutomationsAutomationIdSuppressArgs = {automation_id: string}; export type CreateApiApiV1AutomationsAutomationIdSuppressOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * Suppress Automation * * POST /api/v1/automations/{automation_id}/suppress */ export const createApiApiV1AutomationsAutomationIdSuppress = async (args: CreateApiApiV1AutomationsAutomationIdSuppressArgs, options: CreateApiApiV1AutomationsAutomationIdSuppressOptions) => { const {baseUrl, fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() const url = `${baseUrl.replace(/\/+$/, '')}/api/v1/automations/${encodeURIComponent(String(args.automation_id))}/suppress${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };