export type DriverStatus = {TimeStamp?: string | undefined, EstimatedPickupTime?: string | undefined, EstimatedDeliveryTime?: string | undefined, DriverName?: string | undefined, DriverContactNumber?: string | undefined, Event?: ('DriverAssigned' | 'DriverAtRestaurant' | 'OnItsWay' | 'AtDeliveryAddress' | 'Delivered') | undefined, OrderId?: string | undefined}; export type UpdateApiDriverAtRestaurantArgs = {body: DriverStatus}; export type UpdateApiDriverAtRestaurantOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Driver at restaurant * * PUT /driver-at-restaurant */ export const updateApiDriverAtRestaurant = async (args: UpdateApiDriverAtRestaurantArgs, options?: UpdateApiDriverAtRestaurantOptions) => { const {baseUrl = "https://uk.api.just-eat.io", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") const url = `${baseUrl.replace(/\/+$/, '')}/driver-at-restaurant${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "PUT", headers, body: JSON.stringify(args.body)}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };