5 #include <Quotient/jobs/basejob.h>
44 QString appDisplayName;
48 QString deviceDisplayName;
65 explicit GetPushersJob();
71 static QUrl makeRequestUrl(
const HomeserverData& hsData);
76 QVector<Pusher> pushers()
const {
return loadFromJson<QVector<Pusher>>(
"pushers"_L1); }
79 inline auto collectResponse(
const GetPushersJob* job) {
return job->pushers(); }
82 struct QUOTIENT_API JsonObjectConverter<GetPushersJob::PusherData> {
83 static void fillFrom(
const QJsonObject& jo, GetPushersJob::PusherData& result)
85 fillFromJson(jo.value(
"url"_L1), result.url);
86 fillFromJson(jo.value(
"format"_L1), result.format);
91 struct QUOTIENT_API JsonObjectConverter<GetPushersJob::Pusher> {
92 static void fillFrom(
const QJsonObject& jo, GetPushersJob::Pusher& result)
94 fillFromJson(jo.value(
"pushkey"_L1), result.pushkey);
95 fillFromJson(jo.value(
"kind"_L1), result.kind);
96 fillFromJson(jo.value(
"app_id"_L1), result.appId);
97 fillFromJson(jo.value(
"app_display_name"_L1), result.appDisplayName);
98 fillFromJson(jo.value(
"device_display_name"_L1), result.deviceDisplayName);
99 fillFromJson(jo.value(
"lang"_L1), result.lang);
100 fillFromJson(jo.value(
"data"_L1), result.data);
101 fillFromJson(jo.value(
"profile_tag"_L1), result.profileTag);
191 explicit PostPusherJob(
const QString& pushkey,
const QString& kind,
const QString& appId,
192 const QString& appDisplayName = {},
const QString& deviceDisplayName = {},
193 const QString& profileTag = {},
const QString& lang = {},
194 const std::optional<PusherData>& data = std::nullopt,
195 std::optional<
bool> append = std::nullopt);
199 struct QUOTIENT_API JsonObjectConverter<PostPusherJob::PusherData> {
200 static void dumpTo(QJsonObject& jo,
const PostPusherJob::PusherData& pod)
202 addParam<IfNotEmpty>(jo,
"url"_L1, pod.url);
203 addParam<IfNotEmpty>(jo,
"format"_L1, pod.format);