export type Justification = {reason?: ('AlreadyRefunded' | 'ItemReplaced' | 'PartialRefundRequired' | 'WasNotMissing' | 'WillRedeliver' | 'OrderWasHot' | 'OrderWasOnTime' | 'OrderWasPacked' | 'FoodWasIntact' | 'AddExtraItem' | 'Other') | undefined, comments?: (string | null) | undefined} | null; export type UpdateApiRestaurantsTenantRestaurantIdCustomerclaimsIdRestaurantresponseJustificationArgs = {tenant: string, restaurantId: string, id: string, 'Content-Type': string, body: Justification}; export type UpdateApiRestaurantsTenantRestaurantIdCustomerclaimsIdRestaurantresponseJustificationOptions = {baseUrl?: string | undefined, Bearer?: string | undefined, fetch?: typeof fetch | undefined}; /** * Add reason and comments to the response * * PUT /restaurants/{tenant}/{restaurantId}/customerclaims/{id}/restaurantresponse/justification */ export const updateApiRestaurantsTenantRestaurantIdCustomerclaimsIdRestaurantresponseJustification = async (args: UpdateApiRestaurantsTenantRestaurantIdCustomerclaimsIdRestaurantresponseJustificationArgs, options?: UpdateApiRestaurantsTenantRestaurantIdCustomerclaimsIdRestaurantresponseJustificationOptions) => { const {baseUrl = "https://uk.api.just-eat.io", fetch: fetchFn = fetch, Bearer} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (args['Content-Type'] != null) headers.set("Content-Type", String(args['Content-Type'])) if (Bearer !== undefined) headers.set('authorization', `Bearer ${Bearer}`) const url = `${baseUrl.replace(/\/+$/, '')}/restaurants/${encodeURIComponent(String(args.tenant))}/${encodeURIComponent(String(args.restaurantId))}/customerclaims/${encodeURIComponent(String(args.id))}/restaurantresponse/justification${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 };