export type LodgifyApiPublicReservationsModelsV2ReservationsBookingsBookingCheckInDto = {time: unknown}; export type UpdateApiV2ReservationsBookingsIdCheckinArgs = {id: number, body: LodgifyApiPublicReservationsModelsV2ReservationsBookingsBookingCheckInDto}; export type UpdateApiV2ReservationsBookingsIdCheckinOptions = {baseUrl?: string | undefined, ApiKey?: string | undefined, fetch?: typeof fetch | undefined}; /** * Checkin a booking at the specified time * * PUT /v2/reservations/bookings/{id}/checkin */ export const updateApiV2ReservationsBookingsIdCheckin = async (args: UpdateApiV2ReservationsBookingsIdCheckinArgs, options?: UpdateApiV2ReservationsBookingsIdCheckinOptions) => { 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))}/checkin${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 };