mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-10-31 22:19:00 +00:00
37 lines
855 B
Python
37 lines
855 B
Python
""" actor serializer """
|
|
from dataclasses import dataclass, field
|
|
from typing import Dict
|
|
|
|
from .base_activity import ActivityObject
|
|
from .image import Image
|
|
|
|
|
|
# pylint: disable=invalid-name
|
|
@dataclass(init=False)
|
|
class PublicKey(ActivityObject):
|
|
"""public key block"""
|
|
|
|
owner: str
|
|
publicKeyPem: str
|
|
type: str = "PublicKey"
|
|
|
|
|
|
# pylint: disable=invalid-name
|
|
@dataclass(init=False)
|
|
class Person(ActivityObject):
|
|
"""actor activitypub json"""
|
|
|
|
preferredUsername: str
|
|
inbox: str
|
|
publicKey: PublicKey
|
|
followers: str = None
|
|
following: str = None
|
|
outbox: str = None
|
|
endpoints: Dict = None
|
|
name: str = None
|
|
summary: str = None
|
|
icon: Image = field(default_factory=lambda: {})
|
|
bookwyrmUser: bool = False
|
|
manuallyApprovesFollowers: str = False
|
|
discoverable: str = False
|
|
type: str = "Person"
|