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

Method from_json

py/generate.py:326–335  ·  view source on GitHub ↗

Instantiate a CDP type from a JSON object.

(cls, type_)

Source from the content-addressed store, hash-verified

324
325 @classmethod
326 def from_json(cls, type_):
327 """Instantiate a CDP type from a JSON object."""
328 return cls(
329 type_["id"],
330 type_.get("description"),
331 type_["type"],
332 CdpItems.from_json(type_["items"]) if "items" in type_ else None,
333 type_.get("enum"),
334 [CdpProperty.from_json(p) for p in type_.get("properties", [])],
335 )
336
337 def generate_code(self):
338 """Generate Python code for this type."""

Callers 5

from_jsonMethod · 0.45
from_jsonMethod · 0.45
from_jsonMethod · 0.45
from_jsonMethod · 0.45
parseFunction · 0.45

Calls 1

getMethod · 0.65

Tested by

no test coverage detected