export type GetApiApiV1PluginsIdSnapshotsSnapshotIdFilesBundleArgs = {fileType?: string | undefined}; export type GetApiApiV1PluginsIdSnapshotsSnapshotIdFilesBundleOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * Returns a file bundle containing all of the PluginFile resources for an * * GET /api/v1/plugins/{id}/snapshots/{snapshotId}/files/bundle */ export const getApiApiV1PluginsIdSnapshotsSnapshotIdFilesBundle = async (args: GetApiApiV1PluginsIdSnapshotsSnapshotIdFilesBundleArgs, options: GetApiApiV1PluginsIdSnapshotsSnapshotIdFilesBundleOptions) => { const {baseUrl, fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.fileType != null) query.append("fileType", String(args.fileType)) const url = `${baseUrl.replace(/\/+$/, '')}/api/v1/plugins/${encodeURIComponent(String(args.id))}/snapshots/${encodeURIComponent(String(args.snapshotId))}/files/bundle${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 undefined };