Go to the documentation of this file.
26 std::optional<std::string>
key;
36 std::optional<std::string>
is;
48 if (! jo.is_object()) { jo = json::object(); }
51 jo[
"kind"s] = pod.kind;
63 if (jo.contains(
"kind"s)) {
64 result.kind = jo.at(
"kind"s);
66 if (jo.contains(
"key"s)) {
67 result.key = jo.at(
"key"s);
69 if (jo.contains(
"pattern"s)) {
70 result.pattern = jo.at(
"pattern"s);
72 if (jo.contains(
"is"s)) {
73 result.is = jo.at(
"is"s);
std::optional< std::string > is
Required for room_member_count conditions.
Definition: push_condition.hpp:40
std::optional< std::string > key
Required for event_match conditions.
Definition: push_condition.hpp:30
Definition: push_condition.hpp:14
Definition: location.hpp:26
static void from_json(const json &jo, PushCondition &result)
Definition: push_condition.hpp:60
Definition: location.hpp:10
nlohmann::json json
Definition: jsonwrap.hpp:20
Definition: location.hpp:10
std::optional< std::string > pattern
Required for event_match conditions.
Definition: push_condition.hpp:34
void addToJsonIfNeeded(json &j, std::string name, T &&arg)
Definition: types.hpp:80
std::string kind
The kind of condition to apply.
Definition: push_condition.hpp:21
static void to_json(json &jo, const PushCondition &pod)
Definition: push_condition.hpp:46