export type GetApiV1AnalyticsAppsAppIdTemplatesTemplateIdNotificationsArgs = {appId: number, templateId: number, fromDate: string, toDate: string, page: number, limit: number}; export type GetApiV1AnalyticsAppsAppIdTemplatesTemplateIdNotificationsOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * GET /v1/analytics/apps/{appId}/templates/{templateId}/notifications */ export const getApiV1AnalyticsAppsAppIdTemplatesTemplateIdNotifications = async (args: GetApiV1AnalyticsAppsAppIdTemplatesTemplateIdNotificationsArgs, options: GetApiV1AnalyticsAppsAppIdTemplatesTemplateIdNotificationsOptions) => { const {baseUrl, fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.fromDate != null) query.append("fromDate", String(args.fromDate)) if (args.toDate != null) query.append("toDate", String(args.toDate)) if (args.page != null) query.append("page", String(args.page)) if (args.limit != null) query.append("limit", String(args.limit)) const url = `${baseUrl.replace(/\/+$/, '')}/v1/analytics/apps/${encodeURIComponent(String(args.appId))}/templates/${encodeURIComponent(String(args.templateId))}/notifications${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 };