// 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;

/**
 * Batch item for file extraction.
 *
 * Used with {@code batch_extract_files} and {@code batch_extract_files_sync}
 * to represent a single file in a batch extraction job.
 */
@JsonInclude(JsonInclude.Include.NON_ABSENT)
@JsonDeserialize(builder = BatchFileItem.Builder.class)
public record BatchFileItem(
    /**
     * Path to the file to extract from
     */
    @JsonProperty("path") java.nio.file.Path path,
    /**
     * Per-file configuration overrides (null uses batch-level defaults)
     */
    @Nullable @JsonProperty("config") FileExtractionConfig config
) {
    public static Builder builder() {
        return new Builder();
    }

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

private java.nio.file.Path path = null;
private FileExtractionConfig config = null;

        /** Sets the path field. */
        @JsonProperty("path")
        public Builder withPath(final java.nio.file.Path value) {
            this.path = value;
            return this;
        }

        /** Sets the config field. */
        @JsonProperty("config")
        public Builder withConfig(final @Nullable FileExtractionConfig value) {
            this.config = value;
            return this;
        }

        /** Builds the BatchFileItem instance. */
        public BatchFileItem build() {
            return new BatchFileItem(
                path,
                config
            );
        }
    }
    // CPD-ON
}
