export type GetApiApiV1MaintenanceDownloadStarterWithAssetsArgs = {oldAssets?: boolean | undefined, maxSize?: string | undefined}; export type GetApiApiV1MaintenanceDownloadStarterWithAssetsOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * GET /api/v1/maintenance/_downloadStarterWithAssets */ export const getApiApiV1MaintenanceDownloadStarterWithAssets = async (args: GetApiApiV1MaintenanceDownloadStarterWithAssetsArgs, options: GetApiApiV1MaintenanceDownloadStarterWithAssetsOptions) => { const {baseUrl, fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('accept', "application/json") if (args.oldAssets != null) query.append("oldAssets", String(args.oldAssets)) if (args.maxSize != null) query.append("maxSize", String(args.maxSize)) const url = `${baseUrl.replace(/\/+$/, '')}/api/v1/maintenance/_downloadStarterWithAssets${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 (await res.json()) as unknown };