| 96 | |
| 97 | @staticmethod |
| 98 | def from_json(data: dict[str, str | dict[str, str]] | None): |
| 99 | if data is None: |
| 100 | data = {"semver": "3.0.0"} |
| 101 | |
| 102 | semver = data["semver"] |
| 103 | vm = data.get("vm") |
| 104 | agent = data.get("agent") |
| 105 | platform = PlatformMeta.from_json(data.get("platform")) |
| 106 | |
| 107 | if EDIT_META or vm is None: |
| 108 | vm = DEFAULT_VM |
| 109 | |
| 110 | if EDIT_META or agent is None: |
| 111 | agent = DEFAULT_AGENT |
| 112 | |
| 113 | if EDIT_META: |
| 114 | if META_SET_PLATFORM and not platform: |
| 115 | platform = DEFAULT_PLATFORM.dcopy() |
| 116 | |
| 117 | return Meta(semver, vm, agent, platform) |