def to_dict(payload):
    """Serialize a payload into a json compatible object."""
    return {
        "version":  "0.2",
        "filename": payload.name,
        "filesize": payload.size,
        "filehash": payload.hash,
        "datetime": payload.datetime,
        "uploads":  payload.uploads }