export type MenuIngestionComplete = {tenant?: ('au' | 'dk' | 'es' | 'ie' | 'it' | 'no' | 'uk' | 'nz') | undefined, restaurantId?: string | undefined, timestamp?: string | undefined, result?: ('success' | 'fail') | undefined, correlationId?: string | undefined, fault?: ({id?: string | undefined, errors?: (Array<{code?: string | undefined, description?: string | undefined}>) | undefined}) | undefined}; export type CreateApiMenuIngestionCompleteArgs = {body: MenuIngestionComplete}; export type CreateApiMenuIngestionCompleteOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Menu ingestion complete * * POST /menu-ingestion-complete */ export const createApiMenuIngestionComplete = async (args: CreateApiMenuIngestionCompleteArgs, options?: CreateApiMenuIngestionCompleteOptions) => { 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(/\/+$/, '')}/menu-ingestion-complete${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", 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 };