libkazv
event_context.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 
21 class GetEventContextJob : public BaseJob {
22 public:
23 
24 
25 
26 class JobResponse : public Response
27 {
28 
29 public:
31  bool success() const;
32 
33  // Result properties
34 
35 
36 
37 
39 std::optional<std::string> start() const;
40 
41 
43 std::optional<std::string> end() const;
44 
45 
48 EventList eventsBefore() const;
49 
50 
52 JsonWrap event() const;
53 
54 
57 EventList eventsAfter() const;
58 
59 
61 EventList state() const;
62 
63 };
64  static constexpr auto needsAuth() {
65  return true
66  ;
67  }
68 
69 
70 // Construction/destruction
71 
92  explicit GetEventContextJob(std::string serverUrl
93  , std::string _accessToken
94  ,
95  std::string roomId , std::string eventId , std::optional<int> limit = std::nullopt, std::optional<std::string> filter = std::nullopt
96  );
97 
98 
100  std::optional<int> limit, std::optional<std::string> filter);
101 
102  static BaseJob::Body buildBody(std::string roomId, std::string eventId, std::optional<int> limit, std::optional<std::string> filter);
103 
104 
105 
106 
107 
110  };
112  }
113  namespace nlohmann
114  {
115  using namespace Kazv;
116  using namespace Kazv::Api;
117 
118  }
119 
120  namespace Kazv::Api
121  {
122 
123 } // namespace Kazv::Api
Definition: event_context.hpp:27
std::optional< std::string > end() const
A token that can be used to paginate forwards with.
Definition: event_context.cpp:94
EventList state() const
The state of the room at the last event returned.
Definition: event_context.cpp:138
bool success() const
Definition: event_context.cpp:73
std::optional< std::string > start() const
A token that can be used to paginate backwards with.
Definition: event_context.cpp:83
EventList eventsBefore() const
A list of room events that happened just before the requested event, in reverse-chronological order.
Definition: event_context.cpp:105
JsonWrap event() const
Details of the requested event.
Definition: event_context.cpp:116
EventList eventsAfter() const
A list of room events that happened just after the requested event, in chronological order.
Definition: event_context.cpp:127
JobResponse(Response r)
Definition: event_context.cpp:70
Get events and state around the specified event.
Definition: event_context.hpp:21
GetEventContextJob withData(JsonWrap j) &&
Definition: event_context.cpp:56
static BaseJob::Body buildBody(std::string roomId, std::string eventId, std::optional< int > limit, std::optional< std::string > filter)
Definition: event_context.cpp:24
GetEventContextJob(std::string serverUrl, std::string _accessToken, std::string roomId, std::string eventId, std::optional< int > limit=std::nullopt, std::optional< std::string > filter=std::nullopt)
Get events and state around the specified event.
Definition: event_context.cpp:36
static constexpr auto needsAuth()
Definition: event_context.hpp:64
static BaseJob::Query buildQuery(std::optional< int > limit, std::optional< std::string > filter)
Definition: event_context.cpp:13
Definition: basejob.hpp:91
Definition: basejob.hpp:77
::Kazv::Body Body
Definition: basejob.hpp:100
Definition: jsonwrap.hpp:23
Definition: location.hpp:10
Definition: location.hpp:10
immer::flex_vector< Event > EventList
Definition: types.hpp:107
Definition: location.hpp:27
Definition: basejob.hpp:50