moviewyrm/bookwyrm/activitypub/person.py
Mouse Reeve 60738011a2 user's name and bio field are optional
get it together, mouse
2020-12-20 12:09:19 -08:00

32 lines
747 B
Python

''' actor serializer '''
from dataclasses import dataclass, field
from typing import Dict
from .base_activity import ActivityObject
from .image import Image
@dataclass(init=False)
class PublicKey(ActivityObject):
''' public key block '''
owner: str
publicKeyPem: str
type: str = 'PublicKey'
@dataclass(init=False)
class Person(ActivityObject):
''' actor activitypub json '''
preferredUsername: str
inbox: str
outbox: str
followers: str
publicKey: PublicKey
endpoints: Dict
name: str = None
summary: str = None
icon: Image = field(default_factory=lambda: {})
bookwyrmUser: bool = False
manuallyApprovesFollowers: str = False
discoverable: str = True
type: str = 'Person'