(obj: Any)
| 438 | |
| 439 | @staticmethod |
| 440 | def from_dict(obj: Any) -> PingResponse: |
| 441 | assert isinstance(obj, dict) |
| 442 | message = obj.get("message") |
| 443 | timestamp = obj.get("timestamp") |
| 444 | protocol_version = obj.get("protocolVersion") |
| 445 | if message is None or timestamp is None or protocol_version is None: |
| 446 | raise ValueError( |
| 447 | f"Missing required fields in PingResponse: message={message}, " |
| 448 | f"timestamp={timestamp}, protocolVersion={protocol_version}" |
| 449 | ) |
| 450 | timestamp_value = ( |
| 451 | datetime.fromtimestamp(timestamp / 1000, tz=UTC) |
| 452 | if isinstance(timestamp, (int, float)) |
| 453 | else from_datetime(timestamp) |
| 454 | ) |
| 455 | return PingResponse(str(message), timestamp_value, int(protocol_version)) |
| 456 | |
| 457 | def to_dict(self) -> dict: |
| 458 | result: dict = {} |
nothing calls this directly
no test coverage detected