export type GetApiBookingsBookingIdProposalsIdActArgs = {booking_id: number, id: number, action: string}; export type GetApiBookingsBookingIdProposalsIdActOptions = {baseUrl: string, Bearer?: string | undefined, fetch?: typeof fetch | undefined}; /** * Accept or decline the open proposal * * GET /bookings/{booking_id}/proposals/{id}/act * * Also accepts auth: API-Key */ export const getApiBookingsBookingIdProposalsIdAct = async (args: GetApiBookingsBookingIdProposalsIdActArgs, options: GetApiBookingsBookingIdProposalsIdActOptions) => { const {baseUrl, fetch: fetchFn = fetch, Bearer} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.action != null) query.append("action", String(args.action)) if (Bearer !== undefined) headers.set("Authorization", Bearer) const url = `${baseUrl.replace(/\/+$/, '')}/bookings/${encodeURIComponent(String(args.booking_id))}/proposals/${encodeURIComponent(String(args.id))}/act${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "GET", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };