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

Method from_json

py/generate.py:248–260  ·  view source on GitHub ↗

Instantiate a CDP property from a JSON object.

(cls, property)

Source from the content-addressed store, hash-verified

246
247 @classmethod
248 def from_json(cls, property):
249 """Instantiate a CDP property from a JSON object."""
250 return cls(
251 property["name"],
252 property.get("description"),
253 property.get("type"),
254 property.get("$ref"),
255 property.get("enum"),
256 CdpItems.from_json(property["items"]) if "items" in property else None,
257 property.get("optional", False),
258 property.get("experimental", False),
259 property.get("deprecated", False),
260 )
261
262 def generate_decl(self):
263 """Generate the code that declares this property."""

Callers

nothing calls this directly

Calls 2

getMethod · 0.65
from_jsonMethod · 0.45

Tested by

no test coverage detected