export type GetApiAppCreateGRsaBuilderBuilderIdExportArgs = {builderId: number}; export type GetApiAppCreateGRsaBuilderBuilderIdExportOptions = {baseUrl: string, token?: string | undefined, fetch?: typeof fetch | undefined}; /** * GET /app/create/g/rsaBuilder/{builderId}/export */ export const getApiAppCreateGRsaBuilderBuilderIdExport = async (args: GetApiAppCreateGRsaBuilderBuilderIdExportArgs, options: GetApiAppCreateGRsaBuilderBuilderIdExportOptions) => { const {baseUrl, fetch: fetchFn = fetch, token} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('accept', "text/csv") if (token !== undefined) headers.set("authorization", token) const url = `${baseUrl.replace(/\/+$/, '')}/app/create/g/rsaBuilder/${encodeURIComponent(String(args.builderId))}/export${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.text() };