export type Schedule = {type?: string | undefined, id?: string | undefined, attributes?: ({createdBy?: string | undefined, createdDate?: string | undefined, cron?: string | undefined, description?: string | undefined, enabled?: boolean | undefined, tcl?: string | undefined, templateReference?: string | undefined, updatedBy?: string | undefined, updatedDate?: string | undefined}) | undefined, relationships?: ({workspace?: ({id?: string | undefined, type?: 'workspace' | undefined}) | undefined}) | undefined}; export type PatchApiWorkspaceWorkspaceIdScheduleScheduleIdArgs = {body: {data?: Schedule | undefined}}; export type PatchApiWorkspaceWorkspaceIdScheduleScheduleIdOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * Modifies an instance of type schedule * * PATCH /workspace/{workspaceId}/schedule/{scheduleId} */ export const patchApiWorkspaceWorkspaceIdScheduleScheduleId = async (args: PatchApiWorkspaceWorkspaceIdScheduleScheduleIdArgs, options: PatchApiWorkspaceWorkspaceIdScheduleScheduleIdOptions) => { const {baseUrl, fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/vnd.api+json") const url = `${baseUrl.replace(/\/+$/, '')}/workspace/${encodeURIComponent(String(args.workspaceId))}/schedule/${encodeURIComponent(String(args.scheduleId))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "PATCH", 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 };