export type GetApiFinancialDatasetsFinancialsAsReportedArgs = {ticker?: string | undefined, period: string, limit?: number | undefined, cik?: string | undefined, cursor?: string | undefined}; export type GetApiFinancialDatasetsFinancialsAsReportedOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Get the as-filed hierarchies for income statement, balance sheet, and cash flow statement in a single API call. Each period contains three nested objects; any one may be null if data is missing. * * GET /financial-datasets/financials/as-reported */ export const getApiFinancialDatasetsFinancialsAsReported = async (args: GetApiFinancialDatasetsFinancialsAsReportedArgs, options?: GetApiFinancialDatasetsFinancialsAsReportedOptions) => { const {baseUrl = "https://api.orthogonal.com/mpp", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.ticker != null) query.append("ticker", String(args.ticker)) if (args.period != null) query.append("period", String(args.period)) if (args.limit != null) query.append("limit", String(args.limit)) if (args.cik != null) query.append("cik", String(args.cik)) if (args.cursor != null) query.append("cursor", String(args.cursor)) const url = `${baseUrl.replace(/\/+$/, '')}/financial-datasets/financials/as-reported${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 };