@Override
    void withValueNode(ObjectNode.Builder builder) {
        ArrayNode.Builder rulesBuilder = ArrayNode.builder().sourceLocation(getSourceLocation());
        for (Rule rule : rules) {
            rulesBuilder.withValue(rule.toNode());
        }
        builder.withMember("rules", rulesBuilder.build()).withMember(TYPE, TREE);
    }
Gets the rules contained within this tree.

@return the rules within this tree.
smithy-rules-engine/src/main/java/software/amazon/smithy/rulesengine/language/syntax/rule/TreeRule.java