export type GetApiOfficePaymentsPaymentIdUsersArgs = {paymentId: number, nameEmailSearch?: string | undefined, fromDate?: string | undefined, toDate?: string | undefined, sort?: Array | undefined, offset?: number | undefined, limit?: number | undefined, 'X-Zendesk-Doorman-Auth-Response': string}; export type GetApiOfficePaymentsPaymentIdUsersOptions = {baseUrl?: string | undefined, zendeskAuthn?: string | undefined, fetch?: typeof fetch | undefined}; /** * GET /office/payments/{paymentId}/users */ export const getApiOfficePaymentsPaymentIdUsers = async (args: GetApiOfficePaymentsPaymentIdUsersArgs, options?: GetApiOfficePaymentsPaymentIdUsersOptions) => { const {baseUrl = "http://api.klausapp.com", fetch: fetchFn = fetch, zendeskAuthn} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('accept', "*/*") if (args.nameEmailSearch != null) query.append("nameEmailSearch", String(args.nameEmailSearch)) if (args.fromDate != null) query.append("fromDate", String(args.fromDate)) if (args.toDate != null) query.append("toDate", String(args.toDate)) for (const item of args.sort ?? []) query.append("sort", String(item)) if (args.offset != null) query.append("offset", String(args.offset)) if (args.limit != null) query.append("limit", String(args.limit)) if (args['X-Zendesk-Doorman-Auth-Response'] != null) headers.set("X-Zendesk-Doorman-Auth-Response", String(args['X-Zendesk-Doorman-Auth-Response'])) if (zendeskAuthn !== undefined) headers.set("X-Zendesk-Authn", zendeskAuthn) const url = `${baseUrl.replace(/\/+$/, '')}/office/payments/${encodeURIComponent(String(args.paymentId))}/users${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() };