export type GetApiApiVVersionUserTransactionGetAllUserTransactionArgs = {PageNumber?: number | undefined, PageSize?: number | undefined, version: string}; export type GetApiApiVVersionUserTransactionGetAllUserTransactionOptions = {baseUrl: string, Bearer?: string | undefined, fetch?: typeof fetch | undefined}; /** * GET /api/v{version}/UserTransaction/GetAllUserTransaction */ export const getApiApiVVersionUserTransactionGetAllUserTransaction = async (args: GetApiApiVVersionUserTransactionGetAllUserTransactionArgs, options: GetApiApiVVersionUserTransactionGetAllUserTransactionOptions) => { const {baseUrl, fetch: fetchFn = fetch, Bearer} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.PageNumber != null) query.append("PageNumber", String(args.PageNumber)) if (args.PageSize != null) query.append("PageSize", String(args.PageSize)) if (Bearer !== undefined) headers.set("Authorization", Bearer) const url = `${baseUrl.replace(/\/+$/, '')}/api/v${encodeURIComponent(String(args.version))}/UserTransaction/GetAllUserTransaction${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 };