libkazv
Loading...
Searching...
No Matches
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
12namespace Kazv::Api {
13
21class GetPushRulesJob : public BaseJob {
22public:
23
24
25
26class JobResponse : public Response
27{
28
29public:
31 bool success() const;
32
33 // Result properties
34
35
36
37
39PushRuleset 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
86class GetPushRuleJob : public BaseJob {
87public:
88
89
90
91class JobResponse : public Response
92{
93
94public:
96 bool success() const;
97
98 // Result properties
99
100
103
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
140 );
141
142 static BaseJob::Body buildBody(std::string scope, std::string kind, std::string ruleId);
143
144
145
146
147
150 };
152 }
153 namespace nlohmann
154 {
155 using namespace Kazv;
156 using namespace Kazv::Api;
157
158 }
159
160 namespace Kazv::Api
161 {
162
168public:
169
170
171
172class JobResponse : public Response
173{
174
175public:
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
207 );
208
209 static BaseJob::Body buildBody(std::string scope, std::string kind, std::string ruleId);
210
211
212
213
214
217 };
219 }
220 namespace nlohmann
221 {
222 using namespace Kazv;
223 using namespace Kazv::Api;
224
225 }
226
227 namespace Kazv::Api
228 {
229
238class SetPushRuleJob : public BaseJob {
239public:
240
241
242
243class JobResponse : public Response
244{
245
246public:
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
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
309 };
311 }
312 namespace nlohmann
313 {
314 using namespace Kazv;
315 using namespace Kazv::Api;
316
317 }
318
319 namespace Kazv::Api
320 {
321
327public:
328
329
330
331class JobResponse : public Response
332{
333
334public:
336 bool success() const;
337
338 // Result properties
339
340
341
342
344bool 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
375 );
376
377 static BaseJob::Body buildBody(std::string scope, std::string kind, std::string ruleId);
378
379
380
381
382
385 };
387 }
388 namespace nlohmann
389 {
390 using namespace Kazv;
391 using namespace Kazv::Api;
392
393 }
394
395 namespace Kazv::Api
396 {
397
403public:
404
405
406
407class JobResponse : public Response
408{
409
410public:
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
445 );
446
447 static BaseJob::Body buildBody(std::string scope, std::string kind, std::string ruleId, bool enabled);
448
449
450
451
452
455 };
457 }
458 namespace nlohmann
459 {
460 using namespace Kazv;
461 using namespace Kazv::Api;
462
463 }
464
465 namespace Kazv::Api
466 {
467
473public:
474
475
476
477class JobResponse : public Response
478{
479
480public:
482 bool success() const;
483
484 // Result properties
485
486
487
488
490immer::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
521 );
522
523 static BaseJob::Body buildBody(std::string scope, std::string kind, std::string ruleId);
524
525
526
527
528
531 };
533 }
534 namespace nlohmann
535 {
536 using namespace Kazv;
537 using namespace Kazv::Api;
538
539 }
540
541 namespace Kazv::Api
542 {
543
550public:
551
552
553
554class JobResponse : public Response
555{
556
557public:
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
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
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
Definition pushrules.hpp:173
bool success() const
Definition pushrules.cpp:218
Delete a push rule.
Definition pushrules.hpp:167
static BaseJob::Query buildQuery()
Definition pushrules.cpp:161
static BaseJob::Body buildBody(std::string scope, std::string kind, std::string ruleId)
Definition pushrules.cpp:169
static constexpr auto needsAuth()
Definition pushrules.hpp:180
DeletePushRuleJob withData(JsonWrap j) &&
Definition pushrules.cpp:201
bool success() const
Definition pushrules.cpp:521
immer::array< Variant > actions() const
The action(s) to perform for this rule.
Definition pushrules.cpp:532
The actions for a push rule.
Definition pushrules.hpp:472
static BaseJob::Body buildBody(std::string scope, std::string kind, std::string ruleId)
Definition pushrules.cpp:472
static BaseJob::Query buildQuery()
Definition pushrules.cpp:464
GetPushRuleActionsJob withData(JsonWrap j) &&
Definition pushrules.cpp:504
static constexpr auto needsAuth()
Definition pushrules.hpp:493
Definition pushrules.hpp:92
bool success() const
Definition pushrules.cpp:150
PushRule data() const
The specific push rule.
Definition pushrules.hpp:104
Retrieve a push rule.
Definition pushrules.hpp:86
static BaseJob::Query buildQuery()
Definition pushrules.cpp:93
static BaseJob::Body buildBody(std::string scope, std::string kind, std::string ruleId)
Definition pushrules.cpp:101
static constexpr auto needsAuth()
Definition pushrules.hpp:113
GetPushRuleJob withData(JsonWrap j) &&
Definition pushrules.cpp:133
Definition pushrules.hpp:27
PushRuleset global() const
The global ruleset.
Definition pushrules.cpp:81
bool success() const
Definition pushrules.cpp:70
Retrieve all push rulesets.
Definition pushrules.hpp:21
static BaseJob::Query buildQuery()
Definition pushrules.cpp:13
GetPushRulesJob withData(JsonWrap j) &&
Definition pushrules.cpp:53
static BaseJob::Body buildBody()
Definition pushrules.cpp:21
static constexpr auto needsAuth()
Definition pushrules.hpp:42
bool success() const
Definition pushrules.cpp:367
bool enabled() const
Whether the push rule is enabled or not.
Definition pushrules.cpp:378
Get whether a push rule is enabled.
Definition pushrules.hpp:326
static constexpr auto needsAuth()
Definition pushrules.hpp:347
static BaseJob::Query buildQuery()
Definition pushrules.cpp:310
static BaseJob::Body buildBody(std::string scope, std::string kind, std::string ruleId)
Definition pushrules.cpp:318
IsPushRuleEnabledJob withData(JsonWrap j) &&
Definition pushrules.cpp:350
bool success() const
Definition pushrules.cpp:607
Set the actions for a push rule.
Definition pushrules.hpp:549
static BaseJob::Body buildBody(std::string scope, std::string kind, std::string ruleId, immer::array< Variant > actions)
Definition pushrules.cpp:552
SetPushRuleActionsJob withData(JsonWrap j) &&
Definition pushrules.cpp:590
static BaseJob::Query buildQuery()
Definition pushrules.cpp:544
static constexpr auto needsAuth()
Definition pushrules.hpp:562
bool success() const
Definition pushrules.cpp:453
Enable or disable a push rule.
Definition pushrules.hpp:402
static BaseJob::Query buildQuery()
Definition pushrules.cpp:390
static constexpr auto needsAuth()
Definition pushrules.hpp:415
SetPushRuleEnabledJob withData(JsonWrap j) &&
Definition pushrules.cpp:436
static BaseJob::Body buildBody(std::string scope, std::string kind, std::string ruleId, bool enabled)
Definition pushrules.cpp:398
Definition pushrules.hpp:244
bool success() const
Definition pushrules.cpp:299
Add or change a push rule.
Definition pushrules.hpp:238
static constexpr auto needsAuth()
Definition pushrules.hpp:251
SetPushRuleJob withData(JsonWrap j) &&
Definition pushrules.cpp:282
static BaseJob::Query buildQuery(std::optional< std::string > before, std::optional< std::string > after)
Definition pushrules.cpp:229
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)
Definition pushrules.cpp:240
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
Definition push_rule.hpp:13
Definition push_ruleset.hpp:13
Definition basejob.hpp:49
JsonWrap jsonBody() const
Definition basejob.cpp:141