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

import typing
import pathlib
from styxdefs import *
import dataclasses

V__GET_AFNI_VERSION_METADATA = Metadata(
    id="00b4038dc7dd30e795e94e467e6a777717d8d741.boutiques",
    name="@get.afni.version",
    package="afni",
    container_image_tag="afni/afni_make_build:AFNI_24.2.06",
)


class VGetAfniVersionOutputs(typing.NamedTuple):
    """
    Output object returned when calling `v__get_afni_version(...)`.
    """
    root: OutputPathType
    """Output root folder. This is the root folder for all outputs."""
    src_dir: OutputPathType
    """Directory containing the downloaded AFNI source code for the specified
    version."""


def v__get_afni_version(
    version: str,
    runner: Runner | None = None,
) -> VGetAfniVersionOutputs:
    """
    Downloads the source code for a specified AFNI version.
    
    Author: AFNI Developers
    
    URL: https://afni.nimh.nih.gov/
    
    Args:
        version: AFNI version number to get (e.g., 16.0.01).
        runner: Command runner.
    Returns:
        NamedTuple of outputs (described in `VGetAfniVersionOutputs`).
    """
    runner = runner or get_global_runner()
    execution = runner.start_execution(V__GET_AFNI_VERSION_METADATA)
    cargs = []
    cargs.append("@get.afni.version")
    cargs.append(version)
    ret = VGetAfniVersionOutputs(
        root=execution.output_file("."),
        src_dir=execution.output_file("AFNI_" + version + "/AFNI/src"),
    )
    execution.run(cargs)
    return ret


__all__ = [
    "VGetAfniVersionOutputs",
    "V__GET_AFNI_VERSION_METADATA",
    "v__get_afni_version",
]
