26 std::optional<std::string>
url;
79 immer::array<Pusher>
pushers()
const;
92 , std::string _accessToken
114 using namespace Kazv;
121 if (! jo.is_object()) { jo = json::object(); }
133 if (jo.contains(
"url"s)) {
134 result.
url = jo.at(
"url"s);
136 if (jo.contains(
"format"s)) {
137 result.
format = jo.at(
"format"s);
148 if (! jo.is_object()) { jo = json::object(); }
153 jo[
"kind"s] = pod.
kind;
155 jo[
"app_id"s] = pod.
appId;
161 jo[
"lang"s] = pod.
lang;
163 jo[
"data"s] = pod.
data;
172 if (jo.contains(
"pushkey"s)) {
173 result.
pushkey = jo.at(
"pushkey"s);
175 if (jo.contains(
"kind"s)) {
176 result.
kind = jo.at(
"kind"s);
178 if (jo.contains(
"app_id"s)) {
179 result.
appId = jo.at(
"app_id"s);
181 if (jo.contains(
"app_display_name"s)) {
184 if (jo.contains(
"device_display_name"s)) {
187 if (jo.contains(
"lang"s)) {
188 result.
lang = jo.at(
"lang"s);
190 if (jo.contains(
"data"s)) {
191 result.
data = jo.at(
"data"s);
193 if (jo.contains(
"profile_tag"s)) {
223 std::optional<std::string>
url;
240 bool success()
const;
306 , std::string _accessToken
308 std::string pushkey , std::string kind , std::string appId , std::string appDisplayName , std::string deviceDisplayName , std::string lang , PusherData data , std::optional<std::string> profileTag = std::nullopt, std::optional<bool> append = std::nullopt
315 static BaseJob::Body buildBody(std::string pushkey, std::string kind, std::string appId, std::string appDisplayName, std::string deviceDisplayName, std::string lang, PusherData data, std::optional<std::string> profileTag, std::optional<bool> append);
328 using namespace Kazv;
335 if (! jo.is_object()) { jo = json::object(); }
347 if (jo.contains(
"url"s)) {
348 result.
url = jo.at(
"url"s);
350 if (jo.contains(
"format"s)) {
351 result.
format = jo.at(
"format"s);
Definition: pusher.hpp:67
bool success() const
Definition: pusher.cpp:70
JobResponse(Response r)
Definition: pusher.cpp:67
immer::array< Pusher > pushers() const
An array containing the current pushers for the user.
Definition: pusher.cpp:80
Gets the current pushers for the authenticated user.
Definition: pusher.hpp:16
GetPushersJob withData(JsonWrap j) &&
Definition: pusher.cpp:53
static constexpr auto needsAuth()
Definition: pusher.hpp:82
GetPushersJob(std::string serverUrl, std::string _accessToken)
Gets the current pushers for the authenticated user.
Definition: pusher.cpp:33
static BaseJob::Query buildQuery()
Definition: pusher.cpp:13
static BaseJob::Body buildBody()
Definition: pusher.cpp:21
Definition: pusher.hpp:236
Modify a pusher for this user on the homeserver.
Definition: pusher.hpp:211
static constexpr auto needsAuth()
Definition: pusher.hpp:243
Definition: basejob.hpp:91
Definition: basejob.hpp:77
::Kazv::Body Body
Definition: basejob.hpp:100
Definition: jsonwrap.hpp:23
Definition: location.hpp:10
Definition: location.hpp:10
void addToJsonIfNeeded(json &j, std::string name, T &&arg)
Definition: types.hpp:80
nlohmann::json json
Definition: jsonwrap.hpp:20
Definition: location.hpp:27
A dictionary of information for the pusher implementation itself.
Definition: pusher.hpp:23
std::optional< std::string > url
Required if kind is http.
Definition: pusher.hpp:26
std::optional< std::string > format
The format to use when sending notifications to the Push Gateway.
Definition: pusher.hpp:29
Gets all currently active pushers for the authenticated user.
Definition: pusher.hpp:35
std::string appId
This is a reverse-DNS style identifier for the application.
Definition: pusher.hpp:45
std::optional< std::string > profileTag
This string determines which set of device specific rules this pusher executes.
Definition: pusher.hpp:60
std::string deviceDisplayName
A string that will allow the user to identify what device owns this pusher.
Definition: pusher.hpp:51
PusherData data
A dictionary of information for the pusher implementation itself.
Definition: pusher.hpp:57
std::string kind
The kind of pusher.
Definition: pusher.hpp:42
std::string lang
The preferred language for receiving notifications (e.g.
Definition: pusher.hpp:54
std::string appDisplayName
A string that will allow the user to identify what application owns this pusher.
Definition: pusher.hpp:48
std::string pushkey
This is a unique identifier for this pusher.
Definition: pusher.hpp:39
A dictionary of information for the pusher implementation itself.
Definition: pusher.hpp:219
std::optional< std::string > format
The format to send notifications in to Push Gateways if the kind is http.
Definition: pusher.hpp:229
std::optional< std::string > url
Required if kind is http.
Definition: pusher.hpp:223
Definition: basejob.hpp:50
static void to_json(json &jo, const GetPushersJob::PusherData &pod)
Definition: pusher.hpp:119
static void from_json(const json &jo, GetPushersJob::PusherData &result)
Definition: pusher.hpp:130
static void from_json(const json &jo, GetPushersJob::Pusher &result)
Definition: pusher.hpp:169
static void to_json(json &jo, const GetPushersJob::Pusher &pod)
Definition: pusher.hpp:146
static void from_json(const json &jo, PostPusherJob::PusherData &result)
Definition: pusher.hpp:344
static void to_json(json &jo, const PostPusherJob::PusherData &pod)
Definition: pusher.hpp:333