from typing import Dict
from typing import Tuple


def deserialize_fh(doc: Dict) -> Tuple[str, str]:
    """Get the file identifier and optional target path from an input file
    argument.

    Parameters
    ----------
    doc: dict
        Input file argument value.

    Returns
    -------
    string, string
    """
    try:
        value = doc['value']
        return value['fileId'], value.get('targetPath')
    except KeyError as ex:
        raise ValueError('missing element {}'.format(str(ex)))