export type UpdateApiApiV2ScanScanIdFindingFindingIdArgs = {org: string, group: string, scan_id: string, finding_id: string, body: {status?: string | undefined, reason?: string | undefined, remediation?: string | undefined, severity?: string | undefined, impact?: string | undefined, likelihood?: string | undefined, confidence?: string | undefined}}; export type UpdateApiApiV2ScanScanIdFindingFindingIdOptions = {baseUrl?: string | undefined, ApiKeyAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Update Vulnerability * * PUT /api/v2/scan/{scan_id}/finding/{finding_id} */ export const updateApiApiV2ScanScanIdFindingFindingId = async (args: UpdateApiApiV2ScanScanIdFindingFindingIdArgs, options?: UpdateApiApiV2ScanScanIdFindingFindingIdOptions) => { const {baseUrl = "https://aquilax.ai", fetch: fetchFn = fetch, ApiKeyAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (args.org != null) query.append("org", String(args.org)) if (args.group != null) query.append("group", String(args.group)) if (ApiKeyAuth !== undefined) headers.set("X-AX-KEY", ApiKeyAuth) const url = `${baseUrl.replace(/\/+$/, '')}/api/v2/scan/${encodeURIComponent(String(args.scan_id))}/finding/${encodeURIComponent(String(args.finding_id))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "PUT", 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 };