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

import typing
import pathlib
from styxdefs import *
import dataclasses

FS_TEMP_DIR_METADATA = Metadata(
    id="eed642f69e179f132dedff65309afb7749a5e059.boutiques",
    name="fs_temp_dir",
    package="freesurfer",
    container_image_tag="freesurfer/freesurfer:7.4.1",
)


class FsTempDirOutputs(typing.NamedTuple):
    """
    Output object returned when calling `fs_temp_dir(...)`.
    """
    root: OutputPathType
    """Output root folder. This is the root folder for all outputs."""
    output_directory: OutputPathType
    """The created temporary directory path"""


def fs_temp_dir(
    base_directory: str | None = None,
    scratch: bool = False,
    runner: Runner | None = None,
) -> FsTempDirOutputs:
    """
    Generates and creates an empty temporary directory.
    
    Author: FreeSurfer Developers
    
    URL: https://github.com/freesurfer/freesurfer
    
    Args:
        base_directory: Manually specify base temporary directory.
        scratch: Use /scratch directory if available, but FS_TMPDIR takes\
            priority.
        runner: Command runner.
    Returns:
        NamedTuple of outputs (described in `FsTempDirOutputs`).
    """
    runner = runner or get_global_runner()
    execution = runner.start_execution(FS_TEMP_DIR_METADATA)
    cargs = []
    cargs.append("fs_temp_dir")
    if base_directory is not None:
        cargs.extend([
            "-b",
            base_directory
        ])
    if scratch:
        cargs.append("--scratch")
    ret = FsTempDirOutputs(
        root=execution.output_file("."),
        output_directory=execution.output_file("/tmp/tmp.SF5J66"),
    )
    execution.run(cargs)
    return ret


__all__ = [
    "FS_TEMP_DIR_METADATA",
    "FsTempDirOutputs",
    "fs_temp_dir",
]
