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

import typing
import pathlib
from styxdefs import *
import dataclasses

V_3DNEWID_METADATA = Metadata(
    id="acbbcc60d614fe39bf285beddcf6984090e82ecf.boutiques",
    name="3dnewid",
    package="afni",
    container_image_tag="afni/afni_make_build:AFNI_24.2.06",
)


class V3dnewidOutputs(typing.NamedTuple):
    """
    Output object returned when calling `v_3dnewid(...)`.
    """
    root: OutputPathType
    """Output root folder. This is the root folder for all outputs."""


def v_3dnewid(
    datasets: list[InputPathType],
    fun: float | None = None,
    fun11: bool = False,
    int_: bool = False,
    hash_: str | None = None,
    md5: str | None = None,
    runner: Runner | None = None,
) -> V3dnewidOutputs:
    """
    Assigns a new ID code to a dataset, ensuring internal ID codes remain unique.
    
    Author: AFNI Developers
    
    URL: https://afni.nimh.nih.gov/
    
    Args:
        datasets: Input datasets to assign new ID codes.
        fun: Generate n randomly generated ID codes. If n is not present, 1 ID\
            code is printed.
        fun11: Generate an 11 character ID code for use in scripting.
        int_: Generate a random positive integer between 1 million and 1\
            billion.
        hash_: Generate a unique hash code of the provided string. The same\
            string produces the same hash code.
        md5: Generate the MD5 hash of the provided string. Output should be the\
            same as the -hash output without the prefix and without the + and /\
            char substitutions.
        runner: Command runner.
    Returns:
        NamedTuple of outputs (described in `V3dnewidOutputs`).
    """
    runner = runner or get_global_runner()
    execution = runner.start_execution(V_3DNEWID_METADATA)
    cargs = []
    cargs.append("3dnewid")
    cargs.extend([execution.input_file(f) for f in datasets])
    if fun is not None:
        cargs.extend([
            "-fun",
            str(fun)
        ])
    if fun11:
        cargs.append("-fun11")
    if int_:
        cargs.append("-int")
    if hash_ is not None:
        cargs.extend([
            "-hash",
            hash_
        ])
    if md5 is not None:
        cargs.extend([
            "-MD5",
            md5
        ])
    ret = V3dnewidOutputs(
        root=execution.output_file("."),
    )
    execution.run(cargs)
    return ret


__all__ = [
    "V3dnewidOutputs",
    "V_3DNEWID_METADATA",
    "v_3dnewid",
]
