export type UpdateApiV1ReservationEnquiryIdReopenArgs = {id: number}; export type UpdateApiV1ReservationEnquiryIdReopenOptions = {baseUrl?: string | undefined, ApiKey?: string | undefined, fetch?: typeof fetch | undefined}; /** * Reopens an enquiry, changing its status to Open. * * PUT /v1/reservation/enquiry/{id}/reopen */ export const updateApiV1ReservationEnquiryIdReopen = async (args: UpdateApiV1ReservationEnquiryIdReopenArgs, options?: UpdateApiV1ReservationEnquiryIdReopenOptions) => { const {baseUrl = "https://api.lodgify.com", fetch: fetchFn = fetch, ApiKey} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (ApiKey !== undefined) headers.set("X-ApiKey", ApiKey) const url = `${baseUrl.replace(/\/+$/, '')}/v1/reservation/enquiry/${encodeURIComponent(String(args.id))}/reopen${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 };