export type LodgifyApiPublicReservationsModelsV1BookingCheckInDto = {time: unknown}; export type UpdateApiV1ReservationBookingIdCheckinArgs = {id: number, body: LodgifyApiPublicReservationsModelsV1BookingCheckInDto}; export type UpdateApiV1ReservationBookingIdCheckinOptions = {baseUrl?: string | undefined, ApiKey?: string | undefined, fetch?: typeof fetch | undefined}; /** * Sets the check-in time for a booking. * * PUT /v1/reservation/booking/{id}/checkin */ export const updateApiV1ReservationBookingIdCheckin = async (args: UpdateApiV1ReservationBookingIdCheckinArgs, options?: UpdateApiV1ReservationBookingIdCheckinOptions) => { 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))}/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 };