export type GetApiEntityInformationV1DownloadEntitiesArgs = {token: string, api_key?: string | undefined}; export type GetApiEntityInformationV1DownloadEntitiesOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * getFileFromS3 * * GET /entity-information/v1/download-entities */ export const getApiEntityInformationV1DownloadEntities = async (args: GetApiEntityInformationV1DownloadEntitiesArgs, options: GetApiEntityInformationV1DownloadEntitiesOptions) => { const {baseUrl, fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.token != null) query.append("token", String(args.token)) if (args.api_key != null) query.append("api_key", String(args.api_key)) const url = `${baseUrl.replace(/\/+$/, '')}/entity-information/v1/download-entities${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 };