2020-09-17 20:02:52 +00:00
|
|
|
''' actor serializer '''
|
|
|
|
from dataclasses import dataclass, field
|
|
|
|
from typing import Dict
|
|
|
|
|
2020-11-30 18:32:13 +00:00
|
|
|
from .base_activity import ActivityObject
|
2020-11-28 01:58:21 +00:00
|
|
|
from .image import Image
|
2020-09-17 20:02:52 +00:00
|
|
|
|
2020-11-30 18:32:13 +00:00
|
|
|
|
|
|
|
@dataclass(init=False)
|
|
|
|
class PublicKey(ActivityObject):
|
|
|
|
''' public key block '''
|
|
|
|
owner: str
|
|
|
|
publicKeyPem: str
|
|
|
|
type: str = 'PublicKey'
|
|
|
|
|
|
|
|
|
2020-09-17 20:02:52 +00:00
|
|
|
@dataclass(init=False)
|
|
|
|
class Person(ActivityObject):
|
|
|
|
''' actor activitypub json '''
|
|
|
|
preferredUsername: str
|
|
|
|
inbox: str
|
|
|
|
outbox: str
|
|
|
|
followers: str
|
|
|
|
publicKey: PublicKey
|
|
|
|
endpoints: Dict
|
2020-12-20 20:09:19 +00:00
|
|
|
name: str = None
|
|
|
|
summary: str = None
|
2020-11-25 18:44:49 +00:00
|
|
|
icon: Image = field(default_factory=lambda: {})
|
2020-10-31 20:06:22 +00:00
|
|
|
bookwyrmUser: bool = False
|
2020-09-17 20:02:52 +00:00
|
|
|
manuallyApprovesFollowers: str = False
|
|
|
|
discoverable: str = True
|
|
|
|
type: str = 'Person'
|