export type GetApiApiGongUserGongCallsListArgs = {email?: string | undefined, page?: number | undefined, per_page?: number | undefined}; export type GetApiApiGongUserGongCallsListOptions = {baseUrl: string, bearerAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Get paginated users and calls * * GET /api/gong/user-gong-calls-list */ export const getApiApiGongUserGongCallsList = async (args: GetApiApiGongUserGongCallsListArgs, options: GetApiApiGongUserGongCallsListOptions) => { const {baseUrl, fetch: fetchFn = fetch, bearerAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.email != null) query.append("email", String(args.email)) if (args.page != null) query.append("page", String(args.page)) if (args.per_page != null) query.append("per_page", String(args.per_page)) if (bearerAuth !== undefined) headers.set('authorization', `Bearer ${bearerAuth}`) const url = `${baseUrl.replace(/\/+$/, '')}/api/gong/user-gong-calls-list${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 };