diff options
Diffstat (limited to 'lib/csapi/definitions/push_condition.cpp')
-rw-r--r-- | lib/csapi/definitions/push_condition.cpp | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/lib/csapi/definitions/push_condition.cpp b/lib/csapi/definitions/push_condition.cpp new file mode 100644 index 00000000..149419f4 --- /dev/null +++ b/lib/csapi/definitions/push_condition.cpp @@ -0,0 +1,34 @@ +/****************************************************************************** + * THIS FILE IS GENERATED - ANY EDITS WILL BE OVERWRITTEN + */ + +#include "push_condition.h" + +using namespace QMatrixClient; + +QJsonObject QMatrixClient::toJson(const PushCondition& pod) +{ + QJsonObject _json; + addToJson<>(_json, "kind", pod.kind); + addToJson<IfNotEmpty>(_json, "key", pod.key); + addToJson<IfNotEmpty>(_json, "pattern", pod.pattern); + addToJson<IfNotEmpty>(_json, "is", pod.is); + return _json; +} + +PushCondition FromJson<PushCondition>::operator()(const QJsonValue& jv) +{ + const auto& _json = jv.toObject(); + PushCondition result; + result.kind = + fromJson<QString>(_json.value("kind")); + result.key = + fromJson<QString>(_json.value("key")); + result.pattern = + fromJson<QString>(_json.value("pattern")); + result.is = + fromJson<QString>(_json.value("is")); + + return result; +} + |