def update_types()

in packages/autorest.python/autorest/m4reformatter/__init__.py [0:0]


def update_types(yaml_data: List[Dict[str, Any]]) -> Dict[str, Any]:
    types: List[Dict[str, Any]] = []
    for type in yaml_data:
        if KNOWN_TYPES.get(type["type"]):
            types.append(KNOWN_TYPES[type["type"]])
        else:
            types.append(next(v for v in ORIGINAL_ID_TO_UPDATED_TYPE.values() if id(v) == id(type)))
    retval = {"type": "combined", "types": types}
    ORIGINAL_ID_TO_UPDATED_TYPE[id(retval)] = retval
    return retval