MCPcopy Create free account
hub / github.com/SeleniumHQ/selenium / from_json

Method from_json

py/generate.py:597–610  ·  view source on GitHub ↗

Instantiate a CDP command from a JSON object.

(cls, command, domain)

Source from the content-addressed store, hash-verified

595
596 @classmethod
597 def from_json(cls, command, domain) -> "CdpCommand":
598 """Instantiate a CDP command from a JSON object."""
599 parameters = command.get("parameters", [])
600 returns = command.get("returns", [])
601
602 return cls(
603 command["name"],
604 command.get("description"),
605 command.get("experimental", False),
606 command.get("deprecated", False),
607 [cast(CdpParameter, CdpParameter.from_json(p)) for p in parameters],
608 [cast(CdpReturn, CdpReturn.from_json(r)) for r in returns],
609 domain,
610 )
611
612 def generate_code(self):
613 """Generate code for a CDP command."""

Callers

nothing calls this directly

Calls 2

getMethod · 0.65
from_jsonMethod · 0.45

Tested by

no test coverage detected