mirror of
https://github.com/aljazceru/bitfinex-api-py.git
synced 2025-12-19 23:04:21 +01:00
Replace every snake case (uppercase) to snake case (lowercase) in serializers, types and notification.
This commit is contained in:
@@ -8,16 +8,16 @@ T = TypeVar("T")
|
||||
|
||||
@dataclass
|
||||
class Notification(_Type, Generic[T]):
|
||||
MTS: int
|
||||
TYPE: str
|
||||
MESSAGE_ID: Optional[int]
|
||||
NOTIFY_INFO: T
|
||||
CODE: Optional[int]
|
||||
STATUS: str
|
||||
TEXT: str
|
||||
mts: int
|
||||
type: str
|
||||
message_id: Optional[int]
|
||||
notify_info: T
|
||||
code: Optional[int]
|
||||
status: str
|
||||
text: str
|
||||
|
||||
class _Notification(_Serializer, Generic[T]):
|
||||
__LABELS = [ "MTS", "TYPE", "MESSAGE_ID", "_PLACEHOLDER", "NOTIFY_INFO", "CODE", "STATUS", "TEXT" ]
|
||||
__LABELS = [ "mts", "type", "message_id", "_PLACEHOLDER", "notify_info", "code", "status", "text" ]
|
||||
|
||||
def __init__(self, serializer: Optional[_Serializer] = None, iterate: bool = False):
|
||||
super().__init__("Notification", Notification, _Notification.__LABELS, IGNORE = [ "_PLACEHOLDER" ])
|
||||
@@ -28,13 +28,13 @@ class _Notification(_Serializer, Generic[T]):
|
||||
notification = cast(Notification[T], Notification(**dict(self._serialize(*values))))
|
||||
|
||||
if isinstance(self.serializer, _Serializer):
|
||||
NOTIFY_INFO = cast(List[Any], notification.NOTIFY_INFO)
|
||||
NOTIFY_INFO = cast(List[Any], notification.notify_info)
|
||||
|
||||
if self.iterate == False:
|
||||
if len(NOTIFY_INFO) == 1 and isinstance(NOTIFY_INFO[0], list):
|
||||
NOTIFY_INFO = NOTIFY_INFO[0]
|
||||
|
||||
notification.NOTIFY_INFO = cast(T, self.serializer.klass(**dict(self.serializer._serialize(*NOTIFY_INFO, skip=skip))))
|
||||
else: notification.NOTIFY_INFO = cast(T, [ self.serializer.klass(**dict(self.serializer._serialize(*data, skip=skip))) for data in NOTIFY_INFO ])
|
||||
notification.notify_info = cast(T, self.serializer.klass(**dict(self.serializer._serialize(*NOTIFY_INFO, skip=skip))))
|
||||
else: notification.notify_info = cast(T, [ self.serializer.klass(**dict(self.serializer._serialize(*data, skip=skip))) for data in NOTIFY_INFO ])
|
||||
|
||||
return notification
|
||||
Reference in New Issue
Block a user