export type CreateApiRegisteredUrlForStatusChangeEventsArgs = {body: {business_id: string, client_id: string, event: string, event_time: number, service?: string | undefined, timestamp: number, transaction_id?: string | undefined, data: {appointment_id: string, clinic_id: string, created_at: number, custom_attributes?: ({label?: Array | undefined, tags?: Array | undefined}) | undefined, doctor_id: string, modified_at: number, partner_appointment_id?: string | undefined, partner_clinic_id?: string | undefined, partner_doctor_id?: string | undefined, partner_meta?: ({appointment_id?: string | undefined, encounter_id?: string | undefined, facility_id?: string | undefined}) | undefined, partner_patient_id?: string | undefined, patient_id: string, status: string}}}; export type CreateApiRegisteredUrlForStatusChangeEventsOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Status changed * * POST /registered_url_for_status_change_events */ export const createApiRegisteredUrlForStatusChangeEvents = async (args: CreateApiRegisteredUrlForStatusChangeEventsArgs, options?: CreateApiRegisteredUrlForStatusChangeEventsOptions) => { const {baseUrl = "https://api.eka.care", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") const url = `${baseUrl.replace(/\/+$/, '')}/registered_url_for_status_change_events${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", headers, body: JSON.stringify(args.body)}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };