def METHOD_NAME(self, enum):
    res = {"type": "enum", "name": enum.tag}
    if not enum.opaque:
        res["fields"] = []
        for name, ctype in enum.members:
            field = {"name": name, "ctype": todict(ctype)}
            res["fields"].append(field)
    return res