"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ConflictResolutionResult = void 0;
/**
 * iCure Data Stack API Documentation
 *
 * Result of a conflict resolution request. It contains the saved winner revision and the list of conflicting
 * revisions that could not be purged (and are therefore still in conflict).
 */
class ConflictResolutionResult {
    /**
     * @param json the raw json returned by the backend.
     * @param documentFactory optional factory used to deserialize the embedded `document` into a concrete entity
     * instance (e.g. `(x) => new Patient(x)`). When omitted the `document` is left as the raw json.
     */
    constructor(json, documentFactory) {
        if (json)
            Object.assign(this, json);
        if (json && json.document && documentFactory)
            this.document = documentFactory(json.document);
    }
}
exports.ConflictResolutionResult = ConflictResolutionResult;
//# sourceMappingURL=ConflictResolutionResult.js.map