"use strict";
/*
 * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
 */
Object.defineProperty(exports, "__esModule", { value: true });
exports.ManagementKeys = void 0;
const managementKeysCreate_js_1 = require("../funcs/managementKeysCreate.js");
const managementKeysDelete_js_1 = require("../funcs/managementKeysDelete.js");
const managementKeysGet_js_1 = require("../funcs/managementKeysGet.js");
const managementKeysList_js_1 = require("../funcs/managementKeysList.js");
const managementKeysListCapabilities_js_1 = require("../funcs/managementKeysListCapabilities.js");
const managementKeysUpdate_js_1 = require("../funcs/managementKeysUpdate.js");
const sdks_js_1 = require("../lib/sdks.js");
const fp_js_1 = require("../types/fp.js");
class ManagementKeys extends sdks_js_1.ClientSDK {
    /**
     * List management keys
     *
     * @remarks
     * Returns management keys in 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, managementKeysList_js_1.managementKeysList)(this, request, options));
    }
    /**
     * Create a new management key
     *
     * @remarks
     * Mints a new opaque management 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, managementKeysCreate_js_1.managementKeysCreate)(this, request, options));
    }
    /**
     * List management capability catalog
     *
     * @remarks
     * Returns the management capability catalog: the set of workspace-admin permission domains that can be granted to a management key. Each entry includes the domain id, display name, group, and the read / write verb support. Drives the permissions UI in the dashboard.
     */
    async listCapabilities(options) {
        return (0, fp_js_1.unwrapAsync)((0, managementKeysListCapabilities_js_1.managementKeysListCapabilities)(this, options));
    }
    /**
     * Retrieve a management key
     *
     * @remarks
     * Retrieves the metadata for an existing management key by its unique identifier. The raw secret is never returned — only `token_prefix`, `permission_mode`, and lifecycle fields.
     */
    async get(request, options) {
        return (0, fp_js_1.unwrapAsync)((0, managementKeysGet_js_1.managementKeysGet)(this, request, options));
    }
    /**
     * Delete a management key
     *
     * @remarks
     * Permanently deletes a management key. Cache entries 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, managementKeysDelete_js_1.managementKeysDelete)(this, request, options));
    }
    /**
     * Update a management key
     *
     * @remarks
     * Updates mutable fields of a management key: display name, status (active / disabled / revoked), permission mode and access map, and expiry. Omitted fields keep their current values.
     */
    async update(request, options) {
        return (0, fp_js_1.unwrapAsync)((0, managementKeysUpdate_js_1.managementKeysUpdate)(this, request, options));
    }
}
exports.ManagementKeys = ManagementKeys;
//# sourceMappingURL=managementkeys.js.map