export type PatchApiDrV2AppointmentAppointmentIdArgs = {auth: string, appointment_id: string, partner_id?: string | undefined, body: {token?: number | undefined, appointment_details?: ({start_time?: number | undefined, end_time?: number | undefined, mode?: ('INCLINIC' | 'PHONE' | 'VIDEO') | undefined, custom_attributes?: Record | undefined, video_connect?: ({vendor?: 'other' | undefined, url?: string | undefined}) | undefined}) | undefined, partner_meta?: ({key1?: string | undefined}) | undefined, patient_details?: ({designation?: ('Mr.' | 'Ms.' | 'Mrs.' | 'Miss.' | 'Kumar.' | 'Shri.' | 'Smt.' | 'Dr.' | 'Master.' | 'Baby.' | 'Mohd.' | 'B/O') | undefined, first_name?: string | undefined, partner_patient_id?: string | undefined, middle_name?: string | undefined, last_name?: string | undefined, mobile?: string | undefined, gender?: ('M' | 'F' | 'O') | undefined, address?: ({city?: string | undefined, pincode?: number | undefined}) | undefined, dob: string} | {designation?: ('Mr.' | 'Ms.' | 'Mrs.' | 'Miss.' | 'Kumar.' | 'Shri.' | 'Smt.' | 'Dr.' | 'Master.' | 'Baby.' | 'Mohd.' | 'B/O') | undefined, first_name?: string | undefined, partner_patient_id?: string | undefined, middle_name?: string | undefined, last_name?: string | undefined, mobile?: string | undefined, gender?: ('M' | 'F' | 'O') | undefined, address?: ({city?: string | undefined, pincode?: number | undefined}) | undefined, age: number}) | undefined, display_meta?: Record | undefined, clinic_id: string, doctor_id: string, patient_id: string} | {token?: number | undefined, appointment_details?: ({start_time?: number | undefined, end_time?: number | undefined, mode?: ('INCLINIC' | 'PHONE' | 'VIDEO') | undefined, custom_attributes?: Record | undefined, video_connect?: ({vendor?: 'other' | undefined, url?: string | undefined}) | undefined}) | undefined, partner_meta?: ({key1?: string | undefined}) | undefined, patient_details?: ({designation?: ('Mr.' | 'Ms.' | 'Mrs.' | 'Miss.' | 'Kumar.' | 'Shri.' | 'Smt.' | 'Dr.' | 'Master.' | 'Baby.' | 'Mohd.' | 'B/O') | undefined, first_name?: string | undefined, partner_patient_id?: string | undefined, middle_name?: string | undefined, last_name?: string | undefined, mobile?: string | undefined, gender?: ('M' | 'F' | 'O') | undefined, address?: ({city?: string | undefined, pincode?: number | undefined}) | undefined, dob: string} | {designation?: ('Mr.' | 'Ms.' | 'Mrs.' | 'Miss.' | 'Kumar.' | 'Shri.' | 'Smt.' | 'Dr.' | 'Master.' | 'Baby.' | 'Mohd.' | 'B/O') | undefined, first_name?: string | undefined, partner_patient_id?: string | undefined, middle_name?: string | undefined, last_name?: string | undefined, mobile?: string | undefined, gender?: ('M' | 'F' | 'O') | undefined, address?: ({city?: string | undefined, pincode?: number | undefined}) | undefined, age: number}) | undefined, display_meta?: Record | undefined, partner_clinic_id: string, partner_doctor_id: string, partner_patient_id: string}}; export type PatchApiDrV2AppointmentAppointmentIdOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Update Appointment V2 * * PATCH /dr/v2/appointment/{appointment_id} */ export const patchApiDrV2AppointmentAppointmentId = async (args: PatchApiDrV2AppointmentAppointmentIdArgs, options?: PatchApiDrV2AppointmentAppointmentIdOptions) => { const {baseUrl = "https://api.eka.care", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (args.auth != null) headers.set("auth", String(args.auth)) if (args.partner_id != null) query.append("partner_id", String(args.partner_id)) const url = `${baseUrl.replace(/\/+$/, '')}/dr/v2/appointment/${encodeURIComponent(String(args.appointment_id))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "PATCH", 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 };