import VisibleEdgePropertyRecord from "./VisibleEdgePropertyRecord.js";
import WarpError from "../errors/WarpError.js";
export const GRAPH_EDGE_PROPERTY_SET_OP = 'GraphEdgePropertySet';
/** Runtime-backed graph operation for an edge property compatibility fact. */
export default class GraphEdgePropertySetOp {
    type = GRAPH_EDGE_PROPERTY_SET_OP;
    record;
    constructor(fields) {
        const checkedFields = requireFields(fields);
        this.record = requireEdgePropertyRecord(checkedFields.record);
        Object.freeze(this);
    }
}
/** Validates the graph-edge-property operation constructor envelope. */
function requireFields(fields) {
    if (fields === null || fields === undefined) {
        throw new WarpError('GraphEdgePropertySetOp fields must be provided', 'E_VALIDATION');
    }
    return fields;
}
/** Requires a runtime-backed visible edge property record. */
function requireEdgePropertyRecord(record) {
    if (!(record instanceof VisibleEdgePropertyRecord)) {
        throw new WarpError('GraphEdgePropertySetOp record must be a VisibleEdgePropertyRecord', 'E_VALIDATION');
    }
    return record;
}
