MCPcopy Index your code
hub / github.com/github/copilot-sdk / from_dict

Method from_dict

python/copilot/client.py:440–455  ·  view source on GitHub ↗
(obj: Any)

Source from the content-addressed store, hash-verified

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 = {}

Callers

nothing calls this directly

Calls 3

PingResponseClass · 0.70
from_datetimeFunction · 0.50
getMethod · 0.45

Tested by

no test coverage detected