export type DeleteApiBookingsBookingIdArgs = {'Accept-Language'?: string | undefined, booking_id: string}; export type DeleteApiBookingsBookingIdOptions = {baseUrl?: string | undefined, bearerAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete a booking * * DELETE /bookings/{booking_id} * * Also accepts auth: basicAuth */ export const deleteApiBookingsBookingId = async (args: DeleteApiBookingsBookingIdArgs, options?: DeleteApiBookingsBookingIdOptions) => { const {baseUrl = "https://sandbox.crmcarecloud.com/webservice/rest-api/enterprise-interface/v1.0", fetch: fetchFn = fetch, bearerAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args['Accept-Language'] != null) headers.set("Accept-Language", String(args['Accept-Language'])) if (bearerAuth !== undefined) headers.set('authorization', `Bearer ${bearerAuth}`) const url = `${baseUrl.replace(/\/+$/, '')}/bookings/${encodeURIComponent(String(args.booking_id))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "DELETE", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };