export type GetApiTombaV1EmailCountArgs = {domain: string}; export type GetApiTombaV1EmailCountOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Get the count of email addresses for a domain, broken down by department and seniority. * * GET /tomba/v1/email-count */ export const getApiTombaV1EmailCount = async (args: GetApiTombaV1EmailCountArgs, options?: GetApiTombaV1EmailCountOptions) => { const {baseUrl = "https://api.orthogonal.com/mpp", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.domain != null) query.append("domain", String(args.domain)) const url = `${baseUrl.replace(/\/+$/, '')}/tomba/v1/email-count${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 };