libkazv
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 
13 namespace Kazv::Api {
14 
57 class RegisterJob : public BaseJob {
58 public:
59 
60 
61 
62 class JobResponse : public Response
63 {
64 
65 public:
67  bool success() const;
68 
69  // Result properties
70 
71 
72 
73 
78 std::string userId() const;
79 
80 
84 std::optional<std::string> accessToken() const;
85 
86 
92 std::optional<std::string> refreshToken() const;
93 
94 
103 std::optional<int> expiresInMs() const;
104 
105 
112 std::optional<std::string> homeServer() const;
113 
114 
118 std::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 
172  static BaseJob::Query buildQuery(
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 
204 public:
205 
206 
207 
208 class JobResponse : public Response
209 {
210 
211 public:
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  ,
250  EmailValidationData body
251  );
252 
253 
254  static BaseJob::Query buildQuery(
255  );
256 
257  static BaseJob::Body buildBody(EmailValidationData body);
258 
259 
260 
261 
262 
264  RequestTokenToRegisterEmailJob withData(JsonWrap j) const &;
265  };
267  }
268  namespace nlohmann
269  {
270  using namespace Kazv;
271  using namespace Kazv::Api;
272 
273  }
274 
275  namespace Kazv::Api
276  {
277 
286 public:
287 
288 
289 
290 class JobResponse : public Response
291 {
292 
293 public:
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 
336  static BaseJob::Query buildQuery(
337  );
338 
339  static BaseJob::Body buildBody(MsisdnValidationData body);
340 
341 
342 
343 
344 
346  RequestTokenToRegisterMSISDNJob withData(JsonWrap j) const &;
347  };
349  }
350  namespace nlohmann
351  {
352  using namespace Kazv;
353  using namespace Kazv::Api;
354 
355  }
356 
357  namespace Kazv::Api
358  {
359 
376 class ChangePasswordJob : public BaseJob {
377 public:
378 
379 
380 
381 class JobResponse : public Response
382 {
383 
384 public:
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 
419  static BaseJob::Query buildQuery(
420  );
421 
422  static BaseJob::Body buildBody(std::string newPassword, std::optional<bool> logoutDevices, std::optional<AuthenticationData> auth);
423 
424 
425 
426 
427 
428  ChangePasswordJob withData(JsonWrap j) &&;
429  ChangePasswordJob withData(JsonWrap j) const &;
430  };
432  }
433  namespace nlohmann
434  {
435  using namespace Kazv;
436  using namespace Kazv::Api;
437 
438  }
439 
440  namespace Kazv::Api
441  {
442 
462 public:
463 
464 
465 
466 class JobResponse : public Response
467 {
468 
469 public:
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  ,
517  EmailValidationData body
518  );
519 
520 
521  static BaseJob::Query buildQuery(
522  );
523 
524  static BaseJob::Body buildBody(EmailValidationData body);
525 
526 
527 
528 
529 
531  RequestTokenToResetPasswordEmailJob withData(JsonWrap j) const &;
532  };
534  }
535  namespace nlohmann
536  {
537  using namespace Kazv;
538  using namespace Kazv::Api;
539 
540  }
541 
542  namespace Kazv::Api
543  {
544 
564 public:
565 
566 
567 
568 class JobResponse : public Response
569 {
570 
571 public:
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 
623  static BaseJob::Query buildQuery(
624  );
625 
626  static BaseJob::Body buildBody(MsisdnValidationData body);
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 
665 public:
666 
667 
668 
669 class JobResponse : public Response
670 {
671 
672 public:
674  bool success() const;
675 
676  // Result properties
677 
678 
679 
680 
689 std::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 
720  static BaseJob::Query buildQuery(
721  );
722 
723  static BaseJob::Body buildBody(std::optional<AuthenticationData> auth, std::optional<std::string> idServer);
724 
725 
726 
727 
728 
729  DeactivateAccountJob withData(JsonWrap j) &&;
730  DeactivateAccountJob withData(JsonWrap j) const &;
731  };
733  }
734  namespace nlohmann
735  {
736  using namespace Kazv;
737  using namespace Kazv::Api;
738 
739  }
740 
741  namespace Kazv::Api
742  {
743 
760 public:
761 
762 
763 
764 class JobResponse : public Response
765 {
766 
767 public:
769  bool success() const;
770 
771  // Result properties
772 
773 
774 
775 
778 std::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 
801  static BaseJob::Query buildQuery(
802  std::string username);
803 
804  static BaseJob::Body buildBody(std::string username);
805 
806 
807 
808 
809 
810  CheckUsernameAvailabilityJob withData(JsonWrap j) &&;
811  CheckUsernameAvailabilityJob withData(JsonWrap j) const &;
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
Changes a user's password.
Definition: registration.hpp:376
static constexpr auto needsAuth()
Definition: registration.hpp:389
Checks to see if a username is available on the server.
Definition: registration.hpp:759
static constexpr auto needsAuth()
Definition: registration.hpp:781
Definition: registration.hpp:670
Deactivate a user's account.
Definition: registration.hpp:664
static constexpr auto needsAuth()
Definition: registration.hpp:692
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
JobResponse(Response r)
Definition: registration.cpp:86
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
RegisterJob(std::string serverUrl, 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)
Register for an account on this homeserver.
Definition: registration.cpp:52
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
Begins the validation process for an email to be used during registration.
Definition: registration.hpp:203
static constexpr auto needsAuth()
Definition: registration.hpp:231
RequestTokenResponse data() const
An SMS message has been sent to the specified phone number.
Definition: registration.hpp:304
Requests a validation token be sent to the given phone number for the purpose of registering an accou...
Definition: registration.hpp:285
static constexpr auto needsAuth()
Definition: registration.hpp:313
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 constexpr auto needsAuth()
Definition: registration.hpp:487
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
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
Definition: request_email_validation.hpp:13
Definition: request_msisdn_validation.hpp:13
Definition: request_token_response.hpp:13
Definition: basejob.hpp:50