import { WorkspaceScopedResource, extractData } from './base.js';
/**
 * Metrics — computed metric catalog and typed metric values.
 */
export class MetricsResource extends WorkspaceScopedResource {
    /** List the latest value for each metric in the workspace */
    async listLatest() {
        return extractData(await this.client.GET('/v1/{workspace_id}/metrics', {
            params: { path: { workspace_id: this.workspaceId } },
        }));
    }
    /** List available built-in and custom metric definitions */
    async getCatalog() {
        return extractData(await this.client.GET('/v1/{workspace_id}/metrics/catalog', {
            params: { path: { workspace_id: this.workspaceId } },
        }));
    }
    /** Get stored values for one metric key, optionally bounded by time range */
    async getValues(metricKey, params) {
        return extractData(await this.client.GET('/v1/{workspace_id}/metrics/{metric_key}', {
            params: {
                path: { workspace_id: this.workspaceId, metric_key: metricKey },
                query: params,
            },
        }));
    }
    /** Get a recent time-series trend for one metric key */
    async getTrend(metricKey, params) {
        return extractData(await this.client.GET('/v1/{workspace_id}/metrics/{metric_key}/trend', {
            params: {
                path: { workspace_id: this.workspaceId, metric_key: metricKey },
                query: params,
            },
        }));
    }
}
//# sourceMappingURL=metrics.js.map