| 9 | } |
| 10 | |
| 11 | FunctionCallConfig FunctionCallConfig::fromJson(const nlohmann::json& json) { |
| 12 | FunctionCallConfig config; |
| 13 | |
| 14 | if (json.contains("namespace") && json["namespace"].is_string()) { |
| 15 | config._namespace = json["namespace"].get<std::string>(); |
| 16 | } |
| 17 | |
| 18 | if (json.contains("name") && json["name"].is_string()) { |
| 19 | config._name = json["name"].get<std::string>(); |
| 20 | } |
| 21 | |
| 22 | if (json.contains("description") && json["description"].is_string()) { |
| 23 | config._description = json["description"].get<std::string>(); |
| 24 | } |
| 25 | |
| 26 | if (json.contains("returnType") && json["returnType"].is_string()) { |
| 27 | config._returnType = json["returnType"].get<std::string>(); |
| 28 | } |
| 29 | |
| 30 | return config; |
| 31 | } |
| 32 | |
| 33 | nlohmann::json FunctionCallConfig::toJson() const { |
| 34 | nlohmann::json json; |
no test coverage detected