export type GetApiV3AdminUsersArgs = {q?: string | undefined, status?: number | undefined, superuser?: string | undefined, orphan?: string | undefined, page?: number | undefined, limit?: number | undefined}; export type GetApiV3AdminUsersOptions = {baseUrl?: string | undefined, ApiKeyAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * List users * * GET /v3/admin/users */ export const getApiV3AdminUsers = async (args: GetApiV3AdminUsersArgs, options?: GetApiV3AdminUsersOptions) => { const {baseUrl = "https://api.rhinoartisan.com", fetch: fetchFn = fetch, ApiKeyAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.q != null) query.append("q", String(args.q)) if (args.status != null) query.append("status", String(args.status)) if (args.superuser != null) query.append("superuser", String(args.superuser)) if (args.orphan != null) query.append("orphan", String(args.orphan)) if (args.page != null) query.append("page", String(args.page)) if (args.limit != null) query.append("limit", String(args.limit)) if (ApiKeyAuth !== undefined) headers.set("apikey", ApiKeyAuth) const url = `${baseUrl.replace(/\/+$/, '')}/v3/admin/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 };