import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.js"; import { type NormalizedClientOptionsWithAuth } from "../../../../BaseClient.js"; import * as core from "../../../../core/index.js"; import * as Rulebricks from "../../../index.js"; import { ObjectsClient } from "../resources/objects/client/Client.js"; import { RelationshipsClient } from "../resources/relationships/client/Client.js"; export declare namespace ContextsClient { type Options = BaseClientOptions; interface RequestOptions extends BaseRequestOptions { } } /** * Operations for managing and interacting with live Context instances */ export declare class ContextsClient { protected readonly _options: NormalizedClientOptionsWithAuth; protected _objects: ObjectsClient | undefined; protected _relationships: RelationshipsClient | undefined; constructor(options: ContextsClient.Options); get objects(): ObjectsClient; get relationships(): RelationshipsClient; /** * Retrieve the current state of a context instance. * * @param {Rulebricks.GetContextsRequest} request * @param {ContextsClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Rulebricks.NotFoundError} * @throws {@link Rulebricks.InternalServerError} * * @example * await client.contexts.get({ * slug: "customer", * instance: "cust-12345" * }) */ get(request: Rulebricks.GetContextsRequest, requestOptions?: ContextsClient.RequestOptions): core.HttpResponsePromise; private __get; /** * Submit data to a context instance, creating it if it doesn't exist. May trigger bound rule/flow evaluations. * * @param {Rulebricks.SubmitContextsRequest} request * @param {ContextsClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Rulebricks.BadRequestError} * @throws {@link Rulebricks.NotFoundError} * @throws {@link Rulebricks.InternalServerError} * * @example * await client.contexts.submit({ * slug: "customer", * instance: "cust-12345", * body: { * "email": "customer@example.com", * "age": 30 * } * }) */ submit(request: Rulebricks.SubmitContextsRequest, requestOptions?: ContextsClient.RequestOptions): core.HttpResponsePromise; private __submit; /** * Delete a specific context instance and its history. * * @param {Rulebricks.DeleteContextsRequest} request * @param {ContextsClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Rulebricks.NotFoundError} * @throws {@link Rulebricks.InternalServerError} * * @example * await client.contexts.delete({ * slug: "customer", * instance: "cust-12345" * }) */ delete(request: Rulebricks.DeleteContextsRequest, requestOptions?: ContextsClient.RequestOptions): core.HttpResponsePromise; private __delete; /** * Retrieve the change history for a context instance. * * @param {Rulebricks.GetHistoryContextsRequest} request * @param {ContextsClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Rulebricks.NotFoundError} * @throws {@link Rulebricks.InternalServerError} * * @example * await client.contexts.getHistory({ * slug: "customer", * instance: "cust-12345" * }) */ getHistory(request: Rulebricks.GetHistoryContextsRequest, requestOptions?: ContextsClient.RequestOptions): core.HttpResponsePromise; private __getHistory; /** * Get list of rules/flows that need to be evaluated for this instance. * * @param {Rulebricks.GetPendingContextsRequest} request * @param {ContextsClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Rulebricks.NotFoundError} * @throws {@link Rulebricks.InternalServerError} * * @example * await client.contexts.getPending({ * slug: "customer", * instance: "cust-12345" * }) */ getPending(request: Rulebricks.GetPendingContextsRequest, requestOptions?: ContextsClient.RequestOptions): core.HttpResponsePromise; private __getPending; /** * Execute a specific rule using the context instance's state as input. * * @param {Rulebricks.SolveContextsRequest} request * @param {ContextsClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Rulebricks.BadRequestError} * @throws {@link Rulebricks.NotFoundError} * @throws {@link Rulebricks.InternalServerError} * * @example * await client.contexts.solve({ * slug: "customer", * instance: "cust-12345", * ruleSlug: "eligibility-check", * body: {} * }) */ solve(request: Rulebricks.SolveContextsRequest, requestOptions?: ContextsClient.RequestOptions): core.HttpResponsePromise; private __solve; /** * Trigger re-evaluation of all bound rules and flows for the instance. * * @param {Rulebricks.CascadeContextsRequest} request * @param {ContextsClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Rulebricks.NotFoundError} * @throws {@link Rulebricks.InternalServerError} * * @example * await client.contexts.cascade({ * slug: "customer", * instance: "cust-12345", * body: {} * }) */ cascade(request: Rulebricks.CascadeContextsRequest, requestOptions?: ContextsClient.RequestOptions): core.HttpResponsePromise; private __cascade; /** * Execute a specific flow using the context instance's state as input. * * @param {Rulebricks.ExecuteContextsRequest} request * @param {ContextsClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Rulebricks.BadRequestError} * @throws {@link Rulebricks.NotFoundError} * @throws {@link Rulebricks.InternalServerError} * * @example * await client.contexts.execute({ * slug: "customer", * instance: "cust-12345", * flowSlug: "onboarding-flow", * body: {} * }) */ execute(request: Rulebricks.ExecuteContextsRequest, requestOptions?: ContextsClient.RequestOptions): core.HttpResponsePromise; private __execute; }