export type GetApiPredictleadsV3JobOpeningsIdArgs = {id: string}; export type GetApiPredictleadsV3JobOpeningsIdOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Get a single job opening by ID * * GET /predictleads/v3/job_openings/{id} */ export const getApiPredictleadsV3JobOpeningsId = async (args: GetApiPredictleadsV3JobOpeningsIdArgs, options?: GetApiPredictleadsV3JobOpeningsIdOptions) => { 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/job_openings/${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 };