From 32729d9a7519cd2c4cddb0174b8329c6fd4a4a83 Mon Sep 17 00:00:00 2001 From: Kitsune Ral Date: Sun, 7 Jun 2020 19:46:40 +0200 Subject: Update generated files according to gtad/* changes --- lib/csapi/pushrules.h | 90 +++++++++++++++++++++++++-------------------------- 1 file changed, 44 insertions(+), 46 deletions(-) (limited to 'lib/csapi/pushrules.h') diff --git a/lib/csapi/pushrules.h b/lib/csapi/pushrules.h index a9169151..0971dc6b 100644 --- a/lib/csapi/pushrules.h +++ b/lib/csapi/pushrules.h @@ -4,20 +4,14 @@ #pragma once -#include "converters.h" - #include "csapi/definitions/push_condition.h" #include "csapi/definitions/push_rule.h" #include "csapi/definitions/push_ruleset.h" #include "jobs/basejob.h" -#include - namespace Quotient { -// Operations - /*! \brief Retrieve all push rulesets. * * Retrieve all push rulesets for this user. Clients can "drill-down" on @@ -36,19 +30,14 @@ public: * is necessary but the job itself isn't. */ static QUrl makeRequestUrl(QUrl baseUrl); - ~GetPushRulesJob() override; // Result properties /// The global ruleset. - const PushRuleset& global() const; - -protected: - Status parseJson(const QJsonDocument& data) override; - -private: - class Private; - QScopedPointer d; + PushRuleset global() const + { + return loadFromJson("global"_ls); + } }; /*! \brief Retrieve a push rule. @@ -58,11 +47,14 @@ private: class GetPushRuleJob : public BaseJob { public: /*! \brief Retrieve a push rule. + * * * \param scope * ``global`` to specify global rules. + * * \param kind * The kind of rule + * * \param ruleId * The identifier for the rule. */ @@ -76,19 +68,12 @@ public: */ static QUrl makeRequestUrl(QUrl baseUrl, const QString& scope, const QString& kind, const QString& ruleId); - ~GetPushRuleJob() override; // Result properties - /// The push rule. - const PushRule& data() const; - -protected: - Status parseJson(const QJsonDocument& data) override; - -private: - class Private; - QScopedPointer d; + /// The specific push rule. This will also include keys specific to the + /// rule itself such as the rule's ``actions`` and ``conditions`` if set. + PushRule data() const { return fromJson(jsonData()); } }; /*! \brief Delete a push rule. @@ -98,11 +83,14 @@ private: class DeletePushRuleJob : public BaseJob { public: /*! \brief Delete a push rule. + * * * \param scope * ``global`` to specify global rules. + * * \param kind * The kind of rule + * * \param ruleId * The identifier for the rule. */ @@ -129,29 +117,38 @@ public: class SetPushRuleJob : public BaseJob { public: /*! \brief Add or change a push rule. + * * * \param scope * ``global`` to specify global rules. + * * \param kind * The kind of rule + * * \param ruleId * The identifier for the rule. + * * \param actions * The action(s) to perform when the conditions for this rule are met. + * * \param before * Use 'before' with a ``rule_id`` as its value to make the new rule the * next-most important rule with respect to the given user defined rule. * It is not possible to add a rule relative to a predefined server rule. + * * \param after * This makes the new rule the next-less important rule relative to the * given user defined rule. It is not possible to add a rule relative * to a predefined server rule. + * * \param conditions * The conditions that must hold true for an event in order for a * rule to be applied to an event. A rule with no conditions - * always matches. Only applicable to ``underride`` and ``override`` - * rules. \param pattern Only applicable to ``content`` rules. The - * glob-style pattern to match against. + * always matches. Only applicable to ``underride`` and ``override`` rules. + * + * \param pattern + * Only applicable to ``content`` rules. The glob-style pattern to match + * against. */ explicit SetPushRuleJob(const QString& scope, const QString& kind, const QString& ruleId, const QStringList& actions, @@ -168,12 +165,15 @@ public: class IsPushRuleEnabledJob : public BaseJob { public: /*! \brief Get whether a push rule is enabled + * * * \param scope * Either ``global`` or ``device/`` to specify global * rules or device rules for the given ``profile_tag``. + * * \param kind * The kind of rule + * * \param ruleId * The identifier for the rule. */ @@ -187,19 +187,11 @@ public: */ static QUrl makeRequestUrl(QUrl baseUrl, const QString& scope, const QString& kind, const QString& ruleId); - ~IsPushRuleEnabledJob() override; // Result properties /// Whether the push rule is enabled or not. - bool enabled() const; - -protected: - Status parseJson(const QJsonDocument& data) override; - -private: - class Private; - QScopedPointer d; + bool enabled() const { return loadFromJson("enabled"_ls); } }; /*! \brief Enable or disable a push rule. @@ -209,13 +201,17 @@ private: class SetPushRuleEnabledJob : public BaseJob { public: /*! \brief Enable or disable a push rule. + * * * \param scope * ``global`` to specify global rules. + * * \param kind * The kind of rule + * * \param ruleId * The identifier for the rule. + * * \param enabled * Whether the push rule is enabled or not. */ @@ -230,12 +226,15 @@ public: class GetPushRuleActionsJob : public BaseJob { public: /*! \brief The actions for a push rule + * * * \param scope * Either ``global`` or ``device/`` to specify global * rules or device rules for the given ``profile_tag``. + * * \param kind * The kind of rule + * * \param ruleId * The identifier for the rule. */ @@ -249,19 +248,14 @@ public: */ static QUrl makeRequestUrl(QUrl baseUrl, const QString& scope, const QString& kind, const QString& ruleId); - ~GetPushRuleActionsJob() override; // Result properties /// The action(s) to perform for this rule. - const QStringList& actions() const; - -protected: - Status parseJson(const QJsonDocument& data) override; - -private: - class Private; - QScopedPointer d; + QStringList actions() const + { + return loadFromJson("actions"_ls); + } }; /*! \brief Set the actions for a push rule. @@ -272,13 +266,17 @@ private: class SetPushRuleActionsJob : public BaseJob { public: /*! \brief Set the actions for a push rule. + * * * \param scope * ``global`` to specify global rules. + * * \param kind * The kind of rule + * * \param ruleId * The identifier for the rule. + * * \param actions * The action(s) to perform for this rule. */ -- cgit v1.2.3