libkazv
Loading...
Searching...
No Matches
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
10namespace Kazv::Api {
11
19class SetPresenceJob : public BaseJob {
20public:
21
22
23
24class JobResponse : public Response
25{
26
27public:
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
69 };
71 }
72 namespace nlohmann
73 {
74 using namespace Kazv;
75 using namespace Kazv::Api;
76
77 }
78
79 namespace Kazv::Api
80 {
81
86class GetPresenceJob : public BaseJob {
87public:
88
89
90
91class JobResponse : public Response
92{
93
94public:
96 bool success() const;
97
98 // Result properties
99
100
101
102
104std::string presence() const;
105
106
109std::optional<int> lastActiveAgo() const;
110
111
113Variant statusMsg() const;
114
115
117std::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
141 );
142
143 static BaseJob::Body buildBody(std::string userId);
144
145
146
147
148
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
bool success() const
Definition presence.cpp:146
std::optional< int > lastActiveAgo() const
The length of time in milliseconds since an action was performed by this user.
Definition presence.cpp:168
std::optional< bool > currentlyActive() const
Whether the user is currently active.
Definition presence.cpp:190
std::string presence() const
This user's presence.
Definition presence.cpp:157
Variant statusMsg() const
The state message for this user if one was set.
Definition presence.cpp:179
Get this user's presence state.
Definition presence.hpp:86
static BaseJob::Body buildBody(std::string userId)
Definition presence.cpp:97
static BaseJob::Query buildQuery()
Definition presence.cpp:89
static constexpr auto needsAuth()
Definition presence.hpp:120
GetPresenceJob withData(JsonWrap j) &&
Definition presence.cpp:129
Definition presence.hpp:25
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
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:94
Definition basejob.hpp:68
::Kazv::Body Body
Definition basejob.hpp:103
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:49