import StateSessionError from "../../errors/StateSessionError.js";
export default class StateSessionCloseResult {
    nodeAliveRootOid;
    edgeAliveRootOid;
    constructor(init) {
        validateRootOid("nodeAliveRootOid", init.nodeAliveRootOid);
        validateRootOid("edgeAliveRootOid", init.edgeAliveRootOid);
        this.nodeAliveRootOid = init.nodeAliveRootOid;
        this.edgeAliveRootOid = init.edgeAliveRootOid;
        Object.freeze(this);
    }
}
function validateRootOid(name, rootOid) {
    if (rootOid === null) {
        return;
    }
    if (typeof rootOid !== "string" || rootOid.length === 0) {
        throw new StateSessionError(`StateSessionCloseResult ${name} must be null or a non-empty string; received ${String(rootOid)}`, {
            code: "E_STATE_SESSION_STRUCTURE",
            context: { field: name, rootOid },
        });
    }
}
