5 #include <Quotient/csapi/definitions/push_condition.h>
6 #include <Quotient/csapi/definitions/push_rule.h>
7 #include <Quotient/csapi/definitions/push_ruleset.h>
9 #include <Quotient/jobs/basejob.h>
19 explicit GetPushRulesJob();
25 static QUrl makeRequestUrl(
const HomeserverData& hsData);
30 PushRuleset global()
const {
return loadFromJson<PushRuleset>(
"global"_L1); }
33 inline auto collectResponse(
const GetPushRulesJob* job) {
return job->global(); }
40 explicit GetPushRulesGlobalJob();
46 static QUrl makeRequestUrl(
const HomeserverData& hsData);
51 PushRuleset data()
const {
return fromJson<PushRuleset>(jsonData()); }
54 inline auto collectResponse(
const GetPushRulesGlobalJob* job) {
return job->data(); }
66 explicit GetPushRuleJob(
const QString& kind,
const QString& ruleId);
72 static QUrl makeRequestUrl(
const HomeserverData& hsData,
const QString& kind,
73 const QString& ruleId);
79 PushRule pushRule()
const {
return fromJson<PushRule>(jsonData()); }
82 inline auto collectResponse(
const GetPushRuleJob* job) {
return job->pushRule(); }
94 explicit DeletePushRuleJob(
const QString& kind,
const QString& ruleId);
100 static QUrl makeRequestUrl(
const HomeserverData& hsData,
const QString& kind,
101 const QString& ruleId);
152 explicit SetPushRuleJob(
const QString& kind,
const QString& ruleId,
153 const QVector<QVariant>& actions,
const QString& before = {},
154 const QString& after = {},
const QVector<PushCondition>& conditions = {},
155 const QString& pattern = {});
168 explicit IsPushRuleEnabledJob(
const QString& kind,
const QString& ruleId);
174 static QUrl makeRequestUrl(
const HomeserverData& hsData,
const QString& kind,
175 const QString& ruleId);
180 bool enabled()
const {
return loadFromJson<
bool>(
"enabled"_L1); }
183 inline auto collectResponse(
const IsPushRuleEnabledJob* job) {
return job->enabled(); }
198 explicit SetPushRuleEnabledJob(
const QString& kind,
const QString& ruleId,
bool enabled);
211 explicit GetPushRuleActionsJob(
const QString& kind,
const QString& ruleId);
217 static QUrl makeRequestUrl(
const HomeserverData& hsData,
const QString& kind,
218 const QString& ruleId);
223 QVector<QVariant> actions()
const {
return loadFromJson<QVector<QVariant>>(
"actions"_L1); }
226 inline auto collectResponse(
const GetPushRuleActionsJob* job) {
return job->actions(); }
242 explicit SetPushRuleActionsJob(
const QString& kind,
const QString& ruleId,
243 const QVector<QVariant>& actions);