libkazv
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 
11 namespace Kazv::Api {
12 
17 class GetDevicesJob : public BaseJob {
18 public:
19 
20 
21 
22 class JobResponse : public Response
23 {
24 
25 public:
27  bool success() const;
28 
29  // Result properties
30 
31 
32 
33 
35 immer::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 
64  GetDevicesJob withData(JsonWrap j) const &;
65  };
67  }
68  namespace nlohmann
69  {
70  using namespace Kazv;
71  using namespace Kazv::Api;
72 
73  }
74 
75  namespace Kazv::Api
76  {
77 
82 class GetDeviceJob : public BaseJob {
83 public:
84 
85 
86 
87 class JobResponse : public Response
88 {
89 
90 public:
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 
128  static BaseJob::Query buildQuery(
129  );
130 
131  static BaseJob::Body buildBody(std::string deviceId);
132 
133 
134 
135 
136 
137  GetDeviceJob withData(JsonWrap j) &&;
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 
156 class UpdateDeviceJob : public BaseJob {
157 public:
158 
159 
160 
161 class JobResponse : public Response
162 {
163 
164 public:
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 
193  static BaseJob::Query buildQuery(
194  );
195 
196  static BaseJob::Body buildBody(std::string deviceId, std::optional<std::string> displayName);
197 
198 
199 
200 
201 
202  UpdateDeviceJob withData(JsonWrap j) &&;
203  UpdateDeviceJob withData(JsonWrap j) const &;
204  };
206  }
207  namespace nlohmann
208  {
209  using namespace Kazv;
210  using namespace Kazv::Api;
211 
212  }
213 
214  namespace Kazv::Api
215  {
216 
223 class DeleteDeviceJob : public BaseJob {
224 public:
225 
226 
227 
228 class JobResponse : public Response
229 {
230 
231 public:
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 
260  static BaseJob::Query buildQuery(
261  );
262 
263  static BaseJob::Body buildBody(std::string deviceId, std::optional<AuthenticationData> auth);
264 
265 
266 
267 
268 
269  DeleteDeviceJob withData(JsonWrap j) &&;
270  DeleteDeviceJob withData(JsonWrap j) const &;
271  };
273  }
274  namespace nlohmann
275  {
276  using namespace Kazv;
277  using namespace Kazv::Api;
278 
279  }
280 
281  namespace Kazv::Api
282  {
283 
290 class DeleteDevicesJob : public BaseJob {
291 public:
292 
293 
294 
295 class JobResponse : public Response
296 {
297 
298 public:
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 
327  static BaseJob::Query buildQuery(
328  );
329 
330  static BaseJob::Body buildBody(immer::array<std::string> devices, std::optional<AuthenticationData> auth);
331 
332 
333 
334 
335 
336  DeleteDevicesJob withData(JsonWrap j) &&;
337  DeleteDevicesJob withData(JsonWrap j) const &;
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
Delete a device.
Definition: device_management.hpp:223
static constexpr auto needsAuth()
Definition: device_management.hpp:236
Definition: device_management.hpp:296
Bulk deletion of devices.
Definition: device_management.hpp:290
static constexpr auto needsAuth()
Definition: device_management.hpp:303
Definition: device_management.hpp:88
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
Definition: device_management.hpp:23
immer::array< Device > devices() const
A list of all registered devices for this user.
Definition: device_management.cpp:80
JobResponse(Response r)
Definition: device_management.cpp:67
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
GetDevicesJob(std::string serverUrl, std::string _accessToken)
List registered devices for the current user.
Definition: device_management.cpp:33
static constexpr auto needsAuth()
Definition: device_management.hpp:38
static BaseJob::Query buildQuery()
Definition: device_management.cpp:13
Definition: device_management.hpp:162
Update a device.
Definition: device_management.hpp:156
static constexpr auto needsAuth()
Definition: device_management.hpp:169
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
Definition: location.hpp:27
A client device.
Definition: client_device.hpp:13
Definition: basejob.hpp:50