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
Kazv::Api::GetEventContextJob::JobResponse::eventsAfter
EventList eventsAfter() const
A list of room events that happened just after the requested event, in chronological order.
Definition: event_context.cpp:129
Kazv::Api::GetEventContextJob::JobResponse::state
EventList state() const
The state of the room at the last event returned.
Definition: event_context.cpp:140
Kazv::Api::GetEventContextJob::JobResponse::event
JsonWrap event() const
Details of the requested event.
Definition: event_context.cpp:118
Kazv::Api::GetEventContextJob::JobResponse::end
std::optional< std::string > end() const
A token that can be used to paginate forwards with.
Definition: event_context.cpp:96
nlohmann
Definition: location.hpp:26
Kazv::Api::GetEventContextJob::buildBody
static BaseJob::Body buildBody(std::string roomId, std::string eventId, std::optional< int > limit, std::optional< std::string > filter)
Definition: event_context.cpp:26
Kazv::Api::GetEventContextJob::JobResponse::eventsBefore
EventList eventsBefore() const
A list of room events that happened just before the requested event, in reverse-chronological order.
Definition: event_context.cpp:107
Kazv
Definition: location.hpp:10
Kazv::BaseJob::Query
Definition: basejob.hpp:90
Kazv::Api::GetEventContextJob::JobResponse::start
std::optional< std::string > start() const
A token that can be used to paginate backwards with.
Definition: event_context.cpp:85
Kazv::Api::GetEventContextJob::JobResponse::success
bool success() const
Definition: event_context.cpp:75
Kazv::Api::GetEventContextJob::buildQuery
static BaseJob::Query buildQuery(std::optional< int > limit, std::optional< std::string > filter)
Definition: event_context.cpp:15
Kazv::Api
Definition: location.hpp:10
Kazv::Api::GetEventContextJob
Get events and state around the specified event.
Definition: event_context.hpp:23
Kazv::Api::GetEventContextJob::JobResponse::JobResponse
JobResponse(Response r)
Definition: event_context.cpp:72
Kazv::Api::GetEventContextJob::JobResponse
Definition: event_context.hpp:30
Kazv::Api::GetEventContextJob::GetEventContextJob
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:38
Kazv::Api::GetEventContextJob::needsAuth
static constexpr auto needsAuth()
Definition: event_context.hpp:68
basejob.hpp
Kazv::JsonWrap
Definition: jsonwrap.hpp:22
Kazv::BaseJob::Body
::Kazv::Body Body
Definition: basejob.hpp:100
Kazv::EventList
immer::flex_vector< Event > EventList
Definition: types.hpp:107
Kazv::Api::GetEventContextJob::withData
GetEventContextJob withData(JsonWrap j) &&
Definition: event_context.cpp:58
Kazv::Response
Definition: basejob.hpp:50