add 'raw' properties to protocol members
This commit is contained in:
parent
299de84919
commit
8d1a5736ba
1 changed files with 27 additions and 0 deletions
|
@ -19,8 +19,29 @@ if TYPE_CHECKING:
|
||||||
else:
|
else:
|
||||||
Protocol = object
|
Protocol = object
|
||||||
|
|
||||||
|
|
||||||
|
# common fields across all the Protocol classes, so generic code can be written
|
||||||
|
class RedditThing(Protocol):
|
||||||
|
@property
|
||||||
|
def raw(self) -> Json: ...
|
||||||
|
@property
|
||||||
|
def created(self) -> datetime_aware: ...
|
||||||
|
@property
|
||||||
|
def id(self) -> str: ...
|
||||||
|
@property
|
||||||
|
def url(self) -> str: ...
|
||||||
|
@property
|
||||||
|
def text(self) -> str: ...
|
||||||
|
|
||||||
|
|
||||||
# Note: doesn't include GDPR Save's since they don't have the same metadata
|
# Note: doesn't include GDPR Save's since they don't have the same metadata
|
||||||
class Save(Protocol):
|
class Save(Protocol):
|
||||||
|
@property
|
||||||
|
def raw(self) -> Json: ...
|
||||||
|
@property
|
||||||
|
def created(self) -> datetime_aware: ...
|
||||||
|
@property
|
||||||
|
def id(self) -> str: ...
|
||||||
@property
|
@property
|
||||||
def id(self) -> str: ...
|
def id(self) -> str: ...
|
||||||
@property
|
@property
|
||||||
|
@ -32,6 +53,8 @@ class Save(Protocol):
|
||||||
|
|
||||||
# Note: doesn't include GDPR Upvote's since they don't have the same metadata
|
# Note: doesn't include GDPR Upvote's since they don't have the same metadata
|
||||||
class Upvote(Protocol):
|
class Upvote(Protocol):
|
||||||
|
@property
|
||||||
|
def raw(self) -> Json: ...
|
||||||
@property
|
@property
|
||||||
def id(self) -> str: ...
|
def id(self) -> str: ...
|
||||||
@property
|
@property
|
||||||
|
@ -46,6 +69,8 @@ class Upvote(Protocol):
|
||||||
|
|
||||||
# From rexport, pushshift and the reddit GDPR export
|
# From rexport, pushshift and the reddit GDPR export
|
||||||
class Comment(Protocol):
|
class Comment(Protocol):
|
||||||
|
@property
|
||||||
|
def raw(self) -> Json: ...
|
||||||
@property
|
@property
|
||||||
def id(self) -> str: ...
|
def id(self) -> str: ...
|
||||||
@property
|
@property
|
||||||
|
@ -58,6 +83,8 @@ class Comment(Protocol):
|
||||||
|
|
||||||
# From rexport and the GDPR export
|
# From rexport and the GDPR export
|
||||||
class Submission(Protocol):
|
class Submission(Protocol):
|
||||||
|
@property
|
||||||
|
def raw(self) -> Json: ...
|
||||||
@property
|
@property
|
||||||
def id(self) -> str: ...
|
def id(self) -> str: ...
|
||||||
@property
|
@property
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue