export type DeleteApiAgentsAgentIdSchedulesScheduleIdArgs = {agent_id: string, schedule_id: string}; export type DeleteApiAgentsAgentIdSchedulesScheduleIdOptions = {baseUrl: string, apiKeyAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete a schedule * * DELETE /agents/{agent_id}/schedules/{schedule_id} */ export const deleteApiAgentsAgentIdSchedulesScheduleId = async (args: DeleteApiAgentsAgentIdSchedulesScheduleIdArgs, options: DeleteApiAgentsAgentIdSchedulesScheduleIdOptions) => { const {baseUrl, fetch: fetchFn = fetch, apiKeyAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (apiKeyAuth !== undefined) headers.set("X-Axilio-Api-Key", apiKeyAuth) const url = `${baseUrl.replace(/\/+$/, '')}/agents/${encodeURIComponent(String(args.agent_id))}/schedules/${encodeURIComponent(String(args.schedule_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 };