export type TimeRange = {from?: string | undefined, to?: string | undefined}; export type LicenseBasedReportRequest = {invoiceProfileId?: (number | null) | undefined, customerAccountId?: number | undefined, timeRange?: TimeRange | undefined, cloudAccountId?: (number | null) | undefined, includeOnlyActiveSubscriptions?: (boolean | null) | undefined}; export type CreateApiApiV1ExportsGenerateLicenseReportArgs = {body: LicenseBasedReportRequest}; export type CreateApiApiV1ExportsGenerateLicenseReportOptions = {baseUrl: string, Bearer?: string | undefined, fetch?: typeof fetch | undefined}; /** * POST /api/v1/Exports/generate-license-report */ export const createApiApiV1ExportsGenerateLicenseReport = async (args: CreateApiApiV1ExportsGenerateLicenseReportArgs, options: CreateApiApiV1ExportsGenerateLicenseReportOptions) => { const {baseUrl, fetch: fetchFn = fetch, Bearer} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (Bearer !== undefined) headers.set("Authorization", Bearer) const url = `${baseUrl.replace(/\/+$/, '')}/api/v1/Exports/generate-license-report${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", headers, body: JSON.stringify(args.body)}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };