export type AttemptedDeliveryResponseReceived = {OrderId?: string | undefined, Tenant?: string | undefined, Update?: string | undefined, Notes?: string | undefined}; export type UpdateApiRedeliveryRequestedArgs = {body: AttemptedDeliveryResponseReceived}; export type UpdateApiRedeliveryRequestedOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Customer Requested Redelivery * * PUT /redelivery-requested */ export const updateApiRedeliveryRequested = async (args: UpdateApiRedeliveryRequestedArgs, options?: UpdateApiRedeliveryRequestedOptions) => { 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(/\/+$/, '')}/redelivery-requested${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 };