# This file was auto generated by Styx.
# Do not edit this file directly.

import typing
import pathlib
from styxdefs import *
import dataclasses

FS_CHECK_VERSION_METADATA = Metadata(
    id="1bb29df8432be8183122dba0b74d19ba214f7751.boutiques",
    name="fs-check-version",
    package="freesurfer",
    container_image_tag="freesurfer/freesurfer:7.4.1",
)


class FsCheckVersionOutputs(typing.NamedTuple):
    """
    Output object returned when calling `fs_check_version(...)`.
    """
    root: OutputPathType
    """Output root folder. This is the root folder for all outputs."""
    output_file: OutputPathType
    """Output text file with a 1 if the version matches, otherwise 0"""


def fs_check_version(
    subjects_dir: str,
    outfile: str,
    subject: str | None = None,
    no_require_match: bool = False,
    test_debug: bool = False,
    runner: Runner | None = None,
) -> FsCheckVersionOutputs:
    """
    Script to manage which version of FreeSurfer can be used to analyze data
    ensuring consistency with the desired version.
    
    Author: FreeSurfer Developers
    
    URL: https://github.com/freesurfer/freesurfer
    
    Args:
        subjects_dir: Subjects directory path.
        outfile: Output file path where result of version check will be written.
        subject: Subject name (optional).
        no_require_match: Unset REQUIRE_FS_MATCH for testing.
        test_debug: Go through permutations for debugging.
        runner: Command runner.
    Returns:
        NamedTuple of outputs (described in `FsCheckVersionOutputs`).
    """
    runner = runner or get_global_runner()
    execution = runner.start_execution(FS_CHECK_VERSION_METADATA)
    cargs = []
    cargs.append("fs-check-version")
    cargs.extend([
        "--sd",
        subjects_dir
    ])
    cargs.extend([
        "--o",
        outfile
    ])
    if subject is not None:
        cargs.extend([
            "--s",
            subject
        ])
    if no_require_match:
        cargs.append("--no-require-match")
    if test_debug:
        cargs.append("--test-debug")
    ret = FsCheckVersionOutputs(
        root=execution.output_file("."),
        output_file=execution.output_file(outfile),
    )
    execution.run(cargs)
    return ret


__all__ = [
    "FS_CHECK_VERSION_METADATA",
    "FsCheckVersionOutputs",
    "fs_check_version",
]
