export type GetApiGroupApiVVersionMerchantDownloadfileArgs = {_url?: string | undefined, group: string, version: string}; export type GetApiGroupApiVVersionMerchantDownloadfileOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * GET /{group}/api/v{version}/merchant/downloadfile */ export const getApiGroupApiVVersionMerchantDownloadfile = async (args: GetApiGroupApiVVersionMerchantDownloadfileArgs, options: GetApiGroupApiVVersionMerchantDownloadfileOptions) => { const {baseUrl, fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args._url != null) query.append("_url", String(args._url)) const url = `${baseUrl.replace(/\/+$/, '')}/${encodeURIComponent(String(args.group))}/api/v${encodeURIComponent(String(args.version))}/merchant/downloadfile${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 };