60 std::optional<std::string>
nextToken()
const;
90 , std::string _accessToken
92 std::optional<std::string> from = std::nullopt, std::optional<int> limit = std::nullopt, std::optional<std::string> only = std::nullopt
97 std::optional<std::string> from, std::optional<int> limit, std::optional<std::string> only);
99 static BaseJob::Body buildBody(std::optional<std::string> from, std::optional<int> limit, std::optional<std::string> only);
112 using namespace Kazv;
119 if (! jo.is_object()) { jo = json::object(); }
124 jo[
"event"s] = pod.
event;
126 jo[
"read"s] = pod.
read;
128 jo[
"room_id"s] = pod.
roomId;
139 if (jo.contains(
"actions"s)) {
140 result.
actions = jo.at(
"actions"s);
142 if (jo.contains(
"event"s)) {
143 result.
event = jo.at(
"event"s);
145 if (jo.contains(
"read"s)) {
146 result.
read = jo.at(
"read"s);
148 if (jo.contains(
"room_id"s)) {
149 result.
roomId = jo.at(
"room_id"s);
151 if (jo.contains(
"ts"s)) {
152 result.
ts = jo.at(
"ts"s);
154 if (jo.contains(
"profile_tag"s)) {
Definition: notifications.hpp:46
immer::array< Notification > notifications() const
The list of events that triggered notifications.
Definition: notifications.cpp:97
JobResponse(Response r)
Definition: notifications.cpp:72
std::optional< std::string > nextToken() const
The token to supply in the from param of the next /notifications request in order to request more eve...
Definition: notifications.cpp:86
bool success() const
Definition: notifications.cpp:75
Gets a list of events that the user has been notified about.
Definition: notifications.hpp:17
GetNotificationsJob withData(JsonWrap j) &&
Definition: notifications.cpp:58
static BaseJob::Body buildBody(std::optional< std::string > from, std::optional< int > limit, std::optional< std::string > only)
Definition: notifications.cpp:26
GetNotificationsJob(std::string serverUrl, std::string _accessToken, std::optional< std::string > from=std::nullopt, std::optional< int > limit=std::nullopt, std::optional< std::string > only=std::nullopt)
Gets a list of events that the user has been notified about.
Definition: notifications.cpp:38
static constexpr auto needsAuth()
Definition: notifications.hpp:67
static BaseJob::Query buildQuery(std::optional< std::string > from, std::optional< int > limit, std::optional< std::string > only)
Definition: notifications.cpp:13
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
This API is used to paginate through the list of events that the user has been, or would have been no...
Definition: notifications.hpp:24
Event event
The Event object for the event that triggered the notification.
Definition: notifications.hpp:29
immer::array< Variant > actions
The action(s) to perform when the conditions for this rule are met.
Definition: notifications.hpp:27
std::optional< std::string > profileTag
The profile tag of the rule that matched this event.
Definition: notifications.hpp:39
bool read
Indicates whether the user has sent a read receipt indicating that they have read this message.
Definition: notifications.hpp:32
std::string roomId
The ID of the room in which the event was posted.
Definition: notifications.hpp:34
std::int_fast64_t ts
The unix timestamp at which the event notification was sent, in milliseconds.
Definition: notifications.hpp:37
Definition: basejob.hpp:50
static void from_json(const json &jo, GetNotificationsJob::Notification &result)
Definition: notifications.hpp:136
static void to_json(json &jo, const GetNotificationsJob::Notification &pod)
Definition: notifications.hpp:117