export type UpdateApiV1ClassesClassIdRegistrationsRegistrationIdCancelArgs = {class_id: number, registration_id: number, body: {waive_fee?: boolean | undefined}}; export type UpdateApiV1ClassesClassIdRegistrationsRegistrationIdCancelOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Cancel a guest's registration to a class * * PUT /v1/classes/{class_id}/registrations/{registration_id}/cancel */ export const updateApiV1ClassesClassIdRegistrationsRegistrationIdCancel = async (args: UpdateApiV1ClassesClassIdRegistrationsRegistrationIdCancelArgs, options?: UpdateApiV1ClassesClassIdRegistrationsRegistrationIdCancelOptions) => { const {baseUrl = "https://api.zenoti.com", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") headers.set('accept', "application/json") const url = `${baseUrl.replace(/\/+$/, '')}/v1/classes/${encodeURIComponent(String(args.class_id))}/registrations/${encodeURIComponent(String(args.registration_id))}/cancel${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 (await res.json()) as unknown };