export type GetApiV1AppsAppIdUsersArgs = {pageNo: number, limit: number, identifier: string}; export type GetApiV1AppsAppIdUsersOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * GET /v1/apps/{appId}/users */ export const getApiV1AppsAppIdUsers = async (args: GetApiV1AppsAppIdUsersArgs, options: GetApiV1AppsAppIdUsersOptions) => { const {baseUrl, fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.pageNo != null) query.append("pageNo", String(args.pageNo)) if (args.limit != null) query.append("limit", String(args.limit)) if (args.identifier != null) query.append("identifier", String(args.identifier)) const url = `${baseUrl.replace(/\/+$/, '')}/v1/apps/${encodeURIComponent(String(args.appId))}/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 undefined };