Create a new CDP event instance from a JSON dict.
(cls, json: dict, domain: str)
| 721 | |
| 722 | @classmethod |
| 723 | def from_json(cls, json: dict, domain: str): |
| 724 | """Create a new CDP event instance from a JSON dict.""" |
| 725 | return cls( |
| 726 | json["name"], |
| 727 | json.get("description"), |
| 728 | json.get("deprecated", False), |
| 729 | json.get("experimental", False), |
| 730 | [cast(CdpParameter, CdpParameter.from_json(p)) for p in json.get("parameters", [])], |
| 731 | domain, |
| 732 | ) |
| 733 | |
| 734 | def generate_code(self): |
| 735 | """Generate code for a CDP event.""" |