// This file is auto-generated by alef — DO NOT EDIT.
// alef:hash:4e15143f4af1ae8bafbdb1506ef057da924484c66a19483966333558ad437e75
// To regenerate: alef generate
// To verify freshness: alef verify --exit-code
// Issues & docs: https://github.com/kreuzberg-dev/alef
package dev.kreuzberg;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder;
import org.jspecify.annotations.Nullable;

/**
 * Processing options for tree-sitter code analysis.
 *
 * Controls which analysis features are enabled when extracting code files.
 */
@JsonInclude(JsonInclude.Include.NON_ABSENT)
@JsonDeserialize(builder = TreeSitterProcessConfig.Builder.class)
public record TreeSitterProcessConfig(
    /**
     * Extract structural items (functions, classes, structs, etc.). Default: true.
     */
    @Nullable @JsonProperty("structure") Boolean structure,
    /**
     * Extract import statements. Default: true.
     */
    @Nullable @JsonProperty("imports") Boolean imports,
    /**
     * Extract export statements. Default: true.
     */
    @Nullable @JsonProperty("exports") Boolean exports,
    /**
     * Extract comments. Default: false.
     */
    @Nullable @JsonProperty("comments") Boolean comments,
    /**
     * Extract docstrings. Default: false.
     */
    @Nullable @JsonProperty("docstrings") Boolean docstrings,
    /**
     * Extract symbol definitions. Default: false.
     */
    @Nullable @JsonProperty("symbols") Boolean symbols,
    /**
     * Include parse diagnostics. Default: false.
     */
    @Nullable @JsonProperty("diagnostics") Boolean diagnostics,
    /**
     * Maximum chunk size in bytes. {@code None} disables chunking.
     */
    @Nullable @JsonProperty("chunk_max_size") Long chunkMaxSize,
    /**
     * Content rendering mode for code extraction.
     */
    @Nullable @JsonProperty("content_mode") CodeContentMode contentMode
) {
    public static Builder builder() {
        return new Builder();
    }

    // CPD-OFF
    @JsonPOJOBuilder(withPrefix = "with", buildMethodName = "build")
    public static final class Builder {

private Boolean structure = null;
private Boolean imports = null;
private Boolean exports = null;
private Boolean comments = null;
private Boolean docstrings = null;
private Boolean symbols = null;
private Boolean diagnostics = null;
        @JsonProperty("chunk_max_size")
private Long chunkMaxSize = null;
        @JsonProperty("content_mode")
        @Nullable private CodeContentMode contentMode = CodeContentMode.Chunks;

        /** Sets the structure field. */
        @JsonProperty("structure")
        public Builder withStructure(final @Nullable Boolean value) {
            this.structure = value;
            return this;
        }

        /** Sets the imports field. */
        @JsonProperty("imports")
        public Builder withImports(final @Nullable Boolean value) {
            this.imports = value;
            return this;
        }

        /** Sets the exports field. */
        @JsonProperty("exports")
        public Builder withExports(final @Nullable Boolean value) {
            this.exports = value;
            return this;
        }

        /** Sets the comments field. */
        @JsonProperty("comments")
        public Builder withComments(final @Nullable Boolean value) {
            this.comments = value;
            return this;
        }

        /** Sets the docstrings field. */
        @JsonProperty("docstrings")
        public Builder withDocstrings(final @Nullable Boolean value) {
            this.docstrings = value;
            return this;
        }

        /** Sets the symbols field. */
        @JsonProperty("symbols")
        public Builder withSymbols(final @Nullable Boolean value) {
            this.symbols = value;
            return this;
        }

        /** Sets the diagnostics field. */
        @JsonProperty("diagnostics")
        public Builder withDiagnostics(final @Nullable Boolean value) {
            this.diagnostics = value;
            return this;
        }

        /** Sets the chunkMaxSize field. */
        @JsonProperty("chunk_max_size")
        public Builder withChunkMaxSize(final @Nullable Long value) {
            this.chunkMaxSize = value;
            return this;
        }

        /** Sets the contentMode field. */
        @JsonProperty("content_mode")
        public Builder withContentMode(final @Nullable CodeContentMode value) {
            this.contentMode = value;
            return this;
        }

        /** Builds the TreeSitterProcessConfig instance. */
        public TreeSitterProcessConfig build() {
            return new TreeSitterProcessConfig(
                structure,
                imports,
                exports,
                comments,
                docstrings,
                symbols,
                diagnostics,
                chunkMaxSize,
                contentMode
            );
        }
    }
    // CPD-ON
    public static TreeSitterProcessConfig defaultInstance() {
        throw new UnsupportedOperationException("defaultInstance is not yet bridged via JNI; use the Builder instead.");
    }
}
