libkazv
message_pagination.hpp
Go to the documentation of this file.
1 /******************************************************************************
2  * THIS FILE IS GENERATED - ANY EDITS WILL BE OVERWRITTEN
3  */
4 
5 #pragma once
6 
7 #include "basejob.hpp"
8 
9 
10 namespace Kazv::Api {
11 
20 class GetRoomEventsJob : public BaseJob {
21 public:
22 
23 
24 
25 class JobResponse : public Response
26 {
27 
28 public:
30  bool success() const;
31 
32  // Result properties
33 
34 
35 
36 
39 std::string start() const;
40 
41 
49 std::optional<std::string> end() const;
50 
51 
60 EventList chunk() const;
61 
62 
71 EventList state() const;
72 
73 };
74  static constexpr auto needsAuth() {
75  return true
76  ;
77  }
78 
79 
80 // Construction/destruction
81 
117  explicit GetRoomEventsJob(std::string serverUrl
118  , std::string _accessToken
119  ,
120  std::string roomId , std::string dir , std::optional<std::string> from = std::nullopt, std::optional<std::string> to = std::nullopt, std::optional<int> limit = std::nullopt, std::optional<std::string> filter = std::nullopt
121  );
122 
123 
124  static BaseJob::Query buildQuery(
125  std::optional<std::string> from, std::optional<std::string> to, std::string dir, std::optional<int> limit, std::optional<std::string> filter);
126 
127  static BaseJob::Body buildBody(std::string roomId, std::string dir, std::optional<std::string> from, std::optional<std::string> to, std::optional<int> limit, std::optional<std::string> filter);
128 
129 
130 
131 
132 
135  };
137  }
138  namespace nlohmann
139  {
140  using namespace Kazv;
141  using namespace Kazv::Api;
142 
143  }
144 
145  namespace Kazv::Api
146  {
147 
148 } // namespace Kazv::Api
Kazv::Api::GetRoomEventsJob::needsAuth
static constexpr auto needsAuth()
Definition: message_pagination.hpp:78
Kazv::Api::GetRoomEventsJob::buildQuery
static BaseJob::Query buildQuery(std::optional< std::string > from, std::optional< std::string > to, std::string dir, std::optional< int > limit, std::optional< std::string > filter)
Definition: message_pagination.cpp:15
nlohmann
Definition: location.hpp:26
Kazv::Api::GetRoomEventsJob::JobResponse::chunk
EventList chunk() const
A list of room events.
Definition: message_pagination.cpp:115
Kazv
Definition: location.hpp:10
Kazv::Api::GetRoomEventsJob::JobResponse::start
std::string start() const
A token corresponding to the start of chunk.
Definition: message_pagination.cpp:93
Kazv::BaseJob::Query
Definition: basejob.hpp:90
Kazv::Api
Definition: location.hpp:10
Kazv::Api::GetRoomEventsJob::GetRoomEventsJob
GetRoomEventsJob(std::string serverUrl, std::string _accessToken, std::string roomId, std::string dir, std::optional< std::string > from=std::nullopt, std::optional< std::string > to=std::nullopt, std::optional< int > limit=std::nullopt, std::optional< std::string > filter=std::nullopt)
Get a list of events for this room.
Definition: message_pagination.cpp:44
basejob.hpp
Kazv::JsonWrap
Definition: jsonwrap.hpp:22
Kazv::Api::GetRoomEventsJob::withData
GetRoomEventsJob withData(JsonWrap j) &&
Definition: message_pagination.cpp:64
Kazv::Api::GetRoomEventsJob::JobResponse::end
std::optional< std::string > end() const
A token corresponding to the end of chunk.
Definition: message_pagination.cpp:104
Kazv::Api::GetRoomEventsJob::buildBody
static BaseJob::Body buildBody(std::string roomId, std::string dir, std::optional< std::string > from, std::optional< std::string > to, std::optional< int > limit, std::optional< std::string > filter)
Definition: message_pagination.cpp:32
Kazv::Api::GetRoomEventsJob::JobResponse::state
EventList state() const
A list of state events relevant to showing the chunk.
Definition: message_pagination.cpp:126
Kazv::BaseJob::Body
::Kazv::Body Body
Definition: basejob.hpp:100
Kazv::Api::GetRoomEventsJob
Get a list of events for this room.
Definition: message_pagination.hpp:22
Kazv::Api::GetRoomEventsJob::JobResponse::success
bool success() const
Definition: message_pagination.cpp:81
Kazv::Api::GetRoomEventsJob::JobResponse
Definition: message_pagination.hpp:29
Kazv::EventList
immer::flex_vector< Event > EventList
Definition: types.hpp:107
Kazv::Api::GetRoomEventsJob::JobResponse::JobResponse
JobResponse(Response r)
Definition: message_pagination.cpp:78
Kazv::Response
Definition: basejob.hpp:50