UNPKG

orb-billing

Version:

The official TypeScript library for the Orb API

44 lines 1.82 kB
"use strict"; // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. Object.defineProperty(exports, "__esModule", { value: true }); exports.BillableMetricsPage = exports.Metrics = void 0; const resource_1 = require("../resource.js"); const core_1 = require("../core.js"); const pagination_1 = require("../pagination.js"); class Metrics extends resource_1.APIResource { /** * This endpoint is used to create a [metric](/core-concepts###metric) using a SQL * string. See [SQL support](/extensibility/advanced-metrics#sql-support) for a * description of constructing SQL queries with examples. */ create(body, options) { return this._client.post('/metrics', { body, ...options }); } /** * This endpoint allows you to update the `metadata` property on a metric. If you * pass `null` for the metadata value, it will clear any existing metadata for that * invoice. */ update(metricId, body, options) { return this._client.put(`/metrics/${metricId}`, { body, ...options }); } list(query = {}, options) { if ((0, core_1.isRequestOptions)(query)) { return this.list({}, query); } return this._client.getAPIList('/metrics', BillableMetricsPage, { query, ...options }); } /** * This endpoint is used to list [metrics](/core-concepts#metric). It returns * information about the metrics including its name, description, and item. */ fetch(metricId, options) { return this._client.get(`/metrics/${metricId}`, options); } } exports.Metrics = Metrics; class BillableMetricsPage extends pagination_1.Page { } exports.BillableMetricsPage = BillableMetricsPage; Metrics.BillableMetricsPage = BillableMetricsPage; //# sourceMappingURL=metrics.js.map