export type UpdateJobDefinition = {runtime_environment_name?: string | undefined, runtime_environment_parameters?: {[key: string]: string} | undefined, output_formats?: Array | undefined, parameters?: {[key: string]: string} | undefined, tags?: Array | undefined, name?: string | undefined, url?: string | undefined, schedule?: string | undefined, timezone?: string | undefined, output_filename_template?: string | undefined, active?: boolean | undefined, compute_type?: string | undefined, input_uri?: string | undefined}; export type PatchApiJobDefinitionsJobDefinitionIdArgs = {job_definition_id: string, body: UpdateJobDefinition}; export type PatchApiJobDefinitionsJobDefinitionIdOptions = {baseUrl: string, JupyterServerAuthHeader?: string | undefined, fetch?: typeof fetch | undefined}; /** * Update a specific job definition * * PATCH /job_definitions/{job_definition_id} * * Also accepts auth: JupyterServerAuthToken */ export const patchApiJobDefinitionsJobDefinitionId = async (args: PatchApiJobDefinitionsJobDefinitionIdArgs, options: PatchApiJobDefinitionsJobDefinitionIdOptions) => { const {baseUrl, fetch: fetchFn = fetch, JupyterServerAuthHeader} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (JupyterServerAuthHeader !== undefined) headers.set("Authorization", JupyterServerAuthHeader) const url = `${baseUrl.replace(/\/+$/, '')}/job_definitions/${encodeURIComponent(String(args.job_definition_id))}${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 };