export type PatchApiSnapshotsSsIdMincoreArgs = {ssId: string, body: {from_records_size?: number | undefined, trim_regions?: boolean | undefined, to_ws_file?: string | undefined, inactive_ws?: boolean | undefined, zero_ws?: boolean | undefined, size_threshold?: number | undefined, interval_threshold?: number | undefined, mincore_cache?: Array | undefined, drop_ws_cache?: boolean | undefined}}; export type PatchApiSnapshotsSsIdMincoreOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Change mincore state * * PATCH /snapshots/{ssId}/mincore */ export const patchApiSnapshotsSsIdMincore = async (args: PatchApiSnapshotsSsIdMincoreArgs, options?: PatchApiSnapshotsSsIdMincoreOptions) => { const {baseUrl = "http://localhost:8080", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") const url = `${baseUrl.replace(/\/+$/, '')}/snapshots/${encodeURIComponent(String(args.ssId))}/mincore${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 };