export type GetApiPredictleadsV3DiscoverFinancingEventsArgs = {page?: number | undefined, company_location?: string | undefined, financing_types_normalized?: string | undefined, limit?: number | undefined}; export type GetApiPredictleadsV3DiscoverFinancingEventsOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Search and filter financing events across all companies Pagination billing: call the first page normally and save billing.requestId from the Orthogonal /v1/run response. For later page, offset, or cursor calls on the same logical search, pass parentRequestId with unchanged non-pagination parameters. Valid continuation calls still get their own request IDs and quoted price, but are charged 0. Changing filters starts a new billable request. * * GET /predictleads/v3/discover/financing_events */ export const getApiPredictleadsV3DiscoverFinancingEvents = async (args: GetApiPredictleadsV3DiscoverFinancingEventsArgs, options?: GetApiPredictleadsV3DiscoverFinancingEventsOptions) => { const {baseUrl = "https://api.orthogonal.com/mpp", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.page != null) query.append("page", String(args.page)) if (args.company_location != null) query.append("company_location", String(args.company_location)) if (args.financing_types_normalized != null) query.append("financing_types_normalized", String(args.financing_types_normalized)) if (args.limit != null) query.append("limit", String(args.limit)) const url = `${baseUrl.replace(/\/+$/, '')}/predictleads/v3/discover/financing_events${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 };