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

import typing
import pathlib
from styxdefs import *

METADATA_REMOVE_PROVENANCE_METADATA = Metadata(
    id="4800e85a5fdc741153c992271baa48d72065973e.boutiques",
    name="metadata-remove-provenance",
    package="workbench",
    container_image_tag="brainlife/connectome_workbench:1.5.0-freesurfer-update",
)


MetadataRemoveProvenanceParameters = typing.TypedDict('MetadataRemoveProvenanceParameters', {
    "@type": typing.NotRequired[typing.Literal["workbench/metadata-remove-provenance"]],
    "input_file": str,
    "output_file": str,
})
MetadataRemoveProvenanceParametersTagged = typing.TypedDict('MetadataRemoveProvenanceParametersTagged', {
    "@type": typing.Literal["workbench/metadata-remove-provenance"],
    "input_file": str,
    "output_file": str,
})


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


def metadata_remove_provenance_params(
    input_file: str,
    output_file: str,
) -> MetadataRemoveProvenanceParametersTagged:
    """
    Build parameters.
    
    Args:
        input_file: the file to remove provenance information from.
        output_file: output - the name to save the modified file as.
    Returns:
        Parameter dictionary
    """
    params = {
        "@type": "workbench/metadata-remove-provenance",
        "input_file": input_file,
        "output_file": output_file,
    }
    return params


def metadata_remove_provenance_cargs(
    params: MetadataRemoveProvenanceParameters,
    execution: Execution,
) -> list[str]:
    """
    Build command-line arguments from parameters.
    
    Args:
        params: The parameters.
        execution: The execution object for resolving input paths.
    Returns:
        Command-line arguments.
    """
    cargs = []
    cargs.append("wb_command")
    cargs.append("-metadata-remove-provenance")
    cargs.append(params.get("input_file", None))
    cargs.append(params.get("output_file", None))
    return cargs


def metadata_remove_provenance_outputs(
    params: MetadataRemoveProvenanceParameters,
    execution: Execution,
) -> MetadataRemoveProvenanceOutputs:
    """
    Build outputs object containing output file paths and possibly stdout/stderr.
    
    Args:
        params: The parameters.
        execution: The execution object for resolving input paths.
    Returns:
        Outputs object.
    """
    ret = MetadataRemoveProvenanceOutputs(
        root=execution.output_file("."),
    )
    return ret


def metadata_remove_provenance_execute(
    params: MetadataRemoveProvenanceParameters,
    runner: Runner | None = None,
) -> MetadataRemoveProvenanceOutputs:
    """
    metadata-remove-provenance
    
    Remove provenance information from file metadata.
    
    Removes the provenance metadata fields added by workbench during processing.
    
    Author: Connectome Workbench Developers
    
    URL: https://github.com/Washington-University/workbench
    
    Args:
        params: The parameters.
        runner: Command runner.
    Returns:
        NamedTuple of outputs (described in `MetadataRemoveProvenanceOutputs`).
    """
    runner = runner or get_global_runner()
    execution = runner.start_execution(METADATA_REMOVE_PROVENANCE_METADATA)
    params = execution.params(params)
    cargs = metadata_remove_provenance_cargs(params, execution)
    ret = metadata_remove_provenance_outputs(params, execution)
    execution.run(cargs)
    return ret


def metadata_remove_provenance(
    input_file: str,
    output_file: str,
    runner: Runner | None = None,
) -> MetadataRemoveProvenanceOutputs:
    """
    metadata-remove-provenance
    
    Remove provenance information from file metadata.
    
    Removes the provenance metadata fields added by workbench during processing.
    
    Author: Connectome Workbench Developers
    
    URL: https://github.com/Washington-University/workbench
    
    Args:
        input_file: the file to remove provenance information from.
        output_file: output - the name to save the modified file as.
        runner: Command runner.
    Returns:
        NamedTuple of outputs (described in `MetadataRemoveProvenanceOutputs`).
    """
    params = metadata_remove_provenance_params(
        input_file=input_file,
        output_file=output_file,
    )
    return metadata_remove_provenance_execute(params, runner)


__all__ = [
    "METADATA_REMOVE_PROVENANCE_METADATA",
    "MetadataRemoveProvenanceOutputs",
    "metadata_remove_provenance",
    "metadata_remove_provenance_execute",
    "metadata_remove_provenance_params",
]
