// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { APIResource } from '../../core/resource'; import { APIPromise } from '../../core/api-promise'; import { RequestOptions } from '../../internal/request-options'; import { path } from '../../internal/utils/path'; /** * Trigger management and execution */ export class Manage extends APIResource { /** * Updates the status of a trigger instance to enable or disable it. Disabling a * trigger pauses event listening without deleting the trigger configuration. * Re-enabling restores the trigger to its active state. Use this for temporary * maintenance or to control trigger execution. * * @example * ```ts * const manage = await client.triggerInstances.manage.update( * 'triggerId', * { status: 'enable' }, * ); * ``` */ update( triggerID: string, body: ManageUpdateParams, options?: RequestOptions, ): APIPromise { return this._client.patch(path`/api/v3.1/trigger_instances/manage/${triggerID}`, { body, ...options }); } /** * Permanently deletes a trigger instance. This stops the trigger from listening * for events and removes it from your project. Use the PATCH endpoint with status * "disable" if you want to temporarily pause a trigger instead. * * @example * ```ts * const manage = await client.triggerInstances.manage.delete( * 'triggerId', * ); * ``` */ delete(triggerID: string, options?: RequestOptions): APIPromise { return this._client.delete(path`/api/v3.1/trigger_instances/manage/${triggerID}`, options); } } export interface ManageUpdateResponse { /** * Status of the operation */ status: 'success'; } export interface ManageDeleteResponse { /** * The ID of the deleted trigger instance */ trigger_id: string; } export interface ManageUpdateParams { status: 'enable' | 'disable'; } export declare namespace Manage { export { type ManageUpdateResponse as ManageUpdateResponse, type ManageDeleteResponse as ManageDeleteResponse, type ManageUpdateParams as ManageUpdateParams, }; }