export type UpdateApiV1ReservationBookingIdTentativeArgs = {id: number, requestPayment?: boolean | undefined}; export type UpdateApiV1ReservationBookingIdTentativeOptions = {baseUrl?: string | undefined, ApiKey?: string | undefined, fetch?: typeof fetch | undefined}; /** * Sets a booking as tentative * * PUT /v1/reservation/booking/{id}/tentative */ export const updateApiV1ReservationBookingIdTentative = async (args: UpdateApiV1ReservationBookingIdTentativeArgs, options?: UpdateApiV1ReservationBookingIdTentativeOptions) => { const {baseUrl = "https://api.lodgify.com", fetch: fetchFn = fetch, ApiKey} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.requestPayment != null) query.append("requestPayment", String(args.requestPayment)) if (ApiKey !== undefined) headers.set("X-ApiKey", ApiKey) const url = `${baseUrl.replace(/\/+$/, '')}/v1/reservation/booking/${encodeURIComponent(String(args.id))}/tentative${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "PUT", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };