export type UpdateApiSnapshotsSsIdMincoreArgs = {ssId: string, source?: string | undefined}; export type UpdateApiSnapshotsSsIdMincoreOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Put mincore state * * PUT /snapshots/{ssId}/mincore */ export const updateApiSnapshotsSsIdMincore = async (args: UpdateApiSnapshotsSsIdMincoreArgs, options?: UpdateApiSnapshotsSsIdMincoreOptions) => { const {baseUrl = "http://localhost:8080", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.source != null) query.append("source", String(args.source)) const url = `${baseUrl.replace(/\/+$/, '')}/snapshots/${encodeURIComponent(String(args.ssId))}/mincore${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "PUT", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };