export type GetApiV2OrgOrgIdJobPersonPersonIdsArgs = {orgId: string, personIds: string, scenarioId?: string | undefined, date?: string | undefined, fields?: string | undefined, format?: string | undefined}; export type GetApiV2OrgOrgIdJobPersonPersonIdsOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Find jobs by person ids * * GET /v2/org/{orgId}/job/person/{personIds} */ export const getApiV2OrgOrgIdJobPersonPersonIds = async (args: GetApiV2OrgOrgIdJobPersonPersonIdsArgs, options?: GetApiV2OrgOrgIdJobPersonPersonIdsOptions) => { const {baseUrl = "https://localhost", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.scenarioId != null) query.append("scenarioId", String(args.scenarioId)) if (args.date != null) query.append("date", String(args.date)) if (args.fields != null) query.append("fields", String(args.fields)) if (args.format != null) query.append("format", String(args.format)) const url = `${baseUrl.replace(/\/+$/, '')}/v2/org/${encodeURIComponent(String(args.orgId))}/job/person/${encodeURIComponent(String(args.personIds))}${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 };