export type GetApiSystemUpdateEventsIdReportArgs = {id: string}; export type GetApiSystemUpdateEventsIdReportOptions = {baseUrl?: string | undefined, APITokens?: string | undefined, fetch?: typeof fetch | undefined}; /** * Get report of campaign * * GET /systemUpdate/events/{id}/report */ export const getApiSystemUpdateEventsIdReport = async (args: GetApiSystemUpdateEventsIdReportArgs, options?: GetApiSystemUpdateEventsIdReportOptions) => { const {baseUrl = "https://rudder.example.com/rudder/api/latest", fetch: fetchFn = fetch, APITokens} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('accept', "text/plain") if (APITokens !== undefined) headers.set("X-API-Token", APITokens) const url = `${baseUrl.replace(/\/+$/, '')}/systemUpdate/events/${encodeURIComponent(String(args.id))}/report${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 res.text() };