def to_serialized(ref, the_data):
    """Serialize the property

    Used for the retention store

    :param ref: Not used
    :type ref:
    :param the_data: dictionary to convert
    :type the_data: dict
    :return: serialized data
    :rtype: dict
    """
    if not the_data:
        return {}
    if not getattr(the_data, 'serialize', None):
        return the_data
    return the_data.serialize()
