@staticmethod
def _to_content(conf: Container, resolve: bool, throw_on_missing: bool, enum_to_str: bool=False, structured_config_mode: SCMode=SCMode.DICT) -> Union[(None, Any, str, Dict[(DictKeyType, Any)], List[Any])]:
    from omegaconf import MISSING, DictConfig, ListConfig

    def convert(val: Node) -> Any:
        value = val._value()
        if (enum_to_str and isinstance(value, Enum)):
            value = f'{value.name}'
        return value

    def get_node_value(key: Union[(DictKeyType, int)]) -> Any:
        try:
            node = conf._get_node(key, throw_on_missing_value=throw_on_missing)
        except MissingMandatoryValue as e:
            conf._format_and_raise(key=key, value=None, cause=e)
        assert isinstance(node, Node)
        if resolve:
            try:
                node = node._dereference_node()
            except InterpolationResolutionError as e:
                conf._format_and_raise(key=key, value=None, cause=e)
        if isinstance(node, Container):
            value = BaseContainer._to_content(node, resolve=resolve, throw_on_missing=throw_on_missing, enum_to_str=enum_to_str, structured_config_mode=structured_config_mode)
        else:
            value = convert(node)
        return value
    if conf._is_none():
        return None
    elif conf._is_missing():
        if throw_on_missing:
            conf._format_and_raise(key=None, value=None, cause=MissingMandatoryValue('Missing mandatory value'))
        else:
            return MISSING
    elif ((not resolve) and conf._is_interpolation()):
        inter = conf._value()
        assert isinstance(inter, str)
        return inter
    if resolve:
        _conf = conf._dereference_node()
        assert isinstance(_conf, Container)
        conf = _conf
    if isinstance(conf, DictConfig):
        if ((conf._metadata.object_type not in (dict, None)) and (structured_config_mode == SCMode.DICT_CONFIG)):
            return conf
        if ((structured_config_mode == SCMode.INSTANTIATE) and is_structured_config(conf._metadata.object_type)):
            return conf._to_object()
        retdict: Dict[(DictKeyType, Any)] = {}
        for key in conf.keys():
            value = get_node_value(key)
            if (enum_to_str and isinstance(key, Enum)):
                key = f'{key.name}'
            retdict[key] = value
        return retdict
    elif isinstance(conf, ListConfig):
        retlist: List[Any] = []
        for index in range(len(conf)):
            item = get_node_value(index)
            retlist.append(item)
        return retlist
    assert False
@staticmethod
def _to_content(conf: Container, resolve: bool, throw_on_missing: bool, enum_to_str: bool=False, structured_config_mode: SCMode=SCMode.DICT) -> Union[(None, Any, str, Dict[(DictKeyType, Any)], List[Any])]:
    from omegaconf import MISSING, DictConfig, ListConfig

    def convert(val: Node) -> Any:
        value = val._value()
        if (enum_to_str and isinstance(value, Enum)):
            value = f'{value.name}'
        return value

    def get_node_value(key: Union[(DictKeyType, int)]) -> Any:
        try:
            node = conf._get_node(key, throw_on_missing_value=throw_on_missing)
        except MissingMandatoryValue as e:
            conf._format_and_raise(key=key, value=None, cause=e)
        assert isinstance(node, Node)
        if resolve:
            try:
                node = node._dereference_node()
            except InterpolationResolutionError as e:
                conf._format_and_raise(key=key, value=None, cause=e)
        if isinstance(node, Container):
            value = BaseContainer._to_content(node, resolve=resolve, throw_on_missing=throw_on_missing, enum_to_str=enum_to_str, structured_config_mode=structured_config_mode)
        else:
            value = convert(node)
        return value
    if conf._is_none():
        return None
    elif conf._is_missing():
        if throw_on_missing:
            conf._format_and_raise(key=None, value=None, cause=MissingMandatoryValue('Missing mandatory value'))
        else:
            return MISSING
    elif ((not resolve) and conf._is_interpolation()):
        inter = conf._value()
        assert isinstance(inter, str)
        return inter
    if resolve:
        _conf = conf._dereference_node()
        assert isinstance(_conf, Container)
        conf = _conf
    if isinstance(conf, DictConfig):
        if ((conf._metadata.object_type not in (dict, None)) and (structured_config_mode == SCMode.DICT_CONFIG)):
            return conf
        if ((structured_config_mode == SCMode.INSTANTIATE) and is_structured_config(conf._metadata.object_type)):
            return conf._to_object()
        retdict: Dict[(DictKeyType, Any)] = {}
        for key in conf.keys():
            value = get_node_value(key)
            if (enum_to_str and isinstance(key, Enum)):
                key = f'{key.name}'
            retdict[key] = value
        return retdict
    elif isinstance(conf, ListConfig):
        retlist: List[Any] = []
        for index in range(len(conf)):
            item = get_node_value(index)
            retlist.append(item)
        return retlist
    assert False