"use strict";
/*
 * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
 */
Object.defineProperty(exports, "__esModule", { value: true });
exports.Budgets = void 0;
const budgetsCheck_js_1 = require("../funcs/budgetsCheck.js");
const budgetsCreate_js_1 = require("../funcs/budgetsCreate.js");
const budgetsDelete_js_1 = require("../funcs/budgetsDelete.js");
const budgetsGet_js_1 = require("../funcs/budgetsGet.js");
const budgetsGetConsumption_js_1 = require("../funcs/budgetsGetConsumption.js");
const budgetsList_js_1 = require("../funcs/budgetsList.js");
const budgetsResetConsumption_js_1 = require("../funcs/budgetsResetConsumption.js");
const budgetsUpdate_js_1 = require("../funcs/budgetsUpdate.js");
const sdks_js_1 = require("../lib/sdks.js");
const fp_js_1 = require("../types/fp.js");
class Budgets extends sdks_js_1.ClientSDK {
    /**
     * List budgets
     *
     * @remarks
     * Returns budgets visible to the current workspace, ordered by creation time with the newest first. Supports filtering by scope kind, scope target id, period, and active state, plus an optional free-text query that searches across denormalized target names via Typesense.
     */
    async list(request, options) {
        return (0, fp_js_1.unwrapAsync)((0, budgetsList_js_1.budgetsList)(this, request, options));
    }
    /**
     * Create a new budget
     *
     * @remarks
     * Creates a new budget in the workspace. Exactly one scope variant must be set (workspace / project / identity / api_key / provider / model). At least one of `limits.amount`, `limits.token_limit`, or `rate_limit.requests_per_minute` MUST be provided. Uniqueness is enforced across (workspace_id, scope_kind, scope_target_id).
     */
    async create(request, options) {
        return (0, fp_js_1.unwrapAsync)((0, budgetsCreate_js_1.budgetsCreate)(this, request, options));
    }
    /**
     * Check budget enforcement
     *
     * @remarks
     * Internal endpoint used by the gateway to resolve applicable budgets and check enforcement gates for a request. Returns allowed/rejected status with dimension info for rate-limit headers.
     */
    async check(request, options) {
        return (0, fp_js_1.unwrapAsync)((0, budgetsCheck_js_1.budgetsCheck)(this, request, options));
    }
    /**
     * Retrieve a budget
     *
     * @remarks
     * Retrieves the metadata for an existing budget by its unique identifier. Returns `NotFound` when the budget does not exist in the caller's workspace.
     */
    async get(request, options) {
        return (0, fp_js_1.unwrapAsync)((0, budgetsGet_js_1.budgetsGet)(this, request, options));
    }
    /**
     * Delete a budget
     *
     * @remarks
     * Permanently deletes a budget. Consumption counters in Redis for this budget are cleared immediately. The response body is empty on success.
     */
    async delete(request, options) {
        return (0, fp_js_1.unwrapAsync)((0, budgetsDelete_js_1.budgetsDelete)(this, request, options));
    }
    /**
     * Update a budget
     *
     * @remarks
     * Updates mutable fields of a budget: limits, rate limit, activation, and expiration. The scope is immutable — to change a budget's target, delete and recreate it. Omitted fields keep their current values.
     */
    async update(request, options) {
        return (0, fp_js_1.unwrapAsync)((0, budgetsUpdate_js_1.budgetsUpdate)(this, request, options));
    }
    /**
     * Get current-period consumption
     *
     * @remarks
     * Returns the current-period cost, token, and per-minute request counters for the budget. Values reflect the live Redis state for the active period bucket.
     */
    async getConsumption(request, options) {
        return (0, fp_js_1.unwrapAsync)((0, budgetsGetConsumption_js_1.budgetsGetConsumption)(this, request, options));
    }
    /**
     * Reset budget consumption
     *
     * @remarks
     * Clears the current-period cost, token, and request counters for the budget. The budget record itself is preserved; only the Redis counters are reset.
     */
    async resetConsumption(request, options) {
        return (0, fp_js_1.unwrapAsync)((0, budgetsResetConsumption_js_1.budgetsResetConsumption)(this, request, options));
    }
}
exports.Budgets = Budgets;
//# sourceMappingURL=budgets.js.map