import { WorkspaceScopedResource, extractData } from './base.js';
/**
 * Billing — dashboard, usage summaries, invoices, and usage trends.
 */
export class BillingResource extends WorkspaceScopedResource {
    /** Get composite billing dashboard — KPIs, period comparison, top meters, invoice summary */
    async getDashboard() {
        return extractData(await this.client.GET('/v1/{workspace_id}/billing/dashboard', {
            params: { path: { workspace_id: this.workspaceId } },
        }));
    }
    /** Get usage summary for the workspace */
    async getUsage() {
        return extractData(await this.client.GET('/v1/{workspace_id}/billing/usage', {
            params: { path: { workspace_id: this.workspaceId } },
        }));
    }
    /** Get usage time-series per meter for trend charts */
    async getUsageTrends(params) {
        return extractData(await this.client.GET('/v1/{workspace_id}/billing/usage/trends', {
            params: { path: { workspace_id: this.workspaceId }, query: params },
        }));
    }
    /** List invoices for the workspace */
    async listInvoices(params) {
        return extractData(await this.client.GET('/v1/{workspace_id}/billing/invoices', {
            params: { path: { workspace_id: this.workspaceId }, query: params },
        }));
    }
    listInvoicesAutoPaging(params) {
        return this.iteratePaginatedList((pageParams) => this.listInvoices(pageParams), params);
    }
    /** Get invoice detail */
    async getInvoice(invoiceId) {
        return extractData(await this.client.GET('/v1/{workspace_id}/billing/invoices/{invoice_id}', {
            params: { path: { workspace_id: this.workspaceId, invoice_id: invoiceId } },
        }));
    }
    /** Get presigned S3 URL for invoice PDF download */
    async getInvoicePdf(invoiceId) {
        return extractData(await this.client.GET('/v1/{workspace_id}/billing/invoices/{invoice_id}/pdf', {
            params: { path: { workspace_id: this.workspaceId, invoice_id: invoiceId } },
        }));
    }
}
//# sourceMappingURL=billing.js.map