export type JobId = string; export type DeleteApiFotaJobsJobIdArgs = {jobId: JobId}; export type DeleteApiFotaJobsJobIdOptions = {baseUrl?: string | undefined, SimpleToken?: string | undefined, fetch?: typeof fetch | undefined}; /** * DeleteFOTAJob * * DELETE /fota-jobs/{jobId} */ export const deleteApiFotaJobsJobId = async (args: DeleteApiFotaJobsJobIdArgs, options?: DeleteApiFotaJobsJobIdOptions) => { const {baseUrl = "https://api.nrfcloud.com/v1", fetch: fetchFn = fetch, SimpleToken} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (SimpleToken !== undefined) headers.set('authorization', `Bearer ${SimpleToken}`) const url = `${baseUrl.replace(/\/+$/, '')}/fota-jobs/${encodeURIComponent(String(args.jobId))}${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 };