aboutsummaryrefslogtreecommitdiff
path: root/lib/csapi/threads_list.h
diff options
context:
space:
mode:
authorn-peugnet <n.peugnet@free.fr>2022-10-06 19:27:24 +0200
committern-peugnet <n.peugnet@free.fr>2022-10-06 19:27:24 +0200
commit08632625e1a04257b5c7d4a9db2246ac07436748 (patch)
tree9ddadf219a7e352ddd3549ad1683282c944adfb6 /lib/csapi/threads_list.h
parente9c2e2a26d3711e755aa5eb8a8478917c71d612b (diff)
parentd911b207f49e936b3e992200796110f0749ed150 (diff)
downloadlibquotient-08632625e1a04257b5c7d4a9db2246ac07436748.tar.gz
libquotient-08632625e1a04257b5c7d4a9db2246ac07436748.zip
Update upstream source from tag 'upstream/0.7.0'
Update to upstream version '0.7.0' with Debian dir 30dcb77a77433e4a54eab77c0b82ae925dead2d8
Diffstat (limited to 'lib/csapi/threads_list.h')
-rw-r--r--lib/csapi/threads_list.h76
1 files changed, 76 insertions, 0 deletions
diff --git a/lib/csapi/threads_list.h b/lib/csapi/threads_list.h
new file mode 100644
index 00000000..7041583a
--- /dev/null
+++ b/lib/csapi/threads_list.h
@@ -0,0 +1,76 @@
+/******************************************************************************
+ * THIS FILE IS GENERATED - ANY EDITS WILL BE OVERWRITTEN
+ */
+
+#pragma once
+
+#include "events/roomevent.h"
+#include "jobs/basejob.h"
+
+namespace Quotient {
+
+/*! \brief Retrieve a list of threads in a room, with optional filters.
+ *
+ * Paginates over the thread roots in a room, ordered by the `latest_event` of
+ * each thread root in its bundle.
+ */
+class QUOTIENT_API GetThreadRootsJob : public BaseJob {
+public:
+ /*! \brief Retrieve a list of threads in a room, with optional filters.
+ *
+ * \param roomId
+ * The room ID where the thread roots are located.
+ *
+ * \param include
+ * Optional (default `all`) flag to denote which thread roots are of
+ * interest to the caller. When `all`, all thread roots found in the room
+ * are returned. When `participated`, only thread roots for threads the user
+ * has [participated
+ * in](/client-server-api/#server-side-aggreagtion-of-mthread-relationships)
+ * will be returned.
+ *
+ * \param limit
+ * Optional limit for the maximum number of thread roots to include per
+ * response. Must be an integer greater than zero.
+ *
+ * Servers should apply a default value, and impose a maximum value to
+ * avoid resource exhaustion.
+ *
+ * \param from
+ * A pagination token from a previous result. When not provided, the
+ * server starts paginating from the most recent event visible to the user
+ * (as per history visibility rules; topologically).
+ */
+ explicit GetThreadRootsJob(const QString& roomId,
+ const QString& include = {},
+ Omittable<int> limit = none,
+ const QString& from = {});
+
+ /*! \brief Construct a URL without creating a full-fledged job object
+ *
+ * This function can be used when a URL for GetThreadRootsJob
+ * is necessary but the job itself isn't.
+ */
+ static QUrl makeRequestUrl(QUrl baseUrl, const QString& roomId,
+ const QString& include = {},
+ Omittable<int> limit = none,
+ const QString& from = {});
+
+ // Result properties
+
+ /// The thread roots, ordered by the `latest_event` in each event's
+ /// aggregation bundle. All events returned include bundled
+ /// [aggregations](/client-server-api/#aggregations).
+ ///
+ /// If the thread root event was sent by an [ignored
+ /// user](/client-server-api/#ignoring-users), the event is returned
+ /// redacted to the caller. This is to simulate the same behaviour of a
+ /// client doing aggregation locally on the thread.
+ RoomEvents chunk() { return takeFromJson<RoomEvents>("chunk"_ls); }
+
+ /// A token to supply to `from` to keep paginating the responses. Not
+ /// present when there are no further results.
+ QString nextBatch() const { return loadFromJson<QString>("next_batch"_ls); }
+};
+
+} // namespace Quotient