import collections


def dump_output_template_configs(configs):
    """Return data mapping from list of output template configs."""
    items = []

    for config in configs:
        data = collections.OrderedDict()
        data["id"] = config.id
        data["pattern-path"] = config.pattern_path
        data["pattern-base"] = config.pattern_base

        if config.append_username_to_name is not False:
            data["append-username-to-name"] = config.append_username_to_name

        if config.append_colorspace_to_name is not False:
            data["append-colorspace-to-name"] = config.append_colorspace_to_name

        if config.append_passname_to_name is not False:
            data["append-passname-to-name"] = config.append_passname_to_name

        if config.append_passname_to_subfolder is not False:
            data["append-passname-to-subfolder"] = config.append_passname_to_subfolder
        items.append(data)

    return items