export type LodgifyApiPublicReservationsModelsV1BookingCheckOutDto = {time: unknown}; export type UpdateApiV1ReservationBookingIdCheckoutArgs = {id: number, body: LodgifyApiPublicReservationsModelsV1BookingCheckOutDto}; export type UpdateApiV1ReservationBookingIdCheckoutOptions = {baseUrl?: string | undefined, ApiKey?: string | undefined, fetch?: typeof fetch | undefined}; /** * Sets the check-out time for a booking. * * PUT /v1/reservation/booking/{id}/checkout */ export const updateApiV1ReservationBookingIdCheckout = async (args: UpdateApiV1ReservationBookingIdCheckoutArgs, options?: UpdateApiV1ReservationBookingIdCheckoutOptions) => { 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(/\/+$/, '')}/v1/reservation/booking/${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 };