export type CreateApiCompaniesCompanyIdReportsLiabilitiesLoansOptions = {baseUrl?: string | undefined, authHeader?: string | undefined, fetch?: typeof fetch | undefined}; /** * Generate loan summaries report * * POST /companies/{companyId}/reports/liabilities/loans */ export const createApiCompaniesCompanyIdReportsLiabilitiesLoans = async (options?: CreateApiCompaniesCompanyIdReportsLiabilitiesLoansOptions) => { const {baseUrl = "https://api.codat.io", fetch: fetchFn = fetch, authHeader} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (authHeader !== undefined) headers.set("Authorization", authHeader) const url = `${baseUrl.replace(/\/+$/, '')}/companies/${encodeURIComponent(String(args.companyId))}/reports/liabilities/loans${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };