export type GetApiV1PatientRelationshipsArgs = {primary_person?: number | undefined}; export type GetApiV1PatientRelationshipsOptions = {baseUrl?: string | undefined, ApiKeyAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * List relationships * * GET /v1/patient_relationships */ export const getApiV1PatientRelationships = async (args: GetApiV1PatientRelationshipsArgs, options?: GetApiV1PatientRelationshipsOptions) => { const {baseUrl = "https://developer.yezza.com", fetch: fetchFn = fetch, ApiKeyAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.primary_person != null) query.append("primary_person", String(args.primary_person)) if (ApiKeyAuth !== undefined) headers.set("X-Api-Key", ApiKeyAuth) const url = `${baseUrl.replace(/\/+$/, '')}/v1/patient_relationships${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 };