export type DeleteApiBookingFlightOrdersFlightOrderIdOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Cancel a given flight order * * DELETE /booking/flight-orders/{flight-orderId} */ export const deleteApiBookingFlightOrdersFlightOrderId = async (options?: DeleteApiBookingFlightOrdersFlightOrderIdOptions) => { const {baseUrl = "https://test.api.amadeus.com/v1", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() const url = `${baseUrl.replace(/\/+$/, '')}/booking/flight-orders/${encodeURIComponent(String(args['flight-orderId']))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "DELETE", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };