export type GetApiContextDevBrandRetrieveByEmailArgs = {email: string, maxSpeed?: boolean | undefined, timeoutMS?: number | undefined}; export type GetApiContextDevBrandRetrieveByEmailOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Retrieve brand information using an email address while detecting disposable and free email addresses. This endpoint extracts the domain from the email address and returns brand data for that domain. Disposable and free email addresses (like gmail.com, yahoo.com) will throw a 422 error. * * GET /context-dev/brand/retrieve-by-email */ export const getApiContextDevBrandRetrieveByEmail = async (args: GetApiContextDevBrandRetrieveByEmailArgs, options?: GetApiContextDevBrandRetrieveByEmailOptions) => { const {baseUrl = "https://api.orthogonal.com/mpp", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.email != null) query.append("email", String(args.email)) if (args.maxSpeed != null) query.append("maxSpeed", String(args.maxSpeed)) if (args.timeoutMS != null) query.append("timeoutMS", String(args.timeoutMS)) const url = `${baseUrl.replace(/\/+$/, '')}/context-dev/brand/retrieve-by-email${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 };