From aacc4bcb4a487871daae6717f77605aaba444341 Mon Sep 17 00:00:00 2001 From: Marc Deop Date: Sat, 2 Mar 2019 12:26:57 +0100 Subject: style: apply .clang-format to all .cpp and .h files --- lib/csapi/pushrules.h | 355 ++++++++++++++++++++++++++------------------------ 1 file changed, 186 insertions(+), 169 deletions(-) (limited to 'lib/csapi/pushrules.h') diff --git a/lib/csapi/pushrules.h b/lib/csapi/pushrules.h index c038401c..5191d129 100644 --- a/lib/csapi/pushrules.h +++ b/lib/csapi/pushrules.h @@ -6,14 +6,13 @@ #include "jobs/basejob.h" -#include "csapi/definitions/push_ruleset.h" #include "converters.h" +#include "csapi/definitions/push_condition.h" #include "csapi/definitions/push_rule.h" +#include "csapi/definitions/push_ruleset.h" #include -#include "csapi/definitions/push_condition.h" -namespace QMatrixClient -{ +namespace QMatrixClient { // Operations /// Retrieve all push rulesets. @@ -25,29 +24,29 @@ namespace QMatrixClient class GetPushRulesJob : public BaseJob { public: - explicit GetPushRulesJob(); + explicit GetPushRulesJob(); - /*! Construct a URL without creating a full-fledged job object - * - * This function can be used when a URL for - * GetPushRulesJob is necessary but the job - * itself isn't. - */ - static QUrl makeRequestUrl(QUrl baseUrl); + /*! Construct a URL without creating a full-fledged job object + * + * This function can be used when a URL for + * GetPushRulesJob is necessary but the job + * itself isn't. + */ + static QUrl makeRequestUrl(QUrl baseUrl); - ~GetPushRulesJob() override; + ~GetPushRulesJob() override; - // Result properties + // Result properties - /// The global ruleset. - const PushRuleset& global() const; + /// The global ruleset. + const PushRuleset& global() const; protected: - Status parseJson(const QJsonDocument& data) override; + Status parseJson(const QJsonDocument& data) override; private: - class Private; - QScopedPointer d; + class Private; + QScopedPointer d; }; /// Retrieve a push rule. @@ -56,37 +55,39 @@ namespace QMatrixClient class GetPushRuleJob : public BaseJob { public: - /*! Retrieve a push rule. - * \param scope - * ``global`` to specify global rules. - * \param kind - * The kind of rule - * \param ruleId - * The identifier for the rule. - */ - explicit GetPushRuleJob(const QString& scope, const QString& kind, const QString& ruleId); - - /*! Construct a URL without creating a full-fledged job object - * - * This function can be used when a URL for - * GetPushRuleJob is necessary but the job - * itself isn't. - */ - 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; + /*! Retrieve a push rule. + * \param scope + * ``global`` to specify global rules. + * \param kind + * The kind of rule + * \param ruleId + * The identifier for the rule. + */ + explicit GetPushRuleJob(const QString& scope, const QString& kind, + const QString& ruleId); + + /*! Construct a URL without creating a full-fledged job object + * + * This function can be used when a URL for + * GetPushRuleJob is necessary but the job + * itself isn't. + */ + 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; + Status parseJson(const QJsonDocument& data) override; private: - class Private; - QScopedPointer d; + class Private; + QScopedPointer d; }; /// Delete a push rule. @@ -95,24 +96,25 @@ namespace QMatrixClient class DeletePushRuleJob : public BaseJob { public: - /*! Delete a push rule. - * \param scope - * ``global`` to specify global rules. - * \param kind - * The kind of rule - * \param ruleId - * The identifier for the rule. - */ - explicit DeletePushRuleJob(const QString& scope, const QString& kind, const QString& ruleId); - - /*! Construct a URL without creating a full-fledged job object - * - * This function can be used when a URL for - * DeletePushRuleJob is necessary but the job - * itself isn't. - */ - static QUrl makeRequestUrl(QUrl baseUrl, const QString& scope, const QString& kind, const QString& ruleId); - + /*! Delete a push rule. + * \param scope + * ``global`` to specify global rules. + * \param kind + * The kind of rule + * \param ruleId + * The identifier for the rule. + */ + explicit DeletePushRuleJob(const QString& scope, const QString& kind, + const QString& ruleId); + + /*! Construct a URL without creating a full-fledged job object + * + * This function can be used when a URL for + * DeletePushRuleJob is necessary but the job + * itself isn't. + */ + static QUrl makeRequestUrl(QUrl baseUrl, const QString& scope, + const QString& kind, const QString& ruleId); }; /// Add or change a push rule. @@ -120,36 +122,40 @@ namespace QMatrixClient /// This endpoint allows the creation, modification and deletion of pushers /// for this user ID. The behaviour of this endpoint varies depending on the /// values in the JSON body. - /// + /// /// When creating push rules, they MUST be enabled by default. class SetPushRuleJob : public BaseJob { public: - /*! 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. - */ - explicit SetPushRuleJob(const QString& scope, const QString& kind, const QString& ruleId, const QStringList& actions, const QString& before = {}, const QString& after = {}, const QVector& conditions = {}, const QString& pattern = {}); + /*! 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. + */ + explicit SetPushRuleJob(const QString& scope, const QString& kind, + const QString& ruleId, + const QStringList& actions, + const QString& before = {}, + const QString& after = {}, + const QVector& conditions = {}, + const QString& pattern = {}); }; /// Get whether a push rule is enabled @@ -158,57 +164,62 @@ namespace QMatrixClient class IsPushRuleEnabledJob : public BaseJob { public: - /*! 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. - */ - explicit IsPushRuleEnabledJob(const QString& scope, const QString& kind, const QString& ruleId); - - /*! Construct a URL without creating a full-fledged job object - * - * This function can be used when a URL for - * IsPushRuleEnabledJob is necessary but the job - * itself isn't. - */ - 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; + /*! 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. + */ + explicit IsPushRuleEnabledJob(const QString& scope, const QString& kind, + const QString& ruleId); + + /*! Construct a URL without creating a full-fledged job object + * + * This function can be used when a URL for + * IsPushRuleEnabledJob is necessary but the job + * itself isn't. + */ + 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; + Status parseJson(const QJsonDocument& data) override; private: - class Private; - QScopedPointer d; + class Private; + QScopedPointer d; }; /// Enable or disable a push rule. /// - /// This endpoint allows clients to enable or disable the specified push rule. + /// This endpoint allows clients to enable or disable the specified push + /// rule. class SetPushRuleEnabledJob : public BaseJob { public: - /*! 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. - */ - explicit SetPushRuleEnabledJob(const QString& scope, const QString& kind, const QString& ruleId, bool enabled); + /*! 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. + */ + explicit SetPushRuleEnabledJob(const QString& scope, + const QString& kind, + const QString& ruleId, bool enabled); }; /// The actions for a push rule @@ -217,38 +228,41 @@ namespace QMatrixClient class GetPushRuleActionsJob : public BaseJob { public: - /*! 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. - */ - explicit GetPushRuleActionsJob(const QString& scope, const QString& kind, const QString& ruleId); - - /*! Construct a URL without creating a full-fledged job object - * - * This function can be used when a URL for - * GetPushRuleActionsJob is necessary but the job - * itself isn't. - */ - 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; + /*! 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. + */ + explicit GetPushRuleActionsJob(const QString& scope, + const QString& kind, + const QString& ruleId); + + /*! Construct a URL without creating a full-fledged job object + * + * This function can be used when a URL for + * GetPushRuleActionsJob is necessary but the job + * itself isn't. + */ + 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; + Status parseJson(const QJsonDocument& data) override; private: - class Private; - QScopedPointer d; + class Private; + QScopedPointer d; }; /// Set the actions for a push rule. @@ -258,16 +272,19 @@ namespace QMatrixClient class SetPushRuleActionsJob : public BaseJob { public: - /*! 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. - */ - explicit SetPushRuleActionsJob(const QString& scope, const QString& kind, const QString& ruleId, const QStringList& actions); + /*! 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. + */ + explicit SetPushRuleActionsJob(const QString& scope, + const QString& kind, + const QString& ruleId, + const QStringList& actions); }; } // namespace QMatrixClient -- cgit v1.2.3 From 27ca32a1e5a56e09b9cc1d94224d2831004dcf3d Mon Sep 17 00:00:00 2001 From: Kitsune Ral Date: Sun, 7 Jul 2019 19:32:34 +0900 Subject: Namespace: QMatrixClient -> Quotient (with back comp alias) --- lib/csapi/pushrules.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/csapi/pushrules.h') diff --git a/lib/csapi/pushrules.h b/lib/csapi/pushrules.h index 9074addb..cb94fe7b 100644 --- a/lib/csapi/pushrules.h +++ b/lib/csapi/pushrules.h @@ -14,7 +14,7 @@ #include -namespace QMatrixClient +namespace Quotient { // Operations @@ -297,4 +297,4 @@ public: const QStringList& actions); }; -} // namespace QMatrixClient +} // namespace Quotient -- cgit v1.2.3 From 7036ed0dcb137cb5cbb6b426dd338c5e2e4c6424 Mon Sep 17 00:00:00 2001 From: Kitsune Ral Date: Fri, 17 Apr 2020 07:42:13 +0200 Subject: Regenerate API files using new GTAD and refreshed templates No functional changes. --- lib/csapi/pushrules.h | 120 +++++++++++++++++++++++--------------------------- 1 file changed, 55 insertions(+), 65 deletions(-) (limited to 'lib/csapi/pushrules.h') diff --git a/lib/csapi/pushrules.h b/lib/csapi/pushrules.h index cb94fe7b..a9169151 100644 --- a/lib/csapi/pushrules.h +++ b/lib/csapi/pushrules.h @@ -14,31 +14,28 @@ #include -namespace Quotient -{ +namespace Quotient { // Operations -/// Retrieve all push rulesets. -/*! +/*! \brief Retrieve all push rulesets. + * * Retrieve all push rulesets for this user. Clients can "drill-down" on * the rulesets by suffixing a ``scope`` to this path e.g. * ``/pushrules/global/``. This will return a subset of this data under the * specified key e.g. the ``global`` key. */ -class GetPushRulesJob : public BaseJob -{ +class GetPushRulesJob : public BaseJob { public: + /// Retrieve all push rulesets. explicit GetPushRulesJob(); - /*! Construct a URL without creating a full-fledged job object + /*! \brief Construct a URL without creating a full-fledged job object * - * This function can be used when a URL for - * GetPushRulesJob is necessary but the job - * itself isn't. + * This function can be used when a URL for GetPushRulesJob + * is necessary but the job itself isn't. */ static QUrl makeRequestUrl(QUrl baseUrl); - ~GetPushRulesJob() override; // Result properties @@ -54,14 +51,14 @@ private: QScopedPointer d; }; -/// Retrieve a push rule. -/*! +/*! \brief Retrieve a push rule. + * * Retrieve a single specified push rule. */ -class GetPushRuleJob : public BaseJob -{ +class GetPushRuleJob : public BaseJob { public: - /*! Retrieve a push rule. + /*! \brief Retrieve a push rule. + * * \param scope * ``global`` to specify global rules. * \param kind @@ -72,15 +69,13 @@ public: explicit GetPushRuleJob(const QString& scope, const QString& kind, const QString& ruleId); - /*! Construct a URL without creating a full-fledged job object + /*! \brief Construct a URL without creating a full-fledged job object * - * This function can be used when a URL for - * GetPushRuleJob is necessary but the job - * itself isn't. + * This function can be used when a URL for GetPushRuleJob + * is necessary but the job itself isn't. */ static QUrl makeRequestUrl(QUrl baseUrl, const QString& scope, const QString& kind, const QString& ruleId); - ~GetPushRuleJob() override; // Result properties @@ -96,14 +91,14 @@ private: QScopedPointer d; }; -/// Delete a push rule. -/*! +/*! \brief Delete a push rule. + * * This endpoint removes the push rule defined in the path. */ -class DeletePushRuleJob : public BaseJob -{ +class DeletePushRuleJob : public BaseJob { public: - /*! Delete a push rule. + /*! \brief Delete a push rule. + * * \param scope * ``global`` to specify global rules. * \param kind @@ -114,28 +109,27 @@ public: explicit DeletePushRuleJob(const QString& scope, const QString& kind, const QString& ruleId); - /*! Construct a URL without creating a full-fledged job object + /*! \brief Construct a URL without creating a full-fledged job object * - * This function can be used when a URL for - * DeletePushRuleJob is necessary but the job - * itself isn't. + * This function can be used when a URL for DeletePushRuleJob + * is necessary but the job itself isn't. */ static QUrl makeRequestUrl(QUrl baseUrl, const QString& scope, const QString& kind, const QString& ruleId); }; -/// Add or change a push rule. -/*! +/*! \brief Add or change a push rule. + * * This endpoint allows the creation, modification and deletion of pushers * for this user ID. The behaviour of this endpoint varies depending on the * values in the JSON body. * * When creating push rules, they MUST be enabled by default. */ -class SetPushRuleJob : public BaseJob -{ +class SetPushRuleJob : public BaseJob { public: - /*! Add or change a push rule. + /*! \brief Add or change a push rule. + * * \param scope * ``global`` to specify global rules. * \param kind @@ -167,14 +161,14 @@ public: const QString& pattern = {}); }; -/// Get whether a push rule is enabled -/*! +/*! \brief Get whether a push rule is enabled + * * This endpoint gets whether the specified push rule is enabled. */ -class IsPushRuleEnabledJob : public BaseJob -{ +class IsPushRuleEnabledJob : public BaseJob { public: - /*! Get whether a push rule is enabled + /*! \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``. @@ -186,15 +180,13 @@ public: explicit IsPushRuleEnabledJob(const QString& scope, const QString& kind, const QString& ruleId); - /*! Construct a URL without creating a full-fledged job object + /*! \brief Construct a URL without creating a full-fledged job object * - * This function can be used when a URL for - * IsPushRuleEnabledJob is necessary but the job - * itself isn't. + * This function can be used when a URL for IsPushRuleEnabledJob + * is necessary but the job itself isn't. */ static QUrl makeRequestUrl(QUrl baseUrl, const QString& scope, const QString& kind, const QString& ruleId); - ~IsPushRuleEnabledJob() override; // Result properties @@ -210,14 +202,14 @@ private: QScopedPointer d; }; -/// Enable or disable a push rule. -/*! +/*! \brief Enable or disable a push rule. + * * This endpoint allows clients to enable or disable the specified push rule. */ -class SetPushRuleEnabledJob : public BaseJob -{ +class SetPushRuleEnabledJob : public BaseJob { public: - /*! Enable or disable a push rule. + /*! \brief Enable or disable a push rule. + * * \param scope * ``global`` to specify global rules. * \param kind @@ -231,14 +223,14 @@ public: const QString& ruleId, bool enabled); }; -/// The actions for a push rule -/*! +/*! \brief The actions for a push rule + * * This endpoint get the actions for the specified push rule. */ -class GetPushRuleActionsJob : public BaseJob -{ +class GetPushRuleActionsJob : public BaseJob { public: - /*! The actions for a push rule + /*! \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``. @@ -250,15 +242,13 @@ public: explicit GetPushRuleActionsJob(const QString& scope, const QString& kind, const QString& ruleId); - /*! Construct a URL without creating a full-fledged job object + /*! \brief Construct a URL without creating a full-fledged job object * - * This function can be used when a URL for - * GetPushRuleActionsJob is necessary but the job - * itself isn't. + * This function can be used when a URL for GetPushRuleActionsJob + * is necessary but the job itself isn't. */ static QUrl makeRequestUrl(QUrl baseUrl, const QString& scope, const QString& kind, const QString& ruleId); - ~GetPushRuleActionsJob() override; // Result properties @@ -274,15 +264,15 @@ private: QScopedPointer d; }; -/// Set the actions for a push rule. -/*! +/*! \brief Set the actions for a push rule. + * * This endpoint allows clients to change the actions of a push rule. * This can be used to change the actions of builtin rules. */ -class SetPushRuleActionsJob : public BaseJob -{ +class SetPushRuleActionsJob : public BaseJob { public: - /*! Set the actions for a push rule. + /*! \brief Set the actions for a push rule. + * * \param scope * ``global`` to specify global rules. * \param kind -- cgit v1.2.3 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 From e17764a1ae81393968dfb747c7b67353c109bc71 Mon Sep 17 00:00:00 2001 From: Kitsune Ral Date: Fri, 19 Jun 2020 15:01:33 +0200 Subject: csapi/: generated using the latest GTAD and matrix-doc For matrix-doc, specifically, it is master (5cb4b086) merged with https://github.com/matrix-org/matrix-doc/pull/2518. --- lib/csapi/pushrules.h | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) (limited to 'lib/csapi/pushrules.h') diff --git a/lib/csapi/pushrules.h b/lib/csapi/pushrules.h index 0971dc6b..f6d3458a 100644 --- a/lib/csapi/pushrules.h +++ b/lib/csapi/pushrules.h @@ -47,7 +47,6 @@ public: class GetPushRuleJob : public BaseJob { public: /*! \brief Retrieve a push rule. - * * * \param scope * ``global`` to specify global rules. @@ -73,7 +72,7 @@ public: /// 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()); } + PushRule pushRule() const { return fromJson(jsonData()); } }; /*! \brief Delete a push rule. @@ -83,7 +82,6 @@ public: class DeletePushRuleJob : public BaseJob { public: /*! \brief Delete a push rule. - * * * \param scope * ``global`` to specify global rules. @@ -117,7 +115,6 @@ public: class SetPushRuleJob : public BaseJob { public: /*! \brief Add or change a push rule. - * * * \param scope * ``global`` to specify global rules. @@ -165,7 +162,6 @@ public: class IsPushRuleEnabledJob : public BaseJob { public: /*! \brief Get whether a push rule is enabled - * * * \param scope * Either ``global`` or ``device/`` to specify global @@ -201,7 +197,6 @@ public: class SetPushRuleEnabledJob : public BaseJob { public: /*! \brief Enable or disable a push rule. - * * * \param scope * ``global`` to specify global rules. @@ -226,7 +221,6 @@ public: class GetPushRuleActionsJob : public BaseJob { public: /*! \brief The actions for a push rule - * * * \param scope * Either ``global`` or ``device/`` to specify global @@ -266,7 +260,6 @@ public: class SetPushRuleActionsJob : public BaseJob { public: /*! \brief Set the actions for a push rule. - * * * \param scope * ``global`` to specify global rules. -- cgit v1.2.3 From d1c5e514fb65bbea182b34a893bca12b321e3bac Mon Sep 17 00:00:00 2001 From: Kitsune Ral Date: Fri, 24 Jul 2020 08:29:35 +0200 Subject: csapi/: refresh from the latest matrix-doc --- lib/csapi/pushrules.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'lib/csapi/pushrules.h') diff --git a/lib/csapi/pushrules.h b/lib/csapi/pushrules.h index f6d3458a..1c6d5c2d 100644 --- a/lib/csapi/pushrules.h +++ b/lib/csapi/pushrules.h @@ -148,7 +148,8 @@ public: * against. */ explicit SetPushRuleJob(const QString& scope, const QString& kind, - const QString& ruleId, const QStringList& actions, + const QString& ruleId, + const QVector& actions, const QString& before = {}, const QString& after = {}, const QVector& conditions = {}, @@ -246,9 +247,9 @@ public: // Result properties /// The action(s) to perform for this rule. - QStringList actions() const + QVector actions() const { - return loadFromJson("actions"_ls); + return loadFromJson>("actions"_ls); } }; @@ -275,7 +276,7 @@ public: */ explicit SetPushRuleActionsJob(const QString& scope, const QString& kind, const QString& ruleId, - const QStringList& actions); + const QVector& actions); }; } // namespace Quotient -- cgit v1.2.3 From 0d4315008374d9a4dfb11f934875b1a16670ec74 Mon Sep 17 00:00:00 2001 From: Alexey Rusakov Date: Wed, 23 Jun 2021 19:12:38 +0200 Subject: Re-generate API files --- lib/csapi/pushrules.h | 42 ++++++++++++++++++++++++------------------ 1 file changed, 24 insertions(+), 18 deletions(-) (limited to 'lib/csapi/pushrules.h') diff --git a/lib/csapi/pushrules.h b/lib/csapi/pushrules.h index 1c6d5c2d..90d2ce79 100644 --- a/lib/csapi/pushrules.h +++ b/lib/csapi/pushrules.h @@ -15,9 +15,9 @@ namespace Quotient { /*! \brief Retrieve all push rulesets. * * Retrieve all push rulesets for this user. Clients can "drill-down" on - * the rulesets by suffixing a ``scope`` to this path e.g. - * ``/pushrules/global/``. This will return a subset of this data under the - * specified key e.g. the ``global`` key. + * the rulesets by suffixing a `scope` to this path e.g. + * `/pushrules/global/`. This will return a subset of this data under the + * specified key e.g. the `global` key. */ class GetPushRulesJob : public BaseJob { public: @@ -49,7 +49,7 @@ public: /*! \brief Retrieve a push rule. * * \param scope - * ``global`` to specify global rules. + * `global` to specify global rules. * * \param kind * The kind of rule @@ -71,8 +71,11 @@ public: // Result properties /// 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 pushRule() const { return fromJson(jsonData()); } + /// rule itself such as the rule's `actions` and `conditions` if set. + PushRule pushRule() const + { + return fromJson(jsonData()); + } }; /*! \brief Delete a push rule. @@ -84,7 +87,7 @@ public: /*! \brief Delete a push rule. * * \param scope - * ``global`` to specify global rules. + * `global` to specify global rules. * * \param kind * The kind of rule @@ -117,7 +120,7 @@ public: /*! \brief Add or change a push rule. * * \param scope - * ``global`` to specify global rules. + * `global` to specify global rules. * * \param kind * The kind of rule @@ -129,7 +132,7 @@ public: * 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 + * 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. * @@ -141,10 +144,10 @@ public: * \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. + * always matches. Only applicable to `underride` and `override` rules. * * \param pattern - * Only applicable to ``content`` rules. The glob-style pattern to match + * Only applicable to `content` rules. The glob-style pattern to match * against. */ explicit SetPushRuleJob(const QString& scope, const QString& kind, @@ -165,8 +168,8 @@ 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``. + * Either `global` or `device/` to specify global + * rules or device rules for the given `profile_tag`. * * \param kind * The kind of rule @@ -188,7 +191,10 @@ public: // Result properties /// Whether the push rule is enabled or not. - bool enabled() const { return loadFromJson("enabled"_ls); } + bool enabled() const + { + return loadFromJson("enabled"_ls); + } }; /*! \brief Enable or disable a push rule. @@ -200,7 +206,7 @@ public: /*! \brief Enable or disable a push rule. * * \param scope - * ``global`` to specify global rules. + * `global` to specify global rules. * * \param kind * The kind of rule @@ -224,8 +230,8 @@ 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``. + * Either `global` or `device/` to specify global + * rules or device rules for the given `profile_tag`. * * \param kind * The kind of rule @@ -263,7 +269,7 @@ public: /*! \brief Set the actions for a push rule. * * \param scope - * ``global`` to specify global rules. + * `global` to specify global rules. * * \param kind * The kind of rule -- cgit v1.2.3 From f7cbefe5ad626ae1798a5d7bb7546e89ad336acd Mon Sep 17 00:00:00 2001 From: Alexey Rusakov Date: Sat, 7 Aug 2021 16:55:06 +0200 Subject: API files: reformat after .clang-format change See 000b5730. --- lib/csapi/pushrules.h | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'lib/csapi/pushrules.h') diff --git a/lib/csapi/pushrules.h b/lib/csapi/pushrules.h index 90d2ce79..a5eb48f0 100644 --- a/lib/csapi/pushrules.h +++ b/lib/csapi/pushrules.h @@ -72,10 +72,7 @@ public: /// 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 pushRule() const - { - return fromJson(jsonData()); - } + PushRule pushRule() const { return fromJson(jsonData()); } }; /*! \brief Delete a push rule. @@ -191,10 +188,7 @@ public: // Result properties /// Whether the push rule is enabled or not. - bool enabled() const - { - return loadFromJson("enabled"_ls); - } + bool enabled() const { return loadFromJson("enabled"_ls); } }; /*! \brief Enable or disable a push rule. -- cgit v1.2.3 From 952f8aa8ad19348b50a3b3545d98f7889bfdae76 Mon Sep 17 00:00:00 2001 From: Alexey Rusakov Date: Wed, 29 Dec 2021 15:57:33 +0100 Subject: Regenerate CS API files --- lib/csapi/pushrules.h | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'lib/csapi/pushrules.h') diff --git a/lib/csapi/pushrules.h b/lib/csapi/pushrules.h index a5eb48f0..d6c57efd 100644 --- a/lib/csapi/pushrules.h +++ b/lib/csapi/pushrules.h @@ -19,7 +19,7 @@ namespace Quotient { * `/pushrules/global/`. This will return a subset of this data under the * specified key e.g. the `global` key. */ -class GetPushRulesJob : public BaseJob { +class QUOTIENT_API GetPushRulesJob : public BaseJob { public: /// Retrieve all push rulesets. explicit GetPushRulesJob(); @@ -44,7 +44,7 @@ public: * * Retrieve a single specified push rule. */ -class GetPushRuleJob : public BaseJob { +class QUOTIENT_API GetPushRuleJob : public BaseJob { public: /*! \brief Retrieve a push rule. * @@ -79,7 +79,7 @@ public: * * This endpoint removes the push rule defined in the path. */ -class DeletePushRuleJob : public BaseJob { +class QUOTIENT_API DeletePushRuleJob : public BaseJob { public: /*! \brief Delete a push rule. * @@ -112,7 +112,7 @@ public: * * When creating push rules, they MUST be enabled by default. */ -class SetPushRuleJob : public BaseJob { +class QUOTIENT_API SetPushRuleJob : public BaseJob { public: /*! \brief Add or change a push rule. * @@ -160,7 +160,7 @@ public: * * This endpoint gets whether the specified push rule is enabled. */ -class IsPushRuleEnabledJob : public BaseJob { +class QUOTIENT_API IsPushRuleEnabledJob : public BaseJob { public: /*! \brief Get whether a push rule is enabled * @@ -195,7 +195,7 @@ public: * * This endpoint allows clients to enable or disable the specified push rule. */ -class SetPushRuleEnabledJob : public BaseJob { +class QUOTIENT_API SetPushRuleEnabledJob : public BaseJob { public: /*! \brief Enable or disable a push rule. * @@ -219,7 +219,7 @@ public: * * This endpoint get the actions for the specified push rule. */ -class GetPushRuleActionsJob : public BaseJob { +class QUOTIENT_API GetPushRuleActionsJob : public BaseJob { public: /*! \brief The actions for a push rule * @@ -258,7 +258,7 @@ public: * This endpoint allows clients to change the actions of a push rule. * This can be used to change the actions of builtin rules. */ -class SetPushRuleActionsJob : public BaseJob { +class QUOTIENT_API SetPushRuleActionsJob : public BaseJob { public: /*! \brief Set the actions for a push rule. * -- cgit v1.2.3