libkazv
Loading...
Searching...
No Matches
registration.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"
12
13namespace Kazv::Api {
14
57class RegisterJob : public BaseJob {
58public:
59
60
61
62class JobResponse : public Response
63{
64
65public:
67 bool success() const;
68
69 // Result properties
70
71
72
73
78std::string userId() const;
79
80
84std::optional<std::string> accessToken() const;
85
86
92std::optional<std::string> refreshToken() const;
93
94
103std::optional<int> expiresInMs() const;
104
105
112std::optional<std::string> homeServer() const;
113
114
118std::optional<std::string> deviceId() const;
119
120};
121 static constexpr auto needsAuth() {
122 return
123 false;
124 }
125
126
127// Construction/destruction
128
165 explicit RegisterJob(std::string serverUrl
166
167 ,
168 std::string kind = std::string("user"), std::optional<AuthenticationData> auth = std::nullopt, std::optional<std::string> username = std::nullopt, std::optional<std::string> password = std::nullopt, std::optional<std::string> deviceId = std::nullopt, std::optional<std::string> initialDeviceDisplayName = std::nullopt, std::optional<bool> inhibitLogin = std::nullopt, std::optional<bool> refreshToken = std::nullopt
169 );
170
171
173 std::string kind);
174
175 static BaseJob::Body buildBody(std::string kind, std::optional<AuthenticationData> auth, std::optional<std::string> username, std::optional<std::string> password, std::optional<std::string> deviceId, std::optional<std::string> initialDeviceDisplayName, std::optional<bool> inhibitLogin, std::optional<bool> refreshToken);
176
177
178
179
180
182 RegisterJob withData(JsonWrap j) const &;
183 };
185 }
186 namespace nlohmann
187 {
188 using namespace Kazv;
189 using namespace Kazv::Api;
190
191 }
192
193 namespace Kazv::Api
194 {
195
204public:
205
206
207
208class JobResponse : public Response
209{
210
211public:
213 bool success() const;
214
215 // Result properties
216
217
221
223 {
224 return
225 std::move(jsonBody().get()).get<RequestTokenResponse>()
226 ;
227 }
228
229
230};
231 static constexpr auto needsAuth() {
232 return
233 false;
234 }
235
236
237// Construction/destruction
238
247 explicit RequestTokenToRegisterEmailJob(std::string serverUrl
248
249 ,
251 );
252
253
255 );
256
258
259
260
261
262
265 };
267 }
268 namespace nlohmann
269 {
270 using namespace Kazv;
271 using namespace Kazv::Api;
272
273 }
274
275 namespace Kazv::Api
276 {
277
286public:
287
288
289
290class JobResponse : public Response
291{
292
293public:
295 bool success() const;
296
297 // Result properties
298
299
303
305 {
306 return
307 std::move(jsonBody().get()).get<RequestTokenResponse>()
308 ;
309 }
310
311
312};
313 static constexpr auto needsAuth() {
314 return
315 false;
316 }
317
318
319// Construction/destruction
320
329 explicit RequestTokenToRegisterMSISDNJob(std::string serverUrl
330
331 ,
333 );
334
335
337 );
338
340
341
342
343
344
347 };
349 }
350 namespace nlohmann
351 {
352 using namespace Kazv;
353 using namespace Kazv::Api;
354
355 }
356
357 namespace Kazv::Api
358 {
359
377public:
378
379
380
381class JobResponse : public Response
382{
383
384public:
386 bool success() const;
387
388};
389 static constexpr auto needsAuth() {
390 return true
391 ;
392 }
393
394
395// Construction/destruction
396
412 explicit ChangePasswordJob(std::string serverUrl
413 , std::string _accessToken
414 ,
415 std::string newPassword , std::optional<bool> logoutDevices = std::nullopt, std::optional<AuthenticationData> auth = std::nullopt
416 );
417
418
420 );
421
422 static BaseJob::Body buildBody(std::string newPassword, std::optional<bool> logoutDevices, std::optional<AuthenticationData> auth);
423
424
425
426
427
430 };
432 }
433 namespace nlohmann
434 {
435 using namespace Kazv;
436 using namespace Kazv::Api;
437
438 }
439
440 namespace Kazv::Api
441 {
442
462public:
463
464
465
466class JobResponse : public Response
467{
468
469public:
471 bool success() const;
472
473 // Result properties
474
475
477
479 {
480 return
481 std::move(jsonBody().get()).get<RequestTokenResponse>()
482 ;
483 }
484
485
486};
487 static constexpr auto needsAuth() {
488 return
489 false;
490 }
491
492
493// Construction/destruction
494
514 explicit RequestTokenToResetPasswordEmailJob(std::string serverUrl
515
516 ,
518 );
519
520
522 );
523
525
526
527
528
529
532 };
534 }
535 namespace nlohmann
536 {
537 using namespace Kazv;
538 using namespace Kazv::Api;
539
540 }
541
542 namespace Kazv::Api
543 {
544
564public:
565
566
567
568class JobResponse : public Response
569{
570
571public:
573 bool success() const;
574
575 // Result properties
576
577
579
581 {
582 return
583 std::move(jsonBody().get()).get<RequestTokenResponse>()
584 ;
585 }
586
587
588};
589 static constexpr auto needsAuth() {
590 return
591 false;
592 }
593
594
595// Construction/destruction
596
616 explicit RequestTokenToResetPasswordMSISDNJob(std::string serverUrl
617
618 ,
620 );
621
622
624 );
625
627
628
629
630
631
634 };
636 }
637 namespace nlohmann
638 {
639 using namespace Kazv;
640 using namespace Kazv::Api;
641
642 }
643
644 namespace Kazv::Api
645 {
646
665public:
666
667
668
669class JobResponse : public Response
670{
671
672public:
674 bool success() const;
675
676 // Result properties
677
678
679
680
689std::string idServerUnbindResult() const;
690
691};
692 static constexpr auto needsAuth() {
693 return true
694 ;
695 }
696
697
698// Construction/destruction
699
713 explicit DeactivateAccountJob(std::string serverUrl
714 , std::string _accessToken
715 ,
716 std::optional<AuthenticationData> auth = std::nullopt, std::optional<std::string> idServer = std::nullopt
717 );
718
719
721 );
722
723 static BaseJob::Body buildBody(std::optional<AuthenticationData> auth, std::optional<std::string> idServer);
724
725
726
727
728
731 };
733 }
734 namespace nlohmann
735 {
736 using namespace Kazv;
737 using namespace Kazv::Api;
738
739 }
740
741 namespace Kazv::Api
742 {
743
760public:
761
762
763
764class JobResponse : public Response
765{
766
767public:
769 bool success() const;
770
771 // Result properties
772
773
774
775
778std::optional<bool> available() const;
779
780};
781 static constexpr auto needsAuth() {
782 return
783 false;
784 }
785
786
787// Construction/destruction
788
794 explicit CheckUsernameAvailabilityJob(std::string serverUrl
795
796 ,
797 std::string username
798 );
799
800
802 std::string username);
803
804 static BaseJob::Body buildBody(std::string username);
805
806
807
808
809
812 };
814 }
815 namespace nlohmann
816 {
817 using namespace Kazv;
818 using namespace Kazv::Api;
819
820 }
821
822 namespace Kazv::Api
823 {
824
825} // namespace Kazv::Api
Definition registration.hpp:382
bool success() const
Definition registration.cpp:372
Changes a user's password.
Definition registration.hpp:376
ChangePasswordJob withData(JsonWrap j) &&
Definition registration.cpp:355
static BaseJob::Query buildQuery()
Definition registration.cpp:305
static BaseJob::Body buildBody(std::string newPassword, std::optional< bool > logoutDevices, std::optional< AuthenticationData > auth)
Definition registration.cpp:313
static constexpr auto needsAuth()
Definition registration.hpp:389
std::optional< bool > available() const
A flag to indicate that the username is available.
Definition registration.cpp:677
bool success() const
Definition registration.cpp:667
Checks to see if a username is available on the server.
Definition registration.hpp:759
static BaseJob::Query buildQuery(std::string username)
Definition registration.cpp:609
static BaseJob::Body buildBody(std::string username)
Definition registration.cpp:618
CheckUsernameAvailabilityJob withData(JsonWrap j) &&
Definition registration.cpp:650
static constexpr auto needsAuth()
Definition registration.hpp:781
Definition registration.hpp:670
bool success() const
Definition registration.cpp:586
std::string idServerUnbindResult() const
An indicator as to whether or not the homeserver was able to unbind the user's 3PIDs from the identit...
Definition registration.cpp:597
Deactivate a user's account.
Definition registration.hpp:664
DeactivateAccountJob withData(JsonWrap j) &&
Definition registration.cpp:569
static BaseJob::Query buildQuery()
Definition registration.cpp:521
static constexpr auto needsAuth()
Definition registration.hpp:692
static BaseJob::Body buildBody(std::optional< AuthenticationData > auth, std::optional< std::string > idServer)
Definition registration.cpp:529
Definition registration.hpp:63
std::optional< int > expiresInMs() const
The lifetime of the access token, in milliseconds.
Definition registration.cpp:133
std::optional< std::string > refreshToken() const
A refresh token for the account.
Definition registration.cpp:122
bool success() const
Definition registration.cpp:89
std::optional< std::string > accessToken() const
An access token for the account.
Definition registration.cpp:111
std::string userId() const
The fully-qualified Matrix user ID (MXID) that has been registered.
Definition registration.cpp:100
std::optional< std::string > deviceId() const
ID of the registered device.
Definition registration.cpp:155
std::optional< std::string > homeServer() const
The server_name of the homeserver on which the account has been registered.
Definition registration.cpp:144
Register for an account on this homeserver.
Definition registration.hpp:57
RegisterJob withData(JsonWrap j) &&
Definition registration.cpp:72
static BaseJob::Body buildBody(std::string kind, std::optional< AuthenticationData > auth, std::optional< std::string > username, std::optional< std::string > password, std::optional< std::string > deviceId, std::optional< std::string > initialDeviceDisplayName, std::optional< bool > inhibitLogin, std::optional< bool > refreshToken)
Definition registration.cpp:22
static BaseJob::Query buildQuery(std::string kind)
Definition registration.cpp:13
static constexpr auto needsAuth()
Definition registration.hpp:121
RequestTokenResponse data() const
An email has been sent to the specified address.
Definition registration.hpp:222
bool success() const
Definition registration.cpp:225
Begins the validation process for an email to be used during registration.
Definition registration.hpp:203
static constexpr auto needsAuth()
Definition registration.hpp:231
static BaseJob::Query buildQuery()
Definition registration.cpp:167
RequestTokenToRegisterEmailJob withData(JsonWrap j) &&
Definition registration.cpp:208
static BaseJob::Body buildBody(EmailValidationData body)
Definition registration.cpp:175
RequestTokenResponse data() const
An SMS message has been sent to the specified phone number.
Definition registration.hpp:304
bool success() const
Definition registration.cpp:294
Requests a validation token be sent to the given phone number for the purpose of registering an accou...
Definition registration.hpp:285
static BaseJob::Query buildQuery()
Definition registration.cpp:236
RequestTokenToRegisterMSISDNJob withData(JsonWrap j) &&
Definition registration.cpp:277
static constexpr auto needsAuth()
Definition registration.hpp:313
static BaseJob::Body buildBody(MsisdnValidationData body)
Definition registration.cpp:244
bool success() const
Definition registration.cpp:441
RequestTokenResponse data() const
An email was sent to the given address.
Definition registration.hpp:478
Requests a validation token be sent to the given email address for the purpose of resetting a user's ...
Definition registration.hpp:461
static BaseJob::Query buildQuery()
Definition registration.cpp:383
static constexpr auto needsAuth()
Definition registration.hpp:487
RequestTokenToResetPasswordEmailJob withData(JsonWrap j) &&
Definition registration.cpp:424
static BaseJob::Body buildBody(EmailValidationData body)
Definition registration.cpp:391
bool success() const
Definition registration.cpp:510
RequestTokenResponse data() const
An SMS message was sent to the given phone number.
Definition registration.hpp:580
Requests a validation token be sent to the given phone number for the purpose of resetting a user's p...
Definition registration.hpp:563
static constexpr auto needsAuth()
Definition registration.hpp:589
static BaseJob::Query buildQuery()
Definition registration.cpp:452
RequestTokenToResetPasswordMSISDNJob withData(JsonWrap j) &&
Definition registration.cpp:493
static BaseJob::Body buildBody(MsisdnValidationData body)
Definition registration.cpp:460
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 request_email_validation.hpp:13
Definition request_msisdn_validation.hpp:13
Definition request_token_response.hpp:13
Definition basejob.hpp:49
JsonWrap jsonBody() const
Definition basejob.cpp:141