export type DeleteApiV1WorkspacesWorkspaceTriggersTriggerIdArgs = {trigger_id: string, workspace: string}; export type DeleteApiV1WorkspacesWorkspaceTriggersTriggerIdOptions = {baseUrl: string, HTTPBearer?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete Trigger * * DELETE /v1/workspaces/{workspace}/triggers/{trigger_id} */ export const deleteApiV1WorkspacesWorkspaceTriggersTriggerId = async (args: DeleteApiV1WorkspacesWorkspaceTriggersTriggerIdArgs, options: DeleteApiV1WorkspacesWorkspaceTriggersTriggerIdOptions) => { const {baseUrl, fetch: fetchFn = fetch, HTTPBearer} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (HTTPBearer !== undefined) headers.set('authorization', `Bearer ${HTTPBearer}`) const url = `${baseUrl.replace(/\/+$/, '')}/v1/workspaces/${encodeURIComponent(String(args.workspace))}/triggers/${encodeURIComponent(String(args.trigger_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 };