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

Method from_json

py/generate.py:249–261  ·  view source on GitHub ↗

Instantiate a CDP property from a JSON object.

(cls, property)

Source from the content-addressed store, hash-verified

247
248 @classmethod
249 def from_json(cls, property):
250 """Instantiate a CDP property from a JSON object."""
251 return cls(
252 property["name"],
253 property.get("description"),
254 property.get("type"),
255 property.get("$ref"),
256 property.get("enum"),
257 CdpItems.from_json(property["items"]) if "items" in property else None,
258 property.get("optional", False),
259 property.get("experimental", False),
260 property.get("deprecated", False),
261 )
262
263 def generate_decl(self):
264 """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