1/******************************************************************************
2 * THIS FILE IS GENERATED - ANY EDITS WILL BE OVERWRITTEN
3 */
4
5#pragma once
6
7#include <Quotient/csapi/definitions/push_rule.h>
8
9#include <Quotient/converters.h>
10
11namespace Quotient {
12
13struct PushRuleset {
14 QVector<PushRule> content{};
15
16 QVector<PushRule> override{};
17
18 QVector<PushRule> room{};
19
20 QVector<PushRule> sender{};
21
22 QVector<PushRule> underride{};
23};
24
25template <>
26struct JsonObjectConverter<PushRuleset> {
27 static void dumpTo(QJsonObject& jo, const PushRuleset& pod)
28 {
29 addParam<IfNotEmpty>(container&: jo, QStringLiteral("content"), value: pod.content);
30 addParam<IfNotEmpty>(container&: jo, QStringLiteral("override"), value: pod.override);
31 addParam<IfNotEmpty>(container&: jo, QStringLiteral("room"), value: pod.room);
32 addParam<IfNotEmpty>(container&: jo, QStringLiteral("sender"), value: pod.sender);
33 addParam<IfNotEmpty>(container&: jo, QStringLiteral("underride"), value: pod.underride);
34 }
35 static void fillFrom(const QJsonObject& jo, PushRuleset& pod)
36 {
37 fillFromJson(jv: jo.value(key: "content"_ls), pod&: pod.content);
38 fillFromJson(jv: jo.value(key: "override"_ls), pod&: pod.override);
39 fillFromJson(jv: jo.value(key: "room"_ls), pod&: pod.room);
40 fillFromJson(jv: jo.value(key: "sender"_ls), pod&: pod.sender);
41 fillFromJson(jv: jo.value(key: "underride"_ls), pod&: pod.underride);
42 }
43};
44
45} // namespace Quotient
46