export type UpdateApiBookingV1ReservationActionsIdUnlockUnitArgs = {id: string}; export type UpdateApiBookingV1ReservationActionsIdUnlockUnitOptions = {baseUrl: string, oauth2?: string | undefined, fetch?: typeof fetch | undefined}; /** * Unlock unit assignment for a reservation. * * PUT /booking/v1/reservation-actions/{id}/unlock-unit */ export const updateApiBookingV1ReservationActionsIdUnlockUnit = async (args: UpdateApiBookingV1ReservationActionsIdUnlockUnitArgs, options: UpdateApiBookingV1ReservationActionsIdUnlockUnitOptions) => { const {baseUrl, fetch: fetchFn = fetch, oauth2} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (oauth2 !== undefined) headers.set('authorization', `Bearer ${oauth2}`) const url = `${baseUrl.replace(/\/+$/, '')}/booking/v1/reservation-actions/${encodeURIComponent(String(args.id))}/unlock-unit${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 };