libkazv
presence.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 
19 class SetPresenceJob : public BaseJob {
20 public:
21 
22 
23 
24 class JobResponse : public Response
25 {
26 
27 public:
29  bool success() const;
30 
31 };
32  static constexpr auto needsAuth() {
33  return true
34  ;
35  }
36 
37 
38 // Construction/destruction
39 
51  explicit SetPresenceJob(std::string serverUrl
52  , std::string _accessToken
53  ,
54  std::string userId , std::string presence , std::optional<std::string> statusMsg = std::nullopt
55  );
56 
57 
59  );
60 
61  static BaseJob::Body buildBody(std::string userId, std::string presence, std::optional<std::string> statusMsg);
62 
63 
64 
65 
66 
68  SetPresenceJob withData(JsonWrap j) const &;
69  };
71  }
72  namespace nlohmann
73  {
74  using namespace Kazv;
75  using namespace Kazv::Api;
76 
77  }
78 
79  namespace Kazv::Api
80  {
81 
86 class GetPresenceJob : public BaseJob {
87 public:
88 
89 
90 
91 class JobResponse : public Response
92 {
93 
94 public:
96  bool success() const;
97 
98  // Result properties
99 
100 
101 
102 
104 std::string presence() const;
105 
106 
109 std::optional<int> lastActiveAgo() const;
110 
111 
113 Variant statusMsg() const;
114 
115 
117 std::optional<bool> currentlyActive() const;
118 
119 };
120  static constexpr auto needsAuth() {
121  return true
122  ;
123  }
124 
125 
126 // Construction/destruction
127 
133  explicit GetPresenceJob(std::string serverUrl
134  , std::string _accessToken
135  ,
136  std::string userId
137  );
138 
139 
140  static BaseJob::Query buildQuery(
141  );
142 
143  static BaseJob::Body buildBody(std::string userId);
144 
145 
146 
147 
148 
149  GetPresenceJob withData(JsonWrap j) &&;
150  GetPresenceJob withData(JsonWrap j) const &;
151  };
153  }
154  namespace nlohmann
155  {
156  using namespace Kazv;
157  using namespace Kazv::Api;
158 
159  }
160 
161  namespace Kazv::Api
162  {
163 
164 } // namespace Kazv::Api
Definition: presence.hpp:92
Get this user's presence state.
Definition: presence.hpp:86
static constexpr auto needsAuth()
Definition: presence.hpp:120
Definition: presence.hpp:25
JobResponse(Response r)
Definition: presence.cpp:75
bool success() const
Definition: presence.cpp:78
Update this user's presence state.
Definition: presence.hpp:19
static BaseJob::Query buildQuery()
Definition: presence.cpp:13
SetPresenceJob(std::string serverUrl, std::string _accessToken, std::string userId, std::string presence, std::optional< std::string > statusMsg=std::nullopt)
Update this user's presence state.
Definition: presence.cpp:41
static BaseJob::Body buildBody(std::string userId, std::string presence, std::optional< std::string > statusMsg)
Definition: presence.cpp:21
static constexpr auto needsAuth()
Definition: presence.hpp:32
SetPresenceJob withData(JsonWrap j) &&
Definition: presence.cpp:61
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
std::variant< std::string, JsonWrap, Null > Variant
Definition: types.hpp:112
Definition: location.hpp:27
Definition: basejob.hpp:50