"use strict";
/*
 * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
 */
Object.defineProperty(exports, "__esModule", { value: true });
exports.Schedules = void 0;
const schedulesCreate_js_1 = require("../funcs/schedulesCreate.js");
const schedulesDelete_js_1 = require("../funcs/schedulesDelete.js");
const schedulesList_js_1 = require("../funcs/schedulesList.js");
const schedulesRetrieve_js_1 = require("../funcs/schedulesRetrieve.js");
const schedulesTrigger_js_1 = require("../funcs/schedulesTrigger.js");
const schedulesUpdate_js_1 = require("../funcs/schedulesUpdate.js");
const sdks_js_1 = require("../lib/sdks.js");
const fp_js_1 = require("../types/fp.js");
class Schedules extends sdks_js_1.ClientSDK {
    /**
     * List schedules
     *
     * @remarks
     * Lists all schedules attached to the specified agent, most recent first.
     */
    async list(request, options) {
        return (0, fp_js_1.unwrapAsync)((0, schedulesList_js_1.schedulesList)(this, request, options));
    }
    /**
     * Create schedule
     *
     * @remarks
     * Creates a schedule that runs the agent on a recurring or one-off cadence. The minimum firing interval is 1 hour for `cron` and `interval`; `once` schedules are exempt.
     */
    async create(request, options) {
        return (0, fp_js_1.unwrapAsync)((0, schedulesCreate_js_1.schedulesCreate)(this, request, options));
    }
    /**
     * Delete schedule
     *
     * @remarks
     * Permanently removes a schedule from NATS, Mongo, and the Redis cache.
     */
    async delete(request, options) {
        return (0, fp_js_1.unwrapAsync)((0, schedulesDelete_js_1.schedulesDelete)(this, request, options));
    }
    /**
     * Retrieve schedule
     *
     * @remarks
     * Retrieves a single schedule by ID.
     */
    async retrieve(request, options) {
        return (0, fp_js_1.unwrapAsync)((0, schedulesRetrieve_js_1.schedulesRetrieve)(this, request, options));
    }
    /**
     * Update schedule
     *
     * @remarks
     * Partially updates a schedule. Any omitted field is left unchanged. Changing `expression` or `type` (or reactivating from inactive) re-publishes the NATS schedule and bumps `generation`; payload-only and `agent_tag`-only changes leave the firing cadence in place.
     */
    async update(request, options) {
        return (0, fp_js_1.unwrapAsync)((0, schedulesUpdate_js_1.schedulesUpdate)(this, request, options));
    }
    /**
     * Trigger schedule execution
     *
     * @remarks
     * Runs the schedule's payload immediately (≈10 seconds after the request, to stay above the NATS scheduler's minimum deliver-at margin). The schedule's regular cadence is unaffected. Inactive schedules return 400.
     */
    async trigger(request, options) {
        return (0, fp_js_1.unwrapAsync)((0, schedulesTrigger_js_1.schedulesTrigger)(this, request, options));
    }
}
exports.Schedules = Schedules;
//# sourceMappingURL=schedules.js.map