1pub mod types;
4
5#[allow(unused_imports)]
6use types::*;
7
8#[derive(Clone)]
10pub struct AuthClient {
11 client: crate::client::Client,
12}
13
14impl AuthClient {
15 pub fn new(client: crate::client::Client) -> Self {
16 AuthClient { client }
17 }
18
19 pub async fn create_user_action_signature(
24 &self,
25 body: CreateUserActionSignatureRequest,
26 ) -> Result<CreateUserActionSignatureResponse, crate::error::Error> {
27 let path = String::from("/auth/action");
28 let body = serde_json::to_value(&body)?;
29 self.client
30 .request::<CreateUserActionSignatureResponse>(
31 reqwest::Method::POST,
32 &path,
33 Some(&body),
34 false,
35 )
36 .await
37 }
38
39 pub async fn create_user_action_challenge(
43 &self,
44 body: CreateUserActionChallengeRequest,
45 ) -> Result<CreateUserActionChallengeResponse, crate::error::Error> {
46 let path = String::from("/auth/action/init");
47 let body = serde_json::to_value(&body)?;
48 self.client
49 .request::<CreateUserActionChallengeResponse>(
50 reqwest::Method::POST,
51 &path,
52 Some(&body),
53 false,
54 )
55 .await
56 }
57
58 pub async fn list_audit_logs(
63 &self,
64 query: Option<ListAuditLogsQuery>,
65 ) -> Result<(), crate::error::Error> {
66 let mut path = String::from("/auth/action/logs");
67 if let Some(query) = &query {
68 let mut q: Vec<String> = Vec::new();
69 q.push(format!(
70 "startTime={}",
71 urlencoding::encode(&query.start_time.to_string())
72 ));
73 q.push(format!(
74 "endTime={}",
75 urlencoding::encode(&query.end_time.to_string())
76 ));
77 if let Some(v) = &query.user_id {
78 q.push(format!("userId={}", urlencoding::encode(&v.to_string())));
79 }
80 if !q.is_empty() {
81 path.push('?');
82 path.push_str(&q.join("&"));
83 }
84 }
85 self.client
86 .request_no_content(reqwest::Method::GET, &path, None, false)
87 .await
88 }
89
90 pub async fn get_audit_log(
94 &self,
95 id: String,
96 ) -> Result<GetAuditLogResponse, crate::error::Error> {
97 let path = format!("/auth/action/logs/{}", urlencoding::encode(&id));
98 self.client
99 .request::<GetAuditLogResponse>(reqwest::Method::GET, &path, None, false)
100 .await
101 }
102
103 #[deprecated(note = "This endpoint is deprecated.")]
107 pub async fn list_applications(&self) -> Result<ListApplicationsResponse, crate::error::Error> {
108 let path = String::from("/auth/apps");
109 self.client
110 .request::<ListApplicationsResponse>(reqwest::Method::GET, &path, None, false)
111 .await
112 }
113
114 #[deprecated(note = "This endpoint is deprecated.")]
118 pub async fn get_application(
119 &self,
120 app_id: String,
121 ) -> Result<GetApplicationResponse, crate::error::Error> {
122 let path = format!("/auth/apps/{}", urlencoding::encode(&app_id));
123 self.client
124 .request::<GetApplicationResponse>(reqwest::Method::GET, &path, None, false)
125 .await
126 }
127
128 pub async fn list_credentials(&self) -> Result<ListCredentialsResponse, crate::error::Error> {
130 let path = String::from("/auth/credentials");
131 self.client
132 .request::<ListCredentialsResponse>(reqwest::Method::GET, &path, None, false)
133 .await
134 }
135
136 pub async fn create_credential(
140 &self,
141 body: CreateCredentialRequest,
142 ) -> Result<CreateCredentialResponse, crate::error::Error> {
143 let path = String::from("/auth/credentials");
144 let body = serde_json::to_value(&body)?;
145 self.client
146 .request::<CreateCredentialResponse>(reqwest::Method::POST, &path, Some(&body), true)
147 .await
148 }
149
150 pub async fn create_credential_challenge(
154 &self,
155 body: CreateCredentialChallengeRequest,
156 ) -> Result<serde_json::Value, crate::error::Error> {
157 let path = String::from("/auth/credentials/init");
158 let body = serde_json::to_value(&body)?;
159 self.client
160 .request::<serde_json::Value>(reqwest::Method::POST, &path, Some(&body), false)
161 .await
162 }
163
164 pub async fn activate_credential(
166 &self,
167 body: ActivateCredentialRequest,
168 ) -> Result<ActivateCredentialResponse, crate::error::Error> {
169 let path = String::from("/auth/credentials/activate");
170 let body = serde_json::to_value(&body)?;
171 self.client
172 .request::<ActivateCredentialResponse>(reqwest::Method::PUT, &path, Some(&body), true)
173 .await
174 }
175
176 pub async fn delete_credential(
178 &self,
179 credential_uuid: String,
180 ) -> Result<DeleteCredentialResponse, crate::error::Error> {
181 let path = format!(
182 "/auth/credentials/{}",
183 urlencoding::encode(&credential_uuid)
184 );
185 self.client
186 .request::<DeleteCredentialResponse>(reqwest::Method::DELETE, &path, None, true)
187 .await
188 }
189
190 pub async fn deactivate_credential(
192 &self,
193 body: DeactivateCredentialRequest,
194 ) -> Result<DeactivateCredentialResponse, crate::error::Error> {
195 let path = String::from("/auth/credentials/deactivate");
196 let body = serde_json::to_value(&body)?;
197 self.client
198 .request::<DeactivateCredentialResponse>(reqwest::Method::PUT, &path, Some(&body), true)
199 .await
200 }
201
202 pub async fn create_credential_code(
206 &self,
207 body: CreateCredentialCodeRequest,
208 ) -> Result<CreateCredentialCodeResponse, crate::error::Error> {
209 let path = String::from("/auth/credentials/code");
210 let body = serde_json::to_value(&body)?;
211 self.client
212 .request::<CreateCredentialCodeResponse>(
213 reqwest::Method::POST,
214 &path,
215 Some(&body),
216 true,
217 )
218 .await
219 }
220
221 pub async fn create_credential_challenge_with_code(
225 &self,
226 body: CreateCredentialChallengeWithCodeRequest,
227 ) -> Result<serde_json::Value, crate::error::Error> {
228 let path = String::from("/auth/credentials/code/init");
229 let body = serde_json::to_value(&body)?;
230 self.client
231 .request::<serde_json::Value>(reqwest::Method::POST, &path, Some(&body), false)
232 .await
233 }
234
235 pub async fn create_credential_with_code(
240 &self,
241 body: CreateCredentialWithCodeRequest,
242 ) -> Result<CreateCredentialWithCodeResponse, crate::error::Error> {
243 let path = String::from("/auth/credentials/code/verify");
244 let body = serde_json::to_value(&body)?;
245 self.client
246 .request::<CreateCredentialWithCodeResponse>(
247 reqwest::Method::POST,
248 &path,
249 Some(&body),
250 false,
251 )
252 .await
253 }
254
255 pub async fn create_login_challenge(
260 &self,
261 body: CreateLoginChallengeRequest,
262 ) -> Result<CreateLoginChallengeResponse, crate::error::Error> {
263 let path = String::from("/auth/login/init");
264 let body = serde_json::to_value(&body)?;
265 self.client
266 .request::<CreateLoginChallengeResponse>(
267 reqwest::Method::POST,
268 &path,
269 Some(&body),
270 false,
271 )
272 .await
273 }
274
275 pub async fn delegated_login(
280 &self,
281 body: DelegatedLoginRequest,
282 ) -> Result<DelegatedLoginResponse, crate::error::Error> {
283 let path = String::from("/auth/login/delegated");
284 let body = serde_json::to_value(&body)?;
285 self.client
286 .request::<DelegatedLoginResponse>(reqwest::Method::POST, &path, Some(&body), true)
287 .await
288 }
289
290 pub async fn complete_user_login(
295 &self,
296 body: CompleteUserLoginRequest,
297 ) -> Result<serde_json::Value, crate::error::Error> {
298 let path = String::from("/auth/login");
299 let body = serde_json::to_value(&body)?;
300 self.client
301 .request::<serde_json::Value>(reqwest::Method::POST, &path, Some(&body), false)
302 .await
303 }
304
305 pub async fn logout(&self, body: LogoutRequest) -> Result<LogoutResponse, crate::error::Error> {
307 let path = String::from("/auth/logout");
308 let body = serde_json::to_value(&body)?;
309 self.client
310 .request::<LogoutResponse>(reqwest::Method::PUT, &path, Some(&body), false)
311 .await
312 }
313
314 pub async fn send_login_code(
318 &self,
319 body: SendLoginCodeRequest,
320 ) -> Result<SendLoginCodeResponse, crate::error::Error> {
321 let path = String::from("/auth/login/code");
322 let body = serde_json::to_value(&body)?;
323 self.client
324 .request::<SendLoginCodeResponse>(reqwest::Method::POST, &path, Some(&body), false)
325 .await
326 }
327
328 pub async fn social_login(
330 &self,
331 body: SocialLoginRequest,
332 ) -> Result<SocialLoginResponse, crate::error::Error> {
333 let path = String::from("/auth/login/social");
334 let body = serde_json::to_value(&body)?;
335 self.client
336 .request::<SocialLoginResponse>(reqwest::Method::POST, &path, Some(&body), false)
337 .await
338 }
339
340 pub async fn complete_sso_login(
342 &self,
343 body: CompleteSsoLoginRequest,
344 ) -> Result<CompleteSsoLoginResponse, crate::error::Error> {
345 let path = String::from("/auth/login/sso");
346 let body = serde_json::to_value(&body)?;
347 self.client
348 .request::<CompleteSsoLoginResponse>(reqwest::Method::POST, &path, Some(&body), false)
349 .await
350 }
351
352 pub async fn initiate_sso_login(
354 &self,
355 body: InitiateSsoLoginRequest,
356 ) -> Result<InitiateSsoLoginResponse, crate::error::Error> {
357 let path = String::from("/auth/login/sso/init");
358 let body = serde_json::to_value(&body)?;
359 self.client
360 .request::<InitiateSsoLoginResponse>(reqwest::Method::POST, &path, Some(&body), false)
361 .await
362 }
363
364 pub async fn exchange_access_token(
366 &self,
367 body: ExchangeAccessTokenRequest,
368 ) -> Result<ExchangeAccessTokenResponse, crate::error::Error> {
369 let path = String::from("/auth/tokens");
370 let body = serde_json::to_value(&body)?;
371 self.client
372 .request::<ExchangeAccessTokenResponse>(
373 reqwest::Method::POST,
374 &path,
375 Some(&body),
376 false,
377 )
378 .await
379 }
380
381 pub async fn list_personal_access_tokens(
383 &self,
384 ) -> Result<ListPersonalAccessTokensResponse, crate::error::Error> {
385 let path = String::from("/auth/pats");
386 self.client
387 .request::<ListPersonalAccessTokensResponse>(reqwest::Method::GET, &path, None, false)
388 .await
389 }
390
391 pub async fn create_personal_access_token(
393 &self,
394 body: CreatePersonalAccessTokenRequest,
395 ) -> Result<CreatePersonalAccessTokenResponse, crate::error::Error> {
396 let path = String::from("/auth/pats");
397 let body = serde_json::to_value(&body)?;
398 self.client
399 .request::<CreatePersonalAccessTokenResponse>(
400 reqwest::Method::POST,
401 &path,
402 Some(&body),
403 true,
404 )
405 .await
406 }
407
408 pub async fn get_personal_access_token(
410 &self,
411 token_id: String,
412 ) -> Result<GetPersonalAccessTokenResponse, crate::error::Error> {
413 let path = format!("/auth/pats/{}", urlencoding::encode(&token_id));
414 self.client
415 .request::<GetPersonalAccessTokenResponse>(reqwest::Method::GET, &path, None, false)
416 .await
417 }
418
419 pub async fn update_personal_access_token(
421 &self,
422 token_id: String,
423 body: UpdatePersonalAccessTokenRequest,
424 ) -> Result<UpdatePersonalAccessTokenResponse, crate::error::Error> {
425 let path = format!("/auth/pats/{}", urlencoding::encode(&token_id));
426 let body = serde_json::to_value(&body)?;
427 self.client
428 .request::<UpdatePersonalAccessTokenResponse>(
429 reqwest::Method::PUT,
430 &path,
431 Some(&body),
432 true,
433 )
434 .await
435 }
436
437 pub async fn delete_personal_access_token(
439 &self,
440 token_id: String,
441 ) -> Result<DeletePersonalAccessTokenResponse, crate::error::Error> {
442 let path = format!("/auth/pats/{}", urlencoding::encode(&token_id));
443 self.client
444 .request::<DeletePersonalAccessTokenResponse>(
445 reqwest::Method::DELETE,
446 &path,
447 None,
448 true,
449 )
450 .await
451 }
452
453 pub async fn activate_personal_access_token(
455 &self,
456 token_id: String,
457 ) -> Result<ActivatePersonalAccessTokenResponse, crate::error::Error> {
458 let path = format!("/auth/pats/{}/activate", urlencoding::encode(&token_id));
459 self.client
460 .request::<ActivatePersonalAccessTokenResponse>(reqwest::Method::PUT, &path, None, true)
461 .await
462 }
463
464 pub async fn deactivate_personal_access_token(
466 &self,
467 token_id: String,
468 ) -> Result<DeactivatePersonalAccessTokenResponse, crate::error::Error> {
469 let path = format!("/auth/pats/{}/deactivate", urlencoding::encode(&token_id));
470 self.client
471 .request::<DeactivatePersonalAccessTokenResponse>(
472 reqwest::Method::PUT,
473 &path,
474 None,
475 true,
476 )
477 .await
478 }
479
480 pub async fn create_delegated_recovery_challenge(
485 &self,
486 body: CreateDelegatedRecoveryChallengeRequest,
487 ) -> Result<CreateDelegatedRecoveryChallengeResponse, crate::error::Error> {
488 let path = String::from("/auth/recover/user/delegated");
489 let body = serde_json::to_value(&body)?;
490 self.client
491 .request::<CreateDelegatedRecoveryChallengeResponse>(
492 reqwest::Method::POST,
493 &path,
494 Some(&body),
495 true,
496 )
497 .await
498 }
499
500 pub async fn recover_user(
505 &self,
506 body: RecoverUserRequest,
507 ) -> Result<RecoverUserResponse, crate::error::Error> {
508 let path = String::from("/auth/recover/user");
509 let body = serde_json::to_value(&body)?;
510 self.client
511 .request::<RecoverUserResponse>(reqwest::Method::POST, &path, Some(&body), false)
512 .await
513 }
514
515 pub async fn create_recovery_challenge(
517 &self,
518 body: CreateRecoveryChallengeRequest,
519 ) -> Result<CreateRecoveryChallengeResponse, crate::error::Error> {
520 let path = String::from("/auth/recover/user/init");
521 let body = serde_json::to_value(&body)?;
522 self.client
523 .request::<CreateRecoveryChallengeResponse>(
524 reqwest::Method::POST,
525 &path,
526 Some(&body),
527 false,
528 )
529 .await
530 }
531
532 pub async fn send_recovery_code_email(
534 &self,
535 body: SendRecoveryCodeEmailRequest,
536 ) -> Result<SendRecoveryCodeEmailResponse, crate::error::Error> {
537 let path = String::from("/auth/recover/user/code");
538 let body = serde_json::to_value(&body)?;
539 self.client
540 .request::<SendRecoveryCodeEmailResponse>(
541 reqwest::Method::POST,
542 &path,
543 Some(&body),
544 false,
545 )
546 .await
547 }
548
549 pub async fn create_delegated_registration_challenge(
554 &self,
555 body: CreateDelegatedRegistrationChallengeRequest,
556 ) -> Result<CreateDelegatedRegistrationChallengeResponse, crate::error::Error> {
557 let path = String::from("/auth/registration/delegated");
558 let body = serde_json::to_value(&body)?;
559 self.client
560 .request::<CreateDelegatedRegistrationChallengeResponse>(
561 reqwest::Method::POST,
562 &path,
563 Some(&body),
564 true,
565 )
566 .await
567 }
568
569 pub async fn create_registration_challenge(
571 &self,
572 body: CreateRegistrationChallengeRequest,
573 ) -> Result<CreateRegistrationChallengeResponse, crate::error::Error> {
574 let path = String::from("/auth/registration/init");
575 let body = serde_json::to_value(&body)?;
576 self.client
577 .request::<CreateRegistrationChallengeResponse>(
578 reqwest::Method::POST,
579 &path,
580 Some(&body),
581 false,
582 )
583 .await
584 }
585
586 pub async fn create_social_registration_challenge(
588 &self,
589 body: CreateSocialRegistrationChallengeRequest,
590 ) -> Result<CreateSocialRegistrationChallengeResponse, crate::error::Error> {
591 let path = String::from("/auth/registration/social");
592 let body = serde_json::to_value(&body)?;
593 self.client
594 .request::<CreateSocialRegistrationChallengeResponse>(
595 reqwest::Method::POST,
596 &path,
597 Some(&body),
598 false,
599 )
600 .await
601 }
602
603 pub async fn complete_user_registration(
608 &self,
609 body: CompleteUserRegistrationRequest,
610 ) -> Result<CompleteUserRegistrationResponse, crate::error::Error> {
611 let path = String::from("/auth/registration");
612 let body = serde_json::to_value(&body)?;
613 self.client
614 .request::<CompleteUserRegistrationResponse>(
615 reqwest::Method::POST,
616 &path,
617 Some(&body),
618 false,
619 )
620 .await
621 }
622
623 pub async fn complete_end_user_registration_with_wallets(
628 &self,
629 body: CompleteEndUserRegistrationWithWalletsRequest,
630 ) -> Result<CompleteEndUserRegistrationWithWalletsResponse, crate::error::Error> {
631 let path = String::from("/auth/registration/enduser");
632 let body = serde_json::to_value(&body)?;
633 self.client
634 .request::<CompleteEndUserRegistrationWithWalletsResponse>(
635 reqwest::Method::POST,
636 &path,
637 Some(&body),
638 false,
639 )
640 .await
641 }
642
643 pub async fn resend_registration_code(
645 &self,
646 body: ResendRegistrationCodeRequest,
647 ) -> Result<ResendRegistrationCodeResponse, crate::error::Error> {
648 let path = String::from("/auth/registration/code");
649 let body = serde_json::to_value(&body)?;
650 self.client
651 .request::<ResendRegistrationCodeResponse>(
652 reqwest::Method::PUT,
653 &path,
654 Some(&body),
655 false,
656 )
657 .await
658 }
659
660 pub async fn list_service_accounts(
662 &self,
663 ) -> Result<ListServiceAccountsResponse, crate::error::Error> {
664 let path = String::from("/auth/service-accounts");
665 self.client
666 .request::<ListServiceAccountsResponse>(reqwest::Method::GET, &path, None, false)
667 .await
668 }
669
670 pub async fn create_service_account(
672 &self,
673 body: CreateServiceAccountRequest,
674 ) -> Result<CreateServiceAccountResponse, crate::error::Error> {
675 let path = String::from("/auth/service-accounts");
676 let body = serde_json::to_value(&body)?;
677 self.client
678 .request::<CreateServiceAccountResponse>(
679 reqwest::Method::POST,
680 &path,
681 Some(&body),
682 true,
683 )
684 .await
685 }
686
687 pub async fn get_service_account(
689 &self,
690 service_account_id: String,
691 ) -> Result<GetServiceAccountResponse, crate::error::Error> {
692 let path = format!(
693 "/auth/service-accounts/{}",
694 urlencoding::encode(&service_account_id)
695 );
696 self.client
697 .request::<GetServiceAccountResponse>(reqwest::Method::GET, &path, None, false)
698 .await
699 }
700
701 pub async fn update_service_account(
703 &self,
704 service_account_id: String,
705 body: UpdateServiceAccountRequest,
706 ) -> Result<UpdateServiceAccountResponse, crate::error::Error> {
707 let path = format!(
708 "/auth/service-accounts/{}",
709 urlencoding::encode(&service_account_id)
710 );
711 let body = serde_json::to_value(&body)?;
712 self.client
713 .request::<UpdateServiceAccountResponse>(reqwest::Method::PUT, &path, Some(&body), true)
714 .await
715 }
716
717 pub async fn delete_service_account(
719 &self,
720 service_account_id: String,
721 query: Option<DeleteServiceAccountQuery>,
722 ) -> Result<DeleteServiceAccountResponse, crate::error::Error> {
723 let mut path = format!(
724 "/auth/service-accounts/{}",
725 urlencoding::encode(&service_account_id)
726 );
727 if let Some(query) = &query {
728 let mut q: Vec<String> = Vec::new();
729 if let Some(v) = &query.force {
730 q.push(format!("force={}", urlencoding::encode(&v.to_string())));
731 }
732 if !q.is_empty() {
733 path.push('?');
734 path.push_str(&q.join("&"));
735 }
736 }
737 self.client
738 .request::<DeleteServiceAccountResponse>(reqwest::Method::DELETE, &path, None, true)
739 .await
740 }
741
742 pub async fn activate_service_account(
744 &self,
745 service_account_id: String,
746 ) -> Result<ActivateServiceAccountResponse, crate::error::Error> {
747 let path = format!(
748 "/auth/service-accounts/{}/activate",
749 urlencoding::encode(&service_account_id)
750 );
751 self.client
752 .request::<ActivateServiceAccountResponse>(reqwest::Method::PUT, &path, None, true)
753 .await
754 }
755
756 pub async fn deactivate_service_account(
758 &self,
759 service_account_id: String,
760 body: DeactivateServiceAccountRequest,
761 ) -> Result<DeactivateServiceAccountResponse, crate::error::Error> {
762 let path = format!(
763 "/auth/service-accounts/{}/deactivate",
764 urlencoding::encode(&service_account_id)
765 );
766 let body = serde_json::to_value(&body)?;
767 self.client
768 .request::<DeactivateServiceAccountResponse>(
769 reqwest::Method::PUT,
770 &path,
771 Some(&body),
772 true,
773 )
774 .await
775 }
776
777 pub async fn activate_user(
779 &self,
780 user_id: String,
781 ) -> Result<ActivateUserResponse, crate::error::Error> {
782 let path = format!("/auth/users/{}/activate", urlencoding::encode(&user_id));
783 self.client
784 .request::<ActivateUserResponse>(reqwest::Method::PUT, &path, None, true)
785 .await
786 }
787
788 pub async fn deactivate_user(
790 &self,
791 user_id: String,
792 ) -> Result<DeactivateUserResponse, crate::error::Error> {
793 let path = format!("/auth/users/{}/deactivate", urlencoding::encode(&user_id));
794 self.client
795 .request::<DeactivateUserResponse>(reqwest::Method::PUT, &path, None, true)
796 .await
797 }
798
799 pub async fn get_user(&self, user_id: String) -> Result<GetUserResponse, crate::error::Error> {
801 let path = format!("/auth/users/{}", urlencoding::encode(&user_id));
802 self.client
803 .request::<GetUserResponse>(reqwest::Method::GET, &path, None, false)
804 .await
805 }
806
807 pub async fn update_user(
809 &self,
810 user_id: String,
811 body: UpdateUserRequest,
812 ) -> Result<UpdateUserResponse, crate::error::Error> {
813 let path = format!("/auth/users/{}", urlencoding::encode(&user_id));
814 let body = serde_json::to_value(&body)?;
815 self.client
816 .request::<UpdateUserResponse>(reqwest::Method::PUT, &path, Some(&body), true)
817 .await
818 }
819
820 pub async fn delete_user(
822 &self,
823 user_id: String,
824 ) -> Result<DeleteUserResponse, crate::error::Error> {
825 let path = format!("/auth/users/{}", urlencoding::encode(&user_id));
826 self.client
827 .request::<DeleteUserResponse>(reqwest::Method::DELETE, &path, None, true)
828 .await
829 }
830
831 pub async fn list_users(
833 &self,
834 query: Option<ListUsersQuery>,
835 ) -> Result<ListUsersResponse, crate::error::Error> {
836 let mut path = String::from("/auth/users");
837 if let Some(query) = &query {
838 let mut q: Vec<String> = Vec::new();
839 if let Some(v) = &query.limit {
840 q.push(format!("limit={}", urlencoding::encode(&v.to_string())));
841 }
842 if let Some(v) = &query.pagination_token {
843 q.push(format!(
844 "paginationToken={}",
845 urlencoding::encode(&v.to_string())
846 ));
847 }
848 if let Some(v) = &query.kind {
849 q.push(format!("kind={}", urlencoding::encode(&v.to_string())));
850 }
851 if !q.is_empty() {
852 path.push('?');
853 path.push_str(&q.join("&"));
854 }
855 }
856 self.client
857 .request::<ListUsersResponse>(reqwest::Method::GET, &path, None, false)
858 .await
859 }
860
861 pub async fn create_user(
866 &self,
867 body: CreateUserRequest,
868 ) -> Result<CreateUserResponse, crate::error::Error> {
869 let path = String::from("/auth/users");
870 let body = serde_json::to_value(&body)?;
871 self.client
872 .request::<CreateUserResponse>(reqwest::Method::POST, &path, Some(&body), true)
873 .await
874 }
875
876 pub async fn invite_tenant_user(
878 &self,
879 body: InviteTenantUserRequest,
880 ) -> Result<InviteTenantUserResponse, crate::error::Error> {
881 let path = String::from("/auth/users/invite");
882 let body = serde_json::to_value(&body)?;
883 self.client
884 .request::<InviteTenantUserResponse>(reqwest::Method::POST, &path, Some(&body), true)
885 .await
886 }
887}