export type CreateApiRegisteredUrlForAddAppointmentEventsArgs = {body: {service?: string | undefined, event: string, transaction_id?: string | undefined, event_time: number, timestamp: number, client_id: string, business_id: string, data: {appointment_id: string, partner_appointment_id: string, doctor_id: string, partner_doctor_id: string, patient_id: string, partner_patient_id: string, clinic_id: string, partner_clinic_id: string, status: string, action: string, created_at: number, modified_at: number, custom_attributes?: ({label?: Array | undefined}) | undefined, partner_meta: {key1?: string | undefined}, sa_ids: Array}}}; export type CreateApiRegisteredUrlForAddAppointmentEventsOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Create appointment * * POST /registered_url_for_add_appointment_events */ export const createApiRegisteredUrlForAddAppointmentEvents = async (args: CreateApiRegisteredUrlForAddAppointmentEventsArgs, options?: CreateApiRegisteredUrlForAddAppointmentEventsOptions) => { 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_add_appointment_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 };