export type GetApiPredictleadsV3NewsEventsIdArgs = {id: string}; export type GetApiPredictleadsV3NewsEventsIdOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Get a single news event by ID * * GET /predictleads/v3/news_events/{id} */ export const getApiPredictleadsV3NewsEventsId = async (args: GetApiPredictleadsV3NewsEventsIdArgs, options?: GetApiPredictleadsV3NewsEventsIdOptions) => { const {baseUrl = "https://api.orthogonal.com/mpp", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() const url = `${baseUrl.replace(/\/+$/, '')}/predictleads/v3/news_events/${encodeURIComponent(String(args.id))}${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 };