@@ -27,6 +27,8 @@ class ClientWindowState:
2727 MINIMIZED = "minimized"
2828 NORMAL = "normal"
2929
30+ VALID_STATES = {FULLSCREEN , MAXIMIZED , MINIMIZED , NORMAL }
31+
3032
3133class ClientWindowInfo :
3234 """Represents a client window information."""
@@ -129,7 +131,7 @@ def from_dict(cls, data: dict) -> "ClientWindowInfo":
129131 ValueError: If required fields are missing or have invalid types.
130132 """
131133 try :
132- client_window = data . get ("clientWindow" )
134+ client_window = data ("clientWindow" )
133135 if not isinstance (client_window , str ):
134136 raise ValueError ("clientWindow must be a string" )
135137
@@ -139,15 +141,15 @@ def from_dict(cls, data: dict) -> "ClientWindowInfo":
139141 if state not in ClientWindowState .VALID_STATES :
140142 raise ValueError (f"Invalid state: { state } . Must be one of { ClientWindowState .VALID_STATES } " )
141143
142- width = data ["width" ]
144+ width = data ["width" ]
143145 if not isinstance (width , int ) or width < 0 :
144146 raise ValueError (f"width must be a non-negative integer, got { width } " )
145147
146148 height = data ["height" ]
147149 if not isinstance (height , int ) or height < 0 :
148150 raise ValueError (f"height must be a non-negative integer, got { height } " )
149151
150- x = data ["x" ]
152+ x = data ["x" ]
151153 if not isinstance (x , int ):
152154 raise ValueError (f"x must be an integer, got { type (x ).__name__ } " )
153155
0 commit comments