| 75 | bool isValid() const { return !commands.isEmpty(); } |
| 76 | |
| 77 | static BatchRequest fromJson(const QJsonObject& json) |
| 78 | { |
| 79 | BatchRequest req; |
| 80 | req.id = json.value(QStringLiteral("id")).toString(); |
| 81 | |
| 82 | const auto commandsArray = json.value(QStringLiteral("commands")).toArray(); |
| 83 | for (const auto& cmd : commandsArray) |
| 84 | req.commands.append(CommandRequest::fromJson(cmd.toObject())); |
| 85 | |
| 86 | return req; |
| 87 | } |
| 88 | }; |
| 89 | |
| 90 | /** |