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
Kazv::Api::SetPresenceJob::needsAuth
static constexpr auto needsAuth()
Definition: presence.hpp:36
nlohmann
Definition: location.hpp:26
Kazv::Api::SetPresenceJob::withData
SetPresenceJob withData(JsonWrap j) &&
Definition: presence.cpp:63
Kazv
Definition: location.hpp:10
Kazv::Api::SetPresenceJob::SetPresenceJob
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:43
Kazv::BaseJob::Query
Definition: basejob.hpp:90
Kazv::Api::SetPresenceJob::JobResponse
Definition: presence.hpp:28
Kazv::Api::GetPresenceJob
Get this user's presence state.
Definition: presence.hpp:86
Kazv::Api
Definition: location.hpp:10
Kazv::Api::SetPresenceJob::buildQuery
static BaseJob::Query buildQuery()
Definition: presence.cpp:15
basejob.hpp
Kazv::Api::SetPresenceJob::JobResponse::JobResponse
JobResponse(Response r)
Definition: presence.cpp:77
Kazv::JsonWrap
Definition: jsonwrap.hpp:22
Kazv::Api::SetPresenceJob::buildBody
static BaseJob::Body buildBody(std::string userId, std::string presence, std::optional< std::string > statusMsg)
Definition: presence.cpp:23
Kazv::Api::SetPresenceJob
Update this user's presence state.
Definition: presence.hpp:21
Kazv::Api::GetPresenceJob::needsAuth
static constexpr auto needsAuth()
Definition: presence.hpp:120
Kazv::BaseJob
Definition: basejob.hpp:76
Kazv::Api::SetPresenceJob::JobResponse::success
bool success() const
Definition: presence.cpp:80
Kazv::Variant
std::variant< std::string, JsonWrap, Null > Variant
Definition: types.hpp:112
Kazv::BaseJob::Body
::Kazv::Body Body
Definition: basejob.hpp:100
Kazv::Api::GetPresenceJob::JobResponse
Definition: presence.hpp:91
Kazv::Response
Definition: basejob.hpp:50