libkazv
Loading...
Searching...
No Matches
device_management.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"
10
11namespace Kazv::Api {
12
17class GetDevicesJob : public BaseJob {
18public:
19
20
21
22class JobResponse : public Response
23{
24
25public:
27 bool success() const;
28
29 // Result properties
30
31
32
33
35immer::array<Device> devices() const;
36
37};
38 static constexpr auto needsAuth() {
39 return true
40 ;
41 }
42
43
44// Construction/destruction
45
47 explicit GetDevicesJob(std::string serverUrl
48 , std::string _accessToken
49
50
51 );
52
53
55 );
56
57 static BaseJob::Body buildBody();
58
59
60
61
62
65 };
67 }
68 namespace nlohmann
69 {
70 using namespace Kazv;
71 using namespace Kazv::Api;
72
73 }
74
75 namespace Kazv::Api
76 {
77
82class GetDeviceJob : public BaseJob {
83public:
84
85
86
87class JobResponse : public Response
88{
89
90public:
92 bool success() const;
93
94 // Result properties
95
96
98
99 Device data() const
100 {
101 return
102 std::move(jsonBody().get()).get<Device>()
103 ;
104 }
105
106
107};
108 static constexpr auto needsAuth() {
109 return true
110 ;
111 }
112
113
114// Construction/destruction
115
121 explicit GetDeviceJob(std::string serverUrl
122 , std::string _accessToken
123 ,
124 std::string deviceId
125 );
126
127
129 );
130
131 static BaseJob::Body buildBody(std::string deviceId);
132
133
134
135
136
138 GetDeviceJob withData(JsonWrap j) const &;
139 };
141 }
142 namespace nlohmann
143 {
144 using namespace Kazv;
145 using namespace Kazv::Api;
146
147 }
148
149 namespace Kazv::Api
150 {
151
156class UpdateDeviceJob : public BaseJob {
157public:
158
159
160
161class JobResponse : public Response
162{
163
164public:
166 bool success() const;
167
168};
169 static constexpr auto needsAuth() {
170 return true
171 ;
172 }
173
174
175// Construction/destruction
176
186 explicit UpdateDeviceJob(std::string serverUrl
187 , std::string _accessToken
188 ,
189 std::string deviceId , std::optional<std::string> displayName = std::nullopt
190 );
191
192
194 );
195
196 static BaseJob::Body buildBody(std::string deviceId, std::optional<std::string> displayName);
197
198
199
200
201
204 };
206 }
207 namespace nlohmann
208 {
209 using namespace Kazv;
210 using namespace Kazv::Api;
211
212 }
213
214 namespace Kazv::Api
215 {
216
223class DeleteDeviceJob : public BaseJob {
224public:
225
226
227
228class JobResponse : public Response
229{
230
231public:
233 bool success() const;
234
235};
236 static constexpr auto needsAuth() {
237 return true
238 ;
239 }
240
241
242// Construction/destruction
243
253 explicit DeleteDeviceJob(std::string serverUrl
254 , std::string _accessToken
255 ,
256 std::string deviceId , std::optional<AuthenticationData> auth = std::nullopt
257 );
258
259
261 );
262
263 static BaseJob::Body buildBody(std::string deviceId, std::optional<AuthenticationData> auth);
264
265
266
267
268
271 };
273 }
274 namespace nlohmann
275 {
276 using namespace Kazv;
277 using namespace Kazv::Api;
278
279 }
280
281 namespace Kazv::Api
282 {
283
290class DeleteDevicesJob : public BaseJob {
291public:
292
293
294
295class JobResponse : public Response
296{
297
298public:
300 bool success() const;
301
302};
303 static constexpr auto needsAuth() {
304 return true
305 ;
306 }
307
308
309// Construction/destruction
310
320 explicit DeleteDevicesJob(std::string serverUrl
321 , std::string _accessToken
322 ,
323 immer::array<std::string> devices , std::optional<AuthenticationData> auth = std::nullopt
324 );
325
326
328 );
329
330 static BaseJob::Body buildBody(immer::array<std::string> devices, std::optional<AuthenticationData> auth);
331
332
333
334
335
338 };
340 }
341 namespace nlohmann
342 {
343 using namespace Kazv;
344 using namespace Kazv::Api;
345
346 }
347
348 namespace Kazv::Api
349 {
350
351} // namespace Kazv::Api
Definition device_management.hpp:229
bool success() const
Definition device_management.cpp:297
Delete a device.
Definition device_management.hpp:223
static BaseJob::Query buildQuery()
Definition device_management.cpp:234
static constexpr auto needsAuth()
Definition device_management.hpp:236
DeleteDeviceJob withData(JsonWrap j) &&
Definition device_management.cpp:280
static BaseJob::Body buildBody(std::string deviceId, std::optional< AuthenticationData > auth)
Definition device_management.cpp:242
Definition device_management.hpp:296
bool success() const
Definition device_management.cpp:373
Bulk deletion of devices.
Definition device_management.hpp:290
static constexpr auto needsAuth()
Definition device_management.hpp:303
static BaseJob::Query buildQuery()
Definition device_management.cpp:308
static BaseJob::Body buildBody(immer::array< std::string > devices, std::optional< AuthenticationData > auth)
Definition device_management.cpp:316
DeleteDevicesJob withData(JsonWrap j) &&
Definition device_management.cpp:356
Definition device_management.hpp:88
bool success() const
Definition device_management.cpp:149
Device data() const
Device information.
Definition device_management.hpp:99
Get a single device.
Definition device_management.hpp:82
static constexpr auto needsAuth()
Definition device_management.hpp:108
GetDeviceJob withData(JsonWrap j) &&
Definition device_management.cpp:132
static BaseJob::Query buildQuery()
Definition device_management.cpp:92
static BaseJob::Body buildBody(std::string deviceId)
Definition device_management.cpp:100
Definition device_management.hpp:23
immer::array< Device > devices() const
A list of all registered devices for this user.
Definition device_management.cpp:80
bool success() const
Definition device_management.cpp:70
List registered devices for the current user.
Definition device_management.hpp:17
GetDevicesJob withData(JsonWrap j) &&
Definition device_management.cpp:53
static BaseJob::Body buildBody()
Definition device_management.cpp:21
static constexpr auto needsAuth()
Definition device_management.hpp:38
static BaseJob::Query buildQuery()
Definition device_management.cpp:13
Definition device_management.hpp:162
bool success() const
Definition device_management.cpp:223
Update a device.
Definition device_management.hpp:156
static constexpr auto needsAuth()
Definition device_management.hpp:169
UpdateDeviceJob withData(JsonWrap j) &&
Definition device_management.cpp:206
static BaseJob::Query buildQuery()
Definition device_management.cpp:160
static BaseJob::Body buildBody(std::string deviceId, std::optional< std::string > displayName)
Definition device_management.cpp:168
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
Definition location.hpp:27
A client device.
Definition client_device.hpp:13
Definition basejob.hpp:49
JsonWrap jsonBody() const
Definition basejob.cpp:141