import * as z from "zod/v3";
import { Result as SafeParseResult } from "../../types/fp.js";
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
import { BudgetLimits } from "./budgetlimits.js";
import { BudgetMatch } from "./budgetmatch.js";
import { BudgetScope } from "./budgetscope.js";
import { BudgetUsage } from "./budgetusage.js";
import { IdentityMetrics } from "./identitymetrics.js";
import { RateLimit } from "./ratelimit.js";
/**
 * Custom JSON metadata stored with the identity.
 */
export type IdentityMetadata = {};
/**
 * The budget scoped to this identity, if one exists. Read-only here:
 *
 * @remarks
 *  budgets are created and managed through the Budgets API
 *  (scope.identity). Present only when requested with `include_budget`.
 *  Live consumption (`usage`) is not attached on this path — call the
 *  Budgets API for current spend.
 */
export type IdentityBudget = {
    budgetId?: string | undefined;
    /**
     * Denormalized metadata for UI rendering, list filters, and the
     *
     * @remarks
     *  resolver's prefilter index. Never consulted for matching — the
     *  `match` expression is the single source of matching semantics.
     *  Unset for budgets created from a raw CEL expression ("custom").
     */
    scope?: BudgetScope | undefined;
    /**
     * The matching semantics of the budget. The enforcement resolver
     *
     * @remarks
     *  evaluates `match.cel` against the request context; a budget
     *  applies to a request if and only if the expression evaluates to
     *  true. Scoped creates derive a canonical expression (e.g.
     *  `provider == "openai"`); an empty expression always matches
     *  (workspace-wide).
     */
    match?: BudgetMatch | undefined;
    /**
     * BudgetLimits is the per-period spend and token ceiling. At least one
     *
     * @remarks
     *  of `amount`, `token_limit`, or RateLimit.requests_per_minute MUST be
     *  set on a Budget; that invariant is enforced by the handler.
     */
    limits?: BudgetLimits | undefined;
    /**
     * RateLimit is the per-minute request ceiling. Enforced via atomic
     *
     * @remarks
     *  increment-first semantics in the enforcement middleware.
     */
    rateLimit?: RateLimit | undefined;
    isActive?: boolean | undefined;
    expiresAt?: Date | undefined;
    createdAt?: Date | undefined;
    updatedAt?: Date | undefined;
    /**
     * Live consumption for the current period, read from the Redis
     *
     * @remarks
     *  counters the enforcement gate maintains. Populated by read paths
     *  (Get / List); omitted on write responses (Create / Update / Reset)
     *  where it carries no signal. Absent or all-zero for a budget that
     *  has not been spent against in the current period.
     */
    usage?: BudgetUsage | undefined;
};
export type Identity = {
    /**
     * Unique identity identifier assigned by ORQ. Returned as `_id` for
     *
     * @remarks
     *  compatibility with the v1 identity API.
     */
    id: string;
    /**
     * Customer-provided stable identifier for this identity. This value is
     *
     * @remarks
     *  required on create and is unique within the workspace.
     */
    externalId: string;
    /**
     * Workspace that owns the identity.
     */
    workspaceId: string;
    /**
     * Human-readable display name for the identity.
     */
    displayName?: string | undefined;
    /**
     * Email address associated with the identity.
     */
    email?: string | undefined;
    /**
     * URL of the identity avatar image.
     */
    avatarUrl?: string | undefined;
    /**
     * Free-form labels used to organize and filter identities.
     */
    tags?: Array<string> | undefined;
    /**
     * Custom JSON metadata stored with the identity.
     */
    metadata?: IdentityMetadata | undefined;
    /**
     * ISO timestamp for when the identity was created.
     */
    created: string;
    /**
     * ISO timestamp for when the identity was last updated.
     */
    updated: string;
    /**
     * Optional usage and cost metrics. Present only when requested with
     *
     * @remarks
     *  `include_metrics`.
     */
    metrics?: IdentityMetrics | undefined;
    /**
     * The budget scoped to this identity, if one exists. Read-only here:
     *
     * @remarks
     *  budgets are created and managed through the Budgets API
     *  (scope.identity). Present only when requested with `include_budget`.
     *  Live consumption (`usage`) is not attached on this path — call the
     *  Budgets API for current spend.
     */
    budget?: IdentityBudget | undefined;
};
/** @internal */
export declare const IdentityMetadata$inboundSchema: z.ZodType<IdentityMetadata, z.ZodTypeDef, unknown>;
export declare function identityMetadataFromJSON(jsonString: string): SafeParseResult<IdentityMetadata, SDKValidationError>;
/** @internal */
export declare const IdentityBudget$inboundSchema: z.ZodType<IdentityBudget, z.ZodTypeDef, unknown>;
export declare function identityBudgetFromJSON(jsonString: string): SafeParseResult<IdentityBudget, SDKValidationError>;
/** @internal */
export declare const Identity$inboundSchema: z.ZodType<Identity, z.ZodTypeDef, unknown>;
export declare function identityFromJSON(jsonString: string): SafeParseResult<Identity, SDKValidationError>;
//# sourceMappingURL=identity.d.ts.map