private ValidationEvent getPrivateAccessValidationEvent(Relationship relationship) {
        ShapeId neighborId = relationship.expectNeighborShape().getId();
        String message = String.format(
                "This shape has an invalid %s relationship that targets a private shape, `%s`, in another namespace.",
                relationship.getRelationshipType().toString().toLowerCase(Locale.US),
                neighborId);

        // For now, emit a warning for trait relationships instead of an error. This is because private access on trait
        // relationships was not being validated in the past, so emitting a warning maintains backward compatibility.
        // This will be upgraded to an error in the future.
        if (relationship.getRelationshipType().equals(RelationshipType.TRAIT)) {
            return warning(relationship.getShape(), message);
        } else {
            return error(relationship.getShape(), message);
        }
    }
Ensures that shapes in separate namespaces don't refer to shapes in other
namespaces that are marked as private.
smithy-model/src/main/java/software/amazon/smithy/model/validation/validators/PrivateAccessValidator.java