export type GetApiV1QaQueueOverviewArgs = {tz?: string | undefined, customers: string}; export type GetApiV1QaQueueOverviewOptions = {baseUrl: string, bearerAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * GET /v1/qa/queue-overview */ export const getApiV1QaQueueOverview = async (args: GetApiV1QaQueueOverviewArgs, options: GetApiV1QaQueueOverviewOptions) => { const {baseUrl, fetch: fetchFn = fetch, bearerAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.tz != null) query.append("tz", String(args.tz)) if (args.customers != null) query.append("customers", String(args.customers)) if (bearerAuth !== undefined) headers.set('authorization', `Bearer ${bearerAuth}`) const url = `${baseUrl.replace(/\/+$/, '')}/v1/qa/queue-overview${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 };