"use strict";
/*
 * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
 */
Object.defineProperty(exports, "__esModule", { value: true });
exports.ApiKeys = void 0;
const apiKeysCreate_js_1 = require("../funcs/apiKeysCreate.js");
const apiKeysDelete_js_1 = require("../funcs/apiKeysDelete.js");
const apiKeysGet_js_1 = require("../funcs/apiKeysGet.js");
const apiKeysList_js_1 = require("../funcs/apiKeysList.js");
const apiKeysListCapabilities_js_1 = require("../funcs/apiKeysListCapabilities.js");
const apiKeysUpdate_js_1 = require("../funcs/apiKeysUpdate.js");
const sdks_js_1 = require("../lib/sdks.js");
const fp_js_1 = require("../types/fp.js");
class ApiKeys extends sdks_js_1.ClientSDK {
    /**
     * List API keys
     *
     * @remarks
     * Returns API keys visible to the current workspace, ordered by creation time with the newest key first. The `api_key` and `token_hash` fields are never returned by this endpoint; only `token_prefix` is included.
     */
    async list(request, options) {
        return (0, fp_js_1.unwrapAsync)((0, apiKeysList_js_1.apiKeysList)(this, request, options));
    }
    /**
     * Create a new API key
     *
     * @remarks
     * Mints a new opaque API key (`sk-orq-<key_id>-<secret>`) in the workspace. The raw secret is returned ONCE in the response and is never retrievable afterwards. The stored record retains only `token_prefix` and a SHA-256 `token_hash`.
     */
    async create(request, options) {
        return (0, fp_js_1.unwrapAsync)((0, apiKeysCreate_js_1.apiKeysCreate)(this, request, options));
    }
    /**
     * List capability catalog
     *
     * @remarks
     * Returns the capability catalog: the set of permission domains that can be granted to an API key. Each entry includes the domain id, display name, group, allowed project scopes, and the read / write verb sets resolved at authorize() time. Drives the permissions UI in the dashboard.
     */
    async listCapabilities(options) {
        return (0, fp_js_1.unwrapAsync)((0, apiKeysListCapabilities_js_1.apiKeysListCapabilities)(this, options));
    }
    /**
     * Retrieve an API key
     *
     * @remarks
     * Retrieves the metadata for an existing API key by its unique identifier. The raw secret is never returned — only `token_prefix`, `permission_mode`, `project_scope`, and lifecycle fields.
     */
    async get(request, options) {
        return (0, fp_js_1.unwrapAsync)((0, apiKeysGet_js_1.apiKeysGet)(this, request, options));
    }
    /**
     * Delete an API key
     *
     * @remarks
     * Permanently deletes an API key. Cache entries in `API_KEYS_KV` are invalidated immediately so an in-flight token cannot ride out the TTL. The response body is empty on success.
     */
    async delete(request, options) {
        return (0, fp_js_1.unwrapAsync)((0, apiKeysDelete_js_1.apiKeysDelete)(this, request, options));
    }
    /**
     * Update an API key
     *
     * @remarks
     * Updates mutable fields of an API key: display name, status (active / disabled / revoked), permission mode and access map, project scope, and constraints (budget / rate limit / expiry). Omitted fields keep their current values.
     */
    async update(request, options) {
        return (0, fp_js_1.unwrapAsync)((0, apiKeysUpdate_js_1.apiKeysUpdate)(this, request, options));
    }
}
exports.ApiKeys = ApiKeys;
//# sourceMappingURL=apikeys.js.map