libkazv
peeking_events.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 
25 class PeekEventsJob : public BaseJob {
26 public:
27 
28 
29 
30 class JobResponse : public Response
31 {
32 
33 public:
35  bool success() const;
36 
37  // Result properties
38 
39 
40 
41 
44 std::optional<std::string> start() const;
45 
46 
49 std::optional<std::string> end() const;
50 
51 
53 EventList chunk() const;
54 
55 };
56  static constexpr auto needsAuth() {
57  return true
58  ;
59  }
60 
61 
62 // Construction/destruction
63 
76  explicit PeekEventsJob(std::string serverUrl
77  , std::string _accessToken
78  ,
79  std::optional<std::string> from = std::nullopt, std::optional<int> timeout = std::nullopt, std::optional<std::string> roomId = std::nullopt
80  );
81 
82 
84  std::optional<std::string> from, std::optional<int> timeout, std::optional<std::string> roomId);
85 
86  static BaseJob::Body buildBody(std::optional<std::string> from, std::optional<int> timeout, std::optional<std::string> roomId);
87 
88 
89 
90 
91 
93  PeekEventsJob withData(JsonWrap j) const &;
94  };
96  }
97  namespace nlohmann
98  {
99  using namespace Kazv;
100  using namespace Kazv::Api;
101 
102  }
103 
104  namespace Kazv::Api
105  {
106 
107 } // namespace Kazv::Api
Kazv::Api::PeekEventsJob::needsAuth
static constexpr auto needsAuth()
Definition: peeking_events.hpp:60
Kazv::Api::PeekEventsJob::JobResponse::chunk
EventList chunk() const
An array of events.
Definition: peeking_events.cpp:109
Kazv::Api::PeekEventsJob::buildBody
static BaseJob::Body buildBody(std::optional< std::string > from, std::optional< int > timeout, std::optional< std::string > roomId)
Definition: peeking_events.cpp:28
Kazv::Api::PeekEventsJob
Listen on the event stream of a particular room.
Definition: peeking_events.hpp:27
nlohmann
Definition: location.hpp:26
Kazv::Api::PeekEventsJob::withData
PeekEventsJob withData(JsonWrap j) &&
Definition: peeking_events.cpp:60
Kazv
Definition: location.hpp:10
Kazv::BaseJob::Query
Definition: basejob.hpp:90
Kazv::Api::PeekEventsJob::JobResponse::JobResponse
JobResponse(Response r)
Definition: peeking_events.cpp:74
Kazv::Api
Definition: location.hpp:10
basejob.hpp
Kazv::JsonWrap
Definition: jsonwrap.hpp:22
Kazv::Api::PeekEventsJob::JobResponse::end
std::optional< std::string > end() const
A token which correlates to the last value in chunk.
Definition: peeking_events.cpp:98
Kazv::Api::PeekEventsJob::JobResponse::start
std::optional< std::string > start() const
A token which correlates to the first value in chunk.
Definition: peeking_events.cpp:87
Kazv::Api::PeekEventsJob::JobResponse::success
bool success() const
Definition: peeking_events.cpp:77
Kazv::BaseJob::Body
::Kazv::Body Body
Definition: basejob.hpp:100
Kazv::Api::PeekEventsJob::buildQuery
static BaseJob::Query buildQuery(std::optional< std::string > from, std::optional< int > timeout, std::optional< std::string > roomId)
Definition: peeking_events.cpp:15
Kazv::Api::PeekEventsJob::PeekEventsJob
PeekEventsJob(std::string serverUrl, std::string _accessToken, std::optional< std::string > from=std::nullopt, std::optional< int > timeout=std::nullopt, std::optional< std::string > roomId=std::nullopt)
Listen on the event stream of a particular room.
Definition: peeking_events.cpp:40
Kazv::EventList
immer::flex_vector< Event > EventList
Definition: types.hpp:107
Kazv::Api::PeekEventsJob::JobResponse
Definition: peeking_events.hpp:34
Kazv::Response
Definition: basejob.hpp:50