export type GetApiCollectionsCollectionNameShardsShardIdSnapshotsSnapshotNameArgs = {collection_name: string, shard_id: number, snapshot_name: string}; export type GetApiCollectionsCollectionNameShardsShardIdSnapshotsSnapshotNameOptions = {baseUrl?: string | undefined, apiKey?: string | undefined, fetch?: typeof fetch | undefined}; /** * Download collection snapshot * * GET /collections/{collection_name}/shards/{shard_id}/snapshots/{snapshot_name} * * Also accepts auth: bearerAuth */ export const getApiCollectionsCollectionNameShardsShardIdSnapshotsSnapshotName = async (args: GetApiCollectionsCollectionNameShardsShardIdSnapshotsSnapshotNameArgs, options?: GetApiCollectionsCollectionNameShardsShardIdSnapshotsSnapshotNameOptions) => { 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))}/shards/${encodeURIComponent(String(args.shard_id))}/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() };