export type GetApiApiClubMembersPersepolisFromToHasTransactionArgs = {from: string, hasTransaction: boolean, page?: number | undefined, size?: number | undefined, sort?: Array | undefined, to: string}; export type GetApiApiClubMembersPersepolisFromToHasTransactionOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * getPersepolisClubMembers * * GET /api/club-members/persepolis/{from}/{to}/{hasTransaction} */ export const getApiApiClubMembersPersepolisFromToHasTransaction = async (args: GetApiApiClubMembersPersepolisFromToHasTransactionArgs, options: GetApiApiClubMembersPersepolisFromToHasTransactionOptions) => { const {baseUrl, fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('accept', "*/*") if (args.page != null) query.append("page", String(args.page)) if (args.size != null) query.append("size", String(args.size)) for (const item of args.sort ?? []) query.append("sort", String(item)) const url = `${baseUrl.replace(/\/+$/, '')}/api/club-members/persepolis/${encodeURIComponent(String(args.from))}/${encodeURIComponent(String(args.to))}/${encodeURIComponent(String(args.hasTransaction))}${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.blob() };