export type DeleteApiProviderAffiliatesAffiliateIdPatientsIdArgs = {affiliate_id: string, id: string}; export type DeleteApiProviderAffiliatesAffiliateIdPatientsIdOptions = {baseUrl?: string | undefined, hintApiKey?: string | undefined, fetch?: typeof fetch | undefined}; /** * Remove patient from an affiliation * * DELETE /provider/affiliates/{affiliate_id}/patients/{id} */ export const deleteApiProviderAffiliatesAffiliateIdPatientsId = async (args: DeleteApiProviderAffiliatesAffiliateIdPatientsIdArgs, options?: DeleteApiProviderAffiliatesAffiliateIdPatientsIdOptions) => { const {baseUrl = "https://api.sandbox.hint.com/api", fetch: fetchFn = fetch, hintApiKey} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (hintApiKey !== undefined) headers.set("AUTHORIZATION", hintApiKey) const url = `${baseUrl.replace(/\/+$/, '')}/provider/affiliates/${encodeURIComponent(String(args.affiliate_id))}/patients/${encodeURIComponent(String(args.id))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "DELETE", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };