/** * This file was auto-generated by Fern from our API Definition. */ import * as environments from "../../../../environments.js"; import * as core from "../../../../core/index.js"; import * as Ittybit from "../../../index.js"; export declare namespace Automations { interface Options { environment?: core.Supplier; /** Specify a custom URL to connect the client to. */ baseUrl?: core.Supplier; apiKey?: core.Supplier; /** Override the ACCEPT_VERSION header */ version?: core.Supplier; /** Additional headers to include in requests. */ headers?: Record | undefined>; 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 ACCEPT_VERSION header */ version?: string | undefined; /** Additional query string parameters to include in the request. */ queryParams?: Record; /** Additional headers to include in the request. */ headers?: Record | undefined>; } } /** * You can use the `/automations` and `/automations/{id}` endpoints to manage automated workflows. */ export declare class Automations { protected readonly _options: Automations.Options; constructor(_options?: Automations.Options); /** * Retrieves a paginated list of all automations for the current project. * * @param {Ittybit.AutomationsListRequest} request * @param {Automations.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.automations.list() */ list(request?: Ittybit.AutomationsListRequest, requestOptions?: Automations.RequestOptions): core.HttpResponsePromise; private __list; /** * Creates a new automation. * * @param {Ittybit.AutomationsCreateRequest} request * @param {Automations.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.automations.create({ * name: "My Example Automation", * description: "This workflow will run whenever new media is created.", * trigger: { * kind: "event", * event: "media.created" * }, * workflow: [{ * kind: "description" * }, { * kind: "image", * ref: "thumbnail" * }, { * kind: "video", * next: [{ * kind: "subtitles", * ref: "subtitles" * }] * }], * status: "active" * }) */ create(request: Ittybit.AutomationsCreateRequest, requestOptions?: Automations.RequestOptions): core.HttpResponsePromise; private __create; /** * Retrieve the automation object for a automation with the given ID. * * @param {string} id * @param {Automations.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.automations.get("auto_abcdefgh1234") */ get(id: string, requestOptions?: Automations.RequestOptions): core.HttpResponsePromise; private __get; /** * Permanently removes an automation from the system. This action cannot be undone. * * @param {string} id * @param {Automations.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.automations.delete("auto_abcdefgh1234") */ delete(id: string, requestOptions?: Automations.RequestOptions): core.HttpResponsePromise; private __delete; /** * Updates an automation's `name`, `description`, `trigger`, `workflow`, or `status`. Only the specified fields will be updated. * * @param {string} id * @param {Ittybit.AutomationsUpdateRequest} request * @param {Automations.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.automations.update("auto_abcdefgh1234", { * name: "My Updated Automation", * workflow: [{ * kind: "nsfw" * }, { * kind: "description" * }, { * kind: "image", * ref: "big_thumbnail" * }, { * kind: "video", * next: [{ * kind: "subtitle", * ref: "subtitle" * }] * }], * status: "active" * }) */ update(id: string, request?: Ittybit.AutomationsUpdateRequest, requestOptions?: Automations.RequestOptions): core.HttpResponsePromise; private __update; protected _getAuthorizationHeader(): Promise; }