export type GetApiApiPublicV1IncidentSearchIncidentIdMarkdownArgs = {incidentId: string}; export type GetApiApiPublicV1IncidentSearchIncidentIdMarkdownOptions = {baseUrl: string, ApiKey?: string | undefined, fetch?: typeof fetch | undefined}; /** * Get incident as markdown * * GET /api/public/v1/incident/search/{incidentId}/markdown */ export const getApiApiPublicV1IncidentSearchIncidentIdMarkdown = async (args: GetApiApiPublicV1IncidentSearchIncidentIdMarkdownArgs, options: GetApiApiPublicV1IncidentSearchIncidentIdMarkdownOptions) => { const {baseUrl, fetch: fetchFn = fetch, ApiKey} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (ApiKey !== undefined) headers.set("Authorization", ApiKey) const url = `${baseUrl.replace(/\/+$/, '')}/api/public/v1/incident/search/${encodeURIComponent(String(args.incidentId))}/markdown${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 };