export type GetApiCollectionsCollectionNameSnapshotsSnapshotNameArgs = {collection_name: string, snapshot_name: string}; export type GetApiCollectionsCollectionNameSnapshotsSnapshotNameOptions = {baseUrl?: string | undefined, apiKey?: string | undefined, fetch?: typeof fetch | undefined}; /** * Download collection snapshot * * GET /collections/{collection_name}/snapshots/{snapshot_name} * * Also accepts auth: bearerAuth */ export const getApiCollectionsCollectionNameSnapshotsSnapshotName = async (args: GetApiCollectionsCollectionNameSnapshotsSnapshotNameArgs, options?: GetApiCollectionsCollectionNameSnapshotsSnapshotNameOptions) => { const {baseUrl = "http://localhost:6333", fetch: fetchFn = fetch, apiKey} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('accept', "application/octet-stream") if (apiKey !== undefined) headers.set("api-key", apiKey) const url = `${baseUrl.replace(/\/+$/, '')}/collections/${encodeURIComponent(String(args.collection_name))}/snapshots/${encodeURIComponent(String(args.snapshot_name))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "GET", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return res.blob() };