export type GetApiReportingAfternoonDieteticStatsEmailArgs = {user_id: number, reference_datetime?: string | undefined}; export type GetApiReportingAfternoonDieteticStatsEmailOptions = {baseUrl: string, bearerAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Get current email admin report * * GET /reporting/afternoon_dietetic_stats_email */ export const getApiReportingAfternoonDieteticStatsEmail = async (args: GetApiReportingAfternoonDieteticStatsEmailArgs, options: GetApiReportingAfternoonDieteticStatsEmailOptions) => { const {baseUrl, fetch: fetchFn = fetch, bearerAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.user_id != null) query.append("user_id", String(args.user_id)) if (args.reference_datetime != null) query.append("reference_datetime", String(args.reference_datetime)) if (bearerAuth !== undefined) headers.set('authorization', `Bearer ${bearerAuth}`) const url = `${baseUrl.replace(/\/+$/, '')}/reporting/afternoon_dietetic_stats_email${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "GET", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };