fusionauth_rust_client/apis/
default_api.rs

1/*
2 * FusionAuth API
3 *
4 * This is a FusionAuth server. Find out more at [https://fusionauth.io](https://fusionauth.io). You need to [set up an API key](https://fusionauth.io/docs/v1/tech/apis/authentication#managing-api-keys) in the FusionAuth instance you are using to test out the API calls.
5 *
6 * The version of the OpenAPI document: 1.57.1
7 * 
8 * Generated by: https://openapi-generator.tech
9 */
10
11
12use reqwest;
13use serde::{Deserialize, Serialize, de::Error as _};
14use crate::{apis::ResponseContent, models};
15use super::{Error, configuration, ContentType};
16
17
18/// struct for typed errors of method [`action_user_with_id`]
19#[derive(Debug, Clone, Serialize, Deserialize)]
20#[serde(untagged)]
21pub enum ActionUserWithIdError {
22    DefaultResponse(models::Errors),
23    UnknownValue(serde_json::Value),
24}
25
26/// struct for typed errors of method [`activate_reactor_with_id`]
27#[derive(Debug, Clone, Serialize, Deserialize)]
28#[serde(untagged)]
29pub enum ActivateReactorWithIdError {
30    DefaultResponse(models::Errors),
31    UnknownValue(serde_json::Value),
32}
33
34/// struct for typed errors of method [`approve_device_with_id`]
35#[derive(Debug, Clone, Serialize, Deserialize)]
36#[serde(untagged)]
37pub enum ApproveDeviceWithIdError {
38    DefaultResponse(models::Errors),
39    UnknownValue(serde_json::Value),
40}
41
42/// struct for typed errors of method [`cancel_action_with_id`]
43#[derive(Debug, Clone, Serialize, Deserialize)]
44#[serde(untagged)]
45pub enum CancelActionWithIdError {
46    DefaultResponse(models::Errors),
47    UnknownValue(serde_json::Value),
48}
49
50/// struct for typed errors of method [`change_password_by_identity_with_id`]
51#[derive(Debug, Clone, Serialize, Deserialize)]
52#[serde(untagged)]
53pub enum ChangePasswordByIdentityWithIdError {
54    DefaultResponse(models::Errors),
55    UnknownValue(serde_json::Value),
56}
57
58/// struct for typed errors of method [`change_password_with_id`]
59#[derive(Debug, Clone, Serialize, Deserialize)]
60#[serde(untagged)]
61pub enum ChangePasswordWithIdError {
62    DefaultResponse(models::Errors),
63    UnknownValue(serde_json::Value),
64}
65
66/// struct for typed errors of method [`check_change_password_using_id_with_id`]
67#[derive(Debug, Clone, Serialize, Deserialize)]
68#[serde(untagged)]
69pub enum CheckChangePasswordUsingIdWithIdError {
70    DefaultResponse(models::Errors),
71    UnknownValue(serde_json::Value),
72}
73
74/// struct for typed errors of method [`comment_on_user_with_id`]
75#[derive(Debug, Clone, Serialize, Deserialize)]
76#[serde(untagged)]
77pub enum CommentOnUserWithIdError {
78    DefaultResponse(models::Errors),
79    UnknownValue(serde_json::Value),
80}
81
82/// struct for typed errors of method [`complete_web_authn_assertion_with_id`]
83#[derive(Debug, Clone, Serialize, Deserialize)]
84#[serde(untagged)]
85pub enum CompleteWebAuthnAssertionWithIdError {
86    DefaultResponse(models::Errors),
87    UnknownValue(serde_json::Value),
88}
89
90/// struct for typed errors of method [`complete_web_authn_login_with_id`]
91#[derive(Debug, Clone, Serialize, Deserialize)]
92#[serde(untagged)]
93pub enum CompleteWebAuthnLoginWithIdError {
94    DefaultResponse(models::Errors),
95    UnknownValue(serde_json::Value),
96}
97
98/// struct for typed errors of method [`complete_web_authn_registration_with_id`]
99#[derive(Debug, Clone, Serialize, Deserialize)]
100#[serde(untagged)]
101pub enum CompleteWebAuthnRegistrationWithIdError {
102    DefaultResponse(models::Errors),
103    UnknownValue(serde_json::Value),
104}
105
106/// struct for typed errors of method [`create_api_key`]
107#[derive(Debug, Clone, Serialize, Deserialize)]
108#[serde(untagged)]
109pub enum CreateApiKeyError {
110    DefaultResponse(models::Errors),
111    UnknownValue(serde_json::Value),
112}
113
114/// struct for typed errors of method [`create_api_key_with_id`]
115#[derive(Debug, Clone, Serialize, Deserialize)]
116#[serde(untagged)]
117pub enum CreateApiKeyWithIdError {
118    DefaultResponse(models::Errors),
119    UnknownValue(serde_json::Value),
120}
121
122/// struct for typed errors of method [`create_application`]
123#[derive(Debug, Clone, Serialize, Deserialize)]
124#[serde(untagged)]
125pub enum CreateApplicationError {
126    DefaultResponse(models::Errors),
127    UnknownValue(serde_json::Value),
128}
129
130/// struct for typed errors of method [`create_application_role`]
131#[derive(Debug, Clone, Serialize, Deserialize)]
132#[serde(untagged)]
133pub enum CreateApplicationRoleError {
134    DefaultResponse(models::Errors),
135    UnknownValue(serde_json::Value),
136}
137
138/// struct for typed errors of method [`create_application_role_with_id`]
139#[derive(Debug, Clone, Serialize, Deserialize)]
140#[serde(untagged)]
141pub enum CreateApplicationRoleWithIdError {
142    DefaultResponse(models::Errors),
143    UnknownValue(serde_json::Value),
144}
145
146/// struct for typed errors of method [`create_application_with_id`]
147#[derive(Debug, Clone, Serialize, Deserialize)]
148#[serde(untagged)]
149pub enum CreateApplicationWithIdError {
150    DefaultResponse(models::Errors),
151    UnknownValue(serde_json::Value),
152}
153
154/// struct for typed errors of method [`create_audit_log_with_id`]
155#[derive(Debug, Clone, Serialize, Deserialize)]
156#[serde(untagged)]
157pub enum CreateAuditLogWithIdError {
158    DefaultResponse(models::Errors),
159    UnknownValue(serde_json::Value),
160}
161
162/// struct for typed errors of method [`create_connector`]
163#[derive(Debug, Clone, Serialize, Deserialize)]
164#[serde(untagged)]
165pub enum CreateConnectorError {
166    DefaultResponse(models::Errors),
167    UnknownValue(serde_json::Value),
168}
169
170/// struct for typed errors of method [`create_connector_with_id`]
171#[derive(Debug, Clone, Serialize, Deserialize)]
172#[serde(untagged)]
173pub enum CreateConnectorWithIdError {
174    DefaultResponse(models::Errors),
175    UnknownValue(serde_json::Value),
176}
177
178/// struct for typed errors of method [`create_consent`]
179#[derive(Debug, Clone, Serialize, Deserialize)]
180#[serde(untagged)]
181pub enum CreateConsentError {
182    DefaultResponse(models::Errors),
183    UnknownValue(serde_json::Value),
184}
185
186/// struct for typed errors of method [`create_consent_with_id`]
187#[derive(Debug, Clone, Serialize, Deserialize)]
188#[serde(untagged)]
189pub enum CreateConsentWithIdError {
190    DefaultResponse(models::Errors),
191    UnknownValue(serde_json::Value),
192}
193
194/// struct for typed errors of method [`create_email_template`]
195#[derive(Debug, Clone, Serialize, Deserialize)]
196#[serde(untagged)]
197pub enum CreateEmailTemplateError {
198    DefaultResponse(models::Errors),
199    UnknownValue(serde_json::Value),
200}
201
202/// struct for typed errors of method [`create_email_template_with_id`]
203#[derive(Debug, Clone, Serialize, Deserialize)]
204#[serde(untagged)]
205pub enum CreateEmailTemplateWithIdError {
206    DefaultResponse(models::Errors),
207    UnknownValue(serde_json::Value),
208}
209
210/// struct for typed errors of method [`create_entity`]
211#[derive(Debug, Clone, Serialize, Deserialize)]
212#[serde(untagged)]
213pub enum CreateEntityError {
214    DefaultResponse(models::Errors),
215    UnknownValue(serde_json::Value),
216}
217
218/// struct for typed errors of method [`create_entity_type`]
219#[derive(Debug, Clone, Serialize, Deserialize)]
220#[serde(untagged)]
221pub enum CreateEntityTypeError {
222    DefaultResponse(models::Errors),
223    UnknownValue(serde_json::Value),
224}
225
226/// struct for typed errors of method [`create_entity_type_permission`]
227#[derive(Debug, Clone, Serialize, Deserialize)]
228#[serde(untagged)]
229pub enum CreateEntityTypePermissionError {
230    DefaultResponse(models::Errors),
231    UnknownValue(serde_json::Value),
232}
233
234/// struct for typed errors of method [`create_entity_type_permission_with_id`]
235#[derive(Debug, Clone, Serialize, Deserialize)]
236#[serde(untagged)]
237pub enum CreateEntityTypePermissionWithIdError {
238    DefaultResponse(models::Errors),
239    UnknownValue(serde_json::Value),
240}
241
242/// struct for typed errors of method [`create_entity_type_with_id`]
243#[derive(Debug, Clone, Serialize, Deserialize)]
244#[serde(untagged)]
245pub enum CreateEntityTypeWithIdError {
246    DefaultResponse(models::Errors),
247    UnknownValue(serde_json::Value),
248}
249
250/// struct for typed errors of method [`create_entity_with_id`]
251#[derive(Debug, Clone, Serialize, Deserialize)]
252#[serde(untagged)]
253pub enum CreateEntityWithIdError {
254    DefaultResponse(models::Errors),
255    UnknownValue(serde_json::Value),
256}
257
258/// struct for typed errors of method [`create_family`]
259#[derive(Debug, Clone, Serialize, Deserialize)]
260#[serde(untagged)]
261pub enum CreateFamilyError {
262    DefaultResponse(models::Errors),
263    UnknownValue(serde_json::Value),
264}
265
266/// struct for typed errors of method [`create_family_with_id`]
267#[derive(Debug, Clone, Serialize, Deserialize)]
268#[serde(untagged)]
269pub enum CreateFamilyWithIdError {
270    DefaultResponse(models::Errors),
271    UnknownValue(serde_json::Value),
272}
273
274/// struct for typed errors of method [`create_form`]
275#[derive(Debug, Clone, Serialize, Deserialize)]
276#[serde(untagged)]
277pub enum CreateFormError {
278    DefaultResponse(models::Errors),
279    UnknownValue(serde_json::Value),
280}
281
282/// struct for typed errors of method [`create_form_field`]
283#[derive(Debug, Clone, Serialize, Deserialize)]
284#[serde(untagged)]
285pub enum CreateFormFieldError {
286    DefaultResponse(models::Errors),
287    UnknownValue(serde_json::Value),
288}
289
290/// struct for typed errors of method [`create_form_field_with_id`]
291#[derive(Debug, Clone, Serialize, Deserialize)]
292#[serde(untagged)]
293pub enum CreateFormFieldWithIdError {
294    DefaultResponse(models::Errors),
295    UnknownValue(serde_json::Value),
296}
297
298/// struct for typed errors of method [`create_form_with_id`]
299#[derive(Debug, Clone, Serialize, Deserialize)]
300#[serde(untagged)]
301pub enum CreateFormWithIdError {
302    DefaultResponse(models::Errors),
303    UnknownValue(serde_json::Value),
304}
305
306/// struct for typed errors of method [`create_group`]
307#[derive(Debug, Clone, Serialize, Deserialize)]
308#[serde(untagged)]
309pub enum CreateGroupError {
310    DefaultResponse(models::Errors),
311    UnknownValue(serde_json::Value),
312}
313
314/// struct for typed errors of method [`create_group_members_with_id`]
315#[derive(Debug, Clone, Serialize, Deserialize)]
316#[serde(untagged)]
317pub enum CreateGroupMembersWithIdError {
318    DefaultResponse(models::Errors),
319    UnknownValue(serde_json::Value),
320}
321
322/// struct for typed errors of method [`create_group_with_id`]
323#[derive(Debug, Clone, Serialize, Deserialize)]
324#[serde(untagged)]
325pub enum CreateGroupWithIdError {
326    DefaultResponse(models::Errors),
327    UnknownValue(serde_json::Value),
328}
329
330/// struct for typed errors of method [`create_identity_provider`]
331#[derive(Debug, Clone, Serialize, Deserialize)]
332#[serde(untagged)]
333pub enum CreateIdentityProviderError {
334    DefaultResponse(models::Errors),
335    UnknownValue(serde_json::Value),
336}
337
338/// struct for typed errors of method [`create_identity_provider_with_id`]
339#[derive(Debug, Clone, Serialize, Deserialize)]
340#[serde(untagged)]
341pub enum CreateIdentityProviderWithIdError {
342    DefaultResponse(models::Errors),
343    UnknownValue(serde_json::Value),
344}
345
346/// struct for typed errors of method [`create_introspect`]
347#[derive(Debug, Clone, Serialize, Deserialize)]
348#[serde(untagged)]
349pub enum CreateIntrospectError {
350    DefaultResponse(models::OAuthError),
351    UnknownValue(serde_json::Value),
352}
353
354/// struct for typed errors of method [`create_ip_access_control_list`]
355#[derive(Debug, Clone, Serialize, Deserialize)]
356#[serde(untagged)]
357pub enum CreateIpAccessControlListError {
358    DefaultResponse(models::Errors),
359    UnknownValue(serde_json::Value),
360}
361
362/// struct for typed errors of method [`create_ip_access_control_list_with_id`]
363#[derive(Debug, Clone, Serialize, Deserialize)]
364#[serde(untagged)]
365pub enum CreateIpAccessControlListWithIdError {
366    DefaultResponse(models::Errors),
367    UnknownValue(serde_json::Value),
368}
369
370/// struct for typed errors of method [`create_lambda`]
371#[derive(Debug, Clone, Serialize, Deserialize)]
372#[serde(untagged)]
373pub enum CreateLambdaError {
374    DefaultResponse(models::Errors),
375    UnknownValue(serde_json::Value),
376}
377
378/// struct for typed errors of method [`create_lambda_with_id`]
379#[derive(Debug, Clone, Serialize, Deserialize)]
380#[serde(untagged)]
381pub enum CreateLambdaWithIdError {
382    DefaultResponse(models::Errors),
383    UnknownValue(serde_json::Value),
384}
385
386/// struct for typed errors of method [`create_logout`]
387#[derive(Debug, Clone, Serialize, Deserialize)]
388#[serde(untagged)]
389pub enum CreateLogoutError {
390    DefaultResponse(),
391    UnknownValue(serde_json::Value),
392}
393
394/// struct for typed errors of method [`create_message_template`]
395#[derive(Debug, Clone, Serialize, Deserialize)]
396#[serde(untagged)]
397pub enum CreateMessageTemplateError {
398    DefaultResponse(models::Errors),
399    UnknownValue(serde_json::Value),
400}
401
402/// struct for typed errors of method [`create_message_template_with_id`]
403#[derive(Debug, Clone, Serialize, Deserialize)]
404#[serde(untagged)]
405pub enum CreateMessageTemplateWithIdError {
406    DefaultResponse(models::Errors),
407    UnknownValue(serde_json::Value),
408}
409
410/// struct for typed errors of method [`create_messenger`]
411#[derive(Debug, Clone, Serialize, Deserialize)]
412#[serde(untagged)]
413pub enum CreateMessengerError {
414    DefaultResponse(models::Errors),
415    UnknownValue(serde_json::Value),
416}
417
418/// struct for typed errors of method [`create_messenger_with_id`]
419#[derive(Debug, Clone, Serialize, Deserialize)]
420#[serde(untagged)]
421pub enum CreateMessengerWithIdError {
422    DefaultResponse(models::Errors),
423    UnknownValue(serde_json::Value),
424}
425
426/// struct for typed errors of method [`create_o_auth_scope`]
427#[derive(Debug, Clone, Serialize, Deserialize)]
428#[serde(untagged)]
429pub enum CreateOAuthScopeError {
430    DefaultResponse(models::Errors),
431    UnknownValue(serde_json::Value),
432}
433
434/// struct for typed errors of method [`create_o_auth_scope_with_id`]
435#[derive(Debug, Clone, Serialize, Deserialize)]
436#[serde(untagged)]
437pub enum CreateOAuthScopeWithIdError {
438    DefaultResponse(models::Errors),
439    UnknownValue(serde_json::Value),
440}
441
442/// struct for typed errors of method [`create_tenant`]
443#[derive(Debug, Clone, Serialize, Deserialize)]
444#[serde(untagged)]
445pub enum CreateTenantError {
446    DefaultResponse(models::Errors),
447    UnknownValue(serde_json::Value),
448}
449
450/// struct for typed errors of method [`create_tenant_with_id`]
451#[derive(Debug, Clone, Serialize, Deserialize)]
452#[serde(untagged)]
453pub enum CreateTenantWithIdError {
454    DefaultResponse(models::Errors),
455    UnknownValue(serde_json::Value),
456}
457
458/// struct for typed errors of method [`create_theme`]
459#[derive(Debug, Clone, Serialize, Deserialize)]
460#[serde(untagged)]
461pub enum CreateThemeError {
462    DefaultResponse(models::Errors),
463    UnknownValue(serde_json::Value),
464}
465
466/// struct for typed errors of method [`create_theme_with_id`]
467#[derive(Debug, Clone, Serialize, Deserialize)]
468#[serde(untagged)]
469pub enum CreateThemeWithIdError {
470    DefaultResponse(models::Errors),
471    UnknownValue(serde_json::Value),
472}
473
474/// struct for typed errors of method [`create_token`]
475#[derive(Debug, Clone, Serialize, Deserialize)]
476#[serde(untagged)]
477pub enum CreateTokenError {
478    DefaultResponse(models::OAuthError),
479    UnknownValue(serde_json::Value),
480}
481
482/// struct for typed errors of method [`create_user`]
483#[derive(Debug, Clone, Serialize, Deserialize)]
484#[serde(untagged)]
485pub enum CreateUserError {
486    DefaultResponse(models::Errors),
487    UnknownValue(serde_json::Value),
488}
489
490/// struct for typed errors of method [`create_user_action`]
491#[derive(Debug, Clone, Serialize, Deserialize)]
492#[serde(untagged)]
493pub enum CreateUserActionError {
494    DefaultResponse(models::Errors),
495    UnknownValue(serde_json::Value),
496}
497
498/// struct for typed errors of method [`create_user_action_reason`]
499#[derive(Debug, Clone, Serialize, Deserialize)]
500#[serde(untagged)]
501pub enum CreateUserActionReasonError {
502    DefaultResponse(models::Errors),
503    UnknownValue(serde_json::Value),
504}
505
506/// struct for typed errors of method [`create_user_action_reason_with_id`]
507#[derive(Debug, Clone, Serialize, Deserialize)]
508#[serde(untagged)]
509pub enum CreateUserActionReasonWithIdError {
510    DefaultResponse(models::Errors),
511    UnknownValue(serde_json::Value),
512}
513
514/// struct for typed errors of method [`create_user_action_with_id`]
515#[derive(Debug, Clone, Serialize, Deserialize)]
516#[serde(untagged)]
517pub enum CreateUserActionWithIdError {
518    DefaultResponse(models::Errors),
519    UnknownValue(serde_json::Value),
520}
521
522/// struct for typed errors of method [`create_user_consent`]
523#[derive(Debug, Clone, Serialize, Deserialize)]
524#[serde(untagged)]
525pub enum CreateUserConsentError {
526    DefaultResponse(models::Errors),
527    UnknownValue(serde_json::Value),
528}
529
530/// struct for typed errors of method [`create_user_consent_with_id`]
531#[derive(Debug, Clone, Serialize, Deserialize)]
532#[serde(untagged)]
533pub enum CreateUserConsentWithIdError {
534    DefaultResponse(models::Errors),
535    UnknownValue(serde_json::Value),
536}
537
538/// struct for typed errors of method [`create_user_link_with_id`]
539#[derive(Debug, Clone, Serialize, Deserialize)]
540#[serde(untagged)]
541pub enum CreateUserLinkWithIdError {
542    DefaultResponse(models::Errors),
543    UnknownValue(serde_json::Value),
544}
545
546/// struct for typed errors of method [`create_user_verify_email`]
547#[derive(Debug, Clone, Serialize, Deserialize)]
548#[serde(untagged)]
549pub enum CreateUserVerifyEmailError {
550    DefaultResponse(models::Errors),
551    UnknownValue(serde_json::Value),
552}
553
554/// struct for typed errors of method [`create_user_with_id`]
555#[derive(Debug, Clone, Serialize, Deserialize)]
556#[serde(untagged)]
557pub enum CreateUserWithIdError {
558    DefaultResponse(models::Errors),
559    UnknownValue(serde_json::Value),
560}
561
562/// struct for typed errors of method [`create_webhook`]
563#[derive(Debug, Clone, Serialize, Deserialize)]
564#[serde(untagged)]
565pub enum CreateWebhookError {
566    DefaultResponse(models::Errors),
567    UnknownValue(serde_json::Value),
568}
569
570/// struct for typed errors of method [`create_webhook_with_id`]
571#[derive(Debug, Clone, Serialize, Deserialize)]
572#[serde(untagged)]
573pub enum CreateWebhookWithIdError {
574    DefaultResponse(models::Errors),
575    UnknownValue(serde_json::Value),
576}
577
578/// struct for typed errors of method [`delete_api_key_with_id`]
579#[derive(Debug, Clone, Serialize, Deserialize)]
580#[serde(untagged)]
581pub enum DeleteApiKeyWithIdError {
582    DefaultResponse(models::Errors),
583    UnknownValue(serde_json::Value),
584}
585
586/// struct for typed errors of method [`delete_application_role_with_id`]
587#[derive(Debug, Clone, Serialize, Deserialize)]
588#[serde(untagged)]
589pub enum DeleteApplicationRoleWithIdError {
590    DefaultResponse(models::Errors),
591    UnknownValue(serde_json::Value),
592}
593
594/// struct for typed errors of method [`delete_application_with_id`]
595#[derive(Debug, Clone, Serialize, Deserialize)]
596#[serde(untagged)]
597pub enum DeleteApplicationWithIdError {
598    DefaultResponse(models::Errors),
599    UnknownValue(serde_json::Value),
600}
601
602/// struct for typed errors of method [`delete_connector_with_id`]
603#[derive(Debug, Clone, Serialize, Deserialize)]
604#[serde(untagged)]
605pub enum DeleteConnectorWithIdError {
606    DefaultResponse(models::Errors),
607    UnknownValue(serde_json::Value),
608}
609
610/// struct for typed errors of method [`delete_consent_with_id`]
611#[derive(Debug, Clone, Serialize, Deserialize)]
612#[serde(untagged)]
613pub enum DeleteConsentWithIdError {
614    DefaultResponse(models::Errors),
615    UnknownValue(serde_json::Value),
616}
617
618/// struct for typed errors of method [`delete_email_template_with_id`]
619#[derive(Debug, Clone, Serialize, Deserialize)]
620#[serde(untagged)]
621pub enum DeleteEmailTemplateWithIdError {
622    DefaultResponse(models::Errors),
623    UnknownValue(serde_json::Value),
624}
625
626/// struct for typed errors of method [`delete_entity_grant_with_id`]
627#[derive(Debug, Clone, Serialize, Deserialize)]
628#[serde(untagged)]
629pub enum DeleteEntityGrantWithIdError {
630    DefaultResponse(models::Errors),
631    UnknownValue(serde_json::Value),
632}
633
634/// struct for typed errors of method [`delete_entity_type_permission_with_id`]
635#[derive(Debug, Clone, Serialize, Deserialize)]
636#[serde(untagged)]
637pub enum DeleteEntityTypePermissionWithIdError {
638    DefaultResponse(models::Errors),
639    UnknownValue(serde_json::Value),
640}
641
642/// struct for typed errors of method [`delete_entity_type_with_id`]
643#[derive(Debug, Clone, Serialize, Deserialize)]
644#[serde(untagged)]
645pub enum DeleteEntityTypeWithIdError {
646    DefaultResponse(models::Errors),
647    UnknownValue(serde_json::Value),
648}
649
650/// struct for typed errors of method [`delete_entity_with_id`]
651#[derive(Debug, Clone, Serialize, Deserialize)]
652#[serde(untagged)]
653pub enum DeleteEntityWithIdError {
654    DefaultResponse(models::Errors),
655    UnknownValue(serde_json::Value),
656}
657
658/// struct for typed errors of method [`delete_form_field_with_id`]
659#[derive(Debug, Clone, Serialize, Deserialize)]
660#[serde(untagged)]
661pub enum DeleteFormFieldWithIdError {
662    DefaultResponse(models::Errors),
663    UnknownValue(serde_json::Value),
664}
665
666/// struct for typed errors of method [`delete_form_with_id`]
667#[derive(Debug, Clone, Serialize, Deserialize)]
668#[serde(untagged)]
669pub enum DeleteFormWithIdError {
670    DefaultResponse(models::Errors),
671    UnknownValue(serde_json::Value),
672}
673
674/// struct for typed errors of method [`delete_group_members_with_id`]
675#[derive(Debug, Clone, Serialize, Deserialize)]
676#[serde(untagged)]
677pub enum DeleteGroupMembersWithIdError {
678    DefaultResponse(models::Errors),
679    UnknownValue(serde_json::Value),
680}
681
682/// struct for typed errors of method [`delete_group_with_id`]
683#[derive(Debug, Clone, Serialize, Deserialize)]
684#[serde(untagged)]
685pub enum DeleteGroupWithIdError {
686    DefaultResponse(models::Errors),
687    UnknownValue(serde_json::Value),
688}
689
690/// struct for typed errors of method [`delete_identity_provider_with_id`]
691#[derive(Debug, Clone, Serialize, Deserialize)]
692#[serde(untagged)]
693pub enum DeleteIdentityProviderWithIdError {
694    DefaultResponse(models::Errors),
695    UnknownValue(serde_json::Value),
696}
697
698/// struct for typed errors of method [`delete_ip_access_control_list_with_id`]
699#[derive(Debug, Clone, Serialize, Deserialize)]
700#[serde(untagged)]
701pub enum DeleteIpAccessControlListWithIdError {
702    DefaultResponse(models::Errors),
703    UnknownValue(serde_json::Value),
704}
705
706/// struct for typed errors of method [`delete_jwt_refresh`]
707#[derive(Debug, Clone, Serialize, Deserialize)]
708#[serde(untagged)]
709pub enum DeleteJwtRefreshError {
710    DefaultResponse(models::Errors),
711    UnknownValue(serde_json::Value),
712}
713
714/// struct for typed errors of method [`delete_key_with_id`]
715#[derive(Debug, Clone, Serialize, Deserialize)]
716#[serde(untagged)]
717pub enum DeleteKeyWithIdError {
718    DefaultResponse(models::Errors),
719    UnknownValue(serde_json::Value),
720}
721
722/// struct for typed errors of method [`delete_lambda_with_id`]
723#[derive(Debug, Clone, Serialize, Deserialize)]
724#[serde(untagged)]
725pub enum DeleteLambdaWithIdError {
726    DefaultResponse(models::Errors),
727    UnknownValue(serde_json::Value),
728}
729
730/// struct for typed errors of method [`delete_message_template_with_id`]
731#[derive(Debug, Clone, Serialize, Deserialize)]
732#[serde(untagged)]
733pub enum DeleteMessageTemplateWithIdError {
734    DefaultResponse(models::Errors),
735    UnknownValue(serde_json::Value),
736}
737
738/// struct for typed errors of method [`delete_messenger_with_id`]
739#[derive(Debug, Clone, Serialize, Deserialize)]
740#[serde(untagged)]
741pub enum DeleteMessengerWithIdError {
742    DefaultResponse(models::Errors),
743    UnknownValue(serde_json::Value),
744}
745
746/// struct for typed errors of method [`delete_o_auth_scope_with_id`]
747#[derive(Debug, Clone, Serialize, Deserialize)]
748#[serde(untagged)]
749pub enum DeleteOAuthScopeWithIdError {
750    DefaultResponse(models::Errors),
751    UnknownValue(serde_json::Value),
752}
753
754/// struct for typed errors of method [`delete_tenant_with_id`]
755#[derive(Debug, Clone, Serialize, Deserialize)]
756#[serde(untagged)]
757pub enum DeleteTenantWithIdError {
758    DefaultResponse(models::Errors),
759    UnknownValue(serde_json::Value),
760}
761
762/// struct for typed errors of method [`delete_theme_with_id`]
763#[derive(Debug, Clone, Serialize, Deserialize)]
764#[serde(untagged)]
765pub enum DeleteThemeWithIdError {
766    DefaultResponse(models::Errors),
767    UnknownValue(serde_json::Value),
768}
769
770/// struct for typed errors of method [`delete_user_action_reason_with_id`]
771#[derive(Debug, Clone, Serialize, Deserialize)]
772#[serde(untagged)]
773pub enum DeleteUserActionReasonWithIdError {
774    DefaultResponse(models::Errors),
775    UnknownValue(serde_json::Value),
776}
777
778/// struct for typed errors of method [`delete_user_action_with_id`]
779#[derive(Debug, Clone, Serialize, Deserialize)]
780#[serde(untagged)]
781pub enum DeleteUserActionWithIdError {
782    DefaultResponse(models::Errors),
783    UnknownValue(serde_json::Value),
784}
785
786/// struct for typed errors of method [`delete_user_bulk`]
787#[derive(Debug, Clone, Serialize, Deserialize)]
788#[serde(untagged)]
789pub enum DeleteUserBulkError {
790    DefaultResponse(models::Errors),
791    UnknownValue(serde_json::Value),
792}
793
794/// struct for typed errors of method [`delete_user_link_with_id`]
795#[derive(Debug, Clone, Serialize, Deserialize)]
796#[serde(untagged)]
797pub enum DeleteUserLinkWithIdError {
798    DefaultResponse(models::Errors),
799    UnknownValue(serde_json::Value),
800}
801
802/// struct for typed errors of method [`delete_user_registration_with_id`]
803#[derive(Debug, Clone, Serialize, Deserialize)]
804#[serde(untagged)]
805pub enum DeleteUserRegistrationWithIdError {
806    DefaultResponse(models::Errors),
807    UnknownValue(serde_json::Value),
808}
809
810/// struct for typed errors of method [`delete_user_two_factor_with_id`]
811#[derive(Debug, Clone, Serialize, Deserialize)]
812#[serde(untagged)]
813pub enum DeleteUserTwoFactorWithIdError {
814    DefaultResponse(models::Errors),
815    UnknownValue(serde_json::Value),
816}
817
818/// struct for typed errors of method [`delete_user_with_id`]
819#[derive(Debug, Clone, Serialize, Deserialize)]
820#[serde(untagged)]
821pub enum DeleteUserWithIdError {
822    DefaultResponse(models::Errors),
823    UnknownValue(serde_json::Value),
824}
825
826/// struct for typed errors of method [`delete_web_authn_credential_with_id`]
827#[derive(Debug, Clone, Serialize, Deserialize)]
828#[serde(untagged)]
829pub enum DeleteWebAuthnCredentialWithIdError {
830    DefaultResponse(models::Errors),
831    UnknownValue(serde_json::Value),
832}
833
834/// struct for typed errors of method [`delete_webhook_with_id`]
835#[derive(Debug, Clone, Serialize, Deserialize)]
836#[serde(untagged)]
837pub enum DeleteWebhookWithIdError {
838    DefaultResponse(models::Errors),
839    UnknownValue(serde_json::Value),
840}
841
842/// struct for typed errors of method [`enable_two_factor_with_id`]
843#[derive(Debug, Clone, Serialize, Deserialize)]
844#[serde(untagged)]
845pub enum EnableTwoFactorWithIdError {
846    DefaultResponse(models::Errors),
847    UnknownValue(serde_json::Value),
848}
849
850/// struct for typed errors of method [`exchange_refresh_token_for_jwt_with_id`]
851#[derive(Debug, Clone, Serialize, Deserialize)]
852#[serde(untagged)]
853pub enum ExchangeRefreshTokenForJwtWithIdError {
854    DefaultResponse(models::Errors),
855    UnknownValue(serde_json::Value),
856}
857
858/// struct for typed errors of method [`forgot_password_with_id`]
859#[derive(Debug, Clone, Serialize, Deserialize)]
860#[serde(untagged)]
861pub enum ForgotPasswordWithIdError {
862    DefaultResponse(models::Errors),
863    UnknownValue(serde_json::Value),
864}
865
866/// struct for typed errors of method [`generate_key`]
867#[derive(Debug, Clone, Serialize, Deserialize)]
868#[serde(untagged)]
869pub enum GenerateKeyError {
870    DefaultResponse(models::Errors),
871    UnknownValue(serde_json::Value),
872}
873
874/// struct for typed errors of method [`generate_key_with_id`]
875#[derive(Debug, Clone, Serialize, Deserialize)]
876#[serde(untagged)]
877pub enum GenerateKeyWithIdError {
878    DefaultResponse(models::Errors),
879    UnknownValue(serde_json::Value),
880}
881
882/// struct for typed errors of method [`generate_two_factor_recovery_codes_with_id`]
883#[derive(Debug, Clone, Serialize, Deserialize)]
884#[serde(untagged)]
885pub enum GenerateTwoFactorRecoveryCodesWithIdError {
886    DefaultResponse(models::Errors),
887    UnknownValue(serde_json::Value),
888}
889
890/// struct for typed errors of method [`generate_two_factor_secret_using_jwt_with_id`]
891#[derive(Debug, Clone, Serialize, Deserialize)]
892#[serde(untagged)]
893pub enum GenerateTwoFactorSecretUsingJwtWithIdError {
894    DefaultResponse(),
895    UnknownValue(serde_json::Value),
896}
897
898/// struct for typed errors of method [`identity_provider_login_with_id`]
899#[derive(Debug, Clone, Serialize, Deserialize)]
900#[serde(untagged)]
901pub enum IdentityProviderLoginWithIdError {
902    DefaultResponse(models::Errors),
903    UnknownValue(serde_json::Value),
904}
905
906/// struct for typed errors of method [`import_key`]
907#[derive(Debug, Clone, Serialize, Deserialize)]
908#[serde(untagged)]
909pub enum ImportKeyError {
910    DefaultResponse(models::Errors),
911    UnknownValue(serde_json::Value),
912}
913
914/// struct for typed errors of method [`import_key_with_id`]
915#[derive(Debug, Clone, Serialize, Deserialize)]
916#[serde(untagged)]
917pub enum ImportKeyWithIdError {
918    DefaultResponse(models::Errors),
919    UnknownValue(serde_json::Value),
920}
921
922/// struct for typed errors of method [`import_refresh_tokens_with_id`]
923#[derive(Debug, Clone, Serialize, Deserialize)]
924#[serde(untagged)]
925pub enum ImportRefreshTokensWithIdError {
926    DefaultResponse(models::Errors),
927    UnknownValue(serde_json::Value),
928}
929
930/// struct for typed errors of method [`import_users_with_id`]
931#[derive(Debug, Clone, Serialize, Deserialize)]
932#[serde(untagged)]
933pub enum ImportUsersWithIdError {
934    DefaultResponse(models::Errors),
935    UnknownValue(serde_json::Value),
936}
937
938/// struct for typed errors of method [`import_web_authn_credential_with_id`]
939#[derive(Debug, Clone, Serialize, Deserialize)]
940#[serde(untagged)]
941pub enum ImportWebAuthnCredentialWithIdError {
942    DefaultResponse(models::Errors),
943    UnknownValue(serde_json::Value),
944}
945
946/// struct for typed errors of method [`issue_jwt_with_id`]
947#[derive(Debug, Clone, Serialize, Deserialize)]
948#[serde(untagged)]
949pub enum IssueJwtWithIdError {
950    DefaultResponse(models::Errors),
951    UnknownValue(serde_json::Value),
952}
953
954/// struct for typed errors of method [`login_ping_with_id`]
955#[derive(Debug, Clone, Serialize, Deserialize)]
956#[serde(untagged)]
957pub enum LoginPingWithIdError {
958    DefaultResponse(models::Errors),
959    UnknownValue(serde_json::Value),
960}
961
962/// struct for typed errors of method [`login_ping_with_request_with_id`]
963#[derive(Debug, Clone, Serialize, Deserialize)]
964#[serde(untagged)]
965pub enum LoginPingWithRequestWithIdError {
966    DefaultResponse(models::Errors),
967    UnknownValue(serde_json::Value),
968}
969
970/// struct for typed errors of method [`login_with_id`]
971#[derive(Debug, Clone, Serialize, Deserialize)]
972#[serde(untagged)]
973pub enum LoginWithIdError {
974    DefaultResponse(models::Errors),
975    UnknownValue(serde_json::Value),
976}
977
978/// struct for typed errors of method [`lookup_identity_provider_with_id`]
979#[derive(Debug, Clone, Serialize, Deserialize)]
980#[serde(untagged)]
981pub enum LookupIdentityProviderWithIdError {
982    DefaultResponse(),
983    UnknownValue(serde_json::Value),
984}
985
986/// struct for typed errors of method [`modify_action_with_id`]
987#[derive(Debug, Clone, Serialize, Deserialize)]
988#[serde(untagged)]
989pub enum ModifyActionWithIdError {
990    DefaultResponse(models::Errors),
991    UnknownValue(serde_json::Value),
992}
993
994/// struct for typed errors of method [`passwordless_login_with_id`]
995#[derive(Debug, Clone, Serialize, Deserialize)]
996#[serde(untagged)]
997pub enum PasswordlessLoginWithIdError {
998    DefaultResponse(models::Errors),
999    UnknownValue(serde_json::Value),
1000}
1001
1002/// struct for typed errors of method [`patch_application_role_with_id`]
1003#[derive(Debug, Clone, Serialize, Deserialize)]
1004#[serde(untagged)]
1005pub enum PatchApplicationRoleWithIdError {
1006    DefaultResponse(models::Errors),
1007    UnknownValue(serde_json::Value),
1008}
1009
1010/// struct for typed errors of method [`patch_application_with_id`]
1011#[derive(Debug, Clone, Serialize, Deserialize)]
1012#[serde(untagged)]
1013pub enum PatchApplicationWithIdError {
1014    DefaultResponse(models::Errors),
1015    UnknownValue(serde_json::Value),
1016}
1017
1018/// struct for typed errors of method [`patch_connector_with_id`]
1019#[derive(Debug, Clone, Serialize, Deserialize)]
1020#[serde(untagged)]
1021pub enum PatchConnectorWithIdError {
1022    DefaultResponse(models::Errors),
1023    UnknownValue(serde_json::Value),
1024}
1025
1026/// struct for typed errors of method [`patch_consent_with_id`]
1027#[derive(Debug, Clone, Serialize, Deserialize)]
1028#[serde(untagged)]
1029pub enum PatchConsentWithIdError {
1030    DefaultResponse(models::Errors),
1031    UnknownValue(serde_json::Value),
1032}
1033
1034/// struct for typed errors of method [`patch_email_template_with_id`]
1035#[derive(Debug, Clone, Serialize, Deserialize)]
1036#[serde(untagged)]
1037pub enum PatchEmailTemplateWithIdError {
1038    DefaultResponse(models::Errors),
1039    UnknownValue(serde_json::Value),
1040}
1041
1042/// struct for typed errors of method [`patch_entity_type_permission_with_id`]
1043#[derive(Debug, Clone, Serialize, Deserialize)]
1044#[serde(untagged)]
1045pub enum PatchEntityTypePermissionWithIdError {
1046    DefaultResponse(models::Errors),
1047    UnknownValue(serde_json::Value),
1048}
1049
1050/// struct for typed errors of method [`patch_entity_type_with_id`]
1051#[derive(Debug, Clone, Serialize, Deserialize)]
1052#[serde(untagged)]
1053pub enum PatchEntityTypeWithIdError {
1054    DefaultResponse(models::Errors),
1055    UnknownValue(serde_json::Value),
1056}
1057
1058/// struct for typed errors of method [`patch_entity_with_id`]
1059#[derive(Debug, Clone, Serialize, Deserialize)]
1060#[serde(untagged)]
1061pub enum PatchEntityWithIdError {
1062    DefaultResponse(models::Errors),
1063    UnknownValue(serde_json::Value),
1064}
1065
1066/// struct for typed errors of method [`patch_form_field_with_id`]
1067#[derive(Debug, Clone, Serialize, Deserialize)]
1068#[serde(untagged)]
1069pub enum PatchFormFieldWithIdError {
1070    DefaultResponse(models::Errors),
1071    UnknownValue(serde_json::Value),
1072}
1073
1074/// struct for typed errors of method [`patch_form_with_id`]
1075#[derive(Debug, Clone, Serialize, Deserialize)]
1076#[serde(untagged)]
1077pub enum PatchFormWithIdError {
1078    DefaultResponse(models::Errors),
1079    UnknownValue(serde_json::Value),
1080}
1081
1082/// struct for typed errors of method [`patch_group_with_id`]
1083#[derive(Debug, Clone, Serialize, Deserialize)]
1084#[serde(untagged)]
1085pub enum PatchGroupWithIdError {
1086    DefaultResponse(models::Errors),
1087    UnknownValue(serde_json::Value),
1088}
1089
1090/// struct for typed errors of method [`patch_identity_provider_with_id`]
1091#[derive(Debug, Clone, Serialize, Deserialize)]
1092#[serde(untagged)]
1093pub enum PatchIdentityProviderWithIdError {
1094    DefaultResponse(models::Errors),
1095    UnknownValue(serde_json::Value),
1096}
1097
1098/// struct for typed errors of method [`patch_integrations_with_id`]
1099#[derive(Debug, Clone, Serialize, Deserialize)]
1100#[serde(untagged)]
1101pub enum PatchIntegrationsWithIdError {
1102    DefaultResponse(models::Errors),
1103    UnknownValue(serde_json::Value),
1104}
1105
1106/// struct for typed errors of method [`patch_ip_access_control_list_with_id`]
1107#[derive(Debug, Clone, Serialize, Deserialize)]
1108#[serde(untagged)]
1109pub enum PatchIpAccessControlListWithIdError {
1110    DefaultResponse(models::Errors),
1111    UnknownValue(serde_json::Value),
1112}
1113
1114/// struct for typed errors of method [`patch_lambda_with_id`]
1115#[derive(Debug, Clone, Serialize, Deserialize)]
1116#[serde(untagged)]
1117pub enum PatchLambdaWithIdError {
1118    DefaultResponse(models::Errors),
1119    UnknownValue(serde_json::Value),
1120}
1121
1122/// struct for typed errors of method [`patch_message_template_with_id`]
1123#[derive(Debug, Clone, Serialize, Deserialize)]
1124#[serde(untagged)]
1125pub enum PatchMessageTemplateWithIdError {
1126    DefaultResponse(models::Errors),
1127    UnknownValue(serde_json::Value),
1128}
1129
1130/// struct for typed errors of method [`patch_messenger_with_id`]
1131#[derive(Debug, Clone, Serialize, Deserialize)]
1132#[serde(untagged)]
1133pub enum PatchMessengerWithIdError {
1134    DefaultResponse(models::Errors),
1135    UnknownValue(serde_json::Value),
1136}
1137
1138/// struct for typed errors of method [`patch_o_auth_scope_with_id`]
1139#[derive(Debug, Clone, Serialize, Deserialize)]
1140#[serde(untagged)]
1141pub enum PatchOAuthScopeWithIdError {
1142    DefaultResponse(models::Errors),
1143    UnknownValue(serde_json::Value),
1144}
1145
1146/// struct for typed errors of method [`patch_registration_with_id`]
1147#[derive(Debug, Clone, Serialize, Deserialize)]
1148#[serde(untagged)]
1149pub enum PatchRegistrationWithIdError {
1150    DefaultResponse(models::Errors),
1151    UnknownValue(serde_json::Value),
1152}
1153
1154/// struct for typed errors of method [`patch_system_configuration_with_id`]
1155#[derive(Debug, Clone, Serialize, Deserialize)]
1156#[serde(untagged)]
1157pub enum PatchSystemConfigurationWithIdError {
1158    DefaultResponse(models::Errors),
1159    UnknownValue(serde_json::Value),
1160}
1161
1162/// struct for typed errors of method [`patch_tenant_with_id`]
1163#[derive(Debug, Clone, Serialize, Deserialize)]
1164#[serde(untagged)]
1165pub enum PatchTenantWithIdError {
1166    DefaultResponse(models::Errors),
1167    UnknownValue(serde_json::Value),
1168}
1169
1170/// struct for typed errors of method [`patch_theme_with_id`]
1171#[derive(Debug, Clone, Serialize, Deserialize)]
1172#[serde(untagged)]
1173pub enum PatchThemeWithIdError {
1174    DefaultResponse(models::Errors),
1175    UnknownValue(serde_json::Value),
1176}
1177
1178/// struct for typed errors of method [`patch_user_action_reason_with_id`]
1179#[derive(Debug, Clone, Serialize, Deserialize)]
1180#[serde(untagged)]
1181pub enum PatchUserActionReasonWithIdError {
1182    DefaultResponse(models::Errors),
1183    UnknownValue(serde_json::Value),
1184}
1185
1186/// struct for typed errors of method [`patch_user_action_with_id`]
1187#[derive(Debug, Clone, Serialize, Deserialize)]
1188#[serde(untagged)]
1189pub enum PatchUserActionWithIdError {
1190    DefaultResponse(models::Errors),
1191    UnknownValue(serde_json::Value),
1192}
1193
1194/// struct for typed errors of method [`patch_user_consent_with_id`]
1195#[derive(Debug, Clone, Serialize, Deserialize)]
1196#[serde(untagged)]
1197pub enum PatchUserConsentWithIdError {
1198    DefaultResponse(models::Errors),
1199    UnknownValue(serde_json::Value),
1200}
1201
1202/// struct for typed errors of method [`patch_user_with_id`]
1203#[derive(Debug, Clone, Serialize, Deserialize)]
1204#[serde(untagged)]
1205pub enum PatchUserWithIdError {
1206    DefaultResponse(models::Errors),
1207    UnknownValue(serde_json::Value),
1208}
1209
1210/// struct for typed errors of method [`patch_webhook_with_id`]
1211#[derive(Debug, Clone, Serialize, Deserialize)]
1212#[serde(untagged)]
1213pub enum PatchWebhookWithIdError {
1214    DefaultResponse(models::Errors),
1215    UnknownValue(serde_json::Value),
1216}
1217
1218/// struct for typed errors of method [`reconcile_jwt_with_id`]
1219#[derive(Debug, Clone, Serialize, Deserialize)]
1220#[serde(untagged)]
1221pub enum ReconcileJwtWithIdError {
1222    DefaultResponse(models::Errors),
1223    UnknownValue(serde_json::Value),
1224}
1225
1226/// struct for typed errors of method [`register`]
1227#[derive(Debug, Clone, Serialize, Deserialize)]
1228#[serde(untagged)]
1229pub enum RegisterError {
1230    DefaultResponse(models::Errors),
1231    UnknownValue(serde_json::Value),
1232}
1233
1234/// struct for typed errors of method [`register_with_id`]
1235#[derive(Debug, Clone, Serialize, Deserialize)]
1236#[serde(untagged)]
1237pub enum RegisterWithIdError {
1238    DefaultResponse(models::Errors),
1239    UnknownValue(serde_json::Value),
1240}
1241
1242/// struct for typed errors of method [`reindex_with_id`]
1243#[derive(Debug, Clone, Serialize, Deserialize)]
1244#[serde(untagged)]
1245pub enum ReindexWithIdError {
1246    DefaultResponse(models::Errors),
1247    UnknownValue(serde_json::Value),
1248}
1249
1250/// struct for typed errors of method [`remove_user_from_family_with_id`]
1251#[derive(Debug, Clone, Serialize, Deserialize)]
1252#[serde(untagged)]
1253pub enum RemoveUserFromFamilyWithIdError {
1254    DefaultResponse(models::Errors),
1255    UnknownValue(serde_json::Value),
1256}
1257
1258/// struct for typed errors of method [`retrieve_action_with_id`]
1259#[derive(Debug, Clone, Serialize, Deserialize)]
1260#[serde(untagged)]
1261pub enum RetrieveActionWithIdError {
1262    DefaultResponse(models::Errors),
1263    UnknownValue(serde_json::Value),
1264}
1265
1266/// struct for typed errors of method [`retrieve_api_key_with_id`]
1267#[derive(Debug, Clone, Serialize, Deserialize)]
1268#[serde(untagged)]
1269pub enum RetrieveApiKeyWithIdError {
1270    DefaultResponse(models::Errors),
1271    UnknownValue(serde_json::Value),
1272}
1273
1274/// struct for typed errors of method [`retrieve_application`]
1275#[derive(Debug, Clone, Serialize, Deserialize)]
1276#[serde(untagged)]
1277pub enum RetrieveApplicationError {
1278    DefaultResponse(),
1279    UnknownValue(serde_json::Value),
1280}
1281
1282/// struct for typed errors of method [`retrieve_application_with_id`]
1283#[derive(Debug, Clone, Serialize, Deserialize)]
1284#[serde(untagged)]
1285pub enum RetrieveApplicationWithIdError {
1286    DefaultResponse(),
1287    UnknownValue(serde_json::Value),
1288}
1289
1290/// struct for typed errors of method [`retrieve_audit_log_with_id`]
1291#[derive(Debug, Clone, Serialize, Deserialize)]
1292#[serde(untagged)]
1293pub enum RetrieveAuditLogWithIdError {
1294    DefaultResponse(models::Errors),
1295    UnknownValue(serde_json::Value),
1296}
1297
1298/// struct for typed errors of method [`retrieve_connector_with_id`]
1299#[derive(Debug, Clone, Serialize, Deserialize)]
1300#[serde(untagged)]
1301pub enum RetrieveConnectorWithIdError {
1302    DefaultResponse(),
1303    UnknownValue(serde_json::Value),
1304}
1305
1306/// struct for typed errors of method [`retrieve_consent_with_id`]
1307#[derive(Debug, Clone, Serialize, Deserialize)]
1308#[serde(untagged)]
1309pub enum RetrieveConsentWithIdError {
1310    DefaultResponse(),
1311    UnknownValue(serde_json::Value),
1312}
1313
1314/// struct for typed errors of method [`retrieve_daily_active_report_with_id`]
1315#[derive(Debug, Clone, Serialize, Deserialize)]
1316#[serde(untagged)]
1317pub enum RetrieveDailyActiveReportWithIdError {
1318    DefaultResponse(models::Errors),
1319    UnknownValue(serde_json::Value),
1320}
1321
1322/// struct for typed errors of method [`retrieve_device_user_code`]
1323#[derive(Debug, Clone, Serialize, Deserialize)]
1324#[serde(untagged)]
1325pub enum RetrieveDeviceUserCodeError {
1326    DefaultResponse(),
1327    UnknownValue(serde_json::Value),
1328}
1329
1330/// struct for typed errors of method [`retrieve_email_template`]
1331#[derive(Debug, Clone, Serialize, Deserialize)]
1332#[serde(untagged)]
1333pub enum RetrieveEmailTemplateError {
1334    DefaultResponse(),
1335    UnknownValue(serde_json::Value),
1336}
1337
1338/// struct for typed errors of method [`retrieve_email_template_preview_with_id`]
1339#[derive(Debug, Clone, Serialize, Deserialize)]
1340#[serde(untagged)]
1341pub enum RetrieveEmailTemplatePreviewWithIdError {
1342    DefaultResponse(models::Errors),
1343    UnknownValue(serde_json::Value),
1344}
1345
1346/// struct for typed errors of method [`retrieve_email_template_with_id`]
1347#[derive(Debug, Clone, Serialize, Deserialize)]
1348#[serde(untagged)]
1349pub enum RetrieveEmailTemplateWithIdError {
1350    DefaultResponse(),
1351    UnknownValue(serde_json::Value),
1352}
1353
1354/// struct for typed errors of method [`retrieve_entity_grant_with_id`]
1355#[derive(Debug, Clone, Serialize, Deserialize)]
1356#[serde(untagged)]
1357pub enum RetrieveEntityGrantWithIdError {
1358    DefaultResponse(models::Errors),
1359    UnknownValue(serde_json::Value),
1360}
1361
1362/// struct for typed errors of method [`retrieve_entity_type_with_id`]
1363#[derive(Debug, Clone, Serialize, Deserialize)]
1364#[serde(untagged)]
1365pub enum RetrieveEntityTypeWithIdError {
1366    DefaultResponse(models::Errors),
1367    UnknownValue(serde_json::Value),
1368}
1369
1370/// struct for typed errors of method [`retrieve_entity_with_id`]
1371#[derive(Debug, Clone, Serialize, Deserialize)]
1372#[serde(untagged)]
1373pub enum RetrieveEntityWithIdError {
1374    DefaultResponse(models::Errors),
1375    UnknownValue(serde_json::Value),
1376}
1377
1378/// struct for typed errors of method [`retrieve_event_log_with_id`]
1379#[derive(Debug, Clone, Serialize, Deserialize)]
1380#[serde(untagged)]
1381pub enum RetrieveEventLogWithIdError {
1382    DefaultResponse(models::Errors),
1383    UnknownValue(serde_json::Value),
1384}
1385
1386/// struct for typed errors of method [`retrieve_families_with_id`]
1387#[derive(Debug, Clone, Serialize, Deserialize)]
1388#[serde(untagged)]
1389pub enum RetrieveFamiliesWithIdError {
1390    DefaultResponse(),
1391    UnknownValue(serde_json::Value),
1392}
1393
1394/// struct for typed errors of method [`retrieve_family_members_by_family_id_with_id`]
1395#[derive(Debug, Clone, Serialize, Deserialize)]
1396#[serde(untagged)]
1397pub enum RetrieveFamilyMembersByFamilyIdWithIdError {
1398    DefaultResponse(),
1399    UnknownValue(serde_json::Value),
1400}
1401
1402/// struct for typed errors of method [`retrieve_form_field_with_id`]
1403#[derive(Debug, Clone, Serialize, Deserialize)]
1404#[serde(untagged)]
1405pub enum RetrieveFormFieldWithIdError {
1406    DefaultResponse(),
1407    UnknownValue(serde_json::Value),
1408}
1409
1410/// struct for typed errors of method [`retrieve_form_with_id`]
1411#[derive(Debug, Clone, Serialize, Deserialize)]
1412#[serde(untagged)]
1413pub enum RetrieveFormWithIdError {
1414    DefaultResponse(),
1415    UnknownValue(serde_json::Value),
1416}
1417
1418/// struct for typed errors of method [`retrieve_group_with_id`]
1419#[derive(Debug, Clone, Serialize, Deserialize)]
1420#[serde(untagged)]
1421pub enum RetrieveGroupWithIdError {
1422    DefaultResponse(models::Errors),
1423    UnknownValue(serde_json::Value),
1424}
1425
1426/// struct for typed errors of method [`retrieve_identity_provider_by_type_with_id`]
1427#[derive(Debug, Clone, Serialize, Deserialize)]
1428#[serde(untagged)]
1429pub enum RetrieveIdentityProviderByTypeWithIdError {
1430    DefaultResponse(models::Errors),
1431    UnknownValue(serde_json::Value),
1432}
1433
1434/// struct for typed errors of method [`retrieve_identity_provider_link`]
1435#[derive(Debug, Clone, Serialize, Deserialize)]
1436#[serde(untagged)]
1437pub enum RetrieveIdentityProviderLinkError {
1438    DefaultResponse(models::Errors),
1439    UnknownValue(serde_json::Value),
1440}
1441
1442/// struct for typed errors of method [`retrieve_identity_provider_with_id`]
1443#[derive(Debug, Clone, Serialize, Deserialize)]
1444#[serde(untagged)]
1445pub enum RetrieveIdentityProviderWithIdError {
1446    DefaultResponse(models::Errors),
1447    UnknownValue(serde_json::Value),
1448}
1449
1450/// struct for typed errors of method [`retrieve_ip_access_control_list_with_id`]
1451#[derive(Debug, Clone, Serialize, Deserialize)]
1452#[serde(untagged)]
1453pub enum RetrieveIpAccessControlListWithIdError {
1454    DefaultResponse(),
1455    UnknownValue(serde_json::Value),
1456}
1457
1458/// struct for typed errors of method [`retrieve_json_web_key_set_with_id`]
1459#[derive(Debug, Clone, Serialize, Deserialize)]
1460#[serde(untagged)]
1461pub enum RetrieveJsonWebKeySetWithIdError {
1462    DefaultResponse(),
1463    UnknownValue(serde_json::Value),
1464}
1465
1466/// struct for typed errors of method [`retrieve_jwt_public_key`]
1467#[derive(Debug, Clone, Serialize, Deserialize)]
1468#[serde(untagged)]
1469pub enum RetrieveJwtPublicKeyError {
1470    DefaultResponse(),
1471    UnknownValue(serde_json::Value),
1472}
1473
1474/// struct for typed errors of method [`retrieve_key_with_id`]
1475#[derive(Debug, Clone, Serialize, Deserialize)]
1476#[serde(untagged)]
1477pub enum RetrieveKeyWithIdError {
1478    DefaultResponse(models::Errors),
1479    UnknownValue(serde_json::Value),
1480}
1481
1482/// struct for typed errors of method [`retrieve_keys_with_id`]
1483#[derive(Debug, Clone, Serialize, Deserialize)]
1484#[serde(untagged)]
1485pub enum RetrieveKeysWithIdError {
1486    DefaultResponse(),
1487    UnknownValue(serde_json::Value),
1488}
1489
1490/// struct for typed errors of method [`retrieve_lambda_with_id`]
1491#[derive(Debug, Clone, Serialize, Deserialize)]
1492#[serde(untagged)]
1493pub enum RetrieveLambdaWithIdError {
1494    DefaultResponse(models::Errors),
1495    UnknownValue(serde_json::Value),
1496}
1497
1498/// struct for typed errors of method [`retrieve_lambdas_by_type_with_id`]
1499#[derive(Debug, Clone, Serialize, Deserialize)]
1500#[serde(untagged)]
1501pub enum RetrieveLambdasByTypeWithIdError {
1502    DefaultResponse(),
1503    UnknownValue(serde_json::Value),
1504}
1505
1506/// struct for typed errors of method [`retrieve_message_template`]
1507#[derive(Debug, Clone, Serialize, Deserialize)]
1508#[serde(untagged)]
1509pub enum RetrieveMessageTemplateError {
1510    DefaultResponse(),
1511    UnknownValue(serde_json::Value),
1512}
1513
1514/// struct for typed errors of method [`retrieve_message_template_preview_with_id`]
1515#[derive(Debug, Clone, Serialize, Deserialize)]
1516#[serde(untagged)]
1517pub enum RetrieveMessageTemplatePreviewWithIdError {
1518    DefaultResponse(models::Errors),
1519    UnknownValue(serde_json::Value),
1520}
1521
1522/// struct for typed errors of method [`retrieve_message_template_with_id`]
1523#[derive(Debug, Clone, Serialize, Deserialize)]
1524#[serde(untagged)]
1525pub enum RetrieveMessageTemplateWithIdError {
1526    DefaultResponse(),
1527    UnknownValue(serde_json::Value),
1528}
1529
1530/// struct for typed errors of method [`retrieve_messenger_with_id`]
1531#[derive(Debug, Clone, Serialize, Deserialize)]
1532#[serde(untagged)]
1533pub enum RetrieveMessengerWithIdError {
1534    DefaultResponse(),
1535    UnknownValue(serde_json::Value),
1536}
1537
1538/// struct for typed errors of method [`retrieve_monthly_active_report_with_id`]
1539#[derive(Debug, Clone, Serialize, Deserialize)]
1540#[serde(untagged)]
1541pub enum RetrieveMonthlyActiveReportWithIdError {
1542    DefaultResponse(models::Errors),
1543    UnknownValue(serde_json::Value),
1544}
1545
1546/// struct for typed errors of method [`retrieve_o_auth_scope_with_id`]
1547#[derive(Debug, Clone, Serialize, Deserialize)]
1548#[serde(untagged)]
1549pub enum RetrieveOAuthScopeWithIdError {
1550    DefaultResponse(models::Errors),
1551    UnknownValue(serde_json::Value),
1552}
1553
1554/// struct for typed errors of method [`retrieve_oauth_configuration_with_id`]
1555#[derive(Debug, Clone, Serialize, Deserialize)]
1556#[serde(untagged)]
1557pub enum RetrieveOauthConfigurationWithIdError {
1558    DefaultResponse(models::Errors),
1559    UnknownValue(serde_json::Value),
1560}
1561
1562/// struct for typed errors of method [`retrieve_open_id_configuration_with_id`]
1563#[derive(Debug, Clone, Serialize, Deserialize)]
1564#[serde(untagged)]
1565pub enum RetrieveOpenIdConfigurationWithIdError {
1566    DefaultResponse(),
1567    UnknownValue(serde_json::Value),
1568}
1569
1570/// struct for typed errors of method [`retrieve_password_validation_rules_with_id`]
1571#[derive(Debug, Clone, Serialize, Deserialize)]
1572#[serde(untagged)]
1573pub enum RetrievePasswordValidationRulesWithIdError {
1574    DefaultResponse(),
1575    UnknownValue(serde_json::Value),
1576}
1577
1578/// struct for typed errors of method [`retrieve_password_validation_rules_with_tenant_id_with_id`]
1579#[derive(Debug, Clone, Serialize, Deserialize)]
1580#[serde(untagged)]
1581pub enum RetrievePasswordValidationRulesWithTenantIdWithIdError {
1582    DefaultResponse(),
1583    UnknownValue(serde_json::Value),
1584}
1585
1586/// struct for typed errors of method [`retrieve_pending_children_with_id`]
1587#[derive(Debug, Clone, Serialize, Deserialize)]
1588#[serde(untagged)]
1589pub enum RetrievePendingChildrenWithIdError {
1590    DefaultResponse(models::Errors),
1591    UnknownValue(serde_json::Value),
1592}
1593
1594/// struct for typed errors of method [`retrieve_pending_link_with_id`]
1595#[derive(Debug, Clone, Serialize, Deserialize)]
1596#[serde(untagged)]
1597pub enum RetrievePendingLinkWithIdError {
1598    DefaultResponse(models::Errors),
1599    UnknownValue(serde_json::Value),
1600}
1601
1602/// struct for typed errors of method [`retrieve_reactor_metrics_with_id`]
1603#[derive(Debug, Clone, Serialize, Deserialize)]
1604#[serde(untagged)]
1605pub enum RetrieveReactorMetricsWithIdError {
1606    DefaultResponse(),
1607    UnknownValue(serde_json::Value),
1608}
1609
1610/// struct for typed errors of method [`retrieve_refresh_token_by_id_with_id`]
1611#[derive(Debug, Clone, Serialize, Deserialize)]
1612#[serde(untagged)]
1613pub enum RetrieveRefreshTokenByIdWithIdError {
1614    DefaultResponse(models::Errors),
1615    UnknownValue(serde_json::Value),
1616}
1617
1618/// struct for typed errors of method [`retrieve_refresh_tokens_with_id`]
1619#[derive(Debug, Clone, Serialize, Deserialize)]
1620#[serde(untagged)]
1621pub enum RetrieveRefreshTokensWithIdError {
1622    DefaultResponse(models::Errors),
1623    UnknownValue(serde_json::Value),
1624}
1625
1626/// struct for typed errors of method [`retrieve_registration_report_with_id`]
1627#[derive(Debug, Clone, Serialize, Deserialize)]
1628#[serde(untagged)]
1629pub enum RetrieveRegistrationReportWithIdError {
1630    DefaultResponse(models::Errors),
1631    UnknownValue(serde_json::Value),
1632}
1633
1634/// struct for typed errors of method [`retrieve_registration_with_id`]
1635#[derive(Debug, Clone, Serialize, Deserialize)]
1636#[serde(untagged)]
1637pub enum RetrieveRegistrationWithIdError {
1638    DefaultResponse(models::Errors),
1639    UnknownValue(serde_json::Value),
1640}
1641
1642/// struct for typed errors of method [`retrieve_report_login`]
1643#[derive(Debug, Clone, Serialize, Deserialize)]
1644#[serde(untagged)]
1645pub enum RetrieveReportLoginError {
1646    DefaultResponse(models::Errors),
1647    UnknownValue(serde_json::Value),
1648}
1649
1650/// struct for typed errors of method [`retrieve_status`]
1651#[derive(Debug, Clone, Serialize, Deserialize)]
1652#[serde(untagged)]
1653pub enum RetrieveStatusError {
1654    DefaultResponse(),
1655    UnknownValue(serde_json::Value),
1656}
1657
1658/// struct for typed errors of method [`retrieve_system_health_with_id`]
1659#[derive(Debug, Clone, Serialize, Deserialize)]
1660#[serde(untagged)]
1661pub enum RetrieveSystemHealthWithIdError {
1662    DefaultResponse(),
1663    UnknownValue(serde_json::Value),
1664}
1665
1666/// struct for typed errors of method [`retrieve_tenant_with_id`]
1667#[derive(Debug, Clone, Serialize, Deserialize)]
1668#[serde(untagged)]
1669pub enum RetrieveTenantWithIdError {
1670    DefaultResponse(models::Errors),
1671    UnknownValue(serde_json::Value),
1672}
1673
1674/// struct for typed errors of method [`retrieve_theme_with_id`]
1675#[derive(Debug, Clone, Serialize, Deserialize)]
1676#[serde(untagged)]
1677pub enum RetrieveThemeWithIdError {
1678    DefaultResponse(models::Errors),
1679    UnknownValue(serde_json::Value),
1680}
1681
1682/// struct for typed errors of method [`retrieve_total_report_with_id`]
1683#[derive(Debug, Clone, Serialize, Deserialize)]
1684#[serde(untagged)]
1685pub enum RetrieveTotalReportWithIdError {
1686    DefaultResponse(),
1687    UnknownValue(serde_json::Value),
1688}
1689
1690/// struct for typed errors of method [`retrieve_two_factor_recovery_codes_with_id`]
1691#[derive(Debug, Clone, Serialize, Deserialize)]
1692#[serde(untagged)]
1693pub enum RetrieveTwoFactorRecoveryCodesWithIdError {
1694    DefaultResponse(models::Errors),
1695    UnknownValue(serde_json::Value),
1696}
1697
1698/// struct for typed errors of method [`retrieve_two_factor_status_with_id`]
1699#[derive(Debug, Clone, Serialize, Deserialize)]
1700#[serde(untagged)]
1701pub enum RetrieveTwoFactorStatusWithIdError {
1702    DefaultResponse(models::Errors),
1703    UnknownValue(serde_json::Value),
1704}
1705
1706/// struct for typed errors of method [`retrieve_user`]
1707#[derive(Debug, Clone, Serialize, Deserialize)]
1708#[serde(untagged)]
1709pub enum RetrieveUserError {
1710    DefaultResponse(models::Errors),
1711    UnknownValue(serde_json::Value),
1712}
1713
1714/// struct for typed errors of method [`retrieve_user_action`]
1715#[derive(Debug, Clone, Serialize, Deserialize)]
1716#[serde(untagged)]
1717pub enum RetrieveUserActionError {
1718    DefaultResponse(),
1719    UnknownValue(serde_json::Value),
1720}
1721
1722/// struct for typed errors of method [`retrieve_user_action_reason`]
1723#[derive(Debug, Clone, Serialize, Deserialize)]
1724#[serde(untagged)]
1725pub enum RetrieveUserActionReasonError {
1726    DefaultResponse(),
1727    UnknownValue(serde_json::Value),
1728}
1729
1730/// struct for typed errors of method [`retrieve_user_action_reason_with_id`]
1731#[derive(Debug, Clone, Serialize, Deserialize)]
1732#[serde(untagged)]
1733pub enum RetrieveUserActionReasonWithIdError {
1734    DefaultResponse(),
1735    UnknownValue(serde_json::Value),
1736}
1737
1738/// struct for typed errors of method [`retrieve_user_action_with_id`]
1739#[derive(Debug, Clone, Serialize, Deserialize)]
1740#[serde(untagged)]
1741pub enum RetrieveUserActionWithIdError {
1742    DefaultResponse(),
1743    UnknownValue(serde_json::Value),
1744}
1745
1746/// struct for typed errors of method [`retrieve_user_actioning`]
1747#[derive(Debug, Clone, Serialize, Deserialize)]
1748#[serde(untagged)]
1749pub enum RetrieveUserActioningError {
1750    DefaultResponse(models::Errors),
1751    UnknownValue(serde_json::Value),
1752}
1753
1754/// struct for typed errors of method [`retrieve_user_change_password`]
1755#[derive(Debug, Clone, Serialize, Deserialize)]
1756#[serde(untagged)]
1757pub enum RetrieveUserChangePasswordError {
1758    DefaultResponse(models::Errors),
1759    UnknownValue(serde_json::Value),
1760}
1761
1762/// struct for typed errors of method [`retrieve_user_comments_with_id`]
1763#[derive(Debug, Clone, Serialize, Deserialize)]
1764#[serde(untagged)]
1765pub enum RetrieveUserCommentsWithIdError {
1766    DefaultResponse(models::Errors),
1767    UnknownValue(serde_json::Value),
1768}
1769
1770/// struct for typed errors of method [`retrieve_user_consent_with_id`]
1771#[derive(Debug, Clone, Serialize, Deserialize)]
1772#[serde(untagged)]
1773pub enum RetrieveUserConsentWithIdError {
1774    DefaultResponse(),
1775    UnknownValue(serde_json::Value),
1776}
1777
1778/// struct for typed errors of method [`retrieve_user_consents_with_id`]
1779#[derive(Debug, Clone, Serialize, Deserialize)]
1780#[serde(untagged)]
1781pub enum RetrieveUserConsentsWithIdError {
1782    DefaultResponse(),
1783    UnknownValue(serde_json::Value),
1784}
1785
1786/// struct for typed errors of method [`retrieve_user_info_from_access_token_with_id`]
1787#[derive(Debug, Clone, Serialize, Deserialize)]
1788#[serde(untagged)]
1789pub enum RetrieveUserInfoFromAccessTokenWithIdError {
1790    DefaultResponse(models::OAuthError),
1791    UnknownValue(serde_json::Value),
1792}
1793
1794/// struct for typed errors of method [`retrieve_user_recent_login`]
1795#[derive(Debug, Clone, Serialize, Deserialize)]
1796#[serde(untagged)]
1797pub enum RetrieveUserRecentLoginError {
1798    DefaultResponse(models::Errors),
1799    UnknownValue(serde_json::Value),
1800}
1801
1802/// struct for typed errors of method [`retrieve_user_with_id`]
1803#[derive(Debug, Clone, Serialize, Deserialize)]
1804#[serde(untagged)]
1805pub enum RetrieveUserWithIdError {
1806    DefaultResponse(models::Errors),
1807    UnknownValue(serde_json::Value),
1808}
1809
1810/// struct for typed errors of method [`retrieve_version_with_id`]
1811#[derive(Debug, Clone, Serialize, Deserialize)]
1812#[serde(untagged)]
1813pub enum RetrieveVersionWithIdError {
1814    DefaultResponse(models::Errors),
1815    UnknownValue(serde_json::Value),
1816}
1817
1818/// struct for typed errors of method [`retrieve_web_authn_credential_with_id`]
1819#[derive(Debug, Clone, Serialize, Deserialize)]
1820#[serde(untagged)]
1821pub enum RetrieveWebAuthnCredentialWithIdError {
1822    DefaultResponse(models::Errors),
1823    UnknownValue(serde_json::Value),
1824}
1825
1826/// struct for typed errors of method [`retrieve_web_authn_credentials_for_user_with_id`]
1827#[derive(Debug, Clone, Serialize, Deserialize)]
1828#[serde(untagged)]
1829pub enum RetrieveWebAuthnCredentialsForUserWithIdError {
1830    DefaultResponse(models::Errors),
1831    UnknownValue(serde_json::Value),
1832}
1833
1834/// struct for typed errors of method [`retrieve_webhook`]
1835#[derive(Debug, Clone, Serialize, Deserialize)]
1836#[serde(untagged)]
1837pub enum RetrieveWebhookError {
1838    DefaultResponse(),
1839    UnknownValue(serde_json::Value),
1840}
1841
1842/// struct for typed errors of method [`retrieve_webhook_attempt_log_with_id`]
1843#[derive(Debug, Clone, Serialize, Deserialize)]
1844#[serde(untagged)]
1845pub enum RetrieveWebhookAttemptLogWithIdError {
1846    DefaultResponse(models::Errors),
1847    UnknownValue(serde_json::Value),
1848}
1849
1850/// struct for typed errors of method [`retrieve_webhook_event_log_with_id`]
1851#[derive(Debug, Clone, Serialize, Deserialize)]
1852#[serde(untagged)]
1853pub enum RetrieveWebhookEventLogWithIdError {
1854    DefaultResponse(models::Errors),
1855    UnknownValue(serde_json::Value),
1856}
1857
1858/// struct for typed errors of method [`retrieve_webhook_with_id`]
1859#[derive(Debug, Clone, Serialize, Deserialize)]
1860#[serde(untagged)]
1861pub enum RetrieveWebhookWithIdError {
1862    DefaultResponse(),
1863    UnknownValue(serde_json::Value),
1864}
1865
1866/// struct for typed errors of method [`revoke_refresh_token_by_id_with_id`]
1867#[derive(Debug, Clone, Serialize, Deserialize)]
1868#[serde(untagged)]
1869pub enum RevokeRefreshTokenByIdWithIdError {
1870    DefaultResponse(models::Errors),
1871    UnknownValue(serde_json::Value),
1872}
1873
1874/// struct for typed errors of method [`revoke_user_consent_with_id`]
1875#[derive(Debug, Clone, Serialize, Deserialize)]
1876#[serde(untagged)]
1877pub enum RevokeUserConsentWithIdError {
1878    DefaultResponse(),
1879    UnknownValue(serde_json::Value),
1880}
1881
1882/// struct for typed errors of method [`search_applications_with_id`]
1883#[derive(Debug, Clone, Serialize, Deserialize)]
1884#[serde(untagged)]
1885pub enum SearchApplicationsWithIdError {
1886    DefaultResponse(models::Errors),
1887    UnknownValue(serde_json::Value),
1888}
1889
1890/// struct for typed errors of method [`search_audit_logs_with_id`]
1891#[derive(Debug, Clone, Serialize, Deserialize)]
1892#[serde(untagged)]
1893pub enum SearchAuditLogsWithIdError {
1894    DefaultResponse(models::Errors),
1895    UnknownValue(serde_json::Value),
1896}
1897
1898/// struct for typed errors of method [`search_consents_with_id`]
1899#[derive(Debug, Clone, Serialize, Deserialize)]
1900#[serde(untagged)]
1901pub enum SearchConsentsWithIdError {
1902    DefaultResponse(models::Errors),
1903    UnknownValue(serde_json::Value),
1904}
1905
1906/// struct for typed errors of method [`search_email_templates_with_id`]
1907#[derive(Debug, Clone, Serialize, Deserialize)]
1908#[serde(untagged)]
1909pub enum SearchEmailTemplatesWithIdError {
1910    DefaultResponse(models::Errors),
1911    UnknownValue(serde_json::Value),
1912}
1913
1914/// struct for typed errors of method [`search_entities_by_ids_with_id`]
1915#[derive(Debug, Clone, Serialize, Deserialize)]
1916#[serde(untagged)]
1917pub enum SearchEntitiesByIdsWithIdError {
1918    DefaultResponse(models::Errors),
1919    UnknownValue(serde_json::Value),
1920}
1921
1922/// struct for typed errors of method [`search_entities_with_id`]
1923#[derive(Debug, Clone, Serialize, Deserialize)]
1924#[serde(untagged)]
1925pub enum SearchEntitiesWithIdError {
1926    DefaultResponse(models::Errors),
1927    UnknownValue(serde_json::Value),
1928}
1929
1930/// struct for typed errors of method [`search_entity_grants_with_id`]
1931#[derive(Debug, Clone, Serialize, Deserialize)]
1932#[serde(untagged)]
1933pub enum SearchEntityGrantsWithIdError {
1934    DefaultResponse(models::Errors),
1935    UnknownValue(serde_json::Value),
1936}
1937
1938/// struct for typed errors of method [`search_entity_types_with_id`]
1939#[derive(Debug, Clone, Serialize, Deserialize)]
1940#[serde(untagged)]
1941pub enum SearchEntityTypesWithIdError {
1942    DefaultResponse(models::Errors),
1943    UnknownValue(serde_json::Value),
1944}
1945
1946/// struct for typed errors of method [`search_event_logs_with_id`]
1947#[derive(Debug, Clone, Serialize, Deserialize)]
1948#[serde(untagged)]
1949pub enum SearchEventLogsWithIdError {
1950    DefaultResponse(models::Errors),
1951    UnknownValue(serde_json::Value),
1952}
1953
1954/// struct for typed errors of method [`search_group_members_with_id`]
1955#[derive(Debug, Clone, Serialize, Deserialize)]
1956#[serde(untagged)]
1957pub enum SearchGroupMembersWithIdError {
1958    DefaultResponse(models::Errors),
1959    UnknownValue(serde_json::Value),
1960}
1961
1962/// struct for typed errors of method [`search_groups_with_id`]
1963#[derive(Debug, Clone, Serialize, Deserialize)]
1964#[serde(untagged)]
1965pub enum SearchGroupsWithIdError {
1966    DefaultResponse(models::Errors),
1967    UnknownValue(serde_json::Value),
1968}
1969
1970/// struct for typed errors of method [`search_identity_providers_with_id`]
1971#[derive(Debug, Clone, Serialize, Deserialize)]
1972#[serde(untagged)]
1973pub enum SearchIdentityProvidersWithIdError {
1974    DefaultResponse(models::Errors),
1975    UnknownValue(serde_json::Value),
1976}
1977
1978/// struct for typed errors of method [`search_ip_access_control_lists_with_id`]
1979#[derive(Debug, Clone, Serialize, Deserialize)]
1980#[serde(untagged)]
1981pub enum SearchIpAccessControlListsWithIdError {
1982    DefaultResponse(models::Errors),
1983    UnknownValue(serde_json::Value),
1984}
1985
1986/// struct for typed errors of method [`search_keys_with_id`]
1987#[derive(Debug, Clone, Serialize, Deserialize)]
1988#[serde(untagged)]
1989pub enum SearchKeysWithIdError {
1990    DefaultResponse(models::Errors),
1991    UnknownValue(serde_json::Value),
1992}
1993
1994/// struct for typed errors of method [`search_lambdas_with_id`]
1995#[derive(Debug, Clone, Serialize, Deserialize)]
1996#[serde(untagged)]
1997pub enum SearchLambdasWithIdError {
1998    DefaultResponse(models::Errors),
1999    UnknownValue(serde_json::Value),
2000}
2001
2002/// struct for typed errors of method [`search_login_records_with_id`]
2003#[derive(Debug, Clone, Serialize, Deserialize)]
2004#[serde(untagged)]
2005pub enum SearchLoginRecordsWithIdError {
2006    DefaultResponse(models::Errors),
2007    UnknownValue(serde_json::Value),
2008}
2009
2010/// struct for typed errors of method [`search_tenants_with_id`]
2011#[derive(Debug, Clone, Serialize, Deserialize)]
2012#[serde(untagged)]
2013pub enum SearchTenantsWithIdError {
2014    DefaultResponse(models::Errors),
2015    UnknownValue(serde_json::Value),
2016}
2017
2018/// struct for typed errors of method [`search_themes_with_id`]
2019#[derive(Debug, Clone, Serialize, Deserialize)]
2020#[serde(untagged)]
2021pub enum SearchThemesWithIdError {
2022    DefaultResponse(models::Errors),
2023    UnknownValue(serde_json::Value),
2024}
2025
2026/// struct for typed errors of method [`search_user_comments_with_id`]
2027#[derive(Debug, Clone, Serialize, Deserialize)]
2028#[serde(untagged)]
2029pub enum SearchUserCommentsWithIdError {
2030    DefaultResponse(models::Errors),
2031    UnknownValue(serde_json::Value),
2032}
2033
2034/// struct for typed errors of method [`search_users_by_ids_with_id`]
2035#[derive(Debug, Clone, Serialize, Deserialize)]
2036#[serde(untagged)]
2037pub enum SearchUsersByIdsWithIdError {
2038    DefaultResponse(models::Errors),
2039    UnknownValue(serde_json::Value),
2040}
2041
2042/// struct for typed errors of method [`search_users_by_query_with_id`]
2043#[derive(Debug, Clone, Serialize, Deserialize)]
2044#[serde(untagged)]
2045pub enum SearchUsersByQueryWithIdError {
2046    DefaultResponse(models::Errors),
2047    UnknownValue(serde_json::Value),
2048}
2049
2050/// struct for typed errors of method [`search_webhook_event_logs_with_id`]
2051#[derive(Debug, Clone, Serialize, Deserialize)]
2052#[serde(untagged)]
2053pub enum SearchWebhookEventLogsWithIdError {
2054    DefaultResponse(models::Errors),
2055    UnknownValue(serde_json::Value),
2056}
2057
2058/// struct for typed errors of method [`search_webhooks_with_id`]
2059#[derive(Debug, Clone, Serialize, Deserialize)]
2060#[serde(untagged)]
2061pub enum SearchWebhooksWithIdError {
2062    DefaultResponse(models::Errors),
2063    UnknownValue(serde_json::Value),
2064}
2065
2066/// struct for typed errors of method [`send_email_with_id`]
2067#[derive(Debug, Clone, Serialize, Deserialize)]
2068#[serde(untagged)]
2069pub enum SendEmailWithIdError {
2070    DefaultResponse(models::Errors),
2071    UnknownValue(serde_json::Value),
2072}
2073
2074/// struct for typed errors of method [`send_family_request_email_with_id`]
2075#[derive(Debug, Clone, Serialize, Deserialize)]
2076#[serde(untagged)]
2077pub enum SendFamilyRequestEmailWithIdError {
2078    DefaultResponse(models::Errors),
2079    UnknownValue(serde_json::Value),
2080}
2081
2082/// struct for typed errors of method [`send_passwordless_code_with_id`]
2083#[derive(Debug, Clone, Serialize, Deserialize)]
2084#[serde(untagged)]
2085pub enum SendPasswordlessCodeWithIdError {
2086    DefaultResponse(models::Errors),
2087    UnknownValue(serde_json::Value),
2088}
2089
2090/// struct for typed errors of method [`send_two_factor_code_for_enable_disable_with_id`]
2091#[derive(Debug, Clone, Serialize, Deserialize)]
2092#[serde(untagged)]
2093pub enum SendTwoFactorCodeForEnableDisableWithIdError {
2094    DefaultResponse(models::Errors),
2095    UnknownValue(serde_json::Value),
2096}
2097
2098/// struct for typed errors of method [`send_two_factor_code_for_login_using_method_with_id`]
2099#[derive(Debug, Clone, Serialize, Deserialize)]
2100#[serde(untagged)]
2101pub enum SendTwoFactorCodeForLoginUsingMethodWithIdError {
2102    DefaultResponse(models::Errors),
2103    UnknownValue(serde_json::Value),
2104}
2105
2106/// struct for typed errors of method [`start_identity_provider_login_with_id`]
2107#[derive(Debug, Clone, Serialize, Deserialize)]
2108#[serde(untagged)]
2109pub enum StartIdentityProviderLoginWithIdError {
2110    DefaultResponse(models::Errors),
2111    UnknownValue(serde_json::Value),
2112}
2113
2114/// struct for typed errors of method [`start_passwordless_login_with_id`]
2115#[derive(Debug, Clone, Serialize, Deserialize)]
2116#[serde(untagged)]
2117pub enum StartPasswordlessLoginWithIdError {
2118    DefaultResponse(models::Errors),
2119    UnknownValue(serde_json::Value),
2120}
2121
2122/// struct for typed errors of method [`start_two_factor_login_with_id`]
2123#[derive(Debug, Clone, Serialize, Deserialize)]
2124#[serde(untagged)]
2125pub enum StartTwoFactorLoginWithIdError {
2126    DefaultResponse(models::Errors),
2127    UnknownValue(serde_json::Value),
2128}
2129
2130/// struct for typed errors of method [`start_web_authn_login_with_id`]
2131#[derive(Debug, Clone, Serialize, Deserialize)]
2132#[serde(untagged)]
2133pub enum StartWebAuthnLoginWithIdError {
2134    DefaultResponse(models::Errors),
2135    UnknownValue(serde_json::Value),
2136}
2137
2138/// struct for typed errors of method [`start_web_authn_registration_with_id`]
2139#[derive(Debug, Clone, Serialize, Deserialize)]
2140#[serde(untagged)]
2141pub enum StartWebAuthnRegistrationWithIdError {
2142    DefaultResponse(models::Errors),
2143    UnknownValue(serde_json::Value),
2144}
2145
2146/// struct for typed errors of method [`two_factor_login_with_id`]
2147#[derive(Debug, Clone, Serialize, Deserialize)]
2148#[serde(untagged)]
2149pub enum TwoFactorLoginWithIdError {
2150    DefaultResponse(models::Errors),
2151    UnknownValue(serde_json::Value),
2152}
2153
2154/// struct for typed errors of method [`update_api_key_with_id`]
2155#[derive(Debug, Clone, Serialize, Deserialize)]
2156#[serde(untagged)]
2157pub enum UpdateApiKeyWithIdError {
2158    DefaultResponse(models::Errors),
2159    UnknownValue(serde_json::Value),
2160}
2161
2162/// struct for typed errors of method [`update_application_role_with_id`]
2163#[derive(Debug, Clone, Serialize, Deserialize)]
2164#[serde(untagged)]
2165pub enum UpdateApplicationRoleWithIdError {
2166    DefaultResponse(models::Errors),
2167    UnknownValue(serde_json::Value),
2168}
2169
2170/// struct for typed errors of method [`update_application_with_id`]
2171#[derive(Debug, Clone, Serialize, Deserialize)]
2172#[serde(untagged)]
2173pub enum UpdateApplicationWithIdError {
2174    DefaultResponse(models::Errors),
2175    UnknownValue(serde_json::Value),
2176}
2177
2178/// struct for typed errors of method [`update_connector_with_id`]
2179#[derive(Debug, Clone, Serialize, Deserialize)]
2180#[serde(untagged)]
2181pub enum UpdateConnectorWithIdError {
2182    DefaultResponse(models::Errors),
2183    UnknownValue(serde_json::Value),
2184}
2185
2186/// struct for typed errors of method [`update_consent_with_id`]
2187#[derive(Debug, Clone, Serialize, Deserialize)]
2188#[serde(untagged)]
2189pub enum UpdateConsentWithIdError {
2190    DefaultResponse(models::Errors),
2191    UnknownValue(serde_json::Value),
2192}
2193
2194/// struct for typed errors of method [`update_email_template_with_id`]
2195#[derive(Debug, Clone, Serialize, Deserialize)]
2196#[serde(untagged)]
2197pub enum UpdateEmailTemplateWithIdError {
2198    DefaultResponse(models::Errors),
2199    UnknownValue(serde_json::Value),
2200}
2201
2202/// struct for typed errors of method [`update_entity_type_permission_with_id`]
2203#[derive(Debug, Clone, Serialize, Deserialize)]
2204#[serde(untagged)]
2205pub enum UpdateEntityTypePermissionWithIdError {
2206    DefaultResponse(models::Errors),
2207    UnknownValue(serde_json::Value),
2208}
2209
2210/// struct for typed errors of method [`update_entity_type_with_id`]
2211#[derive(Debug, Clone, Serialize, Deserialize)]
2212#[serde(untagged)]
2213pub enum UpdateEntityTypeWithIdError {
2214    DefaultResponse(models::Errors),
2215    UnknownValue(serde_json::Value),
2216}
2217
2218/// struct for typed errors of method [`update_entity_with_id`]
2219#[derive(Debug, Clone, Serialize, Deserialize)]
2220#[serde(untagged)]
2221pub enum UpdateEntityWithIdError {
2222    DefaultResponse(models::Errors),
2223    UnknownValue(serde_json::Value),
2224}
2225
2226/// struct for typed errors of method [`update_form_field_with_id`]
2227#[derive(Debug, Clone, Serialize, Deserialize)]
2228#[serde(untagged)]
2229pub enum UpdateFormFieldWithIdError {
2230    DefaultResponse(models::Errors),
2231    UnknownValue(serde_json::Value),
2232}
2233
2234/// struct for typed errors of method [`update_form_with_id`]
2235#[derive(Debug, Clone, Serialize, Deserialize)]
2236#[serde(untagged)]
2237pub enum UpdateFormWithIdError {
2238    DefaultResponse(models::Errors),
2239    UnknownValue(serde_json::Value),
2240}
2241
2242/// struct for typed errors of method [`update_group_members_with_id`]
2243#[derive(Debug, Clone, Serialize, Deserialize)]
2244#[serde(untagged)]
2245pub enum UpdateGroupMembersWithIdError {
2246    DefaultResponse(models::Errors),
2247    UnknownValue(serde_json::Value),
2248}
2249
2250/// struct for typed errors of method [`update_group_with_id`]
2251#[derive(Debug, Clone, Serialize, Deserialize)]
2252#[serde(untagged)]
2253pub enum UpdateGroupWithIdError {
2254    DefaultResponse(models::Errors),
2255    UnknownValue(serde_json::Value),
2256}
2257
2258/// struct for typed errors of method [`update_identity_provider_with_id`]
2259#[derive(Debug, Clone, Serialize, Deserialize)]
2260#[serde(untagged)]
2261pub enum UpdateIdentityProviderWithIdError {
2262    DefaultResponse(models::Errors),
2263    UnknownValue(serde_json::Value),
2264}
2265
2266/// struct for typed errors of method [`update_integrations_with_id`]
2267#[derive(Debug, Clone, Serialize, Deserialize)]
2268#[serde(untagged)]
2269pub enum UpdateIntegrationsWithIdError {
2270    DefaultResponse(models::Errors),
2271    UnknownValue(serde_json::Value),
2272}
2273
2274/// struct for typed errors of method [`update_ip_access_control_list_with_id`]
2275#[derive(Debug, Clone, Serialize, Deserialize)]
2276#[serde(untagged)]
2277pub enum UpdateIpAccessControlListWithIdError {
2278    DefaultResponse(models::Errors),
2279    UnknownValue(serde_json::Value),
2280}
2281
2282/// struct for typed errors of method [`update_key_with_id`]
2283#[derive(Debug, Clone, Serialize, Deserialize)]
2284#[serde(untagged)]
2285pub enum UpdateKeyWithIdError {
2286    DefaultResponse(models::Errors),
2287    UnknownValue(serde_json::Value),
2288}
2289
2290/// struct for typed errors of method [`update_lambda_with_id`]
2291#[derive(Debug, Clone, Serialize, Deserialize)]
2292#[serde(untagged)]
2293pub enum UpdateLambdaWithIdError {
2294    DefaultResponse(models::Errors),
2295    UnknownValue(serde_json::Value),
2296}
2297
2298/// struct for typed errors of method [`update_message_template_with_id`]
2299#[derive(Debug, Clone, Serialize, Deserialize)]
2300#[serde(untagged)]
2301pub enum UpdateMessageTemplateWithIdError {
2302    DefaultResponse(models::Errors),
2303    UnknownValue(serde_json::Value),
2304}
2305
2306/// struct for typed errors of method [`update_messenger_with_id`]
2307#[derive(Debug, Clone, Serialize, Deserialize)]
2308#[serde(untagged)]
2309pub enum UpdateMessengerWithIdError {
2310    DefaultResponse(models::Errors),
2311    UnknownValue(serde_json::Value),
2312}
2313
2314/// struct for typed errors of method [`update_o_auth_scope_with_id`]
2315#[derive(Debug, Clone, Serialize, Deserialize)]
2316#[serde(untagged)]
2317pub enum UpdateOAuthScopeWithIdError {
2318    DefaultResponse(models::Errors),
2319    UnknownValue(serde_json::Value),
2320}
2321
2322/// struct for typed errors of method [`update_registration_with_id`]
2323#[derive(Debug, Clone, Serialize, Deserialize)]
2324#[serde(untagged)]
2325pub enum UpdateRegistrationWithIdError {
2326    DefaultResponse(models::Errors),
2327    UnknownValue(serde_json::Value),
2328}
2329
2330/// struct for typed errors of method [`update_system_configuration_with_id`]
2331#[derive(Debug, Clone, Serialize, Deserialize)]
2332#[serde(untagged)]
2333pub enum UpdateSystemConfigurationWithIdError {
2334    DefaultResponse(models::Errors),
2335    UnknownValue(serde_json::Value),
2336}
2337
2338/// struct for typed errors of method [`update_tenant_with_id`]
2339#[derive(Debug, Clone, Serialize, Deserialize)]
2340#[serde(untagged)]
2341pub enum UpdateTenantWithIdError {
2342    DefaultResponse(models::Errors),
2343    UnknownValue(serde_json::Value),
2344}
2345
2346/// struct for typed errors of method [`update_theme_with_id`]
2347#[derive(Debug, Clone, Serialize, Deserialize)]
2348#[serde(untagged)]
2349pub enum UpdateThemeWithIdError {
2350    DefaultResponse(models::Errors),
2351    UnknownValue(serde_json::Value),
2352}
2353
2354/// struct for typed errors of method [`update_user_action_reason_with_id`]
2355#[derive(Debug, Clone, Serialize, Deserialize)]
2356#[serde(untagged)]
2357pub enum UpdateUserActionReasonWithIdError {
2358    DefaultResponse(models::Errors),
2359    UnknownValue(serde_json::Value),
2360}
2361
2362/// struct for typed errors of method [`update_user_action_with_id`]
2363#[derive(Debug, Clone, Serialize, Deserialize)]
2364#[serde(untagged)]
2365pub enum UpdateUserActionWithIdError {
2366    DefaultResponse(models::Errors),
2367    UnknownValue(serde_json::Value),
2368}
2369
2370/// struct for typed errors of method [`update_user_consent_with_id`]
2371#[derive(Debug, Clone, Serialize, Deserialize)]
2372#[serde(untagged)]
2373pub enum UpdateUserConsentWithIdError {
2374    DefaultResponse(models::Errors),
2375    UnknownValue(serde_json::Value),
2376}
2377
2378/// struct for typed errors of method [`update_user_family_with_id`]
2379#[derive(Debug, Clone, Serialize, Deserialize)]
2380#[serde(untagged)]
2381pub enum UpdateUserFamilyWithIdError {
2382    DefaultResponse(models::Errors),
2383    UnknownValue(serde_json::Value),
2384}
2385
2386/// struct for typed errors of method [`update_user_verify_email`]
2387#[derive(Debug, Clone, Serialize, Deserialize)]
2388#[serde(untagged)]
2389pub enum UpdateUserVerifyEmailError {
2390    DefaultResponse(models::Errors),
2391    UnknownValue(serde_json::Value),
2392}
2393
2394/// struct for typed errors of method [`update_user_verify_registration`]
2395#[derive(Debug, Clone, Serialize, Deserialize)]
2396#[serde(untagged)]
2397pub enum UpdateUserVerifyRegistrationError {
2398    DefaultResponse(),
2399    UnknownValue(serde_json::Value),
2400}
2401
2402/// struct for typed errors of method [`update_user_with_id`]
2403#[derive(Debug, Clone, Serialize, Deserialize)]
2404#[serde(untagged)]
2405pub enum UpdateUserWithIdError {
2406    DefaultResponse(models::Errors),
2407    UnknownValue(serde_json::Value),
2408}
2409
2410/// struct for typed errors of method [`update_webhook_with_id`]
2411#[derive(Debug, Clone, Serialize, Deserialize)]
2412#[serde(untagged)]
2413pub enum UpdateWebhookWithIdError {
2414    DefaultResponse(models::Errors),
2415    UnknownValue(serde_json::Value),
2416}
2417
2418/// struct for typed errors of method [`upsert_entity_grant_with_id`]
2419#[derive(Debug, Clone, Serialize, Deserialize)]
2420#[serde(untagged)]
2421pub enum UpsertEntityGrantWithIdError {
2422    DefaultResponse(models::Errors),
2423    UnknownValue(serde_json::Value),
2424}
2425
2426/// struct for typed errors of method [`validate_device_with_id`]
2427#[derive(Debug, Clone, Serialize, Deserialize)]
2428#[serde(untagged)]
2429pub enum ValidateDeviceWithIdError {
2430    DefaultResponse(),
2431    UnknownValue(serde_json::Value),
2432}
2433
2434/// struct for typed errors of method [`validate_jwt_with_id`]
2435#[derive(Debug, Clone, Serialize, Deserialize)]
2436#[serde(untagged)]
2437pub enum ValidateJwtWithIdError {
2438    DefaultResponse(),
2439    UnknownValue(serde_json::Value),
2440}
2441
2442/// struct for typed errors of method [`vend_jwt_with_id`]
2443#[derive(Debug, Clone, Serialize, Deserialize)]
2444#[serde(untagged)]
2445pub enum VendJwtWithIdError {
2446    DefaultResponse(models::Errors),
2447    UnknownValue(serde_json::Value),
2448}
2449
2450/// struct for typed errors of method [`verify_user_registration_with_id`]
2451#[derive(Debug, Clone, Serialize, Deserialize)]
2452#[serde(untagged)]
2453pub enum VerifyUserRegistrationWithIdError {
2454    DefaultResponse(models::Errors),
2455    UnknownValue(serde_json::Value),
2456}
2457
2458
2459/// Takes an action on a user. The user being actioned is called the \"actionee\" and the user taking the action is called the \"actioner\". Both user ids are required in the request object.
2460pub async fn action_user_with_id(configuration: &configuration::Configuration, action_request: Option<models::ActionRequest>) -> Result<models::ActionResponse, Error<ActionUserWithIdError>> {
2461    // add a prefix to parameters to efficiently prevent name collisions
2462    let p_action_request = action_request;
2463
2464    let uri_str = format!("{}/api/user/action", configuration.base_path);
2465    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
2466
2467    if let Some(ref user_agent) = configuration.user_agent {
2468        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2469    }
2470    if let Some(ref apikey) = configuration.api_key {
2471        let key = apikey.key.clone();
2472        let value = match apikey.prefix {
2473            Some(ref prefix) => format!("{} {}", prefix, key),
2474            None => key,
2475        };
2476        req_builder = req_builder.header("Authorization", value);
2477    };
2478    req_builder = req_builder.json(&p_action_request);
2479
2480    let req = req_builder.build()?;
2481    let resp = configuration.client.execute(req).await?;
2482
2483    let status = resp.status();
2484    let content_type = resp
2485        .headers()
2486        .get("content-type")
2487        .and_then(|v| v.to_str().ok())
2488        .unwrap_or("application/octet-stream");
2489    let content_type = super::ContentType::from(content_type);
2490
2491    if !status.is_client_error() && !status.is_server_error() {
2492        let content = resp.text().await?;
2493        match content_type {
2494            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2495            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ActionResponse`"))),
2496            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ActionResponse`")))),
2497        }
2498    } else {
2499        let content = resp.text().await?;
2500        let entity: Option<ActionUserWithIdError> = serde_json::from_str(&content).ok();
2501        Err(Error::ResponseError(ResponseContent { status, content, entity }))
2502    }
2503}
2504
2505/// Activates the FusionAuth Reactor using a license Id and optionally a license text (for air-gapped deployments)
2506pub async fn activate_reactor_with_id(configuration: &configuration::Configuration, reactor_request: Option<models::ReactorRequest>) -> Result<(), Error<ActivateReactorWithIdError>> {
2507    // add a prefix to parameters to efficiently prevent name collisions
2508    let p_reactor_request = reactor_request;
2509
2510    let uri_str = format!("{}/api/reactor", configuration.base_path);
2511    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
2512
2513    if let Some(ref user_agent) = configuration.user_agent {
2514        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2515    }
2516    if let Some(ref apikey) = configuration.api_key {
2517        let key = apikey.key.clone();
2518        let value = match apikey.prefix {
2519            Some(ref prefix) => format!("{} {}", prefix, key),
2520            None => key,
2521        };
2522        req_builder = req_builder.header("Authorization", value);
2523    };
2524    req_builder = req_builder.json(&p_reactor_request);
2525
2526    let req = req_builder.build()?;
2527    let resp = configuration.client.execute(req).await?;
2528
2529    let status = resp.status();
2530
2531    if !status.is_client_error() && !status.is_server_error() {
2532        Ok(())
2533    } else {
2534        let content = resp.text().await?;
2535        let entity: Option<ActivateReactorWithIdError> = serde_json::from_str(&content).ok();
2536        Err(Error::ResponseError(ResponseContent { status, content, entity }))
2537    }
2538}
2539
2540/// Approve a device grant.
2541pub async fn approve_device_with_id(configuration: &configuration::Configuration, ) -> Result<models::DeviceApprovalResponse, Error<ApproveDeviceWithIdError>> {
2542
2543    let uri_str = format!("{}/oauth2/device/approve", configuration.base_path);
2544    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
2545
2546    if let Some(ref user_agent) = configuration.user_agent {
2547        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2548    }
2549    if let Some(ref apikey) = configuration.api_key {
2550        let key = apikey.key.clone();
2551        let value = match apikey.prefix {
2552            Some(ref prefix) => format!("{} {}", prefix, key),
2553            None => key,
2554        };
2555        req_builder = req_builder.header("Authorization", value);
2556    };
2557
2558    let req = req_builder.build()?;
2559    let resp = configuration.client.execute(req).await?;
2560
2561    let status = resp.status();
2562    let content_type = resp
2563        .headers()
2564        .get("content-type")
2565        .and_then(|v| v.to_str().ok())
2566        .unwrap_or("application/octet-stream");
2567    let content_type = super::ContentType::from(content_type);
2568
2569    if !status.is_client_error() && !status.is_server_error() {
2570        let content = resp.text().await?;
2571        match content_type {
2572            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2573            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::DeviceApprovalResponse`"))),
2574            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::DeviceApprovalResponse`")))),
2575        }
2576    } else {
2577        let content = resp.text().await?;
2578        let entity: Option<ApproveDeviceWithIdError> = serde_json::from_str(&content).ok();
2579        Err(Error::ResponseError(ResponseContent { status, content, entity }))
2580    }
2581}
2582
2583/// Cancels the user action.
2584pub async fn cancel_action_with_id(configuration: &configuration::Configuration, action_id: &str, action_request: Option<models::ActionRequest>) -> Result<models::ActionResponse, Error<CancelActionWithIdError>> {
2585    // add a prefix to parameters to efficiently prevent name collisions
2586    let p_action_id = action_id;
2587    let p_action_request = action_request;
2588
2589    let uri_str = format!("{}/api/user/action/{actionId}", configuration.base_path, actionId=crate::apis::urlencode(p_action_id));
2590    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
2591
2592    if let Some(ref user_agent) = configuration.user_agent {
2593        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2594    }
2595    if let Some(ref apikey) = configuration.api_key {
2596        let key = apikey.key.clone();
2597        let value = match apikey.prefix {
2598            Some(ref prefix) => format!("{} {}", prefix, key),
2599            None => key,
2600        };
2601        req_builder = req_builder.header("Authorization", value);
2602    };
2603    req_builder = req_builder.json(&p_action_request);
2604
2605    let req = req_builder.build()?;
2606    let resp = configuration.client.execute(req).await?;
2607
2608    let status = resp.status();
2609    let content_type = resp
2610        .headers()
2611        .get("content-type")
2612        .and_then(|v| v.to_str().ok())
2613        .unwrap_or("application/octet-stream");
2614    let content_type = super::ContentType::from(content_type);
2615
2616    if !status.is_client_error() && !status.is_server_error() {
2617        let content = resp.text().await?;
2618        match content_type {
2619            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2620            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ActionResponse`"))),
2621            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ActionResponse`")))),
2622        }
2623    } else {
2624        let content = resp.text().await?;
2625        let entity: Option<CancelActionWithIdError> = serde_json::from_str(&content).ok();
2626        Err(Error::ResponseError(ResponseContent { status, content, entity }))
2627    }
2628}
2629
2630/// Changes a user's password using their identity (loginId and password). Using a loginId instead of the changePasswordId bypasses the email verification and allows a password to be changed directly without first calling the #forgotPassword method.
2631pub async fn change_password_by_identity_with_id(configuration: &configuration::Configuration, change_password_request: Option<models::ChangePasswordRequest>) -> Result<(), Error<ChangePasswordByIdentityWithIdError>> {
2632    // add a prefix to parameters to efficiently prevent name collisions
2633    let p_change_password_request = change_password_request;
2634
2635    let uri_str = format!("{}/api/user/change-password", configuration.base_path);
2636    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
2637
2638    if let Some(ref user_agent) = configuration.user_agent {
2639        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2640    }
2641    if let Some(ref apikey) = configuration.api_key {
2642        let key = apikey.key.clone();
2643        let value = match apikey.prefix {
2644            Some(ref prefix) => format!("{} {}", prefix, key),
2645            None => key,
2646        };
2647        req_builder = req_builder.header("Authorization", value);
2648    };
2649    req_builder = req_builder.json(&p_change_password_request);
2650
2651    let req = req_builder.build()?;
2652    let resp = configuration.client.execute(req).await?;
2653
2654    let status = resp.status();
2655
2656    if !status.is_client_error() && !status.is_server_error() {
2657        Ok(())
2658    } else {
2659        let content = resp.text().await?;
2660        let entity: Option<ChangePasswordByIdentityWithIdError> = serde_json::from_str(&content).ok();
2661        Err(Error::ResponseError(ResponseContent { status, content, entity }))
2662    }
2663}
2664
2665/// Changes a user's password using the change password Id. This usually occurs after an email has been sent to the user and they clicked on a link to reset their password.  As of version 1.32.2, prefer sending the changePasswordId in the request body. To do this, omit the first parameter, and set the value in the request body.
2666pub async fn change_password_with_id(configuration: &configuration::Configuration, change_password_id: &str, change_password_request: Option<models::ChangePasswordRequest>) -> Result<models::ChangePasswordResponse, Error<ChangePasswordWithIdError>> {
2667    // add a prefix to parameters to efficiently prevent name collisions
2668    let p_change_password_id = change_password_id;
2669    let p_change_password_request = change_password_request;
2670
2671    let uri_str = format!("{}/api/user/change-password/{changePasswordId}", configuration.base_path, changePasswordId=crate::apis::urlencode(p_change_password_id));
2672    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
2673
2674    if let Some(ref user_agent) = configuration.user_agent {
2675        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2676    }
2677    if let Some(ref apikey) = configuration.api_key {
2678        let key = apikey.key.clone();
2679        let value = match apikey.prefix {
2680            Some(ref prefix) => format!("{} {}", prefix, key),
2681            None => key,
2682        };
2683        req_builder = req_builder.header("Authorization", value);
2684    };
2685    req_builder = req_builder.json(&p_change_password_request);
2686
2687    let req = req_builder.build()?;
2688    let resp = configuration.client.execute(req).await?;
2689
2690    let status = resp.status();
2691    let content_type = resp
2692        .headers()
2693        .get("content-type")
2694        .and_then(|v| v.to_str().ok())
2695        .unwrap_or("application/octet-stream");
2696    let content_type = super::ContentType::from(content_type);
2697
2698    if !status.is_client_error() && !status.is_server_error() {
2699        let content = resp.text().await?;
2700        match content_type {
2701            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2702            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ChangePasswordResponse`"))),
2703            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ChangePasswordResponse`")))),
2704        }
2705    } else {
2706        let content = resp.text().await?;
2707        let entity: Option<ChangePasswordWithIdError> = serde_json::from_str(&content).ok();
2708        Err(Error::ResponseError(ResponseContent { status, content, entity }))
2709    }
2710}
2711
2712/// Check to see if the user must obtain a Trust Token Id in order to complete a change password request. When a user has enabled Two-Factor authentication, before you are allowed to use the Change Password API to change your password, you must obtain a Trust Token by completing a Two-Factor Step-Up authentication.  An HTTP status code of 400 with a general error code of [TrustTokenRequired] indicates that a Trust Token is required to make a POST request to this API.
2713pub async fn check_change_password_using_id_with_id(configuration: &configuration::Configuration, change_password_id: &str) -> Result<(), Error<CheckChangePasswordUsingIdWithIdError>> {
2714    // add a prefix to parameters to efficiently prevent name collisions
2715    let p_change_password_id = change_password_id;
2716
2717    let uri_str = format!("{}/api/user/change-password/{changePasswordId}", configuration.base_path, changePasswordId=crate::apis::urlencode(p_change_password_id));
2718    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2719
2720    if let Some(ref user_agent) = configuration.user_agent {
2721        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2722    }
2723    if let Some(ref apikey) = configuration.api_key {
2724        let key = apikey.key.clone();
2725        let value = match apikey.prefix {
2726            Some(ref prefix) => format!("{} {}", prefix, key),
2727            None => key,
2728        };
2729        req_builder = req_builder.header("Authorization", value);
2730    };
2731
2732    let req = req_builder.build()?;
2733    let resp = configuration.client.execute(req).await?;
2734
2735    let status = resp.status();
2736
2737    if !status.is_client_error() && !status.is_server_error() {
2738        Ok(())
2739    } else {
2740        let content = resp.text().await?;
2741        let entity: Option<CheckChangePasswordUsingIdWithIdError> = serde_json::from_str(&content).ok();
2742        Err(Error::ResponseError(ResponseContent { status, content, entity }))
2743    }
2744}
2745
2746/// Adds a comment to the user's account.
2747pub async fn comment_on_user_with_id(configuration: &configuration::Configuration, x_fusion_auth_tenant_id: Option<&str>, user_comment_request: Option<models::UserCommentRequest>) -> Result<models::UserCommentResponse, Error<CommentOnUserWithIdError>> {
2748    // add a prefix to parameters to efficiently prevent name collisions
2749    let p_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
2750    let p_user_comment_request = user_comment_request;
2751
2752    let uri_str = format!("{}/api/user/comment", configuration.base_path);
2753    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
2754
2755    if let Some(ref user_agent) = configuration.user_agent {
2756        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2757    }
2758    if let Some(param_value) = p_x_fusion_auth_tenant_id {
2759        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
2760    }
2761    if let Some(ref apikey) = configuration.api_key {
2762        let key = apikey.key.clone();
2763        let value = match apikey.prefix {
2764            Some(ref prefix) => format!("{} {}", prefix, key),
2765            None => key,
2766        };
2767        req_builder = req_builder.header("Authorization", value);
2768    };
2769    req_builder = req_builder.json(&p_user_comment_request);
2770
2771    let req = req_builder.build()?;
2772    let resp = configuration.client.execute(req).await?;
2773
2774    let status = resp.status();
2775    let content_type = resp
2776        .headers()
2777        .get("content-type")
2778        .and_then(|v| v.to_str().ok())
2779        .unwrap_or("application/octet-stream");
2780    let content_type = super::ContentType::from(content_type);
2781
2782    if !status.is_client_error() && !status.is_server_error() {
2783        let content = resp.text().await?;
2784        match content_type {
2785            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2786            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::UserCommentResponse`"))),
2787            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::UserCommentResponse`")))),
2788        }
2789    } else {
2790        let content = resp.text().await?;
2791        let entity: Option<CommentOnUserWithIdError> = serde_json::from_str(&content).ok();
2792        Err(Error::ResponseError(ResponseContent { status, content, entity }))
2793    }
2794}
2795
2796/// Complete a WebAuthn authentication ceremony by validating the signature against the previously generated challenge without logging the user in
2797pub async fn complete_web_authn_assertion_with_id(configuration: &configuration::Configuration, web_authn_login_request: Option<models::WebAuthnLoginRequest>) -> Result<models::WebAuthnAssertResponse, Error<CompleteWebAuthnAssertionWithIdError>> {
2798    // add a prefix to parameters to efficiently prevent name collisions
2799    let p_web_authn_login_request = web_authn_login_request;
2800
2801    let uri_str = format!("{}/api/webauthn/assert", configuration.base_path);
2802    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
2803
2804    if let Some(ref user_agent) = configuration.user_agent {
2805        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2806    }
2807    if let Some(ref apikey) = configuration.api_key {
2808        let key = apikey.key.clone();
2809        let value = match apikey.prefix {
2810            Some(ref prefix) => format!("{} {}", prefix, key),
2811            None => key,
2812        };
2813        req_builder = req_builder.header("Authorization", value);
2814    };
2815    req_builder = req_builder.json(&p_web_authn_login_request);
2816
2817    let req = req_builder.build()?;
2818    let resp = configuration.client.execute(req).await?;
2819
2820    let status = resp.status();
2821    let content_type = resp
2822        .headers()
2823        .get("content-type")
2824        .and_then(|v| v.to_str().ok())
2825        .unwrap_or("application/octet-stream");
2826    let content_type = super::ContentType::from(content_type);
2827
2828    if !status.is_client_error() && !status.is_server_error() {
2829        let content = resp.text().await?;
2830        match content_type {
2831            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2832            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::WebAuthnAssertResponse`"))),
2833            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::WebAuthnAssertResponse`")))),
2834        }
2835    } else {
2836        let content = resp.text().await?;
2837        let entity: Option<CompleteWebAuthnAssertionWithIdError> = serde_json::from_str(&content).ok();
2838        Err(Error::ResponseError(ResponseContent { status, content, entity }))
2839    }
2840}
2841
2842/// Complete a WebAuthn authentication ceremony by validating the signature against the previously generated challenge and then login the user in
2843pub async fn complete_web_authn_login_with_id(configuration: &configuration::Configuration, web_authn_login_request: Option<models::WebAuthnLoginRequest>) -> Result<models::LoginResponse, Error<CompleteWebAuthnLoginWithIdError>> {
2844    // add a prefix to parameters to efficiently prevent name collisions
2845    let p_web_authn_login_request = web_authn_login_request;
2846
2847    let uri_str = format!("{}/api/webauthn/login", configuration.base_path);
2848    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
2849
2850    if let Some(ref user_agent) = configuration.user_agent {
2851        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2852    }
2853    if let Some(ref apikey) = configuration.api_key {
2854        let key = apikey.key.clone();
2855        let value = match apikey.prefix {
2856            Some(ref prefix) => format!("{} {}", prefix, key),
2857            None => key,
2858        };
2859        req_builder = req_builder.header("Authorization", value);
2860    };
2861    req_builder = req_builder.json(&p_web_authn_login_request);
2862
2863    let req = req_builder.build()?;
2864    let resp = configuration.client.execute(req).await?;
2865
2866    let status = resp.status();
2867    let content_type = resp
2868        .headers()
2869        .get("content-type")
2870        .and_then(|v| v.to_str().ok())
2871        .unwrap_or("application/octet-stream");
2872    let content_type = super::ContentType::from(content_type);
2873
2874    if !status.is_client_error() && !status.is_server_error() {
2875        let content = resp.text().await?;
2876        match content_type {
2877            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2878            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::LoginResponse`"))),
2879            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::LoginResponse`")))),
2880        }
2881    } else {
2882        let content = resp.text().await?;
2883        let entity: Option<CompleteWebAuthnLoginWithIdError> = serde_json::from_str(&content).ok();
2884        Err(Error::ResponseError(ResponseContent { status, content, entity }))
2885    }
2886}
2887
2888/// Complete a WebAuthn registration ceremony by validating the client request and saving the new credential
2889pub async fn complete_web_authn_registration_with_id(configuration: &configuration::Configuration, web_authn_register_complete_request: Option<models::WebAuthnRegisterCompleteRequest>) -> Result<models::WebAuthnRegisterCompleteResponse, Error<CompleteWebAuthnRegistrationWithIdError>> {
2890    // add a prefix to parameters to efficiently prevent name collisions
2891    let p_web_authn_register_complete_request = web_authn_register_complete_request;
2892
2893    let uri_str = format!("{}/api/webauthn/register/complete", configuration.base_path);
2894    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
2895
2896    if let Some(ref user_agent) = configuration.user_agent {
2897        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2898    }
2899    if let Some(ref apikey) = configuration.api_key {
2900        let key = apikey.key.clone();
2901        let value = match apikey.prefix {
2902            Some(ref prefix) => format!("{} {}", prefix, key),
2903            None => key,
2904        };
2905        req_builder = req_builder.header("Authorization", value);
2906    };
2907    req_builder = req_builder.json(&p_web_authn_register_complete_request);
2908
2909    let req = req_builder.build()?;
2910    let resp = configuration.client.execute(req).await?;
2911
2912    let status = resp.status();
2913    let content_type = resp
2914        .headers()
2915        .get("content-type")
2916        .and_then(|v| v.to_str().ok())
2917        .unwrap_or("application/octet-stream");
2918    let content_type = super::ContentType::from(content_type);
2919
2920    if !status.is_client_error() && !status.is_server_error() {
2921        let content = resp.text().await?;
2922        match content_type {
2923            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2924            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::WebAuthnRegisterCompleteResponse`"))),
2925            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::WebAuthnRegisterCompleteResponse`")))),
2926        }
2927    } else {
2928        let content = resp.text().await?;
2929        let entity: Option<CompleteWebAuthnRegistrationWithIdError> = serde_json::from_str(&content).ok();
2930        Err(Error::ResponseError(ResponseContent { status, content, entity }))
2931    }
2932}
2933
2934/// Creates an API key. You can optionally specify a unique Id for the key, if not provided one will be generated. an API key can only be created with equal or lesser authority. An API key cannot create another API key unless it is granted  to that API key.  If an API key is locked to a tenant, it can only create API Keys for that same tenant.
2935pub async fn create_api_key(configuration: &configuration::Configuration, api_key_request: Option<models::ApiKeyRequest>) -> Result<models::ApiKeyResponse, Error<CreateApiKeyError>> {
2936    // add a prefix to parameters to efficiently prevent name collisions
2937    let p_api_key_request = api_key_request;
2938
2939    let uri_str = format!("{}/api/api-key", configuration.base_path);
2940    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
2941
2942    if let Some(ref user_agent) = configuration.user_agent {
2943        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2944    }
2945    if let Some(ref apikey) = configuration.api_key {
2946        let key = apikey.key.clone();
2947        let value = match apikey.prefix {
2948            Some(ref prefix) => format!("{} {}", prefix, key),
2949            None => key,
2950        };
2951        req_builder = req_builder.header("Authorization", value);
2952    };
2953    req_builder = req_builder.json(&p_api_key_request);
2954
2955    let req = req_builder.build()?;
2956    let resp = configuration.client.execute(req).await?;
2957
2958    let status = resp.status();
2959    let content_type = resp
2960        .headers()
2961        .get("content-type")
2962        .and_then(|v| v.to_str().ok())
2963        .unwrap_or("application/octet-stream");
2964    let content_type = super::ContentType::from(content_type);
2965
2966    if !status.is_client_error() && !status.is_server_error() {
2967        let content = resp.text().await?;
2968        match content_type {
2969            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2970            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ApiKeyResponse`"))),
2971            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ApiKeyResponse`")))),
2972        }
2973    } else {
2974        let content = resp.text().await?;
2975        let entity: Option<CreateApiKeyError> = serde_json::from_str(&content).ok();
2976        Err(Error::ResponseError(ResponseContent { status, content, entity }))
2977    }
2978}
2979
2980/// Creates an API key. You can optionally specify a unique Id for the key, if not provided one will be generated. an API key can only be created with equal or lesser authority. An API key cannot create another API key unless it is granted  to that API key.  If an API key is locked to a tenant, it can only create API Keys for that same tenant. OR Updates an authentication API key by given id
2981pub async fn create_api_key_with_id(configuration: &configuration::Configuration, key_id: &str, api_key_request: Option<models::ApiKeyRequest>) -> Result<models::ApiKeyResponse, Error<CreateApiKeyWithIdError>> {
2982    // add a prefix to parameters to efficiently prevent name collisions
2983    let p_key_id = key_id;
2984    let p_api_key_request = api_key_request;
2985
2986    let uri_str = format!("{}/api/api-key/{keyId}", configuration.base_path, keyId=crate::apis::urlencode(p_key_id));
2987    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
2988
2989    if let Some(ref user_agent) = configuration.user_agent {
2990        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2991    }
2992    if let Some(ref apikey) = configuration.api_key {
2993        let key = apikey.key.clone();
2994        let value = match apikey.prefix {
2995            Some(ref prefix) => format!("{} {}", prefix, key),
2996            None => key,
2997        };
2998        req_builder = req_builder.header("Authorization", value);
2999    };
3000    req_builder = req_builder.json(&p_api_key_request);
3001
3002    let req = req_builder.build()?;
3003    let resp = configuration.client.execute(req).await?;
3004
3005    let status = resp.status();
3006    let content_type = resp
3007        .headers()
3008        .get("content-type")
3009        .and_then(|v| v.to_str().ok())
3010        .unwrap_or("application/octet-stream");
3011    let content_type = super::ContentType::from(content_type);
3012
3013    if !status.is_client_error() && !status.is_server_error() {
3014        let content = resp.text().await?;
3015        match content_type {
3016            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3017            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ApiKeyResponse`"))),
3018            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ApiKeyResponse`")))),
3019        }
3020    } else {
3021        let content = resp.text().await?;
3022        let entity: Option<CreateApiKeyWithIdError> = serde_json::from_str(&content).ok();
3023        Err(Error::ResponseError(ResponseContent { status, content, entity }))
3024    }
3025}
3026
3027/// Creates an application. You can optionally specify an Id for the application, if not provided one will be generated.
3028pub async fn create_application(configuration: &configuration::Configuration, x_fusion_auth_tenant_id: Option<&str>, application_request: Option<models::ApplicationRequest>) -> Result<models::ApplicationResponse, Error<CreateApplicationError>> {
3029    // add a prefix to parameters to efficiently prevent name collisions
3030    let p_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
3031    let p_application_request = application_request;
3032
3033    let uri_str = format!("{}/api/application", configuration.base_path);
3034    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
3035
3036    if let Some(ref user_agent) = configuration.user_agent {
3037        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3038    }
3039    if let Some(param_value) = p_x_fusion_auth_tenant_id {
3040        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
3041    }
3042    if let Some(ref apikey) = configuration.api_key {
3043        let key = apikey.key.clone();
3044        let value = match apikey.prefix {
3045            Some(ref prefix) => format!("{} {}", prefix, key),
3046            None => key,
3047        };
3048        req_builder = req_builder.header("Authorization", value);
3049    };
3050    req_builder = req_builder.json(&p_application_request);
3051
3052    let req = req_builder.build()?;
3053    let resp = configuration.client.execute(req).await?;
3054
3055    let status = resp.status();
3056    let content_type = resp
3057        .headers()
3058        .get("content-type")
3059        .and_then(|v| v.to_str().ok())
3060        .unwrap_or("application/octet-stream");
3061    let content_type = super::ContentType::from(content_type);
3062
3063    if !status.is_client_error() && !status.is_server_error() {
3064        let content = resp.text().await?;
3065        match content_type {
3066            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3067            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ApplicationResponse`"))),
3068            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ApplicationResponse`")))),
3069        }
3070    } else {
3071        let content = resp.text().await?;
3072        let entity: Option<CreateApplicationError> = serde_json::from_str(&content).ok();
3073        Err(Error::ResponseError(ResponseContent { status, content, entity }))
3074    }
3075}
3076
3077/// Creates a new role for an application. You must specify the Id of the application you are creating the role for. You can optionally specify an Id for the role inside the ApplicationRole object itself, if not provided one will be generated.
3078pub async fn create_application_role(configuration: &configuration::Configuration, application_id: &str, x_fusion_auth_tenant_id: Option<&str>, application_request: Option<models::ApplicationRequest>) -> Result<models::ApplicationResponse, Error<CreateApplicationRoleError>> {
3079    // add a prefix to parameters to efficiently prevent name collisions
3080    let p_application_id = application_id;
3081    let p_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
3082    let p_application_request = application_request;
3083
3084    let uri_str = format!("{}/api/application/{applicationId}/role", configuration.base_path, applicationId=crate::apis::urlencode(p_application_id));
3085    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
3086
3087    if let Some(ref user_agent) = configuration.user_agent {
3088        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3089    }
3090    if let Some(param_value) = p_x_fusion_auth_tenant_id {
3091        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
3092    }
3093    if let Some(ref apikey) = configuration.api_key {
3094        let key = apikey.key.clone();
3095        let value = match apikey.prefix {
3096            Some(ref prefix) => format!("{} {}", prefix, key),
3097            None => key,
3098        };
3099        req_builder = req_builder.header("Authorization", value);
3100    };
3101    req_builder = req_builder.json(&p_application_request);
3102
3103    let req = req_builder.build()?;
3104    let resp = configuration.client.execute(req).await?;
3105
3106    let status = resp.status();
3107    let content_type = resp
3108        .headers()
3109        .get("content-type")
3110        .and_then(|v| v.to_str().ok())
3111        .unwrap_or("application/octet-stream");
3112    let content_type = super::ContentType::from(content_type);
3113
3114    if !status.is_client_error() && !status.is_server_error() {
3115        let content = resp.text().await?;
3116        match content_type {
3117            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3118            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ApplicationResponse`"))),
3119            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ApplicationResponse`")))),
3120        }
3121    } else {
3122        let content = resp.text().await?;
3123        let entity: Option<CreateApplicationRoleError> = serde_json::from_str(&content).ok();
3124        Err(Error::ResponseError(ResponseContent { status, content, entity }))
3125    }
3126}
3127
3128/// Creates a new role for an application. You must specify the Id of the application you are creating the role for. You can optionally specify an Id for the role inside the ApplicationRole object itself, if not provided one will be generated.
3129pub async fn create_application_role_with_id(configuration: &configuration::Configuration, application_id: &str, role_id: &str, x_fusion_auth_tenant_id: Option<&str>, application_request: Option<models::ApplicationRequest>) -> Result<models::ApplicationResponse, Error<CreateApplicationRoleWithIdError>> {
3130    // add a prefix to parameters to efficiently prevent name collisions
3131    let p_application_id = application_id;
3132    let p_role_id = role_id;
3133    let p_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
3134    let p_application_request = application_request;
3135
3136    let uri_str = format!("{}/api/application/{applicationId}/role/{roleId}", configuration.base_path, applicationId=crate::apis::urlencode(p_application_id), roleId=crate::apis::urlencode(p_role_id));
3137    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
3138
3139    if let Some(ref user_agent) = configuration.user_agent {
3140        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3141    }
3142    if let Some(param_value) = p_x_fusion_auth_tenant_id {
3143        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
3144    }
3145    if let Some(ref apikey) = configuration.api_key {
3146        let key = apikey.key.clone();
3147        let value = match apikey.prefix {
3148            Some(ref prefix) => format!("{} {}", prefix, key),
3149            None => key,
3150        };
3151        req_builder = req_builder.header("Authorization", value);
3152    };
3153    req_builder = req_builder.json(&p_application_request);
3154
3155    let req = req_builder.build()?;
3156    let resp = configuration.client.execute(req).await?;
3157
3158    let status = resp.status();
3159    let content_type = resp
3160        .headers()
3161        .get("content-type")
3162        .and_then(|v| v.to_str().ok())
3163        .unwrap_or("application/octet-stream");
3164    let content_type = super::ContentType::from(content_type);
3165
3166    if !status.is_client_error() && !status.is_server_error() {
3167        let content = resp.text().await?;
3168        match content_type {
3169            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3170            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ApplicationResponse`"))),
3171            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ApplicationResponse`")))),
3172        }
3173    } else {
3174        let content = resp.text().await?;
3175        let entity: Option<CreateApplicationRoleWithIdError> = serde_json::from_str(&content).ok();
3176        Err(Error::ResponseError(ResponseContent { status, content, entity }))
3177    }
3178}
3179
3180/// Creates an application. You can optionally specify an Id for the application, if not provided one will be generated.
3181pub async fn create_application_with_id(configuration: &configuration::Configuration, application_id: &str, x_fusion_auth_tenant_id: Option<&str>, application_request: Option<models::ApplicationRequest>) -> Result<models::ApplicationResponse, Error<CreateApplicationWithIdError>> {
3182    // add a prefix to parameters to efficiently prevent name collisions
3183    let p_application_id = application_id;
3184    let p_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
3185    let p_application_request = application_request;
3186
3187    let uri_str = format!("{}/api/application/{applicationId}", configuration.base_path, applicationId=crate::apis::urlencode(p_application_id));
3188    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
3189
3190    if let Some(ref user_agent) = configuration.user_agent {
3191        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3192    }
3193    if let Some(param_value) = p_x_fusion_auth_tenant_id {
3194        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
3195    }
3196    if let Some(ref apikey) = configuration.api_key {
3197        let key = apikey.key.clone();
3198        let value = match apikey.prefix {
3199            Some(ref prefix) => format!("{} {}", prefix, key),
3200            None => key,
3201        };
3202        req_builder = req_builder.header("Authorization", value);
3203    };
3204    req_builder = req_builder.json(&p_application_request);
3205
3206    let req = req_builder.build()?;
3207    let resp = configuration.client.execute(req).await?;
3208
3209    let status = resp.status();
3210    let content_type = resp
3211        .headers()
3212        .get("content-type")
3213        .and_then(|v| v.to_str().ok())
3214        .unwrap_or("application/octet-stream");
3215    let content_type = super::ContentType::from(content_type);
3216
3217    if !status.is_client_error() && !status.is_server_error() {
3218        let content = resp.text().await?;
3219        match content_type {
3220            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3221            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ApplicationResponse`"))),
3222            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ApplicationResponse`")))),
3223        }
3224    } else {
3225        let content = resp.text().await?;
3226        let entity: Option<CreateApplicationWithIdError> = serde_json::from_str(&content).ok();
3227        Err(Error::ResponseError(ResponseContent { status, content, entity }))
3228    }
3229}
3230
3231/// Creates an audit log with the message and user name (usually an email). Audit logs should be written anytime you make changes to the FusionAuth database. When using the FusionAuth App web interface, any changes are automatically written to the audit log. However, if you are accessing the API, you must write the audit logs yourself.
3232pub async fn create_audit_log_with_id(configuration: &configuration::Configuration, audit_log_request: Option<models::AuditLogRequest>) -> Result<models::AuditLogResponse, Error<CreateAuditLogWithIdError>> {
3233    // add a prefix to parameters to efficiently prevent name collisions
3234    let p_audit_log_request = audit_log_request;
3235
3236    let uri_str = format!("{}/api/system/audit-log", configuration.base_path);
3237    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
3238
3239    if let Some(ref user_agent) = configuration.user_agent {
3240        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3241    }
3242    if let Some(ref apikey) = configuration.api_key {
3243        let key = apikey.key.clone();
3244        let value = match apikey.prefix {
3245            Some(ref prefix) => format!("{} {}", prefix, key),
3246            None => key,
3247        };
3248        req_builder = req_builder.header("Authorization", value);
3249    };
3250    req_builder = req_builder.json(&p_audit_log_request);
3251
3252    let req = req_builder.build()?;
3253    let resp = configuration.client.execute(req).await?;
3254
3255    let status = resp.status();
3256    let content_type = resp
3257        .headers()
3258        .get("content-type")
3259        .and_then(|v| v.to_str().ok())
3260        .unwrap_or("application/octet-stream");
3261    let content_type = super::ContentType::from(content_type);
3262
3263    if !status.is_client_error() && !status.is_server_error() {
3264        let content = resp.text().await?;
3265        match content_type {
3266            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3267            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::AuditLogResponse`"))),
3268            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::AuditLogResponse`")))),
3269        }
3270    } else {
3271        let content = resp.text().await?;
3272        let entity: Option<CreateAuditLogWithIdError> = serde_json::from_str(&content).ok();
3273        Err(Error::ResponseError(ResponseContent { status, content, entity }))
3274    }
3275}
3276
3277/// Creates a connector.  You can optionally specify an Id for the connector, if not provided one will be generated.
3278pub async fn create_connector(configuration: &configuration::Configuration, connector_request: Option<models::ConnectorRequest>) -> Result<models::ConnectorResponse, Error<CreateConnectorError>> {
3279    // add a prefix to parameters to efficiently prevent name collisions
3280    let p_connector_request = connector_request;
3281
3282    let uri_str = format!("{}/api/connector", configuration.base_path);
3283    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
3284
3285    if let Some(ref user_agent) = configuration.user_agent {
3286        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3287    }
3288    if let Some(ref apikey) = configuration.api_key {
3289        let key = apikey.key.clone();
3290        let value = match apikey.prefix {
3291            Some(ref prefix) => format!("{} {}", prefix, key),
3292            None => key,
3293        };
3294        req_builder = req_builder.header("Authorization", value);
3295    };
3296    req_builder = req_builder.json(&p_connector_request);
3297
3298    let req = req_builder.build()?;
3299    let resp = configuration.client.execute(req).await?;
3300
3301    let status = resp.status();
3302    let content_type = resp
3303        .headers()
3304        .get("content-type")
3305        .and_then(|v| v.to_str().ok())
3306        .unwrap_or("application/octet-stream");
3307    let content_type = super::ContentType::from(content_type);
3308
3309    if !status.is_client_error() && !status.is_server_error() {
3310        let content = resp.text().await?;
3311        match content_type {
3312            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3313            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ConnectorResponse`"))),
3314            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ConnectorResponse`")))),
3315        }
3316    } else {
3317        let content = resp.text().await?;
3318        let entity: Option<CreateConnectorError> = serde_json::from_str(&content).ok();
3319        Err(Error::ResponseError(ResponseContent { status, content, entity }))
3320    }
3321}
3322
3323/// Creates a connector.  You can optionally specify an Id for the connector, if not provided one will be generated.
3324pub async fn create_connector_with_id(configuration: &configuration::Configuration, connector_id: &str, connector_request: Option<models::ConnectorRequest>) -> Result<models::ConnectorResponse, Error<CreateConnectorWithIdError>> {
3325    // add a prefix to parameters to efficiently prevent name collisions
3326    let p_connector_id = connector_id;
3327    let p_connector_request = connector_request;
3328
3329    let uri_str = format!("{}/api/connector/{connectorId}", configuration.base_path, connectorId=crate::apis::urlencode(p_connector_id));
3330    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
3331
3332    if let Some(ref user_agent) = configuration.user_agent {
3333        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3334    }
3335    if let Some(ref apikey) = configuration.api_key {
3336        let key = apikey.key.clone();
3337        let value = match apikey.prefix {
3338            Some(ref prefix) => format!("{} {}", prefix, key),
3339            None => key,
3340        };
3341        req_builder = req_builder.header("Authorization", value);
3342    };
3343    req_builder = req_builder.json(&p_connector_request);
3344
3345    let req = req_builder.build()?;
3346    let resp = configuration.client.execute(req).await?;
3347
3348    let status = resp.status();
3349    let content_type = resp
3350        .headers()
3351        .get("content-type")
3352        .and_then(|v| v.to_str().ok())
3353        .unwrap_or("application/octet-stream");
3354    let content_type = super::ContentType::from(content_type);
3355
3356    if !status.is_client_error() && !status.is_server_error() {
3357        let content = resp.text().await?;
3358        match content_type {
3359            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3360            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ConnectorResponse`"))),
3361            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ConnectorResponse`")))),
3362        }
3363    } else {
3364        let content = resp.text().await?;
3365        let entity: Option<CreateConnectorWithIdError> = serde_json::from_str(&content).ok();
3366        Err(Error::ResponseError(ResponseContent { status, content, entity }))
3367    }
3368}
3369
3370/// Creates a user consent type. You can optionally specify an Id for the consent type, if not provided one will be generated.
3371pub async fn create_consent(configuration: &configuration::Configuration, x_fusion_auth_tenant_id: Option<&str>, consent_request: Option<models::ConsentRequest>) -> Result<models::ConsentResponse, Error<CreateConsentError>> {
3372    // add a prefix to parameters to efficiently prevent name collisions
3373    let p_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
3374    let p_consent_request = consent_request;
3375
3376    let uri_str = format!("{}/api/consent", configuration.base_path);
3377    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
3378
3379    if let Some(ref user_agent) = configuration.user_agent {
3380        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3381    }
3382    if let Some(param_value) = p_x_fusion_auth_tenant_id {
3383        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
3384    }
3385    if let Some(ref apikey) = configuration.api_key {
3386        let key = apikey.key.clone();
3387        let value = match apikey.prefix {
3388            Some(ref prefix) => format!("{} {}", prefix, key),
3389            None => key,
3390        };
3391        req_builder = req_builder.header("Authorization", value);
3392    };
3393    req_builder = req_builder.json(&p_consent_request);
3394
3395    let req = req_builder.build()?;
3396    let resp = configuration.client.execute(req).await?;
3397
3398    let status = resp.status();
3399    let content_type = resp
3400        .headers()
3401        .get("content-type")
3402        .and_then(|v| v.to_str().ok())
3403        .unwrap_or("application/octet-stream");
3404    let content_type = super::ContentType::from(content_type);
3405
3406    if !status.is_client_error() && !status.is_server_error() {
3407        let content = resp.text().await?;
3408        match content_type {
3409            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3410            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ConsentResponse`"))),
3411            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ConsentResponse`")))),
3412        }
3413    } else {
3414        let content = resp.text().await?;
3415        let entity: Option<CreateConsentError> = serde_json::from_str(&content).ok();
3416        Err(Error::ResponseError(ResponseContent { status, content, entity }))
3417    }
3418}
3419
3420/// Creates a user consent type. You can optionally specify an Id for the consent type, if not provided one will be generated.
3421pub async fn create_consent_with_id(configuration: &configuration::Configuration, consent_id: &str, x_fusion_auth_tenant_id: Option<&str>, consent_request: Option<models::ConsentRequest>) -> Result<models::ConsentResponse, Error<CreateConsentWithIdError>> {
3422    // add a prefix to parameters to efficiently prevent name collisions
3423    let p_consent_id = consent_id;
3424    let p_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
3425    let p_consent_request = consent_request;
3426
3427    let uri_str = format!("{}/api/consent/{consentId}", configuration.base_path, consentId=crate::apis::urlencode(p_consent_id));
3428    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
3429
3430    if let Some(ref user_agent) = configuration.user_agent {
3431        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3432    }
3433    if let Some(param_value) = p_x_fusion_auth_tenant_id {
3434        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
3435    }
3436    if let Some(ref apikey) = configuration.api_key {
3437        let key = apikey.key.clone();
3438        let value = match apikey.prefix {
3439            Some(ref prefix) => format!("{} {}", prefix, key),
3440            None => key,
3441        };
3442        req_builder = req_builder.header("Authorization", value);
3443    };
3444    req_builder = req_builder.json(&p_consent_request);
3445
3446    let req = req_builder.build()?;
3447    let resp = configuration.client.execute(req).await?;
3448
3449    let status = resp.status();
3450    let content_type = resp
3451        .headers()
3452        .get("content-type")
3453        .and_then(|v| v.to_str().ok())
3454        .unwrap_or("application/octet-stream");
3455    let content_type = super::ContentType::from(content_type);
3456
3457    if !status.is_client_error() && !status.is_server_error() {
3458        let content = resp.text().await?;
3459        match content_type {
3460            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3461            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ConsentResponse`"))),
3462            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ConsentResponse`")))),
3463        }
3464    } else {
3465        let content = resp.text().await?;
3466        let entity: Option<CreateConsentWithIdError> = serde_json::from_str(&content).ok();
3467        Err(Error::ResponseError(ResponseContent { status, content, entity }))
3468    }
3469}
3470
3471/// Creates an email template. You can optionally specify an Id for the template, if not provided one will be generated.
3472pub async fn create_email_template(configuration: &configuration::Configuration, x_fusion_auth_tenant_id: Option<&str>, email_template_request: Option<models::EmailTemplateRequest>) -> Result<models::EmailTemplateResponse, Error<CreateEmailTemplateError>> {
3473    // add a prefix to parameters to efficiently prevent name collisions
3474    let p_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
3475    let p_email_template_request = email_template_request;
3476
3477    let uri_str = format!("{}/api/email/template", configuration.base_path);
3478    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
3479
3480    if let Some(ref user_agent) = configuration.user_agent {
3481        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3482    }
3483    if let Some(param_value) = p_x_fusion_auth_tenant_id {
3484        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
3485    }
3486    if let Some(ref apikey) = configuration.api_key {
3487        let key = apikey.key.clone();
3488        let value = match apikey.prefix {
3489            Some(ref prefix) => format!("{} {}", prefix, key),
3490            None => key,
3491        };
3492        req_builder = req_builder.header("Authorization", value);
3493    };
3494    req_builder = req_builder.json(&p_email_template_request);
3495
3496    let req = req_builder.build()?;
3497    let resp = configuration.client.execute(req).await?;
3498
3499    let status = resp.status();
3500    let content_type = resp
3501        .headers()
3502        .get("content-type")
3503        .and_then(|v| v.to_str().ok())
3504        .unwrap_or("application/octet-stream");
3505    let content_type = super::ContentType::from(content_type);
3506
3507    if !status.is_client_error() && !status.is_server_error() {
3508        let content = resp.text().await?;
3509        match content_type {
3510            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3511            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::EmailTemplateResponse`"))),
3512            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::EmailTemplateResponse`")))),
3513        }
3514    } else {
3515        let content = resp.text().await?;
3516        let entity: Option<CreateEmailTemplateError> = serde_json::from_str(&content).ok();
3517        Err(Error::ResponseError(ResponseContent { status, content, entity }))
3518    }
3519}
3520
3521/// Creates an email template. You can optionally specify an Id for the template, if not provided one will be generated.
3522pub async fn create_email_template_with_id(configuration: &configuration::Configuration, email_template_id: &str, x_fusion_auth_tenant_id: Option<&str>, email_template_request: Option<models::EmailTemplateRequest>) -> Result<models::EmailTemplateResponse, Error<CreateEmailTemplateWithIdError>> {
3523    // add a prefix to parameters to efficiently prevent name collisions
3524    let p_email_template_id = email_template_id;
3525    let p_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
3526    let p_email_template_request = email_template_request;
3527
3528    let uri_str = format!("{}/api/email/template/{emailTemplateId}", configuration.base_path, emailTemplateId=crate::apis::urlencode(p_email_template_id));
3529    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
3530
3531    if let Some(ref user_agent) = configuration.user_agent {
3532        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3533    }
3534    if let Some(param_value) = p_x_fusion_auth_tenant_id {
3535        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
3536    }
3537    if let Some(ref apikey) = configuration.api_key {
3538        let key = apikey.key.clone();
3539        let value = match apikey.prefix {
3540            Some(ref prefix) => format!("{} {}", prefix, key),
3541            None => key,
3542        };
3543        req_builder = req_builder.header("Authorization", value);
3544    };
3545    req_builder = req_builder.json(&p_email_template_request);
3546
3547    let req = req_builder.build()?;
3548    let resp = configuration.client.execute(req).await?;
3549
3550    let status = resp.status();
3551    let content_type = resp
3552        .headers()
3553        .get("content-type")
3554        .and_then(|v| v.to_str().ok())
3555        .unwrap_or("application/octet-stream");
3556    let content_type = super::ContentType::from(content_type);
3557
3558    if !status.is_client_error() && !status.is_server_error() {
3559        let content = resp.text().await?;
3560        match content_type {
3561            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3562            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::EmailTemplateResponse`"))),
3563            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::EmailTemplateResponse`")))),
3564        }
3565    } else {
3566        let content = resp.text().await?;
3567        let entity: Option<CreateEmailTemplateWithIdError> = serde_json::from_str(&content).ok();
3568        Err(Error::ResponseError(ResponseContent { status, content, entity }))
3569    }
3570}
3571
3572/// Creates an Entity. You can optionally specify an Id for the Entity. If not provided one will be generated.
3573pub async fn create_entity(configuration: &configuration::Configuration, x_fusion_auth_tenant_id: Option<&str>, entity_request: Option<models::EntityRequest>) -> Result<models::EntityResponse, Error<CreateEntityError>> {
3574    // add a prefix to parameters to efficiently prevent name collisions
3575    let p_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
3576    let p_entity_request = entity_request;
3577
3578    let uri_str = format!("{}/api/entity", configuration.base_path);
3579    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
3580
3581    if let Some(ref user_agent) = configuration.user_agent {
3582        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3583    }
3584    if let Some(param_value) = p_x_fusion_auth_tenant_id {
3585        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
3586    }
3587    if let Some(ref apikey) = configuration.api_key {
3588        let key = apikey.key.clone();
3589        let value = match apikey.prefix {
3590            Some(ref prefix) => format!("{} {}", prefix, key),
3591            None => key,
3592        };
3593        req_builder = req_builder.header("Authorization", value);
3594    };
3595    req_builder = req_builder.json(&p_entity_request);
3596
3597    let req = req_builder.build()?;
3598    let resp = configuration.client.execute(req).await?;
3599
3600    let status = resp.status();
3601    let content_type = resp
3602        .headers()
3603        .get("content-type")
3604        .and_then(|v| v.to_str().ok())
3605        .unwrap_or("application/octet-stream");
3606    let content_type = super::ContentType::from(content_type);
3607
3608    if !status.is_client_error() && !status.is_server_error() {
3609        let content = resp.text().await?;
3610        match content_type {
3611            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3612            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::EntityResponse`"))),
3613            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::EntityResponse`")))),
3614        }
3615    } else {
3616        let content = resp.text().await?;
3617        let entity: Option<CreateEntityError> = serde_json::from_str(&content).ok();
3618        Err(Error::ResponseError(ResponseContent { status, content, entity }))
3619    }
3620}
3621
3622/// Creates a Entity Type. You can optionally specify an Id for the Entity Type, if not provided one will be generated.
3623pub async fn create_entity_type(configuration: &configuration::Configuration, entity_type_request: Option<models::EntityTypeRequest>) -> Result<models::EntityTypeResponse, Error<CreateEntityTypeError>> {
3624    // add a prefix to parameters to efficiently prevent name collisions
3625    let p_entity_type_request = entity_type_request;
3626
3627    let uri_str = format!("{}/api/entity/type", configuration.base_path);
3628    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
3629
3630    if let Some(ref user_agent) = configuration.user_agent {
3631        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3632    }
3633    if let Some(ref apikey) = configuration.api_key {
3634        let key = apikey.key.clone();
3635        let value = match apikey.prefix {
3636            Some(ref prefix) => format!("{} {}", prefix, key),
3637            None => key,
3638        };
3639        req_builder = req_builder.header("Authorization", value);
3640    };
3641    req_builder = req_builder.json(&p_entity_type_request);
3642
3643    let req = req_builder.build()?;
3644    let resp = configuration.client.execute(req).await?;
3645
3646    let status = resp.status();
3647    let content_type = resp
3648        .headers()
3649        .get("content-type")
3650        .and_then(|v| v.to_str().ok())
3651        .unwrap_or("application/octet-stream");
3652    let content_type = super::ContentType::from(content_type);
3653
3654    if !status.is_client_error() && !status.is_server_error() {
3655        let content = resp.text().await?;
3656        match content_type {
3657            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3658            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::EntityTypeResponse`"))),
3659            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::EntityTypeResponse`")))),
3660        }
3661    } else {
3662        let content = resp.text().await?;
3663        let entity: Option<CreateEntityTypeError> = serde_json::from_str(&content).ok();
3664        Err(Error::ResponseError(ResponseContent { status, content, entity }))
3665    }
3666}
3667
3668/// Creates a new permission for an entity type. You must specify the Id of the entity type you are creating the permission for. You can optionally specify an Id for the permission inside the EntityTypePermission object itself, if not provided one will be generated.
3669pub async fn create_entity_type_permission(configuration: &configuration::Configuration, entity_type_id: &str, entity_type_request: Option<models::EntityTypeRequest>) -> Result<models::EntityTypeResponse, Error<CreateEntityTypePermissionError>> {
3670    // add a prefix to parameters to efficiently prevent name collisions
3671    let p_entity_type_id = entity_type_id;
3672    let p_entity_type_request = entity_type_request;
3673
3674    let uri_str = format!("{}/api/entity/type/{entityTypeId}/permission", configuration.base_path, entityTypeId=crate::apis::urlencode(p_entity_type_id));
3675    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
3676
3677    if let Some(ref user_agent) = configuration.user_agent {
3678        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3679    }
3680    if let Some(ref apikey) = configuration.api_key {
3681        let key = apikey.key.clone();
3682        let value = match apikey.prefix {
3683            Some(ref prefix) => format!("{} {}", prefix, key),
3684            None => key,
3685        };
3686        req_builder = req_builder.header("Authorization", value);
3687    };
3688    req_builder = req_builder.json(&p_entity_type_request);
3689
3690    let req = req_builder.build()?;
3691    let resp = configuration.client.execute(req).await?;
3692
3693    let status = resp.status();
3694    let content_type = resp
3695        .headers()
3696        .get("content-type")
3697        .and_then(|v| v.to_str().ok())
3698        .unwrap_or("application/octet-stream");
3699    let content_type = super::ContentType::from(content_type);
3700
3701    if !status.is_client_error() && !status.is_server_error() {
3702        let content = resp.text().await?;
3703        match content_type {
3704            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3705            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::EntityTypeResponse`"))),
3706            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::EntityTypeResponse`")))),
3707        }
3708    } else {
3709        let content = resp.text().await?;
3710        let entity: Option<CreateEntityTypePermissionError> = serde_json::from_str(&content).ok();
3711        Err(Error::ResponseError(ResponseContent { status, content, entity }))
3712    }
3713}
3714
3715/// Creates a new permission for an entity type. You must specify the Id of the entity type you are creating the permission for. You can optionally specify an Id for the permission inside the EntityTypePermission object itself, if not provided one will be generated.
3716pub async fn create_entity_type_permission_with_id(configuration: &configuration::Configuration, entity_type_id: &str, permission_id: &str, entity_type_request: Option<models::EntityTypeRequest>) -> Result<models::EntityTypeResponse, Error<CreateEntityTypePermissionWithIdError>> {
3717    // add a prefix to parameters to efficiently prevent name collisions
3718    let p_entity_type_id = entity_type_id;
3719    let p_permission_id = permission_id;
3720    let p_entity_type_request = entity_type_request;
3721
3722    let uri_str = format!("{}/api/entity/type/{entityTypeId}/permission/{permissionId}", configuration.base_path, entityTypeId=crate::apis::urlencode(p_entity_type_id), permissionId=crate::apis::urlencode(p_permission_id));
3723    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
3724
3725    if let Some(ref user_agent) = configuration.user_agent {
3726        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3727    }
3728    if let Some(ref apikey) = configuration.api_key {
3729        let key = apikey.key.clone();
3730        let value = match apikey.prefix {
3731            Some(ref prefix) => format!("{} {}", prefix, key),
3732            None => key,
3733        };
3734        req_builder = req_builder.header("Authorization", value);
3735    };
3736    req_builder = req_builder.json(&p_entity_type_request);
3737
3738    let req = req_builder.build()?;
3739    let resp = configuration.client.execute(req).await?;
3740
3741    let status = resp.status();
3742    let content_type = resp
3743        .headers()
3744        .get("content-type")
3745        .and_then(|v| v.to_str().ok())
3746        .unwrap_or("application/octet-stream");
3747    let content_type = super::ContentType::from(content_type);
3748
3749    if !status.is_client_error() && !status.is_server_error() {
3750        let content = resp.text().await?;
3751        match content_type {
3752            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3753            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::EntityTypeResponse`"))),
3754            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::EntityTypeResponse`")))),
3755        }
3756    } else {
3757        let content = resp.text().await?;
3758        let entity: Option<CreateEntityTypePermissionWithIdError> = serde_json::from_str(&content).ok();
3759        Err(Error::ResponseError(ResponseContent { status, content, entity }))
3760    }
3761}
3762
3763/// Creates a Entity Type. You can optionally specify an Id for the Entity Type, if not provided one will be generated.
3764pub async fn create_entity_type_with_id(configuration: &configuration::Configuration, entity_type_id: &str, entity_type_request: Option<models::EntityTypeRequest>) -> Result<models::EntityTypeResponse, Error<CreateEntityTypeWithIdError>> {
3765    // add a prefix to parameters to efficiently prevent name collisions
3766    let p_entity_type_id = entity_type_id;
3767    let p_entity_type_request = entity_type_request;
3768
3769    let uri_str = format!("{}/api/entity/type/{entityTypeId}", configuration.base_path, entityTypeId=crate::apis::urlencode(p_entity_type_id));
3770    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
3771
3772    if let Some(ref user_agent) = configuration.user_agent {
3773        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3774    }
3775    if let Some(ref apikey) = configuration.api_key {
3776        let key = apikey.key.clone();
3777        let value = match apikey.prefix {
3778            Some(ref prefix) => format!("{} {}", prefix, key),
3779            None => key,
3780        };
3781        req_builder = req_builder.header("Authorization", value);
3782    };
3783    req_builder = req_builder.json(&p_entity_type_request);
3784
3785    let req = req_builder.build()?;
3786    let resp = configuration.client.execute(req).await?;
3787
3788    let status = resp.status();
3789    let content_type = resp
3790        .headers()
3791        .get("content-type")
3792        .and_then(|v| v.to_str().ok())
3793        .unwrap_or("application/octet-stream");
3794    let content_type = super::ContentType::from(content_type);
3795
3796    if !status.is_client_error() && !status.is_server_error() {
3797        let content = resp.text().await?;
3798        match content_type {
3799            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3800            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::EntityTypeResponse`"))),
3801            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::EntityTypeResponse`")))),
3802        }
3803    } else {
3804        let content = resp.text().await?;
3805        let entity: Option<CreateEntityTypeWithIdError> = serde_json::from_str(&content).ok();
3806        Err(Error::ResponseError(ResponseContent { status, content, entity }))
3807    }
3808}
3809
3810/// Creates an Entity. You can optionally specify an Id for the Entity. If not provided one will be generated.
3811pub async fn create_entity_with_id(configuration: &configuration::Configuration, entity_id: &str, x_fusion_auth_tenant_id: Option<&str>, entity_request: Option<models::EntityRequest>) -> Result<models::EntityResponse, Error<CreateEntityWithIdError>> {
3812    // add a prefix to parameters to efficiently prevent name collisions
3813    let p_entity_id = entity_id;
3814    let p_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
3815    let p_entity_request = entity_request;
3816
3817    let uri_str = format!("{}/api/entity/{entityId}", configuration.base_path, entityId=crate::apis::urlencode(p_entity_id));
3818    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
3819
3820    if let Some(ref user_agent) = configuration.user_agent {
3821        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3822    }
3823    if let Some(param_value) = p_x_fusion_auth_tenant_id {
3824        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
3825    }
3826    if let Some(ref apikey) = configuration.api_key {
3827        let key = apikey.key.clone();
3828        let value = match apikey.prefix {
3829            Some(ref prefix) => format!("{} {}", prefix, key),
3830            None => key,
3831        };
3832        req_builder = req_builder.header("Authorization", value);
3833    };
3834    req_builder = req_builder.json(&p_entity_request);
3835
3836    let req = req_builder.build()?;
3837    let resp = configuration.client.execute(req).await?;
3838
3839    let status = resp.status();
3840    let content_type = resp
3841        .headers()
3842        .get("content-type")
3843        .and_then(|v| v.to_str().ok())
3844        .unwrap_or("application/octet-stream");
3845    let content_type = super::ContentType::from(content_type);
3846
3847    if !status.is_client_error() && !status.is_server_error() {
3848        let content = resp.text().await?;
3849        match content_type {
3850            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3851            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::EntityResponse`"))),
3852            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::EntityResponse`")))),
3853        }
3854    } else {
3855        let content = resp.text().await?;
3856        let entity: Option<CreateEntityWithIdError> = serde_json::from_str(&content).ok();
3857        Err(Error::ResponseError(ResponseContent { status, content, entity }))
3858    }
3859}
3860
3861/// Creates a family with the user Id in the request as the owner and sole member of the family. You can optionally specify an Id for the family, if not provided one will be generated.
3862pub async fn create_family(configuration: &configuration::Configuration, x_fusion_auth_tenant_id: Option<&str>, family_request: Option<models::FamilyRequest>) -> Result<models::FamilyResponse, Error<CreateFamilyError>> {
3863    // add a prefix to parameters to efficiently prevent name collisions
3864    let p_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
3865    let p_family_request = family_request;
3866
3867    let uri_str = format!("{}/api/user/family", configuration.base_path);
3868    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
3869
3870    if let Some(ref user_agent) = configuration.user_agent {
3871        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3872    }
3873    if let Some(param_value) = p_x_fusion_auth_tenant_id {
3874        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
3875    }
3876    if let Some(ref apikey) = configuration.api_key {
3877        let key = apikey.key.clone();
3878        let value = match apikey.prefix {
3879            Some(ref prefix) => format!("{} {}", prefix, key),
3880            None => key,
3881        };
3882        req_builder = req_builder.header("Authorization", value);
3883    };
3884    req_builder = req_builder.json(&p_family_request);
3885
3886    let req = req_builder.build()?;
3887    let resp = configuration.client.execute(req).await?;
3888
3889    let status = resp.status();
3890    let content_type = resp
3891        .headers()
3892        .get("content-type")
3893        .and_then(|v| v.to_str().ok())
3894        .unwrap_or("application/octet-stream");
3895    let content_type = super::ContentType::from(content_type);
3896
3897    if !status.is_client_error() && !status.is_server_error() {
3898        let content = resp.text().await?;
3899        match content_type {
3900            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3901            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::FamilyResponse`"))),
3902            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::FamilyResponse`")))),
3903        }
3904    } else {
3905        let content = resp.text().await?;
3906        let entity: Option<CreateFamilyError> = serde_json::from_str(&content).ok();
3907        Err(Error::ResponseError(ResponseContent { status, content, entity }))
3908    }
3909}
3910
3911/// Creates a family with the user Id in the request as the owner and sole member of the family. You can optionally specify an Id for the family, if not provided one will be generated.
3912pub async fn create_family_with_id(configuration: &configuration::Configuration, family_id: &str, x_fusion_auth_tenant_id: Option<&str>, family_request: Option<models::FamilyRequest>) -> Result<models::FamilyResponse, Error<CreateFamilyWithIdError>> {
3913    // add a prefix to parameters to efficiently prevent name collisions
3914    let p_family_id = family_id;
3915    let p_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
3916    let p_family_request = family_request;
3917
3918    let uri_str = format!("{}/api/user/family/{familyId}", configuration.base_path, familyId=crate::apis::urlencode(p_family_id));
3919    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
3920
3921    if let Some(ref user_agent) = configuration.user_agent {
3922        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3923    }
3924    if let Some(param_value) = p_x_fusion_auth_tenant_id {
3925        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
3926    }
3927    if let Some(ref apikey) = configuration.api_key {
3928        let key = apikey.key.clone();
3929        let value = match apikey.prefix {
3930            Some(ref prefix) => format!("{} {}", prefix, key),
3931            None => key,
3932        };
3933        req_builder = req_builder.header("Authorization", value);
3934    };
3935    req_builder = req_builder.json(&p_family_request);
3936
3937    let req = req_builder.build()?;
3938    let resp = configuration.client.execute(req).await?;
3939
3940    let status = resp.status();
3941    let content_type = resp
3942        .headers()
3943        .get("content-type")
3944        .and_then(|v| v.to_str().ok())
3945        .unwrap_or("application/octet-stream");
3946    let content_type = super::ContentType::from(content_type);
3947
3948    if !status.is_client_error() && !status.is_server_error() {
3949        let content = resp.text().await?;
3950        match content_type {
3951            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3952            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::FamilyResponse`"))),
3953            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::FamilyResponse`")))),
3954        }
3955    } else {
3956        let content = resp.text().await?;
3957        let entity: Option<CreateFamilyWithIdError> = serde_json::from_str(&content).ok();
3958        Err(Error::ResponseError(ResponseContent { status, content, entity }))
3959    }
3960}
3961
3962/// Creates a form.  You can optionally specify an Id for the form, if not provided one will be generated.
3963pub async fn create_form(configuration: &configuration::Configuration, form_request: Option<models::FormRequest>) -> Result<models::FormResponse, Error<CreateFormError>> {
3964    // add a prefix to parameters to efficiently prevent name collisions
3965    let p_form_request = form_request;
3966
3967    let uri_str = format!("{}/api/form", configuration.base_path);
3968    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
3969
3970    if let Some(ref user_agent) = configuration.user_agent {
3971        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3972    }
3973    if let Some(ref apikey) = configuration.api_key {
3974        let key = apikey.key.clone();
3975        let value = match apikey.prefix {
3976            Some(ref prefix) => format!("{} {}", prefix, key),
3977            None => key,
3978        };
3979        req_builder = req_builder.header("Authorization", value);
3980    };
3981    req_builder = req_builder.json(&p_form_request);
3982
3983    let req = req_builder.build()?;
3984    let resp = configuration.client.execute(req).await?;
3985
3986    let status = resp.status();
3987    let content_type = resp
3988        .headers()
3989        .get("content-type")
3990        .and_then(|v| v.to_str().ok())
3991        .unwrap_or("application/octet-stream");
3992    let content_type = super::ContentType::from(content_type);
3993
3994    if !status.is_client_error() && !status.is_server_error() {
3995        let content = resp.text().await?;
3996        match content_type {
3997            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3998            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::FormResponse`"))),
3999            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::FormResponse`")))),
4000        }
4001    } else {
4002        let content = resp.text().await?;
4003        let entity: Option<CreateFormError> = serde_json::from_str(&content).ok();
4004        Err(Error::ResponseError(ResponseContent { status, content, entity }))
4005    }
4006}
4007
4008/// Creates a form field.  You can optionally specify an Id for the form, if not provided one will be generated.
4009pub async fn create_form_field(configuration: &configuration::Configuration, form_field_request: Option<models::FormFieldRequest>) -> Result<models::FormFieldResponse, Error<CreateFormFieldError>> {
4010    // add a prefix to parameters to efficiently prevent name collisions
4011    let p_form_field_request = form_field_request;
4012
4013    let uri_str = format!("{}/api/form/field", configuration.base_path);
4014    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
4015
4016    if let Some(ref user_agent) = configuration.user_agent {
4017        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4018    }
4019    if let Some(ref apikey) = configuration.api_key {
4020        let key = apikey.key.clone();
4021        let value = match apikey.prefix {
4022            Some(ref prefix) => format!("{} {}", prefix, key),
4023            None => key,
4024        };
4025        req_builder = req_builder.header("Authorization", value);
4026    };
4027    req_builder = req_builder.json(&p_form_field_request);
4028
4029    let req = req_builder.build()?;
4030    let resp = configuration.client.execute(req).await?;
4031
4032    let status = resp.status();
4033    let content_type = resp
4034        .headers()
4035        .get("content-type")
4036        .and_then(|v| v.to_str().ok())
4037        .unwrap_or("application/octet-stream");
4038    let content_type = super::ContentType::from(content_type);
4039
4040    if !status.is_client_error() && !status.is_server_error() {
4041        let content = resp.text().await?;
4042        match content_type {
4043            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4044            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::FormFieldResponse`"))),
4045            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::FormFieldResponse`")))),
4046        }
4047    } else {
4048        let content = resp.text().await?;
4049        let entity: Option<CreateFormFieldError> = serde_json::from_str(&content).ok();
4050        Err(Error::ResponseError(ResponseContent { status, content, entity }))
4051    }
4052}
4053
4054/// Creates a form field.  You can optionally specify an Id for the form, if not provided one will be generated.
4055pub async fn create_form_field_with_id(configuration: &configuration::Configuration, field_id: &str, form_field_request: Option<models::FormFieldRequest>) -> Result<models::FormFieldResponse, Error<CreateFormFieldWithIdError>> {
4056    // add a prefix to parameters to efficiently prevent name collisions
4057    let p_field_id = field_id;
4058    let p_form_field_request = form_field_request;
4059
4060    let uri_str = format!("{}/api/form/field/{fieldId}", configuration.base_path, fieldId=crate::apis::urlencode(p_field_id));
4061    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
4062
4063    if let Some(ref user_agent) = configuration.user_agent {
4064        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4065    }
4066    if let Some(ref apikey) = configuration.api_key {
4067        let key = apikey.key.clone();
4068        let value = match apikey.prefix {
4069            Some(ref prefix) => format!("{} {}", prefix, key),
4070            None => key,
4071        };
4072        req_builder = req_builder.header("Authorization", value);
4073    };
4074    req_builder = req_builder.json(&p_form_field_request);
4075
4076    let req = req_builder.build()?;
4077    let resp = configuration.client.execute(req).await?;
4078
4079    let status = resp.status();
4080    let content_type = resp
4081        .headers()
4082        .get("content-type")
4083        .and_then(|v| v.to_str().ok())
4084        .unwrap_or("application/octet-stream");
4085    let content_type = super::ContentType::from(content_type);
4086
4087    if !status.is_client_error() && !status.is_server_error() {
4088        let content = resp.text().await?;
4089        match content_type {
4090            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4091            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::FormFieldResponse`"))),
4092            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::FormFieldResponse`")))),
4093        }
4094    } else {
4095        let content = resp.text().await?;
4096        let entity: Option<CreateFormFieldWithIdError> = serde_json::from_str(&content).ok();
4097        Err(Error::ResponseError(ResponseContent { status, content, entity }))
4098    }
4099}
4100
4101/// Creates a form.  You can optionally specify an Id for the form, if not provided one will be generated.
4102pub async fn create_form_with_id(configuration: &configuration::Configuration, form_id: &str, form_request: Option<models::FormRequest>) -> Result<models::FormResponse, Error<CreateFormWithIdError>> {
4103    // add a prefix to parameters to efficiently prevent name collisions
4104    let p_form_id = form_id;
4105    let p_form_request = form_request;
4106
4107    let uri_str = format!("{}/api/form/{formId}", configuration.base_path, formId=crate::apis::urlencode(p_form_id));
4108    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
4109
4110    if let Some(ref user_agent) = configuration.user_agent {
4111        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4112    }
4113    if let Some(ref apikey) = configuration.api_key {
4114        let key = apikey.key.clone();
4115        let value = match apikey.prefix {
4116            Some(ref prefix) => format!("{} {}", prefix, key),
4117            None => key,
4118        };
4119        req_builder = req_builder.header("Authorization", value);
4120    };
4121    req_builder = req_builder.json(&p_form_request);
4122
4123    let req = req_builder.build()?;
4124    let resp = configuration.client.execute(req).await?;
4125
4126    let status = resp.status();
4127    let content_type = resp
4128        .headers()
4129        .get("content-type")
4130        .and_then(|v| v.to_str().ok())
4131        .unwrap_or("application/octet-stream");
4132    let content_type = super::ContentType::from(content_type);
4133
4134    if !status.is_client_error() && !status.is_server_error() {
4135        let content = resp.text().await?;
4136        match content_type {
4137            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4138            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::FormResponse`"))),
4139            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::FormResponse`")))),
4140        }
4141    } else {
4142        let content = resp.text().await?;
4143        let entity: Option<CreateFormWithIdError> = serde_json::from_str(&content).ok();
4144        Err(Error::ResponseError(ResponseContent { status, content, entity }))
4145    }
4146}
4147
4148/// Creates a group. You can optionally specify an Id for the group, if not provided one will be generated.
4149pub async fn create_group(configuration: &configuration::Configuration, x_fusion_auth_tenant_id: Option<&str>, group_request: Option<models::GroupRequest>) -> Result<models::GroupResponse, Error<CreateGroupError>> {
4150    // add a prefix to parameters to efficiently prevent name collisions
4151    let p_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
4152    let p_group_request = group_request;
4153
4154    let uri_str = format!("{}/api/group", configuration.base_path);
4155    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
4156
4157    if let Some(ref user_agent) = configuration.user_agent {
4158        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4159    }
4160    if let Some(param_value) = p_x_fusion_auth_tenant_id {
4161        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
4162    }
4163    if let Some(ref apikey) = configuration.api_key {
4164        let key = apikey.key.clone();
4165        let value = match apikey.prefix {
4166            Some(ref prefix) => format!("{} {}", prefix, key),
4167            None => key,
4168        };
4169        req_builder = req_builder.header("Authorization", value);
4170    };
4171    req_builder = req_builder.json(&p_group_request);
4172
4173    let req = req_builder.build()?;
4174    let resp = configuration.client.execute(req).await?;
4175
4176    let status = resp.status();
4177    let content_type = resp
4178        .headers()
4179        .get("content-type")
4180        .and_then(|v| v.to_str().ok())
4181        .unwrap_or("application/octet-stream");
4182    let content_type = super::ContentType::from(content_type);
4183
4184    if !status.is_client_error() && !status.is_server_error() {
4185        let content = resp.text().await?;
4186        match content_type {
4187            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4188            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GroupResponse`"))),
4189            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GroupResponse`")))),
4190        }
4191    } else {
4192        let content = resp.text().await?;
4193        let entity: Option<CreateGroupError> = serde_json::from_str(&content).ok();
4194        Err(Error::ResponseError(ResponseContent { status, content, entity }))
4195    }
4196}
4197
4198/// Creates a member in a group.
4199pub async fn create_group_members_with_id(configuration: &configuration::Configuration, member_request: Option<models::MemberRequest>) -> Result<models::MemberResponse, Error<CreateGroupMembersWithIdError>> {
4200    // add a prefix to parameters to efficiently prevent name collisions
4201    let p_member_request = member_request;
4202
4203    let uri_str = format!("{}/api/group/member", configuration.base_path);
4204    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
4205
4206    if let Some(ref user_agent) = configuration.user_agent {
4207        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4208    }
4209    if let Some(ref apikey) = configuration.api_key {
4210        let key = apikey.key.clone();
4211        let value = match apikey.prefix {
4212            Some(ref prefix) => format!("{} {}", prefix, key),
4213            None => key,
4214        };
4215        req_builder = req_builder.header("Authorization", value);
4216    };
4217    req_builder = req_builder.json(&p_member_request);
4218
4219    let req = req_builder.build()?;
4220    let resp = configuration.client.execute(req).await?;
4221
4222    let status = resp.status();
4223    let content_type = resp
4224        .headers()
4225        .get("content-type")
4226        .and_then(|v| v.to_str().ok())
4227        .unwrap_or("application/octet-stream");
4228    let content_type = super::ContentType::from(content_type);
4229
4230    if !status.is_client_error() && !status.is_server_error() {
4231        let content = resp.text().await?;
4232        match content_type {
4233            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4234            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::MemberResponse`"))),
4235            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::MemberResponse`")))),
4236        }
4237    } else {
4238        let content = resp.text().await?;
4239        let entity: Option<CreateGroupMembersWithIdError> = serde_json::from_str(&content).ok();
4240        Err(Error::ResponseError(ResponseContent { status, content, entity }))
4241    }
4242}
4243
4244/// Creates a group. You can optionally specify an Id for the group, if not provided one will be generated.
4245pub async fn create_group_with_id(configuration: &configuration::Configuration, group_id: &str, x_fusion_auth_tenant_id: Option<&str>, group_request: Option<models::GroupRequest>) -> Result<models::GroupResponse, Error<CreateGroupWithIdError>> {
4246    // add a prefix to parameters to efficiently prevent name collisions
4247    let p_group_id = group_id;
4248    let p_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
4249    let p_group_request = group_request;
4250
4251    let uri_str = format!("{}/api/group/{groupId}", configuration.base_path, groupId=crate::apis::urlencode(p_group_id));
4252    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
4253
4254    if let Some(ref user_agent) = configuration.user_agent {
4255        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4256    }
4257    if let Some(param_value) = p_x_fusion_auth_tenant_id {
4258        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
4259    }
4260    if let Some(ref apikey) = configuration.api_key {
4261        let key = apikey.key.clone();
4262        let value = match apikey.prefix {
4263            Some(ref prefix) => format!("{} {}", prefix, key),
4264            None => key,
4265        };
4266        req_builder = req_builder.header("Authorization", value);
4267    };
4268    req_builder = req_builder.json(&p_group_request);
4269
4270    let req = req_builder.build()?;
4271    let resp = configuration.client.execute(req).await?;
4272
4273    let status = resp.status();
4274    let content_type = resp
4275        .headers()
4276        .get("content-type")
4277        .and_then(|v| v.to_str().ok())
4278        .unwrap_or("application/octet-stream");
4279    let content_type = super::ContentType::from(content_type);
4280
4281    if !status.is_client_error() && !status.is_server_error() {
4282        let content = resp.text().await?;
4283        match content_type {
4284            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4285            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GroupResponse`"))),
4286            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GroupResponse`")))),
4287        }
4288    } else {
4289        let content = resp.text().await?;
4290        let entity: Option<CreateGroupWithIdError> = serde_json::from_str(&content).ok();
4291        Err(Error::ResponseError(ResponseContent { status, content, entity }))
4292    }
4293}
4294
4295/// Creates an identity provider. You can optionally specify an Id for the identity provider, if not provided one will be generated.
4296pub async fn create_identity_provider(configuration: &configuration::Configuration, identity_provider_request: Option<models::IdentityProviderRequest>) -> Result<models::IdentityProviderResponse, Error<CreateIdentityProviderError>> {
4297    // add a prefix to parameters to efficiently prevent name collisions
4298    let p_identity_provider_request = identity_provider_request;
4299
4300    let uri_str = format!("{}/api/identity-provider", configuration.base_path);
4301    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
4302
4303    if let Some(ref user_agent) = configuration.user_agent {
4304        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4305    }
4306    if let Some(ref apikey) = configuration.api_key {
4307        let key = apikey.key.clone();
4308        let value = match apikey.prefix {
4309            Some(ref prefix) => format!("{} {}", prefix, key),
4310            None => key,
4311        };
4312        req_builder = req_builder.header("Authorization", value);
4313    };
4314    req_builder = req_builder.json(&p_identity_provider_request);
4315
4316    let req = req_builder.build()?;
4317    let resp = configuration.client.execute(req).await?;
4318
4319    let status = resp.status();
4320    let content_type = resp
4321        .headers()
4322        .get("content-type")
4323        .and_then(|v| v.to_str().ok())
4324        .unwrap_or("application/octet-stream");
4325    let content_type = super::ContentType::from(content_type);
4326
4327    if !status.is_client_error() && !status.is_server_error() {
4328        let content = resp.text().await?;
4329        match content_type {
4330            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4331            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IdentityProviderResponse`"))),
4332            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IdentityProviderResponse`")))),
4333        }
4334    } else {
4335        let content = resp.text().await?;
4336        let entity: Option<CreateIdentityProviderError> = serde_json::from_str(&content).ok();
4337        Err(Error::ResponseError(ResponseContent { status, content, entity }))
4338    }
4339}
4340
4341/// Creates an identity provider. You can optionally specify an Id for the identity provider, if not provided one will be generated.
4342pub async fn create_identity_provider_with_id(configuration: &configuration::Configuration, identity_provider_id: &str, identity_provider_request: Option<models::IdentityProviderRequest>) -> Result<models::IdentityProviderResponse, Error<CreateIdentityProviderWithIdError>> {
4343    // add a prefix to parameters to efficiently prevent name collisions
4344    let p_identity_provider_id = identity_provider_id;
4345    let p_identity_provider_request = identity_provider_request;
4346
4347    let uri_str = format!("{}/api/identity-provider/{identityProviderId}", configuration.base_path, identityProviderId=crate::apis::urlencode(p_identity_provider_id));
4348    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
4349
4350    if let Some(ref user_agent) = configuration.user_agent {
4351        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4352    }
4353    if let Some(ref apikey) = configuration.api_key {
4354        let key = apikey.key.clone();
4355        let value = match apikey.prefix {
4356            Some(ref prefix) => format!("{} {}", prefix, key),
4357            None => key,
4358        };
4359        req_builder = req_builder.header("Authorization", value);
4360    };
4361    req_builder = req_builder.json(&p_identity_provider_request);
4362
4363    let req = req_builder.build()?;
4364    let resp = configuration.client.execute(req).await?;
4365
4366    let status = resp.status();
4367    let content_type = resp
4368        .headers()
4369        .get("content-type")
4370        .and_then(|v| v.to_str().ok())
4371        .unwrap_or("application/octet-stream");
4372    let content_type = super::ContentType::from(content_type);
4373
4374    if !status.is_client_error() && !status.is_server_error() {
4375        let content = resp.text().await?;
4376        match content_type {
4377            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4378            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IdentityProviderResponse`"))),
4379            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IdentityProviderResponse`")))),
4380        }
4381    } else {
4382        let content = resp.text().await?;
4383        let entity: Option<CreateIdentityProviderWithIdError> = serde_json::from_str(&content).ok();
4384        Err(Error::ResponseError(ResponseContent { status, content, entity }))
4385    }
4386}
4387
4388/// Inspect an access token issued as the result of the User based grant such as the Authorization Code Grant, Implicit Grant, the User Credentials Grant or the Refresh Grant. OR Inspect an access token issued as the result of the Client Credentials Grant.
4389pub async fn create_introspect(configuration: &configuration::Configuration, ) -> Result<serde_json::Value, Error<CreateIntrospectError>> {
4390
4391    let uri_str = format!("{}/oauth2/introspect", configuration.base_path);
4392    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
4393
4394    if let Some(ref user_agent) = configuration.user_agent {
4395        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4396    }
4397    if let Some(ref apikey) = configuration.api_key {
4398        let key = apikey.key.clone();
4399        let value = match apikey.prefix {
4400            Some(ref prefix) => format!("{} {}", prefix, key),
4401            None => key,
4402        };
4403        req_builder = req_builder.header("Authorization", value);
4404    };
4405
4406    let req = req_builder.build()?;
4407    let resp = configuration.client.execute(req).await?;
4408
4409    let status = resp.status();
4410    let content_type = resp
4411        .headers()
4412        .get("content-type")
4413        .and_then(|v| v.to_str().ok())
4414        .unwrap_or("application/octet-stream");
4415    let content_type = super::ContentType::from(content_type);
4416
4417    if !status.is_client_error() && !status.is_server_error() {
4418        let content = resp.text().await?;
4419        match content_type {
4420            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4421            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `serde_json::Value`"))),
4422            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `serde_json::Value`")))),
4423        }
4424    } else {
4425        let content = resp.text().await?;
4426        let entity: Option<CreateIntrospectError> = serde_json::from_str(&content).ok();
4427        Err(Error::ResponseError(ResponseContent { status, content, entity }))
4428    }
4429}
4430
4431/// Creates an IP Access Control List. You can optionally specify an Id on this create request, if one is not provided one will be generated.
4432pub async fn create_ip_access_control_list(configuration: &configuration::Configuration, ip_access_control_list_request: Option<models::IpAccessControlListRequest>) -> Result<models::IpAccessControlListResponse, Error<CreateIpAccessControlListError>> {
4433    // add a prefix to parameters to efficiently prevent name collisions
4434    let p_ip_access_control_list_request = ip_access_control_list_request;
4435
4436    let uri_str = format!("{}/api/ip-acl", configuration.base_path);
4437    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
4438
4439    if let Some(ref user_agent) = configuration.user_agent {
4440        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4441    }
4442    if let Some(ref apikey) = configuration.api_key {
4443        let key = apikey.key.clone();
4444        let value = match apikey.prefix {
4445            Some(ref prefix) => format!("{} {}", prefix, key),
4446            None => key,
4447        };
4448        req_builder = req_builder.header("Authorization", value);
4449    };
4450    req_builder = req_builder.json(&p_ip_access_control_list_request);
4451
4452    let req = req_builder.build()?;
4453    let resp = configuration.client.execute(req).await?;
4454
4455    let status = resp.status();
4456    let content_type = resp
4457        .headers()
4458        .get("content-type")
4459        .and_then(|v| v.to_str().ok())
4460        .unwrap_or("application/octet-stream");
4461    let content_type = super::ContentType::from(content_type);
4462
4463    if !status.is_client_error() && !status.is_server_error() {
4464        let content = resp.text().await?;
4465        match content_type {
4466            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4467            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IpAccessControlListResponse`"))),
4468            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IpAccessControlListResponse`")))),
4469        }
4470    } else {
4471        let content = resp.text().await?;
4472        let entity: Option<CreateIpAccessControlListError> = serde_json::from_str(&content).ok();
4473        Err(Error::ResponseError(ResponseContent { status, content, entity }))
4474    }
4475}
4476
4477/// Creates an IP Access Control List. You can optionally specify an Id on this create request, if one is not provided one will be generated.
4478pub async fn create_ip_access_control_list_with_id(configuration: &configuration::Configuration, access_control_list_id: &str, ip_access_control_list_request: Option<models::IpAccessControlListRequest>) -> Result<models::IpAccessControlListResponse, Error<CreateIpAccessControlListWithIdError>> {
4479    // add a prefix to parameters to efficiently prevent name collisions
4480    let p_access_control_list_id = access_control_list_id;
4481    let p_ip_access_control_list_request = ip_access_control_list_request;
4482
4483    let uri_str = format!("{}/api/ip-acl/{accessControlListId}", configuration.base_path, accessControlListId=crate::apis::urlencode(p_access_control_list_id));
4484    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
4485
4486    if let Some(ref user_agent) = configuration.user_agent {
4487        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4488    }
4489    if let Some(ref apikey) = configuration.api_key {
4490        let key = apikey.key.clone();
4491        let value = match apikey.prefix {
4492            Some(ref prefix) => format!("{} {}", prefix, key),
4493            None => key,
4494        };
4495        req_builder = req_builder.header("Authorization", value);
4496    };
4497    req_builder = req_builder.json(&p_ip_access_control_list_request);
4498
4499    let req = req_builder.build()?;
4500    let resp = configuration.client.execute(req).await?;
4501
4502    let status = resp.status();
4503    let content_type = resp
4504        .headers()
4505        .get("content-type")
4506        .and_then(|v| v.to_str().ok())
4507        .unwrap_or("application/octet-stream");
4508    let content_type = super::ContentType::from(content_type);
4509
4510    if !status.is_client_error() && !status.is_server_error() {
4511        let content = resp.text().await?;
4512        match content_type {
4513            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4514            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IpAccessControlListResponse`"))),
4515            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IpAccessControlListResponse`")))),
4516        }
4517    } else {
4518        let content = resp.text().await?;
4519        let entity: Option<CreateIpAccessControlListWithIdError> = serde_json::from_str(&content).ok();
4520        Err(Error::ResponseError(ResponseContent { status, content, entity }))
4521    }
4522}
4523
4524/// Creates a Lambda. You can optionally specify an Id for the lambda, if not provided one will be generated.
4525pub async fn create_lambda(configuration: &configuration::Configuration, lambda_request: Option<models::LambdaRequest>) -> Result<models::LambdaResponse, Error<CreateLambdaError>> {
4526    // add a prefix to parameters to efficiently prevent name collisions
4527    let p_lambda_request = lambda_request;
4528
4529    let uri_str = format!("{}/api/lambda", configuration.base_path);
4530    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
4531
4532    if let Some(ref user_agent) = configuration.user_agent {
4533        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4534    }
4535    if let Some(ref apikey) = configuration.api_key {
4536        let key = apikey.key.clone();
4537        let value = match apikey.prefix {
4538            Some(ref prefix) => format!("{} {}", prefix, key),
4539            None => key,
4540        };
4541        req_builder = req_builder.header("Authorization", value);
4542    };
4543    req_builder = req_builder.json(&p_lambda_request);
4544
4545    let req = req_builder.build()?;
4546    let resp = configuration.client.execute(req).await?;
4547
4548    let status = resp.status();
4549    let content_type = resp
4550        .headers()
4551        .get("content-type")
4552        .and_then(|v| v.to_str().ok())
4553        .unwrap_or("application/octet-stream");
4554    let content_type = super::ContentType::from(content_type);
4555
4556    if !status.is_client_error() && !status.is_server_error() {
4557        let content = resp.text().await?;
4558        match content_type {
4559            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4560            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::LambdaResponse`"))),
4561            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::LambdaResponse`")))),
4562        }
4563    } else {
4564        let content = resp.text().await?;
4565        let entity: Option<CreateLambdaError> = serde_json::from_str(&content).ok();
4566        Err(Error::ResponseError(ResponseContent { status, content, entity }))
4567    }
4568}
4569
4570/// Creates a Lambda. You can optionally specify an Id for the lambda, if not provided one will be generated.
4571pub async fn create_lambda_with_id(configuration: &configuration::Configuration, lambda_id: &str, lambda_request: Option<models::LambdaRequest>) -> Result<models::LambdaResponse, Error<CreateLambdaWithIdError>> {
4572    // add a prefix to parameters to efficiently prevent name collisions
4573    let p_lambda_id = lambda_id;
4574    let p_lambda_request = lambda_request;
4575
4576    let uri_str = format!("{}/api/lambda/{lambdaId}", configuration.base_path, lambdaId=crate::apis::urlencode(p_lambda_id));
4577    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
4578
4579    if let Some(ref user_agent) = configuration.user_agent {
4580        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4581    }
4582    if let Some(ref apikey) = configuration.api_key {
4583        let key = apikey.key.clone();
4584        let value = match apikey.prefix {
4585            Some(ref prefix) => format!("{} {}", prefix, key),
4586            None => key,
4587        };
4588        req_builder = req_builder.header("Authorization", value);
4589    };
4590    req_builder = req_builder.json(&p_lambda_request);
4591
4592    let req = req_builder.build()?;
4593    let resp = configuration.client.execute(req).await?;
4594
4595    let status = resp.status();
4596    let content_type = resp
4597        .headers()
4598        .get("content-type")
4599        .and_then(|v| v.to_str().ok())
4600        .unwrap_or("application/octet-stream");
4601    let content_type = super::ContentType::from(content_type);
4602
4603    if !status.is_client_error() && !status.is_server_error() {
4604        let content = resp.text().await?;
4605        match content_type {
4606            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4607            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::LambdaResponse`"))),
4608            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::LambdaResponse`")))),
4609        }
4610    } else {
4611        let content = resp.text().await?;
4612        let entity: Option<CreateLambdaWithIdError> = serde_json::from_str(&content).ok();
4613        Err(Error::ResponseError(ResponseContent { status, content, entity }))
4614    }
4615}
4616
4617/// The Logout API is intended to be used to remove the refresh token and access token cookies if they exist on the client and revoke the refresh token stored. This API does nothing if the request does not contain an access token or refresh token cookies. OR The Logout API is intended to be used to remove the refresh token and access token cookies if they exist on the client and revoke the refresh token stored. This API takes the refresh token in the JSON body.
4618pub async fn create_logout(configuration: &configuration::Configuration, global: Option<&str>, refresh_token: Option<&str>, logout_request: Option<models::LogoutRequest>) -> Result<(), Error<CreateLogoutError>> {
4619    // add a prefix to parameters to efficiently prevent name collisions
4620    let p_global = global;
4621    let p_refresh_token = refresh_token;
4622    let p_logout_request = logout_request;
4623
4624    let uri_str = format!("{}/api/logout", configuration.base_path);
4625    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
4626
4627    if let Some(ref param_value) = p_global {
4628        req_builder = req_builder.query(&[("global", &param_value.to_string())]);
4629    }
4630    if let Some(ref param_value) = p_refresh_token {
4631        req_builder = req_builder.query(&[("refreshToken", &param_value.to_string())]);
4632    }
4633    if let Some(ref user_agent) = configuration.user_agent {
4634        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4635    }
4636    if let Some(ref apikey) = configuration.api_key {
4637        let key = apikey.key.clone();
4638        let value = match apikey.prefix {
4639            Some(ref prefix) => format!("{} {}", prefix, key),
4640            None => key,
4641        };
4642        req_builder = req_builder.header("Authorization", value);
4643    };
4644    req_builder = req_builder.json(&p_logout_request);
4645
4646    let req = req_builder.build()?;
4647    let resp = configuration.client.execute(req).await?;
4648
4649    let status = resp.status();
4650
4651    if !status.is_client_error() && !status.is_server_error() {
4652        Ok(())
4653    } else {
4654        let content = resp.text().await?;
4655        let entity: Option<CreateLogoutError> = serde_json::from_str(&content).ok();
4656        Err(Error::ResponseError(ResponseContent { status, content, entity }))
4657    }
4658}
4659
4660/// Creates an message template. You can optionally specify an Id for the template, if not provided one will be generated.
4661pub async fn create_message_template(configuration: &configuration::Configuration, message_template_request: Option<models::MessageTemplateRequest>) -> Result<models::MessageTemplateResponse, Error<CreateMessageTemplateError>> {
4662    // add a prefix to parameters to efficiently prevent name collisions
4663    let p_message_template_request = message_template_request;
4664
4665    let uri_str = format!("{}/api/message/template", configuration.base_path);
4666    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
4667
4668    if let Some(ref user_agent) = configuration.user_agent {
4669        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4670    }
4671    if let Some(ref apikey) = configuration.api_key {
4672        let key = apikey.key.clone();
4673        let value = match apikey.prefix {
4674            Some(ref prefix) => format!("{} {}", prefix, key),
4675            None => key,
4676        };
4677        req_builder = req_builder.header("Authorization", value);
4678    };
4679    req_builder = req_builder.json(&p_message_template_request);
4680
4681    let req = req_builder.build()?;
4682    let resp = configuration.client.execute(req).await?;
4683
4684    let status = resp.status();
4685    let content_type = resp
4686        .headers()
4687        .get("content-type")
4688        .and_then(|v| v.to_str().ok())
4689        .unwrap_or("application/octet-stream");
4690    let content_type = super::ContentType::from(content_type);
4691
4692    if !status.is_client_error() && !status.is_server_error() {
4693        let content = resp.text().await?;
4694        match content_type {
4695            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4696            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::MessageTemplateResponse`"))),
4697            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::MessageTemplateResponse`")))),
4698        }
4699    } else {
4700        let content = resp.text().await?;
4701        let entity: Option<CreateMessageTemplateError> = serde_json::from_str(&content).ok();
4702        Err(Error::ResponseError(ResponseContent { status, content, entity }))
4703    }
4704}
4705
4706/// Creates an message template. You can optionally specify an Id for the template, if not provided one will be generated.
4707pub async fn create_message_template_with_id(configuration: &configuration::Configuration, message_template_id: &str, message_template_request: Option<models::MessageTemplateRequest>) -> Result<models::MessageTemplateResponse, Error<CreateMessageTemplateWithIdError>> {
4708    // add a prefix to parameters to efficiently prevent name collisions
4709    let p_message_template_id = message_template_id;
4710    let p_message_template_request = message_template_request;
4711
4712    let uri_str = format!("{}/api/message/template/{messageTemplateId}", configuration.base_path, messageTemplateId=crate::apis::urlencode(p_message_template_id));
4713    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
4714
4715    if let Some(ref user_agent) = configuration.user_agent {
4716        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4717    }
4718    if let Some(ref apikey) = configuration.api_key {
4719        let key = apikey.key.clone();
4720        let value = match apikey.prefix {
4721            Some(ref prefix) => format!("{} {}", prefix, key),
4722            None => key,
4723        };
4724        req_builder = req_builder.header("Authorization", value);
4725    };
4726    req_builder = req_builder.json(&p_message_template_request);
4727
4728    let req = req_builder.build()?;
4729    let resp = configuration.client.execute(req).await?;
4730
4731    let status = resp.status();
4732    let content_type = resp
4733        .headers()
4734        .get("content-type")
4735        .and_then(|v| v.to_str().ok())
4736        .unwrap_or("application/octet-stream");
4737    let content_type = super::ContentType::from(content_type);
4738
4739    if !status.is_client_error() && !status.is_server_error() {
4740        let content = resp.text().await?;
4741        match content_type {
4742            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4743            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::MessageTemplateResponse`"))),
4744            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::MessageTemplateResponse`")))),
4745        }
4746    } else {
4747        let content = resp.text().await?;
4748        let entity: Option<CreateMessageTemplateWithIdError> = serde_json::from_str(&content).ok();
4749        Err(Error::ResponseError(ResponseContent { status, content, entity }))
4750    }
4751}
4752
4753/// Creates a messenger.  You can optionally specify an Id for the messenger, if not provided one will be generated.
4754pub async fn create_messenger(configuration: &configuration::Configuration, messenger_request: Option<models::MessengerRequest>) -> Result<models::MessengerResponse, Error<CreateMessengerError>> {
4755    // add a prefix to parameters to efficiently prevent name collisions
4756    let p_messenger_request = messenger_request;
4757
4758    let uri_str = format!("{}/api/messenger", configuration.base_path);
4759    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
4760
4761    if let Some(ref user_agent) = configuration.user_agent {
4762        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4763    }
4764    if let Some(ref apikey) = configuration.api_key {
4765        let key = apikey.key.clone();
4766        let value = match apikey.prefix {
4767            Some(ref prefix) => format!("{} {}", prefix, key),
4768            None => key,
4769        };
4770        req_builder = req_builder.header("Authorization", value);
4771    };
4772    req_builder = req_builder.json(&p_messenger_request);
4773
4774    let req = req_builder.build()?;
4775    let resp = configuration.client.execute(req).await?;
4776
4777    let status = resp.status();
4778    let content_type = resp
4779        .headers()
4780        .get("content-type")
4781        .and_then(|v| v.to_str().ok())
4782        .unwrap_or("application/octet-stream");
4783    let content_type = super::ContentType::from(content_type);
4784
4785    if !status.is_client_error() && !status.is_server_error() {
4786        let content = resp.text().await?;
4787        match content_type {
4788            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4789            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::MessengerResponse`"))),
4790            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::MessengerResponse`")))),
4791        }
4792    } else {
4793        let content = resp.text().await?;
4794        let entity: Option<CreateMessengerError> = serde_json::from_str(&content).ok();
4795        Err(Error::ResponseError(ResponseContent { status, content, entity }))
4796    }
4797}
4798
4799/// Creates a messenger.  You can optionally specify an Id for the messenger, if not provided one will be generated.
4800pub async fn create_messenger_with_id(configuration: &configuration::Configuration, messenger_id: &str, messenger_request: Option<models::MessengerRequest>) -> Result<models::MessengerResponse, Error<CreateMessengerWithIdError>> {
4801    // add a prefix to parameters to efficiently prevent name collisions
4802    let p_messenger_id = messenger_id;
4803    let p_messenger_request = messenger_request;
4804
4805    let uri_str = format!("{}/api/messenger/{messengerId}", configuration.base_path, messengerId=crate::apis::urlencode(p_messenger_id));
4806    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
4807
4808    if let Some(ref user_agent) = configuration.user_agent {
4809        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4810    }
4811    if let Some(ref apikey) = configuration.api_key {
4812        let key = apikey.key.clone();
4813        let value = match apikey.prefix {
4814            Some(ref prefix) => format!("{} {}", prefix, key),
4815            None => key,
4816        };
4817        req_builder = req_builder.header("Authorization", value);
4818    };
4819    req_builder = req_builder.json(&p_messenger_request);
4820
4821    let req = req_builder.build()?;
4822    let resp = configuration.client.execute(req).await?;
4823
4824    let status = resp.status();
4825    let content_type = resp
4826        .headers()
4827        .get("content-type")
4828        .and_then(|v| v.to_str().ok())
4829        .unwrap_or("application/octet-stream");
4830    let content_type = super::ContentType::from(content_type);
4831
4832    if !status.is_client_error() && !status.is_server_error() {
4833        let content = resp.text().await?;
4834        match content_type {
4835            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4836            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::MessengerResponse`"))),
4837            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::MessengerResponse`")))),
4838        }
4839    } else {
4840        let content = resp.text().await?;
4841        let entity: Option<CreateMessengerWithIdError> = serde_json::from_str(&content).ok();
4842        Err(Error::ResponseError(ResponseContent { status, content, entity }))
4843    }
4844}
4845
4846/// Creates a new custom OAuth scope for an application. You must specify the Id of the application you are creating the scope for. You can optionally specify an Id for the OAuth scope on the URL, if not provided one will be generated.
4847pub async fn create_o_auth_scope(configuration: &configuration::Configuration, application_id: &str, x_fusion_auth_tenant_id: Option<&str>, application_o_auth_scope_request: Option<models::ApplicationOAuthScopeRequest>) -> Result<models::ApplicationOAuthScopeResponse, Error<CreateOAuthScopeError>> {
4848    // add a prefix to parameters to efficiently prevent name collisions
4849    let p_application_id = application_id;
4850    let p_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
4851    let p_application_o_auth_scope_request = application_o_auth_scope_request;
4852
4853    let uri_str = format!("{}/api/application/{applicationId}/scope", configuration.base_path, applicationId=crate::apis::urlencode(p_application_id));
4854    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
4855
4856    if let Some(ref user_agent) = configuration.user_agent {
4857        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4858    }
4859    if let Some(param_value) = p_x_fusion_auth_tenant_id {
4860        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
4861    }
4862    if let Some(ref apikey) = configuration.api_key {
4863        let key = apikey.key.clone();
4864        let value = match apikey.prefix {
4865            Some(ref prefix) => format!("{} {}", prefix, key),
4866            None => key,
4867        };
4868        req_builder = req_builder.header("Authorization", value);
4869    };
4870    req_builder = req_builder.json(&p_application_o_auth_scope_request);
4871
4872    let req = req_builder.build()?;
4873    let resp = configuration.client.execute(req).await?;
4874
4875    let status = resp.status();
4876    let content_type = resp
4877        .headers()
4878        .get("content-type")
4879        .and_then(|v| v.to_str().ok())
4880        .unwrap_or("application/octet-stream");
4881    let content_type = super::ContentType::from(content_type);
4882
4883    if !status.is_client_error() && !status.is_server_error() {
4884        let content = resp.text().await?;
4885        match content_type {
4886            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4887            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ApplicationOAuthScopeResponse`"))),
4888            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ApplicationOAuthScopeResponse`")))),
4889        }
4890    } else {
4891        let content = resp.text().await?;
4892        let entity: Option<CreateOAuthScopeError> = serde_json::from_str(&content).ok();
4893        Err(Error::ResponseError(ResponseContent { status, content, entity }))
4894    }
4895}
4896
4897/// Creates a new custom OAuth scope for an application. You must specify the Id of the application you are creating the scope for. You can optionally specify an Id for the OAuth scope on the URL, if not provided one will be generated.
4898pub async fn create_o_auth_scope_with_id(configuration: &configuration::Configuration, application_id: &str, scope_id: &str, x_fusion_auth_tenant_id: Option<&str>, application_o_auth_scope_request: Option<models::ApplicationOAuthScopeRequest>) -> Result<models::ApplicationOAuthScopeResponse, Error<CreateOAuthScopeWithIdError>> {
4899    // add a prefix to parameters to efficiently prevent name collisions
4900    let p_application_id = application_id;
4901    let p_scope_id = scope_id;
4902    let p_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
4903    let p_application_o_auth_scope_request = application_o_auth_scope_request;
4904
4905    let uri_str = format!("{}/api/application/{applicationId}/scope/{scopeId}", configuration.base_path, applicationId=crate::apis::urlencode(p_application_id), scopeId=crate::apis::urlencode(p_scope_id));
4906    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
4907
4908    if let Some(ref user_agent) = configuration.user_agent {
4909        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4910    }
4911    if let Some(param_value) = p_x_fusion_auth_tenant_id {
4912        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
4913    }
4914    if let Some(ref apikey) = configuration.api_key {
4915        let key = apikey.key.clone();
4916        let value = match apikey.prefix {
4917            Some(ref prefix) => format!("{} {}", prefix, key),
4918            None => key,
4919        };
4920        req_builder = req_builder.header("Authorization", value);
4921    };
4922    req_builder = req_builder.json(&p_application_o_auth_scope_request);
4923
4924    let req = req_builder.build()?;
4925    let resp = configuration.client.execute(req).await?;
4926
4927    let status = resp.status();
4928    let content_type = resp
4929        .headers()
4930        .get("content-type")
4931        .and_then(|v| v.to_str().ok())
4932        .unwrap_or("application/octet-stream");
4933    let content_type = super::ContentType::from(content_type);
4934
4935    if !status.is_client_error() && !status.is_server_error() {
4936        let content = resp.text().await?;
4937        match content_type {
4938            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4939            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ApplicationOAuthScopeResponse`"))),
4940            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ApplicationOAuthScopeResponse`")))),
4941        }
4942    } else {
4943        let content = resp.text().await?;
4944        let entity: Option<CreateOAuthScopeWithIdError> = serde_json::from_str(&content).ok();
4945        Err(Error::ResponseError(ResponseContent { status, content, entity }))
4946    }
4947}
4948
4949/// Creates a tenant. You can optionally specify an Id for the tenant, if not provided one will be generated.
4950pub async fn create_tenant(configuration: &configuration::Configuration, x_fusion_auth_tenant_id: Option<&str>, tenant_request: Option<models::TenantRequest>) -> Result<models::TenantResponse, Error<CreateTenantError>> {
4951    // add a prefix to parameters to efficiently prevent name collisions
4952    let p_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
4953    let p_tenant_request = tenant_request;
4954
4955    let uri_str = format!("{}/api/tenant", configuration.base_path);
4956    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
4957
4958    if let Some(ref user_agent) = configuration.user_agent {
4959        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4960    }
4961    if let Some(param_value) = p_x_fusion_auth_tenant_id {
4962        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
4963    }
4964    if let Some(ref apikey) = configuration.api_key {
4965        let key = apikey.key.clone();
4966        let value = match apikey.prefix {
4967            Some(ref prefix) => format!("{} {}", prefix, key),
4968            None => key,
4969        };
4970        req_builder = req_builder.header("Authorization", value);
4971    };
4972    req_builder = req_builder.json(&p_tenant_request);
4973
4974    let req = req_builder.build()?;
4975    let resp = configuration.client.execute(req).await?;
4976
4977    let status = resp.status();
4978    let content_type = resp
4979        .headers()
4980        .get("content-type")
4981        .and_then(|v| v.to_str().ok())
4982        .unwrap_or("application/octet-stream");
4983    let content_type = super::ContentType::from(content_type);
4984
4985    if !status.is_client_error() && !status.is_server_error() {
4986        let content = resp.text().await?;
4987        match content_type {
4988            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4989            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::TenantResponse`"))),
4990            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::TenantResponse`")))),
4991        }
4992    } else {
4993        let content = resp.text().await?;
4994        let entity: Option<CreateTenantError> = serde_json::from_str(&content).ok();
4995        Err(Error::ResponseError(ResponseContent { status, content, entity }))
4996    }
4997}
4998
4999/// Creates a tenant. You can optionally specify an Id for the tenant, if not provided one will be generated.
5000pub async fn create_tenant_with_id(configuration: &configuration::Configuration, tenant_id: &str, x_fusion_auth_tenant_id: Option<&str>, tenant_request: Option<models::TenantRequest>) -> Result<models::TenantResponse, Error<CreateTenantWithIdError>> {
5001    // add a prefix to parameters to efficiently prevent name collisions
5002    let p_tenant_id = tenant_id;
5003    let p_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
5004    let p_tenant_request = tenant_request;
5005
5006    let uri_str = format!("{}/api/tenant/{tenantId}", configuration.base_path, tenantId=crate::apis::urlencode(p_tenant_id));
5007    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
5008
5009    if let Some(ref user_agent) = configuration.user_agent {
5010        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5011    }
5012    if let Some(param_value) = p_x_fusion_auth_tenant_id {
5013        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
5014    }
5015    if let Some(ref apikey) = configuration.api_key {
5016        let key = apikey.key.clone();
5017        let value = match apikey.prefix {
5018            Some(ref prefix) => format!("{} {}", prefix, key),
5019            None => key,
5020        };
5021        req_builder = req_builder.header("Authorization", value);
5022    };
5023    req_builder = req_builder.json(&p_tenant_request);
5024
5025    let req = req_builder.build()?;
5026    let resp = configuration.client.execute(req).await?;
5027
5028    let status = resp.status();
5029    let content_type = resp
5030        .headers()
5031        .get("content-type")
5032        .and_then(|v| v.to_str().ok())
5033        .unwrap_or("application/octet-stream");
5034    let content_type = super::ContentType::from(content_type);
5035
5036    if !status.is_client_error() && !status.is_server_error() {
5037        let content = resp.text().await?;
5038        match content_type {
5039            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
5040            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::TenantResponse`"))),
5041            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::TenantResponse`")))),
5042        }
5043    } else {
5044        let content = resp.text().await?;
5045        let entity: Option<CreateTenantWithIdError> = serde_json::from_str(&content).ok();
5046        Err(Error::ResponseError(ResponseContent { status, content, entity }))
5047    }
5048}
5049
5050/// Creates a Theme. You can optionally specify an Id for the theme, if not provided one will be generated.
5051pub async fn create_theme(configuration: &configuration::Configuration, theme_request: Option<models::ThemeRequest>) -> Result<models::ThemeResponse, Error<CreateThemeError>> {
5052    // add a prefix to parameters to efficiently prevent name collisions
5053    let p_theme_request = theme_request;
5054
5055    let uri_str = format!("{}/api/theme", configuration.base_path);
5056    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
5057
5058    if let Some(ref user_agent) = configuration.user_agent {
5059        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5060    }
5061    if let Some(ref apikey) = configuration.api_key {
5062        let key = apikey.key.clone();
5063        let value = match apikey.prefix {
5064            Some(ref prefix) => format!("{} {}", prefix, key),
5065            None => key,
5066        };
5067        req_builder = req_builder.header("Authorization", value);
5068    };
5069    req_builder = req_builder.json(&p_theme_request);
5070
5071    let req = req_builder.build()?;
5072    let resp = configuration.client.execute(req).await?;
5073
5074    let status = resp.status();
5075    let content_type = resp
5076        .headers()
5077        .get("content-type")
5078        .and_then(|v| v.to_str().ok())
5079        .unwrap_or("application/octet-stream");
5080    let content_type = super::ContentType::from(content_type);
5081
5082    if !status.is_client_error() && !status.is_server_error() {
5083        let content = resp.text().await?;
5084        match content_type {
5085            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
5086            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ThemeResponse`"))),
5087            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ThemeResponse`")))),
5088        }
5089    } else {
5090        let content = resp.text().await?;
5091        let entity: Option<CreateThemeError> = serde_json::from_str(&content).ok();
5092        Err(Error::ResponseError(ResponseContent { status, content, entity }))
5093    }
5094}
5095
5096/// Creates a Theme. You can optionally specify an Id for the theme, if not provided one will be generated.
5097pub async fn create_theme_with_id(configuration: &configuration::Configuration, theme_id: &str, theme_request: Option<models::ThemeRequest>) -> Result<models::ThemeResponse, Error<CreateThemeWithIdError>> {
5098    // add a prefix to parameters to efficiently prevent name collisions
5099    let p_theme_id = theme_id;
5100    let p_theme_request = theme_request;
5101
5102    let uri_str = format!("{}/api/theme/{themeId}", configuration.base_path, themeId=crate::apis::urlencode(p_theme_id));
5103    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
5104
5105    if let Some(ref user_agent) = configuration.user_agent {
5106        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5107    }
5108    if let Some(ref apikey) = configuration.api_key {
5109        let key = apikey.key.clone();
5110        let value = match apikey.prefix {
5111            Some(ref prefix) => format!("{} {}", prefix, key),
5112            None => key,
5113        };
5114        req_builder = req_builder.header("Authorization", value);
5115    };
5116    req_builder = req_builder.json(&p_theme_request);
5117
5118    let req = req_builder.build()?;
5119    let resp = configuration.client.execute(req).await?;
5120
5121    let status = resp.status();
5122    let content_type = resp
5123        .headers()
5124        .get("content-type")
5125        .and_then(|v| v.to_str().ok())
5126        .unwrap_or("application/octet-stream");
5127    let content_type = super::ContentType::from(content_type);
5128
5129    if !status.is_client_error() && !status.is_server_error() {
5130        let content = resp.text().await?;
5131        match content_type {
5132            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
5133            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ThemeResponse`"))),
5134            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ThemeResponse`")))),
5135        }
5136    } else {
5137        let content = resp.text().await?;
5138        let entity: Option<CreateThemeWithIdError> = serde_json::from_str(&content).ok();
5139        Err(Error::ResponseError(ResponseContent { status, content, entity }))
5140    }
5141}
5142
5143/// Exchanges an OAuth authorization code and code_verifier for an access token. Makes a request to the Token endpoint to exchange the authorization code returned from the Authorize endpoint and a code_verifier for an access token. OR Make a Client Credentials grant request to obtain an access token. OR Exchange a Refresh Token for an Access Token. If you will be using the Refresh Token Grant, you will make a request to the Token endpoint to exchange the user’s refresh token for an access token. OR Exchange User Credentials for a Token. If you will be using the Resource Owner Password Credential Grant, you will make a request to the Token endpoint to exchange the user’s email and password for an access token. OR Exchanges an OAuth authorization code for an access token. Makes a request to the Token endpoint to exchange the authorization code returned from the Authorize endpoint for an access token.
5144pub async fn create_token(configuration: &configuration::Configuration, ) -> Result<models::AccessToken, Error<CreateTokenError>> {
5145
5146    let uri_str = format!("{}/oauth2/token", configuration.base_path);
5147    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
5148
5149    if let Some(ref user_agent) = configuration.user_agent {
5150        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5151    }
5152    if let Some(ref apikey) = configuration.api_key {
5153        let key = apikey.key.clone();
5154        let value = match apikey.prefix {
5155            Some(ref prefix) => format!("{} {}", prefix, key),
5156            None => key,
5157        };
5158        req_builder = req_builder.header("Authorization", value);
5159    };
5160
5161    let req = req_builder.build()?;
5162    let resp = configuration.client.execute(req).await?;
5163
5164    let status = resp.status();
5165    let content_type = resp
5166        .headers()
5167        .get("content-type")
5168        .and_then(|v| v.to_str().ok())
5169        .unwrap_or("application/octet-stream");
5170    let content_type = super::ContentType::from(content_type);
5171
5172    if !status.is_client_error() && !status.is_server_error() {
5173        let content = resp.text().await?;
5174        match content_type {
5175            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
5176            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::AccessToken`"))),
5177            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::AccessToken`")))),
5178        }
5179    } else {
5180        let content = resp.text().await?;
5181        let entity: Option<CreateTokenError> = serde_json::from_str(&content).ok();
5182        Err(Error::ResponseError(ResponseContent { status, content, entity }))
5183    }
5184}
5185
5186/// Creates a user. You can optionally specify an Id for the user, if not provided one will be generated.
5187pub async fn create_user(configuration: &configuration::Configuration, x_fusion_auth_tenant_id: Option<&str>, user_request: Option<models::UserRequest>) -> Result<models::UserResponse, Error<CreateUserError>> {
5188    // add a prefix to parameters to efficiently prevent name collisions
5189    let p_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
5190    let p_user_request = user_request;
5191
5192    let uri_str = format!("{}/api/user", configuration.base_path);
5193    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
5194
5195    if let Some(ref user_agent) = configuration.user_agent {
5196        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5197    }
5198    if let Some(param_value) = p_x_fusion_auth_tenant_id {
5199        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
5200    }
5201    if let Some(ref apikey) = configuration.api_key {
5202        let key = apikey.key.clone();
5203        let value = match apikey.prefix {
5204            Some(ref prefix) => format!("{} {}", prefix, key),
5205            None => key,
5206        };
5207        req_builder = req_builder.header("Authorization", value);
5208    };
5209    req_builder = req_builder.json(&p_user_request);
5210
5211    let req = req_builder.build()?;
5212    let resp = configuration.client.execute(req).await?;
5213
5214    let status = resp.status();
5215    let content_type = resp
5216        .headers()
5217        .get("content-type")
5218        .and_then(|v| v.to_str().ok())
5219        .unwrap_or("application/octet-stream");
5220    let content_type = super::ContentType::from(content_type);
5221
5222    if !status.is_client_error() && !status.is_server_error() {
5223        let content = resp.text().await?;
5224        match content_type {
5225            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
5226            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::UserResponse`"))),
5227            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::UserResponse`")))),
5228        }
5229    } else {
5230        let content = resp.text().await?;
5231        let entity: Option<CreateUserError> = serde_json::from_str(&content).ok();
5232        Err(Error::ResponseError(ResponseContent { status, content, entity }))
5233    }
5234}
5235
5236/// Creates a user action. This action cannot be taken on a user until this call successfully returns. Anytime after that the user action can be applied to any user.
5237pub async fn create_user_action(configuration: &configuration::Configuration, x_fusion_auth_tenant_id: Option<&str>, user_action_request: Option<models::UserActionRequest>) -> Result<models::UserActionResponse, Error<CreateUserActionError>> {
5238    // add a prefix to parameters to efficiently prevent name collisions
5239    let p_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
5240    let p_user_action_request = user_action_request;
5241
5242    let uri_str = format!("{}/api/user-action", configuration.base_path);
5243    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
5244
5245    if let Some(ref user_agent) = configuration.user_agent {
5246        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5247    }
5248    if let Some(param_value) = p_x_fusion_auth_tenant_id {
5249        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
5250    }
5251    if let Some(ref apikey) = configuration.api_key {
5252        let key = apikey.key.clone();
5253        let value = match apikey.prefix {
5254            Some(ref prefix) => format!("{} {}", prefix, key),
5255            None => key,
5256        };
5257        req_builder = req_builder.header("Authorization", value);
5258    };
5259    req_builder = req_builder.json(&p_user_action_request);
5260
5261    let req = req_builder.build()?;
5262    let resp = configuration.client.execute(req).await?;
5263
5264    let status = resp.status();
5265    let content_type = resp
5266        .headers()
5267        .get("content-type")
5268        .and_then(|v| v.to_str().ok())
5269        .unwrap_or("application/octet-stream");
5270    let content_type = super::ContentType::from(content_type);
5271
5272    if !status.is_client_error() && !status.is_server_error() {
5273        let content = resp.text().await?;
5274        match content_type {
5275            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
5276            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::UserActionResponse`"))),
5277            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::UserActionResponse`")))),
5278        }
5279    } else {
5280        let content = resp.text().await?;
5281        let entity: Option<CreateUserActionError> = serde_json::from_str(&content).ok();
5282        Err(Error::ResponseError(ResponseContent { status, content, entity }))
5283    }
5284}
5285
5286/// Creates a user reason. This user action reason cannot be used when actioning a user until this call completes successfully. Anytime after that the user action reason can be used.
5287pub async fn create_user_action_reason(configuration: &configuration::Configuration, user_action_reason_request: Option<models::UserActionReasonRequest>) -> Result<models::UserActionReasonResponse, Error<CreateUserActionReasonError>> {
5288    // add a prefix to parameters to efficiently prevent name collisions
5289    let p_user_action_reason_request = user_action_reason_request;
5290
5291    let uri_str = format!("{}/api/user-action-reason", configuration.base_path);
5292    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
5293
5294    if let Some(ref user_agent) = configuration.user_agent {
5295        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5296    }
5297    if let Some(ref apikey) = configuration.api_key {
5298        let key = apikey.key.clone();
5299        let value = match apikey.prefix {
5300            Some(ref prefix) => format!("{} {}", prefix, key),
5301            None => key,
5302        };
5303        req_builder = req_builder.header("Authorization", value);
5304    };
5305    req_builder = req_builder.json(&p_user_action_reason_request);
5306
5307    let req = req_builder.build()?;
5308    let resp = configuration.client.execute(req).await?;
5309
5310    let status = resp.status();
5311    let content_type = resp
5312        .headers()
5313        .get("content-type")
5314        .and_then(|v| v.to_str().ok())
5315        .unwrap_or("application/octet-stream");
5316    let content_type = super::ContentType::from(content_type);
5317
5318    if !status.is_client_error() && !status.is_server_error() {
5319        let content = resp.text().await?;
5320        match content_type {
5321            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
5322            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::UserActionReasonResponse`"))),
5323            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::UserActionReasonResponse`")))),
5324        }
5325    } else {
5326        let content = resp.text().await?;
5327        let entity: Option<CreateUserActionReasonError> = serde_json::from_str(&content).ok();
5328        Err(Error::ResponseError(ResponseContent { status, content, entity }))
5329    }
5330}
5331
5332/// Creates a user reason. This user action reason cannot be used when actioning a user until this call completes successfully. Anytime after that the user action reason can be used.
5333pub async fn create_user_action_reason_with_id(configuration: &configuration::Configuration, user_action_reason_id: &str, user_action_reason_request: Option<models::UserActionReasonRequest>) -> Result<models::UserActionReasonResponse, Error<CreateUserActionReasonWithIdError>> {
5334    // add a prefix to parameters to efficiently prevent name collisions
5335    let p_user_action_reason_id = user_action_reason_id;
5336    let p_user_action_reason_request = user_action_reason_request;
5337
5338    let uri_str = format!("{}/api/user-action-reason/{userActionReasonId}", configuration.base_path, userActionReasonId=crate::apis::urlencode(p_user_action_reason_id));
5339    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
5340
5341    if let Some(ref user_agent) = configuration.user_agent {
5342        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5343    }
5344    if let Some(ref apikey) = configuration.api_key {
5345        let key = apikey.key.clone();
5346        let value = match apikey.prefix {
5347            Some(ref prefix) => format!("{} {}", prefix, key),
5348            None => key,
5349        };
5350        req_builder = req_builder.header("Authorization", value);
5351    };
5352    req_builder = req_builder.json(&p_user_action_reason_request);
5353
5354    let req = req_builder.build()?;
5355    let resp = configuration.client.execute(req).await?;
5356
5357    let status = resp.status();
5358    let content_type = resp
5359        .headers()
5360        .get("content-type")
5361        .and_then(|v| v.to_str().ok())
5362        .unwrap_or("application/octet-stream");
5363    let content_type = super::ContentType::from(content_type);
5364
5365    if !status.is_client_error() && !status.is_server_error() {
5366        let content = resp.text().await?;
5367        match content_type {
5368            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
5369            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::UserActionReasonResponse`"))),
5370            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::UserActionReasonResponse`")))),
5371        }
5372    } else {
5373        let content = resp.text().await?;
5374        let entity: Option<CreateUserActionReasonWithIdError> = serde_json::from_str(&content).ok();
5375        Err(Error::ResponseError(ResponseContent { status, content, entity }))
5376    }
5377}
5378
5379/// Creates a user action. This action cannot be taken on a user until this call successfully returns. Anytime after that the user action can be applied to any user.
5380pub async fn create_user_action_with_id(configuration: &configuration::Configuration, user_action_id: &str, x_fusion_auth_tenant_id: Option<&str>, user_action_request: Option<models::UserActionRequest>) -> Result<models::UserActionResponse, Error<CreateUserActionWithIdError>> {
5381    // add a prefix to parameters to efficiently prevent name collisions
5382    let p_user_action_id = user_action_id;
5383    let p_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
5384    let p_user_action_request = user_action_request;
5385
5386    let uri_str = format!("{}/api/user-action/{userActionId}", configuration.base_path, userActionId=crate::apis::urlencode(p_user_action_id));
5387    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
5388
5389    if let Some(ref user_agent) = configuration.user_agent {
5390        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5391    }
5392    if let Some(param_value) = p_x_fusion_auth_tenant_id {
5393        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
5394    }
5395    if let Some(ref apikey) = configuration.api_key {
5396        let key = apikey.key.clone();
5397        let value = match apikey.prefix {
5398            Some(ref prefix) => format!("{} {}", prefix, key),
5399            None => key,
5400        };
5401        req_builder = req_builder.header("Authorization", value);
5402    };
5403    req_builder = req_builder.json(&p_user_action_request);
5404
5405    let req = req_builder.build()?;
5406    let resp = configuration.client.execute(req).await?;
5407
5408    let status = resp.status();
5409    let content_type = resp
5410        .headers()
5411        .get("content-type")
5412        .and_then(|v| v.to_str().ok())
5413        .unwrap_or("application/octet-stream");
5414    let content_type = super::ContentType::from(content_type);
5415
5416    if !status.is_client_error() && !status.is_server_error() {
5417        let content = resp.text().await?;
5418        match content_type {
5419            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
5420            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::UserActionResponse`"))),
5421            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::UserActionResponse`")))),
5422        }
5423    } else {
5424        let content = resp.text().await?;
5425        let entity: Option<CreateUserActionWithIdError> = serde_json::from_str(&content).ok();
5426        Err(Error::ResponseError(ResponseContent { status, content, entity }))
5427    }
5428}
5429
5430/// Creates a single User consent.
5431pub async fn create_user_consent(configuration: &configuration::Configuration, user_consent_request: Option<models::UserConsentRequest>) -> Result<models::UserConsentResponse, Error<CreateUserConsentError>> {
5432    // add a prefix to parameters to efficiently prevent name collisions
5433    let p_user_consent_request = user_consent_request;
5434
5435    let uri_str = format!("{}/api/user/consent", configuration.base_path);
5436    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
5437
5438    if let Some(ref user_agent) = configuration.user_agent {
5439        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5440    }
5441    if let Some(ref apikey) = configuration.api_key {
5442        let key = apikey.key.clone();
5443        let value = match apikey.prefix {
5444            Some(ref prefix) => format!("{} {}", prefix, key),
5445            None => key,
5446        };
5447        req_builder = req_builder.header("Authorization", value);
5448    };
5449    req_builder = req_builder.json(&p_user_consent_request);
5450
5451    let req = req_builder.build()?;
5452    let resp = configuration.client.execute(req).await?;
5453
5454    let status = resp.status();
5455    let content_type = resp
5456        .headers()
5457        .get("content-type")
5458        .and_then(|v| v.to_str().ok())
5459        .unwrap_or("application/octet-stream");
5460    let content_type = super::ContentType::from(content_type);
5461
5462    if !status.is_client_error() && !status.is_server_error() {
5463        let content = resp.text().await?;
5464        match content_type {
5465            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
5466            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::UserConsentResponse`"))),
5467            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::UserConsentResponse`")))),
5468        }
5469    } else {
5470        let content = resp.text().await?;
5471        let entity: Option<CreateUserConsentError> = serde_json::from_str(&content).ok();
5472        Err(Error::ResponseError(ResponseContent { status, content, entity }))
5473    }
5474}
5475
5476/// Creates a single User consent.
5477pub async fn create_user_consent_with_id(configuration: &configuration::Configuration, user_consent_id: &str, user_consent_request: Option<models::UserConsentRequest>) -> Result<models::UserConsentResponse, Error<CreateUserConsentWithIdError>> {
5478    // add a prefix to parameters to efficiently prevent name collisions
5479    let p_user_consent_id = user_consent_id;
5480    let p_user_consent_request = user_consent_request;
5481
5482    let uri_str = format!("{}/api/user/consent/{userConsentId}", configuration.base_path, userConsentId=crate::apis::urlencode(p_user_consent_id));
5483    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
5484
5485    if let Some(ref user_agent) = configuration.user_agent {
5486        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5487    }
5488    if let Some(ref apikey) = configuration.api_key {
5489        let key = apikey.key.clone();
5490        let value = match apikey.prefix {
5491            Some(ref prefix) => format!("{} {}", prefix, key),
5492            None => key,
5493        };
5494        req_builder = req_builder.header("Authorization", value);
5495    };
5496    req_builder = req_builder.json(&p_user_consent_request);
5497
5498    let req = req_builder.build()?;
5499    let resp = configuration.client.execute(req).await?;
5500
5501    let status = resp.status();
5502    let content_type = resp
5503        .headers()
5504        .get("content-type")
5505        .and_then(|v| v.to_str().ok())
5506        .unwrap_or("application/octet-stream");
5507    let content_type = super::ContentType::from(content_type);
5508
5509    if !status.is_client_error() && !status.is_server_error() {
5510        let content = resp.text().await?;
5511        match content_type {
5512            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
5513            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::UserConsentResponse`"))),
5514            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::UserConsentResponse`")))),
5515        }
5516    } else {
5517        let content = resp.text().await?;
5518        let entity: Option<CreateUserConsentWithIdError> = serde_json::from_str(&content).ok();
5519        Err(Error::ResponseError(ResponseContent { status, content, entity }))
5520    }
5521}
5522
5523/// Link an external user from a 3rd party identity provider to a FusionAuth user.
5524pub async fn create_user_link_with_id(configuration: &configuration::Configuration, identity_provider_link_request: Option<models::IdentityProviderLinkRequest>) -> Result<models::IdentityProviderLinkResponse, Error<CreateUserLinkWithIdError>> {
5525    // add a prefix to parameters to efficiently prevent name collisions
5526    let p_identity_provider_link_request = identity_provider_link_request;
5527
5528    let uri_str = format!("{}/api/identity-provider/link", configuration.base_path);
5529    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
5530
5531    if let Some(ref user_agent) = configuration.user_agent {
5532        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5533    }
5534    if let Some(ref apikey) = configuration.api_key {
5535        let key = apikey.key.clone();
5536        let value = match apikey.prefix {
5537            Some(ref prefix) => format!("{} {}", prefix, key),
5538            None => key,
5539        };
5540        req_builder = req_builder.header("Authorization", value);
5541    };
5542    req_builder = req_builder.json(&p_identity_provider_link_request);
5543
5544    let req = req_builder.build()?;
5545    let resp = configuration.client.execute(req).await?;
5546
5547    let status = resp.status();
5548    let content_type = resp
5549        .headers()
5550        .get("content-type")
5551        .and_then(|v| v.to_str().ok())
5552        .unwrap_or("application/octet-stream");
5553    let content_type = super::ContentType::from(content_type);
5554
5555    if !status.is_client_error() && !status.is_server_error() {
5556        let content = resp.text().await?;
5557        match content_type {
5558            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
5559            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IdentityProviderLinkResponse`"))),
5560            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IdentityProviderLinkResponse`")))),
5561        }
5562    } else {
5563        let content = resp.text().await?;
5564        let entity: Option<CreateUserLinkWithIdError> = serde_json::from_str(&content).ok();
5565        Err(Error::ResponseError(ResponseContent { status, content, entity }))
5566    }
5567}
5568
5569/// Administratively verify a user's email address. Use this method to bypass email verification for the user.  The request body will contain the userId to be verified. An API key is required when sending the userId in the request body. OR Confirms a user's email address.   The request body will contain the verificationId. You may also be required to send a one-time use code based upon your configuration. When  the tenant is configured to gate a user until their email address is verified, this procedures requires two values instead of one.  The verificationId is a high entropy value and the one-time use code is a low entropy value that is easily entered in a user interactive form. The  two values together are able to confirm a user's email address and mark the user's email address as verified.
5570pub async fn create_user_verify_email(configuration: &configuration::Configuration, verify_email_request: Option<models::VerifyEmailRequest>) -> Result<(), Error<CreateUserVerifyEmailError>> {
5571    // add a prefix to parameters to efficiently prevent name collisions
5572    let p_verify_email_request = verify_email_request;
5573
5574    let uri_str = format!("{}/api/user/verify-email", configuration.base_path);
5575    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
5576
5577    if let Some(ref user_agent) = configuration.user_agent {
5578        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5579    }
5580    if let Some(ref apikey) = configuration.api_key {
5581        let key = apikey.key.clone();
5582        let value = match apikey.prefix {
5583            Some(ref prefix) => format!("{} {}", prefix, key),
5584            None => key,
5585        };
5586        req_builder = req_builder.header("Authorization", value);
5587    };
5588    req_builder = req_builder.json(&p_verify_email_request);
5589
5590    let req = req_builder.build()?;
5591    let resp = configuration.client.execute(req).await?;
5592
5593    let status = resp.status();
5594
5595    if !status.is_client_error() && !status.is_server_error() {
5596        Ok(())
5597    } else {
5598        let content = resp.text().await?;
5599        let entity: Option<CreateUserVerifyEmailError> = serde_json::from_str(&content).ok();
5600        Err(Error::ResponseError(ResponseContent { status, content, entity }))
5601    }
5602}
5603
5604/// Creates a user. You can optionally specify an Id for the user, if not provided one will be generated.
5605pub async fn create_user_with_id(configuration: &configuration::Configuration, user_id: &str, x_fusion_auth_tenant_id: Option<&str>, user_request: Option<models::UserRequest>) -> Result<models::UserResponse, Error<CreateUserWithIdError>> {
5606    // add a prefix to parameters to efficiently prevent name collisions
5607    let p_user_id = user_id;
5608    let p_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
5609    let p_user_request = user_request;
5610
5611    let uri_str = format!("{}/api/user/{userId}", configuration.base_path, userId=crate::apis::urlencode(p_user_id));
5612    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
5613
5614    if let Some(ref user_agent) = configuration.user_agent {
5615        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5616    }
5617    if let Some(param_value) = p_x_fusion_auth_tenant_id {
5618        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
5619    }
5620    if let Some(ref apikey) = configuration.api_key {
5621        let key = apikey.key.clone();
5622        let value = match apikey.prefix {
5623            Some(ref prefix) => format!("{} {}", prefix, key),
5624            None => key,
5625        };
5626        req_builder = req_builder.header("Authorization", value);
5627    };
5628    req_builder = req_builder.json(&p_user_request);
5629
5630    let req = req_builder.build()?;
5631    let resp = configuration.client.execute(req).await?;
5632
5633    let status = resp.status();
5634    let content_type = resp
5635        .headers()
5636        .get("content-type")
5637        .and_then(|v| v.to_str().ok())
5638        .unwrap_or("application/octet-stream");
5639    let content_type = super::ContentType::from(content_type);
5640
5641    if !status.is_client_error() && !status.is_server_error() {
5642        let content = resp.text().await?;
5643        match content_type {
5644            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
5645            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::UserResponse`"))),
5646            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::UserResponse`")))),
5647        }
5648    } else {
5649        let content = resp.text().await?;
5650        let entity: Option<CreateUserWithIdError> = serde_json::from_str(&content).ok();
5651        Err(Error::ResponseError(ResponseContent { status, content, entity }))
5652    }
5653}
5654
5655/// Creates a webhook. You can optionally specify an Id for the webhook, if not provided one will be generated.
5656pub async fn create_webhook(configuration: &configuration::Configuration, webhook_request: Option<models::WebhookRequest>) -> Result<models::WebhookResponse, Error<CreateWebhookError>> {
5657    // add a prefix to parameters to efficiently prevent name collisions
5658    let p_webhook_request = webhook_request;
5659
5660    let uri_str = format!("{}/api/webhook", configuration.base_path);
5661    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
5662
5663    if let Some(ref user_agent) = configuration.user_agent {
5664        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5665    }
5666    if let Some(ref apikey) = configuration.api_key {
5667        let key = apikey.key.clone();
5668        let value = match apikey.prefix {
5669            Some(ref prefix) => format!("{} {}", prefix, key),
5670            None => key,
5671        };
5672        req_builder = req_builder.header("Authorization", value);
5673    };
5674    req_builder = req_builder.json(&p_webhook_request);
5675
5676    let req = req_builder.build()?;
5677    let resp = configuration.client.execute(req).await?;
5678
5679    let status = resp.status();
5680    let content_type = resp
5681        .headers()
5682        .get("content-type")
5683        .and_then(|v| v.to_str().ok())
5684        .unwrap_or("application/octet-stream");
5685    let content_type = super::ContentType::from(content_type);
5686
5687    if !status.is_client_error() && !status.is_server_error() {
5688        let content = resp.text().await?;
5689        match content_type {
5690            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
5691            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::WebhookResponse`"))),
5692            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::WebhookResponse`")))),
5693        }
5694    } else {
5695        let content = resp.text().await?;
5696        let entity: Option<CreateWebhookError> = serde_json::from_str(&content).ok();
5697        Err(Error::ResponseError(ResponseContent { status, content, entity }))
5698    }
5699}
5700
5701/// Creates a webhook. You can optionally specify an Id for the webhook, if not provided one will be generated.
5702pub async fn create_webhook_with_id(configuration: &configuration::Configuration, webhook_id: &str, webhook_request: Option<models::WebhookRequest>) -> Result<models::WebhookResponse, Error<CreateWebhookWithIdError>> {
5703    // add a prefix to parameters to efficiently prevent name collisions
5704    let p_webhook_id = webhook_id;
5705    let p_webhook_request = webhook_request;
5706
5707    let uri_str = format!("{}/api/webhook/{webhookId}", configuration.base_path, webhookId=crate::apis::urlencode(p_webhook_id));
5708    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
5709
5710    if let Some(ref user_agent) = configuration.user_agent {
5711        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5712    }
5713    if let Some(ref apikey) = configuration.api_key {
5714        let key = apikey.key.clone();
5715        let value = match apikey.prefix {
5716            Some(ref prefix) => format!("{} {}", prefix, key),
5717            None => key,
5718        };
5719        req_builder = req_builder.header("Authorization", value);
5720    };
5721    req_builder = req_builder.json(&p_webhook_request);
5722
5723    let req = req_builder.build()?;
5724    let resp = configuration.client.execute(req).await?;
5725
5726    let status = resp.status();
5727    let content_type = resp
5728        .headers()
5729        .get("content-type")
5730        .and_then(|v| v.to_str().ok())
5731        .unwrap_or("application/octet-stream");
5732    let content_type = super::ContentType::from(content_type);
5733
5734    if !status.is_client_error() && !status.is_server_error() {
5735        let content = resp.text().await?;
5736        match content_type {
5737            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
5738            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::WebhookResponse`"))),
5739            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::WebhookResponse`")))),
5740        }
5741    } else {
5742        let content = resp.text().await?;
5743        let entity: Option<CreateWebhookWithIdError> = serde_json::from_str(&content).ok();
5744        Err(Error::ResponseError(ResponseContent { status, content, entity }))
5745    }
5746}
5747
5748/// Deletes the API key for the given Id.
5749pub async fn delete_api_key_with_id(configuration: &configuration::Configuration, key_id: &str) -> Result<(), Error<DeleteApiKeyWithIdError>> {
5750    // add a prefix to parameters to efficiently prevent name collisions
5751    let p_key_id = key_id;
5752
5753    let uri_str = format!("{}/api/api-key/{keyId}", configuration.base_path, keyId=crate::apis::urlencode(p_key_id));
5754    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
5755
5756    if let Some(ref user_agent) = configuration.user_agent {
5757        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5758    }
5759    if let Some(ref apikey) = configuration.api_key {
5760        let key = apikey.key.clone();
5761        let value = match apikey.prefix {
5762            Some(ref prefix) => format!("{} {}", prefix, key),
5763            None => key,
5764        };
5765        req_builder = req_builder.header("Authorization", value);
5766    };
5767
5768    let req = req_builder.build()?;
5769    let resp = configuration.client.execute(req).await?;
5770
5771    let status = resp.status();
5772
5773    if !status.is_client_error() && !status.is_server_error() {
5774        Ok(())
5775    } else {
5776        let content = resp.text().await?;
5777        let entity: Option<DeleteApiKeyWithIdError> = serde_json::from_str(&content).ok();
5778        Err(Error::ResponseError(ResponseContent { status, content, entity }))
5779    }
5780}
5781
5782/// Hard deletes an application role. This is a dangerous operation and should not be used in most circumstances. This permanently removes the given role from all users that had it.
5783pub async fn delete_application_role_with_id(configuration: &configuration::Configuration, application_id: &str, role_id: &str, x_fusion_auth_tenant_id: Option<&str>) -> Result<(), Error<DeleteApplicationRoleWithIdError>> {
5784    // add a prefix to parameters to efficiently prevent name collisions
5785    let p_application_id = application_id;
5786    let p_role_id = role_id;
5787    let p_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
5788
5789    let uri_str = format!("{}/api/application/{applicationId}/role/{roleId}", configuration.base_path, applicationId=crate::apis::urlencode(p_application_id), roleId=crate::apis::urlencode(p_role_id));
5790    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
5791
5792    if let Some(ref user_agent) = configuration.user_agent {
5793        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5794    }
5795    if let Some(param_value) = p_x_fusion_auth_tenant_id {
5796        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
5797    }
5798    if let Some(ref apikey) = configuration.api_key {
5799        let key = apikey.key.clone();
5800        let value = match apikey.prefix {
5801            Some(ref prefix) => format!("{} {}", prefix, key),
5802            None => key,
5803        };
5804        req_builder = req_builder.header("Authorization", value);
5805    };
5806
5807    let req = req_builder.build()?;
5808    let resp = configuration.client.execute(req).await?;
5809
5810    let status = resp.status();
5811
5812    if !status.is_client_error() && !status.is_server_error() {
5813        Ok(())
5814    } else {
5815        let content = resp.text().await?;
5816        let entity: Option<DeleteApplicationRoleWithIdError> = serde_json::from_str(&content).ok();
5817        Err(Error::ResponseError(ResponseContent { status, content, entity }))
5818    }
5819}
5820
5821/// Hard deletes an application. This is a dangerous operation and should not be used in most circumstances. This will delete the application, any registrations for that application, metrics and reports for the application, all the roles for the application, and any other data associated with the application. This operation could take a very long time, depending on the amount of data in your database. OR Deactivates the application with the given Id.
5822pub async fn delete_application_with_id(configuration: &configuration::Configuration, application_id: &str, hard_delete: Option<&str>, x_fusion_auth_tenant_id: Option<&str>) -> Result<(), Error<DeleteApplicationWithIdError>> {
5823    // add a prefix to parameters to efficiently prevent name collisions
5824    let p_application_id = application_id;
5825    let p_hard_delete = hard_delete;
5826    let p_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
5827
5828    let uri_str = format!("{}/api/application/{applicationId}", configuration.base_path, applicationId=crate::apis::urlencode(p_application_id));
5829    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
5830
5831    if let Some(ref param_value) = p_hard_delete {
5832        req_builder = req_builder.query(&[("hardDelete", &param_value.to_string())]);
5833    }
5834    if let Some(ref user_agent) = configuration.user_agent {
5835        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5836    }
5837    if let Some(param_value) = p_x_fusion_auth_tenant_id {
5838        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
5839    }
5840    if let Some(ref apikey) = configuration.api_key {
5841        let key = apikey.key.clone();
5842        let value = match apikey.prefix {
5843            Some(ref prefix) => format!("{} {}", prefix, key),
5844            None => key,
5845        };
5846        req_builder = req_builder.header("Authorization", value);
5847    };
5848
5849    let req = req_builder.build()?;
5850    let resp = configuration.client.execute(req).await?;
5851
5852    let status = resp.status();
5853
5854    if !status.is_client_error() && !status.is_server_error() {
5855        Ok(())
5856    } else {
5857        let content = resp.text().await?;
5858        let entity: Option<DeleteApplicationWithIdError> = serde_json::from_str(&content).ok();
5859        Err(Error::ResponseError(ResponseContent { status, content, entity }))
5860    }
5861}
5862
5863/// Deletes the connector for the given Id.
5864pub async fn delete_connector_with_id(configuration: &configuration::Configuration, connector_id: &str) -> Result<(), Error<DeleteConnectorWithIdError>> {
5865    // add a prefix to parameters to efficiently prevent name collisions
5866    let p_connector_id = connector_id;
5867
5868    let uri_str = format!("{}/api/connector/{connectorId}", configuration.base_path, connectorId=crate::apis::urlencode(p_connector_id));
5869    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
5870
5871    if let Some(ref user_agent) = configuration.user_agent {
5872        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5873    }
5874    if let Some(ref apikey) = configuration.api_key {
5875        let key = apikey.key.clone();
5876        let value = match apikey.prefix {
5877            Some(ref prefix) => format!("{} {}", prefix, key),
5878            None => key,
5879        };
5880        req_builder = req_builder.header("Authorization", value);
5881    };
5882
5883    let req = req_builder.build()?;
5884    let resp = configuration.client.execute(req).await?;
5885
5886    let status = resp.status();
5887
5888    if !status.is_client_error() && !status.is_server_error() {
5889        Ok(())
5890    } else {
5891        let content = resp.text().await?;
5892        let entity: Option<DeleteConnectorWithIdError> = serde_json::from_str(&content).ok();
5893        Err(Error::ResponseError(ResponseContent { status, content, entity }))
5894    }
5895}
5896
5897/// Deletes the consent for the given Id.
5898pub async fn delete_consent_with_id(configuration: &configuration::Configuration, consent_id: &str, x_fusion_auth_tenant_id: Option<&str>) -> Result<(), Error<DeleteConsentWithIdError>> {
5899    // add a prefix to parameters to efficiently prevent name collisions
5900    let p_consent_id = consent_id;
5901    let p_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
5902
5903    let uri_str = format!("{}/api/consent/{consentId}", configuration.base_path, consentId=crate::apis::urlencode(p_consent_id));
5904    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
5905
5906    if let Some(ref user_agent) = configuration.user_agent {
5907        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5908    }
5909    if let Some(param_value) = p_x_fusion_auth_tenant_id {
5910        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
5911    }
5912    if let Some(ref apikey) = configuration.api_key {
5913        let key = apikey.key.clone();
5914        let value = match apikey.prefix {
5915            Some(ref prefix) => format!("{} {}", prefix, key),
5916            None => key,
5917        };
5918        req_builder = req_builder.header("Authorization", value);
5919    };
5920
5921    let req = req_builder.build()?;
5922    let resp = configuration.client.execute(req).await?;
5923
5924    let status = resp.status();
5925
5926    if !status.is_client_error() && !status.is_server_error() {
5927        Ok(())
5928    } else {
5929        let content = resp.text().await?;
5930        let entity: Option<DeleteConsentWithIdError> = serde_json::from_str(&content).ok();
5931        Err(Error::ResponseError(ResponseContent { status, content, entity }))
5932    }
5933}
5934
5935/// Deletes the email template for the given Id.
5936pub async fn delete_email_template_with_id(configuration: &configuration::Configuration, email_template_id: &str, x_fusion_auth_tenant_id: Option<&str>) -> Result<(), Error<DeleteEmailTemplateWithIdError>> {
5937    // add a prefix to parameters to efficiently prevent name collisions
5938    let p_email_template_id = email_template_id;
5939    let p_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
5940
5941    let uri_str = format!("{}/api/email/template/{emailTemplateId}", configuration.base_path, emailTemplateId=crate::apis::urlencode(p_email_template_id));
5942    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
5943
5944    if let Some(ref user_agent) = configuration.user_agent {
5945        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5946    }
5947    if let Some(param_value) = p_x_fusion_auth_tenant_id {
5948        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
5949    }
5950    if let Some(ref apikey) = configuration.api_key {
5951        let key = apikey.key.clone();
5952        let value = match apikey.prefix {
5953            Some(ref prefix) => format!("{} {}", prefix, key),
5954            None => key,
5955        };
5956        req_builder = req_builder.header("Authorization", value);
5957    };
5958
5959    let req = req_builder.build()?;
5960    let resp = configuration.client.execute(req).await?;
5961
5962    let status = resp.status();
5963
5964    if !status.is_client_error() && !status.is_server_error() {
5965        Ok(())
5966    } else {
5967        let content = resp.text().await?;
5968        let entity: Option<DeleteEmailTemplateWithIdError> = serde_json::from_str(&content).ok();
5969        Err(Error::ResponseError(ResponseContent { status, content, entity }))
5970    }
5971}
5972
5973/// Deletes an Entity Grant for the given User or Entity.
5974pub async fn delete_entity_grant_with_id(configuration: &configuration::Configuration, entity_id: &str, recipient_entity_id: Option<&str>, user_id: Option<&str>, x_fusion_auth_tenant_id: Option<&str>) -> Result<(), Error<DeleteEntityGrantWithIdError>> {
5975    // add a prefix to parameters to efficiently prevent name collisions
5976    let p_entity_id = entity_id;
5977    let p_recipient_entity_id = recipient_entity_id;
5978    let p_user_id = user_id;
5979    let p_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
5980
5981    let uri_str = format!("{}/api/entity/{entityId}/grant", configuration.base_path, entityId=crate::apis::urlencode(p_entity_id));
5982    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
5983
5984    if let Some(ref param_value) = p_recipient_entity_id {
5985        req_builder = req_builder.query(&[("recipientEntityId", &param_value.to_string())]);
5986    }
5987    if let Some(ref param_value) = p_user_id {
5988        req_builder = req_builder.query(&[("userId", &param_value.to_string())]);
5989    }
5990    if let Some(ref user_agent) = configuration.user_agent {
5991        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5992    }
5993    if let Some(param_value) = p_x_fusion_auth_tenant_id {
5994        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
5995    }
5996    if let Some(ref apikey) = configuration.api_key {
5997        let key = apikey.key.clone();
5998        let value = match apikey.prefix {
5999            Some(ref prefix) => format!("{} {}", prefix, key),
6000            None => key,
6001        };
6002        req_builder = req_builder.header("Authorization", value);
6003    };
6004
6005    let req = req_builder.build()?;
6006    let resp = configuration.client.execute(req).await?;
6007
6008    let status = resp.status();
6009
6010    if !status.is_client_error() && !status.is_server_error() {
6011        Ok(())
6012    } else {
6013        let content = resp.text().await?;
6014        let entity: Option<DeleteEntityGrantWithIdError> = serde_json::from_str(&content).ok();
6015        Err(Error::ResponseError(ResponseContent { status, content, entity }))
6016    }
6017}
6018
6019/// Hard deletes a permission. This is a dangerous operation and should not be used in most circumstances. This permanently removes the given permission from all grants that had it.
6020pub async fn delete_entity_type_permission_with_id(configuration: &configuration::Configuration, entity_type_id: &str, permission_id: &str) -> Result<(), Error<DeleteEntityTypePermissionWithIdError>> {
6021    // add a prefix to parameters to efficiently prevent name collisions
6022    let p_entity_type_id = entity_type_id;
6023    let p_permission_id = permission_id;
6024
6025    let uri_str = format!("{}/api/entity/type/{entityTypeId}/permission/{permissionId}", configuration.base_path, entityTypeId=crate::apis::urlencode(p_entity_type_id), permissionId=crate::apis::urlencode(p_permission_id));
6026    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
6027
6028    if let Some(ref user_agent) = configuration.user_agent {
6029        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6030    }
6031    if let Some(ref apikey) = configuration.api_key {
6032        let key = apikey.key.clone();
6033        let value = match apikey.prefix {
6034            Some(ref prefix) => format!("{} {}", prefix, key),
6035            None => key,
6036        };
6037        req_builder = req_builder.header("Authorization", value);
6038    };
6039
6040    let req = req_builder.build()?;
6041    let resp = configuration.client.execute(req).await?;
6042
6043    let status = resp.status();
6044
6045    if !status.is_client_error() && !status.is_server_error() {
6046        Ok(())
6047    } else {
6048        let content = resp.text().await?;
6049        let entity: Option<DeleteEntityTypePermissionWithIdError> = serde_json::from_str(&content).ok();
6050        Err(Error::ResponseError(ResponseContent { status, content, entity }))
6051    }
6052}
6053
6054/// Deletes the Entity Type for the given Id.
6055pub async fn delete_entity_type_with_id(configuration: &configuration::Configuration, entity_type_id: &str) -> Result<(), Error<DeleteEntityTypeWithIdError>> {
6056    // add a prefix to parameters to efficiently prevent name collisions
6057    let p_entity_type_id = entity_type_id;
6058
6059    let uri_str = format!("{}/api/entity/type/{entityTypeId}", configuration.base_path, entityTypeId=crate::apis::urlencode(p_entity_type_id));
6060    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
6061
6062    if let Some(ref user_agent) = configuration.user_agent {
6063        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6064    }
6065    if let Some(ref apikey) = configuration.api_key {
6066        let key = apikey.key.clone();
6067        let value = match apikey.prefix {
6068            Some(ref prefix) => format!("{} {}", prefix, key),
6069            None => key,
6070        };
6071        req_builder = req_builder.header("Authorization", value);
6072    };
6073
6074    let req = req_builder.build()?;
6075    let resp = configuration.client.execute(req).await?;
6076
6077    let status = resp.status();
6078
6079    if !status.is_client_error() && !status.is_server_error() {
6080        Ok(())
6081    } else {
6082        let content = resp.text().await?;
6083        let entity: Option<DeleteEntityTypeWithIdError> = serde_json::from_str(&content).ok();
6084        Err(Error::ResponseError(ResponseContent { status, content, entity }))
6085    }
6086}
6087
6088/// Deletes the Entity for the given Id.
6089pub async fn delete_entity_with_id(configuration: &configuration::Configuration, entity_id: &str, x_fusion_auth_tenant_id: Option<&str>) -> Result<(), Error<DeleteEntityWithIdError>> {
6090    // add a prefix to parameters to efficiently prevent name collisions
6091    let p_entity_id = entity_id;
6092    let p_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
6093
6094    let uri_str = format!("{}/api/entity/{entityId}", configuration.base_path, entityId=crate::apis::urlencode(p_entity_id));
6095    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
6096
6097    if let Some(ref user_agent) = configuration.user_agent {
6098        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6099    }
6100    if let Some(param_value) = p_x_fusion_auth_tenant_id {
6101        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
6102    }
6103    if let Some(ref apikey) = configuration.api_key {
6104        let key = apikey.key.clone();
6105        let value = match apikey.prefix {
6106            Some(ref prefix) => format!("{} {}", prefix, key),
6107            None => key,
6108        };
6109        req_builder = req_builder.header("Authorization", value);
6110    };
6111
6112    let req = req_builder.build()?;
6113    let resp = configuration.client.execute(req).await?;
6114
6115    let status = resp.status();
6116
6117    if !status.is_client_error() && !status.is_server_error() {
6118        Ok(())
6119    } else {
6120        let content = resp.text().await?;
6121        let entity: Option<DeleteEntityWithIdError> = serde_json::from_str(&content).ok();
6122        Err(Error::ResponseError(ResponseContent { status, content, entity }))
6123    }
6124}
6125
6126/// Deletes the form field for the given Id.
6127pub async fn delete_form_field_with_id(configuration: &configuration::Configuration, field_id: &str) -> Result<(), Error<DeleteFormFieldWithIdError>> {
6128    // add a prefix to parameters to efficiently prevent name collisions
6129    let p_field_id = field_id;
6130
6131    let uri_str = format!("{}/api/form/field/{fieldId}", configuration.base_path, fieldId=crate::apis::urlencode(p_field_id));
6132    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
6133
6134    if let Some(ref user_agent) = configuration.user_agent {
6135        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6136    }
6137    if let Some(ref apikey) = configuration.api_key {
6138        let key = apikey.key.clone();
6139        let value = match apikey.prefix {
6140            Some(ref prefix) => format!("{} {}", prefix, key),
6141            None => key,
6142        };
6143        req_builder = req_builder.header("Authorization", value);
6144    };
6145
6146    let req = req_builder.build()?;
6147    let resp = configuration.client.execute(req).await?;
6148
6149    let status = resp.status();
6150
6151    if !status.is_client_error() && !status.is_server_error() {
6152        Ok(())
6153    } else {
6154        let content = resp.text().await?;
6155        let entity: Option<DeleteFormFieldWithIdError> = serde_json::from_str(&content).ok();
6156        Err(Error::ResponseError(ResponseContent { status, content, entity }))
6157    }
6158}
6159
6160/// Deletes the form for the given Id.
6161pub async fn delete_form_with_id(configuration: &configuration::Configuration, form_id: &str) -> Result<(), Error<DeleteFormWithIdError>> {
6162    // add a prefix to parameters to efficiently prevent name collisions
6163    let p_form_id = form_id;
6164
6165    let uri_str = format!("{}/api/form/{formId}", configuration.base_path, formId=crate::apis::urlencode(p_form_id));
6166    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
6167
6168    if let Some(ref user_agent) = configuration.user_agent {
6169        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6170    }
6171    if let Some(ref apikey) = configuration.api_key {
6172        let key = apikey.key.clone();
6173        let value = match apikey.prefix {
6174            Some(ref prefix) => format!("{} {}", prefix, key),
6175            None => key,
6176        };
6177        req_builder = req_builder.header("Authorization", value);
6178    };
6179
6180    let req = req_builder.build()?;
6181    let resp = configuration.client.execute(req).await?;
6182
6183    let status = resp.status();
6184
6185    if !status.is_client_error() && !status.is_server_error() {
6186        Ok(())
6187    } else {
6188        let content = resp.text().await?;
6189        let entity: Option<DeleteFormWithIdError> = serde_json::from_str(&content).ok();
6190        Err(Error::ResponseError(ResponseContent { status, content, entity }))
6191    }
6192}
6193
6194/// Removes users as members of a group.
6195pub async fn delete_group_members_with_id(configuration: &configuration::Configuration, member_delete_request: Option<models::MemberDeleteRequest>) -> Result<(), Error<DeleteGroupMembersWithIdError>> {
6196    // add a prefix to parameters to efficiently prevent name collisions
6197    let p_member_delete_request = member_delete_request;
6198
6199    let uri_str = format!("{}/api/group/member", configuration.base_path);
6200    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
6201
6202    if let Some(ref user_agent) = configuration.user_agent {
6203        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6204    }
6205    if let Some(ref apikey) = configuration.api_key {
6206        let key = apikey.key.clone();
6207        let value = match apikey.prefix {
6208            Some(ref prefix) => format!("{} {}", prefix, key),
6209            None => key,
6210        };
6211        req_builder = req_builder.header("Authorization", value);
6212    };
6213    req_builder = req_builder.json(&p_member_delete_request);
6214
6215    let req = req_builder.build()?;
6216    let resp = configuration.client.execute(req).await?;
6217
6218    let status = resp.status();
6219
6220    if !status.is_client_error() && !status.is_server_error() {
6221        Ok(())
6222    } else {
6223        let content = resp.text().await?;
6224        let entity: Option<DeleteGroupMembersWithIdError> = serde_json::from_str(&content).ok();
6225        Err(Error::ResponseError(ResponseContent { status, content, entity }))
6226    }
6227}
6228
6229/// Deletes the group for the given Id.
6230pub async fn delete_group_with_id(configuration: &configuration::Configuration, group_id: &str, x_fusion_auth_tenant_id: Option<&str>) -> Result<(), Error<DeleteGroupWithIdError>> {
6231    // add a prefix to parameters to efficiently prevent name collisions
6232    let p_group_id = group_id;
6233    let p_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
6234
6235    let uri_str = format!("{}/api/group/{groupId}", configuration.base_path, groupId=crate::apis::urlencode(p_group_id));
6236    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
6237
6238    if let Some(ref user_agent) = configuration.user_agent {
6239        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6240    }
6241    if let Some(param_value) = p_x_fusion_auth_tenant_id {
6242        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
6243    }
6244    if let Some(ref apikey) = configuration.api_key {
6245        let key = apikey.key.clone();
6246        let value = match apikey.prefix {
6247            Some(ref prefix) => format!("{} {}", prefix, key),
6248            None => key,
6249        };
6250        req_builder = req_builder.header("Authorization", value);
6251    };
6252
6253    let req = req_builder.build()?;
6254    let resp = configuration.client.execute(req).await?;
6255
6256    let status = resp.status();
6257
6258    if !status.is_client_error() && !status.is_server_error() {
6259        Ok(())
6260    } else {
6261        let content = resp.text().await?;
6262        let entity: Option<DeleteGroupWithIdError> = serde_json::from_str(&content).ok();
6263        Err(Error::ResponseError(ResponseContent { status, content, entity }))
6264    }
6265}
6266
6267/// Deletes the identity provider for the given Id.
6268pub async fn delete_identity_provider_with_id(configuration: &configuration::Configuration, identity_provider_id: &str) -> Result<(), Error<DeleteIdentityProviderWithIdError>> {
6269    // add a prefix to parameters to efficiently prevent name collisions
6270    let p_identity_provider_id = identity_provider_id;
6271
6272    let uri_str = format!("{}/api/identity-provider/{identityProviderId}", configuration.base_path, identityProviderId=crate::apis::urlencode(p_identity_provider_id));
6273    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
6274
6275    if let Some(ref user_agent) = configuration.user_agent {
6276        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6277    }
6278    if let Some(ref apikey) = configuration.api_key {
6279        let key = apikey.key.clone();
6280        let value = match apikey.prefix {
6281            Some(ref prefix) => format!("{} {}", prefix, key),
6282            None => key,
6283        };
6284        req_builder = req_builder.header("Authorization", value);
6285    };
6286
6287    let req = req_builder.build()?;
6288    let resp = configuration.client.execute(req).await?;
6289
6290    let status = resp.status();
6291
6292    if !status.is_client_error() && !status.is_server_error() {
6293        Ok(())
6294    } else {
6295        let content = resp.text().await?;
6296        let entity: Option<DeleteIdentityProviderWithIdError> = serde_json::from_str(&content).ok();
6297        Err(Error::ResponseError(ResponseContent { status, content, entity }))
6298    }
6299}
6300
6301/// Deletes the IP Access Control List for the given Id.
6302pub async fn delete_ip_access_control_list_with_id(configuration: &configuration::Configuration, ip_access_control_list_id: &str) -> Result<(), Error<DeleteIpAccessControlListWithIdError>> {
6303    // add a prefix to parameters to efficiently prevent name collisions
6304    let p_ip_access_control_list_id = ip_access_control_list_id;
6305
6306    let uri_str = format!("{}/api/ip-acl/{ipAccessControlListId}", configuration.base_path, ipAccessControlListId=crate::apis::urlencode(p_ip_access_control_list_id));
6307    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
6308
6309    if let Some(ref user_agent) = configuration.user_agent {
6310        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6311    }
6312    if let Some(ref apikey) = configuration.api_key {
6313        let key = apikey.key.clone();
6314        let value = match apikey.prefix {
6315            Some(ref prefix) => format!("{} {}", prefix, key),
6316            None => key,
6317        };
6318        req_builder = req_builder.header("Authorization", value);
6319    };
6320
6321    let req = req_builder.build()?;
6322    let resp = configuration.client.execute(req).await?;
6323
6324    let status = resp.status();
6325
6326    if !status.is_client_error() && !status.is_server_error() {
6327        Ok(())
6328    } else {
6329        let content = resp.text().await?;
6330        let entity: Option<DeleteIpAccessControlListWithIdError> = serde_json::from_str(&content).ok();
6331        Err(Error::ResponseError(ResponseContent { status, content, entity }))
6332    }
6333}
6334
6335/// Revoke all refresh tokens that belong to a user by user Id. OR Revoke all refresh tokens that belong to a user by user Id for a specific application by applicationId. OR Revoke all refresh tokens that belong to an application by applicationId. OR Revokes refresh tokens using the information in the JSON body. The handling for this method is the same as the revokeRefreshToken method and is based on the information you provide in the RefreshDeleteRequest object. See that method for additional information. OR Revokes a single refresh token by using the actual refresh token value. This refresh token value is sensitive, so  be careful with this API request. OR Revokes refresh tokens.  Usage examples:   - Delete a single refresh token, pass in only the token.       revokeRefreshToken(token)    - Delete all refresh tokens for a user, pass in only the userId.       revokeRefreshToken(null, userId)    - Delete all refresh tokens for a user for a specific application, pass in both the userId and the applicationId.       revokeRefreshToken(null, userId, applicationId)    - Delete all refresh tokens for an application       revokeRefreshToken(null, null, applicationId)  Note: <code>null</code> may be handled differently depending upon the programming language.  See also: (method names may vary by language... but you'll figure it out)   - revokeRefreshTokenById  - revokeRefreshTokenByToken  - revokeRefreshTokensByUserId  - revokeRefreshTokensByApplicationId  - revokeRefreshTokensByUserIdForApplication
6336pub async fn delete_jwt_refresh(configuration: &configuration::Configuration, user_id: Option<&str>, application_id: Option<&str>, token: Option<&str>, refresh_token_revoke_request: Option<models::RefreshTokenRevokeRequest>) -> Result<(), Error<DeleteJwtRefreshError>> {
6337    // add a prefix to parameters to efficiently prevent name collisions
6338    let p_user_id = user_id;
6339    let p_application_id = application_id;
6340    let p_token = token;
6341    let p_refresh_token_revoke_request = refresh_token_revoke_request;
6342
6343    let uri_str = format!("{}/api/jwt/refresh", configuration.base_path);
6344    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
6345
6346    if let Some(ref param_value) = p_user_id {
6347        req_builder = req_builder.query(&[("userId", &param_value.to_string())]);
6348    }
6349    if let Some(ref param_value) = p_application_id {
6350        req_builder = req_builder.query(&[("applicationId", &param_value.to_string())]);
6351    }
6352    if let Some(ref param_value) = p_token {
6353        req_builder = req_builder.query(&[("token", &param_value.to_string())]);
6354    }
6355    if let Some(ref user_agent) = configuration.user_agent {
6356        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6357    }
6358    if let Some(ref apikey) = configuration.api_key {
6359        let key = apikey.key.clone();
6360        let value = match apikey.prefix {
6361            Some(ref prefix) => format!("{} {}", prefix, key),
6362            None => key,
6363        };
6364        req_builder = req_builder.header("Authorization", value);
6365    };
6366    req_builder = req_builder.json(&p_refresh_token_revoke_request);
6367
6368    let req = req_builder.build()?;
6369    let resp = configuration.client.execute(req).await?;
6370
6371    let status = resp.status();
6372
6373    if !status.is_client_error() && !status.is_server_error() {
6374        Ok(())
6375    } else {
6376        let content = resp.text().await?;
6377        let entity: Option<DeleteJwtRefreshError> = serde_json::from_str(&content).ok();
6378        Err(Error::ResponseError(ResponseContent { status, content, entity }))
6379    }
6380}
6381
6382/// Deletes the key for the given Id.
6383pub async fn delete_key_with_id(configuration: &configuration::Configuration, key_id: &str) -> Result<(), Error<DeleteKeyWithIdError>> {
6384    // add a prefix to parameters to efficiently prevent name collisions
6385    let p_key_id = key_id;
6386
6387    let uri_str = format!("{}/api/key/{keyId}", configuration.base_path, keyId=crate::apis::urlencode(p_key_id));
6388    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
6389
6390    if let Some(ref user_agent) = configuration.user_agent {
6391        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6392    }
6393    if let Some(ref apikey) = configuration.api_key {
6394        let key = apikey.key.clone();
6395        let value = match apikey.prefix {
6396            Some(ref prefix) => format!("{} {}", prefix, key),
6397            None => key,
6398        };
6399        req_builder = req_builder.header("Authorization", value);
6400    };
6401
6402    let req = req_builder.build()?;
6403    let resp = configuration.client.execute(req).await?;
6404
6405    let status = resp.status();
6406
6407    if !status.is_client_error() && !status.is_server_error() {
6408        Ok(())
6409    } else {
6410        let content = resp.text().await?;
6411        let entity: Option<DeleteKeyWithIdError> = serde_json::from_str(&content).ok();
6412        Err(Error::ResponseError(ResponseContent { status, content, entity }))
6413    }
6414}
6415
6416/// Deletes the lambda for the given Id.
6417pub async fn delete_lambda_with_id(configuration: &configuration::Configuration, lambda_id: &str) -> Result<(), Error<DeleteLambdaWithIdError>> {
6418    // add a prefix to parameters to efficiently prevent name collisions
6419    let p_lambda_id = lambda_id;
6420
6421    let uri_str = format!("{}/api/lambda/{lambdaId}", configuration.base_path, lambdaId=crate::apis::urlencode(p_lambda_id));
6422    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
6423
6424    if let Some(ref user_agent) = configuration.user_agent {
6425        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6426    }
6427    if let Some(ref apikey) = configuration.api_key {
6428        let key = apikey.key.clone();
6429        let value = match apikey.prefix {
6430            Some(ref prefix) => format!("{} {}", prefix, key),
6431            None => key,
6432        };
6433        req_builder = req_builder.header("Authorization", value);
6434    };
6435
6436    let req = req_builder.build()?;
6437    let resp = configuration.client.execute(req).await?;
6438
6439    let status = resp.status();
6440
6441    if !status.is_client_error() && !status.is_server_error() {
6442        Ok(())
6443    } else {
6444        let content = resp.text().await?;
6445        let entity: Option<DeleteLambdaWithIdError> = serde_json::from_str(&content).ok();
6446        Err(Error::ResponseError(ResponseContent { status, content, entity }))
6447    }
6448}
6449
6450/// Deletes the message template for the given Id.
6451pub async fn delete_message_template_with_id(configuration: &configuration::Configuration, message_template_id: &str) -> Result<(), Error<DeleteMessageTemplateWithIdError>> {
6452    // add a prefix to parameters to efficiently prevent name collisions
6453    let p_message_template_id = message_template_id;
6454
6455    let uri_str = format!("{}/api/message/template/{messageTemplateId}", configuration.base_path, messageTemplateId=crate::apis::urlencode(p_message_template_id));
6456    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
6457
6458    if let Some(ref user_agent) = configuration.user_agent {
6459        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6460    }
6461    if let Some(ref apikey) = configuration.api_key {
6462        let key = apikey.key.clone();
6463        let value = match apikey.prefix {
6464            Some(ref prefix) => format!("{} {}", prefix, key),
6465            None => key,
6466        };
6467        req_builder = req_builder.header("Authorization", value);
6468    };
6469
6470    let req = req_builder.build()?;
6471    let resp = configuration.client.execute(req).await?;
6472
6473    let status = resp.status();
6474
6475    if !status.is_client_error() && !status.is_server_error() {
6476        Ok(())
6477    } else {
6478        let content = resp.text().await?;
6479        let entity: Option<DeleteMessageTemplateWithIdError> = serde_json::from_str(&content).ok();
6480        Err(Error::ResponseError(ResponseContent { status, content, entity }))
6481    }
6482}
6483
6484/// Deletes the messenger for the given Id.
6485pub async fn delete_messenger_with_id(configuration: &configuration::Configuration, messenger_id: &str) -> Result<(), Error<DeleteMessengerWithIdError>> {
6486    // add a prefix to parameters to efficiently prevent name collisions
6487    let p_messenger_id = messenger_id;
6488
6489    let uri_str = format!("{}/api/messenger/{messengerId}", configuration.base_path, messengerId=crate::apis::urlencode(p_messenger_id));
6490    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
6491
6492    if let Some(ref user_agent) = configuration.user_agent {
6493        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6494    }
6495    if let Some(ref apikey) = configuration.api_key {
6496        let key = apikey.key.clone();
6497        let value = match apikey.prefix {
6498            Some(ref prefix) => format!("{} {}", prefix, key),
6499            None => key,
6500        };
6501        req_builder = req_builder.header("Authorization", value);
6502    };
6503
6504    let req = req_builder.build()?;
6505    let resp = configuration.client.execute(req).await?;
6506
6507    let status = resp.status();
6508
6509    if !status.is_client_error() && !status.is_server_error() {
6510        Ok(())
6511    } else {
6512        let content = resp.text().await?;
6513        let entity: Option<DeleteMessengerWithIdError> = serde_json::from_str(&content).ok();
6514        Err(Error::ResponseError(ResponseContent { status, content, entity }))
6515    }
6516}
6517
6518/// Hard deletes a custom OAuth scope. OAuth workflows that are still requesting the deleted OAuth scope may fail depending on the application's unknown scope policy.
6519pub async fn delete_o_auth_scope_with_id(configuration: &configuration::Configuration, application_id: &str, scope_id: &str, x_fusion_auth_tenant_id: Option<&str>) -> Result<(), Error<DeleteOAuthScopeWithIdError>> {
6520    // add a prefix to parameters to efficiently prevent name collisions
6521    let p_application_id = application_id;
6522    let p_scope_id = scope_id;
6523    let p_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
6524
6525    let uri_str = format!("{}/api/application/{applicationId}/scope/{scopeId}", configuration.base_path, applicationId=crate::apis::urlencode(p_application_id), scopeId=crate::apis::urlencode(p_scope_id));
6526    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
6527
6528    if let Some(ref user_agent) = configuration.user_agent {
6529        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6530    }
6531    if let Some(param_value) = p_x_fusion_auth_tenant_id {
6532        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
6533    }
6534    if let Some(ref apikey) = configuration.api_key {
6535        let key = apikey.key.clone();
6536        let value = match apikey.prefix {
6537            Some(ref prefix) => format!("{} {}", prefix, key),
6538            None => key,
6539        };
6540        req_builder = req_builder.header("Authorization", value);
6541    };
6542
6543    let req = req_builder.build()?;
6544    let resp = configuration.client.execute(req).await?;
6545
6546    let status = resp.status();
6547
6548    if !status.is_client_error() && !status.is_server_error() {
6549        Ok(())
6550    } else {
6551        let content = resp.text().await?;
6552        let entity: Option<DeleteOAuthScopeWithIdError> = serde_json::from_str(&content).ok();
6553        Err(Error::ResponseError(ResponseContent { status, content, entity }))
6554    }
6555}
6556
6557/// Deletes the tenant based on the given Id on the URL. This permanently deletes all information, metrics, reports and data associated with the tenant and everything under the tenant (applications, users, etc). OR Deletes the tenant for the given Id asynchronously. This method is helpful if you do not want to wait for the delete operation to complete. OR Deletes the tenant based on the given request (sent to the API as JSON). This permanently deletes all information, metrics, reports and data associated with the tenant and everything under the tenant (applications, users, etc).
6558pub async fn delete_tenant_with_id(configuration: &configuration::Configuration, tenant_id: &str, x_fusion_auth_tenant_id: Option<&str>, r#async: Option<&str>, tenant_delete_request: Option<models::TenantDeleteRequest>) -> Result<(), Error<DeleteTenantWithIdError>> {
6559    // add a prefix to parameters to efficiently prevent name collisions
6560    let p_tenant_id = tenant_id;
6561    let p_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
6562    let p_async = r#async;
6563    let p_tenant_delete_request = tenant_delete_request;
6564
6565    let uri_str = format!("{}/api/tenant/{tenantId}", configuration.base_path, tenantId=crate::apis::urlencode(p_tenant_id));
6566    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
6567
6568    if let Some(ref param_value) = p_async {
6569        req_builder = req_builder.query(&[("async", &param_value.to_string())]);
6570    }
6571    if let Some(ref user_agent) = configuration.user_agent {
6572        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6573    }
6574    if let Some(param_value) = p_x_fusion_auth_tenant_id {
6575        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
6576    }
6577    if let Some(ref apikey) = configuration.api_key {
6578        let key = apikey.key.clone();
6579        let value = match apikey.prefix {
6580            Some(ref prefix) => format!("{} {}", prefix, key),
6581            None => key,
6582        };
6583        req_builder = req_builder.header("Authorization", value);
6584    };
6585    req_builder = req_builder.json(&p_tenant_delete_request);
6586
6587    let req = req_builder.build()?;
6588    let resp = configuration.client.execute(req).await?;
6589
6590    let status = resp.status();
6591
6592    if !status.is_client_error() && !status.is_server_error() {
6593        Ok(())
6594    } else {
6595        let content = resp.text().await?;
6596        let entity: Option<DeleteTenantWithIdError> = serde_json::from_str(&content).ok();
6597        Err(Error::ResponseError(ResponseContent { status, content, entity }))
6598    }
6599}
6600
6601/// Deletes the theme for the given Id.
6602pub async fn delete_theme_with_id(configuration: &configuration::Configuration, theme_id: &str) -> Result<(), Error<DeleteThemeWithIdError>> {
6603    // add a prefix to parameters to efficiently prevent name collisions
6604    let p_theme_id = theme_id;
6605
6606    let uri_str = format!("{}/api/theme/{themeId}", configuration.base_path, themeId=crate::apis::urlencode(p_theme_id));
6607    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
6608
6609    if let Some(ref user_agent) = configuration.user_agent {
6610        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6611    }
6612    if let Some(ref apikey) = configuration.api_key {
6613        let key = apikey.key.clone();
6614        let value = match apikey.prefix {
6615            Some(ref prefix) => format!("{} {}", prefix, key),
6616            None => key,
6617        };
6618        req_builder = req_builder.header("Authorization", value);
6619    };
6620
6621    let req = req_builder.build()?;
6622    let resp = configuration.client.execute(req).await?;
6623
6624    let status = resp.status();
6625
6626    if !status.is_client_error() && !status.is_server_error() {
6627        Ok(())
6628    } else {
6629        let content = resp.text().await?;
6630        let entity: Option<DeleteThemeWithIdError> = serde_json::from_str(&content).ok();
6631        Err(Error::ResponseError(ResponseContent { status, content, entity }))
6632    }
6633}
6634
6635/// Deletes the user action reason for the given Id.
6636pub async fn delete_user_action_reason_with_id(configuration: &configuration::Configuration, user_action_reason_id: &str) -> Result<(), Error<DeleteUserActionReasonWithIdError>> {
6637    // add a prefix to parameters to efficiently prevent name collisions
6638    let p_user_action_reason_id = user_action_reason_id;
6639
6640    let uri_str = format!("{}/api/user-action-reason/{userActionReasonId}", configuration.base_path, userActionReasonId=crate::apis::urlencode(p_user_action_reason_id));
6641    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
6642
6643    if let Some(ref user_agent) = configuration.user_agent {
6644        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6645    }
6646    if let Some(ref apikey) = configuration.api_key {
6647        let key = apikey.key.clone();
6648        let value = match apikey.prefix {
6649            Some(ref prefix) => format!("{} {}", prefix, key),
6650            None => key,
6651        };
6652        req_builder = req_builder.header("Authorization", value);
6653    };
6654
6655    let req = req_builder.build()?;
6656    let resp = configuration.client.execute(req).await?;
6657
6658    let status = resp.status();
6659
6660    if !status.is_client_error() && !status.is_server_error() {
6661        Ok(())
6662    } else {
6663        let content = resp.text().await?;
6664        let entity: Option<DeleteUserActionReasonWithIdError> = serde_json::from_str(&content).ok();
6665        Err(Error::ResponseError(ResponseContent { status, content, entity }))
6666    }
6667}
6668
6669/// Deactivates the user action with the given Id. OR Deletes the user action for the given Id. This permanently deletes the user action and also any history and logs of the action being applied to any users.
6670pub async fn delete_user_action_with_id(configuration: &configuration::Configuration, user_action_id: &str, x_fusion_auth_tenant_id: Option<&str>, hard_delete: Option<&str>) -> Result<(), Error<DeleteUserActionWithIdError>> {
6671    // add a prefix to parameters to efficiently prevent name collisions
6672    let p_user_action_id = user_action_id;
6673    let p_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
6674    let p_hard_delete = hard_delete;
6675
6676    let uri_str = format!("{}/api/user-action/{userActionId}", configuration.base_path, userActionId=crate::apis::urlencode(p_user_action_id));
6677    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
6678
6679    if let Some(ref param_value) = p_hard_delete {
6680        req_builder = req_builder.query(&[("hardDelete", &param_value.to_string())]);
6681    }
6682    if let Some(ref user_agent) = configuration.user_agent {
6683        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6684    }
6685    if let Some(param_value) = p_x_fusion_auth_tenant_id {
6686        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
6687    }
6688    if let Some(ref apikey) = configuration.api_key {
6689        let key = apikey.key.clone();
6690        let value = match apikey.prefix {
6691            Some(ref prefix) => format!("{} {}", prefix, key),
6692            None => key,
6693        };
6694        req_builder = req_builder.header("Authorization", value);
6695    };
6696
6697    let req = req_builder.build()?;
6698    let resp = configuration.client.execute(req).await?;
6699
6700    let status = resp.status();
6701
6702    if !status.is_client_error() && !status.is_server_error() {
6703        Ok(())
6704    } else {
6705        let content = resp.text().await?;
6706        let entity: Option<DeleteUserActionWithIdError> = serde_json::from_str(&content).ok();
6707        Err(Error::ResponseError(ResponseContent { status, content, entity }))
6708    }
6709}
6710
6711/// Deactivates the users with the given ids. OR Deletes the users with the given ids, or users matching the provided JSON query or queryString. The order of preference is ids, query and then queryString, it is recommended to only provide one of the three for the request.  This method can be used to deactivate or permanently delete (hard-delete) users based upon the hardDelete boolean in the request body. Using the dryRun parameter you may also request the result of the action without actually deleting or deactivating any users.
6712pub async fn delete_user_bulk(configuration: &configuration::Configuration, user_ids: Option<&str>, dry_run: Option<&str>, hard_delete: Option<&str>, user_delete_request: Option<models::UserDeleteRequest>) -> Result<models::UserDeleteResponse, Error<DeleteUserBulkError>> {
6713    // add a prefix to parameters to efficiently prevent name collisions
6714    let p_user_ids = user_ids;
6715    let p_dry_run = dry_run;
6716    let p_hard_delete = hard_delete;
6717    let p_user_delete_request = user_delete_request;
6718
6719    let uri_str = format!("{}/api/user/bulk", configuration.base_path);
6720    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
6721
6722    if let Some(ref param_value) = p_user_ids {
6723        req_builder = req_builder.query(&[("userIds", &param_value.to_string())]);
6724    }
6725    if let Some(ref param_value) = p_dry_run {
6726        req_builder = req_builder.query(&[("dryRun", &param_value.to_string())]);
6727    }
6728    if let Some(ref param_value) = p_hard_delete {
6729        req_builder = req_builder.query(&[("hardDelete", &param_value.to_string())]);
6730    }
6731    if let Some(ref user_agent) = configuration.user_agent {
6732        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6733    }
6734    if let Some(ref apikey) = configuration.api_key {
6735        let key = apikey.key.clone();
6736        let value = match apikey.prefix {
6737            Some(ref prefix) => format!("{} {}", prefix, key),
6738            None => key,
6739        };
6740        req_builder = req_builder.header("Authorization", value);
6741    };
6742    req_builder = req_builder.json(&p_user_delete_request);
6743
6744    let req = req_builder.build()?;
6745    let resp = configuration.client.execute(req).await?;
6746
6747    let status = resp.status();
6748    let content_type = resp
6749        .headers()
6750        .get("content-type")
6751        .and_then(|v| v.to_str().ok())
6752        .unwrap_or("application/octet-stream");
6753    let content_type = super::ContentType::from(content_type);
6754
6755    if !status.is_client_error() && !status.is_server_error() {
6756        let content = resp.text().await?;
6757        match content_type {
6758            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
6759            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::UserDeleteResponse`"))),
6760            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::UserDeleteResponse`")))),
6761        }
6762    } else {
6763        let content = resp.text().await?;
6764        let entity: Option<DeleteUserBulkError> = serde_json::from_str(&content).ok();
6765        Err(Error::ResponseError(ResponseContent { status, content, entity }))
6766    }
6767}
6768
6769/// Remove an existing link that has been made from a 3rd party identity provider to a FusionAuth user.
6770pub async fn delete_user_link_with_id(configuration: &configuration::Configuration, identity_provider_id: Option<&str>, identity_provider_user_id: Option<&str>, user_id: Option<&str>) -> Result<models::IdentityProviderLinkResponse, Error<DeleteUserLinkWithIdError>> {
6771    // add a prefix to parameters to efficiently prevent name collisions
6772    let p_identity_provider_id = identity_provider_id;
6773    let p_identity_provider_user_id = identity_provider_user_id;
6774    let p_user_id = user_id;
6775
6776    let uri_str = format!("{}/api/identity-provider/link", configuration.base_path);
6777    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
6778
6779    if let Some(ref param_value) = p_identity_provider_id {
6780        req_builder = req_builder.query(&[("identityProviderId", &param_value.to_string())]);
6781    }
6782    if let Some(ref param_value) = p_identity_provider_user_id {
6783        req_builder = req_builder.query(&[("identityProviderUserId", &param_value.to_string())]);
6784    }
6785    if let Some(ref param_value) = p_user_id {
6786        req_builder = req_builder.query(&[("userId", &param_value.to_string())]);
6787    }
6788    if let Some(ref user_agent) = configuration.user_agent {
6789        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6790    }
6791    if let Some(ref apikey) = configuration.api_key {
6792        let key = apikey.key.clone();
6793        let value = match apikey.prefix {
6794            Some(ref prefix) => format!("{} {}", prefix, key),
6795            None => key,
6796        };
6797        req_builder = req_builder.header("Authorization", value);
6798    };
6799
6800    let req = req_builder.build()?;
6801    let resp = configuration.client.execute(req).await?;
6802
6803    let status = resp.status();
6804    let content_type = resp
6805        .headers()
6806        .get("content-type")
6807        .and_then(|v| v.to_str().ok())
6808        .unwrap_or("application/octet-stream");
6809    let content_type = super::ContentType::from(content_type);
6810
6811    if !status.is_client_error() && !status.is_server_error() {
6812        let content = resp.text().await?;
6813        match content_type {
6814            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
6815            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IdentityProviderLinkResponse`"))),
6816            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IdentityProviderLinkResponse`")))),
6817        }
6818    } else {
6819        let content = resp.text().await?;
6820        let entity: Option<DeleteUserLinkWithIdError> = serde_json::from_str(&content).ok();
6821        Err(Error::ResponseError(ResponseContent { status, content, entity }))
6822    }
6823}
6824
6825/// Deletes the user registration for the given user and application. OR Deletes the user registration for the given user and application along with the given JSON body that contains the event information.
6826pub async fn delete_user_registration_with_id(configuration: &configuration::Configuration, user_id: &str, application_id: &str, x_fusion_auth_tenant_id: Option<&str>, registration_delete_request: Option<models::RegistrationDeleteRequest>) -> Result<(), Error<DeleteUserRegistrationWithIdError>> {
6827    // add a prefix to parameters to efficiently prevent name collisions
6828    let p_user_id = user_id;
6829    let p_application_id = application_id;
6830    let p_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
6831    let p_registration_delete_request = registration_delete_request;
6832
6833    let uri_str = format!("{}/api/user/registration/{userId}/{applicationId}", configuration.base_path, userId=crate::apis::urlencode(p_user_id), applicationId=crate::apis::urlencode(p_application_id));
6834    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
6835
6836    if let Some(ref user_agent) = configuration.user_agent {
6837        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6838    }
6839    if let Some(param_value) = p_x_fusion_auth_tenant_id {
6840        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
6841    }
6842    if let Some(ref apikey) = configuration.api_key {
6843        let key = apikey.key.clone();
6844        let value = match apikey.prefix {
6845            Some(ref prefix) => format!("{} {}", prefix, key),
6846            None => key,
6847        };
6848        req_builder = req_builder.header("Authorization", value);
6849    };
6850    req_builder = req_builder.json(&p_registration_delete_request);
6851
6852    let req = req_builder.build()?;
6853    let resp = configuration.client.execute(req).await?;
6854
6855    let status = resp.status();
6856
6857    if !status.is_client_error() && !status.is_server_error() {
6858        Ok(())
6859    } else {
6860        let content = resp.text().await?;
6861        let entity: Option<DeleteUserRegistrationWithIdError> = serde_json::from_str(&content).ok();
6862        Err(Error::ResponseError(ResponseContent { status, content, entity }))
6863    }
6864}
6865
6866/// Disable two-factor authentication for a user using a JSON body rather than URL parameters. OR Disable two-factor authentication for a user.
6867pub async fn delete_user_two_factor_with_id(configuration: &configuration::Configuration, user_id: &str, method_id: Option<&str>, code: Option<&str>, two_factor_disable_request: Option<models::TwoFactorDisableRequest>) -> Result<(), Error<DeleteUserTwoFactorWithIdError>> {
6868    // add a prefix to parameters to efficiently prevent name collisions
6869    let p_user_id = user_id;
6870    let p_method_id = method_id;
6871    let p_code = code;
6872    let p_two_factor_disable_request = two_factor_disable_request;
6873
6874    let uri_str = format!("{}/api/user/two-factor/{userId}", configuration.base_path, userId=crate::apis::urlencode(p_user_id));
6875    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
6876
6877    if let Some(ref param_value) = p_method_id {
6878        req_builder = req_builder.query(&[("methodId", &param_value.to_string())]);
6879    }
6880    if let Some(ref param_value) = p_code {
6881        req_builder = req_builder.query(&[("code", &param_value.to_string())]);
6882    }
6883    if let Some(ref user_agent) = configuration.user_agent {
6884        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6885    }
6886    if let Some(ref apikey) = configuration.api_key {
6887        let key = apikey.key.clone();
6888        let value = match apikey.prefix {
6889            Some(ref prefix) => format!("{} {}", prefix, key),
6890            None => key,
6891        };
6892        req_builder = req_builder.header("Authorization", value);
6893    };
6894    req_builder = req_builder.json(&p_two_factor_disable_request);
6895
6896    let req = req_builder.build()?;
6897    let resp = configuration.client.execute(req).await?;
6898
6899    let status = resp.status();
6900
6901    if !status.is_client_error() && !status.is_server_error() {
6902        Ok(())
6903    } else {
6904        let content = resp.text().await?;
6905        let entity: Option<DeleteUserTwoFactorWithIdError> = serde_json::from_str(&content).ok();
6906        Err(Error::ResponseError(ResponseContent { status, content, entity }))
6907    }
6908}
6909
6910/// Deletes the user based on the given request (sent to the API as JSON). This permanently deletes all information, metrics, reports and data associated with the user. OR Deletes the user for the given Id. This permanently deletes all information, metrics, reports and data associated with the user. OR Deactivates the user with the given Id.
6911pub async fn delete_user_with_id(configuration: &configuration::Configuration, user_id: &str, x_fusion_auth_tenant_id: Option<&str>, hard_delete: Option<&str>, user_delete_single_request: Option<models::UserDeleteSingleRequest>) -> Result<(), Error<DeleteUserWithIdError>> {
6912    // add a prefix to parameters to efficiently prevent name collisions
6913    let p_user_id = user_id;
6914    let p_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
6915    let p_hard_delete = hard_delete;
6916    let p_user_delete_single_request = user_delete_single_request;
6917
6918    let uri_str = format!("{}/api/user/{userId}", configuration.base_path, userId=crate::apis::urlencode(p_user_id));
6919    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
6920
6921    if let Some(ref param_value) = p_hard_delete {
6922        req_builder = req_builder.query(&[("hardDelete", &param_value.to_string())]);
6923    }
6924    if let Some(ref user_agent) = configuration.user_agent {
6925        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6926    }
6927    if let Some(param_value) = p_x_fusion_auth_tenant_id {
6928        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
6929    }
6930    if let Some(ref apikey) = configuration.api_key {
6931        let key = apikey.key.clone();
6932        let value = match apikey.prefix {
6933            Some(ref prefix) => format!("{} {}", prefix, key),
6934            None => key,
6935        };
6936        req_builder = req_builder.header("Authorization", value);
6937    };
6938    req_builder = req_builder.json(&p_user_delete_single_request);
6939
6940    let req = req_builder.build()?;
6941    let resp = configuration.client.execute(req).await?;
6942
6943    let status = resp.status();
6944
6945    if !status.is_client_error() && !status.is_server_error() {
6946        Ok(())
6947    } else {
6948        let content = resp.text().await?;
6949        let entity: Option<DeleteUserWithIdError> = serde_json::from_str(&content).ok();
6950        Err(Error::ResponseError(ResponseContent { status, content, entity }))
6951    }
6952}
6953
6954/// Deletes the WebAuthn credential for the given Id.
6955pub async fn delete_web_authn_credential_with_id(configuration: &configuration::Configuration, id: &str) -> Result<(), Error<DeleteWebAuthnCredentialWithIdError>> {
6956    // add a prefix to parameters to efficiently prevent name collisions
6957    let p_id = id;
6958
6959    let uri_str = format!("{}/api/webauthn/{id}", configuration.base_path, id=crate::apis::urlencode(p_id));
6960    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
6961
6962    if let Some(ref user_agent) = configuration.user_agent {
6963        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6964    }
6965    if let Some(ref apikey) = configuration.api_key {
6966        let key = apikey.key.clone();
6967        let value = match apikey.prefix {
6968            Some(ref prefix) => format!("{} {}", prefix, key),
6969            None => key,
6970        };
6971        req_builder = req_builder.header("Authorization", value);
6972    };
6973
6974    let req = req_builder.build()?;
6975    let resp = configuration.client.execute(req).await?;
6976
6977    let status = resp.status();
6978
6979    if !status.is_client_error() && !status.is_server_error() {
6980        Ok(())
6981    } else {
6982        let content = resp.text().await?;
6983        let entity: Option<DeleteWebAuthnCredentialWithIdError> = serde_json::from_str(&content).ok();
6984        Err(Error::ResponseError(ResponseContent { status, content, entity }))
6985    }
6986}
6987
6988/// Deletes the webhook for the given Id.
6989pub async fn delete_webhook_with_id(configuration: &configuration::Configuration, webhook_id: &str) -> Result<(), Error<DeleteWebhookWithIdError>> {
6990    // add a prefix to parameters to efficiently prevent name collisions
6991    let p_webhook_id = webhook_id;
6992
6993    let uri_str = format!("{}/api/webhook/{webhookId}", configuration.base_path, webhookId=crate::apis::urlencode(p_webhook_id));
6994    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
6995
6996    if let Some(ref user_agent) = configuration.user_agent {
6997        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6998    }
6999    if let Some(ref apikey) = configuration.api_key {
7000        let key = apikey.key.clone();
7001        let value = match apikey.prefix {
7002            Some(ref prefix) => format!("{} {}", prefix, key),
7003            None => key,
7004        };
7005        req_builder = req_builder.header("Authorization", value);
7006    };
7007
7008    let req = req_builder.build()?;
7009    let resp = configuration.client.execute(req).await?;
7010
7011    let status = resp.status();
7012
7013    if !status.is_client_error() && !status.is_server_error() {
7014        Ok(())
7015    } else {
7016        let content = resp.text().await?;
7017        let entity: Option<DeleteWebhookWithIdError> = serde_json::from_str(&content).ok();
7018        Err(Error::ResponseError(ResponseContent { status, content, entity }))
7019    }
7020}
7021
7022/// Enable two-factor authentication for a user.
7023pub async fn enable_two_factor_with_id(configuration: &configuration::Configuration, user_id: &str, two_factor_request: Option<models::TwoFactorRequest>) -> Result<models::TwoFactorResponse, Error<EnableTwoFactorWithIdError>> {
7024    // add a prefix to parameters to efficiently prevent name collisions
7025    let p_user_id = user_id;
7026    let p_two_factor_request = two_factor_request;
7027
7028    let uri_str = format!("{}/api/user/two-factor/{userId}", configuration.base_path, userId=crate::apis::urlencode(p_user_id));
7029    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
7030
7031    if let Some(ref user_agent) = configuration.user_agent {
7032        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
7033    }
7034    if let Some(ref apikey) = configuration.api_key {
7035        let key = apikey.key.clone();
7036        let value = match apikey.prefix {
7037            Some(ref prefix) => format!("{} {}", prefix, key),
7038            None => key,
7039        };
7040        req_builder = req_builder.header("Authorization", value);
7041    };
7042    req_builder = req_builder.json(&p_two_factor_request);
7043
7044    let req = req_builder.build()?;
7045    let resp = configuration.client.execute(req).await?;
7046
7047    let status = resp.status();
7048    let content_type = resp
7049        .headers()
7050        .get("content-type")
7051        .and_then(|v| v.to_str().ok())
7052        .unwrap_or("application/octet-stream");
7053    let content_type = super::ContentType::from(content_type);
7054
7055    if !status.is_client_error() && !status.is_server_error() {
7056        let content = resp.text().await?;
7057        match content_type {
7058            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
7059            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::TwoFactorResponse`"))),
7060            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::TwoFactorResponse`")))),
7061        }
7062    } else {
7063        let content = resp.text().await?;
7064        let entity: Option<EnableTwoFactorWithIdError> = serde_json::from_str(&content).ok();
7065        Err(Error::ResponseError(ResponseContent { status, content, entity }))
7066    }
7067}
7068
7069/// Exchange a refresh token for a new JWT.
7070pub async fn exchange_refresh_token_for_jwt_with_id(configuration: &configuration::Configuration, refresh_request: Option<models::RefreshRequest>) -> Result<models::JwtRefreshResponse, Error<ExchangeRefreshTokenForJwtWithIdError>> {
7071    // add a prefix to parameters to efficiently prevent name collisions
7072    let p_refresh_request = refresh_request;
7073
7074    let uri_str = format!("{}/api/jwt/refresh", configuration.base_path);
7075    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
7076
7077    if let Some(ref user_agent) = configuration.user_agent {
7078        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
7079    }
7080    if let Some(ref apikey) = configuration.api_key {
7081        let key = apikey.key.clone();
7082        let value = match apikey.prefix {
7083            Some(ref prefix) => format!("{} {}", prefix, key),
7084            None => key,
7085        };
7086        req_builder = req_builder.header("Authorization", value);
7087    };
7088    req_builder = req_builder.json(&p_refresh_request);
7089
7090    let req = req_builder.build()?;
7091    let resp = configuration.client.execute(req).await?;
7092
7093    let status = resp.status();
7094    let content_type = resp
7095        .headers()
7096        .get("content-type")
7097        .and_then(|v| v.to_str().ok())
7098        .unwrap_or("application/octet-stream");
7099    let content_type = super::ContentType::from(content_type);
7100
7101    if !status.is_client_error() && !status.is_server_error() {
7102        let content = resp.text().await?;
7103        match content_type {
7104            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
7105            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::JwtRefreshResponse`"))),
7106            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::JwtRefreshResponse`")))),
7107        }
7108    } else {
7109        let content = resp.text().await?;
7110        let entity: Option<ExchangeRefreshTokenForJwtWithIdError> = serde_json::from_str(&content).ok();
7111        Err(Error::ResponseError(ResponseContent { status, content, entity }))
7112    }
7113}
7114
7115/// Begins the forgot password sequence, which kicks off an email to the user so that they can reset their password.
7116pub async fn forgot_password_with_id(configuration: &configuration::Configuration, forgot_password_request: Option<models::ForgotPasswordRequest>) -> Result<models::ForgotPasswordResponse, Error<ForgotPasswordWithIdError>> {
7117    // add a prefix to parameters to efficiently prevent name collisions
7118    let p_forgot_password_request = forgot_password_request;
7119
7120    let uri_str = format!("{}/api/user/forgot-password", configuration.base_path);
7121    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
7122
7123    if let Some(ref user_agent) = configuration.user_agent {
7124        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
7125    }
7126    if let Some(ref apikey) = configuration.api_key {
7127        let key = apikey.key.clone();
7128        let value = match apikey.prefix {
7129            Some(ref prefix) => format!("{} {}", prefix, key),
7130            None => key,
7131        };
7132        req_builder = req_builder.header("Authorization", value);
7133    };
7134    req_builder = req_builder.json(&p_forgot_password_request);
7135
7136    let req = req_builder.build()?;
7137    let resp = configuration.client.execute(req).await?;
7138
7139    let status = resp.status();
7140    let content_type = resp
7141        .headers()
7142        .get("content-type")
7143        .and_then(|v| v.to_str().ok())
7144        .unwrap_or("application/octet-stream");
7145    let content_type = super::ContentType::from(content_type);
7146
7147    if !status.is_client_error() && !status.is_server_error() {
7148        let content = resp.text().await?;
7149        match content_type {
7150            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
7151            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ForgotPasswordResponse`"))),
7152            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ForgotPasswordResponse`")))),
7153        }
7154    } else {
7155        let content = resp.text().await?;
7156        let entity: Option<ForgotPasswordWithIdError> = serde_json::from_str(&content).ok();
7157        Err(Error::ResponseError(ResponseContent { status, content, entity }))
7158    }
7159}
7160
7161/// Generate a new RSA or EC key pair or an HMAC secret.
7162pub async fn generate_key(configuration: &configuration::Configuration, key_request: Option<models::KeyRequest>) -> Result<models::KeyResponse, Error<GenerateKeyError>> {
7163    // add a prefix to parameters to efficiently prevent name collisions
7164    let p_key_request = key_request;
7165
7166    let uri_str = format!("{}/api/key/generate", configuration.base_path);
7167    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
7168
7169    if let Some(ref user_agent) = configuration.user_agent {
7170        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
7171    }
7172    if let Some(ref apikey) = configuration.api_key {
7173        let key = apikey.key.clone();
7174        let value = match apikey.prefix {
7175            Some(ref prefix) => format!("{} {}", prefix, key),
7176            None => key,
7177        };
7178        req_builder = req_builder.header("Authorization", value);
7179    };
7180    req_builder = req_builder.json(&p_key_request);
7181
7182    let req = req_builder.build()?;
7183    let resp = configuration.client.execute(req).await?;
7184
7185    let status = resp.status();
7186    let content_type = resp
7187        .headers()
7188        .get("content-type")
7189        .and_then(|v| v.to_str().ok())
7190        .unwrap_or("application/octet-stream");
7191    let content_type = super::ContentType::from(content_type);
7192
7193    if !status.is_client_error() && !status.is_server_error() {
7194        let content = resp.text().await?;
7195        match content_type {
7196            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
7197            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::KeyResponse`"))),
7198            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::KeyResponse`")))),
7199        }
7200    } else {
7201        let content = resp.text().await?;
7202        let entity: Option<GenerateKeyError> = serde_json::from_str(&content).ok();
7203        Err(Error::ResponseError(ResponseContent { status, content, entity }))
7204    }
7205}
7206
7207/// Generate a new RSA or EC key pair or an HMAC secret.
7208pub async fn generate_key_with_id(configuration: &configuration::Configuration, key_id: &str, key_request: Option<models::KeyRequest>) -> Result<models::KeyResponse, Error<GenerateKeyWithIdError>> {
7209    // add a prefix to parameters to efficiently prevent name collisions
7210    let p_key_id = key_id;
7211    let p_key_request = key_request;
7212
7213    let uri_str = format!("{}/api/key/generate/{keyId}", configuration.base_path, keyId=crate::apis::urlencode(p_key_id));
7214    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
7215
7216    if let Some(ref user_agent) = configuration.user_agent {
7217        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
7218    }
7219    if let Some(ref apikey) = configuration.api_key {
7220        let key = apikey.key.clone();
7221        let value = match apikey.prefix {
7222            Some(ref prefix) => format!("{} {}", prefix, key),
7223            None => key,
7224        };
7225        req_builder = req_builder.header("Authorization", value);
7226    };
7227    req_builder = req_builder.json(&p_key_request);
7228
7229    let req = req_builder.build()?;
7230    let resp = configuration.client.execute(req).await?;
7231
7232    let status = resp.status();
7233    let content_type = resp
7234        .headers()
7235        .get("content-type")
7236        .and_then(|v| v.to_str().ok())
7237        .unwrap_or("application/octet-stream");
7238    let content_type = super::ContentType::from(content_type);
7239
7240    if !status.is_client_error() && !status.is_server_error() {
7241        let content = resp.text().await?;
7242        match content_type {
7243            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
7244            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::KeyResponse`"))),
7245            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::KeyResponse`")))),
7246        }
7247    } else {
7248        let content = resp.text().await?;
7249        let entity: Option<GenerateKeyWithIdError> = serde_json::from_str(&content).ok();
7250        Err(Error::ResponseError(ResponseContent { status, content, entity }))
7251    }
7252}
7253
7254/// Generate two-factor recovery codes for a user. Generating two-factor recovery codes will invalidate any existing recovery codes.
7255pub async fn generate_two_factor_recovery_codes_with_id(configuration: &configuration::Configuration, user_id: &str) -> Result<models::TwoFactorRecoveryCodeResponse, Error<GenerateTwoFactorRecoveryCodesWithIdError>> {
7256    // add a prefix to parameters to efficiently prevent name collisions
7257    let p_user_id = user_id;
7258
7259    let uri_str = format!("{}/api/user/two-factor/recovery-code/{userId}", configuration.base_path, userId=crate::apis::urlencode(p_user_id));
7260    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
7261
7262    if let Some(ref user_agent) = configuration.user_agent {
7263        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
7264    }
7265    if let Some(ref apikey) = configuration.api_key {
7266        let key = apikey.key.clone();
7267        let value = match apikey.prefix {
7268            Some(ref prefix) => format!("{} {}", prefix, key),
7269            None => key,
7270        };
7271        req_builder = req_builder.header("Authorization", value);
7272    };
7273
7274    let req = req_builder.build()?;
7275    let resp = configuration.client.execute(req).await?;
7276
7277    let status = resp.status();
7278    let content_type = resp
7279        .headers()
7280        .get("content-type")
7281        .and_then(|v| v.to_str().ok())
7282        .unwrap_or("application/octet-stream");
7283    let content_type = super::ContentType::from(content_type);
7284
7285    if !status.is_client_error() && !status.is_server_error() {
7286        let content = resp.text().await?;
7287        match content_type {
7288            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
7289            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::TwoFactorRecoveryCodeResponse`"))),
7290            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::TwoFactorRecoveryCodeResponse`")))),
7291        }
7292    } else {
7293        let content = resp.text().await?;
7294        let entity: Option<GenerateTwoFactorRecoveryCodesWithIdError> = serde_json::from_str(&content).ok();
7295        Err(Error::ResponseError(ResponseContent { status, content, entity }))
7296    }
7297}
7298
7299/// Generate a Two Factor secret that can be used to enable Two Factor authentication for a User. The response will contain both the secret and a Base32 encoded form of the secret which can be shown to a User when using a 2 Step Authentication application such as Google Authenticator.
7300pub async fn generate_two_factor_secret_using_jwt_with_id(configuration: &configuration::Configuration, ) -> Result<models::SecretResponse, Error<GenerateTwoFactorSecretUsingJwtWithIdError>> {
7301
7302    let uri_str = format!("{}/api/two-factor/secret", configuration.base_path);
7303    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
7304
7305    if let Some(ref user_agent) = configuration.user_agent {
7306        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
7307    }
7308    if let Some(ref token) = configuration.bearer_access_token {
7309        req_builder = req_builder.bearer_auth(token.to_owned());
7310    };
7311
7312    let req = req_builder.build()?;
7313    let resp = configuration.client.execute(req).await?;
7314
7315    let status = resp.status();
7316    let content_type = resp
7317        .headers()
7318        .get("content-type")
7319        .and_then(|v| v.to_str().ok())
7320        .unwrap_or("application/octet-stream");
7321    let content_type = super::ContentType::from(content_type);
7322
7323    if !status.is_client_error() && !status.is_server_error() {
7324        let content = resp.text().await?;
7325        match content_type {
7326            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
7327            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::SecretResponse`"))),
7328            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::SecretResponse`")))),
7329        }
7330    } else {
7331        let content = resp.text().await?;
7332        let entity: Option<GenerateTwoFactorSecretUsingJwtWithIdError> = serde_json::from_str(&content).ok();
7333        Err(Error::ResponseError(ResponseContent { status, content, entity }))
7334    }
7335}
7336
7337/// Handles login via third-parties including Social login, external OAuth and OpenID Connect, and other login systems.
7338pub async fn identity_provider_login_with_id(configuration: &configuration::Configuration, x_fusion_auth_tenant_id: Option<&str>, identity_provider_login_request: Option<models::IdentityProviderLoginRequest>) -> Result<models::LoginResponse, Error<IdentityProviderLoginWithIdError>> {
7339    // add a prefix to parameters to efficiently prevent name collisions
7340    let p_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
7341    let p_identity_provider_login_request = identity_provider_login_request;
7342
7343    let uri_str = format!("{}/api/identity-provider/login", configuration.base_path);
7344    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
7345
7346    if let Some(ref user_agent) = configuration.user_agent {
7347        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
7348    }
7349    if let Some(param_value) = p_x_fusion_auth_tenant_id {
7350        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
7351    }
7352    if let Some(ref apikey) = configuration.api_key {
7353        let key = apikey.key.clone();
7354        let value = match apikey.prefix {
7355            Some(ref prefix) => format!("{} {}", prefix, key),
7356            None => key,
7357        };
7358        req_builder = req_builder.header("Authorization", value);
7359    };
7360    req_builder = req_builder.json(&p_identity_provider_login_request);
7361
7362    let req = req_builder.build()?;
7363    let resp = configuration.client.execute(req).await?;
7364
7365    let status = resp.status();
7366    let content_type = resp
7367        .headers()
7368        .get("content-type")
7369        .and_then(|v| v.to_str().ok())
7370        .unwrap_or("application/octet-stream");
7371    let content_type = super::ContentType::from(content_type);
7372
7373    if !status.is_client_error() && !status.is_server_error() {
7374        let content = resp.text().await?;
7375        match content_type {
7376            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
7377            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::LoginResponse`"))),
7378            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::LoginResponse`")))),
7379        }
7380    } else {
7381        let content = resp.text().await?;
7382        let entity: Option<IdentityProviderLoginWithIdError> = serde_json::from_str(&content).ok();
7383        Err(Error::ResponseError(ResponseContent { status, content, entity }))
7384    }
7385}
7386
7387/// Import an existing RSA or EC key pair or an HMAC secret.
7388pub async fn import_key(configuration: &configuration::Configuration, key_request: Option<models::KeyRequest>) -> Result<models::KeyResponse, Error<ImportKeyError>> {
7389    // add a prefix to parameters to efficiently prevent name collisions
7390    let p_key_request = key_request;
7391
7392    let uri_str = format!("{}/api/key/import", configuration.base_path);
7393    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
7394
7395    if let Some(ref user_agent) = configuration.user_agent {
7396        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
7397    }
7398    if let Some(ref apikey) = configuration.api_key {
7399        let key = apikey.key.clone();
7400        let value = match apikey.prefix {
7401            Some(ref prefix) => format!("{} {}", prefix, key),
7402            None => key,
7403        };
7404        req_builder = req_builder.header("Authorization", value);
7405    };
7406    req_builder = req_builder.json(&p_key_request);
7407
7408    let req = req_builder.build()?;
7409    let resp = configuration.client.execute(req).await?;
7410
7411    let status = resp.status();
7412    let content_type = resp
7413        .headers()
7414        .get("content-type")
7415        .and_then(|v| v.to_str().ok())
7416        .unwrap_or("application/octet-stream");
7417    let content_type = super::ContentType::from(content_type);
7418
7419    if !status.is_client_error() && !status.is_server_error() {
7420        let content = resp.text().await?;
7421        match content_type {
7422            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
7423            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::KeyResponse`"))),
7424            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::KeyResponse`")))),
7425        }
7426    } else {
7427        let content = resp.text().await?;
7428        let entity: Option<ImportKeyError> = serde_json::from_str(&content).ok();
7429        Err(Error::ResponseError(ResponseContent { status, content, entity }))
7430    }
7431}
7432
7433/// Import an existing RSA or EC key pair or an HMAC secret.
7434pub async fn import_key_with_id(configuration: &configuration::Configuration, key_id: &str, key_request: Option<models::KeyRequest>) -> Result<models::KeyResponse, Error<ImportKeyWithIdError>> {
7435    // add a prefix to parameters to efficiently prevent name collisions
7436    let p_key_id = key_id;
7437    let p_key_request = key_request;
7438
7439    let uri_str = format!("{}/api/key/import/{keyId}", configuration.base_path, keyId=crate::apis::urlencode(p_key_id));
7440    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
7441
7442    if let Some(ref user_agent) = configuration.user_agent {
7443        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
7444    }
7445    if let Some(ref apikey) = configuration.api_key {
7446        let key = apikey.key.clone();
7447        let value = match apikey.prefix {
7448            Some(ref prefix) => format!("{} {}", prefix, key),
7449            None => key,
7450        };
7451        req_builder = req_builder.header("Authorization", value);
7452    };
7453    req_builder = req_builder.json(&p_key_request);
7454
7455    let req = req_builder.build()?;
7456    let resp = configuration.client.execute(req).await?;
7457
7458    let status = resp.status();
7459    let content_type = resp
7460        .headers()
7461        .get("content-type")
7462        .and_then(|v| v.to_str().ok())
7463        .unwrap_or("application/octet-stream");
7464    let content_type = super::ContentType::from(content_type);
7465
7466    if !status.is_client_error() && !status.is_server_error() {
7467        let content = resp.text().await?;
7468        match content_type {
7469            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
7470            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::KeyResponse`"))),
7471            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::KeyResponse`")))),
7472        }
7473    } else {
7474        let content = resp.text().await?;
7475        let entity: Option<ImportKeyWithIdError> = serde_json::from_str(&content).ok();
7476        Err(Error::ResponseError(ResponseContent { status, content, entity }))
7477    }
7478}
7479
7480/// Bulk imports refresh tokens. This request performs minimal validation and runs batch inserts of refresh tokens with the expectation that each token represents a user that already exists and is registered for the corresponding FusionAuth Application. This is done to increases the insert performance.  Therefore, if you encounter an error due to a database key violation, the response will likely offer a generic explanation. If you encounter an error, you may optionally enable additional validation to receive a JSON response body with specific validation errors. This will slow the request down but will allow you to identify the cause of the failure. See the validateDbConstraints request parameter.
7481pub async fn import_refresh_tokens_with_id(configuration: &configuration::Configuration, refresh_token_import_request: Option<models::RefreshTokenImportRequest>) -> Result<(), Error<ImportRefreshTokensWithIdError>> {
7482    // add a prefix to parameters to efficiently prevent name collisions
7483    let p_refresh_token_import_request = refresh_token_import_request;
7484
7485    let uri_str = format!("{}/api/user/refresh-token/import", configuration.base_path);
7486    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
7487
7488    if let Some(ref user_agent) = configuration.user_agent {
7489        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
7490    }
7491    if let Some(ref apikey) = configuration.api_key {
7492        let key = apikey.key.clone();
7493        let value = match apikey.prefix {
7494            Some(ref prefix) => format!("{} {}", prefix, key),
7495            None => key,
7496        };
7497        req_builder = req_builder.header("Authorization", value);
7498    };
7499    req_builder = req_builder.json(&p_refresh_token_import_request);
7500
7501    let req = req_builder.build()?;
7502    let resp = configuration.client.execute(req).await?;
7503
7504    let status = resp.status();
7505
7506    if !status.is_client_error() && !status.is_server_error() {
7507        Ok(())
7508    } else {
7509        let content = resp.text().await?;
7510        let entity: Option<ImportRefreshTokensWithIdError> = serde_json::from_str(&content).ok();
7511        Err(Error::ResponseError(ResponseContent { status, content, entity }))
7512    }
7513}
7514
7515/// Bulk imports users. This request performs minimal validation and runs batch inserts of users with the expectation that each user does not yet exist and each registration corresponds to an existing FusionAuth Application. This is done to increases the insert performance.  Therefore, if you encounter an error due to a database key violation, the response will likely offer a generic explanation. If you encounter an error, you may optionally enable additional validation to receive a JSON response body with specific validation errors. This will slow the request down but will allow you to identify the cause of the failure. See the validateDbConstraints request parameter.
7516pub async fn import_users_with_id(configuration: &configuration::Configuration, import_request: Option<models::ImportRequest>) -> Result<(), Error<ImportUsersWithIdError>> {
7517    // add a prefix to parameters to efficiently prevent name collisions
7518    let p_import_request = import_request;
7519
7520    let uri_str = format!("{}/api/user/import", configuration.base_path);
7521    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
7522
7523    if let Some(ref user_agent) = configuration.user_agent {
7524        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
7525    }
7526    if let Some(ref apikey) = configuration.api_key {
7527        let key = apikey.key.clone();
7528        let value = match apikey.prefix {
7529            Some(ref prefix) => format!("{} {}", prefix, key),
7530            None => key,
7531        };
7532        req_builder = req_builder.header("Authorization", value);
7533    };
7534    req_builder = req_builder.json(&p_import_request);
7535
7536    let req = req_builder.build()?;
7537    let resp = configuration.client.execute(req).await?;
7538
7539    let status = resp.status();
7540
7541    if !status.is_client_error() && !status.is_server_error() {
7542        Ok(())
7543    } else {
7544        let content = resp.text().await?;
7545        let entity: Option<ImportUsersWithIdError> = serde_json::from_str(&content).ok();
7546        Err(Error::ResponseError(ResponseContent { status, content, entity }))
7547    }
7548}
7549
7550/// Import a WebAuthn credential
7551pub async fn import_web_authn_credential_with_id(configuration: &configuration::Configuration, web_authn_credential_import_request: Option<models::WebAuthnCredentialImportRequest>) -> Result<(), Error<ImportWebAuthnCredentialWithIdError>> {
7552    // add a prefix to parameters to efficiently prevent name collisions
7553    let p_web_authn_credential_import_request = web_authn_credential_import_request;
7554
7555    let uri_str = format!("{}/api/webauthn/import", configuration.base_path);
7556    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
7557
7558    if let Some(ref user_agent) = configuration.user_agent {
7559        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
7560    }
7561    if let Some(ref apikey) = configuration.api_key {
7562        let key = apikey.key.clone();
7563        let value = match apikey.prefix {
7564            Some(ref prefix) => format!("{} {}", prefix, key),
7565            None => key,
7566        };
7567        req_builder = req_builder.header("Authorization", value);
7568    };
7569    req_builder = req_builder.json(&p_web_authn_credential_import_request);
7570
7571    let req = req_builder.build()?;
7572    let resp = configuration.client.execute(req).await?;
7573
7574    let status = resp.status();
7575
7576    if !status.is_client_error() && !status.is_server_error() {
7577        Ok(())
7578    } else {
7579        let content = resp.text().await?;
7580        let entity: Option<ImportWebAuthnCredentialWithIdError> = serde_json::from_str(&content).ok();
7581        Err(Error::ResponseError(ResponseContent { status, content, entity }))
7582    }
7583}
7584
7585/// Issue a new access token (JWT) for the requested Application after ensuring the provided JWT is valid. A valid access token is properly signed and not expired. <p> This API may be used in an SSO configuration to issue new tokens for another application after the user has obtained a valid token from authentication.
7586pub async fn issue_jwt_with_id(configuration: &configuration::Configuration, application_id: Option<&str>, refresh_token: Option<&str>) -> Result<models::IssueResponse, Error<IssueJwtWithIdError>> {
7587    // add a prefix to parameters to efficiently prevent name collisions
7588    let p_application_id = application_id;
7589    let p_refresh_token = refresh_token;
7590
7591    let uri_str = format!("{}/api/jwt/issue", configuration.base_path);
7592    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
7593
7594    if let Some(ref param_value) = p_application_id {
7595        req_builder = req_builder.query(&[("applicationId", &param_value.to_string())]);
7596    }
7597    if let Some(ref param_value) = p_refresh_token {
7598        req_builder = req_builder.query(&[("refreshToken", &param_value.to_string())]);
7599    }
7600    if let Some(ref user_agent) = configuration.user_agent {
7601        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
7602    }
7603    if let Some(ref token) = configuration.bearer_access_token {
7604        req_builder = req_builder.bearer_auth(token.to_owned());
7605    };
7606
7607    let req = req_builder.build()?;
7608    let resp = configuration.client.execute(req).await?;
7609
7610    let status = resp.status();
7611    let content_type = resp
7612        .headers()
7613        .get("content-type")
7614        .and_then(|v| v.to_str().ok())
7615        .unwrap_or("application/octet-stream");
7616    let content_type = super::ContentType::from(content_type);
7617
7618    if !status.is_client_error() && !status.is_server_error() {
7619        let content = resp.text().await?;
7620        match content_type {
7621            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
7622            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IssueResponse`"))),
7623            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IssueResponse`")))),
7624        }
7625    } else {
7626        let content = resp.text().await?;
7627        let entity: Option<IssueJwtWithIdError> = serde_json::from_str(&content).ok();
7628        Err(Error::ResponseError(ResponseContent { status, content, entity }))
7629    }
7630}
7631
7632/// Sends a ping to FusionAuth indicating that the user was automatically logged into an application. When using FusionAuth's SSO or your own, you should call this if the user is already logged in centrally, but accesses an application where they no longer have a session. This helps correctly track login counts, times and helps with reporting.
7633pub async fn login_ping_with_id(configuration: &configuration::Configuration, user_id: &str, application_id: &str, caller_ip_address: Option<&str>, x_fusion_auth_tenant_id: Option<&str>) -> Result<models::LoginResponse, Error<LoginPingWithIdError>> {
7634    // add a prefix to parameters to efficiently prevent name collisions
7635    let p_user_id = user_id;
7636    let p_application_id = application_id;
7637    let p_caller_ip_address = caller_ip_address;
7638    let p_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
7639
7640    let uri_str = format!("{}/api/login/{userId}/{applicationId}", configuration.base_path, userId=crate::apis::urlencode(p_user_id), applicationId=crate::apis::urlencode(p_application_id));
7641    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
7642
7643    if let Some(ref param_value) = p_caller_ip_address {
7644        req_builder = req_builder.query(&[("callerIPAddress", &param_value.to_string())]);
7645    }
7646    if let Some(ref user_agent) = configuration.user_agent {
7647        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
7648    }
7649    if let Some(param_value) = p_x_fusion_auth_tenant_id {
7650        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
7651    }
7652    if let Some(ref apikey) = configuration.api_key {
7653        let key = apikey.key.clone();
7654        let value = match apikey.prefix {
7655            Some(ref prefix) => format!("{} {}", prefix, key),
7656            None => key,
7657        };
7658        req_builder = req_builder.header("Authorization", value);
7659    };
7660
7661    let req = req_builder.build()?;
7662    let resp = configuration.client.execute(req).await?;
7663
7664    let status = resp.status();
7665    let content_type = resp
7666        .headers()
7667        .get("content-type")
7668        .and_then(|v| v.to_str().ok())
7669        .unwrap_or("application/octet-stream");
7670    let content_type = super::ContentType::from(content_type);
7671
7672    if !status.is_client_error() && !status.is_server_error() {
7673        let content = resp.text().await?;
7674        match content_type {
7675            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
7676            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::LoginResponse`"))),
7677            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::LoginResponse`")))),
7678        }
7679    } else {
7680        let content = resp.text().await?;
7681        let entity: Option<LoginPingWithIdError> = serde_json::from_str(&content).ok();
7682        Err(Error::ResponseError(ResponseContent { status, content, entity }))
7683    }
7684}
7685
7686/// Sends a ping to FusionAuth indicating that the user was automatically logged into an application. When using FusionAuth's SSO or your own, you should call this if the user is already logged in centrally, but accesses an application where they no longer have a session. This helps correctly track login counts, times and helps with reporting.
7687pub async fn login_ping_with_request_with_id(configuration: &configuration::Configuration, x_fusion_auth_tenant_id: Option<&str>, login_ping_request: Option<models::LoginPingRequest>) -> Result<models::LoginResponse, Error<LoginPingWithRequestWithIdError>> {
7688    // add a prefix to parameters to efficiently prevent name collisions
7689    let p_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
7690    let p_login_ping_request = login_ping_request;
7691
7692    let uri_str = format!("{}/api/login", configuration.base_path);
7693    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
7694
7695    if let Some(ref user_agent) = configuration.user_agent {
7696        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
7697    }
7698    if let Some(param_value) = p_x_fusion_auth_tenant_id {
7699        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
7700    }
7701    if let Some(ref apikey) = configuration.api_key {
7702        let key = apikey.key.clone();
7703        let value = match apikey.prefix {
7704            Some(ref prefix) => format!("{} {}", prefix, key),
7705            None => key,
7706        };
7707        req_builder = req_builder.header("Authorization", value);
7708    };
7709    req_builder = req_builder.json(&p_login_ping_request);
7710
7711    let req = req_builder.build()?;
7712    let resp = configuration.client.execute(req).await?;
7713
7714    let status = resp.status();
7715    let content_type = resp
7716        .headers()
7717        .get("content-type")
7718        .and_then(|v| v.to_str().ok())
7719        .unwrap_or("application/octet-stream");
7720    let content_type = super::ContentType::from(content_type);
7721
7722    if !status.is_client_error() && !status.is_server_error() {
7723        let content = resp.text().await?;
7724        match content_type {
7725            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
7726            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::LoginResponse`"))),
7727            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::LoginResponse`")))),
7728        }
7729    } else {
7730        let content = resp.text().await?;
7731        let entity: Option<LoginPingWithRequestWithIdError> = serde_json::from_str(&content).ok();
7732        Err(Error::ResponseError(ResponseContent { status, content, entity }))
7733    }
7734}
7735
7736/// Authenticates a user to FusionAuth.   This API optionally requires an API key. See <code>Application.loginConfiguration.requireAuthentication</code>.
7737pub async fn login_with_id(configuration: &configuration::Configuration, x_fusion_auth_tenant_id: Option<&str>, login_request: Option<models::LoginRequest>) -> Result<models::LoginResponse, Error<LoginWithIdError>> {
7738    // add a prefix to parameters to efficiently prevent name collisions
7739    let p_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
7740    let p_login_request = login_request;
7741
7742    let uri_str = format!("{}/api/login", configuration.base_path);
7743    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
7744
7745    if let Some(ref user_agent) = configuration.user_agent {
7746        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
7747    }
7748    if let Some(param_value) = p_x_fusion_auth_tenant_id {
7749        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
7750    }
7751    if let Some(ref apikey) = configuration.api_key {
7752        let key = apikey.key.clone();
7753        let value = match apikey.prefix {
7754            Some(ref prefix) => format!("{} {}", prefix, key),
7755            None => key,
7756        };
7757        req_builder = req_builder.header("Authorization", value);
7758    };
7759    req_builder = req_builder.json(&p_login_request);
7760
7761    let req = req_builder.build()?;
7762    let resp = configuration.client.execute(req).await?;
7763
7764    let status = resp.status();
7765    let content_type = resp
7766        .headers()
7767        .get("content-type")
7768        .and_then(|v| v.to_str().ok())
7769        .unwrap_or("application/octet-stream");
7770    let content_type = super::ContentType::from(content_type);
7771
7772    if !status.is_client_error() && !status.is_server_error() {
7773        let content = resp.text().await?;
7774        match content_type {
7775            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
7776            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::LoginResponse`"))),
7777            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::LoginResponse`")))),
7778        }
7779    } else {
7780        let content = resp.text().await?;
7781        let entity: Option<LoginWithIdError> = serde_json::from_str(&content).ok();
7782        Err(Error::ResponseError(ResponseContent { status, content, entity }))
7783    }
7784}
7785
7786/// Retrieves the identity provider for the given domain. A 200 response code indicates the domain is managed by a registered identity provider. A 404 indicates the domain is not managed.
7787pub async fn lookup_identity_provider_with_id(configuration: &configuration::Configuration, domain: Option<&str>) -> Result<models::LookupResponse, Error<LookupIdentityProviderWithIdError>> {
7788    // add a prefix to parameters to efficiently prevent name collisions
7789    let p_domain = domain;
7790
7791    let uri_str = format!("{}/api/identity-provider/lookup", configuration.base_path);
7792    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
7793
7794    if let Some(ref param_value) = p_domain {
7795        req_builder = req_builder.query(&[("domain", &param_value.to_string())]);
7796    }
7797    if let Some(ref user_agent) = configuration.user_agent {
7798        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
7799    }
7800    if let Some(ref apikey) = configuration.api_key {
7801        let key = apikey.key.clone();
7802        let value = match apikey.prefix {
7803            Some(ref prefix) => format!("{} {}", prefix, key),
7804            None => key,
7805        };
7806        req_builder = req_builder.header("Authorization", value);
7807    };
7808
7809    let req = req_builder.build()?;
7810    let resp = configuration.client.execute(req).await?;
7811
7812    let status = resp.status();
7813    let content_type = resp
7814        .headers()
7815        .get("content-type")
7816        .and_then(|v| v.to_str().ok())
7817        .unwrap_or("application/octet-stream");
7818    let content_type = super::ContentType::from(content_type);
7819
7820    if !status.is_client_error() && !status.is_server_error() {
7821        let content = resp.text().await?;
7822        match content_type {
7823            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
7824            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::LookupResponse`"))),
7825            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::LookupResponse`")))),
7826        }
7827    } else {
7828        let content = resp.text().await?;
7829        let entity: Option<LookupIdentityProviderWithIdError> = serde_json::from_str(&content).ok();
7830        Err(Error::ResponseError(ResponseContent { status, content, entity }))
7831    }
7832}
7833
7834/// Modifies a temporal user action by changing the expiration of the action and optionally adding a comment to the action.
7835pub async fn modify_action_with_id(configuration: &configuration::Configuration, action_id: &str, action_request: Option<models::ActionRequest>) -> Result<models::ActionResponse, Error<ModifyActionWithIdError>> {
7836    // add a prefix to parameters to efficiently prevent name collisions
7837    let p_action_id = action_id;
7838    let p_action_request = action_request;
7839
7840    let uri_str = format!("{}/api/user/action/{actionId}", configuration.base_path, actionId=crate::apis::urlencode(p_action_id));
7841    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
7842
7843    if let Some(ref user_agent) = configuration.user_agent {
7844        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
7845    }
7846    if let Some(ref apikey) = configuration.api_key {
7847        let key = apikey.key.clone();
7848        let value = match apikey.prefix {
7849            Some(ref prefix) => format!("{} {}", prefix, key),
7850            None => key,
7851        };
7852        req_builder = req_builder.header("Authorization", value);
7853    };
7854    req_builder = req_builder.json(&p_action_request);
7855
7856    let req = req_builder.build()?;
7857    let resp = configuration.client.execute(req).await?;
7858
7859    let status = resp.status();
7860    let content_type = resp
7861        .headers()
7862        .get("content-type")
7863        .and_then(|v| v.to_str().ok())
7864        .unwrap_or("application/octet-stream");
7865    let content_type = super::ContentType::from(content_type);
7866
7867    if !status.is_client_error() && !status.is_server_error() {
7868        let content = resp.text().await?;
7869        match content_type {
7870            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
7871            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ActionResponse`"))),
7872            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ActionResponse`")))),
7873        }
7874    } else {
7875        let content = resp.text().await?;
7876        let entity: Option<ModifyActionWithIdError> = serde_json::from_str(&content).ok();
7877        Err(Error::ResponseError(ResponseContent { status, content, entity }))
7878    }
7879}
7880
7881/// Complete a login request using a passwordless code
7882pub async fn passwordless_login_with_id(configuration: &configuration::Configuration, passwordless_login_request: Option<models::PasswordlessLoginRequest>) -> Result<models::LoginResponse, Error<PasswordlessLoginWithIdError>> {
7883    // add a prefix to parameters to efficiently prevent name collisions
7884    let p_passwordless_login_request = passwordless_login_request;
7885
7886    let uri_str = format!("{}/api/passwordless/login", configuration.base_path);
7887    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
7888
7889    if let Some(ref user_agent) = configuration.user_agent {
7890        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
7891    }
7892    if let Some(ref apikey) = configuration.api_key {
7893        let key = apikey.key.clone();
7894        let value = match apikey.prefix {
7895            Some(ref prefix) => format!("{} {}", prefix, key),
7896            None => key,
7897        };
7898        req_builder = req_builder.header("Authorization", value);
7899    };
7900    req_builder = req_builder.json(&p_passwordless_login_request);
7901
7902    let req = req_builder.build()?;
7903    let resp = configuration.client.execute(req).await?;
7904
7905    let status = resp.status();
7906    let content_type = resp
7907        .headers()
7908        .get("content-type")
7909        .and_then(|v| v.to_str().ok())
7910        .unwrap_or("application/octet-stream");
7911    let content_type = super::ContentType::from(content_type);
7912
7913    if !status.is_client_error() && !status.is_server_error() {
7914        let content = resp.text().await?;
7915        match content_type {
7916            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
7917            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::LoginResponse`"))),
7918            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::LoginResponse`")))),
7919        }
7920    } else {
7921        let content = resp.text().await?;
7922        let entity: Option<PasswordlessLoginWithIdError> = serde_json::from_str(&content).ok();
7923        Err(Error::ResponseError(ResponseContent { status, content, entity }))
7924    }
7925}
7926
7927/// Updates, via PATCH, the application role with the given Id for the application.
7928pub async fn patch_application_role_with_id(configuration: &configuration::Configuration, application_id: &str, role_id: &str, x_fusion_auth_tenant_id: Option<&str>, application_request: Option<models::ApplicationRequest>) -> Result<models::ApplicationResponse, Error<PatchApplicationRoleWithIdError>> {
7929    // add a prefix to parameters to efficiently prevent name collisions
7930    let p_application_id = application_id;
7931    let p_role_id = role_id;
7932    let p_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
7933    let p_application_request = application_request;
7934
7935    let uri_str = format!("{}/api/application/{applicationId}/role/{roleId}", configuration.base_path, applicationId=crate::apis::urlencode(p_application_id), roleId=crate::apis::urlencode(p_role_id));
7936    let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
7937
7938    if let Some(ref user_agent) = configuration.user_agent {
7939        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
7940    }
7941    if let Some(param_value) = p_x_fusion_auth_tenant_id {
7942        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
7943    }
7944    if let Some(ref apikey) = configuration.api_key {
7945        let key = apikey.key.clone();
7946        let value = match apikey.prefix {
7947            Some(ref prefix) => format!("{} {}", prefix, key),
7948            None => key,
7949        };
7950        req_builder = req_builder.header("Authorization", value);
7951    };
7952    req_builder = req_builder.json(&p_application_request);
7953
7954    let req = req_builder.build()?;
7955    let resp = configuration.client.execute(req).await?;
7956
7957    let status = resp.status();
7958    let content_type = resp
7959        .headers()
7960        .get("content-type")
7961        .and_then(|v| v.to_str().ok())
7962        .unwrap_or("application/octet-stream");
7963    let content_type = super::ContentType::from(content_type);
7964
7965    if !status.is_client_error() && !status.is_server_error() {
7966        let content = resp.text().await?;
7967        match content_type {
7968            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
7969            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ApplicationResponse`"))),
7970            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ApplicationResponse`")))),
7971        }
7972    } else {
7973        let content = resp.text().await?;
7974        let entity: Option<PatchApplicationRoleWithIdError> = serde_json::from_str(&content).ok();
7975        Err(Error::ResponseError(ResponseContent { status, content, entity }))
7976    }
7977}
7978
7979/// Updates, via PATCH, the application with the given Id.
7980pub async fn patch_application_with_id(configuration: &configuration::Configuration, application_id: &str, x_fusion_auth_tenant_id: Option<&str>, application_request: Option<models::ApplicationRequest>) -> Result<models::ApplicationResponse, Error<PatchApplicationWithIdError>> {
7981    // add a prefix to parameters to efficiently prevent name collisions
7982    let p_application_id = application_id;
7983    let p_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
7984    let p_application_request = application_request;
7985
7986    let uri_str = format!("{}/api/application/{applicationId}", configuration.base_path, applicationId=crate::apis::urlencode(p_application_id));
7987    let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
7988
7989    if let Some(ref user_agent) = configuration.user_agent {
7990        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
7991    }
7992    if let Some(param_value) = p_x_fusion_auth_tenant_id {
7993        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
7994    }
7995    if let Some(ref apikey) = configuration.api_key {
7996        let key = apikey.key.clone();
7997        let value = match apikey.prefix {
7998            Some(ref prefix) => format!("{} {}", prefix, key),
7999            None => key,
8000        };
8001        req_builder = req_builder.header("Authorization", value);
8002    };
8003    req_builder = req_builder.json(&p_application_request);
8004
8005    let req = req_builder.build()?;
8006    let resp = configuration.client.execute(req).await?;
8007
8008    let status = resp.status();
8009    let content_type = resp
8010        .headers()
8011        .get("content-type")
8012        .and_then(|v| v.to_str().ok())
8013        .unwrap_or("application/octet-stream");
8014    let content_type = super::ContentType::from(content_type);
8015
8016    if !status.is_client_error() && !status.is_server_error() {
8017        let content = resp.text().await?;
8018        match content_type {
8019            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
8020            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ApplicationResponse`"))),
8021            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ApplicationResponse`")))),
8022        }
8023    } else {
8024        let content = resp.text().await?;
8025        let entity: Option<PatchApplicationWithIdError> = serde_json::from_str(&content).ok();
8026        Err(Error::ResponseError(ResponseContent { status, content, entity }))
8027    }
8028}
8029
8030/// Updates, via PATCH, the connector with the given Id.
8031pub async fn patch_connector_with_id(configuration: &configuration::Configuration, connector_id: &str, connector_request: Option<models::ConnectorRequest>) -> Result<models::ConnectorResponse, Error<PatchConnectorWithIdError>> {
8032    // add a prefix to parameters to efficiently prevent name collisions
8033    let p_connector_id = connector_id;
8034    let p_connector_request = connector_request;
8035
8036    let uri_str = format!("{}/api/connector/{connectorId}", configuration.base_path, connectorId=crate::apis::urlencode(p_connector_id));
8037    let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
8038
8039    if let Some(ref user_agent) = configuration.user_agent {
8040        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
8041    }
8042    if let Some(ref apikey) = configuration.api_key {
8043        let key = apikey.key.clone();
8044        let value = match apikey.prefix {
8045            Some(ref prefix) => format!("{} {}", prefix, key),
8046            None => key,
8047        };
8048        req_builder = req_builder.header("Authorization", value);
8049    };
8050    req_builder = req_builder.json(&p_connector_request);
8051
8052    let req = req_builder.build()?;
8053    let resp = configuration.client.execute(req).await?;
8054
8055    let status = resp.status();
8056    let content_type = resp
8057        .headers()
8058        .get("content-type")
8059        .and_then(|v| v.to_str().ok())
8060        .unwrap_or("application/octet-stream");
8061    let content_type = super::ContentType::from(content_type);
8062
8063    if !status.is_client_error() && !status.is_server_error() {
8064        let content = resp.text().await?;
8065        match content_type {
8066            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
8067            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ConnectorResponse`"))),
8068            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ConnectorResponse`")))),
8069        }
8070    } else {
8071        let content = resp.text().await?;
8072        let entity: Option<PatchConnectorWithIdError> = serde_json::from_str(&content).ok();
8073        Err(Error::ResponseError(ResponseContent { status, content, entity }))
8074    }
8075}
8076
8077/// Updates, via PATCH, the consent with the given Id.
8078pub async fn patch_consent_with_id(configuration: &configuration::Configuration, consent_id: &str, x_fusion_auth_tenant_id: Option<&str>, consent_request: Option<models::ConsentRequest>) -> Result<models::ConsentResponse, Error<PatchConsentWithIdError>> {
8079    // add a prefix to parameters to efficiently prevent name collisions
8080    let p_consent_id = consent_id;
8081    let p_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
8082    let p_consent_request = consent_request;
8083
8084    let uri_str = format!("{}/api/consent/{consentId}", configuration.base_path, consentId=crate::apis::urlencode(p_consent_id));
8085    let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
8086
8087    if let Some(ref user_agent) = configuration.user_agent {
8088        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
8089    }
8090    if let Some(param_value) = p_x_fusion_auth_tenant_id {
8091        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
8092    }
8093    if let Some(ref apikey) = configuration.api_key {
8094        let key = apikey.key.clone();
8095        let value = match apikey.prefix {
8096            Some(ref prefix) => format!("{} {}", prefix, key),
8097            None => key,
8098        };
8099        req_builder = req_builder.header("Authorization", value);
8100    };
8101    req_builder = req_builder.json(&p_consent_request);
8102
8103    let req = req_builder.build()?;
8104    let resp = configuration.client.execute(req).await?;
8105
8106    let status = resp.status();
8107    let content_type = resp
8108        .headers()
8109        .get("content-type")
8110        .and_then(|v| v.to_str().ok())
8111        .unwrap_or("application/octet-stream");
8112    let content_type = super::ContentType::from(content_type);
8113
8114    if !status.is_client_error() && !status.is_server_error() {
8115        let content = resp.text().await?;
8116        match content_type {
8117            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
8118            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ConsentResponse`"))),
8119            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ConsentResponse`")))),
8120        }
8121    } else {
8122        let content = resp.text().await?;
8123        let entity: Option<PatchConsentWithIdError> = serde_json::from_str(&content).ok();
8124        Err(Error::ResponseError(ResponseContent { status, content, entity }))
8125    }
8126}
8127
8128/// Updates, via PATCH, the email template with the given Id.
8129pub async fn patch_email_template_with_id(configuration: &configuration::Configuration, email_template_id: &str, x_fusion_auth_tenant_id: Option<&str>, email_template_request: Option<models::EmailTemplateRequest>) -> Result<models::EmailTemplateResponse, Error<PatchEmailTemplateWithIdError>> {
8130    // add a prefix to parameters to efficiently prevent name collisions
8131    let p_email_template_id = email_template_id;
8132    let p_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
8133    let p_email_template_request = email_template_request;
8134
8135    let uri_str = format!("{}/api/email/template/{emailTemplateId}", configuration.base_path, emailTemplateId=crate::apis::urlencode(p_email_template_id));
8136    let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
8137
8138    if let Some(ref user_agent) = configuration.user_agent {
8139        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
8140    }
8141    if let Some(param_value) = p_x_fusion_auth_tenant_id {
8142        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
8143    }
8144    if let Some(ref apikey) = configuration.api_key {
8145        let key = apikey.key.clone();
8146        let value = match apikey.prefix {
8147            Some(ref prefix) => format!("{} {}", prefix, key),
8148            None => key,
8149        };
8150        req_builder = req_builder.header("Authorization", value);
8151    };
8152    req_builder = req_builder.json(&p_email_template_request);
8153
8154    let req = req_builder.build()?;
8155    let resp = configuration.client.execute(req).await?;
8156
8157    let status = resp.status();
8158    let content_type = resp
8159        .headers()
8160        .get("content-type")
8161        .and_then(|v| v.to_str().ok())
8162        .unwrap_or("application/octet-stream");
8163    let content_type = super::ContentType::from(content_type);
8164
8165    if !status.is_client_error() && !status.is_server_error() {
8166        let content = resp.text().await?;
8167        match content_type {
8168            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
8169            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::EmailTemplateResponse`"))),
8170            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::EmailTemplateResponse`")))),
8171        }
8172    } else {
8173        let content = resp.text().await?;
8174        let entity: Option<PatchEmailTemplateWithIdError> = serde_json::from_str(&content).ok();
8175        Err(Error::ResponseError(ResponseContent { status, content, entity }))
8176    }
8177}
8178
8179/// Patches the permission with the given Id for the entity type.
8180pub async fn patch_entity_type_permission_with_id(configuration: &configuration::Configuration, entity_type_id: &str, permission_id: &str, entity_type_request: Option<models::EntityTypeRequest>) -> Result<models::EntityTypeResponse, Error<PatchEntityTypePermissionWithIdError>> {
8181    // add a prefix to parameters to efficiently prevent name collisions
8182    let p_entity_type_id = entity_type_id;
8183    let p_permission_id = permission_id;
8184    let p_entity_type_request = entity_type_request;
8185
8186    let uri_str = format!("{}/api/entity/type/{entityTypeId}/permission/{permissionId}", configuration.base_path, entityTypeId=crate::apis::urlencode(p_entity_type_id), permissionId=crate::apis::urlencode(p_permission_id));
8187    let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
8188
8189    if let Some(ref user_agent) = configuration.user_agent {
8190        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
8191    }
8192    if let Some(ref apikey) = configuration.api_key {
8193        let key = apikey.key.clone();
8194        let value = match apikey.prefix {
8195            Some(ref prefix) => format!("{} {}", prefix, key),
8196            None => key,
8197        };
8198        req_builder = req_builder.header("Authorization", value);
8199    };
8200    req_builder = req_builder.json(&p_entity_type_request);
8201
8202    let req = req_builder.build()?;
8203    let resp = configuration.client.execute(req).await?;
8204
8205    let status = resp.status();
8206    let content_type = resp
8207        .headers()
8208        .get("content-type")
8209        .and_then(|v| v.to_str().ok())
8210        .unwrap_or("application/octet-stream");
8211    let content_type = super::ContentType::from(content_type);
8212
8213    if !status.is_client_error() && !status.is_server_error() {
8214        let content = resp.text().await?;
8215        match content_type {
8216            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
8217            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::EntityTypeResponse`"))),
8218            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::EntityTypeResponse`")))),
8219        }
8220    } else {
8221        let content = resp.text().await?;
8222        let entity: Option<PatchEntityTypePermissionWithIdError> = serde_json::from_str(&content).ok();
8223        Err(Error::ResponseError(ResponseContent { status, content, entity }))
8224    }
8225}
8226
8227/// Updates, via PATCH, the Entity Type with the given Id.
8228pub async fn patch_entity_type_with_id(configuration: &configuration::Configuration, entity_type_id: &str, entity_type_request: Option<models::EntityTypeRequest>) -> Result<models::EntityTypeResponse, Error<PatchEntityTypeWithIdError>> {
8229    // add a prefix to parameters to efficiently prevent name collisions
8230    let p_entity_type_id = entity_type_id;
8231    let p_entity_type_request = entity_type_request;
8232
8233    let uri_str = format!("{}/api/entity/type/{entityTypeId}", configuration.base_path, entityTypeId=crate::apis::urlencode(p_entity_type_id));
8234    let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
8235
8236    if let Some(ref user_agent) = configuration.user_agent {
8237        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
8238    }
8239    if let Some(ref apikey) = configuration.api_key {
8240        let key = apikey.key.clone();
8241        let value = match apikey.prefix {
8242            Some(ref prefix) => format!("{} {}", prefix, key),
8243            None => key,
8244        };
8245        req_builder = req_builder.header("Authorization", value);
8246    };
8247    req_builder = req_builder.json(&p_entity_type_request);
8248
8249    let req = req_builder.build()?;
8250    let resp = configuration.client.execute(req).await?;
8251
8252    let status = resp.status();
8253    let content_type = resp
8254        .headers()
8255        .get("content-type")
8256        .and_then(|v| v.to_str().ok())
8257        .unwrap_or("application/octet-stream");
8258    let content_type = super::ContentType::from(content_type);
8259
8260    if !status.is_client_error() && !status.is_server_error() {
8261        let content = resp.text().await?;
8262        match content_type {
8263            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
8264            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::EntityTypeResponse`"))),
8265            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::EntityTypeResponse`")))),
8266        }
8267    } else {
8268        let content = resp.text().await?;
8269        let entity: Option<PatchEntityTypeWithIdError> = serde_json::from_str(&content).ok();
8270        Err(Error::ResponseError(ResponseContent { status, content, entity }))
8271    }
8272}
8273
8274/// Updates, via PATCH, the Entity with the given Id.
8275pub async fn patch_entity_with_id(configuration: &configuration::Configuration, entity_id: &str, x_fusion_auth_tenant_id: Option<&str>, entity_request: Option<models::EntityRequest>) -> Result<models::EntityResponse, Error<PatchEntityWithIdError>> {
8276    // add a prefix to parameters to efficiently prevent name collisions
8277    let p_entity_id = entity_id;
8278    let p_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
8279    let p_entity_request = entity_request;
8280
8281    let uri_str = format!("{}/api/entity/{entityId}", configuration.base_path, entityId=crate::apis::urlencode(p_entity_id));
8282    let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
8283
8284    if let Some(ref user_agent) = configuration.user_agent {
8285        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
8286    }
8287    if let Some(param_value) = p_x_fusion_auth_tenant_id {
8288        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
8289    }
8290    if let Some(ref apikey) = configuration.api_key {
8291        let key = apikey.key.clone();
8292        let value = match apikey.prefix {
8293            Some(ref prefix) => format!("{} {}", prefix, key),
8294            None => key,
8295        };
8296        req_builder = req_builder.header("Authorization", value);
8297    };
8298    req_builder = req_builder.json(&p_entity_request);
8299
8300    let req = req_builder.build()?;
8301    let resp = configuration.client.execute(req).await?;
8302
8303    let status = resp.status();
8304    let content_type = resp
8305        .headers()
8306        .get("content-type")
8307        .and_then(|v| v.to_str().ok())
8308        .unwrap_or("application/octet-stream");
8309    let content_type = super::ContentType::from(content_type);
8310
8311    if !status.is_client_error() && !status.is_server_error() {
8312        let content = resp.text().await?;
8313        match content_type {
8314            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
8315            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::EntityResponse`"))),
8316            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::EntityResponse`")))),
8317        }
8318    } else {
8319        let content = resp.text().await?;
8320        let entity: Option<PatchEntityWithIdError> = serde_json::from_str(&content).ok();
8321        Err(Error::ResponseError(ResponseContent { status, content, entity }))
8322    }
8323}
8324
8325/// Patches the form field with the given Id.
8326pub async fn patch_form_field_with_id(configuration: &configuration::Configuration, field_id: &str, form_field_request: Option<models::FormFieldRequest>) -> Result<models::FormFieldResponse, Error<PatchFormFieldWithIdError>> {
8327    // add a prefix to parameters to efficiently prevent name collisions
8328    let p_field_id = field_id;
8329    let p_form_field_request = form_field_request;
8330
8331    let uri_str = format!("{}/api/form/field/{fieldId}", configuration.base_path, fieldId=crate::apis::urlencode(p_field_id));
8332    let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
8333
8334    if let Some(ref user_agent) = configuration.user_agent {
8335        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
8336    }
8337    if let Some(ref apikey) = configuration.api_key {
8338        let key = apikey.key.clone();
8339        let value = match apikey.prefix {
8340            Some(ref prefix) => format!("{} {}", prefix, key),
8341            None => key,
8342        };
8343        req_builder = req_builder.header("Authorization", value);
8344    };
8345    req_builder = req_builder.json(&p_form_field_request);
8346
8347    let req = req_builder.build()?;
8348    let resp = configuration.client.execute(req).await?;
8349
8350    let status = resp.status();
8351    let content_type = resp
8352        .headers()
8353        .get("content-type")
8354        .and_then(|v| v.to_str().ok())
8355        .unwrap_or("application/octet-stream");
8356    let content_type = super::ContentType::from(content_type);
8357
8358    if !status.is_client_error() && !status.is_server_error() {
8359        let content = resp.text().await?;
8360        match content_type {
8361            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
8362            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::FormFieldResponse`"))),
8363            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::FormFieldResponse`")))),
8364        }
8365    } else {
8366        let content = resp.text().await?;
8367        let entity: Option<PatchFormFieldWithIdError> = serde_json::from_str(&content).ok();
8368        Err(Error::ResponseError(ResponseContent { status, content, entity }))
8369    }
8370}
8371
8372/// Patches the form with the given Id.
8373pub async fn patch_form_with_id(configuration: &configuration::Configuration, form_id: &str, form_request: Option<models::FormRequest>) -> Result<models::FormResponse, Error<PatchFormWithIdError>> {
8374    // add a prefix to parameters to efficiently prevent name collisions
8375    let p_form_id = form_id;
8376    let p_form_request = form_request;
8377
8378    let uri_str = format!("{}/api/form/{formId}", configuration.base_path, formId=crate::apis::urlencode(p_form_id));
8379    let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
8380
8381    if let Some(ref user_agent) = configuration.user_agent {
8382        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
8383    }
8384    if let Some(ref apikey) = configuration.api_key {
8385        let key = apikey.key.clone();
8386        let value = match apikey.prefix {
8387            Some(ref prefix) => format!("{} {}", prefix, key),
8388            None => key,
8389        };
8390        req_builder = req_builder.header("Authorization", value);
8391    };
8392    req_builder = req_builder.json(&p_form_request);
8393
8394    let req = req_builder.build()?;
8395    let resp = configuration.client.execute(req).await?;
8396
8397    let status = resp.status();
8398    let content_type = resp
8399        .headers()
8400        .get("content-type")
8401        .and_then(|v| v.to_str().ok())
8402        .unwrap_or("application/octet-stream");
8403    let content_type = super::ContentType::from(content_type);
8404
8405    if !status.is_client_error() && !status.is_server_error() {
8406        let content = resp.text().await?;
8407        match content_type {
8408            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
8409            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::FormResponse`"))),
8410            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::FormResponse`")))),
8411        }
8412    } else {
8413        let content = resp.text().await?;
8414        let entity: Option<PatchFormWithIdError> = serde_json::from_str(&content).ok();
8415        Err(Error::ResponseError(ResponseContent { status, content, entity }))
8416    }
8417}
8418
8419/// Updates, via PATCH, the group with the given Id.
8420pub async fn patch_group_with_id(configuration: &configuration::Configuration, group_id: &str, x_fusion_auth_tenant_id: Option<&str>, group_request: Option<models::GroupRequest>) -> Result<models::GroupResponse, Error<PatchGroupWithIdError>> {
8421    // add a prefix to parameters to efficiently prevent name collisions
8422    let p_group_id = group_id;
8423    let p_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
8424    let p_group_request = group_request;
8425
8426    let uri_str = format!("{}/api/group/{groupId}", configuration.base_path, groupId=crate::apis::urlencode(p_group_id));
8427    let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
8428
8429    if let Some(ref user_agent) = configuration.user_agent {
8430        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
8431    }
8432    if let Some(param_value) = p_x_fusion_auth_tenant_id {
8433        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
8434    }
8435    if let Some(ref apikey) = configuration.api_key {
8436        let key = apikey.key.clone();
8437        let value = match apikey.prefix {
8438            Some(ref prefix) => format!("{} {}", prefix, key),
8439            None => key,
8440        };
8441        req_builder = req_builder.header("Authorization", value);
8442    };
8443    req_builder = req_builder.json(&p_group_request);
8444
8445    let req = req_builder.build()?;
8446    let resp = configuration.client.execute(req).await?;
8447
8448    let status = resp.status();
8449    let content_type = resp
8450        .headers()
8451        .get("content-type")
8452        .and_then(|v| v.to_str().ok())
8453        .unwrap_or("application/octet-stream");
8454    let content_type = super::ContentType::from(content_type);
8455
8456    if !status.is_client_error() && !status.is_server_error() {
8457        let content = resp.text().await?;
8458        match content_type {
8459            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
8460            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GroupResponse`"))),
8461            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GroupResponse`")))),
8462        }
8463    } else {
8464        let content = resp.text().await?;
8465        let entity: Option<PatchGroupWithIdError> = serde_json::from_str(&content).ok();
8466        Err(Error::ResponseError(ResponseContent { status, content, entity }))
8467    }
8468}
8469
8470/// Updates, via PATCH, the identity provider with the given Id.
8471pub async fn patch_identity_provider_with_id(configuration: &configuration::Configuration, identity_provider_id: &str, identity_provider_request: Option<models::IdentityProviderRequest>) -> Result<models::IdentityProviderResponse, Error<PatchIdentityProviderWithIdError>> {
8472    // add a prefix to parameters to efficiently prevent name collisions
8473    let p_identity_provider_id = identity_provider_id;
8474    let p_identity_provider_request = identity_provider_request;
8475
8476    let uri_str = format!("{}/api/identity-provider/{identityProviderId}", configuration.base_path, identityProviderId=crate::apis::urlencode(p_identity_provider_id));
8477    let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
8478
8479    if let Some(ref user_agent) = configuration.user_agent {
8480        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
8481    }
8482    if let Some(ref apikey) = configuration.api_key {
8483        let key = apikey.key.clone();
8484        let value = match apikey.prefix {
8485            Some(ref prefix) => format!("{} {}", prefix, key),
8486            None => key,
8487        };
8488        req_builder = req_builder.header("Authorization", value);
8489    };
8490    req_builder = req_builder.json(&p_identity_provider_request);
8491
8492    let req = req_builder.build()?;
8493    let resp = configuration.client.execute(req).await?;
8494
8495    let status = resp.status();
8496    let content_type = resp
8497        .headers()
8498        .get("content-type")
8499        .and_then(|v| v.to_str().ok())
8500        .unwrap_or("application/octet-stream");
8501    let content_type = super::ContentType::from(content_type);
8502
8503    if !status.is_client_error() && !status.is_server_error() {
8504        let content = resp.text().await?;
8505        match content_type {
8506            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
8507            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IdentityProviderResponse`"))),
8508            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IdentityProviderResponse`")))),
8509        }
8510    } else {
8511        let content = resp.text().await?;
8512        let entity: Option<PatchIdentityProviderWithIdError> = serde_json::from_str(&content).ok();
8513        Err(Error::ResponseError(ResponseContent { status, content, entity }))
8514    }
8515}
8516
8517/// Updates, via PATCH, the available integrations.
8518pub async fn patch_integrations_with_id(configuration: &configuration::Configuration, integration_request: Option<models::IntegrationRequest>) -> Result<models::IntegrationResponse, Error<PatchIntegrationsWithIdError>> {
8519    // add a prefix to parameters to efficiently prevent name collisions
8520    let p_integration_request = integration_request;
8521
8522    let uri_str = format!("{}/api/integration", configuration.base_path);
8523    let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
8524
8525    if let Some(ref user_agent) = configuration.user_agent {
8526        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
8527    }
8528    if let Some(ref apikey) = configuration.api_key {
8529        let key = apikey.key.clone();
8530        let value = match apikey.prefix {
8531            Some(ref prefix) => format!("{} {}", prefix, key),
8532            None => key,
8533        };
8534        req_builder = req_builder.header("Authorization", value);
8535    };
8536    req_builder = req_builder.json(&p_integration_request);
8537
8538    let req = req_builder.build()?;
8539    let resp = configuration.client.execute(req).await?;
8540
8541    let status = resp.status();
8542    let content_type = resp
8543        .headers()
8544        .get("content-type")
8545        .and_then(|v| v.to_str().ok())
8546        .unwrap_or("application/octet-stream");
8547    let content_type = super::ContentType::from(content_type);
8548
8549    if !status.is_client_error() && !status.is_server_error() {
8550        let content = resp.text().await?;
8551        match content_type {
8552            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
8553            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IntegrationResponse`"))),
8554            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IntegrationResponse`")))),
8555        }
8556    } else {
8557        let content = resp.text().await?;
8558        let entity: Option<PatchIntegrationsWithIdError> = serde_json::from_str(&content).ok();
8559        Err(Error::ResponseError(ResponseContent { status, content, entity }))
8560    }
8561}
8562
8563/// Update the IP Access Control List with the given Id.
8564pub async fn patch_ip_access_control_list_with_id(configuration: &configuration::Configuration, access_control_list_id: &str, ip_access_control_list_request: Option<models::IpAccessControlListRequest>) -> Result<models::IpAccessControlListResponse, Error<PatchIpAccessControlListWithIdError>> {
8565    // add a prefix to parameters to efficiently prevent name collisions
8566    let p_access_control_list_id = access_control_list_id;
8567    let p_ip_access_control_list_request = ip_access_control_list_request;
8568
8569    let uri_str = format!("{}/api/ip-acl/{accessControlListId}", configuration.base_path, accessControlListId=crate::apis::urlencode(p_access_control_list_id));
8570    let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
8571
8572    if let Some(ref user_agent) = configuration.user_agent {
8573        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
8574    }
8575    if let Some(ref apikey) = configuration.api_key {
8576        let key = apikey.key.clone();
8577        let value = match apikey.prefix {
8578            Some(ref prefix) => format!("{} {}", prefix, key),
8579            None => key,
8580        };
8581        req_builder = req_builder.header("Authorization", value);
8582    };
8583    req_builder = req_builder.json(&p_ip_access_control_list_request);
8584
8585    let req = req_builder.build()?;
8586    let resp = configuration.client.execute(req).await?;
8587
8588    let status = resp.status();
8589    let content_type = resp
8590        .headers()
8591        .get("content-type")
8592        .and_then(|v| v.to_str().ok())
8593        .unwrap_or("application/octet-stream");
8594    let content_type = super::ContentType::from(content_type);
8595
8596    if !status.is_client_error() && !status.is_server_error() {
8597        let content = resp.text().await?;
8598        match content_type {
8599            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
8600            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IpAccessControlListResponse`"))),
8601            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IpAccessControlListResponse`")))),
8602        }
8603    } else {
8604        let content = resp.text().await?;
8605        let entity: Option<PatchIpAccessControlListWithIdError> = serde_json::from_str(&content).ok();
8606        Err(Error::ResponseError(ResponseContent { status, content, entity }))
8607    }
8608}
8609
8610/// Updates, via PATCH, the lambda with the given Id.
8611pub async fn patch_lambda_with_id(configuration: &configuration::Configuration, lambda_id: &str, lambda_request: Option<models::LambdaRequest>) -> Result<models::LambdaResponse, Error<PatchLambdaWithIdError>> {
8612    // add a prefix to parameters to efficiently prevent name collisions
8613    let p_lambda_id = lambda_id;
8614    let p_lambda_request = lambda_request;
8615
8616    let uri_str = format!("{}/api/lambda/{lambdaId}", configuration.base_path, lambdaId=crate::apis::urlencode(p_lambda_id));
8617    let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
8618
8619    if let Some(ref user_agent) = configuration.user_agent {
8620        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
8621    }
8622    if let Some(ref apikey) = configuration.api_key {
8623        let key = apikey.key.clone();
8624        let value = match apikey.prefix {
8625            Some(ref prefix) => format!("{} {}", prefix, key),
8626            None => key,
8627        };
8628        req_builder = req_builder.header("Authorization", value);
8629    };
8630    req_builder = req_builder.json(&p_lambda_request);
8631
8632    let req = req_builder.build()?;
8633    let resp = configuration.client.execute(req).await?;
8634
8635    let status = resp.status();
8636    let content_type = resp
8637        .headers()
8638        .get("content-type")
8639        .and_then(|v| v.to_str().ok())
8640        .unwrap_or("application/octet-stream");
8641    let content_type = super::ContentType::from(content_type);
8642
8643    if !status.is_client_error() && !status.is_server_error() {
8644        let content = resp.text().await?;
8645        match content_type {
8646            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
8647            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::LambdaResponse`"))),
8648            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::LambdaResponse`")))),
8649        }
8650    } else {
8651        let content = resp.text().await?;
8652        let entity: Option<PatchLambdaWithIdError> = serde_json::from_str(&content).ok();
8653        Err(Error::ResponseError(ResponseContent { status, content, entity }))
8654    }
8655}
8656
8657/// Updates, via PATCH, the message template with the given Id.
8658pub async fn patch_message_template_with_id(configuration: &configuration::Configuration, message_template_id: &str, message_template_request: Option<models::MessageTemplateRequest>) -> Result<models::MessageTemplateResponse, Error<PatchMessageTemplateWithIdError>> {
8659    // add a prefix to parameters to efficiently prevent name collisions
8660    let p_message_template_id = message_template_id;
8661    let p_message_template_request = message_template_request;
8662
8663    let uri_str = format!("{}/api/message/template/{messageTemplateId}", configuration.base_path, messageTemplateId=crate::apis::urlencode(p_message_template_id));
8664    let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
8665
8666    if let Some(ref user_agent) = configuration.user_agent {
8667        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
8668    }
8669    if let Some(ref apikey) = configuration.api_key {
8670        let key = apikey.key.clone();
8671        let value = match apikey.prefix {
8672            Some(ref prefix) => format!("{} {}", prefix, key),
8673            None => key,
8674        };
8675        req_builder = req_builder.header("Authorization", value);
8676    };
8677    req_builder = req_builder.json(&p_message_template_request);
8678
8679    let req = req_builder.build()?;
8680    let resp = configuration.client.execute(req).await?;
8681
8682    let status = resp.status();
8683    let content_type = resp
8684        .headers()
8685        .get("content-type")
8686        .and_then(|v| v.to_str().ok())
8687        .unwrap_or("application/octet-stream");
8688    let content_type = super::ContentType::from(content_type);
8689
8690    if !status.is_client_error() && !status.is_server_error() {
8691        let content = resp.text().await?;
8692        match content_type {
8693            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
8694            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::MessageTemplateResponse`"))),
8695            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::MessageTemplateResponse`")))),
8696        }
8697    } else {
8698        let content = resp.text().await?;
8699        let entity: Option<PatchMessageTemplateWithIdError> = serde_json::from_str(&content).ok();
8700        Err(Error::ResponseError(ResponseContent { status, content, entity }))
8701    }
8702}
8703
8704/// Updates, via PATCH, the messenger with the given Id.
8705pub async fn patch_messenger_with_id(configuration: &configuration::Configuration, messenger_id: &str, messenger_request: Option<models::MessengerRequest>) -> Result<models::MessengerResponse, Error<PatchMessengerWithIdError>> {
8706    // add a prefix to parameters to efficiently prevent name collisions
8707    let p_messenger_id = messenger_id;
8708    let p_messenger_request = messenger_request;
8709
8710    let uri_str = format!("{}/api/messenger/{messengerId}", configuration.base_path, messengerId=crate::apis::urlencode(p_messenger_id));
8711    let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
8712
8713    if let Some(ref user_agent) = configuration.user_agent {
8714        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
8715    }
8716    if let Some(ref apikey) = configuration.api_key {
8717        let key = apikey.key.clone();
8718        let value = match apikey.prefix {
8719            Some(ref prefix) => format!("{} {}", prefix, key),
8720            None => key,
8721        };
8722        req_builder = req_builder.header("Authorization", value);
8723    };
8724    req_builder = req_builder.json(&p_messenger_request);
8725
8726    let req = req_builder.build()?;
8727    let resp = configuration.client.execute(req).await?;
8728
8729    let status = resp.status();
8730    let content_type = resp
8731        .headers()
8732        .get("content-type")
8733        .and_then(|v| v.to_str().ok())
8734        .unwrap_or("application/octet-stream");
8735    let content_type = super::ContentType::from(content_type);
8736
8737    if !status.is_client_error() && !status.is_server_error() {
8738        let content = resp.text().await?;
8739        match content_type {
8740            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
8741            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::MessengerResponse`"))),
8742            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::MessengerResponse`")))),
8743        }
8744    } else {
8745        let content = resp.text().await?;
8746        let entity: Option<PatchMessengerWithIdError> = serde_json::from_str(&content).ok();
8747        Err(Error::ResponseError(ResponseContent { status, content, entity }))
8748    }
8749}
8750
8751/// Updates, via PATCH, the custom OAuth scope with the given Id for the application.
8752pub async fn patch_o_auth_scope_with_id(configuration: &configuration::Configuration, application_id: &str, scope_id: &str, x_fusion_auth_tenant_id: Option<&str>, application_o_auth_scope_request: Option<models::ApplicationOAuthScopeRequest>) -> Result<models::ApplicationOAuthScopeResponse, Error<PatchOAuthScopeWithIdError>> {
8753    // add a prefix to parameters to efficiently prevent name collisions
8754    let p_application_id = application_id;
8755    let p_scope_id = scope_id;
8756    let p_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
8757    let p_application_o_auth_scope_request = application_o_auth_scope_request;
8758
8759    let uri_str = format!("{}/api/application/{applicationId}/scope/{scopeId}", configuration.base_path, applicationId=crate::apis::urlencode(p_application_id), scopeId=crate::apis::urlencode(p_scope_id));
8760    let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
8761
8762    if let Some(ref user_agent) = configuration.user_agent {
8763        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
8764    }
8765    if let Some(param_value) = p_x_fusion_auth_tenant_id {
8766        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
8767    }
8768    if let Some(ref apikey) = configuration.api_key {
8769        let key = apikey.key.clone();
8770        let value = match apikey.prefix {
8771            Some(ref prefix) => format!("{} {}", prefix, key),
8772            None => key,
8773        };
8774        req_builder = req_builder.header("Authorization", value);
8775    };
8776    req_builder = req_builder.json(&p_application_o_auth_scope_request);
8777
8778    let req = req_builder.build()?;
8779    let resp = configuration.client.execute(req).await?;
8780
8781    let status = resp.status();
8782    let content_type = resp
8783        .headers()
8784        .get("content-type")
8785        .and_then(|v| v.to_str().ok())
8786        .unwrap_or("application/octet-stream");
8787    let content_type = super::ContentType::from(content_type);
8788
8789    if !status.is_client_error() && !status.is_server_error() {
8790        let content = resp.text().await?;
8791        match content_type {
8792            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
8793            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ApplicationOAuthScopeResponse`"))),
8794            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ApplicationOAuthScopeResponse`")))),
8795        }
8796    } else {
8797        let content = resp.text().await?;
8798        let entity: Option<PatchOAuthScopeWithIdError> = serde_json::from_str(&content).ok();
8799        Err(Error::ResponseError(ResponseContent { status, content, entity }))
8800    }
8801}
8802
8803/// Updates, via PATCH, the registration for the user with the given Id and the application defined in the request.
8804pub async fn patch_registration_with_id(configuration: &configuration::Configuration, user_id: &str, x_fusion_auth_tenant_id: Option<&str>, registration_request: Option<models::RegistrationRequest>) -> Result<models::RegistrationResponse, Error<PatchRegistrationWithIdError>> {
8805    // add a prefix to parameters to efficiently prevent name collisions
8806    let p_user_id = user_id;
8807    let p_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
8808    let p_registration_request = registration_request;
8809
8810    let uri_str = format!("{}/api/user/registration/{userId}", configuration.base_path, userId=crate::apis::urlencode(p_user_id));
8811    let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
8812
8813    if let Some(ref user_agent) = configuration.user_agent {
8814        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
8815    }
8816    if let Some(param_value) = p_x_fusion_auth_tenant_id {
8817        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
8818    }
8819    if let Some(ref apikey) = configuration.api_key {
8820        let key = apikey.key.clone();
8821        let value = match apikey.prefix {
8822            Some(ref prefix) => format!("{} {}", prefix, key),
8823            None => key,
8824        };
8825        req_builder = req_builder.header("Authorization", value);
8826    };
8827    req_builder = req_builder.json(&p_registration_request);
8828
8829    let req = req_builder.build()?;
8830    let resp = configuration.client.execute(req).await?;
8831
8832    let status = resp.status();
8833    let content_type = resp
8834        .headers()
8835        .get("content-type")
8836        .and_then(|v| v.to_str().ok())
8837        .unwrap_or("application/octet-stream");
8838    let content_type = super::ContentType::from(content_type);
8839
8840    if !status.is_client_error() && !status.is_server_error() {
8841        let content = resp.text().await?;
8842        match content_type {
8843            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
8844            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::RegistrationResponse`"))),
8845            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::RegistrationResponse`")))),
8846        }
8847    } else {
8848        let content = resp.text().await?;
8849        let entity: Option<PatchRegistrationWithIdError> = serde_json::from_str(&content).ok();
8850        Err(Error::ResponseError(ResponseContent { status, content, entity }))
8851    }
8852}
8853
8854/// Updates, via PATCH, the system configuration.
8855pub async fn patch_system_configuration_with_id(configuration: &configuration::Configuration, system_configuration_request: Option<models::SystemConfigurationRequest>) -> Result<models::SystemConfigurationResponse, Error<PatchSystemConfigurationWithIdError>> {
8856    // add a prefix to parameters to efficiently prevent name collisions
8857    let p_system_configuration_request = system_configuration_request;
8858
8859    let uri_str = format!("{}/api/system-configuration", configuration.base_path);
8860    let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
8861
8862    if let Some(ref user_agent) = configuration.user_agent {
8863        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
8864    }
8865    if let Some(ref apikey) = configuration.api_key {
8866        let key = apikey.key.clone();
8867        let value = match apikey.prefix {
8868            Some(ref prefix) => format!("{} {}", prefix, key),
8869            None => key,
8870        };
8871        req_builder = req_builder.header("Authorization", value);
8872    };
8873    req_builder = req_builder.json(&p_system_configuration_request);
8874
8875    let req = req_builder.build()?;
8876    let resp = configuration.client.execute(req).await?;
8877
8878    let status = resp.status();
8879    let content_type = resp
8880        .headers()
8881        .get("content-type")
8882        .and_then(|v| v.to_str().ok())
8883        .unwrap_or("application/octet-stream");
8884    let content_type = super::ContentType::from(content_type);
8885
8886    if !status.is_client_error() && !status.is_server_error() {
8887        let content = resp.text().await?;
8888        match content_type {
8889            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
8890            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::SystemConfigurationResponse`"))),
8891            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::SystemConfigurationResponse`")))),
8892        }
8893    } else {
8894        let content = resp.text().await?;
8895        let entity: Option<PatchSystemConfigurationWithIdError> = serde_json::from_str(&content).ok();
8896        Err(Error::ResponseError(ResponseContent { status, content, entity }))
8897    }
8898}
8899
8900/// Updates, via PATCH, the tenant with the given Id.
8901pub async fn patch_tenant_with_id(configuration: &configuration::Configuration, tenant_id: &str, x_fusion_auth_tenant_id: Option<&str>, tenant_request: Option<models::TenantRequest>) -> Result<models::TenantResponse, Error<PatchTenantWithIdError>> {
8902    // add a prefix to parameters to efficiently prevent name collisions
8903    let p_tenant_id = tenant_id;
8904    let p_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
8905    let p_tenant_request = tenant_request;
8906
8907    let uri_str = format!("{}/api/tenant/{tenantId}", configuration.base_path, tenantId=crate::apis::urlencode(p_tenant_id));
8908    let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
8909
8910    if let Some(ref user_agent) = configuration.user_agent {
8911        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
8912    }
8913    if let Some(param_value) = p_x_fusion_auth_tenant_id {
8914        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
8915    }
8916    if let Some(ref apikey) = configuration.api_key {
8917        let key = apikey.key.clone();
8918        let value = match apikey.prefix {
8919            Some(ref prefix) => format!("{} {}", prefix, key),
8920            None => key,
8921        };
8922        req_builder = req_builder.header("Authorization", value);
8923    };
8924    req_builder = req_builder.json(&p_tenant_request);
8925
8926    let req = req_builder.build()?;
8927    let resp = configuration.client.execute(req).await?;
8928
8929    let status = resp.status();
8930    let content_type = resp
8931        .headers()
8932        .get("content-type")
8933        .and_then(|v| v.to_str().ok())
8934        .unwrap_or("application/octet-stream");
8935    let content_type = super::ContentType::from(content_type);
8936
8937    if !status.is_client_error() && !status.is_server_error() {
8938        let content = resp.text().await?;
8939        match content_type {
8940            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
8941            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::TenantResponse`"))),
8942            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::TenantResponse`")))),
8943        }
8944    } else {
8945        let content = resp.text().await?;
8946        let entity: Option<PatchTenantWithIdError> = serde_json::from_str(&content).ok();
8947        Err(Error::ResponseError(ResponseContent { status, content, entity }))
8948    }
8949}
8950
8951/// Updates, via PATCH, the theme with the given Id.
8952pub async fn patch_theme_with_id(configuration: &configuration::Configuration, theme_id: &str, theme_request: Option<models::ThemeRequest>) -> Result<models::ThemeResponse, Error<PatchThemeWithIdError>> {
8953    // add a prefix to parameters to efficiently prevent name collisions
8954    let p_theme_id = theme_id;
8955    let p_theme_request = theme_request;
8956
8957    let uri_str = format!("{}/api/theme/{themeId}", configuration.base_path, themeId=crate::apis::urlencode(p_theme_id));
8958    let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
8959
8960    if let Some(ref user_agent) = configuration.user_agent {
8961        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
8962    }
8963    if let Some(ref apikey) = configuration.api_key {
8964        let key = apikey.key.clone();
8965        let value = match apikey.prefix {
8966            Some(ref prefix) => format!("{} {}", prefix, key),
8967            None => key,
8968        };
8969        req_builder = req_builder.header("Authorization", value);
8970    };
8971    req_builder = req_builder.json(&p_theme_request);
8972
8973    let req = req_builder.build()?;
8974    let resp = configuration.client.execute(req).await?;
8975
8976    let status = resp.status();
8977    let content_type = resp
8978        .headers()
8979        .get("content-type")
8980        .and_then(|v| v.to_str().ok())
8981        .unwrap_or("application/octet-stream");
8982    let content_type = super::ContentType::from(content_type);
8983
8984    if !status.is_client_error() && !status.is_server_error() {
8985        let content = resp.text().await?;
8986        match content_type {
8987            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
8988            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ThemeResponse`"))),
8989            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ThemeResponse`")))),
8990        }
8991    } else {
8992        let content = resp.text().await?;
8993        let entity: Option<PatchThemeWithIdError> = serde_json::from_str(&content).ok();
8994        Err(Error::ResponseError(ResponseContent { status, content, entity }))
8995    }
8996}
8997
8998/// Updates, via PATCH, the user action reason with the given Id.
8999pub async fn patch_user_action_reason_with_id(configuration: &configuration::Configuration, user_action_reason_id: &str, user_action_reason_request: Option<models::UserActionReasonRequest>) -> Result<models::UserActionReasonResponse, Error<PatchUserActionReasonWithIdError>> {
9000    // add a prefix to parameters to efficiently prevent name collisions
9001    let p_user_action_reason_id = user_action_reason_id;
9002    let p_user_action_reason_request = user_action_reason_request;
9003
9004    let uri_str = format!("{}/api/user-action-reason/{userActionReasonId}", configuration.base_path, userActionReasonId=crate::apis::urlencode(p_user_action_reason_id));
9005    let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
9006
9007    if let Some(ref user_agent) = configuration.user_agent {
9008        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
9009    }
9010    if let Some(ref apikey) = configuration.api_key {
9011        let key = apikey.key.clone();
9012        let value = match apikey.prefix {
9013            Some(ref prefix) => format!("{} {}", prefix, key),
9014            None => key,
9015        };
9016        req_builder = req_builder.header("Authorization", value);
9017    };
9018    req_builder = req_builder.json(&p_user_action_reason_request);
9019
9020    let req = req_builder.build()?;
9021    let resp = configuration.client.execute(req).await?;
9022
9023    let status = resp.status();
9024    let content_type = resp
9025        .headers()
9026        .get("content-type")
9027        .and_then(|v| v.to_str().ok())
9028        .unwrap_or("application/octet-stream");
9029    let content_type = super::ContentType::from(content_type);
9030
9031    if !status.is_client_error() && !status.is_server_error() {
9032        let content = resp.text().await?;
9033        match content_type {
9034            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
9035            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::UserActionReasonResponse`"))),
9036            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::UserActionReasonResponse`")))),
9037        }
9038    } else {
9039        let content = resp.text().await?;
9040        let entity: Option<PatchUserActionReasonWithIdError> = serde_json::from_str(&content).ok();
9041        Err(Error::ResponseError(ResponseContent { status, content, entity }))
9042    }
9043}
9044
9045/// Updates, via PATCH, the user action with the given Id.
9046pub async fn patch_user_action_with_id(configuration: &configuration::Configuration, user_action_id: &str, x_fusion_auth_tenant_id: Option<&str>, user_action_request: Option<models::UserActionRequest>) -> Result<models::UserActionResponse, Error<PatchUserActionWithIdError>> {
9047    // add a prefix to parameters to efficiently prevent name collisions
9048    let p_user_action_id = user_action_id;
9049    let p_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
9050    let p_user_action_request = user_action_request;
9051
9052    let uri_str = format!("{}/api/user-action/{userActionId}", configuration.base_path, userActionId=crate::apis::urlencode(p_user_action_id));
9053    let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
9054
9055    if let Some(ref user_agent) = configuration.user_agent {
9056        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
9057    }
9058    if let Some(param_value) = p_x_fusion_auth_tenant_id {
9059        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
9060    }
9061    if let Some(ref apikey) = configuration.api_key {
9062        let key = apikey.key.clone();
9063        let value = match apikey.prefix {
9064            Some(ref prefix) => format!("{} {}", prefix, key),
9065            None => key,
9066        };
9067        req_builder = req_builder.header("Authorization", value);
9068    };
9069    req_builder = req_builder.json(&p_user_action_request);
9070
9071    let req = req_builder.build()?;
9072    let resp = configuration.client.execute(req).await?;
9073
9074    let status = resp.status();
9075    let content_type = resp
9076        .headers()
9077        .get("content-type")
9078        .and_then(|v| v.to_str().ok())
9079        .unwrap_or("application/octet-stream");
9080    let content_type = super::ContentType::from(content_type);
9081
9082    if !status.is_client_error() && !status.is_server_error() {
9083        let content = resp.text().await?;
9084        match content_type {
9085            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
9086            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::UserActionResponse`"))),
9087            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::UserActionResponse`")))),
9088        }
9089    } else {
9090        let content = resp.text().await?;
9091        let entity: Option<PatchUserActionWithIdError> = serde_json::from_str(&content).ok();
9092        Err(Error::ResponseError(ResponseContent { status, content, entity }))
9093    }
9094}
9095
9096/// Updates, via PATCH, a single User consent by Id.
9097pub async fn patch_user_consent_with_id(configuration: &configuration::Configuration, user_consent_id: &str, user_consent_request: Option<models::UserConsentRequest>) -> Result<models::UserConsentResponse, Error<PatchUserConsentWithIdError>> {
9098    // add a prefix to parameters to efficiently prevent name collisions
9099    let p_user_consent_id = user_consent_id;
9100    let p_user_consent_request = user_consent_request;
9101
9102    let uri_str = format!("{}/api/user/consent/{userConsentId}", configuration.base_path, userConsentId=crate::apis::urlencode(p_user_consent_id));
9103    let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
9104
9105    if let Some(ref user_agent) = configuration.user_agent {
9106        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
9107    }
9108    if let Some(ref apikey) = configuration.api_key {
9109        let key = apikey.key.clone();
9110        let value = match apikey.prefix {
9111            Some(ref prefix) => format!("{} {}", prefix, key),
9112            None => key,
9113        };
9114        req_builder = req_builder.header("Authorization", value);
9115    };
9116    req_builder = req_builder.json(&p_user_consent_request);
9117
9118    let req = req_builder.build()?;
9119    let resp = configuration.client.execute(req).await?;
9120
9121    let status = resp.status();
9122    let content_type = resp
9123        .headers()
9124        .get("content-type")
9125        .and_then(|v| v.to_str().ok())
9126        .unwrap_or("application/octet-stream");
9127    let content_type = super::ContentType::from(content_type);
9128
9129    if !status.is_client_error() && !status.is_server_error() {
9130        let content = resp.text().await?;
9131        match content_type {
9132            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
9133            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::UserConsentResponse`"))),
9134            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::UserConsentResponse`")))),
9135        }
9136    } else {
9137        let content = resp.text().await?;
9138        let entity: Option<PatchUserConsentWithIdError> = serde_json::from_str(&content).ok();
9139        Err(Error::ResponseError(ResponseContent { status, content, entity }))
9140    }
9141}
9142
9143/// Updates, via PATCH, the user with the given Id.
9144pub async fn patch_user_with_id(configuration: &configuration::Configuration, user_id: &str, x_fusion_auth_tenant_id: Option<&str>, user_request: Option<models::UserRequest>) -> Result<models::UserResponse, Error<PatchUserWithIdError>> {
9145    // add a prefix to parameters to efficiently prevent name collisions
9146    let p_user_id = user_id;
9147    let p_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
9148    let p_user_request = user_request;
9149
9150    let uri_str = format!("{}/api/user/{userId}", configuration.base_path, userId=crate::apis::urlencode(p_user_id));
9151    let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
9152
9153    if let Some(ref user_agent) = configuration.user_agent {
9154        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
9155    }
9156    if let Some(param_value) = p_x_fusion_auth_tenant_id {
9157        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
9158    }
9159    if let Some(ref apikey) = configuration.api_key {
9160        let key = apikey.key.clone();
9161        let value = match apikey.prefix {
9162            Some(ref prefix) => format!("{} {}", prefix, key),
9163            None => key,
9164        };
9165        req_builder = req_builder.header("Authorization", value);
9166    };
9167    req_builder = req_builder.json(&p_user_request);
9168
9169    let req = req_builder.build()?;
9170    let resp = configuration.client.execute(req).await?;
9171
9172    let status = resp.status();
9173    let content_type = resp
9174        .headers()
9175        .get("content-type")
9176        .and_then(|v| v.to_str().ok())
9177        .unwrap_or("application/octet-stream");
9178    let content_type = super::ContentType::from(content_type);
9179
9180    if !status.is_client_error() && !status.is_server_error() {
9181        let content = resp.text().await?;
9182        match content_type {
9183            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
9184            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::UserResponse`"))),
9185            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::UserResponse`")))),
9186        }
9187    } else {
9188        let content = resp.text().await?;
9189        let entity: Option<PatchUserWithIdError> = serde_json::from_str(&content).ok();
9190        Err(Error::ResponseError(ResponseContent { status, content, entity }))
9191    }
9192}
9193
9194/// Patches the webhook with the given Id.
9195pub async fn patch_webhook_with_id(configuration: &configuration::Configuration, webhook_id: &str, webhook_request: Option<models::WebhookRequest>) -> Result<models::WebhookResponse, Error<PatchWebhookWithIdError>> {
9196    // add a prefix to parameters to efficiently prevent name collisions
9197    let p_webhook_id = webhook_id;
9198    let p_webhook_request = webhook_request;
9199
9200    let uri_str = format!("{}/api/webhook/{webhookId}", configuration.base_path, webhookId=crate::apis::urlencode(p_webhook_id));
9201    let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
9202
9203    if let Some(ref user_agent) = configuration.user_agent {
9204        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
9205    }
9206    if let Some(ref apikey) = configuration.api_key {
9207        let key = apikey.key.clone();
9208        let value = match apikey.prefix {
9209            Some(ref prefix) => format!("{} {}", prefix, key),
9210            None => key,
9211        };
9212        req_builder = req_builder.header("Authorization", value);
9213    };
9214    req_builder = req_builder.json(&p_webhook_request);
9215
9216    let req = req_builder.build()?;
9217    let resp = configuration.client.execute(req).await?;
9218
9219    let status = resp.status();
9220    let content_type = resp
9221        .headers()
9222        .get("content-type")
9223        .and_then(|v| v.to_str().ok())
9224        .unwrap_or("application/octet-stream");
9225    let content_type = super::ContentType::from(content_type);
9226
9227    if !status.is_client_error() && !status.is_server_error() {
9228        let content = resp.text().await?;
9229        match content_type {
9230            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
9231            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::WebhookResponse`"))),
9232            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::WebhookResponse`")))),
9233        }
9234    } else {
9235        let content = resp.text().await?;
9236        let entity: Option<PatchWebhookWithIdError> = serde_json::from_str(&content).ok();
9237        Err(Error::ResponseError(ResponseContent { status, content, entity }))
9238    }
9239}
9240
9241/// Reconcile a User to FusionAuth using JWT issued from another Identity Provider.
9242pub async fn reconcile_jwt_with_id(configuration: &configuration::Configuration, identity_provider_login_request: Option<models::IdentityProviderLoginRequest>) -> Result<models::LoginResponse, Error<ReconcileJwtWithIdError>> {
9243    // add a prefix to parameters to efficiently prevent name collisions
9244    let p_identity_provider_login_request = identity_provider_login_request;
9245
9246    let uri_str = format!("{}/api/jwt/reconcile", configuration.base_path);
9247    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
9248
9249    if let Some(ref user_agent) = configuration.user_agent {
9250        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
9251    }
9252    if let Some(ref apikey) = configuration.api_key {
9253        let key = apikey.key.clone();
9254        let value = match apikey.prefix {
9255            Some(ref prefix) => format!("{} {}", prefix, key),
9256            None => key,
9257        };
9258        req_builder = req_builder.header("Authorization", value);
9259    };
9260    req_builder = req_builder.json(&p_identity_provider_login_request);
9261
9262    let req = req_builder.build()?;
9263    let resp = configuration.client.execute(req).await?;
9264
9265    let status = resp.status();
9266    let content_type = resp
9267        .headers()
9268        .get("content-type")
9269        .and_then(|v| v.to_str().ok())
9270        .unwrap_or("application/octet-stream");
9271    let content_type = super::ContentType::from(content_type);
9272
9273    if !status.is_client_error() && !status.is_server_error() {
9274        let content = resp.text().await?;
9275        match content_type {
9276            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
9277            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::LoginResponse`"))),
9278            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::LoginResponse`")))),
9279        }
9280    } else {
9281        let content = resp.text().await?;
9282        let entity: Option<ReconcileJwtWithIdError> = serde_json::from_str(&content).ok();
9283        Err(Error::ResponseError(ResponseContent { status, content, entity }))
9284    }
9285}
9286
9287/// Registers a user for an application. If you provide the User and the UserRegistration object on this request, it will create the user as well as register them for the application. This is called a Full Registration. However, if you only provide the UserRegistration object, then the user must already exist and they will be registered for the application. The user Id can also be provided and it will either be used to look up an existing user or it will be used for the newly created User.
9288pub async fn register(configuration: &configuration::Configuration, x_fusion_auth_tenant_id: Option<&str>, registration_request: Option<models::RegistrationRequest>) -> Result<models::RegistrationResponse, Error<RegisterError>> {
9289    // add a prefix to parameters to efficiently prevent name collisions
9290    let p_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
9291    let p_registration_request = registration_request;
9292
9293    let uri_str = format!("{}/api/user/registration", configuration.base_path);
9294    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
9295
9296    if let Some(ref user_agent) = configuration.user_agent {
9297        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
9298    }
9299    if let Some(param_value) = p_x_fusion_auth_tenant_id {
9300        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
9301    }
9302    if let Some(ref apikey) = configuration.api_key {
9303        let key = apikey.key.clone();
9304        let value = match apikey.prefix {
9305            Some(ref prefix) => format!("{} {}", prefix, key),
9306            None => key,
9307        };
9308        req_builder = req_builder.header("Authorization", value);
9309    };
9310    req_builder = req_builder.json(&p_registration_request);
9311
9312    let req = req_builder.build()?;
9313    let resp = configuration.client.execute(req).await?;
9314
9315    let status = resp.status();
9316    let content_type = resp
9317        .headers()
9318        .get("content-type")
9319        .and_then(|v| v.to_str().ok())
9320        .unwrap_or("application/octet-stream");
9321    let content_type = super::ContentType::from(content_type);
9322
9323    if !status.is_client_error() && !status.is_server_error() {
9324        let content = resp.text().await?;
9325        match content_type {
9326            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
9327            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::RegistrationResponse`"))),
9328            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::RegistrationResponse`")))),
9329        }
9330    } else {
9331        let content = resp.text().await?;
9332        let entity: Option<RegisterError> = serde_json::from_str(&content).ok();
9333        Err(Error::ResponseError(ResponseContent { status, content, entity }))
9334    }
9335}
9336
9337/// Registers a user for an application. If you provide the User and the UserRegistration object on this request, it will create the user as well as register them for the application. This is called a Full Registration. However, if you only provide the UserRegistration object, then the user must already exist and they will be registered for the application. The user Id can also be provided and it will either be used to look up an existing user or it will be used for the newly created User.
9338pub async fn register_with_id(configuration: &configuration::Configuration, user_id: &str, x_fusion_auth_tenant_id: Option<&str>, registration_request: Option<models::RegistrationRequest>) -> Result<models::RegistrationResponse, Error<RegisterWithIdError>> {
9339    // add a prefix to parameters to efficiently prevent name collisions
9340    let p_user_id = user_id;
9341    let p_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
9342    let p_registration_request = registration_request;
9343
9344    let uri_str = format!("{}/api/user/registration/{userId}", configuration.base_path, userId=crate::apis::urlencode(p_user_id));
9345    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
9346
9347    if let Some(ref user_agent) = configuration.user_agent {
9348        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
9349    }
9350    if let Some(param_value) = p_x_fusion_auth_tenant_id {
9351        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
9352    }
9353    if let Some(ref apikey) = configuration.api_key {
9354        let key = apikey.key.clone();
9355        let value = match apikey.prefix {
9356            Some(ref prefix) => format!("{} {}", prefix, key),
9357            None => key,
9358        };
9359        req_builder = req_builder.header("Authorization", value);
9360    };
9361    req_builder = req_builder.json(&p_registration_request);
9362
9363    let req = req_builder.build()?;
9364    let resp = configuration.client.execute(req).await?;
9365
9366    let status = resp.status();
9367    let content_type = resp
9368        .headers()
9369        .get("content-type")
9370        .and_then(|v| v.to_str().ok())
9371        .unwrap_or("application/octet-stream");
9372    let content_type = super::ContentType::from(content_type);
9373
9374    if !status.is_client_error() && !status.is_server_error() {
9375        let content = resp.text().await?;
9376        match content_type {
9377            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
9378            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::RegistrationResponse`"))),
9379            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::RegistrationResponse`")))),
9380        }
9381    } else {
9382        let content = resp.text().await?;
9383        let entity: Option<RegisterWithIdError> = serde_json::from_str(&content).ok();
9384        Err(Error::ResponseError(ResponseContent { status, content, entity }))
9385    }
9386}
9387
9388/// Requests Elasticsearch to delete and rebuild the index for FusionAuth users or entities. Be very careful when running this request as it will  increase the CPU and I/O load on your database until the operation completes. Generally speaking you do not ever need to run this operation unless  instructed by FusionAuth support, or if you are migrating a database another system and you are not brining along the Elasticsearch index.   You have been warned.
9389pub async fn reindex_with_id(configuration: &configuration::Configuration, reindex_request: Option<models::ReindexRequest>) -> Result<(), Error<ReindexWithIdError>> {
9390    // add a prefix to parameters to efficiently prevent name collisions
9391    let p_reindex_request = reindex_request;
9392
9393    let uri_str = format!("{}/api/system/reindex", configuration.base_path);
9394    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
9395
9396    if let Some(ref user_agent) = configuration.user_agent {
9397        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
9398    }
9399    if let Some(ref apikey) = configuration.api_key {
9400        let key = apikey.key.clone();
9401        let value = match apikey.prefix {
9402            Some(ref prefix) => format!("{} {}", prefix, key),
9403            None => key,
9404        };
9405        req_builder = req_builder.header("Authorization", value);
9406    };
9407    req_builder = req_builder.json(&p_reindex_request);
9408
9409    let req = req_builder.build()?;
9410    let resp = configuration.client.execute(req).await?;
9411
9412    let status = resp.status();
9413
9414    if !status.is_client_error() && !status.is_server_error() {
9415        Ok(())
9416    } else {
9417        let content = resp.text().await?;
9418        let entity: Option<ReindexWithIdError> = serde_json::from_str(&content).ok();
9419        Err(Error::ResponseError(ResponseContent { status, content, entity }))
9420    }
9421}
9422
9423/// Removes a user from the family with the given id.
9424pub async fn remove_user_from_family_with_id(configuration: &configuration::Configuration, family_id: &str, user_id: &str, x_fusion_auth_tenant_id: Option<&str>) -> Result<(), Error<RemoveUserFromFamilyWithIdError>> {
9425    // add a prefix to parameters to efficiently prevent name collisions
9426    let p_family_id = family_id;
9427    let p_user_id = user_id;
9428    let p_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
9429
9430    let uri_str = format!("{}/api/user/family/{familyId}/{userId}", configuration.base_path, familyId=crate::apis::urlencode(p_family_id), userId=crate::apis::urlencode(p_user_id));
9431    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
9432
9433    if let Some(ref user_agent) = configuration.user_agent {
9434        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
9435    }
9436    if let Some(param_value) = p_x_fusion_auth_tenant_id {
9437        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
9438    }
9439    if let Some(ref apikey) = configuration.api_key {
9440        let key = apikey.key.clone();
9441        let value = match apikey.prefix {
9442            Some(ref prefix) => format!("{} {}", prefix, key),
9443            None => key,
9444        };
9445        req_builder = req_builder.header("Authorization", value);
9446    };
9447
9448    let req = req_builder.build()?;
9449    let resp = configuration.client.execute(req).await?;
9450
9451    let status = resp.status();
9452
9453    if !status.is_client_error() && !status.is_server_error() {
9454        Ok(())
9455    } else {
9456        let content = resp.text().await?;
9457        let entity: Option<RemoveUserFromFamilyWithIdError> = serde_json::from_str(&content).ok();
9458        Err(Error::ResponseError(ResponseContent { status, content, entity }))
9459    }
9460}
9461
9462/// Retrieves a single action log (the log of a user action that was taken on a user previously) for the given Id.
9463pub async fn retrieve_action_with_id(configuration: &configuration::Configuration, action_id: &str) -> Result<models::ActionResponse, Error<RetrieveActionWithIdError>> {
9464    // add a prefix to parameters to efficiently prevent name collisions
9465    let p_action_id = action_id;
9466
9467    let uri_str = format!("{}/api/user/action/{actionId}", configuration.base_path, actionId=crate::apis::urlencode(p_action_id));
9468    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
9469
9470    if let Some(ref user_agent) = configuration.user_agent {
9471        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
9472    }
9473    if let Some(ref apikey) = configuration.api_key {
9474        let key = apikey.key.clone();
9475        let value = match apikey.prefix {
9476            Some(ref prefix) => format!("{} {}", prefix, key),
9477            None => key,
9478        };
9479        req_builder = req_builder.header("Authorization", value);
9480    };
9481
9482    let req = req_builder.build()?;
9483    let resp = configuration.client.execute(req).await?;
9484
9485    let status = resp.status();
9486    let content_type = resp
9487        .headers()
9488        .get("content-type")
9489        .and_then(|v| v.to_str().ok())
9490        .unwrap_or("application/octet-stream");
9491    let content_type = super::ContentType::from(content_type);
9492
9493    if !status.is_client_error() && !status.is_server_error() {
9494        let content = resp.text().await?;
9495        match content_type {
9496            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
9497            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ActionResponse`"))),
9498            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ActionResponse`")))),
9499        }
9500    } else {
9501        let content = resp.text().await?;
9502        let entity: Option<RetrieveActionWithIdError> = serde_json::from_str(&content).ok();
9503        Err(Error::ResponseError(ResponseContent { status, content, entity }))
9504    }
9505}
9506
9507/// Retrieves an authentication API key for the given id
9508pub async fn retrieve_api_key_with_id(configuration: &configuration::Configuration, key_id: &str) -> Result<models::ApiKeyResponse, Error<RetrieveApiKeyWithIdError>> {
9509    // add a prefix to parameters to efficiently prevent name collisions
9510    let p_key_id = key_id;
9511
9512    let uri_str = format!("{}/api/api-key/{keyId}", configuration.base_path, keyId=crate::apis::urlencode(p_key_id));
9513    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
9514
9515    if let Some(ref user_agent) = configuration.user_agent {
9516        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
9517    }
9518    if let Some(ref apikey) = configuration.api_key {
9519        let key = apikey.key.clone();
9520        let value = match apikey.prefix {
9521            Some(ref prefix) => format!("{} {}", prefix, key),
9522            None => key,
9523        };
9524        req_builder = req_builder.header("Authorization", value);
9525    };
9526
9527    let req = req_builder.build()?;
9528    let resp = configuration.client.execute(req).await?;
9529
9530    let status = resp.status();
9531    let content_type = resp
9532        .headers()
9533        .get("content-type")
9534        .and_then(|v| v.to_str().ok())
9535        .unwrap_or("application/octet-stream");
9536    let content_type = super::ContentType::from(content_type);
9537
9538    if !status.is_client_error() && !status.is_server_error() {
9539        let content = resp.text().await?;
9540        match content_type {
9541            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
9542            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ApiKeyResponse`"))),
9543            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ApiKeyResponse`")))),
9544        }
9545    } else {
9546        let content = resp.text().await?;
9547        let entity: Option<RetrieveApiKeyWithIdError> = serde_json::from_str(&content).ok();
9548        Err(Error::ResponseError(ResponseContent { status, content, entity }))
9549    }
9550}
9551
9552/// Retrieves the application for the given Id or all the applications if the Id is null. OR Retrieves all the applications that are currently inactive.
9553pub async fn retrieve_application(configuration: &configuration::Configuration, x_fusion_auth_tenant_id: Option<&str>, inactive: Option<&str>) -> Result<models::ApplicationResponse, Error<RetrieveApplicationError>> {
9554    // add a prefix to parameters to efficiently prevent name collisions
9555    let p_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
9556    let p_inactive = inactive;
9557
9558    let uri_str = format!("{}/api/application", configuration.base_path);
9559    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
9560
9561    if let Some(ref param_value) = p_inactive {
9562        req_builder = req_builder.query(&[("inactive", &param_value.to_string())]);
9563    }
9564    if let Some(ref user_agent) = configuration.user_agent {
9565        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
9566    }
9567    if let Some(param_value) = p_x_fusion_auth_tenant_id {
9568        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
9569    }
9570    if let Some(ref apikey) = configuration.api_key {
9571        let key = apikey.key.clone();
9572        let value = match apikey.prefix {
9573            Some(ref prefix) => format!("{} {}", prefix, key),
9574            None => key,
9575        };
9576        req_builder = req_builder.header("Authorization", value);
9577    };
9578
9579    let req = req_builder.build()?;
9580    let resp = configuration.client.execute(req).await?;
9581
9582    let status = resp.status();
9583    let content_type = resp
9584        .headers()
9585        .get("content-type")
9586        .and_then(|v| v.to_str().ok())
9587        .unwrap_or("application/octet-stream");
9588    let content_type = super::ContentType::from(content_type);
9589
9590    if !status.is_client_error() && !status.is_server_error() {
9591        let content = resp.text().await?;
9592        match content_type {
9593            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
9594            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ApplicationResponse`"))),
9595            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ApplicationResponse`")))),
9596        }
9597    } else {
9598        let content = resp.text().await?;
9599        let entity: Option<RetrieveApplicationError> = serde_json::from_str(&content).ok();
9600        Err(Error::ResponseError(ResponseContent { status, content, entity }))
9601    }
9602}
9603
9604/// Retrieves the application for the given Id or all the applications if the Id is null.
9605pub async fn retrieve_application_with_id(configuration: &configuration::Configuration, application_id: &str, x_fusion_auth_tenant_id: Option<&str>) -> Result<models::ApplicationResponse, Error<RetrieveApplicationWithIdError>> {
9606    // add a prefix to parameters to efficiently prevent name collisions
9607    let p_application_id = application_id;
9608    let p_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
9609
9610    let uri_str = format!("{}/api/application/{applicationId}", configuration.base_path, applicationId=crate::apis::urlencode(p_application_id));
9611    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
9612
9613    if let Some(ref user_agent) = configuration.user_agent {
9614        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
9615    }
9616    if let Some(param_value) = p_x_fusion_auth_tenant_id {
9617        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
9618    }
9619    if let Some(ref apikey) = configuration.api_key {
9620        let key = apikey.key.clone();
9621        let value = match apikey.prefix {
9622            Some(ref prefix) => format!("{} {}", prefix, key),
9623            None => key,
9624        };
9625        req_builder = req_builder.header("Authorization", value);
9626    };
9627
9628    let req = req_builder.build()?;
9629    let resp = configuration.client.execute(req).await?;
9630
9631    let status = resp.status();
9632    let content_type = resp
9633        .headers()
9634        .get("content-type")
9635        .and_then(|v| v.to_str().ok())
9636        .unwrap_or("application/octet-stream");
9637    let content_type = super::ContentType::from(content_type);
9638
9639    if !status.is_client_error() && !status.is_server_error() {
9640        let content = resp.text().await?;
9641        match content_type {
9642            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
9643            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ApplicationResponse`"))),
9644            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ApplicationResponse`")))),
9645        }
9646    } else {
9647        let content = resp.text().await?;
9648        let entity: Option<RetrieveApplicationWithIdError> = serde_json::from_str(&content).ok();
9649        Err(Error::ResponseError(ResponseContent { status, content, entity }))
9650    }
9651}
9652
9653/// Retrieves a single audit log for the given Id.
9654pub async fn retrieve_audit_log_with_id(configuration: &configuration::Configuration, audit_log_id: &str) -> Result<models::AuditLogResponse, Error<RetrieveAuditLogWithIdError>> {
9655    // add a prefix to parameters to efficiently prevent name collisions
9656    let p_audit_log_id = audit_log_id;
9657
9658    let uri_str = format!("{}/api/system/audit-log/{auditLogId}", configuration.base_path, auditLogId=crate::apis::urlencode(p_audit_log_id));
9659    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
9660
9661    if let Some(ref user_agent) = configuration.user_agent {
9662        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
9663    }
9664    if let Some(ref apikey) = configuration.api_key {
9665        let key = apikey.key.clone();
9666        let value = match apikey.prefix {
9667            Some(ref prefix) => format!("{} {}", prefix, key),
9668            None => key,
9669        };
9670        req_builder = req_builder.header("Authorization", value);
9671    };
9672
9673    let req = req_builder.build()?;
9674    let resp = configuration.client.execute(req).await?;
9675
9676    let status = resp.status();
9677    let content_type = resp
9678        .headers()
9679        .get("content-type")
9680        .and_then(|v| v.to_str().ok())
9681        .unwrap_or("application/octet-stream");
9682    let content_type = super::ContentType::from(content_type);
9683
9684    if !status.is_client_error() && !status.is_server_error() {
9685        let content = resp.text().await?;
9686        match content_type {
9687            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
9688            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::AuditLogResponse`"))),
9689            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::AuditLogResponse`")))),
9690        }
9691    } else {
9692        let content = resp.text().await?;
9693        let entity: Option<RetrieveAuditLogWithIdError> = serde_json::from_str(&content).ok();
9694        Err(Error::ResponseError(ResponseContent { status, content, entity }))
9695    }
9696}
9697
9698/// Retrieves the connector with the given Id.
9699pub async fn retrieve_connector_with_id(configuration: &configuration::Configuration, connector_id: &str) -> Result<models::ConnectorResponse, Error<RetrieveConnectorWithIdError>> {
9700    // add a prefix to parameters to efficiently prevent name collisions
9701    let p_connector_id = connector_id;
9702
9703    let uri_str = format!("{}/api/connector/{connectorId}", configuration.base_path, connectorId=crate::apis::urlencode(p_connector_id));
9704    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
9705
9706    if let Some(ref user_agent) = configuration.user_agent {
9707        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
9708    }
9709    if let Some(ref apikey) = configuration.api_key {
9710        let key = apikey.key.clone();
9711        let value = match apikey.prefix {
9712            Some(ref prefix) => format!("{} {}", prefix, key),
9713            None => key,
9714        };
9715        req_builder = req_builder.header("Authorization", value);
9716    };
9717
9718    let req = req_builder.build()?;
9719    let resp = configuration.client.execute(req).await?;
9720
9721    let status = resp.status();
9722    let content_type = resp
9723        .headers()
9724        .get("content-type")
9725        .and_then(|v| v.to_str().ok())
9726        .unwrap_or("application/octet-stream");
9727    let content_type = super::ContentType::from(content_type);
9728
9729    if !status.is_client_error() && !status.is_server_error() {
9730        let content = resp.text().await?;
9731        match content_type {
9732            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
9733            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ConnectorResponse`"))),
9734            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ConnectorResponse`")))),
9735        }
9736    } else {
9737        let content = resp.text().await?;
9738        let entity: Option<RetrieveConnectorWithIdError> = serde_json::from_str(&content).ok();
9739        Err(Error::ResponseError(ResponseContent { status, content, entity }))
9740    }
9741}
9742
9743/// Retrieves the Consent for the given Id.
9744pub async fn retrieve_consent_with_id(configuration: &configuration::Configuration, consent_id: &str, x_fusion_auth_tenant_id: Option<&str>) -> Result<models::ConsentResponse, Error<RetrieveConsentWithIdError>> {
9745    // add a prefix to parameters to efficiently prevent name collisions
9746    let p_consent_id = consent_id;
9747    let p_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
9748
9749    let uri_str = format!("{}/api/consent/{consentId}", configuration.base_path, consentId=crate::apis::urlencode(p_consent_id));
9750    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
9751
9752    if let Some(ref user_agent) = configuration.user_agent {
9753        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
9754    }
9755    if let Some(param_value) = p_x_fusion_auth_tenant_id {
9756        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
9757    }
9758    if let Some(ref apikey) = configuration.api_key {
9759        let key = apikey.key.clone();
9760        let value = match apikey.prefix {
9761            Some(ref prefix) => format!("{} {}", prefix, key),
9762            None => key,
9763        };
9764        req_builder = req_builder.header("Authorization", value);
9765    };
9766
9767    let req = req_builder.build()?;
9768    let resp = configuration.client.execute(req).await?;
9769
9770    let status = resp.status();
9771    let content_type = resp
9772        .headers()
9773        .get("content-type")
9774        .and_then(|v| v.to_str().ok())
9775        .unwrap_or("application/octet-stream");
9776    let content_type = super::ContentType::from(content_type);
9777
9778    if !status.is_client_error() && !status.is_server_error() {
9779        let content = resp.text().await?;
9780        match content_type {
9781            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
9782            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ConsentResponse`"))),
9783            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ConsentResponse`")))),
9784        }
9785    } else {
9786        let content = resp.text().await?;
9787        let entity: Option<RetrieveConsentWithIdError> = serde_json::from_str(&content).ok();
9788        Err(Error::ResponseError(ResponseContent { status, content, entity }))
9789    }
9790}
9791
9792/// Retrieves the daily active user report between the two instants. If you specify an application id, it will only return the daily active counts for that application.
9793pub async fn retrieve_daily_active_report_with_id(configuration: &configuration::Configuration, application_id: Option<&str>, start: Option<&str>, end: Option<&str>) -> Result<models::DailyActiveUserReportResponse, Error<RetrieveDailyActiveReportWithIdError>> {
9794    // add a prefix to parameters to efficiently prevent name collisions
9795    let p_application_id = application_id;
9796    let p_start = start;
9797    let p_end = end;
9798
9799    let uri_str = format!("{}/api/report/daily-active-user", configuration.base_path);
9800    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
9801
9802    if let Some(ref param_value) = p_application_id {
9803        req_builder = req_builder.query(&[("applicationId", &param_value.to_string())]);
9804    }
9805    if let Some(ref param_value) = p_start {
9806        req_builder = req_builder.query(&[("start", &param_value.to_string())]);
9807    }
9808    if let Some(ref param_value) = p_end {
9809        req_builder = req_builder.query(&[("end", &param_value.to_string())]);
9810    }
9811    if let Some(ref user_agent) = configuration.user_agent {
9812        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
9813    }
9814    if let Some(ref apikey) = configuration.api_key {
9815        let key = apikey.key.clone();
9816        let value = match apikey.prefix {
9817            Some(ref prefix) => format!("{} {}", prefix, key),
9818            None => key,
9819        };
9820        req_builder = req_builder.header("Authorization", value);
9821    };
9822
9823    let req = req_builder.build()?;
9824    let resp = configuration.client.execute(req).await?;
9825
9826    let status = resp.status();
9827    let content_type = resp
9828        .headers()
9829        .get("content-type")
9830        .and_then(|v| v.to_str().ok())
9831        .unwrap_or("application/octet-stream");
9832    let content_type = super::ContentType::from(content_type);
9833
9834    if !status.is_client_error() && !status.is_server_error() {
9835        let content = resp.text().await?;
9836        match content_type {
9837            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
9838            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::DailyActiveUserReportResponse`"))),
9839            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::DailyActiveUserReportResponse`")))),
9840        }
9841    } else {
9842        let content = resp.text().await?;
9843        let entity: Option<RetrieveDailyActiveReportWithIdError> = serde_json::from_str(&content).ok();
9844        Err(Error::ResponseError(ResponseContent { status, content, entity }))
9845    }
9846}
9847
9848/// Retrieve a user_code that is part of an in-progress Device Authorization Grant.  This API is useful if you want to build your own login workflow to complete a device grant.  This request will require an API key. OR Retrieve a user_code that is part of an in-progress Device Authorization Grant.  This API is useful if you want to build your own login workflow to complete a device grant.
9849pub async fn retrieve_device_user_code(configuration: &configuration::Configuration, ) -> Result<(), Error<RetrieveDeviceUserCodeError>> {
9850
9851    let uri_str = format!("{}/oauth2/device/user-code", configuration.base_path);
9852    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
9853
9854    if let Some(ref user_agent) = configuration.user_agent {
9855        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
9856    }
9857    if let Some(ref apikey) = configuration.api_key {
9858        let key = apikey.key.clone();
9859        let value = match apikey.prefix {
9860            Some(ref prefix) => format!("{} {}", prefix, key),
9861            None => key,
9862        };
9863        req_builder = req_builder.header("Authorization", value);
9864    };
9865
9866    let req = req_builder.build()?;
9867    let resp = configuration.client.execute(req).await?;
9868
9869    let status = resp.status();
9870
9871    if !status.is_client_error() && !status.is_server_error() {
9872        Ok(())
9873    } else {
9874        let content = resp.text().await?;
9875        let entity: Option<RetrieveDeviceUserCodeError> = serde_json::from_str(&content).ok();
9876        Err(Error::ResponseError(ResponseContent { status, content, entity }))
9877    }
9878}
9879
9880/// Retrieves the email template for the given Id. If you don't specify the id, this will return all the email templates.
9881pub async fn retrieve_email_template(configuration: &configuration::Configuration, x_fusion_auth_tenant_id: Option<&str>) -> Result<models::EmailTemplateResponse, Error<RetrieveEmailTemplateError>> {
9882    // add a prefix to parameters to efficiently prevent name collisions
9883    let p_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
9884
9885    let uri_str = format!("{}/api/email/template", configuration.base_path);
9886    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
9887
9888    if let Some(ref user_agent) = configuration.user_agent {
9889        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
9890    }
9891    if let Some(param_value) = p_x_fusion_auth_tenant_id {
9892        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
9893    }
9894    if let Some(ref apikey) = configuration.api_key {
9895        let key = apikey.key.clone();
9896        let value = match apikey.prefix {
9897            Some(ref prefix) => format!("{} {}", prefix, key),
9898            None => key,
9899        };
9900        req_builder = req_builder.header("Authorization", value);
9901    };
9902
9903    let req = req_builder.build()?;
9904    let resp = configuration.client.execute(req).await?;
9905
9906    let status = resp.status();
9907    let content_type = resp
9908        .headers()
9909        .get("content-type")
9910        .and_then(|v| v.to_str().ok())
9911        .unwrap_or("application/octet-stream");
9912    let content_type = super::ContentType::from(content_type);
9913
9914    if !status.is_client_error() && !status.is_server_error() {
9915        let content = resp.text().await?;
9916        match content_type {
9917            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
9918            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::EmailTemplateResponse`"))),
9919            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::EmailTemplateResponse`")))),
9920        }
9921    } else {
9922        let content = resp.text().await?;
9923        let entity: Option<RetrieveEmailTemplateError> = serde_json::from_str(&content).ok();
9924        Err(Error::ResponseError(ResponseContent { status, content, entity }))
9925    }
9926}
9927
9928/// Creates a preview of the email template provided in the request. This allows you to preview an email template that hasn't been saved to the database yet. The entire email template does not need to be provided on the request. This will create the preview based on whatever is given.
9929pub async fn retrieve_email_template_preview_with_id(configuration: &configuration::Configuration, preview_request: Option<models::PreviewRequest>) -> Result<models::PreviewResponse, Error<RetrieveEmailTemplatePreviewWithIdError>> {
9930    // add a prefix to parameters to efficiently prevent name collisions
9931    let p_preview_request = preview_request;
9932
9933    let uri_str = format!("{}/api/email/template/preview", configuration.base_path);
9934    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
9935
9936    if let Some(ref user_agent) = configuration.user_agent {
9937        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
9938    }
9939    if let Some(ref apikey) = configuration.api_key {
9940        let key = apikey.key.clone();
9941        let value = match apikey.prefix {
9942            Some(ref prefix) => format!("{} {}", prefix, key),
9943            None => key,
9944        };
9945        req_builder = req_builder.header("Authorization", value);
9946    };
9947    req_builder = req_builder.json(&p_preview_request);
9948
9949    let req = req_builder.build()?;
9950    let resp = configuration.client.execute(req).await?;
9951
9952    let status = resp.status();
9953    let content_type = resp
9954        .headers()
9955        .get("content-type")
9956        .and_then(|v| v.to_str().ok())
9957        .unwrap_or("application/octet-stream");
9958    let content_type = super::ContentType::from(content_type);
9959
9960    if !status.is_client_error() && !status.is_server_error() {
9961        let content = resp.text().await?;
9962        match content_type {
9963            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
9964            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PreviewResponse`"))),
9965            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::PreviewResponse`")))),
9966        }
9967    } else {
9968        let content = resp.text().await?;
9969        let entity: Option<RetrieveEmailTemplatePreviewWithIdError> = serde_json::from_str(&content).ok();
9970        Err(Error::ResponseError(ResponseContent { status, content, entity }))
9971    }
9972}
9973
9974/// Retrieves the email template for the given Id. If you don't specify the id, this will return all the email templates.
9975pub async fn retrieve_email_template_with_id(configuration: &configuration::Configuration, email_template_id: &str, x_fusion_auth_tenant_id: Option<&str>) -> Result<models::EmailTemplateResponse, Error<RetrieveEmailTemplateWithIdError>> {
9976    // add a prefix to parameters to efficiently prevent name collisions
9977    let p_email_template_id = email_template_id;
9978    let p_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
9979
9980    let uri_str = format!("{}/api/email/template/{emailTemplateId}", configuration.base_path, emailTemplateId=crate::apis::urlencode(p_email_template_id));
9981    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
9982
9983    if let Some(ref user_agent) = configuration.user_agent {
9984        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
9985    }
9986    if let Some(param_value) = p_x_fusion_auth_tenant_id {
9987        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
9988    }
9989    if let Some(ref apikey) = configuration.api_key {
9990        let key = apikey.key.clone();
9991        let value = match apikey.prefix {
9992            Some(ref prefix) => format!("{} {}", prefix, key),
9993            None => key,
9994        };
9995        req_builder = req_builder.header("Authorization", value);
9996    };
9997
9998    let req = req_builder.build()?;
9999    let resp = configuration.client.execute(req).await?;
10000
10001    let status = resp.status();
10002    let content_type = resp
10003        .headers()
10004        .get("content-type")
10005        .and_then(|v| v.to_str().ok())
10006        .unwrap_or("application/octet-stream");
10007    let content_type = super::ContentType::from(content_type);
10008
10009    if !status.is_client_error() && !status.is_server_error() {
10010        let content = resp.text().await?;
10011        match content_type {
10012            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
10013            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::EmailTemplateResponse`"))),
10014            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::EmailTemplateResponse`")))),
10015        }
10016    } else {
10017        let content = resp.text().await?;
10018        let entity: Option<RetrieveEmailTemplateWithIdError> = serde_json::from_str(&content).ok();
10019        Err(Error::ResponseError(ResponseContent { status, content, entity }))
10020    }
10021}
10022
10023/// Retrieves an Entity Grant for the given Entity and User/Entity.
10024pub async fn retrieve_entity_grant_with_id(configuration: &configuration::Configuration, entity_id: &str, recipient_entity_id: Option<&str>, user_id: Option<&str>, x_fusion_auth_tenant_id: Option<&str>) -> Result<models::EntityGrantResponse, Error<RetrieveEntityGrantWithIdError>> {
10025    // add a prefix to parameters to efficiently prevent name collisions
10026    let p_entity_id = entity_id;
10027    let p_recipient_entity_id = recipient_entity_id;
10028    let p_user_id = user_id;
10029    let p_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
10030
10031    let uri_str = format!("{}/api/entity/{entityId}/grant", configuration.base_path, entityId=crate::apis::urlencode(p_entity_id));
10032    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
10033
10034    if let Some(ref param_value) = p_recipient_entity_id {
10035        req_builder = req_builder.query(&[("recipientEntityId", &param_value.to_string())]);
10036    }
10037    if let Some(ref param_value) = p_user_id {
10038        req_builder = req_builder.query(&[("userId", &param_value.to_string())]);
10039    }
10040    if let Some(ref user_agent) = configuration.user_agent {
10041        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
10042    }
10043    if let Some(param_value) = p_x_fusion_auth_tenant_id {
10044        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
10045    }
10046    if let Some(ref apikey) = configuration.api_key {
10047        let key = apikey.key.clone();
10048        let value = match apikey.prefix {
10049            Some(ref prefix) => format!("{} {}", prefix, key),
10050            None => key,
10051        };
10052        req_builder = req_builder.header("Authorization", value);
10053    };
10054
10055    let req = req_builder.build()?;
10056    let resp = configuration.client.execute(req).await?;
10057
10058    let status = resp.status();
10059    let content_type = resp
10060        .headers()
10061        .get("content-type")
10062        .and_then(|v| v.to_str().ok())
10063        .unwrap_or("application/octet-stream");
10064    let content_type = super::ContentType::from(content_type);
10065
10066    if !status.is_client_error() && !status.is_server_error() {
10067        let content = resp.text().await?;
10068        match content_type {
10069            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
10070            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::EntityGrantResponse`"))),
10071            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::EntityGrantResponse`")))),
10072        }
10073    } else {
10074        let content = resp.text().await?;
10075        let entity: Option<RetrieveEntityGrantWithIdError> = serde_json::from_str(&content).ok();
10076        Err(Error::ResponseError(ResponseContent { status, content, entity }))
10077    }
10078}
10079
10080/// Retrieves the Entity Type for the given Id.
10081pub async fn retrieve_entity_type_with_id(configuration: &configuration::Configuration, entity_type_id: &str) -> Result<models::EntityTypeResponse, Error<RetrieveEntityTypeWithIdError>> {
10082    // add a prefix to parameters to efficiently prevent name collisions
10083    let p_entity_type_id = entity_type_id;
10084
10085    let uri_str = format!("{}/api/entity/type/{entityTypeId}", configuration.base_path, entityTypeId=crate::apis::urlencode(p_entity_type_id));
10086    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
10087
10088    if let Some(ref user_agent) = configuration.user_agent {
10089        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
10090    }
10091    if let Some(ref apikey) = configuration.api_key {
10092        let key = apikey.key.clone();
10093        let value = match apikey.prefix {
10094            Some(ref prefix) => format!("{} {}", prefix, key),
10095            None => key,
10096        };
10097        req_builder = req_builder.header("Authorization", value);
10098    };
10099
10100    let req = req_builder.build()?;
10101    let resp = configuration.client.execute(req).await?;
10102
10103    let status = resp.status();
10104    let content_type = resp
10105        .headers()
10106        .get("content-type")
10107        .and_then(|v| v.to_str().ok())
10108        .unwrap_or("application/octet-stream");
10109    let content_type = super::ContentType::from(content_type);
10110
10111    if !status.is_client_error() && !status.is_server_error() {
10112        let content = resp.text().await?;
10113        match content_type {
10114            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
10115            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::EntityTypeResponse`"))),
10116            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::EntityTypeResponse`")))),
10117        }
10118    } else {
10119        let content = resp.text().await?;
10120        let entity: Option<RetrieveEntityTypeWithIdError> = serde_json::from_str(&content).ok();
10121        Err(Error::ResponseError(ResponseContent { status, content, entity }))
10122    }
10123}
10124
10125/// Retrieves the Entity for the given Id.
10126pub async fn retrieve_entity_with_id(configuration: &configuration::Configuration, entity_id: &str, x_fusion_auth_tenant_id: Option<&str>) -> Result<models::EntityResponse, Error<RetrieveEntityWithIdError>> {
10127    // add a prefix to parameters to efficiently prevent name collisions
10128    let p_entity_id = entity_id;
10129    let p_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
10130
10131    let uri_str = format!("{}/api/entity/{entityId}", configuration.base_path, entityId=crate::apis::urlencode(p_entity_id));
10132    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
10133
10134    if let Some(ref user_agent) = configuration.user_agent {
10135        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
10136    }
10137    if let Some(param_value) = p_x_fusion_auth_tenant_id {
10138        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
10139    }
10140    if let Some(ref apikey) = configuration.api_key {
10141        let key = apikey.key.clone();
10142        let value = match apikey.prefix {
10143            Some(ref prefix) => format!("{} {}", prefix, key),
10144            None => key,
10145        };
10146        req_builder = req_builder.header("Authorization", value);
10147    };
10148
10149    let req = req_builder.build()?;
10150    let resp = configuration.client.execute(req).await?;
10151
10152    let status = resp.status();
10153    let content_type = resp
10154        .headers()
10155        .get("content-type")
10156        .and_then(|v| v.to_str().ok())
10157        .unwrap_or("application/octet-stream");
10158    let content_type = super::ContentType::from(content_type);
10159
10160    if !status.is_client_error() && !status.is_server_error() {
10161        let content = resp.text().await?;
10162        match content_type {
10163            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
10164            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::EntityResponse`"))),
10165            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::EntityResponse`")))),
10166        }
10167    } else {
10168        let content = resp.text().await?;
10169        let entity: Option<RetrieveEntityWithIdError> = serde_json::from_str(&content).ok();
10170        Err(Error::ResponseError(ResponseContent { status, content, entity }))
10171    }
10172}
10173
10174/// Retrieves a single event log for the given Id.
10175pub async fn retrieve_event_log_with_id(configuration: &configuration::Configuration, event_log_id: &str) -> Result<models::EventLogResponse, Error<RetrieveEventLogWithIdError>> {
10176    // add a prefix to parameters to efficiently prevent name collisions
10177    let p_event_log_id = event_log_id;
10178
10179    let uri_str = format!("{}/api/system/event-log/{eventLogId}", configuration.base_path, eventLogId=crate::apis::urlencode(p_event_log_id));
10180    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
10181
10182    if let Some(ref user_agent) = configuration.user_agent {
10183        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
10184    }
10185    if let Some(ref apikey) = configuration.api_key {
10186        let key = apikey.key.clone();
10187        let value = match apikey.prefix {
10188            Some(ref prefix) => format!("{} {}", prefix, key),
10189            None => key,
10190        };
10191        req_builder = req_builder.header("Authorization", value);
10192    };
10193
10194    let req = req_builder.build()?;
10195    let resp = configuration.client.execute(req).await?;
10196
10197    let status = resp.status();
10198    let content_type = resp
10199        .headers()
10200        .get("content-type")
10201        .and_then(|v| v.to_str().ok())
10202        .unwrap_or("application/octet-stream");
10203    let content_type = super::ContentType::from(content_type);
10204
10205    if !status.is_client_error() && !status.is_server_error() {
10206        let content = resp.text().await?;
10207        match content_type {
10208            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
10209            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::EventLogResponse`"))),
10210            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::EventLogResponse`")))),
10211        }
10212    } else {
10213        let content = resp.text().await?;
10214        let entity: Option<RetrieveEventLogWithIdError> = serde_json::from_str(&content).ok();
10215        Err(Error::ResponseError(ResponseContent { status, content, entity }))
10216    }
10217}
10218
10219/// Retrieves all the families that a user belongs to.
10220pub async fn retrieve_families_with_id(configuration: &configuration::Configuration, user_id: Option<&str>, x_fusion_auth_tenant_id: Option<&str>) -> Result<models::FamilyResponse, Error<RetrieveFamiliesWithIdError>> {
10221    // add a prefix to parameters to efficiently prevent name collisions
10222    let p_user_id = user_id;
10223    let p_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
10224
10225    let uri_str = format!("{}/api/user/family", configuration.base_path);
10226    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
10227
10228    if let Some(ref param_value) = p_user_id {
10229        req_builder = req_builder.query(&[("userId", &param_value.to_string())]);
10230    }
10231    if let Some(ref user_agent) = configuration.user_agent {
10232        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
10233    }
10234    if let Some(param_value) = p_x_fusion_auth_tenant_id {
10235        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
10236    }
10237    if let Some(ref apikey) = configuration.api_key {
10238        let key = apikey.key.clone();
10239        let value = match apikey.prefix {
10240            Some(ref prefix) => format!("{} {}", prefix, key),
10241            None => key,
10242        };
10243        req_builder = req_builder.header("Authorization", value);
10244    };
10245
10246    let req = req_builder.build()?;
10247    let resp = configuration.client.execute(req).await?;
10248
10249    let status = resp.status();
10250    let content_type = resp
10251        .headers()
10252        .get("content-type")
10253        .and_then(|v| v.to_str().ok())
10254        .unwrap_or("application/octet-stream");
10255    let content_type = super::ContentType::from(content_type);
10256
10257    if !status.is_client_error() && !status.is_server_error() {
10258        let content = resp.text().await?;
10259        match content_type {
10260            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
10261            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::FamilyResponse`"))),
10262            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::FamilyResponse`")))),
10263        }
10264    } else {
10265        let content = resp.text().await?;
10266        let entity: Option<RetrieveFamiliesWithIdError> = serde_json::from_str(&content).ok();
10267        Err(Error::ResponseError(ResponseContent { status, content, entity }))
10268    }
10269}
10270
10271/// Retrieves all the members of a family by the unique Family Id.
10272pub async fn retrieve_family_members_by_family_id_with_id(configuration: &configuration::Configuration, family_id: &str, x_fusion_auth_tenant_id: Option<&str>) -> Result<models::FamilyResponse, Error<RetrieveFamilyMembersByFamilyIdWithIdError>> {
10273    // add a prefix to parameters to efficiently prevent name collisions
10274    let p_family_id = family_id;
10275    let p_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
10276
10277    let uri_str = format!("{}/api/user/family/{familyId}", configuration.base_path, familyId=crate::apis::urlencode(p_family_id));
10278    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
10279
10280    if let Some(ref user_agent) = configuration.user_agent {
10281        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
10282    }
10283    if let Some(param_value) = p_x_fusion_auth_tenant_id {
10284        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
10285    }
10286    if let Some(ref apikey) = configuration.api_key {
10287        let key = apikey.key.clone();
10288        let value = match apikey.prefix {
10289            Some(ref prefix) => format!("{} {}", prefix, key),
10290            None => key,
10291        };
10292        req_builder = req_builder.header("Authorization", value);
10293    };
10294
10295    let req = req_builder.build()?;
10296    let resp = configuration.client.execute(req).await?;
10297
10298    let status = resp.status();
10299    let content_type = resp
10300        .headers()
10301        .get("content-type")
10302        .and_then(|v| v.to_str().ok())
10303        .unwrap_or("application/octet-stream");
10304    let content_type = super::ContentType::from(content_type);
10305
10306    if !status.is_client_error() && !status.is_server_error() {
10307        let content = resp.text().await?;
10308        match content_type {
10309            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
10310            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::FamilyResponse`"))),
10311            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::FamilyResponse`")))),
10312        }
10313    } else {
10314        let content = resp.text().await?;
10315        let entity: Option<RetrieveFamilyMembersByFamilyIdWithIdError> = serde_json::from_str(&content).ok();
10316        Err(Error::ResponseError(ResponseContent { status, content, entity }))
10317    }
10318}
10319
10320/// Retrieves the form field with the given Id.
10321pub async fn retrieve_form_field_with_id(configuration: &configuration::Configuration, field_id: &str) -> Result<models::FormFieldResponse, Error<RetrieveFormFieldWithIdError>> {
10322    // add a prefix to parameters to efficiently prevent name collisions
10323    let p_field_id = field_id;
10324
10325    let uri_str = format!("{}/api/form/field/{fieldId}", configuration.base_path, fieldId=crate::apis::urlencode(p_field_id));
10326    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
10327
10328    if let Some(ref user_agent) = configuration.user_agent {
10329        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
10330    }
10331    if let Some(ref apikey) = configuration.api_key {
10332        let key = apikey.key.clone();
10333        let value = match apikey.prefix {
10334            Some(ref prefix) => format!("{} {}", prefix, key),
10335            None => key,
10336        };
10337        req_builder = req_builder.header("Authorization", value);
10338    };
10339
10340    let req = req_builder.build()?;
10341    let resp = configuration.client.execute(req).await?;
10342
10343    let status = resp.status();
10344    let content_type = resp
10345        .headers()
10346        .get("content-type")
10347        .and_then(|v| v.to_str().ok())
10348        .unwrap_or("application/octet-stream");
10349    let content_type = super::ContentType::from(content_type);
10350
10351    if !status.is_client_error() && !status.is_server_error() {
10352        let content = resp.text().await?;
10353        match content_type {
10354            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
10355            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::FormFieldResponse`"))),
10356            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::FormFieldResponse`")))),
10357        }
10358    } else {
10359        let content = resp.text().await?;
10360        let entity: Option<RetrieveFormFieldWithIdError> = serde_json::from_str(&content).ok();
10361        Err(Error::ResponseError(ResponseContent { status, content, entity }))
10362    }
10363}
10364
10365/// Retrieves the form with the given Id.
10366pub async fn retrieve_form_with_id(configuration: &configuration::Configuration, form_id: &str) -> Result<models::FormResponse, Error<RetrieveFormWithIdError>> {
10367    // add a prefix to parameters to efficiently prevent name collisions
10368    let p_form_id = form_id;
10369
10370    let uri_str = format!("{}/api/form/{formId}", configuration.base_path, formId=crate::apis::urlencode(p_form_id));
10371    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
10372
10373    if let Some(ref user_agent) = configuration.user_agent {
10374        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
10375    }
10376    if let Some(ref apikey) = configuration.api_key {
10377        let key = apikey.key.clone();
10378        let value = match apikey.prefix {
10379            Some(ref prefix) => format!("{} {}", prefix, key),
10380            None => key,
10381        };
10382        req_builder = req_builder.header("Authorization", value);
10383    };
10384
10385    let req = req_builder.build()?;
10386    let resp = configuration.client.execute(req).await?;
10387
10388    let status = resp.status();
10389    let content_type = resp
10390        .headers()
10391        .get("content-type")
10392        .and_then(|v| v.to_str().ok())
10393        .unwrap_or("application/octet-stream");
10394    let content_type = super::ContentType::from(content_type);
10395
10396    if !status.is_client_error() && !status.is_server_error() {
10397        let content = resp.text().await?;
10398        match content_type {
10399            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
10400            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::FormResponse`"))),
10401            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::FormResponse`")))),
10402        }
10403    } else {
10404        let content = resp.text().await?;
10405        let entity: Option<RetrieveFormWithIdError> = serde_json::from_str(&content).ok();
10406        Err(Error::ResponseError(ResponseContent { status, content, entity }))
10407    }
10408}
10409
10410/// Retrieves the group for the given Id.
10411pub async fn retrieve_group_with_id(configuration: &configuration::Configuration, group_id: &str, x_fusion_auth_tenant_id: Option<&str>) -> Result<models::GroupResponse, Error<RetrieveGroupWithIdError>> {
10412    // add a prefix to parameters to efficiently prevent name collisions
10413    let p_group_id = group_id;
10414    let p_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
10415
10416    let uri_str = format!("{}/api/group/{groupId}", configuration.base_path, groupId=crate::apis::urlencode(p_group_id));
10417    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
10418
10419    if let Some(ref user_agent) = configuration.user_agent {
10420        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
10421    }
10422    if let Some(param_value) = p_x_fusion_auth_tenant_id {
10423        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
10424    }
10425    if let Some(ref apikey) = configuration.api_key {
10426        let key = apikey.key.clone();
10427        let value = match apikey.prefix {
10428            Some(ref prefix) => format!("{} {}", prefix, key),
10429            None => key,
10430        };
10431        req_builder = req_builder.header("Authorization", value);
10432    };
10433
10434    let req = req_builder.build()?;
10435    let resp = configuration.client.execute(req).await?;
10436
10437    let status = resp.status();
10438    let content_type = resp
10439        .headers()
10440        .get("content-type")
10441        .and_then(|v| v.to_str().ok())
10442        .unwrap_or("application/octet-stream");
10443    let content_type = super::ContentType::from(content_type);
10444
10445    if !status.is_client_error() && !status.is_server_error() {
10446        let content = resp.text().await?;
10447        match content_type {
10448            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
10449            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GroupResponse`"))),
10450            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GroupResponse`")))),
10451        }
10452    } else {
10453        let content = resp.text().await?;
10454        let entity: Option<RetrieveGroupWithIdError> = serde_json::from_str(&content).ok();
10455        Err(Error::ResponseError(ResponseContent { status, content, entity }))
10456    }
10457}
10458
10459/// Retrieves one or more identity provider for the given type. For types such as Google, Facebook, Twitter and LinkedIn, only a single  identity provider can exist. For types such as OpenID Connect and SAMLv2 more than one identity provider can be configured so this request  may return multiple identity providers.
10460pub async fn retrieve_identity_provider_by_type_with_id(configuration: &configuration::Configuration, r#type: Option<&str>) -> Result<models::IdentityProviderResponse, Error<RetrieveIdentityProviderByTypeWithIdError>> {
10461    // add a prefix to parameters to efficiently prevent name collisions
10462    let p_type = r#type;
10463
10464    let uri_str = format!("{}/api/identity-provider", configuration.base_path);
10465    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
10466
10467    if let Some(ref param_value) = p_type {
10468        req_builder = req_builder.query(&[("type", &param_value.to_string())]);
10469    }
10470    if let Some(ref user_agent) = configuration.user_agent {
10471        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
10472    }
10473    if let Some(ref apikey) = configuration.api_key {
10474        let key = apikey.key.clone();
10475        let value = match apikey.prefix {
10476            Some(ref prefix) => format!("{} {}", prefix, key),
10477            None => key,
10478        };
10479        req_builder = req_builder.header("Authorization", value);
10480    };
10481
10482    let req = req_builder.build()?;
10483    let resp = configuration.client.execute(req).await?;
10484
10485    let status = resp.status();
10486    let content_type = resp
10487        .headers()
10488        .get("content-type")
10489        .and_then(|v| v.to_str().ok())
10490        .unwrap_or("application/octet-stream");
10491    let content_type = super::ContentType::from(content_type);
10492
10493    if !status.is_client_error() && !status.is_server_error() {
10494        let content = resp.text().await?;
10495        match content_type {
10496            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
10497            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IdentityProviderResponse`"))),
10498            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IdentityProviderResponse`")))),
10499        }
10500    } else {
10501        let content = resp.text().await?;
10502        let entity: Option<RetrieveIdentityProviderByTypeWithIdError> = serde_json::from_str(&content).ok();
10503        Err(Error::ResponseError(ResponseContent { status, content, entity }))
10504    }
10505}
10506
10507/// Retrieve a single Identity Provider user (link). OR Retrieve all Identity Provider users (links) for the user. Specify the optional identityProviderId to retrieve links for a particular IdP.
10508pub async fn retrieve_identity_provider_link(configuration: &configuration::Configuration, identity_provider_id: Option<&str>, identity_provider_user_id: Option<&str>, user_id: Option<&str>) -> Result<models::IdentityProviderLinkResponse, Error<RetrieveIdentityProviderLinkError>> {
10509    // add a prefix to parameters to efficiently prevent name collisions
10510    let p_identity_provider_id = identity_provider_id;
10511    let p_identity_provider_user_id = identity_provider_user_id;
10512    let p_user_id = user_id;
10513
10514    let uri_str = format!("{}/api/identity-provider/link", configuration.base_path);
10515    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
10516
10517    if let Some(ref param_value) = p_identity_provider_id {
10518        req_builder = req_builder.query(&[("identityProviderId", &param_value.to_string())]);
10519    }
10520    if let Some(ref param_value) = p_identity_provider_user_id {
10521        req_builder = req_builder.query(&[("identityProviderUserId", &param_value.to_string())]);
10522    }
10523    if let Some(ref param_value) = p_user_id {
10524        req_builder = req_builder.query(&[("userId", &param_value.to_string())]);
10525    }
10526    if let Some(ref user_agent) = configuration.user_agent {
10527        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
10528    }
10529    if let Some(ref apikey) = configuration.api_key {
10530        let key = apikey.key.clone();
10531        let value = match apikey.prefix {
10532            Some(ref prefix) => format!("{} {}", prefix, key),
10533            None => key,
10534        };
10535        req_builder = req_builder.header("Authorization", value);
10536    };
10537
10538    let req = req_builder.build()?;
10539    let resp = configuration.client.execute(req).await?;
10540
10541    let status = resp.status();
10542    let content_type = resp
10543        .headers()
10544        .get("content-type")
10545        .and_then(|v| v.to_str().ok())
10546        .unwrap_or("application/octet-stream");
10547    let content_type = super::ContentType::from(content_type);
10548
10549    if !status.is_client_error() && !status.is_server_error() {
10550        let content = resp.text().await?;
10551        match content_type {
10552            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
10553            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IdentityProviderLinkResponse`"))),
10554            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IdentityProviderLinkResponse`")))),
10555        }
10556    } else {
10557        let content = resp.text().await?;
10558        let entity: Option<RetrieveIdentityProviderLinkError> = serde_json::from_str(&content).ok();
10559        Err(Error::ResponseError(ResponseContent { status, content, entity }))
10560    }
10561}
10562
10563/// Retrieves the identity provider for the given Id or all the identity providers if the Id is null.
10564pub async fn retrieve_identity_provider_with_id(configuration: &configuration::Configuration, identity_provider_id: &str) -> Result<models::IdentityProviderResponse, Error<RetrieveIdentityProviderWithIdError>> {
10565    // add a prefix to parameters to efficiently prevent name collisions
10566    let p_identity_provider_id = identity_provider_id;
10567
10568    let uri_str = format!("{}/api/identity-provider/{identityProviderId}", configuration.base_path, identityProviderId=crate::apis::urlencode(p_identity_provider_id));
10569    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
10570
10571    if let Some(ref user_agent) = configuration.user_agent {
10572        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
10573    }
10574    if let Some(ref apikey) = configuration.api_key {
10575        let key = apikey.key.clone();
10576        let value = match apikey.prefix {
10577            Some(ref prefix) => format!("{} {}", prefix, key),
10578            None => key,
10579        };
10580        req_builder = req_builder.header("Authorization", value);
10581    };
10582
10583    let req = req_builder.build()?;
10584    let resp = configuration.client.execute(req).await?;
10585
10586    let status = resp.status();
10587    let content_type = resp
10588        .headers()
10589        .get("content-type")
10590        .and_then(|v| v.to_str().ok())
10591        .unwrap_or("application/octet-stream");
10592    let content_type = super::ContentType::from(content_type);
10593
10594    if !status.is_client_error() && !status.is_server_error() {
10595        let content = resp.text().await?;
10596        match content_type {
10597            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
10598            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IdentityProviderResponse`"))),
10599            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IdentityProviderResponse`")))),
10600        }
10601    } else {
10602        let content = resp.text().await?;
10603        let entity: Option<RetrieveIdentityProviderWithIdError> = serde_json::from_str(&content).ok();
10604        Err(Error::ResponseError(ResponseContent { status, content, entity }))
10605    }
10606}
10607
10608/// Retrieves the IP Access Control List with the given Id.
10609pub async fn retrieve_ip_access_control_list_with_id(configuration: &configuration::Configuration, ip_access_control_list_id: &str) -> Result<models::IpAccessControlListResponse, Error<RetrieveIpAccessControlListWithIdError>> {
10610    // add a prefix to parameters to efficiently prevent name collisions
10611    let p_ip_access_control_list_id = ip_access_control_list_id;
10612
10613    let uri_str = format!("{}/api/ip-acl/{ipAccessControlListId}", configuration.base_path, ipAccessControlListId=crate::apis::urlencode(p_ip_access_control_list_id));
10614    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
10615
10616    if let Some(ref user_agent) = configuration.user_agent {
10617        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
10618    }
10619    if let Some(ref apikey) = configuration.api_key {
10620        let key = apikey.key.clone();
10621        let value = match apikey.prefix {
10622            Some(ref prefix) => format!("{} {}", prefix, key),
10623            None => key,
10624        };
10625        req_builder = req_builder.header("Authorization", value);
10626    };
10627
10628    let req = req_builder.build()?;
10629    let resp = configuration.client.execute(req).await?;
10630
10631    let status = resp.status();
10632    let content_type = resp
10633        .headers()
10634        .get("content-type")
10635        .and_then(|v| v.to_str().ok())
10636        .unwrap_or("application/octet-stream");
10637    let content_type = super::ContentType::from(content_type);
10638
10639    if !status.is_client_error() && !status.is_server_error() {
10640        let content = resp.text().await?;
10641        match content_type {
10642            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
10643            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IpAccessControlListResponse`"))),
10644            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IpAccessControlListResponse`")))),
10645        }
10646    } else {
10647        let content = resp.text().await?;
10648        let entity: Option<RetrieveIpAccessControlListWithIdError> = serde_json::from_str(&content).ok();
10649        Err(Error::ResponseError(ResponseContent { status, content, entity }))
10650    }
10651}
10652
10653/// Returns public keys used by FusionAuth to cryptographically verify JWTs using the JSON Web Key format.
10654pub async fn retrieve_json_web_key_set_with_id(configuration: &configuration::Configuration, ) -> Result<models::JwksResponse, Error<RetrieveJsonWebKeySetWithIdError>> {
10655
10656    let uri_str = format!("{}/.well-known/jwks.json", configuration.base_path);
10657    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
10658
10659    if let Some(ref user_agent) = configuration.user_agent {
10660        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
10661    }
10662    if let Some(ref apikey) = configuration.api_key {
10663        let key = apikey.key.clone();
10664        let value = match apikey.prefix {
10665            Some(ref prefix) => format!("{} {}", prefix, key),
10666            None => key,
10667        };
10668        req_builder = req_builder.header("Authorization", value);
10669    };
10670
10671    let req = req_builder.build()?;
10672    let resp = configuration.client.execute(req).await?;
10673
10674    let status = resp.status();
10675    let content_type = resp
10676        .headers()
10677        .get("content-type")
10678        .and_then(|v| v.to_str().ok())
10679        .unwrap_or("application/octet-stream");
10680    let content_type = super::ContentType::from(content_type);
10681
10682    if !status.is_client_error() && !status.is_server_error() {
10683        let content = resp.text().await?;
10684        match content_type {
10685            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
10686            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::JwksResponse`"))),
10687            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::JwksResponse`")))),
10688        }
10689    } else {
10690        let content = resp.text().await?;
10691        let entity: Option<RetrieveJsonWebKeySetWithIdError> = serde_json::from_str(&content).ok();
10692        Err(Error::ResponseError(ResponseContent { status, content, entity }))
10693    }
10694}
10695
10696/// Retrieves the Public Key configured for verifying JSON Web Tokens (JWT) by the key Id (kid). OR Retrieves the Public Key configured for verifying the JSON Web Tokens (JWT) issued by the Login API by the Application Id.
10697pub async fn retrieve_jwt_public_key(configuration: &configuration::Configuration, key_id: Option<&str>, application_id: Option<&str>) -> Result<models::PublicKeyResponse, Error<RetrieveJwtPublicKeyError>> {
10698    // add a prefix to parameters to efficiently prevent name collisions
10699    let p_key_id = key_id;
10700    let p_application_id = application_id;
10701
10702    let uri_str = format!("{}/api/jwt/public-key", configuration.base_path);
10703    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
10704
10705    if let Some(ref param_value) = p_key_id {
10706        req_builder = req_builder.query(&[("keyId", &param_value.to_string())]);
10707    }
10708    if let Some(ref param_value) = p_application_id {
10709        req_builder = req_builder.query(&[("applicationId", &param_value.to_string())]);
10710    }
10711    if let Some(ref user_agent) = configuration.user_agent {
10712        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
10713    }
10714    if let Some(ref apikey) = configuration.api_key {
10715        let key = apikey.key.clone();
10716        let value = match apikey.prefix {
10717            Some(ref prefix) => format!("{} {}", prefix, key),
10718            None => key,
10719        };
10720        req_builder = req_builder.header("Authorization", value);
10721    };
10722
10723    let req = req_builder.build()?;
10724    let resp = configuration.client.execute(req).await?;
10725
10726    let status = resp.status();
10727    let content_type = resp
10728        .headers()
10729        .get("content-type")
10730        .and_then(|v| v.to_str().ok())
10731        .unwrap_or("application/octet-stream");
10732    let content_type = super::ContentType::from(content_type);
10733
10734    if !status.is_client_error() && !status.is_server_error() {
10735        let content = resp.text().await?;
10736        match content_type {
10737            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
10738            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PublicKeyResponse`"))),
10739            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::PublicKeyResponse`")))),
10740        }
10741    } else {
10742        let content = resp.text().await?;
10743        let entity: Option<RetrieveJwtPublicKeyError> = serde_json::from_str(&content).ok();
10744        Err(Error::ResponseError(ResponseContent { status, content, entity }))
10745    }
10746}
10747
10748/// Retrieves the key for the given Id.
10749pub async fn retrieve_key_with_id(configuration: &configuration::Configuration, key_id: &str) -> Result<models::KeyResponse, Error<RetrieveKeyWithIdError>> {
10750    // add a prefix to parameters to efficiently prevent name collisions
10751    let p_key_id = key_id;
10752
10753    let uri_str = format!("{}/api/key/{keyId}", configuration.base_path, keyId=crate::apis::urlencode(p_key_id));
10754    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
10755
10756    if let Some(ref user_agent) = configuration.user_agent {
10757        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
10758    }
10759    if let Some(ref apikey) = configuration.api_key {
10760        let key = apikey.key.clone();
10761        let value = match apikey.prefix {
10762            Some(ref prefix) => format!("{} {}", prefix, key),
10763            None => key,
10764        };
10765        req_builder = req_builder.header("Authorization", value);
10766    };
10767
10768    let req = req_builder.build()?;
10769    let resp = configuration.client.execute(req).await?;
10770
10771    let status = resp.status();
10772    let content_type = resp
10773        .headers()
10774        .get("content-type")
10775        .and_then(|v| v.to_str().ok())
10776        .unwrap_or("application/octet-stream");
10777    let content_type = super::ContentType::from(content_type);
10778
10779    if !status.is_client_error() && !status.is_server_error() {
10780        let content = resp.text().await?;
10781        match content_type {
10782            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
10783            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::KeyResponse`"))),
10784            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::KeyResponse`")))),
10785        }
10786    } else {
10787        let content = resp.text().await?;
10788        let entity: Option<RetrieveKeyWithIdError> = serde_json::from_str(&content).ok();
10789        Err(Error::ResponseError(ResponseContent { status, content, entity }))
10790    }
10791}
10792
10793/// Retrieves all the keys.
10794pub async fn retrieve_keys_with_id(configuration: &configuration::Configuration, ) -> Result<models::KeyResponse, Error<RetrieveKeysWithIdError>> {
10795
10796    let uri_str = format!("{}/api/key", configuration.base_path);
10797    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
10798
10799    if let Some(ref user_agent) = configuration.user_agent {
10800        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
10801    }
10802    if let Some(ref apikey) = configuration.api_key {
10803        let key = apikey.key.clone();
10804        let value = match apikey.prefix {
10805            Some(ref prefix) => format!("{} {}", prefix, key),
10806            None => key,
10807        };
10808        req_builder = req_builder.header("Authorization", value);
10809    };
10810
10811    let req = req_builder.build()?;
10812    let resp = configuration.client.execute(req).await?;
10813
10814    let status = resp.status();
10815    let content_type = resp
10816        .headers()
10817        .get("content-type")
10818        .and_then(|v| v.to_str().ok())
10819        .unwrap_or("application/octet-stream");
10820    let content_type = super::ContentType::from(content_type);
10821
10822    if !status.is_client_error() && !status.is_server_error() {
10823        let content = resp.text().await?;
10824        match content_type {
10825            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
10826            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::KeyResponse`"))),
10827            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::KeyResponse`")))),
10828        }
10829    } else {
10830        let content = resp.text().await?;
10831        let entity: Option<RetrieveKeysWithIdError> = serde_json::from_str(&content).ok();
10832        Err(Error::ResponseError(ResponseContent { status, content, entity }))
10833    }
10834}
10835
10836/// Retrieves the lambda for the given Id.
10837pub async fn retrieve_lambda_with_id(configuration: &configuration::Configuration, lambda_id: &str) -> Result<models::LambdaResponse, Error<RetrieveLambdaWithIdError>> {
10838    // add a prefix to parameters to efficiently prevent name collisions
10839    let p_lambda_id = lambda_id;
10840
10841    let uri_str = format!("{}/api/lambda/{lambdaId}", configuration.base_path, lambdaId=crate::apis::urlencode(p_lambda_id));
10842    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
10843
10844    if let Some(ref user_agent) = configuration.user_agent {
10845        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
10846    }
10847    if let Some(ref apikey) = configuration.api_key {
10848        let key = apikey.key.clone();
10849        let value = match apikey.prefix {
10850            Some(ref prefix) => format!("{} {}", prefix, key),
10851            None => key,
10852        };
10853        req_builder = req_builder.header("Authorization", value);
10854    };
10855
10856    let req = req_builder.build()?;
10857    let resp = configuration.client.execute(req).await?;
10858
10859    let status = resp.status();
10860    let content_type = resp
10861        .headers()
10862        .get("content-type")
10863        .and_then(|v| v.to_str().ok())
10864        .unwrap_or("application/octet-stream");
10865    let content_type = super::ContentType::from(content_type);
10866
10867    if !status.is_client_error() && !status.is_server_error() {
10868        let content = resp.text().await?;
10869        match content_type {
10870            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
10871            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::LambdaResponse`"))),
10872            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::LambdaResponse`")))),
10873        }
10874    } else {
10875        let content = resp.text().await?;
10876        let entity: Option<RetrieveLambdaWithIdError> = serde_json::from_str(&content).ok();
10877        Err(Error::ResponseError(ResponseContent { status, content, entity }))
10878    }
10879}
10880
10881/// Retrieves all the lambdas for the provided type.
10882pub async fn retrieve_lambdas_by_type_with_id(configuration: &configuration::Configuration, r#type: Option<&str>) -> Result<models::LambdaResponse, Error<RetrieveLambdasByTypeWithIdError>> {
10883    // add a prefix to parameters to efficiently prevent name collisions
10884    let p_type = r#type;
10885
10886    let uri_str = format!("{}/api/lambda", configuration.base_path);
10887    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
10888
10889    if let Some(ref param_value) = p_type {
10890        req_builder = req_builder.query(&[("type", &param_value.to_string())]);
10891    }
10892    if let Some(ref user_agent) = configuration.user_agent {
10893        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
10894    }
10895    if let Some(ref apikey) = configuration.api_key {
10896        let key = apikey.key.clone();
10897        let value = match apikey.prefix {
10898            Some(ref prefix) => format!("{} {}", prefix, key),
10899            None => key,
10900        };
10901        req_builder = req_builder.header("Authorization", value);
10902    };
10903
10904    let req = req_builder.build()?;
10905    let resp = configuration.client.execute(req).await?;
10906
10907    let status = resp.status();
10908    let content_type = resp
10909        .headers()
10910        .get("content-type")
10911        .and_then(|v| v.to_str().ok())
10912        .unwrap_or("application/octet-stream");
10913    let content_type = super::ContentType::from(content_type);
10914
10915    if !status.is_client_error() && !status.is_server_error() {
10916        let content = resp.text().await?;
10917        match content_type {
10918            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
10919            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::LambdaResponse`"))),
10920            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::LambdaResponse`")))),
10921        }
10922    } else {
10923        let content = resp.text().await?;
10924        let entity: Option<RetrieveLambdasByTypeWithIdError> = serde_json::from_str(&content).ok();
10925        Err(Error::ResponseError(ResponseContent { status, content, entity }))
10926    }
10927}
10928
10929/// Retrieves the message template for the given Id. If you don't specify the id, this will return all the message templates.
10930pub async fn retrieve_message_template(configuration: &configuration::Configuration, ) -> Result<models::MessageTemplateResponse, Error<RetrieveMessageTemplateError>> {
10931
10932    let uri_str = format!("{}/api/message/template", configuration.base_path);
10933    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
10934
10935    if let Some(ref user_agent) = configuration.user_agent {
10936        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
10937    }
10938    if let Some(ref apikey) = configuration.api_key {
10939        let key = apikey.key.clone();
10940        let value = match apikey.prefix {
10941            Some(ref prefix) => format!("{} {}", prefix, key),
10942            None => key,
10943        };
10944        req_builder = req_builder.header("Authorization", value);
10945    };
10946
10947    let req = req_builder.build()?;
10948    let resp = configuration.client.execute(req).await?;
10949
10950    let status = resp.status();
10951    let content_type = resp
10952        .headers()
10953        .get("content-type")
10954        .and_then(|v| v.to_str().ok())
10955        .unwrap_or("application/octet-stream");
10956    let content_type = super::ContentType::from(content_type);
10957
10958    if !status.is_client_error() && !status.is_server_error() {
10959        let content = resp.text().await?;
10960        match content_type {
10961            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
10962            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::MessageTemplateResponse`"))),
10963            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::MessageTemplateResponse`")))),
10964        }
10965    } else {
10966        let content = resp.text().await?;
10967        let entity: Option<RetrieveMessageTemplateError> = serde_json::from_str(&content).ok();
10968        Err(Error::ResponseError(ResponseContent { status, content, entity }))
10969    }
10970}
10971
10972/// Creates a preview of the message template provided in the request, normalized to a given locale.
10973pub async fn retrieve_message_template_preview_with_id(configuration: &configuration::Configuration, preview_message_template_request: Option<models::PreviewMessageTemplateRequest>) -> Result<models::PreviewMessageTemplateResponse, Error<RetrieveMessageTemplatePreviewWithIdError>> {
10974    // add a prefix to parameters to efficiently prevent name collisions
10975    let p_preview_message_template_request = preview_message_template_request;
10976
10977    let uri_str = format!("{}/api/message/template/preview", configuration.base_path);
10978    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
10979
10980    if let Some(ref user_agent) = configuration.user_agent {
10981        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
10982    }
10983    if let Some(ref apikey) = configuration.api_key {
10984        let key = apikey.key.clone();
10985        let value = match apikey.prefix {
10986            Some(ref prefix) => format!("{} {}", prefix, key),
10987            None => key,
10988        };
10989        req_builder = req_builder.header("Authorization", value);
10990    };
10991    req_builder = req_builder.json(&p_preview_message_template_request);
10992
10993    let req = req_builder.build()?;
10994    let resp = configuration.client.execute(req).await?;
10995
10996    let status = resp.status();
10997    let content_type = resp
10998        .headers()
10999        .get("content-type")
11000        .and_then(|v| v.to_str().ok())
11001        .unwrap_or("application/octet-stream");
11002    let content_type = super::ContentType::from(content_type);
11003
11004    if !status.is_client_error() && !status.is_server_error() {
11005        let content = resp.text().await?;
11006        match content_type {
11007            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
11008            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PreviewMessageTemplateResponse`"))),
11009            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::PreviewMessageTemplateResponse`")))),
11010        }
11011    } else {
11012        let content = resp.text().await?;
11013        let entity: Option<RetrieveMessageTemplatePreviewWithIdError> = serde_json::from_str(&content).ok();
11014        Err(Error::ResponseError(ResponseContent { status, content, entity }))
11015    }
11016}
11017
11018/// Retrieves the message template for the given Id. If you don't specify the id, this will return all the message templates.
11019pub async fn retrieve_message_template_with_id(configuration: &configuration::Configuration, message_template_id: &str) -> Result<models::MessageTemplateResponse, Error<RetrieveMessageTemplateWithIdError>> {
11020    // add a prefix to parameters to efficiently prevent name collisions
11021    let p_message_template_id = message_template_id;
11022
11023    let uri_str = format!("{}/api/message/template/{messageTemplateId}", configuration.base_path, messageTemplateId=crate::apis::urlencode(p_message_template_id));
11024    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
11025
11026    if let Some(ref user_agent) = configuration.user_agent {
11027        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
11028    }
11029    if let Some(ref apikey) = configuration.api_key {
11030        let key = apikey.key.clone();
11031        let value = match apikey.prefix {
11032            Some(ref prefix) => format!("{} {}", prefix, key),
11033            None => key,
11034        };
11035        req_builder = req_builder.header("Authorization", value);
11036    };
11037
11038    let req = req_builder.build()?;
11039    let resp = configuration.client.execute(req).await?;
11040
11041    let status = resp.status();
11042    let content_type = resp
11043        .headers()
11044        .get("content-type")
11045        .and_then(|v| v.to_str().ok())
11046        .unwrap_or("application/octet-stream");
11047    let content_type = super::ContentType::from(content_type);
11048
11049    if !status.is_client_error() && !status.is_server_error() {
11050        let content = resp.text().await?;
11051        match content_type {
11052            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
11053            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::MessageTemplateResponse`"))),
11054            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::MessageTemplateResponse`")))),
11055        }
11056    } else {
11057        let content = resp.text().await?;
11058        let entity: Option<RetrieveMessageTemplateWithIdError> = serde_json::from_str(&content).ok();
11059        Err(Error::ResponseError(ResponseContent { status, content, entity }))
11060    }
11061}
11062
11063/// Retrieves the messenger with the given Id.
11064pub async fn retrieve_messenger_with_id(configuration: &configuration::Configuration, messenger_id: &str) -> Result<models::MessengerResponse, Error<RetrieveMessengerWithIdError>> {
11065    // add a prefix to parameters to efficiently prevent name collisions
11066    let p_messenger_id = messenger_id;
11067
11068    let uri_str = format!("{}/api/messenger/{messengerId}", configuration.base_path, messengerId=crate::apis::urlencode(p_messenger_id));
11069    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
11070
11071    if let Some(ref user_agent) = configuration.user_agent {
11072        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
11073    }
11074    if let Some(ref apikey) = configuration.api_key {
11075        let key = apikey.key.clone();
11076        let value = match apikey.prefix {
11077            Some(ref prefix) => format!("{} {}", prefix, key),
11078            None => key,
11079        };
11080        req_builder = req_builder.header("Authorization", value);
11081    };
11082
11083    let req = req_builder.build()?;
11084    let resp = configuration.client.execute(req).await?;
11085
11086    let status = resp.status();
11087    let content_type = resp
11088        .headers()
11089        .get("content-type")
11090        .and_then(|v| v.to_str().ok())
11091        .unwrap_or("application/octet-stream");
11092    let content_type = super::ContentType::from(content_type);
11093
11094    if !status.is_client_error() && !status.is_server_error() {
11095        let content = resp.text().await?;
11096        match content_type {
11097            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
11098            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::MessengerResponse`"))),
11099            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::MessengerResponse`")))),
11100        }
11101    } else {
11102        let content = resp.text().await?;
11103        let entity: Option<RetrieveMessengerWithIdError> = serde_json::from_str(&content).ok();
11104        Err(Error::ResponseError(ResponseContent { status, content, entity }))
11105    }
11106}
11107
11108/// Retrieves the monthly active user report between the two instants. If you specify an application id, it will only return the monthly active counts for that application.
11109pub async fn retrieve_monthly_active_report_with_id(configuration: &configuration::Configuration, application_id: Option<&str>, start: Option<&str>, end: Option<&str>) -> Result<models::MonthlyActiveUserReportResponse, Error<RetrieveMonthlyActiveReportWithIdError>> {
11110    // add a prefix to parameters to efficiently prevent name collisions
11111    let p_application_id = application_id;
11112    let p_start = start;
11113    let p_end = end;
11114
11115    let uri_str = format!("{}/api/report/monthly-active-user", configuration.base_path);
11116    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
11117
11118    if let Some(ref param_value) = p_application_id {
11119        req_builder = req_builder.query(&[("applicationId", &param_value.to_string())]);
11120    }
11121    if let Some(ref param_value) = p_start {
11122        req_builder = req_builder.query(&[("start", &param_value.to_string())]);
11123    }
11124    if let Some(ref param_value) = p_end {
11125        req_builder = req_builder.query(&[("end", &param_value.to_string())]);
11126    }
11127    if let Some(ref user_agent) = configuration.user_agent {
11128        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
11129    }
11130    if let Some(ref apikey) = configuration.api_key {
11131        let key = apikey.key.clone();
11132        let value = match apikey.prefix {
11133            Some(ref prefix) => format!("{} {}", prefix, key),
11134            None => key,
11135        };
11136        req_builder = req_builder.header("Authorization", value);
11137    };
11138
11139    let req = req_builder.build()?;
11140    let resp = configuration.client.execute(req).await?;
11141
11142    let status = resp.status();
11143    let content_type = resp
11144        .headers()
11145        .get("content-type")
11146        .and_then(|v| v.to_str().ok())
11147        .unwrap_or("application/octet-stream");
11148    let content_type = super::ContentType::from(content_type);
11149
11150    if !status.is_client_error() && !status.is_server_error() {
11151        let content = resp.text().await?;
11152        match content_type {
11153            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
11154            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::MonthlyActiveUserReportResponse`"))),
11155            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::MonthlyActiveUserReportResponse`")))),
11156        }
11157    } else {
11158        let content = resp.text().await?;
11159        let entity: Option<RetrieveMonthlyActiveReportWithIdError> = serde_json::from_str(&content).ok();
11160        Err(Error::ResponseError(ResponseContent { status, content, entity }))
11161    }
11162}
11163
11164/// Retrieves a custom OAuth scope.
11165pub async fn retrieve_o_auth_scope_with_id(configuration: &configuration::Configuration, application_id: &str, scope_id: &str, x_fusion_auth_tenant_id: Option<&str>) -> Result<models::ApplicationOAuthScopeResponse, Error<RetrieveOAuthScopeWithIdError>> {
11166    // add a prefix to parameters to efficiently prevent name collisions
11167    let p_application_id = application_id;
11168    let p_scope_id = scope_id;
11169    let p_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
11170
11171    let uri_str = format!("{}/api/application/{applicationId}/scope/{scopeId}", configuration.base_path, applicationId=crate::apis::urlencode(p_application_id), scopeId=crate::apis::urlencode(p_scope_id));
11172    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
11173
11174    if let Some(ref user_agent) = configuration.user_agent {
11175        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
11176    }
11177    if let Some(param_value) = p_x_fusion_auth_tenant_id {
11178        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
11179    }
11180    if let Some(ref apikey) = configuration.api_key {
11181        let key = apikey.key.clone();
11182        let value = match apikey.prefix {
11183            Some(ref prefix) => format!("{} {}", prefix, key),
11184            None => key,
11185        };
11186        req_builder = req_builder.header("Authorization", value);
11187    };
11188
11189    let req = req_builder.build()?;
11190    let resp = configuration.client.execute(req).await?;
11191
11192    let status = resp.status();
11193    let content_type = resp
11194        .headers()
11195        .get("content-type")
11196        .and_then(|v| v.to_str().ok())
11197        .unwrap_or("application/octet-stream");
11198    let content_type = super::ContentType::from(content_type);
11199
11200    if !status.is_client_error() && !status.is_server_error() {
11201        let content = resp.text().await?;
11202        match content_type {
11203            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
11204            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ApplicationOAuthScopeResponse`"))),
11205            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ApplicationOAuthScopeResponse`")))),
11206        }
11207    } else {
11208        let content = resp.text().await?;
11209        let entity: Option<RetrieveOAuthScopeWithIdError> = serde_json::from_str(&content).ok();
11210        Err(Error::ResponseError(ResponseContent { status, content, entity }))
11211    }
11212}
11213
11214/// Retrieves the Oauth2 configuration for the application for the given Application Id.
11215pub async fn retrieve_oauth_configuration_with_id(configuration: &configuration::Configuration, application_id: &str, x_fusion_auth_tenant_id: Option<&str>) -> Result<models::OAuthConfigurationResponse, Error<RetrieveOauthConfigurationWithIdError>> {
11216    // add a prefix to parameters to efficiently prevent name collisions
11217    let p_application_id = application_id;
11218    let p_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
11219
11220    let uri_str = format!("{}/api/application/{applicationId}/oauth-configuration", configuration.base_path, applicationId=crate::apis::urlencode(p_application_id));
11221    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
11222
11223    if let Some(ref user_agent) = configuration.user_agent {
11224        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
11225    }
11226    if let Some(param_value) = p_x_fusion_auth_tenant_id {
11227        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
11228    }
11229    if let Some(ref apikey) = configuration.api_key {
11230        let key = apikey.key.clone();
11231        let value = match apikey.prefix {
11232            Some(ref prefix) => format!("{} {}", prefix, key),
11233            None => key,
11234        };
11235        req_builder = req_builder.header("Authorization", value);
11236    };
11237
11238    let req = req_builder.build()?;
11239    let resp = configuration.client.execute(req).await?;
11240
11241    let status = resp.status();
11242    let content_type = resp
11243        .headers()
11244        .get("content-type")
11245        .and_then(|v| v.to_str().ok())
11246        .unwrap_or("application/octet-stream");
11247    let content_type = super::ContentType::from(content_type);
11248
11249    if !status.is_client_error() && !status.is_server_error() {
11250        let content = resp.text().await?;
11251        match content_type {
11252            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
11253            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::OAuthConfigurationResponse`"))),
11254            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::OAuthConfigurationResponse`")))),
11255        }
11256    } else {
11257        let content = resp.text().await?;
11258        let entity: Option<RetrieveOauthConfigurationWithIdError> = serde_json::from_str(&content).ok();
11259        Err(Error::ResponseError(ResponseContent { status, content, entity }))
11260    }
11261}
11262
11263/// Returns the well known OpenID Configuration JSON document
11264pub async fn retrieve_open_id_configuration_with_id(configuration: &configuration::Configuration, ) -> Result<models::OpenIdConfiguration, Error<RetrieveOpenIdConfigurationWithIdError>> {
11265
11266    let uri_str = format!("{}/.well-known/openid-configuration", configuration.base_path);
11267    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
11268
11269    if let Some(ref user_agent) = configuration.user_agent {
11270        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
11271    }
11272    if let Some(ref apikey) = configuration.api_key {
11273        let key = apikey.key.clone();
11274        let value = match apikey.prefix {
11275            Some(ref prefix) => format!("{} {}", prefix, key),
11276            None => key,
11277        };
11278        req_builder = req_builder.header("Authorization", value);
11279    };
11280
11281    let req = req_builder.build()?;
11282    let resp = configuration.client.execute(req).await?;
11283
11284    let status = resp.status();
11285    let content_type = resp
11286        .headers()
11287        .get("content-type")
11288        .and_then(|v| v.to_str().ok())
11289        .unwrap_or("application/octet-stream");
11290    let content_type = super::ContentType::from(content_type);
11291
11292    if !status.is_client_error() && !status.is_server_error() {
11293        let content = resp.text().await?;
11294        match content_type {
11295            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
11296            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::OpenIdConfiguration`"))),
11297            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::OpenIdConfiguration`")))),
11298        }
11299    } else {
11300        let content = resp.text().await?;
11301        let entity: Option<RetrieveOpenIdConfigurationWithIdError> = serde_json::from_str(&content).ok();
11302        Err(Error::ResponseError(ResponseContent { status, content, entity }))
11303    }
11304}
11305
11306/// Retrieves the password validation rules for a specific tenant. This method requires a tenantId to be provided  through the use of a Tenant scoped API key or an HTTP header X-FusionAuth-TenantId to specify the Tenant Id.  This API does not require an API key.
11307pub async fn retrieve_password_validation_rules_with_id(configuration: &configuration::Configuration, ) -> Result<models::PasswordValidationRulesResponse, Error<RetrievePasswordValidationRulesWithIdError>> {
11308
11309    let uri_str = format!("{}/api/tenant/password-validation-rules", configuration.base_path);
11310    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
11311
11312    if let Some(ref user_agent) = configuration.user_agent {
11313        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
11314    }
11315    if let Some(ref apikey) = configuration.api_key {
11316        let key = apikey.key.clone();
11317        let value = match apikey.prefix {
11318            Some(ref prefix) => format!("{} {}", prefix, key),
11319            None => key,
11320        };
11321        req_builder = req_builder.header("Authorization", value);
11322    };
11323
11324    let req = req_builder.build()?;
11325    let resp = configuration.client.execute(req).await?;
11326
11327    let status = resp.status();
11328    let content_type = resp
11329        .headers()
11330        .get("content-type")
11331        .and_then(|v| v.to_str().ok())
11332        .unwrap_or("application/octet-stream");
11333    let content_type = super::ContentType::from(content_type);
11334
11335    if !status.is_client_error() && !status.is_server_error() {
11336        let content = resp.text().await?;
11337        match content_type {
11338            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
11339            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PasswordValidationRulesResponse`"))),
11340            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::PasswordValidationRulesResponse`")))),
11341        }
11342    } else {
11343        let content = resp.text().await?;
11344        let entity: Option<RetrievePasswordValidationRulesWithIdError> = serde_json::from_str(&content).ok();
11345        Err(Error::ResponseError(ResponseContent { status, content, entity }))
11346    }
11347}
11348
11349/// Retrieves the password validation rules for a specific tenant.  This API does not require an API key.
11350pub async fn retrieve_password_validation_rules_with_tenant_id_with_id(configuration: &configuration::Configuration, tenant_id: &str) -> Result<models::PasswordValidationRulesResponse, Error<RetrievePasswordValidationRulesWithTenantIdWithIdError>> {
11351    // add a prefix to parameters to efficiently prevent name collisions
11352    let p_tenant_id = tenant_id;
11353
11354    let uri_str = format!("{}/api/tenant/password-validation-rules/{tenantId}", configuration.base_path, tenantId=crate::apis::urlencode(p_tenant_id));
11355    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
11356
11357    if let Some(ref user_agent) = configuration.user_agent {
11358        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
11359    }
11360    if let Some(ref apikey) = configuration.api_key {
11361        let key = apikey.key.clone();
11362        let value = match apikey.prefix {
11363            Some(ref prefix) => format!("{} {}", prefix, key),
11364            None => key,
11365        };
11366        req_builder = req_builder.header("Authorization", value);
11367    };
11368
11369    let req = req_builder.build()?;
11370    let resp = configuration.client.execute(req).await?;
11371
11372    let status = resp.status();
11373    let content_type = resp
11374        .headers()
11375        .get("content-type")
11376        .and_then(|v| v.to_str().ok())
11377        .unwrap_or("application/octet-stream");
11378    let content_type = super::ContentType::from(content_type);
11379
11380    if !status.is_client_error() && !status.is_server_error() {
11381        let content = resp.text().await?;
11382        match content_type {
11383            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
11384            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PasswordValidationRulesResponse`"))),
11385            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::PasswordValidationRulesResponse`")))),
11386        }
11387    } else {
11388        let content = resp.text().await?;
11389        let entity: Option<RetrievePasswordValidationRulesWithTenantIdWithIdError> = serde_json::from_str(&content).ok();
11390        Err(Error::ResponseError(ResponseContent { status, content, entity }))
11391    }
11392}
11393
11394/// Retrieves all the children for the given parent email address.
11395pub async fn retrieve_pending_children_with_id(configuration: &configuration::Configuration, parent_email: Option<&str>) -> Result<models::PendingResponse, Error<RetrievePendingChildrenWithIdError>> {
11396    // add a prefix to parameters to efficiently prevent name collisions
11397    let p_parent_email = parent_email;
11398
11399    let uri_str = format!("{}/api/user/family/pending", configuration.base_path);
11400    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
11401
11402    if let Some(ref param_value) = p_parent_email {
11403        req_builder = req_builder.query(&[("parentEmail", &param_value.to_string())]);
11404    }
11405    if let Some(ref user_agent) = configuration.user_agent {
11406        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
11407    }
11408    if let Some(ref apikey) = configuration.api_key {
11409        let key = apikey.key.clone();
11410        let value = match apikey.prefix {
11411            Some(ref prefix) => format!("{} {}", prefix, key),
11412            None => key,
11413        };
11414        req_builder = req_builder.header("Authorization", value);
11415    };
11416
11417    let req = req_builder.build()?;
11418    let resp = configuration.client.execute(req).await?;
11419
11420    let status = resp.status();
11421    let content_type = resp
11422        .headers()
11423        .get("content-type")
11424        .and_then(|v| v.to_str().ok())
11425        .unwrap_or("application/octet-stream");
11426    let content_type = super::ContentType::from(content_type);
11427
11428    if !status.is_client_error() && !status.is_server_error() {
11429        let content = resp.text().await?;
11430        match content_type {
11431            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
11432            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PendingResponse`"))),
11433            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::PendingResponse`")))),
11434        }
11435    } else {
11436        let content = resp.text().await?;
11437        let entity: Option<RetrievePendingChildrenWithIdError> = serde_json::from_str(&content).ok();
11438        Err(Error::ResponseError(ResponseContent { status, content, entity }))
11439    }
11440}
11441
11442/// Retrieve a pending identity provider link. This is useful to validate a pending link and retrieve meta-data about the identity provider link.
11443pub async fn retrieve_pending_link_with_id(configuration: &configuration::Configuration, pending_link_id: &str, user_id: Option<&str>) -> Result<models::IdentityProviderPendingLinkResponse, Error<RetrievePendingLinkWithIdError>> {
11444    // add a prefix to parameters to efficiently prevent name collisions
11445    let p_pending_link_id = pending_link_id;
11446    let p_user_id = user_id;
11447
11448    let uri_str = format!("{}/api/identity-provider/link/pending/{pendingLinkId}", configuration.base_path, pendingLinkId=crate::apis::urlencode(p_pending_link_id));
11449    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
11450
11451    if let Some(ref param_value) = p_user_id {
11452        req_builder = req_builder.query(&[("userId", &param_value.to_string())]);
11453    }
11454    if let Some(ref user_agent) = configuration.user_agent {
11455        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
11456    }
11457    if let Some(ref apikey) = configuration.api_key {
11458        let key = apikey.key.clone();
11459        let value = match apikey.prefix {
11460            Some(ref prefix) => format!("{} {}", prefix, key),
11461            None => key,
11462        };
11463        req_builder = req_builder.header("Authorization", value);
11464    };
11465
11466    let req = req_builder.build()?;
11467    let resp = configuration.client.execute(req).await?;
11468
11469    let status = resp.status();
11470    let content_type = resp
11471        .headers()
11472        .get("content-type")
11473        .and_then(|v| v.to_str().ok())
11474        .unwrap_or("application/octet-stream");
11475    let content_type = super::ContentType::from(content_type);
11476
11477    if !status.is_client_error() && !status.is_server_error() {
11478        let content = resp.text().await?;
11479        match content_type {
11480            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
11481            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IdentityProviderPendingLinkResponse`"))),
11482            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IdentityProviderPendingLinkResponse`")))),
11483        }
11484    } else {
11485        let content = resp.text().await?;
11486        let entity: Option<RetrievePendingLinkWithIdError> = serde_json::from_str(&content).ok();
11487        Err(Error::ResponseError(ResponseContent { status, content, entity }))
11488    }
11489}
11490
11491/// Retrieves the FusionAuth Reactor metrics.
11492pub async fn retrieve_reactor_metrics_with_id(configuration: &configuration::Configuration, ) -> Result<models::ReactorMetricsResponse, Error<RetrieveReactorMetricsWithIdError>> {
11493
11494    let uri_str = format!("{}/api/reactor/metrics", configuration.base_path);
11495    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
11496
11497    if let Some(ref user_agent) = configuration.user_agent {
11498        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
11499    }
11500    if let Some(ref apikey) = configuration.api_key {
11501        let key = apikey.key.clone();
11502        let value = match apikey.prefix {
11503            Some(ref prefix) => format!("{} {}", prefix, key),
11504            None => key,
11505        };
11506        req_builder = req_builder.header("Authorization", value);
11507    };
11508
11509    let req = req_builder.build()?;
11510    let resp = configuration.client.execute(req).await?;
11511
11512    let status = resp.status();
11513    let content_type = resp
11514        .headers()
11515        .get("content-type")
11516        .and_then(|v| v.to_str().ok())
11517        .unwrap_or("application/octet-stream");
11518    let content_type = super::ContentType::from(content_type);
11519
11520    if !status.is_client_error() && !status.is_server_error() {
11521        let content = resp.text().await?;
11522        match content_type {
11523            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
11524            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ReactorMetricsResponse`"))),
11525            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ReactorMetricsResponse`")))),
11526        }
11527    } else {
11528        let content = resp.text().await?;
11529        let entity: Option<RetrieveReactorMetricsWithIdError> = serde_json::from_str(&content).ok();
11530        Err(Error::ResponseError(ResponseContent { status, content, entity }))
11531    }
11532}
11533
11534/// Retrieves a single refresh token by unique Id. This is not the same thing as the string value of the refresh token. If you have that, you already have what you need.
11535pub async fn retrieve_refresh_token_by_id_with_id(configuration: &configuration::Configuration, token_id: &str) -> Result<models::RefreshTokenResponse, Error<RetrieveRefreshTokenByIdWithIdError>> {
11536    // add a prefix to parameters to efficiently prevent name collisions
11537    let p_token_id = token_id;
11538
11539    let uri_str = format!("{}/api/jwt/refresh/{tokenId}", configuration.base_path, tokenId=crate::apis::urlencode(p_token_id));
11540    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
11541
11542    if let Some(ref user_agent) = configuration.user_agent {
11543        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
11544    }
11545    if let Some(ref apikey) = configuration.api_key {
11546        let key = apikey.key.clone();
11547        let value = match apikey.prefix {
11548            Some(ref prefix) => format!("{} {}", prefix, key),
11549            None => key,
11550        };
11551        req_builder = req_builder.header("Authorization", value);
11552    };
11553
11554    let req = req_builder.build()?;
11555    let resp = configuration.client.execute(req).await?;
11556
11557    let status = resp.status();
11558    let content_type = resp
11559        .headers()
11560        .get("content-type")
11561        .and_then(|v| v.to_str().ok())
11562        .unwrap_or("application/octet-stream");
11563    let content_type = super::ContentType::from(content_type);
11564
11565    if !status.is_client_error() && !status.is_server_error() {
11566        let content = resp.text().await?;
11567        match content_type {
11568            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
11569            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::RefreshTokenResponse`"))),
11570            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::RefreshTokenResponse`")))),
11571        }
11572    } else {
11573        let content = resp.text().await?;
11574        let entity: Option<RetrieveRefreshTokenByIdWithIdError> = serde_json::from_str(&content).ok();
11575        Err(Error::ResponseError(ResponseContent { status, content, entity }))
11576    }
11577}
11578
11579/// Retrieves the refresh tokens that belong to the user with the given Id.
11580pub async fn retrieve_refresh_tokens_with_id(configuration: &configuration::Configuration, user_id: Option<&str>) -> Result<models::RefreshTokenResponse, Error<RetrieveRefreshTokensWithIdError>> {
11581    // add a prefix to parameters to efficiently prevent name collisions
11582    let p_user_id = user_id;
11583
11584    let uri_str = format!("{}/api/jwt/refresh", configuration.base_path);
11585    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
11586
11587    if let Some(ref param_value) = p_user_id {
11588        req_builder = req_builder.query(&[("userId", &param_value.to_string())]);
11589    }
11590    if let Some(ref user_agent) = configuration.user_agent {
11591        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
11592    }
11593    if let Some(ref apikey) = configuration.api_key {
11594        let key = apikey.key.clone();
11595        let value = match apikey.prefix {
11596            Some(ref prefix) => format!("{} {}", prefix, key),
11597            None => key,
11598        };
11599        req_builder = req_builder.header("Authorization", value);
11600    };
11601
11602    let req = req_builder.build()?;
11603    let resp = configuration.client.execute(req).await?;
11604
11605    let status = resp.status();
11606    let content_type = resp
11607        .headers()
11608        .get("content-type")
11609        .and_then(|v| v.to_str().ok())
11610        .unwrap_or("application/octet-stream");
11611    let content_type = super::ContentType::from(content_type);
11612
11613    if !status.is_client_error() && !status.is_server_error() {
11614        let content = resp.text().await?;
11615        match content_type {
11616            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
11617            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::RefreshTokenResponse`"))),
11618            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::RefreshTokenResponse`")))),
11619        }
11620    } else {
11621        let content = resp.text().await?;
11622        let entity: Option<RetrieveRefreshTokensWithIdError> = serde_json::from_str(&content).ok();
11623        Err(Error::ResponseError(ResponseContent { status, content, entity }))
11624    }
11625}
11626
11627/// Retrieves the registration report between the two instants. If you specify an application id, it will only return the registration counts for that application.
11628pub async fn retrieve_registration_report_with_id(configuration: &configuration::Configuration, application_id: Option<&str>, start: Option<&str>, end: Option<&str>) -> Result<models::RegistrationReportResponse, Error<RetrieveRegistrationReportWithIdError>> {
11629    // add a prefix to parameters to efficiently prevent name collisions
11630    let p_application_id = application_id;
11631    let p_start = start;
11632    let p_end = end;
11633
11634    let uri_str = format!("{}/api/report/registration", configuration.base_path);
11635    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
11636
11637    if let Some(ref param_value) = p_application_id {
11638        req_builder = req_builder.query(&[("applicationId", &param_value.to_string())]);
11639    }
11640    if let Some(ref param_value) = p_start {
11641        req_builder = req_builder.query(&[("start", &param_value.to_string())]);
11642    }
11643    if let Some(ref param_value) = p_end {
11644        req_builder = req_builder.query(&[("end", &param_value.to_string())]);
11645    }
11646    if let Some(ref user_agent) = configuration.user_agent {
11647        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
11648    }
11649    if let Some(ref apikey) = configuration.api_key {
11650        let key = apikey.key.clone();
11651        let value = match apikey.prefix {
11652            Some(ref prefix) => format!("{} {}", prefix, key),
11653            None => key,
11654        };
11655        req_builder = req_builder.header("Authorization", value);
11656    };
11657
11658    let req = req_builder.build()?;
11659    let resp = configuration.client.execute(req).await?;
11660
11661    let status = resp.status();
11662    let content_type = resp
11663        .headers()
11664        .get("content-type")
11665        .and_then(|v| v.to_str().ok())
11666        .unwrap_or("application/octet-stream");
11667    let content_type = super::ContentType::from(content_type);
11668
11669    if !status.is_client_error() && !status.is_server_error() {
11670        let content = resp.text().await?;
11671        match content_type {
11672            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
11673            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::RegistrationReportResponse`"))),
11674            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::RegistrationReportResponse`")))),
11675        }
11676    } else {
11677        let content = resp.text().await?;
11678        let entity: Option<RetrieveRegistrationReportWithIdError> = serde_json::from_str(&content).ok();
11679        Err(Error::ResponseError(ResponseContent { status, content, entity }))
11680    }
11681}
11682
11683/// Retrieves the user registration for the user with the given Id and the given application id.
11684pub async fn retrieve_registration_with_id(configuration: &configuration::Configuration, user_id: &str, application_id: &str, x_fusion_auth_tenant_id: Option<&str>) -> Result<models::RegistrationResponse, Error<RetrieveRegistrationWithIdError>> {
11685    // add a prefix to parameters to efficiently prevent name collisions
11686    let p_user_id = user_id;
11687    let p_application_id = application_id;
11688    let p_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
11689
11690    let uri_str = format!("{}/api/user/registration/{userId}/{applicationId}", configuration.base_path, userId=crate::apis::urlencode(p_user_id), applicationId=crate::apis::urlencode(p_application_id));
11691    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
11692
11693    if let Some(ref user_agent) = configuration.user_agent {
11694        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
11695    }
11696    if let Some(param_value) = p_x_fusion_auth_tenant_id {
11697        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
11698    }
11699    if let Some(ref apikey) = configuration.api_key {
11700        let key = apikey.key.clone();
11701        let value = match apikey.prefix {
11702            Some(ref prefix) => format!("{} {}", prefix, key),
11703            None => key,
11704        };
11705        req_builder = req_builder.header("Authorization", value);
11706    };
11707
11708    let req = req_builder.build()?;
11709    let resp = configuration.client.execute(req).await?;
11710
11711    let status = resp.status();
11712    let content_type = resp
11713        .headers()
11714        .get("content-type")
11715        .and_then(|v| v.to_str().ok())
11716        .unwrap_or("application/octet-stream");
11717    let content_type = super::ContentType::from(content_type);
11718
11719    if !status.is_client_error() && !status.is_server_error() {
11720        let content = resp.text().await?;
11721        match content_type {
11722            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
11723            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::RegistrationResponse`"))),
11724            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::RegistrationResponse`")))),
11725        }
11726    } else {
11727        let content = resp.text().await?;
11728        let entity: Option<RetrieveRegistrationWithIdError> = serde_json::from_str(&content).ok();
11729        Err(Error::ResponseError(ResponseContent { status, content, entity }))
11730    }
11731}
11732
11733/// Retrieves the login report between the two instants. If you specify an application id, it will only return the login counts for that application. OR Retrieves the login report between the two instants for a particular user by Id. If you specify an application id, it will only return the login counts for that application. OR Retrieves the login report between the two instants for a particular user by login Id. If you specify an application id, it will only return the login counts for that application.
11734pub async fn retrieve_report_login(configuration: &configuration::Configuration, application_id: Option<&str>, start: Option<&str>, end: Option<&str>, user_id: Option<&str>, login_id: Option<&str>) -> Result<models::LoginReportResponse, Error<RetrieveReportLoginError>> {
11735    // add a prefix to parameters to efficiently prevent name collisions
11736    let p_application_id = application_id;
11737    let p_start = start;
11738    let p_end = end;
11739    let p_user_id = user_id;
11740    let p_login_id = login_id;
11741
11742    let uri_str = format!("{}/api/report/login", configuration.base_path);
11743    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
11744
11745    if let Some(ref param_value) = p_application_id {
11746        req_builder = req_builder.query(&[("applicationId", &param_value.to_string())]);
11747    }
11748    if let Some(ref param_value) = p_start {
11749        req_builder = req_builder.query(&[("start", &param_value.to_string())]);
11750    }
11751    if let Some(ref param_value) = p_end {
11752        req_builder = req_builder.query(&[("end", &param_value.to_string())]);
11753    }
11754    if let Some(ref param_value) = p_user_id {
11755        req_builder = req_builder.query(&[("userId", &param_value.to_string())]);
11756    }
11757    if let Some(ref param_value) = p_login_id {
11758        req_builder = req_builder.query(&[("loginId", &param_value.to_string())]);
11759    }
11760    if let Some(ref user_agent) = configuration.user_agent {
11761        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
11762    }
11763    if let Some(ref apikey) = configuration.api_key {
11764        let key = apikey.key.clone();
11765        let value = match apikey.prefix {
11766            Some(ref prefix) => format!("{} {}", prefix, key),
11767            None => key,
11768        };
11769        req_builder = req_builder.header("Authorization", value);
11770    };
11771
11772    let req = req_builder.build()?;
11773    let resp = configuration.client.execute(req).await?;
11774
11775    let status = resp.status();
11776    let content_type = resp
11777        .headers()
11778        .get("content-type")
11779        .and_then(|v| v.to_str().ok())
11780        .unwrap_or("application/octet-stream");
11781    let content_type = super::ContentType::from(content_type);
11782
11783    if !status.is_client_error() && !status.is_server_error() {
11784        let content = resp.text().await?;
11785        match content_type {
11786            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
11787            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::LoginReportResponse`"))),
11788            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::LoginReportResponse`")))),
11789        }
11790    } else {
11791        let content = resp.text().await?;
11792        let entity: Option<RetrieveReportLoginError> = serde_json::from_str(&content).ok();
11793        Err(Error::ResponseError(ResponseContent { status, content, entity }))
11794    }
11795}
11796
11797/// Retrieves the FusionAuth system status. This request is anonymous and does not require an API key. When an API key is not provided the response will contain a single value in the JSON response indicating the current health check. OR Retrieves the FusionAuth system status using an API key. Using an API key will cause the response to include the product version, health checks and various runtime metrics.
11798pub async fn retrieve_status(configuration: &configuration::Configuration, ) -> Result<serde_json::Value, Error<RetrieveStatusError>> {
11799
11800    let uri_str = format!("{}/api/status", configuration.base_path);
11801    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
11802
11803    if let Some(ref user_agent) = configuration.user_agent {
11804        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
11805    }
11806    if let Some(ref apikey) = configuration.api_key {
11807        let key = apikey.key.clone();
11808        let value = match apikey.prefix {
11809            Some(ref prefix) => format!("{} {}", prefix, key),
11810            None => key,
11811        };
11812        req_builder = req_builder.header("Authorization", value);
11813    };
11814
11815    let req = req_builder.build()?;
11816    let resp = configuration.client.execute(req).await?;
11817
11818    let status = resp.status();
11819    let content_type = resp
11820        .headers()
11821        .get("content-type")
11822        .and_then(|v| v.to_str().ok())
11823        .unwrap_or("application/octet-stream");
11824    let content_type = super::ContentType::from(content_type);
11825
11826    if !status.is_client_error() && !status.is_server_error() {
11827        let content = resp.text().await?;
11828        match content_type {
11829            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
11830            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `serde_json::Value`"))),
11831            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `serde_json::Value`")))),
11832        }
11833    } else {
11834        let content = resp.text().await?;
11835        let entity: Option<RetrieveStatusError> = serde_json::from_str(&content).ok();
11836        Err(Error::ResponseError(ResponseContent { status, content, entity }))
11837    }
11838}
11839
11840/// Retrieves the FusionAuth system health. This API will return 200 if the system is healthy, and 500 if the system is un-healthy.
11841pub async fn retrieve_system_health_with_id(configuration: &configuration::Configuration, ) -> Result<(), Error<RetrieveSystemHealthWithIdError>> {
11842
11843    let uri_str = format!("{}/api/health", configuration.base_path);
11844    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
11845
11846    if let Some(ref user_agent) = configuration.user_agent {
11847        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
11848    }
11849    if let Some(ref apikey) = configuration.api_key {
11850        let key = apikey.key.clone();
11851        let value = match apikey.prefix {
11852            Some(ref prefix) => format!("{} {}", prefix, key),
11853            None => key,
11854        };
11855        req_builder = req_builder.header("Authorization", value);
11856    };
11857
11858    let req = req_builder.build()?;
11859    let resp = configuration.client.execute(req).await?;
11860
11861    let status = resp.status();
11862
11863    if !status.is_client_error() && !status.is_server_error() {
11864        Ok(())
11865    } else {
11866        let content = resp.text().await?;
11867        let entity: Option<RetrieveSystemHealthWithIdError> = serde_json::from_str(&content).ok();
11868        Err(Error::ResponseError(ResponseContent { status, content, entity }))
11869    }
11870}
11871
11872/// Retrieves the tenant for the given Id.
11873pub async fn retrieve_tenant_with_id(configuration: &configuration::Configuration, tenant_id: &str, x_fusion_auth_tenant_id: Option<&str>) -> Result<models::TenantResponse, Error<RetrieveTenantWithIdError>> {
11874    // add a prefix to parameters to efficiently prevent name collisions
11875    let p_tenant_id = tenant_id;
11876    let p_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
11877
11878    let uri_str = format!("{}/api/tenant/{tenantId}", configuration.base_path, tenantId=crate::apis::urlencode(p_tenant_id));
11879    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
11880
11881    if let Some(ref user_agent) = configuration.user_agent {
11882        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
11883    }
11884    if let Some(param_value) = p_x_fusion_auth_tenant_id {
11885        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
11886    }
11887    if let Some(ref apikey) = configuration.api_key {
11888        let key = apikey.key.clone();
11889        let value = match apikey.prefix {
11890            Some(ref prefix) => format!("{} {}", prefix, key),
11891            None => key,
11892        };
11893        req_builder = req_builder.header("Authorization", value);
11894    };
11895
11896    let req = req_builder.build()?;
11897    let resp = configuration.client.execute(req).await?;
11898
11899    let status = resp.status();
11900    let content_type = resp
11901        .headers()
11902        .get("content-type")
11903        .and_then(|v| v.to_str().ok())
11904        .unwrap_or("application/octet-stream");
11905    let content_type = super::ContentType::from(content_type);
11906
11907    if !status.is_client_error() && !status.is_server_error() {
11908        let content = resp.text().await?;
11909        match content_type {
11910            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
11911            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::TenantResponse`"))),
11912            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::TenantResponse`")))),
11913        }
11914    } else {
11915        let content = resp.text().await?;
11916        let entity: Option<RetrieveTenantWithIdError> = serde_json::from_str(&content).ok();
11917        Err(Error::ResponseError(ResponseContent { status, content, entity }))
11918    }
11919}
11920
11921/// Retrieves the theme for the given Id.
11922pub async fn retrieve_theme_with_id(configuration: &configuration::Configuration, theme_id: &str) -> Result<models::ThemeResponse, Error<RetrieveThemeWithIdError>> {
11923    // add a prefix to parameters to efficiently prevent name collisions
11924    let p_theme_id = theme_id;
11925
11926    let uri_str = format!("{}/api/theme/{themeId}", configuration.base_path, themeId=crate::apis::urlencode(p_theme_id));
11927    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
11928
11929    if let Some(ref user_agent) = configuration.user_agent {
11930        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
11931    }
11932    if let Some(ref apikey) = configuration.api_key {
11933        let key = apikey.key.clone();
11934        let value = match apikey.prefix {
11935            Some(ref prefix) => format!("{} {}", prefix, key),
11936            None => key,
11937        };
11938        req_builder = req_builder.header("Authorization", value);
11939    };
11940
11941    let req = req_builder.build()?;
11942    let resp = configuration.client.execute(req).await?;
11943
11944    let status = resp.status();
11945    let content_type = resp
11946        .headers()
11947        .get("content-type")
11948        .and_then(|v| v.to_str().ok())
11949        .unwrap_or("application/octet-stream");
11950    let content_type = super::ContentType::from(content_type);
11951
11952    if !status.is_client_error() && !status.is_server_error() {
11953        let content = resp.text().await?;
11954        match content_type {
11955            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
11956            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ThemeResponse`"))),
11957            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ThemeResponse`")))),
11958        }
11959    } else {
11960        let content = resp.text().await?;
11961        let entity: Option<RetrieveThemeWithIdError> = serde_json::from_str(&content).ok();
11962        Err(Error::ResponseError(ResponseContent { status, content, entity }))
11963    }
11964}
11965
11966/// Retrieves the totals report. This contains all the total counts for each application and the global registration count.
11967pub async fn retrieve_total_report_with_id(configuration: &configuration::Configuration, ) -> Result<models::TotalsReportResponse, Error<RetrieveTotalReportWithIdError>> {
11968
11969    let uri_str = format!("{}/api/report/totals", configuration.base_path);
11970    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
11971
11972    if let Some(ref user_agent) = configuration.user_agent {
11973        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
11974    }
11975    if let Some(ref apikey) = configuration.api_key {
11976        let key = apikey.key.clone();
11977        let value = match apikey.prefix {
11978            Some(ref prefix) => format!("{} {}", prefix, key),
11979            None => key,
11980        };
11981        req_builder = req_builder.header("Authorization", value);
11982    };
11983
11984    let req = req_builder.build()?;
11985    let resp = configuration.client.execute(req).await?;
11986
11987    let status = resp.status();
11988    let content_type = resp
11989        .headers()
11990        .get("content-type")
11991        .and_then(|v| v.to_str().ok())
11992        .unwrap_or("application/octet-stream");
11993    let content_type = super::ContentType::from(content_type);
11994
11995    if !status.is_client_error() && !status.is_server_error() {
11996        let content = resp.text().await?;
11997        match content_type {
11998            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
11999            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::TotalsReportResponse`"))),
12000            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::TotalsReportResponse`")))),
12001        }
12002    } else {
12003        let content = resp.text().await?;
12004        let entity: Option<RetrieveTotalReportWithIdError> = serde_json::from_str(&content).ok();
12005        Err(Error::ResponseError(ResponseContent { status, content, entity }))
12006    }
12007}
12008
12009/// Retrieve two-factor recovery codes for a user.
12010pub async fn retrieve_two_factor_recovery_codes_with_id(configuration: &configuration::Configuration, user_id: &str) -> Result<models::TwoFactorRecoveryCodeResponse, Error<RetrieveTwoFactorRecoveryCodesWithIdError>> {
12011    // add a prefix to parameters to efficiently prevent name collisions
12012    let p_user_id = user_id;
12013
12014    let uri_str = format!("{}/api/user/two-factor/recovery-code/{userId}", configuration.base_path, userId=crate::apis::urlencode(p_user_id));
12015    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
12016
12017    if let Some(ref user_agent) = configuration.user_agent {
12018        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
12019    }
12020    if let Some(ref apikey) = configuration.api_key {
12021        let key = apikey.key.clone();
12022        let value = match apikey.prefix {
12023            Some(ref prefix) => format!("{} {}", prefix, key),
12024            None => key,
12025        };
12026        req_builder = req_builder.header("Authorization", value);
12027    };
12028
12029    let req = req_builder.build()?;
12030    let resp = configuration.client.execute(req).await?;
12031
12032    let status = resp.status();
12033    let content_type = resp
12034        .headers()
12035        .get("content-type")
12036        .and_then(|v| v.to_str().ok())
12037        .unwrap_or("application/octet-stream");
12038    let content_type = super::ContentType::from(content_type);
12039
12040    if !status.is_client_error() && !status.is_server_error() {
12041        let content = resp.text().await?;
12042        match content_type {
12043            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
12044            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::TwoFactorRecoveryCodeResponse`"))),
12045            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::TwoFactorRecoveryCodeResponse`")))),
12046        }
12047    } else {
12048        let content = resp.text().await?;
12049        let entity: Option<RetrieveTwoFactorRecoveryCodesWithIdError> = serde_json::from_str(&content).ok();
12050        Err(Error::ResponseError(ResponseContent { status, content, entity }))
12051    }
12052}
12053
12054/// Retrieve a user's two-factor status.  This can be used to see if a user will need to complete a two-factor challenge to complete a login, and optionally identify the state of the two-factor trust across various applications.
12055pub async fn retrieve_two_factor_status_with_id(configuration: &configuration::Configuration, two_factor_trust_id: &str, user_id: Option<&str>, application_id: Option<&str>) -> Result<models::TwoFactorStatusResponse, Error<RetrieveTwoFactorStatusWithIdError>> {
12056    // add a prefix to parameters to efficiently prevent name collisions
12057    let p_two_factor_trust_id = two_factor_trust_id;
12058    let p_user_id = user_id;
12059    let p_application_id = application_id;
12060
12061    let uri_str = format!("{}/api/two-factor/status/{twoFactorTrustId}", configuration.base_path, twoFactorTrustId=crate::apis::urlencode(p_two_factor_trust_id));
12062    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
12063
12064    if let Some(ref param_value) = p_user_id {
12065        req_builder = req_builder.query(&[("userId", &param_value.to_string())]);
12066    }
12067    if let Some(ref param_value) = p_application_id {
12068        req_builder = req_builder.query(&[("applicationId", &param_value.to_string())]);
12069    }
12070    if let Some(ref user_agent) = configuration.user_agent {
12071        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
12072    }
12073    if let Some(ref apikey) = configuration.api_key {
12074        let key = apikey.key.clone();
12075        let value = match apikey.prefix {
12076            Some(ref prefix) => format!("{} {}", prefix, key),
12077            None => key,
12078        };
12079        req_builder = req_builder.header("Authorization", value);
12080    };
12081
12082    let req = req_builder.build()?;
12083    let resp = configuration.client.execute(req).await?;
12084
12085    let status = resp.status();
12086    let content_type = resp
12087        .headers()
12088        .get("content-type")
12089        .and_then(|v| v.to_str().ok())
12090        .unwrap_or("application/octet-stream");
12091    let content_type = super::ContentType::from(content_type);
12092
12093    if !status.is_client_error() && !status.is_server_error() {
12094        let content = resp.text().await?;
12095        match content_type {
12096            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
12097            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::TwoFactorStatusResponse`"))),
12098            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::TwoFactorStatusResponse`")))),
12099        }
12100    } else {
12101        let content = resp.text().await?;
12102        let entity: Option<RetrieveTwoFactorStatusWithIdError> = serde_json::from_str(&content).ok();
12103        Err(Error::ResponseError(ResponseContent { status, content, entity }))
12104    }
12105}
12106
12107/// Retrieves the user for the given username. OR Retrieves the user by a verificationId. The intended use of this API is to retrieve a user after the forgot password workflow has been initiated and you may not know the user's email or username. OR Retrieves the user by a change password Id. The intended use of this API is to retrieve a user after the forgot password workflow has been initiated and you may not know the user's email or username. OR Retrieves the user for the given Id. This method does not use an API key, instead it uses a JSON Web Token (JWT) for authentication. OR Retrieves the user for the given email. OR Retrieves the user for the loginId. The loginId can be either the username or the email.
12108pub async fn retrieve_user(configuration: &configuration::Configuration, username: Option<&str>, x_fusion_auth_tenant_id: Option<&str>, verification_id: Option<&str>, change_password_id: Option<&str>, email: Option<&str>, login_id: Option<&str>) -> Result<models::UserResponse, Error<RetrieveUserError>> {
12109    // add a prefix to parameters to efficiently prevent name collisions
12110    let p_username = username;
12111    let p_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
12112    let p_verification_id = verification_id;
12113    let p_change_password_id = change_password_id;
12114    let p_email = email;
12115    let p_login_id = login_id;
12116
12117    let uri_str = format!("{}/api/user", configuration.base_path);
12118    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
12119
12120    if let Some(ref param_value) = p_username {
12121        req_builder = req_builder.query(&[("username", &param_value.to_string())]);
12122    }
12123    if let Some(ref param_value) = p_verification_id {
12124        req_builder = req_builder.query(&[("verificationId", &param_value.to_string())]);
12125    }
12126    if let Some(ref param_value) = p_change_password_id {
12127        req_builder = req_builder.query(&[("changePasswordId", &param_value.to_string())]);
12128    }
12129    if let Some(ref param_value) = p_email {
12130        req_builder = req_builder.query(&[("email", &param_value.to_string())]);
12131    }
12132    if let Some(ref param_value) = p_login_id {
12133        req_builder = req_builder.query(&[("loginId", &param_value.to_string())]);
12134    }
12135    if let Some(ref user_agent) = configuration.user_agent {
12136        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
12137    }
12138    if let Some(param_value) = p_x_fusion_auth_tenant_id {
12139        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
12140    }
12141    if let Some(ref apikey) = configuration.api_key {
12142        let key = apikey.key.clone();
12143        let value = match apikey.prefix {
12144            Some(ref prefix) => format!("{} {}", prefix, key),
12145            None => key,
12146        };
12147        req_builder = req_builder.header("Authorization", value);
12148    };
12149
12150    let req = req_builder.build()?;
12151    let resp = configuration.client.execute(req).await?;
12152
12153    let status = resp.status();
12154    let content_type = resp
12155        .headers()
12156        .get("content-type")
12157        .and_then(|v| v.to_str().ok())
12158        .unwrap_or("application/octet-stream");
12159    let content_type = super::ContentType::from(content_type);
12160
12161    if !status.is_client_error() && !status.is_server_error() {
12162        let content = resp.text().await?;
12163        match content_type {
12164            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
12165            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::UserResponse`"))),
12166            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::UserResponse`")))),
12167        }
12168    } else {
12169        let content = resp.text().await?;
12170        let entity: Option<RetrieveUserError> = serde_json::from_str(&content).ok();
12171        Err(Error::ResponseError(ResponseContent { status, content, entity }))
12172    }
12173}
12174
12175/// Retrieves all the user actions that are currently inactive. OR Retrieves the user action for the given Id. If you pass in null for the id, this will return all the user actions.
12176pub async fn retrieve_user_action(configuration: &configuration::Configuration, inactive: Option<&str>, x_fusion_auth_tenant_id: Option<&str>) -> Result<models::UserActionResponse, Error<RetrieveUserActionError>> {
12177    // add a prefix to parameters to efficiently prevent name collisions
12178    let p_inactive = inactive;
12179    let p_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
12180
12181    let uri_str = format!("{}/api/user-action", configuration.base_path);
12182    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
12183
12184    if let Some(ref param_value) = p_inactive {
12185        req_builder = req_builder.query(&[("inactive", &param_value.to_string())]);
12186    }
12187    if let Some(ref user_agent) = configuration.user_agent {
12188        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
12189    }
12190    if let Some(param_value) = p_x_fusion_auth_tenant_id {
12191        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
12192    }
12193    if let Some(ref apikey) = configuration.api_key {
12194        let key = apikey.key.clone();
12195        let value = match apikey.prefix {
12196            Some(ref prefix) => format!("{} {}", prefix, key),
12197            None => key,
12198        };
12199        req_builder = req_builder.header("Authorization", value);
12200    };
12201
12202    let req = req_builder.build()?;
12203    let resp = configuration.client.execute(req).await?;
12204
12205    let status = resp.status();
12206    let content_type = resp
12207        .headers()
12208        .get("content-type")
12209        .and_then(|v| v.to_str().ok())
12210        .unwrap_or("application/octet-stream");
12211    let content_type = super::ContentType::from(content_type);
12212
12213    if !status.is_client_error() && !status.is_server_error() {
12214        let content = resp.text().await?;
12215        match content_type {
12216            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
12217            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::UserActionResponse`"))),
12218            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::UserActionResponse`")))),
12219        }
12220    } else {
12221        let content = resp.text().await?;
12222        let entity: Option<RetrieveUserActionError> = serde_json::from_str(&content).ok();
12223        Err(Error::ResponseError(ResponseContent { status, content, entity }))
12224    }
12225}
12226
12227/// Retrieves the user action reason for the given Id. If you pass in null for the id, this will return all the user action reasons.
12228pub async fn retrieve_user_action_reason(configuration: &configuration::Configuration, ) -> Result<models::UserActionReasonResponse, Error<RetrieveUserActionReasonError>> {
12229
12230    let uri_str = format!("{}/api/user-action-reason", configuration.base_path);
12231    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
12232
12233    if let Some(ref user_agent) = configuration.user_agent {
12234        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
12235    }
12236    if let Some(ref apikey) = configuration.api_key {
12237        let key = apikey.key.clone();
12238        let value = match apikey.prefix {
12239            Some(ref prefix) => format!("{} {}", prefix, key),
12240            None => key,
12241        };
12242        req_builder = req_builder.header("Authorization", value);
12243    };
12244
12245    let req = req_builder.build()?;
12246    let resp = configuration.client.execute(req).await?;
12247
12248    let status = resp.status();
12249    let content_type = resp
12250        .headers()
12251        .get("content-type")
12252        .and_then(|v| v.to_str().ok())
12253        .unwrap_or("application/octet-stream");
12254    let content_type = super::ContentType::from(content_type);
12255
12256    if !status.is_client_error() && !status.is_server_error() {
12257        let content = resp.text().await?;
12258        match content_type {
12259            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
12260            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::UserActionReasonResponse`"))),
12261            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::UserActionReasonResponse`")))),
12262        }
12263    } else {
12264        let content = resp.text().await?;
12265        let entity: Option<RetrieveUserActionReasonError> = serde_json::from_str(&content).ok();
12266        Err(Error::ResponseError(ResponseContent { status, content, entity }))
12267    }
12268}
12269
12270/// Retrieves the user action reason for the given Id. If you pass in null for the id, this will return all the user action reasons.
12271pub async fn retrieve_user_action_reason_with_id(configuration: &configuration::Configuration, user_action_reason_id: &str) -> Result<models::UserActionReasonResponse, Error<RetrieveUserActionReasonWithIdError>> {
12272    // add a prefix to parameters to efficiently prevent name collisions
12273    let p_user_action_reason_id = user_action_reason_id;
12274
12275    let uri_str = format!("{}/api/user-action-reason/{userActionReasonId}", configuration.base_path, userActionReasonId=crate::apis::urlencode(p_user_action_reason_id));
12276    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
12277
12278    if let Some(ref user_agent) = configuration.user_agent {
12279        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
12280    }
12281    if let Some(ref apikey) = configuration.api_key {
12282        let key = apikey.key.clone();
12283        let value = match apikey.prefix {
12284            Some(ref prefix) => format!("{} {}", prefix, key),
12285            None => key,
12286        };
12287        req_builder = req_builder.header("Authorization", value);
12288    };
12289
12290    let req = req_builder.build()?;
12291    let resp = configuration.client.execute(req).await?;
12292
12293    let status = resp.status();
12294    let content_type = resp
12295        .headers()
12296        .get("content-type")
12297        .and_then(|v| v.to_str().ok())
12298        .unwrap_or("application/octet-stream");
12299    let content_type = super::ContentType::from(content_type);
12300
12301    if !status.is_client_error() && !status.is_server_error() {
12302        let content = resp.text().await?;
12303        match content_type {
12304            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
12305            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::UserActionReasonResponse`"))),
12306            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::UserActionReasonResponse`")))),
12307        }
12308    } else {
12309        let content = resp.text().await?;
12310        let entity: Option<RetrieveUserActionReasonWithIdError> = serde_json::from_str(&content).ok();
12311        Err(Error::ResponseError(ResponseContent { status, content, entity }))
12312    }
12313}
12314
12315/// Retrieves the user action for the given Id. If you pass in null for the id, this will return all the user actions.
12316pub async fn retrieve_user_action_with_id(configuration: &configuration::Configuration, user_action_id: &str, x_fusion_auth_tenant_id: Option<&str>) -> Result<models::UserActionResponse, Error<RetrieveUserActionWithIdError>> {
12317    // add a prefix to parameters to efficiently prevent name collisions
12318    let p_user_action_id = user_action_id;
12319    let p_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
12320
12321    let uri_str = format!("{}/api/user-action/{userActionId}", configuration.base_path, userActionId=crate::apis::urlencode(p_user_action_id));
12322    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
12323
12324    if let Some(ref user_agent) = configuration.user_agent {
12325        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
12326    }
12327    if let Some(param_value) = p_x_fusion_auth_tenant_id {
12328        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
12329    }
12330    if let Some(ref apikey) = configuration.api_key {
12331        let key = apikey.key.clone();
12332        let value = match apikey.prefix {
12333            Some(ref prefix) => format!("{} {}", prefix, key),
12334            None => key,
12335        };
12336        req_builder = req_builder.header("Authorization", value);
12337    };
12338
12339    let req = req_builder.build()?;
12340    let resp = configuration.client.execute(req).await?;
12341
12342    let status = resp.status();
12343    let content_type = resp
12344        .headers()
12345        .get("content-type")
12346        .and_then(|v| v.to_str().ok())
12347        .unwrap_or("application/octet-stream");
12348    let content_type = super::ContentType::from(content_type);
12349
12350    if !status.is_client_error() && !status.is_server_error() {
12351        let content = resp.text().await?;
12352        match content_type {
12353            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
12354            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::UserActionResponse`"))),
12355            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::UserActionResponse`")))),
12356        }
12357    } else {
12358        let content = resp.text().await?;
12359        let entity: Option<RetrieveUserActionWithIdError> = serde_json::from_str(&content).ok();
12360        Err(Error::ResponseError(ResponseContent { status, content, entity }))
12361    }
12362}
12363
12364/// Retrieves all the actions for the user with the given Id that are currently preventing the User from logging in. OR Retrieves all the actions for the user with the given Id. This will return all time based actions that are active, and inactive as well as non-time based actions. OR Retrieves all the actions for the user with the given Id that are currently active. An active action means one that is time based and has not been canceled, and has not ended. OR Retrieves all the actions for the user with the given Id that are currently inactive. An inactive action means one that is time based and has been canceled or has expired, or is not time based.
12365pub async fn retrieve_user_actioning(configuration: &configuration::Configuration, user_id: Option<&str>, preventing_login: Option<&str>, active: Option<&str>) -> Result<models::ActionResponse, Error<RetrieveUserActioningError>> {
12366    // add a prefix to parameters to efficiently prevent name collisions
12367    let p_user_id = user_id;
12368    let p_preventing_login = preventing_login;
12369    let p_active = active;
12370
12371    let uri_str = format!("{}/api/user/action", configuration.base_path);
12372    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
12373
12374    if let Some(ref param_value) = p_user_id {
12375        req_builder = req_builder.query(&[("userId", &param_value.to_string())]);
12376    }
12377    if let Some(ref param_value) = p_preventing_login {
12378        req_builder = req_builder.query(&[("preventingLogin", &param_value.to_string())]);
12379    }
12380    if let Some(ref param_value) = p_active {
12381        req_builder = req_builder.query(&[("active", &param_value.to_string())]);
12382    }
12383    if let Some(ref user_agent) = configuration.user_agent {
12384        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
12385    }
12386    if let Some(ref apikey) = configuration.api_key {
12387        let key = apikey.key.clone();
12388        let value = match apikey.prefix {
12389            Some(ref prefix) => format!("{} {}", prefix, key),
12390            None => key,
12391        };
12392        req_builder = req_builder.header("Authorization", value);
12393    };
12394
12395    let req = req_builder.build()?;
12396    let resp = configuration.client.execute(req).await?;
12397
12398    let status = resp.status();
12399    let content_type = resp
12400        .headers()
12401        .get("content-type")
12402        .and_then(|v| v.to_str().ok())
12403        .unwrap_or("application/octet-stream");
12404    let content_type = super::ContentType::from(content_type);
12405
12406    if !status.is_client_error() && !status.is_server_error() {
12407        let content = resp.text().await?;
12408        match content_type {
12409            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
12410            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ActionResponse`"))),
12411            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ActionResponse`")))),
12412        }
12413    } else {
12414        let content = resp.text().await?;
12415        let entity: Option<RetrieveUserActioningError> = serde_json::from_str(&content).ok();
12416        Err(Error::ResponseError(ResponseContent { status, content, entity }))
12417    }
12418}
12419
12420/// Check to see if the user must obtain a Trust Request Id in order to complete a change password request. When a user has enabled Two-Factor authentication, before you are allowed to use the Change Password API to change your password, you must obtain a Trust Request Id by completing a Two-Factor Step-Up authentication.  An HTTP status code of 400 with a general error code of [TrustTokenRequired] indicates that a Trust Token is required to make a POST request to this API. OR Check to see if the user must obtain a Trust Token Id in order to complete a change password request. When a user has enabled Two-Factor authentication, before you are allowed to use the Change Password API to change your password, you must obtain a Trust Token by completing a Two-Factor Step-Up authentication.  An HTTP status code of 400 with a general error code of [TrustTokenRequired] indicates that a Trust Token is required to make a POST request to this API.
12421pub async fn retrieve_user_change_password(configuration: &configuration::Configuration, login_id: Option<&str>) -> Result<(), Error<RetrieveUserChangePasswordError>> {
12422    // add a prefix to parameters to efficiently prevent name collisions
12423    let p_login_id = login_id;
12424
12425    let uri_str = format!("{}/api/user/change-password", configuration.base_path);
12426    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
12427
12428    if let Some(ref param_value) = p_login_id {
12429        req_builder = req_builder.query(&[("loginId", &param_value.to_string())]);
12430    }
12431    if let Some(ref user_agent) = configuration.user_agent {
12432        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
12433    }
12434    if let Some(ref apikey) = configuration.api_key {
12435        let key = apikey.key.clone();
12436        let value = match apikey.prefix {
12437            Some(ref prefix) => format!("{} {}", prefix, key),
12438            None => key,
12439        };
12440        req_builder = req_builder.header("Authorization", value);
12441    };
12442
12443    let req = req_builder.build()?;
12444    let resp = configuration.client.execute(req).await?;
12445
12446    let status = resp.status();
12447
12448    if !status.is_client_error() && !status.is_server_error() {
12449        Ok(())
12450    } else {
12451        let content = resp.text().await?;
12452        let entity: Option<RetrieveUserChangePasswordError> = serde_json::from_str(&content).ok();
12453        Err(Error::ResponseError(ResponseContent { status, content, entity }))
12454    }
12455}
12456
12457/// Retrieves all the comments for the user with the given Id.
12458pub async fn retrieve_user_comments_with_id(configuration: &configuration::Configuration, user_id: &str, x_fusion_auth_tenant_id: Option<&str>) -> Result<models::UserCommentResponse, Error<RetrieveUserCommentsWithIdError>> {
12459    // add a prefix to parameters to efficiently prevent name collisions
12460    let p_user_id = user_id;
12461    let p_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
12462
12463    let uri_str = format!("{}/api/user/comment/{userId}", configuration.base_path, userId=crate::apis::urlencode(p_user_id));
12464    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
12465
12466    if let Some(ref user_agent) = configuration.user_agent {
12467        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
12468    }
12469    if let Some(param_value) = p_x_fusion_auth_tenant_id {
12470        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
12471    }
12472    if let Some(ref apikey) = configuration.api_key {
12473        let key = apikey.key.clone();
12474        let value = match apikey.prefix {
12475            Some(ref prefix) => format!("{} {}", prefix, key),
12476            None => key,
12477        };
12478        req_builder = req_builder.header("Authorization", value);
12479    };
12480
12481    let req = req_builder.build()?;
12482    let resp = configuration.client.execute(req).await?;
12483
12484    let status = resp.status();
12485    let content_type = resp
12486        .headers()
12487        .get("content-type")
12488        .and_then(|v| v.to_str().ok())
12489        .unwrap_or("application/octet-stream");
12490    let content_type = super::ContentType::from(content_type);
12491
12492    if !status.is_client_error() && !status.is_server_error() {
12493        let content = resp.text().await?;
12494        match content_type {
12495            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
12496            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::UserCommentResponse`"))),
12497            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::UserCommentResponse`")))),
12498        }
12499    } else {
12500        let content = resp.text().await?;
12501        let entity: Option<RetrieveUserCommentsWithIdError> = serde_json::from_str(&content).ok();
12502        Err(Error::ResponseError(ResponseContent { status, content, entity }))
12503    }
12504}
12505
12506/// Retrieve a single User consent by Id.
12507pub async fn retrieve_user_consent_with_id(configuration: &configuration::Configuration, user_consent_id: &str) -> Result<models::UserConsentResponse, Error<RetrieveUserConsentWithIdError>> {
12508    // add a prefix to parameters to efficiently prevent name collisions
12509    let p_user_consent_id = user_consent_id;
12510
12511    let uri_str = format!("{}/api/user/consent/{userConsentId}", configuration.base_path, userConsentId=crate::apis::urlencode(p_user_consent_id));
12512    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
12513
12514    if let Some(ref user_agent) = configuration.user_agent {
12515        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
12516    }
12517    if let Some(ref apikey) = configuration.api_key {
12518        let key = apikey.key.clone();
12519        let value = match apikey.prefix {
12520            Some(ref prefix) => format!("{} {}", prefix, key),
12521            None => key,
12522        };
12523        req_builder = req_builder.header("Authorization", value);
12524    };
12525
12526    let req = req_builder.build()?;
12527    let resp = configuration.client.execute(req).await?;
12528
12529    let status = resp.status();
12530    let content_type = resp
12531        .headers()
12532        .get("content-type")
12533        .and_then(|v| v.to_str().ok())
12534        .unwrap_or("application/octet-stream");
12535    let content_type = super::ContentType::from(content_type);
12536
12537    if !status.is_client_error() && !status.is_server_error() {
12538        let content = resp.text().await?;
12539        match content_type {
12540            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
12541            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::UserConsentResponse`"))),
12542            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::UserConsentResponse`")))),
12543        }
12544    } else {
12545        let content = resp.text().await?;
12546        let entity: Option<RetrieveUserConsentWithIdError> = serde_json::from_str(&content).ok();
12547        Err(Error::ResponseError(ResponseContent { status, content, entity }))
12548    }
12549}
12550
12551/// Retrieves all the consents for a User.
12552pub async fn retrieve_user_consents_with_id(configuration: &configuration::Configuration, user_id: Option<&str>) -> Result<models::UserConsentResponse, Error<RetrieveUserConsentsWithIdError>> {
12553    // add a prefix to parameters to efficiently prevent name collisions
12554    let p_user_id = user_id;
12555
12556    let uri_str = format!("{}/api/user/consent", configuration.base_path);
12557    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
12558
12559    if let Some(ref param_value) = p_user_id {
12560        req_builder = req_builder.query(&[("userId", &param_value.to_string())]);
12561    }
12562    if let Some(ref user_agent) = configuration.user_agent {
12563        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
12564    }
12565    if let Some(ref apikey) = configuration.api_key {
12566        let key = apikey.key.clone();
12567        let value = match apikey.prefix {
12568            Some(ref prefix) => format!("{} {}", prefix, key),
12569            None => key,
12570        };
12571        req_builder = req_builder.header("Authorization", value);
12572    };
12573
12574    let req = req_builder.build()?;
12575    let resp = configuration.client.execute(req).await?;
12576
12577    let status = resp.status();
12578    let content_type = resp
12579        .headers()
12580        .get("content-type")
12581        .and_then(|v| v.to_str().ok())
12582        .unwrap_or("application/octet-stream");
12583    let content_type = super::ContentType::from(content_type);
12584
12585    if !status.is_client_error() && !status.is_server_error() {
12586        let content = resp.text().await?;
12587        match content_type {
12588            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
12589            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::UserConsentResponse`"))),
12590            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::UserConsentResponse`")))),
12591        }
12592    } else {
12593        let content = resp.text().await?;
12594        let entity: Option<RetrieveUserConsentsWithIdError> = serde_json::from_str(&content).ok();
12595        Err(Error::ResponseError(ResponseContent { status, content, entity }))
12596    }
12597}
12598
12599/// Call the UserInfo endpoint to retrieve User Claims from the access token issued by FusionAuth.
12600pub async fn retrieve_user_info_from_access_token_with_id(configuration: &configuration::Configuration, ) -> Result<serde_json::Value, Error<RetrieveUserInfoFromAccessTokenWithIdError>> {
12601
12602    let uri_str = format!("{}/oauth2/userinfo", configuration.base_path);
12603    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
12604
12605    if let Some(ref user_agent) = configuration.user_agent {
12606        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
12607    }
12608    if let Some(ref token) = configuration.bearer_access_token {
12609        req_builder = req_builder.bearer_auth(token.to_owned());
12610    };
12611
12612    let req = req_builder.build()?;
12613    let resp = configuration.client.execute(req).await?;
12614
12615    let status = resp.status();
12616    let content_type = resp
12617        .headers()
12618        .get("content-type")
12619        .and_then(|v| v.to_str().ok())
12620        .unwrap_or("application/octet-stream");
12621    let content_type = super::ContentType::from(content_type);
12622
12623    if !status.is_client_error() && !status.is_server_error() {
12624        let content = resp.text().await?;
12625        match content_type {
12626            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
12627            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `serde_json::Value`"))),
12628            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `serde_json::Value`")))),
12629        }
12630    } else {
12631        let content = resp.text().await?;
12632        let entity: Option<RetrieveUserInfoFromAccessTokenWithIdError> = serde_json::from_str(&content).ok();
12633        Err(Error::ResponseError(ResponseContent { status, content, entity }))
12634    }
12635}
12636
12637/// Retrieves the last number of login records. OR Retrieves the last number of login records for a user.
12638pub async fn retrieve_user_recent_login(configuration: &configuration::Configuration, offset: Option<&str>, limit: Option<&str>, user_id: Option<&str>) -> Result<models::RecentLoginResponse, Error<RetrieveUserRecentLoginError>> {
12639    // add a prefix to parameters to efficiently prevent name collisions
12640    let p_offset = offset;
12641    let p_limit = limit;
12642    let p_user_id = user_id;
12643
12644    let uri_str = format!("{}/api/user/recent-login", configuration.base_path);
12645    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
12646
12647    if let Some(ref param_value) = p_offset {
12648        req_builder = req_builder.query(&[("offset", &param_value.to_string())]);
12649    }
12650    if let Some(ref param_value) = p_limit {
12651        req_builder = req_builder.query(&[("limit", &param_value.to_string())]);
12652    }
12653    if let Some(ref param_value) = p_user_id {
12654        req_builder = req_builder.query(&[("userId", &param_value.to_string())]);
12655    }
12656    if let Some(ref user_agent) = configuration.user_agent {
12657        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
12658    }
12659    if let Some(ref apikey) = configuration.api_key {
12660        let key = apikey.key.clone();
12661        let value = match apikey.prefix {
12662            Some(ref prefix) => format!("{} {}", prefix, key),
12663            None => key,
12664        };
12665        req_builder = req_builder.header("Authorization", value);
12666    };
12667
12668    let req = req_builder.build()?;
12669    let resp = configuration.client.execute(req).await?;
12670
12671    let status = resp.status();
12672    let content_type = resp
12673        .headers()
12674        .get("content-type")
12675        .and_then(|v| v.to_str().ok())
12676        .unwrap_or("application/octet-stream");
12677    let content_type = super::ContentType::from(content_type);
12678
12679    if !status.is_client_error() && !status.is_server_error() {
12680        let content = resp.text().await?;
12681        match content_type {
12682            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
12683            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::RecentLoginResponse`"))),
12684            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::RecentLoginResponse`")))),
12685        }
12686    } else {
12687        let content = resp.text().await?;
12688        let entity: Option<RetrieveUserRecentLoginError> = serde_json::from_str(&content).ok();
12689        Err(Error::ResponseError(ResponseContent { status, content, entity }))
12690    }
12691}
12692
12693/// Retrieves the user for the given Id.
12694pub async fn retrieve_user_with_id(configuration: &configuration::Configuration, user_id: &str, x_fusion_auth_tenant_id: Option<&str>) -> Result<models::UserResponse, Error<RetrieveUserWithIdError>> {
12695    // add a prefix to parameters to efficiently prevent name collisions
12696    let p_user_id = user_id;
12697    let p_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
12698
12699    let uri_str = format!("{}/api/user/{userId}", configuration.base_path, userId=crate::apis::urlencode(p_user_id));
12700    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
12701
12702    if let Some(ref user_agent) = configuration.user_agent {
12703        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
12704    }
12705    if let Some(param_value) = p_x_fusion_auth_tenant_id {
12706        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
12707    }
12708    if let Some(ref apikey) = configuration.api_key {
12709        let key = apikey.key.clone();
12710        let value = match apikey.prefix {
12711            Some(ref prefix) => format!("{} {}", prefix, key),
12712            None => key,
12713        };
12714        req_builder = req_builder.header("Authorization", value);
12715    };
12716
12717    let req = req_builder.build()?;
12718    let resp = configuration.client.execute(req).await?;
12719
12720    let status = resp.status();
12721    let content_type = resp
12722        .headers()
12723        .get("content-type")
12724        .and_then(|v| v.to_str().ok())
12725        .unwrap_or("application/octet-stream");
12726    let content_type = super::ContentType::from(content_type);
12727
12728    if !status.is_client_error() && !status.is_server_error() {
12729        let content = resp.text().await?;
12730        match content_type {
12731            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
12732            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::UserResponse`"))),
12733            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::UserResponse`")))),
12734        }
12735    } else {
12736        let content = resp.text().await?;
12737        let entity: Option<RetrieveUserWithIdError> = serde_json::from_str(&content).ok();
12738        Err(Error::ResponseError(ResponseContent { status, content, entity }))
12739    }
12740}
12741
12742/// Retrieves the FusionAuth version string.
12743pub async fn retrieve_version_with_id(configuration: &configuration::Configuration, ) -> Result<models::VersionResponse, Error<RetrieveVersionWithIdError>> {
12744
12745    let uri_str = format!("{}/api/system/version", configuration.base_path);
12746    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
12747
12748    if let Some(ref user_agent) = configuration.user_agent {
12749        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
12750    }
12751    if let Some(ref apikey) = configuration.api_key {
12752        let key = apikey.key.clone();
12753        let value = match apikey.prefix {
12754            Some(ref prefix) => format!("{} {}", prefix, key),
12755            None => key,
12756        };
12757        req_builder = req_builder.header("Authorization", value);
12758    };
12759
12760    let req = req_builder.build()?;
12761    let resp = configuration.client.execute(req).await?;
12762
12763    let status = resp.status();
12764    let content_type = resp
12765        .headers()
12766        .get("content-type")
12767        .and_then(|v| v.to_str().ok())
12768        .unwrap_or("application/octet-stream");
12769    let content_type = super::ContentType::from(content_type);
12770
12771    if !status.is_client_error() && !status.is_server_error() {
12772        let content = resp.text().await?;
12773        match content_type {
12774            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
12775            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::VersionResponse`"))),
12776            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::VersionResponse`")))),
12777        }
12778    } else {
12779        let content = resp.text().await?;
12780        let entity: Option<RetrieveVersionWithIdError> = serde_json::from_str(&content).ok();
12781        Err(Error::ResponseError(ResponseContent { status, content, entity }))
12782    }
12783}
12784
12785/// Retrieves the WebAuthn credential for the given Id.
12786pub async fn retrieve_web_authn_credential_with_id(configuration: &configuration::Configuration, id: &str) -> Result<models::WebAuthnCredentialResponse, Error<RetrieveWebAuthnCredentialWithIdError>> {
12787    // add a prefix to parameters to efficiently prevent name collisions
12788    let p_id = id;
12789
12790    let uri_str = format!("{}/api/webauthn/{id}", configuration.base_path, id=crate::apis::urlencode(p_id));
12791    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
12792
12793    if let Some(ref user_agent) = configuration.user_agent {
12794        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
12795    }
12796    if let Some(ref apikey) = configuration.api_key {
12797        let key = apikey.key.clone();
12798        let value = match apikey.prefix {
12799            Some(ref prefix) => format!("{} {}", prefix, key),
12800            None => key,
12801        };
12802        req_builder = req_builder.header("Authorization", value);
12803    };
12804
12805    let req = req_builder.build()?;
12806    let resp = configuration.client.execute(req).await?;
12807
12808    let status = resp.status();
12809    let content_type = resp
12810        .headers()
12811        .get("content-type")
12812        .and_then(|v| v.to_str().ok())
12813        .unwrap_or("application/octet-stream");
12814    let content_type = super::ContentType::from(content_type);
12815
12816    if !status.is_client_error() && !status.is_server_error() {
12817        let content = resp.text().await?;
12818        match content_type {
12819            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
12820            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::WebAuthnCredentialResponse`"))),
12821            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::WebAuthnCredentialResponse`")))),
12822        }
12823    } else {
12824        let content = resp.text().await?;
12825        let entity: Option<RetrieveWebAuthnCredentialWithIdError> = serde_json::from_str(&content).ok();
12826        Err(Error::ResponseError(ResponseContent { status, content, entity }))
12827    }
12828}
12829
12830/// Retrieves all WebAuthn credentials for the given user.
12831pub async fn retrieve_web_authn_credentials_for_user_with_id(configuration: &configuration::Configuration, user_id: Option<&str>) -> Result<models::WebAuthnCredentialResponse, Error<RetrieveWebAuthnCredentialsForUserWithIdError>> {
12832    // add a prefix to parameters to efficiently prevent name collisions
12833    let p_user_id = user_id;
12834
12835    let uri_str = format!("{}/api/webauthn", configuration.base_path);
12836    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
12837
12838    if let Some(ref param_value) = p_user_id {
12839        req_builder = req_builder.query(&[("userId", &param_value.to_string())]);
12840    }
12841    if let Some(ref user_agent) = configuration.user_agent {
12842        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
12843    }
12844    if let Some(ref apikey) = configuration.api_key {
12845        let key = apikey.key.clone();
12846        let value = match apikey.prefix {
12847            Some(ref prefix) => format!("{} {}", prefix, key),
12848            None => key,
12849        };
12850        req_builder = req_builder.header("Authorization", value);
12851    };
12852
12853    let req = req_builder.build()?;
12854    let resp = configuration.client.execute(req).await?;
12855
12856    let status = resp.status();
12857    let content_type = resp
12858        .headers()
12859        .get("content-type")
12860        .and_then(|v| v.to_str().ok())
12861        .unwrap_or("application/octet-stream");
12862    let content_type = super::ContentType::from(content_type);
12863
12864    if !status.is_client_error() && !status.is_server_error() {
12865        let content = resp.text().await?;
12866        match content_type {
12867            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
12868            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::WebAuthnCredentialResponse`"))),
12869            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::WebAuthnCredentialResponse`")))),
12870        }
12871    } else {
12872        let content = resp.text().await?;
12873        let entity: Option<RetrieveWebAuthnCredentialsForUserWithIdError> = serde_json::from_str(&content).ok();
12874        Err(Error::ResponseError(ResponseContent { status, content, entity }))
12875    }
12876}
12877
12878/// Retrieves the webhook for the given Id. If you pass in null for the id, this will return all the webhooks.
12879pub async fn retrieve_webhook(configuration: &configuration::Configuration, ) -> Result<models::WebhookResponse, Error<RetrieveWebhookError>> {
12880
12881    let uri_str = format!("{}/api/webhook", configuration.base_path);
12882    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
12883
12884    if let Some(ref user_agent) = configuration.user_agent {
12885        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
12886    }
12887    if let Some(ref apikey) = configuration.api_key {
12888        let key = apikey.key.clone();
12889        let value = match apikey.prefix {
12890            Some(ref prefix) => format!("{} {}", prefix, key),
12891            None => key,
12892        };
12893        req_builder = req_builder.header("Authorization", value);
12894    };
12895
12896    let req = req_builder.build()?;
12897    let resp = configuration.client.execute(req).await?;
12898
12899    let status = resp.status();
12900    let content_type = resp
12901        .headers()
12902        .get("content-type")
12903        .and_then(|v| v.to_str().ok())
12904        .unwrap_or("application/octet-stream");
12905    let content_type = super::ContentType::from(content_type);
12906
12907    if !status.is_client_error() && !status.is_server_error() {
12908        let content = resp.text().await?;
12909        match content_type {
12910            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
12911            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::WebhookResponse`"))),
12912            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::WebhookResponse`")))),
12913        }
12914    } else {
12915        let content = resp.text().await?;
12916        let entity: Option<RetrieveWebhookError> = serde_json::from_str(&content).ok();
12917        Err(Error::ResponseError(ResponseContent { status, content, entity }))
12918    }
12919}
12920
12921/// Retrieves a single webhook attempt log for the given Id.
12922pub async fn retrieve_webhook_attempt_log_with_id(configuration: &configuration::Configuration, webhook_attempt_log_id: &str) -> Result<models::WebhookAttemptLogResponse, Error<RetrieveWebhookAttemptLogWithIdError>> {
12923    // add a prefix to parameters to efficiently prevent name collisions
12924    let p_webhook_attempt_log_id = webhook_attempt_log_id;
12925
12926    let uri_str = format!("{}/api/system/webhook-attempt-log/{webhookAttemptLogId}", configuration.base_path, webhookAttemptLogId=crate::apis::urlencode(p_webhook_attempt_log_id));
12927    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
12928
12929    if let Some(ref user_agent) = configuration.user_agent {
12930        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
12931    }
12932    if let Some(ref apikey) = configuration.api_key {
12933        let key = apikey.key.clone();
12934        let value = match apikey.prefix {
12935            Some(ref prefix) => format!("{} {}", prefix, key),
12936            None => key,
12937        };
12938        req_builder = req_builder.header("Authorization", value);
12939    };
12940
12941    let req = req_builder.build()?;
12942    let resp = configuration.client.execute(req).await?;
12943
12944    let status = resp.status();
12945    let content_type = resp
12946        .headers()
12947        .get("content-type")
12948        .and_then(|v| v.to_str().ok())
12949        .unwrap_or("application/octet-stream");
12950    let content_type = super::ContentType::from(content_type);
12951
12952    if !status.is_client_error() && !status.is_server_error() {
12953        let content = resp.text().await?;
12954        match content_type {
12955            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
12956            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::WebhookAttemptLogResponse`"))),
12957            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::WebhookAttemptLogResponse`")))),
12958        }
12959    } else {
12960        let content = resp.text().await?;
12961        let entity: Option<RetrieveWebhookAttemptLogWithIdError> = serde_json::from_str(&content).ok();
12962        Err(Error::ResponseError(ResponseContent { status, content, entity }))
12963    }
12964}
12965
12966/// Retrieves a single webhook event log for the given Id.
12967pub async fn retrieve_webhook_event_log_with_id(configuration: &configuration::Configuration, webhook_event_log_id: &str) -> Result<models::WebhookEventLogResponse, Error<RetrieveWebhookEventLogWithIdError>> {
12968    // add a prefix to parameters to efficiently prevent name collisions
12969    let p_webhook_event_log_id = webhook_event_log_id;
12970
12971    let uri_str = format!("{}/api/system/webhook-event-log/{webhookEventLogId}", configuration.base_path, webhookEventLogId=crate::apis::urlencode(p_webhook_event_log_id));
12972    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
12973
12974    if let Some(ref user_agent) = configuration.user_agent {
12975        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
12976    }
12977    if let Some(ref apikey) = configuration.api_key {
12978        let key = apikey.key.clone();
12979        let value = match apikey.prefix {
12980            Some(ref prefix) => format!("{} {}", prefix, key),
12981            None => key,
12982        };
12983        req_builder = req_builder.header("Authorization", value);
12984    };
12985
12986    let req = req_builder.build()?;
12987    let resp = configuration.client.execute(req).await?;
12988
12989    let status = resp.status();
12990    let content_type = resp
12991        .headers()
12992        .get("content-type")
12993        .and_then(|v| v.to_str().ok())
12994        .unwrap_or("application/octet-stream");
12995    let content_type = super::ContentType::from(content_type);
12996
12997    if !status.is_client_error() && !status.is_server_error() {
12998        let content = resp.text().await?;
12999        match content_type {
13000            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
13001            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::WebhookEventLogResponse`"))),
13002            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::WebhookEventLogResponse`")))),
13003        }
13004    } else {
13005        let content = resp.text().await?;
13006        let entity: Option<RetrieveWebhookEventLogWithIdError> = serde_json::from_str(&content).ok();
13007        Err(Error::ResponseError(ResponseContent { status, content, entity }))
13008    }
13009}
13010
13011/// Retrieves the webhook for the given Id. If you pass in null for the id, this will return all the webhooks.
13012pub async fn retrieve_webhook_with_id(configuration: &configuration::Configuration, webhook_id: &str) -> Result<models::WebhookResponse, Error<RetrieveWebhookWithIdError>> {
13013    // add a prefix to parameters to efficiently prevent name collisions
13014    let p_webhook_id = webhook_id;
13015
13016    let uri_str = format!("{}/api/webhook/{webhookId}", configuration.base_path, webhookId=crate::apis::urlencode(p_webhook_id));
13017    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
13018
13019    if let Some(ref user_agent) = configuration.user_agent {
13020        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
13021    }
13022    if let Some(ref apikey) = configuration.api_key {
13023        let key = apikey.key.clone();
13024        let value = match apikey.prefix {
13025            Some(ref prefix) => format!("{} {}", prefix, key),
13026            None => key,
13027        };
13028        req_builder = req_builder.header("Authorization", value);
13029    };
13030
13031    let req = req_builder.build()?;
13032    let resp = configuration.client.execute(req).await?;
13033
13034    let status = resp.status();
13035    let content_type = resp
13036        .headers()
13037        .get("content-type")
13038        .and_then(|v| v.to_str().ok())
13039        .unwrap_or("application/octet-stream");
13040    let content_type = super::ContentType::from(content_type);
13041
13042    if !status.is_client_error() && !status.is_server_error() {
13043        let content = resp.text().await?;
13044        match content_type {
13045            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
13046            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::WebhookResponse`"))),
13047            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::WebhookResponse`")))),
13048        }
13049    } else {
13050        let content = resp.text().await?;
13051        let entity: Option<RetrieveWebhookWithIdError> = serde_json::from_str(&content).ok();
13052        Err(Error::ResponseError(ResponseContent { status, content, entity }))
13053    }
13054}
13055
13056/// Revokes a single refresh token by the unique Id. The unique Id is not sensitive as it cannot be used to obtain another JWT.
13057pub async fn revoke_refresh_token_by_id_with_id(configuration: &configuration::Configuration, token_id: &str) -> Result<(), Error<RevokeRefreshTokenByIdWithIdError>> {
13058    // add a prefix to parameters to efficiently prevent name collisions
13059    let p_token_id = token_id;
13060
13061    let uri_str = format!("{}/api/jwt/refresh/{tokenId}", configuration.base_path, tokenId=crate::apis::urlencode(p_token_id));
13062    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
13063
13064    if let Some(ref user_agent) = configuration.user_agent {
13065        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
13066    }
13067    if let Some(ref apikey) = configuration.api_key {
13068        let key = apikey.key.clone();
13069        let value = match apikey.prefix {
13070            Some(ref prefix) => format!("{} {}", prefix, key),
13071            None => key,
13072        };
13073        req_builder = req_builder.header("Authorization", value);
13074    };
13075
13076    let req = req_builder.build()?;
13077    let resp = configuration.client.execute(req).await?;
13078
13079    let status = resp.status();
13080
13081    if !status.is_client_error() && !status.is_server_error() {
13082        Ok(())
13083    } else {
13084        let content = resp.text().await?;
13085        let entity: Option<RevokeRefreshTokenByIdWithIdError> = serde_json::from_str(&content).ok();
13086        Err(Error::ResponseError(ResponseContent { status, content, entity }))
13087    }
13088}
13089
13090/// Revokes a single User consent by Id.
13091pub async fn revoke_user_consent_with_id(configuration: &configuration::Configuration, user_consent_id: &str) -> Result<(), Error<RevokeUserConsentWithIdError>> {
13092    // add a prefix to parameters to efficiently prevent name collisions
13093    let p_user_consent_id = user_consent_id;
13094
13095    let uri_str = format!("{}/api/user/consent/{userConsentId}", configuration.base_path, userConsentId=crate::apis::urlencode(p_user_consent_id));
13096    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
13097
13098    if let Some(ref user_agent) = configuration.user_agent {
13099        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
13100    }
13101    if let Some(ref apikey) = configuration.api_key {
13102        let key = apikey.key.clone();
13103        let value = match apikey.prefix {
13104            Some(ref prefix) => format!("{} {}", prefix, key),
13105            None => key,
13106        };
13107        req_builder = req_builder.header("Authorization", value);
13108    };
13109
13110    let req = req_builder.build()?;
13111    let resp = configuration.client.execute(req).await?;
13112
13113    let status = resp.status();
13114
13115    if !status.is_client_error() && !status.is_server_error() {
13116        Ok(())
13117    } else {
13118        let content = resp.text().await?;
13119        let entity: Option<RevokeUserConsentWithIdError> = serde_json::from_str(&content).ok();
13120        Err(Error::ResponseError(ResponseContent { status, content, entity }))
13121    }
13122}
13123
13124/// Searches applications with the specified criteria and pagination.
13125pub async fn search_applications_with_id(configuration: &configuration::Configuration, application_search_request: Option<models::ApplicationSearchRequest>) -> Result<models::ApplicationSearchResponse, Error<SearchApplicationsWithIdError>> {
13126    // add a prefix to parameters to efficiently prevent name collisions
13127    let p_application_search_request = application_search_request;
13128
13129    let uri_str = format!("{}/api/application/search", configuration.base_path);
13130    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
13131
13132    if let Some(ref user_agent) = configuration.user_agent {
13133        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
13134    }
13135    if let Some(ref apikey) = configuration.api_key {
13136        let key = apikey.key.clone();
13137        let value = match apikey.prefix {
13138            Some(ref prefix) => format!("{} {}", prefix, key),
13139            None => key,
13140        };
13141        req_builder = req_builder.header("Authorization", value);
13142    };
13143    req_builder = req_builder.json(&p_application_search_request);
13144
13145    let req = req_builder.build()?;
13146    let resp = configuration.client.execute(req).await?;
13147
13148    let status = resp.status();
13149    let content_type = resp
13150        .headers()
13151        .get("content-type")
13152        .and_then(|v| v.to_str().ok())
13153        .unwrap_or("application/octet-stream");
13154    let content_type = super::ContentType::from(content_type);
13155
13156    if !status.is_client_error() && !status.is_server_error() {
13157        let content = resp.text().await?;
13158        match content_type {
13159            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
13160            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ApplicationSearchResponse`"))),
13161            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ApplicationSearchResponse`")))),
13162        }
13163    } else {
13164        let content = resp.text().await?;
13165        let entity: Option<SearchApplicationsWithIdError> = serde_json::from_str(&content).ok();
13166        Err(Error::ResponseError(ResponseContent { status, content, entity }))
13167    }
13168}
13169
13170/// Searches the audit logs with the specified criteria and pagination.
13171pub async fn search_audit_logs_with_id(configuration: &configuration::Configuration, audit_log_search_request: Option<models::AuditLogSearchRequest>) -> Result<models::AuditLogSearchResponse, Error<SearchAuditLogsWithIdError>> {
13172    // add a prefix to parameters to efficiently prevent name collisions
13173    let p_audit_log_search_request = audit_log_search_request;
13174
13175    let uri_str = format!("{}/api/system/audit-log/search", configuration.base_path);
13176    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
13177
13178    if let Some(ref user_agent) = configuration.user_agent {
13179        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
13180    }
13181    if let Some(ref apikey) = configuration.api_key {
13182        let key = apikey.key.clone();
13183        let value = match apikey.prefix {
13184            Some(ref prefix) => format!("{} {}", prefix, key),
13185            None => key,
13186        };
13187        req_builder = req_builder.header("Authorization", value);
13188    };
13189    req_builder = req_builder.json(&p_audit_log_search_request);
13190
13191    let req = req_builder.build()?;
13192    let resp = configuration.client.execute(req).await?;
13193
13194    let status = resp.status();
13195    let content_type = resp
13196        .headers()
13197        .get("content-type")
13198        .and_then(|v| v.to_str().ok())
13199        .unwrap_or("application/octet-stream");
13200    let content_type = super::ContentType::from(content_type);
13201
13202    if !status.is_client_error() && !status.is_server_error() {
13203        let content = resp.text().await?;
13204        match content_type {
13205            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
13206            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::AuditLogSearchResponse`"))),
13207            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::AuditLogSearchResponse`")))),
13208        }
13209    } else {
13210        let content = resp.text().await?;
13211        let entity: Option<SearchAuditLogsWithIdError> = serde_json::from_str(&content).ok();
13212        Err(Error::ResponseError(ResponseContent { status, content, entity }))
13213    }
13214}
13215
13216/// Searches consents with the specified criteria and pagination.
13217pub async fn search_consents_with_id(configuration: &configuration::Configuration, consent_search_request: Option<models::ConsentSearchRequest>) -> Result<models::ConsentSearchResponse, Error<SearchConsentsWithIdError>> {
13218    // add a prefix to parameters to efficiently prevent name collisions
13219    let p_consent_search_request = consent_search_request;
13220
13221    let uri_str = format!("{}/api/consent/search", configuration.base_path);
13222    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
13223
13224    if let Some(ref user_agent) = configuration.user_agent {
13225        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
13226    }
13227    if let Some(ref apikey) = configuration.api_key {
13228        let key = apikey.key.clone();
13229        let value = match apikey.prefix {
13230            Some(ref prefix) => format!("{} {}", prefix, key),
13231            None => key,
13232        };
13233        req_builder = req_builder.header("Authorization", value);
13234    };
13235    req_builder = req_builder.json(&p_consent_search_request);
13236
13237    let req = req_builder.build()?;
13238    let resp = configuration.client.execute(req).await?;
13239
13240    let status = resp.status();
13241    let content_type = resp
13242        .headers()
13243        .get("content-type")
13244        .and_then(|v| v.to_str().ok())
13245        .unwrap_or("application/octet-stream");
13246    let content_type = super::ContentType::from(content_type);
13247
13248    if !status.is_client_error() && !status.is_server_error() {
13249        let content = resp.text().await?;
13250        match content_type {
13251            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
13252            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ConsentSearchResponse`"))),
13253            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ConsentSearchResponse`")))),
13254        }
13255    } else {
13256        let content = resp.text().await?;
13257        let entity: Option<SearchConsentsWithIdError> = serde_json::from_str(&content).ok();
13258        Err(Error::ResponseError(ResponseContent { status, content, entity }))
13259    }
13260}
13261
13262/// Searches email templates with the specified criteria and pagination.
13263pub async fn search_email_templates_with_id(configuration: &configuration::Configuration, email_template_search_request: Option<models::EmailTemplateSearchRequest>) -> Result<models::EmailTemplateSearchResponse, Error<SearchEmailTemplatesWithIdError>> {
13264    // add a prefix to parameters to efficiently prevent name collisions
13265    let p_email_template_search_request = email_template_search_request;
13266
13267    let uri_str = format!("{}/api/email/template/search", configuration.base_path);
13268    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
13269
13270    if let Some(ref user_agent) = configuration.user_agent {
13271        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
13272    }
13273    if let Some(ref apikey) = configuration.api_key {
13274        let key = apikey.key.clone();
13275        let value = match apikey.prefix {
13276            Some(ref prefix) => format!("{} {}", prefix, key),
13277            None => key,
13278        };
13279        req_builder = req_builder.header("Authorization", value);
13280    };
13281    req_builder = req_builder.json(&p_email_template_search_request);
13282
13283    let req = req_builder.build()?;
13284    let resp = configuration.client.execute(req).await?;
13285
13286    let status = resp.status();
13287    let content_type = resp
13288        .headers()
13289        .get("content-type")
13290        .and_then(|v| v.to_str().ok())
13291        .unwrap_or("application/octet-stream");
13292    let content_type = super::ContentType::from(content_type);
13293
13294    if !status.is_client_error() && !status.is_server_error() {
13295        let content = resp.text().await?;
13296        match content_type {
13297            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
13298            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::EmailTemplateSearchResponse`"))),
13299            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::EmailTemplateSearchResponse`")))),
13300        }
13301    } else {
13302        let content = resp.text().await?;
13303        let entity: Option<SearchEmailTemplatesWithIdError> = serde_json::from_str(&content).ok();
13304        Err(Error::ResponseError(ResponseContent { status, content, entity }))
13305    }
13306}
13307
13308/// Retrieves the entities for the given ids. If any Id is invalid, it is ignored.
13309pub async fn search_entities_by_ids_with_id(configuration: &configuration::Configuration, ids: Option<&str>) -> Result<models::EntitySearchResponse, Error<SearchEntitiesByIdsWithIdError>> {
13310    // add a prefix to parameters to efficiently prevent name collisions
13311    let p_ids = ids;
13312
13313    let uri_str = format!("{}/api/entity/search", configuration.base_path);
13314    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
13315
13316    if let Some(ref param_value) = p_ids {
13317        req_builder = req_builder.query(&[("ids", &param_value.to_string())]);
13318    }
13319    if let Some(ref user_agent) = configuration.user_agent {
13320        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
13321    }
13322    if let Some(ref apikey) = configuration.api_key {
13323        let key = apikey.key.clone();
13324        let value = match apikey.prefix {
13325            Some(ref prefix) => format!("{} {}", prefix, key),
13326            None => key,
13327        };
13328        req_builder = req_builder.header("Authorization", value);
13329    };
13330
13331    let req = req_builder.build()?;
13332    let resp = configuration.client.execute(req).await?;
13333
13334    let status = resp.status();
13335    let content_type = resp
13336        .headers()
13337        .get("content-type")
13338        .and_then(|v| v.to_str().ok())
13339        .unwrap_or("application/octet-stream");
13340    let content_type = super::ContentType::from(content_type);
13341
13342    if !status.is_client_error() && !status.is_server_error() {
13343        let content = resp.text().await?;
13344        match content_type {
13345            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
13346            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::EntitySearchResponse`"))),
13347            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::EntitySearchResponse`")))),
13348        }
13349    } else {
13350        let content = resp.text().await?;
13351        let entity: Option<SearchEntitiesByIdsWithIdError> = serde_json::from_str(&content).ok();
13352        Err(Error::ResponseError(ResponseContent { status, content, entity }))
13353    }
13354}
13355
13356/// Searches entities with the specified criteria and pagination.
13357pub async fn search_entities_with_id(configuration: &configuration::Configuration, entity_search_request: Option<models::EntitySearchRequest>) -> Result<models::EntitySearchResponse, Error<SearchEntitiesWithIdError>> {
13358    // add a prefix to parameters to efficiently prevent name collisions
13359    let p_entity_search_request = entity_search_request;
13360
13361    let uri_str = format!("{}/api/entity/search", configuration.base_path);
13362    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
13363
13364    if let Some(ref user_agent) = configuration.user_agent {
13365        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
13366    }
13367    if let Some(ref apikey) = configuration.api_key {
13368        let key = apikey.key.clone();
13369        let value = match apikey.prefix {
13370            Some(ref prefix) => format!("{} {}", prefix, key),
13371            None => key,
13372        };
13373        req_builder = req_builder.header("Authorization", value);
13374    };
13375    req_builder = req_builder.json(&p_entity_search_request);
13376
13377    let req = req_builder.build()?;
13378    let resp = configuration.client.execute(req).await?;
13379
13380    let status = resp.status();
13381    let content_type = resp
13382        .headers()
13383        .get("content-type")
13384        .and_then(|v| v.to_str().ok())
13385        .unwrap_or("application/octet-stream");
13386    let content_type = super::ContentType::from(content_type);
13387
13388    if !status.is_client_error() && !status.is_server_error() {
13389        let content = resp.text().await?;
13390        match content_type {
13391            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
13392            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::EntitySearchResponse`"))),
13393            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::EntitySearchResponse`")))),
13394        }
13395    } else {
13396        let content = resp.text().await?;
13397        let entity: Option<SearchEntitiesWithIdError> = serde_json::from_str(&content).ok();
13398        Err(Error::ResponseError(ResponseContent { status, content, entity }))
13399    }
13400}
13401
13402/// Searches Entity Grants with the specified criteria and pagination.
13403pub async fn search_entity_grants_with_id(configuration: &configuration::Configuration, entity_grant_search_request: Option<models::EntityGrantSearchRequest>) -> Result<models::EntityGrantSearchResponse, Error<SearchEntityGrantsWithIdError>> {
13404    // add a prefix to parameters to efficiently prevent name collisions
13405    let p_entity_grant_search_request = entity_grant_search_request;
13406
13407    let uri_str = format!("{}/api/entity/grant/search", configuration.base_path);
13408    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
13409
13410    if let Some(ref user_agent) = configuration.user_agent {
13411        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
13412    }
13413    if let Some(ref apikey) = configuration.api_key {
13414        let key = apikey.key.clone();
13415        let value = match apikey.prefix {
13416            Some(ref prefix) => format!("{} {}", prefix, key),
13417            None => key,
13418        };
13419        req_builder = req_builder.header("Authorization", value);
13420    };
13421    req_builder = req_builder.json(&p_entity_grant_search_request);
13422
13423    let req = req_builder.build()?;
13424    let resp = configuration.client.execute(req).await?;
13425
13426    let status = resp.status();
13427    let content_type = resp
13428        .headers()
13429        .get("content-type")
13430        .and_then(|v| v.to_str().ok())
13431        .unwrap_or("application/octet-stream");
13432    let content_type = super::ContentType::from(content_type);
13433
13434    if !status.is_client_error() && !status.is_server_error() {
13435        let content = resp.text().await?;
13436        match content_type {
13437            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
13438            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::EntityGrantSearchResponse`"))),
13439            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::EntityGrantSearchResponse`")))),
13440        }
13441    } else {
13442        let content = resp.text().await?;
13443        let entity: Option<SearchEntityGrantsWithIdError> = serde_json::from_str(&content).ok();
13444        Err(Error::ResponseError(ResponseContent { status, content, entity }))
13445    }
13446}
13447
13448/// Searches the entity types with the specified criteria and pagination.
13449pub async fn search_entity_types_with_id(configuration: &configuration::Configuration, entity_type_search_request: Option<models::EntityTypeSearchRequest>) -> Result<models::EntityTypeSearchResponse, Error<SearchEntityTypesWithIdError>> {
13450    // add a prefix to parameters to efficiently prevent name collisions
13451    let p_entity_type_search_request = entity_type_search_request;
13452
13453    let uri_str = format!("{}/api/entity/type/search", configuration.base_path);
13454    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
13455
13456    if let Some(ref user_agent) = configuration.user_agent {
13457        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
13458    }
13459    if let Some(ref apikey) = configuration.api_key {
13460        let key = apikey.key.clone();
13461        let value = match apikey.prefix {
13462            Some(ref prefix) => format!("{} {}", prefix, key),
13463            None => key,
13464        };
13465        req_builder = req_builder.header("Authorization", value);
13466    };
13467    req_builder = req_builder.json(&p_entity_type_search_request);
13468
13469    let req = req_builder.build()?;
13470    let resp = configuration.client.execute(req).await?;
13471
13472    let status = resp.status();
13473    let content_type = resp
13474        .headers()
13475        .get("content-type")
13476        .and_then(|v| v.to_str().ok())
13477        .unwrap_or("application/octet-stream");
13478    let content_type = super::ContentType::from(content_type);
13479
13480    if !status.is_client_error() && !status.is_server_error() {
13481        let content = resp.text().await?;
13482        match content_type {
13483            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
13484            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::EntityTypeSearchResponse`"))),
13485            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::EntityTypeSearchResponse`")))),
13486        }
13487    } else {
13488        let content = resp.text().await?;
13489        let entity: Option<SearchEntityTypesWithIdError> = serde_json::from_str(&content).ok();
13490        Err(Error::ResponseError(ResponseContent { status, content, entity }))
13491    }
13492}
13493
13494/// Searches the event logs with the specified criteria and pagination.
13495pub async fn search_event_logs_with_id(configuration: &configuration::Configuration, event_log_search_request: Option<models::EventLogSearchRequest>) -> Result<models::EventLogSearchResponse, Error<SearchEventLogsWithIdError>> {
13496    // add a prefix to parameters to efficiently prevent name collisions
13497    let p_event_log_search_request = event_log_search_request;
13498
13499    let uri_str = format!("{}/api/system/event-log/search", configuration.base_path);
13500    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
13501
13502    if let Some(ref user_agent) = configuration.user_agent {
13503        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
13504    }
13505    if let Some(ref apikey) = configuration.api_key {
13506        let key = apikey.key.clone();
13507        let value = match apikey.prefix {
13508            Some(ref prefix) => format!("{} {}", prefix, key),
13509            None => key,
13510        };
13511        req_builder = req_builder.header("Authorization", value);
13512    };
13513    req_builder = req_builder.json(&p_event_log_search_request);
13514
13515    let req = req_builder.build()?;
13516    let resp = configuration.client.execute(req).await?;
13517
13518    let status = resp.status();
13519    let content_type = resp
13520        .headers()
13521        .get("content-type")
13522        .and_then(|v| v.to_str().ok())
13523        .unwrap_or("application/octet-stream");
13524    let content_type = super::ContentType::from(content_type);
13525
13526    if !status.is_client_error() && !status.is_server_error() {
13527        let content = resp.text().await?;
13528        match content_type {
13529            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
13530            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::EventLogSearchResponse`"))),
13531            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::EventLogSearchResponse`")))),
13532        }
13533    } else {
13534        let content = resp.text().await?;
13535        let entity: Option<SearchEventLogsWithIdError> = serde_json::from_str(&content).ok();
13536        Err(Error::ResponseError(ResponseContent { status, content, entity }))
13537    }
13538}
13539
13540/// Searches group members with the specified criteria and pagination.
13541pub async fn search_group_members_with_id(configuration: &configuration::Configuration, group_member_search_request: Option<models::GroupMemberSearchRequest>) -> Result<models::GroupMemberSearchResponse, Error<SearchGroupMembersWithIdError>> {
13542    // add a prefix to parameters to efficiently prevent name collisions
13543    let p_group_member_search_request = group_member_search_request;
13544
13545    let uri_str = format!("{}/api/group/member/search", configuration.base_path);
13546    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
13547
13548    if let Some(ref user_agent) = configuration.user_agent {
13549        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
13550    }
13551    if let Some(ref apikey) = configuration.api_key {
13552        let key = apikey.key.clone();
13553        let value = match apikey.prefix {
13554            Some(ref prefix) => format!("{} {}", prefix, key),
13555            None => key,
13556        };
13557        req_builder = req_builder.header("Authorization", value);
13558    };
13559    req_builder = req_builder.json(&p_group_member_search_request);
13560
13561    let req = req_builder.build()?;
13562    let resp = configuration.client.execute(req).await?;
13563
13564    let status = resp.status();
13565    let content_type = resp
13566        .headers()
13567        .get("content-type")
13568        .and_then(|v| v.to_str().ok())
13569        .unwrap_or("application/octet-stream");
13570    let content_type = super::ContentType::from(content_type);
13571
13572    if !status.is_client_error() && !status.is_server_error() {
13573        let content = resp.text().await?;
13574        match content_type {
13575            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
13576            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GroupMemberSearchResponse`"))),
13577            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GroupMemberSearchResponse`")))),
13578        }
13579    } else {
13580        let content = resp.text().await?;
13581        let entity: Option<SearchGroupMembersWithIdError> = serde_json::from_str(&content).ok();
13582        Err(Error::ResponseError(ResponseContent { status, content, entity }))
13583    }
13584}
13585
13586/// Searches groups with the specified criteria and pagination.
13587pub async fn search_groups_with_id(configuration: &configuration::Configuration, group_search_request: Option<models::GroupSearchRequest>) -> Result<models::GroupSearchResponse, Error<SearchGroupsWithIdError>> {
13588    // add a prefix to parameters to efficiently prevent name collisions
13589    let p_group_search_request = group_search_request;
13590
13591    let uri_str = format!("{}/api/group/search", configuration.base_path);
13592    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
13593
13594    if let Some(ref user_agent) = configuration.user_agent {
13595        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
13596    }
13597    if let Some(ref apikey) = configuration.api_key {
13598        let key = apikey.key.clone();
13599        let value = match apikey.prefix {
13600            Some(ref prefix) => format!("{} {}", prefix, key),
13601            None => key,
13602        };
13603        req_builder = req_builder.header("Authorization", value);
13604    };
13605    req_builder = req_builder.json(&p_group_search_request);
13606
13607    let req = req_builder.build()?;
13608    let resp = configuration.client.execute(req).await?;
13609
13610    let status = resp.status();
13611    let content_type = resp
13612        .headers()
13613        .get("content-type")
13614        .and_then(|v| v.to_str().ok())
13615        .unwrap_or("application/octet-stream");
13616    let content_type = super::ContentType::from(content_type);
13617
13618    if !status.is_client_error() && !status.is_server_error() {
13619        let content = resp.text().await?;
13620        match content_type {
13621            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
13622            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GroupSearchResponse`"))),
13623            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GroupSearchResponse`")))),
13624        }
13625    } else {
13626        let content = resp.text().await?;
13627        let entity: Option<SearchGroupsWithIdError> = serde_json::from_str(&content).ok();
13628        Err(Error::ResponseError(ResponseContent { status, content, entity }))
13629    }
13630}
13631
13632/// Searches identity providers with the specified criteria and pagination.
13633pub async fn search_identity_providers_with_id(configuration: &configuration::Configuration, identity_provider_search_request: Option<models::IdentityProviderSearchRequest>) -> Result<models::IdentityProviderSearchResponse, Error<SearchIdentityProvidersWithIdError>> {
13634    // add a prefix to parameters to efficiently prevent name collisions
13635    let p_identity_provider_search_request = identity_provider_search_request;
13636
13637    let uri_str = format!("{}/api/identity-provider/search", configuration.base_path);
13638    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
13639
13640    if let Some(ref user_agent) = configuration.user_agent {
13641        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
13642    }
13643    if let Some(ref apikey) = configuration.api_key {
13644        let key = apikey.key.clone();
13645        let value = match apikey.prefix {
13646            Some(ref prefix) => format!("{} {}", prefix, key),
13647            None => key,
13648        };
13649        req_builder = req_builder.header("Authorization", value);
13650    };
13651    req_builder = req_builder.json(&p_identity_provider_search_request);
13652
13653    let req = req_builder.build()?;
13654    let resp = configuration.client.execute(req).await?;
13655
13656    let status = resp.status();
13657    let content_type = resp
13658        .headers()
13659        .get("content-type")
13660        .and_then(|v| v.to_str().ok())
13661        .unwrap_or("application/octet-stream");
13662    let content_type = super::ContentType::from(content_type);
13663
13664    if !status.is_client_error() && !status.is_server_error() {
13665        let content = resp.text().await?;
13666        match content_type {
13667            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
13668            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IdentityProviderSearchResponse`"))),
13669            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IdentityProviderSearchResponse`")))),
13670        }
13671    } else {
13672        let content = resp.text().await?;
13673        let entity: Option<SearchIdentityProvidersWithIdError> = serde_json::from_str(&content).ok();
13674        Err(Error::ResponseError(ResponseContent { status, content, entity }))
13675    }
13676}
13677
13678/// Searches the IP Access Control Lists with the specified criteria and pagination.
13679pub async fn search_ip_access_control_lists_with_id(configuration: &configuration::Configuration, ip_access_control_list_search_request: Option<models::IpAccessControlListSearchRequest>) -> Result<models::IpAccessControlListSearchResponse, Error<SearchIpAccessControlListsWithIdError>> {
13680    // add a prefix to parameters to efficiently prevent name collisions
13681    let p_ip_access_control_list_search_request = ip_access_control_list_search_request;
13682
13683    let uri_str = format!("{}/api/ip-acl/search", configuration.base_path);
13684    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
13685
13686    if let Some(ref user_agent) = configuration.user_agent {
13687        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
13688    }
13689    if let Some(ref apikey) = configuration.api_key {
13690        let key = apikey.key.clone();
13691        let value = match apikey.prefix {
13692            Some(ref prefix) => format!("{} {}", prefix, key),
13693            None => key,
13694        };
13695        req_builder = req_builder.header("Authorization", value);
13696    };
13697    req_builder = req_builder.json(&p_ip_access_control_list_search_request);
13698
13699    let req = req_builder.build()?;
13700    let resp = configuration.client.execute(req).await?;
13701
13702    let status = resp.status();
13703    let content_type = resp
13704        .headers()
13705        .get("content-type")
13706        .and_then(|v| v.to_str().ok())
13707        .unwrap_or("application/octet-stream");
13708    let content_type = super::ContentType::from(content_type);
13709
13710    if !status.is_client_error() && !status.is_server_error() {
13711        let content = resp.text().await?;
13712        match content_type {
13713            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
13714            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IpAccessControlListSearchResponse`"))),
13715            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IpAccessControlListSearchResponse`")))),
13716        }
13717    } else {
13718        let content = resp.text().await?;
13719        let entity: Option<SearchIpAccessControlListsWithIdError> = serde_json::from_str(&content).ok();
13720        Err(Error::ResponseError(ResponseContent { status, content, entity }))
13721    }
13722}
13723
13724/// Searches keys with the specified criteria and pagination.
13725pub async fn search_keys_with_id(configuration: &configuration::Configuration, key_search_request: Option<models::KeySearchRequest>) -> Result<models::KeySearchResponse, Error<SearchKeysWithIdError>> {
13726    // add a prefix to parameters to efficiently prevent name collisions
13727    let p_key_search_request = key_search_request;
13728
13729    let uri_str = format!("{}/api/key/search", configuration.base_path);
13730    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
13731
13732    if let Some(ref user_agent) = configuration.user_agent {
13733        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
13734    }
13735    if let Some(ref apikey) = configuration.api_key {
13736        let key = apikey.key.clone();
13737        let value = match apikey.prefix {
13738            Some(ref prefix) => format!("{} {}", prefix, key),
13739            None => key,
13740        };
13741        req_builder = req_builder.header("Authorization", value);
13742    };
13743    req_builder = req_builder.json(&p_key_search_request);
13744
13745    let req = req_builder.build()?;
13746    let resp = configuration.client.execute(req).await?;
13747
13748    let status = resp.status();
13749    let content_type = resp
13750        .headers()
13751        .get("content-type")
13752        .and_then(|v| v.to_str().ok())
13753        .unwrap_or("application/octet-stream");
13754    let content_type = super::ContentType::from(content_type);
13755
13756    if !status.is_client_error() && !status.is_server_error() {
13757        let content = resp.text().await?;
13758        match content_type {
13759            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
13760            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::KeySearchResponse`"))),
13761            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::KeySearchResponse`")))),
13762        }
13763    } else {
13764        let content = resp.text().await?;
13765        let entity: Option<SearchKeysWithIdError> = serde_json::from_str(&content).ok();
13766        Err(Error::ResponseError(ResponseContent { status, content, entity }))
13767    }
13768}
13769
13770/// Searches lambdas with the specified criteria and pagination.
13771pub async fn search_lambdas_with_id(configuration: &configuration::Configuration, lambda_search_request: Option<models::LambdaSearchRequest>) -> Result<models::LambdaSearchResponse, Error<SearchLambdasWithIdError>> {
13772    // add a prefix to parameters to efficiently prevent name collisions
13773    let p_lambda_search_request = lambda_search_request;
13774
13775    let uri_str = format!("{}/api/lambda/search", configuration.base_path);
13776    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
13777
13778    if let Some(ref user_agent) = configuration.user_agent {
13779        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
13780    }
13781    if let Some(ref apikey) = configuration.api_key {
13782        let key = apikey.key.clone();
13783        let value = match apikey.prefix {
13784            Some(ref prefix) => format!("{} {}", prefix, key),
13785            None => key,
13786        };
13787        req_builder = req_builder.header("Authorization", value);
13788    };
13789    req_builder = req_builder.json(&p_lambda_search_request);
13790
13791    let req = req_builder.build()?;
13792    let resp = configuration.client.execute(req).await?;
13793
13794    let status = resp.status();
13795    let content_type = resp
13796        .headers()
13797        .get("content-type")
13798        .and_then(|v| v.to_str().ok())
13799        .unwrap_or("application/octet-stream");
13800    let content_type = super::ContentType::from(content_type);
13801
13802    if !status.is_client_error() && !status.is_server_error() {
13803        let content = resp.text().await?;
13804        match content_type {
13805            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
13806            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::LambdaSearchResponse`"))),
13807            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::LambdaSearchResponse`")))),
13808        }
13809    } else {
13810        let content = resp.text().await?;
13811        let entity: Option<SearchLambdasWithIdError> = serde_json::from_str(&content).ok();
13812        Err(Error::ResponseError(ResponseContent { status, content, entity }))
13813    }
13814}
13815
13816/// Searches the login records with the specified criteria and pagination.
13817pub async fn search_login_records_with_id(configuration: &configuration::Configuration, login_record_search_request: Option<models::LoginRecordSearchRequest>) -> Result<models::LoginRecordSearchResponse, Error<SearchLoginRecordsWithIdError>> {
13818    // add a prefix to parameters to efficiently prevent name collisions
13819    let p_login_record_search_request = login_record_search_request;
13820
13821    let uri_str = format!("{}/api/system/login-record/search", configuration.base_path);
13822    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
13823
13824    if let Some(ref user_agent) = configuration.user_agent {
13825        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
13826    }
13827    if let Some(ref apikey) = configuration.api_key {
13828        let key = apikey.key.clone();
13829        let value = match apikey.prefix {
13830            Some(ref prefix) => format!("{} {}", prefix, key),
13831            None => key,
13832        };
13833        req_builder = req_builder.header("Authorization", value);
13834    };
13835    req_builder = req_builder.json(&p_login_record_search_request);
13836
13837    let req = req_builder.build()?;
13838    let resp = configuration.client.execute(req).await?;
13839
13840    let status = resp.status();
13841    let content_type = resp
13842        .headers()
13843        .get("content-type")
13844        .and_then(|v| v.to_str().ok())
13845        .unwrap_or("application/octet-stream");
13846    let content_type = super::ContentType::from(content_type);
13847
13848    if !status.is_client_error() && !status.is_server_error() {
13849        let content = resp.text().await?;
13850        match content_type {
13851            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
13852            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::LoginRecordSearchResponse`"))),
13853            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::LoginRecordSearchResponse`")))),
13854        }
13855    } else {
13856        let content = resp.text().await?;
13857        let entity: Option<SearchLoginRecordsWithIdError> = serde_json::from_str(&content).ok();
13858        Err(Error::ResponseError(ResponseContent { status, content, entity }))
13859    }
13860}
13861
13862/// Searches tenants with the specified criteria and pagination.
13863pub async fn search_tenants_with_id(configuration: &configuration::Configuration, tenant_search_request: Option<models::TenantSearchRequest>) -> Result<models::TenantSearchResponse, Error<SearchTenantsWithIdError>> {
13864    // add a prefix to parameters to efficiently prevent name collisions
13865    let p_tenant_search_request = tenant_search_request;
13866
13867    let uri_str = format!("{}/api/tenant/search", configuration.base_path);
13868    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
13869
13870    if let Some(ref user_agent) = configuration.user_agent {
13871        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
13872    }
13873    if let Some(ref apikey) = configuration.api_key {
13874        let key = apikey.key.clone();
13875        let value = match apikey.prefix {
13876            Some(ref prefix) => format!("{} {}", prefix, key),
13877            None => key,
13878        };
13879        req_builder = req_builder.header("Authorization", value);
13880    };
13881    req_builder = req_builder.json(&p_tenant_search_request);
13882
13883    let req = req_builder.build()?;
13884    let resp = configuration.client.execute(req).await?;
13885
13886    let status = resp.status();
13887    let content_type = resp
13888        .headers()
13889        .get("content-type")
13890        .and_then(|v| v.to_str().ok())
13891        .unwrap_or("application/octet-stream");
13892    let content_type = super::ContentType::from(content_type);
13893
13894    if !status.is_client_error() && !status.is_server_error() {
13895        let content = resp.text().await?;
13896        match content_type {
13897            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
13898            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::TenantSearchResponse`"))),
13899            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::TenantSearchResponse`")))),
13900        }
13901    } else {
13902        let content = resp.text().await?;
13903        let entity: Option<SearchTenantsWithIdError> = serde_json::from_str(&content).ok();
13904        Err(Error::ResponseError(ResponseContent { status, content, entity }))
13905    }
13906}
13907
13908/// Searches themes with the specified criteria and pagination.
13909pub async fn search_themes_with_id(configuration: &configuration::Configuration, theme_search_request: Option<models::ThemeSearchRequest>) -> Result<models::ThemeSearchResponse, Error<SearchThemesWithIdError>> {
13910    // add a prefix to parameters to efficiently prevent name collisions
13911    let p_theme_search_request = theme_search_request;
13912
13913    let uri_str = format!("{}/api/theme/search", configuration.base_path);
13914    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
13915
13916    if let Some(ref user_agent) = configuration.user_agent {
13917        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
13918    }
13919    if let Some(ref apikey) = configuration.api_key {
13920        let key = apikey.key.clone();
13921        let value = match apikey.prefix {
13922            Some(ref prefix) => format!("{} {}", prefix, key),
13923            None => key,
13924        };
13925        req_builder = req_builder.header("Authorization", value);
13926    };
13927    req_builder = req_builder.json(&p_theme_search_request);
13928
13929    let req = req_builder.build()?;
13930    let resp = configuration.client.execute(req).await?;
13931
13932    let status = resp.status();
13933    let content_type = resp
13934        .headers()
13935        .get("content-type")
13936        .and_then(|v| v.to_str().ok())
13937        .unwrap_or("application/octet-stream");
13938    let content_type = super::ContentType::from(content_type);
13939
13940    if !status.is_client_error() && !status.is_server_error() {
13941        let content = resp.text().await?;
13942        match content_type {
13943            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
13944            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ThemeSearchResponse`"))),
13945            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ThemeSearchResponse`")))),
13946        }
13947    } else {
13948        let content = resp.text().await?;
13949        let entity: Option<SearchThemesWithIdError> = serde_json::from_str(&content).ok();
13950        Err(Error::ResponseError(ResponseContent { status, content, entity }))
13951    }
13952}
13953
13954/// Searches user comments with the specified criteria and pagination.
13955pub async fn search_user_comments_with_id(configuration: &configuration::Configuration, user_comment_search_request: Option<models::UserCommentSearchRequest>) -> Result<models::UserCommentSearchResponse, Error<SearchUserCommentsWithIdError>> {
13956    // add a prefix to parameters to efficiently prevent name collisions
13957    let p_user_comment_search_request = user_comment_search_request;
13958
13959    let uri_str = format!("{}/api/user/comment/search", configuration.base_path);
13960    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
13961
13962    if let Some(ref user_agent) = configuration.user_agent {
13963        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
13964    }
13965    if let Some(ref apikey) = configuration.api_key {
13966        let key = apikey.key.clone();
13967        let value = match apikey.prefix {
13968            Some(ref prefix) => format!("{} {}", prefix, key),
13969            None => key,
13970        };
13971        req_builder = req_builder.header("Authorization", value);
13972    };
13973    req_builder = req_builder.json(&p_user_comment_search_request);
13974
13975    let req = req_builder.build()?;
13976    let resp = configuration.client.execute(req).await?;
13977
13978    let status = resp.status();
13979    let content_type = resp
13980        .headers()
13981        .get("content-type")
13982        .and_then(|v| v.to_str().ok())
13983        .unwrap_or("application/octet-stream");
13984    let content_type = super::ContentType::from(content_type);
13985
13986    if !status.is_client_error() && !status.is_server_error() {
13987        let content = resp.text().await?;
13988        match content_type {
13989            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
13990            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::UserCommentSearchResponse`"))),
13991            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::UserCommentSearchResponse`")))),
13992        }
13993    } else {
13994        let content = resp.text().await?;
13995        let entity: Option<SearchUserCommentsWithIdError> = serde_json::from_str(&content).ok();
13996        Err(Error::ResponseError(ResponseContent { status, content, entity }))
13997    }
13998}
13999
14000/// Retrieves the users for the given ids. If any Id is invalid, it is ignored.
14001pub async fn search_users_by_ids_with_id(configuration: &configuration::Configuration, ids: Option<&str>) -> Result<models::SearchResponse, Error<SearchUsersByIdsWithIdError>> {
14002    // add a prefix to parameters to efficiently prevent name collisions
14003    let p_ids = ids;
14004
14005    let uri_str = format!("{}/api/user/search", configuration.base_path);
14006    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
14007
14008    if let Some(ref param_value) = p_ids {
14009        req_builder = req_builder.query(&[("ids", &param_value.to_string())]);
14010    }
14011    if let Some(ref user_agent) = configuration.user_agent {
14012        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
14013    }
14014    if let Some(ref apikey) = configuration.api_key {
14015        let key = apikey.key.clone();
14016        let value = match apikey.prefix {
14017            Some(ref prefix) => format!("{} {}", prefix, key),
14018            None => key,
14019        };
14020        req_builder = req_builder.header("Authorization", value);
14021    };
14022
14023    let req = req_builder.build()?;
14024    let resp = configuration.client.execute(req).await?;
14025
14026    let status = resp.status();
14027    let content_type = resp
14028        .headers()
14029        .get("content-type")
14030        .and_then(|v| v.to_str().ok())
14031        .unwrap_or("application/octet-stream");
14032    let content_type = super::ContentType::from(content_type);
14033
14034    if !status.is_client_error() && !status.is_server_error() {
14035        let content = resp.text().await?;
14036        match content_type {
14037            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
14038            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::SearchResponse`"))),
14039            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::SearchResponse`")))),
14040        }
14041    } else {
14042        let content = resp.text().await?;
14043        let entity: Option<SearchUsersByIdsWithIdError> = serde_json::from_str(&content).ok();
14044        Err(Error::ResponseError(ResponseContent { status, content, entity }))
14045    }
14046}
14047
14048/// Retrieves the users for the given search criteria and pagination.
14049pub async fn search_users_by_query_with_id(configuration: &configuration::Configuration, search_request: Option<models::SearchRequest>) -> Result<models::SearchResponse, Error<SearchUsersByQueryWithIdError>> {
14050    // add a prefix to parameters to efficiently prevent name collisions
14051    let p_search_request = search_request;
14052
14053    let uri_str = format!("{}/api/user/search", configuration.base_path);
14054    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
14055
14056    if let Some(ref user_agent) = configuration.user_agent {
14057        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
14058    }
14059    if let Some(ref apikey) = configuration.api_key {
14060        let key = apikey.key.clone();
14061        let value = match apikey.prefix {
14062            Some(ref prefix) => format!("{} {}", prefix, key),
14063            None => key,
14064        };
14065        req_builder = req_builder.header("Authorization", value);
14066    };
14067    req_builder = req_builder.json(&p_search_request);
14068
14069    let req = req_builder.build()?;
14070    let resp = configuration.client.execute(req).await?;
14071
14072    let status = resp.status();
14073    let content_type = resp
14074        .headers()
14075        .get("content-type")
14076        .and_then(|v| v.to_str().ok())
14077        .unwrap_or("application/octet-stream");
14078    let content_type = super::ContentType::from(content_type);
14079
14080    if !status.is_client_error() && !status.is_server_error() {
14081        let content = resp.text().await?;
14082        match content_type {
14083            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
14084            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::SearchResponse`"))),
14085            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::SearchResponse`")))),
14086        }
14087    } else {
14088        let content = resp.text().await?;
14089        let entity: Option<SearchUsersByQueryWithIdError> = serde_json::from_str(&content).ok();
14090        Err(Error::ResponseError(ResponseContent { status, content, entity }))
14091    }
14092}
14093
14094/// Searches the webhook event logs with the specified criteria and pagination.
14095pub async fn search_webhook_event_logs_with_id(configuration: &configuration::Configuration, webhook_event_log_search_request: Option<models::WebhookEventLogSearchRequest>) -> Result<models::WebhookEventLogSearchResponse, Error<SearchWebhookEventLogsWithIdError>> {
14096    // add a prefix to parameters to efficiently prevent name collisions
14097    let p_webhook_event_log_search_request = webhook_event_log_search_request;
14098
14099    let uri_str = format!("{}/api/system/webhook-event-log/search", configuration.base_path);
14100    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
14101
14102    if let Some(ref user_agent) = configuration.user_agent {
14103        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
14104    }
14105    if let Some(ref apikey) = configuration.api_key {
14106        let key = apikey.key.clone();
14107        let value = match apikey.prefix {
14108            Some(ref prefix) => format!("{} {}", prefix, key),
14109            None => key,
14110        };
14111        req_builder = req_builder.header("Authorization", value);
14112    };
14113    req_builder = req_builder.json(&p_webhook_event_log_search_request);
14114
14115    let req = req_builder.build()?;
14116    let resp = configuration.client.execute(req).await?;
14117
14118    let status = resp.status();
14119    let content_type = resp
14120        .headers()
14121        .get("content-type")
14122        .and_then(|v| v.to_str().ok())
14123        .unwrap_or("application/octet-stream");
14124    let content_type = super::ContentType::from(content_type);
14125
14126    if !status.is_client_error() && !status.is_server_error() {
14127        let content = resp.text().await?;
14128        match content_type {
14129            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
14130            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::WebhookEventLogSearchResponse`"))),
14131            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::WebhookEventLogSearchResponse`")))),
14132        }
14133    } else {
14134        let content = resp.text().await?;
14135        let entity: Option<SearchWebhookEventLogsWithIdError> = serde_json::from_str(&content).ok();
14136        Err(Error::ResponseError(ResponseContent { status, content, entity }))
14137    }
14138}
14139
14140/// Searches webhooks with the specified criteria and pagination.
14141pub async fn search_webhooks_with_id(configuration: &configuration::Configuration, webhook_search_request: Option<models::WebhookSearchRequest>) -> Result<models::WebhookSearchResponse, Error<SearchWebhooksWithIdError>> {
14142    // add a prefix to parameters to efficiently prevent name collisions
14143    let p_webhook_search_request = webhook_search_request;
14144
14145    let uri_str = format!("{}/api/webhook/search", configuration.base_path);
14146    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
14147
14148    if let Some(ref user_agent) = configuration.user_agent {
14149        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
14150    }
14151    if let Some(ref apikey) = configuration.api_key {
14152        let key = apikey.key.clone();
14153        let value = match apikey.prefix {
14154            Some(ref prefix) => format!("{} {}", prefix, key),
14155            None => key,
14156        };
14157        req_builder = req_builder.header("Authorization", value);
14158    };
14159    req_builder = req_builder.json(&p_webhook_search_request);
14160
14161    let req = req_builder.build()?;
14162    let resp = configuration.client.execute(req).await?;
14163
14164    let status = resp.status();
14165    let content_type = resp
14166        .headers()
14167        .get("content-type")
14168        .and_then(|v| v.to_str().ok())
14169        .unwrap_or("application/octet-stream");
14170    let content_type = super::ContentType::from(content_type);
14171
14172    if !status.is_client_error() && !status.is_server_error() {
14173        let content = resp.text().await?;
14174        match content_type {
14175            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
14176            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::WebhookSearchResponse`"))),
14177            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::WebhookSearchResponse`")))),
14178        }
14179    } else {
14180        let content = resp.text().await?;
14181        let entity: Option<SearchWebhooksWithIdError> = serde_json::from_str(&content).ok();
14182        Err(Error::ResponseError(ResponseContent { status, content, entity }))
14183    }
14184}
14185
14186/// Send an email using an email template id. You can optionally provide <code>requestData</code> to access key value pairs in the email template.
14187pub async fn send_email_with_id(configuration: &configuration::Configuration, email_template_id: &str, send_request: Option<models::SendRequest>) -> Result<models::SendResponse, Error<SendEmailWithIdError>> {
14188    // add a prefix to parameters to efficiently prevent name collisions
14189    let p_email_template_id = email_template_id;
14190    let p_send_request = send_request;
14191
14192    let uri_str = format!("{}/api/email/send/{emailTemplateId}", configuration.base_path, emailTemplateId=crate::apis::urlencode(p_email_template_id));
14193    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
14194
14195    if let Some(ref user_agent) = configuration.user_agent {
14196        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
14197    }
14198    if let Some(ref apikey) = configuration.api_key {
14199        let key = apikey.key.clone();
14200        let value = match apikey.prefix {
14201            Some(ref prefix) => format!("{} {}", prefix, key),
14202            None => key,
14203        };
14204        req_builder = req_builder.header("Authorization", value);
14205    };
14206    req_builder = req_builder.json(&p_send_request);
14207
14208    let req = req_builder.build()?;
14209    let resp = configuration.client.execute(req).await?;
14210
14211    let status = resp.status();
14212    let content_type = resp
14213        .headers()
14214        .get("content-type")
14215        .and_then(|v| v.to_str().ok())
14216        .unwrap_or("application/octet-stream");
14217    let content_type = super::ContentType::from(content_type);
14218
14219    if !status.is_client_error() && !status.is_server_error() {
14220        let content = resp.text().await?;
14221        match content_type {
14222            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
14223            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::SendResponse`"))),
14224            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::SendResponse`")))),
14225        }
14226    } else {
14227        let content = resp.text().await?;
14228        let entity: Option<SendEmailWithIdError> = serde_json::from_str(&content).ok();
14229        Err(Error::ResponseError(ResponseContent { status, content, entity }))
14230    }
14231}
14232
14233/// Sends out an email to a parent that they need to register and create a family or need to log in and add a child to their existing family.
14234pub async fn send_family_request_email_with_id(configuration: &configuration::Configuration, family_email_request: Option<models::FamilyEmailRequest>) -> Result<(), Error<SendFamilyRequestEmailWithIdError>> {
14235    // add a prefix to parameters to efficiently prevent name collisions
14236    let p_family_email_request = family_email_request;
14237
14238    let uri_str = format!("{}/api/user/family/request", configuration.base_path);
14239    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
14240
14241    if let Some(ref user_agent) = configuration.user_agent {
14242        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
14243    }
14244    if let Some(ref apikey) = configuration.api_key {
14245        let key = apikey.key.clone();
14246        let value = match apikey.prefix {
14247            Some(ref prefix) => format!("{} {}", prefix, key),
14248            None => key,
14249        };
14250        req_builder = req_builder.header("Authorization", value);
14251    };
14252    req_builder = req_builder.json(&p_family_email_request);
14253
14254    let req = req_builder.build()?;
14255    let resp = configuration.client.execute(req).await?;
14256
14257    let status = resp.status();
14258
14259    if !status.is_client_error() && !status.is_server_error() {
14260        Ok(())
14261    } else {
14262        let content = resp.text().await?;
14263        let entity: Option<SendFamilyRequestEmailWithIdError> = serde_json::from_str(&content).ok();
14264        Err(Error::ResponseError(ResponseContent { status, content, entity }))
14265    }
14266}
14267
14268/// Send a passwordless authentication code in an email to complete login.
14269pub async fn send_passwordless_code_with_id(configuration: &configuration::Configuration, passwordless_send_request: Option<models::PasswordlessSendRequest>) -> Result<(), Error<SendPasswordlessCodeWithIdError>> {
14270    // add a prefix to parameters to efficiently prevent name collisions
14271    let p_passwordless_send_request = passwordless_send_request;
14272
14273    let uri_str = format!("{}/api/passwordless/send", configuration.base_path);
14274    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
14275
14276    if let Some(ref user_agent) = configuration.user_agent {
14277        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
14278    }
14279    if let Some(ref apikey) = configuration.api_key {
14280        let key = apikey.key.clone();
14281        let value = match apikey.prefix {
14282            Some(ref prefix) => format!("{} {}", prefix, key),
14283            None => key,
14284        };
14285        req_builder = req_builder.header("Authorization", value);
14286    };
14287    req_builder = req_builder.json(&p_passwordless_send_request);
14288
14289    let req = req_builder.build()?;
14290    let resp = configuration.client.execute(req).await?;
14291
14292    let status = resp.status();
14293
14294    if !status.is_client_error() && !status.is_server_error() {
14295        Ok(())
14296    } else {
14297        let content = resp.text().await?;
14298        let entity: Option<SendPasswordlessCodeWithIdError> = serde_json::from_str(&content).ok();
14299        Err(Error::ResponseError(ResponseContent { status, content, entity }))
14300    }
14301}
14302
14303/// Send a Two Factor authentication code to assist in setting up Two Factor authentication or disabling.
14304pub async fn send_two_factor_code_for_enable_disable_with_id(configuration: &configuration::Configuration, two_factor_send_request: Option<models::TwoFactorSendRequest>) -> Result<(), Error<SendTwoFactorCodeForEnableDisableWithIdError>> {
14305    // add a prefix to parameters to efficiently prevent name collisions
14306    let p_two_factor_send_request = two_factor_send_request;
14307
14308    let uri_str = format!("{}/api/two-factor/send", configuration.base_path);
14309    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
14310
14311    if let Some(ref user_agent) = configuration.user_agent {
14312        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
14313    }
14314    if let Some(ref apikey) = configuration.api_key {
14315        let key = apikey.key.clone();
14316        let value = match apikey.prefix {
14317            Some(ref prefix) => format!("{} {}", prefix, key),
14318            None => key,
14319        };
14320        req_builder = req_builder.header("Authorization", value);
14321    };
14322    req_builder = req_builder.json(&p_two_factor_send_request);
14323
14324    let req = req_builder.build()?;
14325    let resp = configuration.client.execute(req).await?;
14326
14327    let status = resp.status();
14328
14329    if !status.is_client_error() && !status.is_server_error() {
14330        Ok(())
14331    } else {
14332        let content = resp.text().await?;
14333        let entity: Option<SendTwoFactorCodeForEnableDisableWithIdError> = serde_json::from_str(&content).ok();
14334        Err(Error::ResponseError(ResponseContent { status, content, entity }))
14335    }
14336}
14337
14338/// Send a Two Factor authentication code to allow the completion of Two Factor authentication.
14339pub async fn send_two_factor_code_for_login_using_method_with_id(configuration: &configuration::Configuration, two_factor_id: &str, two_factor_send_request: Option<models::TwoFactorSendRequest>) -> Result<(), Error<SendTwoFactorCodeForLoginUsingMethodWithIdError>> {
14340    // add a prefix to parameters to efficiently prevent name collisions
14341    let p_two_factor_id = two_factor_id;
14342    let p_two_factor_send_request = two_factor_send_request;
14343
14344    let uri_str = format!("{}/api/two-factor/send/{twoFactorId}", configuration.base_path, twoFactorId=crate::apis::urlencode(p_two_factor_id));
14345    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
14346
14347    if let Some(ref user_agent) = configuration.user_agent {
14348        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
14349    }
14350    if let Some(ref apikey) = configuration.api_key {
14351        let key = apikey.key.clone();
14352        let value = match apikey.prefix {
14353            Some(ref prefix) => format!("{} {}", prefix, key),
14354            None => key,
14355        };
14356        req_builder = req_builder.header("Authorization", value);
14357    };
14358    req_builder = req_builder.json(&p_two_factor_send_request);
14359
14360    let req = req_builder.build()?;
14361    let resp = configuration.client.execute(req).await?;
14362
14363    let status = resp.status();
14364
14365    if !status.is_client_error() && !status.is_server_error() {
14366        Ok(())
14367    } else {
14368        let content = resp.text().await?;
14369        let entity: Option<SendTwoFactorCodeForLoginUsingMethodWithIdError> = serde_json::from_str(&content).ok();
14370        Err(Error::ResponseError(ResponseContent { status, content, entity }))
14371    }
14372}
14373
14374/// Begins a login request for a 3rd party login that requires user interaction such as HYPR.
14375pub async fn start_identity_provider_login_with_id(configuration: &configuration::Configuration, identity_provider_start_login_request: Option<models::IdentityProviderStartLoginRequest>) -> Result<models::IdentityProviderStartLoginResponse, Error<StartIdentityProviderLoginWithIdError>> {
14376    // add a prefix to parameters to efficiently prevent name collisions
14377    let p_identity_provider_start_login_request = identity_provider_start_login_request;
14378
14379    let uri_str = format!("{}/api/identity-provider/start", configuration.base_path);
14380    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
14381
14382    if let Some(ref user_agent) = configuration.user_agent {
14383        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
14384    }
14385    if let Some(ref apikey) = configuration.api_key {
14386        let key = apikey.key.clone();
14387        let value = match apikey.prefix {
14388            Some(ref prefix) => format!("{} {}", prefix, key),
14389            None => key,
14390        };
14391        req_builder = req_builder.header("Authorization", value);
14392    };
14393    req_builder = req_builder.json(&p_identity_provider_start_login_request);
14394
14395    let req = req_builder.build()?;
14396    let resp = configuration.client.execute(req).await?;
14397
14398    let status = resp.status();
14399    let content_type = resp
14400        .headers()
14401        .get("content-type")
14402        .and_then(|v| v.to_str().ok())
14403        .unwrap_or("application/octet-stream");
14404    let content_type = super::ContentType::from(content_type);
14405
14406    if !status.is_client_error() && !status.is_server_error() {
14407        let content = resp.text().await?;
14408        match content_type {
14409            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
14410            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IdentityProviderStartLoginResponse`"))),
14411            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IdentityProviderStartLoginResponse`")))),
14412        }
14413    } else {
14414        let content = resp.text().await?;
14415        let entity: Option<StartIdentityProviderLoginWithIdError> = serde_json::from_str(&content).ok();
14416        Err(Error::ResponseError(ResponseContent { status, content, entity }))
14417    }
14418}
14419
14420/// Start a passwordless login request by generating a passwordless code. This code can be sent to the User using the Send Passwordless Code API or using a mechanism outside of FusionAuth. The passwordless login is completed by using the Passwordless Login API with this code.
14421pub async fn start_passwordless_login_with_id(configuration: &configuration::Configuration, passwordless_start_request: Option<models::PasswordlessStartRequest>) -> Result<models::PasswordlessStartResponse, Error<StartPasswordlessLoginWithIdError>> {
14422    // add a prefix to parameters to efficiently prevent name collisions
14423    let p_passwordless_start_request = passwordless_start_request;
14424
14425    let uri_str = format!("{}/api/passwordless/start", configuration.base_path);
14426    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
14427
14428    if let Some(ref user_agent) = configuration.user_agent {
14429        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
14430    }
14431    if let Some(ref apikey) = configuration.api_key {
14432        let key = apikey.key.clone();
14433        let value = match apikey.prefix {
14434            Some(ref prefix) => format!("{} {}", prefix, key),
14435            None => key,
14436        };
14437        req_builder = req_builder.header("Authorization", value);
14438    };
14439    req_builder = req_builder.json(&p_passwordless_start_request);
14440
14441    let req = req_builder.build()?;
14442    let resp = configuration.client.execute(req).await?;
14443
14444    let status = resp.status();
14445    let content_type = resp
14446        .headers()
14447        .get("content-type")
14448        .and_then(|v| v.to_str().ok())
14449        .unwrap_or("application/octet-stream");
14450    let content_type = super::ContentType::from(content_type);
14451
14452    if !status.is_client_error() && !status.is_server_error() {
14453        let content = resp.text().await?;
14454        match content_type {
14455            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
14456            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PasswordlessStartResponse`"))),
14457            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::PasswordlessStartResponse`")))),
14458        }
14459    } else {
14460        let content = resp.text().await?;
14461        let entity: Option<StartPasswordlessLoginWithIdError> = serde_json::from_str(&content).ok();
14462        Err(Error::ResponseError(ResponseContent { status, content, entity }))
14463    }
14464}
14465
14466/// Start a Two-Factor login request by generating a two-factor identifier. This code can then be sent to the Two Factor Send  API (/api/two-factor/send)in order to send a one-time use code to a user. You can also use one-time use code returned  to send the code out-of-band. The Two-Factor login is completed by making a request to the Two-Factor Login  API (/api/two-factor/login). with the two-factor identifier and the one-time use code.  This API is intended to allow you to begin a Two-Factor login outside a normal login that originated from the Login API (/api/login).
14467pub async fn start_two_factor_login_with_id(configuration: &configuration::Configuration, two_factor_start_request: Option<models::TwoFactorStartRequest>) -> Result<models::TwoFactorStartResponse, Error<StartTwoFactorLoginWithIdError>> {
14468    // add a prefix to parameters to efficiently prevent name collisions
14469    let p_two_factor_start_request = two_factor_start_request;
14470
14471    let uri_str = format!("{}/api/two-factor/start", configuration.base_path);
14472    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
14473
14474    if let Some(ref user_agent) = configuration.user_agent {
14475        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
14476    }
14477    if let Some(ref apikey) = configuration.api_key {
14478        let key = apikey.key.clone();
14479        let value = match apikey.prefix {
14480            Some(ref prefix) => format!("{} {}", prefix, key),
14481            None => key,
14482        };
14483        req_builder = req_builder.header("Authorization", value);
14484    };
14485    req_builder = req_builder.json(&p_two_factor_start_request);
14486
14487    let req = req_builder.build()?;
14488    let resp = configuration.client.execute(req).await?;
14489
14490    let status = resp.status();
14491    let content_type = resp
14492        .headers()
14493        .get("content-type")
14494        .and_then(|v| v.to_str().ok())
14495        .unwrap_or("application/octet-stream");
14496    let content_type = super::ContentType::from(content_type);
14497
14498    if !status.is_client_error() && !status.is_server_error() {
14499        let content = resp.text().await?;
14500        match content_type {
14501            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
14502            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::TwoFactorStartResponse`"))),
14503            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::TwoFactorStartResponse`")))),
14504        }
14505    } else {
14506        let content = resp.text().await?;
14507        let entity: Option<StartTwoFactorLoginWithIdError> = serde_json::from_str(&content).ok();
14508        Err(Error::ResponseError(ResponseContent { status, content, entity }))
14509    }
14510}
14511
14512/// Start a WebAuthn authentication ceremony by generating a new challenge for the user
14513pub async fn start_web_authn_login_with_id(configuration: &configuration::Configuration, web_authn_start_request: Option<models::WebAuthnStartRequest>) -> Result<models::WebAuthnStartResponse, Error<StartWebAuthnLoginWithIdError>> {
14514    // add a prefix to parameters to efficiently prevent name collisions
14515    let p_web_authn_start_request = web_authn_start_request;
14516
14517    let uri_str = format!("{}/api/webauthn/start", configuration.base_path);
14518    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
14519
14520    if let Some(ref user_agent) = configuration.user_agent {
14521        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
14522    }
14523    if let Some(ref apikey) = configuration.api_key {
14524        let key = apikey.key.clone();
14525        let value = match apikey.prefix {
14526            Some(ref prefix) => format!("{} {}", prefix, key),
14527            None => key,
14528        };
14529        req_builder = req_builder.header("Authorization", value);
14530    };
14531    req_builder = req_builder.json(&p_web_authn_start_request);
14532
14533    let req = req_builder.build()?;
14534    let resp = configuration.client.execute(req).await?;
14535
14536    let status = resp.status();
14537    let content_type = resp
14538        .headers()
14539        .get("content-type")
14540        .and_then(|v| v.to_str().ok())
14541        .unwrap_or("application/octet-stream");
14542    let content_type = super::ContentType::from(content_type);
14543
14544    if !status.is_client_error() && !status.is_server_error() {
14545        let content = resp.text().await?;
14546        match content_type {
14547            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
14548            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::WebAuthnStartResponse`"))),
14549            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::WebAuthnStartResponse`")))),
14550        }
14551    } else {
14552        let content = resp.text().await?;
14553        let entity: Option<StartWebAuthnLoginWithIdError> = serde_json::from_str(&content).ok();
14554        Err(Error::ResponseError(ResponseContent { status, content, entity }))
14555    }
14556}
14557
14558/// Start a WebAuthn registration ceremony by generating a new challenge for the user
14559pub async fn start_web_authn_registration_with_id(configuration: &configuration::Configuration, web_authn_register_start_request: Option<models::WebAuthnRegisterStartRequest>) -> Result<models::WebAuthnRegisterStartResponse, Error<StartWebAuthnRegistrationWithIdError>> {
14560    // add a prefix to parameters to efficiently prevent name collisions
14561    let p_web_authn_register_start_request = web_authn_register_start_request;
14562
14563    let uri_str = format!("{}/api/webauthn/register/start", configuration.base_path);
14564    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
14565
14566    if let Some(ref user_agent) = configuration.user_agent {
14567        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
14568    }
14569    if let Some(ref apikey) = configuration.api_key {
14570        let key = apikey.key.clone();
14571        let value = match apikey.prefix {
14572            Some(ref prefix) => format!("{} {}", prefix, key),
14573            None => key,
14574        };
14575        req_builder = req_builder.header("Authorization", value);
14576    };
14577    req_builder = req_builder.json(&p_web_authn_register_start_request);
14578
14579    let req = req_builder.build()?;
14580    let resp = configuration.client.execute(req).await?;
14581
14582    let status = resp.status();
14583    let content_type = resp
14584        .headers()
14585        .get("content-type")
14586        .and_then(|v| v.to_str().ok())
14587        .unwrap_or("application/octet-stream");
14588    let content_type = super::ContentType::from(content_type);
14589
14590    if !status.is_client_error() && !status.is_server_error() {
14591        let content = resp.text().await?;
14592        match content_type {
14593            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
14594            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::WebAuthnRegisterStartResponse`"))),
14595            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::WebAuthnRegisterStartResponse`")))),
14596        }
14597    } else {
14598        let content = resp.text().await?;
14599        let entity: Option<StartWebAuthnRegistrationWithIdError> = serde_json::from_str(&content).ok();
14600        Err(Error::ResponseError(ResponseContent { status, content, entity }))
14601    }
14602}
14603
14604/// Complete login using a 2FA challenge
14605pub async fn two_factor_login_with_id(configuration: &configuration::Configuration, two_factor_login_request: Option<models::TwoFactorLoginRequest>) -> Result<models::LoginResponse, Error<TwoFactorLoginWithIdError>> {
14606    // add a prefix to parameters to efficiently prevent name collisions
14607    let p_two_factor_login_request = two_factor_login_request;
14608
14609    let uri_str = format!("{}/api/two-factor/login", configuration.base_path);
14610    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
14611
14612    if let Some(ref user_agent) = configuration.user_agent {
14613        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
14614    }
14615    if let Some(ref apikey) = configuration.api_key {
14616        let key = apikey.key.clone();
14617        let value = match apikey.prefix {
14618            Some(ref prefix) => format!("{} {}", prefix, key),
14619            None => key,
14620        };
14621        req_builder = req_builder.header("Authorization", value);
14622    };
14623    req_builder = req_builder.json(&p_two_factor_login_request);
14624
14625    let req = req_builder.build()?;
14626    let resp = configuration.client.execute(req).await?;
14627
14628    let status = resp.status();
14629    let content_type = resp
14630        .headers()
14631        .get("content-type")
14632        .and_then(|v| v.to_str().ok())
14633        .unwrap_or("application/octet-stream");
14634    let content_type = super::ContentType::from(content_type);
14635
14636    if !status.is_client_error() && !status.is_server_error() {
14637        let content = resp.text().await?;
14638        match content_type {
14639            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
14640            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::LoginResponse`"))),
14641            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::LoginResponse`")))),
14642        }
14643    } else {
14644        let content = resp.text().await?;
14645        let entity: Option<TwoFactorLoginWithIdError> = serde_json::from_str(&content).ok();
14646        Err(Error::ResponseError(ResponseContent { status, content, entity }))
14647    }
14648}
14649
14650/// Updates an API key by given id
14651pub async fn update_api_key_with_id(configuration: &configuration::Configuration, api_key_id: &str, api_key_request: Option<models::ApiKeyRequest>) -> Result<models::ApiKeyResponse, Error<UpdateApiKeyWithIdError>> {
14652    // add a prefix to parameters to efficiently prevent name collisions
14653    let p_api_key_id = api_key_id;
14654    let p_api_key_request = api_key_request;
14655
14656    let uri_str = format!("{}/api/api-key/{apiKeyId}", configuration.base_path, apiKeyId=crate::apis::urlencode(p_api_key_id));
14657    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
14658
14659    if let Some(ref user_agent) = configuration.user_agent {
14660        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
14661    }
14662    if let Some(ref apikey) = configuration.api_key {
14663        let key = apikey.key.clone();
14664        let value = match apikey.prefix {
14665            Some(ref prefix) => format!("{} {}", prefix, key),
14666            None => key,
14667        };
14668        req_builder = req_builder.header("Authorization", value);
14669    };
14670    req_builder = req_builder.json(&p_api_key_request);
14671
14672    let req = req_builder.build()?;
14673    let resp = configuration.client.execute(req).await?;
14674
14675    let status = resp.status();
14676    let content_type = resp
14677        .headers()
14678        .get("content-type")
14679        .and_then(|v| v.to_str().ok())
14680        .unwrap_or("application/octet-stream");
14681    let content_type = super::ContentType::from(content_type);
14682
14683    if !status.is_client_error() && !status.is_server_error() {
14684        let content = resp.text().await?;
14685        match content_type {
14686            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
14687            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ApiKeyResponse`"))),
14688            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ApiKeyResponse`")))),
14689        }
14690    } else {
14691        let content = resp.text().await?;
14692        let entity: Option<UpdateApiKeyWithIdError> = serde_json::from_str(&content).ok();
14693        Err(Error::ResponseError(ResponseContent { status, content, entity }))
14694    }
14695}
14696
14697/// Updates the application role with the given Id for the application.
14698pub async fn update_application_role_with_id(configuration: &configuration::Configuration, application_id: &str, role_id: &str, x_fusion_auth_tenant_id: Option<&str>, application_request: Option<models::ApplicationRequest>) -> Result<models::ApplicationResponse, Error<UpdateApplicationRoleWithIdError>> {
14699    // add a prefix to parameters to efficiently prevent name collisions
14700    let p_application_id = application_id;
14701    let p_role_id = role_id;
14702    let p_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
14703    let p_application_request = application_request;
14704
14705    let uri_str = format!("{}/api/application/{applicationId}/role/{roleId}", configuration.base_path, applicationId=crate::apis::urlencode(p_application_id), roleId=crate::apis::urlencode(p_role_id));
14706    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
14707
14708    if let Some(ref user_agent) = configuration.user_agent {
14709        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
14710    }
14711    if let Some(param_value) = p_x_fusion_auth_tenant_id {
14712        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
14713    }
14714    if let Some(ref apikey) = configuration.api_key {
14715        let key = apikey.key.clone();
14716        let value = match apikey.prefix {
14717            Some(ref prefix) => format!("{} {}", prefix, key),
14718            None => key,
14719        };
14720        req_builder = req_builder.header("Authorization", value);
14721    };
14722    req_builder = req_builder.json(&p_application_request);
14723
14724    let req = req_builder.build()?;
14725    let resp = configuration.client.execute(req).await?;
14726
14727    let status = resp.status();
14728    let content_type = resp
14729        .headers()
14730        .get("content-type")
14731        .and_then(|v| v.to_str().ok())
14732        .unwrap_or("application/octet-stream");
14733    let content_type = super::ContentType::from(content_type);
14734
14735    if !status.is_client_error() && !status.is_server_error() {
14736        let content = resp.text().await?;
14737        match content_type {
14738            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
14739            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ApplicationResponse`"))),
14740            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ApplicationResponse`")))),
14741        }
14742    } else {
14743        let content = resp.text().await?;
14744        let entity: Option<UpdateApplicationRoleWithIdError> = serde_json::from_str(&content).ok();
14745        Err(Error::ResponseError(ResponseContent { status, content, entity }))
14746    }
14747}
14748
14749/// Updates the application with the given Id. OR Reactivates the application with the given Id.
14750pub async fn update_application_with_id(configuration: &configuration::Configuration, application_id: &str, x_fusion_auth_tenant_id: Option<&str>, reactivate: Option<&str>, application_request: Option<models::ApplicationRequest>) -> Result<models::ApplicationResponse, Error<UpdateApplicationWithIdError>> {
14751    // add a prefix to parameters to efficiently prevent name collisions
14752    let p_application_id = application_id;
14753    let p_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
14754    let p_reactivate = reactivate;
14755    let p_application_request = application_request;
14756
14757    let uri_str = format!("{}/api/application/{applicationId}", configuration.base_path, applicationId=crate::apis::urlencode(p_application_id));
14758    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
14759
14760    if let Some(ref param_value) = p_reactivate {
14761        req_builder = req_builder.query(&[("reactivate", &param_value.to_string())]);
14762    }
14763    if let Some(ref user_agent) = configuration.user_agent {
14764        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
14765    }
14766    if let Some(param_value) = p_x_fusion_auth_tenant_id {
14767        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
14768    }
14769    if let Some(ref apikey) = configuration.api_key {
14770        let key = apikey.key.clone();
14771        let value = match apikey.prefix {
14772            Some(ref prefix) => format!("{} {}", prefix, key),
14773            None => key,
14774        };
14775        req_builder = req_builder.header("Authorization", value);
14776    };
14777    req_builder = req_builder.json(&p_application_request);
14778
14779    let req = req_builder.build()?;
14780    let resp = configuration.client.execute(req).await?;
14781
14782    let status = resp.status();
14783    let content_type = resp
14784        .headers()
14785        .get("content-type")
14786        .and_then(|v| v.to_str().ok())
14787        .unwrap_or("application/octet-stream");
14788    let content_type = super::ContentType::from(content_type);
14789
14790    if !status.is_client_error() && !status.is_server_error() {
14791        let content = resp.text().await?;
14792        match content_type {
14793            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
14794            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ApplicationResponse`"))),
14795            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ApplicationResponse`")))),
14796        }
14797    } else {
14798        let content = resp.text().await?;
14799        let entity: Option<UpdateApplicationWithIdError> = serde_json::from_str(&content).ok();
14800        Err(Error::ResponseError(ResponseContent { status, content, entity }))
14801    }
14802}
14803
14804/// Updates the connector with the given Id.
14805pub async fn update_connector_with_id(configuration: &configuration::Configuration, connector_id: &str, connector_request: Option<models::ConnectorRequest>) -> Result<models::ConnectorResponse, Error<UpdateConnectorWithIdError>> {
14806    // add a prefix to parameters to efficiently prevent name collisions
14807    let p_connector_id = connector_id;
14808    let p_connector_request = connector_request;
14809
14810    let uri_str = format!("{}/api/connector/{connectorId}", configuration.base_path, connectorId=crate::apis::urlencode(p_connector_id));
14811    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
14812
14813    if let Some(ref user_agent) = configuration.user_agent {
14814        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
14815    }
14816    if let Some(ref apikey) = configuration.api_key {
14817        let key = apikey.key.clone();
14818        let value = match apikey.prefix {
14819            Some(ref prefix) => format!("{} {}", prefix, key),
14820            None => key,
14821        };
14822        req_builder = req_builder.header("Authorization", value);
14823    };
14824    req_builder = req_builder.json(&p_connector_request);
14825
14826    let req = req_builder.build()?;
14827    let resp = configuration.client.execute(req).await?;
14828
14829    let status = resp.status();
14830    let content_type = resp
14831        .headers()
14832        .get("content-type")
14833        .and_then(|v| v.to_str().ok())
14834        .unwrap_or("application/octet-stream");
14835    let content_type = super::ContentType::from(content_type);
14836
14837    if !status.is_client_error() && !status.is_server_error() {
14838        let content = resp.text().await?;
14839        match content_type {
14840            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
14841            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ConnectorResponse`"))),
14842            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ConnectorResponse`")))),
14843        }
14844    } else {
14845        let content = resp.text().await?;
14846        let entity: Option<UpdateConnectorWithIdError> = serde_json::from_str(&content).ok();
14847        Err(Error::ResponseError(ResponseContent { status, content, entity }))
14848    }
14849}
14850
14851/// Updates the consent with the given Id.
14852pub async fn update_consent_with_id(configuration: &configuration::Configuration, consent_id: &str, x_fusion_auth_tenant_id: Option<&str>, consent_request: Option<models::ConsentRequest>) -> Result<models::ConsentResponse, Error<UpdateConsentWithIdError>> {
14853    // add a prefix to parameters to efficiently prevent name collisions
14854    let p_consent_id = consent_id;
14855    let p_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
14856    let p_consent_request = consent_request;
14857
14858    let uri_str = format!("{}/api/consent/{consentId}", configuration.base_path, consentId=crate::apis::urlencode(p_consent_id));
14859    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
14860
14861    if let Some(ref user_agent) = configuration.user_agent {
14862        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
14863    }
14864    if let Some(param_value) = p_x_fusion_auth_tenant_id {
14865        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
14866    }
14867    if let Some(ref apikey) = configuration.api_key {
14868        let key = apikey.key.clone();
14869        let value = match apikey.prefix {
14870            Some(ref prefix) => format!("{} {}", prefix, key),
14871            None => key,
14872        };
14873        req_builder = req_builder.header("Authorization", value);
14874    };
14875    req_builder = req_builder.json(&p_consent_request);
14876
14877    let req = req_builder.build()?;
14878    let resp = configuration.client.execute(req).await?;
14879
14880    let status = resp.status();
14881    let content_type = resp
14882        .headers()
14883        .get("content-type")
14884        .and_then(|v| v.to_str().ok())
14885        .unwrap_or("application/octet-stream");
14886    let content_type = super::ContentType::from(content_type);
14887
14888    if !status.is_client_error() && !status.is_server_error() {
14889        let content = resp.text().await?;
14890        match content_type {
14891            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
14892            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ConsentResponse`"))),
14893            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ConsentResponse`")))),
14894        }
14895    } else {
14896        let content = resp.text().await?;
14897        let entity: Option<UpdateConsentWithIdError> = serde_json::from_str(&content).ok();
14898        Err(Error::ResponseError(ResponseContent { status, content, entity }))
14899    }
14900}
14901
14902/// Updates the email template with the given Id.
14903pub async fn update_email_template_with_id(configuration: &configuration::Configuration, email_template_id: &str, x_fusion_auth_tenant_id: Option<&str>, email_template_request: Option<models::EmailTemplateRequest>) -> Result<models::EmailTemplateResponse, Error<UpdateEmailTemplateWithIdError>> {
14904    // add a prefix to parameters to efficiently prevent name collisions
14905    let p_email_template_id = email_template_id;
14906    let p_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
14907    let p_email_template_request = email_template_request;
14908
14909    let uri_str = format!("{}/api/email/template/{emailTemplateId}", configuration.base_path, emailTemplateId=crate::apis::urlencode(p_email_template_id));
14910    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
14911
14912    if let Some(ref user_agent) = configuration.user_agent {
14913        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
14914    }
14915    if let Some(param_value) = p_x_fusion_auth_tenant_id {
14916        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
14917    }
14918    if let Some(ref apikey) = configuration.api_key {
14919        let key = apikey.key.clone();
14920        let value = match apikey.prefix {
14921            Some(ref prefix) => format!("{} {}", prefix, key),
14922            None => key,
14923        };
14924        req_builder = req_builder.header("Authorization", value);
14925    };
14926    req_builder = req_builder.json(&p_email_template_request);
14927
14928    let req = req_builder.build()?;
14929    let resp = configuration.client.execute(req).await?;
14930
14931    let status = resp.status();
14932    let content_type = resp
14933        .headers()
14934        .get("content-type")
14935        .and_then(|v| v.to_str().ok())
14936        .unwrap_or("application/octet-stream");
14937    let content_type = super::ContentType::from(content_type);
14938
14939    if !status.is_client_error() && !status.is_server_error() {
14940        let content = resp.text().await?;
14941        match content_type {
14942            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
14943            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::EmailTemplateResponse`"))),
14944            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::EmailTemplateResponse`")))),
14945        }
14946    } else {
14947        let content = resp.text().await?;
14948        let entity: Option<UpdateEmailTemplateWithIdError> = serde_json::from_str(&content).ok();
14949        Err(Error::ResponseError(ResponseContent { status, content, entity }))
14950    }
14951}
14952
14953/// Updates the permission with the given Id for the entity type.
14954pub async fn update_entity_type_permission_with_id(configuration: &configuration::Configuration, entity_type_id: &str, permission_id: &str, entity_type_request: Option<models::EntityTypeRequest>) -> Result<models::EntityTypeResponse, Error<UpdateEntityTypePermissionWithIdError>> {
14955    // add a prefix to parameters to efficiently prevent name collisions
14956    let p_entity_type_id = entity_type_id;
14957    let p_permission_id = permission_id;
14958    let p_entity_type_request = entity_type_request;
14959
14960    let uri_str = format!("{}/api/entity/type/{entityTypeId}/permission/{permissionId}", configuration.base_path, entityTypeId=crate::apis::urlencode(p_entity_type_id), permissionId=crate::apis::urlencode(p_permission_id));
14961    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
14962
14963    if let Some(ref user_agent) = configuration.user_agent {
14964        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
14965    }
14966    if let Some(ref apikey) = configuration.api_key {
14967        let key = apikey.key.clone();
14968        let value = match apikey.prefix {
14969            Some(ref prefix) => format!("{} {}", prefix, key),
14970            None => key,
14971        };
14972        req_builder = req_builder.header("Authorization", value);
14973    };
14974    req_builder = req_builder.json(&p_entity_type_request);
14975
14976    let req = req_builder.build()?;
14977    let resp = configuration.client.execute(req).await?;
14978
14979    let status = resp.status();
14980    let content_type = resp
14981        .headers()
14982        .get("content-type")
14983        .and_then(|v| v.to_str().ok())
14984        .unwrap_or("application/octet-stream");
14985    let content_type = super::ContentType::from(content_type);
14986
14987    if !status.is_client_error() && !status.is_server_error() {
14988        let content = resp.text().await?;
14989        match content_type {
14990            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
14991            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::EntityTypeResponse`"))),
14992            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::EntityTypeResponse`")))),
14993        }
14994    } else {
14995        let content = resp.text().await?;
14996        let entity: Option<UpdateEntityTypePermissionWithIdError> = serde_json::from_str(&content).ok();
14997        Err(Error::ResponseError(ResponseContent { status, content, entity }))
14998    }
14999}
15000
15001/// Updates the Entity Type with the given Id.
15002pub async fn update_entity_type_with_id(configuration: &configuration::Configuration, entity_type_id: &str, entity_type_request: Option<models::EntityTypeRequest>) -> Result<models::EntityTypeResponse, Error<UpdateEntityTypeWithIdError>> {
15003    // add a prefix to parameters to efficiently prevent name collisions
15004    let p_entity_type_id = entity_type_id;
15005    let p_entity_type_request = entity_type_request;
15006
15007    let uri_str = format!("{}/api/entity/type/{entityTypeId}", configuration.base_path, entityTypeId=crate::apis::urlencode(p_entity_type_id));
15008    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
15009
15010    if let Some(ref user_agent) = configuration.user_agent {
15011        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
15012    }
15013    if let Some(ref apikey) = configuration.api_key {
15014        let key = apikey.key.clone();
15015        let value = match apikey.prefix {
15016            Some(ref prefix) => format!("{} {}", prefix, key),
15017            None => key,
15018        };
15019        req_builder = req_builder.header("Authorization", value);
15020    };
15021    req_builder = req_builder.json(&p_entity_type_request);
15022
15023    let req = req_builder.build()?;
15024    let resp = configuration.client.execute(req).await?;
15025
15026    let status = resp.status();
15027    let content_type = resp
15028        .headers()
15029        .get("content-type")
15030        .and_then(|v| v.to_str().ok())
15031        .unwrap_or("application/octet-stream");
15032    let content_type = super::ContentType::from(content_type);
15033
15034    if !status.is_client_error() && !status.is_server_error() {
15035        let content = resp.text().await?;
15036        match content_type {
15037            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
15038            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::EntityTypeResponse`"))),
15039            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::EntityTypeResponse`")))),
15040        }
15041    } else {
15042        let content = resp.text().await?;
15043        let entity: Option<UpdateEntityTypeWithIdError> = serde_json::from_str(&content).ok();
15044        Err(Error::ResponseError(ResponseContent { status, content, entity }))
15045    }
15046}
15047
15048/// Updates the Entity with the given Id.
15049pub async fn update_entity_with_id(configuration: &configuration::Configuration, entity_id: &str, x_fusion_auth_tenant_id: Option<&str>, entity_request: Option<models::EntityRequest>) -> Result<models::EntityResponse, Error<UpdateEntityWithIdError>> {
15050    // add a prefix to parameters to efficiently prevent name collisions
15051    let p_entity_id = entity_id;
15052    let p_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
15053    let p_entity_request = entity_request;
15054
15055    let uri_str = format!("{}/api/entity/{entityId}", configuration.base_path, entityId=crate::apis::urlencode(p_entity_id));
15056    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
15057
15058    if let Some(ref user_agent) = configuration.user_agent {
15059        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
15060    }
15061    if let Some(param_value) = p_x_fusion_auth_tenant_id {
15062        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
15063    }
15064    if let Some(ref apikey) = configuration.api_key {
15065        let key = apikey.key.clone();
15066        let value = match apikey.prefix {
15067            Some(ref prefix) => format!("{} {}", prefix, key),
15068            None => key,
15069        };
15070        req_builder = req_builder.header("Authorization", value);
15071    };
15072    req_builder = req_builder.json(&p_entity_request);
15073
15074    let req = req_builder.build()?;
15075    let resp = configuration.client.execute(req).await?;
15076
15077    let status = resp.status();
15078    let content_type = resp
15079        .headers()
15080        .get("content-type")
15081        .and_then(|v| v.to_str().ok())
15082        .unwrap_or("application/octet-stream");
15083    let content_type = super::ContentType::from(content_type);
15084
15085    if !status.is_client_error() && !status.is_server_error() {
15086        let content = resp.text().await?;
15087        match content_type {
15088            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
15089            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::EntityResponse`"))),
15090            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::EntityResponse`")))),
15091        }
15092    } else {
15093        let content = resp.text().await?;
15094        let entity: Option<UpdateEntityWithIdError> = serde_json::from_str(&content).ok();
15095        Err(Error::ResponseError(ResponseContent { status, content, entity }))
15096    }
15097}
15098
15099/// Updates the form field with the given Id.
15100pub async fn update_form_field_with_id(configuration: &configuration::Configuration, field_id: &str, form_field_request: Option<models::FormFieldRequest>) -> Result<models::FormFieldResponse, Error<UpdateFormFieldWithIdError>> {
15101    // add a prefix to parameters to efficiently prevent name collisions
15102    let p_field_id = field_id;
15103    let p_form_field_request = form_field_request;
15104
15105    let uri_str = format!("{}/api/form/field/{fieldId}", configuration.base_path, fieldId=crate::apis::urlencode(p_field_id));
15106    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
15107
15108    if let Some(ref user_agent) = configuration.user_agent {
15109        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
15110    }
15111    if let Some(ref apikey) = configuration.api_key {
15112        let key = apikey.key.clone();
15113        let value = match apikey.prefix {
15114            Some(ref prefix) => format!("{} {}", prefix, key),
15115            None => key,
15116        };
15117        req_builder = req_builder.header("Authorization", value);
15118    };
15119    req_builder = req_builder.json(&p_form_field_request);
15120
15121    let req = req_builder.build()?;
15122    let resp = configuration.client.execute(req).await?;
15123
15124    let status = resp.status();
15125    let content_type = resp
15126        .headers()
15127        .get("content-type")
15128        .and_then(|v| v.to_str().ok())
15129        .unwrap_or("application/octet-stream");
15130    let content_type = super::ContentType::from(content_type);
15131
15132    if !status.is_client_error() && !status.is_server_error() {
15133        let content = resp.text().await?;
15134        match content_type {
15135            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
15136            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::FormFieldResponse`"))),
15137            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::FormFieldResponse`")))),
15138        }
15139    } else {
15140        let content = resp.text().await?;
15141        let entity: Option<UpdateFormFieldWithIdError> = serde_json::from_str(&content).ok();
15142        Err(Error::ResponseError(ResponseContent { status, content, entity }))
15143    }
15144}
15145
15146/// Updates the form with the given Id.
15147pub async fn update_form_with_id(configuration: &configuration::Configuration, form_id: &str, form_request: Option<models::FormRequest>) -> Result<models::FormResponse, Error<UpdateFormWithIdError>> {
15148    // add a prefix to parameters to efficiently prevent name collisions
15149    let p_form_id = form_id;
15150    let p_form_request = form_request;
15151
15152    let uri_str = format!("{}/api/form/{formId}", configuration.base_path, formId=crate::apis::urlencode(p_form_id));
15153    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
15154
15155    if let Some(ref user_agent) = configuration.user_agent {
15156        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
15157    }
15158    if let Some(ref apikey) = configuration.api_key {
15159        let key = apikey.key.clone();
15160        let value = match apikey.prefix {
15161            Some(ref prefix) => format!("{} {}", prefix, key),
15162            None => key,
15163        };
15164        req_builder = req_builder.header("Authorization", value);
15165    };
15166    req_builder = req_builder.json(&p_form_request);
15167
15168    let req = req_builder.build()?;
15169    let resp = configuration.client.execute(req).await?;
15170
15171    let status = resp.status();
15172    let content_type = resp
15173        .headers()
15174        .get("content-type")
15175        .and_then(|v| v.to_str().ok())
15176        .unwrap_or("application/octet-stream");
15177    let content_type = super::ContentType::from(content_type);
15178
15179    if !status.is_client_error() && !status.is_server_error() {
15180        let content = resp.text().await?;
15181        match content_type {
15182            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
15183            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::FormResponse`"))),
15184            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::FormResponse`")))),
15185        }
15186    } else {
15187        let content = resp.text().await?;
15188        let entity: Option<UpdateFormWithIdError> = serde_json::from_str(&content).ok();
15189        Err(Error::ResponseError(ResponseContent { status, content, entity }))
15190    }
15191}
15192
15193/// Creates a member in a group.
15194pub async fn update_group_members_with_id(configuration: &configuration::Configuration, member_request: Option<models::MemberRequest>) -> Result<models::MemberResponse, Error<UpdateGroupMembersWithIdError>> {
15195    // add a prefix to parameters to efficiently prevent name collisions
15196    let p_member_request = member_request;
15197
15198    let uri_str = format!("{}/api/group/member", configuration.base_path);
15199    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
15200
15201    if let Some(ref user_agent) = configuration.user_agent {
15202        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
15203    }
15204    if let Some(ref apikey) = configuration.api_key {
15205        let key = apikey.key.clone();
15206        let value = match apikey.prefix {
15207            Some(ref prefix) => format!("{} {}", prefix, key),
15208            None => key,
15209        };
15210        req_builder = req_builder.header("Authorization", value);
15211    };
15212    req_builder = req_builder.json(&p_member_request);
15213
15214    let req = req_builder.build()?;
15215    let resp = configuration.client.execute(req).await?;
15216
15217    let status = resp.status();
15218    let content_type = resp
15219        .headers()
15220        .get("content-type")
15221        .and_then(|v| v.to_str().ok())
15222        .unwrap_or("application/octet-stream");
15223    let content_type = super::ContentType::from(content_type);
15224
15225    if !status.is_client_error() && !status.is_server_error() {
15226        let content = resp.text().await?;
15227        match content_type {
15228            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
15229            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::MemberResponse`"))),
15230            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::MemberResponse`")))),
15231        }
15232    } else {
15233        let content = resp.text().await?;
15234        let entity: Option<UpdateGroupMembersWithIdError> = serde_json::from_str(&content).ok();
15235        Err(Error::ResponseError(ResponseContent { status, content, entity }))
15236    }
15237}
15238
15239/// Updates the group with the given Id.
15240pub async fn update_group_with_id(configuration: &configuration::Configuration, group_id: &str, x_fusion_auth_tenant_id: Option<&str>, group_request: Option<models::GroupRequest>) -> Result<models::GroupResponse, Error<UpdateGroupWithIdError>> {
15241    // add a prefix to parameters to efficiently prevent name collisions
15242    let p_group_id = group_id;
15243    let p_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
15244    let p_group_request = group_request;
15245
15246    let uri_str = format!("{}/api/group/{groupId}", configuration.base_path, groupId=crate::apis::urlencode(p_group_id));
15247    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
15248
15249    if let Some(ref user_agent) = configuration.user_agent {
15250        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
15251    }
15252    if let Some(param_value) = p_x_fusion_auth_tenant_id {
15253        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
15254    }
15255    if let Some(ref apikey) = configuration.api_key {
15256        let key = apikey.key.clone();
15257        let value = match apikey.prefix {
15258            Some(ref prefix) => format!("{} {}", prefix, key),
15259            None => key,
15260        };
15261        req_builder = req_builder.header("Authorization", value);
15262    };
15263    req_builder = req_builder.json(&p_group_request);
15264
15265    let req = req_builder.build()?;
15266    let resp = configuration.client.execute(req).await?;
15267
15268    let status = resp.status();
15269    let content_type = resp
15270        .headers()
15271        .get("content-type")
15272        .and_then(|v| v.to_str().ok())
15273        .unwrap_or("application/octet-stream");
15274    let content_type = super::ContentType::from(content_type);
15275
15276    if !status.is_client_error() && !status.is_server_error() {
15277        let content = resp.text().await?;
15278        match content_type {
15279            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
15280            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GroupResponse`"))),
15281            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GroupResponse`")))),
15282        }
15283    } else {
15284        let content = resp.text().await?;
15285        let entity: Option<UpdateGroupWithIdError> = serde_json::from_str(&content).ok();
15286        Err(Error::ResponseError(ResponseContent { status, content, entity }))
15287    }
15288}
15289
15290/// Updates the identity provider with the given Id.
15291pub async fn update_identity_provider_with_id(configuration: &configuration::Configuration, identity_provider_id: &str, identity_provider_request: Option<models::IdentityProviderRequest>) -> Result<models::IdentityProviderResponse, Error<UpdateIdentityProviderWithIdError>> {
15292    // add a prefix to parameters to efficiently prevent name collisions
15293    let p_identity_provider_id = identity_provider_id;
15294    let p_identity_provider_request = identity_provider_request;
15295
15296    let uri_str = format!("{}/api/identity-provider/{identityProviderId}", configuration.base_path, identityProviderId=crate::apis::urlencode(p_identity_provider_id));
15297    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
15298
15299    if let Some(ref user_agent) = configuration.user_agent {
15300        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
15301    }
15302    if let Some(ref apikey) = configuration.api_key {
15303        let key = apikey.key.clone();
15304        let value = match apikey.prefix {
15305            Some(ref prefix) => format!("{} {}", prefix, key),
15306            None => key,
15307        };
15308        req_builder = req_builder.header("Authorization", value);
15309    };
15310    req_builder = req_builder.json(&p_identity_provider_request);
15311
15312    let req = req_builder.build()?;
15313    let resp = configuration.client.execute(req).await?;
15314
15315    let status = resp.status();
15316    let content_type = resp
15317        .headers()
15318        .get("content-type")
15319        .and_then(|v| v.to_str().ok())
15320        .unwrap_or("application/octet-stream");
15321    let content_type = super::ContentType::from(content_type);
15322
15323    if !status.is_client_error() && !status.is_server_error() {
15324        let content = resp.text().await?;
15325        match content_type {
15326            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
15327            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IdentityProviderResponse`"))),
15328            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IdentityProviderResponse`")))),
15329        }
15330    } else {
15331        let content = resp.text().await?;
15332        let entity: Option<UpdateIdentityProviderWithIdError> = serde_json::from_str(&content).ok();
15333        Err(Error::ResponseError(ResponseContent { status, content, entity }))
15334    }
15335}
15336
15337/// Updates the available integrations.
15338pub async fn update_integrations_with_id(configuration: &configuration::Configuration, integration_request: Option<models::IntegrationRequest>) -> Result<models::IntegrationResponse, Error<UpdateIntegrationsWithIdError>> {
15339    // add a prefix to parameters to efficiently prevent name collisions
15340    let p_integration_request = integration_request;
15341
15342    let uri_str = format!("{}/api/integration", configuration.base_path);
15343    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
15344
15345    if let Some(ref user_agent) = configuration.user_agent {
15346        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
15347    }
15348    if let Some(ref apikey) = configuration.api_key {
15349        let key = apikey.key.clone();
15350        let value = match apikey.prefix {
15351            Some(ref prefix) => format!("{} {}", prefix, key),
15352            None => key,
15353        };
15354        req_builder = req_builder.header("Authorization", value);
15355    };
15356    req_builder = req_builder.json(&p_integration_request);
15357
15358    let req = req_builder.build()?;
15359    let resp = configuration.client.execute(req).await?;
15360
15361    let status = resp.status();
15362    let content_type = resp
15363        .headers()
15364        .get("content-type")
15365        .and_then(|v| v.to_str().ok())
15366        .unwrap_or("application/octet-stream");
15367    let content_type = super::ContentType::from(content_type);
15368
15369    if !status.is_client_error() && !status.is_server_error() {
15370        let content = resp.text().await?;
15371        match content_type {
15372            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
15373            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IntegrationResponse`"))),
15374            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IntegrationResponse`")))),
15375        }
15376    } else {
15377        let content = resp.text().await?;
15378        let entity: Option<UpdateIntegrationsWithIdError> = serde_json::from_str(&content).ok();
15379        Err(Error::ResponseError(ResponseContent { status, content, entity }))
15380    }
15381}
15382
15383/// Updates the IP Access Control List with the given Id.
15384pub async fn update_ip_access_control_list_with_id(configuration: &configuration::Configuration, access_control_list_id: &str, ip_access_control_list_request: Option<models::IpAccessControlListRequest>) -> Result<models::IpAccessControlListResponse, Error<UpdateIpAccessControlListWithIdError>> {
15385    // add a prefix to parameters to efficiently prevent name collisions
15386    let p_access_control_list_id = access_control_list_id;
15387    let p_ip_access_control_list_request = ip_access_control_list_request;
15388
15389    let uri_str = format!("{}/api/ip-acl/{accessControlListId}", configuration.base_path, accessControlListId=crate::apis::urlencode(p_access_control_list_id));
15390    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
15391
15392    if let Some(ref user_agent) = configuration.user_agent {
15393        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
15394    }
15395    if let Some(ref apikey) = configuration.api_key {
15396        let key = apikey.key.clone();
15397        let value = match apikey.prefix {
15398            Some(ref prefix) => format!("{} {}", prefix, key),
15399            None => key,
15400        };
15401        req_builder = req_builder.header("Authorization", value);
15402    };
15403    req_builder = req_builder.json(&p_ip_access_control_list_request);
15404
15405    let req = req_builder.build()?;
15406    let resp = configuration.client.execute(req).await?;
15407
15408    let status = resp.status();
15409    let content_type = resp
15410        .headers()
15411        .get("content-type")
15412        .and_then(|v| v.to_str().ok())
15413        .unwrap_or("application/octet-stream");
15414    let content_type = super::ContentType::from(content_type);
15415
15416    if !status.is_client_error() && !status.is_server_error() {
15417        let content = resp.text().await?;
15418        match content_type {
15419            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
15420            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IpAccessControlListResponse`"))),
15421            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IpAccessControlListResponse`")))),
15422        }
15423    } else {
15424        let content = resp.text().await?;
15425        let entity: Option<UpdateIpAccessControlListWithIdError> = serde_json::from_str(&content).ok();
15426        Err(Error::ResponseError(ResponseContent { status, content, entity }))
15427    }
15428}
15429
15430/// Updates the key with the given Id.
15431pub async fn update_key_with_id(configuration: &configuration::Configuration, key_id: &str, key_request: Option<models::KeyRequest>) -> Result<models::KeyResponse, Error<UpdateKeyWithIdError>> {
15432    // add a prefix to parameters to efficiently prevent name collisions
15433    let p_key_id = key_id;
15434    let p_key_request = key_request;
15435
15436    let uri_str = format!("{}/api/key/{keyId}", configuration.base_path, keyId=crate::apis::urlencode(p_key_id));
15437    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
15438
15439    if let Some(ref user_agent) = configuration.user_agent {
15440        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
15441    }
15442    if let Some(ref apikey) = configuration.api_key {
15443        let key = apikey.key.clone();
15444        let value = match apikey.prefix {
15445            Some(ref prefix) => format!("{} {}", prefix, key),
15446            None => key,
15447        };
15448        req_builder = req_builder.header("Authorization", value);
15449    };
15450    req_builder = req_builder.json(&p_key_request);
15451
15452    let req = req_builder.build()?;
15453    let resp = configuration.client.execute(req).await?;
15454
15455    let status = resp.status();
15456    let content_type = resp
15457        .headers()
15458        .get("content-type")
15459        .and_then(|v| v.to_str().ok())
15460        .unwrap_or("application/octet-stream");
15461    let content_type = super::ContentType::from(content_type);
15462
15463    if !status.is_client_error() && !status.is_server_error() {
15464        let content = resp.text().await?;
15465        match content_type {
15466            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
15467            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::KeyResponse`"))),
15468            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::KeyResponse`")))),
15469        }
15470    } else {
15471        let content = resp.text().await?;
15472        let entity: Option<UpdateKeyWithIdError> = serde_json::from_str(&content).ok();
15473        Err(Error::ResponseError(ResponseContent { status, content, entity }))
15474    }
15475}
15476
15477/// Updates the lambda with the given Id.
15478pub async fn update_lambda_with_id(configuration: &configuration::Configuration, lambda_id: &str, lambda_request: Option<models::LambdaRequest>) -> Result<models::LambdaResponse, Error<UpdateLambdaWithIdError>> {
15479    // add a prefix to parameters to efficiently prevent name collisions
15480    let p_lambda_id = lambda_id;
15481    let p_lambda_request = lambda_request;
15482
15483    let uri_str = format!("{}/api/lambda/{lambdaId}", configuration.base_path, lambdaId=crate::apis::urlencode(p_lambda_id));
15484    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
15485
15486    if let Some(ref user_agent) = configuration.user_agent {
15487        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
15488    }
15489    if let Some(ref apikey) = configuration.api_key {
15490        let key = apikey.key.clone();
15491        let value = match apikey.prefix {
15492            Some(ref prefix) => format!("{} {}", prefix, key),
15493            None => key,
15494        };
15495        req_builder = req_builder.header("Authorization", value);
15496    };
15497    req_builder = req_builder.json(&p_lambda_request);
15498
15499    let req = req_builder.build()?;
15500    let resp = configuration.client.execute(req).await?;
15501
15502    let status = resp.status();
15503    let content_type = resp
15504        .headers()
15505        .get("content-type")
15506        .and_then(|v| v.to_str().ok())
15507        .unwrap_or("application/octet-stream");
15508    let content_type = super::ContentType::from(content_type);
15509
15510    if !status.is_client_error() && !status.is_server_error() {
15511        let content = resp.text().await?;
15512        match content_type {
15513            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
15514            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::LambdaResponse`"))),
15515            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::LambdaResponse`")))),
15516        }
15517    } else {
15518        let content = resp.text().await?;
15519        let entity: Option<UpdateLambdaWithIdError> = serde_json::from_str(&content).ok();
15520        Err(Error::ResponseError(ResponseContent { status, content, entity }))
15521    }
15522}
15523
15524/// Updates the message template with the given Id.
15525pub async fn update_message_template_with_id(configuration: &configuration::Configuration, message_template_id: &str, message_template_request: Option<models::MessageTemplateRequest>) -> Result<models::MessageTemplateResponse, Error<UpdateMessageTemplateWithIdError>> {
15526    // add a prefix to parameters to efficiently prevent name collisions
15527    let p_message_template_id = message_template_id;
15528    let p_message_template_request = message_template_request;
15529
15530    let uri_str = format!("{}/api/message/template/{messageTemplateId}", configuration.base_path, messageTemplateId=crate::apis::urlencode(p_message_template_id));
15531    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
15532
15533    if let Some(ref user_agent) = configuration.user_agent {
15534        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
15535    }
15536    if let Some(ref apikey) = configuration.api_key {
15537        let key = apikey.key.clone();
15538        let value = match apikey.prefix {
15539            Some(ref prefix) => format!("{} {}", prefix, key),
15540            None => key,
15541        };
15542        req_builder = req_builder.header("Authorization", value);
15543    };
15544    req_builder = req_builder.json(&p_message_template_request);
15545
15546    let req = req_builder.build()?;
15547    let resp = configuration.client.execute(req).await?;
15548
15549    let status = resp.status();
15550    let content_type = resp
15551        .headers()
15552        .get("content-type")
15553        .and_then(|v| v.to_str().ok())
15554        .unwrap_or("application/octet-stream");
15555    let content_type = super::ContentType::from(content_type);
15556
15557    if !status.is_client_error() && !status.is_server_error() {
15558        let content = resp.text().await?;
15559        match content_type {
15560            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
15561            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::MessageTemplateResponse`"))),
15562            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::MessageTemplateResponse`")))),
15563        }
15564    } else {
15565        let content = resp.text().await?;
15566        let entity: Option<UpdateMessageTemplateWithIdError> = serde_json::from_str(&content).ok();
15567        Err(Error::ResponseError(ResponseContent { status, content, entity }))
15568    }
15569}
15570
15571/// Updates the messenger with the given Id.
15572pub async fn update_messenger_with_id(configuration: &configuration::Configuration, messenger_id: &str, messenger_request: Option<models::MessengerRequest>) -> Result<models::MessengerResponse, Error<UpdateMessengerWithIdError>> {
15573    // add a prefix to parameters to efficiently prevent name collisions
15574    let p_messenger_id = messenger_id;
15575    let p_messenger_request = messenger_request;
15576
15577    let uri_str = format!("{}/api/messenger/{messengerId}", configuration.base_path, messengerId=crate::apis::urlencode(p_messenger_id));
15578    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
15579
15580    if let Some(ref user_agent) = configuration.user_agent {
15581        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
15582    }
15583    if let Some(ref apikey) = configuration.api_key {
15584        let key = apikey.key.clone();
15585        let value = match apikey.prefix {
15586            Some(ref prefix) => format!("{} {}", prefix, key),
15587            None => key,
15588        };
15589        req_builder = req_builder.header("Authorization", value);
15590    };
15591    req_builder = req_builder.json(&p_messenger_request);
15592
15593    let req = req_builder.build()?;
15594    let resp = configuration.client.execute(req).await?;
15595
15596    let status = resp.status();
15597    let content_type = resp
15598        .headers()
15599        .get("content-type")
15600        .and_then(|v| v.to_str().ok())
15601        .unwrap_or("application/octet-stream");
15602    let content_type = super::ContentType::from(content_type);
15603
15604    if !status.is_client_error() && !status.is_server_error() {
15605        let content = resp.text().await?;
15606        match content_type {
15607            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
15608            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::MessengerResponse`"))),
15609            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::MessengerResponse`")))),
15610        }
15611    } else {
15612        let content = resp.text().await?;
15613        let entity: Option<UpdateMessengerWithIdError> = serde_json::from_str(&content).ok();
15614        Err(Error::ResponseError(ResponseContent { status, content, entity }))
15615    }
15616}
15617
15618/// Updates the OAuth scope with the given Id for the application.
15619pub async fn update_o_auth_scope_with_id(configuration: &configuration::Configuration, application_id: &str, scope_id: &str, x_fusion_auth_tenant_id: Option<&str>, application_o_auth_scope_request: Option<models::ApplicationOAuthScopeRequest>) -> Result<models::ApplicationOAuthScopeResponse, Error<UpdateOAuthScopeWithIdError>> {
15620    // add a prefix to parameters to efficiently prevent name collisions
15621    let p_application_id = application_id;
15622    let p_scope_id = scope_id;
15623    let p_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
15624    let p_application_o_auth_scope_request = application_o_auth_scope_request;
15625
15626    let uri_str = format!("{}/api/application/{applicationId}/scope/{scopeId}", configuration.base_path, applicationId=crate::apis::urlencode(p_application_id), scopeId=crate::apis::urlencode(p_scope_id));
15627    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
15628
15629    if let Some(ref user_agent) = configuration.user_agent {
15630        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
15631    }
15632    if let Some(param_value) = p_x_fusion_auth_tenant_id {
15633        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
15634    }
15635    if let Some(ref apikey) = configuration.api_key {
15636        let key = apikey.key.clone();
15637        let value = match apikey.prefix {
15638            Some(ref prefix) => format!("{} {}", prefix, key),
15639            None => key,
15640        };
15641        req_builder = req_builder.header("Authorization", value);
15642    };
15643    req_builder = req_builder.json(&p_application_o_auth_scope_request);
15644
15645    let req = req_builder.build()?;
15646    let resp = configuration.client.execute(req).await?;
15647
15648    let status = resp.status();
15649    let content_type = resp
15650        .headers()
15651        .get("content-type")
15652        .and_then(|v| v.to_str().ok())
15653        .unwrap_or("application/octet-stream");
15654    let content_type = super::ContentType::from(content_type);
15655
15656    if !status.is_client_error() && !status.is_server_error() {
15657        let content = resp.text().await?;
15658        match content_type {
15659            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
15660            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ApplicationOAuthScopeResponse`"))),
15661            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ApplicationOAuthScopeResponse`")))),
15662        }
15663    } else {
15664        let content = resp.text().await?;
15665        let entity: Option<UpdateOAuthScopeWithIdError> = serde_json::from_str(&content).ok();
15666        Err(Error::ResponseError(ResponseContent { status, content, entity }))
15667    }
15668}
15669
15670/// Updates the registration for the user with the given Id and the application defined in the request.
15671pub async fn update_registration_with_id(configuration: &configuration::Configuration, user_id: &str, x_fusion_auth_tenant_id: Option<&str>, registration_request: Option<models::RegistrationRequest>) -> Result<models::RegistrationResponse, Error<UpdateRegistrationWithIdError>> {
15672    // add a prefix to parameters to efficiently prevent name collisions
15673    let p_user_id = user_id;
15674    let p_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
15675    let p_registration_request = registration_request;
15676
15677    let uri_str = format!("{}/api/user/registration/{userId}", configuration.base_path, userId=crate::apis::urlencode(p_user_id));
15678    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
15679
15680    if let Some(ref user_agent) = configuration.user_agent {
15681        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
15682    }
15683    if let Some(param_value) = p_x_fusion_auth_tenant_id {
15684        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
15685    }
15686    if let Some(ref apikey) = configuration.api_key {
15687        let key = apikey.key.clone();
15688        let value = match apikey.prefix {
15689            Some(ref prefix) => format!("{} {}", prefix, key),
15690            None => key,
15691        };
15692        req_builder = req_builder.header("Authorization", value);
15693    };
15694    req_builder = req_builder.json(&p_registration_request);
15695
15696    let req = req_builder.build()?;
15697    let resp = configuration.client.execute(req).await?;
15698
15699    let status = resp.status();
15700    let content_type = resp
15701        .headers()
15702        .get("content-type")
15703        .and_then(|v| v.to_str().ok())
15704        .unwrap_or("application/octet-stream");
15705    let content_type = super::ContentType::from(content_type);
15706
15707    if !status.is_client_error() && !status.is_server_error() {
15708        let content = resp.text().await?;
15709        match content_type {
15710            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
15711            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::RegistrationResponse`"))),
15712            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::RegistrationResponse`")))),
15713        }
15714    } else {
15715        let content = resp.text().await?;
15716        let entity: Option<UpdateRegistrationWithIdError> = serde_json::from_str(&content).ok();
15717        Err(Error::ResponseError(ResponseContent { status, content, entity }))
15718    }
15719}
15720
15721/// Updates the system configuration.
15722pub async fn update_system_configuration_with_id(configuration: &configuration::Configuration, system_configuration_request: Option<models::SystemConfigurationRequest>) -> Result<models::SystemConfigurationResponse, Error<UpdateSystemConfigurationWithIdError>> {
15723    // add a prefix to parameters to efficiently prevent name collisions
15724    let p_system_configuration_request = system_configuration_request;
15725
15726    let uri_str = format!("{}/api/system-configuration", configuration.base_path);
15727    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
15728
15729    if let Some(ref user_agent) = configuration.user_agent {
15730        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
15731    }
15732    if let Some(ref apikey) = configuration.api_key {
15733        let key = apikey.key.clone();
15734        let value = match apikey.prefix {
15735            Some(ref prefix) => format!("{} {}", prefix, key),
15736            None => key,
15737        };
15738        req_builder = req_builder.header("Authorization", value);
15739    };
15740    req_builder = req_builder.json(&p_system_configuration_request);
15741
15742    let req = req_builder.build()?;
15743    let resp = configuration.client.execute(req).await?;
15744
15745    let status = resp.status();
15746    let content_type = resp
15747        .headers()
15748        .get("content-type")
15749        .and_then(|v| v.to_str().ok())
15750        .unwrap_or("application/octet-stream");
15751    let content_type = super::ContentType::from(content_type);
15752
15753    if !status.is_client_error() && !status.is_server_error() {
15754        let content = resp.text().await?;
15755        match content_type {
15756            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
15757            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::SystemConfigurationResponse`"))),
15758            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::SystemConfigurationResponse`")))),
15759        }
15760    } else {
15761        let content = resp.text().await?;
15762        let entity: Option<UpdateSystemConfigurationWithIdError> = serde_json::from_str(&content).ok();
15763        Err(Error::ResponseError(ResponseContent { status, content, entity }))
15764    }
15765}
15766
15767/// Updates the tenant with the given Id.
15768pub async fn update_tenant_with_id(configuration: &configuration::Configuration, tenant_id: &str, x_fusion_auth_tenant_id: Option<&str>, tenant_request: Option<models::TenantRequest>) -> Result<models::TenantResponse, Error<UpdateTenantWithIdError>> {
15769    // add a prefix to parameters to efficiently prevent name collisions
15770    let p_tenant_id = tenant_id;
15771    let p_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
15772    let p_tenant_request = tenant_request;
15773
15774    let uri_str = format!("{}/api/tenant/{tenantId}", configuration.base_path, tenantId=crate::apis::urlencode(p_tenant_id));
15775    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
15776
15777    if let Some(ref user_agent) = configuration.user_agent {
15778        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
15779    }
15780    if let Some(param_value) = p_x_fusion_auth_tenant_id {
15781        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
15782    }
15783    if let Some(ref apikey) = configuration.api_key {
15784        let key = apikey.key.clone();
15785        let value = match apikey.prefix {
15786            Some(ref prefix) => format!("{} {}", prefix, key),
15787            None => key,
15788        };
15789        req_builder = req_builder.header("Authorization", value);
15790    };
15791    req_builder = req_builder.json(&p_tenant_request);
15792
15793    let req = req_builder.build()?;
15794    let resp = configuration.client.execute(req).await?;
15795
15796    let status = resp.status();
15797    let content_type = resp
15798        .headers()
15799        .get("content-type")
15800        .and_then(|v| v.to_str().ok())
15801        .unwrap_or("application/octet-stream");
15802    let content_type = super::ContentType::from(content_type);
15803
15804    if !status.is_client_error() && !status.is_server_error() {
15805        let content = resp.text().await?;
15806        match content_type {
15807            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
15808            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::TenantResponse`"))),
15809            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::TenantResponse`")))),
15810        }
15811    } else {
15812        let content = resp.text().await?;
15813        let entity: Option<UpdateTenantWithIdError> = serde_json::from_str(&content).ok();
15814        Err(Error::ResponseError(ResponseContent { status, content, entity }))
15815    }
15816}
15817
15818/// Updates the theme with the given Id.
15819pub async fn update_theme_with_id(configuration: &configuration::Configuration, theme_id: &str, theme_request: Option<models::ThemeRequest>) -> Result<models::ThemeResponse, Error<UpdateThemeWithIdError>> {
15820    // add a prefix to parameters to efficiently prevent name collisions
15821    let p_theme_id = theme_id;
15822    let p_theme_request = theme_request;
15823
15824    let uri_str = format!("{}/api/theme/{themeId}", configuration.base_path, themeId=crate::apis::urlencode(p_theme_id));
15825    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
15826
15827    if let Some(ref user_agent) = configuration.user_agent {
15828        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
15829    }
15830    if let Some(ref apikey) = configuration.api_key {
15831        let key = apikey.key.clone();
15832        let value = match apikey.prefix {
15833            Some(ref prefix) => format!("{} {}", prefix, key),
15834            None => key,
15835        };
15836        req_builder = req_builder.header("Authorization", value);
15837    };
15838    req_builder = req_builder.json(&p_theme_request);
15839
15840    let req = req_builder.build()?;
15841    let resp = configuration.client.execute(req).await?;
15842
15843    let status = resp.status();
15844    let content_type = resp
15845        .headers()
15846        .get("content-type")
15847        .and_then(|v| v.to_str().ok())
15848        .unwrap_or("application/octet-stream");
15849    let content_type = super::ContentType::from(content_type);
15850
15851    if !status.is_client_error() && !status.is_server_error() {
15852        let content = resp.text().await?;
15853        match content_type {
15854            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
15855            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ThemeResponse`"))),
15856            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ThemeResponse`")))),
15857        }
15858    } else {
15859        let content = resp.text().await?;
15860        let entity: Option<UpdateThemeWithIdError> = serde_json::from_str(&content).ok();
15861        Err(Error::ResponseError(ResponseContent { status, content, entity }))
15862    }
15863}
15864
15865/// Updates the user action reason with the given Id.
15866pub async fn update_user_action_reason_with_id(configuration: &configuration::Configuration, user_action_reason_id: &str, user_action_reason_request: Option<models::UserActionReasonRequest>) -> Result<models::UserActionReasonResponse, Error<UpdateUserActionReasonWithIdError>> {
15867    // add a prefix to parameters to efficiently prevent name collisions
15868    let p_user_action_reason_id = user_action_reason_id;
15869    let p_user_action_reason_request = user_action_reason_request;
15870
15871    let uri_str = format!("{}/api/user-action-reason/{userActionReasonId}", configuration.base_path, userActionReasonId=crate::apis::urlencode(p_user_action_reason_id));
15872    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
15873
15874    if let Some(ref user_agent) = configuration.user_agent {
15875        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
15876    }
15877    if let Some(ref apikey) = configuration.api_key {
15878        let key = apikey.key.clone();
15879        let value = match apikey.prefix {
15880            Some(ref prefix) => format!("{} {}", prefix, key),
15881            None => key,
15882        };
15883        req_builder = req_builder.header("Authorization", value);
15884    };
15885    req_builder = req_builder.json(&p_user_action_reason_request);
15886
15887    let req = req_builder.build()?;
15888    let resp = configuration.client.execute(req).await?;
15889
15890    let status = resp.status();
15891    let content_type = resp
15892        .headers()
15893        .get("content-type")
15894        .and_then(|v| v.to_str().ok())
15895        .unwrap_or("application/octet-stream");
15896    let content_type = super::ContentType::from(content_type);
15897
15898    if !status.is_client_error() && !status.is_server_error() {
15899        let content = resp.text().await?;
15900        match content_type {
15901            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
15902            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::UserActionReasonResponse`"))),
15903            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::UserActionReasonResponse`")))),
15904        }
15905    } else {
15906        let content = resp.text().await?;
15907        let entity: Option<UpdateUserActionReasonWithIdError> = serde_json::from_str(&content).ok();
15908        Err(Error::ResponseError(ResponseContent { status, content, entity }))
15909    }
15910}
15911
15912/// Reactivates the user action with the given Id. OR Updates the user action with the given Id.
15913pub async fn update_user_action_with_id(configuration: &configuration::Configuration, user_action_id: &str, reactivate: Option<&str>, x_fusion_auth_tenant_id: Option<&str>, user_action_request: Option<models::UserActionRequest>) -> Result<models::UserActionResponse, Error<UpdateUserActionWithIdError>> {
15914    // add a prefix to parameters to efficiently prevent name collisions
15915    let p_user_action_id = user_action_id;
15916    let p_reactivate = reactivate;
15917    let p_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
15918    let p_user_action_request = user_action_request;
15919
15920    let uri_str = format!("{}/api/user-action/{userActionId}", configuration.base_path, userActionId=crate::apis::urlencode(p_user_action_id));
15921    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
15922
15923    if let Some(ref param_value) = p_reactivate {
15924        req_builder = req_builder.query(&[("reactivate", &param_value.to_string())]);
15925    }
15926    if let Some(ref user_agent) = configuration.user_agent {
15927        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
15928    }
15929    if let Some(param_value) = p_x_fusion_auth_tenant_id {
15930        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
15931    }
15932    if let Some(ref apikey) = configuration.api_key {
15933        let key = apikey.key.clone();
15934        let value = match apikey.prefix {
15935            Some(ref prefix) => format!("{} {}", prefix, key),
15936            None => key,
15937        };
15938        req_builder = req_builder.header("Authorization", value);
15939    };
15940    req_builder = req_builder.json(&p_user_action_request);
15941
15942    let req = req_builder.build()?;
15943    let resp = configuration.client.execute(req).await?;
15944
15945    let status = resp.status();
15946    let content_type = resp
15947        .headers()
15948        .get("content-type")
15949        .and_then(|v| v.to_str().ok())
15950        .unwrap_or("application/octet-stream");
15951    let content_type = super::ContentType::from(content_type);
15952
15953    if !status.is_client_error() && !status.is_server_error() {
15954        let content = resp.text().await?;
15955        match content_type {
15956            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
15957            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::UserActionResponse`"))),
15958            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::UserActionResponse`")))),
15959        }
15960    } else {
15961        let content = resp.text().await?;
15962        let entity: Option<UpdateUserActionWithIdError> = serde_json::from_str(&content).ok();
15963        Err(Error::ResponseError(ResponseContent { status, content, entity }))
15964    }
15965}
15966
15967/// Updates a single User consent by Id.
15968pub async fn update_user_consent_with_id(configuration: &configuration::Configuration, user_consent_id: &str, user_consent_request: Option<models::UserConsentRequest>) -> Result<models::UserConsentResponse, Error<UpdateUserConsentWithIdError>> {
15969    // add a prefix to parameters to efficiently prevent name collisions
15970    let p_user_consent_id = user_consent_id;
15971    let p_user_consent_request = user_consent_request;
15972
15973    let uri_str = format!("{}/api/user/consent/{userConsentId}", configuration.base_path, userConsentId=crate::apis::urlencode(p_user_consent_id));
15974    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
15975
15976    if let Some(ref user_agent) = configuration.user_agent {
15977        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
15978    }
15979    if let Some(ref apikey) = configuration.api_key {
15980        let key = apikey.key.clone();
15981        let value = match apikey.prefix {
15982            Some(ref prefix) => format!("{} {}", prefix, key),
15983            None => key,
15984        };
15985        req_builder = req_builder.header("Authorization", value);
15986    };
15987    req_builder = req_builder.json(&p_user_consent_request);
15988
15989    let req = req_builder.build()?;
15990    let resp = configuration.client.execute(req).await?;
15991
15992    let status = resp.status();
15993    let content_type = resp
15994        .headers()
15995        .get("content-type")
15996        .and_then(|v| v.to_str().ok())
15997        .unwrap_or("application/octet-stream");
15998    let content_type = super::ContentType::from(content_type);
15999
16000    if !status.is_client_error() && !status.is_server_error() {
16001        let content = resp.text().await?;
16002        match content_type {
16003            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
16004            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::UserConsentResponse`"))),
16005            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::UserConsentResponse`")))),
16006        }
16007    } else {
16008        let content = resp.text().await?;
16009        let entity: Option<UpdateUserConsentWithIdError> = serde_json::from_str(&content).ok();
16010        Err(Error::ResponseError(ResponseContent { status, content, entity }))
16011    }
16012}
16013
16014/// Updates a family with a given Id. OR Adds a user to an existing family. The family Id must be specified.
16015pub async fn update_user_family_with_id(configuration: &configuration::Configuration, family_id: &str, x_fusion_auth_tenant_id: Option<&str>, family_request: Option<models::FamilyRequest>) -> Result<models::FamilyResponse, Error<UpdateUserFamilyWithIdError>> {
16016    // add a prefix to parameters to efficiently prevent name collisions
16017    let p_family_id = family_id;
16018    let p_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
16019    let p_family_request = family_request;
16020
16021    let uri_str = format!("{}/api/user/family/{familyId}", configuration.base_path, familyId=crate::apis::urlencode(p_family_id));
16022    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
16023
16024    if let Some(ref user_agent) = configuration.user_agent {
16025        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
16026    }
16027    if let Some(param_value) = p_x_fusion_auth_tenant_id {
16028        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
16029    }
16030    if let Some(ref apikey) = configuration.api_key {
16031        let key = apikey.key.clone();
16032        let value = match apikey.prefix {
16033            Some(ref prefix) => format!("{} {}", prefix, key),
16034            None => key,
16035        };
16036        req_builder = req_builder.header("Authorization", value);
16037    };
16038    req_builder = req_builder.json(&p_family_request);
16039
16040    let req = req_builder.build()?;
16041    let resp = configuration.client.execute(req).await?;
16042
16043    let status = resp.status();
16044    let content_type = resp
16045        .headers()
16046        .get("content-type")
16047        .and_then(|v| v.to_str().ok())
16048        .unwrap_or("application/octet-stream");
16049    let content_type = super::ContentType::from(content_type);
16050
16051    if !status.is_client_error() && !status.is_server_error() {
16052        let content = resp.text().await?;
16053        match content_type {
16054            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
16055            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::FamilyResponse`"))),
16056            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::FamilyResponse`")))),
16057        }
16058    } else {
16059        let content = resp.text().await?;
16060        let entity: Option<UpdateUserFamilyWithIdError> = serde_json::from_str(&content).ok();
16061        Err(Error::ResponseError(ResponseContent { status, content, entity }))
16062    }
16063}
16064
16065/// Re-sends the verification email to the user. OR Re-sends the verification email to the user. If the Application has configured a specific email template this will be used instead of the tenant configuration. OR Generate a new Email Verification Id to be used with the Verify Email API. This API will not attempt to send an email to the User. This API may be used to collect the verificationId for use with a third party system.
16066pub async fn update_user_verify_email(configuration: &configuration::Configuration, email: Option<&str>, application_id: Option<&str>, send_verify_email: Option<&str>) -> Result<models::VerifyEmailResponse, Error<UpdateUserVerifyEmailError>> {
16067    // add a prefix to parameters to efficiently prevent name collisions
16068    let p_email = email;
16069    let p_application_id = application_id;
16070    let p_send_verify_email = send_verify_email;
16071
16072    let uri_str = format!("{}/api/user/verify-email", configuration.base_path);
16073    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
16074
16075    if let Some(ref param_value) = p_email {
16076        req_builder = req_builder.query(&[("email", &param_value.to_string())]);
16077    }
16078    if let Some(ref param_value) = p_application_id {
16079        req_builder = req_builder.query(&[("applicationId", &param_value.to_string())]);
16080    }
16081    if let Some(ref param_value) = p_send_verify_email {
16082        req_builder = req_builder.query(&[("sendVerifyEmail", &param_value.to_string())]);
16083    }
16084    if let Some(ref user_agent) = configuration.user_agent {
16085        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
16086    }
16087    if let Some(ref apikey) = configuration.api_key {
16088        let key = apikey.key.clone();
16089        let value = match apikey.prefix {
16090            Some(ref prefix) => format!("{} {}", prefix, key),
16091            None => key,
16092        };
16093        req_builder = req_builder.header("Authorization", value);
16094    };
16095
16096    let req = req_builder.build()?;
16097    let resp = configuration.client.execute(req).await?;
16098
16099    let status = resp.status();
16100    let content_type = resp
16101        .headers()
16102        .get("content-type")
16103        .and_then(|v| v.to_str().ok())
16104        .unwrap_or("application/octet-stream");
16105    let content_type = super::ContentType::from(content_type);
16106
16107    if !status.is_client_error() && !status.is_server_error() {
16108        let content = resp.text().await?;
16109        match content_type {
16110            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
16111            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::VerifyEmailResponse`"))),
16112            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::VerifyEmailResponse`")))),
16113        }
16114    } else {
16115        let content = resp.text().await?;
16116        let entity: Option<UpdateUserVerifyEmailError> = serde_json::from_str(&content).ok();
16117        Err(Error::ResponseError(ResponseContent { status, content, entity }))
16118    }
16119}
16120
16121/// Generate a new Application Registration Verification Id to be used with the Verify Registration API. This API will not attempt to send an email to the User. This API may be used to collect the verificationId for use with a third party system. OR Re-sends the application registration verification email to the user.
16122pub async fn update_user_verify_registration(configuration: &configuration::Configuration, email: Option<&str>, send_verify_password_email: Option<&str>, application_id: Option<&str>) -> Result<models::VerifyRegistrationResponse, Error<UpdateUserVerifyRegistrationError>> {
16123    // add a prefix to parameters to efficiently prevent name collisions
16124    let p_email = email;
16125    let p_send_verify_password_email = send_verify_password_email;
16126    let p_application_id = application_id;
16127
16128    let uri_str = format!("{}/api/user/verify-registration", configuration.base_path);
16129    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
16130
16131    if let Some(ref param_value) = p_email {
16132        req_builder = req_builder.query(&[("email", &param_value.to_string())]);
16133    }
16134    if let Some(ref param_value) = p_send_verify_password_email {
16135        req_builder = req_builder.query(&[("sendVerifyPasswordEmail", &param_value.to_string())]);
16136    }
16137    if let Some(ref param_value) = p_application_id {
16138        req_builder = req_builder.query(&[("applicationId", &param_value.to_string())]);
16139    }
16140    if let Some(ref user_agent) = configuration.user_agent {
16141        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
16142    }
16143    if let Some(ref apikey) = configuration.api_key {
16144        let key = apikey.key.clone();
16145        let value = match apikey.prefix {
16146            Some(ref prefix) => format!("{} {}", prefix, key),
16147            None => key,
16148        };
16149        req_builder = req_builder.header("Authorization", value);
16150    };
16151
16152    let req = req_builder.build()?;
16153    let resp = configuration.client.execute(req).await?;
16154
16155    let status = resp.status();
16156    let content_type = resp
16157        .headers()
16158        .get("content-type")
16159        .and_then(|v| v.to_str().ok())
16160        .unwrap_or("application/octet-stream");
16161    let content_type = super::ContentType::from(content_type);
16162
16163    if !status.is_client_error() && !status.is_server_error() {
16164        let content = resp.text().await?;
16165        match content_type {
16166            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
16167            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::VerifyRegistrationResponse`"))),
16168            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::VerifyRegistrationResponse`")))),
16169        }
16170    } else {
16171        let content = resp.text().await?;
16172        let entity: Option<UpdateUserVerifyRegistrationError> = serde_json::from_str(&content).ok();
16173        Err(Error::ResponseError(ResponseContent { status, content, entity }))
16174    }
16175}
16176
16177/// Reactivates the user with the given Id. OR Updates the user with the given Id.
16178pub async fn update_user_with_id(configuration: &configuration::Configuration, user_id: &str, reactivate: Option<&str>, x_fusion_auth_tenant_id: Option<&str>, user_request: Option<models::UserRequest>) -> Result<models::UserResponse, Error<UpdateUserWithIdError>> {
16179    // add a prefix to parameters to efficiently prevent name collisions
16180    let p_user_id = user_id;
16181    let p_reactivate = reactivate;
16182    let p_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
16183    let p_user_request = user_request;
16184
16185    let uri_str = format!("{}/api/user/{userId}", configuration.base_path, userId=crate::apis::urlencode(p_user_id));
16186    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
16187
16188    if let Some(ref param_value) = p_reactivate {
16189        req_builder = req_builder.query(&[("reactivate", &param_value.to_string())]);
16190    }
16191    if let Some(ref user_agent) = configuration.user_agent {
16192        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
16193    }
16194    if let Some(param_value) = p_x_fusion_auth_tenant_id {
16195        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
16196    }
16197    if let Some(ref apikey) = configuration.api_key {
16198        let key = apikey.key.clone();
16199        let value = match apikey.prefix {
16200            Some(ref prefix) => format!("{} {}", prefix, key),
16201            None => key,
16202        };
16203        req_builder = req_builder.header("Authorization", value);
16204    };
16205    req_builder = req_builder.json(&p_user_request);
16206
16207    let req = req_builder.build()?;
16208    let resp = configuration.client.execute(req).await?;
16209
16210    let status = resp.status();
16211    let content_type = resp
16212        .headers()
16213        .get("content-type")
16214        .and_then(|v| v.to_str().ok())
16215        .unwrap_or("application/octet-stream");
16216    let content_type = super::ContentType::from(content_type);
16217
16218    if !status.is_client_error() && !status.is_server_error() {
16219        let content = resp.text().await?;
16220        match content_type {
16221            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
16222            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::UserResponse`"))),
16223            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::UserResponse`")))),
16224        }
16225    } else {
16226        let content = resp.text().await?;
16227        let entity: Option<UpdateUserWithIdError> = serde_json::from_str(&content).ok();
16228        Err(Error::ResponseError(ResponseContent { status, content, entity }))
16229    }
16230}
16231
16232/// Updates the webhook with the given Id.
16233pub async fn update_webhook_with_id(configuration: &configuration::Configuration, webhook_id: &str, webhook_request: Option<models::WebhookRequest>) -> Result<models::WebhookResponse, Error<UpdateWebhookWithIdError>> {
16234    // add a prefix to parameters to efficiently prevent name collisions
16235    let p_webhook_id = webhook_id;
16236    let p_webhook_request = webhook_request;
16237
16238    let uri_str = format!("{}/api/webhook/{webhookId}", configuration.base_path, webhookId=crate::apis::urlencode(p_webhook_id));
16239    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
16240
16241    if let Some(ref user_agent) = configuration.user_agent {
16242        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
16243    }
16244    if let Some(ref apikey) = configuration.api_key {
16245        let key = apikey.key.clone();
16246        let value = match apikey.prefix {
16247            Some(ref prefix) => format!("{} {}", prefix, key),
16248            None => key,
16249        };
16250        req_builder = req_builder.header("Authorization", value);
16251    };
16252    req_builder = req_builder.json(&p_webhook_request);
16253
16254    let req = req_builder.build()?;
16255    let resp = configuration.client.execute(req).await?;
16256
16257    let status = resp.status();
16258    let content_type = resp
16259        .headers()
16260        .get("content-type")
16261        .and_then(|v| v.to_str().ok())
16262        .unwrap_or("application/octet-stream");
16263    let content_type = super::ContentType::from(content_type);
16264
16265    if !status.is_client_error() && !status.is_server_error() {
16266        let content = resp.text().await?;
16267        match content_type {
16268            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
16269            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::WebhookResponse`"))),
16270            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::WebhookResponse`")))),
16271        }
16272    } else {
16273        let content = resp.text().await?;
16274        let entity: Option<UpdateWebhookWithIdError> = serde_json::from_str(&content).ok();
16275        Err(Error::ResponseError(ResponseContent { status, content, entity }))
16276    }
16277}
16278
16279/// Creates or updates an Entity Grant. This is when a User/Entity is granted permissions to an Entity.
16280pub async fn upsert_entity_grant_with_id(configuration: &configuration::Configuration, entity_id: &str, x_fusion_auth_tenant_id: Option<&str>, entity_grant_request: Option<models::EntityGrantRequest>) -> Result<(), Error<UpsertEntityGrantWithIdError>> {
16281    // add a prefix to parameters to efficiently prevent name collisions
16282    let p_entity_id = entity_id;
16283    let p_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
16284    let p_entity_grant_request = entity_grant_request;
16285
16286    let uri_str = format!("{}/api/entity/{entityId}/grant", configuration.base_path, entityId=crate::apis::urlencode(p_entity_id));
16287    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
16288
16289    if let Some(ref user_agent) = configuration.user_agent {
16290        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
16291    }
16292    if let Some(param_value) = p_x_fusion_auth_tenant_id {
16293        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
16294    }
16295    if let Some(ref apikey) = configuration.api_key {
16296        let key = apikey.key.clone();
16297        let value = match apikey.prefix {
16298            Some(ref prefix) => format!("{} {}", prefix, key),
16299            None => key,
16300        };
16301        req_builder = req_builder.header("Authorization", value);
16302    };
16303    req_builder = req_builder.json(&p_entity_grant_request);
16304
16305    let req = req_builder.build()?;
16306    let resp = configuration.client.execute(req).await?;
16307
16308    let status = resp.status();
16309
16310    if !status.is_client_error() && !status.is_server_error() {
16311        Ok(())
16312    } else {
16313        let content = resp.text().await?;
16314        let entity: Option<UpsertEntityGrantWithIdError> = serde_json::from_str(&content).ok();
16315        Err(Error::ResponseError(ResponseContent { status, content, entity }))
16316    }
16317}
16318
16319/// Validates the end-user provided user_code from the user-interaction of the Device Authorization Grant. If you build your own activation form you should validate the user provided code prior to beginning the Authorization grant.
16320pub async fn validate_device_with_id(configuration: &configuration::Configuration, user_code: Option<&str>, client_id: Option<&str>) -> Result<(), Error<ValidateDeviceWithIdError>> {
16321    // add a prefix to parameters to efficiently prevent name collisions
16322    let p_user_code = user_code;
16323    let p_client_id = client_id;
16324
16325    let uri_str = format!("{}/oauth2/device/validate", configuration.base_path);
16326    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
16327
16328    if let Some(ref param_value) = p_user_code {
16329        req_builder = req_builder.query(&[("user_code", &param_value.to_string())]);
16330    }
16331    if let Some(ref param_value) = p_client_id {
16332        req_builder = req_builder.query(&[("client_id", &param_value.to_string())]);
16333    }
16334    if let Some(ref user_agent) = configuration.user_agent {
16335        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
16336    }
16337    if let Some(ref apikey) = configuration.api_key {
16338        let key = apikey.key.clone();
16339        let value = match apikey.prefix {
16340            Some(ref prefix) => format!("{} {}", prefix, key),
16341            None => key,
16342        };
16343        req_builder = req_builder.header("Authorization", value);
16344    };
16345
16346    let req = req_builder.build()?;
16347    let resp = configuration.client.execute(req).await?;
16348
16349    let status = resp.status();
16350
16351    if !status.is_client_error() && !status.is_server_error() {
16352        Ok(())
16353    } else {
16354        let content = resp.text().await?;
16355        let entity: Option<ValidateDeviceWithIdError> = serde_json::from_str(&content).ok();
16356        Err(Error::ResponseError(ResponseContent { status, content, entity }))
16357    }
16358}
16359
16360/// Validates the provided JWT (encoded JWT string) to ensure the token is valid. A valid access token is properly signed and not expired. <p> This API may be used to verify the JWT as well as decode the encoded JWT into human readable identity claims.
16361pub async fn validate_jwt_with_id(configuration: &configuration::Configuration, ) -> Result<models::ValidateResponse, Error<ValidateJwtWithIdError>> {
16362
16363    let uri_str = format!("{}/api/jwt/validate", configuration.base_path);
16364    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
16365
16366    if let Some(ref user_agent) = configuration.user_agent {
16367        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
16368    }
16369    if let Some(ref token) = configuration.bearer_access_token {
16370        req_builder = req_builder.bearer_auth(token.to_owned());
16371    };
16372
16373    let req = req_builder.build()?;
16374    let resp = configuration.client.execute(req).await?;
16375
16376    let status = resp.status();
16377    let content_type = resp
16378        .headers()
16379        .get("content-type")
16380        .and_then(|v| v.to_str().ok())
16381        .unwrap_or("application/octet-stream");
16382    let content_type = super::ContentType::from(content_type);
16383
16384    if !status.is_client_error() && !status.is_server_error() {
16385        let content = resp.text().await?;
16386        match content_type {
16387            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
16388            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ValidateResponse`"))),
16389            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ValidateResponse`")))),
16390        }
16391    } else {
16392        let content = resp.text().await?;
16393        let entity: Option<ValidateJwtWithIdError> = serde_json::from_str(&content).ok();
16394        Err(Error::ResponseError(ResponseContent { status, content, entity }))
16395    }
16396}
16397
16398/// It's a JWT vending machine!  Issue a new access token (JWT) with the provided claims in the request. This JWT is not scoped to a tenant or user, it is a free form  token that will contain what claims you provide. <p> The iat, exp and jti claims will be added by FusionAuth, all other claims must be provided by the caller.  If a TTL is not provided in the request, the TTL will be retrieved from the default Tenant or the Tenant specified on the request either  by way of the X-FusionAuth-TenantId request header, or a tenant scoped API key.
16399pub async fn vend_jwt_with_id(configuration: &configuration::Configuration, jwt_vend_request: Option<models::JwtVendRequest>) -> Result<models::JwtVendResponse, Error<VendJwtWithIdError>> {
16400    // add a prefix to parameters to efficiently prevent name collisions
16401    let p_jwt_vend_request = jwt_vend_request;
16402
16403    let uri_str = format!("{}/api/jwt/vend", configuration.base_path);
16404    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
16405
16406    if let Some(ref user_agent) = configuration.user_agent {
16407        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
16408    }
16409    if let Some(ref apikey) = configuration.api_key {
16410        let key = apikey.key.clone();
16411        let value = match apikey.prefix {
16412            Some(ref prefix) => format!("{} {}", prefix, key),
16413            None => key,
16414        };
16415        req_builder = req_builder.header("Authorization", value);
16416    };
16417    req_builder = req_builder.json(&p_jwt_vend_request);
16418
16419    let req = req_builder.build()?;
16420    let resp = configuration.client.execute(req).await?;
16421
16422    let status = resp.status();
16423    let content_type = resp
16424        .headers()
16425        .get("content-type")
16426        .and_then(|v| v.to_str().ok())
16427        .unwrap_or("application/octet-stream");
16428    let content_type = super::ContentType::from(content_type);
16429
16430    if !status.is_client_error() && !status.is_server_error() {
16431        let content = resp.text().await?;
16432        match content_type {
16433            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
16434            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::JwtVendResponse`"))),
16435            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::JwtVendResponse`")))),
16436        }
16437    } else {
16438        let content = resp.text().await?;
16439        let entity: Option<VendJwtWithIdError> = serde_json::from_str(&content).ok();
16440        Err(Error::ResponseError(ResponseContent { status, content, entity }))
16441    }
16442}
16443
16444/// Confirms a user's registration.   The request body will contain the verificationId. You may also be required to send a one-time use code based upon your configuration. When  the application is configured to gate a user until their registration is verified, this procedures requires two values instead of one.  The verificationId is a high entropy value and the one-time use code is a low entropy value that is easily entered in a user interactive form. The  two values together are able to confirm a user's registration and mark the user's registration as verified.
16445pub async fn verify_user_registration_with_id(configuration: &configuration::Configuration, verify_registration_request: Option<models::VerifyRegistrationRequest>) -> Result<(), Error<VerifyUserRegistrationWithIdError>> {
16446    // add a prefix to parameters to efficiently prevent name collisions
16447    let p_verify_registration_request = verify_registration_request;
16448
16449    let uri_str = format!("{}/api/user/verify-registration", configuration.base_path);
16450    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
16451
16452    if let Some(ref user_agent) = configuration.user_agent {
16453        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
16454    }
16455    if let Some(ref apikey) = configuration.api_key {
16456        let key = apikey.key.clone();
16457        let value = match apikey.prefix {
16458            Some(ref prefix) => format!("{} {}", prefix, key),
16459            None => key,
16460        };
16461        req_builder = req_builder.header("Authorization", value);
16462    };
16463    req_builder = req_builder.json(&p_verify_registration_request);
16464
16465    let req = req_builder.build()?;
16466    let resp = configuration.client.execute(req).await?;
16467
16468    let status = resp.status();
16469
16470    if !status.is_client_error() && !status.is_server_error() {
16471        Ok(())
16472    } else {
16473        let content = resp.text().await?;
16474        let entity: Option<VerifyUserRegistrationWithIdError> = serde_json::from_str(&content).ok();
16475        Err(Error::ResponseError(ResponseContent { status, content, entity }))
16476    }
16477}
16478