import type { Case, CaseType, CaseDocumentLink, CaseEntityLink, CasePipelineLink } from "../_internal/types.gen";
import type { RequestOptions } from "../base-client";
import { RequestBuilder } from "../request-builder";
/** Attributes accepted when creating a new Case (admin surface). */
export type CreateCaseAttributes = {
    workspace_id: string;
    case_type_id: string;
    title: string;
    summary?: string;
    state?: string;
    priority?: "low" | "normal" | "high" | "urgent";
    sla_due_at?: string;
    opened_at?: string;
    contact_id?: string | null;
    deal_id?: string | null;
    invoice_id?: string | null;
    custom_fields?: Record<string, unknown>;
    owner_id?: string | null;
};
/** Attributes accepted when updating an existing Case (PATCH semantics). */
export type UpdateCaseAttributes = {
    title?: string;
    summary?: string;
    priority?: "low" | "normal" | "high" | "urgent";
    sla_due_at?: string;
    contact_id?: string | null;
    deal_id?: string | null;
    invoice_id?: string | null;
    custom_fields?: Record<string, unknown>;
    owner_id?: string | null;
};
/** Arguments accepted when transitioning a Case to a new state. */
export type TransitionCaseAttributes = {
    state: string;
};
/** Arguments accepted when assigning a Case owner. */
export type AssignCaseOwnerAttributes = {
    owner_id: string | null;
};
/** Arguments accepted when recording a decision on a Case. */
export type DecideCaseAttributes = {
    decision_outcome: string;
    /**
     * Optional free-text notes captured with the decision. Required (server-side
     * validation) when the resolved `DecisionOutcome` has `requires_note: true`.
     */
    notes?: string;
};
/**
 * `:reopen` takes no arguments on the server — callers pass an empty body.
 * Retained as a named type so callers can write `{}` against a stable name.
 */
export type ReopenCaseAttributes = Record<string, never>;
/**
 * `:close` takes no arguments on the server — callers pass an empty body.
 * Retained as a named type so callers can write `{}` against a stable name.
 */
export type CloseCaseAttributes = Record<string, never>;
/** Options accepted by the admin workspace attention list primitive. */
export type AdminCaseAttentionListOptions = {
    /** Maximum number of open cases to return. Server caps this at 25. */
    limit?: number;
} & RequestOptions;
/** Workspace-scoped open Case SLA summary. */
export type AdminCaseAttentionSummary = {
    open: number;
    sla_overdue: number;
    sla_within_24h: number;
    sla_within_7d: number;
};
/** Attributes accepted when creating a CaseType (admin surface). */
export type CreateCaseTypeAttributes = {
    workspace_id: string;
    slug: string;
    name: string;
    description?: string;
    schema_family_id?: string | null;
    is_active?: boolean;
    state_machine: Record<string, unknown>;
    grouping_rules?: Record<string, unknown>;
    routing_rules?: Record<string, unknown>;
    required_reviews?: Record<string, unknown>;
    expected_document_types?: string[];
    decision_outcomes?: Array<Record<string, unknown>>;
};
/** Attributes accepted when updating a CaseType (PATCH semantics). */
export type UpdateCaseTypeAttributes = {
    name?: string;
    description?: string;
    schema_family_id?: string | null;
    state_machine?: Record<string, unknown>;
    grouping_rules?: Record<string, unknown>;
    routing_rules?: Record<string, unknown>;
    required_reviews?: Record<string, unknown>;
    expected_document_types?: string[];
    decision_outcomes?: Array<Record<string, unknown>>;
    is_active?: boolean;
};
export type CreateCaseDocumentLinkAttributes = {
    workspace_id: string;
    case_id: string;
    document_id: string;
    role?: "primary" | "evidence" | "supporting";
};
export type CreateCaseEntityLinkAttributes = {
    workspace_id: string;
    case_id: string;
    entity_type: "extracted_person" | "extracted_org" | "extracted_location" | "custom";
    entity_id: string;
    metadata?: Record<string, unknown>;
};
/**
 * Admin Cases namespace — ISV-admin surface for the operational case aggregate.
 *
 * Mirrors the client-API Cases namespace at `/admin/cases` and `/admin/case-*`
 * paths. Used by ISV back-office callers with `sk_srv_` server keys.
 */
export declare function createCasesNamespace(rb: RequestBuilder): {
    /**
     * Cases — operational case aggregate with state machine workflow.
     *
     * A Case is identified by a workspace-scoped `reference_number`
     * (`CASE-{YYYY}-{SEQ:5}`) and has exactly one CaseType that governs its
     * valid states and decision outcomes. Admin callers act on behalf of the
     * platform/ISV with `sk_srv_` keys at `/admin/cases`.
     */
    cases: {
        /**
         * List admin-visible Cases.
         *
         * @param options - Optional pagination and request settings.
         * @returns A promise resolving to Case records.
         */
        list: (options?: {
            page?: number;
            pageSize?: number;
        } & RequestOptions) => Promise<Case[]>;
        /**
         * Fetch a Case by id.
         *
         * @param id - Case id.
         * @param options - Optional request settings.
         * @returns A promise resolving to the Case.
         */
        get: (id: string, options?: RequestOptions) => Promise<Case>;
        /**
         * List open Cases ordered for attention in a workspace.
         *
         * @param workspaceId - Workspace UUID to scope the admin request.
         * @param options - Optional limit and request settings.
         * @returns A promise resolving to open Case records.
         */
        attentionList: (workspaceId: string, options?: AdminCaseAttentionListOptions) => Promise<Case[]>;
        /**
         * Return open Case SLA counts for a workspace.
         *
         * @param workspaceId - Workspace UUID to scope the admin request.
         * @param options - Optional request settings.
         * @returns A promise resolving to open/SLA bucket counts.
         */
        attentionSummary: (workspaceId: string, options?: RequestOptions) => Promise<AdminCaseAttentionSummary>;
        /**
         * Create a Case from the admin surface.
         *
         * @param attributes - Accepted Case create attributes.
         * @param options - Optional request settings.
         * @returns A promise resolving to the created Case.
         * @example
         * ```typescript
         * await admin.cases.cases.create({ workspace_id, case_type_id, title });
         * ```
         */
        create: (attributes: CreateCaseAttributes, options?: RequestOptions) => Promise<Case>;
        /**
         * Update mutable Case fields.
         *
         * @param id - Case id.
         * @param attributes - Accepted Case update attributes.
         * @param options - Optional request settings.
         * @returns A promise resolving to the updated Case.
         * @example
         * ```typescript
         * await admin.cases.cases.update(caseId, { priority: "high" });
         * ```
         */
        update: (id: string, attributes: UpdateCaseAttributes, options?: RequestOptions) => Promise<Case>;
        /**
         * Transition a Case to another state.
         *
         * @param id - Case id.
         * @param attributes - Transition target state.
         * @param options - Optional request settings.
         * @returns A promise resolving to the transitioned Case.
         * @example
         * ```typescript
         * await admin.cases.cases.transitionState(caseId, { state: "under_review" });
         * ```
         */
        transitionState: (id: string, attributes: TransitionCaseAttributes, options?: RequestOptions) => Promise<Case>;
        /**
         * Assign or clear a Case owner.
         *
         * @param id - Case id.
         * @param attributes - Owner assignment attributes.
         * @param options - Optional request settings.
         * @returns A promise resolving to the updated Case.
         * @example
         * ```typescript
         * await admin.cases.cases.assignOwner(caseId, { owner_id: userId });
         * ```
         */
        assignOwner: (id: string, attributes: AssignCaseOwnerAttributes, options?: RequestOptions) => Promise<Case>;
        /**
         * Record an irreversible decision on a Case. Requires `cases:decide` scope.
         * Terminal decisions auto-cascade to `close`.
         *
         * @param id - Case id.
         * @param attributes - Decision outcome and optional notes.
         * @param options - Optional request settings.
         * @returns A promise resolving to the decided Case.
         * @example
         * ```typescript
         * await admin.cases.cases.decide(caseId, { decision_outcome: "approved" });
         * ```
         */
        decide: (id: string, attributes: DecideCaseAttributes, options?: RequestOptions) => Promise<Case>;
        /**
         * Reopen a decided Case.
         *
         * @param id - Case id.
         * @param attributes - Empty reopen attributes object.
         * @param options - Optional request settings.
         * @returns A promise resolving to the reopened Case.
         * @example
         * ```typescript
         * await admin.cases.cases.reopen(caseId);
         * ```
         */
        reopen: (id: string, attributes?: ReopenCaseAttributes, options?: RequestOptions) => Promise<Case>;
        /**
         * Close a Case.
         *
         * @param id - Case id.
         * @param attributes - Empty close attributes object.
         * @param options - Optional request settings.
         * @returns A promise resolving to the closed Case.
         * @example
         * ```typescript
         * await admin.cases.cases.close(caseId);
         * ```
         */
        close: (id: string, attributes?: CloseCaseAttributes, options?: RequestOptions) => Promise<Case>;
        /**
         * Delete a Case.
         *
         * @param id - Case id.
         * @param options - Optional request settings.
         * @returns A promise resolving to true when the delete succeeds.
         */
        delete: (id: string, options?: RequestOptions) => Promise<true>;
    };
    /**
     * CaseTypes — workspace-scoped configuration records that govern Cases.
     *
     * A CaseType declares the state machine, grouping rules, routing rules,
     * required reviews, and decision outcomes for all Cases of that type.
     * Identity: `(workspace_id, slug)`.
     */
    caseTypes: {
        /**
         * List admin-visible CaseType definitions.
         *
         * @param options - Optional pagination and request settings.
         * @returns A promise resolving to CaseType records.
         */
        list: (options?: {
            page?: number;
            pageSize?: number;
        } & RequestOptions) => Promise<CaseType[]>;
        /**
         * Fetch a CaseType by id.
         *
         * @param id - CaseType id.
         * @param options - Optional request settings.
         * @returns A promise resolving to the CaseType.
         */
        get: (id: string, options?: RequestOptions) => Promise<CaseType>;
        /**
         * Create a CaseType.
         *
         * @param attributes - Accepted CaseType create attributes.
         * @param options - Optional request settings.
         * @returns A promise resolving to the created CaseType.
         * @example
         * ```typescript
         * await admin.cases.caseTypes.create({ workspace_id, slug, name, state_machine });
         * ```
         */
        create: (attributes: CreateCaseTypeAttributes, options?: RequestOptions) => Promise<CaseType>;
        /**
         * Update mutable CaseType fields.
         *
         * @param id - CaseType id.
         * @param attributes - Accepted CaseType update attributes.
         * @param options - Optional request settings.
         * @returns A promise resolving to the updated CaseType.
         * @example
         * ```typescript
         * await admin.cases.caseTypes.update(caseTypeId, { name: "Escalations" });
         * ```
         */
        update: (id: string, attributes: UpdateCaseTypeAttributes, options?: RequestOptions) => Promise<CaseType>;
        /**
         * Activate a CaseType.
         *
         * @param id - CaseType id.
         * @param options - Optional request settings.
         * @returns A promise resolving to the activated CaseType.
         * @example
         * ```typescript
         * await admin.cases.caseTypes.activate(caseTypeId);
         * ```
         */
        activate: (id: string, options?: RequestOptions) => Promise<CaseType>;
        /**
         * Deactivate a CaseType.
         *
         * @param id - CaseType id.
         * @param options - Optional request settings.
         * @returns A promise resolving to the deactivated CaseType.
         * @example
         * ```typescript
         * await admin.cases.caseTypes.deactivate(caseTypeId);
         * ```
         */
        deactivate: (id: string, options?: RequestOptions) => Promise<CaseType>;
        /**
         * Delete a CaseType.
         *
         * @param id - CaseType id.
         * @param options - Optional request settings.
         * @returns A promise resolving to true when the delete succeeds.
         */
        delete: (id: string, options?: RequestOptions) => Promise<true>;
    };
    /**
     * CaseDocumentLinks — many-to-many join between Cases and Extraction documents.
     *
     * `document_id` is a weak cross-tier foreign key (no DB constraint). Roles
     * are `:primary`, `:evidence` (default), or `:supporting`.
     */
    documents: {
        /**
         * List admin-visible CaseDocumentLink records.
         *
         * @param options - Optional pagination and request settings.
         * @returns A promise resolving to CaseDocumentLink records.
         */
        list: (options?: {
            page?: number;
            pageSize?: number;
        } & RequestOptions) => Promise<CaseDocumentLink[]>;
        /**
         * Fetch a CaseDocumentLink by id.
         *
         * @param id - CaseDocumentLink id.
         * @param options - Optional request settings.
         * @returns A promise resolving to the CaseDocumentLink.
         */
        get: (id: string, options?: RequestOptions) => Promise<CaseDocumentLink>;
        /**
         * Attach a document to a Case.
         *
         * @param attributes - Accepted CaseDocumentLink create attributes.
         * @param options - Optional request settings.
         * @returns A promise resolving to the created CaseDocumentLink.
         * @example
         * ```typescript
         * await admin.cases.documents.create({ workspace_id, case_id, document_id });
         * ```
         */
        create: (attributes: CreateCaseDocumentLinkAttributes, options?: RequestOptions) => Promise<CaseDocumentLink>;
        /**
         * Delete a CaseDocumentLink.
         *
         * @param id - CaseDocumentLink id.
         * @param options - Optional request settings.
         * @returns A promise resolving to true when the delete succeeds.
         */
        delete: (id: string, options?: RequestOptions) => Promise<true>;
    };
    /**
     * CaseEntityLinks — polymorphic join attaching external entities to Cases.
     *
     * `entity_type` may be `:extracted_person`, `:extracted_org`,
     * `:extracted_location`, or `:custom`. For the first three,
     * `entity_id` must be a valid UUID.
     */
    entities: {
        /**
         * List admin-visible CaseEntityLink records.
         *
         * @param options - Optional pagination and request settings.
         * @returns A promise resolving to CaseEntityLink records.
         */
        list: (options?: {
            page?: number;
            pageSize?: number;
        } & RequestOptions) => Promise<CaseEntityLink[]>;
        /**
         * Fetch a CaseEntityLink by id.
         *
         * @param id - CaseEntityLink id.
         * @param options - Optional request settings.
         * @returns A promise resolving to the CaseEntityLink.
         */
        get: (id: string, options?: RequestOptions) => Promise<CaseEntityLink>;
        /**
         * Link an external entity to a Case.
         *
         * @param attributes - Accepted CaseEntityLink create attributes.
         * @param options - Optional request settings.
         * @returns A promise resolving to the created CaseEntityLink.
         * @example
         * ```typescript
         * await admin.cases.entities.create({ workspace_id, case_id, entity_type: "custom", entity_id });
         * ```
         */
        create: (attributes: CreateCaseEntityLinkAttributes, options?: RequestOptions) => Promise<CaseEntityLink>;
        /**
         * Delete a CaseEntityLink.
         *
         * @param id - CaseEntityLink id.
         * @param options - Optional request settings.
         * @returns A promise resolving to true when the delete succeeds.
         */
        delete: (id: string, options?: RequestOptions) => Promise<true>;
    };
    /**
     * CasePipelineLinks — read-only join attaching pipeline executions to Cases.
     *
     * **Read-only over HTTP.** These records are populated automatically by the
     * Cases EventHandler when an `Agents.PipelineExecutionStarted` event carries
     * a `case_id` in its input. No `create` or `delete` HTTP routes exist —
     * admin consumers MUST NOT attempt POST/DELETE on this sub-namespace.
     */
    pipelines: {
        /**
         * List admin-visible CasePipelineLink records.
         *
         * @param options - Optional pagination and request settings.
         * @returns A promise resolving to CasePipelineLink records.
         */
        list: (options?: {
            page?: number;
            pageSize?: number;
        } & RequestOptions) => Promise<CasePipelineLink[]>;
        /**
         * Fetch a CasePipelineLink by id.
         *
         * @param id - CasePipelineLink id.
         * @param options - Optional request settings.
         * @returns A promise resolving to the CasePipelineLink.
         */
        get: (id: string, options?: RequestOptions) => Promise<CasePipelineLink>;
    };
};
//# sourceMappingURL=cases.d.ts.map