export type WorkflowSchedulePauseRequest = {note?: (string | null) | undefined}; export type CreateApiV1WorkflowsSchedulesScheduleIdPauseArgs = {schedule_id: string, body: WorkflowSchedulePauseRequest | null}; export type CreateApiV1WorkflowsSchedulesScheduleIdPauseOptions = {baseUrl?: string | undefined, ApiKey?: string | undefined, fetch?: typeof fetch | undefined}; /** * Pause Schedule * * POST /v1/workflows/schedules/{schedule_id}/pause */ export const createApiV1WorkflowsSchedulesScheduleIdPause = async (args: CreateApiV1WorkflowsSchedulesScheduleIdPauseArgs, options?: CreateApiV1WorkflowsSchedulesScheduleIdPauseOptions) => { const {baseUrl = "https://api.mistral.ai", fetch: fetchFn = fetch, ApiKey} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (ApiKey !== undefined) headers.set('authorization', `Bearer ${ApiKey}`) const url = `${baseUrl.replace(/\/+$/, '')}/v1/workflows/schedules/${encodeURIComponent(String(args.schedule_id))}/pause${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", headers, body: JSON.stringify(args.body)}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };