/** * This file was auto-generated by Fern from our API Definition. */ import * as environments from "../../../../environments"; import * as core from "../../../../core"; import * as Flatfile from "../../../index"; export declare namespace Agents { interface Options { environment?: core.Supplier; /** Specify a custom URL to connect the client to. */ baseUrl?: core.Supplier; token?: core.Supplier; /** Override the X-Disable-Hooks header */ xDisableHooks?: "true"; fetcher?: core.FetchFunction; } interface RequestOptions { /** The maximum time to wait for a response in seconds. */ timeoutInSeconds?: number; /** The number of times to retry the request. Defaults to 2. */ maxRetries?: number; /** A hook to abort the request. */ abortSignal?: AbortSignal; /** Override the X-Disable-Hooks header */ xDisableHooks?: "true"; /** Additional headers to include in the request. */ headers?: Record; } } export declare class Agents { protected readonly _options: Agents.Options; constructor(_options?: Agents.Options); /** * @param {Flatfile.ListAgentsRequest} request * @param {Agents.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.agents.list({ * environmentId: "us_env_YOUR_ID", * pageSize: 20, * pageNumber: 1 * }) */ list(request: Flatfile.ListAgentsRequest, requestOptions?: Agents.RequestOptions): core.HttpResponsePromise; private __list; /** * @param {Flatfile.CreateAgentsRequest} request * @param {Agents.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Flatfile.BadRequestError} * * @example * await client.agents.create({ * environmentId: "us_env_YOUR_ID", * body: { * topics: ["workbook:updated"], * compiler: "js", * source: "module.exports = { routeEvent: async (...args) => { console.log(args) } }", * namespace: "space:blue" * } * }) */ create(request: Flatfile.CreateAgentsRequest, requestOptions?: Agents.RequestOptions): core.HttpResponsePromise; private __create; /** * @param {Flatfile.AgentId} agentId * @param {Flatfile.GetAgentRequest} request * @param {Agents.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Flatfile.BadRequestError} * @throws {@link Flatfile.NotFoundError} * * @example * await client.agents.get("us_ag_YOUR_ID", { * environmentId: "us_env_YOUR_ID" * }) */ get(agentId: Flatfile.AgentId, request?: Flatfile.GetAgentRequest, requestOptions?: Agents.RequestOptions): core.HttpResponsePromise; private __get; /** * @param {Flatfile.AgentId} agentId * @param {Agents.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Flatfile.BadRequestError} * @throws {@link Flatfile.NotFoundError} * * @example * await client.agents.listVersions("agentId") */ listVersions(agentId: Flatfile.AgentId, requestOptions?: Agents.RequestOptions): core.HttpResponsePromise; private __listVersions; /** * @param {Flatfile.AgentId} agentId * @param {Flatfile.AgentVersionId} agentVersionId * @param {Agents.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Flatfile.BadRequestError} * @throws {@link Flatfile.NotFoundError} * * @example * await client.agents.revert("agentId", "agentVersionId") */ revert(agentId: Flatfile.AgentId, agentVersionId: Flatfile.AgentVersionId, requestOptions?: Agents.RequestOptions): core.HttpResponsePromise; private __revert; /** * Lists roles assigned to an agent. * * @param {Flatfile.AgentId} agentId - The agent id * @param {Agents.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Flatfile.BadRequestError} * @throws {@link Flatfile.NotFoundError} * @throws {@link Flatfile.ForbiddenError} * * @example * await client.agents.listAgentRoles("agentId") */ listAgentRoles(agentId: Flatfile.AgentId, requestOptions?: Agents.RequestOptions): core.HttpResponsePromise; private __listAgentRoles; /** * Assigns a role to a agent. * * @param {Flatfile.AgentId} agentId - The agent id * @param {Flatfile.AssignActorRoleRequest} request * @param {Agents.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Flatfile.BadRequestError} * @throws {@link Flatfile.NotFoundError} * @throws {@link Flatfile.ForbiddenError} * * @example * await client.agents.assignAgentRole("agentId", { * roleId: "roleId", * resourceId: "resourceId" * }) */ assignAgentRole(agentId: Flatfile.AgentId, request: Flatfile.AssignActorRoleRequest, requestOptions?: Agents.RequestOptions): core.HttpResponsePromise; private __assignAgentRole; /** * Removes a role from an agent. * * @param {Flatfile.AgentId} agentId - The agent id * @param {Flatfile.ActorRoleId} actorRoleId - The actor role id * @param {Agents.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Flatfile.BadRequestError} * @throws {@link Flatfile.NotFoundError} * @throws {@link Flatfile.ForbiddenError} * * @example * await client.agents.deleteAgentRole("agentId", "actorRoleId") */ deleteAgentRole(agentId: Flatfile.AgentId, actorRoleId: Flatfile.ActorRoleId, requestOptions?: Agents.RequestOptions): core.HttpResponsePromise; private __deleteAgentRole; /** * @param {Flatfile.AgentId} agentId * @param {Flatfile.GetAgentLogsRequest} request * @param {Agents.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Flatfile.BadRequestError} * @throws {@link Flatfile.NotFoundError} * * @example * await client.agents.getAgentLogs("us_ag_YOUR_ID", { * environmentId: "us_env_YOUR_ID" * }) */ getAgentLogs(agentId: Flatfile.AgentId, request: Flatfile.GetAgentLogsRequest, requestOptions?: Agents.RequestOptions): core.HttpResponsePromise; private __getAgentLogs; /** * @param {Flatfile.EventId} eventId * @param {Flatfile.GetAgentLogRequest} request * @param {Agents.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Flatfile.BadRequestError} * @throws {@link Flatfile.NotFoundError} * * @example * await client.agents.getAgentLog("commons.EventId", { * environmentId: "us_env_YOUR_ID" * }) */ getAgentLog(eventId: Flatfile.EventId, request: Flatfile.GetAgentLogRequest, requestOptions?: Agents.RequestOptions): core.HttpResponsePromise; private __getAgentLog; /** * @param {Flatfile.GetEnvironmentAgentLogsRequest} request * @param {Agents.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Flatfile.BadRequestError} * @throws {@link Flatfile.NotFoundError} * * @example * await client.agents.getEnvironmentAgentLogs({ * environmentId: "us_env_YOUR_ID", * spaceId: "us_sp_YOUR_ID", * success: true, * pageSize: 20, * pageNumber: 1 * }) */ getEnvironmentAgentLogs(request: Flatfile.GetEnvironmentAgentLogsRequest, requestOptions?: Agents.RequestOptions): core.HttpResponsePromise; private __getEnvironmentAgentLogs; /** * @param {Flatfile.GetEnvironmentAgentExecutionsRequest} request * @param {Agents.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Flatfile.BadRequestError} * @throws {@link Flatfile.NotFoundError} * * @example * await client.agents.getEnvironmentAgentExecutions({ * environmentId: "us_env_YOUR_ID", * agentId: "us_ag_YOUR_ID", * spaceId: "us_sp_YOUR_ID", * success: true, * pageSize: 20, * pageNumber: 1 * }) */ getEnvironmentAgentExecutions(request: Flatfile.GetEnvironmentAgentExecutionsRequest, requestOptions?: Agents.RequestOptions): core.HttpResponsePromise; private __getEnvironmentAgentExecutions; /** * Deletes a single agent * * @param {Flatfile.AgentId} agentId * @param {Flatfile.DeleteAgentRequest} request * @param {Agents.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Flatfile.BadRequestError} * @throws {@link Flatfile.NotFoundError} * * @example * await client.agents.delete("us_ag_YOUR_ID") */ delete(agentId: Flatfile.AgentId, request?: Flatfile.DeleteAgentRequest, requestOptions?: Agents.RequestOptions): core.HttpResponsePromise; private __delete; protected _getAuthorizationHeader(): Promise; }