2021-03-08 16:49:10 +00:00
|
|
|
""" actor serializer """
|
2020-09-17 20:02:52 +00:00
|
|
|
from dataclasses import dataclass, field
|
|
|
|
from typing import Dict
|
|
|
|
|
2020-11-30 18:32:13 +00:00
|
|
|
from .base_activity import ActivityObject
|
2021-04-17 18:47:48 +00:00
|
|
|
from .image import Image
|
2020-09-17 20:02:52 +00:00
|
|
|
|
2020-11-30 18:32:13 +00:00
|
|
|
|
2021-06-18 21:29:24 +00:00
|
|
|
# pylint: disable=invalid-name
|
2020-11-30 18:32:13 +00:00
|
|
|
@dataclass(init=False)
|
|
|
|
class PublicKey(ActivityObject):
|
2021-04-26 16:15:42 +00:00
|
|
|
"""public key block"""
|
2021-03-08 16:49:10 +00:00
|
|
|
|
2020-11-30 18:32:13 +00:00
|
|
|
owner: str
|
|
|
|
publicKeyPem: str
|
2021-03-08 16:49:10 +00:00
|
|
|
type: str = "PublicKey"
|
2020-11-30 18:32:13 +00:00
|
|
|
|
|
|
|
|
2021-06-18 21:29:24 +00:00
|
|
|
# pylint: disable=invalid-name
|
2020-09-17 20:02:52 +00:00
|
|
|
@dataclass(init=False)
|
|
|
|
class Person(ActivityObject):
|
2021-04-26 16:15:42 +00:00
|
|
|
"""actor activitypub json"""
|
2021-03-08 16:49:10 +00:00
|
|
|
|
2020-09-17 20:02:52 +00:00
|
|
|
preferredUsername: str
|
|
|
|
inbox: str
|
|
|
|
publicKey: PublicKey
|
2021-04-02 14:38:37 +00:00
|
|
|
followers: str = None
|
2021-04-07 17:32:16 +00:00
|
|
|
following: str = None
|
2021-04-02 14:35:56 +00:00
|
|
|
outbox: str = None
|
2021-03-17 20:59:16 +00:00
|
|
|
endpoints: Dict = None
|
2020-12-20 20:09:19 +00:00
|
|
|
name: str = None
|
|
|
|
summary: str = None
|
2021-04-17 18:47:48 +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
|
2021-03-21 21:50:36 +00:00
|
|
|
discoverable: str = False
|
2021-03-08 16:49:10 +00:00
|
|
|
type: str = "Person"
|