export type CreateApiRegisteredUrlForDoctorEventsArgs = {body: {event: 'schedule.start_practice' | 'schedule.stop_practice' | 'schedule.available_for_consultation', event_time: number, timestamp: number, client_id: string, business_id: string, data: {doctor_id: string, partner_doctor_id: string, clinic_id?: string | undefined, partner_clinic_id?: string | undefined, created_at: number, modified_at: number, partner_meta?: ({key1?: string | undefined}) | undefined}}}; export type CreateApiRegisteredUrlForDoctorEventsOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Doctor Events * * POST /registered_url_for_doctor_events */ export const createApiRegisteredUrlForDoctorEvents = async (args: CreateApiRegisteredUrlForDoctorEventsArgs, options?: CreateApiRegisteredUrlForDoctorEventsOptions) => { 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_doctor_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 };