export type CreateApiIcypeasApiBulkSingleSearchsReadArgs = {body: {id: string, next?: boolean | undefined, sorts?: Array | undefined}}; export type CreateApiIcypeasApiBulkSingleSearchsReadOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Retrieve results for a search by ID. Use to poll async results from email-search, email-verification, domain-search, scrape, url-search. Supports pagination. * * POST /icypeas/api/bulk-single-searchs/read */ export const createApiIcypeasApiBulkSingleSearchsRead = async (args: CreateApiIcypeasApiBulkSingleSearchsReadArgs, options?: CreateApiIcypeasApiBulkSingleSearchsReadOptions) => { const {baseUrl = "https://api.orthogonal.com/mpp", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") const url = `${baseUrl.replace(/\/+$/, '')}/icypeas/api/bulk-single-searchs/read${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", headers, body: JSON.stringify(args.body)}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };