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

Method from_json

py/generate.py:596–609  ·  view source on GitHub ↗

Instantiate a CDP command from a JSON object.

(cls, command, domain)

Source from the content-addressed store, hash-verified

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