Skip to content

Commit

Permalink
Update dataClasses.py
Browse files Browse the repository at this point in the history
  • Loading branch information
ShadowMikado committed Nov 18, 2023
1 parent c72c995 commit d2d33e9
Showing 1 changed file with 41 additions and 0 deletions.
41 changes: 41 additions & 0 deletions pronotepy/dataClasses.py
Original file line number Diff line number Diff line change
Expand Up @@ -2166,3 +2166,44 @@ def __init__(self, json_dict: dict) -> None:
)

del self._resolver



class Notifications(Object):

"""
Represents the notifications. You shouldn't have to create this class manually.
Attributes:
part (str): part of the notification
ident (str): ident of the notification
"""

def __init__(self, json_dict: dict) -> None:
super().__init__(json_dict)

self.part: str = self._resolver(str, "L")
self.ident: str = self._resolver(str, "ident")

self.notifications: List[Notifications.Notification] = self._resolver(
lambda x: [Notifications.Notification(i) for i in x], "liste", "V"
)
del self._resolver

class Notification(Object):
"""
Represents the notification. You shouldn't have to create this class manually.
Attributes:
id (str): id of the notification
message (str): message of the notification
type (int): type of the notification
action (int): action of the notification
"""
def __init__(self, json_dict: dict) -> None:
super().__init__(json_dict)

self.id: str = self._resolver(str, "id")
self.message: str = self._resolver(str, "message", "V")
self.type: int = self._resolver(int, "type")
self.action: int = self._resolver(int, "action")

0 comments on commit d2d33e9

Please sign in to comment.