import WarpError from "../errors/WarpError.js";
/** Runtime-backed mapping from a legacy edge id to the planned graph edge id. */
export default class GraphModelMigrationEdgeMapping {
    legacyEdgeId;
    targetEdgeId;
    constructor(fields) {
        const checkedFields = requireFields(fields);
        this.legacyEdgeId = requireNonEmptyString(checkedFields.legacyEdgeId, 'legacyEdgeId');
        this.targetEdgeId = requireNonEmptyString(checkedFields.targetEdgeId, 'targetEdgeId');
        Object.freeze(this);
    }
}
/** Validates the constructor envelope. */
function requireFields(fields) {
    if (fields === null || fields === undefined) {
        throw new WarpError('GraphModelMigrationEdgeMapping fields must be provided', 'E_VALIDATION');
    }
    return fields;
}
/** Validates a required non-empty string. */
function requireNonEmptyString(value, name) {
    if (typeof value !== 'string' || value.length === 0) {
        throw new WarpError(`${name} must be a non-empty string`, 'E_VALIDATION');
    }
    return value;
}
