export type GetApiV3ClientBookClientArgs = {search?: string | undefined, scope?: ('active' | 'archived' | 'all') | undefined, page?: number | undefined, limit?: number | undefined}; export type GetApiV3ClientBookClientOptions = {baseUrl?: string | undefined, ApiKeyAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * List clients * * GET /v3/client-book/client */ export const getApiV3ClientBookClient = async (args: GetApiV3ClientBookClientArgs, options?: GetApiV3ClientBookClientOptions) => { const {baseUrl = "https://api.rhinoartisan.com", fetch: fetchFn = fetch, ApiKeyAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.search != null) query.append("search", String(args.search)) if (args.scope != null) query.append("scope", String(args.scope)) 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/client-book/client${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 };