export type DeleteApiApiV1InstallerJobsInstallerJobIdArgs = {installerJobId: number}; export type DeleteApiApiV1InstallerJobsInstallerJobIdOptions = {baseUrl?: string | undefined, BearerAccessToken?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete an existing installer job * * DELETE /api/v1/installer-jobs/{installerJobId} */ export const deleteApiApiV1InstallerJobsInstallerJobId = async (args: DeleteApiApiV1InstallerJobsInstallerJobIdArgs, options?: DeleteApiApiV1InstallerJobsInstallerJobIdOptions) => { const {baseUrl = "https://partner-api.monta.com", fetch: fetchFn = fetch, BearerAccessToken} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (BearerAccessToken !== undefined) headers.set('authorization', `Bearer ${BearerAccessToken}`) const url = `${baseUrl.replace(/\/+$/, '')}/api/v1/installer-jobs/${encodeURIComponent(String(args.installerJobId))}${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 };