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

Method from_json

py/generate.py:327–336  ·  view source on GitHub ↗

Instantiate a CDP type from a JSON object.

(cls, type_)

Source from the content-addressed store, hash-verified

325
326 @classmethod
327 def from_json(cls, type_):
328 """Instantiate a CDP type from a JSON object."""
329 return cls(
330 type_["id"],
331 type_.get("description"),
332 type_["type"],
333 CdpItems.from_json(type_["items"]) if "items" in type_ else None,
334 type_.get("enum"),
335 [CdpProperty.from_json(p) for p in type_.get("properties", [])],
336 )
337
338 def generate_code(self):
339 """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