export type AppointmentNoShowModel = Record; export type UpdateApiConsumerV1AppointmentsIdNoshowArgs = {id: number, body: AppointmentNoShowModel}; export type UpdateApiConsumerV1AppointmentsIdNoshowOptions = {baseUrl?: string | undefined, oauth2?: string | undefined, fetch?: typeof fetch | undefined}; /** * Set NoShow Status * * PUT /consumer/v1/appointments/{id}/noshow */ export const updateApiConsumerV1AppointmentsIdNoshow = async (args: UpdateApiConsumerV1AppointmentsIdNoshowArgs, options?: UpdateApiConsumerV1AppointmentsIdNoshowOptions) => { const {baseUrl = "https://sandbox-api.onsched.com", fetch: fetchFn = fetch, oauth2} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (oauth2 !== undefined) headers.set('authorization', `Bearer ${oauth2}`) const url = `${baseUrl.replace(/\/+$/, '')}/consumer/v1/appointments/${encodeURIComponent(String(args.id))}/noshow${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "PUT", 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 };