import { WorkspaceScopedResource, extractData } from './base.js';
/**
 * Manage entity unification rules — declarative joins that fold duplicate
 * world-model entities into a single canonical record. Rules are evaluated
 * on ingest; the surviving entity inherits properties from its merge sources.
 *
 * @beta New in this release; surface may evolve.
 */
export class UnificationRulesResource extends WorkspaceScopedResource {
    /** Create a new unification rule */
    async create(body) {
        return extractData(await this.client.POST('/v1/{workspace_id}/unification-rules', {
            params: { path: { workspace_id: this.workspaceId } },
            body,
        }));
    }
    /** List unification rules in the workspace */
    async list(params) {
        return extractData(await this.client.GET('/v1/{workspace_id}/unification-rules', {
            params: { path: { workspace_id: this.workspaceId }, query: params },
        }));
    }
    listAutoPaging(params) {
        return this.iteratePaginatedList((pageParams) => this.list(pageParams), params);
    }
    /** Get a single unification rule */
    async get(ruleId) {
        return extractData(await this.client.GET('/v1/{workspace_id}/unification-rules/{rule_id}', {
            params: { path: { workspace_id: this.workspaceId, rule_id: ruleId } },
        }));
    }
    /** Update a unification rule */
    async update(ruleId, body) {
        return extractData(await this.client.PATCH('/v1/{workspace_id}/unification-rules/{rule_id}', {
            params: { path: { workspace_id: this.workspaceId, rule_id: ruleId } },
            body,
        }));
    }
    /** Delete a unification rule */
    async delete(ruleId) {
        return extractData(await this.client.DELETE('/v1/{workspace_id}/unification-rules/{rule_id}', {
            params: { path: { workspace_id: this.workspaceId, rule_id: ruleId } },
        }));
    }
}
//# sourceMappingURL=unification-rules.js.map