libkazv
pushrules.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"
11 
12 namespace Kazv::Api {
13 
21 class GetPushRulesJob : public BaseJob {
22 public:
23 
24 
25 
26 class JobResponse : public Response
27 {
28 
29 public:
31  bool success() const;
32 
33  // Result properties
34 
35 
36 
37 
39 PushRuleset global() const;
40 
41 };
42  static constexpr auto needsAuth() {
43  return true
44  ;
45  }
46 
47 
48 // Construction/destruction
49 
51  explicit GetPushRulesJob(std::string serverUrl
52  , std::string _accessToken
53 
54 
55  );
56 
57 
59  );
60 
61  static BaseJob::Body buildBody();
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 
86 class GetPushRuleJob : 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 
103 
104  PushRule data() const
105  {
106  return
107  std::move(jsonBody().get()).get<PushRule>()
108  ;
109  }
110 
111 
112 };
113  static constexpr auto needsAuth() {
114  return true
115  ;
116  }
117 
118 
119 // Construction/destruction
120 
132  explicit GetPushRuleJob(std::string serverUrl
133  , std::string _accessToken
134  ,
135  std::string scope , std::string kind , std::string ruleId
136  );
137 
138 
139  static BaseJob::Query buildQuery(
140  );
141 
142  static BaseJob::Body buildBody(std::string scope, std::string kind, std::string ruleId);
143 
144 
145 
146 
147 
148  GetPushRuleJob withData(JsonWrap j) &&;
149  GetPushRuleJob withData(JsonWrap j) const &;
150  };
152  }
153  namespace nlohmann
154  {
155  using namespace Kazv;
156  using namespace Kazv::Api;
157 
158  }
159 
160  namespace Kazv::Api
161  {
162 
167 class DeletePushRuleJob : public BaseJob {
168 public:
169 
170 
171 
172 class JobResponse : public Response
173 {
174 
175 public:
177  bool success() const;
178 
179 };
180  static constexpr auto needsAuth() {
181  return true
182  ;
183  }
184 
185 
186 // Construction/destruction
187 
199  explicit DeletePushRuleJob(std::string serverUrl
200  , std::string _accessToken
201  ,
202  std::string scope , std::string kind , std::string ruleId
203  );
204 
205 
206  static BaseJob::Query buildQuery(
207  );
208 
209  static BaseJob::Body buildBody(std::string scope, std::string kind, std::string ruleId);
210 
211 
212 
213 
214 
215  DeletePushRuleJob withData(JsonWrap j) &&;
216  DeletePushRuleJob withData(JsonWrap j) const &;
217  };
219  }
220  namespace nlohmann
221  {
222  using namespace Kazv;
223  using namespace Kazv::Api;
224 
225  }
226 
227  namespace Kazv::Api
228  {
229 
238 class SetPushRuleJob : public BaseJob {
239 public:
240 
241 
242 
243 class JobResponse : public Response
244 {
245 
246 public:
248  bool success() const;
249 
250 };
251  static constexpr auto needsAuth() {
252  return true
253  ;
254  }
255 
256 
257 // Construction/destruction
258 
291  explicit SetPushRuleJob(std::string serverUrl
292  , std::string _accessToken
293  ,
294  std::string scope , std::string kind , std::string ruleId , immer::array<Variant> actions , std::optional<std::string> before = std::nullopt, std::optional<std::string> after = std::nullopt, immer::array<PushCondition> conditions = {}, std::optional<std::string> pattern = std::nullopt
295  );
296 
297 
298  static BaseJob::Query buildQuery(
299  std::optional<std::string> before, std::optional<std::string> after);
300 
301  static BaseJob::Body buildBody(std::string scope, std::string kind, std::string ruleId, immer::array<Variant> actions, std::optional<std::string> before, std::optional<std::string> after, immer::array<PushCondition> conditions, std::optional<std::string> pattern);
302 
303 
304 
305 
306 
307  SetPushRuleJob withData(JsonWrap j) &&;
308  SetPushRuleJob withData(JsonWrap j) const &;
309  };
311  }
312  namespace nlohmann
313  {
314  using namespace Kazv;
315  using namespace Kazv::Api;
316 
317  }
318 
319  namespace Kazv::Api
320  {
321 
327 public:
328 
329 
330 
331 class JobResponse : public Response
332 {
333 
334 public:
336  bool success() const;
337 
338  // Result properties
339 
340 
341 
342 
344 bool enabled() const;
345 
346 };
347  static constexpr auto needsAuth() {
348  return true
349  ;
350  }
351 
352 
353 // Construction/destruction
354 
367  explicit IsPushRuleEnabledJob(std::string serverUrl
368  , std::string _accessToken
369  ,
370  std::string scope , std::string kind , std::string ruleId
371  );
372 
373 
374  static BaseJob::Query buildQuery(
375  );
376 
377  static BaseJob::Body buildBody(std::string scope, std::string kind, std::string ruleId);
378 
379 
380 
381 
382 
383  IsPushRuleEnabledJob withData(JsonWrap j) &&;
384  IsPushRuleEnabledJob withData(JsonWrap j) const &;
385  };
387  }
388  namespace nlohmann
389  {
390  using namespace Kazv;
391  using namespace Kazv::Api;
392 
393  }
394 
395  namespace Kazv::Api
396  {
397 
403 public:
404 
405 
406 
407 class JobResponse : public Response
408 {
409 
410 public:
412  bool success() const;
413 
414 };
415  static constexpr auto needsAuth() {
416  return true
417  ;
418  }
419 
420 
421 // Construction/destruction
422 
437  explicit SetPushRuleEnabledJob(std::string serverUrl
438  , std::string _accessToken
439  ,
440  std::string scope , std::string kind , std::string ruleId , bool enabled
441  );
442 
443 
444  static BaseJob::Query buildQuery(
445  );
446 
447  static BaseJob::Body buildBody(std::string scope, std::string kind, std::string ruleId, bool enabled);
448 
449 
450 
451 
452 
453  SetPushRuleEnabledJob withData(JsonWrap j) &&;
454  SetPushRuleEnabledJob withData(JsonWrap j) const &;
455  };
457  }
458  namespace nlohmann
459  {
460  using namespace Kazv;
461  using namespace Kazv::Api;
462 
463  }
464 
465  namespace Kazv::Api
466  {
467 
473 public:
474 
475 
476 
477 class JobResponse : public Response
478 {
479 
480 public:
482  bool success() const;
483 
484  // Result properties
485 
486 
487 
488 
490 immer::array<Variant> actions() const;
491 
492 };
493  static constexpr auto needsAuth() {
494  return true
495  ;
496  }
497 
498 
499 // Construction/destruction
500 
513  explicit GetPushRuleActionsJob(std::string serverUrl
514  , std::string _accessToken
515  ,
516  std::string scope , std::string kind , std::string ruleId
517  );
518 
519 
520  static BaseJob::Query buildQuery(
521  );
522 
523  static BaseJob::Body buildBody(std::string scope, std::string kind, std::string ruleId);
524 
525 
526 
527 
528 
529  GetPushRuleActionsJob withData(JsonWrap j) &&;
530  GetPushRuleActionsJob withData(JsonWrap j) const &;
531  };
533  }
534  namespace nlohmann
535  {
536  using namespace Kazv;
537  using namespace Kazv::Api;
538 
539  }
540 
541  namespace Kazv::Api
542  {
543 
550 public:
551 
552 
553 
554 class JobResponse : public Response
555 {
556 
557 public:
559  bool success() const;
560 
561 };
562  static constexpr auto needsAuth() {
563  return true
564  ;
565  }
566 
567 
568 // Construction/destruction
569 
584  explicit SetPushRuleActionsJob(std::string serverUrl
585  , std::string _accessToken
586  ,
587  std::string scope , std::string kind , std::string ruleId , immer::array<Variant> actions
588  );
589 
590 
591  static BaseJob::Query buildQuery(
592  );
593 
594  static BaseJob::Body buildBody(std::string scope, std::string kind, std::string ruleId, immer::array<Variant> actions);
595 
596 
597 
598 
599 
600  SetPushRuleActionsJob withData(JsonWrap j) &&;
601  SetPushRuleActionsJob withData(JsonWrap j) const &;
602  };
604  }
605  namespace nlohmann
606  {
607  using namespace Kazv;
608  using namespace Kazv::Api;
609 
610  }
611 
612  namespace Kazv::Api
613  {
614 
615 } // namespace Kazv::Api
push_rule.hpp
Kazv::Api::GetPushRuleActionsJob::JobResponse
Definition: pushrules.hpp:477
push_ruleset.hpp
Kazv::Api::DeletePushRuleJob
Delete a push rule.
Definition: pushrules.hpp:167
Kazv::Api::PushRule
Definition: push_rule.hpp:14
Kazv::Api::DeletePushRuleJob::JobResponse
Definition: pushrules.hpp:172
Kazv::Api::GetPushRuleJob
Retrieve a push rule.
Definition: pushrules.hpp:86
Kazv::Api::GetPushRuleJob::needsAuth
static constexpr auto needsAuth()
Definition: pushrules.hpp:113
Kazv::Api::SetPushRuleEnabledJob
Enable or disable a push rule.
Definition: pushrules.hpp:402
Kazv::Api::SetPushRuleJob::needsAuth
static constexpr auto needsAuth()
Definition: pushrules.hpp:251
nlohmann
Definition: location.hpp:26
Kazv::Api::IsPushRuleEnabledJob
Get whether a push rule is enabled.
Definition: pushrules.hpp:326
Kazv::Api::GetPushRuleActionsJob::needsAuth
static constexpr auto needsAuth()
Definition: pushrules.hpp:493
Kazv::Api::GetPushRuleActionsJob
The actions for a push rule.
Definition: pushrules.hpp:472
Kazv::Api::GetPushRulesJob::buildBody
static BaseJob::Body buildBody()
Definition: pushrules.cpp:23
Kazv
Definition: location.hpp:10
Kazv::Api::GetPushRulesJob::JobResponse::success
bool success() const
Definition: pushrules.cpp:72
Kazv::Api::PushRuleset
Definition: push_ruleset.hpp:14
Kazv::BaseJob::Query
Definition: basejob.hpp:90
Kazv::Api::GetPushRulesJob::needsAuth
static constexpr auto needsAuth()
Definition: pushrules.hpp:46
Kazv::Api::GetPushRuleJob::JobResponse
Definition: pushrules.hpp:91
Kazv::Api::SetPushRuleEnabledJob::needsAuth
static constexpr auto needsAuth()
Definition: pushrules.hpp:415
push_condition.hpp
Kazv::Api::GetPushRuleJob::JobResponse::data
PushRule data() const
The specific push rule.
Definition: pushrules.hpp:104
Kazv::Api::SetPushRuleJob::JobResponse
Definition: pushrules.hpp:243
Kazv::Api::GetPushRulesJob::JobResponse
Definition: pushrules.hpp:30
Kazv::Api
Definition: location.hpp:10
Kazv::Api::GetPushRulesJob::JobResponse::JobResponse
JobResponse(Response r)
Definition: pushrules.cpp:69
Kazv::Api::SetPushRuleActionsJob::JobResponse
Definition: pushrules.hpp:554
Kazv::Api::SetPushRuleActionsJob
Set the actions for a push rule.
Definition: pushrules.hpp:549
Kazv::Api::SetPushRuleActionsJob::needsAuth
static constexpr auto needsAuth()
Definition: pushrules.hpp:562
Kazv::Api::DeletePushRuleJob::needsAuth
static constexpr auto needsAuth()
Definition: pushrules.hpp:180
basejob.hpp
Kazv::JsonWrap
Definition: jsonwrap.hpp:22
Kazv::Api::GetPushRulesJob::withData
GetPushRulesJob withData(JsonWrap j) &&
Definition: pushrules.cpp:55
Kazv::BaseJob
Definition: basejob.hpp:76
Kazv::Api::IsPushRuleEnabledJob::JobResponse
Definition: pushrules.hpp:331
Kazv::BaseJob::Body
::Kazv::Body Body
Definition: basejob.hpp:100
Kazv::Api::SetPushRuleEnabledJob::JobResponse
Definition: pushrules.hpp:407
Kazv::Api::GetPushRulesJob
Retrieve all push rulesets.
Definition: pushrules.hpp:23
Kazv::Api::GetPushRulesJob::buildQuery
static BaseJob::Query buildQuery()
Definition: pushrules.cpp:15
Kazv::Api::GetPushRulesJob::JobResponse::global
PushRuleset global() const
The global ruleset.
Definition: pushrules.cpp:83
Kazv::Api::GetPushRulesJob::GetPushRulesJob
GetPushRulesJob(std::string serverUrl, std::string _accessToken)
Retrieve all push rulesets.
Definition: pushrules.cpp:35
Kazv::Api::SetPushRuleJob
Add or change a push rule.
Definition: pushrules.hpp:238
Kazv::Api::IsPushRuleEnabledJob::needsAuth
static constexpr auto needsAuth()
Definition: pushrules.hpp:347
Kazv::Response
Definition: basejob.hpp:50