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
Definition: peeking_events.hpp:31
EventList chunk() const
An array of events.
Definition: peeking_events.cpp:107
std::optional< std::string > end() const
A token which correlates to the last value in chunk.
Definition: peeking_events.cpp:96
bool success() const
Definition: peeking_events.cpp:75
std::optional< std::string > start() const
A token which correlates to the first value in chunk.
Definition: peeking_events.cpp:85
JobResponse(Response r)
Definition: peeking_events.cpp:72
Listen on the event stream of a particular room.
Definition: peeking_events.hpp:25
static constexpr auto needsAuth()
Definition: peeking_events.hpp:56
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:38
static BaseJob::Query buildQuery(std::optional< std::string > from, std::optional< int > timeout, std::optional< std::string > roomId)
Definition: peeking_events.cpp:13
static BaseJob::Body buildBody(std::optional< std::string > from, std::optional< int > timeout, std::optional< std::string > roomId)
Definition: peeking_events.cpp:26
PeekEventsJob withData(JsonWrap j) &&
Definition: peeking_events.cpp:58
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