export type LodgifyApiPublicReservationsModelsV2ReservationsBookingsBookingCheckOutDto = {time: unknown}; export type UpdateApiV2ReservationsBookingsIdCheckoutArgs = {id: number, body: LodgifyApiPublicReservationsModelsV2ReservationsBookingsBookingCheckOutDto}; export type UpdateApiV2ReservationsBookingsIdCheckoutOptions = {baseUrl?: string | undefined, ApiKey?: string | undefined, fetch?: typeof fetch | undefined}; /** * Checkout a booking at the specified time * * PUT /v2/reservations/bookings/{id}/checkout */ export const updateApiV2ReservationsBookingsIdCheckout = async (args: UpdateApiV2ReservationsBookingsIdCheckoutArgs, options?: UpdateApiV2ReservationsBookingsIdCheckoutOptions) => { const {baseUrl = "https://api.lodgify.com", fetch: fetchFn = fetch, ApiKey} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (ApiKey !== undefined) headers.set("X-ApiKey", ApiKey) const url = `${baseUrl.replace(/\/+$/, '')}/v2/reservations/bookings/${encodeURIComponent(String(args.id))}/checkout${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 };