export type History = {type?: string | undefined, id?: string | undefined, attributes?: ({createdBy?: string | undefined, createdDate?: string | undefined, jobReference?: string | undefined, output?: string | undefined, updatedBy?: string | undefined, updatedDate?: string | undefined}) | undefined, relationships?: ({workspace?: ({id?: string | undefined, type?: 'workspace' | undefined}) | undefined}) | undefined}; export type PatchApiWorkspaceWorkspaceIdHistoryHistoryIdArgs = {body: {data?: History | undefined}}; export type PatchApiWorkspaceWorkspaceIdHistoryHistoryIdOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * Modifies an instance of type history * * PATCH /workspace/{workspaceId}/history/{historyId} */ export const patchApiWorkspaceWorkspaceIdHistoryHistoryId = async (args: PatchApiWorkspaceWorkspaceIdHistoryHistoryIdArgs, options: PatchApiWorkspaceWorkspaceIdHistoryHistoryIdOptions) => { 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))}/history/${encodeURIComponent(String(args.historyId))}${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 };