export type DtoPatchFinding = {customSeverity?: string | undefined, origin?: string | undefined, reviewed?: boolean | undefined, suppressed?: boolean | undefined, suppressionReason?: string | undefined}; export type PatchApiApiV30ProjectsProjectUuidCodeFindingsFindingSnapshotIdArgs = {projectUuid: string, findingSnapshotId: string, body: DtoPatchFinding}; export type PatchApiApiV30ProjectsProjectUuidCodeFindingsFindingSnapshotIdOptions = {baseUrl?: string | undefined, bearerKey?: string | undefined, fetch?: typeof fetch | undefined}; /** * Update a project finding state (review and/or suppression) or severity (Code - SAST) * * PATCH /api/v3.0/projects/{projectUuid}/code/findings/{findingSnapshotId} */ export const patchApiApiV30ProjectsProjectUuidCodeFindingsFindingSnapshotId = async (args: PatchApiApiV30ProjectsProjectUuidCodeFindingsFindingSnapshotIdArgs, options?: PatchApiApiV30ProjectsProjectUuidCodeFindingsFindingSnapshotIdOptions) => { const {baseUrl = "https://baseUrl", fetch: fetchFn = fetch, bearerKey} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") headers.set('accept', "*/*") if (bearerKey !== undefined) headers.set('authorization', `Bearer ${bearerKey}`) const url = `${baseUrl.replace(/\/+$/, '')}/api/v3.0/projects/${encodeURIComponent(String(args.projectUuid))}/code/findings/${encodeURIComponent(String(args.findingSnapshotId))}${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 res.blob() };